diff --git a/.gitignore b/.gitignore index ba24b7fe39..5aaef0d51a 100644 --- a/.gitignore +++ b/.gitignore @@ -10,6 +10,10 @@ *.patch *.diff +# Ignore profiling files +callgrind.out.* +cachegrind.out.* + # ports/ should not go into release tarballs *.obj *.rc @@ -33,6 +37,9 @@ /*.tmp # vim swap files /\.*sw? +/*/*.sw? +/*/*/*.sw? +/*/*/*/*.sw? /*.vcproj* /.git /.parrot_current_rev @@ -51,6 +58,8 @@ /installable* /libparrot.def /libparrot.dll +/libparrot.dll.a +/cygparrot*.dll /miniparrot /myconfig /ops2c @@ -73,7 +82,7 @@ /parrot_nci_thunk_gen /parrot_nci_thunk_gen.c /parrot_nci_thunk_gen.pbc -/parrot_test_run.tar.gz +/parrot_old /pbc_disassemble /pbc_dump /pbc_info @@ -175,41 +184,12 @@ /examples/pir/befunge/MANIFEST /examples/pir/befunge/befunge /examples/pir/befunge/installable_befunge -/ext/Makefile -/ext/Parrot-Embed/*.bs -/ext/Parrot-Embed/*.bundle -/ext/Parrot-Embed/*.c -/ext/Parrot-Embed/*.def -/ext/Parrot-Embed/*.dll -/ext/Parrot-Embed/*.dump -/ext/Parrot-Embed/*.dylib -/ext/Parrot-Embed/*.exe -/ext/Parrot-Embed/*.exp -/ext/Parrot-Embed/*.h -/ext/Parrot-Embed/*.ilk -/ext/Parrot-Embed/*.lib -/ext/Parrot-Embed/*.manifest -/ext/Parrot-Embed/*.o -/ext/Parrot-Embed/*.obj -/ext/Parrot-Embed/*.old -/ext/Parrot-Embed/*.pdb -/ext/Parrot-Embed/*.pdb -/ext/Parrot-Embed/*.so -/ext/Parrot-Embed/*.tmp -/ext/Parrot-Embed/*.xs -/ext/Parrot-Embed/Build -/ext/Parrot-Embed/Build.bat -/ext/Parrot-Embed/Makefile -/ext/Parrot-Embed/Makefile.PL -/ext/Parrot-Embed/_build -/ext/Parrot-Embed/blib -/ext/Parrot-Embed/dll.base -/ext/Parrot-Embed/pm_to_blib -/ext/Parrot-Embed/lib/Parrot/*.c -/ext/Parrot-Embed/lib/Parrot/*.obj -/ext/Parrot-Embed/t/*.pbc /ext/nqp-rx/src/stage0/nqp-setting.pir /frontend/parrot/main.o +/frontend/parrot2/main.o +/frontend/parrot2/prt0.pbc +/frontend/parrot2/prt0.pbc.c +/frontend/parrot2/prt0.pbc.o /frontend/parrot_debugger/main.o /frontend/pbc_disassemble/main.o /frontend/pbc_dump/main.o @@ -240,6 +220,7 @@ /runtime/parrot/dynext/*.bundle /runtime/parrot/dynext/*.def /runtime/parrot/dynext/*.dll +/runtime/parrot/dynext/*.dll.a /runtime/parrot/dynext/*.dylib /runtime/parrot/dynext/*.exe /runtime/parrot/dynext/*.exp @@ -324,6 +305,7 @@ /src/dynoplibs/*.bundle /src/dynoplibs/*.c /src/dynoplibs/*.dll +/src/dynoplibs/*.dll.a /src/dynoplibs/*.exp /src/dynoplibs/*.h /src/dynoplibs/*.ilk @@ -339,6 +321,7 @@ /src/dynpmc/*.c /src/dynpmc/*.def /src/dynpmc/*.dll +/src/dynpmc/*.dll.a /src/dynpmc/*.dump /src/dynpmc/*.dylib /src/dynpmc/*.exe @@ -385,6 +368,7 @@ /src/string/charset/*.obj /src/string/encoding/*.o /src/string/encoding/*.obj +/t/archive/parrot_test_run.tar.gz /t/benchmark/*.pasm /t/benchmark/*.pir /t/compilers/data_json/*.pbc @@ -449,9 +433,14 @@ /t/pmc/*_pbcexe* /t/pmc/testlib/*.pbc /t/src/*_*.c +/t/src/*.exe +/t/src/*.lib +/t/src/*.exp /t/src/*.gcov /t/src/*.gcdada /t/src/embed/*.c +/t/src/embed*.o +/t/src/extend*.o /t/stress/*.out /t/stress/*.pasm /t/stress/*.pbc diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000000..9a4b016018 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,45 @@ +language: "perl" +perl: +# - "5.10" + - "5.14" +install: "echo" +before_script: + - sudo apt-get install libffi-dev libicu-dev libgmp3-dev clang llvm-dev zlib1g-dev gcc-multilib +# No, we are not going to run the tests for all these dependencies on every commit + - cpanm -n LWP::UserAgent TAP::Harness::Archive TAP::Harness::ReportByDescription +# This stuff used to be required, but was rolled into the Travis CI perl support. +# - curl -L http://cpanmin.us | sudo perl - --self-upgrade +# - export CI_USER=$USER +# - mkdir ~/perl5 && perl -Mlocal::lib >> /tmp/local_lib_junk.sh && source /tmp/local_lib_junk.sh +# - sudo chown -R $CI_USER ~/.cpanm +# - sudo chown -R $CI_USER ~/perl5 + +# Don't run Configure.pl tests, for now +#script: "perl Configure.pl --test=build $PARROT_CONFIG_ARGS $PARROT_OPTIMIZE --cc=\"$CC\" --link=\"$CC\" --ld=\"$CC\" --ccflags='-g' ; make $PARROT_TEST" + +script: "perl Configure.pl $PARROT_CONFIG_ARGS $PARROT_OPTIMIZE --cc=\"$CC\" --link=\"$CC\" --ld=\"$CC\" --ccflags='-g' ; make $PARROT_TEST" + +branches: + only: + - master +notifications: + recipients: + - parrot-ci@lists.parrot.org + email: + on_success: change + on_failure: always + irc: + channels: + - "irc.parrot.org#parrot" + on_success: change + on_failure: change +env: + - PARROT_CONFIG_ARGS="" PARROT_OPTIMIZE="--optimize" PARROT_TEST="smoke" CC="clang" + - PARROT_CONFIG_ARGS="" PARROT_OPTIMIZE="" PARROT_TEST="smoke" CC="clang" + - PARROT_CONFIG_ARGS="--without-gettext --without-gmp --without-libffi --without-extra-nci-thunks --without-opengl --without-readline --without-pcre --without-zlib --without-threads --without-icu" PARROT_OPTIMIZE="" PARROT_TEST="smoke" CC="clang" + - PARROT_CONFIG_ARGS="" PARROT_OPTIMIZE="--optimize" PARROT_TEST="smoke" CC="gcc" + - PARROT_CONFIG_ARGS="" PARROT_OPTIMIZE="" PARROT_TEST="smoke" CC="gcc" + - PARROT_CONFIG_ARGS="--without-gettext --without-gmp --without-libffi --without-extra-nci-thunks --without-opengl --without-readline --without-pcre --without-zlib --without-threads --without-icu" PARROT_OPTIMIZE="" PARROT_TEST="smoke" CC="gcc" + - PARROT_CONFIG_ARGS="" PARROT_OPTIMIZE="--optimize" PARROT_TEST="smoke" CC="g++" + - PARROT_CONFIG_ARGS="" PARROT_OPTIMIZE="" PARROT_TEST="smoke" CC="g++" + - PARROT_CONFIG_ARGS="--without-gettext --without-gmp --without-libffi --without-extra-nci-thunks --without-opengl --without-readline --without-pcre --without-zlib --without-threads --without-icu" PARROT_OPTIMIZE="" PARROT_TEST="smoke" CC="g++" diff --git a/CREDITS b/CREDITS index 50fe1b92c0..4574658562 100644 --- a/CREDITS +++ b/CREDITS @@ -8,7 +8,7 @@ grepping and beautification by scripts. The fields are: name (N), email (E), web-address (W), description (D), main username (U), alias usernames (A) - and snail-mail address (S). + and geographic location (S). Thanks, @@ -18,6 +18,13 @@ PPPS: To turn this file into a author map for git-svn, see tools/dev/mk_author_map.pl ---------- +N: Aaron Faanes +E: dafrito@gmail.com +W: http://www.dafrito.com +D: make_html_docs revisions +U: dafrito +S: Richardson, TX + N: Aaron Sherman U: ajs E: ajs@ajs.com @@ -69,6 +76,13 @@ D: Architect (0.4.6 - 2.8.0) & Lead Developer E: allison@parrot.org U: allison +N: Alvis Yardley +D: Documentation Shepherd (3.9.0 - Present) +D: Release manger for 4.1.0 +E: ac.yardley@gmail.com +U: alvis +S: Ft. Worth, Texas + N: Amir Karger U: amirkarger D: editor bugfixes @@ -100,7 +114,7 @@ E: yDNA@cpan.org N: Andrew Whitworth D: Internals development D: Documentation -D: Release manager for 0.8.2, 1.3.0, 1.5.0, 2.4.0, 2.11.0 and 3.3.0 +D: Release manager for 0.8.2, 1.3.0, 1.5.0, 2.4.0, 2.11.0, 3.3.0, 3.10.0 and 4.0.0 E: wknight8111@gmail.com U: Whiteknight @@ -447,6 +461,12 @@ A: gerd E: pokorra@uni-siegen.de D: Release manager for 1.9.0, 2.3.0, 2.5.0, 2.8.0, 2.9.0, 3.2.0 and 3.4.0 +N: Gerhard R. +U: gerdr +A: not_gerd +W: http://gerdr.github.com/on-parrot/ +D: MSYS fixes + N: Goplat D: Win98 and other fixes. @@ -508,7 +528,7 @@ D: lot of general hints and patches to improve portability N: Jason Gloudon -N: Jay Emmerson +N: Jay Emerson E: john.emerson@yale.edu U: jay @@ -572,10 +592,16 @@ D: coding standard tests N: John Paul Wallington D: pir-mode.el: fix for xemacs plus bugfixes and cleanups +N: Jonathan Gentle +E: atrodo@atrodo.org +U: atrodo +A: atrodo +S: Ohio, USA + N: Jonathan "Duke" Leto E: jonathan@leto.net -W: http://leto.net -D: Release manager for 1.7.0 +W: http://dukeleto.pl +D: Release manager for 1.7.0, 3.9.0,4.2.0 GCI/GSoC Org Admin/Mentor U: dukeleto A: leto A: Duke Leto @@ -655,7 +681,7 @@ N: Kevin Falcone N: Kevin Polulak U: soh_cah_toa E: kpolulak@gmail.com -D: HBDB debugger +D: HBDB debugger, release manager for 3.8.0 S: New Jersey, USA N: Kevin Tew @@ -796,6 +822,11 @@ D: tracwiki additions D: Release manager for 2.7.0, 3.1.0 E: mike.hind@gmail.com +N: Michael Schroeder +U: mls +D: subprof profiling runcore +E: mls@suse.de + N: Michael G. Schwern N: Michael Scott @@ -929,6 +960,9 @@ D: The Second Perl 6 Summarizer after Bryan C. Warnock E: pdcawley@bofh.org.uk W: http://www.bofh.org.uk:8080/ +N: Piotr Fusik +D: Fixed typos + N: Reini Urban U: rurban E: rurban@cpan.org @@ -1031,6 +1065,13 @@ E: stefanor@cox.net D: Perl 5 interoperability, Blizkost U: sorear +N: Stefan Seifert +U: nine +E: nine@detonation.org +D: Continuation of Chandler's work on tasks +S: Linz, Austria +W: http://niner.name + N: Stéphane Payrard D: Various code fixes and improvements diff --git a/ChangeLog b/ChangeLog index f0f84b3203..4c51b65884 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,9554 +1,11865 @@ -#1 - -2011.07.19 jkeenan - * Released 3.6.0 - See NEWS for more information. - -2011.06.21 cotto - * Released 3.5.0 - See NEWS for more information. - -2011.05.17 Gerd - * Released 3.4.0 - See NEWS for more. - -2011.04.19 Whiteknight - * Released 3.3.0 - See NEWS for more. - -2011.03.15 Gerd - * Released 3.2.0 - See NEWS for more. - -2011.02.15 mikehh - * Released 3.1.0 - See NEWS for more. - -2011.01.18 cotto - * Released 3.0.0 - See NEWS for more. - -2010.12.21 Whiteknight - * Released 2.11.0 - See NEWS for more. - -2010.11.16 tcurtis - * Released 2.10.0 - See NEWS for more. - -2010.10.19 Gerd - * Released 2.9.0 - See NEWS for more. - -2010.09.21 Gerd - * Released 2.8.0 - See NEWS for more. - -2010.08.17 mikehh - * Released 2.7.0 - See NEWS for more. - -2010.07.10 coke - * Released 2.6.0 - See NEWS for more. - -2010.06.15 Gerd - * Released 2.5.0 - See NEWS for more. - -2010.05.18 Whiteknight - * Released 2.4.0 - See NEWS for more - -2010.04.20 Gerd - * Released 2.3.0 - See NEWS for more. - -2010.03.16 cotto - * Released 2.2.0 - See NEWS for more. - -2010.02.16 darbelo - * Released 2.1.0 - See NEWS for more. - -2010.01.19 chromatic - * Released 2.0.0 - See NEWS for more. - -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 - See NEWS for more. - -2009.05.19 Infinoid - * Released 1.2.0 - See NEWS for more. - -2009.04.21 fperrad - * Released 1.1.0 - See NEWS for more. - -2009.03.17 allison - * Released 1.0.0 - See NEWS for more. - -2009.02.17 kjs - * Released 0.9.1 - See NEWS for more. - -2009.01.20 chromatic - * Released 0.9.0 - See NEWS for more. - -2008.12.16 Whiteknight - * Released 0.8.2 - See NEWS for more. - -2008.11.18 chromatic - * Released 0.8.1 - See NEWS for more. - -2008.10.21 particle - * Released 0.8.0 - See NEWS for more. - -2008.09.16 pmichaud - * Released 0.7.1 - See NEWS for more. - -2008.08.19 rgrjr - * Released 0.7.0 - See NEWS for more. - -2008.07.15 barney - * Released 0.6.4 - See NEWS for more. - -2008.06.17 smash - * Released 0.6.3 - See NEWS for more. - -2008.05.20 chromatic - * Released 0.6.2 - See NEWS for more. - -2008.04.15 particle - * Released 0.6.1 - See NEWS for more. - -2008.03.18 bernhard - * Released 0.6.0 - See NEWS for more. - -2008.02.20 pmichaud - * Released 0.5.3 - See NEWS for more. - -2008.01.15 rgrjr - * Released 0.5.2 - See NEWS for more. - -2007.12.18 jonathan - * Released 0.5.1 - See NEWS for more. - -2007.11.20 chromatic - * Released 0.5.0 - See NEWS for more. - -2007.10.17 coke - * Released 0.4.17 - See NEWS for more. - -2007.09.18 particle - * Released 0.4.16 - See NEWS for more. - -2007.08.22 pmichaud - * Released 0.4.15 - See NEWS for more. - -2007.07.17 particle - * Released 0.4.14 - See NEWS for more. - -2007.06.19 allison - * Released 0.4.13 - See NEWS for more. - -2007.05.15 chromatic - * Released 0.4.12 - See NEWS for more. - -2007.04.17 mdiep - * Released 0.4.11 - See NEWS for more. - -2007.03.20 coke - * Released 0.4.10 - See NEWS for more. - -2007.3.10 coke - * removed parakeet - -2007.02.22 pmichaud - * Released 0.4.9 - See NEWS for more. - -2007.01.17 chromatic - * changed 'name' method on namespaces to 'get_name' per pdd21 - -2007.01.16 particle - * Released 0.4.8 - See NEWS for more. - -2006.12.12 particle - * added C opcode - -2006.11.14 chip - * Released 0.4.7 - See NEWS for more. - -2006.11.07 tewk - * added :init pragma functionality to subs - -2006.10.28 jonathan - * added :vtable pragma functionality to subs - -2006.09.18 chromatic - * added Parrot::Embed under ext/Parrot-Embed - -2006.08.18 leo - * remove the None PMC - if needed it can trivially be reimplemented - in languages from r14189 - -2006.08.16 creiss - Merged Software Transactional Memory branch into trunk, adds: - * several new opcodes whose names start with stm_ - * read-only PMC support - * several new PMC types (whose names start with STM*) - * support for threads (again) - -2006.08.08 chip - * Released 0.4.6 - See NEWS for more. - -2006.08.02 chip - * opcodes: "in PMC" is no longer a synonym for "invar PMC"; - there are opcodes now that want the real "in PMC". - * namespace and global opcodes now accept name arrays again, as - well as keys; the corresponding namespace PMC methods are gone. - -2006.07.21 leo - * Parrot_x_exit, Parrot_x_on_exit take now an Interp * argument - -2006.07.25 chip - * add experimental op find_type_i_p - * fix longstanding bug that sometimes didn't encode pasm keys as - Key PMCs (specifically "[S0]" and "['stringliteral']"). - -2006.07.24 chip - further implementation of new pdd21: - * new opcodes {get,set}*global - (old {find,store}*global will be supported for a short while) - -2006.07.20 audreyt - * --maintainer prerequesites are now bison 2.2+ and flex 2.5.3x - (or some such --leo) - (at the moment code is checking for 2.0 -- ambs) - -2006.07.17 chip - partial implementation of new pdd21: - * old: "get_namespace KEY". new: "get_hll_namespace KEY" - * get_namespace and find_global opcodes no longer accept arrays - of strings. To use arrays, call namespace object methods. - -2006.06.19 leo - * Released 0.4.5 - See NEWS for more. - -2006.06.03 leo - * I and N registers are never cleared to 0 / 0.0 on subroutine entry - -2006.05.14 leo - * Released 0.4.4 - See NEWS for more. - -2006.04.30 bernhard - * Make the Perl PMCs dynamic and move them to src/dynpmc - -2006.04.02 leo - * Released 0.4.3 - See NEWS for more. - -2006.03.06 leo - * Shifted argument type bits left by 2 according to r11754 - change of docs/pdds/pdd03_calling_conventions.pod - * if you are creating PASM then code needs adjustment - -2006.02.22 leo - * Released 0.4.2 - See NEWS for more. - -2006.01.16 bernhard - * rename src/dynclasses to src/dynpmc - * rename src/classes to src/pmc - -2006.01.15 leo - - * find_global and friends returns a .Null PMC instead of .Undef on - lookup failure, iff lookup exceptions are off - -2006.01.08 leo - * Released 0.4.1 - See NEWS for more. - -2005.12.28 particle - * renamed all .imc files to .pir - * modified all doc references to .pir as well - -2005.12.13 particle - * moved jit/ directory to src/jit/ - -2005.12.12 particle - * moved io/ directory to src/io/ - * moved classes/ directory to src/classes/ - * moved dynclasses/ directory to src/dynclasses/ - -2005.12.08 particle - * moved types/ directory to src/types/ - * moved pf/ directory to src/packfile/ - * moved ops/ directory to src/ops/ - -2005.12.08 particle - * moved charset/ directory to src/charset/ - * moved encodings/ directory to src/encodings/ - -2005.12.07 particle - * moved imcc/ directory to compilers/imcc/ - -2005.12.06 particle - * moved util/ directory to tools/util/ - * removed imcc/examples/ directory - * moved ast/ directory to compilers/ast/ - -2005.12.05 particle - * moved imcc/docs/ directory to docs/imcc/ - * moved build_tools/ directory to tools/build/ - * modified MANIFEST, MANIFEST.generated, and MANIFEST.SKIP - -2005.12.04 leo - * Released 0.4.0 - * See NEWS for changes - -2005.11.06 leo - * Released 0.3.1 - * See NEWS for changes - -2005.10.01 leo - * Released 0.3.0 - * See NEWS for changes - -2005.08.05 leo - * Released 0.2.3 - * See NEWS for changes - -2005.07.03 leo - * Released 0.2.2 - * See NEWS for changes - -2005.06.04 leo - * Released 0.2.1 - * allow short names for object attributes - * string encoding and charset can now be set independently - * experimental mmap IO layer for slurping files - * enable compile opcode support for compilers written in PASM/PIR - * improved HLL support with .HLL and n_operators pragmas - * simplified hash code - * more strength reduce optimizations - * distinct debug and trace flag settings - * glob support in PGE - * new character classification opcodes and interfaces - * numerous bug fixes and enhancements +2012-04-17 release 4.3.0 + - Core + + Winxed snapshot updated to 1.7.0 + + Add type introspection to lexical variables. + + New 'tools/release/parrot_github_release.pl' script to automate + updates to the 'parrot.github.com' and 'parrot-docsx' repositories. + + Numerous casting and consting fixes thanks to GCC 4.8 . + - Documentation + + Updated 'docs/projects/release_manager_guide.pod' + + Updated 'docs/projects/release_parrot_github_guide.pod' + + Improved function documentation. + - Tests + - Community + - Platforms + + Fixed alignment issues on ia64, sparc and mipsel. + + Fixed a platform-specific issue with dlclose(). + +2012-03-20 release 4.2.0 + - API Changes + + The signature of getprop was changed from (PMC,String,PMC) to + (PMC, PMC,String) for consistency + - Core + + Parrot Calling Conventions (pcc) now reuses Continuation PMCs + internally, which reduces GC work by 25% and improves + the fib.pir benchmark by 6% + + Winxed snapshot updated to 1.6.devel 44a04cfa7b + + Improved the detection of Clang-ish compilers during configuration + + Fixed a possible segfault bug when reading packfiles with no + constants or main_sub + + By default, Parrot has now elevated these GCC warnings to errors + during compile time: + implicit-function-declaration, undef, missing-braces, + nested externs, old-style-definition, strict-prototypes, + + The OS Dynamic PMC now has separate functions to unlink a file + and remove an empty directory (rmdir) + + Fix building on Cygwin due to an improperly named DLL file + + Various small bug fixes pointed out by static and dynamic analysis + tools + - Branches + + Work on M0 continues now in the m0 branch, which contains both + implementations (currently C and Perl) and specification. + + Good progress has been made on the threads branch which builds + on the green_threads branch. This gets Parrot much closer to + being able to utilize multiple CPU cores seemlessly. More details + at http://niner.name/Hybrid_Threads_for_the_Parrot_VM.pdf + - Documentation + + New release manager documentation for parrot.github.com : + http://git.io/parrot-github-guide + - Community + + Parrot was accepted to Google Summer of Code 2012! + Ideas Page: http://git.io/parrot-gsoc-2012 + +2012-02-21 release 4.1.0 + - Core + + Shared libraries and installable binaries are now stripped if + built with --optimize on Cygwin, which greatly reduces their + size on disk + + New experimental PCC-related ops added to core. + - Documentation + + Revised 'docs/project/release_manager_guide.pod' + - Tests + + Parrot now uses Travis CI http://travis-ci.org + + Parrot Continuous Integration (CI) with Travis CI means + every commit of Parrot is now compiled and tested on gcc, + g++ and clang with various Configure.pl options. + + CI Notifications are sent to parrot-dev, the #parrot + IRC channel and Smolder + + Cardinal and Rakudo spec tests also on Travis CI + +2012-01-17 release 4.0.0 + - Core + + Several cleanups to the interp subsystem API + + Cleanups and documentation additions for green threads and timers + + Iterator PMC and family now implement the "iterator" role + + A bug in Parrot_ext_try was fixed where it was not popping a context correctly + - Documentation + + Docs for all versions of Parrot ever released are now available + at http://parrot.github.com + - Tests + + Timer PMC tests were converted from PASM to PIR + +2011-12-20 release 3.11.0 + - Core + + packfile api and pbc handling improvements + + smarter recursion tracking across threads + + new "pop_upto_eh" op for finer-grained exception handling + + subroutine-level profiling runcore cleanups + + improved window support + - Languages + + new math builtins in winxed (abs, sinh, cosh and tanh) + + better inline support in winxed + + squaak improvements (sub as expression, new read() builtin) + - Documentation + + many new man pages thanks to gci students + - Tests + + updated example code for FileHandle and Iterator + + coding standards fixes + +2011-11-15 release 3.10.0 + - Core + + The mark VTABLE was added to the Select PMC + + The Parrot::Embed Perl 5 module was removed from parrot.git and now lives + at https://github.com/parrot/parrot-embed + + A set_random method was added to the Integer PMC, so random numbers can + be generated without needing to load math dynops + + A new implementation of green threads was added to Parrot, in preparation + for a robust hybrid threading system. Green threads are currently + not available on Windows. + - Languages + + Winxed + - 'multi' modifier improved + - throw "string" now emits throw instead of die + - several optimizations in generated code + - improved some error dianostics + - Community + + Parrot Foundation was accepted to Google Code-In 2011. We could always use more volunteers. + Task ideas are on the wiki: + https://github.com/parrot/parrot/wiki/Google-Code-In-Task-Ideas + - Documentation + - Tests + + Added tests for recently-fixed bugs using return :flat and ResizableStringArrays. + +2011-10-18 release 3.9.0 + - Core + + The whiteknight/kill_threads branch was merged, which removes the old and broken + thread/concurrency implementation. Better and more flexible concurrency primitives + are currently being worked on. This also involved removing some of the last vestiges + of assembly code from Parrot as well as removing the share and share_ro vtables. + + random_lib.pir was removed, since better alternatives already exist + + The freeze and thaw vtables were removed from Default PMC, because they weren't + useful and caused hard-to-find bugs. + + A new subroutine profiling runcore was added. It can be enabled with the command-line + argument of -R subprof . The resulting data can be analyzed with kcachegrind. + + Added get_string VTABLE to FixedIntegerArray and FixedFloatArray PMCs + + The update() method was added to the Hash PMC, which updates one Hash with the contents + of another. This speeds up rakudo/nqp startup time. + - Languages + + Winxed + - Updated snapshot to version 1.3.0 + - Added the builtin sleep + - Modifier 'multi' allows some more multi functionality + - Community + + New repo for the Parrot Alternate Compiler Toolkit, a re-implementation of + PCT in Winxed: https://github.com/parrot/PACT + - Documentation + + We are in the process to migrating our Trac wiki at http://trac.parrot.org/ to Github + at https://github.com/parrot/parrot/wiki + + Packfile PMC documentation was updated + - Tests + + Select PMC tests improved to pass on non-Linuxy platforms + +2011-09-20 release 3.8.0 + - Core + + New tools/release/auto_release.pl script automates most of release + - Languages + + Winxed + - Updated snapshot to version 1.2.0 + - allowtailcall modifier in try + --debug command-line option, __DEBUG__ predefined constant + and __ASSERT__ builtin + - namespace, class, and ~ (bitwise not) operators + - Implicit nested namespace in namespace and class declarations + - -X command-line arg + - Documentation + + Improved release manager guide + - Tests + + New Makefile target "resubmit_smolder" to resubmit test results + + New Makefile target "all_hll_test" runs the test suite of all HLLs + and libraries known to work on Parrot + + New Makefile target "interop_tests" run language interoperability tests, + which runs as part of the normal "make test" as well + +2011-08-16 release 3.7.0 + - Core + + Added mem_sys_strndup function. + + Added new load_bytecode_p_s opcode as an eventual replacement for load_bytecode_s + + Added new :tag() syntax to IMCC for PIR + + Improved configuration support for msys + + known-buggy parrot_debugger is no longer installed + - Languages + + Winxed + - Updated snapshot to version 1.1.0 + - multi functions and methods + - cast to var + - load_packfile builtin + - __NAMESPACE__ and __CLASS__ predefined constants + - Documentation + + The Archive::Tar and Archive::Zip libraries now have POD docs + - Tests + +2011-07-19 Release 3.6.0 + - Core + + Class.add_vtable_override now allows you to overwrite an override + + Integers, floats and strings can now be stored in lexical variables. + Previously, only PMCs could be stored in lexicals. + + VTABLE_substr has been removed. VTABLE_substr_str has been renamed to + VTABLE_substr + + Added a new PackfileView PMC type, an intended replacement for the deprecated + Eval PMC. + + The is_integer vtable on the String PMC now works for all string encodings. + + Unicode error messages on Win32 now work correctly. + + A memory leak in IMCC was fixed. + - Languages + + The snaphost of Winxed included with Parrot was updated to version 1.0.0 + + Winxed has migrated to Github: https://github.com/NotFound/winxed + +2011-06-21 Release 3.5.0 + - Core + + Parrot_PMC_destroy, Parrot_PMC_mark and Parrot_PMC_invoke were removed from + the public extension API. + + PAST now has PAST::Stmt node types, supports reusable temporary registers. + + Test coverage of the embedding and extending interface is now at least 95%. + + A snapshot of Winxed is now included in Parrot core to facilitate writing + core Parrot tools from a higher level language than PIR. + - Languages + + Winxed + - Improved compile time scope search. + - Added 'using namespace' statement. + - Compiler classes and functions now live in the Winxed;Compiler namespace. + - Tests + + The Parrot test suite harness now understands the HARNESS_TIMER environment + variable. Setting it to a true value will show timing results for a test run. + + IPv6 tests are now parallel testing friendly. + +2011-05-17 Release 3.4.0 + - Core + + The Generational Mark and Sweep garbage collector is the new default. + + The --gc-nursery-size command line argument was added. + + Parrot now gets entropy from the underlying OS. + + The NCI subsystem now supports 8, 16, 32 and 64 bit integers. + + The NCI subsystem now supports "long long" and "long double" signatures. + Not all platforms/compilers support these non-standard types, so developers + are cautioned to take note that using them reduces portability. + + Many more OpenGL functions in the Parrot OpenGL bindings are available, + which required the above-mentioned signatures. + + Bytecode-related embedding api functions moved to src/embed/bytecode.c. + - Languages + + Winxed + - Use 'using extern' for module imports. + - Improved stage 0 prefix ++ and -- operators. + - Allow 'null' in conditional operator. + - Several examples are updated. + - Community + + Google Summer of Code Bonding period is going well. Students are mostly done + with their classes and much code will flow soon. + - Documentation + + More PCT introductions are available at: http://github.com/benabik/cish + +2011-04-19 Release 3.3.0 + - Core + + The isa and isa_pmc vtables can now be overridden from PIR + + IMCC has a new improved external interface + + A new IMCCompiler PMC adds prototype PDD31-alike functionality for the PIR and PASM compilers + + New --with-llvm option to Configure.pl, which will link to LLVM if it is available + - Community + + Parrot Virtual Machine was accepted into Google Summer of Code 2011 + - Ecosystem + + Rosella adds a stable "Event" library to implement a publish/subscribe mechanism + - Tests + + The test coverage of the extend_vtable subsystem was greatly increased + +2011-03-15 Release 3.2.0 + - Core + + Full support for Unicode filenames on Linux and Win32 + + The configuration option --cxx is gone + + New Generational GC implemented. To enable it run Configure.pl --gc=gms + + Now op definitions are semantically parsed. It opens possibilities for + future optimizations of parrot core. + + A statement convert the '.param' PIR systax + + A PMC is implemented for low-level buffer access which separate the + representation from the pointers + + Support added for 'long double', 'long long', and 64-bit to StructView + + In math.h are tools available for Inf/NaN + + Signature PMCs are used pervasively + - Languages + + A few tests in Cardinal are fixed + + A binary .dmg is created of Rakudo Star for OS X + + Winxed + - Minor fixes, refactors and cleaning + - New predefs replace, push and provide a way to access multiple return + values + - Operators exits, class and .* (indirect method call) added + - $loadlib directive + - -o option to installable driver added + - Indent generated PIR is added to improve clarity and avoid imcc pitfalls + with non indented sub bodys + - Community + + M0 roadmap is in progress + - Documentation + + 'make docs' target, which was serving only to generate superfluous POD + files, has been removed. + + Svn remnants from PDDs are removed + - Tests + + Added 'make release_check' target so that Release Manager can double-check + tarball + + Probes added for 'long long' and 64-bit C types + - Rosella (https://github.com/Whiteknight/Rosella) + Rosella is a collection of tools and building blocks for Parrot + + A working proxy library is created, that make mostly-transparent custom + proxies for many types of Parrot PMCs + + A mockobject testing library is created, using the new proxy library + + The PLA test suite is updated to use the new Rosella testing tools, + including the new mockobjects to test callbacks + +2011-02-15 Release 3.1.0 + - Core + + Exception PMCs are now subclassable from PIR + + IPv6 is now supported and tested + + Added Parrot_ext_try function to extend API (experimental), to allow + implementation of try .. catch construct in C extensions. + + We now have a YAML library called YAML::Tiny, a port of YAML::Tiny from Perl 5 + + Deprecated/experimental features are now stored in api.yaml in an easy-to-parse + format, which will allow automated tools easy access to this data. This replaces + DEPRECATED.pod, which no longer exists. + + Improved GC latency + + Improved GC performance on low-memory systems + + Improved packfile annotation lookup complexity + + Removal of unused code and SVN based code + - NQP + + A repository for a new NQP version which has a new object model is + created at http://github.com/perl6/nqp + - Languages + + Cardinal (Ruby on Parrot) now compiles and passes it's test suite on master + and is looking for developers : https://github.com/parrot/cardinal + + Cardinal can send smoke reports with "rake smoke" or "parrot setup.pir smoke" + + Jaspers, an implementation of Javascript on Parrot, now has a Github repo + and is looking for developers: https://github.com/leto/jaspers + - Community + + The following Parrot Google Code-In students were grand prize winners: + Fernando Brito, Brazil David Czech, Canada + Nolan Lum, United States Matt Rajca, United States + Tony Young, New Zealand Daniel Kang, United States + We are very proud of them for their fine work and congratulate + them for achieving top finalist status! For more info, see: + http://google-opensource.blogspot.com/2011/02/google-code-in-grand-prize-winners.html + - Documentation + + Many new Parrot-related terms were added to docs/glossary.pod + + Removal of most remaining references to SVN + + Internal project documentation is included in html output + - Tests + + Test suite now passes on NetBSD 5.1 + + Test coverage increased greatly for the Embed/Extend subsystem, + thanks to a TPF grant: + http://leto.net/dukeleto.pl/2011/01/parrot-embed-grant-update-2.html + +2011-01-18 Release 3.0.0 + - Core + + A new embedding API is available in "parrot/api.h" and documented in + docs/pdd/pdd10_embedding.pod . + + Packfile PMCs were refactored and can now be used to produce runnable bytecode. + + Packfile manipulation code now throws embedder-friendly exceptions rather + than printing error details directly to stderr. + + Unicode support for file IO, environment variables, program names, and + command-line parameters was improved. + + An experimental gdb pretty-printers in tools/dev for Parrot STRINGs and + PMCs is now available. (gdb 7.2 or later and Python are required) + + c2str.pl and pmc2c.pl improvements result in a noticably faster build. + + Bugs in our Digest::sha256 library and bit-related dynamic ops were fixed + by GCI student Nolan Lum. Both now work correctly on 32 and 64 bit systems. + - Languages + + Ωη;)XD - OMeta for Winxed https://github.com/plobsing/ohm-eta-wink-kzd + - Community + + tree-optimization by GSoC student Tyler L. Curtis joined the nest and now + lives at http://github.com/parrot/tree-optimization . + + Plumage now lives at http://github.com/parrot/plumage and is installable. + + Christmas proceeded as scheduled. The Parrot team does not take credit for + this event. + - Documentation + + HTML documentation generation has been rewritten and greatly simplified. + + We have improved documentation in docs/project/git_workflow.pod about + keeping a fork of parrot.git in sync. + + Translations of our README in various languages are now in the + docs/translation directory, thanks to Google Code-In students. + - Tests + + A better way to write "todo" tests with Parrot's Test::More was implemented + by GCI student Fernando Brito. + + Major increases in test coverage of many core PMCs, dynamic PMCs and + dynamic opcodes resulted from GCI and the interpid students it attracted. + + Jonathan "Duke" Leto set up Debian Linux x86_64 and sparc32 smokers + in the GCC Compile Farm, which continually submit smoke reports with + a variety of configuration options and compilers. Thanks, GCC! + + Makefile dependency checking is now automatically tested, resulting in a + more reliable parallel build. + + Coverage tests were improved for platforms with and without Devel::Cover. + +2010-12-21 Release 2.11.0 + - Core + + Just In Time native call frame generation using LibFFI + + PIR op find_codepoint is no longer experimental, it is now supported + + Several public functions in libparrot have been brought up to standard + naming conventions. + + Improved linked-list implementation in GC + + set_addr opcode is being replaced with the new set_label opcode in core libraries + + Removed deprecated CodeString PMC + + Added close, is_closed, read, readline methods to Socket + + Added experimental MappedByteArray PMC type + + Added Parrot_warn_experimental, to warn the user about experimental features + + Code for frontend executables moved from src/ to frontend/ + + Support for chunked receive in LWP library. + + Added a "quickcover" make target + - Languages + + PIRC + - left the nest and is currently at https://github.com/parrot/pirc/ + + Community + - Our README was translated into the following languages + by Google Code-In students and mentors: + Polish README.polski + Spanish README.espanol + German README.deutsch + - Documentation + - Tests + + Test coverage increase on PMCs: String, Integer, NameSpace, Complex, EventHandler + + 'make quickcover' target added to speed up most essential + parts of coverage analysis + + 'tools/dev/headerizer.pl' refactored to improve maintainability + (no change in functionality) + +2010-11-16 Release 2.10.0 + - Core + + We are on github now! https://github.com/parrot/parrot + + Configure, build and test subsystems were made Git-aware + + New parrot_config key 'osvers' which contains + Operating System Version information + + Updated to the latest nqp-rx + + A proper exception is now thrown on IO read errors + + Garbage Collector optimizations and memory leak fixes + + Deprecated charset ops were removed + + Configure system learned to detect IPv6 + + The mk_language_shell and create_language scripts have not yet been + ported to Git. + - Documentation + + How To Use Git to work on Parrot + https://github.com/parrot/parrot/blob/master/docs/project/git_workflow.pod + + Git Terminology + https://github.com/parrot/parrot/blob/master/docs/project/git_terminology.pod + - Platforms + - Testing + + Increased coverage on: String, FixedBooleanArray, PMCProxy, LexPad + - Community + + Macports portfile updated to 2.6.0 + + A Fedora package for PL/Parrot ( postgresql-plparrot ) was created + This package allows you to write stored procedures for PostgreSQL in + PIR or Rakudo Perl 6 http://pl.parrot.org + + Parrot Foundation is teaming up with The Perl Foundation and taking + part in Google Code-In 2010. Learn about it and how to get involved here: + + http://trac.parrot.org/parrot/wiki/GoogleCodeIn2010Tasks + + http://leto.net/perl/2010/11/parrot-foundation-the-perl-foundation-google-code-in.html + +2010-10-19 Release 2.9.1 + - This is a bugfix release. If you run out of memory on a box with < 512 MB physical RAM, please report it to us. + +2010-10-19 Release 2.9.0 + - Core + + Parrot and Rakudo's build and tests can now be run under the profiling runcore + + IPv6 is now detected, laying the groundwork for future networking improvements + + mk_language_shell.pl and create_language.pl no longer require an installed parrot + + String PMC's 'reverse' method is now faster and supports all encodings + + improvements and simplifications in internal string processing + + Added API for adding STRINGs to the gc root set + + Speed up ord, substr, index and string comparison opcodes + - Testing + + "make smoke" supports parallel testing by honoring TEST_JOBS + + Added tests for Socket PMC, StringBuilder PMC, ByteBuffer PMC, + mk_language_shell.pl, create_language.pl + + Fixed "Configure.pl" about missing tests + + Parrot and Rakudo Perl 6 now have access to the GCC Compile Farm + + Testing on Darwin/PPC + - Git Migration + + Most developer tools have been ported to Git + + Majority of developer docs have been written for Git + - Platforms + + Parrot can now be built on Minix + +2010-09-21 Release 2.8.0 + - Core + + Inlined hashing and comparison functions + + Hash memory allocation moved from system malloc to lazy allocated + + Avoided infinite catching of exceptions while dying from exception + + Some svn fixes + + Added a check for duplicate vtable entries in PMCs + + Building Parrot with Perl 5.12 and gcc-4.5 / g++-4.5 + + Eliminated cruft left over after dynops_mapping + + Improved charset and string encoding + + Better organisation of programs by reposition it to "tools/build" and "tools/release" + + Implemented Exception clone vtable function + + Added experimental function Parrot_getpid and getpid method + + --gc-threshold command line argument added, which controls the % of memory wasted by the GC + + Closed a lot of tickets + - Testing + + Added more core pmc tests + + Rearranged some tests with C coverage + + We now have Smolder back, at http://smolder.parrot.org . Submit reports with "make smoke" + + skip_all implementation in Parrot's Test::More completed + - GitMigration + + Set up a test site for github trac plugin at http://mksig.org/trac/ + + Code of Trac plugin at github is on http://github.com/cotto/github-trac + + Parrot is now mirrored on github at http://github.com/parrot/parrot + - Compilers + + Fixed problem with imcc HLL in load_bytecode difference between loading a pbc and compiling a pir + +2010-08-17 Release 2.7.0 + - Core + + cleanups in packfile and freeze/thaw handling + + Hash optimizations that improve HLL startup and run time + + As always, many bug fixes and other optimizations + - Runtime + + some runtime library cleanups + - Testing + + added more tests to improve coverage + + new codingstd test for documentation in .pmc files + - Documentation + + added documentation to .pmc files (some still missing but headers in place) + + general documentation improvements and bringing up-to-date + - NQP-rx + + Updated version included from http://github.com/perl6/nqp-rx includes + speed improvements + +2010-07-20 Release 2.6.0 + - Core + + Plug some memory leaks + + As always, bug fixes and some optimizations + - Runtime + + added (experimental) URI::Escape + - Testing + + Improved test coverage of core parrot + - Documentation + + Updated the Squaak tutorial to use modern NQP-rx and PCT + - Platforms + + The Fedora package 'parrot-devel' install the files for syntax-highlighting + and automatic indenting for the vim editor + - NQP-rx + + Updated version included from http://github.com/perl6/nqp-rx includes + new or improved: regex backtracking, named assertions, interactive mode, + and setting (a minimal but useful runtime library) + +2010-06-15 Release 2.5.0 + - Core + + Added ByteBuffer PMC to allow direct byte manipulation + + Modified some PMC vtable functions to reduce complexity, simplifying coverage. + + Modified PAST to generate symbolic PASM constants in PIR output. + + General STRING API cleanups + + Increased test coverage of core PMCs + + Fixed up 'exit' opcode, added CONTROL_EXIT exception type. + + Experimental 'unroll' opcode renamed to 'finalize' + - NQP-rx + + Added proper support for multisubs and multimethods + + Fixed sigspace handling ** quantifier in regexes + + Added \e strings + + Added use of inversion lists for charclass lists in regexes + - Platforms + + EPEL (Extra Packages for Enterprise Linux) packages for RHEL6.beta are available + - Begin moving towards Lorito, the ops refactor to enable pervasive self-hosting and JIT compilation. + + All ops are now built with the self-hosted opsc compiler. + + For more Information about Lorito see: + http://trac.parrot.org/parrot/wiki/Lorito + http://trac.parrot.org/parrot/wiki/LoritoRoadmap + +2010-05-18 Release 2.4.0 + - Core + + Various long-standing bugs in IMCC were fixed + + STRINGs are now immutable. + + use STRINGNULL instead of NULL when working with strings + + Fixed storage of methods in the NameSpace PMC + + Added :nsentry flag to force method to be stored in the NameSpace + + Added StringBuilder and PackfileDebug PMCs + + Added experimental opcodes find_codepoint and unroll + - Compilers + + Fixed reporting of line numbers in IMCC + + Removed deprecated NQP compiler, replaced with new NQP-RX + + Removed NCIGen compiler + - Deprecations + + Tools to distribute on CPAN were removed + + Deprecated dynpmcs have been removed to external repositories + + Removed RetContinuation PMC + + Removed CGoto, CGP, and Switch runcores + - Tests + + Many tests for the extend/embed interface were added + + done_testing() is now implemented in Test::More + - Tools + + The fakexecutable tapir is renamed parrot-prove + + Performance fixes to the pbc_to_exe tool + + Fix data_json to work outside of trunk + + The dynpmc GzipHandle (zlib wrapper) was added + + The library Archive/Tar.pir was added. + + The library Archive/Zip.pir was added. + + The libraries LWP.pir, HTTP/Message.pir & URI.pir were added. + - Miscellaneous + + Six Parrot-related projects accepted to GSoC + + Improve use of const and other compiler hints + +2010-04-20 Release 2.3.0 + - Core + + Allow passing parameters to the dynamic linker ('dlopen' improved) + + loadlib opcode added + + Calling conventions are now much more consistent, and follows natural + semantics of handling arguments and return values + + Recursive make for src/dynpmc removed + + Datatype STRINGNULL for a single Null STRING added + + config_lib.pasm replaced with config_lib.pir + - Platforms + + Improved handling of new compilers + + Cygwin packages will be updated again with Parrot releases + + Fedora packages add desktop files + + gzip and bzip2 compressed tar files for releases + - Tools + + tapir executable added; tapir is a TAP test harness + + Added TAP options --merge --ignore-exit + - Miscellaneous + + 3 month cycle for supported releases + + Review and vote of GSoC applications + +2010-03-16 Release 2.2.0 + - Core changes + + Most internal allocations now use the GC + + RNG non-randomnes fixes + + Elimination of much dead code + - API changes + + PMCs can now be initialized from an int + + Many legacy ops are removed + - Platforms + + Sun cc and Intel icc support have been restored + + Compiler invocation no longer goes through a Perl script + - Tools + + NCI thunks are now generated by self-hosted PIR code + +2010-02-16 Release 2.1.0 + - Core changes + + GC performance and encapsulation were greatly improved. + + PMC freeze refactored. + + More Makefile and build improvements. + - API Changes + + The Array PMC was removed. + + Several deprecated vtables were removed. + + The OrderedHash PMC was substantialy improved. + - Platforms + + Packaging improvements on some operating systems. + - Tools + + Some cases in pbc_merge are now handled. + + Improvements were made to the dependency checker. + + New tool nativecall.pir added. + +2010-01-19 Release 2.0.0 + - Features + + Context PMCs now support attribute-based introspection + + Context and CallSignature PMCs merged into CallContext + + .lex directive throws exceptions when used with incorrect register types + - Platforms + + Packaging improved for free OS distributions + + PPC, PPC64, and ARM now tested when running Linux + - Performance + + Minor improvements to the profiling runcore + + 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 + - Tests + + Continued migration of core tests from Perl 5 to PIR + - 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 + +2009-12-15 Release 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:" 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 + +2009-11-17 Release 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. + +2009-10-20 Release 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 + +2009-09-15 Release 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 + +2009-08-18 Release 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 + +2009-07-21 Release 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: + + 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 + +2009-06-16 Release 1.3.0 + - Core + + Optimized parts of the IO system + + Fixed inheritance hierarchy of FileHandle and Socket PMC types + + Fixed leaks involving subroutines and Parrot_Context + + Cleaned up and refactored GC internals, including fixes and optimizations + + Optimized PMC class manipulations to use type numbers instead of string names + + Fixed problems involving hashval calculations in strings + + Removed unnecessary MULTI dispatches in built-in PMCs + + Fixed memory leaks involving PMCs that were not properly destroyed + + Fixed creation of PMCProxy PMCs in correct namespaces + + Added preliminary Pipe support + + Fixed cloning of Object PMCs + + Added root_new opcode + + Added initial versions of Packfile PMCs with read/write capabilities + - Compilers + + Fixed several memory leaks in IMCC + + Updated PCT to use root_new opcode + + Added support for keyword "self" in NQP + - Documentation + + Improved and expanded /docs/book + + Updated project documentation + + Defined 'experimental' status and procedures in DEPRECATED.pod + - Miscellaneous + + Cleaned code and improved code-level documentation + + Various bugfixes, code cleanups, and coding standard fixes + + Added an experimental compiler library to help use PIR libraries from HLLs + + Updated OpenGL library and examples to support experimental HLL import + +2009-05-19 Release 1.2.0 + - Core + + Fixes for pir classes inheriting from core pmcs. + + Cleaned up headers and reorganized some sources into subsystem directories. + + Clean up PMCs so libparrot.so exports far fewer vtable/method symbols. + + Clean up the GC API. + + Several unicode identifier improvements in IMCC. + - Deprecations + + Protoobject stringification is gone. + - Documentation + + Rewrite several core documents. + + Many reworks, improvements & additions to the Parrot Book. + + Installation PDD is launched out of draft. + - Tools + + Fixes for running the language shell generator outside the parrot tree. + + Several fixes for developing and building HLLs from an installed parrot. + + Configure.pl now has a --no-line-directives option to ease source level debugging. + - Miscellaneous + + Portability updates for macports, netbsd, mingw32, hpux. + + Several (build time, runtime) performance improvements. + + Lots of updates to examples and tests. + + Various bugfixes, code cleanups, and coding standard fixes. + +2009-04-21 Release 1.1.0 + - Core + + Added op: load_language, find_caller_lex + + Socket IO are back as PMC + + Refactor some PMC: Hash, ManagedStruct + + Refactor GC API + - Compiler + + PGE + - Allow \x, \c, and \o in enumerated character classes (incl ranges) + - Add initial greedy-only version of ** quantifier + + PCT + - Add HLL source line bytecode annotations + - Add another dumper format to assist syntax highlighters + - Revise mk_language_shell.pl to updated create_language.pl + - Deprecations + + Removed ops: gcd, exec, classname, need_finalize, runinterp, substr_r + + Removed dynamic op: mul + + Removed .HLL_map directive; use interp's .hll_map() instead + + Removed PMCs: slice, bound_nci, ref + + Removed Configure.pl option: --pmc + + Removed PMC union struct + - Documentation + + Book + - Reorganization and many improvements & additions + - Tools + + Add a parrot-fuzzer + - Miscellaneous + + Improve Debian/Ubuntu package + + various bugfixes, code cleanups, and coding standard fixes + + +2009-03-17 Release 1.0.0 + - Documentation + + New user documentation for exceptions. + + Updates to Chapters 4 & 5 of the Parrot book. + + Improved and expanded generated HTML documentation, as the input for + http://docs.parrot.org. + + Added Compiled HTML Help (.chm) version of documentation. + + Cleanups and fixes. + - Languages + + Pynie + - left the nest and is now at http://pynie.googlecode.com/ + + Cardinal + - left the nest and is now at http://github.com/cardinal + + APL + - left the nest and is now at http://paraplegic.googlecode.com/ + + ABC, Squaak, and Befunge moved to examples/. + + All remaining languages moved to https://svn.parrot.org/languages/ + - Tools + + Support for language builds from an installed Parrot. + + Expanded language shell generator for new languages. + + 'parrotbug' utility repurposed for the Trac interface. + - Deprecations + + Removed deprecated Tqueue and Closure PMCs. + + String, Key, NCI, LexPad, Iterator, Sub, Continuation, RetContinuation, + ExceptionHandler, ParrotLibrary, ParrotInterpreter, ParrotThread, + ParrotRunningThread, Rational, FixedPMCArray, ResizablePMCArray, and + GDBMHash PMCs now use declared attributes (ATTR), in place of the + deprecated UnionVal. + +2009-02-17 Release 0.9.1 + - Implementation + + Support for portable 'Inf', 'NaN' and -0.0 + + pbc_disassemble prints constants in constants table + + New experimental BigNum implementation + + Pair is now a dynamic loadable PMC + + Various function name sanification + + New implementation of Strings component + + Replace various PMC value union access code by VTABLE method invocations + + Replace various PMC value unions by ATTRibutes + + Removed SArray PMC. Use FixedPMCArray instead. + - Documentation + + Book + - updates to Chapter 2 (getting started) + - updates to Chapter 3 (PIR basics) + - updates to Chapter 4 (PIR subroutines) + - updates to Chapter 10 (HLLs) + - updates to Chapter 12 (opcodes) + + Function documentation + + Pod documentation style modernized; no longer Perl 5 style. + + PMC has an additional acronym: Poly Morphic Container + + The DOD (Dead Object Detection) acronym is no longer used; + use 'GC' to refer to the Garbage Collector component. + - Compilers + + IMCC + - :named flag can now take string registers as argument + - A single '=cut' directive is now ignored (without initial Pod directive) + - :vtable subs now have proper access to 'self' pseudo variable + - Languages + + add new 'Pod' documentation parser + + Pipp (PHP implementation): + - Pipp is now at http://github.com/bschmalhofer/pipp + - support for 'print', 'dirname', 'implode', 'str_replace', + - various grammar fixes + + ECMAScript + + add 'quit', 'readline' builtins + + fix 'Boolean' type and 'print' builtin + + Lua + - left the nest and is now at http://github.com/fperrad/lua/ + + Rakudo + - left the nest and is now at http://github.com/rakudo/rakudo/ + - build instructions can be found at http://tinyurl.com/rakudo + + lazy-k + - left the nest and is now at http://github.com/bschmalhofer/lazy-k.git + + unlambda + - left the nest and is now at http://github.com/bschmalhofer/unlambda/ + + WMLScript + - left the nest and is now at http://github.com/fperrad/wmlscript.git + + removed Zcode implementation + - Tools + + pmc2C + - ATTRs are now inherited automatically in subclassing PMCs + - Deprecations + + Parrot_readbc, Parrot_loadbc renamed to Parrot_pbc_read, Parrot_pbc_load. + + .HLL_map directive in favour of 'hll_map' method on Parrot interpreter + + Data::Escape library + - Tools + + pbc_disassemble options added + + pbc_dump renamed from pdump + - Miscellaneous + + Parrot is now Copyright Parrot Foundation + + Parrot's SVN repository is now hosted at https://svn.parrot.org + + Various code cleanups, consting, 64-bit incompatibilities and other bug fixes + +2009-01-20 Release 0.9.0 + - Implementation + + Implemented bytecode annotations + + Role composition is now aware of multi-subs + + Unbuffered IO PMCs now autopromote when buffering is necessary + + Installation parrot binary and libparrot shared library now supported + + Class registry now respects HLLs + - Compilers + + IMCC + - removed keyed string indexing, e.g. $S0[1]. + - removed slice syntax, e.g. $P0[1..2] + - removed .namespace /.endnamespace pair + - fixed 'new $P0, [classname]' syntax + + PIRC + - refactoring of various data structures + - various bug fixes and updates + - complete bytecode generation + - add '-x' commandline option to run compiled code + + PCT + - add 'hll' and 'subid' attributes to PAST::Block + - refactor loop handling code to handle last/redo/next + - add :pasttype('stmts') and :pasttype('null') + - improve "scope not found" error message + - allow PAST::Val nodes to contain block references + + PGE + - add "skipkey" option to PGE::OPTable + - allow spaces before modifiers in regexes + - add '(' ~ ')' goal matching syntax + - skip creating a class/grammar if it already exists + - Languages + + Rakudo + - improved error mesages in multi dispatch + - implemented clone method for all objects + - implemented MAIN sub + - Unicode versions of infix hyper operators + - refactored IO.readline + - basic support for Inf and NaN + - list and array slices with whatever star + - hash slices + - implemented last and redo + - pointy blocks as terms + - refactored variable and parameter passing + - improved assignment semantics + - improved parsing of type names and subs + - mostly implemented parametric roles + - separate types for blocks, subs and methods + - basic support for submethods + - implemented Junction autothreading of user code (not builtins yet) + - eval supports :lang attribute + - proto makes other subs in scope multis, including in role composition + + Befunge + - back to working state + - ported to pir + + Pipp + - add support for predefined constant __CLASS__ and __METHOD__ + - add initial support for static members + - add support for namespaced constants + - constants are now handled as package vars + - variables are now lexical variables + - add support for superglobals in functions + - Call the class __constructor when there is one + - added incomplete support for closures + - removed support for the alternative parsing strategies + - added support for 'elsif' + - added support for 'do-while' + + HQ9+ + - left the nest and is now at https://github.com/bschmalhofer/hq9plus/ + + Eclectus + - left the nest and is now at http://github.com/bschmalhofer/eclectus/ + + m4 + - left the nest and is now at http://github.com/bschmalhofer/m4/ + + Lua: + - add a minimalist user back trace + + PIR + - "does" and "morph" VTABLE interfaces are now overridable from PIR + - Miscellaneous + + Infrastructure + - 'make smoke' now generates Smolder reports sent to + http://smolder.plusthree.com/app/public_projects/smoke_reports/8 + + Improved const and null correctness for C function parameters + + Sped up STRING manipulation (append, chop), improving PGE about 30% + + BOOK + - Added sections about Classes, OO programming, and methods. + - Added information about Annotations, Exceptions, and Handlers + + STM + - Removed non-functional STM subsystem + +2008-12-16 Release 0.8.2 + - Implementation + + fixed lexical semantics + + added the 'capture_lex' opcode + + added automatic resume for nonfatal exceptions + + added multidispatch cache + + applied miscellaneous performance improvements, including startup time + + fixed several bugs and leaks found by Coverity Scan + + removed race conditions from parallel testing + - Compilers + + IMCC + - removed undocumented .param int => syntax + - .line directive now only takes an integer argument + - new .file directive to specify the file name being compiled + + PCT + - properly handles lexical generation and closure semantics + - uses :subid instead of name lookups to reference PAST::Block nodes + - added PAST::Control node type (exception handlers) + + PGE + - add support for and assertions + - Match objects use Capture PMC instead of Capture_PIR + + PIRC + - add macro handling to PASM mode + - disable vanilla register allocation in PASM mode, but do allow optimization + - add tests and bug fixes + - first bits of bytecode generation. No sub calling/returning yet. + - Languages + + Rakudo + - fixed lexical handling and recursion + - refactored subtypes implementation + - support for quotes with multi-character delimiters + - implemented list slices (Positional role) + - list assignment + - reduction meta operators + - hyper meta operators + - cross meta operators + - more builtin functions + - added Nil type + - basic support for protos + - iterator on filehandle objects + - basic support for exception handlers + - warn + + Lua + - added complex & mathx libraries + - merged LuaClosure & LuaFunction PMC + + Pipp + - added support for a return value from user defined functions + - added incomplete implementation of 'require_once' + + Ecmascript + - parser fixes, parses spidermonkey's top level test/shell.js + - Deprecations + + PARROT_API is now PARROT_EXPORT + + PIR + - :lexid is now :subid + - .arg is now .set_arg + - .result is now .get_result + - .yield (in .begin/end_yield) is now .set_yield + - .return (in .begin/end_return) is now .set_return + - .namespace x / .endnamespace x syntax is removed + + Capture_PIR (runtime/parrot/library/Parrot/Capture_PIR.pir) + +2008-11-18 Release 0.8.1 + - Implementation + + added CPAN module Storable 2.12 as a configuration and build dependency + + removed the pseudo PIR opcode 'addr' + + added the 'box' opcode + + fixed 'pop_eh' handling in PIR libraries and examples + + removed usage of .return for tailcalls (use .tailcall instead) + + removed 'get_hash' and 'get_array' from Capture PMC and Capture_PIR + + improved debugger and HLL coordination + + allowed MMD primitive autoboxing + + fixed all known memory leaks in PIR "Hello, world!" + + NCI signatures now JITted on x86-32 platforms (Windows and Linux) + + made the .const directive take a quoted type name instead of a constant + + made IMCC more re-entrant + - Languages + + Rakudo + - refactored Junctions implementation + - added "fire and forget" tool to rebase/rebuild/test Parrot and Rakudo + - updated container/reference semantics + - added more builtin methods and functions + - improved support for multilevel namespaces + - added support for .Str, .succ, .pred in user-defined classes + - implemented pointy blocks on if/loops + - increased STD.pm convergence + - added %*VM hash + - improved MMD candidate sorting + - improved integration of Num and Int + - implemented increment on protoobjects + - added initial support for MAIN subs + - added .PARROT method + + Pipp + - added some predefined constants + - added implementation of the function basename() + + Cardinal (Ruby) + - Added initial support for the classes Proc, Continuation, Queue, Dir, File, and FileStat + - fixed various minor bugs + - fixed broken Regexes + - Compilers + + PCT + - added '.isa' method to PCT::Node + - cleaned up 'immediate block' handling + - allowed arguments to immediate blocks in loops/conditionals + - metaclass objects can now 'add_method' + + PIRC + - integrated macro processing in PIRC's lexer + - integrated heredoc lexer in PIRC executable + - added preprocess and heredoc-preprocess commandline options + - integrated the PASM grammar into PIRC + - added a register allocator to optimize the built-in vanilla allocator + - code cleanups and documentation + - added 'make test' target + + TGE + - updated to work with new namespace/classname syntax + - Deprecations + + PARROT_API will become PARROT_EXPORT + + :lexid will become :subid + - Miscellaneous + + Documentation + - updates and additions to the Parrot book (see docs/book/) + + OpenGL + - minor fixes to Parrot's base OpenGL bindings + - converted OpenGL PIR examples to Perl 6 (two complete, one WIP) + - added simplified OpenGL PIR example for NCI JIT testing + + Tests + - further improvements to parallel tests + - tests no longer leave filesystem breadcrumbs + - more thorough testing of Parrot::Test itself + +2008-10-21 Release 0.8.0 + - Implementation + + float precision expanded to 15 significant digits from 6 + + large integers autopromoted in PIR so as not to lose precision + + improved precision of complex square root + + exception handlers can register types of exceptions they catch + - Languages + + Cardinal (Ruby) + - implemented gather, take, and yield builtins + - Range, Time, Math, GC, Kernel classes + - many more tests + - added a new committer + + Markdown : new lightweight markup language + - start implementation with PCT/NQP + + partcl (Tcl 8.5.4) + - Moved to its own repository: http://code.google.com/p/partcl/ + + Rakudo (Perl 6) + - split() works with regexes + - implemented Str.comb + - ord() and chr() builtins + - improved parsing of literal numbers + - support for hyphens and dashes in identifiers + - next() on for-loops + - fixed floating point constant precision + - improved namespace handling, closer to STD.pm model + - support for exporting symbols + - Compilers + + P6object + - now generates classes in nested namespaces instead of :: names + - supports class creation in caller's HLL namespace + + PCT / PGE + - now using true nested namespaces instead of :: names + - cleaned up HLLCompiler interactive prompts and readline mode + - updated to use typed exception handler registration + - added initial support for loop control exceptions + + PIRC + - fixed Heredoc preprocessor + - cleaned up Macro preprocessor + - many code clean-ups, warning fixes and consting + - updated Makefile for easier compilation + + IMCC + - Added .tailcall syntax to replace .return in tailcall context + - Examples + + pirric (BASIC) + - an old style line numbered Basic interpreter able to use parrot objects + - example connecting to mysql via nci + - example using classes to write and run an embedded Basic program + - Documentation + + Book + - Added chapters for PCT, PMCs, and Opcodes/Runcores + - Expanded and improved formatting in various chapters + - Renumbered chapters + +2008-09-16 Release 0.7.1 + - Implementation + + add -I and -L command line options + + support for null strings in NCI calls + + preliminary support for resumable exceptions + + add '.hll_map' method for dynamic HLL type mapping + + more parrot_debugger fixes + + remove obsolete '.past' extension + - Languages + + Rakudo (Perl 6) + - now over 3300 passing spectests + - precompiled modules + - precompiled scripts (--target=pir can now be executed standalone) + - Support for @*INC and %*INC varialbes + - additional builtin methods and subs + - added 'fail' function, warnings on use of undefined values + - m/.../ regexes + - qq, qw, q quoting forms + - run tests in parallel + - gather/take + - Perl6MultiSub + + Cardinal (Ruby): + - 'require' and precompiled modules + - many new tests + - all Array tests pass + - regexes + - default arguments to functions + - new committer + - Compilers + + PCT: + - add :loadinit attribute for PAST::Block + + PIRC: + - major refactoring to allow all PIR keywords as identifiers + - links to libparrot now, so all Parrot ops are recognized as such + - implemented .loadlib, .HLL_map, .HLL + - Miscellaneous + + add Xlib and Mysql modules and test programs to NCI examples + + many updates and cleanups to PDD documents + +2008-08-19 Release 0.7.0 + - Specification + + PDD27: add multisub lookup + - Implementation + + new concurrency implementation (see PDD25) + + Exception PMC now captures a return continuation + + improved PMC encapsulation (Iterator, Key, Pair) + - Languages + + Cardinal (Ruby): + - class variables + - parsing improvements + - minor additions to class builtins + - add support for block parameters to functions + + Lua: + - various language fixes + - refactor all libraries (namespace, method registration) + - add a OpenGL binding (still incomplete) + - lost user back trace (see ppd25 & pushaction) + + Pipp (PHP): + - add support for while- and for-loops + - add support for increment and decrement + - designate PHP 5.3 as the reference implementation + - improve support for string literals + + Pugs (Perl 6): + - removed due to bit rot + + Rakudo (Perl 6): + - now over 2200 passing spectests + - updated the Rakudo roadmap + - Perl 6 multi dispatch + - dispatch with slurpies + - class attributes ("my $.x") + - anonymous classes + - OO and metaclass improvements (.WHAT, .WHICH, .WHENCE) + - additional builtin methods and subs + - improved make test targets and harness + + Tcl: + - implement [lreverse], [lsort -command] + - allow [incr] to autovivify + - update tclsh spec target to 8.5.3 + - fix bug in TclDict PMC, allowing ~200 more [dict] spec tests to pass + - update 'make spectest' fudging, using TODO instead of SKIP if possible + - Compilers + + PCT: + - :scope('register') for PAST::Var nodes + - allow invocant specification in attribute scope PAST::Var nodes + - correct ordering of sub generation from POST + - add 'loadinit' attribute to PAST::Block for block initialization + + PIRC: + - PIR registers now use the vanilla register allocator + - all PASM output now uses PASM registers + - all .locals and $registers are mapped + - clean-up of grammar, back-end and documentation + - implemented constant folding + - implemented instruction selection + - Configuration + + tests now clean up after themselves + + improved parallel test support + + ports/cygwin added + + Darwin problems fixed + - Tools + + parrot_debugger renamed from pdb, numerous tweaks + - Miscellaneous + + IMCC cleanups + + :vtable implies self in PIR + + modest core speed improvements + + Cygwin support improved + + "say" now an opcode (was dispatched to a method; see Deprecations) + - Deprecations + + ".pragma n_operators" is deprecated + + old PASM register syntax (without "$") is deprecated + + bare (unquoted) method names are deprecated + + "#line" will be replaced with ".line" + + ".HLL_map" syntax will change + + ".loadlib" is now separate from ".HLL" + + mmdvtregister and mmdvtablefind opcodes are deprecated + + removed getfd, getclass opcodes + + removed IMCC syntax that treated some methods as builtins + + removed numeric get_attr and set_attr vtable entries + +2008-07-15 Release 0.6.4 + - Documentation + + removed a lot of old information from the FAQ + + improved function level documentation + - Configuration + + removed the configuration item 'has_gnu_m4' + + refactored ICU-detection + - Languages + + ChitChat + - improved the Smalltalk implementation + + Pipp + - renamed Plumhead to Pipp + - support for a lot of builtin functions. + - Pipp now uses PHP specific data types. + - converted from PCT with TGE to PCT with NQP actions + - improvements in the PCT variant by using optok parsing + - start of object support + + pir + - simple assignments work + + json + - added a PCT-based implementation of JSON parsing + + lolcode + - improved handling of symbols + - added support for block handling + - added support for globals + + Lua + - more tests + + Rakudo + - updated Range implementation + - added enums + - added generic type declarations (::T) + - added runtime mixing of roles with 'does' and 'but' + - fixed handling of implicit lexicals ($_, $!, and $/) + - fixed implicit method calls on $_ + - improved complex math builtins, added Complex + - moved many builtins to class Any + - declaration of lists of variables now work + - improved test infrastructure + - 910 additional passing spec tests since last release + - more convergence with STD.pm grammar + - added named 0-ary parsing and ops + - Compilers + + PCT: + - allowed subroutine and method names to be a PAST tree that produces the name + - Improved lexical handling + - Tools + + pbc_disassemble renamed from disassemble + - Implementation + + allowed .macro_const in PIR + + added the flag :lexid(...) for subroutines + + made multiple dispatch work for sub types + + fixed garbage collection bug related to the metadata attached to a PMC_EXT structure + + added a warning when using deprecated opcodes + + simplified the stacks implementation + + fixed C++ build + + improved closure and lexical support + + improved IMCC register allocator + + added cache for all runtime-constant strings, reducing memory usage + - Miscellaneous + + improved OpenGL/GLU/GLUT bindings + + added a standard profile for Perl::Critic coding standard testing + + added support for smoke testing with Smolder + + enabled use of Test::Harness 3.0 if available, but don't require it for 'make test' + + added the executable 'parrot_config' to query Parrot configuration + +2008-06-17 Release 0.6.3 + - Specification + + updated pdd09_gc.pod + - Languages + + Cardinal: + - dramatically improved parsing speed + - added support for defining and instantiating classes + - started fleshing out the builtin class hierarchy + - added support for hashes and arrays + + Chitchat: added the start of a smalltalk compiler + + Pheme: updated to match PGE changes + + Pynie: return statement, other minor updates + + Rakudo: + - added working list and hash contexts + - added 'return' statements + - added => pair constructor + - added ?? !! ternary + - added Range, range operators, Complex + - added common List, Hash methods + - refactored base classes + - added Mutable, Perl6Scalar classes + - added type-checking, is readonly/rw/copy for parameters + - added make localtest, docs/spectest-progress.csv + - fix named unaries + + Squaak: implement return statement + + Tcl: updated control flow exceptions to use new builtin types + - Compilers + + All tools converted to P6object metamodel + + PGE: + - is now a zero-width match + - reduced backtracking to improve parsing speed + + PCT: + - added "return" PAST.op node type for subroutine returns + - added "keyed_int" scoping to PAST::Var + - fixed calls to closures + - automatically transcode 7-bit unicode to ascii for faster processing + + NQP: added "return" statement, ?? !! ternary operator + - Configuration + + expanded step gen::opengl + - Implementation + + updated function and macro names to match pdd09_gc.pod + + removed Super PMC + + add ".namespace []" as alternative to ".namespace" + + "make codetest" target runs standard coding tests + - Miscellaneous + + added P6object class for Perl 6 interfaces to objects in Parrot + + ported OpenGL/GLU/GLUT bindings to Win32, BSD, and more Mac OS X variants + + generate OpenGL/GLU/GLUT bindings by parsing system headers + + new OpenGL example shapes.pir, covering basic OpenGL 1.1 / GLUT 3 APIs + + new float4.pir structure-packing benchmark + + reduced memory use for variables + + improved constant string caching + + made code g++ and gcc (with optimizations) safe + + the usual collection of bugfixes and optimizations + +2008-05-20 Release 0.6.2 + - Specification + + updated and launched pdd28_strings.pod + + updated pdd19_pir.pod + - Implementation + + added implementation of Rational PMC. + + simplified ops control flow syntax + + enabled backtrace on non-glibc platforms too + + improved some PIR error reporting + + removed user stack opcodes + (save, restore, lookback, entrytype, depth, rotate_up) + (NOTE: This was scheduled to occur after 0.7.0, moved up to this release) + + removed register stack, saveall, and restoreall opcodes + + removed various deprecated features and unused code + - Languages + + Amber: retired + + C99: grammar updated + + Cardinal: resurrected, method calls and do blocks work now + + Eclectus: use NQP as PAST generating code + + Lua: + - added big number library + - updated to match PGE changes + - added a bytecode disassembler & a Lua 5.1 VM bytecode translator + + Pheme: updated to match PGE/PCT changes + + Plumhead: + - use NQP as PAST generating code + - use riaxpander for macro expansion + + Rakudo: + - updated ROADMAP + - conditional and loop statement modifiers + - lots of class, object, role, and method improvements + - Str increment and decrement + - improved spectest reporting + - type checking on assignment + - regexes and grammars + - undef and self + - placeholder vars + roadmap updated + + Squaak: added to repository + + TAP: retired + - Compilers + + PGE: updated to match Synopsis 5, deprecated features removed + + PCT: + - improve handling of register types, conversion between registers + - improved error diagnostics + - add 'arity' to for loops + - Configuration + + added step auto::opengl + + added step gen::opengl + + added step gen::call_list + - Miscellaneous + + still more optimizations and performance improvements, especially in GC + + new libraries: OpenGL/GLU/GLUT bindings (small subset working) + + new dump_pbc.pl utility: PBC disassembly/source code weaver + + improved C++ compiler support + + optimized builds work again + +2008-04-15 Release 0.6.1 + - Specification + + drafted pdd29_compiler_tools.pod + + updated pdd28_character_sets.pod draft + + updated pdd19_pir.pod draft + - Languages + + c99: added independent C pre-processor + + HQ9+: reimplemented with PCT + + Lua: + . reimplementation with PCT, using PAST and POST + . behavior aligned wih 5.1.3 + + Rakudo: + . implemented basic I/O, including '$*IN', '$*OUT', '$*ERR', 'prefix:=' + . implemented simple typing and runtime type checking + . added basic multi-method dispatch + . expanded named argument handling, including Pair and colonpairs + . added 'Whatever' and 'Capture' classes + . implemented 'handles' trait verb + . added 'loop' statement + . implemented 'given', 'when', 'for', 'while', 'until' statement modifiers + . implemented Hash methods '.keys' and '.values' + . fixed bug to get '.WHAT' working correctly + . initial implementation of 'eval' + - Compilers + + NQP: + . created a bootstrapped build, see 'make boot' + . added 'infix:<', 'infix:<=', 'infix:>', 'infix:>=' relational operators + . added 'postfix:++', 'postfix:--' operators + + PCT: + . added methods specifying default behaviors in PAST, reducing repeated code + . improved symbol table lookup + + PGE: + . removed deprecated code including: P6Regex, P6Grammar, PAST-pm + - Miscellaneous + + notable speedups during compilation and execution of parrot and HLLs + + pdb (the parrot debugger) can now catch parrot exceptions + + better detection of glibc and gettext during configuration + + various bugfixes, code cleanups, deprecations, and coding standard fixes + +2008-03-18 Release 0.6.0 + - Specification + + launched pdd18_security.pod + + updated pdd17_pmc.pod + + launching draft of pdd28_character_sets.pod + - Documentation + + cleanup of IMCC documentation + - Configuration + + add step auto::gettext + + add step auto::crypto + - Compilers + + PCT: + . Fix '-e' option + . Phase out P6Regex in favor of Perl6Regex + + IMCC: + '.local Array my_arr' is illegal now + - Languages + + C99: reimplementation with PCT + + lolcode: + . various updates + . add support for functions with params + . add math functions + + Rakudo: + . support for 'say' + . first cut at smart matching + . indirect method calls + . support for Pairs + . added methods 'grep' and 'first' + . implement auto{increment,decrement} + . initial implementation of 'perl6doc' + + Lua: + . various updates + . add base64 library + + Cardinal: basic support for functions with parameters + + Pheme: various updates + + Ecmascript: various updates + + Tcl: now targeting tcl 8.5.1, no more expected failures in test suite. + (No, this doesn't mean everything's implemented. =-) + + Eclectus: various updates + + WMLScript: various updates + - Implementation + + PDD17 (PMCs) + + Add library YAML::Dumper + + Add the MD2, MD4, MD5, RIPEMD160, SHA & SHA1 PMC, as a wrapper + around libcrypto + - Miscellaneous + + various bugfixes, code cleanups and coding standard fixes + + consting + + remove external Perl 5 modules from the Parrot distribution + +2008-02-20 Release 0.5.3 + - Documentation + + PDD09 (garbage collection) - approved + + PDD28 (character sets) - draft started + + added function documentation to some core functions + + PCT beginners guide, optable guide and PAST nodes guide, bug fixes + - Compilers + + IMCC: plugged various memory leaks and other cleanups + + PCT: + . add "attribute" as a scope variant to PAST::Var nodes + . add 'shift' and 'pop' methods to PAST:: nodes + + NQP: add '=:=' op, tests for scalar and list contextualizers, \x escapes + - Languages + + APL: reimplementation with PCT + + Cardinal (Ruby): re-implementation with PCT + + Ecmascript: reimplementation with PCT + + lolcode: improved expression parsing, ifthen, IT, YARN + + lua: + . aligned with Lua official release 5.1.3. + . added initial PCT-based implementation. + + Punie (Perl 1): refactor to use standard PCT-based filenames + + Pynie (Python): add functions + + Rakudo (Perl 6): + . rebranded, formerly known as 'perl6' + . passes many more official Perl 6 Specification tests + . added 'perl6doc' utility + . oo including meta?classes, objects, methods, attributes, role composition + . match variables, while/until statements, traits + . many new methods for Str, List, Hash, Junction + - Implementation + - Deprecations + + PCCINVOKE syntax for named arguments using []; use () instead. + + see DEPRECATED.pod for details + - Miscellaneous + + pbc_to_exe refactored for code reduction, portability, and maintainability + + various bug fixes + + #line directives added to generated JIT files, improving debugging + + consting, attribute marking, refactoring, warnings cleanup + +2008-01-15 Release 0.5.2 + - Documentation + + PDD27 (multiple dispatch) - debut of new design + + Numerous small updates to glossary.pod, etc + - Compiler Toolkit + + NQP: optional, named, and named/required parameters + + PIRC: cleanups + + PAST: "defined-or" + - Languages + + New mk_language_shell.pl script creates language stubs + + LOLCODE: new + + Lua: various + + Eclectus: start with support for local variables and procedures, + use SXML as intermediate representation + + Perl 6: list builtins, compiler directives, command-line options, etc. + + "make perl6" now builds a Perl 6 executable + + punie: more builtins, control structures, code refactoring + + pynie: builtin stubs, more tests + - Implementation + + New "pbc_to_exe" utility turns bytecode to executables + + New set_outer method for subs + + Further configuration refactoring for testability + + All functions now completely headerized + + Concurrency: interpreter schedulers + - Deprecations + + DYNSELF (changes to SELF; SELF to STATICSELF) + + METHOD (replaced by renaming PCCMETHOD) + + pmcinfo op (superseded by 'inspect') + + get_attr, set_attr, and 8 other vtable methods + + See DEPRECATED.pod for details + - Miscellaneous + + Many bug fixes + + Minor speed enhancements with UTF-8 string handling + + Debian packaging + + consting, attribute marking, warnings cleanup, memory leaks plugged ... + +2007-12-18 Release 0.5.1 + - Documentation + + PDD19 (PIR) - reflect state on the ground; incorporate old IMCC docs + + PDD25 (Concurrency) - launch out of draft + + Improve documentation of deprecated parrot features. + - Compilers + + PCT: Parrot Compiler Toolkit redesigned and updated + + NQP: major updates, including support for namespaces, + module/class declarations, methods + + IMCC: remove .sym as alias for .local. Remove .pcc_ + prefix for calling directives (.pcc_begin became .begin_call). + + PIRC: creates an AST during the parse. + + PGE: more updates to match S05 syntax. + - Languages + + perl6: re-implemented using PCT and NQP, new object subsystem + + abc: re-implemented using PCT and NQP + + eclectus: initial implementation + + plumhead: add PCT variant + + punie: re-implemented using PCT and NQP, extended to handle subroutines + Happy 20th Birthday, Perl! + + pynie: re-implemented using PCT and NQP + + PIR: start conversion to NQP (under construction) + - Implementation + + new opcodes: 'die', 'addhandler', 'copy' + + Initial implementation of Concurrency PDD + + Add 'arity' method to Sub and NCI PMCs + - Miscellaneous + + Bug cleanup + + consting, attribute marking, warnings cleanup, memory leaks, GC... + + dead code removal (includes some defunct languages) + +2007-11-20 Release 0.5.0 + - Implementation + + PDD15 (OO) branch merged with trunk; this release contains a working, + tested implementation of the latest OO model + + Added pop_eh/push_eh_p/count_eh opcodes + + Add --runcore command line option + + Add gcdebug runcore to help track down GC bugs + + minor improvements to IA-32 JIT + - Documentation + + PDD19 (PIR): updates to macros, .pcc* directives + + PDD25 (Concurrency): updated + + PDD26 (AST): draft approved + + PDD23 (Exceptions): draft approved + + Copyright cleanups + - Languages/Compilers + + languages/APL: minor updates, PDD15 conformance + + languages/dotnet: minor updates + + languages/lua: minor updates, PDD15 conformance + + languages/lisp: minor updates + + languages/perl6: minor updates, PDD15 conformance + + languages/plumhead: minor updates + + languages/punie: minor updates, PDD15 conformance + + languages/nqp: minor updates + + languages/scheme: many updates, PDD15 conformance, improved tests, use + PMCs instead of primitive registers to represent values + + languages/tcl: bugfixes, PDD15 conformance + + languages/WMLScript: minor updates + + compilers/pirc: updates from PDD19, PDD06 + + compilers/pct: minor updates, PDD15 conformance + + compilers/pge: PDD15 conformance + + compilers/tge: PDD15 conformance + - Configuration + + Improve test coverage + + Improve reporting when a step fails; allow abort on failure + - Miscellaneous + + More coding standard conformance, tests, cleanup, speedups, + warnings cleanup + + Bug cleanup, esp. GC bugs + + Eliminate .imc extension (use .pir) + + Simplify some core config steps to not allow interactive prompting + - Removed + + clear_eh opcode + +2007-10-17 Release 0.4.17 + - Implementation + + Bug fixes (including Coverity IDs 20, 22, 30, 119-122, 124-126, 129-131) + Also various GC, memory, and segfault issues + + Fix & reenable CGP core + + Parrot's -r flag now works again (compile to and execute bytecode) + + Updates to pmc2c & PIR syntaxes + + Fix Complex PMC + + Minor performance improvements, especially in PGE + - Documentation + + PDD02 "Vtables" - superceded by PDD17 + + PDD06 "PASM" - minor updates + + PDD17 "PMC" - add VTABLE syntax, update core PMC struct, restore UnionVal + + PDD19 "PIR" - early review started + + PDD21 "Namespaces" - cleanup + + PDD24 "Events" - draft approved + + PDD25 "Concurrency" - minor updates + + PDD26 "AST" - draft version begun + + PIR tutorials updated + - Languages/Compilers + + Make scheme work with the current calling conventions, other major work. + + Updates to m4, lua, compilers/pirc, languages/PIR, dotnet, tcl + - Miscellaneous: + + make -j functional again + + Code cleanup (refactoring, optimizations) + +2007-09-18 Release 0.4.16 + - Implementation: + + Performed code review on every PMC + + Modified PMC code generation to use Storable, reducing compile times + + Added a makefile target to generate test coverage data of C sources + - Languages: + + NQP: added lists, for loops, operators, comparison and multiplicative operators + + Announced Kea-CL, Kea Common Lisp, an ANSI Common Lisp implementation + The repository is available at https://rgrjr.dyndns.org/svn/kea-cl/trunk/ + - Documentation + + PDD17 "PMCs" - draft approved, the design is complete + + Added more PIR tutorials, see examples/tutorial/00_README.pod + - Miscellaneous: + + Many bugfixes, enhancements, documentation, and coding standard updates + + Deprecated PMC constants and other crufty syntax, see DEPRECATED.pod + + Improved icc compiler compatibility for error line reporting + +2007-08-22 Release 0.4.15 + - Implementation: + + Lots of code review, many bugs fixed + + Many more code cleanups and compiler warning levels + + Started a new jit engine for 64-bit processors + + Refactored configure process, with tests and new diagnostic options + + Added new CodeString PMC for dynamic generation of PIR code + + More pdd15 support for object metamodel. + - Languages: + + Added NQP ("Not Quite Perl"), a very lightweight Perl 6-like language + + Significant improvements and refactors to PCT (Parrot Compiler Toolkit) + + perl6 passes more spec tests + + Lua works now with a PGE/TGE/PAST-pm based compiler, lives in one pbc, + and the interpreter has same behavior as original. + - Documentation + + Added a committers' HOWTO + + More PIR tutorial examples + + Added PAUSE guide + +2007-07-17 Release 0.4.14 + - Now, with Seat Belts! + + added makefile targets for Sun lint, BSD lint, and splint + + corrected many errors picked up by these tools + + decorated source code with compiler hints, assertions, and attribute macros + + automated creation of function declarations to prevent common errors + + increased compiler warnings levels + + converted more exceptions to a recoverable form + - Languages: + + updated Lisp, Lua, Perl 6, tcl, regex, Scheme ("Pheme") + + Perl 6 now fetches selected tests from pugs, and even passes some + + PGE modified to handle {*} action subs for top-down and bottom-up parsers, + and to allow grammar subclassing + + HLLCompiler now has better exception, eval, and exit support + + Introduced PCT, a refactor of HLLCompiler and PAST-pm + - Design: + + PDD15 "Objects" - details added to 'new' and 'getattribute' opcodes + + PDD17 "PMCs" - notes added on instantiation and dynamic extention in PIR + - Documentation: + + added Parrot-related text from "Perl 6 and Parrot Essentials" book, + tutorial examples from "Learning PIR" talk, and PDD15 metamodel diagrams + - Implementation: + + reduced memory footprint when using named registers + + implemented overridding of vtable methods by PDD15 classes + + improved PDD15 support for 'new', 'instantiate', and others + + added makefile targets to ease core and HLL makefile regeneration + + updated parrot dubugger, "pdb", to allow loading of commands from file + - Misc: + + many bugfixes, enhancements, documentation, and coding standard updates + +2007-06-19 Release 0.4.13 + - Languages: + + Updated Lisp, Lua, PHP ("Plumhead"), Python ("Pynie"), ABC, + WMLScript, and Tcl ("ParTcl"). + + Perl 6 passes all of the sanity tests. + + PGE supports latest Perl 6 grammar syntax. Perl 6, Python + ("Pynie"), and ABC parsers updated to match. + + Updated PHP ("Plumhead") to Antlr 3.0. + + Lua added the beginnings of a PGE/TGE based compiler (not yet + replacing the Perl/Yapp compiler). + + Lisp updated for current features, added a test suite. + - Core Implementation: + + Filled in features and backward compatibility for PDD 15 objects. + New object metamodel passes 85% of old test suite. + + GCC API symbols are visible externally only when explicitly exported. + + Added generated GCC compiler attributes to increase warnings, and + cleaned up resulting warnings. + + Code cleanup efforts and fixed memory leaks by the cage cleaners, + resulting in notable speed increases. + - Misc: + + Updated Parrot distribution to Artistic License 2.0, from dual + Artistic 1/GPL license. + + SDL examples brought up-to-date with current features. + +2007-05-15 Release 0.4.12 + - Build: + + even more refactorings and improvements in configuration system + + improved tests and documentation for configuration system + - Languages: + + Updated abc, PHP ("Plumhead"), Lua, Tcl + + Reclaimed Lisp + - Design: + + new PMC PDD draft partially completed + - Implementation: + + continued implementation of PDD 15 (Objects) + + minor garbage collector and memory management improvements + + several memory leaks resolved + + extended support for compilers other than GCC + + improved C++ compiler compatibility + + enhanced support for Solaris, non-MSVC Win32, and other platforms + +2007-04-17 Release 0.4.11 + + - Compilers: + + IMCC: added documentation for C-based Parrot Calling Conventions, + refactorings and bug fixes + + PGE: new perl6regex front end reflecting recent S05 syntax changes + + PIRC: new prototype PIR parser + - Languages: + + Updated Lua, PHP ("Plumhead"), BASIC, pynie + + Lua implements environment + - Design: + + PDD15 "Objects" - details added, and draft approved + - Documentation: + + Added guidelines for PMC documentation + - Implementation: + + PDD15 implementation is largely complete, including role-based composition, + introspection, and C3 method resolution order + + new Exporter PMC for importing globals between namespaces + + new string utilities for radix conversion + + PCCINVOKE and Parrot_PCCINVOKE allow calling using the full Parrot Calling + Conventions from PMCs and C code respectively + - Build: + + Refactorings and improvements in test coverage for 'Configure.pl' + - Misc: + + many bugfixes, enhancements, and code cleanup + + added example subversion config file + + extended support for gcc, icc, and other compilers + + extended support for Solaris and other platforms + +2007-03-20 Release 0.4.10 + - Compilers: + + IMCC: Parrot calling conventions now available between two C PMCs (PMINVOKE) + + PGE: Match object improvements + + smop: added Attribute and Class PMCs + + HLLCompiler: improvements for interactive mode + - PAST: + + extended binding to a list of variables + - Languages: + + Updated Lua, PHP ("Plumhead"), Tcl ("ParTcl"), Ruby ("Cardinal") + + Update PIR, regex, Zcode + + New language: Pynie - a Python compiler for Parrot + + Lua implements require and many other ops, improved regex support + + Remove parakeet + - Design: + + PDD01 "Overview" - updated architecture and platform information + + PDD15 "Objects" - details on roles, objects, and classes added + + PDD22 "I/O" - added async ops and Status PMC details + - Documentation: + + Added guides for Metacommitter, Relase Manager, and Cage Cleaner roles + - Implementation: + + Object, Class, Role, and Attribute PMC implementation has begun + + Perl 5 module "Parrot::Embed" now compiles and links on all platforms + - Build: + + Major improvements in test coverage for 'ops2c.pl' + - Misc: + + New utility: Crow, a template processor + + New library module: Config/JSON for reading/writing JSON files + + many bugfixes, enhancements, and coding standard updates, code cleanup + +2007-3-10 coke + + * removed parakeet + +2007-02-22 Release 0.4.9 + - Compilers: + + IMCC: Parrot calling conventions now available in C PMCs, allowing + named, optional, slurpy, and flat parameter passing + + PGE: extended support for Perl 5 Regexes + + smop: prototype object model implementation + + hllcompiler: refactored to run a configurable set of compilation stages + - PAST: + + redesigned assign/binding to support Perl 6 binding semantics + - Languages: + + Updated Lua, PHP ("Plumhead"), Tcl ("ParTcl"), perl6, perl5 + + New language: PIR - a PGE-based implementation of Parrot PIR + + perl6 now supports binding (':=') and 'join' + + lua generates tail calls, and supports its own regex flavor (PGE-based) + + Pheme still works, huzzah! + - Design: + + PDD21 "Objects" - rewritten + + PDD22 "I/O" - updated and 'TODO' tests added + - Documentation: + + Interface stability classification standards approved + + Roles and Responsibilities documented approved + + Official 'drafts' directory created (was 'clip') + - Implementation: + + More NameSpace and OS PMC methods implemented + + Parrot executable fullname and basename now available in PIR/PASM code + + new 'chomp' library function + - Build: + + Major improvements in test coverage for 'ops2pm.pl' + - Misc: + + many bugfixes, enhancements, and coding standard updates + + extended support for Sun Workshop Compilers + + Parrot now builds on PocketPC platform + +2007-01-17 chromatic + + * changed 'name' method on namespaces to 'get_name' per pdd21 + + Release 0.4.8 + - Compilers: + + HLLCompiler: added tracing options, modified api + + PGE & TGE bugfixes and updates + - PAST: + + added global and lexical variable support + + added looping constructs, arrays, hashes + - Languages: + + Updated PHP ("Plumhead"), Tcl ("ParTcl"), + forth, perl6, lua, abc, APL, WMLScript, punie + + ParTcl is passing > 24.9% of Tcl cvs-latest test suite + + perl6 now supports hashes, arrays, method calls, arity-based + multisubs, quoted terms, ranges (non-lazy), try blocks, $! + - Design: + + PDD01 "Overview" - updated + + PDD22 "I/O" - rewritten and approved + - Test Suite: + + Converted Perl 5 Regex tests to PIR, with notable speedup + + Added tests for opcodes, compilers, languages, and coding standards + - Build: + + Major improvements in test coverage for 'pmc2c.pl' + - Misc: + + many bugfixes, enhancements, and coding standard updates + + extended support for non-core platforms including Cygwin, Tru64 + +2006-12-12 particle + + * added C opcode + +2006-11-14 Release 0.4.7 + - New languages: PHP ("Plumhead"), Forth + - Updated languages: Ruby ("Cardinal"), Tcl, Lua + - Remove old Python implementation from Parrot repository; the new Python + language code is hosted at http://pirate.tangentcode.com + - Compilers: + + PGE updated with more expressions, latest changes to S05 + + new Perl 6 grammar compiler + - Integration: + + Perl 5 module "Parrot::Embed" allows easy embedding of a Parrot + runtime into a Perl 5 program + - PIR: + + new :init pragma for subs that must run before the main function + + new :vtable pragma to identify subs that override PMC vtable methods, + eliminating the need for special subroutine names + + PIR parser/compiler does not stop on first syntax error + + Vanilla register allocator ("register alligator") greatly improves + performance compiling large functions + + Eliminated limit on number of PIR macros + - PMCs: + + hash lookups return null instead of None for missing keys + - Design: + + PDD13 "Bytecode files: format and manipulation" - new + + PDD10 "Embedding" - new + + PDD25 "Concurrency" - rewritten + + PDD15 "Objects" - new section on redesign requirements + + PDD07 "Coding standards" - significant updates and automated tests + - Test Suite: + + Many many more new tests + - Build Process: + + autoconf compatible install options + - Misc: + + Namespace refinements + + Coroutine improvements + + An impressive swarm of other bugfixes and enhancements + +2006-11-07 tewk + + * added :init pragma functionality to subs + +2006-10-28 jonathan + + * added :vtable pragma functionality to subs + +2006-09-18 chromatic + + * added Parrot::Embed under ext/Parrot-Embed + +2006-08-18 leo + + * remove the None PMC - if needed it can trivially be reimplemented + in languages from r14189 + +2006-08-16 creiss + + Merged Software Transactional Memory branch into trunk, adds: + * several new opcodes whose names start with stm_ + * read-only PMC support + * several new PMC types (whose names start with STM*) + * support for threads (again) + +2006-08-08 Release 0.4.6 + - New languages: Ruby ("Cardinal"), Javascript ("ecmascript") + - Updated languages: Tcl, dotnet, bc, Pheme, Punie, WMLScript + - Updated compilers: PGE, TGE + - IMCC updates: + + ".loadlib" directive expresses dependencies + + ".namespace" with no parameter goes to HLL root + + lexer is reentrant (reentrant grammar in progress) + - Namespace improvements: + + new suite of opcodes to access namespaces and globals + ("find_global" and "store_global" will be phased out) + + namespace '' no longer means HLL root + - Design document updates: + namespaces (pdd23), basic types (pdd17), embedding + - Updated tool requirements for developers: + flex 2.5.33, bison 2.1, perl 5.6.1 + - New to-do list for people new to Parrot: + cage/todo.pod + - The usual plethora of bugfixes and enhancements + +2006-08-02 chip + + * opcodes: "in PMC" is no longer a synonym for "invar PMC"; + there are opcodes now that want the real "in PMC". + * namespace and global opcodes now accept name arrays again, as + well as keys; the corresponding namespace PMC methods are gone. + +2006-07-25 chip + + * add experimental op find_type_i_p + * fix longstanding bug that sometimes didn't encode pasm keys as + Key PMCs (specifically "[S0]" and "['stringliteral']"). + +2006-07-24 chip + + further implementation of new pdd21: + * new opcodes {get,set}*global + (old {find,store}*global will be supported for a short while) + +2006-07-21 leo + + * Parrot_x_exit, Parrot_x_on_exit take now an Interp * argument + + +2006-07-20 audreyt + + * --maintainer prerequesites are now bison 2.2+ and flex 2.5.3x + (or some such --leo) + (at the moment code is checking for 2.0 -- ambs) + +2006-07-17 chip + + partial implementation of new pdd21: + * old: "get_namespace KEY". new: "get_hll_namespace KEY" + * get_namespace and find_global opcodes no longer accept arrays + of strings. To use arrays, call namespace object methods. + +2006-06-19 Release 0.4.5 + - unicode subroutine names + - hierarchical class names finished including MMD support + - new dotnet CLI to PIR translator + - improved TGE code and compiler + - APL: vector handling + - new STM branch in the svn repository + - the usual bugfixes and enhancements + +2006-06-03 leo + + * I and N registers are never cleared to 0 / 0.0 on subroutine entry + +2006-05-14 Release 0.4.4 + - hierarchical class names + - APL compiler + - under development + - understands simple vector ops, strings + - demonstrates use of Unicode in Parrot + - pgc, a compiler for rules and operator precedence parsers + - Major redesign and improvements for PGE + - compilers understand named parameter options + - :ratchet option implemented to support non-backtracking quantifiers + - TGE (tree grammar engine) for tree transformations + - tgc, tree grammar compiler + - perl6 compiler + - support for many operators, lexical scalars, regex matches + - new pheme (Parrot scheme) compiler + +2006-04-30 bernhard + + * Make the Perl PMCs dynamic and move them to src/dynpmc + +2006-04-02 Release 0.4.3 + - namespaces partially implemented + - rulec, Perl 6 rule compiler + - PGE improvements including return values for closure + - parts of a Perl 6 parser based on PGE + - complex trigonometric methods + - type of Sub PMC is now overridable by HLL + - NetBSD support + - many bug fixes and improvements + +2006-03-06 leo + + * Shifted argument type bits left by 2 according to r11754 + change of docs/pdds/pdd03_calling_conventions.pod + * if you are creating PASM then code needs adjustment + +2006-02-22 Release 0.4.2 + - improved PPC and x86 JIT support including JIT compilation + of very simple PASM/PIR subroutines + - preliminary libreadline support + - better trace and debug features + - pkgconfig support + - META.yml to support proper indexing on CPAN + - new opcode: hcf (in "my_ops" in dynamic op library) + - new File pmc for file specific ops (is_dir, is_file, copy, rename...) + - named arguments and parameters (both :named("") and => syntaxes) + - ongoing config improvements + - tons of bug fixes and other small improvements - too much to list all + +2006-01-16 bernhard + + * rename src/dynclasses to src/dynpmc + * rename src/classes to src/pmc + +2006-01-15 leo + + * find_global and friends returns a .Null PMC instead of .Undef on + lookup failure, iff lookup exceptions are off + +2006-01-08 Release 0.4.1 + - Installation: 'make install' is using standard locations now + (/usr/local is the default --prefix) + - Produce static and shared libraries on some systems + - Configure system rearragement + - OS pmc started (mkdir,cd,cwd,rm,umask,stat) + - Shootout examples + - Test files are now testable with 'prove' + - Smoke (and smokej) outputs progress + - PIR supports: I = A < B (>,<=,>=,==,!=) + - Add support for octal number constants + - partcl updates: + - almost finish [string]; start [file] + - add build tool for generating inline'd tcl builtins from templates. + - Jako updates: NCI, subroutines, global variables and constants all work. + (Gregor) + +2005-12-28 particle + + * renamed all .imc files to .pir + * modified all doc references to .pir as well + +2005-12-13 particle + + * moved jit/ directory to src/jit/ + +2005-12-12 particle + + * moved io/ directory to src/io/ + * moved classes/ directory to src/classes/ + * moved dynclasses/ directory to src/dynclasses/ + +2005-12-08 particle + + * moved types/ directory to src/types/ + * moved pf/ directory to src/packfile/ + * moved ops/ directory to src/ops/ + +2005-12-08 particle + + * moved charset/ directory to src/charset/ + * moved encodings/ directory to src/encodings/ + +2005-12-07 particle + + * moved imcc/ directory to compilers/imcc/ + +2005-12-06 particle + + * moved util/ directory to tools/util/ + * removed imcc/examples/ directory + * moved ast/ directory to compilers/ast/ + +2005-12-05 particle + + * moved imcc/docs/ directory to docs/imcc/ + * moved build_tools/ directory to tools/build/ + * modified MANIFEST, MANIFEST.generated, and MANIFEST.SKIP + +2005-12-04 Release 0.4.0 + - New lexical handling and closure support including better + introspection for caller and outer + - PGE (Parrot Grammar Engine) provides now compilers for P6Rule, + P6Grammar, P5Regexp, and Glob + - ca. 1000 new tests including 800 for Perl5 regexp + - Improved unicode charset and encoding support + - Calling conventions for exception handlers + - Punie (Perl 1) uses TGE (Tree Grammar Engine) to convert from + PGE match objects to AST via two steps of tree transformation grammars + - New languages: amber and lua + - The usual code fixes, cleanup, and improvements, including an overhaul + of the config and test framework + +2005-11-06 Release 0.3.1 + - Variable sized register frames are finished. Each subroutine gets + the amount of registers that it actually needs. No more spilling. + - Vastly improved PGE (Parrot Grammar Engine) including shift-reduce, + precedence-based expression parser and support for matching of + bracketed text delimited by e.g. ()[]{}'" + - uniccode character classification (is_upper ...) + - support for heredoc syntax in assembler + - improved examples, basic JSON support + - debian packaging support + - the usual improvements, bug fixes, and cleanup + - test count exceeds 3000 + +2005-10-01 Release 0.3.0 + - New calling conventions implemented: see PDD03 for details + - Merge multiple Parrot bytecode (PBC) files into a singe PBC file + - 'make smoke' target going beta + - bc now supports if statements, comparison ops, prefix inc/dec + - ParTcl adds [lassign], [switch] (partially); [expr] converted to a compiler + - Many exciting doc updates, tests, and bugfixes, too numerous to mention + +2005-08-05 Release 0.2.3 + - Dynamic classes now compile on Windows (including ParTcl) + - New Super PMC allows easy access to superclass methods + - Implement C3 method resolution order (just like Perl 6 & Python) + - ParTcl has new PIR-based parser and passes more Tcl tests + - added character class support in Globs to PGE + - added language implementations of unlambda, Lazy-k + - many bugfixes, including GC and memory leaks + - the new calling scheme continued to evolve in branches/leo-ctx5 + +2005-06-04 leo + + * allow short names for object attributes + * string encoding and charset can now be set independently + * experimental mmap IO layer for slurping files + * enable compile opcode support for compilers written in PASM/PIR + * improved HLL support with .HLL and n_operators pragmas + * simplified hash code + * more strength reduce optimizations + * distinct debug and trace flag settings + * glob support in PGE + * new character classification opcodes and interfaces + * numerous bug fixes and enhancements 2005-05-08 leo - * Released 0.2.0 - * parrot repository is now under subversion - * MMD (Multi Method Dispatch) enhanced - * new unary and infix opcodes that return new result PMCs - * dynamic scalar PMCs inherit now almost all from Parrot core PMCs - * more unification of PMCs and ParrotObjects - * tailcalls for functions and methods - * PGE (Parrot Grammar Engine) reworked - * Pugs creates Parrot code and Pugs is a registered compiler now - * new languages/lisp - * the usual bug fixes and improvements + + * parrot repository is now under subversion + * MMD (Multi Method Dispatch) enhanced + * new unary and infix opcodes that return new result PMCs + * dynamic scalar PMCs inherit now almost all from Parrot core PMCs + * more unification of PMCs and ParrotObjects + * tailcalls for functions and methods + * PGE (Parrot Grammar Engine) reworked + * Pugs creates Parrot code and Pugs is a registered compiler now + * new languages/lisp + * the usual bug fixes and improvements + +2005-07-03 Release 0.2.2 + - new call scheme: docs/pdds/pdd03_calling_conventions.pod + - partial implementation of the new calling conventions + PASM only, don't mix PIR foo() call syntax with the new scheme + - grammar and rule support in PGE - the Parrot Grammar Engine + - TCL passes >10% of the tcl test suite + - the usual bugfixes and improvements + +2005-06-04 Release 0.2.1 + - better HLL support (short names for object attributes, and + .HLL and n_operators pragmas) + - string encoding and charset can now be set independently + - experimental mmap IO layer for slurping files + - distinct debug and trace flag settings + - glob support in PGE + - new character classification opcodes and interfaces + +2005-05-08 Release 0.2.0 + - parrot repository is now under subversion + - MMD (Multi Method Dispatch) enhanced + - new unary and infix opcodes that return new result PMCs + - dynamic scalar PMCs inherit now almost all from Parrot core PMCs + - more unification of PMCs and ParrotObjects + - tailcalls for functions and methods + - PGE (Parrot Grammar Engine) reworked + - Pugs creates Parrot code and Pugs is a registered compiler now + - new languages/lisp + - the usual bug fixes and improvements + +2005-03-06 Release 0.1.2 + - New string handling code. Strings now have charset and encoding + - Parts of a generation garbage collector + - Better Python code, separated in dynclasses + - Parrot Grammar Engine + - Improved test coverage and documentation 2005-03-06 leo - * Released 0.1.2 - * big rewrite of string code, not yet finished but ... - * partial implementation of a generational garbage collector - * indirect register frame addressing - * .return(args) PIR syntax - * moved most of the Python code to dynclasses - * a lot more Python functionality - * precalculate opcodes with all constants - * PGE - Parrot Grammar Engine - * scalar classes refactoring - * much more tests and big test system cleanup - * improved documentation - * and as always a lot more + + * big rewrite of string code, not yet finished but ... + * partial implementation of a generational garbage collector + * indirect register frame addressing + * .return(args) PIR syntax + * moved most of the Python code to dynclasses + * a lot more Python functionality + * precalculate opcodes with all constants + * PGE - Parrot Grammar Engine + * scalar classes refactoring + * much more tests and big test system cleanup + * improved documentation + * and as always a lot more + +2004-10-09 Release 0.1.1 + Parrot 0.1.1 is an intermediate release with tons of updates and fixes. + - Python support: Parrot runs 4/7 of the pie-thon test suite + - Better OS support: more platforms, compiler, OS functions + - Improved PIR syntax for method calls and = assignment + - Dynamic loading reworked including a "make install" target + - MMD - multi method dispatch for binary vtable methods + - Library improvement and cleanup + - BigInt, Complex, *Array, Slice, Enumerate, None PMC classes + - IA64 and hppa JIT support + - Tons of fixes, improvements, new tests, and documentation updates. + A lot is unfinished and keeps changing. Nethertheless Parrot is stable + and usable at the surface, while internals are moving. 2004-10-09 leo - * Released 0.1.1 - * Need Perl 5.6 now for building - * Basic AST support, PAST file parser, bits of code generation - * BigInt PMC using GMP - * Complex PMC - * Dynamic loading improved including bundles of PMC classes - * Experimental support for "make install" - * IA64 and hppa JIT support - * ICU unicode support - * IO layer handling code - * IO readline and buffered IO fixes - * Incremental GC - * Internal pythonic functions: filter, map, reduce, max, min ... - * Languages updates for m4, tcl, perl6, regex. New parakeet language. - * Library updates, Stream and SDL library - * MMD - multi method dispatch for binary vtable methods - * Many new array PMCs - * Method call syntax in PIR obj."meth"(...) - * More OS stuff: stat, exec, system, gmtime, piped read and write - * New Python PMCs like Enumerate, None - * Non-branching compare opcodes - * PIR support for += and friends - * Python language subdir - * Python types mapped to existing PMCs - * Slices and range support - * Tons of bug fixes, documentation updates, new tests - * Win32 COFF exec support - * ... and a lot more + + * Need Perl 5.6 now for building + * Basic AST support, PAST file parser, bits of code generation + * BigInt PMC using GMP + * Complex PMC + * Dynamic loading improved including bundles of PMC classes + * Experimental support for "make install" + * IA64 and hppa JIT support + * ICU unicode support + * IO layer handling code + * IO readline and buffered IO fixes + * Incremental GC + * Internal pythonic functions: filter, map, reduce, max, min ... + * Languages updates for m4, tcl, perl6, regex. New parakeet language. + * Library updates, Stream and SDL library + * MMD - multi method dispatch for binary vtable methods + * Many new array PMCs + * Method call syntax in PIR obj."meth"(...) + * More OS stuff: stat, exec, system, gmtime, piped read and write + * New Python PMCs like Enumerate, None + * Non-branching compare opcodes + * PIR support for += and friends + * Python language subdir + * Python types mapped to existing PMCs + * Slices and range support + * Tons of bug fixes, documentation updates, new tests + * Win32 COFF exec support + * ... and a lot more + +2004-02-29 Release 0.1.0 + - "Ladies and gentlemen, I give you... objects!" + - Huge documentation overhaul + - More supported platforms, s. PLATFORMS + - Basic thread support for pthread based architectures + - Basic event handling for timers and signals including: + - PASM callbacks for NCI (native C) functions. + - Improved platform configuration + - COW stacks now working, stacks code redone + - Structure handling vastly improved + - Random PMC and rand primitives + - Better subroutine call syntax in PIR + - Make PIR subroutines compliant with pdd03 + - Improved profiling (DOD, GC timings) + - Hash code improvements, incl. random key order support + - Experimental freeze/thaw code for some PMC types + - IO improvements for buffered layer and Win32 + - String iterators + - String bitwise vtables + - Many new opcodes + - Support for JIT, where malloced memory isn't executable + - Priority DOD scheme for objects that need timely destruction + - Improved byte code loading (e.g. onLoad functions) + - Language updates: forth, Perl 6/P6C, m4 + - Libraries: Getopt_Long, SDL, Dumper, Sort + - new JAPH examples + - Unified imcc and parrot test handling + - Many new tests (make test reports 1386 tests) + - Numerous bug fixes 2004-02-29 leo - * Released 0.1.0 - * "Ladies and gentlemen, I give you... objects!" - * Huge documentation overhaul - * More supported platforms, s. PLATFORMS - * Basic thread support for pthread based architectures - * Basic event handling for timers and signals including: - * PASM callbacks for NCI (native C) functions. - * Improved platform configuration - * COW stacks now working, stacks code redone - * Structure handling vastly improved - * Random PMC and rand primitives - * Better subroutine call syntax in PIR - * Make PIR subroutines compliant with pdd03 - * Improved profiling (DOD, GC timings) - * Hash code improvements, incl. random key order support - * Experimental freeze/thaw code for some PMC types - * IO improvements for buffered layer and Win32 - * String iterators - * String bitwise vtables - * Many new opcodes - * Support for JIT, where malloced memory isn't executable - * Priority DOD scheme for objects that need timely destruction - * Improved bytecode loading (e.g. onLoad functions) - * Language updates: forth, Perl6/P6C, m4 - * Libraries: Getopt_Long, SDL, Dumper, Sort - * new JAPH examples - * Unified imcc and parrot test handling - * Many new tests (make test reports 1386 tests) - * Numerous bug fixes + * "Ladies and gentlemen, I give you... objects!" + * Huge documentation overhaul + * More supported platforms, s. PLATFORMS + * Basic thread support for pthread based architectures + * Basic event handling for timers and signals including: + * PASM callbacks for NCI (native C) functions. + * Improved platform configuration + * COW stacks now working, stacks code redone + * Structure handling vastly improved + * Random PMC and rand primitives + * Better subroutine call syntax in PIR + * Make PIR subroutines compliant with pdd03 + * Improved profiling (DOD, GC timings) + * Hash code improvements, incl. random key order support + * Experimental freeze/thaw code for some PMC types + * IO improvements for buffered layer and Win32 + * String iterators + * String bitwise vtables + * Many new opcodes + * Support for JIT, where malloced memory isn't executable + * Priority DOD scheme for objects that need timely destruction + * Improved bytecode loading (e.g. onLoad functions) + * Language updates: forth, Perl6/P6C, m4 + * Libraries: Getopt_Long, SDL, Dumper, Sort + * new JAPH examples + * Unified imcc and parrot test handling + * Many new tests (make test reports 1386 tests) + * Numerous bug fixes + +2003-10-31 Release 0.0.13 + - The Big Move: Parrot source and build files rearranged into sub dirs + - Build imcc as parrot + - Objects more finished + - Delegate vtable methods to byte code + - Binary multi-method dispatching + - Isa and does methods for PMCs + - Call byte code from C + - Start of extension interface + - Experimental struct handling + - Catch access to NULL PMCs + - Experimental network socket interface code and opcodes + - IO fixes and improvements + - Dynamic opcode libraries + - Fix-assigned opcode numbers + - Argument flattening for function calls + - More native call interface (NCI) signatures + - Ncurses, postgres, and pcre interface libraries + - Forth language is vastly improved + - BSD and Win32 build improvements + - Many new tests and fixes 2003-10-31 leo - * Released 0.0.13 - * Yep thirteen - haunted by the ghost of 0.0.12 - * Build imcc as parrot - * Objects more finished - * Delegate vtable methods to byte code - * Binary multi-method dispatching - * Isa and does methods for PMCs - * Call byte code from C - * Start of extension interface - * Experimental struct handling - * Catch access to NULL PMCs - * Experimental network socket interface code and opcodes - * IO fixes and improvements - * Dynamic opcode libraries - * Fix-assigned opcode numbers - * Argument flattening for function calls - * More native call interface (NCI) signatures - * Ncurses, postgres, and pcre interface libraries - * Forth language is vastly improved - * BSD and Win32 build improvements - * Many new tests and fixes + + * Yep thirteen - haunted by the ghost of 0.0.12 + * Build imcc as parrot + * Objects more finished + * Delegate vtable methods to byte code + * Binary multi-method dispatching + * Isa and does methods for PMCs + * Call byte code from C + * Start of extension interface + * Experimental struct handling + * Catch access to NULL PMCs + * Experimental network socket interface code and opcodes + * IO fixes and improvements + * Dynamic opcode libraries + * Fix-assigned opcode numbers + * Argument flattening for function calls + * More native call interface (NCI) signatures + * Ncurses, postgres, and pcre interface libraries + * Forth language is vastly improved + * BSD and Win32 build improvements + * Many new tests and fixes 2003-10-22 melvin - * imcc moved from parrot/languages/ to parrot/ + + * imcc moved from parrot/languages/ to parrot/ + +2003-09-20 Release 0.0.11 + - Executable output + - Dynamic PMC registration + - Trial exception system + - Beginnings of object system + - Iterators + - Ordered hashes + - I/O system improvements + - References + - Documentation for basic PMC types + - IMCC support of Parrot Calling Conventions + - Runtime loading of chartypes (and other string improvements) + - Conditional breakpoints + - Dramatically accelerated sweeps for finalizable objects + - Small PMCs (PMCs split into core and extensions) + - Loadable bytecode packfiles + - Constant PMCs + - Sub variants that deal with the stack correctly + - Switched runops core + - Line numbers in warnings + - Environment access + - Many documentation cleanups + - Conversion to CPS style! + - BASIC debugger and many other wacky features + - Filename, line number parsing support in IMCC 2003-09-20 sfink - * updated the native_pbc test files (from Leo) - * built 0.0.11.1 release tarball + * updated the native_pbc test files (from Leo) 2003-09-20 sfink - * CHANGES BUNDLED INTO 0.0.11: - * Executable output - * Dynamic PMC registration - * Trial exception system - * Beginnings of object system - * Iterators - * Ordered hashes - * I/O system improvements - * References - * Documentation for basic PMC types - * IMCC support of Parrot Calling Conventions - * Runtime loading of chartypes (and other string improvements) - * Conditional breakpoints - * Dramatically accelerated sweeps for finalizable objects - * Small PMCs (PMCs split into core and extensions) - * Loadable bytecode packfiles - * Constant PMCs - * Sub variants that deal with the stack correctly - * Switched runops core - * Line numbers in warnings - * Environment access - * Many documentation cleanups - * Conversion to CPS style! - * BASIC debugger and many other wacky features - * Filename, line number parsing support in IMCC + * Executable output + * Dynamic PMC registration + * Trial exception system + * Beginnings of object system + * Iterators + * Ordered hashes + * I/O system improvements + * References + * Documentation for basic PMC types + * IMCC support of Parrot Calling Conventions + * Runtime loading of chartypes (and other string improvements) + * Conditional breakpoints + * Dramatically accelerated sweeps for finalizable objects + * Small PMCs (PMCs split into core and extensions) + * Loadable bytecode packfiles + * Constant PMCs + * Sub variants that deal with the stack correctly + * Switched runops core + * Line numbers in warnings + * Environment access + * Many documentation cleanups + * Conversion to CPS style! + * BASIC debugger and many other wacky features + * Filename, line number parsing support in IMCC 2003-07-21 17:31 chromatic - * applied copyright patch from Josh Wilmes + + * applied copyright patch from Josh Wilmes 2003-06-14 13:50 dan - * Moved the registers out of the context structure, since they - really aren't context - * Changed the register stack frames to hold only 16 registers - rather than 32, added half-set push and pop ops, and reworked - the full set push/pops to do two half-set push/pops. Should - speed up saving register data on calls, since we usually only - care about the top half of the registers anyway. - * Started committing some of the new class/object framework - * Remembered to finally start updating the Changelog + + * Moved the registers out of the context structure, since they + really aren't context + * Changed the register stack frames to hold only 16 registers + rather than 32, added half-set push and pop ops, and reworked + the full set push/pops to do two half-set push/pops. Should + speed up saving register data on calls, since we usually only + care about the top half of the registers anyway. + * Started committing some of the new class/object framework + * Remembered to finally start updating the Changelog 2003-03-18 03:50 ask - * Various files - Update Yet Another copyright statements to reflect the (no longer - so) shiny new year. + * Various files + Update Yet Another copyright statements to reflect the (no longer + so) shiny new year. + +2003-03-16 Release 0.0.10 + - IMCC integration + - eval + - some more benchmarking + - cgp core + - optimized math ops + - intersegment branches + - more complete use of PObjs + - beefed up packfiles + - sub/continuation/coroutine fixes + - better NCI (native calling interface) + - many imcc improvements + - jako improvements 2003-03-11 22:06 chip - * Configure.pl: print help on non-option command line args + * Configure.pl: print help on non-option command line args + +2002-12-19 Release 0.0.9 + - Native function calling interface (Dan) + - Stack/list aggregate rewrite (Leo) + - Scratchpads (Jonathan Sillito) + - Preliminary DotGNU support -- type conversion ops (Gopal V + Leo) + - Buffer/PMC unification (Leo) + - stabs debugging support for JIT (Leo) + - Jako overhaul (Gregor) + - Optional Lea allocator (Leo) + - Parrot sprintf (Brent) + - Miniparrot (Josh) + - PMC Properties (Dan) + - Various JIT improvements (D. Grunblatt + Leo) + - Extensible packfiles (Juergen) + - Restructured PMC hierarchy (Leo) + - Real Scheme (Juergen) 2002-12-18 20:38 sfink: changes since 0.0.8 - - Allow suppression of cgoto core to save memory during compile - * Native function calling interface - * Major rewrite of stack and list aggregates - - Scalar PMC added - * Scratchpads implemented - - Win32 libraries - - Internal memory subsystem documentation - * Preliminary DotGNU support - - Packfile fingerprinting - * Buffer/PMC unification (into PObjs) - * stabs debugging information support - * Major Jako overhaul, including: - - imcc integration - - native function calling - - Perl6 string interpolation - - languages/regex now targets IMCC - * Optional Lea memory allocator - * Full sprintf implementation - * Many, many new tests - * Miniparrot - - exchange ops - - runtime-controllable gc debugging - * PMC properties - - Crash info - * JIT: various improvements - - register usage tracking - - block register allocation - - optimizations - - more jitted ops - - restartable - - architecture abstraction layer - - debugging via GDB - * Beginning support for extensible packfiles - * Much better key support, generally - * splice() - * Restructured PMC hierarchy with better functionality inheritance - * IMCC: many, many improvements. See imcc/ChangeLog - * Perl6: index map grep join reverse defined - * Scheme with functions! - + - Allow suppression of cgoto core to save memory during compile + * Native function calling interface + * Major rewrite of stack and list aggregates + - Scalar PMC added + * Scratchpads implemented + - Win32 libraries + - Internal memory subsystem documentation + * Preliminary DotGNU support + - Packfile fingerprinting + * Buffer/PMC unification (into PObjs) + * stabs debugging information support + * Major Jako overhaul, including: + - imcc integration + - native function calling + - Perl6 string interpolation + - languages/regex now targets IMCC + * Optional Lea memory allocator + * Full sprintf implementation + * Many, many new tests + * Miniparrot + - exchange ops + - runtime-controllable gc debugging + * PMC properties + - Crash info + * JIT: various improvements + - register usage tracking + - block register allocation + - optimizations + - more jitted ops + - restartable + - architecture abstraction layer + - debugging via GDB + * Beginning support for extensible packfiles + * Much better key support, generally + * splice() + * Restructured PMC hierarchy with better functionality inheritance + * IMCC: many, many improvements. See imcc/ChangeLog + * Perl6: index map grep join reverse defined + * Scheme with functions! + +2002-09-01 Release 0.0.8 + - Several new grammars and a BNF -> perl5 and perl6 converter (Jeff) + - Working Perl 6 REs (Sean) + - Keyed Access (Tom Hughes et al) + - New PMCs (Alberto et al) + - Better Documentation + - New COW semantics + - GC acceleration (Mike Lambert) + - Lexical scope (Jonathan Sillito) + - IMCC patches + - JIT for the ARM + +2002-07-18 Release 0.0.7 + - Perl 6 Grammar and Compiler (Sean) + - Subroutines, coroutines, and continuations (Melvin) + - GC improvements (Peter Gibbs, Mike Lambert) + - Global variables (Melvin) + - Intermediate bytecode compiler (Melvin, Angel) + - And much, much more. + +2002-06-04 Release 0.0.6 + - New assembler that support keyed types (Jeff) + - New macro layer, allowing constants (Jeff) + - New Configure.pl (Brent) + - Changes to bytecode format, endian issues resolved (Melvin) + - GC improvements and bug fixes (Peter Gibbs, Mike Lambert) + - JIT compiler rewrite (Jason and Daniel) + - Parrot assembler in Parrot (Daniel) + - Parrot debugger (Daniel) + - BASIC polished, Eliza.bas is new (Clint) + - Cola compiler committed and working, with limited OOP (Melvin) + - Keyed aggregates (Steve Fink) + - Global ops (Melvin) + - Compile-time speedup (Melvin) + - Much documentation + - New PDDs (Dan) + - Contributed tetris and lzw files + - And many more, from the cast of thousands + +2002-04-16 Release 0.0.5 + - Full GC + - Perl Scalar support in PMCs + - Array and Hash types almost ready for prime-time + - Internal support for keyed types + - EMACS editing mode + - New PDDs + - New Language - BASIC + - Regular expression compiler + - More tests + - Many, many bug fixes, enhancements, and speedups + +2002-03-19 Release 0.0.4 + - Arena-based memory allocation system + - Copying GC + - New IO subsystem + - "Predereferencing" mode - ./parrot -P - 22% speedup + - JIT compiler - ./parrot -j + - Parrot now builds warnings-clean on many platforms + - Many more PMC methods implemented + - Regular expression operations + - Added a FAQ + - Basic support for embedding Parrot in other programs + - Warnings support + - Added PDDs to distribution + - Bignum library + + - PMC inheritance + - Added an assembly optimizer + - Improved string encoding/type support + - Many more tests + - Source reformatting + - Major refactoring in packfile library + - More Miniperl functionality + - New PMC "clone" operator + - Beginnings of key-based access to PMCs - arrays and hashes + - MOPS comparisons in examples/mops/ 2002-03-19 22:54 nicholas - * docs/running.pod: Patch from Simon Glover : + * docs/running.pod: Patch from Simon Glover : - We can now get usage information for test_parrot without having to - grep the source. + We can now get usage information for test_parrot without having to + grep the source. 2002-03-19 22:53 simon - * Configure.pl: - Parrot is called parrot. + * Configure.pl: + Parrot is called parrot. 2002-03-19 22:53 nicholas - * docs/tests.pod: Patch from Simon Glover : + * docs/tests.pod: Patch from Simon Glover : - 1. There are tests in t/pmc as well as t/op now. - 2. Adds a comment about Parrot::Test + 1. There are tests in t/pmc as well as t/op now. + 2. Adds a comment about Parrot::Test 2002-03-19 18:09 dan - * Configure.pl, examples/assembly/life.pasm: Toss a prompt that - messes up automated builds + * Configure.pl, examples/assembly/life.pasm: Toss a prompt that + messes up automated builds - Courtesy of "David M. Lloyd" + Courtesy of "David M. Lloyd" 2002-03-19 00:33 mrjoltcola - * core.ops: Doc cleanup from Simon Glover. + * core.ops: Doc cleanup from Simon Glover. 2002-03-18 23:52 mrjoltcola - * io/io_unix.c: Typo fix for invalid lvalue caught by David Loyd. + * io/io_unix.c: Typo fix for invalid lvalue caught by David Loyd. 2002-03-18 22:09 dan - * include/parrot/resources.h: Checked in old version + * include/parrot/resources.h: Checked in old version 2002-03-18 20:17 dan - * include/parrot/resources.h: Forgot a prototype + * include/parrot/resources.h: Forgot a prototype 2002-03-18 20:15 dan - * resources.c: D'oh! Thinko, fixed. + * resources.c: D'oh! Thinko, fixed. - Courtesy of "Peter Gibbs" + Courtesy of "Peter Gibbs" 2002-03-18 17:33 josh - * Configure.pl: Lowering the bar a bit. + * Configure.pl: Lowering the bar a bit. 2002-03-18 17:33 sfink - * languages/regex/: MAINTAINER, Makefile, README, regex.pl, - test.pl, lib/Regex.pm, lib/Regex/AsmOps.pm, lib/Regex/CodeGen.pm, - lib/Regex/Generate.pm, lib/Regex/Grammar.pm, lib/Regex/Grammar.y, - lib/Regex/Optimize.pm, lib/Regex/Parse.pm, lib/Regex/Pasm.pm, - lib/Regex/PreOptimize.pm, lib/Regex/RegexOps.pm, - lib/Regex/Rewrite.pm, lib/Regex/CodeGen/Re.pm, - lib/Regex/CodeGen/Rx.pm, lib/Regex/Rewrite/Re.pm, - lib/Regex/Rewrite/Rx.pm, lib/Regex/Rewrite/Stackless.pm, - t/example.t: Whoops, wrong time to check this in. + * languages/regex/: MAINTAINER, Makefile, README, regex.pl, + test.pl, lib/Regex.pm, lib/Regex/AsmOps.pm, lib/Regex/CodeGen.pm, + lib/Regex/Generate.pm, lib/Regex/Grammar.pm, lib/Regex/Grammar.y, + lib/Regex/Optimize.pm, lib/Regex/Parse.pm, lib/Regex/Pasm.pm, + lib/Regex/PreOptimize.pm, lib/Regex/RegexOps.pm, + lib/Regex/Rewrite.pm, lib/Regex/CodeGen/Re.pm, + lib/Regex/CodeGen/Rx.pm, lib/Regex/Rewrite/Re.pm, + lib/Regex/Rewrite/Rx.pm, lib/Regex/Rewrite/Stackless.pm, + t/example.t: Whoops, wrong time to check this in. 2002-03-18 16:42 dan - * memory.c, resources.c: Partial fix for GC's memory trouncing. At - least we consider the PMC and Buffer free pools worth collecting, - and initialize the Buffer pool stuff. Still not 100% correct, - though. + * memory.c, resources.c: Partial fix for GC's memory trouncing. At + least we consider the PMC and Buffer free pools worth collecting, + and initialize the Buffer pool stuff. Still not 100% correct, + though. 2002-03-18 15:35 simon - * packfile.c: - Fix format arg bug. + * packfile.c: + Fix format arg bug. 2002-03-18 07:45 brentdax - * Configure.pl: Warn if you're using 64-bit ints on a 32-bit - system. + * Configure.pl: Warn if you're using 64-bit ints on a 32-bit + system. 2002-03-18 00:09 sfink - * languages/regex/: MAINTAINER, Makefile, README, regex.pl, - test.pl, lib/Regex.pm, lib/Regex/AsmOps.pm, lib/Regex/CodeGen.pm, - lib/Regex/Generate.pm, lib/Regex/Grammar.pm, lib/Regex/Grammar.y, - lib/Regex/Optimize.pm, lib/Regex/Parse.pm, lib/Regex/Pasm.pm, - lib/Regex/PreOptimize.pm, lib/Regex/RegexOps.pm, - lib/Regex/Rewrite.pm, lib/Regex/CodeGen/Re.pm, - lib/Regex/CodeGen/Rx.pm, lib/Regex/Rewrite/Re.pm, - lib/Regex/Rewrite/Rx.pm, lib/Regex/Rewrite/Stackless.pm, - t/example.t: Buggy 1st version of regex compiler implementation. - Warning: the test code depends on features of the assembler that do - not yet exist. + * languages/regex/: MAINTAINER, Makefile, README, regex.pl, + test.pl, lib/Regex.pm, lib/Regex/AsmOps.pm, lib/Regex/CodeGen.pm, + lib/Regex/Generate.pm, lib/Regex/Grammar.pm, lib/Regex/Grammar.y, + lib/Regex/Optimize.pm, lib/Regex/Parse.pm, lib/Regex/Pasm.pm, + lib/Regex/PreOptimize.pm, lib/Regex/RegexOps.pm, + lib/Regex/Rewrite.pm, lib/Regex/CodeGen/Re.pm, + lib/Regex/CodeGen/Rx.pm, lib/Regex/Rewrite/Re.pm, + lib/Regex/Rewrite/Rx.pm, lib/Regex/Rewrite/Stackless.pm, + t/example.t: Buggy 1st version of regex compiler implementation. + Warning: the test code depends on features of the assembler that do + not yet exist. 2002-03-17 21:35 ajgough - * types/: bignum.c, bignum_atest.pl: Added a couple of quick routes - through addition and subtraction. Also added the ability to run - all the tests, including the ones which deal with overflow and - underflow. These fail, but that's expected. Soon they'll pass. - Then I'll show them. Yesssssss. Tessssssssts my precioussssss, - passsssssssings tesssstsssss. + * types/: bignum.c, bignum_atest.pl: Added a couple of quick routes + through addition and subtraction. Also added the ability to run + all the tests, including the ones which deal with overflow and + underflow. These fail, but that's expected. Soon they'll pass. + Then I'll show them. Yesssssss. Tessssssssts my precioussssss, + passsssssssings tesssstsssss. 2002-03-17 20:06 ajgough - * types/: bignum.c, bignum.h, bignum_test.pl: Modified - check_(under|over)flow to test bignumbers, rather than values. - context now carries E_limit, from which max and min exp are found. + * types/: bignum.c, bignum.h, bignum_test.pl: Modified + check_(under|over)flow to test bignumbers, rather than values. + context now carries E_limit, from which max and min exp are found. - Added a default-context-creating function (although this isn't the - same as either of the default contexts defined in the eda). + Added a default-context-creating function (although this isn't the + same as either of the default contexts defined in the eda). 2002-03-17 13:31 ajgough - * types/: bignum.c, bignum.h: Made BN_round and BN_iround so that - exported version matches prototypes of other public functions. + * types/: bignum.c, bignum.h: Made BN_round and BN_iround so that + exported version matches prototypes of other public functions. 2002-03-17 06:44 josh - * chartype.c, encoding.c, memory.c, misc.c, packdump.c, packfile.c, - packout.c, resources.c, string.c, include/parrot/encoding.h: Some - last-minute re-indenting. + * chartype.c, encoding.c, memory.c, misc.c, packdump.c, packfile.c, + packout.c, resources.c, string.c, include/parrot/encoding.h: Some + last-minute re-indenting. 2002-03-17 05:07 mrjoltcola - * io/io_unix.c: Clear up unsigned compare caught by Solaris GCC. + * io/io_unix.c: Clear up unsigned compare caught by Solaris GCC. 2002-03-16 23:17 nicholas - * classes/default.pmc: Patch from Simon Glover to - remove warnings: + * classes/default.pmc: Patch from Simon Glover to + remove warnings: - default.pmc: In function `Parrot_default_get_integer_keyed': - default.pmc:50: warning: control reaches end of non-void function - default.pmc: In function `Parrot_default_get_number_keyed': - default.pmc:58: warning: control reaches end of non-void function - default.pmc: In function `Parrot_default_get_string_keyed': - default.pmc:67: warning: control reaches end of non-void function - default.pmc: In function `Parrot_default_get_pmc_keyed': - default.pmc:87: warning: control reaches end of non-void function + default.pmc: In function `Parrot_default_get_integer_keyed': + default.pmc:50: warning: control reaches end of non-void function + default.pmc: In function `Parrot_default_get_number_keyed': + default.pmc:58: warning: control reaches end of non-void function + default.pmc: In function `Parrot_default_get_string_keyed': + default.pmc:67: warning: control reaches end of non-void function + default.pmc: In function `Parrot_default_get_pmc_keyed': + default.pmc:87: warning: control reaches end of non-void function 2002-03-16 18:50 ajgough - * types/: bignum.c, bignum.h: Lots of prototypes changed in - readiness for nicely telling your caller about any oddness you've - caused in the persuit of flow. + * types/: bignum.c, bignum.h: Lots of prototypes changed in + readiness for nicely telling your caller about any oddness you've + caused in the persuit of flow. 2002-03-16 17:38 dan - * interpreter.c, resources.c, docs/pdds/pdd09_gc.pod, - include/parrot/interpreter.h, include/parrot/resources.h: Now we - can control the GC and DOD, to stop it when we don't really want - it. + * interpreter.c, resources.c, docs/pdds/pdd09_gc.pod, + include/parrot/interpreter.h, include/parrot/resources.h: Now we + can control the GC and DOD, to stop it when we don't really want + it. 2002-03-16 16:58 dan - * resources.c, vtable.tbl, classes/default.pmc, - include/parrot/resources.h: Added the last code to let PMCs control - their marking at DOD time + * resources.c, vtable.tbl, classes/default.pmc, + include/parrot/resources.h: Added the last code to let PMCs control + their marking at DOD time 2002-03-16 16:57 ajgough - * types/bignum.c: Ok, I worked out how to not have lots of tabs. I - feel a little more virtuous now. Really I do. You might not - believe me, but you should. perl -pne 's/\t/ /g', if you're - curious. + * types/bignum.c: Ok, I worked out how to not have lots of tabs. I + feel a little more virtuous now. Really I do. You might not + believe me, but you should. perl -pne 's/\t/ /g', if you're + curious. 2002-03-16 16:57 josh - * packfile.c, packout.c: M-x untabify is my new friend. + * packfile.c, packout.c: M-x untabify is my new friend. 2002-03-16 16:50 josh - * trace.c, resources.c: Minor whitespace tweak for the benefit of - check_source_standards.pl + * trace.c, resources.c: Minor whitespace tweak for the benefit of + check_source_standards.pl 2002-03-16 16:50 ajgough - * types/: bignum.c, bignum.h: More documentation, separate - functions into public and private sorts, some initial stuff to cope - with over and underflow correctly. + * types/: bignum.c, bignum.h: More documentation, separate + functions into public and private sorts, some initial stuff to cope + with over and underflow correctly. 2002-03-16 16:49 josh - * resources.c: Re-indented (sorry bout the big diff) + * resources.c: Re-indented (sorry bout the big diff) 2002-03-16 16:47 bdwheele - * examples/assembly/fact.pasm: This fixes fact.pasm so it will - assemble again, both with Simon's new assembler and with the old - one. + * examples/assembly/fact.pasm: This fixes fact.pasm so it will + assemble again, both with Simon's new assembler and with the old + one. 2002-03-16 16:33 mrjoltcola - * io/TODO: Get the TODO up-to-date for 0.0.4. + * io/TODO: Get the TODO up-to-date for 0.0.4. 2002-03-16 16:11 josh - * Configure.pl: Patch from Nicholas Clark : stops - silly people (such as me) running Configure with - /usr/local/bin/perl (which is 5.004_05) and not realising their - mistake until the pmc subdirectory, where the first qr// is - encountered. + * Configure.pl: Patch from Nicholas Clark : stops + silly people (such as me) running Configure with + /usr/local/bin/perl (which is 5.004_05) and not realising their + mistake until the pmc subdirectory, where the first qr// is + encountered. - Syntax error messages don't tell you what you did wrong. This does: + Syntax error messages don't tell you what you did wrong. This does: - /usr/local/bin/perl Configure.pl Perl 5.00503 required--this is - only version 5.00405, stopped at Configure.pl line 10. + /usr/local/bin/perl Configure.pl Perl 5.00503 required--this is + only version 5.00405, stopped at Configure.pl line 10. 2002-03-16 14:38 ajgough - * Makefile.in: Small fix to Makefile.in to keep Irix make happy - with commenting. + * Makefile.in: Small fix to Makefile.in to keep Irix make happy + with commenting. 2002-03-16 11:45 simon - * MANIFEST, examples/assembly/xml_parser.pasm: - Added Clint Pierce's XML parser. + * MANIFEST, examples/assembly/xml_parser.pasm: + Added Clint Pierce's XML parser. 2002-03-15 22:24 simon - * packout.c: - Don't need that function. + * packout.c: + Don't need that function. 2002-03-15 21:56 simon - * Makefile.in, include/parrot/packfile.h: - Rebuild packout.o, since it'll be used for the Packfile XS module + * Makefile.in, include/parrot/packfile.h: + Rebuild packout.o, since it'll be used for the Packfile XS module 2002-03-15 19:45 dan - * include/parrot/: memory.h, pmc.h: Another add-in for GC + * include/parrot/: memory.h, pmc.h: Another add-in for GC 2002-03-14 19:48 dan - * core.ops: No string to int for some reason + * core.ops: No string to int for some reason 2002-03-14 18:45 dan - * string.c, t/op/string.t: Fix 0-length substr problem + * string.c, t/op/string.t: Fix 0-length substr problem 2002-03-14 14:46 dan - * core.ops, interpreter.c, resources.c, classes/array.pmc, - classes/perlarray.pmc, examples/assembly/life.pasm, - include/parrot/interpreter.h, include/parrot/resources.h: Added in - a counter for copied memory, with a display in life.pasm + * core.ops, interpreter.c, resources.c, classes/array.pmc, + classes/perlarray.pmc, examples/assembly/life.pasm, + include/parrot/interpreter.h, include/parrot/resources.h: Added in + a counter for copied memory, with a display in life.pasm 2002-03-14 03:16 mrjoltcola - * MANIFEST: Update MANIFEST courtesy of Simon Glover. + * MANIFEST: Update MANIFEST courtesy of Simon Glover. 2002-03-13 23:43 simon - * packfile.c: - Oops. + * packfile.c: + Oops. 2002-03-13 23:43 simon - * packfile.c: - Hangs head in shame. + * packfile.c: + Hangs head in shame. 2002-03-13 21:31 simon - * MANIFEST: - FAQ moved. + * MANIFEST: + FAQ moved. 2002-03-13 18:06 simon - * string.c: + * string.c: - Fix string_compare screw-up. + Fix string_compare screw-up. 2002-03-13 18:02 brentdax - * docs/: parrot.pod, ParrotFAQ.htm, faq.pod: Move the FAQ into POD - and add a new question/answer pair. + * docs/: parrot.pod, ParrotFAQ.htm, faq.pod: Move the FAQ into POD + and add a new question/answer pair. 2002-03-12 22:53 mrjoltcola - * io.ops: Quick and dirty read ops for PIO. No warranty provided. + * io.ops: Quick and dirty read ops for PIO. No warranty provided. 2002-03-12 22:48 mrjoltcola - * examples/assembly/io2.pasm: Quick and dirty read ops for PIO. No - warranty provided. + * examples/assembly/io2.pasm: Quick and dirty read ops for PIO. No + warranty provided. 2002-03-12 22:29 ajgough - * docs/pdds/pdd14_bignum.pod: Ooops, it is #14, really. + * docs/pdds/pdd14_bignum.pod: Ooops, it is #14, really. 2002-03-12 22:24 ajgough - * docs/pdds/pdd14_bignum.pod: Creation of bignumber pdd, update to - version 1.1, Don't know if this is the correct number, but I don't - want this stuck on my harddrive where it will get lost, so 14 it is - :) + * docs/pdds/pdd14_bignum.pod: Creation of bignumber pdd, update to + version 1.1, Don't know if this is the correct number, but I don't + want this stuck on my harddrive where it will get lost, so 14 it is + :) 2002-03-12 11:35 simon - * MANIFEST, packdump.c, packout.c: + * MANIFEST, packdump.c, packout.c: - Just so the functionality doesn't disappear. + Just so the functionality doesn't disappear. 2002-03-12 11:33 simon - * Makefile.in, chartype.c, encoding.c, packfile.c, - chartypes/unicode.c, chartypes/usascii.c, encodings/singlebyte.c, - encodings/utf16.c, encodings/utf32.c, encodings/utf8.c, - include/parrot/chartype.h, include/parrot/encoding.h, - include/parrot/packfile.h: + * Makefile.in, chartype.c, encoding.c, packfile.c, + chartypes/unicode.c, chartypes/usascii.c, encodings/singlebyte.c, + encodings/utf16.c, encodings/utf32.c, encodings/utf8.c, + include/parrot/chartype.h, include/parrot/encoding.h, + include/parrot/packfile.h: - Packfile axing. + Packfile axing. 2002-03-11 23:06 nicholas - * core.ops: Patch from Simon Glover : + * core.ops: Patch from Simon Glover : - Core.ops documentation nits + Core.ops documentation nits 2002-03-11 23:05 nicholas - * t/pmc/pmc.t: Patch from Simon Glover : + * t/pmc/pmc.t: Patch from Simon Glover : - Most of the PerlUndef tests in pmc.t appear to have been added - twice. - Enclosed patch removes the duplicates. + Most of the PerlUndef tests in pmc.t appear to have been added + twice. + Enclosed patch removes the duplicates. 2002-03-10 23:40 nicholas - * t/pmc/perlstring.t: Patch from Simon Glover : + * t/pmc/perlstring.t: Patch from Simon Glover : - More tests for the PerlString test-suite. + More tests for the PerlString test-suite. 2002-03-10 23:40 nicholas - * t/op/time.t: Patch from Simon Glover : + * t/op/time.t: Patch from Simon Glover : - test for sleep with negative argument + test for sleep with negative argument 2002-03-10 21:58 nicholas - * t/op/rx.t: Patch from Simon Glover : + * t/op/rx.t: Patch from Simon Glover : - Enclosed patch fixes up a few more holes in our test coverage. + Enclosed patch fixes up a few more holes in our test coverage. 2002-03-10 21:18 mrjoltcola - * classes/array.pmc, classes/default.pmc, classes/intqueue.pmc, - classes/parrotpointer.pmc, classes/perlarray.pmc, - classes/perlhash.pmc, classes/perlint.pmc, classes/perlnum.pmc, - classes/perlstring.pmc, classes/perlundef.pmc, - include/parrot/pmc.h, core.ops, pmc.c, vtable.tbl: Add size - argument to the init() vtable method so PMCs have the option to - know how to size themselves at creation. size could be N elements - or a byte count, depending on the PMC or it may simply be ignored. - Overloaded 'new' opcode for optional arg. + * classes/array.pmc, classes/default.pmc, classes/intqueue.pmc, + classes/parrotpointer.pmc, classes/perlarray.pmc, + classes/perlhash.pmc, classes/perlint.pmc, classes/perlnum.pmc, + classes/perlstring.pmc, classes/perlundef.pmc, + include/parrot/pmc.h, core.ops, pmc.c, vtable.tbl: Add size + argument to the init() vtable method so PMCs have the option to + know how to size themselves at creation. size could be N elements + or a byte count, depending on the PMC or it may simply be ignored. + Overloaded 'new' opcode for optional arg. 2002-03-10 21:15 mrjoltcola - * lib/Parrot/Assembler.pm: Minor patch to the assembler for the - new_p_ic_ic opcode to work same as new_p_ic (looks up a named - class). + * lib/Parrot/Assembler.pm: Minor patch to the assembler for the + new_p_ic_ic opcode to work same as new_p_ic (looks up a named + class). - Also added small hack for .sub directive (which simply translates - to a label, however we might eventually want to collect these to - validate bsr calls. + Also added small hack for .sub directive (which simply translates + to a label, however we might eventually want to collect these to + validate bsr calls. 2002-03-10 15:09 ajgough - * types/: bignum.c, bignum.h, bignum_atest.pl, bignum_test.pl: - Added round_floor and round_ceiling. 3403 tests pass, none fail. + * types/: bignum.c, bignum.h, bignum_atest.pl, bignum_test.pl: + Added round_floor and round_ceiling. 3403 tests pass, none fail. 2002-03-10 03:56 ajgough - * types/: bignum.c, bignum_atest.pl: Added extended stuff to - divide, divide integer and remainder. All filled in functions now - have special values capability. + * types/: bignum.c, bignum_atest.pl: Added extended stuff to + divide, divide integer and remainder. All filled in functions now + have special values capability. - Much remains to be done though, and the pdd needs to catch up. + Much remains to be done though, and the pdd needs to catch up. 2002-03-10 01:36 ajgough - * types/bignum.c: Added extended stuff to _add, _subtract. + * types/bignum.c: Added extended stuff to _add, _subtract. 2002-03-10 00:14 nicholas - * t/op/: integer.t, number.t: Patch from Simon Glover - : + * t/op/: integer.t, number.t: Patch from Simon Glover + : - The enclosed patch fixes a few of the holes in our test coverage - uncovered by Josh Wilmes + The enclosed patch fixes a few of the holes in our test coverage + uncovered by Josh Wilmes 2002-03-09 23:03 ajgough - * types/: bignum.c, bignum.h: Modified compare to work with - extended values. Made a couple of changes here and there to allow - BN_comp to take a context, so that an is_zero check doesn't clobber - negative zeros. + * types/: bignum.c, bignum.h: Modified compare to work with + extended values. Made a couple of changes here and there to allow + BN_comp to take a context, so that an is_zero check doesn't clobber + negative zeros. 2002-03-09 22:19 ajgough - * types/: bignum.c, bignum.h, bignum_atest.pl, bignum_test.pl: - Unary plus now copes with special values. + * types/: bignum.c, bignum.h, bignum_atest.pl, bignum_test.pl: + Unary plus now copes with special values. 2002-03-09 04:25 ajgough - * types/: bignum.c, bignum_atest.pl, bignum_test.pl: Exception - traps and flags are now enabled and tested for all the standard - tests for all the functions which are currently implemented. Test - harness faffed with to allow these to be tested. + * types/: bignum.c, bignum_atest.pl, bignum_test.pl: Exception + traps and flags are now enabled and tested for all the standard + tests for all the functions which are currently implemented. Test + harness faffed with to allow these to be tested. 2002-03-09 02:29 josh - * encodings/singlebyte.c, encodings/utf16.c, encodings/utf32.c, - encodings/utf8.c, chartypes/unicode.c, chartypes/usascii.c: - Re-indented + * encodings/singlebyte.c, encodings/utf16.c, encodings/utf32.c, + encodings/utf8.c, chartypes/unicode.c, chartypes/usascii.c: + Re-indented 2002-03-09 02:22 josh - * config_h.in: tab-blastin' + * config_h.in: tab-blastin' 2002-03-09 02:21 josh - * check_source_standards.pl: Play nicer with M-x compile- don't - bother giving line numbers for things you don't want to look at. + * check_source_standards.pl: Play nicer with M-x compile- don't + bother giving line numbers for things you don't want to look at. 2002-03-09 02:10 josh - * examples/mops/mops.c: re-indented + * examples/mops/mops.c: re-indented 2002-03-09 02:07 josh - * classes/pmc2c.pl: Use the usual header so that we can detect the - autogeneratedness. + * classes/pmc2c.pl: Use the usual header so that we can detect the + autogeneratedness. 2002-03-09 02:05 josh - * jit2h.pl: Avoid accidental /* inside a comment, which generates a - compiler warning + * jit2h.pl: Avoid accidental /* inside a comment, which generates a + compiler warning 2002-03-09 01:59 josh - * io/: io.c, io_stdio.c, io_unix.c, io_win32.c: Another large - patch- re-indent io/*.c. + * io/: io.c, io_stdio.c, io_unix.c, io_win32.c: Another large + patch- re-indent io/*.c. 2002-03-09 01:52 ajgough - * types/: bignum.c, bignum.h, bignum_test.pl: Added handling of - special values to the string conversion functions, some other - functions now need context (to let -0 pass through really_zero) - which have also been added. + * types/: bignum.c, bignum.h, bignum_test.pl: Added handling of + special values to the string conversion functions, some other + functions now need context (to let -0 pass through really_zero) + which have also been added. 2002-03-09 01:47 josh - * test_main.c: Re-indented. + * test_main.c: Re-indented. 2002-03-09 01:41 josh - * rx.c: killed a stray tab + * rx.c: killed a stray tab 2002-03-09 01:38 josh - * rx.c: Re-indented. + * rx.c: Re-indented. 2002-03-09 01:36 josh - * misc.c: Oops, some tabs remained- cleaned up. + * misc.c: Oops, some tabs remained- cleaned up. 2002-03-09 01:31 josh - * misc.c: Re-indented (major patch, sorry) + * misc.c: Re-indented (major patch, sorry) 2002-03-09 00:59 josh - * embed.c: Re-indented. + * embed.c: Re-indented. 2002-03-08 23:08 simon - * MANIFEST, docs/pdds/pdd10_embedding.pod, - docs/pdds/pdd11_extending.pod, docs/pdds/pdd12_assembly.pod, - docs/pdds/pdd13_bytecode.pod: - Placeholder PDDs. + * MANIFEST, docs/pdds/pdd10_embedding.pod, + docs/pdds/pdd11_extending.pod, docs/pdds/pdd12_assembly.pod, + docs/pdds/pdd13_bytecode.pod: + Placeholder PDDs. 2002-03-08 21:12 ajgough - * include/parrot/string.h: Added private flags to string.h, mostly - so that other GCed stuff can also have its very own private flags. + * include/parrot/string.h: Added private flags to string.h, mostly + so that other GCed stuff can also have its very own private flags. 2002-03-08 19:53 simon - * MANIFEST: - Great PDD Renaming + * MANIFEST: + Great PDD Renaming 2002-03-08 19:41 robert - * docs/pdds/: pdd0.pod, pdd1.pod, pdd2.pod, pdd4.pod, pdd5.pod, - pdd6.pod, pdd7.pod: Renamed... + * docs/pdds/: pdd0.pod, pdd1.pod, pdd2.pod, pdd4.pod, pdd5.pod, + pdd6.pod, pdd7.pod: Renamed... 2002-03-08 18:51 simon - * MANIFEST, docs/pdds/pdd08_keys.pod: - Add keys PDD. + * MANIFEST, docs/pdds/pdd08_keys.pod: + Add keys PDD. 2002-03-08 18:20 ajgough - * types/: bignum.c, bignum.h, bignum_atest.pl, bignum_test.pl: - Introduced exception handlers and exception flags to context, will - allow support of extended standard. Unified exception checking - mechanism (sort of) and made minimal changes to bulk of code to use - this. Tests pass, I'm happy, and further changes will happen more - gradually. + * types/: bignum.c, bignum.h, bignum_atest.pl, bignum_test.pl: + Introduced exception handlers and exception flags to context, will + allow support of extended standard. Unified exception checking + mechanism (sort of) and made minimal changes to bulk of code to use + this. Tests pass, I'm happy, and further changes will happen more + gradually. 2002-03-08 04:38 josh - * interpreter.c, string.c, testparrotsizes_c.in: More indenting - tweaks. + * interpreter.c, string.c, testparrotsizes_c.in: More indenting + tweaks. 2002-03-08 04:37 josh - * platforms/: generic.c, generic.h, win32.c, win32.h: Re-indented + * platforms/: generic.c, generic.h, win32.c, win32.h: Re-indented 2002-03-08 04:24 josh - * embed.c: A bit more re-indenting + * embed.c: A bit more re-indenting 2002-03-08 04:20 josh - * embed.c: Indenting fixes + * embed.c: Indenting fixes 2002-03-08 04:14 josh - * jit.c: Re-indented (run_indent.pl) + * jit.c: Re-indented (run_indent.pl) 2002-03-08 03:36 josh - * ops2c.pl: Fix the line numbers which get reported while compiling - core_ops*.c + * ops2c.pl: Fix the line numbers which get reported while compiling + core_ops*.c 2002-03-08 03:22 josh - * packfile.c: -1552 cc: WARNING File = packfile.c, Line = 1537 - The variable "type" is set but never used. + * packfile.c: -1552 cc: WARNING File = packfile.c, Line = 1537 + The variable "type" is set but never used. - opcode_t type; + opcode_t type; 2002-03-08 03:04 josh - * resources.c, stacks.c, string.c, io/io.c, io/io_stdio.c, - io/io_unix.c: Clean up unused and set-but-not-referenced variables - noticed by the sgi compiler. + * resources.c, stacks.c, string.c, io/io.c, io/io_stdio.c, + io/io_unix.c: Clean up unused and set-but-not-referenced variables + noticed by the sgi compiler. 2002-03-08 03:02 josh - * misc.c: Fixes this warning (SGI) cc-1188 cc: WARNING File = - misc.c, Line = 417 The indicated type qualifier is meaningless on - cast type. + * misc.c: Fixes this warning (SGI) cc-1188 cc: WARNING File = + misc.c, Line = 417 The indicated type qualifier is meaningless on + cast type. - (const char) 'f'); - ^ + (const char) 'f'); + ^ 2002-03-08 02:55 josh - * Makefile.in: Clean up one of the object files it was missing + * Makefile.in: Clean up one of the object files it was missing 2002-03-08 01:15 josh - * include/parrot/interpreter.h: Fixes the following error (tcc): - "./include/parrot/interpreter.h", line 27: Error: [Syntax]: Extra - comma at end of list. + * include/parrot/interpreter.h: Fixes the following error (tcc): + "./include/parrot/interpreter.h", line 27: Error: [Syntax]: Extra + comma at end of list. 2002-03-06 22:15 simon - * stacks.c: - Tidy up stack chunk allocation. + * stacks.c: + Tidy up stack chunk allocation. 2002-03-06 21:00 simon - * interpreter.c: - Create strings only once we've got string register heads set up. + * interpreter.c: + Create strings only once we've got string register heads set up. 2002-03-06 20:31 simon - * classes/perlarray.pmc: - malloc(0) considered harmful. + * classes/perlarray.pmc: + malloc(0) considered harmful. 2002-03-06 20:24 simon - * include/parrot/resources.h: - I like it when Parrot compiles. + * include/parrot/resources.h: + I like it when Parrot compiles. 2002-03-06 17:02 dan - * classes/array.pmc: Changed over to data pointing to a Buffer. + * classes/array.pmc: Changed over to data pointing to a Buffer. 2002-03-06 15:45 dan - * core.ops, embed.c, exceptions.c, interpreter.c, memory.c, - packfile.c, pbc2c.pl, pdump.c, resources.c, - include/parrot/interpreter.h, include/parrot/memory.h, - include/parrot/resources.h, io/io.c: Three quick things: 1) INTVALs - and opcode_t > longs will now be even more suspect than what they - were beforehand. 2) Feel free to bicker with names. I don't think - we've come to *any* sort of agreement with these, although we - really, really, need to. 3) I forget the third thing. 4) But I - thought of a fourth. 5) I've now remembered the third thing: IIRC, - ANSI C states that enums will fit within the smallest type (int or - greater) that can hold the values. Is that actually correct, and - does it state whether unsigned is preferred to signed for - non-negative enums? 6) Since I'm no longer constrained by "three" - or "quick", I'm going size_t happy for a lot of memory-related - storage. (That's good. No sense wasting the size or performance - of an UINTVAL for strange values of UINTVAL.) I'm also using it in - a couple other internal things (like the GC stat counters, seen - here). Size and performance, again, and unpromotable to a bigint, - so we know that we (theoretically) will wrap. However, size_t - isn't the best choice for the type. (Not that there's anything - wrong with size_t, just that it shouldn't be called size_t.) Any - thoughts? I was thinking of just doing unsigned int, because, - IIRC, int is usually the natural word size, and will be most - efficient. Thoughts? 7) I forgot what the fourth thing I thought - of was while writing down the others. Sorry. - - Courtesy of "Bryan C. Warnock" + * core.ops, embed.c, exceptions.c, interpreter.c, memory.c, + packfile.c, pbc2c.pl, pdump.c, resources.c, + include/parrot/interpreter.h, include/parrot/memory.h, + include/parrot/resources.h, io/io.c: Three quick things: 1) INTVALs + and opcode_t > longs will now be even more suspect than what they + were beforehand. 2) Feel free to bicker with names. I don't think + we've come to *any* sort of agreement with these, although we + really, really, need to. 3) I forget the third thing. 4) But I + thought of a fourth. 5) I've now remembered the third thing: IIRC, + ANSI C states that enums will fit within the smallest type (int or + greater) that can hold the values. Is that actually correct, and + does it state whether unsigned is preferred to signed for + non-negative enums? 6) Since I'm no longer constrained by "three" + or "quick", I'm going size_t happy for a lot of memory-related + storage. (That's good. No sense wasting the size or performance + of an UINTVAL for strange values of UINTVAL.) I'm also using it in + a couple other internal things (like the GC stat counters, seen + here). Size and performance, again, and unpromotable to a bigint, + so we know that we (theoretically) will wrap. However, size_t + isn't the best choice for the type. (Not that there's anything + wrong with size_t, just that it shouldn't be called size_t.) Any + thoughts? I was thinking of just doing unsigned int, because, + IIRC, int is usually the natural word size, and will be most + efficient. Thoughts? 7) I forgot what the fourth thing I thought + of was while writing down the others. Sorry. + + Courtesy of "Bryan C. Warnock" 2002-03-06 15:26 dan - * memory.c, resources.c, string.c, classes/perlarray.pmc, - include/parrot/resources.h: Now we allocate generic Buffers from - arenas too + * memory.c, resources.c, string.c, classes/perlarray.pmc, + include/parrot/resources.h: Now we allocate generic Buffers from + arenas too 2002-03-05 21:42 brentdax - * Configure.pl: Minor cleanup and enhancements. + * Configure.pl: Minor cleanup and enhancements. 2002-03-05 21:25 dan - * resources.c: non-special GC now works with PMCs + * resources.c: non-special GC now works with PMCs 2002-03-05 19:48 brentdax - * Configure.pl, DEVELOPING, MANIFEST, config_h.in, test_main.c: - Parrot now "knows" if it's a development version or a release - version. See the instructions in the DEVELOPING file. + * Configure.pl, DEVELOPING, MANIFEST, config_h.in, test_main.c: + Parrot now "knows" if it's a development version or a release + version. See the instructions in the DEVELOPING file. 2002-03-05 18:05 brentdax - * MANIFEST: pasm.vim wasn't in the manifest. + * MANIFEST: pasm.vim wasn't in the manifest. 2002-03-05 17:57 simon - * Makefile.in: - Now, through much evilness, make distclean and make cvsclean work - again. + * Makefile.in: + Now, through much evilness, make distclean and make cvsclean work + again. 2002-03-05 17:38 dan - * memory.c, resources.c, docs/pdds/pdd09_gc.pod, - include/parrot/interpreter.h, include/parrot/pmc.h, - include/parrot/resources.h: PMC tracing complete + * memory.c, resources.c, docs/pdds/pdd09_gc.pod, + include/parrot/interpreter.h, include/parrot/pmc.h, + include/parrot/resources.h: PMC tracing complete 2002-03-05 16:28 gregor - * languages/jako/Makefile.in: - Changed -I ../../ to -I ../../lib when calling the assembler, since - the perl modules have moved. + * languages/jako/Makefile.in: + Changed -I ../../ to -I ../../lib when calling the assembler, since + the perl modules have moved. 2002-03-05 05:30 josh - * packfile.c, pdump.c, pmc.c, register.c, rxstacks.c, stacks.c, - string.c: More re-indenting via run_indent.pl. + * packfile.c, pdump.c, pmc.c, register.c, rxstacks.c, stacks.c, + string.c: More re-indenting via run_indent.pl. 2002-03-05 05:17 josh - * runops_cores.c, trace.c, warnings.c: Re-indented (via - run_indent.pl) + * runops_cores.c, trace.c, warnings.c: Re-indented (via + run_indent.pl) 2002-03-05 04:26 josh - * key.c, memory.c, test_gnuc.c, testparrotfuncptr.c: Re-indented - using run_indent.pl and some minor tweaking. + * key.c, memory.c, test_gnuc.c, testparrotfuncptr.c: Re-indented + using run_indent.pl and some minor tweaking. 2002-03-05 04:21 josh - * chartype.c, encoding.c, exceptions.c, global_setup.c, - interpreter.c: Re-indented using run_indent.pl and some minor - tweaking. + * chartype.c, encoding.c, exceptions.c, global_setup.c, + interpreter.c: Re-indented using run_indent.pl and some minor + tweaking. 2002-03-05 03:30 josh - * include/parrot/trace.h: These functions are no longer used (or - even implemented) + * include/parrot/trace.h: These functions are no longer used (or + even implemented) 2002-03-04 18:21 josh - * include/parrot/trace.h: Fix a typo in the argument type. + * include/parrot/trace.h: Fix a typo in the argument type. - Patch from + Patch from 2002-03-04 03:39 josh - * check_source_standards.pl, jit2h.pl: Add the "autogenerated file" - header to jit_struct.h so we don't try to check it for conformance. - (no way will it conform) + * check_source_standards.pl, jit2h.pl: Add the "autogenerated file" + header to jit_struct.h so we don't try to check it for conformance. + (no way will it conform) 2002-03-04 03:38 josh - * include/parrot/: chartype.h, interpreter.h, io.h, rx.h, trace.h, - unicode.h, warnings.h: Remove some remaining tabs and split some of - the remaining long lines. + * include/parrot/: chartype.h, interpreter.h, io.h, rx.h, trace.h, + unicode.h, warnings.h: Remove some remaining tabs and split some of + the remaining long lines. 2002-03-04 03:17 josh - * include/parrot/: chartype.h, embed.h, encoding.h, exceptions.h, - global_setup.h, interpreter.h, io.h, jit.h, key.h, memory.h, - misc.h, op.h, oplib.h, packfile.h, parrot.h, pmc.h, register.h, - resources.h, runops_cores.h, rx.h, rxstacks.h, stacks.h, string.h, - string_funcs.h, trace.h, warnings.h: This is the first batch of - re-indenting. This patch is the result of running run_indent.pl - on the header files and manually tweaking the results where errors - were noticed. This should get us closed, but some refinement may - follow. + * include/parrot/: chartype.h, embed.h, encoding.h, exceptions.h, + global_setup.h, interpreter.h, io.h, jit.h, key.h, memory.h, + misc.h, op.h, oplib.h, packfile.h, parrot.h, pmc.h, register.h, + resources.h, runops_cores.h, rx.h, rxstacks.h, stacks.h, string.h, + string_funcs.h, trace.h, warnings.h: This is the first batch of + re-indenting. This patch is the result of running run_indent.pl + on the header files and manually tweaking the results where errors + were noticed. This should get us closed, but some refinement may + follow. 2002-03-04 03:06 josh - * resources.c: Return without parens, as mentioned in PDD 7 + * resources.c: Return without parens, as mentioned in PDD 7 2002-03-04 03:01 josh - * core.ops: POD fixes. + * core.ops: POD fixes. 2002-03-04 02:58 josh - * config_h.in, ops2c.pl, classes/pmc2c.pl: More consistent headers - on autogenerated files- used by the check_source_standards.pl - script (for now) to exempt autogenerated files from the checks. + * config_h.in, ops2c.pl, classes/pmc2c.pl: More consistent headers + on autogenerated files- used by the check_source_standards.pl + script (for now) to exempt autogenerated files from the checks. 2002-03-04 02:51 josh - * embed.c, key.c, pmc.c, resources.c, rx.c, testparrotfuncptr.c, - warnings.c: Added the editor "boilerplate" footer to a few files - which were missing it. + * embed.c, key.c, pmc.c, resources.c, rx.c, testparrotfuncptr.c, + warnings.c: Added the editor "boilerplate" footer to a few files + which were missing it. 2002-03-04 02:34 josh - * check_source_standards.pl, interpreter.c, jit.c, test_gnuc.c, - include/parrot/io.h, include/parrot/parrot.h, io/io_win32.c: Fixes - c preprocessor directive indentation to comply with pdd 7. + * check_source_standards.pl, interpreter.c, jit.c, test_gnuc.c, + include/parrot/io.h, include/parrot/parrot.h, io/io_win32.c: Fixes + c preprocessor directive indentation to comply with pdd 7. - (also fixes the check for this indentation in - check_source_standards.pl) + (also fixes the check for this indentation in + check_source_standards.pl) 2002-03-04 02:32 josh - * lib/Parrot/Test.pm: Fixes this error seen on perl 5.005_02 on - irix. + * lib/Parrot/Test.pm: Fixes this error seen on perl 5.005_02 on + irix. - perl t/harness t/op/basic..........Use of uninitialized value at - lib/Parrot/Test.pm line 81. # Failed test (t/op/basic.t at - line 6) # got: undef # expected: '' + perl t/harness t/op/basic..........Use of uninitialized value at + lib/Parrot/Test.pm line 81. # Failed test (t/op/basic.t at + line 6) # got: undef # expected: '' 2002-03-04 02:30 josh - * MANIFEST, run_indent.pl, docs/pdds/pdd07_codingstd.pod, - docs/pdds/pdd7.pod: Added documentation and code to invoke the GNU - "indent" program to enforce some of the code style standards - outlined in PDD 7. + * MANIFEST, run_indent.pl, docs/pdds/pdd07_codingstd.pod, + docs/pdds/pdd7.pod: Added documentation and code to invoke the GNU + "indent" program to enforce some of the code style standards + outlined in PDD 7. - Usage: ./run_indent.pl + Usage: ./run_indent.pl 2002-03-03 19:04 simon - * examples/mops/mops.c: - Let's make it compile, huh? + * examples/mops/mops.c: + Let's make it compile, huh? 2002-03-03 19:04 simon - * examples/mops/mops.cs: - I R AN IDIOT + * examples/mops/mops.cs: + I R AN IDIOT 2002-03-03 18:11 simon - * examples/mops/mops.cs, examples/mops/mops.il, MANIFEST: - Added C# and MS-IL versions of mops tester. + * examples/mops/mops.cs, examples/mops/mops.il, MANIFEST: + Added C# and MS-IL versions of mops tester. 2002-03-03 14:52 simon - * core.ops: - Add a sub() op to make mops_p work. + * core.ops: + Add a sub() op to make mops_p work. 2002-03-02 18:12 nicholas - * examples/mops/mops.c, include/parrot/embed.h, - include/parrot/interp_guts.h, include/parrot/jit.h, - include/parrot/misc.h, include/parrot/packfile.h, - include/parrot/rx.h, include/parrot/warnings.h, - platforms/generic.c, platforms/generic.h, platforms/win32.c, - platforms/win32.h, types/bignum.c, types/bignum.h: Patch from Josh - Wilmes to add the emacs and vim "ending boilerplate" that sets the - indent variables correctly. + * examples/mops/mops.c, include/parrot/embed.h, + include/parrot/interp_guts.h, include/parrot/jit.h, + include/parrot/misc.h, include/parrot/packfile.h, + include/parrot/rx.h, include/parrot/warnings.h, + platforms/generic.c, platforms/generic.h, platforms/win32.c, + platforms/win32.h, types/bignum.c, types/bignum.h: Patch from Josh + Wilmes to add the emacs and vim "ending boilerplate" that sets the + indent variables correctly. 2002-03-02 17:41 nicholas - * resources.c: Patch from Josh Wilmes : Little - patch to fix a compiler warning. + * resources.c: Patch from Josh Wilmes : Little + patch to fix a compiler warning. 2002-03-01 22:35 dan - * memory.c, resources.c, include/parrot/pmc.h, - include/parrot/resources.h: PMCs now come out of arenas. + * memory.c, resources.c, include/parrot/pmc.h, + include/parrot/resources.h: PMCs now come out of arenas. 2002-03-01 06:15 dan - * string.c: - A non-existing buffer + a non-existing buffer should be a - non-existing buffer, not "", which is really '\0'. + * string.c: + A non-existing buffer + a non-existing buffer should be a + non-existing buffer, not "", which is really '\0'. - Courtesy of "Bryan C. Warnock" + Courtesy of "Bryan C. Warnock" 2002-03-01 06:02 dan - * classes/: array.pmc, perlarray.pmc, perlhash.pmc, perlstring.pmc: + * classes/: array.pmc, perlarray.pmc, perlhash.pmc, perlstring.pmc: - TMTOWTDI, but strcmp is probably the worse. + TMTOWTDI, but strcmp is probably the worse. - Courtesy of "Bryan C. Warnock" + Courtesy of "Bryan C. Warnock" 2002-03-01 02:32 brentdax - * embed.c: Debug mode now prints out the GC data. + * embed.c: Debug mode now prints out the GC data. 2002-02-28 23:44 dan - * core.ops, resources.c, include/parrot/resources.h: Added collect - and sweep opcodes + * core.ops, resources.c, include/parrot/resources.h: Added collect + and sweep opcodes 2002-02-28 22:58 dan - * docs/pdds/: pdd06_pasm.pod, pdd6.pod: Add docs for interpinfo - opcode + * docs/pdds/: pdd06_pasm.pod, pdd6.pod: Add docs for interpinfo + opcode 2002-02-28 22:50 dan - * core.ops, interpreter.c, resources.c, - examples/assembly/life.pasm, include/parrot/interpreter.h, - include/parrot/resources.h: Add some stat gathering to the resource - allocation code. + * core.ops, interpreter.c, resources.c, + examples/assembly/life.pasm, include/parrot/interpreter.h, + include/parrot/resources.h: Add some stat gathering to the resource + allocation code. - Also add an interpreter info retrieval op, and teach it about the - different things it can retrieve. + Also add an interpreter info retrieval op, and teach it about the + different things it can retrieve. - Finally, add some stat info to life.pasm as an example + Finally, add some stat info to life.pasm as an example 2002-02-28 21:27 dan - * editor/pasm.vim: VIM mode commands for parrot assembly files + * editor/pasm.vim: VIM mode commands for parrot assembly files - Courtesy of Scott Beck + Courtesy of Scott Beck 2002-02-28 19:20 dan - * examples/assembly/life.pasm: Fix a creeping string length leak. + * examples/assembly/life.pasm: Fix a creeping string length leak. - Courtesy of "Bryan C. Warnock" + Courtesy of "Bryan C. Warnock" 2002-02-28 18:26 dan - * string.c: When you clone a constant, it ain't constant no mo'. + * string.c: When you clone a constant, it ain't constant no mo'. - Courtesy of "Bryan C. Warnock" + Courtesy of "Bryan C. Warnock" 2002-02-28 00:51 dan - * MANIFEST: Add missing files + * MANIFEST: Add missing files - Courtesy of "Bryan C. Warnock" + Courtesy of "Bryan C. Warnock" 2002-02-28 00:49 dan - * docs/pdds/: pdd0.pod, pdd00_pdd.pod: The pod version of PDD 0 in - CVS seems to have several chunks missing out of it, too. This - patch is simply an administrative patch, with the differences - between my last version, and the one currently in there. There - will be a forthcoming patch for some minor tweaking to the PDD, but - I wanted a common baseline before I make any (potential) semantic - changes. + * docs/pdds/: pdd0.pod, pdd00_pdd.pod: The pod version of PDD 0 in + CVS seems to have several chunks missing out of it, too. This + patch is simply an administrative patch, with the differences + between my last version, and the one currently in there. There + will be a forthcoming patch for some minor tweaking to the PDD, but + I wanted a common baseline before I make any (potential) semantic + changes. - There's only one semi-major change, which noone needs to worry - about just yet. That's a change from PDD Format 1 to PDD Format - 6.0 - rationale can be found under 'Standard (Version #)' of the - STANDARDS TRACK infomation. Don't worry about this yet, because it - should be 6.0.0, and we need to discuss Perl versus Parrot with - PDDs. + There's only one semi-major change, which noone needs to worry + about just yet. That's a change from PDD Format 1 to PDD Format + 6.0 - rationale can be found under 'Standard (Version #)' of the + STANDARDS TRACK infomation. Don't worry about this yet, because it + should be 6.0.0, and we need to discuss Perl versus Parrot with + PDDs. - Courtesy of "Bryan C. Warnock" + Courtesy of "Bryan C. Warnock" 2002-02-28 00:27 dan - * packfile.c, resources.c, examples/assembly/life.pasm, - include/parrot/register.h, include/parrot/resources.h, - include/parrot/string.h: First pass of semi-full GC. (Strings only, - no PMCs yet) + * packfile.c, resources.c, examples/assembly/life.pasm, + include/parrot/register.h, include/parrot/resources.h, + include/parrot/string.h: First pass of semi-full GC. (Strings only, + no PMCs yet) - This patch now implements a real copying collector. We trace from - our root set and compact the contents of Buffer structs. + This patch now implements a real copying collector. We trace from + our root set and compact the contents of Buffer structs. - Todo: + Todo: - *) It's very STRING-centric and doesn't handle memory stuffed in - Buffers. But, then, we don't have pool allocation for Buffers - either, and we need to have that soonish for this to work. + *) It's very STRING-centric and doesn't handle memory stuffed in + Buffers. But, then, we don't have pool allocation for Buffers + either, and we need to have that soonish for this to work. - *) Doesn't trace PMCs, so if you trigger a collection and there's - memory or STRING structs only accessible from PMCs, you'll fail - horribly. That needs fixing too + *) Doesn't trace PMCs, so if you trigger a collection and there's + memory or STRING structs only accessible from PMCs, you'll fail + horribly. That needs fixing too - *) Better algorithms for when to trace or collect vs when to just - go allocate more memory from the system. Should probably be more - cache friendly too. + *) Better algorithms for when to trace or collect vs when to just + go allocate more memory from the system. Should probably be more + cache friendly too. 2002-02-27 21:04 dan - * jit.c, memory.c, resources.c, string.c, docs/pdds/pdd09_gc.pod, - examples/assembly/life.pasm, include/parrot/resources.h, - include/parrot/string.h, include/parrot/string_funcs.h, - jit/i386/core.jit: Start of GC in + * jit.c, memory.c, resources.c, string.c, docs/pdds/pdd09_gc.pod, + examples/assembly/life.pasm, include/parrot/resources.h, + include/parrot/string.h, include/parrot/string_funcs.h, + jit/i386/core.jit: Start of GC in 2002-02-26 16:41 dan - * jit/i386/string.jit: Fix a typo + * jit/i386/string.jit: Fix a typo - Courtesy of Jonathan Stowe + Courtesy of Jonathan Stowe 2002-02-26 16:37 dan - * interpreter.c: Fix solaris test failures + * interpreter.c: Fix solaris test failures - Courtesy of Josh Wilmes + Courtesy of Josh Wilmes 2002-02-26 16:36 dan - * include/parrot/: interp_guts.h, io.h, packfile.h, rx.h, - unicode.h, warnings.h: Fixes various warts in header files, such - as: * macros -added parens to prevent problems with operator - precedence -removed ; at end * removed SSIZE_MAX, since ssize_t - is no longer used * added some more INLINE definitions for MSVC and - C99 compilers + * include/parrot/: interp_guts.h, io.h, packfile.h, rx.h, + unicode.h, warnings.h: Fixes various warts in header files, such + as: * macros -added parens to prevent problems with operator + precedence -removed ; at end * removed SSIZE_MAX, since ssize_t + is no longer used * added some more INLINE definitions for MSVC and + C99 compilers - Courtesy of Brian Lee Ray + Courtesy of Brian Lee Ray 2002-02-26 16:20 dan - * Configure.pl: Turns out we were using a warning flag which - doesn't exist on 2.7. Simple tweak though: + * Configure.pl: Turns out we were using a warning flag which + doesn't exist on 2.7. Simple tweak though: - Courtesy of Josh Wilmes + Courtesy of Josh Wilmes 2002-02-25 22:58 dan - * MANIFEST, docs/pdds/pdd09_gc.pod: Add docs of GC + * MANIFEST, docs/pdds/pdd09_gc.pod: Add docs of GC 2002-02-25 17:36 dan - * include/parrot/pmc.h: Fix the bits + * include/parrot/pmc.h: Fix the bits 2002-02-23 21:57 dan - * include/parrot/resources.h: Another 1.5% never hurts + * include/parrot/resources.h: Another 1.5% never hurts 2002-02-23 21:44 dan - * global_setup.c, memory.c, resources.c, string.c, - include/parrot/resources.h: Allocate STRING headers from an arena - with freelist rather than with the system malloc. First step in a - good (or even a bad) GC system. + * global_setup.c, memory.c, resources.c, string.c, + include/parrot/resources.h: Allocate STRING headers from an arena + with freelist rather than with the system malloc. First step in a + good (or even a bad) GC system. 2002-02-23 20:37 brentdax - * misc.c: lint has been doing Evil and Wrong things to misc.c. + * misc.c: lint has been doing Evil and Wrong things to misc.c. 2002-02-22 14:59 ajgough - * types/bignum.c: BN_multiply split into BN_multiply and - BN_imultiply, the internal version to be used by idivide so that - rounding isn't performed during intermediate stages of division. + * types/bignum.c: BN_multiply split into BN_multiply and + BN_imultiply, the internal version to be used by idivide so that + rounding isn't performed during intermediate stages of division. - following test scripts now all pass: divide divideint add multiply - subtract remainder compare rounding plus minus (these are all the - operations currently implemented, rescale and power must still be - written, so don't pass right now). + following test scripts now all pass: divide divideint add multiply + subtract remainder compare rounding plus minus (these are all the + operations currently implemented, rescale and power must still be + written, so don't pass right now). 2002-02-22 13:13 ajgough - * types/bignum_atest.pl: Test harness modified to understand - comments better, and be able to run unary (and rounding) tests. - Currently a few rounding tests fail, which are being investigated. + * types/bignum_atest.pl: Test harness modified to understand + comments better, and be able to run unary (and rounding) tests. + Currently a few rounding tests fail, which are being investigated. 2002-02-22 01:41 dan - * key.c: Although there's more work being done on the key stuff and - this isn't the final fix, applying this patch does get parrot to - build with two more compilers, so it's probably worthwhile. + * key.c: Although there's more work being done on the key stuff and + this isn't the final fix, applying this patch does get parrot to + build with two more compilers, so it's probably worthwhile. - Courtesy of Josh Wilmes + Courtesy of Josh Wilmes 2002-02-22 00:53 dan - * config_h.in, misc.c, include/parrot/embed.h, - include/parrot/exceptions.h, include/parrot/interpreter.h, - include/parrot/io.h, include/parrot/parrot.h, include/parrot/pmc.h, - include/parrot/resources.h, include/parrot/rx.h, - include/parrot/string.h, include/parrot/unicode.h, - include/parrot/warnings.h, io/io_stdio.c, io/io_unix.c, - io/io_win32.c: Fixes the following (lcc) warnings: + * config_h.in, misc.c, include/parrot/embed.h, + include/parrot/exceptions.h, include/parrot/interpreter.h, + include/parrot/io.h, include/parrot/parrot.h, include/parrot/pmc.h, + include/parrot/resources.h, include/parrot/rx.h, + include/parrot/string.h, include/parrot/unicode.h, + include/parrot/warnings.h, io/io_stdio.c, io/io_unix.c, + io/io_win32.c: Fixes the following (lcc) warnings: - - interpreter.c:470: warning: expression with no effect elided - (related to the way warnings flags were defined) + - interpreter.c:470: warning: expression with no effect elided + (related to the way warnings flags were defined) - - misc.c:352: warning: unreachable code - misc.c:483: warning: unreachable code - (i introduced these with some overzealous de-linting) + - misc.c:352: warning: unreachable code + misc.c:483: warning: unreachable code + (i introduced these with some overzealous de-linting) - - numerous warnings like this: - io/io_unix.c:383: warning: conversion from pointer to void' to - pointer to - pointer to struct _ParrotIO function(pointer to struct - Parrot_Interp,pointer - to struct _ParrotIOLayer,pointer to const char,pointer to const - char,pointer - to pointer to void)' is compiler dependent + - numerous warnings like this: + io/io_unix.c:383: warning: conversion from pointer to void' to + pointer to + pointer to struct _ParrotIO function(pointer to struct + Parrot_Interp,pointer + to struct _ParrotIOLayer,pointer to const char,pointer to const + char,pointer + to pointer to void)' is compiler dependent - Fixes the following nits: - remove bad indenting (tabs) in the - includes + Fixes the following nits: - remove bad indenting (tabs) in the + includes - Courtesy of Josh Wilmes + Courtesy of Josh Wilmes 2002-02-21 21:12 ajgough - * types/: bignum.c, bignum.h: These might look like massive - changes, but really it's just he imposition of coding standards. - The file still isn't entirely compliant, but is now much more so. + * types/: bignum.c, bignum.h: These might look like massive + changes, but really it's just he imposition of coding standards. + The file still isn't entirely compliant, but is now much more so. - Also changed: + Also changed: - o a few more comments - o BN_compare uses internal BN_comp to compare - o lost_digits behaviour is now correct (test harness modified to - test - this). + o a few more comments + o BN_compare uses internal BN_comp to compare + o lost_digits behaviour is now correct (test harness modified to + test + this). - All binary functions now pass all the tests in the basic standard. - Unary functions not yet tested, will be soon. + All binary functions now pass all the tests in the basic standard. + Unary functions not yet tested, will be soon. 2002-02-21 18:20 dan - * lib/Parrot/OpTrans/CPrederef.pm: The "inline" bit of that patch - was no longer needed, and the ssize_t thing really shouldn't be - needed either. + * lib/Parrot/OpTrans/CPrederef.pm: The "inline" bit of that patch + was no longer needed, and the ssize_t thing really shouldn't be + needed either. - Courtesy of Josh Wilmes + Courtesy of Josh Wilmes 2002-02-21 18:15 dan - * Configure.pl, embed.c, pdump.c, hints/mswin32.pl, - include/parrot/parrot.h: this patch adds support for the freely - available borland c++ 5.5.1 compiler + * Configure.pl, embed.c, pdump.c, hints/mswin32.pl, + include/parrot/parrot.h: this patch adds support for the freely + available borland c++ 5.5.1 compiler - depends on: - josh's patch to remove ssize_t from CPrederef.pm - - working borland compiler (compiler must know where to find headers - and libs) - Perl's Config.pm modified to use cc='bcc32.exe' not of - cc='cl.exe' - a working make utility (borland make doesn't work, - nmake does) + depends on: - josh's patch to remove ssize_t from CPrederef.pm - + working borland compiler (compiler must know where to find headers + and libs) - Perl's Config.pm modified to use cc='bcc32.exe' not of + cc='cl.exe' - a working make utility (borland make doesn't work, + nmake does) - changes: - add bcc in hints/mswin32.pl - clean up for msvc++ in - hints/mswin32.pl - remove a space from Configure.pl (very very - important for bcc) - add a O_BINARY flag to open() in pdump.c, - embed.c (required by bcc) - define O_BINARY 0 when it's not defined - (win32 knows it, linux not) + changes: - add bcc in hints/mswin32.pl - clean up for msvc++ in + hints/mswin32.pl - remove a space from Configure.pl (very very + important for bcc) - add a O_BINARY flag to open() in pdump.c, + embed.c (required by bcc) - define O_BINARY 0 when it's not defined + (win32 knows it, linux not) - and the why: - parrot is MUCH faster when compiled with borland c - (make test on p2-450, 320MB): * msvc++: 313 seconds * bcc: 251 - seconds + and the why: - parrot is MUCH faster when compiled with borland c + (make test on p2-450, 320MB): * msvc++: 313 seconds * bcc: 251 + seconds - Courtesy of "Ritz Daniel" + Courtesy of "Ritz Daniel" 2002-02-21 18:09 dan - * jit.c, testparrotfuncptr.c, trace.c, classes/array.pmc, io/io.c, - io/io_stdio.c, io/io_unix.c, io/io_win32.c: This patch removes - cuddled elses, as required by PDD 7. + * jit.c, testparrotfuncptr.c, trace.c, classes/array.pmc, io/io.c, + io/io_stdio.c, io/io_unix.c, io/io_win32.c: This patch removes + cuddled elses, as required by PDD 7. - Courtesy of Josh Wilmes + Courtesy of Josh Wilmes 2002-02-21 18:04 dan - * MANIFEST, Makefile.in, check_source_standards.pl: This patch adds - a new Makefile target called "check_source". This target scans all - the .c and .h files in the directory and checks for conformance to - a number of the standards outlined in PDD 7. + * MANIFEST, Makefile.in, check_source_standards.pl: This patch adds + a new Makefile target called "check_source". This target scans all + the .c and .h files in the directory and checks for conformance to + a number of the standards outlined in PDD 7. - Courtesy of Josh Wilmes + Courtesy of Josh Wilmes 2002-02-21 16:38 ajgough - * types/: bignum.c, bignum.h, bignum_atest.pl: Modifications to - allow arithmetic with numbers with a fixed fractional part, buffer - structures now more ready to be integrated into the parrot memory - allocation game, test harness modified to allow lost_digits - condition to be checked. Some more comments. + * types/: bignum.c, bignum.h, bignum_atest.pl: Modifications to + allow arithmetic with numbers with a fixed fractional part, buffer + structures now more ready to be integrated into the parrot memory + allocation game, test harness modified to allow lost_digits + condition to be checked. Some more comments. 2002-02-21 15:53 simon - * io/io_unix.c: - Fix typo + * io/io_unix.c: + Fix typo - Courtesy of: "David M. Lloyd" + Courtesy of: "David M. Lloyd" 2002-02-20 16:41 dan - * MANIFEST, docs/pdds/pdd_template.pod: Added in template PDD + * MANIFEST, docs/pdds/pdd_template.pod: Added in template PDD 2002-02-18 18:25 dan - * MANIFEST, lib_deps.pl: Added in lib_deps.pl and MANIFEST change. + * MANIFEST, lib_deps.pl: Added in lib_deps.pl and MANIFEST change. - Courtesy of Josh Wilmes + Courtesy of Josh Wilmes 2002-02-18 18:21 dan - * lib/Parrot/OpTrans/CPrederef.pm: this is a quick fix for - CPrederef.pm to make to generated code compile with the MS - compiler. + * lib/Parrot/OpTrans/CPrederef.pm: this is a quick fix for + CPrederef.pm to make to generated code compile with the MS + compiler. - fixes: - ms compiler allows inline only for c++, for c there's - __inline - ms header files knows nothing about ssize_t + fixes: - ms compiler allows inline only for c++, for c there's + __inline - ms header files knows nothing about ssize_t - Courtesy of "Ritz Daniel" + Courtesy of "Ritz Daniel" 2002-02-18 17:49 dan - * MANIFEST: Add the PDDs + * MANIFEST: Add the PDDs 2002-02-18 17:47 dan - * docs/pdds/: pdd07_codingstd.pod, pdd7.pod: Added in PDD 7, the - coding standards PDD. + * docs/pdds/: pdd07_codingstd.pod, pdd7.pod: Added in PDD 7, the + coding standards PDD. 2002-02-18 17:40 dan - * docs/pdds/: pdd06_pasm.pod, pdd6.pod: Updated to latest rev + * docs/pdds/: pdd06_pasm.pod, pdd6.pod: Updated to latest rev 2002-02-18 12:41 gregor - * test_main.c: - Remove warning about exit() not being declared. + * test_main.c: + Remove warning about exit() not being declared. 2002-02-18 08:29 simon - * misc.c, warnings.c, include/parrot/misc.h, - include/parrot/warnings.h: - This patch adds some missing const's to silence a number of gcc - warnings. + * misc.c, warnings.c, include/parrot/misc.h, + include/parrot/warnings.h: + This patch adds some missing const's to silence a number of gcc + warnings. - Courtesy of: Josh Wilmes + Courtesy of: Josh Wilmes 2002-02-18 08:26 simon - * Makefile.in, core.ops, embed.c, interpreter.c, key.c, misc.c, - ops2c.pl, packfile.c, pdump.c, stacks.c, string.c, - classes/array.pmc, classes/perlarray.pmc, classes/perlhash.pmc, - include/parrot/parrot.h, include/parrot/rx.h, - include/parrot/stacks.h, io/io_stdio.c, io/io_unix.c, - lib/Parrot/OpTrans/CPrederef.pm: - - add makefile target and script to test for external libc - dependencies - - fix return values in hash and array PMCs (returning 0 in a - void func) - - remove unnecessary data pointer <=> function pointer - conversions - outside of the JIT code. - - move the definition of the "INLINE" macro out of the rx header - and make - available for general use on C++ compilers and gcc. - - remove a few unused variables - - Courtesy of: Josh Wilmes + * Makefile.in, core.ops, embed.c, interpreter.c, key.c, misc.c, + ops2c.pl, packfile.c, pdump.c, stacks.c, string.c, + classes/array.pmc, classes/perlarray.pmc, classes/perlhash.pmc, + include/parrot/parrot.h, include/parrot/rx.h, + include/parrot/stacks.h, io/io_stdio.c, io/io_unix.c, + lib/Parrot/OpTrans/CPrederef.pm: + - add makefile target and script to test for external libc + dependencies + - fix return values in hash and array PMCs (returning 0 in a + void func) + - remove unnecessary data pointer <=> function pointer + conversions + outside of the JIT code. + - move the definition of the "INLINE" macro out of the rx header + and make + available for general use on C++ compilers and gcc. + - remove a few unused variables + + Courtesy of: Josh Wilmes 2002-02-17 16:29 simon - * docs/pdds/: pdd0.pod, pdd00_pdd.pod, pdd01_overview.pod, - pdd02_vtables.pod, pdd04_datatypes.pod, pdd05_opfunc.pod, - pdd06_pasm.pod, pdd1.pod, pdd2.pod, pdd4.pod, pdd5.pod, pdd6.pod: - We're organised and responsible. Honest. + * docs/pdds/: pdd0.pod, pdd00_pdd.pod, pdd01_overview.pod, + pdd02_vtables.pod, pdd04_datatypes.pod, pdd05_opfunc.pod, + pdd06_pasm.pod, pdd1.pod, pdd2.pod, pdd4.pod, pdd5.pod, pdd6.pod: + We're organised and responsible. Honest. 2002-02-17 02:46 sfink - * Makefile.in: Remove $^ for nmake compatibility. + * Makefile.in: Remove $^ for nmake compatibility. 2002-02-16 09:20 brentdax - * config_h.in, test_main.c, include/parrot/chartype.h, - include/parrot/embed.h, include/parrot/encoding.h, - include/parrot/string.h, include/parrot/string_funcs.h: Better - embedding exposure and hiding, part 1. + * config_h.in, test_main.c, include/parrot/chartype.h, + include/parrot/embed.h, include/parrot/encoding.h, + include/parrot/string.h, include/parrot/string_funcs.h: Better + embedding exposure and hiding, part 1. 2002-02-16 04:38 dan - * Makefile.in, core.ops, interpreter.c, pbc2c.pl, pdump.c, - runops_cores.c, docs/running.pod, lib/Parrot/OpTrans/C.pm, - lib/Parrot/OpTrans/CGoto.pm, lib/Parrot/OpTrans/CPrederef.pm: - Anyway, here's a patch to repair pbc2c.pl, combined with removing - typecasts in various places throughout the code. It probably won't - work for Windows yet. The libparrot.a target might need to be - modified to at least prevent it from confusing make on Windows; I - don't know. + * Makefile.in, core.ops, interpreter.c, pbc2c.pl, pdump.c, + runops_cores.c, docs/running.pod, lib/Parrot/OpTrans/C.pm, + lib/Parrot/OpTrans/CGoto.pm, lib/Parrot/OpTrans/CPrederef.pm: + Anyway, here's a patch to repair pbc2c.pl, combined with removing + typecasts in various places throughout the code. It probably won't + work for Windows yet. The libparrot.a target might need to be + modified to at least prevent it from confusing make on Windows; I + don't know. - Preliminary instructions for using pbc2c.pl are in - docs/running.pod. I'll try to do better later. + Preliminary instructions for using pbc2c.pl are in + docs/running.pod. I'll try to do better later. - Courtesy of Steve Fink + Courtesy of Steve Fink 2002-02-16 04:15 dan - * exceptions.c, include/parrot/exceptions.h: Warnings cleaned up + * exceptions.c, include/parrot/exceptions.h: Warnings cleaned up - Courtesy of Josh Wilmes + Courtesy of Josh Wilmes 2002-02-16 00:03 simon - * classes/: perlarray.pmc, perlhash.pmc: + * classes/: perlarray.pmc, perlhash.pmc: - pmc is already defined! + pmc is already defined! 2002-02-15 23:20 brentdax - * Configure.pl, config_h.in, exceptions.c, pmc.c, - include/parrot/exceptions.h: Far more informative panic messages. + * Configure.pl, config_h.in, exceptions.c, pmc.c, + include/parrot/exceptions.h: Far more informative panic messages. 2002-02-15 03:24 dan - * lib/Parrot/: Op.pm, OpsFile.pm, OpTrans/CPrederef.pm: Here's a - much more extensive patch that fixes it to work properly, and - deletes a bazillion casts as well. It also points to the question - "can we make the byte_code be an opcode_t* already?" + * lib/Parrot/: Op.pm, OpsFile.pm, OpTrans/CPrederef.pm: Here's a + much more extensive patch that fixes it to work properly, and + deletes a bazillion casts as well. It also points to the question + "can we make the byte_code be an opcode_t* already?" - Oh, and it makes some of the formatting prettier, so it's gotta be - good. + Oh, and it makes some of the formatting prettier, so it's gotta be + good. - Courtesy of * Steve Fink + Courtesy of * Steve Fink 2002-02-15 02:30 dan - * Makefile.in, core.ops, embed.c, misc.c, packfile.c, rx.ops, - stacks.c: I've tweaked the "lint" target somewhat and fixed a few - of the things it finds. Attaching the patch as well as the current - lint output. + * Makefile.in, core.ops, embed.c, misc.c, packfile.c, rx.ops, + stacks.c: I've tweaked the "lint" target somewhat and fixed a few + of the things it finds. Attaching the patch as well as the current + lint output. - Courtesy of Josh Wilmes + Courtesy of Josh Wilmes 2002-02-15 01:59 dan - * t/pmc/: array.t, perlhash.t: Disable non-functional bits for the - moment. + * t/pmc/: array.t, perlhash.t: Disable non-functional bits for the + moment. 2002-02-15 01:48 dan - * t/pmc/perlarray.t: Skip tests for features that need twiddling + * t/pmc/perlarray.t: Skip tests for features that need twiddling 2002-02-15 01:40 dan - * t/op/rx.t: Skip a test that's waiting for us to rejig some array - things + * t/op/rx.t: Skip a test that's waiting for us to rejig some array + things 2002-02-14 23:30 dan - * resources.c: Added comment for buffer tag routine. D'oh! + * resources.c: Added comment for buffer tag routine. D'oh! 2002-02-14 23:28 dan - * resources.c, include/parrot/resources.h: Added buffer mark - routine for GC + * resources.c, include/parrot/resources.h: Added buffer mark + routine for GC 2002-02-14 23:17 dan - * memory.c, classes/array.pmc, classes/perlarray.pmc, - include/parrot/memory.h, include/parrot/string.h, t/pmc/perlhash.t: - Rejigged memory system a bit. Now should be ready for the horror - that is garbage collection. + * memory.c, classes/array.pmc, classes/perlarray.pmc, + include/parrot/memory.h, include/parrot/string.h, t/pmc/perlhash.t: + Rejigged memory system a bit. Now should be ready for the horror + that is garbage collection. 2002-02-14 19:33 gregor - * ops2c.pl, include/parrot/oplib.h: - Added code to automatically generate a function within an oplib to - lookup opinfos given the op name. This will come in handy in future - when we want to twiddle opcode tables at run time and possibly at - startup time. + * ops2c.pl, include/parrot/oplib.h: + Added code to automatically generate a function within an oplib to + lookup opinfos given the op name. This will come in handy in future + when we want to twiddle opcode tables at run time and possibly at + startup time. 2002-02-14 19:25 gregor - * examples/assembly/queens.pasm: - Regenerated queens.pasm from queens.jako since the clone_* stuff - went away. + * examples/assembly/queens.pasm: + Regenerated queens.pasm from queens.jako since the clone_* stuff + went away. 2002-02-14 17:12 dan - * resources.c, include/parrot/resources.h: Finished up the - interface for memory and tracked interpreter thingies. + * resources.c, include/parrot/resources.h: Finished up the + interface for memory and tracked interpreter thingies. 2002-02-14 16:53 dan - * memory.c, include/parrot/memory.h: intercept free and realloc + * memory.c, include/parrot/memory.h: intercept free and realloc 2002-02-14 05:53 dan - * interpreter.c, runops_cores.c: The type changes in struct - Packfile break the pointer math used in a few places to calculate - the address of the end of the loaded byte code. This causes - segfaults in build_asm in jit.c when using -j. It also breaks the - bounds checking on opcode address in runops_slow_core. + * interpreter.c, runops_cores.c: The type changes in struct + Packfile break the pointer math used in a few places to calculate + the address of the end of the loaded byte code. This causes + segfaults in build_asm in jit.c when using -j. It also breaks the + bounds checking on opcode address in runops_slow_core. - The patch adds the necessary cast to correct the code_end - calculations. + The patch adds the necessary cast to correct the code_end + calculations. - Courtesy of Jason Gloudon + Courtesy of Jason Gloudon 2002-02-14 01:01 ajgough - * types/: bignum.c, bignum.h, bignum_test.pl: Added support for - BigInt operations (I think), tests for normal operation continue to - pass. Also a shed load of comments. + * types/: bignum.c, bignum.h, bignum_test.pl: Added support for + BigInt operations (I think), tests for normal operation continue to + pass. Also a shed load of comments. 2002-02-13 01:34 ajgough - * types/: bignum.c, bignum.h, bignum_atest.pl, bignum_test.pl: This - is a (mostly) working bignumber library. There remains much work - to do though, some functions are not yet implemented and headers - need to find their way to the correct place RSN. Also support for - bigints and a sensible error reporting mechanism are needed. + * types/: bignum.c, bignum.h, bignum_atest.pl, bignum_test.pl: This + is a (mostly) working bignumber library. There remains much work + to do though, some functions are not yet implemented and headers + need to find their way to the correct place RSN. Also support for + bigints and a sensible error reporting mechanism are needed. 2002-02-12 18:51 dan - * misc.c: Fix some warnings + * misc.c: Fix some warnings 2002-02-12 17:10 dan - * misc.c: Run through indent -kr -nce so I can read it + * misc.c: Run through indent -kr -nce so I can read it 2002-02-12 16:49 dan - * misc.c: Need standard header/footer comments + * misc.c: Need standard header/footer comments 2002-02-11 20:32 simon - * classes/array.pmc: - get and set pmc methods. + * classes/array.pmc: + get and set pmc methods. 2002-02-11 20:19 simon - * classes/array.pmc: - Maybe the keys aren't integer... + * classes/array.pmc: + Maybe the keys aren't integer... 2002-02-11 20:03 simon - * core.ops, vtable.tbl, classes/default.pmc: - {g,s}et_pmc_keyed + * core.ops, vtable.tbl, classes/default.pmc: + {g,s}et_pmc_keyed 2002-02-11 19:07 simon - * vtable.tbl, classes/default.pmc: - Add set_pmc. Usee with caution. + * vtable.tbl, classes/default.pmc: + Add set_pmc. Usee with caution. 2002-02-11 18:20 dan - * classes/: array.pmc, perlarray.pmc: Patch array classes to - compile + * classes/: array.pmc, perlarray.pmc: Patch array classes to + compile 2002-02-11 17:59 simon - * core.ops, embed.c, global_setup.c, key.c, rx.ops, - classes/perlarray.pmc, classes/perlhash.pmc: - Make it compile. + * core.ops, embed.c, global_setup.c, key.c, rx.ops, + classes/perlarray.pmc, classes/perlhash.pmc: + Make it compile. 2002-02-11 17:57 simon - * packfile.c, include/parrot/packfile.h: - Reduce warnings + * packfile.c, include/parrot/packfile.h: + Reduce warnings - Courtesy of: Andy Dougherty + Courtesy of: Andy Dougherty 2002-02-11 17:55 dan - * docs/parrot_assembly.pod: Document some key ops + * docs/parrot_assembly.pod: Document some key ops 2002-02-11 09:20 brentdax - * pmc.c, include/parrot/exceptions.h: Adding a panic ought to be - disgustingly easy. + * pmc.c, include/parrot/exceptions.h: Adding a panic ought to be + disgustingly easy. 2002-02-11 00:34 simon - * core.ops, include/parrot/exceptions.h: - This is what keyed set ops look like. Remember, however, that for - keyed functions, all operands must be PMCs. set(PMC, PMC, INT) - means $1 = $2[$3], not $1[$2] = $3. set(PMC,PMC,PMC) is so - obviously ambiguous that you ought to use the 4-arg version - instead. + * core.ops, include/parrot/exceptions.h: + This is what keyed set ops look like. Remember, however, that for + keyed functions, all operands must be PMCs. set(PMC, PMC, INT) + means $1 = $2[$3], not $1[$2] = $3. set(PMC,PMC,PMC) is so + obviously ambiguous that you ought to use the 4-arg version + instead. 2002-02-10 23:12 jgoff - * classes/: array.pmc, perlarray.pmc: Properly allocate - SELF->data's array of PMC* data in array and perlarray.pmc. This - isn't tested yet, but should be fairly straightforward. PerlHash - needs to be finished before the system will compile again, and that - should be done in the next few days. + * classes/: array.pmc, perlarray.pmc: Properly allocate + SELF->data's array of PMC* data in array and perlarray.pmc. This + isn't tested yet, but should be fairly straightforward. PerlHash + needs to be finished before the system will compile again, and that + should be done in the next few days. 2002-02-09 04:46 jgoff - * classes/: array.pmc, default.pmc, intqueue.pmc, - parrotpointer.pmc, perlarray.pmc, perlhash.pmc, perlundef.pmc: - Added basic _keyed member functions. Unfortunately this still - doesn't fix the problems that are causing the build to break. It's - a start though. I'm not implementing the PMC add functions just - yet. + * classes/: array.pmc, default.pmc, intqueue.pmc, + parrotpointer.pmc, perlarray.pmc, perlhash.pmc, perlundef.pmc: + Added basic _keyed member functions. Unfortunately this still + doesn't fix the problems that are causing the build to break. It's + a start though. I'm not implementing the PMC add functions just + yet. 2002-02-08 15:59 simon - * classes/array.pmc: - Some more work on getting the array stuff up to date. + * classes/array.pmc: + Some more work on getting the array stuff up to date. 2002-02-08 12:23 simon - * classes/array.pmc, classes/perlhash.pmc, include/parrot/key.h, - lib/Parrot/Vtable.pm: - Got array->get_integer_keyed doing what I think it ought to. One - down, all the rest to go. + * classes/array.pmc, classes/perlhash.pmc, include/parrot/key.h, + lib/Parrot/Vtable.pm: + Got array->get_integer_keyed doing what I think it ought to. One + down, all the rest to go. 2002-02-08 11:47 simon - * vtable.tbl: - Although I didn't intend it to be quite that broken... + * vtable.tbl: + Although I didn't intend it to be quite that broken... 2002-02-08 11:42 simon - * vtable.tbl, include/parrot/parrot.h, lib/Parrot/Vtable.pm: - Completely break Parrot, but at least we get the key stuff right - for now. + * vtable.tbl, include/parrot/parrot.h, lib/Parrot/Vtable.pm: + Completely break Parrot, but at least we get the key stuff right + for now. 2002-02-08 06:25 dan - * hints/darwin.pl: Silences the warning about passing in - -flat_namespace to the compile. That's a link-only flag. + * hints/darwin.pl: Silences the warning about passing in + -flat_namespace to the compile. That's a link-only flag. 2002-02-08 04:52 jgoff - * classes/: array.pmc, default.pmc, intqueue.pmc, - parrotpointer.pmc, perlarray.pmc, perlhash.pmc, perlint.pmc, - perlnum.pmc, perlstring.pmc, perlundef.pmc: Filled in missing - return values in *.pmc, added some missing casts to the repeat_foo - members, and deleted the _index members from the perlscalar - classes. Basic cleanup, and getting ready for _keyed functions. + * classes/: array.pmc, default.pmc, intqueue.pmc, + parrotpointer.pmc, perlarray.pmc, perlhash.pmc, perlint.pmc, + perlnum.pmc, perlstring.pmc, perlundef.pmc: Filled in missing + return values in *.pmc, added some missing casts to the repeat_foo + members, and deleted the _index members from the perlscalar + classes. Basic cleanup, and getting ready for _keyed functions. 2002-02-07 04:49 mrjoltcola - * examples/assembly/bsr.pasm: Elaborated on the bsr/ret example, - added a nested subroutine call. + * examples/assembly/bsr.pasm: Elaborated on the bsr/ret example, + added a nested subroutine call. 2002-02-07 04:32 jgoff - * vtable.tbl, lib/Parrot/Vtable.pm: vtable.tbl got some minor - changes in order to give the whitespace rules a little workout, and - do a little bit more testing. No actual structural changes were - made. lib/Parrot/Vtable.pm got an interface change, and more - importantly should be ready to support the new '_keyed' attribute, - which will work roughly thus: PMC* src_value gets remapped to 'PMC* - src_value' followed by 'KEY* src_key'. This will be how the new - _keyed operators will function, and those should be written within - a few days. + * vtable.tbl, lib/Parrot/Vtable.pm: vtable.tbl got some minor + changes in order to give the whitespace rules a little workout, and + do a little bit more testing. No actual structural changes were + made. lib/Parrot/Vtable.pm got an interface change, and more + importantly should be ready to support the new '_keyed' attribute, + which will work roughly thus: PMC* src_value gets remapped to 'PMC* + src_value' followed by 'KEY* src_key'. This will be how the new + _keyed operators will function, and those should be written within + a few days. 2002-02-06 18:00 doughera - * misc.c: Change C++-style comments to C comments (again). Remove - unused perl5 code that was in #if 0/#endif. + * misc.c: Change C++-style comments to C comments (again). Remove + unused perl5 code that was in #if 0/#endif. 2002-02-06 17:59 doughera - * warnings.c: Add trailing newline. + * warnings.c: Add trailing newline. 2002-02-06 04:14 mrjoltcola - * include/parrot/io.h, io/io.c: Minor cleanup. + * include/parrot/io.h, io/io.c: Minor cleanup. 2002-02-06 03:11 mrjoltcola - * examples/assembly/io1.pasm, io/io.c, io/io_win32.c: Tied up a - couple of loose end in win32 IO stuff. Open behaves now but needs - more work. + * examples/assembly/io1.pasm, io/io.c, io/io_win32.c: Tied up a + couple of loose end in win32 IO stuff. Open behaves now but needs + more work. 2002-02-05 21:02 brentdax - * classes/pmc2c.pl: Length on whoami init was always 7--a problem - which showed up in Purify builds. + * classes/pmc2c.pl: Length on whoami init was always 7--a problem + which showed up in Purify builds. 2002-02-05 17:15 simon - * misc.c: - Warning fixes. + * misc.c: + Warning fixes. - Courtesy of: Jonathan Stowe + Courtesy of: Jonathan Stowe 2002-02-05 17:08 doughera - * misc.c: Avoid C++-style comments. + * misc.c: Avoid C++-style comments. 2002-02-05 17:07 doughera - * lib/Parrot/Jit/sun4Generic.pm: Generated assembly programs were - not valid assembler for Sun's /usr/ccs/bin/as. Now they are, - thanks to Jason Gloudon . + * lib/Parrot/Jit/sun4Generic.pm: Generated assembly programs were + not valid assembler for Sun's /usr/ccs/bin/as. Now they are, + thanks to Jason Gloudon . 2002-02-05 14:04 simon - * misc.c: - Make the problem different, perhaps even better. + * misc.c: + Make the problem different, perhaps even better. 2002-02-05 13:49 simon - * misc.c: - Possibly fix a `short int' is promoted to `int' when passed through - `...' scary error, possibly make things absolutely worse. + * misc.c: + Possibly fix a `short int' is promoted to `int' when passed through + `...' scary error, possibly make things absolutely worse. 2002-02-05 13:15 simon - * Configure.pl: - Placate Tru64. + * Configure.pl: + Placate Tru64. 2002-02-05 13:12 simon - * warnings.c: - Not going to get far without this one... + * warnings.c: + Not going to get far without this one... 2002-02-05 11:41 simon - * string.c: - Don't barf when handed null pointers. + * string.c: + Don't barf when handed null pointers. 2002-02-05 10:04 simon - * misc.c, include/parrot/misc.h: - Fix some trivial bugs in warnings code. + * misc.c, include/parrot/misc.h: + Fix some trivial bugs in warnings code. 2002-02-05 09:27 simon - * misc.c: - Oops, forgot this one; also added %P support. + * misc.c: + Oops, forgot this one; also added %P support. 2002-02-05 09:20 simon - * MANIFEST, Makefile.in, core.ops, embed.c, interpreter.c, - test_main.c, classes/perlundef.pmc, include/parrot/embed.h, - include/parrot/interpreter.h, include/parrot/misc.h, - include/parrot/parrot.h, include/parrot/warnings.h: - Warnings support. + * MANIFEST, Makefile.in, core.ops, embed.c, interpreter.c, + test_main.c, classes/perlundef.pmc, include/parrot/embed.h, + include/parrot/interpreter.h, include/parrot/misc.h, + include/parrot/parrot.h, include/parrot/warnings.h: + Warnings support. - Courtesy of: Brent Dax + Courtesy of: Brent Dax 2002-02-05 05:41 jgoff - * vtable.tbl, lib/Parrot/Vtable.pm, t/pmc/perlstring.t: Changed the - format of vtable.tbl to get rid of the tab-dependence. The format - now looks roughly like this: + * vtable.tbl, lib/Parrot/Vtable.pm, t/pmc/perlstring.t: Changed the + format of vtable.tbl to get rid of the tab-dependence. The format + now looks roughly like this: - init() # 'void' and 'unique' are assumed INTVAL type ( ) # 'unique' - is assumed str void concatenate (PMC* value, PMC* dest) # Nothing - assumed here, but note the C-like prototyping. Also had to disable - one test that depended upon 'concat_p_p_s', which isn't necessary - anyway. + init() # 'void' and 'unique' are assumed INTVAL type ( ) # 'unique' + is assumed str void concatenate (PMC* value, PMC* dest) # Nothing + assumed here, but note the C-like prototyping. Also had to disable + one test that depended upon 'concat_p_p_s', which isn't necessary + anyway. - Vtable.pm will change again when the type '_keyed' is added, - because that requires remapping parameters slightly differently - again. Also, note that it assumes 'value' is the first parameter - in the list. This assumption will go away at the same time. + Vtable.pm will change again when the type '_keyed' is added, + because that requires remapping parameters slightly differently + again. Also, note that it assumes 'value' is the first parameter + in the list. This assumption will go away at the same time. 2002-02-04 16:57 ajgough - * core.ops, t/pmc/perlstring.t, t/pmc/pmc.t: More tests for pmc - functions. Thanks to Simon Glover. + * core.ops, t/pmc/perlstring.t, t/pmc/pmc.t: More tests for pmc + functions. Thanks to Simon Glover. 2002-02-04 02:47 ajgough - * hints/os2.pl: Removes a flag from the os/2 hints file that isn't - needed. I suspect that the entire hints file isn't really needed, - but there's no one to actually tell us this. + * hints/os2.pl: Removes a flag from the os/2 hints file that isn't + needed. I suspect that the entire hints file isn't really needed, + but there's no one to actually tell us this. 2002-02-02 15:45 ask - * docs/ParrotFAQ.htm: fix internal links + * docs/ParrotFAQ.htm: fix internal links 2002-02-02 04:06 jgoff - * classes/: array.pmc, intqueue.pmc, perlarray.pmc, perlhash.pmc: - Moving the internal KEY structure from the cache.struct_val member, - where it doesn't really belong, to the internal SELF->data member. - This frees up the cache/type members for other usage. + * classes/: array.pmc, intqueue.pmc, perlarray.pmc, perlhash.pmc: + Moving the internal KEY structure from the cache.struct_val member, + where it doesn't really belong, to the internal SELF->data member. + This frees up the cache/type members for other usage. - This is the first step in moving PMCs to the point where we can do - multidimensional PMC handles. The next step is to change the - assembler to accept the syntax of 'set P0["foo"],7'. + This is the first step in moving PMCs to the point where we can do + multidimensional PMC handles. The next step is to change the + assembler to accept the syntax of 'set P0["foo"],7'. 2002-02-02 00:13 nicholas - * include/parrot/global_setup.h: Patch from Jonathan Stowe to - prototype Parrot_Array_class_init + * include/parrot/global_setup.h: Patch from Jonathan Stowe to + prototype Parrot_Array_class_init 2002-02-02 00:13 nicholas - * embed.c: Casts to tidy up warnings from Jonathan Stowe Change - time to sum_time to avoid warning on FreeBSD about tracking a - global [No, this warning does not appear on Linux. Yes, it is real - :-)] + * embed.c: Casts to tidy up warnings from Jonathan Stowe Change + time to sum_time to avoid warning on FreeBSD about tracking a + global [No, this warning does not appear on Linux. Yes, it is real + :-)] 2002-02-01 23:02 nicholas - * embed.c: Fix fprintf format warning in Parrot_runcode. From Simon - Glover + * embed.c: Fix fprintf format warning in Parrot_runcode. From Simon + Glover 2002-02-01 20:20 nicholas - * t/pmc/pmc.t: Add end at end of asm in test (from Simon Glover) + * t/pmc/pmc.t: Add end at end of asm in test (from Simon Glover) 2002-02-01 18:20 nicholas - * lib/Parrot/Test.pm: Env.pm on 5.005_03 doesn't do a use vars for - you + * lib/Parrot/Test.pm: Env.pm on 5.005_03 doesn't do a use vars for + you 2002-02-01 13:22 nicholas - * MANIFEST: Add docs/embed.pod and t/op/ifunless.t + * MANIFEST: Add docs/embed.pod and t/op/ifunless.t 2002-02-01 12:19 simon - * core.ops, t/op/ifunless.t, t/op/integer.t: - Added "unless" op. + * core.ops, t/op/ifunless.t, t/op/integer.t: + Added "unless" op. 2002-02-01 12:11 simon - * lib/Parrot/Test.pm: - Remove a warning. + * lib/Parrot/Test.pm: + Remove a warning. 2002-02-01 01:38 nicholas - * MANIFEST, MANIFEST.SKIP, Makefile.in: Add a MANIFEST.SKIP file, - and a manitest target to Makefile.in that lets one test the - manifest. + * MANIFEST, MANIFEST.SKIP, Makefile.in: Add a MANIFEST.SKIP file, + and a manitest target to Makefile.in that lets one test the + manifest. 2002-02-01 00:03 dan - * core.ops, global_setup.c, include/parrot/pmc.h: More setup for - PMC dynaloading + * core.ops, global_setup.c, include/parrot/pmc.h: More setup for + PMC dynaloading 2002-01-31 21:46 gregor - * Configure.pl, Makefile.in, hints/mswin32.pl: - A few more things are now configable, so we are closer to win32 - shared library builds. Not there yet, but closer. + * Configure.pl, Makefile.in, hints/mswin32.pl: + A few more things are now configable, so we are closer to win32 + shared library builds. Not there yet, but closer. 2002-01-31 21:00 dan - * global_setup.c, classes/pmc2c.pl, include/parrot/global_setup.h, - include/parrot/pmc.h: First step in dynamically loading PMC classes + * global_setup.c, classes/pmc2c.pl, include/parrot/global_setup.h, + include/parrot/pmc.h: First step in dynamically loading PMC classes 2002-01-31 19:38 dan - * Makefile.in: Dependencies in the Makefile are currently too broad - brush. I don't enjoy waiting for everything to recompile every - time I try to tweak the jit. The only file that #includes - jit_struct.h is jit.c, so I feel that the Makefile dependencies - should reflect this, and not cause a gratuitous recompile of - everything. There are probably other auto-generated header files - that world+dog should not depend on. + * Makefile.in: Dependencies in the Makefile are currently too broad + brush. I don't enjoy waiting for everything to recompile every + time I try to tweak the jit. The only file that #includes + jit_struct.h is jit.c, so I feel that the Makefile dependencies + should reflect this, and not cause a gratuitous recompile of + everything. There are probably other auto-generated header files + that world+dog should not depend on. - Courtesy of Nicholas Clark + Courtesy of Nicholas Clark 2002-01-31 19:03 gregor - * Makefile.in, lib/Parrot/Test.pm, t/harness: - Added two new make targets: + * Makefile.in, lib/Parrot/Test.pm, t/harness: + Added two new make targets: - * testp: Like 'make test', but passes -P to t/harness, so you get - to - see how broken predereferencing is. + * testp: Like 'make test', but passes -P to t/harness, so you get + to + see how broken predereferencing is. - * testj: Like 'make test', but passes -j to t/harness, so you get - to - see how broken JIT is. + * testj: Like 'make test', but passes -j to t/harness, so you get + to + see how broken JIT is. - Now, anyone who wants to see how good all three ways of running are - can do so, at the cost of about 3x the time. + Now, anyone who wants to see how good all three ways of running are + can do so, at the cost of about 3x the time. 2002-01-31 17:09 brentdax - * embed.c, test_main.c: Implement the ARGV-in-P0 thing. + * embed.c, test_main.c: Implement the ARGV-in-P0 thing. 2002-01-31 03:41 grunblatt - * docs/jit.pod: Update jit.pod + * docs/jit.pod: Update jit.pod 2002-01-31 03:20 grunblatt - * jit/i386/core.jit: Hold this until we get an assemble tool, - because of the different objdump problems. + * jit/i386/core.jit: Hold this until we get an assemble tool, + because of the different objdump problems. 2002-01-31 03:13 grunblatt - * Configure.pl, lib/Parrot/Jit/sun4-solaris.pm, - lib/Parrot/Jit/sun4Generic.pm: Use dis intead of objdump. Courtesy - of: Jason Gloudon + * Configure.pl, lib/Parrot/Jit/sun4-solaris.pm, + lib/Parrot/Jit/sun4Generic.pm: Use dis intead of objdump. Courtesy + of: Jason Gloudon 2002-01-31 02:22 grunblatt - * jit/i386/core.jit: Continue if the register is null + * jit/i386/core.jit: Continue if the register is null 2002-01-30 23:50 grunblatt - * lib/Parrot/Jit/: alpha-bsd.pm, alpha-linux.pm, alphaGeneric.pm, - i386-bsd.pm, i386-linux.pm, i386Generic.pm, sun4-solaris.pm, - sun4Generic.pm: Move the AS and OBJDUMP constants to each os - specific file. + * lib/Parrot/Jit/: alpha-bsd.pm, alpha-linux.pm, alphaGeneric.pm, + i386-bsd.pm, i386-linux.pm, i386Generic.pm, sun4-solaris.pm, + sun4Generic.pm: Move the AS and OBJDUMP constants to each os + specific file. 2002-01-30 23:35 mrjoltcola - * io/io_win32.c: Change implementation of isatty on win32, - suggested by Hong Zhang. + * io/io_win32.c: Change implementation of isatty on win32, + suggested by Hong Zhang. 2002-01-30 23:19 sfink - * jit2h.pl, lib/Parrot/Op.pm, lib/Parrot/OpsFile.pm: Added - Op::may_jump boolean method. + * jit2h.pl, lib/Parrot/Op.pm, lib/Parrot/OpsFile.pm: Added + Op::may_jump boolean method. - Replaced jit2h's hardcoded pattern match to decide what ops might - change the control flow. + Replaced jit2h's hardcoded pattern match to decide what ops might + change the control flow. 2002-01-30 22:13 dan - * Configure.pl, MANIFEST, testparrotfuncptr.c: This patch allows - parrot to mostly-build with tcc. It allows one to skip compiling - the JIT stuff (by specifying --define jitcapable=0), and it - introduces a test program which gives a friendlier error in this - case for compilers which are as picky as tcc is about function - pointer conversion. + * Configure.pl, MANIFEST, testparrotfuncptr.c: This patch allows + parrot to mostly-build with tcc. It allows one to skip compiling + the JIT stuff (by specifying --define jitcapable=0), and it + introduces a test program which gives a friendlier error in this + case for compilers which are as picky as tcc is about function + pointer conversion. - If anyone figures out the proper way to cast these function - pointers this may not be necessary. + If anyone figures out the proper way to cast these function + pointers this may not be necessary. - Courtesy of Josh Wilmes + Courtesy of Josh Wilmes 2002-01-30 20:54 dan - * docs/running.pod, lib/Parrot/Test.pm: I'm being anal again. - Here's an update to docs/running.pod to better reflect the current - state (both the test_parrot and assemble.pl improvements, plus - documentation of a few more things.) And also a speling fiks - s/POST_MORTERM/POST_MORTEM/. + * docs/running.pod, lib/Parrot/Test.pm: I'm being anal again. + Here's an update to docs/running.pod to better reflect the current + state (both the test_parrot and assemble.pl improvements, plus + documentation of a few more things.) And also a speling fiks + s/POST_MORTERM/POST_MORTEM/. - I could also replace some "perl foo" calls with "./foo" if someone - wanted to set the executable flag in CVS on assemble.pl, - optimize.pl, etc. + I could also replace some "perl foo" calls with "./foo" if someone + wanted to set the executable flag in CVS on assemble.pl, + optimize.pl, etc. - Courtesy of Steve Fink + Courtesy of Steve Fink 2002-01-30 20:43 dan - * core.ops: find_global doesn't work, so stub out the wrong code + * core.ops: find_global doesn't work, so stub out the wrong code 2002-01-30 19:08 dan - * lib/Parrot/Assembler.pm: fixes the POD in Parrot::Assembler so - that perldoc - can read it and just tidies it up generally. It also adds - documentation - for the constantize_integer and constantize_number functions. + * lib/Parrot/Assembler.pm: fixes the POD in Parrot::Assembler so + that perldoc + can read it and just tidies it up generally. It also adds + documentation + for the constantize_integer and constantize_number functions. - Courtesy of Simon Glover + Courtesy of Simon Glover 2002-01-30 18:02 dan - * assemble.pl, disassemble.pl, optimizer.pl, pbc2c.pl, - classes/genclass.pl, classes/pmc2c.pl, - languages/scheme/Scheme/Test.pm: Many of the Perl scripts in the - distribution (including assemble.pl !) - can no longer find the Parrot::* modules. Enclosed patch fixes - (although - it would be nice if there were an easier way to do this). + * assemble.pl, disassemble.pl, optimizer.pl, pbc2c.pl, + classes/genclass.pl, classes/pmc2c.pl, + languages/scheme/Scheme/Test.pm: Many of the Perl scripts in the + distribution (including assemble.pl !) + can no longer find the Parrot::* modules. Enclosed patch fixes + (although + it would be nice if there were an easier way to do this). - Courtesy of Simon Glover + Courtesy of Simon Glover 2002-01-30 16:00 mrjoltcola - * io/io_win32.c: Correct function calls for win32_fdopen and arg - types. + * io/io_win32.c: Correct function calls for win32_fdopen and arg + types. 2002-01-30 15:50 mrjoltcola - * io/io_unix.c: Minor bug fix for fdopen flag arg type. + * io/io_unix.c: Minor bug fix for fdopen flag arg type. 2002-01-30 15:42 grunblatt - * pbc2c.pl, examples/assembly/Makefile: Updates related to moving - files around + * pbc2c.pl, examples/assembly/Makefile: Updates related to moving + files around 2002-01-30 15:38 grunblatt - * MANIFEST: Enclosed patch adds the new SPARC-based JIT files to - the manifest, and also puts it back into alphabetical order. + * MANIFEST: Enclosed patch adds the new SPARC-based JIT files to + the manifest, and also puts it back into alphabetical order. - Courtesy of: Simon Glover + Courtesy of: Simon Glover 2002-01-30 14:41 nicholas - * embed.c: Patch from Simon Glover to clean up warnings where - prototype is () not (void) + * embed.c: Patch from Simon Glover to clean up warnings where + prototype is () not (void) 2002-01-30 13:54 nicholas - * include/parrot/embed.h, test_main.c: Add void as an explicit - parameter in test_main.c's usage(), version(void) and embed.h's - Parrot_new() Without these gcc moans: include/parrot/embed.h:34: - warning: function declaration isn't a prototype + * include/parrot/embed.h, test_main.c: Add void as an explicit + parameter in test_main.c's usage(), version(void) and embed.h's + Parrot_new() Without these gcc moans: include/parrot/embed.h:34: + warning: function declaration isn't a prototype 2002-01-30 12:08 simon - * lib/Parrot/.cvsignore: - Ignore generated Perl modules. + * lib/Parrot/.cvsignore: + Ignore generated Perl modules. 2002-01-30 12:07 simon - * t/harness: - Run the PMC tests as well. + * t/harness: + Run the PMC tests as well. 2002-01-30 12:04 simon - * MANIFEST: - Fix MANIFEST after recent t/pmc rejig. + * MANIFEST: + Fix MANIFEST after recent t/pmc rejig. 2002-01-30 11:42 simon - * lib/Parrot/Test.pm: - Report non-zero exit codes. + * lib/Parrot/Test.pm: + Report non-zero exit codes. - Courtesy of: Michael G Schwern + Courtesy of: Michael G Schwern 2002-01-30 11:39 simon - * t/op/rx.t: - Skip final test, TODO doesn't work yet. + * t/op/rx.t: + Skip final test, TODO doesn't work yet. 2002-01-30 09:54 brentdax - * docs/embed.pod: Leon Brocard was kind enough to explain to me how - predereferencing works. + * docs/embed.pod: Leon Brocard was kind enough to explain to me how + predereferencing works. 2002-01-30 09:38 brentdax - * docs/: embed.pod, parrot.pod: Document this newfangled embedding - subsystem. + * docs/: embed.pod, parrot.pod: Document this newfangled embedding + subsystem. 2002-01-30 09:37 brentdax - * include/parrot/embed.h: Fix a mistake, clear up a warning. + * include/parrot/embed.h: Fix a mistake, clear up a warning. 2002-01-30 09:37 brentdax - * config_h.in: Expose another flag for embedders. + * config_h.in: Expose another flag for embedders. 2002-01-30 05:07 jgoff - * make_vtable_ops.pl, t/harness: Both files didn't know of the new - location for Parrot/, and t/harness wasn't able to run the new - op/pmc tests. Both problems fixed, so I think I'm going to declare - the build suitable for public consumption. + * make_vtable_ops.pl, t/harness: Both files didn't know of the new + location for Parrot/, and t/harness wasn't able to run the new + op/pmc tests. Both problems fixed, so I think I'm going to declare + the build suitable for public consumption. 2002-01-30 04:34 robert - * docs/Makefile.in: update for CVS movement + * docs/Makefile.in: update for CVS movement 2002-01-30 04:32 robert - * Makefile.in: Adjust for CVS reorganization. (This time, edit the - .in file, not the real Makefile) + * Makefile.in: Adjust for CVS reorganization. (This time, edit the + .in file, not the real Makefile) 2002-01-30 04:20 robert - * Configure.pl, jit2h.pl, ops2c.pl, ops2pm.pl, pmc_pm.pl, - vtable_h.pl, classes/pmc2c.pl, include/parrot/parrot.h: Updates - related to moving files around + * Configure.pl, jit2h.pl, ops2c.pl, ops2pm.pl, pmc_pm.pl, + vtable_h.pl, classes/pmc2c.pl, include/parrot/parrot.h: Updates + related to moving files around 2002-01-30 04:10 robert - * MANIFEST: Update MANIFEST to reflect CVS reorg. + * MANIFEST: Update MANIFEST to reflect CVS reorg. 2002-01-30 04:07 robert - * Configure.pl: Add './lib' to our @INC because Parrot/* moved. + * Configure.pl: Add './lib' to our @INC because Parrot/* moved. 2002-01-30 03:56 robert - * Parrot/: .cvsignore, Assembler.pm, BuildUtil.pm, Op.pm, - OpTrans.pm, OpsFile.pm, Optimizer.pm, PackFile.pm, String.pm, - Test.pm, Vtable.pm, Jit/alpha-bsd.pm, Jit/alpha-linux.pm, - Jit/alphaGeneric.pm, Jit/i386-bsd.pm, Jit/i386-linux.pm, - Jit/i386-nojit.pm, Jit/i386Generic.pm, Jit/sun4-solaris.pm, - Jit/sun4Generic.pm, OpLib/.cvsignore, OpTrans/C.pm, - OpTrans/CGoto.pm, OpTrans/CPrederef.pm, PackFile/ConstTable.pm, - PackFile/Constant.pm, PackFile/FixupTable.pm: Moved Parrot/* to - lib/Parrot/ + * Parrot/: .cvsignore, Assembler.pm, BuildUtil.pm, Op.pm, + OpTrans.pm, OpsFile.pm, Optimizer.pm, PackFile.pm, String.pm, + Test.pm, Vtable.pm, Jit/alpha-bsd.pm, Jit/alpha-linux.pm, + Jit/alphaGeneric.pm, Jit/i386-bsd.pm, Jit/i386-linux.pm, + Jit/i386-nojit.pm, Jit/i386Generic.pm, Jit/sun4-solaris.pm, + Jit/sun4Generic.pm, OpLib/.cvsignore, OpTrans/C.pm, + OpTrans/CGoto.pm, OpTrans/CPrederef.pm, PackFile/ConstTable.pm, + PackFile/Constant.pm, PackFile/FixupTable.pm: Moved Parrot/* to + lib/Parrot/ 2002-01-30 03:46 robert - * languages/miniperl/miniperlc: renamed to mpc + * languages/miniperl/miniperlc: renamed to mpc 2002-01-30 03:45 robert - * t/op/: pmc.t, pmc_array.t, pmc_perlarray.t, pmc_perlhash.t, - pmc_perlstring.t: Moved to t/op/pmc/ + * t/op/: pmc.t, pmc_array.t, pmc_perlarray.t, pmc_perlhash.t, + pmc_perlstring.t: Moved to t/op/pmc/ 2002-01-30 03:40 robert - * include/parrot/register_funcs.h: Renamed to regfuncs.h + * include/parrot/register_funcs.h: Renamed to regfuncs.h 2002-01-30 03:14 jgoff - * classes/perlarray.pmc, t/op/pmc_perlarray.t, t/pmc/perlarray.t: - Fixed some problems with PerlArray and added tests. Previously, - only integers could be accessed by negative indices. After this - change, all basic types can be accessed by negative indices, and - they can also be set at negative indices. + * classes/perlarray.pmc, t/op/pmc_perlarray.t, t/pmc/perlarray.t: + Fixed some problems with PerlArray and added tests. Previously, + only integers could be accessed by negative indices. After this + change, all basic types can be accessed by negative indices, and + they can also be set at negative indices. 2002-01-29 22:13 brentdax - * TODO: Just look at the stupid diff. + * TODO: Just look at the stupid diff. 2002-01-29 21:53 simon - * TODO, docs/vtables.pod: - New TODO, and tiny addition to vtables.pod + * TODO, docs/vtables.pod: + New TODO, and tiny addition to vtables.pod 2002-01-29 21:47 mrjoltcola - * include/parrot/io.h, io/io_unix.c: Minor bug fix in io_unix. + * include/parrot/io.h, io/io_unix.c: Minor bug fix in io_unix. 2002-01-29 21:38 mrjoltcola - * Makefile.in: Makefile.in tweak for io depend. + * Makefile.in: Makefile.in tweak for io depend. 2002-01-29 21:15 brentdax - * embed.c: Fix a segfault and some profiling formatting nits. + * embed.c: Fix a segfault and some profiling formatting nits. 2002-01-29 20:54 brentdax - * pmc.c: Oops. + * pmc.c: Oops. 2002-01-29 20:50 brentdax - * pmc.c, include/parrot/exceptions.h: Exceptions are better than - segfaults. + * pmc.c, include/parrot/exceptions.h: Exceptions are better than + segfaults. 2002-01-29 20:17 mrjoltcola - * interpreter.c, core.ops, io.ops: CVS missed this. + * interpreter.c, core.ops, io.ops: CVS missed this. 2002-01-29 20:17 mrjoltcola - * io/io.c: These should have gone in Sunday with the rest. CVS is - out to get me. + * io/io.c: These should have gone in Sunday with the rest. CVS is + out to get me. 2002-01-29 18:39 brentdax - * platforms/win32.h: Fix Win32 whoops. + * platforms/win32.h: Fix Win32 whoops. 2002-01-29 18:29 brentdax - * embed.c, include/parrot/embed.h: A couple minor embedding fixes. + * embed.c, include/parrot/embed.h: A couple minor embedding fixes. 2002-01-29 17:51 simon - * MANIFEST, Makefile.in, config_h.in, embed.c, test_main.c, - include/parrot/embed.h, include/parrot/parrot.h: - Embedding support. Cool. + * MANIFEST, Makefile.in, config_h.in, embed.c, test_main.c, + include/parrot/embed.h, include/parrot/parrot.h: + Embedding support. Cool. - Courtesy of: + Courtesy of: 2002-01-29 15:40 grunblatt - * Configure.pl: Detect if we can use "objdump". Courtesy of: Jason - Gloudon + * Configure.pl: Detect if we can use "objdump". Courtesy of: Jason + Gloudon 2002-01-29 14:42 simon - * include/parrot/parrot.h: - Platform stuff has to be included *after* system headers. + * include/parrot/parrot.h: + Platform stuff has to be included *after* system headers. 2002-01-29 14:05 grunblatt - * interpreter.c, jit.c, Parrot/Jit/sun4-solaris.pm, - Parrot/Jit/sun4Generic.pm, lib/Parrot/Jit/sun4-solaris.pm, - lib/Parrot/Jit/sun4Generic.pm, include/parrot/jit.h, - jit/sun4/core.jit, jit/sun4/lib.jit, jit/sun4/string.jit: Added - support for SPARC. Courtesy of: Jason Gloudon + * interpreter.c, jit.c, Parrot/Jit/sun4-solaris.pm, + Parrot/Jit/sun4Generic.pm, lib/Parrot/Jit/sun4-solaris.pm, + lib/Parrot/Jit/sun4Generic.pm, include/parrot/jit.h, + jit/sun4/core.jit, jit/sun4/lib.jit, jit/sun4/string.jit: Added + support for SPARC. Courtesy of: Jason Gloudon 2002-01-29 10:56 simon - * platforms/generic.h: - If we don't have a S_ISREG, produce something close to it. + * platforms/generic.h: + If we don't have a S_ISREG, produce something close to it. 2002-01-29 06:01 dan - * MANIFEST, README, LICENSES/Artistic: Finally added licenses + * MANIFEST, README, LICENSES/Artistic: Finally added licenses 2002-01-29 04:38 jgoff - * classes/array.pmc: Forgot to remove some C++-isms from the - get_{foo}_index routines. + * classes/array.pmc: Forgot to remove some C++-isms from the + get_{foo}_index routines. 2002-01-29 04:26 jgoff - * MANIFEST, Makefile.in, global_setup.c, classes/Makefile.in, - classes/array.pmc, include/parrot/pmc.h, t/op/pmc_array.t, - t/pmc/array.t: Added array class that languages other than perl can - use for a basis. It has no features like preextension, and the - array index starts at 0. + * MANIFEST, Makefile.in, global_setup.c, classes/Makefile.in, + classes/array.pmc, include/parrot/pmc.h, t/op/pmc_array.t, + t/pmc/array.t: Added array class that languages other than perl can + use for a basis. It has no features like preextension, and the + array index starts at 0. - MANIFEST - added classes/array.pmc and t/op/pmc_array.t Makefile.in - and classes/Makefile.in - Added array.pmc to the makefile. - (Assuming rules like .pmc.o are portable (or even possible) I might - alter classes/Makefile.in to autobuild the appropriate files. + MANIFEST - added classes/array.pmc and t/op/pmc_array.t Makefile.in + and classes/Makefile.in - Added array.pmc to the makefile. + (Assuming rules like .pmc.o are portable (or even possible) I might + alter classes/Makefile.in to autobuild the appropriate files. 2002-01-29 02:32 dan - * MANIFEST, Parrot/Test.pm, lib/Parrot/Test.pm, - lib/Test/Builder.pm, lib/Test/More.pm, lib/Test/Simple.pm, - lib/Test/Utils.pm, t/op/interp.t, t/op/macro.t, t/op/pmc.t, - t/op/rx.t, t/op/stacks.t, t/pmc/pmc.t: - Update to Test::More 0.41 which adds Test::Builder + * MANIFEST, Parrot/Test.pm, lib/Parrot/Test.pm, + lib/Test/Builder.pm, lib/Test/More.pm, lib/Test/Simple.pm, + lib/Test/Utils.pm, t/op/interp.t, t/op/macro.t, t/op/pmc.t, + t/op/rx.t, t/op/stacks.t, t/pmc/pmc.t: + Update to Test::More 0.41 which adds Test::Builder - Delete the vestigal Test::Utils + Delete the vestigal Test::Utils - Change Parrot::Test so it uses Test::Builder instead of Evil - Wrappers - around Test::More + Change Parrot::Test so it uses Test::Builder instead of Evil + Wrappers + around Test::More - output_* now returns whether the test passes or fails + output_* now returns whether the test passes or fails - Parrot::Test no longer exports Test::More's functions. Instead - they - can simply be used together. The few tests which used - Test::More - features (ie. skip) have 'use Test::More' added. + Parrot::Test no longer exports Test::More's functions. Instead + they + can simply be used together. The few tests which used + Test::More + features (ie. skip) have 'use Test::More' added. - I ditched the export_to_level() crutch. Do we expect parrot to - work on - 5.004? (literally 5.004, not 5.004_04) + I ditched the export_to_level() crutch. Do we expect parrot to + work on + 5.004? (literally 5.004, not 5.004_04) - Courtesy of Michael G Schwern + Courtesy of Michael G Schwern 2002-01-28 21:04 dan - * docs/overview.pod: There is no opcodes.pod; I'm assuming the - pointer should actually be to - parrot_assembly.pod, as the canonical documentation. + * docs/overview.pod: There is no opcodes.pod; I'm assuming the + pointer should actually be to + parrot_assembly.pod, as the canonical documentation. - Courtesy of Simon Glover + Courtesy of Simon Glover 2002-01-28 20:21 dan - * languages/jako/jakoc, t/op/stacks.t: Toss the last traces of - clone[inps] + * languages/jako/jakoc, t/op/stacks.t: Toss the last traces of + clone[inps] 2002-01-28 19:18 dan - * core.ops, register.c: clone[insp] is dead + * core.ops, register.c: clone[insp] is dead 2002-01-28 17:46 grunblatt - * Parrot/Jit/i386Generic.pm, lib/Parrot/Jit/i386Generic.pm, - jit/i386/core.jit: Fix to make the jit work in linux yet again. + * Parrot/Jit/i386Generic.pm, lib/Parrot/Jit/i386Generic.pm, + jit/i386/core.jit: Fix to make the jit work in linux yet again. 2002-01-28 16:45 dan - * MANIFEST, README.OS_X: Added Mac OS X specific readme documenting - the requirement for fink at the moment. + * MANIFEST, README.OS_X: Added Mac OS X specific readme documenting + the requirement for fink at the moment. 2002-01-28 15:59 simon - * test_main.c: - People might try and run a directory file, with spectacular - results. We don't want that. No. + * test_main.c: + People might try and run a directory file, with spectacular + results. We don't want that. No. 2002-01-28 14:58 doughera - * core.ops: Avoid C++-style comments. + * core.ops: Avoid C++-style comments. 2002-01-28 14:16 grunblatt - * jit.c, io/io.c: Changed jit.c to fit the way registers are - accessed. Readded the pio_(stdin|stdout|stderr) to make builds - work again. + * jit.c, io/io.c: Changed jit.c to fit the way registers are + accessed. Readded the pio_(stdin|stdout|stderr) to make builds + work again. 2002-01-28 13:47 doughera - * include/parrot/register.h: Avoid C++-style comment. + * include/parrot/register.h: Avoid C++-style comment. 2002-01-28 06:03 dan - * MANIFEST, core.ops, interpreter.c, key.c, register.c, trace.c, - Parrot/OpTrans/C.pm, Parrot/OpTrans/CGoto.pm, - lib/Parrot/OpTrans/C.pm, lib/Parrot/OpTrans/CGoto.pm, - docs/parrot_assembly.pod, include/parrot/interpreter.h, - include/parrot/parrot.h, include/parrot/regfuncs.h, - include/parrot/register.h, include/parrot/register_funcs.h, - include/parrot/string.h, include/parrot/string_funcs.h: Registers - are now stored in the interpreter structure itself, rather than - just a pointer to the top of the register structure. Pushes and - pops now involve memcpys, but register access has one fewer - dereference. - - Fails four of the register stack tests, though, so not perfect. - Needs fixing, but this is a good place to start. + * MANIFEST, core.ops, interpreter.c, key.c, register.c, trace.c, + Parrot/OpTrans/C.pm, Parrot/OpTrans/CGoto.pm, + lib/Parrot/OpTrans/C.pm, lib/Parrot/OpTrans/CGoto.pm, + docs/parrot_assembly.pod, include/parrot/interpreter.h, + include/parrot/parrot.h, include/parrot/regfuncs.h, + include/parrot/register.h, include/parrot/register_funcs.h, + include/parrot/string.h, include/parrot/string_funcs.h: Registers + are now stored in the interpreter structure itself, rather than + just a pointer to the top of the register structure. Pushes and + pops now involve memcpys, but register access has one fewer + dereference. + + Fails four of the register stack tests, though, so not perfect. + Needs fixing, but this is a good place to start. 2002-01-28 04:40 mrjoltcola - * test_main.c: cvs commit missed this. ?? + * test_main.c: cvs commit missed this. ?? 2002-01-28 04:27 mrjoltcola - * examples/assembly/io1.pasm, include/parrot/exceptions.h, - include/parrot/interpreter.h, include/parrot/io.h, io/io.c, - io/io_stdio.c, io/io_unix.c, io/io_win32.c: ParrotIO local to each - interpreter now (at least in theory). IO handle array added. Misc - bug fixes in layer handling. Changed any IO_ constants to PIO_ so - we don't conflict with system libraries. Still have broken - stuff in win32 and stdio layer. + * examples/assembly/io1.pasm, include/parrot/exceptions.h, + include/parrot/interpreter.h, include/parrot/io.h, io/io.c, + io/io_stdio.c, io/io_unix.c, io/io_win32.c: ParrotIO local to each + interpreter now (at least in theory). IO handle array added. Misc + bug fixes in layer handling. Changed any IO_ constants to PIO_ so + we don't conflict with system libraries. Still have broken + stuff in win32 and stdio layer. 2002-01-28 04:01 mrjoltcola - * include/parrot/chartype.h: Typo in chartype.h include guard. + * include/parrot/chartype.h: Typo in chartype.h include guard. 2002-01-28 03:41 mrjoltcola - * t/op/interp.t: Fix flag for interp so we don't get "info" - messages which break tests. + * t/op/interp.t: Fix flag for interp so we don't get "info" + messages which break tests. 2002-01-28 01:54 dan - * include/parrot/string.h: A few more buffer/string flags + * include/parrot/string.h: A few more buffer/string flags 2002-01-27 11:33 nicholas - * chartypes/unicode.c: Cast unsigned argument to int in call to - isdigit to silence gcc warning. + * chartypes/unicode.c: Cast unsigned argument to int in call to + isdigit to silence gcc warning. 2002-01-26 23:18 grunblatt - * Parrot/Jit/i386Generic.pm, lib/Parrot/Jit/i386Generic.pm: Turn - off that flag. + * Parrot/Jit/i386Generic.pm, lib/Parrot/Jit/i386Generic.pm: Turn + off that flag. 2002-01-26 23:17 grunblatt - * Parrot/Jit/i386Generic.pm, lib/Parrot/Jit/i386Generic.pm, - jit/i386/core.jit: [no log message] + * Parrot/Jit/i386Generic.pm, lib/Parrot/Jit/i386Generic.pm, + jit/i386/core.jit: [no log message] 2002-01-26 22:18 simon - * jit/i386/core.jit: - Jumping to 0x0 is a recipe for segfaults. + * jit/i386/core.jit: + Jumping to 0x0 is a recipe for segfaults. 2002-01-26 18:35 simon - * t/harness: - Allow user to select which tests to harness + * t/harness: + Allow user to select which tests to harness - Courtesy of: Nicholas Clark + Courtesy of: Nicholas Clark 2002-01-26 17:20 grunblatt - * Parrot/Jit/i386-linux.pm, Parrot/Jit/i386Generic.pm, - lib/Parrot/Jit/i386-linux.pm, lib/Parrot/Jit/i386Generic.pm: Patch - to make the jit work in linux again. + * Parrot/Jit/i386-linux.pm, Parrot/Jit/i386Generic.pm, + lib/Parrot/Jit/i386-linux.pm, lib/Parrot/Jit/i386Generic.pm: Patch + to make the jit work in linux again. 2002-01-26 16:52 dan - * Configure.pl, hints/darwin.pl: Add -Wno-shadow, as Darwin's - headers can't cope with this. Darwin-only + * Configure.pl, hints/darwin.pl: Add -Wno-shadow, as Darwin's + headers can't cope with this. Darwin-only 2002-01-26 16:04 dan - * include/parrot/parrot.h: Quick note to remind folks that this - isn't the file they're looking for if they're writing extensions or - embedding parrot. + * include/parrot/parrot.h: Quick note to remind folks that this + isn't the file they're looking for if they're writing extensions or + embedding parrot. - Courtesy of Andy Dougherty + Courtesy of Andy Dougherty 2002-01-26 00:41 mrjoltcola - * MANIFEST: Oopsy. + * MANIFEST: Oopsy. 2002-01-26 00:37 mrjoltcola - * docs/ParrotFAQ.htm: Parrot FAQ : Created and maintained by Adam - Turoff + * docs/ParrotFAQ.htm: Parrot FAQ : Created and maintained by Adam + Turoff 2002-01-25 01:31 grunblatt - * jit/alpha/core.jit: There is no neg or fneg. + * jit/alpha/core.jit: There is no neg or fneg. 2002-01-25 01:27 grunblatt - * core.ops, Parrot/Jit/alphaGeneric.pm, Parrot/Jit/i386Generic.pm, - lib/Parrot/Jit/alphaGeneric.pm, lib/Parrot/Jit/i386Generic.pm, - jit/alpha/core.jit, jit/i386/core.jit, t/op/integer.t, - t/op/number.t: Added Parrot_neg. Erase t.s + * core.ops, Parrot/Jit/alphaGeneric.pm, Parrot/Jit/i386Generic.pm, + lib/Parrot/Jit/alphaGeneric.pm, lib/Parrot/Jit/i386Generic.pm, + jit/alpha/core.jit, jit/i386/core.jit, t/op/integer.t, + t/op/number.t: Added Parrot_neg. Erase t.s 2002-01-24 23:26 dan - * interpreter.c: Best make sure unused elements are NULL + * interpreter.c: Best make sure unused elements are NULL 2002-01-24 23:24 dan - * interpreter.c: Fix stupid thinko + * interpreter.c: Fix stupid thinko 2002-01-24 18:37 doughera - * Makefile.in: Add a few missing dollar signs in the lifetest - section so that ${exe} and the like get properly interpolated. + * Makefile.in: Add a few missing dollar signs in the lifetest + section so that ${exe} and the like get properly interpolated. 2002-01-24 18:15 mrjoltcola - * docs/: .cvsignore, Makefile.in, parrot.pod: Fix pod generation - for io.ops file. Add reference to it in parrot.pod. Courtesy of - Simon Glover + * docs/: .cvsignore, Makefile.in, parrot.pod: Fix pod generation + for io.ops file. Add reference to it in parrot.pod. Courtesy of + Simon Glover 2002-01-24 06:43 mrjoltcola - * io/io_stdio.c: Oops. + * io/io_stdio.c: Oops. 2002-01-24 06:34 mrjoltcola - * include/parrot/io.h, io/TODO, io/io.c, io/io_stdio.c: Did a bit - of work on the buffering layer. Decided to use shared read/write - buffer (as do most implementations) for now since its the simplest - way to keep everything synced, (flush on seeks, flush read on - writes, etc.) + * include/parrot/io.h, io/TODO, io/io.c, io/io_stdio.c: Did a bit + of work on the buffering layer. Decided to use shared read/write + buffer (as do most implementations) for now since its the simplest + way to keep everything synced, (flush on seeks, flush read on + writes, etc.) 2002-01-24 03:38 mrjoltcola - * test_main.c: Cleaned up option handling code a bit for main(). + * test_main.c: Cleaned up option handling code a bit for main(). 2002-01-23 23:22 dan - * interpreter.c, include/parrot/interpreter.h, - include/parrot/resources.h: Now each interpreter gets its own hash - for globals. + * interpreter.c, include/parrot/interpreter.h, + include/parrot/resources.h: Now each interpreter gets its own hash + for globals. 2002-01-23 20:45 dan - * Configure.pl: Fix a warning when there's no - in an architecture + * Configure.pl: Fix a warning when there's no - in an architecture 2002-01-22 23:57 grunblatt - * docs/running.pod: [no log message] + * docs/running.pod: [no log message] 2002-01-22 20:29 doughera - * KNOWN_ISSUES: long doubles don't work on SPARC either. It - appears to be a generic problem (if sizeof(long double) > - sizeof(double)), not an x86-specific one. + * KNOWN_ISSUES: long doubles don't work on SPARC either. It + appears to be a generic problem (if sizeof(long double) > + sizeof(double)), not an x86-specific one. 2002-01-22 16:57 doughera - * runops_cores.c: Change variable name from time to starttime to - avoid gcc warning about variable name shadowing. + * runops_cores.c: Change variable name from time to starttime to + avoid gcc warning about variable name shadowing. 2002-01-22 16:55 doughera - * classes/pmc2c.pl: Include class_init prototype too. + * classes/pmc2c.pl: Include class_init prototype too. 2002-01-22 16:01 doughera - * MANIFEST: [no log message] + * MANIFEST: [no log message] 2002-01-22 01:04 ajgough - * global_setup.c, classes/default.pmc, classes/intqueue.pmc, - classes/parrotpointer.pmc, classes/perlarray.pmc, - classes/perlhash.pmc, classes/perlint.pmc, classes/perlnum.pmc, - classes/perlstring.pmc, classes/perlundef.pmc, classes/pmc2c.pl, - include/parrot/global_setup.h: Patch from Nick Clark to quieten - warnings from pmc files. Message-ID: - <20020121224719.GE1726@Bagpuss.unfortu.net> + * global_setup.c, classes/default.pmc, classes/intqueue.pmc, + classes/parrotpointer.pmc, classes/perlarray.pmc, + classes/perlhash.pmc, classes/perlint.pmc, classes/perlnum.pmc, + classes/perlstring.pmc, classes/perlundef.pmc, classes/pmc2c.pl, + include/parrot/global_setup.h: Patch from Nick Clark to quieten + warnings from pmc files. Message-ID: + <20020121224719.GE1726@Bagpuss.unfortu.net> 2002-01-22 00:53 ajgough - * test_main.c: Clears up a couple of warnings in test_main.c. - Thanks to Nick Clark. Message-ID: - <20020121190457.GB1726@Bagpuss.unfortu.net> + * test_main.c: Clears up a couple of warnings in test_main.c. + Thanks to Nick Clark. Message-ID: + <20020121190457.GB1726@Bagpuss.unfortu.net> 2002-01-22 00:47 ajgough - * string.c, chartypes/unicode.c, chartypes/usascii.c, - include/parrot/chartype.h: Cause all codepoints to be treated as - UNITVALS, and get_digit to return INTVAL, just in case. (Thanks to - Nick Clark, see also: Message-ID: - <20020121214137.GC2371@Bagpuss.unfortu.net> ) + * string.c, chartypes/unicode.c, chartypes/usascii.c, + include/parrot/chartype.h: Cause all codepoints to be treated as + UNITVALS, and get_digit to return INTVAL, just in case. (Thanks to + Nick Clark, see also: Message-ID: + <20020121214137.GC2371@Bagpuss.unfortu.net> ) 2002-01-22 00:24 dan - * key.c: We do mandate an ANSI conformant C compiler, don't we? + * key.c: We do mandate an ANSI conformant C compiler, don't we? - Appended patch cures these warnings: + Appended patch cures these warnings: - key.c: In function `debug_key': key.c:29: warning: int format, - INTVAL arg (arg 3) key.c:33: warning: int format, INTVAL arg (arg - 3) key.c:33: warning: int format, INTVAL arg (arg 4) key.c:36: - warning: int format, INTVAL arg (arg 3) key.c:36: warning: int - format, INTVAL arg (arg 4) + key.c: In function `debug_key': key.c:29: warning: int format, + INTVAL arg (arg 3) key.c:33: warning: int format, INTVAL arg (arg + 3) key.c:33: warning: int format, INTVAL arg (arg 4) key.c:36: + warning: int format, INTVAL arg (arg 3) key.c:36: warning: int + format, INTVAL arg (arg 4) - Courtesy of Nicholas Clark + Courtesy of Nicholas Clark 2002-01-21 12:41 mrjoltcola - * MANIFEST, io.ops: For some reason cvs commit didn't get this, may - be clock skew. + * MANIFEST, io.ops: For some reason cvs commit didn't get this, may + be clock skew. 2002-01-21 06:37 mrjoltcola - * io/io.c: Cleanup a warning + * io/io.c: Cleanup a warning 2002-01-21 06:28 mrjoltcola - * examples/assembly/io1.pasm, include/parrot/io.h, io/io.c, - io/io_stdio.c, io/io_unix.c, io/io_win32.c: Added 32/64 bit seek - ops. Various other IO twiddlings. + * examples/assembly/io1.pasm, include/parrot/io.h, io/io.c, + io/io_stdio.c, io/io_unix.c, io/io_win32.c: Added 32/64 bit seek + ops. Various other IO twiddlings. 2002-01-21 03:25 grunblatt - * Makefile.in: Use $jitcpuarch instead of $cpuarch. Thanks to - Melvin Smith for the catch up. + * Makefile.in: Use $jitcpuarch instead of $cpuarch. Thanks to + Melvin Smith for the catch up. 2002-01-20 23:13 sfink - * stacks.c: Fixed logic errors, need tests + * stacks.c: Fixed logic errors, need tests 2002-01-20 22:17 brentdax - * rx.c, rx.ops, include/parrot/rx.h, t/op/rx.t: Make /m work and - prepare for /i to work. + * rx.c, rx.ops, include/parrot/rx.h, t/op/rx.t: Make /m work and + prepare for /i to work. 2002-01-20 20:52 grunblatt - * Configure.pl, MANIFEST, Makefile.in, interpreter.c, jit.c, - jit2h.pl, Parrot/Jit/alpha-bsd.pm, Parrot/Jit/alpha-linux.pm, - Parrot/Jit/alphaGeneric.pm, Parrot/Jit/i386-bsd.pm, - Parrot/Jit/i386-linux.pm, lib/Parrot/Jit/alpha-bsd.pm, - lib/Parrot/Jit/alpha-linux.pm, lib/Parrot/Jit/alphaGeneric.pm, - lib/Parrot/Jit/i386-bsd.pm, lib/Parrot/Jit/i386-linux.pm, - Parrot/Jit/i386Generic.pm, lib/Parrot/Jit/i386Generic.pm, - include/parrot/jit.h, jit/alpha/core.jit, jit/alpha/lib.jit, - jit/alpha/string.jit: - - Added support for ALPHA, by now linux and bsd. + * Configure.pl, MANIFEST, Makefile.in, interpreter.c, jit.c, + jit2h.pl, Parrot/Jit/alpha-bsd.pm, Parrot/Jit/alpha-linux.pm, + Parrot/Jit/alphaGeneric.pm, Parrot/Jit/i386-bsd.pm, + Parrot/Jit/i386-linux.pm, lib/Parrot/Jit/alpha-bsd.pm, + lib/Parrot/Jit/alpha-linux.pm, lib/Parrot/Jit/alphaGeneric.pm, + lib/Parrot/Jit/i386-bsd.pm, lib/Parrot/Jit/i386-linux.pm, + Parrot/Jit/i386Generic.pm, lib/Parrot/Jit/i386Generic.pm, + include/parrot/jit.h, jit/alpha/core.jit, jit/alpha/lib.jit, + jit/alpha/string.jit: + - Added support for ALPHA, by now linux and bsd. - - Reduced jit2h.pl execution time by precompiling the call to the - unimplemented op. + - Reduced jit2h.pl execution time by precompiling the call to the + unimplemented op. - - Reduced the duplicated code in Parrot/Jit/*.pm by adding - Parrot/Jit/${cpuarch}Generic.pm + - Reduced the duplicated code in Parrot/Jit/*.pm by adding + Parrot/Jit/${cpuarch}Generic.pm - - Changed the way to detect quads to what is written in "man - perlfunc". + - Changed the way to detect quads to what is written in "man + perlfunc". 2002-01-20 17:23 brentdax - * rx.ops: There's no such thing as rx_allocateinfo. + * rx.ops: There's no such thing as rx_allocateinfo. 2002-01-19 08:26 brentdax - * pbc2c.pl: Stop this stupid "hard-code the new oplib" stuff. + * pbc2c.pl: Stop this stupid "hard-code the new oplib" stuff. 2002-01-19 07:12 mrjoltcola - * MANIFEST, core.ops, io.ops, pbc2c.pl: Separate pure ParrotIO ops - into io.ops, leave the STDIO wrappers in core.ops until they - disappear. Added debug op for switching on VM debug flag + * MANIFEST, core.ops, io.ops, pbc2c.pl: Separate pure ParrotIO ops + into io.ops, leave the STDIO wrappers in core.ops until they + disappear. Added debug op for switching on VM debug flag 2002-01-19 01:55 mrjoltcola - * include/parrot/io.h, io/TODO, io/io.c, io/io_stdio.c, - io/io_unix.c, io/io_win32.c: Added a few more Win32 layer calls + * include/parrot/io.h, io/TODO, io/io.c, io/io_stdio.c, + io/io_unix.c, io/io_win32.c: Added a few more Win32 layer calls 2002-01-19 00:55 brentdax - * Makefile.in, rx.c, rx.ops, rxstacks.c, include/parrot/rx.h, - include/parrot/rxstacks.h: Add regex-specific stacks for - efficiency. + * Makefile.in, rx.c, rx.ops, rxstacks.c, include/parrot/rx.h, + include/parrot/rxstacks.h: Add regex-specific stacks for + efficiency. 2002-01-18 23:58 dan - * Configure.pl: I think the optimal fix here is simply to remove - -ansi -pedantic. -ansi may well have some uses, but even the gcc - man pages say "There is no reason to use this option [-pedantic]; - it exists only to satisfy pedants." + * Configure.pl: I think the optimal fix here is simply to remove + -ansi -pedantic. -ansi may well have some uses, but even the gcc + man pages say "There is no reason to use this option [-pedantic]; + it exists only to satisfy pedants." - Courtesy of Andy Dougherty + Courtesy of Andy Dougherty 2002-01-18 23:23 dan - * MANIFEST, docs/parrot.pod, docs/running.pod: This patch add - docs/running.pod, which lists the various executables Parrot - currently includes, examples of running them, and mentions of where - they fail to work. It's more of a cry for help than a useful - reference. :-) I've been having trouble recently when making - changes in figuring out whether I broke anything, because any - non-default way of running the system seems to be already broken. I - can't tell what brokenness is expected and what isn't. + * MANIFEST, docs/parrot.pod, docs/running.pod: This patch add + docs/running.pod, which lists the various executables Parrot + currently includes, examples of running them, and mentions of where + they fail to work. It's more of a cry for help than a useful + reference. :-) I've been having trouble recently when making + changes in figuring out whether I broke anything, because any + non-default way of running the system seems to be already broken. I + can't tell what brokenness is expected and what isn't. - Courtesy of Steve Fink + Courtesy of Steve Fink 2002-01-15 22:13 brentdax - * include/parrot/rx.h, rx.c, rx.ops: Remove the last vestiges of - substring use and enhance performance. + * include/parrot/rx.h, rx.c, rx.ops: Remove the last vestiges of + substring use and enhance performance. 2002-01-15 21:03 ajgough - * string.c: Fix problem with string_transcode, &dest not being - updated if src was already in desired encoding. + * string.c: Fix problem with string_transcode, &dest not being + updated if src was already in desired encoding. 2002-01-15 16:54 brentdax - * rx.c, rx.ops, include/parrot/rx.h: Hunt down and destroy - warnings. Leaves only one warning, at rx.ops line 409, that I - can't manage to get rid of. + * rx.c, rx.ops, include/parrot/rx.h: Hunt down and destroy + warnings. Leaves only one warning, at rx.ops line 409, that I + can't manage to get rid of. 2002-01-15 16:50 dan - * pbc2c.pl: Pointer arithmetic not quite right in the generated - code. Also patches pbc2c.pl to work with rx.ops. + * pbc2c.pl: Pointer arithmetic not quite right in the generated + code. Also patches pbc2c.pl to work with rx.ops. - Courtesy of Jason Gloudon + Courtesy of Jason Gloudon 2002-01-15 16:15 dan - * classes/Makefile.in: All the C files in classes/ weren't being - compiled with an of the gcc warnings flags. With this patch they - are, and there are an awful lot of warnings, more than I could hope - to understand and clear up (within any sensible time period before - submitting a rash of patches, by which time everyone else would - have moved the code on) + * classes/Makefile.in: All the C files in classes/ weren't being + compiled with an of the gcc warnings flags. With this patch they + are, and there are an awful lot of warnings, more than I could hope + to understand and clear up (within any sensible time period before + submitting a rash of patches, by which time everyone else would + have moved the code on) - Courtesy of Nicholas Clark + Courtesy of Nicholas Clark 2002-01-15 16:10 dan - * core.ops, ops2c.pl, Parrot/Op.pm, Parrot/OpTrans.pm, - Parrot/OpsFile.pm, lib/Parrot/Op.pm, lib/Parrot/OpTrans.pm, - lib/Parrot/OpsFile.pm, Parrot/OpTrans/C.pm, - Parrot/OpTrans/CGoto.pm, Parrot/OpTrans/CPrederef.pm, - lib/Parrot/OpTrans/C.pm, lib/Parrot/OpTrans/CGoto.pm, - lib/Parrot/OpTrans/CPrederef.pm, chartypes/unicode.c, - chartypes/usascii.c: This patch adds a few more macros for .ops - files to use. In addition to the existing - - goto OFFSET(...) - goto ADDRESS(...) - goto POP() - goto NEXT() - - it adds - - expr OFFSET(...) - expr ADDRESS(...) - expr POP() - expr NEXT() - - This is intended mainly for use in helper functions in .ops files, - but also for ops that need to eg push the address of the next - opcode onto a stack. The only place this currently happens (outside - of my private code) is in the bsr opcode, which previously - hardcoded the computation. - - This patch also makes ops2c.pl move the CUR_OPCODE #define a bit - higher in the generated file so that it can be used by static - functions in the preamble. - - Finally, I ran into a parentheses matching problem -- should goto - OFFSET(...) rewrite \bgoto\s+OFFSET\((.*)\) or - \bgoto\s+OFFSET\((.*?)\) - - It was done inconsistently for the different calculations, and of - course neither are correct because you really want matching - parentheses. But that seems like too much bother. (Currently, - there's only one place that uses anything other than $n in the - parentheses, and that's the enternative() op.) So I made them all - .*? but emulated recent POD by also allowing (( ... )) (that's two - parenthesis with a space padding the body.) - - The generated core_ops.c and core_ops_prederef.c files after this - patch are identical except for the CUR_OPCODE and REL_PC macros - getting moved a little higher, and the bsr in the regular path (not - prederef) uses 'CUR_OPCODE' instead of the hardcoded 'cur_opcode'. - - In summary, this is a big wad of meaningless changes for the - current code. But it will make adding some opcodes easier in the - future, and cleans up a small nit in the current bsr. - - Courtesy of Steve Fink + * core.ops, ops2c.pl, Parrot/Op.pm, Parrot/OpTrans.pm, + Parrot/OpsFile.pm, lib/Parrot/Op.pm, lib/Parrot/OpTrans.pm, + lib/Parrot/OpsFile.pm, Parrot/OpTrans/C.pm, + Parrot/OpTrans/CGoto.pm, Parrot/OpTrans/CPrederef.pm, + lib/Parrot/OpTrans/C.pm, lib/Parrot/OpTrans/CGoto.pm, + lib/Parrot/OpTrans/CPrederef.pm, chartypes/unicode.c, + chartypes/usascii.c: This patch adds a few more macros for .ops + files to use. In addition to the existing + + goto OFFSET(...) + goto ADDRESS(...) + goto POP() + goto NEXT() + + it adds + + expr OFFSET(...) + expr ADDRESS(...) + expr POP() + expr NEXT() + + This is intended mainly for use in helper functions in .ops files, + but also for ops that need to eg push the address of the next + opcode onto a stack. The only place this currently happens (outside + of my private code) is in the bsr opcode, which previously + hardcoded the computation. + + This patch also makes ops2c.pl move the CUR_OPCODE #define a bit + higher in the generated file so that it can be used by static + functions in the preamble. + + Finally, I ran into a parentheses matching problem -- should goto + OFFSET(...) rewrite \bgoto\s+OFFSET\((.*)\) or + \bgoto\s+OFFSET\((.*?)\) + + It was done inconsistently for the different calculations, and of + course neither are correct because you really want matching + parentheses. But that seems like too much bother. (Currently, + there's only one place that uses anything other than $n in the + parentheses, and that's the enternative() op.) So I made them all + .*? but emulated recent POD by also allowing (( ... )) (that's two + parenthesis with a space padding the body.) + + The generated core_ops.c and core_ops_prederef.c files after this + patch are identical except for the CUR_OPCODE and REL_PC macros + getting moved a little higher, and the bsr in the regular path (not + prederef) uses 'CUR_OPCODE' instead of the hardcoded 'cur_opcode'. + + In summary, this is a big wad of meaningless changes for the + current code. But it will make adding some opcodes easier in the + future, and cleans up a small nit in the current bsr. + + Courtesy of Steve Fink 2002-01-15 08:48 brentdax - * include/parrot/rx.h: Bitmaps can now include chars >255 (well, - sort of). + * include/parrot/rx.h: Bitmaps can now include chars >255 (well, + sort of). 2002-01-15 08:45 brentdax - * rx.c, rx.ops: Bitmaps can now include chars >255 (well, sort of). + * rx.c, rx.ops: Bitmaps can now include chars >255 (well, sort of). 2002-01-15 05:00 brentdax - * rx.ops: Speed up rx_literal--roughly doubles benchmark - performance. + * rx.ops: Speed up rx_literal--roughly doubles benchmark + performance. 2002-01-14 20:18 dan - * vtable.tbl, vtable_h.pl: Clean up a zillion warnings + * vtable.tbl, vtable_h.pl: Clean up a zillion warnings - Courtesy of Nicholas Clark + Courtesy of Nicholas Clark 2002-01-14 20:03 dan - * Configure.pl, MANIFEST, Makefile.in, core.ops, exceptions.c, - global_setup.c, interpreter.c, key.c, ops2c.pl, register.c, - runops_cores.c, rx.ops, stacks.c, string.c, test_main.c, trace.c, - chartypes/unicode.c, chartypes/usascii.c, classes/default.pmc, - classes/parrotpointer.pmc, classes/perlarray.pmc, - classes/perlhash.pmc, classes/perlint.pmc, classes/perlnum.pmc, - classes/perlstring.pmc, classes/perlundef.pmc, - encodings/singlebyte.c, encodings/utf16.c, encodings/utf32.c, - encodings/utf8.c, include/parrot/exceptions.h, include/parrot/io.h, - include/parrot/parrot.h, include/parrot/rx.h, io/io_stdio.c, - io/io_win32.c, platforms/win32.c, platforms/win32.h, t/op/pmc.t, - t/op/pmc_perlhash.t, t/op/rx.t, t/pmc/perlhash.t, t/pmc/pmc.t: This - patch cleans up most of the MSVC-warnings when using warning level - 4 (the highest, one above the default level 3). It turns off two - level-4 warnings for 'unreferenced formal parameter' and 'named - type definition in parentheses', the latter of which was turning up - warnings in MS VC headers. Level 4 warnings also helped me find a - couple of other lurking bugs in the parrot code. - - Replaces the various fprintf/exit combos with calls to - internal_exception, which uses var_args to emulate printf. Various - exception types were added as well. These are probably temporary - until a real exception system arrives. - - Fixed some places in the IO code where wrong functions were being - called, or put into the vtable. - - Courtesy of "Michel Lambert" + * Configure.pl, MANIFEST, Makefile.in, core.ops, exceptions.c, + global_setup.c, interpreter.c, key.c, ops2c.pl, register.c, + runops_cores.c, rx.ops, stacks.c, string.c, test_main.c, trace.c, + chartypes/unicode.c, chartypes/usascii.c, classes/default.pmc, + classes/parrotpointer.pmc, classes/perlarray.pmc, + classes/perlhash.pmc, classes/perlint.pmc, classes/perlnum.pmc, + classes/perlstring.pmc, classes/perlundef.pmc, + encodings/singlebyte.c, encodings/utf16.c, encodings/utf32.c, + encodings/utf8.c, include/parrot/exceptions.h, include/parrot/io.h, + include/parrot/parrot.h, include/parrot/rx.h, io/io_stdio.c, + io/io_win32.c, platforms/win32.c, platforms/win32.h, t/op/pmc.t, + t/op/pmc_perlhash.t, t/op/rx.t, t/pmc/perlhash.t, t/pmc/pmc.t: This + patch cleans up most of the MSVC-warnings when using warning level + 4 (the highest, one above the default level 3). It turns off two + level-4 warnings for 'unreferenced formal parameter' and 'named + type definition in parentheses', the latter of which was turning up + warnings in MS VC headers. Level 4 warnings also helped me find a + couple of other lurking bugs in the parrot code. + + Replaces the various fprintf/exit combos with calls to + internal_exception, which uses var_args to emulate printf. Various + exception types were added as well. These are probably temporary + until a real exception system arrives. + + Fixed some places in the IO code where wrong functions were being + called, or put into the vtable. + + Courtesy of "Michel Lambert" 2002-01-14 19:00 dan - * MANIFEST: D'oh! Forgot a file. + * MANIFEST: D'oh! Forgot a file. - Courtesy of Andy Dougherty + Courtesy of Andy Dougherty 2002-01-14 18:44 brentdax - * rx.c, rx.ops, include/parrot/rx.h: Use bitmaps where it makes - sense (and a few other enhancements to regexes). + * rx.c, rx.ops, include/parrot/rx.h: Use bitmaps where it makes + sense (and a few other enhancements to regexes). 2002-01-14 07:07 brentdax - * interpreter.c, runops_cores.c, test_main.c, - include/parrot/interpreter.h: Make profiling a little more useful. + * interpreter.c, runops_cores.c, test_main.c, + include/parrot/interpreter.h: Make profiling a little more useful. 2002-01-13 19:44 dan - * Configure.pl: Turn off unsed things warnings for now + * Configure.pl: Turn off unsed things warnings for now 2002-01-13 19:39 dan - * key.c, classes/perlarray.pmc: key.c: initialize KEY.keys + * key.c, classes/perlarray.pmc: key.c: initialize KEY.keys - classes/perlarray.c: * get_string: is casting - SELF->cache.struct_val to a STRING*, while all other methods are - using it as a KEY*; don't know what a perlarray stringifies to, - so replacing with NULL * get_bool: the default behaviour does not - look right to me + classes/perlarray.c: * get_string: is casting + SELF->cache.struct_val to a STRING*, while all other methods are + using it as a KEY*; don't know what a perlarray stringifies to, + so replacing with NULL * get_bool: the default behaviour does not + look right to me - Courtesy of "Mattia Barbon" + Courtesy of "Mattia Barbon" 2002-01-13 19:37 dan - * Makefile.in, classes/Makefile.in: Makefile.in: (Re)add ld_debug - flags to LDFLAGS, so that Configure.pl --debugging works with - MSVC + * Makefile.in, classes/Makefile.in: Makefile.in: (Re)add ld_debug + flags to LDFLAGS, so that Configure.pl --debugging works with + MSVC - classes/Makefile.in make easier to add pmb2c.pl flags to all - pmc2c calls + classes/Makefile.in make easier to add pmb2c.pl flags to all + pmc2c calls - Courtesy of "Mattia Barbon" + Courtesy of "Mattia Barbon" 2002-01-13 19:36 dan - * io/io_win32.c: according to my MSVC docs, you should use - _tcslen only after - #including tchar.h + * io/io_win32.c: according to my MSVC docs, you should use + _tcslen only after + #including tchar.h - Courtesy of "Mattia Barbon" + Courtesy of "Mattia Barbon" 2002-01-13 19:35 dan - * docs/intro.pod: Doc tweak. + * docs/intro.pod: Doc tweak. - Courtesy of Simon Glover + Courtesy of Simon Glover 2002-01-13 19:34 dan - * t/: op/pmc_perlstring.t, pmc/perlstring.t: Enclosed test checks - that + * t/: op/pmc_perlstring.t, pmc/perlstring.t: Enclosed test checks + that - if Px, ... + if Px, ... - works with PerlString PMCs; these should be false if they are "", - 0, or - are undefined, and true in every other case. + works with PerlString PMCs; these should be false if they are "", + 0, or + are undefined, and true in every other case. - Courtesy of Simon Glover + Courtesy of Simon Glover 2002-01-13 19:23 dan - * Configure.pl, config_h.in, core.ops, classes/perlnum.pmc: Change - NUMVAL_FMT to FLOATVAL_FMT. + * Configure.pl, config_h.in, core.ops, classes/perlnum.pmc: Change + NUMVAL_FMT to FLOATVAL_FMT. - Courtesy of "David M. Lloyd" + Courtesy of "David M. Lloyd" 2002-01-13 17:45 jgoff - * Makefile.in, global_setup.c, classes/Makefile.in, - classes/intqueue.pmc, include/parrot/pmc.h, t/op/pmc.t, - t/pmc/pmc.t: IntQueue is for an upcoming article on perl.com on - designing your own classes. + * Makefile.in, global_setup.c, classes/Makefile.in, + classes/intqueue.pmc, include/parrot/pmc.h, t/op/pmc.t, + t/pmc/pmc.t: IntQueue is for an upcoming article on perl.com on + designing your own classes. 2002-01-13 08:47 simon - * interpreter.c, Parrot/OpTrans/CPrederef.pm, - lib/Parrot/OpTrans/CPrederef.pm: - Fix bsr in prederef mode. + * interpreter.c, Parrot/OpTrans/CPrederef.pm, + lib/Parrot/OpTrans/CPrederef.pm: + Fix bsr in prederef mode. - Courtesy of: Jason Gloudon + Courtesy of: Jason Gloudon 2002-01-12 15:33 dan - * interpreter.c, key.c, packfile.c, register.c, resources.c, - string.c, encodings/singlebyte.c, encodings/utf32.c, - include/parrot/parrot.h, io/io.c, io/io_stdio.c, io/io_unix.c: - Silence most of the unused variable warnings. + * interpreter.c, key.c, packfile.c, register.c, resources.c, + string.c, encodings/singlebyte.c, encodings/utf32.c, + include/parrot/parrot.h, io/io.c, io/io_stdio.c, io/io_unix.c: + Silence most of the unused variable warnings. - Courtesy of Nicholas Clark + Courtesy of Nicholas Clark 2002-01-12 15:18 dan - * rx.ops: This patch fixes a warning and also changes an 'int' to - an 'INTVAL'. All tests should pass on Solaris. + * rx.ops: This patch fixes a warning and also changes an 'int' to + an 'INTVAL'. All tests should pass on Solaris. - Courtesy of "David M. Lloyd" + Courtesy of "David M. Lloyd" 2002-01-12 15:13 dan - * interpreter.c, string.c, test_main.c, classes/parrotpointer.pmc, - examples/assembly/life.pasm, include/parrot/interpreter.h, - include/parrot/io.h, io/io.c, io/io_stdio.c, io/io_unix.c, - io/io_win32.c: More IO work. (Plus some misc twiddles) + * interpreter.c, string.c, test_main.c, classes/parrotpointer.pmc, + examples/assembly/life.pasm, include/parrot/interpreter.h, + include/parrot/io.h, io/io.c, io/io_stdio.c, io/io_unix.c, + io/io_win32.c: More IO work. (Plus some misc twiddles) - Courtesy of Melvin Smith + Courtesy of Melvin Smith 2002-01-12 01:14 dan - * include/parrot/string.h: fix a missing name + * include/parrot/string.h: fix a missing name 2002-01-12 00:39 grunblatt - * include/parrot/string.h: Few typos. + * include/parrot/string.h: Few typos. 2002-01-12 00:16 grunblatt - * jit.c, jit2h.pl, jit/i386/core.jit: Added support for opcodes - that change the program control flow. + * jit.c, jit2h.pl, jit/i386/core.jit: Added support for opcodes + that change the program control flow. 2002-01-11 23:53 brentdax - * classes/parrotpointer.pmc: Tell the GC to keep its hands out of a - ParrotPointer's guts. + * classes/parrotpointer.pmc: Tell the GC to keep its hands out of a + ParrotPointer's guts. 2002-01-11 23:03 dan - * include/parrot/string.h: flags for the buffers, for GC + * include/parrot/string.h: flags for the buffers, for GC 2002-01-11 22:31 dan - * include/parrot/pmc.h: PMC flag docs. Those'd be good... + * include/parrot/pmc.h: PMC flag docs. Those'd be good... 2002-01-11 22:21 dan - * include/parrot/pmc.h: Started with PMC flags + * include/parrot/pmc.h: Started with PMC flags 2002-01-11 19:33 dan - * config_h.in, memory.c, resources.c, string.c, - include/parrot/resources.h: Beginnings of a memory allocation/gc - system. Without the GC part. + * config_h.in, memory.c, resources.c, string.c, + include/parrot/resources.h: Beginnings of a memory allocation/gc + system. Without the GC part. 2002-01-11 18:05 dan - * core.ops: Make sure constant pushes are right on mixed 32/64 bit - systems + * core.ops: Make sure constant pushes are right on mixed 32/64 bit + systems - Courtesy of "David M. Lloyd" + Courtesy of "David M. Lloyd" 2002-01-11 17:50 dan - * core.ops, pbc2c.pl, Parrot/OpTrans/CGoto.pm, - lib/Parrot/OpTrans/CGoto.pm, include/parrot/interpreter.h: Here is - a patch that makes pbc2c generated code work with the bsr opcode. - It creates a new opcode 'enternative', and uses this to support a - mixed model of interpretation and execution of compiled C code. + * core.ops, pbc2c.pl, Parrot/OpTrans/CGoto.pm, + lib/Parrot/OpTrans/CGoto.pm, include/parrot/interpreter.h: Here is + a patch that makes pbc2c generated code work with the bsr opcode. + It creates a new opcode 'enternative', and uses this to support a + mixed model of interpretation and execution of compiled C code. - Courtesy of Jason Gloudon + Courtesy of Jason Gloudon 2002-01-11 17:48 dan - * Makefile.in: Add life as a potential .exe target + * Makefile.in: Add life as a potential .exe target 2002-01-11 17:30 dan - * include/parrot/resources.h: Start of arena stuff for GC + * include/parrot/resources.h: Start of arena stuff for GC 2002-01-11 05:34 brentdax - * rx.ops: Docs modifications. + * rx.ops: Docs modifications. 2002-01-11 04:19 brentdax - * rx.ops, include/parrot/rx.h: Remove unnecessary evilness from - regular expressions. + * rx.ops, include/parrot/rx.h: Remove unnecessary evilness from + regular expressions. 2002-01-11 03:44 grunblatt - * jit/i386/core.jit: off by one. + * jit/i386/core.jit: off by one. 2002-01-11 02:25 dan - * Makefile.in, examples/assembly/life.pasm: Tweak to life benchmark + * Makefile.in, examples/assembly/life.pasm: Tweak to life benchmark - Courtesy of Steve Fink + Courtesy of Steve Fink 2002-01-11 00:32 brentdax - * MANIFEST: Forgot to put parrotpointer.pmc in the MANIFEST. + * MANIFEST: Forgot to put parrotpointer.pmc in the MANIFEST. 2002-01-10 23:22 ajgough - * string.c, docs/strings.pod: Removed all the nul termination code, - as this is in general a bad idea. Note added to docs/strings.pod - to warn people away from assuming termination. + * string.c, docs/strings.pod: Removed all the nul termination code, + as this is in general a bad idea. Note added to docs/strings.pod + to warn people away from assuming termination. 2002-01-10 23:14 dan - * core.ops, interpreter.c, jit.c, rx.c, rx.ops, stacks.c, - testparrotsizes_c.in, include/parrot/interpreter.h, - include/parrot/rx.h, include/parrot/stacks.h: Much nicer stack - implementation + * core.ops, interpreter.c, jit.c, rx.c, rx.ops, stacks.c, + testparrotsizes_c.in, include/parrot/interpreter.h, + include/parrot/rx.h, include/parrot/stacks.h: Much nicer stack + implementation - Courtesy of Steve Fink + Courtesy of Steve Fink 2002-01-10 22:48 dan - * core.ops: Fix 'basic' test 1 for sizeof(opcode_t) != - sizeof(INTVAL) + * core.ops: Fix 'basic' test 1 for sizeof(opcode_t) != + sizeof(INTVAL) - Courtesy of "David M. Lloyd" + Courtesy of "David M. Lloyd" 2002-01-10 22:46 dan - * key.c, classes/perlhash.pmc, t/op/pmc_perlhash.t, - t/pmc/perlhash.t: Well, actually two bugs. + * key.c, classes/perlhash.pmc, t/op/pmc_perlhash.t, + t/pmc/perlhash.t: Well, actually two bugs. - The first is an off-by-one error in key.c than can cause parrot - to segfault if hash % NUM_BUCKETS happens to be zero. + The first is an off-by-one error in key.c than can cause parrot + to segfault if hash % NUM_BUCKETS happens to be zero. - The other is a bug in the PerlHash init() code that causes new - PerlHash - PMCs to start with the wrong size. + The other is a bug in the PerlHash init() code that causes new + PerlHash + PMCs to start with the wrong size. - Both fixed below; also tests to prevent them recurring. + Both fixed below; also tests to prevent them recurring. - Courtesy of Simon Glover + Courtesy of Simon Glover 2002-01-10 22:30 dan - * classes/default.pmc, classes/perlarray.pmc, t/op/pmc_perlarray.t, - t/pmc/perlarray.t: The enclosed patch allows one to use the if op - with a PerlArray, + * classes/default.pmc, classes/perlarray.pmc, t/op/pmc_perlarray.t, + t/pmc/perlarray.t: The enclosed patch allows one to use the if op + with a PerlArray, - Courtesy of Simon Glover + Courtesy of Simon Glover 2002-01-10 21:31 dan - * examples/assembly/life.pasm: Tweaked to be a benchmarkable thing + * examples/assembly/life.pasm: Tweaked to be a benchmarkable thing 2002-01-10 20:30 grunblatt - * jit.c, jit2h.pl, Parrot/Jit/i386-bsd.pm, - Parrot/Jit/i386-linux.pm, lib/Parrot/Jit/i386-bsd.pm, - lib/Parrot/Jit/i386-linux.pm, jit/i386/core.jit, jit/i386/lib.jit: - All the op codes that doesn't change the program control flow now - work in the JIT by calling the code generated by the compiler when - the op is not in core.jit TODO: * Make all the ops that change - the program control flow (and are not on core.jit) work. * - Remove the dispatch payload. + * jit.c, jit2h.pl, Parrot/Jit/i386-bsd.pm, + Parrot/Jit/i386-linux.pm, lib/Parrot/Jit/i386-bsd.pm, + lib/Parrot/Jit/i386-linux.pm, jit/i386/core.jit, jit/i386/lib.jit: + All the op codes that doesn't change the program control flow now + work in the JIT by calling the code generated by the compiler when + the op is not in core.jit TODO: * Make all the ops that change + the program control flow (and are not on core.jit) work. * + Remove the dispatch payload. 2002-01-10 17:13 dan - * classes/parrotpointer.pmc: This patch fixes parrotpointer.pmc, - which tries to return 0 from a void function. + * classes/parrotpointer.pmc: This patch fixes parrotpointer.pmc, + which tries to return 0 from a void function. - Courtesy of "David M. Lloyd" + Courtesy of "David M. Lloyd" 2002-01-10 17:12 dan - * t/op/macro.t: Skip tests, don't comment them out. + * t/op/macro.t: Skip tests, don't comment them out. - Courtesy of Simon Glover + Courtesy of Simon Glover 2002-01-10 17:10 dan - * rx.c: This fixes a couple of nits in rx.c: + * rx.c: This fixes a couple of nits in rx.c: - 1. There's no newline at the end, which makes gcc unhappy. - 2. We should use NULL, not 0 or "", for creating null pointers. + 1. There's no newline at the end, which makes gcc unhappy. + 2. We should use NULL, not 0 or "", for creating null pointers. - Courtesy of Simon Glover + Courtesy of Simon Glover 2002-01-10 17:09 dan - * MANIFEST: Adds rx.t, removes duplicated rx.c and puts everything - back in - alphabetical order. + * MANIFEST: Adds rx.t, removes duplicated rx.c and puts everything + back in + alphabetical order. - Courtesy of Simon Glover + Courtesy of Simon Glover 2002-01-10 16:54 ajgough - * resources.c: Made free_string check that there was a string to - free. In reponse to a bug spotted by Joshua Nye. + * resources.c: Made free_string check that there was a string to + free. In reponse to a bug spotted by Joshua Nye. 2002-01-09 22:44 dan - * global_setup.c: Forgot the setup + * global_setup.c: Forgot the setup 2002-01-09 22:35 dan - * rx.ops: Forgot this one + * rx.ops: Forgot this one 2002-01-09 22:35 dan - * MANIFEST, Makefile.in, rx.c, string.c, include/parrot/pmc.h, - include/parrot/rx.h, t/op/rx.t: Preliminary regex implementation. - Tests don't work, though. + * MANIFEST, Makefile.in, rx.c, string.c, include/parrot/pmc.h, + include/parrot/rx.h, t/op/rx.t: Preliminary regex implementation. + Tests don't work, though. - Courtesy of "Brent Dax" + Courtesy of "Brent Dax" 2002-01-09 21:48 dan - * t/: op/pmc_perlarray.t, pmc/perlarray.t: Whoops, forgot that + * t/: op/pmc_perlarray.t, pmc/perlarray.t: Whoops, forgot that 2002-01-09 21:22 dan - * classes/Makefile.in, classes/parrotpointer.pmc, Makefile.in: - Generic pointer holder class + * classes/Makefile.in, classes/parrotpointer.pmc, Makefile.in: + Generic pointer holder class - Courtesy of "Brent Dax" + Courtesy of "Brent Dax" 2002-01-09 21:19 dan - * MANIFEST, classes/perlarray.pmc, t/op/pmc.t, t/pmc/pmc.t: Array - patches. + * MANIFEST, classes/perlarray.pmc, t/op/pmc.t, t/pmc/pmc.t: Array + patches. 2002-01-09 19:54 dan - * io/io_unix.c: Whoops. Forgot one + * io/io_unix.c: Whoops. Forgot one 2002-01-09 19:43 dan - * key.c, classes/perlhash.pmc, t/op/pmc_perlhash.t, - t/pmc/perlhash.t: Fix hash crash bugs + * key.c, classes/perlhash.pmc, t/op/pmc_perlhash.t, + t/pmc/perlhash.t: Fix hash crash bugs - Courtesy of Simon Glover + Courtesy of Simon Glover 2002-01-09 19:13 dan - * memory.c: Signedness whoops. + * memory.c: Signedness whoops. - Courtesy of Simon Glover + Courtesy of Simon Glover 2002-01-09 18:23 dan - * MANIFEST, Makefile.in, include/parrot/io.h, io/io.c, io/io_os.c, - io/io_stdio.c, io/io_win32.c: Changes: + * MANIFEST, Makefile.in, include/parrot/io.h, io/io.c, io/io_os.c, + io/io_stdio.c, io/io_win32.c: Changes: - -Minor layer cleanups -Win32 layer added (mostly stubs for now) but - will be using the Win32 API and company rather than the unix-ish - fake ones. -stdin/stdout/stderr Win32 specific code added. Rather - than use 0,1,2, Microsoft says use GetStdHandle(), etc. so that - stuff is there. Soon we should be able to start using these - rather than fprintf(stderr, ...) and remove stdio linkage. + -Minor layer cleanups -Win32 layer added (mostly stubs for now) but + will be using the Win32 API and company rather than the unix-ish + fake ones. -stdin/stdout/stderr Win32 specific code added. Rather + than use 0,1,2, Microsoft says use GetStdHandle(), etc. so that + stuff is there. Soon we should be able to start using these + rather than fprintf(stderr, ...) and remove stdio linkage. - Courtesy of + Courtesy of 2002-01-09 17:26 dan - * test_main.c: Fixes bad code gen on x86. + * test_main.c: Fixes bad code gen on x86. - Courtesy of Josh Wilmes + Courtesy of Josh Wilmes 2002-01-09 17:24 dan - * Configure.pl, config_h.in, core.ops, key.c, classes/perlint.pmc, - classes/perlnum.pmc: This patch adds macros to the config.h file - for INTVAL and NUMVAL printf formats. + * Configure.pl, config_h.in, core.ops, key.c, classes/perlint.pmc, + classes/perlnum.pmc: This patch adds macros to the config.h file + for INTVAL and NUMVAL printf formats. - Courtesy of "David M. Lloyd" + Courtesy of "David M. Lloyd" 2002-01-08 22:55 ajgough - * docs/vtables.pod: Clarify what get_string should do. + * docs/vtables.pod: Clarify what get_string should do. 2002-01-08 20:05 dan - * key.c: Keep comments in sync. + * key.c: Keep comments in sync. - Courtesy of Simon Glover + Courtesy of Simon Glover 2002-01-08 19:50 dan - * memory.c, include/parrot/memory.h: Need a realloc + * memory.c, include/parrot/memory.h: Need a realloc 2002-01-08 17:24 gregor - * .cvsignore, Configure.pl, Makefile.in: - Added 'reconfig' make target and corresponding --reconfig option to - Configure.pl, so its very easy to re-run Configure.pl with the last - (command-line) options you passed it. + * .cvsignore, Configure.pl, Makefile.in: + Added 'reconfig' make target and corresponding --reconfig option to + Configure.pl, so its very easy to re-run Configure.pl with the last + (command-line) options you passed it. 2002-01-08 16:33 dan - * core.ops, make_vtable_ops.pl, Parrot/OpsFile.pm, - lib/Parrot/OpsFile.pm: Add in, out, and inout parameters to teh ops - in core.ops. Potential help for optimizers and JITters. + * core.ops, make_vtable_ops.pl, Parrot/OpsFile.pm, + lib/Parrot/OpsFile.pm: Add in, out, and inout parameters to teh ops + in core.ops. Potential help for optimizers and JITters. - Courtesy of gregor@linux1.kennedytech.com + Courtesy of gregor@linux1.kennedytech.com 2002-01-08 16:32 dan - * key.c: Grab key length from the right spot + * key.c: Grab key length from the right spot - Courtesy of "Peter Gibbs" + Courtesy of "Peter Gibbs" 2002-01-08 13:27 ajgough - * test_main.c: Fix slight thinko in realloc usage for reading from - stdin. + * test_main.c: Fix slight thinko in realloc usage for reading from + stdin. 2002-01-08 11:34 ajgough - * test_main.c: Allow test_parrot to read bytecode stream from - stdin, adds -f command line option, with "-f -" doing the stdin - stuff. + * test_main.c: Allow test_parrot to read bytecode stream from + stdin, adds -f command line option, with "-f -" doing the stdin + stuff. 2002-01-08 06:34 jgoff - * key.c, include/parrot/key.h: key.c - Added simple implementation - of buckets. include/parrot/key.h - Added enum_key_bucket type + * key.c, include/parrot/key.h: key.c - Added simple implementation + of buckets. include/parrot/key.h - Added enum_key_bucket type 2002-01-08 03:21 jgoff - * include/parrot/key.h: Added an undef type to the key structure, - so we can delete keys without confusion. + * include/parrot/key.h: Added an undef type to the key structure, + so we can delete keys without confusion. 2002-01-07 22:09 dan - * key.c, packfile.c, string.c, include/parrot/key.h, - include/parrot/packfile.h, include/parrot/string.h: Fix whines - about index being redefined + * key.c, packfile.c, string.c, include/parrot/key.h, + include/parrot/packfile.h, include/parrot/string.h: Fix whines + about index being redefined - Courtesy of Nick Clark + Courtesy of Nick Clark 2002-01-07 21:15 dan - * ops2pm.pl: Don't allow the same ops lib to be included twice. + * ops2pm.pl: Don't allow the same ops lib to be included twice. - Courtesy of Steve Fink + Courtesy of Steve Fink 2002-01-07 20:48 dan - * Parrot/Test.pm, lib/Parrot/Test.pm: Report useful info for test - failures + * Parrot/Test.pm, lib/Parrot/Test.pm: Report useful info for test + failures - Courtesy of "Brent Dax" + Courtesy of "Brent Dax" 2002-01-07 20:43 dan - * docs/intro.pod: Missing a comma + * docs/intro.pod: Missing a comma - Courtesy of "coral" + Courtesy of "coral" 2002-01-07 20:41 dan - * global_setup.c: Quiet a warning + * global_setup.c: Quiet a warning - Courtesy of Simon Glover + Courtesy of Simon Glover 2002-01-07 18:58 gregor - * t/op/.cvsignore: - Ignore intermediate test files. + * t/op/.cvsignore: + Ignore intermediate test files. 2002-01-07 17:01 gregor - * ops2c.pl: - Print a warning if an .ops file is mentioned more than once on the - command line. + * ops2c.pl: + Print a warning if an .ops file is mentioned more than once on the + command line. 2002-01-07 16:12 ajgough - * t/: op/pmc_perlhash.t, pmc/perlhash.t: A couple more hash tests, - these shouldn't fail. + * t/: op/pmc_perlhash.t, pmc/perlhash.t: A couple more hash tests, + these shouldn't fail. 2002-01-07 15:15 simon - * t/: op/pmc_perlhash.t, pmc/perlhash.t: - Stop segfaults. + * t/: op/pmc_perlhash.t, pmc/perlhash.t: + Stop segfaults. 2002-01-07 15:11 simon - * key.c: - Fix zero-termination bug in hash function. + * key.c: + Fix zero-termination bug in hash function. 2002-01-07 13:37 ajgough - * MANIFEST, t/op/pmc_perlhash.t, t/pmc/perlhash.t: Added - pmc_perlhash.t, one test currently fails, one passes, yin-yang fun. + * MANIFEST, t/op/pmc_perlhash.t, t/pmc/perlhash.t: Added + pmc_perlhash.t, one test currently fails, one passes, yin-yang fun. 2002-01-07 11:53 brentdax - * Configure.pl: Fixes the + thing in prompts, plus adds a synonym - (:add{foo}) and a new deleting thing (:rem{foo}) + * Configure.pl: Fixes the + thing in prompts, plus adds a synonym + (:add{foo}) and a new deleting thing (:rem{foo}) 2002-01-07 11:43 simon - * Configure.pl: - Gobble the + before concatenating. + * Configure.pl: + Gobble the + before concatenating. 2002-01-07 03:53 dan - * Makefile.in: Dependency fix for new ops setup. + * Makefile.in: Dependency fix for new ops setup. 2002-01-07 03:33 jgoff - * classes/perlarray.pmc: Add negative indices, and fix a small - allocation problem. + * classes/perlarray.pmc: Add negative indices, and fix a small + allocation problem. 2002-01-06 23:54 ajgough - * hints/os2.pl: Makes the hints file take account of ldflags and - ccflags being split. This hints file is still very specific to - builds with gnu tools, but a proper solution can wait. Thanks to - Nick Burch. + * hints/os2.pl: Makes the hints file take account of ldflags and + ccflags being split. This hints file is still very specific to + builds with gnu tools, but a proper solution can wait. Thanks to + Nick Burch. 2002-01-06 22:12 dan - * Makefile.in, ops2c.pl, Parrot/OpsFile.pm, lib/Parrot/OpsFile.pm: - -changes Parrot::OpLib::core's dependencies to reflect the new - selectable ops files -allows some of the special forms of 'goto' - inside the PREAMBLE of an opcode file + * Makefile.in, ops2c.pl, Parrot/OpsFile.pm, lib/Parrot/OpsFile.pm: + -changes Parrot::OpLib::core's dependencies to reflect the new + selectable ops files -allows some of the special forms of 'goto' + inside the PREAMBLE of an opcode file - Courtesy of "Brent Dax" + Courtesy of "Brent Dax" 2002-01-06 19:59 simon - * Makefile.in: - *cough* + * Makefile.in: + *cough* 2002-01-06 18:19 dan - * classes/perlhash.pmc: Fix some type issues. + * classes/perlhash.pmc: Fix some type issues. - Courtesy of Josh Wilmes + Courtesy of Josh Wilmes 2002-01-06 18:03 dan - * Configure.pl, Makefile.in: It adds a prompt to Configure asking - for a list of opcode files to use. The default is everything - available except for obscure.ops. + * Configure.pl, Makefile.in: It adds a prompt to Configure asking + for a list of opcode files to use. The default is everything + available except for obscure.ops. - In addition, it makes it so that if your answer to a question - starts with '+', it will concatenate it to the default. For - example: + In addition, it makes it so that if your answer to a question + starts with '+', it will concatenate it to the default. For + example: - What C compiler do you want to use? [cl] +HAHAHA!!! + What C compiler do you want to use? [cl] +HAHAHA!!! - will result in $PConfig{cc} eq "cl HAHAHA!!!". While that example - is not terribly useful, it is quite useful with things like - command-line flags and the like. + will result in $PConfig{cc} eq "cl HAHAHA!!!". While that example + is not terribly useful, it is quite useful with things like + command-line flags and the like. - Finally, it contains a couple tweaks so that my syntax-highlighting - editor recognizes some heredocs correctly. :^) + Finally, it contains a couple tweaks so that my syntax-highlighting + editor recognizes some heredocs correctly. :^) - Courtesy of "Brent Dax" + Courtesy of "Brent Dax" 2002-01-06 17:59 dan - * KNOWN_ISSUES, MANIFEST, README: Doc Patches + * KNOWN_ISSUES, MANIFEST, README: Doc Patches - Courtesy of "Bryan C. Warnock" + Courtesy of "Bryan C. Warnock" 2002-01-06 17:58 dan - * MANIFEST: We're missing a couple of files from the MANIFEST. + * MANIFEST: We're missing a couple of files from the MANIFEST. - Courtesy of Simon Glover + Courtesy of Simon Glover 2002-01-06 17:57 dan - * ops2c.pl, Parrot/OpsFile.pm, lib/Parrot/OpsFile.pm: 1. - Compiler directives, etc. in files other than core.ops will now - work. 2. Compiler warnings will now display the file and line - number of the opcode file. + * ops2c.pl, Parrot/OpsFile.pm, lib/Parrot/OpsFile.pm: 1. + Compiler directives, etc. in files other than core.ops will now + work. 2. Compiler warnings will now display the file and line + number of the opcode file. - Courtesy of "Brent Dax" + Courtesy of "Brent Dax" 2002-01-06 17:52 dan - * languages/jako/jakoc: Fix breakage caused by iton/ntoi going away + * languages/jako/jakoc: Fix breakage caused by iton/ntoi going away - Courtesy of Simon Glover + Courtesy of Simon Glover 2002-01-06 17:36 dan - * docs/intro.pod: Lots of updates + * docs/intro.pod: Lots of updates - Courtesy of Simon Glover + Courtesy of Simon Glover 2002-01-06 02:34 gregor - * interpreter.c: - Add some internal documentation on the theory of operation of the - prederef code. + * interpreter.c: + Add some internal documentation on the theory of operation of the + prederef code. 2002-01-06 02:17 gregor - * interpreter.c: - Removed unnecessary include. + * interpreter.c: + Removed unnecessary include. 2002-01-05 12:37 simon - * classes/.cvsignore: - Ignore generated .h files. + * classes/.cvsignore: + Ignore generated .h files. - Courtesy of: Josh Wilmes + Courtesy of: Josh Wilmes 2002-01-05 12:37 simon - * Configure.pl: - Make lcc happier by adding a dummy structure. + * Configure.pl: + Make lcc happier by adding a dummy structure. - Courtesy of: Josh Wilmes + Courtesy of: Josh Wilmes 2002-01-05 12:35 simon - * global_setup.c, classes/perlundef.pmc, t/op/pmc.t, t/pmc/pmc.t: - Make perlundef work. (And coincidentally stop segfaults in the - tests :) + * global_setup.c, classes/perlundef.pmc, t/op/pmc.t, t/pmc/pmc.t: + Make perlundef work. (And coincidentally stop segfaults in the + tests :) - Courtesy of: Jason Gloudon + Courtesy of: Jason Gloudon 2002-01-05 04:59 dan - * t/: op/pmc.t, pmc/pmc.t: Undef tests added. + * t/: op/pmc.t, pmc/pmc.t: Undef tests added. 2002-01-05 04:55 jgoff - * classes/perlhash.pmc: Added perlhash class definition + * classes/perlhash.pmc: Added perlhash class definition 2002-01-05 04:48 dan - * core.ops: Fix on 64 bit platforms with 32-bit opcode_t + * core.ops: Fix on 64 bit platforms with 32-bit opcode_t - Courtesy of "David M. Lloyd" + Courtesy of "David M. Lloyd" 2002-01-05 03:57 jgoff - * MANIFEST, Makefile.in, core.ops, global_setup.c, key.c, - vtable.tbl, classes/Makefile.in, classes/default.pmc, - include/parrot/key.h, include/parrot/pmc.h, t/op/pmc.t, - t/pmc/pmc.t: Initial hash commit. + * MANIFEST, Makefile.in, core.ops, global_setup.c, key.c, + vtable.tbl, classes/Makefile.in, classes/default.pmc, + include/parrot/key.h, include/parrot/pmc.h, t/op/pmc.t, + t/pmc/pmc.t: Initial hash commit. - core.ops - Adding set({i,n,s},p,s) and set(p,{i,n,s},s) operations. - key.h - Adding NUM_BUCKETS classes/default.pmc - Adding - set_{integer,number,string}_index_s + core.ops - Adding set({i,n,s},p,s) and set(p,{i,n,s},s) operations. + key.h - Adding NUM_BUCKETS classes/default.pmc - Adding + set_{integer,number,string}_index_s - This does not yet do collision resolution, but will soon. + This does not yet do collision resolution, but will soon. 2002-01-05 02:54 dan - * interpreter.c: More unsigned fixes + * interpreter.c: More unsigned fixes - Courtesy of "Bryan C. Warnock" + Courtesy of "Bryan C. Warnock" 2002-01-04 22:13 dan - * Configure.pl, hints/mswin32.pl: Makes config's building of the - test programs happier. + * Configure.pl, hints/mswin32.pl: Makes config's building of the + test programs happier. - Courtesy of "Jason Diamond" + Courtesy of "Jason Diamond" 2002-01-04 19:00 dan - * Configure.pl, Makefile.in, hints/darwin.pl: Add link flags as - separate things + * Configure.pl, Makefile.in, hints/darwin.pl: Add link flags as + separate things 2002-01-04 18:27 dan - * Configure.pl, Makefile.in, classes/Makefile.in, hints/mswin32.pl: - Fixes to get things configuring and building on Win32 Native. + * Configure.pl, Makefile.in, classes/Makefile.in, hints/mswin32.pl: + Fixes to get things configuring and building on Win32 Native. - Courtesy of "Jason Diamond" + Courtesy of "Jason Diamond" 2002-01-04 17:39 dan - * hints/vms.pl: debug cleanup + * hints/vms.pl: debug cleanup 2002-01-04 16:53 dan - * docs/parrot.pod: The enclosed patch brings the list of - documentation in parrot.pod - up to date. + * docs/parrot.pod: The enclosed patch brings the list of + documentation in parrot.pod + up to date. - Courtesy of Simon Glover + Courtesy of Simon Glover 2002-01-04 16:47 dan - * test_main.c, Parrot/Jit/i386-linux.pm, - lib/Parrot/Jit/i386-linux.pm: In an attempt to just keep knocking - off warnings.. + * test_main.c, Parrot/Jit/i386-linux.pm, + lib/Parrot/Jit/i386-linux.pm: In an attempt to just keep knocking + off warnings.. - Courtesy of Kevin Falcone + Courtesy of Kevin Falcone 2002-01-04 16:44 dan - * Configure.pl, Makefile.in: Fixed linking to use linker. + * Configure.pl, Makefile.in: Fixed linking to use linker. - Courtesy of Josh Wilmes + Courtesy of Josh Wilmes 2002-01-04 16:39 dan - * io/io_stdio.c: Added CVS tag info + * io/io_stdio.c: Added CVS tag info 2002-01-04 16:35 dan - * hints/cygwin.pl: Time for this. We need a sane linker, and ld2 - isn't it + * hints/cygwin.pl: Time for this. We need a sane linker, and ld2 + isn't it 2002-01-04 16:26 dan - * languages/miniperl/Miniperl/Tokenizer.pm: Quiet a warning in the - Tokenizer test + * languages/miniperl/Miniperl/Tokenizer.pm: Quiet a warning in the + Tokenizer test - Courtesy of Jonathan Stowe + Courtesy of Jonathan Stowe 2002-01-04 16:17 dan - * chartypes/unicode.c: Silence some warnings. + * chartypes/unicode.c: Silence some warnings. - Courtesy of "David M. Lloyd" + Courtesy of "David M. Lloyd" 2002-01-04 16:09 dan - * classes/: genclass.pl, perlarray.pmc, perlint.pmc, perlnum.pmc, - perlstring.pmc, perlundef.pmc: - genclass.pl attempts to put the Id mark - into generated files - but the Id mark string gets mangled when it's committed. - This patch fixes the existing .pmc files and fixes genclass.pl. + * classes/: genclass.pl, perlarray.pmc, perlint.pmc, perlnum.pmc, + perlstring.pmc, perlundef.pmc: - genclass.pl attempts to put the Id mark + into generated files + but the Id mark string gets mangled when it's committed. + This patch fixes the existing .pmc files and fixes genclass.pl. - - Makes capitalization in .pmc header match actual filenames + - Makes capitalization in .pmc header match actual filenames - - The command for calling genclass.pl in vtables.pod is incorrect, - since it assumes you're running in classes/ but genclass.pl - assumes - it's being run from the main directory. I changed genclass.pl to - not - care. + - The command for calling genclass.pl in vtables.pod is incorrect, + since it assumes you're running in classes/ but genclass.pl + assumes + it's being run from the main directory. I changed genclass.pl to + not + care. - Courtesy of Steve Fink + Courtesy of Steve Fink 2002-01-04 03:57 dan - * MANIFEST, io/TODO, io/io_stdio.c: No wonder things worked for - me--I *had* the files:wq! + * MANIFEST, io/TODO, io/io_stdio.c: No wonder things worked for + me--I *had* the files:wq! 2002-01-04 03:40 dan - * MANIFEST: Whoops--remove files not really there + * MANIFEST: Whoops--remove files not really there 2002-01-04 03:37 dan - * interpreter.c, stacks.c, include/parrot/stacks.h: The patch below - my sig adds a new_stack() function to take care of the allocation - and setup of "generic" stacks. + * interpreter.c, stacks.c, include/parrot/stacks.h: The patch below + my sig adds a new_stack() function to take care of the allocation + and setup of "generic" stacks. - Courtesy of "Brent Dax" + Courtesy of "Brent Dax" 2002-01-04 02:36 dan - * core.ops: The entry in core.ops for puts(s|sc) is missing a =cut - and so - writes a load of junk in core_ops.pod. Applied patch fixes. + * core.ops: The entry in core.ops for puts(s|sc) is missing a =cut + and so + writes a load of junk in core_ops.pod. Applied patch fixes. - Courtesy of Simon Glover + Courtesy of Simon Glover 2002-01-04 02:35 dan - * classes/: perlint.pmc, perlnum.pmc, perlstring.pmc: The PerlInt - logical-or is using get_integer instead of get_bool for logical - operations. This patch corrects that. + * classes/: perlint.pmc, perlnum.pmc, perlstring.pmc: The PerlInt + logical-or is using get_integer instead of get_bool for logical + operations. This patch corrects that. - Perlnum and perlstring have working get_bool's, so the default - logical_or and logical_and should be sufficient. The empty methods - are pointed to the default logical_or. + Perlnum and perlstring have working get_bool's, so the default + logical_or and logical_and should be sufficient. The empty methods + are pointed to the default logical_or. - Courtesy of Jason Gloudon + Courtesy of Jason Gloudon 2002-01-04 02:31 dan - * Makefile.in: docs/Makefile should be removed by realclean, but - isn't + * Makefile.in: docs/Makefile should be removed by realclean, but + isn't - Courtesy of Kevin Falcone + Courtesy of Kevin Falcone 2002-01-04 02:29 dan - * classes/: Makefile.in, pmc2c.pl: PMC inheritance! Yay! + * classes/: Makefile.in, pmc2c.pl: PMC inheritance! Yay! - Courtesy of Steve Fink + Courtesy of Steve Fink 2002-01-04 00:51 dan - * docs/vtables.pod: More docs + * docs/vtables.pod: More docs - Courtesy of Steve Fink + Courtesy of Steve Fink 2002-01-04 00:47 dan - * Configure.pl: Updated 64-bit patch + * Configure.pl: Updated 64-bit patch - Courtesy of "David M. Lloyd" + Courtesy of "David M. Lloyd" 2002-01-04 00:43 dan - * Configure.pl: 64-bit Fix. + * Configure.pl: 64-bit Fix. - Courtesy of "Bryan C. Warnock" + Courtesy of "Bryan C. Warnock" 2002-01-03 22:37 dan - * MANIFEST, Makefile.in, interpreter.c, include/parrot/io.h, - io/io.c, io/io_os.c: Code cleanup, started STDIO layer, started - some buffering work. Additional work on other layers. + * MANIFEST, Makefile.in, interpreter.c, include/parrot/io.h, + io/io.c, io/io_os.c: Code cleanup, started STDIO layer, started + some buffering work. Additional work on other layers. - Courtesy of Melvin Smith + Courtesy of Melvin Smith 2002-01-03 19:41 gregor - * disassemble.pl, obscure.ops, packfile.c, pbc2c.pl: - Updated copyright messages on top-level files. + * disassemble.pl, obscure.ops, packfile.c, pbc2c.pl: + Updated copyright messages on top-level files. 2002-01-03 04:23 robert - * make.pl: Add author information. Bonsai test. + * make.pl: Add author information. Bonsai test. 2002-01-03 04:02 dan - * io/io_os.c: Twig Bonsai + * io/io_os.c: Twig Bonsai 2002-01-03 03:45 dan - * io/: io_os.c, io_os.c: Twig Bonsai + * io/: io_os.c, io_os.c: Twig Bonsai 2002-01-03 03:41 dan - * io/io_os.c: Twig Bonsai + * io/io_os.c: Twig Bonsai 2002-01-02 21:42 gregor - * packfile.c, include/parrot/packfile.h: - Get rid of warnings in packfile.[hc] + * packfile.c, include/parrot/packfile.h: + Get rid of warnings in packfile.[hc] 2002-01-02 20:39 gregor - * manicheck.pl: - Bracketed translated patterns with ^ and $. + * manicheck.pl: + Bracketed translated patterns with ^ and $. 2002-01-02 20:11 dan - * io/io_os.c: silence a warning + * io/io_os.c: silence a warning 2002-01-02 19:52 grunblatt - * jit.c, jit2h.pl, include/parrot/jit.h: Moved the definition of - op_assembly to jit_struct.h, so that we get the real number of ops. - Removed some warnings. + * jit.c, jit2h.pl, include/parrot/jit.h: Moved the definition of + op_assembly to jit_struct.h, so that we get the real number of ops. + Removed some warnings. 2002-01-02 19:31 tom - * string.c: Fix string transcoding so that it actually works. + * string.c: Fix string transcoding so that it actually works. - Patch from Peter Gibbs + Patch from Peter Gibbs 2002-01-02 19:20 gregor - * manicheck.pl: - A program to check the MANIFEST file, accounting for .cvsignore - files. + * manicheck.pl: + A program to check the MANIFEST file, accounting for .cvsignore + files. 2002-01-02 19:19 dan - * t/harness: twig bonsai + * t/harness: twig bonsai 2002-01-02 19:13 dan - * t/harness: twig bonsai + * t/harness: twig bonsai 2002-01-02 18:54 dan - * t/harness: Tweak to test Bonsai + * t/harness: Tweak to test Bonsai 2002-01-02 16:27 dan - * Configure.pl: Allow 64-bit build of parrot on systems with a - mixed 32/64 bit perl + * Configure.pl: Allow 64-bit build of parrot on systems with a + mixed 32/64 bit perl - Courtesy of David M. Lloyd + Courtesy of David M. Lloyd 2002-01-02 15:33 simon - * MANIFEST, docs/Makefile: - Fixed up MANIFEST. (And I removed the Makefile in docs/) + * MANIFEST, docs/Makefile: + Fixed up MANIFEST. (And I removed the Makefile in docs/) - Courtesy of: Andy Dougherty + Courtesy of: Andy Dougherty 2002-01-02 13:51 simon - * Configure.pl: - Die on broken manifest. + * Configure.pl: + Die on broken manifest. 2002-01-02 13:48 simon - * jit2h.pl, examples/assembly/mops.pasm: - Clear up JIT warnings. + * jit2h.pl, examples/assembly/mops.pasm: + Clear up JIT warnings. - Courtesy of: Nick Clark + Courtesy of: Nick Clark 2002-01-02 04:10 dan - * io/io.c, io/io_os.c, t/op/interp.t: IO stack now gets initialized - only once, so new interp creation works again + * io/io.c, io/io_os.c, t/op/interp.t: IO stack now gets initialized + only once, so new interp creation works again - Courtesy of Melvin Smith + Courtesy of Melvin Smith 2002-01-02 03:32 dan - * t/op/interp.t: Stubbed the test out, since it's hanging at the - moment. + * t/op/interp.t: Stubbed the test out, since it's hanging at the + moment. 2002-01-02 00:55 dan - * MANIFEST, Makefile.in, core.ops, include/parrot/io.h, io/io.c, - io/io_os.c: Initial IO system patches + * MANIFEST, Makefile.in, core.ops, include/parrot/io.h, io/io.c, + io/io_os.c: Initial IO system patches - Courtesy of + Courtesy of 2002-01-01 22:55 ajgough - * classes/default.pmc: On second thoughts, and some prodding, the - set_* methods now only set the appropriate part of the cache, and - do nothing else. + * classes/default.pmc: On second thoughts, and some prodding, the + set_* methods now only set the appropriate part of the cache, and + do nothing else. 2002-01-01 22:29 ajgough - * classes/default.pmc: Wrote a whole host of default pmc methods. + * classes/default.pmc: Wrote a whole host of default pmc methods. - set_* create appropriate Perl* result. - get_* simply grabs needed bit of cache.*_val + set_* create appropriate Perl* result. + get_* simply grabs needed bit of cache.*_val - Other methods do the rightest thing I can think of, at the moment. + Other methods do the rightest thing I can think of, at the moment. - None yet cope with overflow, the modulus operation needs to be - checked as - I don't know quite which semantics we really want. + None yet cope with overflow, the modulus operation needs to be + checked as + I don't know quite which semantics we really want. - Not tested yet. + Not tested yet. 2002-01-01 20:23 dan - * docs/Makefile, encodings/singlebyte.c, encodings/utf16.c, - encodings/utf32.c, encodings/utf8.c, include/parrot/encoding.h: Got - rid of unneeded tmp var and eliminated const from encode prototype - since it does make changes to the string. + * docs/Makefile, encodings/singlebyte.c, encodings/utf16.c, + encodings/utf32.c, encodings/utf8.c, include/parrot/encoding.h: Got + rid of unneeded tmp var and eliminated const from encode prototype + since it does make changes to the string. - Courtesy of "David & Lisa Jacobs" + Courtesy of "David & Lisa Jacobs" 2002-01-01 20:11 dan - * Makefile.in: Make clean now tosses pdump.o + * Makefile.in: Make clean now tosses pdump.o - Courtesy of "David & Lisa Jacobs" + Courtesy of "David & Lisa Jacobs" 2002-01-01 19:49 dan - * pdump.c, test_main.c: Warnings cleanup + * pdump.c, test_main.c: Warnings cleanup - Courtesy of Josh Wilmes + Courtesy of Josh Wilmes 2002-01-01 19:45 dan - * Configure.pl, Makefile.in, docs/.cvsignore, docs/Makefile.in, - hints/mswin32.pl, languages/jako/Makefile.in, - languages/scheme/Makefile.in: Makes cleanup better on non-Unix - platforms + * Configure.pl, Makefile.in, docs/.cvsignore, docs/Makefile.in, + hints/mswin32.pl, languages/jako/Makefile.in, + languages/scheme/Makefile.in: Makes cleanup better on non-Unix + platforms - Courtesy of "Jason Diamond" + Courtesy of "Jason Diamond" 2002-01-01 19:41 dan - * include/parrot/register.h: Clean up some warnings + * include/parrot/register.h: Clean up some warnings - Courtesy of Josh Wilmes + Courtesy of Josh Wilmes 2002-01-01 19:10 simon - * pbc2c.pl, Parrot/OpsFile.pm, lib/Parrot/OpsFile.pm: - Hack-around to enable compilation of code using vtable ops. + * pbc2c.pl, Parrot/OpsFile.pm, lib/Parrot/OpsFile.pm: + Hack-around to enable compilation of code using vtable ops. 2002-01-01 18:43 dan - * encodings/: singlebyte.c, utf16.c, utf32.c, utf8.c: Toss <0 - checks on unsigned things + * encodings/: singlebyte.c, utf16.c, utf32.c, utf8.c: Toss <0 + checks on unsigned things - Courtesy of "David & Lisa Jacobs" + Courtesy of "David & Lisa Jacobs" 2002-01-01 18:26 dan - * runops_cores.c: More warning silences. + * runops_cores.c: More warning silences. - Courtesy of Nicholas Clark + Courtesy of Nicholas Clark 2002-01-01 18:25 dan - * trace.c: Shuts up a warning. + * trace.c: Shuts up a warning. - Courtesy of Nicholas Clark + Courtesy of Nicholas Clark 2002-01-01 18:24 dan - * encodings/singlebyte.c: Clean up some warnings. + * encodings/singlebyte.c: Clean up some warnings. - Courtesy of Nicholas Clark + Courtesy of Nicholas Clark 2002-01-01 18:20 dan - * Configure.pl: Hey, those PPros are really x86 systems! Who'dve - thunk it? + * Configure.pl: Hey, those PPros are really x86 systems! Who'dve + thunk it? - Courtesy of "Bryan C. Warnock" + Courtesy of "Bryan C. Warnock" 2002-01-01 18:17 dan - * packfile.c: Warning cleanup + * packfile.c: Warning cleanup - Courtesy of Nicholas Clark + Courtesy of Nicholas Clark 2002-01-01 17:53 dan - * string.c: New string size should be based on output encoding's - size, not input encoding's size. + * string.c: New string size should be based on output encoding's + size, not input encoding's size. - Courtesy of: "Peter Gibbs" + Courtesy of: "Peter Gibbs" 2002-01-01 17:22 dan - * Configure.pl, core.ops, interpreter.c, memory.c, runops_cores.c, - string.c, test_main.c, trace.c, include/parrot/exceptions.h, - include/parrot/interpreter.h, include/parrot/memory.h, - include/parrot/oplib.h, include/parrot/string.h, t/op/string.t: - Warnings fixups. + * Configure.pl, core.ops, interpreter.c, memory.c, runops_cores.c, + string.c, test_main.c, trace.c, include/parrot/exceptions.h, + include/parrot/interpreter.h, include/parrot/memory.h, + include/parrot/oplib.h, include/parrot/string.h, t/op/string.t: + Warnings fixups. - Courtesy of Chip Turner + Courtesy of Chip Turner 2002-01-01 17:09 dan - * encodings/singlebyte.c, encodings/utf16.c, encodings/utf32.c, - encodings/utf8.c, include/parrot/encoding.h: Some signed things are - now unsigned, as is proper. + * encodings/singlebyte.c, encodings/utf16.c, encodings/utf32.c, + encodings/utf8.c, include/parrot/encoding.h: Some signed things are + now unsigned, as is proper. - Courtesy of: "David & Lisa Jacobs" - Courtesy of: "Bryan C. Warnock" + Courtesy of: "David & Lisa Jacobs" + Courtesy of: "Bryan C. Warnock" 2002-01-01 16:59 dan - * include/parrot/trace.h: Useless debugging prototype removed + * include/parrot/trace.h: Useless debugging prototype removed - Courtesy of: "Bryan C. Warnock" + Courtesy of: "Bryan C. Warnock" 2002-01-01 16:58 dan - * MANIFEST: We forgot a file. + * MANIFEST: We forgot a file. - Courtesy of "Bryan C. Warnock" + Courtesy of "Bryan C. Warnock" 2002-01-01 03:53 dan - * Configure.pl: Okay, I give. Removed some warnings because the - darned system headers were triggering them. Sloppy, sloppy - coding... + * Configure.pl: Okay, I give. Removed some warnings because the + darned system headers were triggering them. Sloppy, sloppy + coding... 2002-01-01 03:48 dan - * config_h.in: Add in an unsigned INTVAL. + * config_h.in: Add in an unsigned INTVAL. - Courtesy of "David & Lisa Jacobs" + Courtesy of "David & Lisa Jacobs" 2002-01-01 03:46 dan - * global_setup.c: Clean up some compiler warnings. + * global_setup.c: Clean up some compiler warnings. - Courtesy of "David & Lisa Jacobs" + Courtesy of "David & Lisa Jacobs" 2002-01-01 03:43 dan - * ops2c.pl, Parrot/OpTrans.pm, Parrot/OpTrans/CPrederef.pm, - lib/Parrot/OpTrans.pm, lib/Parrot/OpTrans/CPrederef.pm, - include/parrot/op.h: Cleaned up some things to make the compiler - happier. + * ops2c.pl, Parrot/OpTrans.pm, Parrot/OpTrans/CPrederef.pm, + lib/Parrot/OpTrans.pm, lib/Parrot/OpTrans/CPrederef.pm, + include/parrot/op.h: Cleaned up some things to make the compiler + happier. - Courtesy of Nicholas Clark + Courtesy of Nicholas Clark 2002-01-01 03:14 dan - * Configure.pl: Quad updates. + * Configure.pl: Quad updates. - Courtesy of Nicholas Clark + Courtesy of Nicholas Clark 2001-12-31 22:53 dan - * include/parrot/op.h: Typedef had parameters backwards. Threw - core.ops for a big whiny warnings loop. + * include/parrot/op.h: Typedef had parameters backwards. Threw + core.ops for a big whiny warnings loop. 2001-12-31 22:37 dan - * Makefile.in, resources.c: Tweaks to try and get things to build - in the right order. + * Makefile.in, resources.c: Tweaks to try and get things to build + in the right order. 2001-12-31 21:58 dan - * Configure.pl: Stupid thinko fix + * Configure.pl: Stupid thinko fix 2001-12-31 21:34 dan - * Configure.pl, hints/mswin32.pl: Tweaks for Win32 builds + * Configure.pl, hints/mswin32.pl: Tweaks for Win32 builds - Courtesy of: "Jason Diamond" + Courtesy of: "Jason Diamond" 2001-12-31 21:32 dan - * Configure.pl: Fix for non-gcc systems + * Configure.pl: Fix for non-gcc systems 2001-12-31 20:22 dan - * interpreter.c: Tweak so we can build on non-JIT platforms + * interpreter.c: Tweak so we can build on non-JIT platforms 2001-12-31 20:11 dan - * Configure.pl: Force the time on some copied files to be 'now' to - make the Win builds much less annoying. + * Configure.pl: Force the time on some copied files to be 'now' to + make the Win builds much less annoying. - Courtesy of "Jason Diamond" + Courtesy of "Jason Diamond" 2001-12-31 20:07 dan - * Configure.pl: Nuke all object files in the parrot tree that - matter when configuring. Shouldn't be necessary with good - dependencies in the makefile, but we don't have those yet. + * Configure.pl: Nuke all object files in the parrot tree that + matter when configuring. Shouldn't be necessary with good + dependencies in the makefile, but we don't have those yet. 2001-12-31 20:00 gregor - * chartypes/unicode.c: - Silence unused variable warnings. + * chartypes/unicode.c: + Silence unused variable warnings. 2001-12-31 19:40 dan - * Configure.pl: Minor Win32 tweaks. Tossed -Wtraditional, too + * Configure.pl: Minor Win32 tweaks. Tossed -Wtraditional, too 2001-12-31 19:37 gregor - * interpreter.c, jit.c, include/parrot/jit.h: - Created a prototype for JIT functions and used it in interpreter.c. + * interpreter.c, jit.c, include/parrot/jit.h: + Created a prototype for JIT functions and used it in interpreter.c. 2001-12-31 19:31 dan - * Configure.pl, test_gnuc.c: Better GCC detection (and version - detection) with really cranky warnings if we find we're using it. + * Configure.pl, test_gnuc.c: Better GCC detection (and version + detection) with really cranky warnings if we find we're using it. - Courtesy of: Nicholas Clark + Courtesy of: Nicholas Clark 2001-12-31 18:01 gregor - * interpreter.c, include/parrot/interpreter.h, include/parrot/op.h: + * interpreter.c, include/parrot/interpreter.h, include/parrot/op.h: - Fixed a few warnings wrt prototypes, etc. + Fixed a few warnings wrt prototypes, etc. 2001-12-31 17:23 dan - * string.c: Silenced most of the compiler whines + * string.c: Silenced most of the compiler whines 2001-12-31 17:15 gregor - * Configure.pl: - Get the ccname from either ccname or just cc config var. + * Configure.pl: + Get the ccname from either ccname or just cc config var. 2001-12-31 17:14 gregor - * Parrot/Op.pm, lib/Parrot/Op.pm: - Another intermediate opbody notation. Could come in handy. Explicit - types. + * Parrot/Op.pm, lib/Parrot/Op.pm: + Another intermediate opbody notation. Could come in handy. Explicit + types. 2001-12-31 17:05 dan - * string.c: Minor warnings update + * string.c: Minor warnings update 2001-12-31 17:00 dan - * include/parrot/string.h: Warnings cleanup + * include/parrot/string.h: Warnings cleanup 2001-12-31 16:00 simon - * encodings/utf8.c, include/parrot/encoding.h: - Remove a couple more. + * encodings/utf8.c, include/parrot/encoding.h: + Remove a couple more. 2001-12-31 15:58 simon - * vtable_h.pl, include/parrot/global_setup.h, include/parrot/jit.h, - include/parrot/op.h: - Rid ourselves of a few warnings. + * vtable_h.pl, include/parrot/global_setup.h, include/parrot/jit.h, + include/parrot/op.h: + Rid ourselves of a few warnings. 2001-12-31 15:32 dan - * Configure.pl: Made GCC ever so much pickier. + * Configure.pl: Made GCC ever so much pickier. - Switch list courtesy of Jarkko. + Switch list courtesy of Jarkko. 2001-12-31 15:22 dan - * string.c: Tightened up initial allocation. + * string.c: Tightened up initial allocation. - Courtesy of: "Peter Gibbs" + Courtesy of: "Peter Gibbs" 2001-12-31 06:48 dan - * Configure.pl: Minor Windows tweak + * Configure.pl: Minor Windows tweak 2001-12-31 05:32 dan - * core.ops: Unused temp variable tossed. + * core.ops: Unused temp variable tossed. - Courtesy of "David & Lisa Jacobs" + Courtesy of "David & Lisa Jacobs" 2001-12-31 05:09 grunblatt - * Configure.pl, Makefile.in, interpreter.c: Link jit.o only on - supported plataforms + * Configure.pl, Makefile.in, interpreter.c: Link jit.o only on + supported plataforms 2001-12-31 03:05 dan - * Configure.pl, Makefile.in, classes/Makefile.in: Added in a - platform-independent quote substitution for the makefiles. - Hopefully this'll make the Win32 builds happier. + * Configure.pl, Makefile.in, classes/Makefile.in: Added in a + platform-independent quote substitution for the makefiles. + Hopefully this'll make the Win32 builds happier. 2001-12-30 21:08 dan - * string.c, include/parrot/string.h: More string system tweaks. + * string.c, include/parrot/string.h: More string system tweaks. - Courtesy of "David & Lisa Jacobs" + Courtesy of "David & Lisa Jacobs" 2001-12-30 20:45 dan - * core.ops: Some pod cleanup + * core.ops: Some pod cleanup - Courtesy of Josh Wilmes + Courtesy of Josh Wilmes 2001-12-30 20:22 ajgough - * docs/parrot_assembly.pod: removed ntoi and iton ops from docs, as - we aren't using them right now. Clarified the workings of set Px, - Py and clone Px, Py. + * docs/parrot_assembly.pod: removed ntoi and iton ops from docs, as + we aren't using them right now. Clarified the workings of set Px, + Py and clone Px, Py. 2001-12-30 20:15 grunblatt - * jit.c, jit2h.pl, jit/i386/core.jit: Removed the warnings in jit.c - Added readjit() to read *.jit files Updated core.jit to the new - set_n_i + * jit.c, jit2h.pl, jit/i386/core.jit: Removed the warnings in jit.c + Added readjit() to read *.jit files Updated core.jit to the new + set_n_i 2001-12-30 20:14 ajgough - * examples/assembly/mops.pasm: Changed iton/ntoi to set. + * examples/assembly/mops.pasm: Changed iton/ntoi to set. 2001-12-30 19:52 dan - * packfile.c, pdump.c, register.c, string.c, include/parrot/key.h, - include/parrot/trace.h, platforms/generic.c: Compiler whine - cleanups + * packfile.c, pdump.c, register.c, string.c, include/parrot/key.h, + include/parrot/trace.h, platforms/generic.c: Compiler whine + cleanups - Courtesy of Josh Wilmes + Courtesy of Josh Wilmes 2001-12-30 19:13 dan - * Configure.pl, Makefile.in: Make GCC pickier by default. + * Configure.pl, Makefile.in: Make GCC pickier by default. - Courtesy of: Josh Wilmes + Courtesy of: Josh Wilmes 2001-12-30 18:41 dan - * core.ops, t/op/integer.t, t/op/number.t: Transformed iton and - ntoi opcodes to sets. + * core.ops, t/op/integer.t, t/op/number.t: Transformed iton and + ntoi opcodes to sets. - Courtesy of "David & Lisa Jacobs" + Courtesy of "David & Lisa Jacobs" 2001-12-30 17:58 gregor - * Makefile.in: - 'make' no longer builds the mops test. Use 'make mops' for that. To - run the test, you can do 'make mopstest'. + * Makefile.in: + 'make' no longer builds the mops test. Use 'make mops' for that. To + run the test, you can do 'make mopstest'. 2001-12-30 17:30 gregor - * Makefile.in: - Fixed one oversight. 'make clean' was removing Parrot/Types.pm. Bad - Gregor. + * Makefile.in: + Fixed one oversight. 'make clean' was removing Parrot/Types.pm. Bad + Gregor. 2001-12-30 17:26 gregor - * .cvsignore, Configure.pl, Makefile.in, VERSION, config_h.in, - core.ops, interpreter.c, make_vtable_ops.pl, obscure.ops, ops2c.pl, - Parrot/BuildUtil.pm, Parrot/OpsFile.pm, lib/Parrot/BuildUtil.pm, - lib/Parrot/OpsFile.pm, include/parrot/oplib.h: - Build enhancements. Originally to support building shared - libraries, but now of broader impact. + * .cvsignore, Configure.pl, Makefile.in, VERSION, config_h.in, + core.ops, interpreter.c, make_vtable_ops.pl, obscure.ops, ops2c.pl, + Parrot/BuildUtil.pm, Parrot/OpsFile.pm, lib/Parrot/BuildUtil.pm, + lib/Parrot/OpsFile.pm, include/parrot/oplib.h: + Build enhancements. Originally to support building shared + libraries, but now of broader impact. - * .cvsignore: Ignore the blib/ directory, about which more later. + * .cvsignore: Ignore the blib/ directory, about which more later. - * Configure.pl: + * Configure.pl: - * Got rid of TAB formatting and lined a few things up. + * Got rid of TAB formatting and lined a few things up. - * Added header comment with CVS Id variable, and a few other - block header comments. + * Added header comment with CVS Id variable, and a few other + block header comments. - * Uses new Parrot::BuildUtil module to determine the Parrot - version. + * Uses new Parrot::BuildUtil module to determine the Parrot + version. - * Reworded a few messages, added a couple, and wrapped - messages - to 79 columns. + * Reworded a few messages, added a couple, and wrapped + messages + to 79 columns. - * Added 2002 to the Copyright statement. + * Added 2002 to the Copyright statement. - * Added new configure variables: VERSION, MAJOR, MINOR and - PATCH + * Added new configure variables: VERSION, MAJOR, MINOR and + PATCH - NOTE: Please see the 'Alas perl5.7.2' comment. 5.7.2 is - greater - than 5.6.0, but the comment implies it isn't. + NOTE: Please see the 'Alas perl5.7.2' comment. 5.7.2 is + greater + than 5.6.0, but the comment implies it isn't. - * Makefile.in: + * Makefile.in: - * Added $(SO), $(A) and $(AR_CRS) defines for library - building. + * Added $(SO), $(A) and $(AR_CRS) defines for library + building. - * Added $(RM_RF) define for removing directory trees + * Added $(RM_RF) define for removing directory trees - * Grouped generated files into two classes: "sticky" (made by - configure, - persisting across 'make clean') and 'fluid' (made during - the build - process, deleted by 'make clean'). + * Grouped generated files into two classes: "sticky" (made by + configure, + persisting across 'make clean') and 'fluid' (made during + the build + process, deleted by 'make clean'). - * Added header comments. + * Added header comments. - * Added target for test_prog linked with shared library. + * Added target for test_prog linked with shared library. - * Added rules to build shared libraries in blib/lib. The - libraries are - built with trailing version numbers in their file names, - and then - symbolic links are created for shorter and no version tag - variants. + * Added rules to build shared libraries in blib/lib. The + libraries are + built with trailing version numbers in their file names, + and then + symbolic links are created for shorter and no version tag + variants. - * Added some missing dependencies + * Added some missing dependencies - * Added some missing 'make clean' targets. + * Added some missing 'make clean' targets. - * Added 'make realclean' target that deletes files created by - Configure.pl (including Makefile), forcing a re-configure. + * Added 'make realclean' target that deletes files created by + Configure.pl (including Makefile), forcing a re-configure. - * Added a 'status' CVS target. + * Added a 'status' CVS target. - * VERSION: New file, contains only the version. This version - number is - propagated to a few places, such as the core oplib version - number. This - reduces the amount of coordination that has to happen to get - version - number stuff throughout the tree in sync and updated prior to - cutting - a new release. Feel free to grep for '0.0.3' to see the other - files - that contain the version number (but, do that in a fresh CVS - copy, or - after doing 'make realclean'). + * VERSION: New file, contains only the version. This version + number is + propagated to a few places, such as the core oplib version + number. This + reduces the amount of coordination that has to happen to get + version + number stuff throughout the tree in sync and updated prior to + cutting + a new release. Feel free to grep for '0.0.3' to see the other + files + that contain the version number (but, do that in a fresh CVS + copy, or + after doing 'make realclean'). - * config_h.in: Renamed PARROT_CORE_OPLIB_*_VERSION to - PARROT_*_VERSION, - since the oplib and Parrot itself share a version number now. - Added - PARROT_PATCH_VERSION (the third component) and PARROT_VERSION - (a - string). + * config_h.in: Renamed PARROT_CORE_OPLIB_*_VERSION to + PARROT_*_VERSION, + since the oplib and Parrot itself share a version number now. + Added + PARROT_PATCH_VERSION (the third component) and PARROT_VERSION + (a + string). - * core.ops: Uses new notation "VERSION = PARROT_VERSION" instead - of - specifying the version by hand. Non-core oplibs will set this - to - a quoted dot-string with three natural number components - without - leading zeros. + * core.ops: Uses new notation "VERSION = PARROT_VERSION" instead + of + specifying the version by hand. Non-core oplibs will set this + to + a quoted dot-string with three natural number components + without + leading zeros. - * interpreter.c: Make use of PARROT_VERSION to simplify some - sprintf()s, and - to get the complete version number in the resulting strings - (including the - new PATCH portion). + * interpreter.c: Make use of PARROT_VERSION to simplify some + sprintf()s, and + to get the complete version number in the resulting strings + (including the + new PATCH portion). - * make_vtable_ops.pl: Put the "VERSION = PARROT_VERSION" line int - the - generated file. + * make_vtable_ops.pl: Put the "VERSION = PARROT_VERSION" line int + the + generated file. - * obscure.ops: Use the new "VERSION = PARROT_VERSION" technique. + * obscure.ops: Use the new "VERSION = PARROT_VERSION" technique. - * ops2c.pl: Account for the PATCH version, too. This affects the - name of the - oplib init function, and the oplib info struct initializer. + * ops2c.pl: Account for the PATCH version, too. This affects the + name of the + oplib init function, and the oplib info struct initializer. - * Parrot/BuildUtil.pm: New file for reading in and validating the - contents of - the new VERSION file. Other build utilities could go here in - futuer. + * Parrot/BuildUtil.pm: New file for reading in and validating the + contents of + the new VERSION file. Other build utilities could go here in + futuer. - * Parrot/OpsFile.pm: + * Parrot/OpsFile.pm: - * Allow three components in version number, and require that - the value - be in double quotes. + * Allow three components in version number, and require that + the value + be in double quotes. - * Allow "VERSION = PARROT_VERSION", substituting the shared - Parrot - VERSION in that case. + * Allow "VERSION = PARROT_VERSION", substituting the shared + Parrot + VERSION in that case. - * include/parrot/oplib.h: Add the patch_version member. + * include/parrot/oplib.h: Add the patch_version member. 2001-12-30 12:16 simon - * MANIFEST, Makefile.in: - More stuff forgotten from MANIFEST. + * MANIFEST, Makefile.in: + More stuff forgotten from MANIFEST. 2001-12-30 12:13 simon - * MANIFEST: - Missing JIT file. + * MANIFEST: + Missing JIT file. 2001-12-30 12:12 simon - * jit2h.pl: - Safety first. + * jit2h.pl: + Safety first. 2001-12-30 12:12 simon - * Makefile.in: - Gragh. + * Makefile.in: + Gragh. 2001-12-30 12:04 simon - * Makefile.in, core.ops, packfile.c, pbc2c.pl, string.c, - classes/perlstring.pmc, encodings/singlebyte.c, encodings/utf16.c, - encodings/utf32.c, encodings/utf8.c, include/parrot/encoding.h, - include/parrot/string.h, t/op/string.t: - * Expand the strings test suite to be more complete * Make string - commands more consistent (i.e, now the only string command that - actually changes the original is chopn) * Significantly reduce the - number of memory allocations and eliminate reallocations. + * Makefile.in, core.ops, packfile.c, pbc2c.pl, string.c, + classes/perlstring.pmc, encodings/singlebyte.c, encodings/utf16.c, + encodings/utf32.c, encodings/utf8.c, include/parrot/encoding.h, + include/parrot/string.h, t/op/string.t: + * Expand the strings test suite to be more complete * Make string + commands more consistent (i.e, now the only string command that + actually changes the original is chopn) * Significantly reduce the + number of memory allocations and eliminate reallocations. - Courtesy of: David Jacobs + Courtesy of: David Jacobs 2001-12-29 22:12 dan - * interpreter.c, key.c, register.c, stacks.c, string.c, - test_main.c, trace.c: Updates to match the coding standards. + * interpreter.c, key.c, register.c, stacks.c, string.c, + test_main.c, trace.c: Updates to match the coding standards. - Courtesy of Bryan C. Warnock + Courtesy of Bryan C. Warnock 2001-12-29 20:42 grunblatt - * jit2h.pl, Parrot/Jit/i386-bsd.pm, Parrot/Jit/i386-linux.pm, - Parrot/Jit/i386-nojit.pm, jit/i386/core.jit, jit/i386/lib.jit, - jit/i386/string.jit, lib/Parrot/Jit/i386-bsd.pm, - lib/Parrot/Jit/i386-linux.pm, lib/Parrot/Jit/i386-nojit.pm: Allow - us to write asm in *.jit files instead of hex. Courtesy of: Rafael - Kitover + * jit2h.pl, Parrot/Jit/i386-bsd.pm, Parrot/Jit/i386-linux.pm, + Parrot/Jit/i386-nojit.pm, jit/i386/core.jit, jit/i386/lib.jit, + jit/i386/string.jit, lib/Parrot/Jit/i386-bsd.pm, + lib/Parrot/Jit/i386-linux.pm, lib/Parrot/Jit/i386-nojit.pm: Allow + us to write asm in *.jit files instead of hex. Courtesy of: Rafael + Kitover 2001-12-28 21:20 dan - * core.ops: Okay, now print takes a preceding file handle. + * core.ops: Okay, now print takes a preceding file handle. - I feel so dirty now. + I feel so dirty now. 2001-12-28 20:46 dan - * core.ops, t/op/hacks.t: Added in the readline op, as well as - changing the open op to use fopen under the hood. + * core.ops, t/op/hacks.t: Added in the readline op, as well as + changing the open op to use fopen under the hood. - THESE OPS ARE EVIL! AND TEMPORARY! USE FOR DEBUGGING PURPOSES ONLY! + THESE OPS ARE EVIL! AND TEMPORARY! USE FOR DEBUGGING PURPOSES ONLY! 2001-12-28 18:20 ajgough - * core.ops, make_vtable_ops.pl, string.c, classes/default.pmc, - classes/perlstring.pmc, docs/parrot_assembly.pod, docs/strings.pod, - include/parrot/exceptions.h, include/parrot/string.h, - t/op/pmc_perlstring.t, t/op/string.t, t/pmc/perlstring.t: Added - repeat op, so that "foo" x 10 can be done. Filled in PerlString - vtables appropriately. Also tests for same, new pmc_perlstring.t - to hold tests specific to PerlStrings, as the pmc.t file is taking - too long to run and slowing down my thought processes. + * core.ops, make_vtable_ops.pl, string.c, classes/default.pmc, + classes/perlstring.pmc, docs/parrot_assembly.pod, docs/strings.pod, + include/parrot/exceptions.h, include/parrot/string.h, + t/op/pmc_perlstring.t, t/op/string.t, t/pmc/perlstring.t: Added + repeat op, so that "foo" x 10 can be done. Filled in PerlString + vtables appropriately. Also tests for same, new pmc_perlstring.t + to hold tests specific to PerlStrings, as the pmc.t file is taking + too long to run and slowing down my thought processes. - Changes to strings.c etc to take string functions. + Changes to strings.c etc to take string functions. - Some changes to the strings docs, but not yet complete. + Some changes to the strings docs, but not yet complete. - Also, PerlString was copying pointers to strings, rather than - strings themselves, so some action-at-a-distance bugs were creeping - in, I think I've fixed this so everything works nicely. + Also, PerlString was copying pointers to strings, rather than + strings themselves, so some action-at-a-distance bugs were creeping + in, I think I've fixed this so everything works nicely. 2001-12-28 04:56 gregor - * examples/assembly/pmcmops.pasm: - PMC-using version of mops.pasm. + * examples/assembly/pmcmops.pasm: + PMC-using version of mops.pasm. - Courtesy of: Bryan C. Warnock + Courtesy of: Bryan C. Warnock 2001-12-28 04:56 gregor - * examples/assembly/.cvsignore: - Small tinkering. Removed old stuff, etc. + * examples/assembly/.cvsignore: + Small tinkering. Removed old stuff, etc. 2001-12-28 01:26 gregor - * examples/mops/mops.scheme: - Scheme example. Major GC thrashing on umb-scheme here. Probably due - to the very un-scheme-like implementation. + * examples/mops/mops.scheme: + Scheme example. Major GC thrashing on umb-scheme here. Probably due + to the very un-scheme-like implementation. 2001-12-28 01:19 gregor - * examples/mops/mops.c: - Some people's picky compilers don't like us redefineing time(), so - we call it time_n(). :) + * examples/mops/mops.c: + Some people's picky compilers don't like us redefineing time(), so + we call it time_n(). :) 2001-12-28 00:28 gregor - * examples/mops/: README, mops.ps: - Added a PostScript example and a README. + * examples/mops/: README, mops.ps: + Added a PostScript example and a README. 2001-12-27 23:57 gregor - * Makefile.in: - Build the C mops translation in examples/mops/mops.c + * Makefile.in: + Build the C mops translation in examples/mops/mops.c 2001-12-27 23:56 gregor - * examples/mops/: .cvsignore, mops.c, mops.pl, mops.py, mops.rb: - Some translations of mops.pasm into other languages, for inner loop - performance comparisons. + * examples/mops/: .cvsignore, mops.c, mops.pl, mops.py, mops.rb: + Some translations of mops.pasm into other languages, for inner loop + performance comparisons. 2001-12-27 22:40 gregor - * examples/assembly/mops.pasm: - Fixed erroneous file name in header comment. + * examples/assembly/mops.pasm: + Fixed erroneous file name in header comment. 2001-12-27 21:18 gregor - * pbc2c.pl: - One-liner to avoid no-op gotos to the next op. + * pbc2c.pl: + One-liner to avoid no-op gotos to the next op. 2001-12-27 21:06 gregor - * runops_cores.c: - Fixed -p (profiling). Slow runops core was doing unconditional - tracing, when it should have been checking the flags. + * runops_cores.c: + Fixed -p (profiling). Slow runops core was doing unconditional + tracing, when it should have been checking the flags. 2001-12-27 18:50 ajgough - * core.ops, string.c, chartypes/unicode.c, chartypes/usascii.c, - classes/perlstring.pmc, include/parrot/chartype.h, - include/parrot/string.h, t/op/pmc.t, t/op/string.t, t/pmc/pmc.t: - dded get_digit() to chartypes * Added string_bool() to strings * - Added if_s_ic op, to use same * Added (PerlString)->get_bool stuff - to perlstring.pmc * Tests for above, also a for couple of other - ops without tests + * core.ops, string.c, chartypes/unicode.c, chartypes/usascii.c, + classes/perlstring.pmc, include/parrot/chartype.h, + include/parrot/string.h, t/op/pmc.t, t/op/string.t, t/pmc/pmc.t: + dded get_digit() to chartypes * Added string_bool() to strings * + Added if_s_ic op, to use same * Added (PerlString)->get_bool stuff + to perlstring.pmc * Tests for above, also a for couple of other + ops without tests - The unicode chartype has only had placeholders added for get_digit, - string_to_num has been updated to use type->get_digit rather than - the previous ascii-isms. Some remain, but we need to carefully - define what we mean by a number before we let thousands of code - points act as a minus sign. + The unicode chartype has only had placeholders added for get_digit, + string_to_num has been updated to use type->get_digit rather than + the previous ascii-isms. Some remain, but we need to carefully + define what we mean by a number before we let thousands of code + points act as a minus sign. 2001-12-27 18:32 dan - * classes/: perlint.pmc, perlnum.pmc, perlstring.pmc: Silenced some - compiler warnings. + * classes/: perlint.pmc, perlnum.pmc, perlstring.pmc: Silenced some + compiler warnings. - Courtesy of "David Jacobs" + Courtesy of "David Jacobs" 2001-12-27 18:23 dan - * t/op/bitwise.t: More tests. + * t/op/bitwise.t: More tests. - Courtesy of "David Jacobs" + Courtesy of "David Jacobs" 2001-12-27 17:08 gregor - * MANIFEST, Makefile.in, config_h.in, core.ops, interpreter.c, - make_vtable_ops.pl, obscure.ops, ops2c.pl, ops2pm.pl, test_main.c, - trace.c, Parrot/OpsFile.pm, include/parrot/interp_guts.h, - include/parrot/interpreter.h, include/parrot/oplib.h, - lib/Parrot/OpsFile.pm, platforms/generic.c, platforms/generic.h, - platforms/win32.c, platforms/win32.h: - Initial code for dynamic loading of oplibs, applied for now to the - loading of the core_prederef oplib when the -P flag is passed to - test_parrot. + * MANIFEST, Makefile.in, config_h.in, core.ops, interpreter.c, + make_vtable_ops.pl, obscure.ops, ops2c.pl, ops2pm.pl, test_main.c, + trace.c, Parrot/OpsFile.pm, include/parrot/interp_guts.h, + include/parrot/interpreter.h, include/parrot/oplib.h, + lib/Parrot/OpsFile.pm, platforms/generic.c, platforms/generic.h, + platforms/win32.c, platforms/win32.h: + Initial code for dynamic loading of oplibs, applied for now to the + loading of the core_prederef oplib when the -P flag is passed to + test_parrot. - * MANIFEST: Added entry for the new file include/parrot/oplib.h. + * MANIFEST: Added entry for the new file include/parrot/oplib.h. - * Makefile.in: + * Makefile.in: - * Added libcore_prederef_0_3.so to the shared target. - * Added build rule for libcore_prederef_0_3.so. - * Added dependencies on Parrot/OpsFile.pm and Parrot/Op.pm - to Parrot/OpLib/core.pm, core_ops.c and - core_ops_prederef.c. + * Added libcore_prederef_0_3.so to the shared target. + * Added build rule for libcore_prederef_0_3.so. + * Added dependencies on Parrot/OpsFile.pm and Parrot/Op.pm + to Parrot/OpLib/core.pm, core_ops.c and + core_ops_prederef.c. - * config_h.in: Added defines for constants used to locate the - core oplib's init function, and the core_prederef oplib for - dynaloading. + * config_h.in: Added defines for constants used to locate the + core oplib's init function, and the core_prederef oplib for + dynaloading. - * core.ops: Added a VERSION = 0.3 line near the top. This is now - required by Parrot/OpsFile.pm. + * core.ops: Added a VERSION = 0.3 line near the top. This is now + required by Parrot/OpsFile.pm. - * interpreter.c: + * interpreter.c: - * Added init_prederef() and stop_prederef() functions to load - and unload the core_prederef oplib when we are in prederef - mode. + * Added init_prederef() and stop_prederef() functions to load + and unload the core_prederef oplib when we are in prederef + mode. - NOTE: In all likelihood, the prederef stuff has a rapidly - dwindling time-to-live. The JIT should provide vastly - superior - performance, and loading an alternate set of core_ops isn't - the real direction for the dynaloading stuff. Loading - *additional* ops is. It does provide a handy test case for - the - general idea for now, though. + NOTE: In all likelihood, the prederef stuff has a rapidly + dwindling time-to-live. The JIT should provide vastly + superior + performance, and loading an alternate set of core_ops isn't + the real direction for the dynaloading stuff. Loading + *additional* ops is. It does provide a handy test case for + the + general idea for now, though. - * Gets the core copcode table, etc. via the core oplibs oplib - info pointer, as returned by the core oplib's init - function. + * Gets the core copcode table, etc. via the core oplibs oplib + info pointer, as returned by the core oplib's init + function. - * ops2c.pl + * ops2c.pl - * Make use of the version, major version and minor version - stuff parsed by Parrot/OpsFile.pm + * Make use of the version, major version and minor version + stuff parsed by Parrot/OpsFile.pm - * The only exported symbol in the generated files is the init - function now, since that returns an oplib info struct - pointer, and all the important stuff can be found there. + * The only exported symbol in the generated files is the init + function now, since that returns an oplib info struct + pointer, and all the important stuff can be found there. - * ops2pm.pl: Put the oplib version in the generated .pm file. + * ops2pm.pl: Put the oplib version in the generated .pm file. - * test_main.c: Small changes necessitated by changes in the names - of some members of the interpreter struct. + * test_main.c: Small changes necessitated by changes in the names + of some members of the interpreter struct. - * trace.c: Small changes necessitated by changes in the names - of some members of the interpreter struct. + * trace.c: Small changes necessitated by changes in the names + of some members of the interpreter struct. - * Parrot/OpsFile.pm: Require a "VERSION = x.y" line before any - ops are found. + * Parrot/OpsFile.pm: Require a "VERSION = x.y" line before any + ops are found. - * include/parrot/interp_guts.h: Small changes necessitated by - changes in the names of some members of the interpreter struct. + * include/parrot/interp_guts.h: Small changes necessitated by + changes in the names of some members of the interpreter struct. - * include/parrot/interpreter.h: Include the new - include/parrot/oplib.h header. Small changes to the oplib- - related members. + * include/parrot/interpreter.h: Include the new + include/parrot/oplib.h header. Small changes to the oplib- + related members. - * include/parrot/oplib.h: Define the type of the oplib init - function, and the struct type for the oplib info. + * include/parrot/oplib.h: Define the type of the oplib init + function, and the struct type for the oplib info. - * platforms/*.[hc]: Remove the second argument to Parrot_dlopen() - since not all platforms have it. For those that do, a default - second argument is provided. + * platforms/*.[hc]: Remove the second argument to Parrot_dlopen() + since not all platforms have it. For those that do, a default + second argument is provided. 2001-12-26 05:12 gregor - * Configure.pl: - Make jitarch calculation not get tripped up by extra components to - archname. + * Configure.pl: + Make jitarch calculation not get tripped up by extra components to + archname. 2001-12-24 21:23 gregor - * jit.c, jit2h.pl, Parrot/Jit/i386-bsd.pm, - Parrot/Jit/i386-linux.pm, Parrot/Jit/i386-nojit.pm, - include/parrot/jit.h, jit/i386/core.jit, jit/i386/lib.jit, - jit/i386/string.jit, lib/Parrot/Jit/i386-bsd.pm, - lib/Parrot/Jit/i386-linux.pm, lib/Parrot/Jit/i386-nojit.pm: - Some more JIT work from Daniel Grunblatt. + * jit.c, jit2h.pl, Parrot/Jit/i386-bsd.pm, + Parrot/Jit/i386-linux.pm, Parrot/Jit/i386-nojit.pm, + include/parrot/jit.h, jit/i386/core.jit, jit/i386/lib.jit, + jit/i386/string.jit, lib/Parrot/Jit/i386-bsd.pm, + lib/Parrot/Jit/i386-linux.pm, lib/Parrot/Jit/i386-nojit.pm: + Some more JIT work from Daniel Grunblatt. - * Ops added set_s_s, set_s_sc, bsr_i and eq_s_sc but using calls - to C - functions. + * Ops added set_s_s, set_s_sc, bsr_i and eq_s_sc but using calls + to C + functions. - * Added JUMP(END) to place the number of bytes to the end of the - current - op. + * Added JUMP(END) to place the number of bytes to the end of the + current + op. - * The *.jit files syntax changed. + * The *.jit files syntax changed. - * Added jit/i386/lib.jit to place handly functions as jump that - take as - argument the address where is the opcode number to jump to. + * Added jit/i386/lib.jit to place handly functions as jump that + take as + argument the address where is the opcode number to jump to. - * There is a bug at some point, but I will start writing - jit/i386/string.jit and jit/i386/stacks.jit so that we don't - have use - calls, which make the jit as slow as the interpreter. + * There is a bug at some point, but I will start writing + jit/i386/string.jit and jit/i386/stacks.jit so that we don't + have use + calls, which make the jit as slow as the interpreter. - Courtesy of: Daniel Grunblatt + Courtesy of: Daniel Grunblatt 2001-12-24 03:46 dan - * Parrot/OpTrans.pm, Parrot/OpTrans/C.pm, Parrot/OpTrans/CGoto.pm, - Parrot/OpTrans/CPrederef.pm, lib/Parrot/OpTrans.pm, - lib/Parrot/OpTrans/C.pm, lib/Parrot/OpTrans/CGoto.pm, - lib/Parrot/OpTrans/CPrederef.pm: Commented out the use warnings. - Perls before 5.6.0 don't like it. + * Parrot/OpTrans.pm, Parrot/OpTrans/C.pm, Parrot/OpTrans/CGoto.pm, + Parrot/OpTrans/CPrederef.pm, lib/Parrot/OpTrans.pm, + lib/Parrot/OpTrans/C.pm, lib/Parrot/OpTrans/CGoto.pm, + lib/Parrot/OpTrans/CPrederef.pm: Commented out the use warnings. + Perls before 5.6.0 don't like it. 2001-12-22 16:02 ajgough - * t/op/stacks.t: stopped skipping tests we can run now. added - clonep tests. + * t/op/stacks.t: stopped skipping tests we can run now. added + clonep tests. 2001-12-21 21:13 gregor - * jit2h.pl, Parrot/Jit/i386-bsd.pm, Parrot/Jit/i386-linux.pm, - Parrot/Jit/i386-nojit.pm, lib/Parrot/Jit/i386-bsd.pm, - lib/Parrot/Jit/i386-linux.pm, lib/Parrot/Jit/i386-nojit.pm: - Fixed some package name goofs. + * jit2h.pl, Parrot/Jit/i386-bsd.pm, Parrot/Jit/i386-linux.pm, + Parrot/Jit/i386-nojit.pm, lib/Parrot/Jit/i386-bsd.pm, + lib/Parrot/Jit/i386-linux.pm, lib/Parrot/Jit/i386-nojit.pm: + Fixed some package name goofs. - Thanks to: Andy Dougherty + Thanks to: Andy Dougherty 2001-12-21 19:32 gregor - * MANIFEST, Makefile.in, core.ops, interpreter.c, - make_vtable_ops.pl, obscure.ops, ops2c-prederef.pl, ops2c.pl, - pbc2c.pl, stacks.c, Parrot/Op.pm, Parrot/OpTrans.pm, - Parrot/Opcode.pm, Parrot/OpsFile.pm, lib/Parrot/Op.pm, - lib/Parrot/OpTrans.pm, lib/Parrot/Opcode.pm, lib/Parrot/OpsFile.pm, - Parrot/OpTrans/C.pm, Parrot/OpTrans/CGoto.pm, - Parrot/OpTrans/CPrederef.pm, docs/intro.pod, include/parrot/op.h, - include/parrot/stacks.h, lib/Parrot/OpTrans/C.pm, - lib/Parrot/OpTrans/CGoto.pm, lib/Parrot/OpTrans/CPrederef.pm: - Changes to syntax of .ops files and refactoring of ops2c*.pl and - pbc2c.pl. + * MANIFEST, Makefile.in, core.ops, interpreter.c, + make_vtable_ops.pl, obscure.ops, ops2c-prederef.pl, ops2c.pl, + pbc2c.pl, stacks.c, Parrot/Op.pm, Parrot/OpTrans.pm, + Parrot/Opcode.pm, Parrot/OpsFile.pm, lib/Parrot/Op.pm, + lib/Parrot/OpTrans.pm, lib/Parrot/Opcode.pm, lib/Parrot/OpsFile.pm, + Parrot/OpTrans/C.pm, Parrot/OpTrans/CGoto.pm, + Parrot/OpTrans/CPrederef.pm, docs/intro.pod, include/parrot/op.h, + include/parrot/stacks.h, lib/Parrot/OpTrans/C.pm, + lib/Parrot/OpTrans/CGoto.pm, lib/Parrot/OpTrans/CPrederef.pm: + Changes to syntax of .ops files and refactoring of ops2c*.pl and + pbc2c.pl. - * Removed ops2c-prederef.pl + * Removed ops2c-prederef.pl - * (unrelated) Removed vestigial Parrot/Opcode.pm file. + * (unrelated) Removed vestigial Parrot/Opcode.pm file. - * Added Parrot/OpTrans.pm, Parrot/OpTrans/C.pm (needed for old - functionality of ops2c.pl), Parrot/OpTrans/CPrederef.pm (needed - for old functionality of ops2c-prederef.pl), and - Parrot/OpTrans/CGoto.pm (needed for functionality of pbc2c.pl). + * Added Parrot/OpTrans.pm, Parrot/OpTrans/C.pm (needed for old + functionality of ops2c.pl), Parrot/OpTrans/CPrederef.pm (needed + for old functionality of ops2c-prederef.pl), and + Parrot/OpTrans/CGoto.pm (needed for functionality of pbc2c.pl). - "OpTrans" == "Op Transformation" + "OpTrans" == "Op Transformation" - * Makefile.in modifications to call "ops2c.pl C" where it used - to be just "ops2c.pl", and "ops2c.pl CPrederef" where it used - to be "ops2c-prederef.pl". + * Makefile.in modifications to call "ops2c.pl C" where it used + to be just "ops2c.pl", and "ops2c.pl CPrederef" where it used + to be "ops2c-prederef.pl". - * core.ops and obscure.ops changes to syntax. Semantics are - identical with previous version: + * core.ops and obscure.ops changes to syntax. Semantics are + identical with previous version: - return HALT --> HALT() - return AUTO --> goto NEXT() - return RETREL(...) --> goto OFFSET(...) - return RESTART(*) --> restart NEXT() + return HALT --> HALT() + return AUTO --> goto NEXT() + return RETREL(...) --> goto OFFSET(...) + return RESTART(*) --> restart NEXT() - Also, pop_generic_entry() stuff (local var + 5 lines of code) - for dest-less branch ops replaced with new notation "goto - POP()", - which uses the new pop_dest() function in stacks.c. This also - allowed these ops to become 'inline' ops, since they no longer - have local variables. + Also, pop_generic_entry() stuff (local var + 5 lines of code) + for dest-less branch ops replaced with new notation "goto + POP()", + which uses the new pop_dest() function in stacks.c. This also + allowed these ops to become 'inline' ops, since they no longer + have local variables. - The 'ret' op also became simplified to just "goto POP()", and - also became an inline op. + The 'ret' op also became simplified to just "goto POP()", and + also became an inline op. - * interpreter.c reflects the change in type name: + * interpreter.c reflects the change in type name: - prederef_op_func_t --> op_func_prederef_t + prederef_op_func_t --> op_func_prederef_t - that occurred in include/parrot/op.h + that occurred in include/parrot/op.h - * make_vtable_ops.pl uses "goto NEXT()" where it used to use - "return AUTO". + * make_vtable_ops.pl uses "goto NEXT()" where it used to use + "return AUTO". - * ops2c.pl is now generic. Its first argument is the last - package name component of a subclass of Parrot::OpTrans. These - subclasses all have full names of the form Parrot::OpTrans::*. - An instance of the class is created and later consulted for - various bits of information needed to generate the C code. + * ops2c.pl is now generic. Its first argument is the last + package name component of a subclass of Parrot::OpTrans. These + subclasses all have full names of the form Parrot::OpTrans::*. + An instance of the class is created and later consulted for + various bits of information needed to generate the C code. - * pbc2c.pl now uses an instance of Parrot::OpTrans::CGoto to - contain its transformation rules. + * pbc2c.pl now uses an instance of Parrot::OpTrans::CGoto to + contain its transformation rules. - * stacks.c has a new function pop_dest() that pops a destination - off the control stack. include/parrot/stacks.h has the - prototype. + * stacks.c has a new function pop_dest() that pops a destination + off the control stack. include/parrot/stacks.h has the + prototype. - * Parrot/Op.pm now supports the syntax generated by - Parrot::OpsFile - for the "goto POP" case. + * Parrot/Op.pm now supports the syntax generated by + Parrot::OpsFile + for the "goto POP" case. - Also, the source() method now expects its second argument to be - an object that ISA Parrot::OpTrans. Methods of this object are - called to perform the substitutions. + Also, the source() method now expects its second argument to be + an object that ISA Parrot::OpTrans. Methods of this object are + called to perform the substitutions. - * Parrot/OpsFile.pm supports the change in notation mentioned - above. + * Parrot/OpsFile.pm supports the change in notation mentioned + above. - * docs/intro.pod reflects these changes. + * docs/intro.pod reflects these changes. - * include/parrot/op.h: Renamed type prederef_op_func_t to - op_func_prederef_t because it made the implementation of the - shared ops2c.pl easier. + * include/parrot/op.h: Renamed type prederef_op_func_t to + op_func_prederef_t because it made the implementation of the + shared ops2c.pl easier. 2001-12-21 13:47 gregor - * Configure.pl, config_h.in, interpreter.c, test_main.c: - Both test_parrot (via test_main.c) and the intepreter itself (via - interpreter.c) use the JIT_CAPABLE config to decide whether to - actually attempt JIT operation, or to complain. + * Configure.pl, config_h.in, interpreter.c, test_main.c: + Both test_parrot (via test_main.c) and the intepreter itself (via + interpreter.c) use the JIT_CAPABLE config to decide whether to + actually attempt JIT operation, or to complain. 2001-12-20 23:25 gregor - * core.ops, make_vtable_ops.pl, obscure.ops, Parrot/OpsFile.pm, - lib/Parrot/OpsFile.pm, docs/intro.pod, include/parrot/op.h: - Changes to the format of *.ops files. An attempt to provide hints - for future opfunc processing logic that wants to know if an opfunc - is simple enough to JIT (e.g.) inline, or not. + * core.ops, make_vtable_ops.pl, obscure.ops, Parrot/OpsFile.pm, + lib/Parrot/OpsFile.pm, docs/intro.pod, include/parrot/op.h: + Changes to the format of *.ops files. An attempt to provide hints + for future opfunc processing logic that wants to know if an opfunc + is simple enough to JIT (e.g.) inline, or not. - See the POD in Parrot/OpsFile.pm and the updated docs/intro.pod in - addition to The Source in core.ops and Parrot/OpsFile.pm for more - info. + See the POD in Parrot/OpsFile.pm and the updated docs/intro.pod in + addition to The Source in core.ops and Parrot/OpsFile.pm for more + info. 2001-12-20 21:28 gregor - * Configure.pl, jit.c, jit2h.pl, include/parrot/jit.h, - jit/i386/core.jit: - More JIT stuff: + * Configure.pl, jit.c, jit2h.pl, include/parrot/jit.h, + jit/i386/core.jit: + More JIT stuff: - * A fix to Gregor's last Configure.pl update. + * A fix to Gregor's last Configure.pl update. - * Remove the need for hardcoded "\n" at the end of the "%f" - format for printing floating-point numbers. + * Remove the need for hardcoded "\n" at the end of the "%f" + format for printing floating-point numbers. - * New, improved *.jit syntax for references to registers, - e.g. INT_REG[n]. + * New, improved *.jit syntax for references to registers, + e.g. INT_REG[n]. - * Support for C() improved. + * Support for C() improved. - Courtesy of: Daniel Grunblatt + Courtesy of: Daniel Grunblatt 2001-12-20 16:55 dan - * MANIFEST: Added jit.c to the manifest. + * MANIFEST: Added jit.c to the manifest. 2001-12-20 15:24 simon - * jit2h.pl: - Off-by-one error fixed. + * jit2h.pl: + Off-by-one error fixed. 2001-12-20 14:18 simon - * jit/i386/core.jit: - Just a noop. It's the only machine code I know. + * jit/i386/core.jit: + Just a noop. It's the only machine code I know. 2001-12-20 13:10 gregor - * Configure.pl, Makefile.in, jit2h.pl: - Attempt to fix Win32 builds. + * Configure.pl, Makefile.in, jit2h.pl: + Attempt to fix Win32 builds. - * No more empty braces in include/parrot/jit_struct.h + * No more empty braces in include/parrot/jit_struct.h - Also: + Also: - * ${jitarchname} has the *bsd -> bsd substitution on it, but - ${archname} - does not. + * ${jitarchname} has the *bsd -> bsd substitution on it, but + ${archname} + does not. 2001-12-20 11:56 simon - * Makefile.in: - De-cp + * Makefile.in: + De-cp 2001-12-20 01:57 gregor - * Configure.pl, MANIFEST, Makefile.in, interpreter.c, jit.c, - jit2h.pl, test_main.c, Parrot/.cvsignore, Parrot/Jit/i386-bsd.pm, - Parrot/Jit/i386-linux.pm, Parrot/Jit/i386-nojit.pm, docs/jit.pod, - include/parrot/.cvsignore, include/parrot/interpreter.h, - include/parrot/jit.h, jit/i386/core.jit, jit/i386/string.jit, - lib/Parrot/Jit/i386-bsd.pm, lib/Parrot/Jit/i386-linux.pm, - lib/Parrot/Jit/i386-nojit.pm: - Initial JIT implementation. + * Configure.pl, MANIFEST, Makefile.in, interpreter.c, jit.c, + jit2h.pl, test_main.c, Parrot/.cvsignore, Parrot/Jit/i386-bsd.pm, + Parrot/Jit/i386-linux.pm, Parrot/Jit/i386-nojit.pm, docs/jit.pod, + include/parrot/.cvsignore, include/parrot/interpreter.h, + include/parrot/jit.h, jit/i386/core.jit, jit/i386/string.jit, + lib/Parrot/Jit/i386-bsd.pm, lib/Parrot/Jit/i386-linux.pm, + lib/Parrot/Jit/i386-nojit.pm: + Initial JIT implementation. - * Enabled with test_parrot -j. 20x speed boosts seen. + * Enabled with test_parrot -j. 20x speed boosts seen. - * Unsupported archs mapped to i386-nojit. Don't do -j on them. + * Unsupported archs mapped to i386-nojit. Don't do -j on them. - * More to come. + * More to come. - Courtesy of: Daniel Grunblatt + Courtesy of: Daniel Grunblatt 2001-12-20 01:53 jgoff - * MANIFEST, core.ops, t/op/key.t: MANIFEST - Removed t/op/key.t - core.ops - Removed key operators, they should be hidden from the - assembler. t/op/key.t - No need to test the nonexistent key - operators. + * MANIFEST, core.ops, t/op/key.t: MANIFEST - Removed t/op/key.t + core.ops - Removed key operators, they should be hidden from the + assembler. t/op/key.t - No need to test the nonexistent key + operators. 2001-12-20 00:13 ajgough - * core.ops, t/op/stacks.t: Added tests for entrytype op, noticed - that asking for type of entry at depth causes segfault as stack is - zero based, fixed cmp in core.ops to reflect this. Last test is - skipped as we don't do exceptions right yet. + * core.ops, t/op/stacks.t: Added tests for entrytype op, noticed + that asking for type of entry at depth causes segfault as stack is + zero based, fixed cmp in core.ops to reflect this. Last test is + skipped as we don't do exceptions right yet. 2001-12-19 19:11 ajgough - * t/op/debuginfo.t: Added C ops to debuginfo.t, as thier - non-being was causing Irix "issues". + * t/op/debuginfo.t: Added C ops to debuginfo.t, as thier + non-being was causing Irix "issues". 2001-12-19 03:37 jgoff - * languages/miniperl/Miniperl/t/: 001_tokenizer.t, 003_generator.t, - 004_combined.t: Changed tests to make sure they pass with the - addition of the clone operator. + * languages/miniperl/Miniperl/t/: 001_tokenizer.t, 003_generator.t, + 004_combined.t: Changed tests to make sure they pass with the + addition of the clone operator. 2001-12-18 20:06 gregor - * interpreter.c, include/parrot/interp_guts.h: - Performance improvements to the predereferencing code path - suggested to me over lunch yesterday by my friend John Kennedy. - The goal is to remove the additional test in the inner loop that - was checking for NULL to decide whether or not to call the - prederef() function. Also moved pc & pc_prederef syncing outside - the inner loop. + * interpreter.c, include/parrot/interp_guts.h: + Performance improvements to the predereferencing code path + suggested to me over lunch yesterday by my friend John Kennedy. + The goal is to remove the additional test in the inner loop that + was checking for NULL to decide whether or not to call the + prederef() function. Also moved pc & pc_prederef syncing outside + the inner loop. - * Changed the prototype of the prederef() function in - interpreter.c to match that of an opfunc. + * Changed the prototype of the prederef() function in + interpreter.c to match that of an opfunc. - * Instead of initializing the prederef void * array with NULL, - we initialize it with pointers to prederef(). + * Instead of initializing the prederef void * array with NULL, + we initialize it with pointers to prederef(). - * prederef() now returns the prederef_pc passed in, so that - after predereferencing, the same location is executed, but now - with the real code being called. + * prederef() now returns the prederef_pc passed in, so that + after predereferencing, the same location is executed, but now + with the real code being called. - Thanks to: John Kennedy + Thanks to: John Kennedy 2001-12-18 19:59 ajgough - * t/: op/pmc.t, pmc/pmc.t: Added some more num -> string tests - (including some more in the skipped string -> int tests). + * t/: op/pmc.t, pmc/pmc.t: Added some more num -> string tests + (including some more in the skipped string -> int tests). 2001-12-18 07:06 jgoff - * MANIFEST: Forgot to add classes/perlarray.pmc + * MANIFEST: Forgot to add classes/perlarray.pmc 2001-12-18 07:05 jgoff - * Makefile.in, core.ops, global_setup.c, vtable.tbl, - classes/Makefile.in, classes/default.pmc, classes/perlarray.pmc, - classes/perlint.pmc, classes/perlnum.pmc, classes/perlstring.pmc, - classes/perlundef.pmc, include/parrot/pmc.h, t/op/pmc.t, - t/pmc/pmc.t: Big update... Makefile.in - Added - classes/perlarray.pmc core.ops - Added new series of set() ops for - arrays global_setup.c - Initialized perlarray classes/Makefile.in - - Added perlarray.pmc classes/*.pmc - Added - set_{integer,number,string}_index and - get_{integer,number,string}_index include/parrot/pmc.h - Added new - type t/op/pmc.t - Added basic array test + * Makefile.in, core.ops, global_setup.c, vtable.tbl, + classes/Makefile.in, classes/default.pmc, classes/perlarray.pmc, + classes/perlint.pmc, classes/perlnum.pmc, classes/perlstring.pmc, + classes/perlundef.pmc, include/parrot/pmc.h, t/op/pmc.t, + t/pmc/pmc.t: Big update... Makefile.in - Added + classes/perlarray.pmc core.ops - Added new series of set() ops for + arrays global_setup.c - Initialized perlarray classes/Makefile.in - + Added perlarray.pmc classes/*.pmc - Added + set_{integer,number,string}_index and + get_{integer,number,string}_index include/parrot/pmc.h - Added new + type t/op/pmc.t - Added basic array test - classes/perlarray.pmc - Added + classes/perlarray.pmc - Added 2001-12-17 05:29 jgoff - * languages/miniperl/Miniperl/Generator.pm: Altered miniperl code - generator to use clone operator instead of set Px,Py + * languages/miniperl/Miniperl/Generator.pm: Altered miniperl code + generator to use clone operator instead of set Px,Py 2001-12-17 05:25 jgoff - * core.ops, classes/perlint.pmc, classes/perlnum.pmc, - classes/perlstring.pmc, t/op/pmc.t, t/pmc/pmc.t: Added clone - PMC,PMC operator. Uses the clone() vtable entries. + * core.ops, classes/perlint.pmc, classes/perlnum.pmc, + classes/perlstring.pmc, t/op/pmc.t, t/pmc/pmc.t: Added clone + PMC,PMC operator. Uses the clone() vtable entries. 2001-12-17 04:51 jgoff - * MANIFEST: Added miniperl test suite, removed old Miniperl/Test.pm - entry + * MANIFEST: Added miniperl test suite, removed old Miniperl/Test.pm + entry 2001-12-17 04:41 jgoff - * languages/miniperl/Miniperl/Makefile.PL: Now in its proper - directory... + * languages/miniperl/Miniperl/Makefile.PL: Now in its proper + directory... 2001-12-17 04:41 jgoff - * languages/miniperl/Makefile.PL: Moved it to the proper directory. + * languages/miniperl/Makefile.PL: Moved it to the proper directory. 2001-12-17 04:39 jgoff - * languages/miniperl/: Makefile.PL, Miniperl.pm, miniperlc, mpc, - Miniperl/Tokenizer.pm: Makefile.PL to let us run the test suite in - t/ + * languages/miniperl/: Makefile.PL, Miniperl.pm, miniperlc, mpc, + Miniperl/Tokenizer.pm: Makefile.PL to let us run the test suite in + t/ 2001-12-17 04:27 jgoff - * languages/miniperl/Miniperl.pm: Latest version of the driver. - Admittedly it's a little thin on true OO, but the algorithms are - the key. + * languages/miniperl/Miniperl.pm: Latest version of the driver. + Admittedly it's a little thin on true OO, but the algorithms are + the key. 2001-12-17 04:24 jgoff - * languages/miniperl/Miniperl/t/: 001_tokenizer.t, 002_parser.t, - 003_generator.t, 004_combined.t: Much more comprehensive test suite - for the codegen et al + * languages/miniperl/Miniperl/t/: 001_tokenizer.t, 002_parser.t, + 003_generator.t, 004_combined.t: Much more comprehensive test suite + for the codegen et al 2001-12-17 04:22 jgoff - * languages/miniperl/Miniperl/: Generator.pm, Parser.pm, - Tokenizer.pm: Newer codegen, tightened up parser output, added hash - key handling + * languages/miniperl/Miniperl/: Generator.pm, Parser.pm, + Tokenizer.pm: Newer codegen, tightened up parser output, added hash + key handling 2001-12-17 04:20 jgoff - * languages/miniperl/Miniperl/Test.pm: The newer test suite is much - more comprehensive. + * languages/miniperl/Miniperl/Test.pm: The newer test suite is much + more comprehensive. 2001-12-17 04:17 jgoff - * languages/miniperl/foo.mpl: Test file that'll be outdated by - changes to the new compiler + * languages/miniperl/foo.mpl: Test file that'll be outdated by + changes to the new compiler 2001-12-17 04:11 jgoff - * languages/miniperl/t/: harness, 001_basic/basic.t: Moving testing - files to Miniperl/ + * languages/miniperl/t/: harness, 001_basic/basic.t: Moving testing + files to Miniperl/ 2001-12-16 14:11 simon - * classes/perlint.pmc, examples/assembly/mops_p.pasm, t/op/pmc.t, - t/pmc/pmc.t: - Fix bogus assumption that multiplying an integer by an integer - yields an integer. + * classes/perlint.pmc, examples/assembly/mops_p.pasm, t/op/pmc.t, + t/pmc/pmc.t: + Fix bogus assumption that multiplying an integer by an integer + yields an integer. 2001-12-16 12:48 simon - * make_vtable_ops.pl: - Fixed op exploder. + * make_vtable_ops.pl: + Fixed op exploder. 2001-12-16 12:45 simon - * make_vtable_ops.pl, Parrot/Vtable.pm, lib/Parrot/Vtable.pm: - Expand multimethod vtable ops. + * make_vtable_ops.pl, Parrot/Vtable.pm, lib/Parrot/Vtable.pm: + Expand multimethod vtable ops. 2001-12-16 12:04 simon - * Makefile.in: - Added 'cvsclean' which doesn't zap CVS/* directories. + * Makefile.in: + Added 'cvsclean' which doesn't zap CVS/* directories. 2001-12-15 01:50 dan - * include/parrot/string.h: Fixed typo in string.h. lagnuage, - indeed! + * include/parrot/string.h: Fixed typo in string.h. lagnuage, + indeed! - Thanks to grunblatt fom #parrot for the catch + Thanks to grunblatt fom #parrot for the catch 2001-12-15 01:39 dan - * .cvsignore, Configure.pl, MANIFEST, languages/jako/Makefile.in, - languages/miniperl/.cvsignore, languages/miniperl/Makefile, - languages/miniperl/Makefile.in, - languages/miniperl/Miniperl/Test.pm, languages/scheme/.cvsignore, - languages/scheme/Makefile, languages/scheme/Makefile.in: Build - tweaks. + * .cvsignore, Configure.pl, MANIFEST, languages/jako/Makefile.in, + languages/miniperl/.cvsignore, languages/miniperl/Makefile, + languages/miniperl/Makefile.in, + languages/miniperl/Miniperl/Test.pm, languages/scheme/.cvsignore, + languages/scheme/Makefile, languages/scheme/Makefile.in: Build + tweaks. - Courtesy of: Jay McCarthy + Courtesy of: Jay McCarthy 2001-12-14 17:39 dan - * t/op/trans.t: More trans tests. + * t/op/trans.t: More trans tests. - Courtesy of: Simon Glover + Courtesy of: Simon Glover 2001-12-14 07:41 robert - * make.pl: - define MAKE macro - topological sort and subgraph - order - start of timestamp stuff (still badly broken) + * make.pl: - define MAKE macro - topological sort and subgraph + order - start of timestamp stuff (still badly broken) 2001-12-14 06:06 jgoff - * optimizer.pl: Hopefully this should do the trick.. + * optimizer.pl: Hopefully this should do the trick.. 2001-12-14 06:04 jgoff - * Parrot/Optimizer.pm, lib/Parrot/Optimizer.pm: Optimizer + * Parrot/Optimizer.pm, lib/Parrot/Optimizer.pm: Optimizer - optimizer.pl is the stub, Parrot/Optimizer.pm is the driver. + optimizer.pl is the stub, Parrot/Optimizer.pm is the driver. - The optimizer performs its work on a file post-macro expansion. - Run it on a .pasm file, preferably with some trivially reducible - operations - like 'add I0,5,-6' or 'mul I0,I1,0' + The optimizer performs its work on a file post-macro expansion. + Run it on a .pasm file, preferably with some trivially reducible + operations + like 'add I0,5,-6' or 'mul I0,I1,0' 2001-12-14 05:48 robert - * Makefile.in: case error EXE -> exe + * Makefile.in: case error EXE -> exe 2001-12-14 05:42 robert - * Makefile.in: remove legacy PDISASM macro + * Makefile.in: remove legacy PDISASM macro 2001-12-14 04:01 dan - * classes/Makefile.in, languages/Makefile.in: Makefile tweaks for - better Win building + * classes/Makefile.in, languages/Makefile.in: Makefile tweaks for + better Win building - Courtesy of: Garrett Goebel + Courtesy of: Garrett Goebel 2001-12-13 22:03 dan - * Configure.pl, Makefile.in, Parrot/Test.pm, - languages/scheme/Makefile, languages/scheme/Scheme/Test.pm, - lib/Parrot/Test.pm: Parrot test prog's now a config variable, so we - can change it without having to change the world. + * Configure.pl, Makefile.in, Parrot/Test.pm, + languages/scheme/Makefile, languages/scheme/Scheme/Test.pm, + lib/Parrot/Test.pm: Parrot test prog's now a config variable, so we + can change it without having to change the world. 2001-12-13 21:57 dan - * core.ops, interpreter.c, docs/parrot_assembly.pod, - include/parrot/interpreter.h, t/op/debuginfo.t: Added current - file/line/package to interp structure, with ops to get and set - them. Now we can know where we are! + * core.ops, interpreter.c, docs/parrot_assembly.pod, + include/parrot/interpreter.h, t/op/debuginfo.t: Added current + file/line/package to interp structure, with ops to get and set + them. Now we can know where we are! 2001-12-13 19:43 dan - * Configure.pl, Makefile.in: Makefile tweaks to hopefully make - WinXP builds work out of the box + * Configure.pl, Makefile.in: Makefile tweaks to hopefully make + WinXP builds work out of the box 2001-12-13 17:05 dan - * Makefile.in, Parrot/Test.pm, lib/Parrot/Test.pm: Change test prog - name again--makes case-insensitive systems much happier. + * Makefile.in, Parrot/Test.pm, lib/Parrot/Test.pm: Change test prog + name again--makes case-insensitive systems much happier. 2001-12-13 16:21 dan - * core.ops, key.c, string.c, test_main.c, trace.c, - classes/Makefile.in, include/parrot/trace.h: Fixes to clean up - compiler warnings + * core.ops, key.c, string.c, test_main.c, trace.c, + classes/Makefile.in, include/parrot/trace.h: Fixes to clean up + compiler warnings - Courtesy of: Josh Wilmes + Courtesy of: Josh Wilmes 2001-12-13 13:33 gregor - * languages/jako/Makefile.in: - Improved the method of calling the assembler. + * languages/jako/Makefile.in: + Improved the method of calling the assembler. 2001-12-13 13:30 gregor - * languages/jako/Makefile.in: - Improve the build process. It now works from the main parrot dir, - and from the languages/jako directory. Now uses the .SUFFIXES - target and generic build rules to reduce clutter in the - Makefile.in. + * languages/jako/Makefile.in: + Improve the build process. It now works from the main parrot dir, + and from the languages/jako directory. Now uses the .SUFFIXES + target and generic build rules to reduce clutter in the + Makefile.in. 2001-12-13 13:29 gregor - * languages/jako/.cvsignore: - Ignore the (now generated Makefile), and don't ignore .list files - anymore, since we aren't generating them. + * languages/jako/.cvsignore: + Ignore the (now generated Makefile), and don't ignore .list files + anymore, since we aren't generating them. 2001-12-13 13:11 gregor - * Configure.pl, MANIFEST, Makefile.in, languages/.cvsignore, - languages/Makefile.in, languages/jako/Makefile, - languages/jako/Makefile.in: - Added a 'languages' target to the top-level Makefile.in, and - modified the jako build procedure to involve Makefile.in --> - Makefile too (done by Configure.pl). + * Configure.pl, MANIFEST, Makefile.in, languages/.cvsignore, + languages/Makefile.in, languages/jako/Makefile, + languages/jako/Makefile.in: + Added a 'languages' target to the top-level Makefile.in, and + modified the jako build procedure to involve Makefile.in --> + Makefile too (done by Configure.pl). - NOTE: languages/jako and language/scheme are built. - languages/miniperl wasn't building right, so it was left off for - now. + NOTE: languages/jako and language/scheme are built. + languages/miniperl wasn't building right, so it was left off for + now. 2001-12-13 12:15 gregor - * MANIFEST: - Added MAINTAINER file and mandelzoom.jako from languages/jako to - the MANIFEST. + * MANIFEST: + Added MAINTAINER file and mandelzoom.jako from languages/jako to + the MANIFEST. 2001-12-13 12:12 gregor - * .cvsignore, MANIFEST, Makefile.in, core.ops, interpreter.c, - ops2c-prederef.pl, ops2c.pl, test_main.c, - include/parrot/interp_guts.h, include/parrot/interpreter.h, - include/parrot/op.h, include/parrot/oplib/.cvsignore: - Welcome to the Just-in-Time Predereferencing Patch! - - This patch implements a "predereferencing" mode for parrot. That - means that a lot of the dereferencing you see in DO_OP and in the - opfuncs is done up front (really, JIT) rather than as and each time - we execute each op in the byte code stream. - - This works by creating an array of void pointers with the same - number of elements as the byte code array. This array starts out - life zero-initialized. Each time we go to execute an op, we check - first to see if we have a NULL pointer at *cur_opcode. If so, we - know we haven't done our predereferencing yet (this is the JIT - part), so we call the prederef() function with sufficient args that - it can go look up opfunc pointers and op arg types and put the - opfunc and arg pointers at cur_opcode[0] .. cur_opcode[N - 1], - where N is the number of args (counting the op itself as one arg). - - We assume that sizeof(INTVAL) <= sizeof(void *), so we can continue - to have inline INTVAL constants. - - I've been getting about a 22% speed increase over vanilla code path - when I compile with -O0. Advantage decreases at -O9 here. I tested - with mops.pbc, and also by temporarily putting the -P flag in - Parrot/Test.pm and running all the tests. So, this code is as - correct as the test suite can detect. - - Here's how it plays out in the code: - - * New script ops2c-prederef.pl - - Copy-paste code reuse from ops2c.pl. Modified to expect the - args to give - a void ** cur_opcode and to return a void **. + * .cvsignore, MANIFEST, Makefile.in, core.ops, interpreter.c, + ops2c-prederef.pl, ops2c.pl, test_main.c, + include/parrot/interp_guts.h, include/parrot/interpreter.h, + include/parrot/op.h, include/parrot/oplib/.cvsignore: + Welcome to the Just-in-Time Predereferencing Patch! + + This patch implements a "predereferencing" mode for parrot. That + means that a lot of the dereferencing you see in DO_OP and in the + opfuncs is done up front (really, JIT) rather than as and each time + we execute each op in the byte code stream. + + This works by creating an array of void pointers with the same + number of elements as the byte code array. This array starts out + life zero-initialized. Each time we go to execute an op, we check + first to see if we have a NULL pointer at *cur_opcode. If so, we + know we haven't done our predereferencing yet (this is the JIT + part), so we call the prederef() function with sufficient args that + it can go look up opfunc pointers and op arg types and put the + opfunc and arg pointers at cur_opcode[0] .. cur_opcode[N - 1], + where N is the number of args (counting the op itself as one arg). + + We assume that sizeof(INTVAL) <= sizeof(void *), so we can continue + to have inline INTVAL constants. + + I've been getting about a 22% speed increase over vanilla code path + when I compile with -O0. Advantage decreases at -O9 here. I tested + with mops.pbc, and also by temporarily putting the -P flag in + Parrot/Test.pm and running all the tests. So, this code is as + correct as the test suite can detect. + + Here's how it plays out in the code: + + * New script ops2c-prederef.pl + + Copy-paste code reuse from ops2c.pl. Modified to expect the + args to give + a void ** cur_opcode and to return a void **. - * Modified ops2c.pl + * Modified ops2c.pl - * opfuncs are now static. Who needs to call them by name from - outside, - anyway? They are accessed via the opfunc table. + * opfuncs are now static. Who needs to call them by name from + outside, + anyway? They are accessed via the opfunc table. - * Some MACRO stuff to make things work whether we prederef or - not. It - may be possible to get rid of these some day if other folks - agree - that we should be using CODE object pointers + offsets as - our PC - rather than raw pointers to either opcode_t's or (void *)'s - (depending on prederef mode or no). + * Some MACRO stuff to make things work whether we prederef or + not. It + may be possible to get rid of these some day if other folks + agree + that we should be using CODE object pointers + offsets as + our PC + rather than raw pointers to either opcode_t's or (void *)'s + (depending on prederef mode or no). - * core.ops modified to be usable to build both kinds of opfuncs. - For now, - this means: + * core.ops modified to be usable to build both kinds of opfuncs. + For now, + this means: - * calls to push_generic_entry(... cur_opcode ...) were - changed to - push_generic_entry(... CUR_OPCODE ...), where CUR_OPCODE is - a - macro that does the right thing in both kinds of ops.c - files. + * calls to push_generic_entry(... cur_opcode ...) were + changed to + push_generic_entry(... CUR_OPCODE ...), where CUR_OPCODE is + a + macro that does the right thing in both kinds of ops.c + files. - This is applicable to the bsr op. If we treated - destinations as - (Code PMC + local offset) rather than as - pointer-to-memory-somewhere, - this wouldn't be a big deal. We may need to do that at some - point - anyway, so that when you jump around and return not only do - you have - the right PC (pointer, today), but you also have the - thread/interpreter - knowing what chunk of bytecode it is in at all times - (assuming we'll - allow reflection, as in ops that query or affect the - current CODE PMC). + This is applicable to the bsr op. If we treated + destinations as + (Code PMC + local offset) rather than as + pointer-to-memory-somewhere, + this wouldn't be a big deal. We may need to do that at some + point + anyway, so that when you jump around and return not only do + you have + the right PC (pointer, today), but you also have the + thread/interpreter + knowing what chunk of bytecode it is in at all times + (assuming we'll + allow reflection, as in ops that query or affect the + current CODE PMC). - * runinterp was modified. Instead of copying the top-level - PackFile struct - and blasting its byte_code pointer, we simply call runops - on the new - interp, passing in the pointer to the current interp's code - and the - offset into that code at which to start (this last arg used - to be a - pointer PC, now its an offset PC). + * runinterp was modified. Instead of copying the top-level + PackFile struct + and blasting its byte_code pointer, we simply call runops + on the new + interp, passing in the pointer to the current interp's code + and the + offset into that code at which to start (this last arg used + to be a + pointer PC, now its an offset PC). - * include/parrot/op.h + * include/parrot/op.h - * new typedef for prederef opfuncs (they return void **) + * new typedef for prederef opfuncs (they return void **) - * include/parrot/interp_guts.h + * include/parrot/interp_guts.h - * New DO_OP_PREDEREF() macro described above. + * New DO_OP_PREDEREF() macro described above. - * include/parrot/interpreter.h + * include/parrot/interpreter.h - * New prototype of runops() -- see below. - - * resume_addr field changed to resume_flag and resume_offset - pair of fields. - We might be resuming from interp using prederef to one not - or vice-versa, - so pointers between the two don't play nice together. - Offsets are beautiful. + * New prototype of runops() -- see below. + + * resume_addr field changed to resume_flag and resume_offset + pair of fields. + We might be resuming from interp using prederef to one not + or vice-versa, + so pointers between the two don't play nice together. + Offsets are beautiful. - * New PARROT_PREDEREF_FLAG constant + * New PARROT_PREDEREF_FLAG constant - * interpreter.c + * interpreter.c - * include "parrot/oplib/core_ops_prederef.h" + * include "parrot/oplib/core_ops_prederef.h" - * prederef() function described above. + * prederef() function described above. - * runops_prederef() runops variant. Uses DO_OP_PREDEREF() - macro as its core. + * runops_prederef() runops variant. Uses DO_OP_PREDEREF() + macro as its core. - * runops() modified to take size_t CODE-relative offset PC - rather than - pointer PC. This made other things workable and doesn't - seem to have lost - anything important (IMO). + * runops() modified to take size_t CODE-relative offset PC + rather than + pointer PC. This made other things workable and doesn't + seem to have lost + anything important (IMO). - * test_main.c + * test_main.c - * New flag '-P' to enable predereferencing. + * New flag '-P' to enable predereferencing. - * Makefile modified to build core_ops_prederef.c from core.ops - via - ops2c-prederef.pl. + * Makefile modified to build core_ops_prederef.c from core.ops + via + ops2c-prederef.pl. - BTW, also added missing $(INC)/interp_guts.h to H_FILES. + BTW, also added missing $(INC)/interp_guts.h to H_FILES. - Added core_ops_prederef$(O) to O_FILES + Added core_ops_prederef$(O) to O_FILES 2001-12-13 12:12 gregor - * languages/jako/MAINTAINER: - Thought it would be nice to put this right in the code... + * languages/jako/MAINTAINER: + Thought it would be nice to put this right in the code... 2001-12-13 04:36 jgoff - * languages/miniperl/Miniperl/Generator.pm: Commented out - debugging, fixed register spillover algorithm + * languages/miniperl/Miniperl/Generator.pm: Commented out + debugging, fixed register spillover algorithm 2001-12-13 04:23 jgoff - * make.pl: Found and fixed obob in the parser (Wasn't parsing last - line) Restructured a bit of the dependency generator to fix a - different obob bug. + * make.pl: Found and fixed obob in the parser (Wasn't parsing last + line) Restructured a bit of the dependency generator to fix a + different obob bug. 2001-12-13 03:43 robert - * MANIFEST, docs/opcodes.pod: remove old docs/opcodes.pod + * MANIFEST, docs/opcodes.pod: remove old docs/opcodes.pod 2001-12-13 03:03 jgoff - * make.pl: Added make.pl + * make.pl: Added make.pl 2001-12-13 02:44 jgoff - * languages/miniperl/Miniperl.pm: Nearly-complete 'make' - replacement in perl. Non-compliant bits - Takes absolutely -NO- - special flags... - Dies on undefined macros - such as $(PDISASM) in current make - Dies on - recursive macro expansions (Doesn't test for - mutual or multipart loops) - In general it - seems to be a little less lenient... Missing bits - File - mod/creation times aren't being looked at - Actions - aren't being taken - The few funky variables ($@, $<) - aren't being dealt with Bugs - Line numbers are slipping a bit. + * languages/miniperl/Miniperl.pm: Nearly-complete 'make' + replacement in perl. Non-compliant bits - Takes absolutely -NO- + special flags... - Dies on undefined macros + such as $(PDISASM) in current make - Dies on + recursive macro expansions (Doesn't test for + mutual or multipart loops) - In general it + seems to be a little less lenient... Missing bits - File + mod/creation times aren't being looked at - Actions + aren't being taken - The few funky variables ($@, $<) + aren't being dealt with Bugs - Line numbers are slipping a bit. 2001-12-13 02:29 jgoff - * languages/miniperl/Miniperl/: Generator.pm, Parser.pm: - Reconstructing files to make the parser flow a little better. + * languages/miniperl/Miniperl/: Generator.pm, Parser.pm: + Reconstructing files to make the parser flow a little better. 2001-12-13 00:51 dan - * resources.c: Be a bit less wasteful with resources that don't - need to be aligned + * resources.c: Be a bit less wasteful with resources that don't + need to be aligned 2001-12-12 18:22 dan - * Makefile.in: D'oh! Fixed looping makefile bug. + * Makefile.in: D'oh! Fixed looping makefile bug. - Courtesy of: "Jaen Saul" + Courtesy of: "Jaen Saul" 2001-12-12 16:23 jgoff - * languages/miniperl/t/001_basic/basic1.scheme: Bogus entry + * languages/miniperl/t/001_basic/basic1.scheme: Bogus entry 2001-12-12 16:22 jgoff - * MANIFEST: Manifest additions for languages/miniperl + * MANIFEST: Manifest additions for languages/miniperl 2001-12-12 16:19 jgoff - * languages/miniperl/t/001_basic/: basic.t, basic1.scheme: Basic - tests. These are left over from the Scheme suite and shouldn't be - used yet. + * languages/miniperl/t/001_basic/: basic.t, basic1.scheme: Basic + tests. These are left over from the Scheme suite and shouldn't be + used yet. 2001-12-12 16:18 jgoff - * languages/miniperl/: Miniperl/Generator.pm, Miniperl/Parser.pm, - Miniperl/Test.pm, Miniperl/Tokenizer.pm, t/harness: Miniperl base - modules. Miniperl/ is where the real work gets done. t/ is largely - vacant because it isn't ready to survive real tests yet. + * languages/miniperl/: Miniperl/Generator.pm, Miniperl/Parser.pm, + Miniperl/Test.pm, Miniperl/Tokenizer.pm, t/harness: Miniperl base + modules. Miniperl/ is where the real work gets done. t/ is largely + vacant because it isn't ready to survive real tests yet. 2001-12-12 16:17 jgoff - * languages/miniperl/: Makefile, Miniperl.pm, foo.mpl, miniperlc, - mpc: Final go-round, hopefully. + * languages/miniperl/: Makefile, Miniperl.pm, foo.mpl, miniperlc, + mpc: Final go-round, hopefully. - languages/miniperl/Makefile - Used basically to run tests, as there - is nothing here that needs to be - dynamically built. languages/miniperl/Miniperl.pm - Stub module - that calls the real Miniperl/ mods languages/miniperl/foo.mpl - - Sample miniperl file. languages/miniperl/miniperlc - Miniperl - compiler stub + languages/miniperl/Makefile - Used basically to run tests, as there + is nothing here that needs to be + dynamically built. languages/miniperl/Miniperl.pm - Stub module + that calls the real Miniperl/ mods languages/miniperl/foo.mpl - + Sample miniperl file. languages/miniperl/miniperlc - Miniperl + compiler stub 2001-12-12 16:09 dan - * Configure.pl: Setting a variable with the make command name is - useful. + * Configure.pl: Setting a variable with the make command name is + useful. 2001-12-12 15:07 simon - * Makefile.in, languages/jako/Makefile, languages/scheme/Makefile: - Recursive make considered "ow, don't do that". + * Makefile.in, languages/jako/Makefile, languages/scheme/Makefile: + Recursive make considered "ow, don't do that". 2001-12-12 14:45 dan - * Makefile.in: Makefile had some non-portable code. (Okay, a lot of - non-portable code) Killing builds on Win32 native. Small patch - applied which hopefully fixes it. + * Makefile.in: Makefile had some non-portable code. (Okay, a lot of + non-portable code) Killing builds on Win32 native. Small patch + applied which hopefully fixes it. 2001-12-12 06:12 ajgough - * classes/Makefile.in: perl is $(PERL), you know it makes sense. + * classes/Makefile.in: perl is $(PERL), you know it makes sense. 2001-12-12 06:08 ajgough - * Makefile.in: perl is $(PERL). + * Makefile.in: perl is $(PERL). 2001-12-12 06:00 ajgough - * t/op/integer.t: Added tests to integer.t so that all permutations - of arguments are actually called at some point. + * t/op/integer.t: Added tests to integer.t so that all permutations + of arguments are actually called at some point. 2001-12-12 05:18 ajgough - * t/op/time.t: I can't sleep, but I don't see why parrot shouldn't. - Tests for sleep i|ic + * t/op/time.t: I can't sleep, but I don't see why parrot shouldn't. + Tests for sleep i|ic 2001-12-12 05:09 ajgough - * t/op/stacks.t: Added pushp and popp register stack tests. + * t/op/stacks.t: Added pushp and popp register stack tests. 2001-12-12 04:51 ajgough - * t/op/stacks.t: Added tests for save and restore, for all register - types. Let there be Haiku. + * t/op/stacks.t: Added tests for save and restore, for all register + types. Let there be Haiku. 2001-12-12 04:27 ajgough - * t/op/basic.t: bsr_i test. You know you want it. + * t/op/basic.t: bsr_i test. You know you want it. 2001-12-12 02:55 ajgough - * MANIFEST: Added hints/os2.pl to MANIFEST. + * MANIFEST: Added hints/os2.pl to MANIFEST. 2001-12-12 02:52 jgoff - * core.ops, key.c: Final checkin... These are actually the correct - copies. + * core.ops, key.c: Final checkin... These are actually the correct + copies. 2001-12-12 02:12 jgoff - * include/parrot/key.h: key.c - Removed a few functions, - generalized set_element_value and element_value to accept - KEY_PAIRs from core.ops include/parrot/key.h - Modified header. - core.ops - Modified to accept the new return style. + * include/parrot/key.h: key.c - Removed a few functions, + generalized set_element_value and element_value to accept + KEY_PAIRs from core.ops include/parrot/key.h - Modified header. + core.ops - Modified to accept the new return style. - This is a prelude to adding virtual-table methods to allow hashing - &c. Expect at least one or two more redesigns before this settles - down. However, it still passes the original tests. + This is a prelude to adding virtual-table methods to allow hashing + &c. Expect at least one or two more redesigns before this settles + down. However, it still passes the original tests. 2001-12-11 13:35 gregor - * runops_cores.c: - Fixed a typo. + * runops_cores.c: + Fixed a typo. 2001-12-11 12:03 gregor - * .cvsignore: - Don't ignore test_prog, but do ignore parrot. + * .cvsignore: + Don't ignore test_prog, but do ignore parrot. 2001-12-11 12:03 gregor - * classes/.cvsignore: - Ignore the generated file default.h + * classes/.cvsignore: + Ignore the generated file default.h 2001-12-11 04:07 jgoff - * key.c: Key source + * key.c: Key source 2001-12-11 04:05 jgoff - * include/parrot/key.h, t/op/key.t: Needed header file, new test + * include/parrot/key.h, t/op/key.t: Needed header file, new test 2001-12-11 04:00 jgoff - * core.ops: Added new key aggregate operations to core ops. + * core.ops: Added new key aggregate operations to core ops. 2001-12-11 04:00 jgoff - * include/parrot/parrot.h: Added key.h to header list + * include/parrot/parrot.h: Added key.h to header list 2001-12-11 03:59 jgoff - * MANIFEST: Added key.c, include/parrot/key.h, t/op/key.t + * MANIFEST: Added key.c, include/parrot/key.h, t/op/key.t 2001-12-11 03:58 jgoff - * Makefile.in: Added implementation of key aggregates. + * Makefile.in: Added implementation of key aggregates. + +2001-12-08 Release 0.0.3 + - PMCs! + - Perl base scalar types implemented + - A new minilanguage, Scheme + - Much improved documentation + - Register stacks pushing and popping + - User stack pushing, popping and rotating + - Jako updates: subroutines, more example programs, optimizations + - test_prog renamed to 'parrot' + + - Added features to the assembler: @ for current location, and global + labels + - Build tweaks for VMS + - Bytecode typing clean-ups + - More platforms: OS X, HPUX, OS/2 + - The proliferation of runops cores reduced to one fast and one slow one + - Opcode tracing, bounds checking, profiling + - Vastly improved string support, with separation of encoding and + charset + - Lots more tests + - Multiple interpreter creation support - the beginnings of threading + - Much better resource handling - the beginnings of GC 2001-12-08 23:07 simon - * README: - README good to go. + * README: + README good to go. 2001-12-08 23:05 simon - * Configure.pl, Makefile.in, README, Parrot/Test.pm, - docs/intro.pod, languages/jako/Makefile, languages/scheme/Makefile, - languages/scheme/Scheme/Test.pm, lib/Parrot/Test.pm: - test_prog? What is test_prog? + * Configure.pl, Makefile.in, README, Parrot/Test.pm, + docs/intro.pod, languages/jako/Makefile, languages/scheme/Makefile, + languages/scheme/Scheme/Test.pm, lib/Parrot/Test.pm: + test_prog? What is test_prog? 2001-12-08 22:57 simon - * ChangeLog: + * ChangeLog: - Oops, the changelog commit was on *this* machine. + Oops, the changelog commit was on *this* machine. 2001-12-08 22:56 simon - * NEWS: - Updates to NEWS and ChangeLog pre-release. + * NEWS: + Updates to NEWS and ChangeLog pre-release. 2001-12-08 22:07 simon - * MANIFEST, Makefile.in, classes/Makefile.in, classes/default.pmc, - classes/perlnum.pmc, classes/pmc2c.pl: - Add "default" PMC vtable so you can inherit implied stuff. + * MANIFEST, Makefile.in, classes/Makefile.in, classes/default.pmc, + classes/perlnum.pmc, classes/pmc2c.pl: + Add "default" PMC vtable so you can inherit implied stuff. 2001-12-08 21:24 simon - * Parrot/PackFile.pm, docs/parrot.pod, docs/parrotbyte.pod, - docs/vtables.pod, lib/Parrot/PackFile.pm: - Getting the documentation up to scratch. + * Parrot/PackFile.pm, docs/parrot.pod, docs/parrotbyte.pod, + docs/vtables.pod, lib/Parrot/PackFile.pm: + Getting the documentation up to scratch. 2001-12-08 21:21 simon - * classes/pmc2c.pl: - Allow inheriting from default class. + * classes/pmc2c.pl: + Allow inheriting from default class. 2001-12-07 20:43 gregor - * examples/assembly/queens.pasm: - Regenerated the file with the latest jakoc. + * examples/assembly/queens.pasm: + Regenerated the file with the latest jakoc. 2001-12-07 20:29 simon - * core.ops, t/op/stacks.t: - Rename "rotate" to "rotate_up". + * core.ops, t/op/stacks.t: + Rename "rotate" to "rotate_up". 2001-12-07 20:15 simon - * t/op/stacks.t: - Some tests for rotate. + * t/op/stacks.t: + Some tests for rotate. 2001-12-07 00:55 gregor - * core.ops: - Cast the result of the pointer arithmetic, since without the cast - there are warnings with some compilers, and without the parens - around the pointer arithmetic, precedence breaks the meaning and - causes crashes. + * core.ops: + Cast the result of the pointer arithmetic, since without the cast + there are warnings with some compilers, and without the parens + around the pointer arithmetic, precedence breaks the meaning and + causes crashes. 2001-12-06 23:37 simon - * core.ops: - Temporary. I prefer compiler warnings to segfaults, thanks. + * core.ops: + Temporary. I prefer compiler warnings to segfaults, thanks. 2001-12-06 23:34 simon - * runops_cores.c: - Make "trace" work again. + * runops_cores.c: + Make "trace" work again. 2001-12-06 21:23 dan - * Parrot/Test.pm, lib/Parrot/Test.pm: Undo twiddles to test.pm + * Parrot/Test.pm, lib/Parrot/Test.pm: Undo twiddles to test.pm 2001-12-06 21:22 dan - * core.ops, packfile.c, Parrot/Test.pm, include/parrot/stacks.h, - lib/Parrot/Test.pm: Fix up source issues that made Dec C unhappy + * core.ops, packfile.c, Parrot/Test.pm, include/parrot/stacks.h, + lib/Parrot/Test.pm: Fix up source issues that made Dec C unhappy 2001-12-06 19:22 simon - * core.ops: - Yet another "How the *%$! did that compile?" moment. + * core.ops: + Yet another "How the *%$! did that compile?" moment. 2001-12-06 18:28 dan - * hints/vms.pl: Fix to build, with a HERE logical required + * hints/vms.pl: Fix to build, with a HERE logical required 2001-12-06 17:48 dan - * core.ops, interpreter.c, pbc2c.pl, pdump.c, test_main.c, - docs/parrot_assembly.pod, include/parrot/interpreter.h: Sensible - changes to the interpreter--flags are now part of the interp - structure. + * core.ops, interpreter.c, pbc2c.pl, pdump.c, test_main.c, + docs/parrot_assembly.pod, include/parrot/interpreter.h: Sensible + changes to the interpreter--flags are now part of the interp + structure. - Courtesy of "Melvin Smith" + Courtesy of "Melvin Smith" 2001-12-06 14:02 gregor - * docs/intro.pod: - s/little_languages/languages/ in Jako section. + * docs/intro.pod: + s/little_languages/languages/ in Jako section. 2001-12-06 13:15 simon - * Makefile.in: - Ensure the documentation gets made. + * Makefile.in: + Ensure the documentation gets made. 2001-12-06 13:12 simon - * MANIFEST, docs/intro.pod: - Documentation! Added the "Some Assembly Required" article with - minor updates. + * MANIFEST, docs/intro.pod: + Documentation! Added the "Some Assembly Required" article with + minor updates. 2001-12-06 00:39 simon - * core.ops: - More "eq" support. + * core.ops: + More "eq" support. - Courtesy of: Nguon Hao Ching + Courtesy of: Nguon Hao Ching 2001-12-06 00:37 simon - * test_main.c: - Add the "-d" debug flag. Doesn't actually *do* anything yet. + * test_main.c: + Add the "-d" debug flag. Doesn't actually *do* anything yet. - Courtesy of: Melvin + Courtesy of: Melvin 2001-12-06 00:11 tom - * string.c, chartypes/unicode.c, chartypes/usascii.c, - encodings/singlebyte.c, encodings/utf16.c, encodings/utf8.c, - include/parrot/chartype.h, include/parrot/encoding.h, - include/parrot/parrot.h: Moved string to number conversion code out - of the encoding layer and into the main string layer as neither the - encoding layer nor the character type layer knows enough on it's - own to do the conversion correctly. + * string.c, chartypes/unicode.c, chartypes/usascii.c, + encodings/singlebyte.c, encodings/utf16.c, encodings/utf8.c, + include/parrot/chartype.h, include/parrot/encoding.h, + include/parrot/parrot.h: Moved string to number conversion code out + of the encoding layer and into the main string layer as neither the + encoding layer nor the character type layer knows enough on it's + own to do the conversion correctly. 2001-12-05 23:12 tom - * Makefile.in: Rebuild the classes directory if any of the object - files for the classes are missing rather than only when perlint.o - is missing. + * Makefile.in: Rebuild the classes directory if any of the object + files for the classes are missing rather than only when perlint.o + is missing. 2001-12-05 19:43 gregor - * Parrot/Assembler.pm, lib/Parrot/Assembler.pm: - * Reworked the constantize_string() stuff a little bit because it - was - puking on things like "\033[H\033[2J\0" (which occurs in the - languages/jako/mandelzoom.jako example). + * Parrot/Assembler.pm, lib/Parrot/Assembler.pm: + * Reworked the constantize_string() stuff a little bit because it + was + puking on things like "\033[H\033[2J\0" (which occurs in the + languages/jako/mandelzoom.jako example). 2001-12-05 19:39 gregor - * languages/jako/: Makefile, mandelzoom.jako: - Added 'mandelzoom' example. + * languages/jako/: Makefile, mandelzoom.jako: + Added 'mandelzoom' example. 2001-12-05 19:38 gregor - * languages/jako/jakoc: - * Added sleep() + * languages/jako/jakoc: + * Added sleep() - * Changed some instances of die() to confess() + * Changed some instances of die() to confess() 2001-12-05 18:34 gregor - * t/: op/pmc.t, pmc/pmc.t: - s/sting->int/string->int/ + * t/: op/pmc.t, pmc/pmc.t: + s/sting->int/string->int/ 2001-12-05 18:08 gregor - * Parrot/.cvsignore: - Ignore PMC.pm + * Parrot/.cvsignore: + Ignore PMC.pm 2001-12-05 18:05 gregor - * classes/.cvsignore: - Ignore the generated files. + * classes/.cvsignore: + Ignore the generated files. 2001-12-05 17:19 gregor - * pbc2c.pl: - * Reverted recent changes, since they broke the script. Real fix - coming - later. + * pbc2c.pl: + * Reverted recent changes, since they broke the script. Real fix + coming + later. 2001-12-05 17:03 simon - * classes/Makefile.in: - Remember: change Makefile.in, not Makefile. D'oh. + * classes/Makefile.in: + Remember: change Makefile.in, not Makefile. D'oh. 2001-12-05 17:02 simon - * Makefile.in: - Ensure PMC.pm gets remade. + * Makefile.in: + Ensure PMC.pm gets remade. 2001-12-05 16:58 simon - * MANIFEST, Makefile.in, classes/Makefile.in, - classes/perlundef.pmc, include/parrot/pmc.h: - Add perlundef class. + * MANIFEST, Makefile.in, classes/Makefile.in, + classes/perlundef.pmc, include/parrot/pmc.h: + Add perlundef class. 2001-12-05 16:45 simon - * core.ops: - Document "new P0, foo" + * core.ops: + Document "new P0, foo" 2001-12-05 16:43 simon - * MANIFEST, Makefile.in, pbc2c.pl, pmc_pm.pl, Parrot/Assembler.pm, - lib/Parrot/Assembler.pm, t/op/pmc.t, t/pmc/pmc.t: - Allow assembler to know about PMC class names. + * MANIFEST, Makefile.in, pbc2c.pl, pmc_pm.pl, Parrot/Assembler.pm, + lib/Parrot/Assembler.pm, t/op/pmc.t, t/pmc/pmc.t: + Allow assembler to know about PMC class names. 2001-12-04 13:39 ajgough - * MANIFEST: Added t/op/pmc.t to MANIFEST. + * MANIFEST: Added t/op/pmc.t to MANIFEST. 2001-12-04 05:02 ajgough - * classes/perlnum.pmc: Picky compiler pointed out probable thinko - in perlnum.c + * classes/perlnum.pmc: Picky compiler pointed out probable thinko + in perlnum.c 2001-12-04 04:24 ajgough - * encodings/singlebyte.c, t/op/pmc.t, t/pmc/pmc.t: A much less - broken form of strtod and appropriate tests. Does not yet check - for overflow. + * encodings/singlebyte.c, t/op/pmc.t, t/pmc/pmc.t: A much less + broken form of strtod and appropriate tests. Does not yet check + for overflow. 2001-12-04 01:31 ajgough - * string.c, encodings/singlebyte.c, encodings/utf16.c, - encodings/utf8.c, include/parrot/encoding.h: Added length parameter - to extract_num and extract_int string vtables, without this it - would be impossible to have strings with nulls in while still - knowing where they ended. + * string.c, encodings/singlebyte.c, encodings/utf16.c, + encodings/utf8.c, include/parrot/encoding.h: Added length parameter + to extract_num and extract_int string vtables, without this it + would be impossible to have strings with nulls in while still + knowing where they ended. 2001-12-03 18:40 ajgough - * string.c, classes/perlstring.pmc, encodings/singlebyte.c, - encodings/utf16.c, encodings/utf8.c, include/parrot/encoding.h, - include/parrot/string.h: Moved pmc string to number conversion into - the string encoding tables. + * string.c, classes/perlstring.pmc, encodings/singlebyte.c, + encodings/utf16.c, encodings/utf8.c, include/parrot/encoding.h, + include/parrot/string.h: Moved pmc string to number conversion into + the string encoding tables. 2001-12-03 00:21 ajgough - * core.ops, t/op/pmc.t, t/pmc/pmc.t: Added set i, p and some tests - for p-> integer. + * core.ops, t/op/pmc.t, t/pmc/pmc.t: Added set i, p and some tests + for p-> integer. 2001-12-02 23:09 jgoff - * classes/Makefile.in: Removed some redundant targets. + * classes/Makefile.in: Removed some redundant targets. 2001-12-02 19:02 ajgough - * t/: op/pmc.t, pmc/pmc.t: Modified all pmc tests to make use of fp - equality macro rather than using perl to generate expected output, - all tests now have < + Courtesy of: Andy Dougherty: 2001-11-28 16:40 simon - * classes/perlnum.pmc: + * classes/perlnum.pmc: - De-C++ + De-C++ 2001-11-28 15:22 simon - * string.c: + * string.c: - Fixes Alex's string concat worry. + Fixes Alex's string concat worry. 2001-11-28 14:27 ajgough - * t/op/string.t: test "null onto null" incorrectly passing as it - produced no output. Output provided. + * t/op/string.t: test "null onto null" incorrectly passing as it + produced no output. Output provided. 2001-11-28 11:14 simon - * include/parrot/pmc.h: + * include/parrot/pmc.h: - Placate AIX. + Placate AIX. 2001-11-26 21:03 dan - * MANIFEST, hints/darwin.pl: Tweaks to build on Mac OS X 10.1 + * MANIFEST, hints/darwin.pl: Tweaks to build on Mac OS X 10.1 2001-11-26 17:29 simon - * classes/perlint.pmc: + * classes/perlint.pmc: - Various subtle but non-showstopper bugs. + Various subtle but non-showstopper bugs. 2001-11-26 11:23 simon - * classes/pmc2c.pl: + * classes/pmc2c.pl: - Replace dependency on Text::Balanced + Replace dependency on Text::Balanced - Courtesy of: Bart Lateur + Courtesy of: Bart Lateur 2001-11-26 05:22 jgoff - * global_setup.c: Last file that should need to be committed. I - swear. + * global_setup.c: Last file that should need to be committed. I + swear. 2001-11-26 05:09 jgoff - * core.ops: Let's try this again... Changes to core.ops required + * core.ops: Let's try this again... Changes to core.ops required 2001-11-26 04:58 jgoff - * classes/perlint.pmc, classes/perlnum.pmc, t/op/pmc.t, - t/pmc/pmc.t: Makefile.in - Added missing cleanup line for perl*.c - core.ops - Added set(p,n|nc), modified print(p) global_setup.c - - Uncommented PerlNum_init classes/perlint.pmc - Added set_number - functions classes/perlnum.pmc - Set up basic number functions - t/op/pmc.t - Added tests for set P0. and {add,mul,sub,div} - tests against numbers and numbers+integers + * classes/perlint.pmc, classes/perlnum.pmc, t/op/pmc.t, + t/pmc/pmc.t: Makefile.in - Added missing cleanup line for perl*.c + core.ops - Added set(p,n|nc), modified print(p) global_setup.c - + Uncommented PerlNum_init classes/perlint.pmc - Added set_number + functions classes/perlnum.pmc - Set up basic number functions + t/op/pmc.t - Added tests for set P0. and {add,mul,sub,div} + tests against numbers and numbers+integers 2001-11-25 13:18 simon - * Makefile.in: - Windows XP make doesn't like $< + * Makefile.in: + Windows XP make doesn't like $< 2001-11-25 12:56 simon - * MANIFEST, Makefile.in, classes/genclass.pl, classes/perlint.c, - classes/perlint.pmc, classes/perlnum.c, classes/perlnum.pmc, - classes/perlstring.c, classes/perlstring.pmc, classes/pmc2c.pl, - examples/assembly/mops_p.pasm: - PMC preprocessor. + * MANIFEST, Makefile.in, classes/genclass.pl, classes/perlint.c, + classes/perlint.pmc, classes/perlnum.c, classes/perlnum.pmc, + classes/perlstring.c, classes/perlstring.pmc, classes/pmc2c.pl, + examples/assembly/mops_p.pasm: + PMC preprocessor. - Courtesy of: Angel Faus + Courtesy of: Angel Faus - I (Simon) also added a couple more integer methods, but no tests - since I'm a Bad Person. + I (Simon) also added a couple more integer methods, but no tests + since I'm a Bad Person. 2001-11-25 08:40 brentdax - * ops2c.pl, Parrot/Op.pm, Parrot/OpsFile.pm, lib/Parrot/Op.pm, - lib/Parrot/OpsFile.pm: Allow _ in op names + * ops2c.pl, Parrot/Op.pm, Parrot/OpsFile.pm, lib/Parrot/Op.pm, + lib/Parrot/OpsFile.pm: Allow _ in op names 2001-11-25 05:54 jgoff - * classes/perlint.c, t/op/pmc.t, t/pmc/pmc.t: classes/perlint.c - - Added basic math ops t/op/pmc.t - Added tests of basic math ops + * classes/perlint.c, t/op/pmc.t, t/pmc/pmc.t: classes/perlint.c - + Added basic math ops t/op/pmc.t - Added tests of basic math ops 2001-11-23 18:27 simon - * core.ops, classes/perlint.c, examples/assembly/mops_p.pasm: - Add everything you need to make MOPS use PMCs. + * core.ops, classes/perlint.c, examples/assembly/mops_p.pasm: + Add everything you need to make MOPS use PMCs. 2001-11-23 18:06 simon - * core.ops: - Eh, you'll need this for rewriting mops.pasm. + * core.ops: + Eh, you'll need this for rewriting mops.pasm. 2001-11-23 17:55 simon - * core.ops, classes/perlint.c, include/parrot/pmc.h, t/op/pmc.t, - t/pmc/pmc.t: - More work on integer PMCs. + * core.ops, classes/perlint.c, include/parrot/pmc.h, t/op/pmc.t, + t/pmc/pmc.t: + More work on integer PMCs. 2001-11-23 17:29 simon - * Makefile.in: - Surprise! Whitespace! HLAGHLAGHLAGH + * Makefile.in: + Surprise! Whitespace! HLAGHLAGHLAGH 2001-11-23 17:28 simon - * Makefile.in, ops2c.pl, ops2pm.pl: - Add vtables.ops to the core + * Makefile.in, ops2c.pl, ops2pm.pl: + Add vtables.ops to the core - Courtesy of: Jeff Goff + Courtesy of: Jeff Goff 2001-11-22 18:39 simon - * core.ops, global_setup.c, docs/parrot_assembly.pod, t/op/pmc.t, - t/pmc/pmc.t: - We can now create PMCs. + * core.ops, global_setup.c, docs/parrot_assembly.pod, t/op/pmc.t, + t/pmc/pmc.t: + We can now create PMCs. 2001-11-21 05:49 jgoff - * Makefile.in: Makefile cleans up *.pasm *.pbc *.out + * Makefile.in: Makefile cleans up *.pasm *.pbc *.out 2001-11-20 16:00 simon - * docs/vtables.pod, include/parrot/pmc.h: - Reorder PMC flags so there's a fixed number of user-defined flags. + * docs/vtables.pod, include/parrot/pmc.h: + Reorder PMC flags so there's a fixed number of user-defined flags. - Courtesy of: Dave Mitchell + Courtesy of: Dave Mitchell 2001-11-19 03:39 jgoff - * Parrot/Assembler.pm, lib/Parrot/Assembler.pm, t/op/basic.t: - Parrot/Assembler.pm - Allow "print 'foo'", and properly escape - nested quotes. t/op/basic.t - Add tests for single-quoted strings, - escaped quotes, and proper handling of newlines. + * Parrot/Assembler.pm, lib/Parrot/Assembler.pm, t/op/basic.t: + Parrot/Assembler.pm - Allow "print 'foo'", and properly escape + nested quotes. t/op/basic.t - Add tests for single-quoted strings, + escaped quotes, and proper handling of newlines. 2001-11-16 22:03 simon - * classes/perlint.c: - More work on the Perl Integer class. More needed, though. + * classes/perlint.c: + More work on the Perl Integer class. More needed, though. 2001-11-16 21:57 simon - * pmc.c, vtable.tbl, classes/genclass.pl, classes/perlint.c: - Rename ->new to ->init, and rework pmc.c:pmc_new to fiddle it. + * pmc.c, vtable.tbl, classes/genclass.pl, classes/perlint.c: + Rename ->new to ->init, and rework pmc.c:pmc_new to fiddle it. 2001-11-16 20:49 simon - * interpreter.c, runops_cores.c, trace.c, - include/parrot/runops_cores.h: - Kill superfluous runops cores. + * interpreter.c, runops_cores.c, trace.c, + include/parrot/runops_cores.h: + Kill superfluous runops cores. 2001-11-16 17:50 simon - * MANIFEST, Makefile.in, classes/intclass.c, classes/perlint.c, - classes/perlnum.c, classes/perlstring.c, classes/scalarclass.c, - include/parrot/parrot.h, include/parrot/pmc.h: - Skeleton for Perl scalar types, done right. + * MANIFEST, Makefile.in, classes/intclass.c, classes/perlint.c, + classes/perlnum.c, classes/perlstring.c, classes/scalarclass.c, + include/parrot/parrot.h, include/parrot/pmc.h: + Skeleton for Perl scalar types, done right. 2001-11-16 16:15 simon - * classes/genclass.pl: - This tidies up genclass to deal with the new-style multimethods. + * classes/genclass.pl: + This tidies up genclass to deal with the new-style multimethods. 2001-11-16 15:29 simon - * Makefile.in, make_vtable_ops.pl, vtable.tbl, Parrot/Vtable.pm, - lib/Parrot/Vtable.pm, include/parrot/parrot.h: - Rework multimethods to be *true* multimethods - that is, have - different types. + * Makefile.in, make_vtable_ops.pl, vtable.tbl, Parrot/Vtable.pm, + lib/Parrot/Vtable.pm, include/parrot/parrot.h: + Rework multimethods to be *true* multimethods - that is, have + different types. 2001-11-15 22:29 simon - * MANIFEST, Makefile.in, pmc.c: - pmc.c linkage and support. Oh, and making it compile. + * MANIFEST, Makefile.in, pmc.c: + pmc.c linkage and support. Oh, and making it compile. 2001-11-15 22:26 dan - * t/op/interp.t: Forgot to tell CVS about the test... + * t/op/interp.t: Forgot to tell CVS about the test... 2001-11-15 22:10 dan - * MANIFEST, Types_pm.in, core.ops, vtable_h.pl, - docs/parrot_assembly.pod, include/parrot/string.h: Added in support - for PMC registers for the interpreter. + * MANIFEST, Types_pm.in, core.ops, vtable_h.pl, + docs/parrot_assembly.pod, include/parrot/string.h: Added in support + for PMC registers for the interpreter. - Added in the docs for the runinterp opcode. + Added in the docs for the runinterp opcode. - Added in code for both the newinterp and runinterp opcodes, so we - can now create new interpreters from within parrot and have them do - things. (Though we can't pass data back and forth. Yet) + Added in code for both the newinterp and runinterp opcodes, so we + can now create new interpreters from within parrot and have them do + things. (Though we can't pass data back and forth. Yet) 2001-11-15 21:24 simon - * vtable.tbl, classes/scalarclass.c, docs/vtables.pod: - More documentation, and other changes as discussed with Dan. + * vtable.tbl, classes/scalarclass.c, docs/vtables.pod: + More documentation, and other changes as discussed with Dan. 2001-11-15 19:51 simon - * classes/scalarclass.c: - De-cut-and-pasto. + * classes/scalarclass.c: + De-cut-and-pasto. 2001-11-15 19:50 simon - * classes/scalarclass.c: - A little code tidiness. + * classes/scalarclass.c: + A little code tidiness. 2001-11-15 19:33 simon - * include/parrot/pmc.h: - Missed this in the previous commit - un-constantize the base for - user-defined PMC flags. + * include/parrot/pmc.h: + Missed this in the previous commit - un-constantize the base for + user-defined PMC flags. 2001-11-15 19:28 simon - * classes/scalarclass.c: - Hey look, sanity. + * classes/scalarclass.c: + Hey look, sanity. 2001-11-15 17:09 simon - * classes/scalarclass.c: - It seems I have completely forgotten how to write C. + * classes/scalarclass.c: + It seems I have completely forgotten how to write C. 2001-11-15 16:53 simon - * docs/vtables.pod: - Start of the PMC classes documentation. + * docs/vtables.pod: + Start of the PMC classes documentation. 2001-11-15 14:46 simon - * classes/scalarclass.c: - Changing to use a Perl-style struct instead of the union cache. + * classes/scalarclass.c: + Changing to use a Perl-style struct instead of the union cache. 2001-11-13 23:56 tom - * string.c: Removed leading _ from string_index as function names - starting with _ are reserved to implementors by the C standard. + * string.c: Removed leading _ from string_index as function names + starting with _ are reserved to implementors by the C standard. - Also fixed string_index to use the encoding routines instead of - assuming a single byte encoding. + Also fixed string_index to use the encoding routines instead of + assuming a single byte encoding. 2001-11-13 12:59 jgoff - * string.c: Patched string_concat to accept null strings. That - test was failing. Nothing to do with ord(). + * string.c: Patched string_concat to accept null strings. That + test was failing. Nothing to do with ord(). 2001-11-13 12:43 jgoff - * string.c: string_ord function, string_concat fixes + * string.c: string_ord function, string_concat fixes 2001-11-13 04:52 jgoff - * core.ops: Added ord to core.ops + * core.ops: Added ord to core.ops 2001-11-13 04:35 jgoff - * docs/strings.pod, include/parrot/exceptions.h, - include/parrot/string.h, t/op/string.t: core.ops - Added ord - operator, documentation string.c - Added string_ord, _string_index - (_string_index is a static helper) Patched - string_concat to handle null strings properly. docs/strings.pod - - Description of string_ord include/parrot/exceptions.h - Added - ORD_OUT_OF_STRING exception include/parrot/string.h - Added - string_ord() t/op/string.t - Added full set of test for - ord_i_(s|sc)(_(i|ic))? + * docs/strings.pod, include/parrot/exceptions.h, + include/parrot/string.h, t/op/string.t: core.ops - Added ord + operator, documentation string.c - Added string_ord, _string_index + (_string_index is a static helper) Patched + string_concat to handle null strings properly. docs/strings.pod - + Description of string_ord include/parrot/exceptions.h - Added + ORD_OUT_OF_STRING exception include/parrot/string.h - Added + string_ord() t/op/string.t - Added full set of test for + ord_i_(s|sc)(_(i|ic))? - string.c contains a bit of documentation explaining the logic - behind _string_index, primarily having to do with multiple encoding - formats. + string.c contains a bit of documentation explaining the logic + behind _string_index, primarily having to do with multiple encoding + formats. 2001-11-12 22:30 simon - * t/op/macro.t: - Count 'em. + * t/op/macro.t: + Count 'em. 2001-11-12 22:28 simon - * Makefile.in: - Add a rule to compile "platform" + * Makefile.in: + Add a rule to compile "platform" 2001-11-12 22:26 simon - * Makefile.in: - Tidy up distclean target. + * Makefile.in: + Tidy up distclean target. 2001-11-12 16:54 dan - * MANIFEST, Parrot/Assembler.pm, lib/Parrot/Assembler.pm, - t/op/macro.t: Fixes to the assembler's macro facility and a test + * MANIFEST, Parrot/Assembler.pm, lib/Parrot/Assembler.pm, + t/op/macro.t: Fixes to the assembler's macro facility and a test - Courtesy of: Jeff + Courtesy of: Jeff 2001-11-12 16:50 dan - * Parrot/Assembler.pm, lib/Parrot/Assembler.pm: Allow input from - stdin + * Parrot/Assembler.pm, lib/Parrot/Assembler.pm: Allow input from + stdin - Courtesy of: Jeff + Courtesy of: Jeff 2001-11-12 16:36 dan - * Parrot/Test.pm, lib/Parrot/Test.pm: Fix to make test work on - CygWin + * Parrot/Test.pm, lib/Parrot/Test.pm: Fix to make test work on + CygWin - Courtesy of: Alex Gough + Courtesy of: Alex Gough 2001-11-12 11:22 simon - * examples/assembly/mops.pasm: + * examples/assembly/mops.pasm: - Trivial tightening of mops loop. + Trivial tightening of mops loop. 2001-11-07 23:57 ajgough - * docs/tests.pod: This is a basic quide to writing tests with - assembler. + * docs/tests.pod: This is a basic quide to writing tests with + assembler. 2001-11-07 22:29 dan - * stacks.c: Added a little documentation on the cleanup parameter - for an entry + * stacks.c: Added a little documentation on the cleanup parameter + for an entry 2001-11-07 14:43 dan - * MANIFEST, platforms/generic.c, platforms/linux.c, - platforms/linux.h: Portability patches. + * MANIFEST, platforms/generic.c, platforms/linux.c, + platforms/linux.h: Portability patches. - Courtesy of: Andy Dougherty + Courtesy of: Andy Dougherty 2001-11-06 19:51 tom - * Makefile.in: Clean up object files in the subdirectories as well - as those in the top level directory. + * Makefile.in: Clean up object files in the subdirectories as well + as those in the top level directory. - Enhanced version of patch from Daniel Grunblatt - + Enhanced version of patch from Daniel Grunblatt + 2001-11-06 16:14 dan - * Configure.pl, MANIFEST, Makefile.in, core.ops, - platforms/generic.c, platforms/generic.h: Made things a bit more - platform-independent. Makefile still needs work to pick up changes - to the platform-specific files. + * Configure.pl, MANIFEST, Makefile.in, core.ops, + platforms/generic.c, platforms/generic.h: Made things a bit more + platform-independent. Makefile still needs work to pick up changes + to the platform-specific files. 2001-11-05 21:32 dan - * docs/parrot_assembly.pod: Added docs for the GC control ops + * docs/parrot_assembly.pod: Added docs for the GC control ops 2001-11-04 02:52 gregor - * platforms/: win32.c, win32.h: - * win32 dynamic loading functions. + * platforms/: win32.c, win32.h: + * win32 dynamic loading functions. - Courtesy of Jason Diamond + Courtesy of Jason Diamond 2001-11-04 00:04 brentdax - * Parrot/Assembler.pm, lib/Parrot/Assembler.pm: Assembler fixes: - allows an absolute path to be used and gives a useful error message - if the original source file can't be found + * Parrot/Assembler.pm, lib/Parrot/Assembler.pm: Assembler fixes: + allows an absolute path to be used and gives a useful error message + if the original source file can't be found 2001-11-02 12:37 gregor - * platforms/: linux.c, linux.h: - * Beginning of dynamic loading support. Linux only for now. + * platforms/: linux.c, linux.h: + * Beginning of dynamic loading support. Linux only for now. 2001-11-02 12:13 gregor - * MANIFEST, time.c, include/parrot/time.h: - * Removed time.[hc], since they have been superseded by the new - platform - stuff. + * MANIFEST, time.c, include/parrot/time.h: + * Removed time.[hc], since they have been superseded by the new + platform + stuff. 2001-11-02 12:11 gregor - * Configure.pl, Makefile.in, core.ops, vtable.tbl, - classes/intclass.c, classes/scalarclass.c, hints/mswin32.pl, - include/parrot/parrot.h, platforms/linux.c, platforms/linux.h, - platforms/win32.c, platforms/win32.h: - Patch from Jason Diamond to make win32 platform stuff work: + * Configure.pl, Makefile.in, core.ops, vtable.tbl, + classes/intclass.c, classes/scalarclass.c, hints/mswin32.pl, + include/parrot/parrot.h, platforms/linux.c, platforms/linux.h, + platforms/win32.c, platforms/win32.h: + Patch from Jason Diamond to make win32 platform stuff work: - * Modified Configure.pl, mswin32.pl, and Makefile.in so that the - platform specific files in the platforms directory gets copied to - the correct directories. The Makefile will re-copy the platform.h - and .c files if the original is modified. + * Modified Configure.pl, mswin32.pl, and Makefile.in so that the + platform specific files in the platforms directory gets copied to + the correct directories. The Makefile will re-copy the platform.h + and .c files if the original is modified. - * #include platform.h in parrot.h instead of time.h. + * #include platform.h in parrot.h instead of time.h. - * Removed time.h and time.obj from the Makefile. time.h and time.c - aren't being used anymore since that code was moved to linux.c and - win32.c. + * Removed time.h and time.obj from the Makefile. time.h and time.c + aren't being used anymore since that code was moved to linux.c and + win32.c. - * Renamed the BOOL typedef in parrot.h to BOOLVAL (inspired by - INTVAL and FLOATVAL). This was conflicting with the BOOL typedef in - windows.h. This required updating several files besides parrot.h. + * Renamed the BOOL typedef in parrot.h to BOOLVAL (inspired by + INTVAL and FLOATVAL). This was conflicting with the BOOL typedef in + windows.h. This required updating several files besides parrot.h. - * Added a DEFAULT_OPEN_MODE to linux.h and win32.h and used that - instead of the missing identifiers (on Windows) in core.ops in the - calls to open. + * Added a DEFAULT_OPEN_MODE to linux.h and win32.h and used that + instead of the missing identifiers (on Windows) in core.ops in the + calls to open. - * Added Parrot_sleep and Parrot_setenv to both the linux and win32 - platform files and called those from core.ops. The Linux code for - these functions came from core.ops so they should hopefully work. + * Added Parrot_sleep and Parrot_setenv to both the linux and win32 + platform files and called those from core.ops. The Linux code for + these functions came from core.ops so they should hopefully work. - Courtesy of Jason Diamond + Courtesy of Jason Diamond 2001-11-02 06:43 brentdax - * Makefile.in, hints/mswin32.pl: Fix classes/intclass.obj building - for Win32 (courtesy of Jason Diamond ) + * Makefile.in, hints/mswin32.pl: Fix classes/intclass.obj building + for Win32 (courtesy of Jason Diamond ) 2001-11-02 02:26 gregor - * .cvsignore, MANIFEST, include/parrot/.cvsignore, - platforms/linux.c, platforms/linux.h, platforms/win32.c, - platforms/win32.h: - * Beginnings of platform support files in platform/*.[hc] + * .cvsignore, MANIFEST, include/parrot/.cvsignore, + platforms/linux.c, platforms/linux.h, platforms/win32.c, + platforms/win32.h: + * Beginnings of platform support files in platform/*.[hc] 2001-11-01 23:37 tom - * classes/intclass.c: Added missing *'s to STRING arguments and - return values to avoid compiler warnings. + * classes/intclass.c: Added missing *'s to STRING arguments and + return values to avoid compiler warnings. 2001-11-01 22:21 gregor - * MANIFEST, Makefile.in, core.ops, obscure.ops, time.c, - include/parrot/parrot.h, include/parrot/time.h: - Initial "fix" of time(n) op for Win32: + * MANIFEST, Makefile.in, core.ops, obscure.ops, time.c, + include/parrot/parrot.h, include/parrot/time.h: + Initial "fix" of time(n) op for Win32: - * Initial Win32 code Courtesy of Richard J Cox + * Initial Win32 code Courtesy of Richard J Cox - * time.c and include/parrot/time.h + * time.c and include/parrot/time.h - First attempt at getting this working across platforms. The - macro WIN32 being tested might not be right. + First attempt at getting this working across platforms. The + macro WIN32 being tested might not be right. - * New functions Parrot_intval_time() and Parrot_floatval_time() - wrap the appropriate functionality depending upon platform. - Changed core.ops to call these. + * New functions Parrot_intval_time() and Parrot_floatval_time() + wrap the appropriate functionality depending upon platform. + Changed core.ops to call these. - Added obscure.ops with obscure transcendental ops. + Added obscure.ops with obscure transcendental ops. - Added simple file I/O ops (close, open, read, write): + Added simple file I/O ops (close, open, read, write): - * Initial versions Courtesy of Jeff + * Initial versions Courtesy of Jeff - * I changed some arg ordering stuff. + * I changed some arg ordering stuff. - * I added read/write of INTVALs and FLOATVALs. + * I added read/write of INTVALs and FLOATVALs. - Added environment variable ops (getenv, setenv) + Added environment variable ops (getenv, setenv) - Added system error ops (err(i) and err(s) for accessing errno and - strerr(). + Added system error ops (err(i) and err(s) for accessing errno and + strerr(). - Moved print ops in with other "temporary" developer ops, since - they'll move to a devel.ops or temp.ops oplib once we have oplibs. + Moved print ops in with other "temporary" developer ops, since + they'll move to a devel.ops or temp.ops oplib once we have oplibs. 2001-10-31 22:51 tom - * MANIFEST, Makefile.in, chartype.c, encoding.c, global_setup.c, - packfile.c, string.c, strnative.c, strutf16.c, strutf32.c, - strutf8.c, transcode.c, chartypes/unicode.c, chartypes/usascii.c, - encodings/singlebyte.c, encodings/utf16.c, encodings/utf32.c, - encodings/utf8.c, include/parrot/chartype.h, - include/parrot/encoding.h, include/parrot/exceptions.h, - include/parrot/parrot.h, include/parrot/string.h, - include/parrot/strnative.h, include/parrot/strutf16.h, - include/parrot/strutf32.h, include/parrot/strutf8.h, - include/parrot/transcode.h: Reworked the string code in line with - Dan's latest design that separates character sets from encodings. + * MANIFEST, Makefile.in, chartype.c, encoding.c, global_setup.c, + packfile.c, string.c, strnative.c, strutf16.c, strutf32.c, + strutf8.c, transcode.c, chartypes/unicode.c, chartypes/usascii.c, + encodings/singlebyte.c, encodings/utf16.c, encodings/utf32.c, + encodings/utf8.c, include/parrot/chartype.h, + include/parrot/encoding.h, include/parrot/exceptions.h, + include/parrot/parrot.h, include/parrot/string.h, + include/parrot/strnative.h, include/parrot/strutf16.h, + include/parrot/strutf32.h, include/parrot/strutf8.h, + include/parrot/transcode.h: Reworked the string code in line with + Dan's latest design that separates character sets from encodings. 2001-10-31 19:53 dan - * docs/parrot_assembly.pod: Finished I/O section of docs + * docs/parrot_assembly.pod: Finished I/O section of docs 2001-10-31 16:51 dan - * core.ops, docs/parrot_assembly.pod, include/parrot/parrot.h: - Moved includes out of core.ops and into parrot.h where they belong - (suitably guarded with #ifdefs). Also some updates to - parrot_assembly.pod + * core.ops, docs/parrot_assembly.pod, include/parrot/parrot.h: + Moved includes out of core.ops and into parrot.h where they belong + (suitably guarded with #ifdefs). Also some updates to + parrot_assembly.pod 2001-10-30 21:43 dan - * core.ops, stacks.c, docs/parrot_assembly.pod, - include/parrot/stacks.h: Added entrytype opcode to fetch the type - of the entry on the stack + * core.ops, stacks.c, docs/parrot_assembly.pod, + include/parrot/stacks.h: Added entrytype opcode to fetch the type + of the entry on the stack 2001-10-29 18:30 dan - * stacks.c: You can turn off stack entry type validation on pop by - passing in a type of 0 now. (For those cases where you just want to - throw the darned thing away) + * stacks.c: You can turn off stack entry type validation on pop by + passing in a type of 0 now. (For those cases where you just want to + throw the darned thing away) 2001-10-29 14:37 gregor - * core.ops, languages/jako/jakoc: - * New variants of the save ops to save constants on the stack. - This is - useful for saving zero arg and result counts on the stack, for - example. - - * Modified jakoc to to adapt to the newly announced calling - conventions. - Even though Jako source code appears to show subroutines with - fixed - numbers of arguments and results, they are implemented with the - variable count calling convention. Future modifications will be - needed - to ensure that an exception is raised if the stack frame is of - the - wrong size (or, at least that we pop the complete frame off). - We'll - also have to make more changes to support the true - fixed-arg-count - and fixed-result-count parts of the calling convention spec. + * core.ops, languages/jako/jakoc: + * New variants of the save ops to save constants on the stack. + This is + useful for saving zero arg and result counts on the stack, for + example. + + * Modified jakoc to to adapt to the newly announced calling + conventions. + Even though Jako source code appears to show subroutines with + fixed + numbers of arguments and results, they are implemented with the + variable count calling convention. Future modifications will be + needed + to ensure that an exception is raised if the stack frame is of + the + wrong size (or, at least that we pop the complete frame off). + We'll + also have to make more changes to support the true + fixed-arg-count + and fixed-result-count parts of the calling convention spec. 2001-10-28 16:53 simon - * MANIFEST, stacks.c, classes/scalarclass.c, - include/parrot/stacks.h: - Unbelievably bad errors of mine, plus a type incompatibility of - Dan's. + * MANIFEST, stacks.c, classes/scalarclass.c, + include/parrot/stacks.h: + Unbelievably bad errors of mine, plus a type incompatibility of + Dan's. 2001-10-28 08:30 simon - * classes/scalarclass.c: - Beginning of a scalar class. + * classes/scalarclass.c: + Beginning of a scalar class. 2001-10-28 08:29 simon - * make_vtable_ops.pl, vtable.tbl, Parrot/Vtable.pm, - lib/Parrot/Vtable.pm, classes/genclass.pl, classes/intclass.c, - include/parrot/pmc.h: - This fixes the problem with vtables and pointer arithmetic. + * make_vtable_ops.pl, vtable.tbl, Parrot/Vtable.pm, + lib/Parrot/Vtable.pm, classes/genclass.pl, classes/intclass.c, + include/parrot/pmc.h: + This fixes the problem with vtables and pointer arithmetic. 2001-10-26 19:58 dan - * core.ops, interpreter.c, stacks.c, include/parrot/interpreter.h, - include/parrot/stacks.h: Split the generic stack into a user push - stack and a control stack + * core.ops, interpreter.c, stacks.c, include/parrot/interpreter.h, + include/parrot/stacks.h: Split the generic stack into a user push + stack and a control stack 2001-10-26 02:59 bdwheele - * Parrot/OpsFile.pm, lib/Parrot/OpsFile.pm: [no log message] + * Parrot/OpsFile.pm, lib/Parrot/OpsFile.pm: [no log message] 2001-10-24 20:27 dan - * languages/scheme/: Makefile, Scheme.pm, schemec, - Scheme/Generator.pm, Scheme/Parser.pm, Scheme/Test.pm, - Scheme/Tokenizer.pm, t/harness, t/arith/basic.t, t/arith/logic.t, - t/arith/nested.t, t/io/basic.t, t/logic/basic.t: Added the mini - Scheme compiler + * languages/scheme/: Makefile, Scheme.pm, schemec, + Scheme/Generator.pm, Scheme/Parser.pm, Scheme/Test.pm, + Scheme/Tokenizer.pm, t/harness, t/arith/basic.t, t/arith/logic.t, + t/arith/nested.t, t/io/basic.t, t/logic/basic.t: Added the mini + Scheme compiler 2001-10-24 20:23 dan - * MANIFEST, pdump.c, docs/parrot_assembly.pod: Update for - interpreter needs in pdump.c. Added scheme bits to manifest + * MANIFEST, pdump.c, docs/parrot_assembly.pod: Update for + interpreter needs in pdump.c. Added scheme bits to manifest 2001-10-24 16:43 gregor - * Parrot/Assembler.pm, lib/Parrot/Assembler.pm: - * Make the assembler handle octal character code escapes in - string - constants. + * Parrot/Assembler.pm, lib/Parrot/Assembler.pm: + * Make the assembler handle octal character code escapes in + string + constants. 2001-10-24 15:56 dan - * MANIFEST, examples/assembly/life.pasm: Added an example in to - play the game of life + * MANIFEST, examples/assembly/life.pasm: Added an example in to + play the game of life 2001-10-24 15:54 dan - * core.ops: Added sleep. We'll need to override this to do events - properly anyway, so... + * core.ops: Added sleep. We'll need to override this to do events + properly anyway, so... 2001-10-24 14:03 gregor - * Makefile.in, pbc2c.pl, pdump.c: - * Adapt pdump.c and pbc2c.pl to the new requirement to pass - interpreter - pointer into string functions. + * Makefile.in, pbc2c.pl, pdump.c: + * Adapt pdump.c and pbc2c.pl to the new requirement to pass + interpreter + pointer into string functions. - Courtesy of: Ryan O'Neil + Courtesy of: Ryan O'Neil 2001-10-23 20:09 gregor - * languages/jako/jakoc: - * Terminological refinement in regexp capture comment. + * languages/jako/jakoc: + * Terminological refinement in regexp capture comment. 2001-10-23 15:23 simon - * classes/genclass.pl: - Use a saner ANSI C construct to make MIPSPro happy. + * classes/genclass.pl: + Use a saner ANSI C construct to make MIPSPro happy. - Courtesy of: Alex Gough + Courtesy of: Alex Gough 2001-10-23 00:34 tom - * core.ops, string.c, strnative.c, strutf16.c, strutf32.c, - strutf8.c, include/parrot/string.h: Make sure the interpreter - structure is passed to the transcoder as necessary, including - passing it to string_compare(). + * core.ops, string.c, strnative.c, strutf16.c, strutf32.c, + strutf8.c, include/parrot/string.h: Make sure the interpreter + structure is passed to the transcoder as necessary, including + passing it to string_compare(). 2001-10-23 00:32 tom - * Makefile.in: Make pdump build again by including resources.o in - the link. + * Makefile.in: Make pdump build again by including resources.o in + the link. 2001-10-22 22:43 dan - * core.ops, packfile.c, string.c, strnative.c, strutf16.c, - strutf32.c, strutf8.c, test_main.c, transcode.c, - include/parrot/packfile.h, include/parrot/parrot.h, - include/parrot/resources.h, include/parrot/string.h, - include/parrot/transcode.h: Everything now uses the allocators and - deallocators in resources.c. + * core.ops, packfile.c, string.c, strnative.c, strutf16.c, + strutf32.c, strutf8.c, test_main.c, transcode.c, + include/parrot/packfile.h, include/parrot/parrot.h, + include/parrot/resources.h, include/parrot/string.h, + include/parrot/transcode.h: Everything now uses the allocators and + deallocators in resources.c. - Unfortunately we lost standalone string-test mode, but I can cope - with that. + Unfortunately we lost standalone string-test mode, but I can cope + with that. - Please note that until we have a real allocation/deallocation/GC - system, this'll leak. A *lot*. + Please note that until we have a real allocation/deallocation/GC + system, this'll leak. A *lot*. 2001-10-22 20:27 dan - * MANIFEST, Makefile.in, pmc.c, resources.c, - include/parrot/resources.h: First cut to handle arena allocation of - PMC headers. (Amongst other things) + * MANIFEST, Makefile.in, pmc.c, resources.c, + include/parrot/resources.h: First cut to handle arena allocation of + PMC headers. (Amongst other things) 2001-10-22 19:02 dan - * Configure.pl, config_h.in, register.c, include/parrot/register.h: - Now each register type has its own mask macro, which is the right - thing to do. + * Configure.pl, config_h.in, register.c, include/parrot/register.h: + Now each register type has its own mask macro, which is the right + thing to do. - Patch courtesy of Jason Gloudon + Patch courtesy of Jason Gloudon 2001-10-21 23:40 tom - * stacks.c, t/op/stacks.t: Fix bug in handling of rollover to a new - stack chunk and add a test to test this rollover in future. + * stacks.c, t/op/stacks.t: Fix bug in handling of rollover to a new + stack chunk and add a test to test this rollover in future. - Courtesy of Jason Gloudon . + Courtesy of Jason Gloudon . 2001-10-21 19:14 dan - * include/parrot/string.h: Changed string 'unused' field to the - language field. + * include/parrot/string.h: Changed string 'unused' field to the + language field. 2001-10-21 18:18 gregor - * languages/jako/: Makefile, mops.jako: - * Makefile: 'clean' target removes .list files, too. And, it does - rm -f - with wildcards rather than listing things explicitly. + * languages/jako/: Makefile, mops.jako: + * Makefile: 'clean' target removes .list files, too. And, it does + rm -f + with wildcards rather than listing things explicitly. - * mops.jako actually prints out the - millions-of-operations-per-second - (mops) value instead of just the operations-per-second value. + * mops.jako actually prints out the + millions-of-operations-per-second + (mops) value instead of just the operations-per-second value. 2001-10-21 18:03 simon - * classes/intclass.o: - *smack*! WRONG! + * classes/intclass.o: + *smack*! WRONG! 2001-10-21 17:47 simon - * MANIFEST, Makefile.in, make_vtable_ops.pl, pmc.c, vtable_h.pl, - Parrot/Vtable.pm, classes/genclass.pl, classes/intclass.c, - classes/intclass.o, include/parrot/parrot.h, include/parrot/pmc.h, - lib/Parrot/Vtable.pm: - Initial work on PMCs. Explanation to follow + * MANIFEST, Makefile.in, make_vtable_ops.pl, pmc.c, vtable_h.pl, + Parrot/Vtable.pm, classes/genclass.pl, classes/intclass.c, + classes/intclass.o, include/parrot/parrot.h, include/parrot/pmc.h, + lib/Parrot/Vtable.pm: + Initial work on PMCs. Explanation to follow 2001-10-21 15:20 gregor - * examples/assembly/queens.pasm: - * Modernize the calling conventions in queens.pasm. It was using - swap, - which now must be rotate. Also, changed to use return values on - the - stack instead of in I0. + * examples/assembly/queens.pasm: + * Modernize the calling conventions in queens.pasm. It was using + swap, + which now must be rotate. Also, changed to use return values on + the + stack instead of in I0. 2001-10-19 18:14 gregor - * core.ops, stacks.c, include/parrot/stacks.h, - languages/jako/jakoc: - Per Dan's request, replacing 'swap' op by 'rotate'. + * core.ops, stacks.c, include/parrot/stacks.h, + languages/jako/jakoc: + Per Dan's request, replacing 'swap' op by 'rotate'. - * core.ops: Replaced 'swap()' by 'rotate(i|ic)'. + * core.ops: Replaced 'swap()' by 'rotate(i|ic)'. - * stacks.c and stacks.h: Removed swap-related functions from my - prior commit, replacing them with stack_depth(), stack_entry() - and rotate_entries(). + * stacks.c and stacks.h: Removed swap-related functions from my + prior commit, replacing them with stack_depth(), stack_entry() + and rotate_entries(). - NOTE: The stack_depth() and rotate_entries() routines could - be made more efficient through the caching of the sum of chunk - 'used' members from lower chunks in a field in the upper - chunks. Also, if the interpreter's stack_base was changed to - hold the pointer to the *top* chunk (since we usually come - at the stack from the top down) instead of the *bottom* - chunk. The code here at least works, and we can decide about - bigger changes separately. + NOTE: The stack_depth() and rotate_entries() routines could + be made more efficient through the caching of the sum of chunk + 'used' members from lower chunks in a field in the upper + chunks. Also, if the interpreter's stack_base was changed to + hold the pointer to the *top* chunk (since we usually come + at the stack from the top down) instead of the *bottom* + chunk. The code here at least works, and we can decide about + bigger changes separately. - For now, rotate only handles rotates in one direction and - of magnituded one. A fully general rotate would do handle - rotates in both directions and of arbitrary amounts. Again, - this implementation is sufficient for current applications, - and a feature-complete version can be developed if this turns - out to be otherwise the right type of implementation. + For now, rotate only handles rotates in one direction and + of magnituded one. A fully general rotate would do handle + rotates in both directions and of arbitrary amounts. Again, + this implementation is sufficient for current applications, + and a feature-complete version can be developed if this turns + out to be otherwise the right type of implementation. - This change includes a new exception for ERROR_STACK_SHALLOW, - meaning "not-empty-yet-not-deep-enough-for-what-you-asked". + This change includes a new exception for ERROR_STACK_SHALLOW, + meaning "not-empty-yet-not-deep-enough-for-what-you-asked". - * jakoc: Changed the calling convention to use rotate instead - of swap (of course). Also changed the convention for return - value passing to use the stack as well. + * jakoc: Changed the calling convention to use rotate instead + of swap (of course). Also changed the convention for return + value passing to use the stack as well. 2001-10-19 13:36 gregor - * MANIFEST, core.ops, disassemble.pl, stacks.c, - examples/assembly/queens.pasm, include/parrot/stacks.h, - languages/jako/.cvsignore, languages/jako/Makefile, - languages/jako/bench.jako, languages/jako/euclid.jako, - languages/jako/fact.jako, languages/jako/jakoc, - languages/jako/mandelbrot.jako, languages/jako/mops.jako, - languages/jako/primes.jako, languages/jako/queens.jako, - languages/jako/sub.jako: - * New stack functions push_entry(), pop_entry() and swap_entry(). - The first two exist for the support of the last one. These - functions don't care what is in the stack entries. These exist - to support the new 'swap' op (see next bullet). - - * New op 'swap' for swapping the top two elements on the stack. - This is necessary for passing arguments to functions, since - the return address will be on top of any arguments that have - been pushed on the stack. This way, you can use a (swap, pop) - pair to retrieve each argument (for subroutine linkage). - - * Disassembler now prints numbers in decimal by default, with - a new '-x' flag to turn on hexadecimal display. Since other - members of the Parrot Tool Set use decimal by default, this - makes it easier to compare output from the various tools. - - * Jako compiler has more explanatory comments and the following - new features: - - * Lexically scoped variables. - - * Subroutines that take arguments and return values: - - sub int foo(int bar) { - if (bar == 1) { - return 42; - } else { - return 13; - } - } - * ... if (...) and ... unless (...) statement modifiers - can be used on next, last and redo. - - * Bitwise and (&, &=) and or (|, |=) ops. - - * Type names are just 'int', 'num', 'str', and 'poly' now. - The old long names 'integer', 'number', 'string', and - 'polytype' are no longer valid. - - * Integer variable assignments can now use 0b (binary), - 0 (octal) and 0x (hexadecimal) radix prefixes on literals. - - * New Jako and Parrot assembly examples queens.{jako,pasm} for - solving the eight-queens problem. The assembly example is a - hand-modified version of the assembly code produced by the - Jako compiler from queens.jako. A few unnecessary ops have - been removed, lots of unnecessary labels have been removed, - and all the Jako source code comments have been removed. - - * Makefile and .cvsignore in languages/jako modified so that - the assembler produces listings when assembling the programs, - yet the *.list files are ignored by CVS. - - * Made the default target in languages/jako/Makefile 'all'. - - * Modified some of the Jako examples to use some of the new - features of Jako, such as subroutines and lexical variable - scoping. + * MANIFEST, core.ops, disassemble.pl, stacks.c, + examples/assembly/queens.pasm, include/parrot/stacks.h, + languages/jako/.cvsignore, languages/jako/Makefile, + languages/jako/bench.jako, languages/jako/euclid.jako, + languages/jako/fact.jako, languages/jako/jakoc, + languages/jako/mandelbrot.jako, languages/jako/mops.jako, + languages/jako/primes.jako, languages/jako/queens.jako, + languages/jako/sub.jako: + * New stack functions push_entry(), pop_entry() and swap_entry(). + The first two exist for the support of the last one. These + functions don't care what is in the stack entries. These exist + to support the new 'swap' op (see next bullet). + + * New op 'swap' for swapping the top two elements on the stack. + This is necessary for passing arguments to functions, since + the return address will be on top of any arguments that have + been pushed on the stack. This way, you can use a (swap, pop) + pair to retrieve each argument (for subroutine linkage). + + * Disassembler now prints numbers in decimal by default, with + a new '-x' flag to turn on hexadecimal display. Since other + members of the Parrot Tool Set use decimal by default, this + makes it easier to compare output from the various tools. + + * Jako compiler has more explanatory comments and the following + new features: + + * Lexically scoped variables. + + * Subroutines that take arguments and return values: + + sub int foo(int bar) { + if (bar == 1) { + return 42; + } else { + return 13; + } + } + * ... if (...) and ... unless (...) statement modifiers + can be used on next, last and redo. + + * Bitwise and (&, &=) and or (|, |=) ops. + + * Type names are just 'int', 'num', 'str', and 'poly' now. + The old long names 'integer', 'number', 'string', and + 'polytype' are no longer valid. + + * Integer variable assignments can now use 0b (binary), + 0 (octal) and 0x (hexadecimal) radix prefixes on literals. + + * New Jako and Parrot assembly examples queens.{jako,pasm} for + solving the eight-queens problem. The assembly example is a + hand-modified version of the assembly code produced by the + Jako compiler from queens.jako. A few unnecessary ops have + been removed, lots of unnecessary labels have been removed, + and all the Jako source code comments have been removed. + + * Makefile and .cvsignore in languages/jako modified so that + the assembler produces listings when assembling the programs, + yet the *.list files are ignored by CVS. + + * Made the default target in languages/jako/Makefile 'all'. + + * Modified some of the Jako examples to use some of the new + features of Jako, such as subroutines and lexical variable + scoping. 2001-10-19 02:43 gregor - * runops_cores.c, include/parrot/runops_cores.h: - Bug fix (gcc doesn't complain, but MIPSpro does): + * runops_cores.c, include/parrot/runops_cores.h: + Bug fix (gcc doesn't complain, but MIPSpro does): - * Added missing extern to runops_cores array declaration in - include/parrot/runops_cores.h + * Added missing extern to runops_cores array declaration in + include/parrot/runops_cores.h - * Also added 'const' there and in runops_cores.c + * Also added 'const' there and in runops_cores.c 2001-10-18 15:18 gregor - * .cvsignore, include/parrot/oplib/.cvsignore: - * Ignore the vtable-related generated files. + * .cvsignore, include/parrot/oplib/.cvsignore: + * Ignore the vtable-related generated files. 2001-10-18 15:14 gregor - * core.ops: - * left and right shifts now allow the 2nd argument to be a - constant. + * core.ops: + * left and right shifts now allow the 2nd argument to be a + constant. 2001-10-18 14:55 simon - * make_vtable_ops.pl: - This is C, not Perl. How on earth did that even compile? + * make_vtable_ops.pl: + This is C, not Perl. How on earth did that even compile? 2001-10-18 14:54 simon - * make_vtable_ops.pl: - More vtable ops. + * make_vtable_ops.pl: + More vtable ops. 2001-10-18 12:33 simon - * Makefile.in, make_vtable_ops.pl, vtable.tbl: - Initial stab at vtable opcode creation stuff. + * Makefile.in, make_vtable_ops.pl, vtable.tbl: + Initial stab at vtable opcode creation stuff. 2001-10-18 02:15 gregor - * MANIFEST, Makefile.in, interpreter.c, runops_cores.c, trace.c, - include/parrot/interpreter.h, include/parrot/runops_cores.h, - include/parrot/trace.h: Preparation for autogenerated runops cores: + * MANIFEST, Makefile.in, interpreter.c, runops_cores.c, trace.c, + include/parrot/interpreter.h, include/parrot/runops_cores.h, + include/parrot/trace.h: Preparation for autogenerated runops cores: - * Split tracing and runops core stuff out of interpreter.c into - trace.c and runops_cores.c + * Split tracing and runops core stuff out of interpreter.c into + trace.c and runops_cores.c - * Similar split of stuff from include/parrot/interpreter.h + * Similar split of stuff from include/parrot/interpreter.h - * Manifest and Makefile.in updates to make things still compile. + * Manifest and Makefile.in updates to make things still compile. 2001-10-18 01:21 gregor - * Makefile.in, ops2c.pl, ops2pm.pl, pbc2c.pl: Bug fixes: + * Makefile.in, ops2c.pl, ops2pm.pl, pbc2c.pl: Bug fixes: - * Makefile.in: examples/assembly/mops.c depends on pbc2c.pl + * Makefile.in: examples/assembly/mops.c depends on pbc2c.pl - * Makefile.in: Parrot/OpLib/core.pm depends on ops2pm.pl + * Makefile.in: Parrot/OpLib/core.pm depends on ops2pm.pl - * ops2c.pl: Added second arg to mkdir (perl 5.005_02 complains) + * ops2c.pl: Added second arg to mkdir (perl 5.005_02 complains) - * ops2pm.pl: Added second arg to mkdir (perl 5.005_02 complains) + * ops2pm.pl: Added second arg to mkdir (perl 5.005_02 complains) - * pbc2c.pl: Removed explicit include of , replacing it - with - copy of $ops->preamble. + * pbc2c.pl: Removed explicit include of , replacing it + with + copy of $ops->preamble. 2001-10-17 22:32 bdwheele - * interpreter.c: Moved op dump code into trace_op_dump, per Dan's - request. + * interpreter.c: Moved op dump code into trace_op_dump, per Dan's + request. 2001-10-17 22:08 gregor - * Parrot/Assembler.pm, lib/Parrot/Assembler.pm: - * Now handles label-and-comment-only lines. + * Parrot/Assembler.pm, lib/Parrot/Assembler.pm: + * Now handles label-and-comment-only lines. 2001-10-17 22:04 bdwheele - * interpreter.c: added more comprehensive trace output + * interpreter.c: added more comprehensive trace output 2001-10-17 16:50 tom - * Makefile.in: Removed the explicit rule for building mops.o from - mops.c so that the implicit rule for compiling C files is used - instead. This means that the chosen C flags are used, including any - optimisation options. + * Makefile.in: Removed the explicit rule for building mops.o from + mops.c so that the implicit rule for compiling C files is used + instead. This means that the chosen C flags are used, including any + optimisation options. 2001-10-17 15:24 tom - * core.ops, Parrot/OpsFile.pm, lib/Parrot/OpsFile.pm: Enhanced the - op explosion logic to be able to handle exploding this: + * core.ops, Parrot/OpsFile.pm, lib/Parrot/OpsFile.pm: Enhanced the + op explosion logic to be able to handle exploding this: - sub(i, i|ic, i|ic) + sub(i, i|ic, i|ic) - into these: + into these: - sub(i, i, i) - sub(i, i, ic) - sub(i, ic, i) + sub(i, i, i) + sub(i, i, ic) + sub(i, ic, i) - without also generating this unwanted version: + without also generating this unwanted version: - sub(i, ic, ic) + sub(i, ic, ic) - The enhanced version rejects any expansion where there is more than - one expanded argument and all the expanded arguments are constants. + The enhanced version rejects any expansion where there is more than + one expanded argument and all the expanded arguments are constants. 2001-10-17 14:20 simon - * Makefile.in, ops2c.pl, ops2pm.pl, examples/assembly/Makefile: - Build fixes to use correct Perl version and ensure that things are - running in the right directory. + * Makefile.in, ops2c.pl, ops2pm.pl, examples/assembly/Makefile: + Build fixes to use correct Perl version and ensure that things are + running in the right directory. - Courtesy of: Andy Dougherty + Courtesy of: Andy Dougherty 2001-10-17 13:16 simon - * Makefile.in: - core.pm is more critical than that. + * Makefile.in: + core.pm is more critical than that. 2001-10-17 13:05 simon - * core.ops, Parrot/OpsFile.pm, lib/Parrot/OpsFile.pm: - "Explode" ops into multiple versions for different parameters. + * core.ops, Parrot/OpsFile.pm, lib/Parrot/OpsFile.pm: + "Explode" ops into multiple versions for different parameters. - Courtesy of: Tom Hughes + Courtesy of: Tom Hughes 2001-10-17 12:54 simon - * Makefile.in: - Fix dependencies and cleaning. + * Makefile.in: + Fix dependencies and cleaning. 2001-10-17 12:45 simon - * Configure.pl, Makefile.in: - Fixes to make Parrot compile without the temporary build hack + * Configure.pl, Makefile.in: + Fixes to make Parrot compile without the temporary build hack - Courtesy of: Jason Gloudon + Courtesy of: Jason Gloudon 2001-10-16 20:43 gregor - * Makefile.in: - * Fixed dependencies for building Parrot/OpLib/core.pm + * Makefile.in: + * Fixed dependencies for building Parrot/OpLib/core.pm 2001-10-16 19:35 bdwheele - * core.ops, t/op/string.t: Changed set s,sc to use string_copy & - added test, thanks to Alex Gough + * core.ops, t/op/string.t: Changed set s,sc to use string_copy & + added test, thanks to Alex Gough 2001-10-16 16:49 bdwheele - * core.ops: added opcode variants for constants and 3 arg concat + * core.ops: added opcode variants for constants and 3 arg concat 2001-10-16 15:12 bdwheele - * core.ops: added "set Sx,Sy" as a string copy to match the other - register-to-register copies available + * core.ops: added "set Sx,Sy" as a string copy to match the other + register-to-register copies available 2001-10-16 13:09 gregor - * core.ops: - * Added #include in the preamble for gettimeofday(). + * core.ops: + * Added #include in the preamble for gettimeofday(). 2001-10-16 13:09 gregor - * Makefile.in: - * Removed cd t; make, which no longer applies + * Makefile.in: + * Removed cd t; make, which no longer applies 2001-10-16 03:18 bdwheele - * core.ops: fix save & restore operations to push correct type onto - stack. [good eye to Jason Gloudon for noticing this] + * core.ops: fix save & restore operations to push correct type onto + stack. [good eye to Jason Gloudon for noticing this] 2001-10-16 01:38 bdwheele - * core.ops, register.c, examples/assembly/fact.pasm, - include/parrot/register.h: send in the clones: clone routines for - parrot + example program + * core.ops, register.c, examples/assembly/fact.pasm, + include/parrot/register.h: send in the clones: clone routines for + parrot + example program 2001-10-15 22:37 gregor - * MANIFEST, Makefile.in, examples/assembly/.cvsignore, - examples/assembly/Makefile, examples/assembly/bsr.pasm, - examples/assembly/call.pasm, examples/assembly/euclid.pasm, - examples/assembly/jump.pasm, examples/assembly/local_label.pasm, - examples/assembly/mops.pasm, examples/assembly/stack.pasm, - examples/assembly/substr.pasm, examples/assembly/trace.pasm, - t/.cvsignore, t/Makefile, t/call.pasm, t/euclid.pasm, t/jump.pasm, - t/local_label.pasm, t/test.pasm, t/test2.pasm, t/test3.pasm, - t/test4.pasm, t/test5.pasm, t/trace.pasm: - * Moved examples from t/*.pasm to examples/assembly/*.pasm, with - some - renames so the names match what they demonstrate. + * MANIFEST, Makefile.in, examples/assembly/.cvsignore, + examples/assembly/Makefile, examples/assembly/bsr.pasm, + examples/assembly/call.pasm, examples/assembly/euclid.pasm, + examples/assembly/jump.pasm, examples/assembly/local_label.pasm, + examples/assembly/mops.pasm, examples/assembly/stack.pasm, + examples/assembly/substr.pasm, examples/assembly/trace.pasm, + t/.cvsignore, t/Makefile, t/call.pasm, t/euclid.pasm, t/jump.pasm, + t/local_label.pasm, t/test.pasm, t/test2.pasm, t/test3.pasm, + t/test4.pasm, t/test5.pasm, t/trace.pasm: + * Moved examples from t/*.pasm to examples/assembly/*.pasm, with + some + renames so the names match what they demonstrate. 2001-10-15 22:18 gregor - * core.ops, t/test.pasm: - * time_n uses gettimeofday() to get sub-second times. + * core.ops, t/test.pasm: + * time_n uses gettimeofday() to get sub-second times. - * t/test.pasm uses time_n directly rather than doing int stuff - and - converting to num later. + * t/test.pasm uses time_n directly rather than doing int stuff + and + converting to num later. 2001-10-15 12:28 gregor - * t/: test.pasm, test2.pasm, trace.pasm: - * t/test.pasm prints using string constants instead of string - regs. + * t/: test.pasm, test2.pasm, trace.pasm: + * t/test.pasm prints using string constants instead of string + regs. - * t/test2.pasm assembles (using implicit op modes) + * t/test2.pasm assembles (using implicit op modes) - * t/trace.pasm updated for new behavior of trace_ic, which does - not - require an 'end' after 'trace'. + * t/trace.pasm updated for new behavior of trace_ic, which does + not + require an 'end' after 'trace'. 2001-10-15 00:47 gregor - * core.ops, interpreter.c, test_main.c, - include/parrot/interpreter.h, t/test.pasm: * New interpreter flag - PARROT_PROFILE_FLAG + * core.ops, interpreter.c, test_main.c, + include/parrot/interpreter.h, t/test.pasm: * New interpreter flag + PARROT_PROFILE_FLAG - * New runops cores to handle profiling + * New runops cores to handle profiling - * Support for -p flag in test_prog to enable profiling + * Support for -p flag in test_prog to enable profiling - * New profile_ic op to control profiling at run-time + * New profile_ic op to control profiling at run-time 2001-10-14 21:54 gregor - * core.ops, Parrot/OpsFile.pm, docs/.cvsignore, docs/Makefile, - lib/Parrot/OpsFile.pm: Integrated op documentation. + * core.ops, Parrot/OpsFile.pm, docs/.cvsignore, docs/Makefile, + lib/Parrot/OpsFile.pm: Integrated op documentation. - * core.ops now contains POD documentation of ops, interspersed - with the - ops themselves + * core.ops now contains POD documentation of ops, interspersed + with the + ops themselves - * Ops are organized into POD =head2 sections + * Ops are organized into POD =head2 sections - * Parrot/OpsFile.pm now treats the preamble of the ops file as - anything - up to the first POD directive OR op definition. + * Parrot/OpsFile.pm now treats the preamble of the ops file as + anything + up to the first POD directive OR op definition. - * docs/Makefile now generates core_ops.pod from core.ops vi - perldoc -u. + * docs/Makefile now generates core_ops.pod from core.ops vi + perldoc -u. 2001-10-14 11:58 simon - * Makefile.in: - Unbreak Digital Un^W^WTru64 + * Makefile.in: + Unbreak Digital Un^W^WTru64 2001-10-14 11:00 simon - * Configure.pl: - Remove weird typo. + * Configure.pl: + Remove weird typo. 2001-10-14 10:56 tom - * Configure.pl: Stop Configure trying to make op_info.c and op.h as - op_info.c no longer exists and op.h is no longer a generated file. + * Configure.pl: Stop Configure trying to make op_info.c and op.h as + op_info.c no longer exists and op.h is no longer a generated file. 2001-10-14 10:54 tom - * Makefile.in: Added vtable.h to the list of things removed by the - clean target. + * Makefile.in: Added vtable.h to the list of things removed by the + clean target. 2001-10-14 01:43 gregor - * .cvsignore, MANIFEST, Makefile.in, basic_opcodes.ops, - build_interp_starter.pl, core.ops, disassemble.pl, interpreter.c, - make_op_header.pl, memory.c, opcheck.pl, opcode_table, ops2c.pl, - ops2pm.pl, packfile.c, pbc2c.pl, process_opfunc.pl, - Parrot/Assembler.pm, Parrot/Op.pm, Parrot/OpsFile.pm, - Parrot/OpLib/.cvsignore, lib/Parrot/Assembler.pm, lib/Parrot/Op.pm, - lib/Parrot/OpsFile.pm, lib/Parrot/OpLib/.cvsignore, - include/parrot/.cvsignore, include/parrot/interp_guts.h, - include/parrot/interpreter.h, include/parrot/op.h, - include/parrot/oplib/.cvsignore, t/.cvsignore, t/Makefile, - t/euclid.pasm, t/test.pasm, t/op/integer.t, t/op/number.t, - t/op/stacks.t, t/op/string.t, t/op/trans.t: - Moby Patch: - - * basic_opcodes.ops and opcode_table replaced by core.ops - - * process_opfunc.pl replaced by Parrot/OpsFile.pm, Parrot/Op.pm, - and ops2c.pl. These convert *.ops to *_ops.c and - include/parrot/oplib/*_ops.h - - * New ops2pm.pl converts *.ops to Parrot/OpLib/*.pm - - * disassemble.pl modified to use - - * interpreter.c modified to use structures in core_ops.c instead - of the old op_info and op_func stuff. We're not yet to the - point of handling multiple oplibs at a time, but we are getting - there... - - Fingerprinting stuff disabled for now. We used to go off - opcode_table. We need to rethink this. I have some ideas to - make it unnecessary, but it remains to be seen whether others - will like the direction they take us. - - Termination condition for while(){} loop in runops is now - (pc) instead of (*pc). Any op can cause a HALT by returning - a NULL pointer. Ops end, bounds and trace all do this. So, now - the 'end' op body is actually executed, although all it does - is HALT. - - * Makefile.in modified to perform a test build using pbc2c.pl, - which is the bytecode --> C compiler I've posted to the - list before. - - * Op full names are now autogenerated. Op root names must not - contain underscores, so some op renamings have happened. - Such as clear_i becoming cleari. + * .cvsignore, MANIFEST, Makefile.in, basic_opcodes.ops, + build_interp_starter.pl, core.ops, disassemble.pl, interpreter.c, + make_op_header.pl, memory.c, opcheck.pl, opcode_table, ops2c.pl, + ops2pm.pl, packfile.c, pbc2c.pl, process_opfunc.pl, + Parrot/Assembler.pm, Parrot/Op.pm, Parrot/OpsFile.pm, + Parrot/OpLib/.cvsignore, lib/Parrot/Assembler.pm, lib/Parrot/Op.pm, + lib/Parrot/OpsFile.pm, lib/Parrot/OpLib/.cvsignore, + include/parrot/.cvsignore, include/parrot/interp_guts.h, + include/parrot/interpreter.h, include/parrot/op.h, + include/parrot/oplib/.cvsignore, t/.cvsignore, t/Makefile, + t/euclid.pasm, t/test.pasm, t/op/integer.t, t/op/number.t, + t/op/stacks.t, t/op/string.t, t/op/trans.t: + Moby Patch: + + * basic_opcodes.ops and opcode_table replaced by core.ops + + * process_opfunc.pl replaced by Parrot/OpsFile.pm, Parrot/Op.pm, + and ops2c.pl. These convert *.ops to *_ops.c and + include/parrot/oplib/*_ops.h + + * New ops2pm.pl converts *.ops to Parrot/OpLib/*.pm + + * disassemble.pl modified to use + + * interpreter.c modified to use structures in core_ops.c instead + of the old op_info and op_func stuff. We're not yet to the + point of handling multiple oplibs at a time, but we are getting + there... + + Fingerprinting stuff disabled for now. We used to go off + opcode_table. We need to rethink this. I have some ideas to + make it unnecessary, but it remains to be seen whether others + will like the direction they take us. + + Termination condition for while(){} loop in runops is now + (pc) instead of (*pc). Any op can cause a HALT by returning + a NULL pointer. Ops end, bounds and trace all do this. So, now + the 'end' op body is actually executed, although all it does + is HALT. + + * Makefile.in modified to perform a test build using pbc2c.pl, + which is the bytecode --> C compiler I've posted to the + list before. + + * Op full names are now autogenerated. Op root names must not + contain underscores, so some op renamings have happened. + Such as clear_i becoming cleari. 2001-10-13 11:49 simon - * Configure.pl, MANIFEST: - Make parrot actually build again. + * Configure.pl, MANIFEST: + Make parrot actually build again. 2001-10-12 21:34 dan - * docs/parrot_assembly.pod: Added docs for the new save/restore/bsr - opcodes + * docs/parrot_assembly.pod: Added docs for the new save/restore/bsr + opcodes 2001-10-12 20:56 dan - * MANIFEST, Makefile.in, basic_opcodes.ops, interpreter.c, - opcode_table, process_opfunc.pl, stacks.c, include/parrot/stacks.h, - t/test3.pasm, t/test4.pasm, t/test5.pasm: Changes to support - generic stack now in. We also have subroutines, of a simple sort! + * MANIFEST, Makefile.in, basic_opcodes.ops, interpreter.c, + opcode_table, process_opfunc.pl, stacks.c, include/parrot/stacks.h, + t/test3.pasm, t/test4.pasm, t/test5.pasm: Changes to support + generic stack now in. We also have subroutines, of a simple sort! 2001-10-12 19:15 tom - * t/op/string.t: Improved string comparison tests try all string - combinations with each of the comparison ops. + * t/op/string.t: Improved string comparison tests try all string + combinations with each of the comparison ops. 2001-10-12 19:09 dan - * interpreter.c: Properly sets up generic stack now + * interpreter.c: Properly sets up generic stack now 2001-10-12 19:09 dan - * include/parrot/interpreter.h: Fixed stack chunk struct type in - interpreter structure + * include/parrot/interpreter.h: Fixed stack chunk struct type in + interpreter structure 2001-10-12 18:59 dan - * stacks.c, include/parrot/parrot.h, include/parrot/stacks.h: More - changes to get the generic stack working + * stacks.c, include/parrot/parrot.h, include/parrot/stacks.h: More + changes to get the generic stack working 2001-10-12 18:59 dan - * Configure.pl, MANIFEST, config_h.in, testparrotsizes_c.in, - hints/vms.pl: Made the changes to figure out mask bits for various - register and stack chunks + * Configure.pl, MANIFEST, config_h.in, testparrotsizes_c.in, + hints/vms.pl: Made the changes to figure out mask bits for various + register and stack chunks 2001-10-11 22:09 dan - * docs/parrot_assembly.pod: Tossed the parameter for return + * docs/parrot_assembly.pod: Tossed the parameter for return 2001-10-11 19:28 tom - * strnative.c: Assignment, not comparison. (Plus formatted for - coding standards) - - Courtesy of Bryan C. Warnock + * strnative.c: Assignment, not comparison. (Plus formatted for + coding standards) + + Courtesy of Bryan C. Warnock + +2001-10-05 Release 0.0.2 + - Parrot now works on all core platforms + - A large number of tests, in the standard Perl testing framework + - A new minilanguage (Jako) which compiles to Parrot assembly + - Documentation about the assembly language (docs/parrot_assembly.pod) + + - Separate modules for assembly (Parrot::Assemble) and bytecode + manipulation (Parrot::PackFile::*, packfile.c) + - Assembler completely rewritten + - Better operand-type guessing in the assembler + - Assembler support for '\n' etc. in string constants + - Code reformatted to match the coding standards + - New ops for register-constant INTEGER comparisons + - Macro expansion in the assembler + - IVs and NVs renamed to more friendly INTVAL and NUMVAL + - Hard-coded pack("") formats removed + - Better handling of floating-point numbers in assembler + - Moved floats to constant table (fixing many alignment issues) 2001-10-10 19:21 tom - * basic_opcodes.ops, opcode_table, string.c, strnative.c, - strutf16.c, strutf32.c, strutf8.c, docs/strings.pod, - include/parrot/string.h, t/op/string.t: Added support for string - comparisons and extended the comparison ops to include comparison - of strings. + * basic_opcodes.ops, opcode_table, string.c, strnative.c, + strutf16.c, strutf32.c, strutf8.c, docs/strings.pod, + include/parrot/string.h, t/op/string.t: Added support for string + comparisons and extended the comparison ops to include comparison + of strings. 2001-10-10 17:58 dan - * MANIFEST: Shouldn't have added vtable.h to the manifest... + * MANIFEST: Shouldn't have added vtable.h to the manifest... 2001-10-10 17:54 dan - * MANIFEST, stacks.c, vtable_h.pl, Parrot/Vtable.pm, - lib/Parrot/Vtable.pm: Now spits out the #defines for the various - vtable type entries properly + * MANIFEST, stacks.c, vtable_h.pl, Parrot/Vtable.pm, + lib/Parrot/Vtable.pm: Now spits out the #defines for the various + vtable type entries properly 2001-10-10 15:37 dan - * Parrot/Vtable.pm, lib/Parrot/Vtable.pm: Re-enabled change to - parse new vtable.tbl file now that I've actually checked *in* the - new format vtable.tbl file... + * Parrot/Vtable.pm, lib/Parrot/Vtable.pm: Re-enabled change to + parse new vtable.tbl file now that I've actually checked *in* the + new format vtable.tbl file... 2001-10-10 15:32 dan - * vtable.tbl: New Column to indicate the type of the vtabel entry - so we can know how many slots it takes + * vtable.tbl: New Column to indicate the type of the vtabel entry + so we can know how many slots it takes 2001-10-10 05:26 thgibbs - * Parrot/Vtable.pm, lib/Parrot/Vtable.pm, vtable_h.pl: Patch to - allow parrot to compile. PACKAGE is not defined, therefore, I - added a struct before it to have it not complain until we define - PACKAGE. Also, there was an extra shift in Vtable.pm and a missing - semicolon at the end of the struct declaration. + * Parrot/Vtable.pm, lib/Parrot/Vtable.pm, vtable_h.pl: Patch to + allow parrot to compile. PACKAGE is not defined, therefore, I + added a struct before it to have it not complain until we define + PACKAGE. Also, there was an extra shift in Vtable.pm and a missing + semicolon at the end of the struct declaration. 2001-10-10 05:09 thgibbs - * Parrot/Assembler.pm, lib/Parrot/Assembler.pm: This patch makes - string constants of the form U"string" become unicode encoded - parrot strings and the form N"string" become native encoded parrot - strings. + * Parrot/Assembler.pm, lib/Parrot/Assembler.pm: This patch makes + string constants of the form U"string" become unicode encoded + parrot strings and the form N"string" become native encoded parrot + strings. - Courtesy of: Tom Hughes + Courtesy of: Tom Hughes 2001-10-10 04:55 dan - * vtable_h.pl, Parrot/Vtable.pm, lib/Parrot/Vtable.pm: Start of - support for generating the vtable function table offset macros + * vtable_h.pl, Parrot/Vtable.pm, lib/Parrot/Vtable.pm: Start of + support for generating the vtable function table offset macros 2001-10-10 01:05 simon - * t/op/integer.t: - The test for cmod_i was using the 'mod Ix, Ix, Ix' form which - compiles into the mod op, not the cmod_i op, hence wasn't testing - what it thought it was. + * t/op/integer.t: + The test for cmod_i was using the 'mod Ix, Ix, Ix' form which + compiles into the mod op, not the cmod_i op, hence wasn't testing + what it thought it was. - Courtesy of: Alex Gough + Courtesy of: Alex Gough 2001-10-09 03:45 thgibbs - * Parrot/Assembler.pm, lib/Parrot/Assembler.pm: Patch to allow - assembler to generate unicode strings. + * Parrot/Assembler.pm, lib/Parrot/Assembler.pm: Patch to allow + assembler to generate unicode strings. - Courtesy of: Tom Hughes + Courtesy of: Tom Hughes 2001-10-08 19:30 brentdax - * Configure.pl, test_c.in, hints/vms.pl: Cleaner VMS support, more - info for Parrot::Config to remember, more flexible test.c stuff + * Configure.pl, test_c.in, hints/vms.pl: Cleaner VMS support, more + info for Parrot::Config to remember, more flexible test.c stuff 2001-10-08 15:04 gregor - * basic_opcodes.ops: - * Removed trash from early mod_i experiments (pardon our dust) + * basic_opcodes.ops: + * Removed trash from early mod_i experiments (pardon our dust) 2001-10-08 14:56 gregor - * basic_opcodes.ops: - * Fixed a couple of typos. + * basic_opcodes.ops: + * Fixed a couple of typos. 2001-10-08 14:45 gregor - * basic_opcodes.ops, opcode_table, t/op/integer.t, t/op/number.t: - Arithmetic enhancements: - - * Renamed existing mod_i as cmod_i and added "corrected" mod_i: - - NOTE: This "uncorrected mod" algorithm uses the C language's - built-in - mod operator (x % y), which is - - ... the remainder when x is divided by y, and thus is zero - when y - divides x exactly. - ... - The direction of truncation for / and teh sign of the - result for % - are machine-dependent for negative operands, as is the - action taken - on overflow or underflow. - -- - [1], page 41 - - Also: - - ... if the second operand is 0, the result is undefined. - Otherwise, it - is always true that (a/b)*b + a%b is equal to z. I both - operands are - non-negative, then teh remainder is non-negative and - smaller than the - divisor; if not, it is guaranteed only that the absolute - value of the - remainder is smaller than the absolute value of the - divisor. - -- - [1], page 205 - - This op is provided for those who need it (such as - speed-sensitive - applications with heavy use of mod, but using it only with - positive - arguments), but a more mathematically useful numeric mod based - on - floor(x/y) and defined with y == 0 is provided by the mod_i op. - - [1] Brian W. Kernighan and Dennis M. Ritchie, *The C - Programming - Language*, Second Edition. Prentice Hall, 1988. - - * Added "corrected" mod_i: - - NOTE: This "corrected mod" algorithm is based on the C code on - page 70 - of [1]. Assuming correct behavior of C's built-in mod operator - (%) with - positive arguments, this algorithm implements a mathematically - convenient - version of mod, defined thus: - - x mod y = x - y * floor(x / y) - - For more information on this definition of mod, see section 3.4 - of [2], - pages 81-85. - - References: - - [1] Donald E. Knuth, *MMIXware: A RISC Computer for the Third - Millennium* Springer, 1999. - - [2] Ronald L. Graham, Donald E. Knuth and Oren Patashnik, - *Concrete - Mathematics*, Second Edition. Addison-Wesley, 1994. - - * Added mod_n, using the same formula as above, but with FLOATVAL - arguments. - - * Added cmod_n, using the C math library's fmod() function: - - NOTE: This "uncorrected mod" algorithm uses the built-in C math - library's - fmod() function, which computes - - ... the remainder of dividing x by y. The return value is x - - n * y, - where n is the quotient of x / y, rounded towards zero to - an - integer. - -- fmod() manpage on RedHat - Linux 7.0 - - In addition, fmod() returns - - the remainder, unless y is zero, when the function fails - and errno - is set. - - According to page 251 of [1], the result when y is zero is - implementation- - defined. - - This op is provided for those who need it, but a more - mathematically - useful numeric mod based on floor(x/y) instead of truncate(x/y) - and - defined with y == 0 is provided by the mod_n op. - - [1] Brian W. Kernighan and Dennis M. Ritchie, *The C - Programming - Language*, Second Edition. Prentice Hall, 1988. - - * Added and modified tests as appropriate for the above. + * basic_opcodes.ops, opcode_table, t/op/integer.t, t/op/number.t: + Arithmetic enhancements: + + * Renamed existing mod_i as cmod_i and added "corrected" mod_i: + + NOTE: This "uncorrected mod" algorithm uses the C language's + built-in + mod operator (x % y), which is + + ... the remainder when x is divided by y, and thus is zero + when y + divides x exactly. + ... + The direction of truncation for / and teh sign of the + result for % + are machine-dependent for negative operands, as is the + action taken + on overflow or underflow. + -- + [1], page 41 + + Also: + + ... if the second operand is 0, the result is undefined. + Otherwise, it + is always true that (a/b)*b + a%b is equal to z. I both + operands are + non-negative, then teh remainder is non-negative and + smaller than the + divisor; if not, it is guaranteed only that the absolute + value of the + remainder is smaller than the absolute value of the + divisor. + -- + [1], page 205 + + This op is provided for those who need it (such as + speed-sensitive + applications with heavy use of mod, but using it only with + positive + arguments), but a more mathematically useful numeric mod based + on + floor(x/y) and defined with y == 0 is provided by the mod_i op. + + [1] Brian W. Kernighan and Dennis M. Ritchie, *The C + Programming + Language*, Second Edition. Prentice Hall, 1988. + + * Added "corrected" mod_i: + + NOTE: This "corrected mod" algorithm is based on the C code on + page 70 + of [1]. Assuming correct behavior of C's built-in mod operator + (%) with + positive arguments, this algorithm implements a mathematically + convenient + version of mod, defined thus: + + x mod y = x - y * floor(x / y) + + For more information on this definition of mod, see section 3.4 + of [2], + pages 81-85. + + References: + + [1] Donald E. Knuth, *MMIXware: A RISC Computer for the Third + Millennium* Springer, 1999. + + [2] Ronald L. Graham, Donald E. Knuth and Oren Patashnik, + *Concrete + Mathematics*, Second Edition. Addison-Wesley, 1994. + + * Added mod_n, using the same formula as above, but with FLOATVAL + arguments. + + * Added cmod_n, using the C math library's fmod() function: + + NOTE: This "uncorrected mod" algorithm uses the built-in C math + library's + fmod() function, which computes + + ... the remainder of dividing x by y. The return value is x + - n * y, + where n is the quotient of x / y, rounded towards zero to + an + integer. + -- fmod() manpage on RedHat + Linux 7.0 + + In addition, fmod() returns + + the remainder, unless y is zero, when the function fails + and errno + is set. + + According to page 251 of [1], the result when y is zero is + implementation- + defined. + + This op is provided for those who need it, but a more + mathematically + useful numeric mod based on floor(x/y) instead of truncate(x/y) + and + defined with y == 0 is provided by the mod_n op. + + [1] Brian W. Kernighan and Dennis M. Ritchie, *The C + Programming + Language*, Second Edition. Prentice Hall, 1988. + + * Added and modified tests as appropriate for the above. 2001-10-08 08:49 thgibbs - * include/parrot/exceptions.h, include/parrot/parrot.h, - include/parrot/string.h, include/parrot/strutf16.h, - include/parrot/strutf32.h, include/parrot/strutf8.h, - include/parrot/transcode.h, include/parrot/unicode.h, MANIFEST, - Makefile.in, global_setup.c, string.c, strnative.c, transcode.c, - strutf16.c, strutf32.c, strutf8.c: Added code to handle unicode - strings for utf8, utf16, and utf32. + * include/parrot/exceptions.h, include/parrot/parrot.h, + include/parrot/string.h, include/parrot/strutf16.h, + include/parrot/strutf32.h, include/parrot/strutf8.h, + include/parrot/transcode.h, include/parrot/unicode.h, MANIFEST, + Makefile.in, global_setup.c, string.c, strnative.c, transcode.c, + strutf16.c, strutf32.c, strutf8.c: Added code to handle unicode + strings for utf8, utf16, and utf32. - Courtesy of: Tom Hughes + Courtesy of: Tom Hughes 2001-10-08 08:10 thgibbs - * memory.c: Fixed uninitialized variables. + * memory.c: Fixed uninitialized variables. - Courtesy of: Bryan C. Warnock + Courtesy of: Bryan C. Warnock 2001-10-08 01:21 gregor - * packfile.c: * Casting a return value + * packfile.c: * Casting a return value - * Potential uninitialized variable fix + * Potential uninitialized variable fix - Courtesy of Bryan C. Warnock + Courtesy of Bryan C. Warnock 2001-10-08 01:15 gregor - * packfile.c, test_main.c: One of Bryan's languishing patches (with - a few tweaks of my own): + * packfile.c, test_main.c: One of Bryan's languishing patches (with + a few tweaks of my own): - * Line wrapping + * Line wrapping - * Printf format fixes + * Printf format fixes - Courtesy of: Bryan C. Warnock + Courtesy of: Bryan C. Warnock 2001-10-07 22:39 thgibbs - * build_interp_starter.pl: No longer adds (void*) casts to - interp_guts.c function table as they are not necessary in ANSI C. + * build_interp_starter.pl: No longer adds (void*) casts to + interp_guts.c function table as they are not necessary in ANSI C. 2001-10-07 16:27 gregor - * basic_opcodes.ops, interpreter.c, opcode_table, - process_opfunc.pl, test_main.c, include/parrot/interpreter.h, - t/trace.pasm: - * Two new ops, trace_ic and bounds_ic that twiddle bits in - interpreter->flags and set interpreter->resume_addr. + * basic_opcodes.ops, interpreter.c, opcode_table, + process_opfunc.pl, test_main.c, include/parrot/interpreter.h, + t/trace.pasm: + * Two new ops, trace_ic and bounds_ic that twiddle bits in + interpreter->flags and set interpreter->resume_addr. - * Two new runops core variants, so now we cover the relevant - flag space over {trace, notrace} x {boundscheck, noboundscheck} + * Two new runops core variants, so now we cover the relevant + flag space over {trace, notrace} x {boundscheck, noboundscheck} - * Runops core selection that converts the flags into an index - into - a core table (runops_cores) to get the core function pointer. + * Runops core selection that converts the flags into an index + into + a core table (runops_cores) to get the core function pointer. - * A new trace_op variant that doesn't do bounds checking (used by - the non-bounds-checking-but-tracing runops core). + * A new trace_op variant that doesn't do bounds checking (used by + the non-bounds-checking-but-tracing runops core). - * PC is passed into the cores so that they can be used when - resuming (they used to assume starting at the beginning of the - code, which would thwart resumption). + * PC is passed into the cores so that they can be used when + resuming (they used to assume starting at the beginning of the + code, which would thwart resumption). - * runops() itself is changed to have a while() loop in it so that - any time we drop out of the core, we'll resume if we have an - interpreter->resume_addr set (after reselecting the core, - though). + * runops() itself is changed to have a while() loop in it so that + any time we drop out of the core, we'll resume if we have an + interpreter->resume_addr set (after reselecting the core, + though). - * process_opfunc.pl has a new "macro": RESUME(), that sets up - interpreter->resume_addr. This is used by the new ops. The new - ops still return the new PC as the next op (which MUST be an - 'end' op to force the core loop to terminate -- *pc being false - is the only termination condition we can count on for all - cores). + * process_opfunc.pl has a new "macro": RESUME(), that sets up + interpreter->resume_addr. This is used by the new ops. The new + ops still return the new PC as the next op (which MUST be an + 'end' op to force the core loop to terminate -- *pc being false + is the only termination condition we can count on for all + cores). - * New interpreter flag: PARROT_BOUNDS_FLAG, used to control - bounds checking core selection. + * New interpreter flag: PARROT_BOUNDS_FLAG, used to control + bounds checking core selection. - * test_prog now has a '-b' flag in addition to the '-t' flag. - Now, - bounds checking is off by default (I saw a performance boost: - 6.3 Mop/s with -b, 7.0 Mop/s without). + * test_prog now has a '-b' flag in addition to the '-t' flag. + Now, + bounds checking is off by default (I saw a performance boost: + 6.3 Mop/s with -b, 7.0 Mop/s without). - * A new sample/test program: t/trace.pasm that twiddles the trace - flag while it is running. + * A new sample/test program: t/trace.pasm that twiddles the trace + flag while it is running. 2001-10-07 15:41 gregor - * .cvsignore, Makefile.in, build_interp_starter.pl, interpreter.c, - include/parrot/.cvsignore, include/parrot/interpreter.h: - Now that 0.0.2 is released, I can clear out the backlog of approved - but uncommitted patches. Here's one Dan approved on 2001-09-21 - (Simplified DO_OP): + * .cvsignore, Makefile.in, build_interp_starter.pl, interpreter.c, + include/parrot/.cvsignore, include/parrot/interpreter.h: + Now that 0.0.2 is released, I can clear out the backlog of approved + but uncommitted patches. Here's one Dan approved on 2001-09-21 + (Simplified DO_OP): - * test_prog and pdump are linked with only the files the need, - not - al the files. + * test_prog and pdump are linked with only the files the need, + not + al the files. - * build_interp_starter.pl writes out op_info.[hc], too. These - files - contain op name, arg count and arg type information. This will - be - useful for multiple things in the future, including better - trace - output and the crystalizing loader. + * build_interp_starter.pl writes out op_info.[hc], too. These + files + contain op name, arg count and arg type information. This will + be + useful for multiple things in the future, including better + trace + output and the crystalizing loader. - * The DO_OP macro is now simpler and doesn't require explicit - temporaries. + * The DO_OP macro is now simpler and doesn't require explicit + temporaries. - * interpreter.c is modified to use the new op info in tracing - output. + * interpreter.c is modified to use the new op info in tracing + output. - * The interpreter just points its opcode_funcs and opcode_info - members at the default tables rather than allocating memory on - the fly. + * The interpreter just points its opcode_funcs and opcode_info + members at the default tables rather than allocating memory on + the fly. 2001-10-07 03:58 thgibbs - * include/parrot/.cvsignore, vtable_h.pl: Minor updates fixing a - comment and adding vtable.h to .cvsignore as it is produced by - vtable_h.in + * include/parrot/.cvsignore, vtable_h.pl: Minor updates fixing a + comment and adding vtable.h to .cvsignore as it is produced by + vtable_h.in 2001-10-06 20:58 thgibbs - * vtable.tbl: Added * to REGEX type. + * vtable.tbl: Added * to REGEX type. - Courtesy of Bryan C. Warnock + Courtesy of Bryan C. Warnock 2001-10-06 13:41 simon - * MANIFEST, Makefile.in, vtable.tbl, vtable_h.pl, Parrot/Vtable.pm, - include/parrot/parrot.h, lib/Parrot/Vtable.pm: - Framework for vtable functions. + * MANIFEST, Makefile.in, vtable.tbl, vtable_h.pl, Parrot/Vtable.pm, + include/parrot/parrot.h, lib/Parrot/Vtable.pm: + Framework for vtable functions. 2001-10-06 06:52 thgibbs - * make_op_header.pl: Removed confusing and unused typedef. + * make_op_header.pl: Removed confusing and unused typedef. 2001-10-06 06:31 thgibbs - * Parrot/Opcode.pm, lib/Parrot/Opcode.pm: Removed variables that - are no longer used. + * Parrot/Opcode.pm, lib/Parrot/Opcode.pm: Removed variables that + are no longer used. 2001-10-06 06:26 thgibbs - * disassemble.pl: Changed intval to op in disassembler. + * disassemble.pl: Changed intval to op in disassembler. 2001-10-06 06:21 thgibbs - * Parrot/Assembler.pm, lib/Parrot/Assembler.pm: Fixed typo with - Assembler, local labels, and integer constants. + * Parrot/Assembler.pm, lib/Parrot/Assembler.pm: Fixed typo with + Assembler, local labels, and integer constants. 2001-10-06 03:11 ask - * Makefile.in: make `make test` actually run the tests on - darwin/macosx + * Makefile.in: make `make test` actually run the tests on + darwin/macosx 2001-10-06 02:04 thgibbs - * Parrot/Assembler.pm, Parrot/Opcode.pm, Parrot/PackFile.pm, - Parrot/String.pm, Parrot/PackFile/ConstTable.pm, - Parrot/PackFile/Constant.pm, include/parrot/packfile.h, - include/parrot/register.h, lib/Parrot/Assembler.pm, - lib/Parrot/Opcode.pm, lib/Parrot/PackFile.pm, lib/Parrot/String.pm, - lib/Parrot/PackFile/ConstTable.pm, lib/Parrot/PackFile/Constant.pm, - t/op/integer.t: No, it didn't mess anything up. I just forgot to - type make. :) + * Parrot/Assembler.pm, Parrot/Opcode.pm, Parrot/PackFile.pm, + Parrot/String.pm, Parrot/PackFile/ConstTable.pm, + Parrot/PackFile/Constant.pm, include/parrot/packfile.h, + include/parrot/register.h, lib/Parrot/Assembler.pm, + lib/Parrot/Opcode.pm, lib/Parrot/PackFile.pm, lib/Parrot/String.pm, + lib/Parrot/PackFile/ConstTable.pm, lib/Parrot/PackFile/Constant.pm, + t/op/integer.t: No, it didn't mess anything up. I just forgot to + type make. :) 2001-10-06 02:02 thgibbs - * Parrot/Assembler.pm, Parrot/Opcode.pm, Parrot/PackFile.pm, - Parrot/String.pm, Parrot/PackFile/ConstTable.pm, - Parrot/PackFile/Constant.pm, include/parrot/packfile.h, - include/parrot/register.h, lib/Parrot/Assembler.pm, - lib/Parrot/Opcode.pm, lib/Parrot/PackFile.pm, lib/Parrot/String.pm, - lib/Parrot/PackFile/ConstTable.pm, lib/Parrot/PackFile/Constant.pm, - t/op/integer.t: oops...this messed something up. I must have - missed something in the patch...I have reverted. + * Parrot/Assembler.pm, Parrot/Opcode.pm, Parrot/PackFile.pm, + Parrot/String.pm, Parrot/PackFile/ConstTable.pm, + Parrot/PackFile/Constant.pm, include/parrot/packfile.h, + include/parrot/register.h, lib/Parrot/Assembler.pm, + lib/Parrot/Opcode.pm, lib/Parrot/PackFile.pm, lib/Parrot/String.pm, + lib/Parrot/PackFile/ConstTable.pm, lib/Parrot/PackFile/Constant.pm, + t/op/integer.t: oops...this messed something up. I must have + missed something in the patch...I have reverted. 2001-10-06 01:57 thgibbs - * Parrot/Assembler.pm, Parrot/Opcode.pm, Parrot/PackFile.pm, - Parrot/String.pm, Parrot/PackFile/ConstTable.pm, - Parrot/PackFile/Constant.pm, include/parrot/packfile.h, - include/parrot/register.h, lib/Parrot/Assembler.pm, - lib/Parrot/Opcode.pm, lib/Parrot/PackFile.pm, lib/Parrot/String.pm, - lib/Parrot/PackFile/ConstTable.pm, lib/Parrot/PackFile/Constant.pm, - t/op/integer.t, Types_pm.in, basic_opcodes.ops, config_h.in, - memory.c, packfile.c, process_opfunc.pl, strnative.c, test_main.c: - This patch ensures that all bytecode is of type opcode_t except for - the constant table constants. That means that almost all of the - INTVALs in the code were replaced with opcode_t and the i pack type - was replaced with the op pack type in calls to pack_arg and such. - Also, since it has been declared that ALL integer constants are to - be 32 bits, some test cases were changed to ensure that an integer - constant was no bigger than 2 ** 31. - - process_opfunc.pl was also cleaned up to no longer look at either - opcode_table or interp_guts.h but gather all of its information - from Opcode.pm. - - The Assembler.pm module was changed to do late binding of arguments - so that 0 could be treated like 0.0 without having to be so - declared. Also, only strings now use the [sc:N] intermediate form - as it was unnecessary for integer and float types. + * Parrot/Assembler.pm, Parrot/Opcode.pm, Parrot/PackFile.pm, + Parrot/String.pm, Parrot/PackFile/ConstTable.pm, + Parrot/PackFile/Constant.pm, include/parrot/packfile.h, + include/parrot/register.h, lib/Parrot/Assembler.pm, + lib/Parrot/Opcode.pm, lib/Parrot/PackFile.pm, lib/Parrot/String.pm, + lib/Parrot/PackFile/ConstTable.pm, lib/Parrot/PackFile/Constant.pm, + t/op/integer.t, Types_pm.in, basic_opcodes.ops, config_h.in, + memory.c, packfile.c, process_opfunc.pl, strnative.c, test_main.c: + This patch ensures that all bytecode is of type opcode_t except for + the constant table constants. That means that almost all of the + INTVALs in the code were replaced with opcode_t and the i pack type + was replaced with the op pack type in calls to pack_arg and such. + Also, since it has been declared that ALL integer constants are to + be 32 bits, some test cases were changed to ensure that an integer + constant was no bigger than 2 ** 31. + + process_opfunc.pl was also cleaned up to no longer look at either + opcode_table or interp_guts.h but gather all of its information + from Opcode.pm. + + The Assembler.pm module was changed to do late binding of arguments + so that 0 could be treated like 0.0 without having to be so + declared. Also, only strings now use the [sc:N] intermediate form + as it was unnecessary for integer and float types. 2001-10-05 21:59 gregor - * MANIFEST, languages/jako/Makefile: - Fixed things due to the movement of little_languages/* to - languages/jako. + * MANIFEST, languages/jako/Makefile: + Fixed things due to the movement of little_languages/* to + languages/jako. 2001-10-05 18:31 gregor - * MANIFEST: - Updated MANIFEST to reflect recent additions for Jako. + * MANIFEST: + Updated MANIFEST to reflect recent additions for Jako. 2001-10-05 17:54 gregor - * languages/jako/: Makefile, bench.jako, euclid.jako, fact.jako, - fib.jako, hello.jako, jakoc, leibniz.jako, mandelbrot.jako, - mops.jako, primes.jako, sub.jako: - * Compiler: - - * User-defined subroutines. - * Generates assembly code with the Jako code in comments. - * "end;" no longer required at the end of programs. - * Better handling of const-reg and reg-const. - * Optimizes const-const operations to compile-time - evaluations. - * Constants in addition to variables. - * Arithmetic fixes. - * Allow leading minus signs in integer and number constants - (ahem). - * goto's. - - * New sample programs: - - * leibniz.jako (based on Greg McCarroll's leibniz.pasm - example) - * mandelbrot.jako (based on Leon Brocard's translation of - Glenn Rhodes' C code) - * mops.jako (based on t/test.pasm) - * primes.jako (based on Leon Brocard's primes.pasm example) - * sub.jako (demonstrates a simple user-defined subroutine) + * languages/jako/: Makefile, bench.jako, euclid.jako, fact.jako, + fib.jako, hello.jako, jakoc, leibniz.jako, mandelbrot.jako, + mops.jako, primes.jako, sub.jako: + * Compiler: + + * User-defined subroutines. + * Generates assembly code with the Jako code in comments. + * "end;" no longer required at the end of programs. + * Better handling of const-reg and reg-const. + * Optimizes const-const operations to compile-time + evaluations. + * Constants in addition to variables. + * Arithmetic fixes. + * Allow leading minus signs in integer and number constants + (ahem). + * goto's. + + * New sample programs: + + * leibniz.jako (based on Greg McCarroll's leibniz.pasm + example) + * mandelbrot.jako (based on Leon Brocard's translation of + Glenn Rhodes' C code) + * mops.jako (based on t/test.pasm) + * primes.jako (based on Leon Brocard's primes.pasm example) + * sub.jako (demonstrates a simple user-defined subroutine) 2001-10-05 12:54 gregor - * Parrot/Opcode.pm, lib/Parrot/Opcode.pm: - * Removed mysterious extra copy of code after POD. + * Parrot/Opcode.pm, lib/Parrot/Opcode.pm: + * Removed mysterious extra copy of code after POD. 2001-10-05 12:46 gregor - * basic_opcodes.ops, t/op/string.t: - * Enabled the previously SKIPped test of printing string regs - after - clear_s + * basic_opcodes.ops, t/op/string.t: + * Enabled the previously SKIPped test of printing string regs + after + clear_s - * Made print_s do nothing if the STRING pointer in the register - file - is NULL. + * Made print_s do nothing if the STRING pointer in the register + file + is NULL. 2001-10-04 21:19 dan - * Configure.pl: VMS tweaks + * Configure.pl: VMS tweaks 2001-10-04 21:17 dan - * hints/vms.pl: Hints file for VMS + * hints/vms.pl: Hints file for VMS 2001-10-04 00:58 bdwheele - * Parrot/Assembler.pm, lib/Parrot/Assembler.pm: fixed but in - Assembler which stopped equates from working. + * Parrot/Assembler.pm, lib/Parrot/Assembler.pm: fixed but in + Assembler which stopped equates from working. 2001-10-03 21:50 gregor - * Makefile.in, docs/.cvsignore, docs/Makefile, docs/parrotbyte.pod: + * Makefile.in, docs/.cvsignore, docs/Makefile, docs/parrotbyte.pod: - * More documentation updates for the packfile stuff. + * More documentation updates for the packfile stuff. 2001-10-03 21:37 gregor - * docs/parrotbyte.pod: - * Pointed the reader at Parrot::PackFile. + * docs/parrotbyte.pod: + * Pointed the reader at Parrot::PackFile. 2001-10-03 21:34 gregor - * Parrot/PackFile.pm, lib/Parrot/PackFile.pm: - * Updated documentation to match current implementation. + * Parrot/PackFile.pm, lib/Parrot/PackFile.pm: + * Updated documentation to match current implementation. 2001-10-03 18:30 gregor - * .cvsignore, disassemble.pl, Parrot/Assembler.pm, - lib/Parrot/Assembler.pm, t/call.pasm, t/euclid.pasm, - t/local_label.pasm, t/test.pasm, t/test2.pasm, t/test3.pasm, - t/op/basic.t: - * Added new syntax to the assembler to allow square-bracket - arithmetic expressions involving (global) labels, the current - instructions base address ('@'), numeric constants (not - equates) - and basic arithmetic operators (+, -, *, / -- although + and - - are likely to be the only ones used in practice). + * .cvsignore, disassemble.pl, Parrot/Assembler.pm, + lib/Parrot/Assembler.pm, t/call.pasm, t/euclid.pasm, + t/local_label.pasm, t/test.pasm, t/test2.pasm, t/test3.pasm, + t/op/basic.t: + * Added new syntax to the assembler to allow square-bracket + arithmetic expressions involving (global) labels, the current + instructions base address ('@'), numeric constants (not + equates) + and basic arithmetic operators (+, -, *, / -- although + and - + are likely to be the only ones used in practice). - * Fixed a bug in Parrot/Assemble.pl that caused macro expansion - to - fail (argument passing wasn't working). + * Fixed a bug in Parrot/Assemble.pl that caused macro expansion + to + fail (argument passing wasn't working). - * Enabled t/op/basic.t's last test, which is actually a copy of - the - code from t/call.pasm. Now all tests there are enabled and - working. + * Enabled t/op/basic.t's last test, which is actually a copy of + the + code from t/call.pasm. Now all tests there are enabled and + working. - * Added new example/test program t/call.pasm to demonstrate - working - macros and poor-man's subroutine calls + * Added new example/test program t/call.pasm to demonstrate + working + macros and poor-man's subroutine calls - * Added header comments to t/*.pasm + * Added header comments to t/*.pasm 2001-10-03 18:00 simon - * ChangeLog: - Needed, since it's in the MANIFEST. + * ChangeLog: + Needed, since it's in the MANIFEST. 2001-10-03 17:56 simon - * t/op/: string.t, time.t: - Small fixes to help Win32 on its way. + * t/op/: string.t, time.t: + Small fixes to help Win32 on its way. 2001-10-03 17:41 simon - * MANIFEST, README: - Oops. Tiny bugs. + * MANIFEST, README: + Oops. Tiny bugs. 2001-10-03 17:39 simon - * MANIFEST, NEWS, README: - README, NEWS and MANIFEST? Could it be time for Parrot 0.0.2? I - think so! + * MANIFEST, NEWS, README: + README, NEWS and MANIFEST? Could it be time for Parrot 0.0.2? I + think so! 2001-10-03 17:21 simon - * basic_opcodes.ops, interpreter.c, packfile.c: - Evil printf bandaid (which allows Sparc64 to pass tests) + * basic_opcodes.ops, interpreter.c, packfile.c: + Evil printf bandaid (which allows Sparc64 to pass tests) - Courtesy of: Andy Dougherty + Courtesy of: Andy Dougherty 2001-10-03 16:58 simon - * string.c, t/op/string.t: - chop fixes for n < 0 and tests + * string.c, t/op/string.t: + chop fixes for n < 0 and tests - Courtesy of: Alex Gough + Courtesy of: Alex Gough 2001-10-03 15:51 thgibbs - * interpreter.c: Changed an occurrence of INTVAL to opcode_t + * interpreter.c: Changed an occurrence of INTVAL to opcode_t - Courtesy of: Bryan C. Warnock + Courtesy of: Bryan C. Warnock 2001-10-02 17:48 dan - * include/parrot/stacks.h: Fix typo in function name + * include/parrot/stacks.h: Fix typo in function name 2001-10-02 17:35 dan - * include/parrot/stacks.h: changed to support new stack stuff - coming after 0.02 + * include/parrot/stacks.h: changed to support new stack stuff + coming after 0.02 2001-10-02 15:01 simon - * Configure.pl, Types_pm.in, basic_opcodes.ops, config_h.in, - interpreter.c, make_op_header.pl, memory.c, packfile.c, - process_opfunc.pl, register.c, string.c, strnative.c, - Parrot/Opcode.pm, Parrot/PackFile.pm, Parrot/String.pm, - lib/Parrot/Opcode.pm, lib/Parrot/PackFile.pm, lib/Parrot/String.pm, - Parrot/PackFile/ConstTable.pm, Parrot/PackFile/Constant.pm, - docs/overview.pod, docs/strings.pod, include/parrot/interpreter.h, - include/parrot/memory.h, include/parrot/packfile.h, - include/parrot/parrot.h, include/parrot/register.h, - include/parrot/stacks.h, include/parrot/string.h, - lib/Parrot/PackFile/ConstTable.pm, lib/Parrot/PackFile/Constant.pm: + * Configure.pl, Types_pm.in, basic_opcodes.ops, config_h.in, + interpreter.c, make_op_header.pl, memory.c, packfile.c, + process_opfunc.pl, register.c, string.c, strnative.c, + Parrot/Opcode.pm, Parrot/PackFile.pm, Parrot/String.pm, + lib/Parrot/Opcode.pm, lib/Parrot/PackFile.pm, lib/Parrot/String.pm, + Parrot/PackFile/ConstTable.pm, Parrot/PackFile/Constant.pm, + docs/overview.pod, docs/strings.pod, include/parrot/interpreter.h, + include/parrot/memory.h, include/parrot/packfile.h, + include/parrot/parrot.h, include/parrot/register.h, + include/parrot/stacks.h, include/parrot/string.h, + lib/Parrot/PackFile/ConstTable.pm, lib/Parrot/PackFile/Constant.pm: - The Great Renaming. + The Great Renaming. 2001-10-02 12:49 gregor - * process_opfunc.pl: - * Fixed a tyop: s/string/integer/ for INT_CONST expansion + * process_opfunc.pl: + * Fixed a tyop: s/string/integer/ for INT_CONST expansion 2001-10-02 12:40 simon - * basic_opcodes.ops, process_opfunc.pl, register.c, - include/parrot/register.h: - Move preprocessing of register accessors to process_opfunc.pl + * basic_opcodes.ops, process_opfunc.pl, register.c, + include/parrot/register.h: + Move preprocessing of register accessors to process_opfunc.pl - Courtesy of: Jason Gloudon + Courtesy of: Jason Gloudon 2001-10-02 01:20 ask - * README: add a few lines about lists. + * README: add a few lines about lists. 2001-10-01 23:00 brentdax - * Configure.pl, Makefile.in, hints/mswin32.pl: Make 'make clean' - work on Win32 (courtesy of Mattia Barbon ) + * Configure.pl, Makefile.in, hints/mswin32.pl: Make 'make clean' + work on Win32 (courtesy of Mattia Barbon ) 2001-10-01 22:50 brentdax - * Configure.pl, test_c.in: More changes for 64-bit compatibility + * Configure.pl, test_c.in: More changes for 64-bit compatibility 2001-10-01 21:51 simon - * process_opfunc.pl: - Michael Fischer's patch broke conditionals. + * process_opfunc.pl: + Michael Fischer's patch broke conditionals. 2001-10-01 15:38 simon - * process_opfunc.pl: - Small hack to keep process_opfunc.pl from generating extra return() - statements. + * process_opfunc.pl: + Small hack to keep process_opfunc.pl from generating extra return() + statements. - Courtesy of: Michael Fischer + Courtesy of: Michael Fischer 2001-10-01 15:32 simon - * Parrot/Opcode.pm, lib/Parrot/Opcode.pm: - Documentation fix. + * Parrot/Opcode.pm, lib/Parrot/Opcode.pm: + Documentation fix. - Courtesy of: Josh Wilmes + Courtesy of: Josh Wilmes 2001-10-01 01:49 simon - * packfile.c: - Simon is an idiot. Don't trust him with your code. + * packfile.c: + Simon is an idiot. Don't trust him with your code. - Courtesy of: Gibbs Tanton - tgibbs + Courtesy of: Gibbs Tanton - tgibbs 2001-10-01 00:59 simon - * Parrot/String.pm, lib/Parrot/String.pm: - Was in manifest, but not in CVS. + * Parrot/String.pm, lib/Parrot/String.pm: + Was in manifest, but not in CVS. 2001-09-30 21:25 simon - * MANIFEST, Types_pm.in, assemble.pl, basic_opcodes.ops, - disassemble.pl, packfile.c, pdump.c, process_opfunc.pl, - Parrot/Assembler.pm, Parrot/PackFile.pm, - Parrot/PackFile/ConstTable.pm, Parrot/PackFile/Constant.pm, - Parrot/PackFile/FixupTable.pm, lib/Parrot/Assembler.pm, - lib/Parrot/PackFile.pm, lib/Parrot/PackFile/ConstTable.pm, - lib/Parrot/PackFile/Constant.pm, lib/Parrot/PackFile/FixupTable.pm, - include/parrot/packfile.h, include/parrot/string.h: - Move NVs to the constant table. * Changes to Types_pm.in to make - life easier for some of the packing/etc. I'm doing elsewhere. - Also, we now pack 'n' as 'i'. + * MANIFEST, Types_pm.in, assemble.pl, basic_opcodes.ops, + disassemble.pl, packfile.c, pdump.c, process_opfunc.pl, + Parrot/Assembler.pm, Parrot/PackFile.pm, + Parrot/PackFile/ConstTable.pm, Parrot/PackFile/Constant.pm, + Parrot/PackFile/FixupTable.pm, lib/Parrot/Assembler.pm, + lib/Parrot/PackFile.pm, lib/Parrot/PackFile/ConstTable.pm, + lib/Parrot/PackFile/Constant.pm, lib/Parrot/PackFile/FixupTable.pm, + include/parrot/packfile.h, include/parrot/string.h: + Move NVs to the constant table. * Changes to Types_pm.in to make + life easier for some of the packing/etc. I'm doing elsewhere. + Also, we now pack 'n' as 'i'. - * Moved the guts of assemble.pl to Parrot/Assembler.pm so that - eventually we can use all these tools together inside scripts - rather than call out to the shell to run the programs. + * Moved the guts of assemble.pl to Parrot/Assembler.pm so that + eventually we can use all these tools together inside scripts + rather than call out to the shell to run the programs. - * As I was tracking down problems, I converted the internal - documentation of the assembler to POD from comments. + * As I was tracking down problems, I converted the internal + documentation of the assembler to POD from comments. - * Changed the numeric regexp in the assembler to detect leading - signs and trailing exponents. + * Changed the numeric regexp in the assembler to detect leading + signs and trailing exponents. - * Updated basic_opcodes.ops to fetch numeric constants from the - constant table. + * Updated basic_opcodes.ops to fetch numeric constants from the + constant table. - * Enhanced the disassembler in a number of ways to make my life - easier while tracking down bugs (try it out). It now puts in - labels for ops that are the destinations of flow control ops. + * Enhanced the disassembler in a number of ways to make my life + easier while tracking down bugs (try it out). It now puts in + labels for ops that are the destinations of flow control ops. - * packfile.c now has a TRACE_PACKFILE switch that can be set - to get it to print info as it processes. I needed this while - debugging, but I can remove it or change it before committing - if its a problem. + * packfile.c now has a TRACE_PACKFILE switch that can be set + to get it to print info as it processes. I needed this while + debugging, but I can remove it or change it before committing + if its a problem. - * Updated pdump.c because it was missing a call to init_world(). + * Updated pdump.c because it was missing a call to init_world(). - * Updated process_opfunc.pl to deal with numeric constants - being stored in the constant table instead of inline. + * Updated process_opfunc.pl to deal with numeric constants + being stored in the constant table instead of inline. - * Added multiple type support to Parrot/PackFile/Constant.pm + * Added multiple type support to Parrot/PackFile/Constant.pm - * Added Parrot/String.pm, to be used for constants. + * Added Parrot/String.pm, to be used for constants. - * Added packfile.[hc] functions for allocating new constants - of various types. + * Added packfile.[hc] functions for allocating new constants + of various types. - * Made string_copy visible to the world in parrot/string.h. + * Made string_copy visible to the world in parrot/string.h. - Wow. + Wow. - Courtesy of: Gregor N. Purdy + Courtesy of: Gregor N. Purdy 2001-09-29 15:56 gregor - * languages/jako/Makefile: - Removed assumption that '.' is on the path. + * languages/jako/Makefile: + Removed assumption that '.' is on the path. 2001-09-29 15:55 gregor - * languages/jako/Makefile: - Removed references to leibnitz test program. + * languages/jako/Makefile: + Removed references to leibnitz test program. 2001-09-29 15:21 thgibbs - * t/op/trans.t, basic_opcodes.ops: Added NV casts to transcendental - math ops args to work on Solaris. + * t/op/trans.t, basic_opcodes.ops: Added NV casts to transcendental + math ops args to work on Solaris. 2001-09-27 15:15 thgibbs - * assemble.pl: Added case insensitive matches to hex and binary - characters + * assemble.pl: Added case insensitive matches to hex and binary + characters - Courtesy of: Johnathan Scott Duff + Courtesy of: Johnathan Scott Duff 2001-09-27 04:46 thgibbs - * assemble.pl: This patch makes integer constants of the form - 0b[01]+ work with perl 5.005. The oct function in versions of perl - before 5.6 did not handle the 0b numeric prefix; therefore, it was - returning 0. To fix this, I added a from_binary function that - would take a binary string and return its decimal representation. - Now, instead of blindly calilng oct, it makes a distinction between - 0/0x numbers and 0b numbers. + * assemble.pl: This patch makes integer constants of the form + 0b[01]+ work with perl 5.005. The oct function in versions of perl + before 5.6 did not handle the 0b numeric prefix; therefore, it was + returning 0. To fix this, I added a from_binary function that + would take a binary string and return its decimal representation. + Now, instead of blindly calling oct, it makes a distinction between + 0/0x numbers and 0b numbers. 2001-09-26 19:30 thgibbs - * assemble.pl: Error now returns a non-zero status + * assemble.pl: Error now returns a non-zero status - Courtesy of: Andrew Kuchling + Courtesy of: Andrew Kuchling 2001-09-26 19:13 gregor - * MANIFEST, Makefile.in, basic_opcodes.ops, bytecode.c, - interpreter.c, packfile.c, pdump.c, test_main.c, - include/parrot/bytecode.h, include/parrot/interpreter.h, - include/parrot/packfile.h, include/parrot/parrot.h, t/op/integer.t, - t/op/stacks.t: - * bytecode.[hc] removed. packfile.[hc] are the interface to the - packfile/bytecode file from C. May be renamed in the future. + * MANIFEST, Makefile.in, basic_opcodes.ops, bytecode.c, + interpreter.c, packfile.c, pdump.c, test_main.c, + include/parrot/bytecode.h, include/parrot/interpreter.h, + include/parrot/packfile.h, include/parrot/parrot.h, t/op/integer.t, + t/op/stacks.t: + * bytecode.[hc] removed. packfile.[hc] are the interface to the + packfile/bytecode file from C. May be renamed in the future. - * packfile.[hc] changed to use 'struct PackFile *', etc. instead - of 'PackFile *', just like the interpreter, etc. + * packfile.[hc] changed to use 'struct PackFile *', etc. instead + of 'PackFile *', just like the interpreter, etc. - * Constants are accessed via the interpreter's 'code' member - (struct PackFile * code). Macros PCONST(i) and PNCONST are - provided to access constants by index and the number of - constants, respectively (assumes a variable 'interpreter' of - the appropriate type is in scope). + * Constants are accessed via the interpreter's 'code' member + (struct PackFile * code). Macros PCONST(i) and PNCONST are + provided to access constants by index and the number of + constants, respectively (assumes a variable 'interpreter' of + the appropriate type is in scope). - * Byte Code is accessed via the interpreter's 'code' member. + * Byte Code is accessed via the interpreter's 'code' member. - * Changed PackFile_Constant to point to a STRING instead of - having - members for the string_make() arguments. Also has a 'type' IV - in preparation for allowing multiple types of constants in - const_table. + * Changed PackFile_Constant to point to a STRING instead of + having + members for the string_make() arguments. Also has a 'type' IV + in preparation for allowing multiple types of constants in + const_table. - * Removed hardcoded example program from test_main.c. We have - plenty of test programs elsewhere. + * Removed hardcoded example program from test_main.c. We have + plenty of test programs elsewhere. - * test_prog now uses a PackFile to deal with the program before - sending it on to the interpreter. + * test_prog now uses a PackFile to deal with the program before + sending it on to the interpreter. - * Added missing 'end' ops to some tests in t/op/integer.t and - t/op/stacks.t. + * Added missing 'end' ops to some tests in t/op/integer.t and + t/op/stacks.t. 2001-09-26 18:38 thgibbs - * assemble.pl: Separated code into functions and added comments. + * assemble.pl: Separated code into functions and added comments. 2001-09-26 18:29 simon - * config_h.in: - Fix 64-bit chunk-base issue. + * config_h.in: + Fix 64-bit chunk-base issue. 2001-09-26 06:55 thgibbs - * t/op/bitwise.t: Added end to bitwise tests. + * t/op/bitwise.t: Added end to bitwise tests. 2001-09-26 00:54 dan - * docs/parrot_assembly.pod: Added in the base for threading, I/O, - and interpreter creation. Skeleton only, but it's something to peer - at. + * docs/parrot_assembly.pod: Added in the base for threading, I/O, + and interpreter creation. Skeleton only, but it's something to peer + at. 2001-09-25 21:44 thgibbs - * t/op/trans.t: Removed loops in transcendtal op test. + * t/op/trans.t: Removed loops in transcendtal op test. 2001-09-25 10:12 simon - * MANIFEST, t/op/basic.t, t/op/bitwise.t, t/op/integer.t, - t/op/string.t, t/op/time.t: - More tests + * MANIFEST, t/op/basic.t, t/op/bitwise.t, t/op/integer.t, + t/op/string.t, t/op/time.t: + More tests - Courtesy of: Alex Gough + Courtesy of: Alex Gough 2001-09-24 19:08 gregor - * t/op/number.t: - * Enabled the clear_n test. + * t/op/number.t: + * Enabled the clear_n test. 2001-09-24 18:56 gregor - * Parrot/.cvsignore: - * Ignore the generated Types.pm file. + * Parrot/.cvsignore: + * Ignore the generated Types.pm file. 2001-09-24 18:52 gregor - * languages/jako/Makefile, t/op/number.t: - * No need to skip the inc and dec numeric tests anymore. I fixed - the - assembler earlier today. + * languages/jako/Makefile, t/op/number.t: + * No need to skip the inc and dec numeric tests anymore. I fixed + the + assembler earlier today. 2001-09-24 18:21 simon - * MANIFEST, t/op/stacks.t: - Oops. + * MANIFEST, t/op/stacks.t: + Oops. 2001-09-24 18:19 simon - * build_interp_starter.pl, interpreter.c, string.c, Parrot/Test.pm, - include/parrot/exceptions.h, include/parrot/interpreter.h, - lib/Parrot/Test.pm, t/op/string.t: - 1) captured error output, so can test errors, this might be bad, - not sure. 2) basic tests for register stack frames, including some - errors 3) I think we can stop skipping one of the string tests 4) I - added some more substr tests, but substr was broken, so 5) changed - substr to work with out of range values, or 6) throw an error if - they're far too silly + * build_interp_starter.pl, interpreter.c, string.c, Parrot/Test.pm, + include/parrot/exceptions.h, include/parrot/interpreter.h, + lib/Parrot/Test.pm, t/op/string.t: + 1) captured error output, so can test errors, this might be bad, + not sure. 2) basic tests for register stack frames, including some + errors 3) I think we can stop skipping one of the string tests 4) I + added some more substr tests, but substr was broken, so 5) changed + substr to work with out of range values, or 6) throw an error if + they're far too silly - Courtesy of: Alex Gough + Courtesy of: Alex Gough 2001-09-24 17:27 gregor - * basic_opcodes.ops, opcode_table, t/op/number.t: - * Op set_n was missing. Added it and a test for it. We now have - the - same int and num ops, except mod is int-only. + * basic_opcodes.ops, opcode_table, t/op/number.t: + * Op set_n was missing. Added it and a test for it. We now have + the + same int and num ops, except mod is int-only. 2001-09-24 17:01 gregor - * assemble.pl: - * Fixed a typo: s/Line/line/ + * assemble.pl: + * Fixed a typo: s/Line/line/ 2001-09-24 16:02 gregor - * basic_opcodes.ops: - * Fixed dec_n_nc opcode, which had += where it should have had - -=. + * basic_opcodes.ops: + * Fixed dec_n_nc opcode, which had += where it should have had + -=. 2001-09-24 15:34 gregor - * assemble.pl: - * Fixed handling of constants starting with '0' that should not - be - sent through oct(). For example 'set N2 0.1' was being - interpreted - as 'set N2 0' (naughty). + * assemble.pl: + * Fixed handling of constants starting with '0' that should not + be + sent through oct(). For example 'set N2 0.1' was being + interpreted + as 'set N2 0' (naughty). - As reported by Leon Brocard in the comments - of - his mandelbrot.pasm example. + As reported by Leon Brocard in the comments + of + his mandelbrot.pasm example. 2001-09-24 02:21 bdwheele - * assemble.pl: fixed dumb code when --include was not specified. + * assemble.pl: fixed dumb code when --include was not specified. 2001-09-24 02:17 simon - * assemble.pl: - Shit-sweeping. + * assemble.pl: + Shit-sweeping. 2001-09-24 01:56 bdwheele - * assemble.pl: * Added --include=dir option to assembler to provide - a path to look for included files. * Error message of a macro is - defined inside of a macro + * assemble.pl: * Added --include=dir option to assembler to provide + a path to look for included files. * Error message of a macro is + defined inside of a macro 2001-09-23 21:29 bdwheele - * assemble.pl: Added __FILE__ equate, fixed __LINE__ equate. + * assemble.pl: Added __FILE__ equate, fixed __LINE__ equate. 2001-09-23 15:50 simon - * Configure.pl: - Fixed typo. Parrot might work again on non-8.3 filesystems. :) + * Configure.pl: + Fixed typo. Parrot might work again on non-8.3 filesystems. :) 2001-09-23 02:03 ask - * Configure.pl, test_c.in: fix missing newline at the end of test.c - Courtesy of: acme@astray.com (Leon Brocard) + * Configure.pl, test_c.in: fix missing newline at the end of test.c + Courtesy of: acme@astray.com (Leon Brocard) - rename 'test' executable used in Configure process to test_siz. + rename 'test' executable used in Configure process to test_siz. 2001-09-23 01:03 simon - * process_opfunc.pl: - iPaq fix. No, really. + * process_opfunc.pl: + iPaq fix. No, really. 2001-09-23 00:47 simon - * MANIFEST: - Missed several, in fact. + * MANIFEST: + Missed several, in fact. 2001-09-23 00:46 simon - * MANIFEST: - Missed one. + * MANIFEST: + Missed one. 2001-09-22 21:13 simon - * assemble.pl: - Assembler register numbering rigour. + * assemble.pl: + Assembler register numbering rigour. - Courtesy of: Leon Brocard + Courtesy of: Leon Brocard 2001-09-22 18:20 simon - * Makefile.in, lib/Test/More.pm, lib/Test/Simple.pm, - lib/Test/Utils.pm: - I'm sick of having to install Test::More everywhere. Temporary - measure until we remove this silly dependency. + * Makefile.in, lib/Test/More.pm, lib/Test/Simple.pm, + lib/Test/Utils.pm: + I'm sick of having to install Test::More everywhere. Temporary + measure until we remove this silly dependency. - Also a typo in Makefile.in which suggests some things were only - happening correctly by sheer chance. :) + Also a typo in Makefile.in which suggests some things were only + happening correctly by sheer chance. :) 2001-09-22 18:06 simon - * README: - test.pasm is dead, long like make test. + * README: + test.pasm is dead, long like make test. 2001-09-22 17:47 simon - * t/op/number.t: - De-fang overzealous floating point test. + * t/op/number.t: + De-fang overzealous floating point test. 2001-09-22 17:39 simon - * process_opfunc.pl: - Remove hard-coded NV size assumption. Tru64 is nearly there! + * process_opfunc.pl: + Remove hard-coded NV size assumption. Tru64 is nearly there! 2001-09-22 17:18 simon - * assemble.pl, disassemble.pl: - More portability fixups. + * assemble.pl, disassemble.pl: + More portability fixups. 2001-09-22 16:44 simon - * assemble.pl, Parrot/PackFile/Constant.pm, - lib/Parrot/PackFile/Constant.pm: - And I *think* this fixes Tru64. + * assemble.pl, Parrot/PackFile/Constant.pm, + lib/Parrot/PackFile/Constant.pm: + And I *think* this fixes Tru64. 2001-09-22 16:37 simon - * Parrot/PackFile/ConstTable.pm, lib/Parrot/PackFile/ConstTable.pm: + * Parrot/PackFile/ConstTable.pm, lib/Parrot/PackFile/ConstTable.pm: - Oops. + Oops. 2001-09-22 16:36 simon - * Parrot/PackFile.pm, Parrot/PackFile/ConstTable.pm, - Parrot/PackFile/Constant.pm, lib/Parrot/PackFile.pm, - lib/Parrot/PackFile/ConstTable.pm, lib/Parrot/PackFile/Constant.pm: + * Parrot/PackFile.pm, Parrot/PackFile/ConstTable.pm, + Parrot/PackFile/Constant.pm, lib/Parrot/PackFile.pm, + lib/Parrot/PackFile/ConstTable.pm, lib/Parrot/PackFile/Constant.pm: - More removal of hard-coded pack formats. + More removal of hard-coded pack formats. 2001-09-22 15:21 simon - * assemble.pl: + * assemble.pl: - Grrr. Why isn't this working? + Grrr. Why isn't this working? 2001-09-22 15:18 simon - * Parrot/PackFile.pm, Parrot/PackFile/ConstTable.pm, - lib/Parrot/PackFile.pm, lib/Parrot/PackFile/ConstTable.pm: + * Parrot/PackFile.pm, Parrot/PackFile/ConstTable.pm, + lib/Parrot/PackFile.pm, lib/Parrot/PackFile/ConstTable.pm: - Make assemble use the PackFile modules; also fixed some bugs in - them. + Make assemble use the PackFile modules; also fixed some bugs in + them. 2001-09-22 14:38 simon - * Configure.pl, MANIFEST, Types_pm.in, assemble.pl, disassemble.pl: + * Configure.pl, MANIFEST, Types_pm.in, assemble.pl, disassemble.pl: - Abstract the argument and opcode packing types and functions out - into a separate module. This *should* help us maintain consistency - when we change the various types. + Abstract the argument and opcode packing types and functions out + into a separate module. This *should* help us maintain consistency + when we change the various types. 2001-09-22 00:46 brentdax - * Configure.pl: Delete test.o (or its equivalent) after Configure's - test program finishes. + * Configure.pl: Delete test.o (or its equivalent) after Configure's + test program finishes. 2001-09-21 21:24 brentdax - * Parrot/Test.pm, lib/Parrot/Test.pm: Fix error with \ as path - separator (courtesy of Mattia Barbon ) + * Parrot/Test.pm, lib/Parrot/Test.pm: Fix error with \ as path + separator (courtesy of Mattia Barbon ) 2001-09-21 21:09 gregor - * Parrot/PackFile/ConstTable.pm, Parrot/PackFile/Constant.pm, - lib/Parrot/PackFile/ConstTable.pm, lib/Parrot/PackFile/Constant.pm: + * Parrot/PackFile/ConstTable.pm, Parrot/PackFile/Constant.pm, + lib/Parrot/PackFile/ConstTable.pm, lib/Parrot/PackFile/Constant.pm: - * Fixed pad calculation (similar to recent bug fix on C library) + * Fixed pad calculation (similar to recent bug fix on C library) 2001-09-21 20:23 simon - * disassemble.pl: - Pack types and sizes have gone askew. + * disassemble.pl: + Pack types and sizes have gone askew. 2001-09-21 20:18 brentdax - * Configure.pl: Fix typo in setting stuff from the C test program + * Configure.pl: Fix typo in setting stuff from the C test program 2001-09-21 10:25 simon - * basic_opcodes.ops, process_opfunc.pl: - Document patches. + * basic_opcodes.ops, process_opfunc.pl: + Document patches. - Courtesy of: Leon Brocard + Courtesy of: Leon Brocard 2001-09-21 06:06 ask - * Config_pm.in, assemble.pl: fix 5.005_03. + * Config_pm.in, assemble.pl: fix 5.005_03. 2001-09-21 06:03 ask - * Configure.pl: make the ivsize detection work for us normal people - without . in our PATH. :-) + * Configure.pl: make the ivsize detection work for us normal people + without . in our PATH. :-) 2001-09-21 05:56 brentdax - * test_main.c: Change _read to read for portability to Tru64 - (Damien Neil and likely many others) + * test_main.c: Change _read to read for portability to Tru64 + (Damien Neil and likely many others) 2001-09-21 05:46 ask - * Makefile.in: "update" target to update from cvs. + * Makefile.in: "update" target to update from cvs. 2001-09-21 05:44 brentdax - * Configure.pl, test_c.in: Fix issues with ivsize and nvsize + * Configure.pl, test_c.in: Fix issues with ivsize and nvsize 2001-09-21 02:43 brentdax - * Configure.pl: Fix a typo that forced the -g flag on + * Configure.pl: Fix a typo that forced the -g flag on 2001-09-20 22:41 dan - * packfile.c: Had some no-value returns. Naughty + * packfile.c: Had some no-value returns. Naughty 2001-09-20 22:40 dan - * t/test.pasm: Added labels to output + * t/test.pasm: Added labels to output 2001-09-20 15:39 simon - * Parrot/Opcode.pm, Parrot/Test.pm, lib/Parrot/Opcode.pm, - lib/Parrot/Test.pm: - This patch does two only somewhat related things. + * Parrot/Opcode.pm, Parrot/Test.pm, lib/Parrot/Opcode.pm, + lib/Parrot/Test.pm: + This patch does two only somewhat related things. - Parrot/Opcode.pm: Change the hard-wired assumption that sizeof(nv) - = 2*sizeof(iv) to a PConfig-type computed value. + Parrot/Opcode.pm: Change the hard-wired assumption that sizeof(nv) + = 2*sizeof(iv) to a PConfig-type computed value. - Parrot/Test.pm: Change it to run with the perl that was used to - generate this version of Parrot. This is useful if, for example, - you want to use bleadperl to build and test parrot (e.g. to try out - various 64-bit options) but you still have a 5.6.x (or 5.005_xx) - installed as the default 'perl' on your system. Since perl-5.7.x - is installed 'version-only', a plain 'perl' is quite likely to pick - up the older perl in such cases. Such an older perl might well not - understand pack('q') used in the assembler. + Parrot/Test.pm: Change it to run with the perl that was used to + generate this version of Parrot. This is useful if, for example, + you want to use bleadperl to build and test parrot (e.g. to try out + various 64-bit options) but you still have a 5.6.x (or 5.005_xx) + installed as the default 'perl' on your system. Since perl-5.7.x + is installed 'version-only', a plain 'perl' is quite likely to pick + up the older perl in such cases. Such an older perl might well not + understand pack('q') used in the assembler. - Courtesy of: Andy Dougherty + Courtesy of: Andy Dougherty 2001-09-20 15:14 gregor - * packfile.c: - * Fixed a typo in pad calculation that throwing off unpack and - pack. + * packfile.c: + * Fixed a typo in pad calculation that throwing off unpack and + pack. 2001-09-20 15:03 thgibbs - * t/op/integer.t: Removed overflow tests from integer.t. set_i_ic - tests now cover all registers. + * t/op/integer.t: Removed overflow tests from integer.t. set_i_ic + tests now cover all registers. - Courtesy of: Damien Neil neild@misago.org + Courtesy of: Damien Neil neild@misago.org 2001-09-20 14:48 thgibbs - * process_opfunc.pl: Changed process_opfunc.pl to work on 64 bit - machines. + * process_opfunc.pl: Changed process_opfunc.pl to work on 64 bit + machines. 2001-09-20 14:35 simon - * Configure.pl, assemble.pl: - Pack IVs correctly. + * Configure.pl, assemble.pl: + Pack IVs correctly. - Courtesy of: Andy Dougherty + Courtesy of: Andy Dougherty 2001-09-20 14:06 gregor - * languages/jako/jakoc: - * Fixed a tyop in the string interpolation regex. + * languages/jako/jakoc: + * Fixed a tyop in the string interpolation regex. - Courtesy of Michael L Maraist + Courtesy of Michael L Maraist 2001-09-20 13:56 gregor - * languages/jako/jakoc: - * Updated jakoc to work with the single-destination comp ops. + * languages/jako/jakoc: + * Updated jakoc to work with the single-destination comp ops. 2001-09-20 05:08 bdwheele - * assemble.pl: macro expansion. Here's the test macro I was using: + * assemble.pl: macro expansion. Here's the test macro I was using: - # this uses I32,I31 as temporaries. # macro must be preceded by a - label. testi macro num,got,want print "Test #" - print num print "..." set I32,want set - I31,got eq I32,I31,$ok print "NG\n" branch - $end $ok: print "OK\n" $end: endm + # this uses I32,I31 as temporaries. # macro must be preceded by a + label. testi macro num,got,want print "Test #" + print num print "..." set I32,want set + I31,got eq I32,I31,$ok print "NG\n" branch + $end $ok: print "OK\n" $end: endm - It is invoked as: + It is invoked as: - Test1: testi 1,I3,I2 + Test1: testi 1,I3,I2 2001-09-20 03:52 dan - * stacks.c, include/parrot/stacks.h: Preliminary files for the - generic stack support + * stacks.c, include/parrot/stacks.h: Preliminary files for the + generic stack support 2001-09-20 02:49 bdwheele - * assemble.pl: Added include processing to assemble.pl the syntax - is: include 'file.to.include' + * assemble.pl: Added include processing to assemble.pl the syntax + is: include 'file.to.include' 2001-09-19 23:57 thgibbs - * t/op/integer.t, t/op/number.t, assemble.pl, opcode_table: Fixed - opcode_table listing of if_i_ic and if_n_ic. Dan had changed the - function to only use 2 args, but the opcode_table still had three - listed. Fixed integer.t and number.t to use the new comparison - operators. Improved assemble.pl ability to grok operators by - constructing a function set and comparing operator types. + * t/op/integer.t, t/op/number.t, assemble.pl, opcode_table: Fixed + opcode_table listing of if_i_ic and if_n_ic. Dan had changed the + function to only use 2 args, but the opcode_table still had three + listed. Fixed integer.t and number.t to use the new comparison + operators. Improved assemble.pl ability to grok operators by + constructing a function set and comparing operator types. 2001-09-19 22:42 dan - * assemble.pl: Binmodes the output filehandles now. (No more - bytecode munching...) + * assemble.pl: Binmodes the output filehandles now. (No more + bytecode munching...) 2001-09-19 22:32 dan - * Configure.pl, basic_opcodes.ops, opcode_table, process_opfunc.pl, - t/euclid.pasm, t/test.pasm, t/test2.pasm: Changed opcodes so - conditional branches take a single argument, and fall through - otherwise. + * Configure.pl, basic_opcodes.ops, opcode_table, process_opfunc.pl, + t/euclid.pasm, t/test.pasm, t/test2.pasm: Changed opcodes so + conditional branches take a single argument, and fall through + otherwise. 2001-09-19 21:19 thgibbs - * memory.c: Added explanation of mem_allocate_aligned give by Dan - Sugalski + * memory.c: Added explanation of mem_allocate_aligned give by Dan + Sugalski - Courtesy of: Josh Wilmes + Courtesy of: Josh Wilmes 2001-09-19 21:04 thgibbs - * include/parrot/interpreter.h, Configure.pl, - build_interp_starter.pl, bytecode.c, config_h.in, interpreter.c, - process_opfunc.pl: Changed opcode_t from a union to a configurable - type. + * include/parrot/interpreter.h, Configure.pl, + build_interp_starter.pl, bytecode.c, config_h.in, interpreter.c, + process_opfunc.pl: Changed opcode_t from a union to a configurable + type. 2001-09-19 20:54 thgibbs - * assemble.pl: Missed a couple of changes for 64 bit portability. + * assemble.pl: Missed a couple of changes for 64 bit portability. 2001-09-19 20:37 gregor - * packfile.c, include/parrot/packfile.h: - * Added "methods" for setting and getting all the various - attributes, - probably sufficient for an assembler to use the library. + * packfile.c, include/parrot/packfile.h: + * Added "methods" for setting and getting all the various + attributes, + probably sufficient for an assembler to use the library. 2001-09-19 20:04 thgibbs - * assemble.pl: Modifications to run on 64 bit platforms. To run on - a 64 bit platform manually change the setting for 'i' from 'l' to - 'q'. This should be automatically done by a Configure setting in - the near future. + * assemble.pl: Modifications to run on 64 bit platforms. To run on + a 64 bit platform manually change the setting for 'i' from 'l' to + 'q'. This should be automatically done by a Configure setting in + the near future. 2001-09-19 19:10 thgibbs - * config_h.in: changed c++ comment to c comment. + * config_h.in: changed c++ comment to c comment. - Courtesy of: Andy Dougherty + Courtesy of: Andy Dougherty 2001-09-19 17:48 gregor - * .cvsignore, MANIFEST, Makefile.in, packfile.c, pdump.c, - include/parrot/packfile.h: - * C code for dealing with PackFiles as if they were objects. - Mostly - read-only interface for now, but it would not be hard to make - it - read-write. [packfile.c, include/parrot/packfile.h] + * .cvsignore, MANIFEST, Makefile.in, packfile.c, pdump.c, + include/parrot/packfile.h: + * C code for dealing with PackFiles as if they were objects. + Mostly + read-only interface for now, but it would not be hard to make + it + read-write. [packfile.c, include/parrot/packfile.h] - * PackFile Dumping program that falls short of disassembling, but - tests the above code and provides a hex listing of the byte - code - contents of the PackFile. [pdump.c] + * PackFile Dumping program that falls short of disassembling, but + tests the above code and provides a hex listing of the byte + code + contents of the PackFile. [pdump.c] - * New Makefile target 'pdump' for the above program, and related - Makefile.in changes. + * New Makefile target 'pdump' for the above program, and related + Makefile.in changes. - * Updated MANIFEST to reflect the added files + * Updated MANIFEST to reflect the added files - * Update .cvsignore to ignore pdump. + * Update .cvsignore to ignore pdump. 2001-09-19 14:55 thgibbs - * MANIFEST: Added number.t and trans.t to MANIFEST + * MANIFEST: Added number.t and trans.t to MANIFEST 2001-09-19 05:40 thgibbs - * process_opfunc.pl: Now taking & of opcode_t instead of i member - of union opcode_t. I hope this will be more portable for set_n_nc. + * process_opfunc.pl: Now taking & of opcode_t instead of i member + of union opcode_t. I hope this will be more portable for set_n_nc. 2001-09-19 05:39 thgibbs - * t/op/integer.t: Added end to test 1. + * t/op/integer.t: Added end to test 1. 2001-09-19 00:09 thgibbs - * t/op/number.t: Added end to each test + * t/op/number.t: Added end to each test 2001-09-19 00:00 simon - * t/op/number.t: - Number tests! Wooo! + * t/op/number.t: + Number tests! Wooo! - Courtesy of: Damien Neil + Courtesy of: Damien Neil 2001-09-18 23:52 thgibbs - * interpreter.c: Added casts to appropriate types to make -Wall not - complain on certain printf formats + * interpreter.c: Added casts to appropriate types to make -Wall not + complain on certain printf formats 2001-09-18 23:31 thgibbs - * t/op/integer.t: Added end to each test. + * t/op/integer.t: Added end to each test. 2001-09-18 22:54 thgibbs - * t/op/trans.t: Added trans.t for transcendental math function - tests. + * t/op/trans.t: Added trans.t for transcendental math function + tests. 2001-09-18 22:28 simon - * MANIFEST: - MANIFEST updates. (And notice how I carefully snuck in the - t/op/integer.t there...) + * MANIFEST: + MANIFEST updates. (And notice how I carefully snuck in the + t/op/integer.t there...) - Courtesy of: Andy Dougherty + Courtesy of: Andy Dougherty 2001-09-18 22:26 simon - * t/: integer.t, op/integer.t: - Except it doesn't go there. Duh. + * t/: integer.t, op/integer.t: + Except it doesn't go there. Duh. 2001-09-18 22:25 simon - * t/integer.t: - Tests for integer ops. + * t/integer.t: + Tests for integer ops. - Courtesy of: Damien Neil + Courtesy of: Damien Neil 2001-09-18 22:03 thgibbs - * include/parrot/bytecode.h, include/parrot/interpreter.h, - build_interp_starter.pl, bytecode.c, config_h.in, interpreter.c, - make_op_header.pl, process_opfunc.pl, test_main.c: Changed IV to - opcode_t union for operators. This required a few perl script - changes to output the correct type. There were also some changes - to allow -pedantic in gcc + * include/parrot/bytecode.h, include/parrot/interpreter.h, + build_interp_starter.pl, bytecode.c, config_h.in, interpreter.c, + make_op_header.pl, process_opfunc.pl, test_main.c: Changed IV to + opcode_t union for operators. This required a few perl script + changes to output the correct type. There were also some changes + to allow -pedantic in gcc 2001-09-18 21:07 gregor - * disassemble.pl, Parrot/PackFile.pm, - Parrot/PackFile/ConstTable.pm, Parrot/PackFile/Constant.pm, - lib/Parrot/PackFile.pm, lib/Parrot/PackFile/ConstTable.pm, - lib/Parrot/PackFile/Constant.pm: - Converted the disassembler to use the Parrot::PackFile Perl classes - to do its job. + * disassemble.pl, Parrot/PackFile.pm, + Parrot/PackFile/ConstTable.pm, Parrot/PackFile/Constant.pm, + lib/Parrot/PackFile.pm, lib/Parrot/PackFile/ConstTable.pm, + lib/Parrot/PackFile/Constant.pm: + Converted the disassembler to use the Parrot::PackFile Perl classes + to do its job. 2001-09-18 19:18 brentdax - * Makefile.in: Fix missing functions for real this time. (I - swear!) + * Makefile.in: Fix missing functions for real this time. (I + swear!) 2001-09-18 18:49 brentdax - * Configure.pl: Remove unnecessary -I.. (courtesy of Andy Dougherty - } + * Configure.pl: Remove unnecessary -I.. (courtesy of Andy Dougherty + } 2001-09-18 18:47 brentdax - * Makefile.in: Fix bugs with missing math, etc. functions + * Makefile.in: Fix bugs with missing math, etc. functions 2001-09-18 14:42 thgibbs - * strnative.c: Sorry Simon...forgot bustart was a void* not a - char*. + * strnative.c: Sorry Simon...forgot bustart was a void* not a + char*. 2001-09-18 13:59 thgibbs - * strnative.c: Removed unnecessary IV cast in concat. + * strnative.c: Removed unnecessary IV cast in concat. 2001-09-18 13:58 thgibbs - * t/op/string.t: Removed unnecessary IV cast in concat. Added end - to concat test in string.t + * t/op/string.t: Removed unnecessary IV cast in concat. Added end + to concat test in string.t 2001-09-18 12:07 gregor - * languages/jako/jakoc: - * var num ... no longer requires assignment - * automatic casting between int and num - * Fixed an error message + * languages/jako/jakoc: + * var num ... no longer requires assignment + * automatic casting between int and num + * Fixed an error message - Courtesy of: Simon Cozens + Courtesy of: Simon Cozens 2001-09-18 11:57 simon - * TODO: - Gonna have to start thinking of more things to do, soon. + * TODO: + Gonna have to start thinking of more things to do, soon. 2001-09-18 10:42 simon - * opcode_table: - Introduce a little more tidiness into the opcode table. + * opcode_table: + Introduce a little more tidiness into the opcode table. 2001-09-18 03:06 gregor - * basic_opcodes.ops, opcode_table, t/euclid.pasm: - Resurrected register-const ops per Dan's request. + * basic_opcodes.ops, opcode_table, t/euclid.pasm: + Resurrected register-const ops per Dan's request. 2001-09-18 02:20 gregor - * .cvsignore, Configure.pl, MANIFEST, Makefile.in, - build_interp_starter.pl, bytecode.h, events.h, exceptions.h, - global_setup.h, interpreter.h, io.h, memory.h, parrot.h, - process_opfunc.pl, register.h, stacks.h, string.h, strnative.h: - Committed some files that were missed in the last *.h moving - commit. + * .cvsignore, Configure.pl, MANIFEST, Makefile.in, + build_interp_starter.pl, bytecode.h, events.h, exceptions.h, + global_setup.h, interpreter.h, io.h, memory.h, parrot.h, + process_opfunc.pl, register.h, stacks.h, string.h, strnative.h: + Committed some files that were missed in the last *.h moving + commit. 2001-09-18 02:17 gregor - * include/parrot/.cvsignore: Fixed a typo in .cvsignore. + * include/parrot/.cvsignore: Fixed a typo in .cvsignore. 2001-09-18 02:16 gregor - * include/parrot/: .cvsignore, bytecode.h, events.h, exceptions.h, - global_setup.h, interpreter.h, io.h, memory.h, parrot.h, - register.h, stacks.h, string.h, strnative.h: Added .cvsignore file - missed in last commit for the move of *.h to include/parrot. + * include/parrot/: .cvsignore, bytecode.h, events.h, exceptions.h, + global_setup.h, interpreter.h, io.h, memory.h, parrot.h, + register.h, stacks.h, string.h, strnative.h: Added .cvsignore file + missed in last commit for the move of *.h to include/parrot. 2001-09-18 01:32 simon - * t/Makefile: - Trivial "clean" target to t/Makefile. + * t/Makefile: + Trivial "clean" target to t/Makefile. 2001-09-18 01:32 simon - * assemble.pl, build_interp_starter.pl, disassemble.pl, - Parrot/Opcode.pm, lib/Parrot/Opcode.pm: - Change icky Digest::MD5 for nice simple unpack() + * assemble.pl, build_interp_starter.pl, disassemble.pl, + Parrot/Opcode.pm, lib/Parrot/Opcode.pm: + Change icky Digest::MD5 for nice simple unpack() - Courtesy of: Jonathan Scott Duff + Courtesy of: Jonathan Scott Duff 2001-09-18 00:35 simon - * basic_opcodes.ops, opcode_table, docs/parrot_assembly.pod, - t/op/string.t: - New concat op. Hey, if I'm going to talk about it in an article, - better implement it... + * basic_opcodes.ops, opcode_table, docs/parrot_assembly.pod, + t/op/string.t: + New concat op. Hey, if I'm going to talk about it in an article, + better implement it... 2001-09-17 22:54 gregor - * MANIFEST, Parrot/PackFile.pm, Parrot/PackFile/ConstTable.pm, - Parrot/PackFile/Constant.pm, Parrot/PackFile/FixupTable.pm, - lib/Parrot/PackFile.pm, lib/Parrot/PackFile/ConstTable.pm, - lib/Parrot/PackFile/Constant.pm, lib/Parrot/PackFile/FixupTable.pm: + * MANIFEST, Parrot/PackFile.pm, Parrot/PackFile/ConstTable.pm, + Parrot/PackFile/Constant.pm, Parrot/PackFile/FixupTable.pm, + lib/Parrot/PackFile.pm, lib/Parrot/PackFile/ConstTable.pm, + lib/Parrot/PackFile/Constant.pm, lib/Parrot/PackFile/FixupTable.pm: - Functions for reading, writing and manipulating Parrot Pack Files. - NOTE: This is a proposed term based on the fact that the file - contains more than just byte code, and another language (Java) - calls its binary files by a broader notion of what's in them (Class - Files). Since Perl has packages, and since we use pack() to write - them, we'll call them PackFiles (at least for now). + Functions for reading, writing and manipulating Parrot Pack Files. + NOTE: This is a proposed term based on the fact that the file + contains more than just byte code, and another language (Java) + calls its binary files by a broader notion of what's in them (Class + Files). Since Perl has packages, and since we use pack() to write + them, we'll call them PackFiles (at least for now). - That does, however, beg the question of file extension. Should we - name the files "foo.pack" instead of "foo.pbc"? + That does, however, beg the question of file extension. Should we + name the files "foo.pack" instead of "foo.pbc"? 2001-09-17 20:23 thgibbs - * interpreter.c, test_main.c: Uncuddled else statements for coding - standard. + * interpreter.c, test_main.c: Uncuddled else statements for coding + standard. 2001-09-17 19:57 gregor - * Parrot/Opcode.pm, lib/Parrot/Opcode.pm: - Added a $revision variable, parsing of the CVS Id line in - opcode_table and a &revision() subroutine. + * Parrot/Opcode.pm, lib/Parrot/Opcode.pm: + Added a $revision variable, parsing of the CVS Id line in + opcode_table and a &revision() subroutine. 2001-09-17 19:53 gregor - * opcode_table: - Added a CVS Id tag to it. + * opcode_table: + Added a CVS Id tag to it. 2001-09-17 18:58 thgibbs - * interpreter.c: Cleared interpreter flags on creation. + * interpreter.c: Cleared interpreter flags on creation. 2001-09-17 18:38 gregor - * build_interp_starter.pl, bytecode.c, bytecode.h, interpreter.c, - interpreter.h, test_main.c: - * Provides macros in interp_guts.h for setting up arrays with - op names and op arg counts (done via build_interp_starter.pl). - - These are used in the op tracing - - * The functions in bytecode.[hc] pass around a pointer to the - length - of the bytecode so that later when we get to runops, we know - how much bytecode we've got and we can detect out-of-bounds - jumping. The documentation is updated, too. - - * runops in interpreter.c now looks at interpreter->flags to - decide if the core of runops should be runops_trace_core or - runops_notrace_core. These new functions contain just the - while-loop portion of runops. A new function runops_generic - does any other setup (such as checking the bytecode - fingerprint) or wrapup (such as complaining if we ended up - out-of-bounds). NOTE: I didn't know what we should do for - functions in here that are not part of the api, so I gave - them docs with 'TODO' marks mentioning they really aren't - part of the api. Guidance appreciated. - - * test_main.c now checks for '-t' arg and sets the tracing flag - on its interpreter instance as appropriate. + * build_interp_starter.pl, bytecode.c, bytecode.h, interpreter.c, + interpreter.h, test_main.c: + * Provides macros in interp_guts.h for setting up arrays with + op names and op arg counts (done via build_interp_starter.pl). + + These are used in the op tracing + + * The functions in bytecode.[hc] pass around a pointer to the + length + of the bytecode so that later when we get to runops, we know + how much bytecode we've got and we can detect out-of-bounds + jumping. The documentation is updated, too. + + * runops in interpreter.c now looks at interpreter->flags to + decide if the core of runops should be runops_trace_core or + runops_notrace_core. These new functions contain just the + while-loop portion of runops. A new function runops_generic + does any other setup (such as checking the bytecode + fingerprint) or wrapup (such as complaining if we ended up + out-of-bounds). NOTE: I didn't know what we should do for + functions in here that are not part of the api, so I gave + them docs with 'TODO' marks mentioning they really aren't + part of the api. Guidance appreciated. + + * test_main.c now checks for '-t' arg and sets the tracing flag + on its interpreter instance as appropriate. 2001-09-17 17:47 bdwheele - * assemble.pl: added some default equates, and if they're sub - references, they are computed each time it is referenced. + * assemble.pl: added some default equates, and if they're sub + references, they are computed each time it is referenced. 2001-09-17 16:15 dan - * interpreter.h: + * interpreter.h: - Added flags to the interpreter structure and defined a few. + Added flags to the interpreter structure and defined a few. 2001-09-17 15:51 simon - * bytecode.h, string.h: - VAR_SCOPE on globals. + * bytecode.h, string.h: + VAR_SCOPE on globals. 2001-09-17 15:20 simon - * MANIFEST: - Parrot/Opcode.pm, Parrot/Test.pm into MANIFEST. + * MANIFEST: + Parrot/Opcode.pm, Parrot/Test.pm into MANIFEST. 2001-09-17 15:05 gregor - * t/jump.pasm, MANIFEST: - Added a test program to demonstrate jump_i. + * t/jump.pasm, MANIFEST: + Added a test program to demonstrate jump_i. 2001-09-17 14:44 thgibbs - * register.c: Fixed register pop not using correct offset (off by - one). + * register.c: Fixed register pop not using correct offset (off by + one). - Courtesy of: Philip Kendall + Courtesy of: Philip Kendall 2001-09-17 13:56 thgibbs - * interpreter.c, register.c: Added code to call Parrot_clear_s - during initialization and Parrot_clear_s and Parrot_clear_p when a - new stack frame is pushed. + * interpreter.c, register.c: Added code to call Parrot_clear_s + during initialization and Parrot_clear_s and Parrot_clear_p when a + new stack frame is pushed. 2001-09-17 13:51 gregor - * languages/jako/: Makefile, bench.jako, euclid.jako, fact.jako, - fib.jako, hello.jako: Added bench.pasm to "clean" + * languages/jako/: Makefile, bench.jako, euclid.jako, fact.jako, + fib.jako, hello.jako: Added bench.pasm to "clean" 2001-09-17 13:49 gregor - * languages/jako/: jakoc, Makefile: - Added CVS Id tag. + * languages/jako/: jakoc, Makefile: + Added CVS Id tag. 2001-09-17 13:49 gregor - * languages/jako/jakoc: - Code streamlining. + * languages/jako/jakoc: + Code streamlining. - Courtesy of: Buggs + Courtesy of: Buggs 2001-09-17 13:29 gregor - * MANIFEST, opcheck.pl: - Added an opcode_table checker to make sure that all opcodes listed - there conform to a simple set of naming rules (rules themselves, of - course, are subject to change). + * MANIFEST, opcheck.pl: + Added an opcode_table checker to make sure that all opcodes listed + there conform to a simple set of naming rules (rules themselves, of + course, are subject to change). 2001-09-17 13:23 thgibbs - * string.c: Modified string.c to correctly use the return value of - realloc. + * string.c: Modified string.c to correctly use the return value of + realloc. 2001-09-17 05:26 brentdax - * Makefile.in: Making the Makefile smarter + * Makefile.in: Making the Makefile smarter 2001-09-16 23:06 brentdax - * hints/mswin32.pl: Finishing the Configure hints + * hints/mswin32.pl: Finishing the Configure hints 2001-09-16 23:05 brentdax - * Configure.pl, Makefile.in, parrot.h, test_main.c, - Parrot/Opcode.pm, lib/Parrot/Opcode.pm: Win32 compatibility, - Configure hints, 5.005 compatibility, MANIFEST checking + * Configure.pl, Makefile.in, parrot.h, test_main.c, + Parrot/Opcode.pm, lib/Parrot/Opcode.pm: Win32 compatibility, + Configure hints, 5.005 compatibility, MANIFEST checking 2001-09-16 19:25 bdwheele - * assemble.pl: parrot assembly equates + * assemble.pl: parrot assembly equates 2001-09-16 18:03 gregor - * Makefile.in: - Added 'test' target to run new test suite. + * Makefile.in: + Added 'test' target to run new test suite. 2001-09-16 17:33 simon - * basic_opcodes.ops: - 'not' was being !, rather than ~. Too many Perl programmers here, I - suspect. + * basic_opcodes.ops: + 'not' was being !, rather than ~. Too many Perl programmers here, I + suspect. - Courtesy of: Tom Hughes + Courtesy of: Tom Hughes 2001-09-16 17:21 simon - * Parrot/Test.pm, lib/Parrot/Test.pm, t/harness, t/op/basic.t, - t/op/string.t: - A *real* test suite! + * Parrot/Test.pm, lib/Parrot/Test.pm, t/harness, t/op/basic.t, + t/op/string.t: + A *real* test suite! - Courtesy of: "Mattia Barbon" + Courtesy of: "Mattia Barbon" 2001-09-16 16:49 gregor - * basic_opcodes.ops, opcode_table: - At Dan's request, my new register-constant comparison ops have been - removed. + * basic_opcodes.ops, opcode_table: + At Dan's request, my new register-constant comparison ops have been + removed. 2001-09-16 16:40 gregor - * languages/jako/jakoc: - Fixed a copy-paste error in one of jakoc's error messages. + * languages/jako/jakoc: + Fixed a copy-paste error in one of jakoc's error messages. - Courtesy of: Buggs + Courtesy of: Buggs 2001-09-16 16:37 gregor - * languages/jako/jakoc: - Modified comparison implementation to use temporary registers in - the case of register-constant and constant-register comparisons. - This will allow the compiler to emit code that works when the - constant-comparison ops are backed out of Parrot. If the ops ever - make their way back in, then jakoc can emit more efficient code - again. + * languages/jako/jakoc: + Modified comparison implementation to use temporary registers in + the case of register-constant and constant-register comparisons. + This will allow the compiler to emit code that works when the + constant-comparison ops are backed out of Parrot. If the ops ever + make their way back in, then jakoc can emit more efficient code + again. 2001-09-16 16:19 bdwheele - * assemble.pl, t/local_label.pasm: Added local labels ($whatever) - ... though not subroutine based like the documentation wants, they - are local to the last non-local label defined. + * assemble.pl, t/local_label.pasm: Added local labels ($whatever) + ... though not subroutine based like the documentation wants, they + are local to the last non-local label defined. 2001-09-16 14:02 simon - * MANIFEST: - And remember, when you add stuff, keep the manifest up to date. + * MANIFEST: + And remember, when you add stuff, keep the manifest up to date. 2001-09-16 02:55 ask - * Makefile.in: a "shared" target for building libparrot.so + * Makefile.in: a "shared" target for building libparrot.so 2001-09-16 02:45 thgibbs - * bytecode.c, bytecode.h, events.h, exceptions.h, global_setup.c, - global_setup.h, interpreter.c, interpreter.h, io.h, - make_op_header.pl, memory.c, memory.h, parrot.c, parrot.h, - process_opfunc.pl, register.c, register.h, stacks.h, string.c, - string.h, strnative.c, strnative.h, test_main.c: Updated files to - use the coding standard PDD. Also changed Perl_Interp to - Parrot_Interp. + * bytecode.c, bytecode.h, events.h, exceptions.h, global_setup.c, + global_setup.h, interpreter.c, interpreter.h, io.h, + make_op_header.pl, memory.c, memory.h, parrot.c, parrot.h, + process_opfunc.pl, register.c, register.h, stacks.h, string.c, + string.h, strnative.c, strnative.h, test_main.c: Updated files to + use the coding standard PDD. Also changed Perl_Interp to + Parrot_Interp. 2001-09-16 02:21 ask - * README: emphasise the bits about the license not being worked out - yet. + * README: emphasise the bits about the license not being worked out + yet. 2001-09-15 22:21 simon - * process_opfunc.pl: - basic_opcodes.c should *scream* that it's autogenerated. + * process_opfunc.pl: + basic_opcodes.c should *scream* that it's autogenerated. 2001-09-15 21:58 gregor - * languages/jako/Makefile: - Fixed Makefile to use 'jakoc' instead of 'jako_compiler.pl' to - compile. + * languages/jako/Makefile: + Fixed Makefile to use 'jakoc' instead of 'jako_compiler.pl' to + compile. 2001-09-15 21:58 gregor - * languages/jako/: jako_compiler.pl, jakoc: - Renamed the Jako compiler to jakoc from jako_compiler.pl + * languages/jako/: jako_compiler.pl, jakoc: + Renamed the Jako compiler to jakoc from jako_compiler.pl 2001-09-15 21:51 gregor - * languages/jako/: Makefile, bench.jako, euclid.jako, - jako_compiler.pl: - Added a new bench.jako example based on Leon Brocard's Bench.java. + * languages/jako/: Makefile, bench.jako, euclid.jako, + jako_compiler.pl: + Added a new bench.jako example based on Leon Brocard's Bench.java. - Jako Compiler: * fix a bug in assignment handling * add some - more conditionals to while and if * revert to using implicit - opcodes in a few cases that were broken before the assembler - patch went in recently. + Jako Compiler: * fix a bug in assignment handling * add some + more conditionals to while and if * revert to using implicit + opcodes in a few cases that were broken before the assembler + patch went in recently. 2001-09-15 21:46 gregor - * assemble.pl, basic_opcodes.ops, opcode_table: - New ops for register-constant INTEGER comparisons: + * assemble.pl, basic_opcodes.ops, opcode_table: + New ops for register-constant INTEGER comparisons: - {eq,ne,lt,le,gt,ge}_ic_ic + {eq,ne,lt,le,gt,ge}_ic_ic - New ops for register-register and register-constant NUMERIC - comparisons: + New ops for register-register and register-constant NUMERIC + comparisons: - eq_nc_ic - {ne,lt,le,gt,ge}_{n,nc}_ic + eq_nc_ic + {ne,lt,le,gt,ge}_{n,nc}_ic - Assembler: + Assembler: - Allow uppercase and underscores in labels. + Allow uppercase and underscores in labels. - Tweaks to the op infer code to make it work with the examples - I've been - creating. + Tweaks to the op infer code to make it work with the examples + I've been + creating. 2001-09-15 19:16 thgibbs - * README: Updated README to include Configure.pl + * README: Updated README to include Configure.pl 2001-09-15 17:05 simon - * build_interp_starter.pl: - Casting happiness + * build_interp_starter.pl: + Casting happiness - Courtesy of: Jarkko Hietaniemi + Courtesy of: Jarkko Hietaniemi 2001-09-15 16:45 simon - * assemble.pl: - And the same again: Parrot/Opcode.pm wasn't "..-aware". + * assemble.pl: + And the same again: Parrot/Opcode.pm wasn't "..-aware". 2001-09-15 16:40 simon - * t/Makefile: - The Parrot/Opcode.pm dependency means we need to do -I.. in the - test Makefile + * t/Makefile: + The Parrot/Opcode.pm dependency means we need to do -I.. in the + test Makefile 2001-09-15 12:26 simon - * memory.c: - Fixed to match the coding standards. + * memory.c: + Fixed to match the coding standards. - Courtesy of: Gibbs Tanton - tgibbs + Courtesy of: Gibbs Tanton - tgibbs 2001-09-15 01:57 ask - * Configure.pl, Makefile.in, Parrot/Opcode.pm, - lib/Parrot/Opcode.pm: make the Makefile use the perl that was used - to run Configure.pl + * Configure.pl, Makefile.in, Parrot/Opcode.pm, + lib/Parrot/Opcode.pm: make the Makefile use the perl that was used + to run Configure.pl 2001-09-15 01:48 ask - * Parrot/Opcode.pm, lib/Parrot/Opcode.pm: if we need perl 5.6, just - say so. :-) + * Parrot/Opcode.pm, lib/Parrot/Opcode.pm: if we need perl 5.6, just + say so. :-) 2001-09-15 01:42 gregor - * languages/jako/: euclid.jako, fact.jako, fib.jako, - jako_compiler.pl: - Compiler: Added variable interpolation in double-quoted strings. - Examples: Made use of variable interpolation. + * languages/jako/: euclid.jako, fact.jako, fib.jako, + jako_compiler.pl: + Compiler: Added variable interpolation in double-quoted strings. + Examples: Made use of variable interpolation. 2001-09-15 01:28 gregor - * Parrot/.cvsignore: - Ignore the Config.pm generated file. + * Parrot/.cvsignore: + Ignore the Config.pm generated file. 2001-09-15 01:22 gregor - * languages/jako/: .cvsignore, Makefile, euclid.jako, fact.jako, - fib.jako, hello.jako, jako_compiler.pl: - gnp: Added some more sample Jako files and added many more - operators to the compiler. Preparations for supporting all the Math - and bitwise ops. + * languages/jako/: .cvsignore, Makefile, euclid.jako, fact.jako, + fib.jako, hello.jako, jako_compiler.pl: + gnp: Added some more sample Jako files and added many more + operators to the compiler. Preparations for supporting all the Math + and bitwise ops. 2001-09-14 19:06 simon - * assemble.pl, build_interp_starter.pl, disassemble.pl, - make_op_header.pl, process_opfunc.pl, Parrot/Opcode.pm, - lib/Parrot/Opcode.pm: - Move common table reading stuff to a module. + * assemble.pl, build_interp_starter.pl, disassemble.pl, + make_op_header.pl, process_opfunc.pl, Parrot/Opcode.pm, + lib/Parrot/Opcode.pm: + Move common table reading stuff to a module. - Courtesy of: Damien Neil + Courtesy of: Damien Neil 2001-09-14 17:42 simon - * .cvsignore: - More .cvsignore foo. + * .cvsignore: + More .cvsignore foo. 2001-09-14 17:40 simon - * assemble.pl, config_h.in: - De-coredump + * assemble.pl, config_h.in: + De-coredump - Courtesy of: Gibbs Tanton - tgibbs + Courtesy of: Gibbs Tanton - tgibbs 2001-09-14 17:38 simon - * assemble.pl, t/Makefile: - Make assemble.pl look in its parent directory if the data files it - needs aren't in the current one. Plus a Makefile that lets "make - foo.pbc" work in t/ + * assemble.pl, t/Makefile: + Make assemble.pl look in its parent directory if the data files it + needs aren't in the current one. Plus a Makefile that lets "make + foo.pbc" work in t/ - Courtesy of: Rocco Caputo + Courtesy of: Rocco Caputo 2001-09-14 16:29 simon - * make_op_header.pl: - Wildly experimental patch to make Parrot compile on FreeBSD. (And - probably segfault everywhere else.) + * make_op_header.pl: + Wildly experimental patch to make Parrot compile on FreeBSD. (And + probably segfault everywhere else.) 2001-09-14 15:58 dan - * languages/jako/: euclid.jako, jako_compiler.pl: + * languages/jako/: euclid.jako, jako_compiler.pl: - Added in the first mini-language that targets Parrot. + Added in the first mini-language that targets Parrot. - Courtesy of: "Gregor N. Purdy" + Courtesy of: "Gregor N. Purdy" 2001-09-14 15:20 dan - * memory.c: Was misaligning returned memory. Fixed. + * memory.c: Was misaligning returned memory. Fixed. 2001-09-14 15:08 simon - * Makefile.in, basic_opcodes.ops, bytecode.c, global_setup.c, - interpreter.c, interpreter.h, memory.c, parrot.c, parrot.h, - register.c, register.h, string.c, string.h, strnative.c, - test_main.c: - Fixes to include + * Makefile.in, basic_opcodes.ops, bytecode.c, global_setup.c, + interpreter.c, interpreter.h, memory.c, parrot.c, parrot.h, + register.c, register.h, string.c, string.h, strnative.c, + test_main.c: + Fixes to include - Courtesy of: Gibbs Tanton - tgibbs + Courtesy of: Gibbs Tanton - tgibbs 2001-09-14 12:05 simon - * strnative.c: - Appease Tru64. + * strnative.c: + Appease Tru64. 2001-09-14 12:01 simon - * memory.c: - Appease Tru64. + * memory.c: + Appease Tru64. 2001-09-14 11:54 simon - * interpreter.c: - Remove lvalue cast. + * interpreter.c: + Remove lvalue cast. 2001-09-14 11:45 simon - * Configure.pl: - Be 5.005 friendly. + * Configure.pl: + Be 5.005 friendly. 2001-09-14 11:39 simon - * Configure.pl: - Tru64 cc doesn't like -Wall + * Configure.pl: + Tru64 cc doesn't like -Wall 2001-09-14 10:57 simon - * Config_pm.in, Configure.pl, MANIFEST, Makefile, Makefile.in, - assemble.pl, build_interp_starter.pl, bytecode.c, bytecode.h, - config.h.in, config_h.in, disassemble.pl, interpreter.c: - Configure now generates Makefile + * Config_pm.in, Configure.pl, MANIFEST, Makefile, Makefile.in, + assemble.pl, build_interp_starter.pl, bytecode.c, bytecode.h, + config.h.in, config_h.in, disassemble.pl, interpreter.c: + Configure now generates Makefile - Courtesy of: Brent Dax + Courtesy of: Brent Dax 2001-09-14 10:08 simon - * t/test3.pasm: - Add "end" + * t/test3.pasm: + Add "end" - Courtesy of: Gibbs Tanton - tgibbs + Courtesy of: Gibbs Tanton - tgibbs 2001-09-14 10:07 simon - * assemble.pl: - * uses Getopt::Long for options. -c is now --checksyntax. - I wasn't - sure how to keep compatible (patches welcome!) * options - include: --help --version - --verbose --output=file - --listing=file --checksyntax * produces - verbose listing of what the assembler saw :) Only one nitpick with - it: unknown symbols are given as 0xffffffff, unfortunately, this - includes symbols which may be defined later in the file (i.e. - forward jumps). + * assemble.pl: + * uses Getopt::Long for options. -c is now --checksyntax. + I wasn't + sure how to keep compatible (patches welcome!) * options + include: --help --version + --verbose --output=file + --listing=file --checksyntax * produces + verbose listing of what the assembler saw :) Only one nitpick with + it: unknown symbols are given as 0xffffffff, unfortunately, this + includes symbols which may be defined later in the file (i.e. + forward jumps). - Courtesy of: Brian Wheeler + Courtesy of: Brian Wheeler 2001-09-14 10:06 simon - * strnative.c: - substr growth fixup + * strnative.c: + substr growth fixup - Courtesy of: Gibbs Tanton - tgibbs + Courtesy of: Gibbs Tanton - tgibbs 2001-09-14 10:03 simon - * bytecode.c, global_setup.c, interpreter.c, memory.c, memory.h, - register.c, string.c, strnative.c, test_main.c: - Coding standards conformance + * bytecode.c, global_setup.c, interpreter.c, memory.c, memory.h, + register.c, string.c, strnative.c, test_main.c: + Coding standards conformance - Courtesy of Gibbs Tanton - tgibbs + Courtesy of Gibbs Tanton - tgibbs 2001-09-14 09:46 simon - * assemble.pl: - Make the assembler grok transcendental maths again. Courtesy of: - Gibbs Tanton - tgibbs + * assemble.pl: + Make the assembler grok transcendental maths again. Courtesy of: + Gibbs Tanton - tgibbs 2001-09-13 17:29 simon - * assemble.pl: - Better opcode guessing, from Brian Wheeler. (Again!) + * assemble.pl: + Better opcode guessing, from Brian Wheeler. (Again!) 2001-09-13 17:20 dan - * docs/parrot_assembly.pod: + * docs/parrot_assembly.pod: - Took out duplicate entries for iton, ntoi, and tostring. + Took out duplicate entries for iton, ntoi, and tostring. 2001-09-13 17:16 simon - * assemble.pl, basic_opcodes.ops, opcode_table: - From Brian Wheeler: + * assemble.pl, basic_opcodes.ops, opcode_table: + From Brian Wheeler: - This patch gives the assembler support of '\a','\n','\r','\t', and - '\\' in string constants. + This patch gives the assembler support of '\a','\n','\r','\t', and + '\\' in string constants. - In addition, it changes (for all registers) "I reg %li is ..." to - just the value of the register. Printing constants is also - supported, but alas, you have to specify the type (print_sc, - print_ic, print_nc). + In addition, it changes (for all registers) "I reg %li is ..." to + just the value of the register. Printing constants is also + supported, but alas, you have to specify the type (print_sc, + print_ic, print_nc). 2001-09-13 15:38 simon - * assemble.pl: - Why don't I actually *test* this stuff before applying it, eh? + * assemble.pl: + Why don't I actually *test* this stuff before applying it, eh? 2001-09-13 15:34 simon - * TODO, t/euclid.pasm: - From: "Gregor N. Purdy" Subject: [patch - (really)] Removed opcode qualifers t/euclid.pasm to exercise opcode - inference + * TODO, t/euclid.pasm: + From: "Gregor N. Purdy" Subject: [patch + (really)] Removed opcode qualifers t/euclid.pasm to exercise opcode + inference 2001-09-13 14:42 simon - * assemble.pl: - A new assembler, from Brian Wheeler. + * assemble.pl: + A new assembler, from Brian Wheeler. 2001-09-13 09:44 simon - * basic_opcodes.ops, interpreter.h, parrot.h, strnative.c, - test_main.c: - Two more from Tom Hughes: Patch to fix C++ style comments - Patch to remove use of structure constant/cast + * basic_opcodes.ops, interpreter.h, parrot.h, strnative.c, + test_main.c: + Two more from Tom Hughes: Patch to fix C++ style comments + Patch to remove use of structure constant/cast 2001-09-13 09:39 simon - * TODO, docs/strings.pod: - Update string docs. + * TODO, docs/strings.pod: + Update string docs. 2001-09-13 09:36 simon - * Makefile, basic_opcodes.ops: - Tom Hughes Patch to link with the maths library Tom Hughes - Patch to fix += on rvalue + * Makefile, basic_opcodes.ops: + Tom Hughes Patch to link with the maths library Tom Hughes + Patch to fix += on rvalue 2001-09-13 08:57 simon - * MANIFEST: - I guess nobody's been using the nightly builds... + * MANIFEST: + I guess nobody's been using the nightly builds... 2001-09-13 08:27 simon - * assemble.pl, basic_opcodes.ops, opcode_table: - Bitwise ops, from Brian Wheeler. + * assemble.pl, basic_opcodes.ops, opcode_table: + Bitwise ops, from Brian Wheeler. 2001-09-13 08:23 simon - * .cvsignore, t/.cvsignore: - .cvsignore's, from Gregor Purdy. + * .cvsignore, t/.cvsignore: + .cvsignore's, from Gregor Purdy. 2001-09-13 08:22 simon - * Makefile: - Euclidean test and test output rearranging from Gregor Purdy. + * Makefile: + Euclidean test and test output rearranging from Gregor Purdy. 2001-09-13 08:21 simon - * assemble.pl, basic_opcodes.ops, disassemble.pl, opcode_table: - Math ops from Gibbs Tanton. + * assemble.pl, basic_opcodes.ops, disassemble.pl, opcode_table: + Math ops from Gibbs Tanton. 2001-09-13 08:14 simon - * basic_opcodes.ops, opcode_table, string.c, string.h, strnative.c, - t/test2.pasm: - String substr op; also rearranged "encoding" to be a vtable - pointer, not an array index. Haven't changed docs to reflect this, - oops. + * basic_opcodes.ops, opcode_table, string.c, string.h, strnative.c, + t/test2.pasm: + String substr op; also rearranged "encoding" to be a vtable + pointer, not an array index. Haven't changed docs to reflect this, + oops. - Simon + Simon 2001-09-12 19:48 dan - * t/euclid.pasm: Implementation of Euclid's Algorithm, courtesy of - Gregor Purdy + * t/euclid.pasm: Implementation of Euclid's Algorithm, courtesy of + Gregor Purdy 2001-09-12 19:39 dan - * basic_opcodes.ops, opcode_table: From Gregor Purdy. Adds mod_i. + * basic_opcodes.ops, opcode_table: From Gregor Purdy. Adds mod_i. 2001-09-12 19:23 dan - * interpreter.h, parrot.h: Quick placeholder entry for string - function tables + * interpreter.h, parrot.h: Quick placeholder entry for string + function tables 2001-09-12 18:58 dan - * memory.c: Added in a cast to make gcc happy. + * memory.c: Added in a cast to make gcc happy. 2001-09-12 16:44 dan - * docs/parrot_assembly.pod: + * docs/parrot_assembly.pod: - PDD describing parrot's assembly language and the opcodes in it + PDD describing parrot's assembly language and the opcodes in it 2001-09-12 14:20 dan - * memory.c: - Fixed alignment issues with allocation + * memory.c: + Fixed alignment issues with allocation 2001-09-12 10:54 simon - * Makefile, assemble.pl, bytecode.c, disassemble.pl, - make_op_header.pl, opcode_table, process_opfunc.pl: - Brian Wheeler's big patch: + * Makefile, assemble.pl, bytecode.c, disassemble.pl, + make_op_header.pl, opcode_table, process_opfunc.pl: + Brian Wheeler's big patch: - * Changes the opcode_table file to provide additional information - about the operands. Case shouldn't be a problem since that data - never becomes a C symbol [this is pretty much as before] + * Changes the opcode_table file to provide additional information + about the operands. Case shouldn't be a problem since that data + never becomes a C symbol [this is pretty much as before] - * Padding errors solved: assemble.pl and bytecode.c were padding - the constants incorrectly. It should have been 4-(size % 4), not - just (size % 4). It is now fixed in both places. + * Padding errors solved: assemble.pl and bytecode.c were padding + the constants incorrectly. It should have been 4-(size % 4), not + just (size % 4). It is now fixed in both places. - * assembler has less special cases, and should be easier to hang - error checking on + * assembler has less special cases, and should be easier to hang + error checking on - * disassembler dumps constant table and the format is a bit - prettier, including register names, etc. + * disassembler dumps constant table and the format is a bit + prettier, including register names, etc. 2001-09-11 23:21 dan - * build_interp_starter.pl, interpreter.c: + * build_interp_starter.pl, interpreter.c: - Abstracted the runops function core into a macro for easy - replacement later. + Abstracted the runops function core into a macro for easy + replacement later. 2001-09-11 10:43 simon - * Configure.pl, MANIFEST, Makefile, config.h, config.h.in: - Configure system from Brent Dax + * Configure.pl, MANIFEST, Makefile, config.h, config.h.in: + Configure system from Brent Dax 2001-09-11 09:38 simon - * assemble.pl, test.pbc: - From: Bryan C. Warnock Subject: Patch: - assembler deferred output + * assemble.pl, test.pbc: + From: Bryan C. Warnock Subject: Patch: + assembler deferred output - Also got rid of the bytecode, since that's probably way out of - date. + Also got rid of the bytecode, since that's probably way out of + date. 2001-09-11 09:26 simon - * basic_opcodes.ops, opcode_table, t/test2.pasm: - From: Bryan C. Warnock Subject: length_s_i - patch + * basic_opcodes.ops, opcode_table, t/test2.pasm: + From: Bryan C. Warnock Subject: length_s_i + patch 2001-09-10 23:20 simon - * MANIFEST: - And that move needs a MANIFEST change. So many things to remember! + * MANIFEST: + And that move needs a MANIFEST change. So many things to remember! 2001-09-10 23:18 simon - * t/: test.pasm, test2.pasm, test3.pasm: - Move tests to t/. (Oh, CVS doesn't work the way I think it does.) + * t/: test.pasm, test2.pasm, test3.pasm: + Move tests to t/. (Oh, CVS doesn't work the way I think it does.) 2001-09-10 23:18 simon - * test.pasm, test2.pasm, test3.pasm: - Move tests to t/ + * test.pasm, test2.pasm, test3.pasm: + Move tests to t/ 2001-09-10 23:04 dan - * test3.pasm: + * test3.pasm: - Register push/pop test + Register push/pop test 2001-09-10 22:47 simon - * basic_opcodes.ops, bytecode.c, parrot.h, test_main.c: - Fix up format warnings, from Sam Tregar . - (Modified to avoid conflict with Dan's changes.) + * basic_opcodes.ops, bytecode.c, parrot.h, test_main.c: + Fix up format warnings, from Sam Tregar . + (Modified to avoid conflict with Dan's changes.) 2001-09-10 22:45 dan - * disassemble.pl: + * disassemble.pl: - Happier about blanks in opcode_table + Happier about blanks in opcode_table 2001-09-10 22:40 dan - * interpreter.c, register.c: + * interpreter.c, register.c: - Yanked out debugging code, since these work OK. The bug I want is - elsewhere. + Yanked out debugging code, since these work OK. The bug I want is + elsewhere. 2001-09-10 22:30 simon - * MANIFEST: - Uhm. We want make_op_header.pl. We really, really do. + * MANIFEST: + Uhm. We want make_op_header.pl. We really, really do. 2001-09-10 22:26 simon - * Makefile, TODO, assemble.pl, basic_opcodes.ops, - build_interp_starter.pl, disassemble.pl, make_op_header.pl, - opcode_table, process_opfunc.pl: - Automatic opcode numbering, from Leon Brocard . - This means we can add lots more opcodes without fiddling about with - the numbers. Hooray! + * Makefile, TODO, assemble.pl, basic_opcodes.ops, + build_interp_starter.pl, disassemble.pl, make_op_header.pl, + opcode_table, process_opfunc.pl: + Automatic opcode numbering, from Leon Brocard . + This means we can add lots more opcodes without fiddling about with + the numbers. Hooray! - Don't forget that "end" needs to be op zero, else the interpreter - falls off the end of the code. This is Bad, and I wonder if there's - a way around it. + Don't forget that "end" needs to be op zero, else the interpreter + falls off the end of the code. This is Bad, and I wonder if there's + a way around it. 2001-09-10 19:49 simon - * MANIFEST, make_op_table_build.pl: - Hey! This doesn't do anything... + * MANIFEST, make_op_table_build.pl: + Hey! This doesn't do anything... 2001-09-10 19:46 simon - * Makefile: - "clean" target cleanup from Bryan C. Warnock . + * Makefile: + "clean" target cleanup from Bryan C. Warnock . 2001-09-10 18:31 simon - * MANIFEST: - You know what this means... + * MANIFEST: + You know what this means... 2001-09-10 18:30 simon - * assemble.pl: - "use strict" patch from Leon Brocard . Hey, why - wait for a release...? :) + * assemble.pl: + "use strict" patch from Leon Brocard . Hey, why + wait for a release...? :) 2001-09-10 18:13 simon - * interpreter.c: - Bad Dan! No cookie! + * interpreter.c: + Bad Dan! No cookie! 2001-09-10 17:56 simon - * README: - A *real* README file, which doesn't claim it isn't for public - consumption. + * README: + A *real* README file, which doesn't claim it isn't for public + consumption. 2001-09-10 17:02 simon - * TODO: - More things to do. + * TODO: + More things to do. 2001-09-10 16:56 dan - * TODO: Added in assembler gripe. Also added a few blank lines for - clarity + * TODO: Added in assembler gripe. Also added a few blank lines for + clarity 2001-09-10 16:49 dan - * register.h, register.c: Renamed the core functions so the opcodes - can find 'em OK. (There were some conflicts) + * register.h, register.c: Renamed the core functions so the opcodes + can find 'em OK. (There were some conflicts) 2001-09-10 16:48 dan - * basic_opcodes.ops, opcode_table: Added register window ops + * basic_opcodes.ops, opcode_table: Added register window ops 2001-09-10 11:07 simon - * TODO: - Trivial TODO list. + * TODO: + Trivial TODO list. 2001-09-10 11:05 simon - * test.pbc, test2.pasm, test_main.c: Other string bits and pieces; - note "-s" flag to test prog. + * test.pbc, test2.pasm, test_main.c: Other string bits and pieces; + note "-s" flag to test prog. 2001-09-10 11:01 simon - * docs/strings.pod: - New string documentation. + * docs/strings.pod: + New string documentation. 2001-09-10 11:01 simon - * basic_opcodes.ops, opcode_table: - String ops. + * basic_opcodes.ops, opcode_table: + String ops. 2001-09-10 10:53 simon - * global_setup.c: - More string fu. + * global_setup.c: + More string fu. 2001-09-10 10:51 simon - * memory.h: - Just some more aliases for now. Used by string handling stuff. + * memory.h: + Just some more aliases for now. Used by string handling stuff. 2001-09-10 10:50 simon - * assemble.pl, bytecode.c, bytecode.h: - Temporary hack to store string constants in bytecode and recreate - them at runtime. + * assemble.pl, bytecode.c, bytecode.h: + Temporary hack to store string constants in bytecode and recreate + them at runtime. 2001-09-10 10:48 simon - * op.h: - op.h is now generated by the Makefile; remove it. + * op.h: + op.h is now generated by the Makefile; remove it. 2001-09-10 10:47 simon - * Makefile: - clean and op.h Makefile targets. + * Makefile: + clean and op.h Makefile targets. 2001-09-10 10:45 simon - * string.c, string.h, strnative.c: - More string vtable stuff. + * string.c, string.h, strnative.c: + More string vtable stuff. 2001-09-07 21:07 dan - * assemble.pl: + * assemble.pl: - Much less picky about whitespace in the opcode_table now. (Doesn't - whine on blank lines) + Much less picky about whitespace in the opcode_table now. (Doesn't + whine on blank lines) 2001-09-07 16:23 dan - * Makefile, assemble.pl, global_setup.h, interpreter.c, - interpreter.h, opcode_table, parrot.h, test.pasm: (Here's hoping - this takes) Added global_setup.h to declare init_world function + * Makefile, assemble.pl, global_setup.h, interpreter.c, + interpreter.h, opcode_table, parrot.h, test.pasm: (Here's hoping + this takes) Added global_setup.h to declare init_world function - Moved variable declarations out of the interpreter loop for small - speed boost. + Moved variable declarations out of the interpreter loop for small + speed boost. - Changed end opcode to now be opcode #0. A function is provided for - it, but isn't ever executed. + Changed end opcode to now be opcode #0. A function is provided for + it, but isn't ever executed. - When the interpreter sees an opcode 0 in the stream it means the - end of stream. Things were coring on Cygwin otherwise. (I think I - was dereferencing a zero, which is bad) + When the interpreter sees an opcode 0 in the stream it means the + end of stream. Things were coring on Cygwin otherwise. (I think I + was dereferencing a zero, which is bad) 2001-09-06 22:07 dan - * basic_opcodes.ops, process_opfunc.pl: + * basic_opcodes.ops, process_opfunc.pl: - Minor tweaks to basic_opcodes.ops to fix some NV issues. The rest - are minor changes now that things are in a fixed state. + Minor tweaks to basic_opcodes.ops to fix some NV issues. The rest + are minor changes now that things are in a fixed state. 2001-09-06 16:13 dan - * basic_opcodes.c, test_opcodes.c: - test_opcodes.c is now irrelevant--they're all in basic_opcodes.ops. + * basic_opcodes.c, test_opcodes.c: + test_opcodes.c is now irrelevant--they're all in basic_opcodes.ops. - basic_opcodes.c is now autogenerated from basic_opcodes.ops, and - should be nuked. So it is. :) + basic_opcodes.c is now autogenerated from basic_opcodes.ops, and + should be nuked. So it is. :) 2001-09-06 03:35 dan - * basic_opcodes.ops, build_interp_starter.pl, process_opfunc.pl: - Scripts to build the header file that holds the function table - creation code, as well as the script to turn an opcode file to C - source. (And the basic opcode functions turned into an opcode - source file) + * basic_opcodes.ops, build_interp_starter.pl, process_opfunc.pl: + Scripts to build the header file that holds the function table + creation code, as well as the script to turn an opcode file to C + source. (And the basic opcode functions turned into an opcode + source file) 2001-09-06 03:31 dan - * Makefile, interpreter.c: - Changes to support the autogeneration of the opcode function - pointer table in interpreter.c, along with the changes to the - Makefile needed. + * Makefile, interpreter.c: + Changes to support the autogeneration of the opcode function + pointer table in interpreter.c, along with the changes to the + Makefile needed. 2001-09-05 13:27 simon - * bytecode.c, config.h, docs/opcodes.pod, docs/overview.pod, - docs/parrotbyte.pod, docs/vtables.pod: - Added stubs for the documents; working on them this week. (What's - left of it.) config.h change is just to type VTABLE, and the - bytecode thing you might want to revoke. It's apidoc for the - functions in there. + * bytecode.c, config.h, docs/opcodes.pod, docs/overview.pod, + docs/parrotbyte.pod, docs/vtables.pod: + Added stubs for the documents; working on them this week. (What's + left of it.) config.h change is just to type VTABLE, and the + bytecode thing you might want to revoke. It's apidoc for the + functions in there. 2001-09-03 18:26 simon - * docs/strings.pod: - A start on the string API documentation. + * docs/strings.pod: + A start on the string API documentation. 2001-09-03 17:43 simon - * opcode_table: - Since we specify the opcode number, we can rearrange to a more - human-friendly ordering. + * opcode_table: + Since we specify the opcode number, we can rearrange to a more + human-friendly ordering. 2001-09-03 17:42 simon - * basic_opcodes.c: - Coupl'a logic bugs. (I think) + * basic_opcodes.c: + Coupl'a logic bugs. (I think) 2001-09-03 17:41 simon - * string.c, string.h, strnative.c: - Tidying up the string vtables. + * string.c, string.h, strnative.c: + Tidying up the string vtables. 2001-09-03 17:38 simon - * make_op_header.pl: - Spit out the whole of op.h, not just the bit in the middle. + * make_op_header.pl: + Spit out the whole of op.h, not just the bit in the middle. 2001-08-29 13:16 ask - * README: it seems like we indeed can commit. What about sending - commit mails? + * README: it seems like we indeed can commit. What about sending + commit mails? 2001-08-29 13:07 simon - * Makefile, README, assemble.pl, basic_opcodes.c, bytecode.c, - bytecode.h, config.h, disassemble.pl, events.h, exceptions.h, - global_setup.c, interpreter.c, interpreter.h, io.h, - make_op_header.pl, make_op_table_build.pl, memory.c, memory.h, - op.h, opcode_table, parrot.c, parrot.h, register.c, register.h, - stacks.h, string.c, string.h, strnative.c, strnative.h, test.pasm, - test.pbc, test_main.c, test_opcodes.c: - Initial checkin of Simon's work directory - Dan, feel free to nuke. - I'm still working on the string stuff, though. + * Makefile, README, assemble.pl, basic_opcodes.c, bytecode.c, + bytecode.h, config.h, disassemble.pl, events.h, exceptions.h, + global_setup.c, interpreter.c, interpreter.h, io.h, + make_op_header.pl, make_op_table_build.pl, memory.c, memory.h, + op.h, opcode_table, parrot.c, parrot.h, register.c, register.h, + stacks.h, string.c, string.h, strnative.c, strnative.h, test.pasm, + test.pbc, test_main.c, test_opcodes.c: + Initial checkin of Simon's work directory - Dan, feel free to nuke. + I'm still working on the string stuff, though. 2001-08-29 12:44 ask - * README: update README with list address + * README: update README with list address 2001-08-29 12:36 ask - * README: first readme. + * README: first readme. diff --git a/Configure.pl b/Configure.pl index a6932fd298..0edb0377b3 100644 --- a/Configure.pl +++ b/Configure.pl @@ -458,6 +458,13 @@ =head1 CONFIGURATION-FILE INTERFACE ... you would now place the assignments to C and C in the I<=variables> section of the configuration file (as above). +In addition, should you wish to use an option whose value contains whitespace +and would, if presented on the command-line, require quoting, you may +assign that string to a variable and then use the variable in the C +section below. + + LONGLONG=long long + =back =item * general @@ -485,6 +492,14 @@ =head1 CONFIGURATION-FILE INTERFACE Note that when the value is a variable defined in the I<=variables> section, it must be preceded by a C<$> sign. + intval=$LONGLONG + +Alternatively, if assignment of a value to an option on the command-line would +require quoting due to the presence of whitespace in the value, you may assign +it to a value in the I<=general> section by double-quoting the value. + + intval="long long" + =item * You I list options here which are I limited to a single diff --git a/MANIFEST b/MANIFEST index 141c3e7661..89a25f7ede 100644 --- a/MANIFEST +++ b/MANIFEST @@ -7,6 +7,7 @@ # See docs/submissions.pod and the documentation in # tools/dev/mk_manifest_and_skip.pl. .gitignore [] +.travis.yml [] CREDITS [main]doc ChangeLog [] Configure.pl [] @@ -16,7 +17,6 @@ LICENSE [main]doc MANIFEST [] MANIFEST.SKIP [] MANIFEST.generated [] -NEWS [main]doc PBC_COMPAT [main]doc PLATFORMS [devel]doc README [devel]doc @@ -219,7 +219,6 @@ config/gen/core_pmcs.pm [] config/gen/makefiles.pm [] config/gen/makefiles/docs.in [] config/gen/makefiles/editor.in [] -config/gen/makefiles/ext.in [] config/gen/makefiles/parrot_embed_pl.in [] config/gen/makefiles/root.in [] config/gen/opengl.pm [] @@ -252,6 +251,16 @@ config/inter/progs.pm [] config/inter/shlibs.pm [] config/inter/types.pm [] config/inter/yacc.pm [] +docs/binaries/ops2c.pod [doc] +docs/binaries/parrot-nqp.pod [doc] +docs/binaries/parrot-prove.pod [doc] +docs/binaries/parrot.pod [doc] +docs/binaries/parrot_config.pod [doc] +docs/binaries/parrot_nci_thunk_gen.pod [doc] +docs/binaries/parrotbug.pod [doc] +docs/binaries/pbc_to_exe.pod [doc] +docs/binaries/plumage.pod [doc] +docs/binaries/winxed.pod [doc] docs/book/draft/README [] docs/book/draft/appa_glossary.pod [] docs/book/draft/appb_patch_submission.pod [] @@ -303,8 +312,8 @@ docs/dev/infant.pod [doc] docs/dev/longopt.pod [doc] docs/dev/optimizer.pod [doc] docs/dev/parrot_api.pod [doc] +docs/dev/pcc_methods.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] @@ -384,6 +393,7 @@ docs/project/hacking_tips.pod [doc] docs/project/merge_review_guidelines.pod [doc] docs/project/metacommitter_guide.pod [doc] docs/project/release_manager_guide.pod [doc] +docs/project/release_parrot_github_guide.pod [doc] docs/project/roles_responsibilities.pod [doc] docs/project/support_policy.pod [doc] docs/project/ticket_triaging.pod [doc] @@ -466,10 +476,6 @@ examples/benchmarks/oo3.pir [examples] examples/benchmarks/oo3.pl [examples] examples/benchmarks/oo3.py [examples] examples/benchmarks/oo3.rb [examples] -examples/benchmarks/oo4.pasm [examples] -examples/benchmarks/oo4.pl [examples] -examples/benchmarks/oo4.py [examples] -examples/benchmarks/oo4.rb [examples] examples/benchmarks/oo5.pir [examples] examples/benchmarks/oo5.pl [examples] examples/benchmarks/oo5.py [examples] @@ -516,6 +522,7 @@ examples/c/test_main.c [examples] examples/compilers/Makefile [examples] examples/compilers/japhc.c [examples] examples/config/file/configcompiler [examples] +examples/config/file/configverbose [examples] examples/config/file/configwithfatalstep [examples] examples/embed/Makefile [examples] examples/embed/Makefile.msvc [examples] @@ -541,6 +548,8 @@ examples/languages/abc/t/abc_special_variables [examples] examples/languages/abc/t/abc_statement [examples] examples/languages/squaak/MAINTAINER [examples] examples/languages/squaak/README [examples] +examples/languages/squaak/doc/pct-stages.png [examples] +examples/languages/squaak/doc/pct-stages.svg [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] @@ -620,6 +629,7 @@ examples/pir/befunge/stack.pir [examples] examples/pir/befunge/t/basic.t [examples] examples/pir/befunge/test.bef [examples] examples/pir/circle.pir [examples] +examples/pir/coop_threads.pir [examples] examples/pir/euclid.pir [examples] examples/pir/genprog.bas [examples] examples/pir/hanoi.pir [examples] @@ -779,23 +789,6 @@ examples/tutorial/81_continuation.pir [examples] examples/tutorial/82_coroutine.pir [examples] examples/tutorial/83_external_libraries.pir [examples] examples/tutorial/90_writing_tests.pir [examples] -ext/Parrot-Embed/Build.PL [] -ext/Parrot-Embed/Changes [] -ext/Parrot-Embed/MANIFEST [] -ext/Parrot-Embed/README []doc -ext/Parrot-Embed/TODO [] -ext/Parrot-Embed/lib/Parrot/Embed.pm [] -ext/Parrot-Embed/lib/Parrot/Embed.xs [] -ext/Parrot-Embed/lib/Parrot/Interpreter.pm [] -ext/Parrot-Embed/lib/Parrot/PMC.pm [] -ext/Parrot-Embed/t/00-load.t [test] -ext/Parrot-Embed/t/greet.pir [test] -ext/Parrot-Embed/t/interp.t [test] -ext/Parrot-Embed/t/languages.t [test] -ext/Parrot-Embed/t/pipp.t [test] -ext/Parrot-Embed/tools/check_embed_coverage.pl [] -ext/Parrot-Embed/tools/write_typemap.pl [] -ext/Parrot-Embed/typemap [] ext/nqp-rx/CREDITS [] ext/nqp-rx/Defines.mak [] ext/nqp-rx/LICENSE [] @@ -868,6 +861,10 @@ ext/winxed/Rules.mak [] ext/winxed/compiler.pir [] ext/winxed/driver.pir [] frontend/parrot/main.c [] +frontend/parrot2/build.pir [] +frontend/parrot2/main.c [] +frontend/parrot2/prt0.pir [] +frontend/parrot2/prt0.winxed [] frontend/parrot_debugger/main.c [] frontend/pbc_disassemble/main.c [] frontend/pbc_dump/main.c [] @@ -876,12 +873,8 @@ frontend/pbc_merge/main.c [] include/imcc/api.h [main]include include/imcc/embed.h [main]include include/imcc/yyscanner.h [main]include +include/parrot/alarm.h [main]include include/parrot/api.h [main]include -include/parrot/atomic.h [main]include -include/parrot/atomic/fallback.h [main]include -include/parrot/atomic/gcc_pcc.h [main]include -include/parrot/atomic/gcc_x86.h [main]include -include/parrot/atomic/sparc.h [main]include include/parrot/caches.h [main]include include/parrot/call.h [main]include include/parrot/cclass.h [main]include @@ -890,10 +883,11 @@ 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 +include/parrot/disassemble.h [main]include include/parrot/dynext.h [main]include -include/parrot/embed.h [main]include include/parrot/encoding.h [main]include include/parrot/enums.h [main]include +include/parrot/events.h [main]include include/parrot/exceptions.h [main]include include/parrot/exit.h [main]include include/parrot/extend.h [main]include @@ -929,6 +923,7 @@ include/parrot/pobj.h [main]include include/parrot/pointer_array.h [main]include include/parrot/runcore_api.h [main]include include/parrot/runcore_profiling.h [main]include +include/parrot/runcore_subprof.h [main]include include/parrot/runcore_trace.h [main]include include/parrot/scheduler.h [main]include include/parrot/scheduler_private.h [main]include @@ -936,10 +931,6 @@ include/parrot/settings.h [main]include include/parrot/string.h [main]include include/parrot/string_funcs.h [main]include include/parrot/sub.h [main]include -include/parrot/thr_none.h [main]include -include/parrot/thr_pthread.h [main]include -include/parrot/thr_windows.h [main]include -include/parrot/thread.h [main]include include/parrot/vtables.h [main]include include/parrot/warnings.h [main]include include/pmc/dummy [main]include @@ -997,6 +988,7 @@ lib/Parrot/H2inc.pm [devel]lib lib/Parrot/Harness/DefaultTests.pm [devel]lib lib/Parrot/Harness/Options.pm [devel]lib lib/Parrot/Harness/Smoke.pm [devel]lib +lib/Parrot/Harness/TestSets.pm [devel]lib lib/Parrot/Headerizer.pm [devel]lib lib/Parrot/Headerizer/Functions.pm [devel]lib lib/Parrot/IO/Directory.pm [devel]lib @@ -1028,7 +1020,6 @@ lib/Parrot/SearchOps.pm [devel]lib lib/Parrot/Test.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/Pod.pm [devel]lib lib/Parrot/Test/Pod/Utils.pm [devel]lib lib/Parrot/Test/Util.pm [devel]lib @@ -1042,6 +1033,7 @@ lib/Perl/Critic/Policy/TestingAndDebugging/ProhibitShebangWarningsArg.pm [] lib/Perl/Critic/Policy/TestingAndDebugging/RequirePortableShebang.pm [] lib/Pod/Escapes.pm [] lib/Pod/Simple.pm [] +lib/Pod/Simple.pod [] lib/Pod/Simple/BlackBox.pm [] lib/Pod/Simple/Checker.pm [] lib/Pod/Simple/Debug.pm [] @@ -1061,6 +1053,7 @@ lib/Pod/Simple/PullParserToken.pm [] lib/Pod/Simple/RTF.pm [] lib/Pod/Simple/Search.pm [] lib/Pod/Simple/SimpleTree.pm [] +lib/Pod/Simple/Subclassing.pod [] lib/Pod/Simple/Text.pm [] lib/Pod/Simple/TextContent.pm [] lib/Pod/Simple/TiedOutFH.pm [] @@ -1074,6 +1067,7 @@ runtime/parrot/bin/prove.pir [library] runtime/parrot/dynext/README []doc runtime/parrot/include/README []doc runtime/parrot/include/fp_equality.pasm [library] +runtime/parrot/include/green_threads.pir [library] runtime/parrot/include/hllmacros.pir [library] runtime/parrot/include/test_more.pir [library] runtime/parrot/languages/parrot/parrot.pir [library] @@ -1174,11 +1168,9 @@ runtime/parrot/library/pcore.pir [library] runtime/parrot/library/pcre.pir [library] runtime/parrot/library/postgres.declarations [library] runtime/parrot/library/postgres.pir [library] -runtime/parrot/library/random_lib.pir [library] runtime/parrot/library/uuid.pir [library] runtime/parrot/library/yaml_dumper.pir [library] -src/atomic/gcc_x86.c [] -src/atomic/sparc_v9.s [] +src/alarm.c [] src/call/args.c [] src/call/context.c [] src/call/context_accessors.c [] @@ -1186,6 +1178,7 @@ src/call/ops.c [] src/call/pcc.c [] src/datatypes.c [] src/debug.c [] +src/disassemble.c [] src/dynext.c [] src/dynoplibs/Defines.in [] src/dynoplibs/README []doc @@ -1211,13 +1204,14 @@ src/dynpmc/os.pmc [] src/dynpmc/pccmethod_test.pmc [] src/dynpmc/rational.pmc [] src/dynpmc/rotest.pmc [] +src/dynpmc/select.pmc [] src/dynpmc/subproxy.pmc [] -src/embed.c [] src/embed/api.c [] src/embed/bytecode.c [] src/embed/embed_private.h [] src/embed/pmc.c [] src/embed/strings.c [] +src/events.c [] src/exceptions.c [] src/exit.c [] src/extend.c [] @@ -1241,9 +1235,8 @@ src/gc/variable_size_pool.h [] src/global_setup.c [] src/hash.c [] src/hll.c [] +src/interp/api.c [] src/interp/inter_cb.c [] -src/interp/inter_create.c [] -src/interp/inter_misc.c [] src/io/api.c [] src/io/buffer.c [] src/io/core.c [] @@ -1283,7 +1276,6 @@ src/ops/string.ops [] src/ops/sys.ops [] src/ops/var.ops [] src/packfile/api.c [] -src/packfile/byteorder.h [] src/packfile/object_serialization.c [] src/packfile/output.c [] src/packfile/pf_items.c [] @@ -1332,11 +1324,13 @@ src/platform/win32/time.c [] src/platform/win32/uid.c [] src/pmc.c [] src/pmc/addrregistry.pmc [] +src/pmc/alarm.pmc [] src/pmc/arrayiterator.pmc [] src/pmc/bigint.pmc [] src/pmc/bignum.pmc [] src/pmc/boolean.pmc [] src/pmc/bytebuffer.pmc [] +src/pmc/callback.pmc [] src/pmc/callcontext.pmc [] src/pmc/capture.pmc [] src/pmc/class.pmc [] @@ -1396,8 +1390,8 @@ src/pmc/packfilesegment.pmc [] src/pmc/packfileview.pmc [] src/pmc/parrotinterpreter.pmc [] src/pmc/parrotlibrary.pmc [] -src/pmc/parrotthread.pmc [] src/pmc/pmc.num [] +src/pmc/pmclist.pmc [] src/pmc/pmcproxy.pmc [] src/pmc/pointer.pmc [] src/pmc/ptr.pmc [] @@ -1421,7 +1415,6 @@ src/pmc/stringiterator.pmc [] src/pmc/structview.pmc [] src/pmc/sub.pmc [] src/pmc/task.pmc [] -src/pmc/threadinterpreter.pmc [] src/pmc/timer.pmc [] src/pmc/undef.pmc [] src/pmc/unmanagedstruct.pmc [] @@ -1429,6 +1422,7 @@ src/pointer_array.c [] src/runcore/cores.c [] src/runcore/main.c [] src/runcore/profiling.c [] +src/runcore/subprof.c [] src/runcore/trace.c [] src/scheduler.c [] src/spf_render.c [] @@ -1449,13 +1443,13 @@ src/string/encoding/unicode.h [] src/string/encoding/utf16.c [] src/string/encoding/utf8.c [] src/sub.c [] -src/thread.c [] src/utils.c [] src/vtable.tbl [devel]src src/vtables.c [] src/warnings.c [] t/README.pod []doc t/TESTS_STATUS.pod [test] +t/archive/README []doc t/benchmark/benchmarks.t [test] t/codingstd/c_arg_assert.t [test] t/codingstd/c_code_coda.t [test] @@ -1470,6 +1464,7 @@ t/codingstd/c_parens.t [test] t/codingstd/c_returns.t [test] t/codingstd/c_struct.t [test] t/codingstd/c_todo.t [test] +t/codingstd/case_sensitive_files.t [test] t/codingstd/check_isxxx.t [test] t/codingstd/check_toxxx.t [test] t/codingstd/copyright.t [test] @@ -1631,7 +1626,6 @@ t/configure/testlib/init/lambda.pm [test] t/configure/testlib/init/mu.pm [test] t/configure/testlib/init/zeta.pm [test] t/configure/testlib/inter/theta.pm [test] -t/configure/testlib/verbosefoobar [test] t/distro/manifest.t [test] t/distro/manifest_generated.t [test] t/dynoplibs/bit.t [test] @@ -1667,6 +1661,7 @@ t/dynpmc/os_unicode.t [test] t/dynpmc/pccmethod_test.t [test] t/dynpmc/rational.t [test] t/dynpmc/rotest.t [test] +t/dynpmc/select.t [test] t/dynpmc/subclass_with_pir_method.t [test] t/dynpmc/subproxy.t [test] t/examples/catchall.t [test] @@ -1682,6 +1677,7 @@ t/examples/streams.t [test] t/examples/subs.t [test] t/examples/tutorial.t [test] t/ext/winxed/compreg.t [test] +t/fullharness [test] t/harness [test] t/harness.pir [test] t/include/fp_equality.t [test] @@ -1729,6 +1725,7 @@ t/manifest/03-regenerate_skip.t [test] t/manifest/04-alt_file.t [test] t/manifest/05-alt_skip.t [test] t/manifest/README []doc +t/native_pbc/annotations.pbc [test] t/native_pbc/header.t [test] t/native_pbc/integer.pbc [test] t/native_pbc/integer.t [test] @@ -1754,6 +1751,7 @@ t/native_pbc/string_1.pbc [test] t/native_pbc/string_2.pbc [test] t/native_pbc/string_3.pbc [test] t/native_pbc/string_4.pbc [test] +t/native_pbc/string_5.pbc [test] t/native_pbc/string_6.pbc [test] t/native_pbc/string_7.pbc [test] t/native_pbc/testdata/README []doc @@ -1837,12 +1835,14 @@ t/pharness/01-default_tests.t [test] 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/interop.t [test] t/pir/macro.t [test] t/pir/pbc_fallback.t [test] t/pir/registernames.t [test] t/pir/testlib/loadtest.pir [test] t/pir/timer_exit.t [test] t/pmc/addrregistry.t [test] +t/pmc/alarm.t [test] t/pmc/arrayiterator.t [test] t/pmc/bigint.t [test] t/pmc/bignum.t [test] @@ -1921,8 +1921,8 @@ t/pmc/parrotinterpreter.t [test] t/pmc/parrotio.t [test] t/pmc/parrotlibrary.t [test] t/pmc/parrotobject.t [test] -t/pmc/parrotthread.t [test] t/pmc/pmc.t [test] +t/pmc/pmclist.t [test] t/pmc/pmcproxy.t [test] t/pmc/pointer.t [test] t/pmc/prop.t [test] @@ -1934,7 +1934,6 @@ t/pmc/resizablestringarray.t [test] t/pmc/ro.t [test] t/pmc/role.t [test] t/pmc/scalar.t [test] -t/pmc/scheduler.t [test] t/pmc/schedulermessage.t [test] t/pmc/signal.t [test] t/pmc/sockaddr.t [test] @@ -1948,13 +1947,13 @@ t/pmc/structview.t [test] t/pmc/sub.t [test] t/pmc/sys.t [test] t/pmc/task.t [test] +t/pmc/task_primes.t [test] t/pmc/testfile [test] t/pmc/testlib/annotations.pir [test] t/pmc/testlib/number.pasm [test] t/pmc/testlib/packfile_common.pir [test] t/pmc/testlib/test_server.pir [test] t/pmc/testlib/test_server_ipv6.pir [test] -t/pmc/threads.t [test] t/pmc/timer.t [test] t/pmc/undef.t [test] t/pmc/unmanagedstruct.t [test] @@ -1967,7 +1966,6 @@ t/run/README []doc t/run/exit.t [test] t/run/options.t [test] t/src/README []doc -t/src/atomic.t [test] t/src/basic.t [test] t/src/checkdepend.t [test] t/src/embed.t [test] @@ -1979,6 +1977,7 @@ t/src/extend.t [test] t/src/extend_vtable.t [test] t/src/misc.t [test] t/src/pointer_array.t [test] +t/src/threads_io.t [test] t/src/warnings.t [test] t/steps/auto/arch-01.t [test] t/steps/auto/attributes-01.t [test] @@ -2015,7 +2014,6 @@ t/steps/auto/pod2man-01.t [test] t/steps/auto/readline-01.t [test] t/steps/auto/readline-02.t [test] t/steps/auto/revision-01.t [test] -t/steps/auto/sha1-01.t [test] t/steps/auto/signal-01.t [test] t/steps/auto/sizes-01.t [test] t/steps/auto/snprintf-01.t [test] @@ -2067,8 +2065,8 @@ t/tools/dev/headerizer/testlib/nci_pmc.in [test] t/tools/dev/headerizer/testlib/none.in [test] t/tools/dev/headerizer/testlib/validheader.in [test] t/tools/dev/pmctree.t [test] -t/tools/dev/searchops.t [test] -t/tools/dev/searchops/samples.pm [test] +t/tools/dev/search_ops.t [test] +t/tools/dev/search_ops/samples.pm [test] t/tools/dump_pbc.t [test] t/tools/install/01-create_directories.t [test] t/tools/install/02-install_files.t [test] @@ -2123,8 +2121,9 @@ tools/build/pmc2c.pl [devel] tools/build/vtable_extend.pl [] tools/build/vtable_h.pl [] tools/dev/.gdbinit [] -tools/dev/README []doc +tools/dev/README.md []doc tools/dev/addopstags.pl [] +tools/dev/all_hll_test.pl [] tools/dev/as2c.pl [] tools/dev/bench_op.pir [] tools/dev/create_language.pl [devel] @@ -2133,7 +2132,7 @@ tools/dev/dedeprecator.nqp [] tools/dev/dump_pbc.pl [] tools/dev/faces.pl [] tools/dev/fetch_languages.pl [] -tools/dev/findhacks.pl [] +tools/dev/find_hacks.pl [] tools/dev/gdb-pp-load.py [] tools/dev/gdb-pp.py [] tools/dev/gen_charset_tables.pl [] @@ -2160,11 +2159,12 @@ tools/dev/mk_rpm_manifests.pl [] tools/dev/nci_test_gen.pl [] tools/dev/nci_thunk_gen.pir [] tools/dev/ncidef2pir.pl [] +tools/dev/new_changelog_skeleton.pl [] tools/dev/nopaste.pl [] tools/dev/parrot-config.pir [] -tools/dev/parrot-fuzzer [] tools/dev/parrot.supp [] tools/dev/parrot_coverage.pl [] +tools/dev/parrot_fuzzer.py [] tools/dev/parrot_shell.pl [] tools/dev/parrotbench.pl [] tools/dev/pbc_header.pl [] @@ -2177,7 +2177,8 @@ tools/dev/pmctree.pl [] tools/dev/pprof2cg.pl [devel] tools/dev/reconfigure.pl [devel] tools/dev/resolve_deprecated.nqp [] -tools/dev/search-ops.pl [] +tools/dev/resubmit_smolder.pl [] +tools/dev/search_ops.pl [] tools/dev/show_deprecated.nqp [] tools/dev/show_experimental.nqp [] tools/dev/symlink.pl [] @@ -2187,17 +2188,21 @@ tools/dev/vgp_darwin [] tools/dev/vms-patch [] tools/dev/vtablize.pl [] tools/docs/filename_and_chapter.pl [] -tools/docs/make_html_docs.pl [] tools/docs/mk_chm.pl [] +tools/docs/mk_html_docs.pl [] tools/docs/ops_summary.pl [] tools/install/smoke.pl [] tools/install/smoke_languages.pl [] tools/release/README []doc +tools/release/auto_release.pl [] tools/release/crow.pir [] +tools/release/cut.pl [] tools/release/gen_release_info.pl [] tools/release/inc_ver.pir [] +tools/release/parrot_github_release.pl [] tools/release/release.json [] tools/release/releasecheck.pl [] +tools/release/sha256sum.pl [] tools/release/templates.json [] tools/release/update_version.pl [] # Local variables: diff --git a/MANIFEST.SKIP b/MANIFEST.SKIP index 2dee9bca0e..5ba4dd44fe 100644 --- a/MANIFEST.SKIP +++ b/MANIFEST.SKIP @@ -12,6 +12,8 @@ # ports/ should not go into release tarballs ^ports$ ^ports/ +^$ +^/ ^.*\.diff$ ^.*\.diff/ ^.*\.obj$ @@ -26,6 +28,12 @@ ^.*\.rej/ ^.*\.res$ ^.*\.res/ +^/.*/.*/.*/.*\.sw?$ +^/.*/.*/.*/.*\.sw?/ +^/.*/.*/.*\.sw?$ +^/.*/.*/.*\.sw?/ +^/.*/.*\.sw?$ +^/.*/.*\.sw?/ ^/.*\.core$ ^/.*\.core/ ^/.*\.def$ @@ -150,6 +158,8 @@ ^/core.*/ ^/cover_db$ ^/cover_db/ +^/cygparrot.*\.dll$ +^/cygparrot.*\.dll/ ^/docs/.*\.tmp$ ^/docs/.*\.tmp/ ^/docs/Makefile$ @@ -264,70 +274,6 @@ ^/examples/pir/befunge/befunge/ ^/examples/pir/befunge/installable_befunge$ ^/examples/pir/befunge/installable_befunge/ -^/ext/Makefile$ -^/ext/Makefile/ -^/ext/Parrot-Embed/.*\.bs$ -^/ext/Parrot-Embed/.*\.bs/ -^/ext/Parrot-Embed/.*\.bundle$ -^/ext/Parrot-Embed/.*\.bundle/ -^/ext/Parrot-Embed/.*\.c$ -^/ext/Parrot-Embed/.*\.c/ -^/ext/Parrot-Embed/.*\.def$ -^/ext/Parrot-Embed/.*\.def/ -^/ext/Parrot-Embed/.*\.dll$ -^/ext/Parrot-Embed/.*\.dll/ -^/ext/Parrot-Embed/.*\.dump$ -^/ext/Parrot-Embed/.*\.dump/ -^/ext/Parrot-Embed/.*\.dylib$ -^/ext/Parrot-Embed/.*\.dylib/ -^/ext/Parrot-Embed/.*\.exe$ -^/ext/Parrot-Embed/.*\.exe/ -^/ext/Parrot-Embed/.*\.exp$ -^/ext/Parrot-Embed/.*\.exp/ -^/ext/Parrot-Embed/.*\.h$ -^/ext/Parrot-Embed/.*\.h/ -^/ext/Parrot-Embed/.*\.ilk$ -^/ext/Parrot-Embed/.*\.ilk/ -^/ext/Parrot-Embed/.*\.lib$ -^/ext/Parrot-Embed/.*\.lib/ -^/ext/Parrot-Embed/.*\.manifest$ -^/ext/Parrot-Embed/.*\.manifest/ -^/ext/Parrot-Embed/.*\.o$ -^/ext/Parrot-Embed/.*\.o/ -^/ext/Parrot-Embed/.*\.obj$ -^/ext/Parrot-Embed/.*\.obj/ -^/ext/Parrot-Embed/.*\.old$ -^/ext/Parrot-Embed/.*\.old/ -^/ext/Parrot-Embed/.*\.pdb$ -^/ext/Parrot-Embed/.*\.pdb/ -^/ext/Parrot-Embed/.*\.so$ -^/ext/Parrot-Embed/.*\.so/ -^/ext/Parrot-Embed/.*\.tmp$ -^/ext/Parrot-Embed/.*\.tmp/ -^/ext/Parrot-Embed/.*\.xs$ -^/ext/Parrot-Embed/.*\.xs/ -^/ext/Parrot-Embed/Build$ -^/ext/Parrot-Embed/Build/ -^/ext/Parrot-Embed/Build\.bat$ -^/ext/Parrot-Embed/Build\.bat/ -^/ext/Parrot-Embed/Makefile$ -^/ext/Parrot-Embed/Makefile/ -^/ext/Parrot-Embed/Makefile\.PL$ -^/ext/Parrot-Embed/Makefile\.PL/ -^/ext/Parrot-Embed/_build$ -^/ext/Parrot-Embed/_build/ -^/ext/Parrot-Embed/blib$ -^/ext/Parrot-Embed/blib/ -^/ext/Parrot-Embed/dll\.base$ -^/ext/Parrot-Embed/dll\.base/ -^/ext/Parrot-Embed/lib/Parrot/.*\.c$ -^/ext/Parrot-Embed/lib/Parrot/.*\.c/ -^/ext/Parrot-Embed/lib/Parrot/.*\.obj$ -^/ext/Parrot-Embed/lib/Parrot/.*\.obj/ -^/ext/Parrot-Embed/pm_to_blib$ -^/ext/Parrot-Embed/pm_to_blib/ -^/ext/Parrot-Embed/t/.*\.pbc$ -^/ext/Parrot-Embed/t/.*\.pbc/ ^/ext/nqp-rx/src/stage0/nqp-setting\.pir$ ^/ext/nqp-rx/src/stage0/nqp-setting\.pir/ ^/frontend/parrot/.*\.gcda$ @@ -338,6 +284,14 @@ ^/frontend/parrot/.*\.gcov/ ^/frontend/parrot/main\.o$ ^/frontend/parrot/main\.o/ +^/frontend/parrot2/main\.o$ +^/frontend/parrot2/main\.o/ +^/frontend/parrot2/prt0\.pbc$ +^/frontend/parrot2/prt0\.pbc/ +^/frontend/parrot2/prt0\.pbc\.c$ +^/frontend/parrot2/prt0\.pbc\.c/ +^/frontend/parrot2/prt0\.pbc\.o$ +^/frontend/parrot2/prt0\.pbc\.o/ ^/frontend/parrot_debugger/.*\.gcda$ ^/frontend/parrot_debugger/.*\.gcda/ ^/frontend/parrot_debugger/.*\.gcno$ @@ -420,6 +374,8 @@ ^/libparrot\.def/ ^/libparrot\.dll$ ^/libparrot\.dll/ +^/libparrot\.dll\.a$ +^/libparrot\.dll\.a/ ^/miniparrot$ ^/miniparrot/ ^/myconfig$ @@ -464,8 +420,8 @@ ^/parrot_nci_thunk_gen\.c/ ^/parrot_nci_thunk_gen\.pbc$ ^/parrot_nci_thunk_gen\.pbc/ -^/parrot_test_run\.tar\.gz$ -^/parrot_test_run\.tar\.gz/ +^/parrot_old$ +^/parrot_old/ ^/pbc_disassemble$ ^/pbc_disassemble/ ^/pbc_dump$ @@ -488,6 +444,8 @@ ^/runtime/parrot/dynext/.*\.def/ ^/runtime/parrot/dynext/.*\.dll$ ^/runtime/parrot/dynext/.*\.dll/ +^/runtime/parrot/dynext/.*\.dll\.a$ +^/runtime/parrot/dynext/.*\.dll\.a/ ^/runtime/parrot/dynext/.*\.dylib$ ^/runtime/parrot/dynext/.*\.dylib/ ^/runtime/parrot/dynext/.*\.exe$ @@ -626,6 +584,8 @@ ^/src/dynoplibs/.*\.c/ ^/src/dynoplibs/.*\.dll$ ^/src/dynoplibs/.*\.dll/ +^/src/dynoplibs/.*\.dll\.a$ +^/src/dynoplibs/.*\.dll\.a/ ^/src/dynoplibs/.*\.exp$ ^/src/dynoplibs/.*\.exp/ ^/src/dynoplibs/.*\.gcda$ @@ -662,6 +622,8 @@ ^/src/dynpmc/.*\.def/ ^/src/dynpmc/.*\.dll$ ^/src/dynpmc/.*\.dll/ +^/src/dynpmc/.*\.dll\.a$ +^/src/dynpmc/.*\.dll\.a/ ^/src/dynpmc/.*\.dump$ ^/src/dynpmc/.*\.dump/ ^/src/dynpmc/.*\.dylib$ @@ -862,6 +824,8 @@ ^/src/string/encoding/.*\.obj/ ^/src/string/private_cstring\.h$ ^/src/string/private_cstring\.h/ +^/t/archive/parrot_test_run\.tar\.gz$ +^/t/archive/parrot_test_run\.tar\.gz/ ^/t/benchmark/.*\.pasm$ ^/t/benchmark/.*\.pasm/ ^/t/benchmark/.*\.pir$ @@ -988,14 +952,24 @@ ^/t/pmc/.*_pbcexe.*/ ^/t/pmc/testlib/.*\.pbc$ ^/t/pmc/testlib/.*\.pbc/ +^/t/src/.*\.exe$ +^/t/src/.*\.exe/ +^/t/src/.*\.exp$ +^/t/src/.*\.exp/ ^/t/src/.*\.gcdada$ ^/t/src/.*\.gcdada/ ^/t/src/.*\.gcov$ ^/t/src/.*\.gcov/ +^/t/src/.*\.lib$ +^/t/src/.*\.lib/ ^/t/src/.*_.*\.c$ ^/t/src/.*_.*\.c/ +^/t/src/embed.*\.o$ +^/t/src/embed.*\.o/ ^/t/src/embed/.*\.c$ ^/t/src/embed/.*\.c/ +^/t/src/extend.*\.o$ +^/t/src/extend.*\.o/ ^/t/stress/.*\.out$ ^/t/stress/.*\.out/ ^/t/stress/.*\.pasm$ @@ -1054,6 +1028,10 @@ ^/winxed/ ^/winxed\..*$ ^/winxed\..*/ +^cachegrind\.out\..*$ +^cachegrind\.out\..*/ +^callgrind\.out\..*$ +^callgrind\.out\..*/ # Local variables: # mode: text # buffer-read-only: t diff --git a/MANIFEST.generated b/MANIFEST.generated index bb1b0dc082..113fc43708 100644 --- a/MANIFEST.generated +++ b/MANIFEST.generated @@ -1,13 +1,14 @@ # 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.3.6.0.dylib [main]lib +blib/lib/libparrot.4.3.0.dylib [main]lib blib/lib/libparrot.a [main]lib blib/lib/libparrot.dylib [main]lib blib/lib/libparrot.so [main]lib -blib/lib/libparrot.so.3.6.0 [main]lib +blib/lib/libparrot.so.4.3.0 [main]lib compilers/data_json/data_json.pbc [data_json] config/gen/call_list/opengl.in [] +cygparrot-4.3.0.dll [main]bin docs/ops/bit.pod [doc] docs/ops/cmp.pod [doc] docs/ops/core.pod [doc] @@ -35,11 +36,13 @@ include/parrot/has_header.h [main]include include/parrot/pbcversion.h [devel]include include/parrot/vtable.h [main]include include/pmc/pmc_addrregistry.h [devel]include +include/pmc/pmc_alarm.h [devel]include include/pmc/pmc_arrayiterator.h [devel]include include/pmc/pmc_bigint.h [devel]include include/pmc/pmc_bignum.h [devel]include include/pmc/pmc_boolean.h [devel]include include/pmc/pmc_bytebuffer.h [devel]include +include/pmc/pmc_callback.h [devel]include include/pmc/pmc_callcontext.h [devel]include include/pmc/pmc_capture.h [devel]include include/pmc/pmc_class.h [devel]include @@ -103,7 +106,7 @@ include/pmc/pmc_packfilesegment.h [devel]include include/pmc/pmc_packfileview.h [devel]include include/pmc/pmc_parrotinterpreter.h [devel]include include/pmc/pmc_parrotlibrary.h [devel]include -include/pmc/pmc_parrotthread.h [devel]include +include/pmc/pmc_pmclist.h [devel]include include/pmc/pmc_pmcproxy.h [devel]include include/pmc/pmc_pointer.h [devel]include include/pmc/pmc_ptr.h [devel]include @@ -128,7 +131,6 @@ include/pmc/pmc_stringiterator.h [devel]include include/pmc/pmc_structview.h [devel]include include/pmc/pmc_sub.h [devel]include include/pmc/pmc_task.h [devel]include -include/pmc/pmc_threadinterpreter.h [devel]include include/pmc/pmc_timer.h [devel]include include/pmc/pmc_undef.h [devel]include include/pmc/pmc_unmanagedstruct.h [devel]include @@ -143,8 +145,6 @@ installable_parrot-prove.exe [main]bin installable_parrot.exe [main]bin installable_parrot_config [main]bin installable_parrot_config.exe [main]bin -installable_parrot_debugger [main]bin -installable_parrot_debugger.exe [main]bin installable_parrot_nci_thunk_gen [main]bin installable_pbc_disassemble [main]bin installable_pbc_disassemble.exe [main]bin @@ -160,6 +160,7 @@ lib/Parrot/Config/Generated.pm [devel]lib lib/Parrot/PMC.pm [devel]lib lib/Parrot/Pmc2c/PCCMETHOD_BITS.pm [devel]lib libparrot.dll [main]bin +libparrot.dll.a [main]lib libparrot.lib [main]bin runtime/parrot/dynext/bit_ops.bundle [library] runtime/parrot/dynext/bit_ops.dll [library] @@ -209,6 +210,10 @@ runtime/parrot/dynext/rational.bundle [library] runtime/parrot/dynext/rational.dll [library] runtime/parrot/dynext/rational.dylib [library] runtime/parrot/dynext/rational.so [library] +runtime/parrot/dynext/select.bundle [library] +runtime/parrot/dynext/select.dll [library] +runtime/parrot/dynext/select.dylib [library] +runtime/parrot/dynext/select.so [library] runtime/parrot/dynext/sys_ops.bundle [library] runtime/parrot/dynext/sys_ops.dll [library] runtime/parrot/dynext/sys_ops.dylib [library] @@ -348,11 +353,13 @@ src/nci.c [] src/null_config.c [] src/parrot_config.c [] src/pmc/addrregistry.dump [devel]src +src/pmc/alarm.dump [devel]src src/pmc/arrayiterator.dump [devel]src src/pmc/bigint.dump [devel]src src/pmc/bignum.dump [devel]src src/pmc/boolean.dump [devel]src src/pmc/bytebuffer.dump [devel]src +src/pmc/callback.dump [devel]src src/pmc/callcontext.dump [devel]src src/pmc/capture.dump [devel]src src/pmc/class.dump [devel]src @@ -415,7 +422,7 @@ src/pmc/packfilesegment.dump [devel]src src/pmc/packfileview.dump [devel]src src/pmc/parrotinterpreter.dump [devel]src src/pmc/parrotlibrary.dump [devel]src -src/pmc/parrotthread.dump [devel]src +src/pmc/pmclist.dump [devel]src src/pmc/pmcproxy.dump [devel]src src/pmc/pointer.dump [devel]src src/pmc/ptr.dump [devel]src @@ -440,7 +447,6 @@ src/pmc/stringiterator.dump [devel]src src/pmc/structview.dump [devel]src src/pmc/sub.dump [devel]src src/pmc/task.dump [devel]src -src/pmc/threadinterpreter.dump [devel]src src/pmc/timer.dump [devel]src src/pmc/undef.dump [devel]src src/pmc/unmanagedstruct.dump [devel]src diff --git a/NEWS b/NEWS deleted file mode 100644 index b53e6a3ae6..0000000000 --- a/NEWS +++ /dev/null @@ -1,2409 +0,0 @@ -New in 3.7.0 -- Core -- Languages -- Documentation - + The Archive::Tar and Archive::Zip libraries now have POD docs -- Tests - -New in 3.6.0 -- Core - + Class.add_vtable_override now allows you to overwrite an override - + Integers, floats and strings can now be stored in lexical variables. - Previously, only PMCs could be stored in lexicals. - + VTABLE_substr has been removed. VTABLE_substr_str has been renamed to - VTABLE_substr - + Added a new PackfileView PMC type, an intended replacement for the deprecated - Eval PMC. - + The is_integer vtable on the String PMC now works for all string encodings. - + Unicode error messages on Win32 now work correctly. - + A memory leak in IMCC was fixed. -- Languages - + The snaphost of Winxed included with Parrot was updated to version 1.0.0 - + Winxed has migrated to Github: https://github.com/NotFound/winxed - -New in 3.5.0 -- Core - + Parrot_PMC_destroy, Parrot_PMC_mark and Parrot_PMC_invoke were removed from - the public extension API. - + PAST now has PAST::Stmt node types, supports reusable temporary registers. - + Test coverage of the embedding and extending interface is now at least 95%. - + A snapshot of Winxed is now included in Parrot core to facilitate writing - core Parrot tools from a higher level language than PIR. -- Languages - + Winxed - - Improved compile time scope search. - - Added 'using namespace' statement. - - Compiler classes and functions now live in the Winxed;Compiler namespace. -- Tests - + The Parrot test suite harness now understands the HARNESS_TIMER environment - variable. Setting it to a true value will show timing results for a test run. - + IPv6 tests are now parallel testing friendly. - -New in 3.4.0 -- Core - + The Generational Mark and Sweep garbage collector is the new default. - + The --gc-nursery-size command line argument was added. - + Parrot now gets entropy from the underlying OS. - + The NCI subsystem now supports 8, 16, 32 and 64 bit integers. - + The NCI subsystem now supports "long long" and "long double" signatures. - Not all platforms/compilers support these non-standard types, so developers - are cautioned to take note that using them reduces portability. - + Many more OpenGL functions in the Parrot OpenGL bindings are available, - which required the above-mentioned signatures. - + Bytecode-related embedding api functions moved to src/embed/bytecode.c. -- Languages - + Winxed - - Use 'using extern' for module imports. - - Improved stage 0 prefix ++ and -- operators. - - Allow 'null' in conditional operator. - - Several examples are updated. -- Community - + Google Summer of Code Bonding period is going well. Students are mostly done - with their classes and much code will flow soon. -- Documentation - + More PCT introductions are available at: http://github.com/benabik/cish - -New in 3.3.0 -- Core - + The isa and isa_pmc vtables can now be overridden from PIR - + IMCC has a new improved external interface - + A new IMCCompiler PMC adds prototype PDD31-alike functionality for the PIR and PASM compilers - + New --with-llvm option to Configure.pl, which will link to LLVM if it is available -- Community - + Parrot Virtual Machine was accepted into Google Summer of Code 2011 -- Ecosystem - + Rosella adds a stable "Event" library to implement a publish/subscribe mechanism -- Tests - + The test coverage of the extend_vtable subsystem was greatly increased - -New in 3.2.0 -- Core - + Full support for Unicode filenames on Linux and Win32 - + The configuration option --cxx is gone - + New Generational GC implemented. To enable it run Configure.pl --gc=gms - + Now op definitions are semantically parsed. It opens possibilities for - future optimizations of parrot core. - + A statement convert the '.param' PIR systax - + A PMC is implemented for low-level buffer access which separate the - representation from the pointers - + Support added for 'long double', 'long long', and 64-bit to StructView - + In math.h are tools available for Inf/NaN - + Signature PMCs are used pervasively -- Languages - + A few tests in Cardinal are fixed - + A binary .dmg is created of Rakudo Star for OS X - + Winxed - - Minor fixes, refactors and cleaning - - New predefs replace, push and provide a way to access multiple return - values - - Operators exits, class and .* (indirect method call) added - - $loadlib directive - - -o option to installable driver added - - Indent generated PIR is added to improve clarity and avoid imcc pitfalls - with non indented sub bodys -- Community - + M0 roadmap is in progress -- Documentation - + 'make docs' target, which was serving only to generate superfluous POD - files, has been removed. - + Svn remnants from PDDs are removed -- Tests - + Added 'make release_check' target so that Release Manager can double-check - tarball - + Probes added for 'long long' and 64-bit C types -- Rosella (https://github.com/Whiteknight/Rosella) - Rosella is a collection of tools and building blocks for Parrot - + A working proxy library is created, that make mostly-transparent custom - proxies for many types of Parrot PMCs - + A mockobject testing library is created, using the new proxy library - + The PLA test suite is updated to use the new Rosella testing tools, - including the new mockobjects to test callbacks - -New in 3.1.0 -- Core - + Exception PMCs are now subclassable from PIR - + IPv6 is now supported and tested - + Added Parrot_ext_try function to extend API (experimental), to allow - implementation of try .. catch construct in C extensions. - + We now have a YAML library called YAML::Tiny, a port of YAML::Tiny from Perl 5 - + Deprecated/experimental features are now stored in api.yaml in an easy-to-parse - format, which will allow automated tools easy access to this data. This replaces - DEPRECATED.pod, which no longer exists. - + Improved GC latency - + Improved GC performance on low-memory systems - + Improved packfile annotation lookup complexity - + Removal of unused code and SVN based code -- NQP - + A repository for a new NQP version which has a new object model is - created at http://github.com/perl6/nqp -- Languages - + Cardinal (Ruby on Parrot) now compiles and passes it's test suite on master - and is looking for developers : https://github.com/parrot/cardinal - + Cardinal can send smoke reports with "rake smoke" or "parrot setup.pir smoke" - + Jaspers, an implementation of Javascript on Parrot, now has a Github repo - and is looking for developers: https://github.com/leto/jaspers -- Community - + The following Parrot Google Code-In students were grand prize winners: - Fernando Brito, Brazil David Czech, Canada - Nolan Lum, United States Matt Rajca, United States - Tony Young, New Zealand Daniel Kang, United States - We are very proud of them for their fine work and congratulate - them for achieving top finalist status! For more info, see: - http://google-opensource.blogspot.com/2011/02/google-code-in-grand-prize-winners.html -- Documentation - + Many new Parrot-related terms were added to docs/glossary.pod - + Removal of most remaining references to SVN - + Internal project documentation is included in html output -- Tests - + Test suite now passes on NetBSD 5.1 - + Test coverage increased greatly for the Embed/Extend subsystem, - thanks to a TPF grant: - http://leto.net/dukeleto.pl/2011/01/parrot-embed-grant-update-2.html - -New in 3.0.0 -- Core - + A new embedding API is available in "parrot/api.h" and documented in - docs/pdd/pdd10_embedding.pod . - + Packfile PMCs were refactored and can now be used to produce runnable bytecode. - + Packfile manipulation code now throws embedder-friendly exceptions rather - than printing error details directly to stderr. - + Unicode support for file IO, environment variables, program names, and - command-line parameters was improved. - + An experimental gdb pretty-printers in tools/dev for Parrot STRINGs and - PMCs is now available. (gdb 7.2 or later and Python are required) - + c2str.pl and pmc2c.pl improvements result in a noticably faster build. - + Bugs in our Digest::sha256 library and bit-related dynamic ops were fixed - by GCI student Nolan Lum. Both now work correctly on 32 and 64 bit systems. -- Languages - + Ωη;)XD - OMeta for Winxed https://github.com/plobsing/ohm-eta-wink-kzd -- Community - + tree-optimization by GSoC student Tyler L. Curtis joined the nest and now - lives at http://github.com/parrot/tree-optimization . - + Plumage now lives at http://github.com/parrot/plumage and is installable. - + Christmas proceeded as scheduled. The Parrot team does not take credit for - this event. -- Documentation - + HTML documentation generation has been rewritten and greatly simplified. - + We have improved documentation in docs/project/git_workflow.pod about - keeping a fork of parrot.git in sync. - + Translations of our README in various languages are now in the - docs/translation directory, thanks to Google Code-In students. -- Tests - + A better way to write "todo" tests with Parrot's Test::More was implemented - by GCI student Fernando Brito. - + Major increases in test coverage of many core PMCs, dynamic PMCs and - dynamic opcodes resulted from GCI and the interpid students it attracted. - + Jonathan "Duke" Leto set up Debian Linux x86_64 and sparc32 smokers - in the GCC Compile Farm, which continually submit smoke reports with - a variety of configuration options and compilers. Thanks, GCC! - + Makefile dependency checking is now automatically tested, resulting in a - more reliable parallel build. - + Coverage tests were improved for platforms with and without Devel::Cover. - -New in 2.11.0 -- Core - + Just In Time native call frame generation using LibFFI - + PIR op find_codepoint is no longer experimental, it is now supported - + Several public functions in libparrot have been brought up to standard - naming conventions. - + Improved linked-list implementation in GC - + set_addr opcode is being replaced with the new set_label opcode in core libraries - + Removed deprecated CodeString PMC - + Added close, is_closed, read, readline methods to Socket - + Added experimental MappedByteArray PMC type - + Added Parrot_warn_experimental, to warn the user about experimental features - + Code for frontend executables moved from src/ to frontend/ - + Support for chunked receive in LWP library. - + Added a "quickcover" make target -- Languages - + PIRC - - left the nest and is currently at https://github.com/parrot/pirc/ - + Community - - Our README was translated into the following languages - by Google Code-In students and mentors: - Polish README.polski - Spanish README.espanol - German README.deutsch -- Documentation -- Tests - + Test coverage increase on PMCs: String, Integer, NameSpace, Complex, EventHandler - + 'make quickcover' target added to speed up most essential - parts of coverage analysis - + 'tools/dev/headerizer.pl' refactored to improve maintainability - (no change in functionality) - -New in 2.10.0 -- Core - + We are on github now! https://github.com/parrot/parrot - + Configure, build and test subsystems were made Git-aware - + New parrot_config key 'osvers' which contains - Operating System Version information - + Updated to the latest nqp-rx - + A proper exception is now thrown on IO read errors - + Garbage Collector optimizations and memory leak fixes - + Deprecated charset ops were removed - + Configure system learned to detect IPv6 - + The mk_language_shell and create_language scripts have not yet been - ported to Git. -- Documentation - + How To Use Git to work on Parrot - https://github.com/parrot/parrot/blob/master/docs/project/git_workflow.pod - + Git Terminology - https://github.com/parrot/parrot/blob/master/docs/project/git_terminology.pod -- Platforms -- Testing - + Increased coverage on: String, FixedBooleanArray, PMCProxy, LexPad -- Community - + Macports portfile updated to 2.6.0 - + A Fedora package for PL/Parrot ( postgresql-plparrot ) was created - This package allows you to write stored procedures for PostgreSQL in - PIR or Rakudo Perl 6 http://pl.parrot.org - + Parrot Foundation is teaming up with The Perl Foundation and taking - part in Google Code-In 2010. Learn about it and how to get involved here: - - http://trac.parrot.org/parrot/wiki/GoogleCodeIn2010Tasks - - http://leto.net/perl/2010/11/parrot-foundation-the-perl-foundation-google-code-in.html - - -New in 2.9.1 - - This is a bugfix release. If you run out of memory on a box with < 512 MB physical RAM, please report it to us. - -New in 2.9.0 -- Core - + Parrot and Rakudo's build and tests can now be run under the profiling runcore - + IPv6 is now detected, laying the groundwork for future networking improvements - + mk_language_shell.pl and create_language.pl no longer require an installed parrot - + String PMC's 'reverse' method is now faster and supports all encodings - + improvements and simplifications in internal string processing - + Added API for adding STRINGs to the gc root set - + Speed up ord, substr, index and string comparison opcodes -- Testing - + "make smoke" supports parallel testing by honoring TEST_JOBS - + Added tests for Socket PMC, StringBuilder PMC, ByteBuffer PMC, - mk_language_shell.pl, create_language.pl - + Fixed "Configure.pl" about missing tests - + Parrot and Rakudo Perl 6 now have access to the GCC Compile Farm - + Testing on Darwin/PPC -- Git Migration - + Most developer tools have been ported to Git - + Majority of developer docs have been written for Git -- Platforms - + Parrot can now be built on Minix - -New in 2.8.0 -- Core - + Inlined hashing and comparison functions - + Hash memory allocation moved from system malloc to lazy allocated - + Avoided infinite catching of exceptions while dying from exception - + Some svn fixes - + Added a check for duplicate vtable entries in PMCs - + Building Parrot with Perl 5.12 and gcc-4.5 / g++-4.5 - + Eliminated cruft left over after dynops_mapping - + Improved charset and string encoding - + Better organisation of programs by reposition it to "tools/build" and "tools/release" - + Implemented Exception clone vtable function - + Added experimental function Parrot_getpid and getpid method - + --gc-threshold command line argument added, which controls the % of memory wasted by the GC - + Closed a lot of tickets -- Testing - + Added more core pmc tests - + Rearranged some tests with C coverage - + We now have Smolder back, at http://smolder.parrot.org . Submit reports with "make smoke" - + skip_all implementation in Parrot's Test::More completed -- GitMigration - + Set up a test site for github trac plugin at http://mksig.org/trac/ - + Code of Trac plugin at github is on http://github.com/cotto/github-trac - + Parrot is now mirrored on github at http://github.com/parrot/parrot -- Compilers - + Fixed problem with imcc HLL in load_bytecode difference between loading a pbc and compiling a pir - -New in 2.7.0 -- Core - + cleanups in packfile and freeze/thaw handling - + Hash optimizations that improve HLL startup and run time - + As always, many bug fixes and other optimizations -- Runtime - + some runtime library cleanups -- Testing - + added more tests to improve coverage - + new codingstd test for documentation in .pmc files -- Documentation - + added documentation to .pmc files (some still missing but headers in place) - + general documentation improvements and bringing up-to-date -- NQP-rx - + Updated version included from http://github.com/perl6/nqp-rx includes - speed improvements - -New in 2.6.0 -- Core - + Plug some memory leaks - + As always, bug fixes and some optimizations -- Runtime - + added (experimental) URI::Escape -- Testing - + Improved test coverage of core parrot -- Documentation - + Updated the Squaak tutorial to use modern NQP-rx and PCT -- Platforms - + The Fedora package 'parrot-devel' install the files for syntax-highlighting - and automatic indenting for the vim editor -- NQP-rx - + Updated version included from http://github.com/perl6/nqp-rx includes - new or improved: regex backtracking, named assertions, interactive mode, - and setting (a minimal but useful runtime library) - -New in 2.5.0 -- Core - + Added ByteBuffer PMC to allow direct byte manipulation - + Modified some PMC vtable functions to reduce complexity, simplifying coverage. - + Modified PAST to generate symbolic PASM constants in PIR output. - + General STRING API cleanups - + Increased test coverage of core PMCs - + Fixed up 'exit' opcode, added CONTROL_EXIT exception type. - + Experimental 'unroll' opcode renamed to 'finalize' -- NQP-rx - + Added proper support for multisubs and multimethods - + Fixed sigspace handling ** quantifier in regexes - + Added \e strings - + Added use of inversion lists for charclass lists in regexes -- Platforms - + EPEL (Extra Packages for Enterprise Linux) packages for RHEL6.beta are available -- Begin moving towards Lorito, the ops refactor to enable pervasive self-hosting and JIT compilation. - + All ops are now built with the self-hosted opsc compiler. - + For more Information about Lorito see: - http://trac.parrot.org/parrot/wiki/Lorito - http://trac.parrot.org/parrot/wiki/LoritoRoadmap - -New in 2.4.0 -- Core - + Various long-standing bugs in IMCC were fixed - + STRINGs are now immutable. - + use STRINGNULL instead of NULL when working with strings - + Fixed storage of methods in the NameSpace PMC - + Added :nsentry flag to force method to be stored in the NameSpace - + Added StringBuilder and PackfileDebug PMCs - + Added experimental opcodes find_codepoint and unroll -- Compilers - + Fixed reporting of line numbers in IMCC - + Removed deprecated NQP compiler, replaced with new NQP-RX - + Removed NCIGen compiler -- Deprecations - + Tools to distribute on CPAN were removed - + Deprecated dynpmcs have been removed to external repositories - + Removed RetContinuation PMC - + Removed CGoto, CGP, and Switch runcores -- Tests - + Many tests for the extend/embed interface were added - + done_testing() is now implemented in Test::More -- Tools - + The fakexecutable tapir is renamed parrot-prove - + Performance fixes to the pbc_to_exe tool - + Fix data_json to work outside of trunk - + The dynpmc GzipHandle (zlib wrapper) was added - + The library Archive/Tar.pir was added. - + The library Archive/Zip.pir was added. - + The libraries LWP.pir, HTTP/Message.pir & URI.pir were added. -- Miscellaneous - + Six Parrot-related projects accepted to GSoC - + Improve use of const and other compiler hints - -New in 2.3.0 -- Core - + Allow passing parameters to the dynamic linker ('dlopen' improved) - + loadlib opcode added - + Calling conventions are now much more consistent, and follows natural - semantics of handling arguments and return values - + Recursive make for src/dynpmc removed - + Datatype STRINGNULL for a single Null STRING added - + config_lib.pasm replaced with config_lib.pir -- Platforms - + Improved handling of new compilers - + Cygwin packages will be updated again with Parrot releases - + Fedora packages add desktop files - + gzip and bzip2 compressed tar files for releases -- Tools - + tapir executable added; tapir is a TAP test harness - + Added TAP options --merge --ignore-exit -- Miscellaneous - + 3 month cycle for supported releases - + Review and vote of GSoC applications - -New in 2.2.0 -- Core changes - + Most internal allocations now use the GC - + RNG non-randomnes fixes - + Elimination of much dead code -- API changes - + PMCs can now be initialized from an int - + Many legacy ops are removed -- Platforms - + Sun cc and Intel icc support have been restored - + Compiler invocation no longer goes through a Perl script -- Tools - + NCI thunks are now generated by self-hosted PIR code - -New in 2.1.0 -- Core changes - + GC performance and encapsulation were greatly improved. - + PMC freeze refactored. - + More Makefile and build improvements. -- API Changes - + The Array PMC was removed. - + Several deprecated vtables were removed. - + The OrderedHash PMC was substantialy improved. -- Platforms - + Packaging improvements on some operating systems. -- Tools - + Some cases in pbc_merge are now handled. - + Improvements were made to the dependency checker. - + New tool nativecall.pir added. - -New in 2.0.0 -- Features - + Context PMCs now support attribute-based introspection - + Context and CallSignature PMCs merged into CallContext - + .lex directive throws exceptions when used with incorrect register types -- Platforms - + Packaging improved for free OS distributions - + PPC, PPC64, and ARM now tested when running Linux -- Performance - + Minor improvements to the profiling runcore - + 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 -- Tests - + Continued migration of core tests from Perl 5 to PIR -- 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:" 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: - + 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 - + Fixed inheritance hierarchy of FileHandle and Socket PMC types - + Fixed leaks involving subroutines and Parrot_Context - + Cleaned up and refactored GC internals, including fixes and optimizations - + Optimized PMC class manipulations to use type numbers instead of string names - + Fixed problems involving hashval calculations in strings - + Removed unnecessary MULTI dispatches in built-in PMCs - + Fixed memory leaks involving PMCs that were not properly destroyed - + Fixed creation of PMCProxy PMCs in correct namespaces - + Added preliminary Pipe support - + Fixed cloning of Object PMCs - + Added root_new opcode - + Added initial versions of Packfile PMCs with read/write capabilities -- Compilers - + Fixed several memory leaks in IMCC - + Updated PCT to use root_new opcode - + Added support for keyword "self" in NQP -- Documentation - + Improved and expanded /docs/book - + Updated project documentation - + Defined 'experimental' status and procedures in DEPRECATED.pod -- Miscellaneous - + Cleaned code and improved code-level documentation - + Various bugfixes, code cleanups, and coding standard fixes - + Added an experimental compiler library to help use PIR libraries from HLLs - + Updated OpenGL library and examples to support experimental HLL import - -New in 1.2.0 -- Core - + Fixes for pir classes inheriting from core pmcs. - + Cleaned up headers and reorganized some sources into subsystem directories. - + Clean up PMCs so libparrot.so exports far fewer vtable/method symbols. - + Clean up the GC API. - + Several unicode identifier improvements in IMCC. -- Deprecations - + Protoobject stringification is gone. -- Documentation - + Rewrite several core documents. - + Many reworks, improvements & additions to the Parrot Book. - + Installation PDD is launched out of draft. -- Tools - + Fixes for running the language shell generator outside the parrot tree. - + Several fixes for developing and building HLLs from an installed parrot. - + Configure.pl now has a --no-line-directives option to ease source level debugging. -- Miscellaneous - + Portability updates for macports, netbsd, mingw32, hpux. - + Several (build time, runtime) performance improvements. - + Lots of updates to examples and tests. - + Various bugfixes, code cleanups, and coding standard fixes. - -New in 1.1.0 -- Core - + Added op: load_language, find_caller_lex - + Socket IO are back as PMC - + Refactor some PMC: Hash, ManagedStruct - + Refactor GC API -- Compiler - + PGE - - Allow \x, \c, and \o in enumerated character classes (incl ranges) - - Add initial greedy-only version of ** quantifier - + PCT - - Add HLL source line bytecode annotations - - Add another dumper format to assist syntax highlighters - - Revise mk_language_shell.pl to updated create_language.pl -- Deprecations - + Removed ops: gcd, exec, classname, need_finalize, runinterp, substr_r - + Removed dynamic op: mul - + Removed .HLL_map directive; use interp's .hll_map() instead - + Removed PMCs: slice, bound_nci, ref - + Removed Configure.pl option: --pmc - + Removed PMC union struct -- Documentation - + Book - - Reorganization and many improvements & additions -- Tools - + Add a parrot-fuzzer -- Miscellaneous - + Improve Debian/Ubuntu package - + various bugfixes, code cleanups, and coding standard fixes - - -New in 1.0.0 -- Documentation - + New user documentation for exceptions. - + Updates to Chapters 4 & 5 of the Parrot book. - + Improved and expanded generated HTML documentation, as the input for - http://docs.parrot.org. - + Added Compiled HTML Help (.chm) version of documentation. - + Cleanups and fixes. -- Languages - + Pynie - - left the nest and is now at http://pynie.googlecode.com/ - + Cardinal - - left the nest and is now at http://github.com/cardinal - + APL - - left the nest and is now at http://paraplegic.googlecode.com/ - + ABC, Squaak, and Befunge moved to examples/. - + All remaining languages moved to https://svn.parrot.org/languages/ -- Tools - + Support for language builds from an installed Parrot. - + Expanded language shell generator for new languages. - + 'parrotbug' utility repurposed for the Trac interface. -- Deprecations - + Removed deprecated Tqueue and Closure PMCs. - + String, Key, NCI, LexPad, Iterator, Sub, Continuation, RetContinuation, - ExceptionHandler, ParrotLibrary, ParrotInterpreter, ParrotThread, - ParrotRunningThread, Rational, FixedPMCArray, ResizablePMCArray, and - GDBMHash PMCs now use declared attributes (ATTR), in place of the - deprecated UnionVal. - - -New in 0.9.1 -- Implementation - + Support for portable 'Inf', 'NaN' and -0.0 - + pbc_disassemble prints constants in constants table - + New experimental BigNum implementation - + Pair is now a dynamic loadable PMC - + Various function name sanification - + New implementation of Strings component - + Replace various PMC value union access code by VTABLE method invocations - + Replace various PMC value unions by ATTRibutes - + Removed SArray PMC. Use FixedPMCArray instead. -- Documentation - + Book - - updates to Chapter 2 (getting started) - - updates to Chapter 3 (PIR basics) - - updates to Chapter 4 (PIR subroutines) - - updates to Chapter 10 (HLLs) - - updates to Chapter 12 (opcodes) - + Function documentation - + Pod documentation style modernized; no longer Perl 5 style. - + PMC has an additional acronym: Poly Morphic Container - + The DOD (Dead Object Detection) acronym is no longer used; - use 'GC' to refer to the Garbage Collector component. -- Compilers - + IMCC - - :named flag can now take string registers as argument - - A single '=cut' directive is now ignored (without initial Pod directive) - - :vtable subs now have proper access to 'self' pseudo variable -- Languages - + add new 'Pod' documentation parser - + Pipp (PHP implementation): - - Pipp is now at http://github.com/bschmalhofer/pipp - - support for 'print', 'dirname', 'implode', 'str_replace', - - various grammar fixes - + ECMAScript - + add 'quit', 'readline' builtins - + fix 'Boolean' type and 'print' builtin - + Lua - - left the nest and is now at http://github.com/fperrad/lua/ - + Rakudo - - left the nest and is now at http://github.com/rakudo/rakudo/ - - build instructions can be found at http://tinyurl.com/rakudo - + lazy-k - - left the nest and is now at http://github.com/bschmalhofer/lazy-k.git - + unlambda - - left the nest and is now at http://github.com/bschmalhofer/unlambda/ - + WMLScript - - left the nest and is now at http://github.com/fperrad/wmlscript.git - + removed Zcode implementation -- Tools - + pmc2C - - ATTRs are now inherited automatically in subclassing PMCs -- Deprecations - + Parrot_readbc, Parrot_loadbc renamed to Parrot_pbc_read, Parrot_pbc_load. - + .HLL_map directive in favour of 'hll_map' method on Parrot interpreter - + Data::Escape library -- Tools - + pbc_disassemble options added - + pbc_dump renamed from pdump -- Miscellaneous - + Parrot is now Copyright Parrot Foundation - + Parrot's SVN repository is now hosted at https://svn.parrot.org - + Various code cleanups, consting, 64-bit incompatibilities and other bug fixes - - -New in January 2009 release (0.9.0) -- Implementation - + Implemented bytecode annotations - + Role composition is now aware of multi-subs - + Unbuffered IO PMCs now autopromote when buffering is necessary - + Installation parrot binary and libparrot shared library now supported - + Class registry now respects HLLs -- Compilers - + IMCC - - removed keyed string indexing, e.g. $S0[1]. - - removed slice syntax, e.g. $P0[1..2] - - removed .namespace /.endnamespace pair - - fixed 'new $P0, [classname]' syntax - + PIRC - - refactoring of various data structures - - various bug fixes and updates - - complete bytecode generation - - add '-x' commandline option to run compiled code - + PCT - - add 'hll' and 'subid' attributes to PAST::Block - - refactor loop handling code to handle last/redo/next - - add :pasttype('stmts') and :pasttype('null') - - improve "scope not found" error message - - allow PAST::Val nodes to contain block references - + PGE - - add "skipkey" option to PGE::OPTable - - allow spaces before modifiers in regexes - - add '(' ~ ')' goal matching syntax - - skip creating a class/grammar if it already exists -- Languages - + Rakudo - - improved error mesages in multi dispatch - - implemented clone method for all objects - - implemented MAIN sub - - Unicode versions of infix hyper operators - - refactored IO.readline - - basic support for Inf and NaN - - list and array slices with whatever star - - hash slices - - implemented last and redo - - pointy blocks as terms - - refactored variable and parameter passing - - improved assignment semantics - - improved parsing of type names and subs - - mostly implemented parametric roles - - separate types for blocks, subs and methods - - basic support for submethods - - implemented Junction autothreading of user code (not builtins yet) - - eval supports :lang attribute - - proto makes other subs in scope multis, including in role composition - + Befunge - - back to working state - - ported to pir - + Pipp - - add support for predefined constant __CLASS__ and __METHOD__ - - add initial support for static members - - add support for namespaced constants - - constants are now handled as package vars - - variables are now lexical variables - - add support for superglobals in functions - - Call the class __constructor when there is one - - added incomplete support for closures - - removed support for the alternative parsing strategies - - added support for 'elsif' - - added support for 'do-while' - + HQ9+ - - left the nest and is now at https://github.com/bschmalhofer/hq9plus/ - + Eclectus - - left the nest and is now at http://github.com/bschmalhofer/eclectus/ - + m4 - - left the nest and is now at http://github.com/bschmalhofer/m4/ - + Lua: - - add a minimalist user back trace - + PIR - - "does" and "morph" VTABLE interfaces are now overridable from PIR -- Miscellaneous - + Infrastructure - - 'make smoke' now generates Smolder reports sent to - http://smolder.plusthree.com/app/public_projects/smoke_reports/8 - + Improved const and null correctness for C function parameters - + Sped up STRING manipulation (append, chop), improving PGE about 30% - + BOOK - - Added sections about Classes, OO programming, and methods. - - Added information about Annotations, Exceptions, and Handlers - + STM - - Removed non-functional STM subsystem - - -New in 0.8.2 -- Implementation - + fixed lexical semantics - + added the 'capture_lex' opcode - + added automatic resume for nonfatal exceptions - + added multidispatch cache - + applied miscellaneous performance improvements, including startup time - + fixed several bugs and leaks found by Coverity Scan - + removed race conditions from parallel testing -- Compilers - + IMCC - - removed undocumented .param int => syntax - - .line directive now only takes an integer argument - - new .file directive to specify the file name being compiled - + PCT - - properly handles lexical generation and closure semantics - - uses :subid instead of name lookups to reference PAST::Block nodes - - added PAST::Control node type (exception handlers) - + PGE - - add support for and assertions - - Match objects use Capture PMC instead of Capture_PIR - + PIRC - - add macro handling to PASM mode - - disable vanilla register allocation in PASM mode, but do allow optimization - - add tests and bug fixes - - first bits of bytecode generation. No sub calling/returning yet. -- Languages - + Rakudo - - fixed lexical handling and recursion - - refactored subtypes implementation - - support for quotes with multi-character delimiters - - implemented list slices (Positional role) - - list assignment - - reduction meta operators - - hyper meta operators - - cross meta operators - - more builtin functions - - added Nil type - - basic support for protos - - iterator on filehandle objects - - basic support for exception handlers - - warn - + Lua - - added complex & mathx libraries - - merged LuaClosure & LuaFunction PMC - + Pipp - - added support for a return value from user defined functions - - added incomplete implementation of 'require_once' - + Ecmascript - - parser fixes, parses spidermonkey's top level test/shell.js -- Deprecations - + PARROT_API is now PARROT_EXPORT - + PIR - - :lexid is now :subid - - .arg is now .set_arg - - .result is now .get_result - - .yield (in .begin/end_yield) is now .set_yield - - .return (in .begin/end_return) is now .set_return - - .namespace x / .endnamespace x syntax is removed - + Capture_PIR (runtime/parrot/library/Parrot/Capture_PIR.pir) - -New in 0.8.1 -- Implementation - + added CPAN module Storable 2.12 as a configuration and build dependency - + removed the pseudo PIR opcode 'addr' - + added the 'box' opcode - + fixed 'pop_eh' handling in PIR libraries and examples - + removed usage of .return for tailcalls (use .tailcall instead) - + removed 'get_hash' and 'get_array' from Capture PMC and Capture_PIR - + improved debugger and HLL coordination - + allowed MMD primitive autoboxing - + fixed all known memory leaks in PIR "Hello, world!" - + NCI signatures now JITted on x86-32 platforms (Windows and Linux) - + made the .const directive take a quoted type name instead of a constant - + made IMCC more re-entrant -- Languages - + Rakudo - - refactored Junctions implementation - - added "fire and forget" tool to rebase/rebuild/test Parrot and Rakudo - - updated container/reference semantics - - added more builtin methods and functions - - improved support for multilevel namespaces - - added support for .Str, .succ, .pred in user-defined classes - - implemented pointy blocks on if/loops - - increased STD.pm convergence - - added %*VM hash - - improved MMD candidate sorting - - improved integration of Num and Int - - implemented increment on protoobjects - - added initial support for MAIN subs - - added .PARROT method - + Pipp - - added some predefined constants - - added implementation of the function basename() - + Cardinal (Ruby) - - Added initial support for the classes Proc, Continuation, Queue, Dir, File, and FileStat - - fixed various minor bugs - - fixed broken Regexes -- Compilers - + PCT - - added '.isa' method to PCT::Node - - cleaned up 'immediate block' handling - - allowed arguments to immediate blocks in loops/conditionals - - metaclass objects can now 'add_method' - + PIRC - - integrated macro processing in PIRC's lexer - - integrated heredoc lexer in PIRC executable - - added preprocess and heredoc-preprocess commandline options - - integrated the PASM grammar into PIRC - - added a register allocator to optimize the built-in vanilla allocator - - code cleanups and documentation - - added 'make test' target - + TGE - - updated to work with new namespace/classname syntax -- Deprecations - + PARROT_API will become PARROT_EXPORT - + :lexid will become :subid -- Miscellaneous - + Documentation - - updates and additions to the Parrot book (see docs/book/) - + OpenGL - - minor fixes to Parrot's base OpenGL bindings - - converted OpenGL PIR examples to Perl 6 (two complete, one WIP) - - added simplified OpenGL PIR example for NCI JIT testing - + Tests - - further improvements to parallel tests - - tests no longer leave filesystem breadcrumbs - - more thorough testing of Parrot::Test itself - -New in 0.8.0 -- Implementation - + float precision expanded to 15 significant digits from 6 - + large integers autopromoted in PIR so as not to lose precision - + improved precision of complex square root - + exception handlers can register types of exceptions they catch -- Languages - + Cardinal (Ruby) - - implemented gather, take, and yield builtins - - Range, Time, Math, GC, Kernel classes - - many more tests - - added a new committer - + Markdown : new lightweight markup language - - start implementation with PCT/NQP - + partcl (Tcl 8.5.4) - - Moved to its own repository: http://code.google.com/p/partcl/ - + Rakudo (Perl 6) - - split() works with regexes - - implemented Str.comb - - ord() and chr() builtins - - improved parsing of literal numbers - - support for hyphens and dashes in identifiers - - next() on for-loops - - fixed floating point constant precision - - improved namespace handling, closer to STD.pm model - - support for exporting symbols -- Compilers - + P6object - - now generates classes in nested namespaces instead of :: names - - supports class creation in caller's HLL namespace - + PCT / PGE - - now using true nested namespaces instead of :: names - - cleaned up HLLCompiler interactive prompts and readline mode - - updated to use typed exception handler registration - - added initial support for loop control exceptions - + PIRC - - fixed Heredoc preprocessor - - cleaned up Macro preprocessor - - many code clean-ups, warning fixes and consting - - updated Makefile for easier compilation - + IMCC - - Added .tailcall syntax to replace .return in tailcall context -- Examples - + pirric (BASIC) - - an old style line numbered Basic interpreter able to use parrot objects - - example connecting to mysql via nci - - example using classes to write and run an embedded Basic program -- Documentation - + Book - - Added chapters for PCT, PMCs, and Opcodes/Runcores - - Expanded and improved formatting in various chapters - - Renumbered chapters - - -New in 0.7.1 -- Implementation - + add -I and -L command line options - + support for null strings in NCI calls - + preliminary support for resumable exceptions - + add '.hll_map' method for dynamic HLL type mapping - + more parrot_debugger fixes - + remove obsolete '.past' extension -- Languages - + Rakudo (Perl 6) - - now over 3300 passing spectests - - precompiled modules - - precompiled scripts (--target=pir can now be executed standalone) - - Support for @*INC and %*INC varialbes - - additional builtin methods and subs - - added 'fail' function, warnings on use of undefined values - - m/.../ regexes - - qq, qw, q quoting forms - - run tests in parallel - - gather/take - - Perl6MultiSub - + Cardinal (Ruby): - - 'require' and precompiled modules - - many new tests - - all Array tests pass - - regexes - - default arguments to functions - - new committer -- Compilers - + PCT: - - add :loadinit attribute for PAST::Block - + PIRC: - - major refactoring to allow all PIR keywords as identifiers - - links to libparrot now, so all Parrot ops are recognized as such - - implemented .loadlib, .HLL_map, .HLL -- Miscellaneous - + add Xlib and Mysql modules and test programs to NCI examples - + many updates and cleanups to PDD documents - -New in 0.7.0 -- Specification - + PDD27: add multisub lookup -- Implementation - + new concurrency implementation (see PDD25) - + Exception PMC now captures a return continuation - + improved PMC encapsulation (Iterator, Key, Pair) -- Languages - + Cardinal (Ruby): - - class variables - - parsing improvements - - minor additions to class builtins - - add support for block parameters to functions - + Lua: - - various language fixes - - refactor all libraries (namespace, method registration) - - add a OpenGL binding (still incomplete) - - lost user back trace (see ppd25 & pushaction) - + Pipp (PHP): - - add support for while- and for-loops - - add support for increment and decrement - - designate PHP 5.3 as the reference implementation - - improve support for string literals - + Pugs (Perl 6): - - removed due to bit rot - + Rakudo (Perl 6): - - now over 2200 passing spectests - - updated the Rakudo roadmap - - Perl 6 multi dispatch - - dispatch with slurpies - - class attributes ("my $.x") - - anonymous classes - - OO and metaclass improvements (.WHAT, .WHICH, .WHENCE) - - additional builtin methods and subs - - improved make test targets and harness - + Tcl: - - implement [lreverse], [lsort -command] - - allow [incr] to autovivify - - update tclsh spec target to 8.5.3 - - fix bug in TclDict PMC, allowing ~200 more [dict] spec tests to pass - - update 'make spectest' fudging, using TODO instead of SKIP if possible -- Compilers - + PCT: - - :scope('register') for PAST::Var nodes - - allow invocant specification in attribute scope PAST::Var nodes - - correct ordering of sub generation from POST - - add 'loadinit' attribute to PAST::Block for block initialization - + PIRC: - - PIR registers now use the vanilla register allocator - - all PASM output now uses PASM registers - - all .locals and $registers are mapped - - clean-up of grammar, back-end and documentation - - implemented constant folding - - implemented instruction selection -- Configuration - + tests now clean up after themselves - + improved parallel test support - + ports/cygwin added - + Darwin problems fixed -- Tools - + parrot_debugger renamed from pdb, numerous tweaks -- Miscellaneous - + IMCC cleanups - + :vtable implies self in PIR - + modest core speed improvements - + Cygwin support improved - + "say" now an opcode (was dispatched to a method; see Deprecations) -- Deprecations - + ".pragma n_operators" is deprecated - + old PASM register syntax (without "$") is deprecated - + bare (unquoted) method names are deprecated - + "#line" will be replaced with ".line" - + ".HLL_map" syntax will change - + ".loadlib" is now separate from ".HLL" - + mmdvtregister and mmdvtablefind opcodes are deprecated - + removed getfd, getclass opcodes - + removed IMCC syntax that treated some methods as builtins - + removed numeric get_attr and set_attr vtable entries - -New in 0.6.4 -- Documentation - + removed a lot of old information from the FAQ - + improved function level documentation -- Configuration - + removed the configuration item 'has_gnu_m4' - + refactored ICU-detection -- Languages - + ChitChat - - improved the Smalltalk implementation - + Pipp - - renamed Plumhead to Pipp - - support for a lot of builtin functions. - - Pipp now uses PHP specific data types. - - converted from PCT with TGE to PCT with NQP actions - - improvements in the PCT variant by using optok parsing - - start of object support - + pir - - simple assignments work - + json - - added a PCT-based implementation of JSON parsing - + lolcode - - improved handling of symbols - - added support for block handling - - added support for globals - + Lua - - more tests - + Rakudo - - updated Range implementation - - added enums - - added generic type declarations (::T) - - added runtime mixing of roles with 'does' and 'but' - - fixed handling of implicit lexicals ($_, $!, and $/) - - fixed implicit method calls on $_ - - improved complex math builtins, added Complex - - moved many builtins to class Any - - declaration of lists of variables now work - - improved test infrastructure - - 910 additional passing spec tests since last release - - more convergence with STD.pm grammar - - added named 0-ary parsing and ops -- Compilers - + PCT: - - allowed subroutine and method names to be a PAST tree that produces the name - - Improved lexical handling -- Tools - + pbc_disassemble renamed from disassemble -- Implementation - + allowed .macro_const in PIR - + added the flag :lexid(...) for subroutines - + made multiple dispatch work for sub types - + fixed garbage collection bug related to the metadata attached to a PMC_EXT structure - + added a warning when using deprecated opcodes - + simplified the stacks implementation - + fixed C++ build - + improved closure and lexical support - + improved IMCC register allocator - + added cache for all runtime-constant strings, reducing memory usage -- Miscellaneous - + improved OpenGL/GLU/GLUT bindings - + added a standard profile for Perl::Critic coding standard testing - + added support for smoke testing with Smolder - + enabled use of Test::Harness 3.0 if available, but don't require it for 'make test' - + added the executable 'parrot_config' to query Parrot configuration - -New in 0.6.3 -- Specification - + updated pdd09_gc.pod -- Languages - + Cardinal: - - dramatically improved parsing speed - - added support for defining and instantiating classes - - started fleshing out the builtin class hierarchy - - added support for hashes and arrays - + Chitchat: added the start of a smalltalk compiler - + Pheme: updated to match PGE changes - + Pynie: return statement, other minor updates - + Rakudo: - - added working list and hash contexts - - added 'return' statements - - added => pair constructor - - added ?? !! ternary - - added Range, range operators, Complex - - added common List, Hash methods - - refactored base classes - - added Mutable, Perl6Scalar classes - - added type-checking, is readonly/rw/copy for parameters - - added make localtest, docs/spectest-progress.csv - - fix named unaries - + Squaak: implement return statement - + Tcl: updated control flow exceptions to use new builtin types -- Compilers - + All tools converted to P6object metamodel - + PGE: - - is now a zero-width match - - reduced backtracking to improve parsing speed - + PCT: - - added "return" PAST.op node type for subroutine returns - - added "keyed_int" scoping to PAST::Var - - fixed calls to closures - - automatically transcode 7-bit unicode to ascii for faster processing - + NQP: added "return" statement, ?? !! ternary operator -- Configuration - + expanded step gen::opengl -- Implementation - + updated function and macro names to match pdd09_gc.pod - + removed Super PMC - + add ".namespace []" as alternative to ".namespace" - + "make codetest" target runs standard coding tests -- Miscellaneous - + added P6object class for Perl 6 interfaces to objects in Parrot - + ported OpenGL/GLU/GLUT bindings to Win32, BSD, and more Mac OS X variants - + generate OpenGL/GLU/GLUT bindings by parsing system headers - + new OpenGL example shapes.pir, covering basic OpenGL 1.1 / GLUT 3 APIs - + new float4.pir structure-packing benchmark - + reduced memory use for variables - + improved constant string caching - + made code g++ and gcc (with optimizations) safe - + the usual collection of bugfixes and optimizations - -New in 0.6.2 -- Specification - + updated and launched pdd28_strings.pod - + updated pdd19_pir.pod -- Implementation - + added implementation of Rational PMC. - + simplified ops control flow syntax - + enabled backtrace on non-glibc platforms too - + improved some PIR error reporting - + removed user stack opcodes - (save, restore, lookback, entrytype, depth, rotate_up) - (NOTE: This was scheduled to occur after 0.7.0, moved up to this release) - + removed register stack, saveall, and restoreall opcodes - + removed various deprecated features and unused code -- Languages - + Amber: retired - + C99: grammar updated - + Cardinal: resurrected, method calls and do blocks work now - + Eclectus: use NQP as PAST generating code - + Lua: - - added big number library - - updated to match PGE changes - - added a bytecode disassembler & a Lua 5.1 VM bytecode translator - + Pheme: updated to match PGE/PCT changes - + Plumhead: - - use NQP as PAST generating code - - use riaxpander for macro expansion - + Rakudo: - - updated ROADMAP - - conditional and loop statement modifiers - - lots of class, object, role, and method improvements - - Str increment and decrement - - improved spectest reporting - - type checking on assignment - - regexes and grammars - - undef and self - - placeholder vars -roadmap updated - + Squaak: added to repository - + TAP: retired -- Compilers - + PGE: updated to match Synopsis 5, deprecated features removed - + PCT: - - improve handling of register types, conversion between registers - - improved error diagnostics - - add 'arity' to for loops -- Configuration - + added step auto::opengl - + added step gen::opengl - + added step gen::call_list -- Miscellaneous - + still more optimizations and performance improvements, especially in GC - + new libraries: OpenGL/GLU/GLUT bindings (small subset working) - + new dump_pbc.pl utility: PBC disassembly/source code weaver - + improved C++ compiler support - + optimized builds work again - - -New in 0.6.1 -- Specification - + drafted pdd29_compiler_tools.pod - + updated pdd28_character_sets.pod draft - + updated pdd19_pir.pod draft -- Languages - + c99: added independent C pre-processor - + HQ9+: reimplemented with PCT - + Lua: - . reimplementation with PCT, using PAST and POST - . behavior aligned wih 5.1.3 - + Rakudo: - . implemented basic I/O, including '$*IN', '$*OUT', '$*ERR', 'prefix:=' - . implemented simple typing and runtime type checking - . added basic multi-method dispatch - . expanded named argument handling, including Pair and colonpairs - . added 'Whatever' and 'Capture' classes - . implemented 'handles' trait verb - . added 'loop' statement - . implemented 'given', 'when', 'for', 'while', 'until' statement modifiers - . implemented Hash methods '.keys' and '.values' - . fixed bug to get '.WHAT' working correctly - . initial implementation of 'eval' -- Compilers - + NQP: - . created a bootstrapped build, see 'make boot' - . added 'infix:<', 'infix:<=', 'infix:>', 'infix:>=' relational operators - . added 'postfix:++', 'postfix:--' operators - + PCT: - . added methods specifying default behaviors in PAST, reducing repeated code - . improved symbol table lookup - + PGE: - . removed deprecated code including: P6Regex, P6Grammar, PAST-pm -- Miscellaneous - + notable speedups during compilation and execution of parrot and HLLs - + pdb (the parrot debugger) can now catch parrot exceptions - + better detection of glibc and gettext during configuration - + various bugfixes, code cleanups, deprecations, and coding standard fixes - - -New in 0.6.0 -- Specification - + launched pdd18_security.pod - + updated pdd17_pmc.pod - + launching draft of pdd28_character_sets.pod -- Documentation - + cleanup of IMCC documentation -- Configuration - + add step auto::gettext - + add step auto::crypto -- Compilers - + PCT: - . Fix '-e' option - . Phase out P6Regex in favor of Perl6Regex - + IMCC: - '.local Array my_arr' is illegal now -- Languages - + C99: reimplementation with PCT - + lolcode: - . various updates - . add support for functions with params - . add math functions - + Rakudo: - . support for 'say' - . first cut at smart matching - . indirect method calls - . support for Pairs - . added methods 'grep' and 'first' - . implement auto{increment,decrement} - . initial implementation of 'perl6doc' - + Lua: - . various updates - . add base64 library - + Cardinal: basic support for functions with parameters - + Pheme: various updates - + Ecmascript: various updates - + Tcl: now targeting tcl 8.5.1, no more expected failures in test suite. - (No, this doesn't mean everything's implemented. =-) - + Eclectus: various updates - + WMLScript: various updates -- Implementation - + PDD17 (PMCs) - + Add library YAML::Dumper - + Add the MD2, MD4, MD5, RIPEMD160, SHA & SHA1 PMC, as a wrapper - around libcrypto -- Miscellaneous - + various bugfixes, code cleanups and coding standard fixes - + consting - + remove external Perl 5 modules from the Parrot distribution - -New in 0.5.3 -- Documentation - + PDD09 (garbage collection) - approved - + PDD28 (character sets) - draft started - + added function documentation to some core functions - + PCT beginners guide, optable guide and PAST nodes guide, bug fixes -- Compilers - + IMCC: plugged various memory leaks and other cleanups - + PCT: - . add "attribute" as a scope variant to PAST::Var nodes - . add 'shift' and 'pop' methods to PAST:: nodes - + NQP: add '=:=' op, tests for scalar and list contextualizers, \x escapes -- Languages - + APL: reimplementation with PCT - + Cardinal (Ruby): re-implementation with PCT - + Ecmascript: reimplementation with PCT - + lolcode: improved expression parsing, ifthen, IT, YARN - + lua: - . aligned with Lua official release 5.1.3. - . added initial PCT-based implementation. - + Punie (Perl 1): refactor to use standard PCT-based filenames - + Pynie (Python): add functions - + Rakudo (Perl 6): - . rebranded, formerly known as 'perl6' - . passes many more official Perl 6 Specification tests - . added 'perl6doc' utility - . oo including meta?classes, objects, methods, attributes, role composition - . match variables, while/until statements, traits - . many new methods for Str, List, Hash, Junction -- Implementation -- Deprecations - + PCCINVOKE syntax for named arguments using []; use () instead. - + see DEPRECATED.pod for details -- Miscellaneous - + pbc_to_exe refactored for code reduction, portability, and maintainability - + various bug fixes - + #line directives added to generated JIT files, improving debugging - + consting, attribute marking, refactoring, warnings cleanup - -New in 0.5.2 -- Documentation - + PDD27 (multiple dispatch) - debut of new design - + Numerous small updates to glossary.pod, etc -- Compiler Toolkit - + NQP: optional, named, and named/required parameters - + PIRC: cleanups - + PAST: "defined-or" -- Languages - + New mk_language_shell.pl script creates language stubs - + LOLCODE: new - + Lua: various - + Eclectus: start with support for local variables and procedures, - use SXML as intermediate representation - + Perl 6: list builtins, compiler directives, command-line options, etc. - + "make perl6" now builds a Perl 6 executable - + punie: more builtins, control structures, code refactoring - + pynie: builtin stubs, more tests -- Implementation - + New "pbc_to_exe" utility turns bytecode to executables - + New set_outer method for subs - + Further configuration refactoring for testability - + All functions now completely headerized - + Concurrency: interpreter schedulers -- Deprecations - + DYNSELF (changes to SELF; SELF to STATICSELF) - + METHOD (replaced by renaming PCCMETHOD) - + pmcinfo op (superseded by 'inspect') - + get_attr, set_attr, and 8 other vtable methods - + See DEPRECATED.pod for details -- Miscellaneous - + Many bug fixes - + Minor speed enhancements with UTF-8 string handling - + Debian packaging - + consting, attribute marking, warnings cleanup, memory leaks plugged ... - -New in 0.5.1 -- Documentation - + PDD19 (PIR) - reflect state on the ground; incorporate old IMCC docs - + PDD25 (Concurrency) - launch out of draft - + Improve documentation of deprecated parrot features. -- Compilers - + PCT: Parrot Compiler Toolkit redesigned and updated - + NQP: major updates, including support for namespaces, - module/class declarations, methods - + IMCC: remove .sym as alias for .local. Remove .pcc_ - prefix for calling directives (.pcc_begin became .begin_call). - + PIRC: creates an AST during the parse. - + PGE: more updates to match S05 syntax. -- Languages - + perl6: re-implemented using PCT and NQP, new object subsystem - + abc: re-implemented using PCT and NQP - + eclectus: initial implementation - + plumhead: add PCT variant - + punie: re-implemented using PCT and NQP, extended to handle subroutines - Happy 20th Birthday, Perl! - + pynie: re-implemented using PCT and NQP - + PIR: start conversion to NQP (under construction) -- Implementation - + new opcodes: 'die', 'addhandler', 'copy' - + Initial implementation of Concurrency PDD - + Add 'arity' method to Sub and NCI PMCs -- Miscellaneous - + Bug cleanup - + consting, attribute marking, warnings cleanup, memory leaks, GC... - + dead code removal (includes some defunct languages) - -New in 0.5.0 -- Implementation - + PDD15 (OO) branch merged with trunk; this release contains a working, - tested implementation of the latest OO model - + Added pop_eh/push_eh_p/count_eh opcodes - + Add --runcore command line option - + Add gcdebug runcore to help track down GC bugs - + minor improvements to IA-32 JIT -- Documentation - + PDD19 (PIR): updates to macros, .pcc* directives - + PDD25 (Concurrency): updated - + PDD26 (AST): draft approved - + PDD23 (Exceptions): draft approved - + Copyright cleanups -- Languages/Compilers - + languages/APL: minor updates, PDD15 conformance - + languages/dotnet: minor updates - + languages/lua: minor updates, PDD15 conformance - + languages/lisp: minor updates - + languages/perl6: minor updates, PDD15 conformance - + languages/plumhead: minor updates - + languages/punie: minor updates, PDD15 conformance - + languages/nqp: minor updates - + languages/scheme: many updates, PDD15 conformance, improved tests, use - PMCs instead of primitive registers to represent values - + languages/tcl: bugfixes, PDD15 conformance - + languages/WMLScript: minor updates - + compilers/pirc: updates from PDD19, PDD06 - + compilers/pct: minor updates, PDD15 conformance - + compilers/pge: PDD15 conformance - + compilers/tge: PDD15 conformance -- Configuration - + Improve test coverage - + Improve reporting when a step fails; allow abort on failure -- Miscellaneous - + More coding standard conformance, tests, cleanup, speedups, - warnings cleanup - + Bug cleanup, esp. GC bugs - + Eliminate .imc extension (use .pir) - + Simplify some core config steps to not allow interactive prompting -- Removed - + clear_eh opcode - -New in 0.4.17 -- Implementation - + Bug fixes (including Coverity IDs 20, 22, 30, 119-122, 124-126, 129-131) - Also various GC, memory, and segfault issues - + Fix & reenable CGP core - + Parrot's -r flag now works again (compile to and execute bytecode) - + Updates to pmc2c & PIR syntaxes - + Fix Complex PMC - + Minor performance improvements, especially in PGE -- Documentation - + PDD02 "Vtables" - superceded by PDD17 - + PDD06 "PASM" - minor updates - + PDD17 "PMC" - add VTABLE syntax, update core PMC struct, restore UnionVal - + PDD19 "PIR" - early review started - + PDD21 "Namespaces" - cleanup - + PDD24 "Events" - draft approved - + PDD25 "Concurrency" - minor updates - + PDD26 "AST" - draft version begun - + PIR tutorials updated -- Languages/Compilers - + Make scheme work with the current calling conventions, other major work. - + Updates to m4, lua, compilers/pirc, languages/PIR, dotnet, tcl -- Miscellaneous: - + make -j functional again - + Code cleanup (refactoring, optimizations) - -New in 0.4.16 -- Implementation: - + Performed code review on every PMC - + Modified PMC code generation to use Storable, reducing compile times - + Added a makefile target to generate test coverage data of C sources -- Languages: - + NQP: added lists, for loops, operators, comparison and multiplicative operators - + Announced Kea-CL, Kea Common Lisp, an ANSI Common Lisp implementation - The repository is available at https://rgrjr.dyndns.org/svn/kea-cl/trunk/ -- Documentation - + PDD17 "PMCs" - draft approved, the design is complete - + Added more PIR tutorials, see examples/tutorial/00_README.pod -- Miscellaneous: - + Many bugfixes, enhancements, documentation, and coding standard updates - + Deprecated PMC constants and other crufty syntax, see DEPRECATED.pod - + Improved icc compiler compatibility for error line reporting - -New in 0.4.15 -- Implementation: - + Lots of code review, many bugs fixed - + Many more code cleanups and compiler warning levels - + Started a new jit engine for 64-bit processors - + Refactored configure process, with tests and new diagnostic options - + Added new CodeString PMC for dynamic generation of PIR code - + More pdd15 support for object metamodel. -- Languages: - + Added NQP ("Not Quite Perl"), a very lightweight Perl 6-like language - + Significant improvements and refactors to PCT (Parrot Compiler Toolkit) - + perl6 passes more spec tests - + Lua works now with a PGE/TGE/PAST-pm based compiler, lives in one pbc, - and the interpreter has same behavior as original. -- Documentation - + Added a committers' HOWTO - + More PIR tutorial examples - + Added PAUSE guide - -New in 0.4.14 -- Now, with Seat Belts! - + added makefile targets for Sun lint, BSD lint, and splint - + corrected many errors picked up by these tools - + decorated source code with compiler hints, assertions, and attribute macros - + automated creation of function declarations to prevent common errors - + increased compiler warnings levels - + converted more exceptions to a recoverable form -- Languages: - + updated Lisp, Lua, Perl 6, tcl, regex, Scheme ("Pheme") - + Perl 6 now fetches selected tests from pugs, and even passes some - + PGE modified to handle {*} action subs for top-down and bottom-up parsers, - and to allow grammar subclassing - + HLLCompiler now has better exception, eval, and exit support - + Introduced PCT, a refactor of HLLCompiler and PAST-pm -- Design: - + PDD15 "Objects" - details added to 'new' and 'getattribute' opcodes - + PDD17 "PMCs" - notes added on instantiation and dynamic extention in PIR -- Documentation: - + added Parrot-related text from "Perl 6 and Parrot Essentials" book, - tutorial examples from "Learning PIR" talk, and PDD15 metamodel diagrams -- Implementation: - + reduced memory footprint when using named registers - + implemented overridding of vtable methods by PDD15 classes - + improved PDD15 support for 'new', 'instantiate', and others - + added makefile targets to ease core and HLL makefile regeneration - + updated parrot dubugger, "pdb", to allow loading of commands from file -- Misc: - + many bugfixes, enhancements, documentation, and coding standard updates - -New in 0.4.13 -- Languages: - + Updated Lisp, Lua, PHP ("Plumhead"), Python ("Pynie"), ABC, - WMLScript, and Tcl ("ParTcl"). - + Perl 6 passes all of the sanity tests. - + PGE supports latest Perl 6 grammar syntax. Perl 6, Python - ("Pynie"), and ABC parsers updated to match. - + Updated PHP ("Plumhead") to Antlr 3.0. - + Lua added the beginnings of a PGE/TGE based compiler (not yet - replacing the Perl/Yapp compiler). - + Lisp updated for current features, added a test suite. -- Core Implementation: - + Filled in features and backward compatibility for PDD 15 objects. - New object metamodel passes 85% of old test suite. - + GCC API symbols are visible externally only when explicitly exported. - + Added generated GCC compiler attributes to increase warnings, and - cleaned up resulting warnings. - + Code cleanup efforts and fixed memory leaks by the cage cleaners, - resulting in notable speed increases. -- Misc: - + Updated Parrot distribution to Artistic License 2.0, from dual - Artistic 1/GPL license. - + SDL examples brought up-to-date with current features. - -New in 0.4.12 -- Build: - + even more refactorings and improvements in configuration system - + improved tests and documentation for configuration system -- Languages: - + Updated abc, PHP ("Plumhead"), Lua, Tcl - + Reclaimed Lisp -- Design: - + new PMC PDD draft partially completed -- Implementation: - + continued implementation of PDD 15 (Objects) - + minor garbage collector and memory management improvements - + several memory leaks resolved - + extended support for compilers other than GCC - + improved C++ compiler compatibility - + enhanced support for Solaris, non-MSVC Win32, and other platforms - -New in 0.4.11 - -- Compilers: - + IMCC: added documentation for C-based Parrot Calling Conventions, - refactorings and bug fixes - + PGE: new perl6regex front end reflecting recent S05 syntax changes - + PIRC: new prototype PIR parser -- Languages: - + Updated Lua, PHP ("Plumhead"), BASIC, pynie - + Lua implements environment -- Design: - + PDD15 "Objects" - details added, and draft approved -- Documentation: - + Added guidelines for PMC documentation -- Implementation: - + PDD15 implementation is largely complete, including role-based composition, - introspection, and C3 method resolution order - + new Exporter PMC for importing globals between namespaces - + new string utilities for radix conversion - + PCCINVOKE and Parrot_PCCINVOKE allow calling using the full Parrot Calling - Conventions from PMCs and C code respectively -- Build: - + Refactorings and improvements in test coverage for 'Configure.pl' -- Misc: - + many bugfixes, enhancements, and code cleanup - + added example subversion config file - + extended support for gcc, icc, and other compilers - + extended support for Solaris and other platforms - - -New in 0.4.10 - -- Compilers: - + IMCC: Parrot calling conventions now available between two C PMCs (PMINVOKE) - + PGE: Match object improvements - + smop: added Attribute and Class PMCs - + HLLCompiler: improvements for interactive mode -- PAST: - + extended binding to a list of variables -- Languages: - + Updated Lua, PHP ("Plumhead"), Tcl ("ParTcl"), Ruby ("Cardinal") - + Update PIR, regex, Zcode - + New language: Pynie - a Python compiler for Parrot - + Lua implements require and many other ops, improved regex support - + Remove parakeet -- Design: - + PDD01 "Overview" - updated architecture and platform information - + PDD15 "Objects" - details on roles, objects, and classes added - + PDD22 "I/O" - added async ops and Status PMC details -- Documentation: - + Added guides for Metacommitter, Relase Manager, and Cage Cleaner roles -- Implementation: - + Object, Class, Role, and Attribute PMC implementation has begun - + Perl 5 module "Parrot::Embed" now compiles and links on all platforms -- Build: - + Major improvements in test coverage for 'ops2c.pl' -- Misc: - + New utility: Crow, a template processor - + New library module: Config/JSON for reading/writing JSON files - + many bugfixes, enhancements, and coding standard updates, code cleanup - -New in 0.4.9 - -- Compilers: - + IMCC: Parrot calling conventions now available in C PMCs, allowing - named, optional, slurpy, and flat parameter passing - + PGE: extended support for Perl 5 Regexes - + smop: prototype object model implementation - + hllcompiler: refactored to run a configurable set of compilation stages -- PAST: - + redesigned assign/binding to support Perl 6 binding semantics -- Languages: - + Updated Lua, PHP ("Plumhead"), Tcl ("ParTcl"), perl6, perl5 - + New language: PIR - a PGE-based implementation of Parrot PIR - + perl6 now supports binding (':=') and 'join' - + lua generates tail calls, and supports its own regex flavor (PGE-based) - + Pheme still works, huzzah! -- Design: - + PDD21 "Objects" - rewritten - + PDD22 "I/O" - updated and 'TODO' tests added -- Documentation: - + Interface stability classification standards approved - + Roles and Responsibilities documented approved - + Official 'drafts' directory created (was 'clip') -- Implementation: - + More NameSpace and OS PMC methods implemented - + Parrot executable fullname and basename now available in PIR/PASM code - + new 'chomp' library function -- Build: - + Major improvements in test coverage for 'ops2pm.pl' -- Misc: - + many bugfixes, enhancements, and coding standard updates - + extended support for Sun Workshop Compilers - + Parrot now builds on PocketPC platform - -New in 0.4.8 - -- Compilers: - + HLLCompiler: added tracing options, modified api - + PGE & TGE bugfixes and updates -- PAST: - + added global and lexical variable support - + added looping constructs, arrays, hashes -- Languages: - + Updated PHP ("Plumhead"), Tcl ("ParTcl"), - forth, perl6, lua, abc, APL, WMLScript, punie - + ParTcl is passing > 24.9% of Tcl cvs-latest test suite - + perl6 now supports hashes, arrays, method calls, arity-based - multisubs, quoted terms, ranges (non-lazy), try blocks, $! -- Design: - + PDD01 "Overview" - updated - + PDD22 "I/O" - rewritten and approved -- Test Suite: - + Converted Perl 5 Regex tests to PIR, with notable speedup - + Added tests for opcodes, compilers, languages, and coding standards -- Build: - + Major improvements in test coverage for 'pmc2c.pl' -- Misc: - + many bugfixes, enhancements, and coding standard updates - + extended support for non-core platforms including Cygwin, Tru64 - -New in 0.4.7 - -- New languages: PHP ("Plumhead"), Forth -- Updated languages: Ruby ("Cardinal"), Tcl, Lua -- Remove old Python implementation from Parrot repository; the new Python - language code is hosted at http://pirate.tangentcode.com -- Compilers: - + PGE updated with more expressions, latest changes to S05 - + new Perl 6 grammar compiler -- Integration: - + Perl 5 module "Parrot::Embed" allows easy embedding of a Parrot - runtime into a Perl 5 program -- PIR: - + new :init pragma for subs that must run before the main function - + new :vtable pragma to identify subs that override PMC vtable methods, - eliminating the need for special subroutine names - + PIR parser/compiler does not stop on first syntax error - + Vanilla register allocator ("register alligator") greatly improves - performance compiling large functions - + Eliminated limit on number of PIR macros -- PMCs: - + hash lookups return null instead of None for missing keys -- Design: - + PDD13 "Bytecode files: format and manipulation" - new - + PDD10 "Embedding" - new - + PDD25 "Concurrency" - rewritten - + PDD15 "Objects" - new section on redesign requirements - + PDD07 "Coding standards" - significant updates and automated tests -- Test Suite: - + Many many more new tests -- Build Process: - + autoconf compatible install options -- Misc: - + Namespace refinements - + Coroutine improvements - + An impressive swarm of other bugfixes and enhancements - -New in 0.4.6 - -- New languages: Ruby ("Cardinal"), Javascript ("ecmascript") -- Updated languages: Tcl, dotnet, bc, Pheme, Punie, WMLScript -- Updated compilers: PGE, TGE -- IMCC updates: - + ".loadlib" directive expresses dependencies - + ".namespace" with no parameter goes to HLL root - + lexer is reentrant (reentrant grammar in progress) -- Namespace improvements: - + new suite of opcodes to access namespaces and globals - ("find_global" and "store_global" will be phased out) - + namespace '' no longer means HLL root -- Design document updates: - namespaces (pdd23), basic types (pdd17), embedding -- Updated tool requirements for developers: - flex 2.5.33, bison 2.1, perl 5.6.1 -- New to-do list for people new to Parrot: - cage/todo.pod -- The usual plethora of bugfixes and enhancements - -New in 0.4.5 - -- unicode subroutine names -- hierarchical class names finished including MMD support -- new dotnet CLI to PIR translator -- improved TGE code and compiler -- APL: vector handling -- new STM branch in the svn repository -- the usual bugfixes and enhancements - -New in 0.4.4 - -- hierarchical class names -- APL compiler - - under development - - understands simple vector ops, strings - - demonstrates use of Unicode in Parrot -- pgc, a compiler for rules and operator precedence parsers -- Major redesign and improvements for PGE - - compilers understand named parameter options - - :ratchet option implemented to support non-backtracking quantifiers -- TGE (tree grammar engine) for tree transformations - - tgc, tree grammar compiler -- perl6 compiler - - support for many operators, lexical scalars, regex matches -- new pheme (Parrot scheme) compiler - -New in 0.4.3 - -- namespaces partially implemented -- rulec, Perl 6 rule compiler -- PGE improvements including return values for closure -- parts of a Perl 6 parser based on PGE -- complex trigonometric methods -- type of Sub PMC is now overridable by HLL -- NetBSD support -- many bug fixes and improvements - -New in 0.4.2 - -- improved PPC and x86 JIT support including JIT compilation - of very simple PASM/PIR subroutines -- preliminary libreadline support -- better trace and debug features -- pkgconfig support -- META.yml to support proper indexing on CPAN -- new opcode: hcf (in "my_ops" in dynamic op library) -- new File pmc for file specific ops (is_dir, is_file, copy, rename...) -- named arguments and parameters (both :named("") and => syntaxes) -- ongoing config improvements -- tons of bug fixes and other small improvements - too much to list all - -New in 0.4.1 - -- Installation: 'make install' is using standard locations now - (/usr/local is the default --prefix) -- Produce static and shared libraries on some systems -- Configure system rearragement -- OS pmc started (mkdir,cd,cwd,rm,umask,stat) -- Shootout examples -- Test files are now testable with 'prove' -- Smoke (and smokej) outputs progress -- PIR supports: I = A < B (>,<=,>=,==,!=) -- Add support for octal number constants -- partcl updates: - - almost finish [string]; start [file] - - add build tool for generating inline'd tcl builtins from templates. -- Jako updates: NCI, subroutines, global variables and constants all work. - (Gregor) - -New in 0.4.0 - -- New lexical handling and closure support including better - introspection for caller and outer -- PGE (Parrot Grammar Engine) provides now compilers for P6Rule, - P6Grammar, P5Regexp, and Glob -- ca. 1000 new tests including 800 for Perl5 regexp -- Improved unicode charset and encoding support -- Calling conventions for exception handlers -- Punie (Perl 1) uses TGE (Tree Grammar Engine) to convert from - PGE match objects to AST via two steps of tree transformation grammars -- New languages: amber and lua -- The usual code fixes, cleanup, and improvements, including an overhaul - of the config and test framework - -New in 0.3.1 - -- Variable sized register frames are finished. Each subroutine gets - the amount of registers that it actually needs. No more spilling. -- Vastly improved PGE (Parrot Grammar Engine) including shift-reduce, - precedence-based expression parser and support for matching of - bracketed text delimited by e.g. ()[]{}'" -- uniccode character classification (is_upper ...) -- support for heredoc syntax in assembler -- improved examples, basic JSON support -- debian packaging support -- the usual improvements, bug fixes, and cleanup -- test count exceeds 3000 - -New in 0.3.0 - -- New calling conventions implemented: see PDD03 for details -- Merge multiple Parrot bytecode (PBC) files into a singe PBC file -- 'make smoke' target going beta -- bc now supports if statements, comparison ops, prefix inc/dec -- ParTcl adds [lassign], [switch] (partially); [expr] converted to a compiler -- Many exciting doc updates, tests, and bugfixes, too numerous to mention - -New in 0.2.3 - -- Dynamic classes now compile on Windows (including ParTcl) -- New Super PMC allows easy access to superclass methods -- Implement C3 method resolution order (just like Perl 6 & Python) -- ParTcl has new PIR-based parser and passes more Tcl tests -- added character class support in Globs to PGE -- added language implementations of unlambda, Lazy-k -- many bugfixes, including GC and memory leaks -- the new calling scheme continued to evolve in branches/leo-ctx5 - -New in 0.2.2 - -- new call scheme: docs/pdds/pdd03_calling_conventions.pod -- partial implementation of the new calling conventions - PASM only, don't mix PIR foo() call syntax with the new scheme -- grammar and rule support in PGE - the Parrot Grammar Engine -- TCL passes >10% of the tcl test suite -- the usual bugfixes and improvements - -New in 0.2.1 - -- better HLL support (short names for object attributes, and - .HLL and n_operators pragmas) -- string encoding and charset can now be set independently -- experimental mmap IO layer for slurping files -- distinct debug and trace flag settings -- glob support in PGE -- new character classification opcodes and interfaces - -New in 0.2.0 - -- parrot repository is now under subversion -- MMD (Multi Method Dispatch) enhanced -- new unary and infix opcodes that return new result PMCs -- dynamic scalar PMCs inherit now almost all from Parrot core PMCs -- more unification of PMCs and ParrotObjects -- tailcalls for functions and methods -- PGE (Parrot Grammar Engine) reworked -- Pugs creates Parrot code and Pugs is a registered compiler now -- new languages/lisp -- the usual bug fixes and improvements - -New in 0.1.2 - -- New string handling code. Strings now have charset and encoding -- Parts of a generation garbage collector -- Better Python code, separated in dynclasses -- Parrot Grammar Engine -- Improved test coverage and documentation - -New in 0.1.1 - -Parrot 0.1.1 is an intermediate release with tons of updates and fixes. - - Python support: Parrot runs 4/7 of the pie-thon test suite - - Better OS support: more platforms, compiler, OS functions - - Improved PIR syntax for method calls and = assignment - - Dynamic loading reworked including a "make install" target - - MMD - multi method dispatch for binary vtable methods - - Library improvement and cleanup - - BigInt, Complex, *Array, Slice, Enumerate, None PMC classes - - IA64 and hppa JIT support - - Tons of fixes, improvements, new tests, and documentation updates. -A lot is unfinished and keeps changing. Nethertheless Parrot is stable -and usable at the surface, while internals are moving. - -New in 0.1.0 - - "Ladies and gentlemen, I give you... objects!" - - Huge documentation overhaul - - More supported platforms, s. PLATFORMS - - Basic thread support for pthread based architectures - - Basic event handling for timers and signals including: - - PASM callbacks for NCI (native C) functions. - - Improved platform configuration - - COW stacks now working, stacks code redone - - Structure handling vastly improved - - Random PMC and rand primitives - - Better subroutine call syntax in PIR - - Make PIR subroutines compliant with pdd03 - - Improved profiling (DOD, GC timings) - - Hash code improvements, incl. random key order support - - Experimental freeze/thaw code for some PMC types - - IO improvements for buffered layer and Win32 - - String iterators - - String bitwise vtables - - Many new opcodes - - Support for JIT, where malloced memory isn't executable - - Priority DOD scheme for objects that need timely destruction - - Improved byte code loading (e.g. onLoad functions) - - Language updates: forth, Perl 6/P6C, m4 - - Libraries: Getopt_Long, SDL, Dumper, Sort - - new JAPH examples - - Unified imcc and parrot test handling - - Many new tests (make test reports 1386 tests) - - Numerous bug fixes - -New in 0.0.13 - - The Big Move: Parrot source and build files rearranged into sub dirs - - Build imcc as parrot - - Objects more finished - - Delegate vtable methods to byte code - - Binary multi-method dispatching - - Isa and does methods for PMCs - - Call byte code from C - - Start of extension interface - - Experimental struct handling - - Catch access to NULL PMCs - - Experimental network socket interface code and opcodes - - IO fixes and improvements - - Dynamic opcode libraries - - Fix-assigned opcode numbers - - Argument flattening for function calls - - More native call interface (NCI) signatures - - Ncurses, postgres, and pcre interface libraries - - Forth language is vastly improved - - BSD and Win32 build improvements - - Many new tests and fixes - -New in 0.0.12 - - This number intentionally left blank - -New in 0.0.11 - - Executable output - - Dynamic PMC registration - - Trial exception system - - Beginnings of object system - - Iterators - - Ordered hashes - - I/O system improvements - - References - - Documentation for basic PMC types - - IMCC support of Parrot Calling Conventions - - Runtime loading of chartypes (and other string improvements) - - Conditional breakpoints - - Dramatically accelerated sweeps for finalizable objects - - Small PMCs (PMCs split into core and extensions) - - Loadable bytecode packfiles - - Constant PMCs - - Sub variants that deal with the stack correctly - - Switched runops core - - Line numbers in warnings - - Environment access - - Many documentation cleanups - - Conversion to CPS style! - - BASIC debugger and many other wacky features - - Filename, line number parsing support in IMCC - -New in 0.0.10 - - IMCC integration - - eval - - some more benchmarking - - cgp core - - optimized math ops - - intersegment branches - - more complete use of PObjs - - beefed up packfiles - - sub/continuation/coroutine fixes - - better NCI (native calling interface) - - many imcc improvements - - jako improvements - -New in 0.0.9 - -- Native function calling interface (Dan) -- Stack/list aggregate rewrite (Leo) -- Scratchpads (Jonathan Sillito) -- Preliminary DotGNU support -- type conversion ops (Gopal V + Leo) -- Buffer/PMC unification (Leo) -- stabs debugging support for JIT (Leo) -- Jako overhaul (Gregor) -- Optional Lea allocator (Leo) -- Parrot sprintf (Brent) -- Miniparrot (Josh) -- PMC Properties (Dan) -- Various JIT improvements (D. Grunblatt + Leo) -- Extensible packfiles (Juergen) -- Restructured PMC hierarchy (Leo) -- Real Scheme (Juergen) - -New in 0.0.8 - -- Several new grammars and a BNF -> perl5 and perl6 converter (Jeff) -- Working Perl 6 REs (Sean) -- Keyed Access (Tom Hughes et al) -- New PMCs (Alberto et al) -- Better Documentation -- New COW semantics -- GC acceleration (Mike Lambert) -- Lexical scope (Jonathan Sillito) -- IMCC patches -- JIT for the ARM - -New in 0.0.7 - -- Perl 6 Grammar and Compiler (Sean) -- Subroutines, coroutines, and continuations (Melvin) -- GC improvements (Peter Gibbs, Mike Lambert) -- Global variables (Melvin) -- Intermediate bytecode compiler (Melvin, Angel) -- And much, much more. - -New in 0.0.6 - -- New assembler that support keyed types (Jeff) -- New macro layer, allowing constants (Jeff) -- New Configure.pl (Brent) -- Changes to bytecode format, endian issues resolved (Melvin) -- GC improvements and bug fixes (Peter Gibbs, Mike Lambert) -- JIT compiler rewrite (Jason and Daniel) -- Parrot assembler in Parrot (Daniel) -- Parrot debugger (Daniel) -- BASIC polished, Eliza.bas is new (Clint) -- Cola compiler committed and working, with limited OOP (Melvin) -- Keyed aggregates (Steve Fink) -- Global ops (Melvin) -- Compile-time speedup (Melvin) -- Much documentation -- New PDDs (Dan) -- Contributed tetris and lzw files -- And many more, from the cast of thousands - -New in 0.0.5 - -- Full GC -- Perl Scalar support in PMCs -- Array and Hash types almost ready for prime-time -- Internal support for keyed types -- EMACS editing mode -- New PDDs -- New Language - BASIC -- Regular expression compiler -- More tests -- Many, many bug fixes, enhancements, and speedups - -New in 0.0.4 - -- Arena-based memory allocation system -- Copying GC -- New IO subsystem -- "Predereferencing" mode - ./parrot -P - 22% speedup -- JIT compiler - ./parrot -j -- Parrot now builds warnings-clean on many platforms -- Many more PMC methods implemented -- Regular expression operations -- Added a FAQ -- Basic support for embedding Parrot in other programs -- Warnings support -- Added PDDs to distribution -- Bignum library - -- PMC inheritance -- Added an assembly optimizer -- Improved string encoding/type support -- Many more tests -- Source reformatting -- Major refactoring in packfile library -- More Miniperl functionality -- New PMC "clone" operator -- Beginnings of key-based access to PMCs - arrays and hashes -- MOPS comparisons in examples/mops/ - -New in 0.0.3 - -- PMCs! -- Perl base scalar types implemented -- A new minilanguage, Scheme -- Much improved documentation -- Register stacks pushing and popping -- User stack pushing, popping and rotating -- Jako updates: subroutines, more example programs, optimizations -- test_prog renamed to 'parrot' - -- Added features to the assembler: @ for current location, and global - labels -- Build tweaks for VMS -- Bytecode typing clean-ups -- More platforms: OS X, HPUX, OS/2 -- The proliferation of runops cores reduced to one fast and one slow one -- Opcode tracing, bounds checking, profiling -- Vastly improved string support, with separation of encoding and - charset -- Lots more tests -- Multiple interpreter creation support - the beginnings of threading -- Much better resource handling - the beginnings of GC - -New in 0.0.2 - -- Parrot now works on all core platforms -- A large number of tests, in the standard Perl testing framework -- A new minilanguage (Jako) which compiles to Parrot assembly -- Documentation about the assembly language (docs/parrot_assembly.pod) - -- Separate modules for assembly (Parrot::Assemble) and bytecode - manipulation (Parrot::PackFile::*, packfile.c) -- Assembler completely rewritten -- Better operand-type guessing in the assembler -- Assembler support for '\n' etc. in string constants -- Code reformatted to match the coding standards -- New ops for register-constant INTEGER comparisons -- Macro expansion in the assembler -- IVs and NVs renamed to more friendly INTVAL and NUMVAL -- Hard-coded pack("") formats removed -- Better handling of floating-point numbers in assembler -- Moved floats to constant table (fixing many alignment issues) diff --git a/PBC_COMPAT b/PBC_COMPAT index a61d3303b5..c2beb91a0a 100644 --- a/PBC_COMPAT +++ b/PBC_COMPAT @@ -28,6 +28,7 @@ # please insert tab separated entries at the top of the list +12.0 2011.10.18 dukeleto released 3.9.0 11.0 2011.07.19 jkeenan released 3.6.0 10.0 2011.01.18 cotto released 3.0.0 9.0 2010.10.19 gerd released 2.9.0 diff --git a/README b/README index 9af227a758..b781c6062d 100644 --- a/README +++ b/README @@ -1,7 +1,7 @@ -This is Parrot, version 3.6.0 +This is Parrot, version 4.3.0 ------------------------------ -Parrot is Copyright (C) 2001-2011, Parrot Foundation. +Parrot is Copyright (C) 2001-2012, Parrot Foundation. LICENSE INFORMATION @@ -37,10 +37,14 @@ I. Install Git. Linux: The method depends on your distribution. To install you should execute (as root or sudo ): -On Ubuntu/Debian (apt-based): +On Ubuntu/Debian (old versions, apt-based): apt-get install git-core +On Ubuntu/Debian (new versions, apt-based): + + apt-get install git + On Red Hat, Fedora (rpm-based): yum install git @@ -148,7 +152,7 @@ CHANGES ------- For documentation on the user-visible changes between this version and -previous versions, please see NEWS. +previous versions, please see ChangeLog. MAILING LISTS ------------- @@ -170,8 +174,8 @@ WEB SITES The following web sites have all the information you need about Parrot: http://www.parrot.org/ - http://trac.parrot.org/ http://docs.parrot.org/ + https://github.com/parrot/parrot/ Have fun, The Parrot Team. diff --git a/RESPONSIBLE_PARTIES b/RESPONSIBLE_PARTIES index d50649ad7c..55ae192371 100644 --- a/RESPONSIBLE_PARTIES +++ b/RESPONSIBLE_PARTIES @@ -6,7 +6,7 @@ commit access, just those who have a role they've taken responsibility for. See docs/project/roles_responsibilities.pod for role definitions, and -https://trac.parrot.org/parrot/wiki/Languages for language authors/maintainers. +https://github.com/parrot/parrot/wiki/Languages for language authors/maintainers. Project Team @@ -16,9 +16,9 @@ Architect Christoph Otto Product Manager Andrew Whitworth -Project Manager James E Keenan +Project Manager ENOBODY -Community Manager Jonathan "Duke" Leto +Community Ambassador Jonathan "Duke" Leto Release Manager Bob Rogers Patrick Michaud @@ -36,6 +36,8 @@ Release Manager Bob Rogers Michael Hind Tyler Curtis James E Keenan + Kevin Polulak + Alvis Yardley Metacommitter Allison Randal Jerry Gay diff --git a/TODO b/TODO index 6fb2cf20c2..04cb65edaf 100644 --- a/TODO +++ b/TODO @@ -1,9 +1,9 @@ -All todo items should have a corresponding trac ticket. See the current list: +All todo items should have a corresponding github issue. See the current list: - https://trac.parrot.org/parrot/report/9 + https://github.com/parrot/parrot/issues?labels=todo To open a new todo ticket, use - https://trac.parrot.org/ + https://github.com/parrot/parrot/issues/new diff --git a/VERSION b/VERSION index 40c341bdcd..80895903a1 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -3.6.0 +4.3.0 diff --git a/api.yaml b/api.yaml index 2500d9e3ca..857033854a 100644 --- a/api.yaml +++ b/api.yaml @@ -1,4 +1,18 @@ --- +- + name: 'Op new_si is deprecated' + note: "new_si op used to create empty string with reserved capacity. In non-mutable strings world of modern parrot this doesn't make sense. new_s to create new empty string will remain" + tags: + - 'deprecated' + - 'Opcodes' + ticket: 'https://github.com/parrot/parrot/issues/203' +- + name: 'Experimental Select PMC' + note: 'The Select PMC is experimental until its interface gets some exercise. See ticket for more information.' + tags: + - 'PMC' + - 'experimental' + ticket: 'https://github.com/parrot/parrot/issues/651' - name: '"Advanced" NCI parameter types' eligible: '3.1' @@ -9,7 +23,7 @@ - name: 'Pointer, UnManagedStruct, and ManagedStruct' eligible: '3.4' - ticket: 'http://trac.parrot.org/parrot/ticket/2035' + ticket: 'https://github.com/parrot/parrot/issues/657' - name: 'add write barrier to all PMCs that write in unusual VTABLE functions' eligible: '3.4' @@ -17,6 +31,7 @@ tags: - 'C' - 'deprecated' + - 'completed' ticket: 'http://trac.parrot.org/parrot/ticket/2010' - name: '":init" Sub flag' @@ -29,7 +44,7 @@ detection: regex: pir: '^ ".sub" .+ ":init"' - ticket: 'https://trac.parrot.org/parrot/ticket/1896' + ticket: 'https://github.com/parrot/parrot/issues/469' - name: '":load" and ":init" Sub flags doing different things' eligible: '3.1' @@ -47,7 +62,10 @@ - 'deprecated' - 'PIR' - 'syntax' - ticket: 'https://trac.parrot.org/parrot/ticket/1705' + tickets: + - 'https://github.com/parrot/parrot/issues/600' + - 'https://github.com/parrot/parrot/issues/571' + - 'https://github.com/parrot/parrot/issues/578' - name: 'Action methods in rules' note: 'Per Synopsis 5, all regexes will have an implied {*} token at the end which cause invocation of an action method if a ":action" object is supplied.' @@ -61,7 +79,7 @@ tags: - 'library' - 'experimental' - ticket: 'https://trac.parrot.org/parrot/ticket/1598' + ticket: 'https://github.com/parrot/parrot/issues/375' - name: 'Assigning to registers in parrot_debugger' tags: @@ -94,13 +112,13 @@ detection: regex: pir: 'new\s\[?\''Complex\''\]?' - ticket: 'https://trac.parrot.org/parrot/ticket/1892' + ticket: 'https://github.com/parrot/parrot/issues/462' - name: 'Cross-HLL library loading' tags: - 'library' - 'experimental' - ticket: 'https://trac.parrot.org/parrot/ticket/754' + ticket: 'https://github.com/parrot/parrot/issues/266' - name: 'GC timely destruction' eligible: '3.1' @@ -108,14 +126,14 @@ tags: - 'deprecated' - 'functions' - ticket: 'https://trac.parrot.org/parrot/ticket/1800' + ticket: 'https://github.com/parrot/parrot/issues/278' - name: 'GC_SYS_NAME option to interpinfo_s_i' note: 'Ability to get the string name of the current GC core from the interpinfo_s_i. See r43900 and r43904 for details.' tags: - 'Opcodes' - 'experimental' - ticket: 'https://trac.parrot.org/parrot/ticket/1581' + ticket: 'https://github.com/parrot/parrot/issues/347' - name: 'IPv6 Support' tags: @@ -128,13 +146,13 @@ tags: - 'deprecated' - 'library' - ticket: 'https://trac.parrot.org/parrot/ticket/508' + ticket: 'https://github.com/parrot/parrot/issues/494' - name: 'LWP, https::Message, URI & URI::Escape' tags: - 'library' - 'experimental' - ticket: 'https://trac.parrot.org/parrot/ticket/1637' + ticket: 'https://github.com/parrot/parrot/issues/431' - name: 'ManagedStruct reallocations based on shape changes' eligible: '2.4' @@ -142,13 +160,13 @@ tags: - 'deprecated' - 'PMC' - ticket: 'https://trac.parrot.org/parrot/ticket/1554' + ticket: 'https://github.com/parrot/parrot/issues/319' - name: 'MappedByteArray PMC' tags: - 'PMC' - 'experimental' - ticket: 'https://trac.parrot.org/parrot/ticket/1877' + ticket: 'https://github.com/parrot/parrot/issues/420' - name: 'Meta-model implementation used by PCT' eligible: '2.7' @@ -171,7 +189,7 @@ tags: - 'opcodes' - 'experimental' - ticket: 'https://trac.parrot.org/parrot/ticket/1582' + ticket: 'https://github.com/parrot/parrot/issues/354' - name: 'OpenGL bindings and libraries' tags: @@ -209,7 +227,7 @@ tags: - 'deprecated' - 'compiler' - ticket: 'https://trac.parrot.org/parrot/ticket/463' + ticket: 'https://github.com/parrot/parrot/issues/464' - name: 'PCT::HLLCompiler stages' eligible: '1.1' @@ -238,7 +256,7 @@ tags: - 'PMC' - 'experimental' - ticket: 'https://trac.parrot.org/parrot/ticket/1599' + ticket: 'https://github.com/parrot/parrot/issues/382' - name: 'Parrot_load_bytecode_file' note: 'Load a .pbc file into the interpreter. Experimental.' @@ -292,7 +310,7 @@ tags: - 'deprecated' - 'PMC' - ticket: 'https://trac.parrot.org/parrot/ticket/1553' + ticket: 'https://github.com/parrot/parrot/issues/311' - name: 'UnManagedStruct handling nested structure' eligible: '2.4' @@ -300,7 +318,7 @@ tags: - 'PMC' - 'deprecated' - ticket: 'https://trac.parrot.org/parrot/ticket/1551' + ticket: 'https://github.com/parrot/parrot/issues/298' - name: 'UnManagedStruct initializer structure' eligible: '2.4' @@ -308,7 +326,7 @@ tags: - 'deprecated' - 'PMC' - ticket: 'https://trac.parrot.org/parrot/ticket/1552' + ticket: 'https://github.com/parrot/parrot/issues/305' - name: 'charset, charsetname, find_charset, trans_charset' eligible: '2.10' @@ -334,7 +352,7 @@ tags: - 'deprecated' - 'opcodes' - ticket: 'https://trac.parrot.org/parrot/ticket/1565' + ticket: 'https://github.com/parrot/parrot/issues/340' - name: 'finalize' note: 'Finalize exception handler, unrolling inner runloops if needed.' @@ -359,7 +377,7 @@ tags: - 'deprecated' - 'opcodes' - ticket: 'https://trac.parrot.org/parrot/ticket/218' + ticket: 'https://github.com/parrot/parrot/issues/303' - name: 'get_results opcode order and features' eligible: '2.1' @@ -393,7 +411,7 @@ tags: - 'opcodes' - 'experimental' - ticket: 'https://trac.parrot.org/parrot/ticket/1583' + ticket: 'https://github.com/parrot/parrot/issues/361' - name: 'logical PMC ops' eligible: '2.7' @@ -416,7 +434,7 @@ tags: - 'deprecated' - 'functions' - ticket: 'https://trac.parrot.org/parrot/ticket/907' + ticket: 'https://github.com/parrot/parrot/issues/460' - name: 'multiple dispatch within core PMC' eligible: '1.1' @@ -431,7 +449,7 @@ tags: - 'deprecated' - 'opcodes' - ticket: 'https://trac.parrot.org/parrot/ticket/1548' + ticket: 'https://github.com/parrot/parrot/issues/291' - name: 'opcode numbering' tags: @@ -446,7 +464,7 @@ tags: - 'deprecated' - 'opcodes' - ticket: 'https://trac.parrot.org/parrot/ticket/1697' + ticket: 'https://github.com/parrot/parrot/issues/550' - name: 'packfile structure' tags: @@ -468,7 +486,7 @@ tags: - 'experimental' - 'functions' - ticket: 'https://trac.parrot.org/parrot/ticket/1996' + ticket: 'https://github.com/parrot/parrot/issues/602' - name: 'LANG search path with -L' tags: @@ -490,7 +508,7 @@ name : 'Eval PMC' tags: - 'deprecated' - ticket: 'http://trac.parrot.org/parrot/ticket/1969' + ticket: 'https://github.com/parrot/parrot/issues/567' - name : 'PackFile_* API functions' tags : @@ -506,4 +524,97 @@ name : 'load_bytecode_p_s opcode' tags : - 'experimental' - ticket : 'http://trac.parrot.org/parrot/ticket/2146' + ticket : 'https://github.com/parrot/parrot/issues/435' +- + name : 'FixedPMCArray.set_pmc' + eligible : '3.1' + tags : + - 'deprecated' + - 'completed' + ticket : 'http://trac.parrot.org/parrot/ticket/1904' +- + name : 'Scalar PMC' + note : 'The Scalar PMC can be removed, so long as the behaviors of PMCs which inherit from it do not change.' + ticket : 'https://github.com/parrot/parrot/issues/672' + eligible : '3.1' +- + name : 'encoding:charset:"" string literals' + note : 'This form of string literals will be removed.' + ticket : 'https://trac.parrot.org/parrot/ticket/1808' + eligible : '3.1' +- + name : 'Old string_* functions' + eligible : '3.0' + note : 'The old string_* functions will be removed.' + ticket : 'http://trac.parrot.org/parrot/ticket/1809' +- + name : 'PIR compiler availability' + eligible : '3.1' + note : 'The PIR compiler (currently IMCC) will be extracted to a separately loadable component.' + ticket : 'https://github.com/parrot/parrot/issues/406' +- + name : '"constant" PObj' + eligible : '3.1' + note: + "constant" PObj (which is never collected) are deprecated. All PMCs and STRINGs + should be properly marked during GC. + + Functions C, C, + C and C + will be removed. + + PObj flag C and related macros will be removed. + ticket : 'https://trac.parrot.org/parrot/ticket/1875' + tags: + - 'deprecated' + - 'completed' +- + name : 'Non-const STRING* arguments' + eligible : '3.1' + note : + Due to the immutable nature of STRINGs we are changing the internal handling to use only + const STRING pointers. This will improve optimizations possibilities for compilers, + and make parrot const-correct. + + Passing of non-const STRING* arguments is deprecated and will be changed to + const STRING*. This includes (but is not limited to) all string API functions, + VTABLEs, PCC, etc + ticket : 'https://github.com/parrot/parrot/issues/483' +- + name : 'X-to-Y native PBC reading' + eligible : '3.1' + note : 'Support for PBC files optimized for alternate platforms will be dropped in favour of a universal network PBC format.' + ticket : 'https://github.com/parrot/parrot/issues/553' +- + name : 'The PIR and PASM compreg PMCs' + eligible : '3.1' + note : + The PMC returned by C is not going to be an NCI PMC any longer, + it will be a new type of PMC which conforms to PDD31 and will be similar to + HLLCompiler. + + There will not be a PASM compreg anymore. + ticket : 'http://trac.parrot.org/parrot/ticket/1967' +- + name : 'Interpreter API cleanup' + note : + All functions that were defined in parrot/interpreter.h have been renamed in order + to follow the project's coding standards. + + Functions that began with "Parrot_" now begin with "Parrot_interp_" + For example, function C has been renamed to C. + + Also, "Parrot_interp_" has been prepended to all functions that didn't begin with + "Parrot_" for consistency. For example, function C has been + renamed to C. + + Other than the above changes, the below functions were also renamed to make their + purpose more clear: + * C -> C + * C -> C + tags: + - api + - deprecated + - completed + ticket: 'http://trac.parrot.org/parrot/ticket/443' + diff --git a/compilers/imcc/Rules.in b/compilers/imcc/Rules.in index a3847ce9d0..76b2c3d966 100644 --- a/compilers/imcc/Rules.in +++ b/compilers/imcc/Rules.in @@ -87,7 +87,6 @@ compilers/imcc/parser_util$(O) : \ include/imcc/yyscanner.h \ include/imcc/embed.h \ $(INC_DIR)/dynext.h \ - $(INC_DIR)/embed.h \ $(INC_DIR)/oplib/ops.h \ $(PARROT_H_HEADERS) \ include/pmc/pmc_sub.h @@ -192,7 +191,6 @@ compilers/imcc/main$(O) : \ compilers/imcc/symreg.h \ compilers/imcc/unit.h \ include/imcc/yyscanner.h \ - $(INC_DIR)/embed.h \ $(INC_DIR)/oplib/ops.h \ $(INC_DIR)/runcore_api.h \ $(INC_DIR)/api.h \ diff --git a/compilers/imcc/api.c b/compilers/imcc/api.c index f15db90528..1a4b903151 100644 --- a/compilers/imcc/api.c +++ b/compilers/imcc/api.c @@ -43,7 +43,7 @@ static PMC * get_compreg_pmc(PARROT_INTERP, int is_pasm, int add_compreg) /* Don't modify between HEADERIZER BEGIN / HEADERIZER END. Your changes will be lost. */ /* HEADERIZER END: static */ -#define GET_RAW_INTERP(p) Parrot_int_get_interp_from_pmc(p) +#define GET_RAW_INTERP(p) Parrot_interp_get_from_pmc(p) #define GET_INTERP(p) (PMC_IS_NULL(p) ? NULL : GET_RAW_INTERP(p)) #define IMCC_API_CALLIN(p, i) \ @@ -142,7 +142,7 @@ get_compreg_pmc(PARROT_INTERP, int is_pasm, int add_compreg) PMC * const comp = Parrot_pmc_new_init_int(interp, enum_class_IMCCompiler, is_pasm); if (add_compreg) { STRING * const name = VTABLE_get_string(interp, comp); - Parrot_set_compiler(interp, name, comp); + Parrot_interp_set_compiler(interp, name, comp); } return comp; } diff --git a/compilers/imcc/cfg.c b/compilers/imcc/cfg.c index e4915bce70..f4a9da77ea 100644 --- a/compilers/imcc/cfg.c +++ b/compilers/imcc/cfg.c @@ -447,11 +447,11 @@ build_cfg(ARGMOD(imc_info_t *imcc), ARGMOD(IMC_Unit *unit)) /* Decouple unreachable blocks (not the first block, with no predecessors) * from the CFG */ do { - unsigned int i; + unsigned int j; changes = 0; - for (i = 1; i < unit->n_basic_blocks; i++) { - Basic_block * const bb = unit->bb_list[i]; + for (j = 1; j < unit->n_basic_blocks; j++) { + Basic_block * const bb = unit->bb_list[j]; if (!bb->pred_list) { /* Remove all successor edges of block bb */ diff --git a/compilers/imcc/imc.h b/compilers/imcc/imc.h index 98f45447e1..7fcadaf9df 100644 --- a/compilers/imcc/imc.h +++ b/compilers/imcc/imc.h @@ -423,7 +423,8 @@ typedef struct subs_t { SymHash fixup; /* currently set_p_pc sub names only */ int ins_line; /* line number for debug */ int n_basic_blocks; /* block count */ - int pmc_const; /* index in const table */ + int pmc_const; /* sub pmc index in const table */ + int lexinfo_const; /* lexinfo pmc index in const table */ size_t size; /* code size in ops */ } subs_t; diff --git a/compilers/imcc/imcc.l b/compilers/imcc/imcc.l index 2568c60c81..4df513ce10 100644 --- a/compilers/imcc/imcc.l +++ b/compilers/imcc/imcc.l @@ -289,7 +289,7 @@ SP [ ] ".annotate" return ANNOTATE; ".lex" return LEXICAL; ".set_arg" return ARG; -".sub" return SUB; +".sub" { SET_LINE_NUMBER; return SUB; } ".end" return ESUB; ".begin_call" return PCC_BEGIN; ".end_call" return PCC_END; @@ -308,6 +308,7 @@ SP [ ] ":init" return INIT; ":immediate" return IMMEDIATE; ":postcomp" return POSTCOMP; +":tag" return SUBTAG; ":anon" return ANON; ":outer" return OUTER; ":lex" return NEED_LEX; @@ -787,8 +788,10 @@ destroy_frame(struct macro_frame_t *frame, void *yyscanner) if (frame->heredoc_rest) { mem_sys_free(frame->heredoc_rest); frame->heredoc_rest = NULL; - } else + } + else { ret = frame->s.line; + } mem_sys_free(frame); @@ -1199,7 +1202,7 @@ include_file(ARGMOD(imc_info_t *imcc), ARGIN(STRING *file_name), void *yyscanner if (STRING_IS_NULL(s) || (file = PIO_OPEN(imcc->interp, s, PIO_F_READ)) == PIO_INVALID_HANDLE) { IMCC_fataly(imcc, EXCEPTION_EXTERNAL_ERROR, - "No such file or directory"); + "No such file or directory '%Ss'", file_name); } frame->s.file = file_name; diff --git a/compilers/imcc/imcc.y b/compilers/imcc/imcc.y index 5f4d64c546..4897782049 100644 --- a/compilers/imcc/imcc.y +++ b/compilers/imcc/imcc.y @@ -488,6 +488,12 @@ mk_pmc_const_named(ARGMOD(imc_info_t *imcc), ARGMOD(IMC_Unit *unit), rhs->usage |= U_FIXUP | U_SUBID_LOOKUP; } + else if (strncmp(unquoted_name, "LexInfo", name_length) == 0) { + rhs = mk_const(imcc, const_name, 'l'); + if (!ascii) + rhs->type |= VT_ENCODED; + rhs->usage |= U_FIXUP | U_LEXINFO_LOOKUP; + } else { rhs = mk_const(imcc, const_name, 'P'); } @@ -1013,7 +1019,7 @@ do_loadlib(ARGMOD(imc_info_t *imcc), ARGIN(const char *lib)) /* TODO: This is very ugly and heavily nested. Can we avoid this? */ if (!STRING_equal(imcc->interp, VTABLE_get_string(imcc->interp, - VTABLE_getprop(imcc->interp, lib_pmc, + Parrot_pmc_getprop(imcc->interp, lib_pmc, Parrot_str_new_constant(imcc->interp, "_type"))), Parrot_str_new_constant(imcc->interp, "Ops"))) imcc_pbc_add_libdep(imcc, s); @@ -1054,7 +1060,7 @@ do_loadlib(ARGMOD(imc_info_t *imcc), ARGIN(const char *lib)) %token PCC_BEGIN PCC_END PCC_CALL PCC_SUB PCC_BEGIN_RETURN PCC_END_RETURN %token PCC_BEGIN_YIELD PCC_END_YIELD INVOCANT %token MAIN LOAD INIT IMMEDIATE POSTCOMP METHOD ANON OUTER NEED_LEX -%token MULTI VTABLE_METHOD LOADLIB SUB_INSTANCE_OF SUBID +%token MULTI SUBTAG VTABLE_METHOD LOADLIB SUB_INSTANCE_OF SUBID %token NS_ENTRY %token LABEL %token EMIT EOM @@ -1071,9 +1077,10 @@ do_loadlib(ARGMOD(imc_info_t *imcc), ARGIN(const char *lib)) %type pcc_sub_call %type sub_param pcc_arg pcc_result pcc_args pcc_results sub_param_type_def %type pcc_returns pcc_yields pcc_return pcc_call arg arglist the_sub multi_type +%type subtags %type argtype_list argtype paramtype_list paramtype %type pcc_return_many -%type proto sub_proto sub_proto_list multi multi_types outer +%type proto sub_proto sub_proto_list multi subtag multi_types outer %type vtable instanceof subid %type method ns_entry_name %type instruction assignment conditional_statement labeled_inst opt_label op_assign @@ -1407,6 +1414,76 @@ multi: MULTI '(' multi_types ')' { $$ = 0; } ; +multi_types: + /* empty */ + { + add_pcc_multi(imcc, imcc->cur_call, NULL); + } + | multi_types COMMA multi_type + { + $$ = 0; + add_pcc_multi(imcc, imcc->cur_call, $3); + } + | multi_type + { + $$ = 0; + add_pcc_multi(imcc, imcc->cur_call, $1); + } + ; + +multi_type: + INTV { $$ = mk_const(imcc, "INTVAL", 'S'); } + | FLOATV { $$ = mk_const(imcc, "FLOATVAL", 'S'); } + | PMCV { $$ = mk_const(imcc, "PMC", 'S'); } + | STRINGV { $$ = mk_const(imcc, "STRING", 'S'); } + | IDENTIFIER + { + SymReg *r; + if (strcmp($1, "_") != 0) + r = mk_const(imcc, $1, 'S'); + else { + r = mk_const(imcc, "PMC", 'S'); + } + mem_sys_free($1); + $$ = r; + } + | STRINGC + { + SymReg *r; + if (strcmp($1, "\"_\"") == 0 || strcmp($1, "'_'") == 0) + r = mk_const(imcc, "PMC", 'S'); + else { + r = mk_const(imcc, $1, 'S'); + } + mem_sys_free($1); + $$ = r; + } + | '[' keylist ']' { $$ = $2; } + ; + + +subtag: + SUBTAG '(' subtags ')' { $$ = 0; } + ; + +subtags: + subtags COMMA STRINGC + { + SymReg * const r = mk_const(imcc, $3, 'S'); + add_pcc_flag_str(imcc, imcc->cur_call, r); + mem_sys_free($3); + $$ = r; + } + | STRINGC + { + SymReg * const r = mk_const(imcc, $1, 'S'); + add_pcc_flag_str(imcc, imcc->cur_call, r); + mem_sys_free($1); + $$ = r; + } + ; + + outer: OUTER '(' STRINGC ')' { @@ -1491,53 +1568,6 @@ subid: } ; -multi_types: - /* empty */ - { - add_pcc_multi(imcc, imcc->cur_call, NULL); - } - | multi_types COMMA multi_type - { - $$ = 0; - add_pcc_multi(imcc, imcc->cur_call, $3); - } - | multi_type - { - $$ = 0; - add_pcc_multi(imcc, imcc->cur_call, $1); - } - ; - -multi_type: - INTV { $$ = mk_const(imcc, "INTVAL", 'S'); } - | FLOATV { $$ = mk_const(imcc, "FLOATVAL", 'S'); } - | PMCV { $$ = mk_const(imcc, "PMC", 'S'); } - | STRINGV { $$ = mk_const(imcc, "STRING", 'S'); } - | IDENTIFIER - { - SymReg *r; - if (strcmp($1, "_") != 0) - r = mk_const(imcc, $1, 'S'); - else { - r = mk_const(imcc, "PMC", 'S'); - } - mem_sys_free($1); - $$ = r; - } - | STRINGC - { - SymReg *r; - if (strcmp($1, "_") != 0) - r = mk_const(imcc, $1, 'S'); - else { - r = mk_const(imcc, "PMC", 'S'); - } - mem_sys_free($1); - $$ = r; - } - | '[' keylist ']' { $$ = $2; } - ; - sub_body: /* empty */ | statements @@ -1590,14 +1620,29 @@ sub_proto_list: ; proto: - LOAD { $$ = P_LOAD; } - | INIT { $$ = P_INIT; } + LOAD { + $$ = P_LOAD; + /* + SymReg * const r = mk_const(imcc, "load", 'S'); + add_pcc_flag_str(imcc, imcc->cur_call, r); + $$ = r; + */ + } + | INIT { + $$ = P_INIT; + /* + SymReg * const r = mk_const(imcc, "load", 'S'); + add_pcc_flag_str(imcc, imcc->cur_call, r); + $$ = r; + */ + } | MAIN { $$ = P_MAIN; } | IMMEDIATE { $$ = P_IMMEDIATE; } | POSTCOMP { $$ = P_POSTCOMP; } | ANON { $$ = P_ANON; } | NEED_LEX { $$ = P_NEED_LEX; } | multi + | subtag | outer | vtable | method diff --git a/compilers/imcc/imclexer.c b/compilers/imcc/imclexer.c index 0a4177a431..d52c24ba65 100644 --- a/compilers/imcc/imclexer.c +++ b/compilers/imcc/imclexer.c @@ -78,6 +78,7 @@ typedef int flex_int32_t; typedef unsigned char flex_uint8_t; typedef unsigned short int flex_uint16_t; typedef unsigned int flex_uint32_t; +#endif /* ! C99 */ /* Limits of integral types. */ #ifndef INT8_MIN @@ -108,8 +109,6 @@ typedef unsigned int flex_uint32_t; #define UINT32_MAX (4294967295U) #endif -#endif /* ! C99 */ - #endif /* ! FLEXINT_H */ #ifdef __cplusplus @@ -183,15 +182,7 @@ typedef void* yyscan_t; /* Size of default input buffer. */ #ifndef YY_BUF_SIZE -#ifdef __ia64__ -/* On IA-64, the buffer size is 16k, not 8k. - * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case. - * Ditto for the __ia64__ case accordingly. - */ -#define YY_BUF_SIZE 32768 -#else #define YY_BUF_SIZE 16384 -#endif /* __ia64__ */ #endif /* The state buf must be large enough to hold one state per character in the main buffer. @@ -392,8 +383,8 @@ static void yy_fatal_error (yyconst char msg[] ,yyscan_t yyscanner ); *yy_cp = '\0'; \ yyg->yy_c_buf_p = yy_cp; -#define YY_NUM_RULES 144 -#define YY_END_OF_BUFFER 145 +#define YY_NUM_RULES 145 +#define YY_END_OF_BUFFER 146 /* This struct is not used in this scanner, but its presence is necessary. */ struct yy_trans_info @@ -401,123 +392,123 @@ struct yy_trans_info flex_int32_t yy_verify; flex_int32_t yy_nxt; }; -static yyconst flex_int16_t yy_accept[1047] = +static yyconst flex_int16_t yy_accept[1050] = { 0, 0, 1, 0, 1, 0, 1, 17, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, - 4, 1, 145, 132, 131, 11, 131, 132, 132, 12, - 132, 132, 132, 132, 132, 132, 113, 132, 93, 132, - 117, 117, 132, 85, 132, 87, 130, 130, 130, 130, - 130, 130, 130, 130, 132, 132, 1, 1, 132, 131, - 131, 132, 132, 132, 132, 130, 1, 1, 132, 143, - 138, 134, 138, 143, 143, 143, 143, 143, 117, 117, - 143, 141, 141, 141, 1, 1, 143, 17, 18, 17, + 4, 1, 146, 133, 132, 11, 132, 133, 133, 12, + 133, 133, 133, 133, 133, 133, 114, 133, 94, 133, + 118, 118, 133, 86, 133, 88, 131, 131, 131, 131, + 131, 131, 131, 131, 133, 133, 1, 1, 133, 132, + 132, 133, 133, 133, 133, 131, 1, 1, 133, 144, + 139, 135, 139, 144, 144, 144, 144, 144, 118, 118, + 144, 142, 142, 142, 1, 1, 144, 17, 18, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 1, - 1, 17, 144, 132, 9, 9, 132, 132, 1, 5, + 1, 17, 145, 133, 9, 9, 133, 133, 1, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 1, - 6, 132, 10, 132, 132, 132, 132, 132, 117, 117, - 132, 132, 132, 1, 1, 132, 13, 132, 132, 132, - 132, 132, 117, 117, 132, 132, 132, 1, 1, 144, - 2, 144, 144, 144, 144, 144, 117, 117, 144, 144, - 144, 1, 1, 4, 3, 144, 4, 4, 4, 4, - 4, 4, 4, 4, 4, 1, 1, 131, 0, 11, - 90, 0, 121, 0, 128, 128, 128, 128, 128, 98, - 82, 101, 0, 91, 96, 0, 117, 94, 95, 116, - - 107, 115, 115, 115, 115, 115, 115, 115, 115, 115, - 115, 115, 115, 115, 115, 115, 115, 115, 99, 97, - 116, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 79, 86, 89, 62, - 88, 80, 112, 0, 130, 114, 129, 130, 72, 130, - 130, 130, 130, 130, 130, 102, 83, 103, 84, 1, - 0, 15, 0, 89, 62, 0, 131, 115, 115, 115, - 115, 0, 0, 0, 0, 1, 138, 134, 138, 0, - 0, 0, 142, 142, 142, 142, 141, 0, 139, 141, - 1, 1, 17, 18, 17, 17, 17, 17, 17, 17, + 6, 133, 10, 133, 133, 133, 133, 133, 118, 118, + 133, 133, 133, 1, 1, 133, 13, 133, 133, 133, + 133, 133, 118, 118, 133, 133, 133, 1, 1, 145, + 2, 145, 145, 145, 145, 145, 118, 118, 145, 145, + 145, 1, 1, 4, 3, 145, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 1, 1, 132, 0, 11, + 91, 0, 122, 0, 129, 129, 129, 129, 129, 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, 116, 116, 100, 98, + 117, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 80, 87, 90, + 63, 89, 81, 113, 0, 131, 115, 130, 131, 73, + 131, 131, 131, 131, 131, 131, 103, 84, 104, 85, + 1, 0, 15, 0, 90, 63, 0, 132, 116, 116, + 116, 116, 0, 0, 0, 0, 1, 139, 135, 139, + 0, 0, 0, 143, 143, 143, 143, 142, 0, 140, + 142, 1, 1, 17, 18, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, - 17, 17, 1, 17, 0, 0, 9, 0, 1, 5, + 17, 17, 17, 1, 17, 0, 0, 9, 0, 1, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 1, 0, 10, 0, - 0, 0, 121, 0, 0, 0, 0, 117, 116, 0, - 0, 116, 0, 0, 0, 0, 0, 0, 0, 0, - 1, 1, 0, 13, 0, 0, 0, 121, 0, 0, - 0, 0, 117, 116, 0, 0, 116, 0, 0, 0, - 0, 0, 0, 0, 0, 1, 1, 0, 2, 0, - 0, 0, 121, 0, 0, 0, 0, 117, 116, 0, - - 0, 116, 0, 0, 0, 0, 0, 0, 0, 0, - 1, 1, 4, 0, 3, 4, 0, 4, 4, 4, - 0, 4, 4, 4, 4, 4, 4, 4, 4, 4, - 4, 4, 4, 4, 4, 1, 1, 92, 124, 125, - 127, 126, 0, 115, 115, 115, 115, 115, 115, 115, - 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, - 115, 115, 115, 115, 115, 115, 100, 116, 119, 0, - 116, 120, 118, 0, 0, 0, 0, 0, 0, 0, + 5, 5, 5, 5, 5, 5, 5, 1, 0, 10, + 0, 0, 0, 122, 0, 0, 0, 0, 118, 117, + 0, 0, 117, 0, 0, 0, 0, 0, 0, 0, + 0, 1, 1, 0, 13, 0, 0, 0, 122, 0, + 0, 0, 0, 118, 117, 0, 0, 117, 0, 0, + 0, 0, 0, 0, 0, 0, 1, 1, 0, 2, + 0, 0, 0, 122, 0, 0, 0, 0, 118, 117, + + 0, 0, 117, 0, 0, 0, 0, 0, 0, 0, + 0, 1, 1, 4, 0, 3, 4, 0, 4, 4, + 4, 0, 4, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 4, 1, 1, 93, 125, + 126, 128, 127, 0, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 105, 104, 81, 111, 0, 129, 130, - - 75, 130, 76, 77, 130, 130, 130, 0, 115, 115, - 0, 0, 135, 140, 137, 142, 142, 142, 142, 142, - 141, 17, 17, 17, 17, 17, 17, 17, 17, 17, - 17, 17, 17, 17, 17, 0, 0, 0, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 0, - 0, 0, 116, 119, 0, 116, 120, 118, 0, 0, - 0, 0, 0, 0, 0, 116, 119, 0, 116, 120, - 118, 0, 0, 0, 0, 0, 0, 0, 116, 119, - 0, 116, 120, 118, 0, 0, 0, 0, 4, 4, - 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 0, 0, 0, 0, 0, 106, 105, 82, 112, 0, - 4, 0, 116, 66, 115, 115, 115, 115, 25, 115, - 115, 115, 115, 115, 22, 115, 115, 115, 115, 115, - 115, 115, 115, 115, 24, 115, 115, 0, 0, 0, - 0, 0, 0, 0, 44, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 122, 0, - 0, 106, 0, 123, 0, 71, 74, 130, 130, 130, - 130, 0, 137, 142, 142, 142, 142, 141, 141, 17, - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, - 17, 17, 17, 0, 0, 0, 0, 5, 5, 5, - 5, 5, 5, 5, 5, 0, 116, 0, 0, 0, - - 0, 122, 0, 0, 0, 0, 0, 123, 0, 0, - 0, 0, 116, 0, 0, 0, 0, 122, 0, 0, - 0, 0, 0, 123, 0, 0, 0, 0, 116, 0, - 0, 0, 0, 122, 0, 0, 0, 0, 0, 123, - 0, 0, 0, 4, 4, 4, 4, 4, 0, 4, - 4, 4, 0, 4, 0, 4, 4, 4, 4, 115, - 115, 28, 115, 115, 20, 115, 115, 115, 115, 19, - 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, - 42, 0, 57, 0, 39, 0, 0, 38, 37, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 130, 131, 76, 131, 77, 78, 131, 131, 131, 0, + 116, 116, 0, 0, 136, 141, 138, 143, 143, 143, + 143, 143, 142, 17, 17, 17, 17, 17, 17, 17, + 17, 17, 17, 17, 17, 17, 17, 0, 0, 0, + 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, + 5, 0, 0, 0, 117, 120, 0, 117, 121, 119, + 0, 0, 0, 0, 0, 0, 0, 117, 120, 0, + 117, 121, 119, 0, 0, 0, 0, 0, 0, 0, + 117, 120, 0, 117, 121, 119, 0, 0, 0, 0, + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, - 130, 130, 130, 130, 14, 0, 133, 20, 142, 19, - 141, 141, 17, 17, 17, 17, 16, 17, 20, 19, - 0, 0, 5, 5, 5, 5, 20, 19, 0, 0, - 20, 19, 0, 0, 20, 19, 0, 0, 4, 4, - 4, 4, 115, 115, 68, 115, 115, 115, 115, 115, - 115, 115, 115, 67, 109, 115, 70, 115, 115, 115, - 115, 115, 115, 51, 0, 0, 0, 0, 0, 36, - 61, 0, 0, 0, 43, 0, 0, 48, 0, 130, - 130, 78, 73, 142, 141, 141, 17, 17, 0, 0, - 5, 5, 0, 0, 0, 0, 0, 0, 4, 4, - - 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, - 115, 115, 115, 53, 115, 115, 115, 115, 0, 0, - 0, 0, 35, 0, 0, 0, 0, 58, 45, 130, - 130, 136, 141, 141, 17, 17, 0, 0, 5, 5, - 0, 0, 0, 0, 0, 0, 4, 4, 115, 115, - 115, 115, 115, 115, 115, 115, 115, 110, 115, 56, - 115, 115, 30, 23, 115, 115, 115, 0, 0, 0, - 0, 46, 0, 0, 0, 0, 8, 17, 8, 5, - 5, 0, 8, 0, 8, 0, 8, 4, 4, 21, - 115, 115, 115, 27, 115, 115, 115, 115, 29, 115, - - 115, 115, 115, 55, 64, 0, 0, 63, 60, 59, - 41, 7, 7, 7, 7, 7, 4, 115, 115, 115, - 115, 34, 115, 115, 115, 65, 115, 52, 40, 0, - 26, 115, 115, 32, 49, 115, 115, 54, 47, 115, - 33, 50, 69, 108, 31, 0 + 4, 4, 4, 0, 117, 67, 116, 116, 116, 116, + 25, 116, 116, 116, 116, 116, 22, 116, 116, 116, + 116, 116, 116, 116, 116, 116, 24, 116, 116, 0, + 0, 0, 0, 0, 0, 0, 45, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 42, 0, + 0, 123, 0, 0, 107, 0, 124, 0, 72, 75, + 131, 131, 131, 131, 0, 138, 143, 143, 143, 143, + 142, 142, 17, 17, 17, 17, 17, 17, 17, 17, + 17, 17, 17, 17, 17, 17, 0, 0, 0, 0, + 5, 5, 5, 5, 5, 5, 5, 5, 0, 117, + + 0, 0, 0, 0, 123, 0, 0, 0, 0, 0, + 124, 0, 0, 0, 0, 117, 0, 0, 0, 0, + 123, 0, 0, 0, 0, 0, 124, 0, 0, 0, + 0, 117, 0, 0, 0, 0, 123, 0, 0, 0, + 0, 0, 124, 0, 0, 0, 4, 4, 4, 4, + 4, 0, 4, 4, 4, 0, 4, 0, 4, 4, + 4, 4, 116, 116, 28, 116, 116, 20, 116, 116, + 116, 116, 19, 116, 116, 116, 116, 116, 116, 116, + 116, 116, 116, 43, 0, 58, 0, 39, 0, 0, + 38, 37, 0, 0, 0, 0, 0, 0, 0, 0, + + 0, 0, 0, 131, 131, 131, 131, 14, 0, 134, + 20, 143, 19, 142, 142, 17, 17, 17, 17, 16, + 17, 20, 19, 0, 0, 5, 5, 5, 5, 20, + 19, 0, 0, 20, 19, 0, 0, 20, 19, 0, + 0, 4, 4, 4, 4, 116, 116, 69, 116, 116, + 116, 116, 116, 116, 116, 116, 68, 110, 116, 71, + 116, 116, 116, 116, 116, 116, 52, 0, 0, 0, + 0, 0, 36, 62, 0, 0, 0, 44, 0, 0, + 49, 0, 131, 131, 79, 74, 143, 142, 142, 17, + 17, 0, 0, 5, 5, 0, 0, 0, 0, 0, + + 0, 4, 4, 116, 116, 116, 116, 116, 116, 116, + 116, 116, 116, 116, 116, 116, 54, 116, 116, 116, + 116, 0, 0, 0, 0, 35, 0, 0, 0, 0, + 59, 46, 131, 131, 137, 142, 142, 17, 17, 0, + 0, 5, 5, 0, 0, 0, 0, 0, 0, 4, + 4, 116, 116, 116, 116, 116, 116, 116, 116, 116, + 111, 116, 57, 116, 116, 30, 23, 116, 116, 116, + 0, 0, 0, 0, 47, 0, 0, 0, 0, 8, + 17, 8, 5, 5, 0, 8, 0, 8, 0, 8, + 4, 4, 21, 116, 116, 116, 27, 116, 116, 116, + + 116, 29, 116, 116, 116, 116, 56, 65, 0, 0, + 64, 61, 60, 41, 7, 7, 7, 7, 7, 4, + 116, 116, 116, 116, 34, 116, 116, 116, 66, 116, + 53, 40, 0, 26, 116, 116, 32, 50, 116, 116, + 55, 48, 116, 33, 51, 70, 109, 31, 0 } ; static yyconst flex_int32_t yy_ec[256] = @@ -563,273 +554,275 @@ static yyconst flex_int32_t yy_meta[65] = 10, 10, 1, 1 } ; -static yyconst flex_int16_t yy_base[1179] = +static yyconst flex_int16_t yy_base[1182] = { 0, 0, 63, 87, 69, 151, 74, 215, 81, 279, 112, 343, 116, 108, 406, 428, 120, 492, 129, 556, 134, - 620, 143, 5811, 5812, 683, 5812, 687, 5785, 62, 5812, - 379, 5784, 55, 5796, 57, 676, 5812, 686, 693, 59, - 739, 767, 772, 71, 82, 393, 693, 782, 754, 783, - 748, 757, 812, 758, 56, 62, 829, 835, 838, 418, - 845, 834, 858, 824, 5783, 864, 813, 857, 841, 5812, - 886, 5812, 890, 83, 834, 5794, 902, 908, 0, 914, - 5781, 694, 926, 749, 894, 935, 908, 0, 5812, 5801, - 679, 5791, 944, 948, 983, 947, 5778, 1044, 1108, 969, - - 975, 5757, 5812, 996, 972, 1055, 5777, 86, 980, 0, - 0, 950, 1011, 1044, 1156, 1044, 5775, 1217, 1281, 1005, - 772, 922, 5812, 947, 1020, 984, 1124, 1136, 1343, 1050, - 1017, 1404, 5752, 1133, 1147, 994, 5812, 1031, 1156, 1078, - 1186, 1250, 1466, 1155, 1158, 1527, 5751, 1162, 1209, 1035, - 5812, 1093, 1197, 1176, 1241, 1310, 1589, 1279, 1235, 1650, - 5750, 1244, 1262, 5791, 5812, 5791, 1248, 137, 1331, 1470, - 1711, 1280, 772, 1772, 1836, 1098, 1271, 1354, 1298, 5812, - 5812, 803, 5812, 0, 0, 1317, 1347, 1355, 1371, 5812, - 5812, 5812, 5781, 5812, 5812, 1379, 1577, 5812, 5812, 1478, - - 5812, 0, 5758, 5738, 5744, 367, 5736, 5738, 648, 5734, - 1274, 5744, 5743, 861, 5738, 822, 5741, 5732, 5756, 5812, - 1583, 1110, 1457, 1149, 0, 5727, 5737, 5727, 1198, 811, - 1464, 899, 735, 5723, 930, 5718, 1371, 5812, 5812, 5812, - 5812, 1252, 5752, 5751, 1083, 5766, 1617, 1711, 1371, 1713, - 1740, 1744, 1735, 1743, 1752, 5812, 5812, 5812, 5812, 1499, - 1307, 5812, 1322, 1339, 1351, 1735, 1509, 5718, 5718, 1472, - 5726, 1332, 5712, 5709, 999, 1610, 1642, 5812, 1714, 5744, - 1785, 0, 0, 5713, 5715, 1353, 884, 5757, 1794, 1805, - 1721, 1820, 0, 5812, 1272, 0, 0, 5751, 1810, 1847, - - 1851, 5712, 5711, 1864, 1461, 1882, 1601, 1892, 1135, 1939, - 5753, 2003, 1741, 5700, 5708, 5707, 1950, 1013, 1853, 0, - 1912, 0, 1868, 2014, 1886, 5706, 5705, 1954, 1474, 1909, - 1781, 2049, 1588, 2096, 5747, 2160, 1956, 1613, 5812, 1627, - 1979, 1984, 1638, 1645, 1815, 1914, 2019, 2112, 2043, 1830, - 1995, 2176, 1974, 2124, 2055, 2222, 2045, 2269, 1871, 5695, - 2051, 2078, 1888, 5812, 1986, 2083, 2147, 2047, 2081, 2114, - 2144, 2188, 2210, 2216, 2149, 2178, 2331, 2185, 2343, 2335, - 2375, 2251, 2422, 2208, 5694, 2338, 2364, 2121, 5812, 2190, - 2341, 2367, 2198, 2213, 2245, 2372, 2369, 2484, 2488, 2333, - - 2486, 2518, 2382, 2538, 2389, 2562, 2490, 2609, 2408, 5693, - 2521, 2541, 5746, 0, 5812, 2491, 1475, 5745, 5744, 1758, - 5735, 2549, 2557, 2670, 882, 1038, 2674, 2241, 2693, 2492, - 2717, 2543, 2764, 68, 2828, 2515, 2584, 2591, 2578, 2660, - 2664, 2703, 2712, 0, 5712, 5692, 5696, 5692, 5689, 5696, - 5689, 5681, 5684, 1034, 5676, 5683, 1693, 5691, 5682, 5677, - 5688, 5673, 5672, 5686, 5678, 5681, 5812, 2721, 2214, 2733, - 2764, 2379, 0, 5672, 5674, 5682, 5671, 1935, 5661, 5679, - 5670, 5661, 5667, 5665, 5670, 5657, 5656, 5656, 5653, 5668, - 5668, 1594, 5697, 5812, 5812, 5683, 5812, 1902, 2540, 2694, - - 2782, 2793, 2783, 2784, 2808, 2799, 2802, 2672, 5663, 5664, - 5655, 5681, 5812, 2841, 0, 0, 5658, 5651, 5658, 5647, - 2834, 2851, 5648, 5645, 2857, 2394, 2775, 2874, 2508, 2885, - 1926, 5685, 1961, 2932, 5638, 5644, 5641, 2654, 2902, 5642, - 5639, 2879, 2480, 2978, 2982, 2737, 2986, 2699, 3033, 3095, - 2529, 2816, 3099, 3006, 3103, 3127, 3123, 3147, 3097, 2715, - 3131, 3194, 3256, 2684, 3109, 3260, 3136, 3160, 3264, 3284, - 3304, 3258, 2809, 3288, 3351, 3296, 3270, 3290, 3413, 3154, - 3316, 3417, 3310, 3457, 3415, 2871, 3422, 3504, 3426, 1468, - 1264, 3445, 3166, 3449, 3476, 3437, 3565, 3101, 2137, 3262, - - 3612, 2998, 3002, 0, 5637, 5640, 5638, 5631, 5646, 5640, - 5644, 5641, 5632, 5628, 0, 5635, 5635, 5637, 5622, 5631, - 5634, 5634, 5615, 5632, 0, 5610, 5586, 5583, 5574, 5556, - 5557, 5534, 5381, 5366, 5812, 5364, 5345, 5338, 5316, 5322, - 5285, 374, 5281, 5258, 5255, 5260, 5256, 1990, 5812, 0, - 5276, 5812, 2150, 5812, 0, 2903, 3465, 3565, 3668, 3669, - 3670, 2512, 0, 5225, 5220, 5067, 5048, 3137, 3138, 3320, - 3551, 5037, 5026, 2342, 0, 0, 5049, 2807, 0, 0, - 3727, 4998, 2569, 4996, 4960, 1174, 1698, 3556, 3570, 4949, - 4938, 2877, 0, 3791, 4931, 3579, 3677, 3447, 3679, 3853, - - 3855, 2598, 2695, 3480, 3593, 3860, 3862, 2746, 2907, 3902, - 4930, 3684, 3691, 3964, 3966, 3968, 3973, 3008, 3129, 3697, - 3704, 3975, 3980, 3180, 3293, 4020, 4925, 3867, 3877, 3970, - 4082, 4084, 4086, 3341, 3420, 3711, 3870, 4091, 4093, 3424, - 3469, 4133, 4924, 3857, 3977, 968, 2084, 4194, 2816, 4966, - 4965, 2235, 4946, 4195, 2895, 4943, 4932, 4235, 4875, 4758, - 4741, 0, 4724, 3828, 0, 4715, 4718, 4690, 4692, 0, - 4646, 4645, 4637, 4633, 4627, 4618, 4618, 3944, 4619, 4607, - 5812, 4600, 5812, 4585, 5812, 4479, 4455, 5812, 5812, 4426, - 4419, 4413, 4389, 4387, 4378, 4342, 4350, 4338, 4337, 4326, - - 4291, 4292, 4293, 4294, 5812, 3486, 0, 0, 4325, 0, - 4076, 4290, 0, 0, 3529, 1183, 5812, 4370, 5812, 5812, - 1130, 1786, 0, 0, 3552, 1574, 3686, 3716, 3841, 2867, - 3985, 3987, 3942, 3671, 3991, 3998, 3953, 3961, 4361, 4359, - 3967, 4051, 4313, 4306, 0, 4302, 4294, 4254, 4192, 4178, - 4077, 4078, 4056, 0, 3978, 3952, 0, 3926, 3832, 3819, - 3822, 3748, 3675, 0, 3645, 3556, 3551, 3452, 3437, 5812, - 5812, 3407, 3403, 3399, 5812, 3390, 3369, 5812, 3281, 4302, - 4303, 4093, 4094, 4103, 4184, 4187, 1806, 1909, 1461, 2089, - 3680, 3959, 4065, 4068, 4073, 4075, 4158, 4159, 4165, 4166, - - 3264, 4162, 3260, 3251, 3255, 3232, 3227, 3132, 3119, 3122, - 3115, 3110, 3093, 0, 3080, 3052, 2994, 2976, 2963, 2866, - 2853, 2829, 5812, 2804, 2816, 2784, 2758, 5812, 5812, 4315, - 4323, 4215, 1365, 3878, 1815, 2171, 2132, 2562, 4300, 4316, - 4317, 4318, 4322, 4324, 4325, 4328, 4329, 4330, 2734, 2702, - 2683, 2658, 2543, 2516, 2511, 2492, 2481, 0, 2358, 0, - 2352, 2343, 0, 0, 2321, 2208, 2202, 2155, 2109, 2093, - 2045, 5812, 2024, 1991, 1982, 2353, 2027, 2796, 2020, 2883, - 2001, 4218, 4223, 4349, 4354, 4357, 4366, 4125, 4108, 0, - 1930, 1869, 1849, 0, 1823, 1781, 1760, 1711, 0, 1702, - - 1696, 1469, 1430, 0, 5812, 1356, 1295, 5812, 5812, 5812, - 5812, 5812, 0, 4210, 4228, 4333, 1252, 1164, 1134, 1123, - 1071, 0, 982, 968, 918, 0, 905, 0, 5812, 896, - 0, 862, 775, 0, 726, 704, 675, 0, 5812, 90, - 0, 0, 0, 0, 0, 5812, 4380, 4386, 4396, 4404, - 4415, 4419, 4427, 4434, 4445, 4456, 4467, 4478, 4485, 4496, - 4507, 4518, 4529, 4540, 4551, 4562, 4573, 4584, 4595, 4606, - 4617, 4628, 4639, 4650, 4661, 4667, 4677, 4683, 4689, 4694, - 4702, 4713, 4719, 4723, 4729, 4736, 4747, 4758, 4769, 4780, - 4791, 4802, 4813, 4824, 4835, 4846, 4857, 4868, 4879, 4890, - - 4901, 4912, 4923, 4934, 4945, 4956, 4962, 4967, 4973, 4982, - 4993, 5004, 5012, 5023, 5029, 5035, 5041, 5048, 5059, 5070, - 5081, 5092, 5099, 5110, 5121, 5132, 5143, 5154, 5165, 5176, - 5187, 5198, 5209, 5220, 5231, 5242, 5253, 5264, 5275, 5286, - 5297, 5303, 5314, 5325, 5336, 5344, 5355, 5361, 5367, 5374, - 5385, 5396, 5407, 5418, 5425, 5436, 5447, 5458, 5469, 5480, - 5491, 5502, 5513, 5524, 5535, 5546, 5557, 5568, 5579, 5590, - 5601, 5612, 5623, 5629, 5637, 5648, 5654, 5661 + 620, 143, 5815, 5816, 683, 5816, 687, 5789, 62, 5816, + 379, 5788, 55, 5800, 57, 676, 5816, 686, 693, 59, + 739, 767, 772, 71, 82, 393, 693, 782, 754, 812, + 748, 757, 822, 758, 56, 62, 832, 837, 844, 418, + 848, 841, 864, 824, 5787, 848, 790, 888, 852, 5816, + 895, 5816, 899, 83, 848, 5798, 908, 914, 0, 920, + 5785, 694, 932, 760, 941, 954, 869, 0, 5816, 5805, + 679, 5795, 950, 954, 989, 953, 5782, 1050, 1114, 813, + + 975, 5761, 5816, 965, 978, 1061, 5781, 86, 986, 0, + 0, 1010, 1017, 1050, 1162, 1050, 5779, 1223, 1287, 1019, + 772, 840, 5816, 902, 1026, 990, 1130, 1142, 1349, 1056, + 914, 1410, 5756, 1042, 1139, 928, 5816, 959, 1162, 1037, + 1153, 1192, 1472, 1161, 1084, 1533, 5755, 1183, 1215, 1000, + 5816, 1023, 1254, 1155, 1247, 1256, 1595, 1280, 1206, 1656, + 5754, 1250, 1268, 5795, 5816, 5795, 1096, 137, 1318, 1310, + 1717, 1319, 786, 1778, 1842, 1240, 1277, 1342, 1313, 5816, + 5816, 909, 5816, 0, 0, 1355, 1362, 1377, 1385, 5816, + 5816, 5816, 5785, 5816, 5816, 1458, 1466, 5816, 5816, 1484, + + 5816, 0, 5762, 5742, 5748, 367, 5740, 5742, 648, 5738, + 1048, 5748, 5747, 867, 5742, 774, 5745, 5736, 5760, 5816, + 1581, 1086, 1503, 1264, 0, 5731, 5741, 5731, 1154, 841, + 922, 1111, 1121, 5727, 1269, 5738, 5721, 1123, 5816, 5816, + 5816, 5816, 1299, 5755, 5754, 1333, 5769, 1623, 1597, 1377, + 1717, 1746, 1610, 1719, 1743, 1749, 5816, 5816, 5816, 5816, + 1385, 1360, 5816, 1405, 1478, 1494, 1746, 1505, 5721, 5721, + 1677, 5729, 1447, 5715, 5712, 1008, 1527, 1605, 5816, 1648, + 5747, 1787, 0, 0, 5716, 5718, 1471, 749, 5760, 1800, + 1706, 1809, 1822, 0, 5816, 1314, 0, 0, 5754, 1809, + + 1815, 1850, 5715, 5714, 1854, 1508, 1871, 1602, 1888, 1041, + 1935, 5756, 1999, 1739, 5703, 5711, 5710, 1882, 1019, 1893, + 0, 1874, 0, 1900, 1946, 1950, 5709, 5708, 1999, 1585, + 1963, 1609, 2045, 1187, 2092, 5750, 2156, 1909, 1632, 5816, + 1644, 1922, 1986, 1721, 1764, 1952, 1983, 2027, 2039, 2108, + 2029, 2031, 2172, 1859, 2120, 2033, 2218, 2140, 2265, 1920, + 5698, 2117, 2146, 1770, 5816, 1835, 2037, 2183, 1970, 2024, + 2068, 2185, 2205, 2212, 2327, 2122, 2180, 2331, 2232, 2360, + 2335, 2380, 2200, 2427, 2079, 5697, 2196, 2251, 2047, 5816, + 2110, 2329, 2338, 2142, 2174, 2355, 2382, 2368, 2489, 2493, + + 2207, 2362, 2521, 2394, 2533, 2400, 2565, 2491, 2612, 2388, + 5696, 2413, 2497, 5749, 0, 5816, 1741, 1754, 5748, 5747, + 1990, 5738, 2512, 2542, 2673, 1105, 1258, 2677, 2224, 2561, + 2501, 2720, 2566, 2767, 68, 2831, 2524, 2587, 2594, 2581, + 2663, 2667, 2689, 2706, 0, 5715, 5695, 5699, 5695, 5692, + 5699, 5692, 5684, 5687, 1052, 5679, 5686, 1301, 5694, 5685, + 5680, 5691, 5676, 5675, 5689, 5681, 5684, 5816, 2713, 2186, + 2693, 2725, 2386, 0, 5675, 5677, 5685, 5674, 1931, 5664, + 5682, 5673, 5664, 5670, 5668, 5673, 5660, 5659, 5659, 5656, + 5671, 5665, 5670, 2210, 5699, 5816, 5816, 5685, 5816, 2330, + + 2581, 2780, 2778, 2796, 2779, 2788, 2849, 2800, 2805, 2697, + 5665, 5666, 5657, 5683, 5816, 2840, 0, 0, 5660, 5653, + 5660, 5649, 2850, 2860, 5650, 5647, 2883, 2324, 2732, 2805, + 2537, 2911, 2353, 5687, 2510, 2958, 5640, 5646, 5643, 2655, + 2871, 5644, 5641, 2888, 2525, 2848, 2895, 2697, 3004, 2803, + 3051, 3113, 2687, 2676, 3117, 2908, 2916, 3121, 3024, 3161, + 3115, 2796, 3145, 3208, 3153, 2874, 2733, 3270, 3141, 3173, + 3274, 3167, 3314, 3272, 2939, 3279, 3361, 3306, 2895, 3147, + 3284, 3304, 3328, 3423, 3334, 3443, 3426, 3026, 3428, 3490, + 3434, 795, 1811, 3551, 2902, 3455, 3555, 3463, 3594, 2813, + + 2064, 3119, 3641, 2928, 3020, 0, 5639, 5642, 5640, 5633, + 5648, 5642, 5646, 5643, 5634, 5630, 0, 5637, 5637, 5628, + 5590, 5599, 5592, 5582, 5553, 5560, 0, 5397, 5378, 5365, + 5356, 5338, 5337, 5319, 5289, 5282, 5816, 5280, 5267, 5270, + 5250, 5251, 5233, 374, 5229, 5064, 5047, 5042, 5816, 5038, + 2520, 5816, 0, 5058, 5816, 2531, 5816, 0, 3569, 3570, + 3571, 3579, 3573, 3697, 2602, 0, 5005, 5005, 4969, 4958, + 1344, 3540, 3177, 3459, 4947, 4944, 3139, 0, 0, 4977, + 3161, 0, 0, 3754, 4934, 2701, 4937, 4933, 1707, 1928, + 3545, 3584, 4932, 4921, 3605, 0, 3818, 4906, 3704, 3708, + + 2880, 3294, 3711, 3880, 2727, 2753, 3150, 3437, 3882, 3887, + 2757, 2920, 3927, 4895, 3713, 3718, 3554, 3565, 3989, 3991, + 2941, 3032, 3448, 3606, 3996, 3998, 3127, 3277, 4038, 4884, + 3889, 3893, 3706, 4100, 4102, 4104, 3281, 3298, 3616, 3738, + 4109, 4111, 3342, 3348, 4151, 4775, 3727, 3884, 1911, 2149, + 3430, 3421, 4799, 4787, 2066, 4768, 4212, 3429, 4765, 4754, + 4252, 4695, 4648, 4652, 0, 4642, 3122, 0, 4643, 4646, + 4625, 4639, 0, 4621, 4610, 4596, 4582, 4478, 4451, 4433, + 3955, 4434, 4422, 5816, 4415, 5816, 4398, 5816, 4399, 4363, + 5816, 5816, 4349, 4352, 4346, 4329, 4335, 4326, 4323, 4334, + + 4322, 4331, 4324, 4308, 4309, 4310, 4311, 5816, 3454, 0, + 0, 4322, 0, 4094, 4202, 0, 0, 3510, 1587, 5816, + 4369, 5816, 5816, 2112, 1283, 0, 0, 3533, 1701, 3627, + 3629, 3584, 2454, 3740, 3895, 3850, 2526, 3913, 3915, 3873, + 3954, 4367, 4366, 3875, 3956, 4327, 4323, 0, 4321, 4315, + 4307, 4310, 4297, 4199, 4197, 4184, 0, 4191, 4175, 0, + 4164, 4094, 4087, 4093, 4074, 3993, 0, 3975, 3975, 3963, + 3971, 3876, 5816, 5816, 3851, 3851, 3842, 5816, 3771, 3683, + 5816, 3690, 4314, 4319, 3999, 4003, 4016, 2806, 4104, 1470, + 2087, 901, 1794, 2195, 3265, 3707, 3964, 3977, 3978, 3984, + + 3987, 4073, 4075, 3661, 4078, 3550, 3533, 3393, 3272, 3277, + 3267, 3246, 3159, 3114, 3086, 3015, 0, 2989, 2973, 2915, + 2901, 2825, 2822, 2774, 2760, 5816, 2736, 2741, 2728, 2706, + 5816, 5816, 4212, 4215, 4124, 4125, 4217, 3557, 3594, 1198, + 1251, 4316, 4317, 4324, 4331, 4333, 4334, 4335, 4336, 4338, + 4339, 2675, 2532, 2520, 2498, 2479, 2459, 2360, 2337, 2321, + 0, 2310, 0, 2308, 2296, 0, 0, 2200, 2198, 2162, + 2137, 2073, 2062, 2041, 5816, 2036, 2004, 1983, 2881, 2010, + 3334, 1992, 3620, 1949, 4128, 4133, 4238, 4243, 4342, 4246, + 4222, 4232, 0, 1887, 1836, 1843, 0, 1827, 1813, 1782, + + 1723, 0, 1717, 1686, 1562, 1450, 0, 5816, 1444, 1430, + 5816, 5816, 5816, 5816, 5816, 0, 4347, 4349, 4351, 1397, + 1340, 1313, 1314, 1273, 0, 1207, 1114, 1027, 0, 978, + 0, 5816, 948, 0, 927, 822, 0, 739, 704, 675, + 0, 5816, 90, 0, 0, 0, 0, 0, 5816, 4389, + 4395, 4405, 4413, 4424, 4428, 4436, 4443, 4454, 4465, 4476, + 4487, 4494, 4505, 4516, 4527, 4538, 4549, 4560, 4571, 4582, + 4593, 4604, 4615, 4626, 4637, 4648, 4659, 4670, 4676, 4686, + 4692, 4698, 4703, 4711, 4722, 4728, 4732, 4738, 4745, 4756, + 4767, 4778, 4789, 4800, 4811, 4822, 4833, 4844, 4855, 4866, + + 4877, 4888, 4899, 4910, 4921, 4932, 4943, 4954, 4965, 4971, + 4976, 4982, 4991, 5002, 5013, 5021, 5032, 5038, 5044, 5050, + 5057, 5068, 5079, 5090, 5101, 5108, 5119, 5130, 5141, 5152, + 5163, 5174, 5185, 5196, 5207, 5218, 5229, 5240, 5251, 5262, + 5273, 5284, 5295, 5306, 5312, 5323, 5334, 5345, 5353, 5364, + 5370, 5376, 5383, 5394, 5405, 5416, 5427, 5434, 5445, 5456, + 5467, 5478, 5489, 5500, 5511, 5522, 5533, 5544, 5555, 5566, + 5577, 5588, 5599, 5610, 5621, 5632, 5638, 5646, 5657, 5663, + 5670 } ; -static yyconst flex_int16_t yy_def[1179] = +static yyconst flex_int16_t yy_def[1182] = { 0, - 1046, 1, 1, 3, 1046, 5, 1046, 7, 1046, 9, - 1046, 11, 9, 9, 1046, 15, 1046, 17, 1046, 19, - 1046, 21, 1046, 1046, 1046, 1046, 1046, 1046, 1047, 1046, - 1048, 1046, 1046, 1049, 1046, 1046, 1046, 1046, 1046, 1046, - 1046, 1046, 1046, 1046, 1046, 1046, 1050, 1050, 1050, 1050, - 1050, 1050, 1050, 1050, 1046, 1046, 1046, 1046, 1051, 1046, - 1046, 1046, 39, 1046, 1046, 1050, 1046, 1046, 1051, 1046, - 1046, 1046, 1046, 1047, 1052, 1049, 1046, 1053, 41, 1046, - 1046, 1054, 1054, 1054, 1046, 1046, 1051, 1055, 1046, 1055, - 1056, 1057, 1055, 1055, 1055, 95, 1055, 1058, 1058, 1055, - - 1055, 1055, 1046, 1046, 41, 1046, 1059, 1059, 1046, 1060, - 1060, 1061, 1060, 1060, 1060, 115, 1060, 1062, 1062, 1060, - 1047, 1063, 1046, 1063, 1064, 1065, 1063, 1063, 1063, 129, - 1063, 1046, 132, 1063, 1063, 1066, 1046, 1066, 1067, 1068, - 1066, 1066, 1066, 143, 1066, 1046, 146, 1066, 1066, 1069, - 1046, 1069, 1070, 1071, 1069, 1069, 1069, 157, 1069, 1046, - 160, 1069, 1069, 1072, 1046, 1072, 1073, 1074, 1072, 1072, - 1072, 171, 1072, 1075, 1075, 1072, 1072, 1046, 1046, 1046, - 1046, 1047, 1046, 1047, 1076, 1076, 1076, 1076, 1076, 1046, - 1046, 1046, 1077, 1046, 1046, 1046, 1046, 1046, 1046, 1046, - - 1046, 1078, 1078, 1078, 1078, 1078, 1078, 1078, 1078, 1078, - 1078, 1078, 1078, 1078, 1078, 1078, 1078, 1078, 1046, 1046, - 1046, 1046, 1046, 1046, 1079, 1046, 1046, 1046, 1046, 1046, - 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, - 1046, 1046, 1046, 1080, 1081, 1046, 1081, 1081, 1081, 1081, - 1081, 1081, 1081, 1081, 1081, 1046, 1046, 1046, 1046, 1046, - 1082, 1046, 1082, 1082, 1082, 1082, 1046, 1078, 1078, 1078, - 1078, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1083, - 1083, 1084, 1085, 1085, 1085, 1085, 1086, 1046, 1086, 1086, - 1046, 1046, 1087, 1046, 1088, 1087, 1088, 1089, 1087, 1087, - - 1087, 1087, 1087, 1087, 1087, 1087, 1087, 1087, 1087, 1090, - 1087, 1090, 1087, 1087, 1046, 1046, 1046, 1080, 1046, 1091, - 1092, 1091, 1091, 1091, 1091, 1091, 1091, 1091, 1091, 1091, - 1091, 1091, 1091, 1093, 1091, 1093, 1091, 1094, 1046, 1094, - 1095, 1095, 1094, 1095, 1096, 1096, 1094, 1094, 1094, 1094, - 1094, 1094, 1094, 1094, 1094, 1094, 1094, 1046, 1094, 358, - 1094, 1094, 1097, 1046, 1097, 1098, 1098, 1097, 1098, 1099, - 1099, 1097, 1097, 1097, 1097, 1097, 1097, 1097, 1097, 1097, - 1097, 1097, 1046, 1097, 383, 1097, 1097, 1100, 1046, 1100, - 1101, 1101, 1100, 1101, 1102, 1102, 1100, 1100, 1100, 1100, - - 1100, 1100, 1100, 1100, 1100, 1100, 1100, 1046, 1100, 408, - 1100, 1100, 1103, 1103, 1046, 1104, 1104, 1103, 1104, 1105, - 1105, 1103, 1103, 1103, 1103, 1103, 1103, 1103, 1103, 1103, - 1103, 1103, 1106, 1103, 1106, 1103, 1103, 1046, 1107, 1107, - 1107, 1107, 1046, 1108, 1108, 1108, 1108, 1108, 1108, 1108, - 1108, 1108, 1108, 1108, 1108, 1108, 1108, 1108, 1108, 1108, - 1108, 1108, 1108, 1108, 1108, 1108, 1046, 1046, 1046, 1046, - 1046, 1046, 1109, 1046, 1046, 1046, 1046, 1046, 1046, 1046, - 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, - 1046, 1110, 1111, 1046, 1046, 1046, 1046, 1112, 1113, 1113, - - 1113, 1113, 1113, 1113, 1113, 1113, 1113, 1114, 1108, 1108, - 1046, 1115, 1046, 1115, 1116, 1117, 1117, 1117, 1117, 1117, - 1118, 1119, 1119, 1119, 1119, 1119, 1119, 1119, 1119, 1119, - 1120, 1121, 1122, 1046, 1119, 1046, 1046, 1123, 1124, 1124, - 1124, 1124, 1124, 1124, 1124, 1124, 1124, 1125, 1046, 1126, - 1126, 1126, 1126, 1126, 1126, 1126, 1126, 1126, 1127, 1128, - 1129, 1046, 1130, 1130, 1130, 1130, 1130, 1130, 1130, 1130, - 1130, 1131, 1132, 1133, 1046, 1134, 1134, 1134, 1134, 1134, - 1134, 1134, 1134, 1134, 1135, 1136, 1137, 1046, 1138, 1138, - 1138, 1138, 1138, 1138, 1138, 1138, 1138, 1139, 1140, 1141, - - 1046, 1046, 1046, 1142, 1142, 1142, 1142, 1142, 1142, 1142, - 1142, 1142, 1142, 1142, 1142, 1142, 1142, 1142, 1142, 1142, - 1142, 1142, 1142, 1142, 1142, 1142, 1142, 1046, 1046, 1046, - 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, - 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1143, 1046, 1143, - 1144, 1046, 1145, 1046, 1145, 1146, 1146, 1146, 1146, 1146, - 1146, 1147, 1148, 1149, 1149, 1149, 1149, 1150, 1150, 1151, - 1151, 1151, 1151, 1152, 1151, 1152, 1153, 1154, 1151, 1154, - 1046, 681, 1151, 1046, 1046, 1155, 1155, 1156, 1156, 1156, - 1156, 1157, 1156, 1046, 694, 1158, 1158, 1158, 1158, 1159, - - 1159, 1158, 1159, 1160, 1160, 1161, 1161, 1158, 1161, 1046, - 710, 1162, 1162, 1162, 1162, 1163, 1163, 1162, 1163, 1164, - 1164, 1165, 1165, 1162, 1165, 1046, 726, 1166, 1166, 1166, - 1166, 1167, 1167, 1166, 1167, 1168, 1168, 1169, 1169, 1166, - 1169, 1046, 742, 1170, 1170, 1170, 1170, 1171, 1171, 1170, - 1171, 1172, 1172, 1173, 1173, 1170, 1173, 1046, 758, 1174, - 1174, 1174, 1174, 1174, 1174, 1174, 1174, 1174, 1174, 1174, - 1174, 1174, 1174, 1174, 1174, 1174, 1174, 1174, 1174, 1174, - 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, - 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, - - 1175, 1175, 1175, 1175, 1046, 1176, 1177, 1177, 1177, 1177, - 1178, 1178, 1151, 1151, 681, 681, 1046, 1151, 1046, 1046, - 1155, 1155, 1156, 1156, 694, 694, 1158, 1158, 710, 710, - 1162, 1162, 726, 726, 1166, 1166, 742, 742, 1170, 1170, - 758, 758, 1174, 1174, 1174, 1174, 1174, 1174, 1174, 1174, - 1174, 1174, 1174, 1174, 1174, 1174, 1174, 1174, 1174, 1174, - 1174, 1174, 1174, 1174, 1046, 1046, 1046, 1046, 1046, 1046, - 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1175, - 1175, 1175, 1175, 1177, 1178, 1178, 681, 681, 1155, 1155, - 694, 694, 710, 710, 726, 726, 742, 742, 758, 758, - - 1174, 1174, 1174, 1174, 1174, 1174, 1174, 1174, 1174, 1174, - 1174, 1174, 1174, 1174, 1174, 1174, 1174, 1174, 1046, 1046, - 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1175, - 1175, 1046, 1178, 1178, 681, 681, 1155, 1155, 694, 694, - 710, 710, 726, 726, 742, 742, 758, 758, 1174, 1174, - 1174, 1174, 1174, 1174, 1174, 1174, 1174, 1174, 1174, 1174, - 1174, 1174, 1174, 1174, 1174, 1174, 1174, 1046, 1046, 1046, - 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1151, 1151, 1156, - 1156, 1158, 1158, 1162, 1162, 1166, 1166, 1170, 1170, 1174, - 1174, 1174, 1174, 1174, 1174, 1174, 1174, 1174, 1174, 1174, - - 1174, 1174, 1174, 1174, 1046, 1046, 1046, 1046, 1046, 1046, - 1046, 1046, 1151, 1158, 1162, 1166, 1170, 1174, 1174, 1174, - 1174, 1174, 1174, 1174, 1174, 1174, 1174, 1174, 1046, 1046, - 1174, 1174, 1174, 1174, 1174, 1174, 1174, 1174, 1046, 1174, - 1174, 1174, 1174, 1174, 1174, 0, 1046, 1046, 1046, 1046, - 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, - 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, - 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, - 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, - 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, - - 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, - 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, - 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, - 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, - 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, - 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, - 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, - 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046 + 1049, 1, 1, 3, 1049, 5, 1049, 7, 1049, 9, + 1049, 11, 9, 9, 1049, 15, 1049, 17, 1049, 19, + 1049, 21, 1049, 1049, 1049, 1049, 1049, 1049, 1050, 1049, + 1051, 1049, 1049, 1052, 1049, 1049, 1049, 1049, 1049, 1049, + 1049, 1049, 1049, 1049, 1049, 1049, 1053, 1053, 1053, 1053, + 1053, 1053, 1053, 1053, 1049, 1049, 1049, 1049, 1054, 1049, + 1049, 1049, 39, 1049, 1049, 1053, 1049, 1049, 1054, 1049, + 1049, 1049, 1049, 1050, 1055, 1052, 1049, 1056, 41, 1049, + 1049, 1057, 1057, 1057, 1049, 1049, 1054, 1058, 1049, 1058, + 1059, 1060, 1058, 1058, 1058, 95, 1058, 1061, 1061, 1058, + + 1058, 1058, 1049, 1049, 41, 1049, 1062, 1062, 1049, 1063, + 1063, 1064, 1063, 1063, 1063, 115, 1063, 1065, 1065, 1063, + 1050, 1066, 1049, 1066, 1067, 1068, 1066, 1066, 1066, 129, + 1066, 1049, 132, 1066, 1066, 1069, 1049, 1069, 1070, 1071, + 1069, 1069, 1069, 143, 1069, 1049, 146, 1069, 1069, 1072, + 1049, 1072, 1073, 1074, 1072, 1072, 1072, 157, 1072, 1049, + 160, 1072, 1072, 1075, 1049, 1075, 1076, 1077, 1075, 1075, + 1075, 171, 1075, 1078, 1078, 1075, 1075, 1049, 1049, 1049, + 1049, 1050, 1049, 1050, 1079, 1079, 1079, 1079, 1079, 1049, + 1049, 1049, 1080, 1049, 1049, 1049, 1049, 1049, 1049, 1049, + + 1049, 1081, 1081, 1081, 1081, 1081, 1081, 1081, 1081, 1081, + 1081, 1081, 1081, 1081, 1081, 1081, 1081, 1081, 1049, 1049, + 1049, 1049, 1049, 1049, 1082, 1049, 1049, 1049, 1049, 1049, + 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, + 1049, 1049, 1049, 1049, 1083, 1084, 1049, 1084, 1084, 1084, + 1084, 1084, 1084, 1084, 1084, 1084, 1049, 1049, 1049, 1049, + 1049, 1085, 1049, 1085, 1085, 1085, 1085, 1049, 1081, 1081, + 1081, 1081, 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, + 1086, 1086, 1087, 1088, 1088, 1088, 1088, 1089, 1049, 1089, + 1089, 1049, 1049, 1090, 1049, 1091, 1090, 1091, 1092, 1090, + + 1090, 1090, 1090, 1090, 1090, 1090, 1090, 1090, 1090, 1090, + 1093, 1090, 1093, 1090, 1090, 1049, 1049, 1049, 1083, 1049, + 1094, 1095, 1094, 1094, 1094, 1094, 1094, 1094, 1094, 1094, + 1094, 1094, 1094, 1094, 1096, 1094, 1096, 1094, 1097, 1049, + 1097, 1098, 1098, 1097, 1098, 1099, 1099, 1097, 1097, 1097, + 1097, 1097, 1097, 1097, 1097, 1097, 1097, 1097, 1049, 1097, + 359, 1097, 1097, 1100, 1049, 1100, 1101, 1101, 1100, 1101, + 1102, 1102, 1100, 1100, 1100, 1100, 1100, 1100, 1100, 1100, + 1100, 1100, 1100, 1049, 1100, 384, 1100, 1100, 1103, 1049, + 1103, 1104, 1104, 1103, 1104, 1105, 1105, 1103, 1103, 1103, + + 1103, 1103, 1103, 1103, 1103, 1103, 1103, 1103, 1049, 1103, + 409, 1103, 1103, 1106, 1106, 1049, 1107, 1107, 1106, 1107, + 1108, 1108, 1106, 1106, 1106, 1106, 1106, 1106, 1106, 1106, + 1106, 1106, 1106, 1109, 1106, 1109, 1106, 1106, 1049, 1110, + 1110, 1110, 1110, 1049, 1111, 1111, 1111, 1111, 1111, 1111, + 1111, 1111, 1111, 1111, 1111, 1111, 1111, 1111, 1111, 1111, + 1111, 1111, 1111, 1111, 1111, 1111, 1111, 1049, 1049, 1049, + 1049, 1049, 1049, 1112, 1049, 1049, 1049, 1049, 1049, 1049, + 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, + 1049, 1049, 1049, 1113, 1114, 1049, 1049, 1049, 1049, 1115, + + 1116, 1116, 1116, 1116, 1116, 1116, 1116, 1116, 1116, 1117, + 1111, 1111, 1049, 1118, 1049, 1118, 1119, 1120, 1120, 1120, + 1120, 1120, 1121, 1122, 1122, 1122, 1122, 1122, 1122, 1122, + 1122, 1122, 1123, 1124, 1125, 1049, 1122, 1049, 1049, 1126, + 1127, 1127, 1127, 1127, 1127, 1127, 1127, 1127, 1127, 1128, + 1049, 1129, 1129, 1129, 1129, 1129, 1129, 1129, 1129, 1129, + 1130, 1131, 1132, 1049, 1133, 1133, 1133, 1133, 1133, 1133, + 1133, 1133, 1133, 1134, 1135, 1136, 1049, 1137, 1137, 1137, + 1137, 1137, 1137, 1137, 1137, 1137, 1138, 1139, 1140, 1049, + 1141, 1141, 1141, 1141, 1141, 1141, 1141, 1141, 1141, 1142, + + 1143, 1144, 1049, 1049, 1049, 1145, 1145, 1145, 1145, 1145, + 1145, 1145, 1145, 1145, 1145, 1145, 1145, 1145, 1145, 1145, + 1145, 1145, 1145, 1145, 1145, 1145, 1145, 1145, 1145, 1049, + 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, + 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, + 1146, 1049, 1146, 1147, 1049, 1148, 1049, 1148, 1149, 1149, + 1149, 1149, 1149, 1149, 1150, 1151, 1152, 1152, 1152, 1152, + 1153, 1153, 1154, 1154, 1154, 1154, 1155, 1154, 1155, 1156, + 1157, 1154, 1157, 1049, 684, 1154, 1049, 1049, 1158, 1158, + 1159, 1159, 1159, 1159, 1160, 1159, 1049, 697, 1161, 1161, + + 1161, 1161, 1162, 1162, 1161, 1162, 1163, 1163, 1164, 1164, + 1161, 1164, 1049, 713, 1165, 1165, 1165, 1165, 1166, 1166, + 1165, 1166, 1167, 1167, 1168, 1168, 1165, 1168, 1049, 729, + 1169, 1169, 1169, 1169, 1170, 1170, 1169, 1170, 1171, 1171, + 1172, 1172, 1169, 1172, 1049, 745, 1173, 1173, 1173, 1173, + 1174, 1174, 1173, 1174, 1175, 1175, 1176, 1176, 1173, 1176, + 1049, 761, 1177, 1177, 1177, 1177, 1177, 1177, 1177, 1177, + 1177, 1177, 1177, 1177, 1177, 1177, 1177, 1177, 1177, 1177, + 1177, 1177, 1177, 1049, 1049, 1049, 1049, 1049, 1049, 1049, + 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, + + 1049, 1049, 1049, 1178, 1178, 1178, 1178, 1049, 1179, 1180, + 1180, 1180, 1180, 1181, 1181, 1154, 1154, 684, 684, 1049, + 1154, 1049, 1049, 1158, 1158, 1159, 1159, 697, 697, 1161, + 1161, 713, 713, 1165, 1165, 729, 729, 1169, 1169, 745, + 745, 1173, 1173, 761, 761, 1177, 1177, 1177, 1177, 1177, + 1177, 1177, 1177, 1177, 1177, 1177, 1177, 1177, 1177, 1177, + 1177, 1177, 1177, 1177, 1177, 1177, 1177, 1049, 1049, 1049, + 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, + 1049, 1049, 1178, 1178, 1178, 1178, 1180, 1181, 1181, 684, + 684, 1158, 1158, 697, 697, 713, 713, 729, 729, 745, + + 745, 761, 761, 1177, 1177, 1177, 1177, 1177, 1177, 1177, + 1177, 1177, 1177, 1177, 1177, 1177, 1177, 1177, 1177, 1177, + 1177, 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, + 1049, 1049, 1178, 1178, 1049, 1181, 1181, 684, 684, 1158, + 1158, 697, 697, 713, 713, 729, 729, 745, 745, 761, + 761, 1177, 1177, 1177, 1177, 1177, 1177, 1177, 1177, 1177, + 1177, 1177, 1177, 1177, 1177, 1177, 1177, 1177, 1177, 1177, + 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, + 1154, 1154, 1159, 1159, 1161, 1161, 1165, 1165, 1169, 1169, + 1173, 1173, 1177, 1177, 1177, 1177, 1177, 1177, 1177, 1177, + + 1177, 1177, 1177, 1177, 1177, 1177, 1177, 1049, 1049, 1049, + 1049, 1049, 1049, 1049, 1049, 1154, 1161, 1165, 1169, 1173, + 1177, 1177, 1177, 1177, 1177, 1177, 1177, 1177, 1177, 1177, + 1177, 1049, 1049, 1177, 1177, 1177, 1177, 1177, 1177, 1177, + 1177, 1049, 1177, 1177, 1177, 1177, 1177, 1177, 0, 1049, + 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, + 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, + 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, + 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, + 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, + + 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, + 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, + 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, + 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, + 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, + 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, + 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, + 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, + 1049 } ; -static yyconst flex_int16_t yy_nxt[5877] = +static yyconst flex_int16_t yy_nxt[5881] = { 0, 24, 25, 26, 27, 25, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, @@ -838,15 +831,15 @@ static yyconst flex_int16_t yy_nxt[5877] = 47, 47, 47, 47, 47, 47, 47, 49, 47, 50, 47, 47, 51, 47, 52, 47, 53, 47, 54, 47, 47, 47, 55, 56, 57, 191, 58, 57, 183, 194, - 67, 414, 68, 67, 600, 85, 219, 86, 85, 192, - 256, 195, 100, 220, 101, 100, 258, 59, 60, 183, - 61, 60, 24, 69, 237, 238, 24, 24, 87, 24, - - 62, 184, 62, 63, 24, 102, 239, 240, 288, 64, - 65, 24, 24, 109, 121, 109, 109, 120, 257, 120, - 120, 134, 184, 135, 134, 259, 41, 42, 42, 42, - 148, 318, 149, 148, 47, 162, 47, 163, 162, 47, - 421, 47, 1045, 66, 176, 47, 177, 176, 418, 24, + 67, 415, 68, 67, 602, 85, 219, 86, 85, 192, + 257, 195, 100, 220, 101, 100, 259, 59, 60, 183, + 61, 60, 24, 69, 238, 239, 24, 24, 87, 24, + + 62, 184, 62, 63, 24, 102, 240, 241, 289, 64, + 65, 24, 24, 109, 121, 109, 109, 120, 258, 120, + 120, 134, 184, 135, 134, 260, 41, 42, 42, 42, + 148, 319, 149, 148, 47, 162, 47, 163, 162, 47, + 422, 47, 1048, 66, 176, 47, 177, 176, 419, 24, 24, 70, 71, 72, 73, 71, 70, 74, 70, 75, 70, 70, 76, 70, 77, 70, 77, 78, 70, 79, 80, 80, 80, 70, 81, 70, 70, 82, 82, 82, @@ -875,9 +868,9 @@ static yyconst flex_int16_t yy_nxt[5877] = 118, 118, 110, 118, 118, 118, 118, 118, 118, 118, 118, 118, 118, 118, 118, 118, 118, 118, 118, 119, - 118, 118, 118, 118, 118, 110, 110, 109, 448, 109, - 109, 186, 121, 187, 794, 188, 189, 241, 242, 267, - 449, 267, 267, 795, 41, 42, 42, 42, 122, 122, + 118, 118, 118, 118, 118, 110, 110, 109, 449, 109, + 109, 186, 121, 187, 797, 188, 189, 242, 243, 268, + 450, 268, 268, 798, 41, 42, 42, 42, 122, 122, 123, 124, 122, 122, 125, 122, 122, 122, 122, 126, 122, 127, 122, 127, 128, 122, 129, 130, 130, 130, 122, 131, 122, 122, 132, 132, 132, 132, 132, 132, @@ -905,581 +898,581 @@ static yyconst flex_int16_t yy_nxt[5877] = 174, 174, 174, 174, 174, 174, 174, 174, 174, 164, 174, 174, 174, 174, 174, 174, 174, 174, 174, 174, 174, 174, 174, 174, 174, 174, 175, 174, 174, 174, - 174, 174, 164, 164, 178, 296, 178, 178, 178, 180, - 178, 178, 196, 452, 197, 197, 197, 197, 453, 179, + 174, 174, 164, 164, 178, 297, 178, 178, 178, 180, + 178, 178, 196, 453, 197, 197, 197, 197, 454, 179, - 198, 243, 196, 179, 197, 197, 197, 197, 244, 244, - 199, 200, 200, 200, 200, 246, 288, 201, 297, 202, + 198, 244, 196, 179, 197, 197, 197, 197, 245, 245, + 199, 200, 200, 200, 200, 247, 289, 201, 298, 202, 202, 202, 202, 202, 203, 202, 202, 202, 202, 202, - 202, 202, 1044, 202, 204, 205, 206, 202, 207, 208, + 202, 202, 1047, 202, 204, 205, 206, 202, 207, 208, 209, 202, 210, 211, 212, 213, 202, 214, 215, 216, - 217, 202, 202, 202, 218, 221, 243, 197, 197, 197, - 197, 1043, 243, 244, 244, 243, 243, 222, 223, 244, - 246, 288, 244, 244, 224, 414, 246, 225, 183, 246, - 246, 222, 1042, 221, 223, 197, 197, 197, 197, 486, - 243, 243, 224, 487, 290, 432, 223, 244, 244, 225, - - 247, 247, 247, 247, 246, 246, 251, 248, 252, 183, - 255, 184, 223, 226, 276, 227, 276, 276, 228, 1041, - 243, 229, 230, 231, 232, 233, 234, 244, 235, 249, - 260, 236, 260, 260, 246, 250, 260, 180, 260, 260, - 262, 263, 184, 262, 263, 179, 267, 180, 267, 267, - 196, 179, 197, 197, 197, 197, 479, 253, 276, 180, - 276, 276, 264, 265, 480, 226, 281, 463, 281, 254, - 281, 281, 243, 272, 230, 231, 273, 274, 234, 244, - 464, 266, 1046, 236, 266, 414, 246, 277, 278, 279, - 277, 277, 278, 279, 277, 291, 278, 292, 291, 244, - - 202, 268, 460, 202, 461, 202, 288, 269, 270, 253, - 262, 263, 271, 202, 202, 202, 282, 1040, 196, 202, - 197, 197, 197, 197, 339, 340, 200, 200, 200, 200, - 221, 590, 197, 197, 197, 197, 291, 278, 292, 291, - 484, 244, 1039, 223, 289, 289, 289, 289, 288, 339, - 340, 266, 320, 284, 285, 485, 193, 1038, 286, 223, - 299, 322, 300, 300, 300, 300, 301, 301, 301, 301, - 313, 414, 313, 313, 1037, 293, 313, 294, 313, 313, - 489, 319, 293, 319, 319, 293, 339, 346, 490, 293, - 317, 317, 317, 317, 302, 343, 364, 365, 303, 304, - - 293, 300, 300, 300, 300, 492, 337, 293, 337, 337, - 493, 305, 306, 839, 200, 200, 200, 200, 307, 339, - 340, 308, 339, 342, 1036, 305, 343, 323, 306, 324, - 324, 324, 324, 364, 365, 288, 307, 389, 390, 1035, - 357, 414, 315, 308, 293, 293, 316, 293, 293, 293, - 293, 293, 293, 293, 293, 293, 293, 293, 293, 344, - 293, 293, 325, 325, 325, 325, 311, 293, 293, 293, - 538, 221, 320, 317, 317, 317, 317, 613, 338, 320, - 364, 371, 320, 293, 223, 338, 320, 591, 338, 368, - 326, 243, 338, 614, 327, 389, 390, 320, 244, 436, - - 223, 437, 436, 338, 320, 246, 293, 293, 293, 293, - 338, 293, 293, 293, 293, 293, 293, 293, 293, 293, - 293, 293, 293, 1034, 293, 293, 339, 340, 469, 469, - 311, 293, 293, 293, 361, 339, 362, 361, 339, 340, - 347, 531, 348, 348, 348, 348, 532, 293, 361, 339, - 362, 361, 288, 312, 349, 349, 349, 349, 364, 367, - 364, 365, 368, 386, 364, 387, 386, 472, 472, 472, - 293, 293, 328, 1033, 324, 324, 324, 324, 389, 396, - 889, 382, 350, 363, 329, 330, 351, 393, 364, 365, - 363, 331, 1032, 363, 332, 369, 288, 363, 329, 389, - - 392, 330, 372, 393, 373, 373, 373, 373, 363, 331, - 386, 364, 387, 386, 1031, 363, 332, 320, 320, 320, - 320, 320, 320, 821, 320, 320, 320, 320, 320, 320, - 320, 320, 310, 320, 320, 888, 394, 389, 390, 335, - 320, 320, 320, 389, 390, 411, 389, 412, 411, 477, - 478, 417, 364, 365, 418, 414, 320, 397, 407, 398, - 398, 398, 398, 411, 389, 412, 411, 414, 374, 374, - 374, 374, 436, 415, 436, 436, 495, 496, 296, 320, - 320, 320, 320, 320, 320, 320, 320, 419, 320, 320, - 320, 320, 320, 320, 320, 320, 375, 320, 320, 438, - - 376, 438, 438, 335, 320, 320, 320, 388, 413, 262, - 263, 297, 389, 390, 388, 413, 747, 388, 413, 455, - 320, 388, 413, 456, 262, 263, 336, 457, 399, 399, - 399, 399, 388, 413, 414, 439, 439, 439, 439, 388, - 413, 262, 263, 320, 320, 339, 340, 422, 1030, 423, - 423, 423, 423, 262, 263, 178, 400, 178, 178, 352, - 401, 348, 348, 348, 348, 440, 440, 440, 440, 976, - 179, 353, 354, 441, 441, 441, 441, 492, 355, 243, - 244, 356, 493, 477, 511, 353, 244, 288, 354, 442, - 442, 442, 442, 246, 519, 494, 355, 200, 200, 200, - - 200, 1029, 520, 356, 338, 338, 339, 340, 338, 338, - 338, 338, 338, 338, 338, 338, 338, 338, 338, 358, - 338, 338, 358, 358, 358, 358, 359, 338, 338, 338, - 358, 358, 358, 358, 358, 358, 358, 358, 358, 358, - 358, 358, 358, 338, 358, 358, 358, 358, 358, 358, - 358, 358, 358, 358, 358, 358, 358, 358, 358, 358, - 358, 358, 358, 358, 358, 358, 338, 338, 364, 365, - 470, 414, 470, 414, 1028, 471, 471, 471, 471, 526, - 526, 418, 377, 288, 373, 373, 373, 373, 424, 424, - 424, 424, 543, 543, 378, 379, 200, 200, 200, 200, - - 260, 380, 260, 260, 381, 481, 937, 443, 378, 482, - 267, 379, 267, 267, 419, 179, 425, 455, 746, 380, - 426, 456, 483, 443, 1027, 510, 381, 363, 363, 364, - 365, 363, 363, 363, 363, 363, 363, 363, 363, 363, - 363, 363, 383, 363, 363, 383, 383, 383, 383, 384, - 363, 363, 363, 383, 383, 383, 383, 383, 383, 383, - 383, 383, 383, 383, 383, 383, 363, 383, 383, 383, - 383, 383, 383, 383, 383, 383, 383, 383, 383, 383, - 383, 383, 383, 383, 383, 383, 383, 383, 383, 363, - 363, 389, 390, 221, 492, 197, 197, 197, 197, 548, - - 649, 468, 468, 468, 468, 402, 223, 398, 398, 398, - 398, 276, 443, 276, 276, 339, 340, 403, 404, 529, - 529, 529, 223, 334, 405, 243, 892, 406, 443, 339, - 340, 403, 244, 650, 404, 499, 499, 499, 499, 246, - 339, 340, 405, 277, 278, 279, 277, 339, 342, 406, - 388, 388, 389, 390, 388, 388, 388, 388, 388, 388, - 388, 388, 388, 388, 388, 408, 388, 388, 408, 408, - 408, 408, 409, 388, 388, 388, 408, 408, 408, 408, - 408, 408, 408, 408, 408, 408, 408, 408, 408, 388, - 408, 408, 408, 408, 408, 408, 408, 408, 408, 408, - - 408, 408, 408, 408, 408, 408, 408, 408, 408, 408, - 408, 408, 388, 388, 414, 277, 278, 279, 277, 243, - 288, 243, 291, 278, 292, 291, 244, 427, 244, 423, - 423, 423, 423, 246, 617, 246, 618, 262, 263, 428, - 429, 1026, 313, 243, 313, 313, 430, 822, 243, 431, - 244, 243, 243, 428, 1025, 244, 429, 246, 244, 244, - 243, 421, 246, 1024, 430, 246, 246, 244, 500, 418, - 501, 431, 413, 413, 246, 414, 413, 413, 413, 413, - 413, 413, 413, 413, 413, 413, 413, 504, 413, 413, - 502, 503, 505, 508, 434, 413, 413, 413, 506, 546, - - 546, 546, 507, 514, 514, 514, 514, 513, 288, 244, - 1023, 413, 289, 289, 289, 289, 288, 339, 346, 978, - 244, 291, 278, 292, 291, 1022, 343, 288, 301, 301, - 301, 301, 339, 340, 413, 413, 413, 413, 890, 414, - 413, 413, 413, 413, 413, 413, 413, 413, 413, 413, - 413, 935, 413, 413, 319, 310, 319, 319, 434, 413, - 413, 413, 521, 304, 310, 300, 300, 300, 300, 301, - 301, 301, 301, 339, 340, 413, 306, 561, 1021, 551, - 522, 435, 525, 525, 525, 525, 325, 325, 325, 325, - 364, 365, 306, 522, 1020, 527, 522, 527, 413, 413, - - 528, 528, 528, 528, 325, 325, 325, 325, 654, 522, - 530, 530, 530, 530, 320, 539, 339, 346, 193, 530, - 530, 530, 544, 322, 544, 343, 1019, 545, 545, 545, - 545, 539, 675, 530, 530, 530, 530, 530, 530, 293, - 293, 655, 293, 293, 293, 293, 293, 293, 293, 293, - 293, 293, 293, 293, 936, 293, 293, 337, 310, 337, - 337, 311, 293, 293, 293, 676, 221, 679, 317, 317, - 317, 317, 542, 542, 542, 542, 339, 340, 293, 223, - 1018, 339, 342, 539, 632, 343, 339, 342, 364, 365, - 343, 633, 554, 554, 634, 223, 649, 339, 340, 539, - - 680, 293, 293, 293, 293, 981, 293, 293, 293, 293, - 293, 293, 293, 293, 293, 293, 293, 293, 344, 293, - 293, 339, 340, 344, 979, 311, 293, 293, 293, 650, - 328, 977, 324, 324, 324, 324, 1011, 349, 349, 349, - 349, 1010, 293, 330, 552, 339, 340, 339, 340, 364, - 365, 559, 361, 339, 362, 361, 560, 339, 340, 330, - 534, 349, 349, 349, 349, 293, 293, 547, 547, 547, - 547, 1009, 550, 557, 557, 557, 547, 547, 547, 361, - 339, 362, 361, 364, 367, 364, 367, 414, 550, 368, - 547, 547, 547, 547, 547, 547, 320, 320, 320, 320, - - 320, 320, 1008, 320, 320, 320, 320, 320, 320, 320, - 320, 288, 320, 320, 339, 340, 364, 371, 335, 320, - 320, 320, 369, 389, 390, 368, 339, 340, 352, 840, - 348, 348, 348, 348, 938, 320, 976, 555, 1007, 555, - 753, 354, 556, 556, 556, 556, 364, 371, 750, 364, - 367, 364, 365, 368, 288, 368, 654, 354, 320, 320, - 320, 320, 320, 320, 320, 320, 1006, 320, 320, 320, - 320, 320, 320, 320, 320, 979, 320, 320, 339, 340, - 364, 365, 335, 320, 320, 320, 369, 364, 365, 655, - 364, 365, 389, 390, 553, 553, 553, 553, 564, 320, - - 389, 390, 1005, 567, 567, 550, 374, 374, 374, 374, - 364, 365, 364, 365, 574, 389, 392, 549, 364, 365, - 310, 550, 320, 320, 339, 340, 377, 565, 373, 373, - 373, 373, 469, 469, 374, 374, 374, 374, 753, 379, - 558, 558, 558, 558, 414, 563, 750, 389, 396, 558, - 558, 558, 1004, 364, 365, 379, 393, 572, 1003, 593, - 593, 563, 573, 558, 558, 558, 558, 558, 558, 338, - 338, 339, 340, 338, 338, 338, 338, 338, 338, 338, - 338, 338, 338, 338, 358, 338, 338, 358, 358, 358, - 358, 359, 338, 338, 338, 358, 358, 358, 358, 358, - - 358, 358, 358, 358, 358, 358, 358, 358, 338, 358, - 358, 358, 358, 358, 358, 358, 358, 358, 358, 358, - 358, 358, 358, 358, 358, 358, 358, 358, 358, 358, - 358, 338, 338, 364, 365, 389, 390, 364, 365, 386, - 364, 387, 386, 389, 392, 364, 365, 393, 675, 566, - 566, 566, 566, 570, 570, 570, 568, 976, 568, 1012, - 563, 569, 569, 569, 569, 386, 364, 387, 386, 389, - 392, 389, 390, 393, 389, 396, 563, 364, 365, 1002, - 394, 676, 577, 393, 389, 390, 1001, 399, 399, 399, - 399, 389, 390, 571, 571, 571, 571, 472, 472, 472, - - 580, 580, 571, 571, 571, 1000, 394, 583, 583, 583, - 389, 390, 526, 526, 587, 999, 571, 571, 571, 571, - 571, 571, 363, 363, 364, 365, 363, 363, 363, 363, - 363, 363, 363, 363, 363, 363, 363, 383, 363, 363, - 383, 383, 383, 383, 384, 363, 363, 363, 383, 383, - 383, 383, 383, 383, 383, 383, 383, 383, 383, 383, - 383, 363, 383, 383, 383, 383, 383, 383, 383, 383, - 383, 383, 383, 383, 383, 383, 383, 383, 383, 383, - 383, 383, 383, 383, 363, 363, 389, 390, 389, 390, - 389, 390, 389, 390, 417, 414, 585, 418, 543, 543, - - 402, 586, 398, 398, 398, 398, 399, 399, 399, 399, - 596, 596, 596, 404, 805, 806, 436, 576, 437, 436, - 389, 390, 411, 389, 412, 411, 529, 529, 529, 404, - 419, 339, 340, 576, 998, 578, 579, 579, 579, 579, - 389, 390, 411, 389, 412, 411, 414, 576, 243, 598, - 997, 581, 414, 581, 599, 244, 582, 582, 582, 582, - 414, 996, 246, 576, 389, 390, 977, 424, 424, 424, - 424, 817, 818, 427, 995, 423, 423, 423, 423, 698, - 584, 584, 584, 584, 288, 436, 429, 436, 436, 584, - 584, 584, 438, 994, 438, 438, 439, 439, 439, 439, - - 339, 340, 429, 584, 584, 584, 584, 584, 584, 388, - 388, 389, 390, 388, 388, 388, 388, 388, 388, 388, - 388, 388, 388, 388, 408, 388, 388, 408, 408, 408, - 408, 409, 388, 388, 388, 408, 408, 408, 408, 408, - 408, 408, 408, 408, 408, 408, 408, 408, 388, 408, - 408, 408, 408, 408, 408, 408, 408, 408, 408, 408, - 408, 408, 408, 408, 408, 408, 408, 408, 408, 408, - 408, 388, 388, 414, 262, 263, 288, 414, 440, 440, - 440, 440, 441, 441, 441, 441, 364, 365, 424, 424, - 424, 424, 592, 592, 592, 592, 414, 339, 701, 589, - - 686, 320, 243, 589, 687, 651, 594, 993, 594, 244, - 693, 595, 595, 595, 595, 589, 246, 339, 705, 589, - 414, 442, 442, 442, 442, 602, 702, 602, 992, 662, - 603, 603, 603, 603, 714, 597, 597, 597, 597, 468, - 468, 468, 468, 991, 597, 597, 597, 656, 339, 340, - 443, 471, 471, 471, 471, 546, 546, 546, 597, 597, - 597, 597, 597, 597, 413, 413, 443, 414, 413, 413, - 413, 413, 413, 413, 413, 413, 413, 413, 413, 990, - 413, 413, 471, 471, 471, 471, 434, 413, 413, 413, - 243, 243, 243, 528, 528, 528, 528, 244, 244, 244, - - 978, 243, 1013, 413, 246, 246, 246, 243, 244, 975, - 243, 364, 721, 679, 244, 246, 243, 244, 339, 340, - 718, 246, 750, 244, 246, 974, 413, 413, 413, 413, - 246, 414, 413, 413, 413, 413, 413, 413, 413, 413, - 413, 413, 413, 657, 413, 413, 680, 661, 660, 244, - 434, 413, 413, 413, 658, 751, 288, 973, 659, 514, - 514, 514, 514, 513, 670, 972, 670, 413, 699, 671, - 671, 671, 671, 389, 737, 525, 525, 525, 525, 320, - 668, 971, 734, 651, 669, 601, 522, 980, 693, 1012, - 413, 413, 528, 528, 528, 528, 970, 542, 542, 542, - - 542, 756, 522, 530, 530, 530, 530, 969, 539, 339, - 707, 243, 530, 530, 530, 688, 358, 688, 244, 894, - 689, 689, 689, 689, 539, 246, 530, 530, 530, 530, - 530, 530, 293, 293, 757, 293, 293, 293, 293, 293, - 293, 293, 293, 293, 293, 293, 293, 310, 293, 293, - 310, 310, 310, 310, 311, 293, 293, 293, 310, 310, - 310, 310, 310, 310, 310, 310, 310, 310, 310, 310, - 310, 293, 310, 310, 310, 310, 310, 310, 681, 310, - 310, 310, 682, 310, 310, 310, 310, 310, 310, 310, - 310, 310, 310, 310, 293, 293, 545, 545, 545, 545, - - 545, 545, 545, 545, 547, 547, 547, 547, 339, 340, - 364, 365, 968, 547, 547, 547, 603, 603, 603, 603, - 603, 603, 603, 603, 554, 554, 967, 547, 547, 547, - 547, 547, 547, 320, 320, 320, 320, 320, 320, 966, - 320, 320, 320, 320, 320, 320, 320, 320, 334, 320, - 320, 334, 334, 334, 334, 335, 320, 320, 320, 334, - 334, 334, 334, 334, 334, 334, 334, 334, 334, 334, - 334, 334, 320, 334, 334, 334, 334, 334, 334, 694, - 334, 334, 334, 695, 334, 334, 334, 334, 334, 334, - 334, 334, 334, 334, 334, 320, 320, 339, 340, 339, - - 701, 339, 340, 702, 749, 339, 340, 750, 696, 965, - 696, 364, 365, 697, 697, 697, 697, 553, 553, 553, - 553, 556, 556, 556, 556, 339, 340, 964, 550, 339, - 340, 364, 717, 339, 707, 963, 703, 708, 364, 365, - 751, 557, 557, 557, 550, 556, 556, 556, 556, 339, - 340, 962, 244, 244, 567, 567, 389, 390, 961, 288, - 288, 715, 364, 365, 960, 558, 558, 558, 558, 414, - 709, 959, 580, 580, 558, 558, 558, 958, 569, 569, - 569, 569, 364, 365, 593, 593, 811, 812, 558, 558, - 558, 558, 558, 558, 338, 338, 339, 340, 338, 338, - - 338, 338, 338, 338, 338, 338, 338, 338, 338, 358, - 338, 338, 358, 358, 358, 358, 359, 338, 338, 338, - 358, 358, 358, 358, 358, 358, 358, 358, 358, 358, - 358, 358, 358, 338, 358, 358, 358, 358, 358, 358, - 710, 358, 358, 358, 711, 358, 358, 358, 358, 358, - 358, 358, 358, 358, 358, 358, 338, 338, 364, 365, - 364, 717, 364, 365, 718, 755, 364, 365, 756, 712, - 957, 712, 389, 390, 713, 713, 713, 713, 566, 566, - 566, 566, 569, 569, 569, 569, 364, 365, 956, 563, - 364, 723, 389, 390, 724, 364, 723, 719, 389, 390, - - 955, 757, 570, 570, 570, 563, 364, 365, 954, 728, - 953, 728, 389, 390, 729, 729, 729, 729, 389, 390, - 730, 949, 571, 571, 571, 571, 929, 725, 583, 583, - 583, 571, 571, 571, 582, 582, 582, 582, 671, 671, - 671, 671, 731, 389, 390, 571, 571, 571, 571, 571, - 571, 363, 363, 364, 365, 363, 363, 363, 363, 363, - 363, 363, 363, 363, 363, 363, 383, 363, 363, 383, - 383, 383, 383, 384, 363, 363, 363, 383, 383, 383, - 383, 383, 383, 383, 383, 383, 383, 383, 383, 383, - 363, 383, 383, 383, 383, 383, 383, 726, 383, 383, - - 383, 727, 383, 383, 383, 383, 383, 383, 383, 383, - 383, 383, 383, 363, 363, 389, 390, 389, 733, 389, - 390, 734, 389, 733, 389, 739, 389, 390, 740, 414, - 928, 579, 579, 579, 579, 582, 582, 582, 582, 744, - 414, 744, 576, 927, 745, 745, 745, 745, 414, 339, - 340, 926, 414, 925, 735, 596, 596, 596, 576, 389, - 390, 741, 924, 592, 592, 592, 592, 595, 595, 595, - 595, 389, 739, 243, 589, 584, 584, 584, 584, 414, - 244, 923, 339, 705, 584, 584, 584, 246, 805, 263, - 589, 702, 827, 922, 595, 595, 595, 595, 584, 584, - - 584, 584, 584, 584, 388, 388, 389, 390, 388, 388, - 388, 388, 388, 388, 388, 388, 388, 388, 388, 408, - 388, 388, 408, 408, 408, 408, 409, 388, 388, 388, - 408, 408, 408, 408, 408, 408, 408, 408, 408, 408, - 408, 408, 408, 388, 408, 408, 408, 408, 408, 408, - 742, 408, 408, 408, 743, 408, 408, 408, 408, 408, - 408, 408, 408, 408, 408, 408, 388, 388, 414, 671, - 671, 671, 671, 243, 689, 689, 689, 689, 310, 887, - 244, 339, 340, 597, 597, 597, 597, 246, 689, 689, - 689, 689, 597, 597, 597, 339, 705, 697, 697, 697, - - 697, 334, 891, 921, 702, 920, 597, 597, 597, 597, - 597, 597, 413, 413, 801, 414, 413, 413, 413, 413, - 413, 413, 413, 413, 413, 413, 413, 433, 413, 413, - 433, 433, 433, 433, 434, 413, 413, 413, 433, 433, - 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, - 433, 413, 433, 433, 433, 433, 433, 433, 758, 433, - 433, 433, 759, 433, 433, 433, 433, 433, 433, 433, - 433, 433, 433, 433, 413, 413, 243, 243, 243, 339, - 340, 339, 340, 244, 244, 244, 364, 365, 339, 340, - 246, 246, 246, 364, 365, 697, 697, 697, 697, 364, - - 721, 919, 713, 713, 713, 713, 364, 721, 718, 713, - 713, 713, 713, 389, 737, 718, 918, 802, 339, 340, - 383, 803, 734, 896, 828, 939, 804, 293, 293, 334, - 293, 293, 293, 293, 293, 293, 293, 293, 293, 293, - 293, 293, 310, 293, 293, 310, 310, 310, 310, 311, - 293, 293, 293, 310, 310, 310, 310, 310, 310, 310, - 310, 310, 310, 310, 310, 310, 293, 310, 310, 310, - 310, 310, 310, 310, 310, 310, 815, 310, 310, 310, - 310, 310, 310, 310, 310, 310, 310, 310, 310, 293, - 293, 320, 320, 320, 320, 320, 320, 917, 320, 320, - - 320, 320, 320, 320, 320, 320, 334, 320, 320, 334, - 334, 334, 334, 335, 320, 320, 320, 334, 334, 334, - 334, 334, 334, 334, 334, 334, 334, 334, 334, 334, - 320, 334, 334, 334, 334, 334, 334, 334, 334, 334, - 825, 334, 334, 334, 334, 334, 334, 334, 334, 334, - 334, 334, 334, 320, 320, 339, 701, 339, 701, 702, - 414, 702, 339, 707, 339, 707, 708, 916, 708, 389, - 390, 846, 389, 737, 915, 745, 745, 745, 745, 389, - 390, 734, 977, 847, 914, 729, 729, 729, 729, 848, - 358, 893, 703, 244, 703, 729, 729, 729, 729, 709, - - 288, 709, 338, 338, 339, 340, 338, 338, 338, 338, - 338, 338, 338, 338, 338, 338, 338, 358, 338, 338, - 358, 358, 358, 358, 359, 338, 338, 338, 358, 358, - 358, 358, 358, 358, 358, 358, 358, 358, 358, 358, - 358, 338, 358, 358, 358, 358, 358, 358, 358, 358, - 358, 829, 358, 358, 358, 358, 358, 358, 358, 358, - 358, 358, 358, 358, 338, 338, 364, 365, 364, 365, - 364, 717, 389, 390, 718, 364, 717, 364, 723, 718, - 414, 724, 364, 723, 913, 860, 724, 364, 365, 364, - 365, 383, 895, 389, 390, 745, 745, 745, 745, 861, - - 389, 390, 408, 897, 940, 862, 912, 719, 334, 831, - 408, 832, 719, 898, 725, 835, 433, 899, 911, 725, - 363, 363, 364, 365, 363, 363, 363, 363, 363, 363, - 363, 363, 363, 363, 363, 383, 363, 363, 383, 383, - 383, 383, 384, 363, 363, 363, 383, 383, 383, 383, - 383, 383, 383, 383, 383, 383, 383, 383, 383, 363, - 383, 383, 383, 383, 383, 383, 383, 383, 383, 833, - 383, 383, 383, 383, 383, 383, 383, 383, 383, 383, - 383, 383, 363, 363, 389, 390, 389, 733, 389, 733, - 734, 244, 734, 389, 739, 389, 739, 740, 288, 740, - - 433, 243, 243, 900, 932, 910, 932, 932, 244, 244, - 941, 414, 989, 942, 358, 246, 246, 358, 943, 909, - 944, 908, 383, 735, 383, 735, 885, 836, 414, 988, - 741, 1017, 741, 388, 388, 389, 390, 388, 388, 388, - 388, 388, 388, 388, 388, 388, 388, 388, 408, 388, - 388, 408, 408, 408, 408, 409, 388, 388, 388, 408, - 408, 408, 408, 408, 408, 408, 408, 408, 408, 408, - 408, 408, 388, 408, 408, 408, 408, 408, 408, 408, - 408, 408, 837, 408, 408, 408, 408, 408, 408, 408, - 408, 408, 408, 408, 408, 388, 388, 749, 755, 244, - - 750, 756, 244, 945, 946, 950, 288, 408, 408, 288, - 947, 948, 339, 340, 433, 433, 932, 951, 932, 932, - 339, 340, 982, 952, 1014, 339, 340, 983, 907, 933, - 364, 365, 934, 751, 757, 413, 413, 906, 414, 413, - 413, 413, 413, 413, 413, 413, 413, 413, 413, 413, - 433, 413, 413, 433, 433, 433, 433, 434, 413, 413, - 413, 433, 433, 433, 433, 433, 433, 433, 433, 433, - 433, 433, 433, 433, 413, 433, 433, 433, 433, 433, - 433, 433, 433, 433, 841, 433, 433, 433, 433, 433, - 433, 433, 433, 433, 433, 433, 433, 413, 413, 243, - - 243, 243, 243, 905, 980, 244, 244, 244, 244, 244, - 243, 243, 288, 246, 246, 246, 246, 244, 244, 976, - 981, 982, 983, 243, 246, 246, 984, 977, 985, 986, - 244, 243, 987, 988, 989, 389, 390, 246, 244, 904, - 882, 880, 886, 903, 881, 246, 902, 930, 931, 334, - 883, 364, 365, 984, 901, 1015, 364, 365, 985, 389, - 390, 986, 414, 1016, 414, 334, 358, 358, 389, 390, - 987, 383, 817, 383, 408, 884, 879, 408, 433, 433, - 182, 878, 182, 182, 182, 182, 182, 182, 182, 182, - 182, 185, 877, 876, 185, 185, 193, 875, 193, 193, - - 193, 193, 193, 193, 193, 193, 193, 245, 245, 245, - 245, 245, 245, 245, 245, 261, 261, 261, 261, 261, - 261, 261, 261, 261, 261, 261, 280, 280, 280, 280, - 283, 874, 283, 873, 283, 283, 283, 283, 287, 287, - 287, 287, 287, 287, 287, 293, 872, 293, 293, 293, - 293, 293, 293, 293, 293, 293, 295, 871, 295, 295, - 295, 295, 295, 295, 295, 295, 295, 298, 870, 298, - 298, 298, 298, 298, 298, 298, 298, 298, 310, 869, - 310, 310, 310, 310, 310, 310, 310, 310, 310, 244, - 244, 244, 244, 244, 244, 244, 320, 320, 868, 320, - - 320, 320, 320, 320, 320, 320, 320, 321, 321, 321, - 321, 321, 321, 321, 321, 321, 321, 321, 334, 334, - 867, 334, 334, 334, 334, 334, 334, 334, 334, 338, - 338, 338, 338, 338, 338, 338, 338, 338, 338, 338, - 341, 341, 341, 341, 341, 341, 341, 341, 341, 341, - 341, 345, 345, 345, 345, 345, 345, 345, 345, 345, - 345, 345, 363, 363, 363, 363, 363, 363, 363, 363, - 363, 363, 363, 366, 366, 366, 366, 366, 366, 366, - 366, 366, 366, 366, 370, 370, 370, 370, 370, 370, - 370, 370, 370, 370, 370, 388, 388, 388, 388, 388, - - 388, 388, 388, 388, 388, 388, 391, 391, 391, 391, - 391, 391, 391, 391, 391, 391, 391, 395, 395, 395, - 395, 395, 395, 395, 395, 395, 395, 395, 413, 866, - 413, 413, 413, 413, 413, 413, 413, 413, 413, 416, - 865, 416, 416, 416, 416, 416, 416, 416, 416, 416, - 420, 864, 420, 420, 420, 420, 420, 420, 420, 420, - 420, 433, 863, 433, 433, 433, 433, 433, 433, 433, - 433, 433, 185, 859, 858, 185, 185, 193, 857, 193, - 193, 193, 193, 193, 193, 193, 193, 193, 444, 856, - 855, 444, 444, 444, 473, 854, 853, 473, 244, 244, - - 244, 244, 244, 244, 244, 245, 245, 245, 245, 245, - 245, 245, 245, 261, 261, 261, 261, 261, 261, 261, - 261, 261, 261, 261, 512, 512, 512, 512, 512, 512, - 515, 515, 515, 515, 516, 852, 516, 516, 516, 516, - 287, 287, 287, 287, 287, 287, 287, 293, 851, 293, - 293, 293, 293, 293, 293, 293, 293, 293, 295, 850, - 295, 295, 295, 295, 295, 295, 295, 295, 295, 298, - 849, 298, 298, 298, 298, 298, 298, 298, 298, 298, - 310, 845, 310, 310, 310, 310, 310, 310, 310, 310, - 310, 320, 320, 844, 320, 320, 320, 320, 320, 320, - - 320, 320, 321, 321, 321, 321, 321, 321, 321, 321, - 321, 321, 321, 334, 334, 843, 334, 334, 334, 334, - 334, 334, 334, 334, 338, 338, 338, 338, 338, 338, - 338, 338, 338, 338, 338, 341, 341, 341, 341, 341, - 341, 341, 341, 341, 341, 341, 345, 345, 345, 345, - 345, 345, 345, 345, 345, 345, 345, 363, 363, 363, - 363, 363, 363, 363, 363, 363, 363, 363, 366, 366, - 366, 366, 366, 366, 366, 366, 366, 366, 366, 370, - 370, 370, 370, 370, 370, 370, 370, 370, 370, 370, - 388, 388, 388, 388, 388, 388, 388, 388, 388, 388, - - 388, 391, 391, 391, 391, 391, 391, 391, 391, 391, - 391, 391, 395, 395, 395, 395, 395, 395, 395, 395, - 395, 395, 395, 413, 842, 413, 413, 413, 413, 413, - 413, 413, 413, 413, 416, 755, 416, 416, 416, 416, - 416, 416, 416, 416, 416, 420, 414, 420, 420, 420, - 420, 420, 420, 420, 420, 420, 433, 750, 433, 433, - 433, 433, 433, 433, 433, 433, 433, 185, 749, 414, - 185, 185, 444, 838, 834, 444, 444, 444, 473, 830, - 826, 473, 648, 824, 648, 648, 648, 648, 648, 648, - 648, 648, 648, 651, 823, 651, 651, 651, 651, 651, - - 651, 651, 651, 651, 653, 820, 653, 653, 653, 653, - 653, 653, 653, 653, 653, 245, 245, 245, 245, 245, - 245, 245, 245, 261, 261, 261, 261, 261, 261, 261, - 261, 261, 261, 261, 512, 512, 512, 512, 512, 512, - 663, 819, 663, 663, 663, 663, 516, 816, 516, 516, - 516, 516, 287, 287, 287, 287, 287, 287, 287, 293, - 675, 293, 293, 293, 293, 293, 293, 293, 293, 293, - 674, 814, 674, 674, 674, 674, 674, 674, 674, 674, - 674, 677, 813, 677, 677, 677, 677, 677, 677, 677, - 677, 677, 678, 810, 678, 678, 678, 678, 678, 678, - - 678, 678, 678, 244, 244, 244, 244, 244, 244, 244, - 320, 320, 809, 320, 320, 320, 320, 320, 320, 320, - 320, 692, 692, 692, 692, 692, 692, 692, 692, 692, - 692, 692, 338, 338, 338, 338, 338, 338, 338, 338, - 338, 338, 338, 700, 700, 700, 700, 700, 700, 700, - 700, 700, 700, 700, 704, 704, 704, 704, 704, 704, - 704, 704, 704, 704, 704, 706, 706, 706, 706, 706, - 706, 706, 706, 706, 706, 706, 363, 363, 363, 363, - 363, 363, 363, 363, 363, 363, 363, 716, 716, 716, - 716, 716, 716, 716, 716, 716, 716, 716, 720, 720, - - 720, 720, 720, 720, 720, 720, 720, 720, 720, 722, - 722, 722, 722, 722, 722, 722, 722, 722, 722, 722, - 388, 388, 388, 388, 388, 388, 388, 388, 388, 388, - 388, 732, 732, 732, 732, 732, 732, 732, 732, 732, - 732, 732, 736, 736, 736, 736, 736, 736, 736, 736, - 736, 736, 736, 738, 738, 738, 738, 738, 738, 738, - 738, 738, 738, 738, 413, 808, 413, 413, 413, 413, - 413, 413, 413, 413, 413, 748, 807, 748, 748, 748, - 748, 748, 748, 748, 748, 748, 752, 649, 752, 752, - 752, 752, 752, 752, 752, 752, 752, 754, 800, 754, - - 754, 754, 754, 754, 754, 754, 754, 754, 444, 799, - 798, 444, 444, 444, 648, 797, 648, 648, 648, 648, - 648, 648, 648, 648, 648, 651, 796, 651, 651, 651, - 651, 651, 651, 651, 651, 651, 653, 793, 653, 653, - 653, 653, 653, 653, 653, 653, 653, 245, 245, 245, - 245, 245, 245, 245, 245, 261, 261, 261, 261, 261, - 261, 261, 261, 261, 261, 261, 663, 792, 663, 663, - 663, 663, 516, 791, 516, 516, 516, 516, 287, 287, - 287, 287, 287, 287, 287, 293, 790, 293, 293, 293, - 293, 293, 293, 293, 293, 293, 674, 789, 674, 674, - - 674, 674, 674, 674, 674, 674, 674, 677, 788, 677, - 677, 677, 677, 677, 677, 677, 677, 677, 678, 787, - 678, 678, 678, 678, 678, 678, 678, 678, 678, 244, - 244, 244, 244, 244, 244, 244, 320, 320, 786, 320, - 320, 320, 320, 320, 320, 320, 320, 692, 692, 692, - 692, 692, 692, 692, 692, 692, 692, 692, 338, 338, - 338, 338, 338, 338, 338, 338, 338, 338, 338, 700, - 700, 700, 700, 700, 700, 700, 700, 700, 700, 700, - 704, 704, 704, 704, 704, 704, 704, 704, 704, 704, - 704, 706, 706, 706, 706, 706, 706, 706, 706, 706, - - 706, 706, 363, 363, 363, 363, 363, 363, 363, 363, - 363, 363, 363, 716, 716, 716, 716, 716, 716, 716, - 716, 716, 716, 716, 720, 720, 720, 720, 720, 720, - 720, 720, 720, 720, 720, 722, 722, 722, 722, 722, - 722, 722, 722, 722, 722, 722, 388, 388, 388, 388, - 388, 388, 388, 388, 388, 388, 388, 732, 732, 732, - 732, 732, 732, 732, 732, 732, 732, 732, 736, 736, - 736, 736, 736, 736, 736, 736, 736, 736, 736, 738, - 738, 738, 738, 738, 738, 738, 738, 738, 738, 738, - 413, 785, 413, 413, 413, 413, 413, 413, 413, 413, - - 413, 748, 784, 748, 748, 748, 748, 748, 748, 748, - 748, 748, 752, 783, 752, 752, 752, 752, 752, 752, - 752, 752, 752, 754, 782, 754, 754, 754, 754, 754, - 754, 754, 754, 754, 444, 781, 780, 444, 444, 444, - 245, 245, 245, 245, 245, 245, 245, 245, 261, 261, - 261, 261, 261, 261, 261, 261, 261, 261, 261, 516, - 779, 516, 516, 516, 516, 287, 287, 287, 287, 287, - 287, 287, 778, 777, 776, 775, 774, 773, 772, 771, - 770, 769, 768, 767, 766, 765, 764, 763, 762, 761, - 760, 691, 690, 685, 684, 683, 675, 673, 672, 667, - - 666, 665, 664, 513, 632, 617, 613, 652, 649, 647, - 646, 645, 644, 643, 642, 641, 640, 639, 638, 637, - 636, 635, 631, 630, 629, 628, 627, 626, 625, 624, - 623, 622, 621, 620, 619, 616, 615, 612, 611, 610, - 609, 608, 607, 606, 605, 604, 418, 417, 414, 414, - 588, 575, 562, 498, 541, 540, 537, 536, 535, 533, - 524, 523, 296, 498, 518, 517, 513, 487, 485, 461, - 509, 449, 498, 288, 497, 491, 488, 476, 475, 474, - 467, 466, 465, 462, 459, 458, 454, 451, 450, 447, - 446, 445, 183, 415, 414, 410, 385, 360, 333, 288, - - 314, 309, 296, 294, 275, 183, 275, 183, 190, 181, - 1046, 23, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, - 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, - 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, - 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, - 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, - 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, - 1046, 1046, 1046, 1046, 1046, 1046 + 217, 202, 202, 202, 218, 221, 244, 197, 197, 197, + 197, 1046, 244, 245, 245, 244, 244, 222, 223, 245, + 247, 289, 245, 245, 224, 245, 247, 225, 183, 247, + 247, 222, 289, 221, 223, 197, 197, 197, 197, 415, + 244, 277, 224, 277, 277, 1045, 223, 245, 415, 225, + + 248, 248, 248, 248, 247, 291, 252, 249, 253, 433, + 256, 184, 223, 226, 314, 227, 314, 314, 228, 464, + 244, 229, 230, 231, 232, 233, 234, 245, 235, 236, + 244, 237, 465, 261, 247, 261, 261, 245, 261, 180, + 261, 261, 340, 341, 247, 749, 263, 264, 179, 268, + 180, 268, 268, 179, 263, 264, 244, 196, 250, 197, + 197, 197, 197, 245, 251, 226, 1044, 254, 265, 266, + 247, 263, 264, 273, 230, 231, 274, 275, 234, 255, + 282, 236, 282, 237, 282, 282, 480, 267, 1049, 277, + 180, 277, 277, 254, 481, 267, 278, 279, 280, 278, + + 278, 279, 280, 278, 340, 341, 202, 269, 461, 202, + 462, 202, 267, 270, 271, 183, 340, 341, 272, 202, + 202, 202, 283, 289, 196, 202, 197, 197, 197, 197, + 365, 366, 200, 200, 200, 200, 221, 358, 197, 197, + 197, 197, 292, 279, 293, 292, 940, 245, 184, 223, + 290, 290, 290, 290, 289, 292, 279, 293, 292, 285, + 286, 365, 366, 482, 287, 223, 300, 483, 301, 301, + 301, 301, 302, 302, 302, 302, 314, 295, 314, 314, + 484, 294, 1043, 200, 200, 200, 200, 320, 294, 320, + 320, 294, 340, 347, 1042, 294, 318, 318, 318, 318, + + 303, 344, 390, 391, 304, 305, 294, 301, 301, 301, + 301, 316, 321, 294, 494, 317, 193, 306, 307, 495, + 338, 323, 338, 338, 308, 390, 391, 309, 340, 343, + 1041, 306, 344, 324, 307, 325, 325, 325, 325, 365, + 372, 289, 308, 362, 340, 363, 362, 533, 369, 309, + 294, 294, 534, 294, 294, 294, 294, 294, 294, 294, + 294, 294, 294, 294, 294, 345, 294, 294, 326, 326, + 326, 326, 312, 294, 294, 294, 540, 221, 321, 318, + 318, 318, 318, 1040, 339, 321, 365, 366, 321, 294, + 223, 339, 321, 456, 339, 615, 327, 457, 339, 418, + + 328, 458, 419, 321, 470, 470, 223, 383, 415, 339, + 321, 616, 294, 294, 294, 294, 339, 294, 294, 294, + 294, 294, 294, 294, 294, 294, 294, 294, 294, 494, + 294, 294, 340, 341, 495, 420, 312, 294, 294, 294, + 362, 340, 363, 362, 340, 341, 348, 496, 349, 349, + 349, 349, 485, 294, 592, 365, 366, 390, 397, 313, + 350, 350, 350, 350, 365, 368, 394, 486, 369, 373, + 1039, 374, 374, 374, 374, 487, 294, 294, 329, 488, + 325, 325, 325, 325, 387, 365, 388, 387, 351, 364, + 330, 331, 352, 494, 365, 366, 364, 332, 550, 364, + + 333, 370, 979, 364, 330, 478, 479, 331, 390, 391, + 375, 375, 375, 375, 364, 332, 387, 365, 388, 387, + 289, 364, 333, 321, 321, 321, 321, 321, 321, 408, + 321, 321, 321, 321, 321, 321, 321, 321, 376, 321, + 321, 437, 377, 438, 437, 336, 321, 321, 321, 390, + 391, 412, 390, 413, 412, 980, 390, 393, 390, 391, + 394, 415, 321, 398, 1038, 399, 399, 399, 399, 412, + 390, 413, 412, 289, 400, 400, 400, 400, 437, 416, + 437, 437, 473, 473, 473, 321, 321, 321, 321, 321, + 321, 321, 321, 395, 321, 321, 321, 321, 321, 321, + + 321, 321, 401, 321, 321, 289, 402, 593, 389, 336, + 321, 321, 321, 415, 439, 389, 439, 439, 389, 490, + 297, 415, 389, 497, 498, 1037, 321, 491, 425, 425, + 425, 425, 337, 389, 423, 893, 424, 424, 424, 424, + 389, 244, 619, 178, 620, 178, 178, 414, 245, 321, + 321, 340, 341, 298, 414, 247, 426, 414, 179, 245, + 427, 414, 263, 264, 1036, 353, 289, 349, 349, 349, + 349, 1035, 414, 440, 440, 440, 440, 354, 355, 414, + 441, 441, 441, 441, 356, 244, 261, 357, 261, 261, + 1034, 354, 245, 814, 355, 442, 442, 442, 442, 247, + + 415, 179, 356, 443, 443, 443, 443, 263, 264, 357, + 339, 339, 340, 341, 339, 339, 339, 339, 339, 339, + 339, 339, 339, 339, 339, 359, 339, 339, 359, 359, + 359, 359, 360, 339, 339, 339, 359, 359, 359, 359, + 359, 359, 359, 359, 359, 359, 359, 359, 359, 339, + 359, 359, 359, 359, 359, 359, 359, 359, 359, 359, + 359, 359, 359, 359, 359, 359, 359, 359, 359, 359, + 359, 359, 339, 339, 365, 366, 200, 200, 200, 200, + 263, 264, 221, 1033, 197, 197, 197, 197, 378, 1032, + 374, 374, 374, 374, 1031, 223, 263, 264, 478, 513, + + 379, 380, 200, 200, 200, 200, 268, 381, 268, 268, + 382, 223, 521, 444, 379, 938, 471, 380, 471, 311, + 522, 472, 472, 472, 472, 381, 528, 528, 277, 444, + 277, 277, 382, 364, 364, 365, 366, 364, 364, 364, + 364, 364, 364, 364, 364, 364, 364, 364, 384, 364, + 364, 384, 384, 384, 384, 385, 364, 364, 364, 384, + 384, 384, 384, 384, 384, 384, 384, 384, 384, 384, + 384, 384, 364, 384, 384, 384, 384, 384, 384, 384, + 384, 384, 384, 384, 384, 384, 384, 384, 384, 384, + 384, 384, 384, 384, 384, 364, 364, 390, 391, 469, + + 469, 469, 469, 545, 545, 244, 278, 279, 280, 278, + 444, 403, 245, 399, 399, 399, 399, 1030, 244, 247, + 531, 531, 531, 404, 405, 245, 444, 548, 548, 548, + 406, 244, 247, 407, 340, 341, 311, 404, 245, 891, + 405, 501, 501, 501, 501, 247, 340, 341, 406, 278, + 279, 280, 278, 506, 502, 407, 389, 389, 390, 391, + 389, 389, 389, 389, 389, 389, 389, 389, 389, 389, + 389, 409, 389, 389, 409, 409, 409, 409, 410, 389, + 389, 389, 409, 409, 409, 409, 409, 409, 409, 409, + 409, 409, 409, 409, 409, 389, 409, 409, 409, 409, + + 409, 409, 409, 409, 409, 409, 409, 409, 409, 409, + 409, 409, 409, 409, 409, 409, 409, 409, 389, 389, + 415, 245, 456, 340, 341, 244, 457, 244, 289, 289, + 512, 1029, 245, 428, 245, 424, 424, 424, 424, 247, + 314, 247, 314, 314, 418, 429, 430, 419, 263, 264, + 335, 244, 431, 895, 244, 432, 824, 244, 245, 429, + 419, 245, 430, 523, 245, 247, 340, 343, 247, 1028, + 431, 247, 365, 366, 503, 1027, 507, 432, 414, 414, + 420, 415, 414, 414, 414, 414, 414, 414, 414, 414, + 414, 414, 414, 420, 414, 414, 504, 505, 508, 509, + + 435, 414, 414, 414, 510, 516, 516, 516, 516, 515, + 292, 279, 293, 292, 415, 245, 289, 414, 290, 290, + 290, 290, 289, 292, 279, 293, 292, 302, 302, 302, + 302, 305, 1026, 301, 301, 301, 301, 365, 366, 941, + 414, 414, 414, 414, 307, 415, 414, 414, 414, 414, + 414, 414, 414, 414, 414, 414, 414, 1025, 414, 414, + 307, 340, 341, 750, 435, 414, 414, 414, 302, 302, + 302, 302, 527, 527, 527, 527, 321, 556, 556, 524, + 193, 414, 1024, 524, 529, 323, 529, 436, 1023, 530, + 530, 530, 530, 1022, 320, 524, 320, 320, 221, 524, + + 318, 318, 318, 318, 414, 414, 532, 532, 532, 532, + 338, 223, 338, 338, 415, 532, 532, 532, 326, 326, + 326, 326, 340, 341, 340, 343, 563, 223, 344, 532, + 532, 532, 532, 532, 532, 294, 294, 1021, 294, 294, + 294, 294, 294, 294, 294, 294, 294, 294, 294, 294, + 289, 294, 294, 984, 340, 347, 842, 312, 294, 294, + 294, 345, 329, 344, 325, 325, 325, 325, 326, 326, + 326, 326, 365, 366, 294, 331, 546, 825, 546, 541, + 634, 547, 547, 547, 547, 340, 347, 635, 340, 343, + 636, 331, 344, 422, 344, 541, 982, 294, 294, 294, + + 294, 419, 294, 294, 294, 294, 294, 294, 294, 294, + 294, 294, 294, 294, 980, 294, 294, 544, 544, 544, + 544, 312, 294, 294, 294, 345, 365, 368, 541, 340, + 341, 340, 341, 340, 341, 340, 341, 1014, 294, 365, + 368, 340, 341, 369, 541, 350, 350, 350, 350, 390, + 391, 559, 559, 559, 1013, 353, 536, 349, 349, 349, + 349, 294, 294, 549, 549, 549, 549, 756, 355, 756, + 365, 372, 549, 549, 549, 753, 370, 753, 553, 369, + 554, 365, 366, 1012, 355, 576, 549, 549, 549, 549, + 549, 549, 321, 321, 321, 321, 321, 321, 1011, 321, + + 321, 321, 321, 321, 321, 321, 321, 1010, 321, 321, + 340, 341, 390, 391, 336, 321, 321, 321, 362, 340, + 363, 362, 340, 341, 365, 366, 350, 350, 350, 350, + 1009, 321, 939, 557, 289, 557, 311, 552, 558, 558, + 558, 558, 340, 341, 390, 391, 561, 362, 340, 363, + 362, 562, 415, 552, 321, 321, 321, 321, 321, 321, + 321, 321, 892, 321, 321, 321, 321, 321, 321, 321, + 321, 566, 321, 321, 340, 341, 390, 393, 336, 321, + 321, 321, 365, 366, 1008, 365, 368, 365, 372, 369, + 555, 555, 555, 555, 843, 321, 369, 387, 365, 388, + + 387, 552, 365, 366, 470, 470, 574, 365, 366, 390, + 391, 575, 1007, 551, 365, 366, 652, 552, 321, 321, + 340, 341, 370, 375, 375, 375, 375, 415, 378, 567, + 374, 374, 374, 374, 365, 366, 560, 560, 560, 560, + 942, 380, 595, 595, 335, 560, 560, 560, 1006, 653, + 569, 569, 387, 365, 388, 387, 579, 380, 1005, 560, + 560, 560, 560, 560, 560, 339, 339, 340, 341, 339, + 339, 339, 339, 339, 339, 339, 339, 339, 339, 339, + 359, 339, 339, 359, 359, 359, 359, 360, 339, 339, + 339, 359, 359, 359, 359, 359, 359, 359, 359, 359, + + 359, 359, 359, 359, 339, 359, 359, 359, 359, 359, + 359, 359, 359, 359, 359, 359, 359, 359, 359, 359, + 359, 359, 359, 359, 359, 359, 359, 339, 339, 365, + 366, 390, 393, 365, 366, 394, 657, 365, 366, 1004, + 390, 393, 528, 528, 394, 375, 375, 375, 375, 568, + 568, 568, 568, 572, 572, 572, 565, 390, 397, 678, + 565, 1003, 365, 366, 390, 391, 394, 1002, 395, 658, + 390, 391, 565, 570, 1001, 570, 565, 395, 571, 571, + 571, 571, 365, 366, 390, 397, 400, 400, 400, 400, + 390, 391, 679, 394, 589, 1000, 390, 391, 573, 573, + + 573, 573, 390, 391, 473, 473, 473, 573, 573, 573, + 999, 580, 582, 582, 412, 390, 413, 412, 585, 585, + 585, 573, 573, 573, 573, 573, 573, 364, 364, 365, + 366, 364, 364, 364, 364, 364, 364, 364, 364, 364, + 364, 364, 384, 364, 364, 384, 384, 384, 384, 385, + 364, 364, 364, 384, 384, 384, 384, 384, 384, 384, + 384, 384, 384, 384, 384, 384, 364, 384, 384, 384, + 384, 384, 384, 384, 384, 384, 384, 384, 384, 384, + 384, 384, 384, 384, 384, 384, 384, 384, 384, 364, + 364, 390, 391, 390, 391, 390, 391, 587, 412, 390, + + 413, 412, 588, 359, 415, 403, 897, 399, 399, 399, + 399, 400, 400, 400, 400, 415, 682, 998, 405, 598, + 598, 598, 578, 390, 391, 437, 652, 438, 437, 997, + 425, 425, 425, 425, 405, 390, 391, 657, 578, 581, + 581, 581, 581, 545, 545, 415, 583, 996, 583, 683, + 578, 584, 584, 584, 584, 531, 531, 531, 428, 653, + 424, 424, 424, 424, 415, 995, 578, 390, 391, 415, + 658, 430, 600, 994, 596, 384, 596, 601, 899, 597, + 597, 597, 597, 586, 586, 586, 586, 430, 437, 244, + 437, 437, 586, 586, 586, 439, 245, 439, 439, 440, + + 440, 440, 440, 247, 808, 809, 586, 586, 586, 586, + 586, 586, 389, 389, 390, 391, 389, 389, 389, 389, + 389, 389, 389, 389, 389, 389, 389, 409, 389, 389, + 409, 409, 409, 409, 410, 389, 389, 389, 409, 409, + 409, 409, 409, 409, 409, 409, 409, 409, 409, 409, + 409, 389, 409, 409, 409, 409, 409, 409, 409, 409, + 409, 409, 409, 409, 409, 409, 409, 409, 409, 409, + 409, 409, 409, 409, 389, 389, 415, 289, 340, 341, + 415, 441, 441, 441, 441, 442, 442, 442, 442, 340, + 341, 425, 425, 425, 425, 594, 594, 594, 594, 263, + + 264, 689, 591, 820, 821, 690, 591, 443, 443, 443, + 443, 472, 472, 472, 472, 548, 548, 548, 591, 604, + 993, 604, 591, 415, 605, 605, 605, 605, 702, 340, + 341, 469, 469, 469, 469, 365, 366, 701, 599, 599, + 599, 599, 444, 472, 472, 472, 472, 599, 599, 599, + 530, 530, 530, 530, 665, 340, 704, 978, 444, 340, + 341, 599, 599, 599, 599, 599, 599, 414, 414, 977, + 415, 414, 414, 414, 414, 414, 414, 414, 414, 414, + 414, 414, 976, 414, 414, 718, 244, 244, 244, 435, + 414, 414, 414, 245, 245, 245, 244, 975, 340, 708, + + 247, 247, 247, 245, 244, 321, 414, 705, 244, 654, + 247, 245, 974, 244, 696, 245, 752, 973, 247, 753, + 245, 245, 247, 530, 530, 530, 530, 247, 289, 414, + 414, 414, 414, 659, 415, 414, 414, 414, 414, 414, + 414, 414, 414, 414, 414, 414, 660, 414, 414, 663, + 664, 936, 754, 435, 414, 414, 414, 244, 516, 516, + 516, 516, 515, 972, 245, 245, 547, 547, 547, 547, + 414, 247, 289, 673, 971, 673, 365, 366, 674, 674, + 674, 674, 340, 341, 691, 979, 691, 1015, 603, 692, + 692, 692, 692, 414, 414, 661, 671, 390, 391, 662, + + 672, 527, 527, 527, 527, 415, 544, 544, 544, 544, + 340, 341, 524, 547, 547, 547, 547, 541, 340, 341, + 595, 595, 340, 710, 717, 830, 556, 556, 524, 532, + 532, 532, 532, 541, 558, 558, 558, 558, 532, 532, + 532, 365, 724, 365, 366, 733, 605, 605, 605, 605, + 721, 970, 532, 532, 532, 532, 532, 532, 294, 294, + 969, 294, 294, 294, 294, 294, 294, 294, 294, 294, + 294, 294, 294, 311, 294, 294, 311, 311, 311, 311, + 312, 294, 294, 294, 311, 311, 311, 311, 311, 311, + 311, 311, 311, 311, 311, 311, 311, 294, 311, 311, + + 311, 311, 311, 311, 684, 311, 311, 311, 685, 311, + 311, 311, 311, 311, 311, 311, 311, 311, 311, 311, + 294, 294, 549, 549, 549, 549, 340, 341, 390, 740, + 968, 549, 549, 549, 365, 720, 967, 737, 605, 605, + 605, 605, 559, 559, 559, 549, 549, 549, 549, 549, + 549, 321, 321, 321, 321, 321, 321, 966, 321, 321, + 321, 321, 321, 321, 321, 321, 335, 321, 321, 335, + 335, 335, 335, 336, 321, 321, 321, 335, 335, 335, + 335, 335, 335, 335, 335, 335, 335, 335, 335, 335, + 321, 335, 335, 335, 335, 335, 335, 697, 335, 335, + + 335, 698, 335, 335, 335, 335, 335, 335, 335, 335, + 335, 335, 335, 321, 321, 340, 341, 340, 704, 340, + 341, 705, 758, 340, 341, 759, 699, 965, 699, 365, + 366, 700, 700, 700, 700, 555, 555, 555, 555, 558, + 558, 558, 558, 365, 366, 678, 552, 340, 710, 390, + 391, 711, 340, 708, 706, 365, 366, 964, 760, 569, + 569, 705, 552, 340, 341, 849, 715, 682, 715, 365, + 366, 716, 716, 716, 716, 365, 366, 850, 679, 560, + 560, 560, 560, 851, 712, 572, 572, 572, 560, 560, + 560, 571, 571, 571, 571, 674, 674, 674, 674, 734, + + 683, 963, 560, 560, 560, 560, 560, 560, 339, 339, + 340, 341, 339, 339, 339, 339, 339, 339, 339, 339, + 339, 339, 339, 359, 339, 339, 359, 359, 359, 359, + 360, 339, 339, 339, 359, 359, 359, 359, 359, 359, + 359, 359, 359, 359, 359, 359, 359, 339, 359, 359, + 359, 359, 359, 359, 713, 359, 359, 359, 714, 359, + 359, 359, 359, 359, 359, 359, 359, 359, 359, 359, + 339, 339, 365, 366, 365, 720, 365, 366, 721, 365, + 726, 365, 726, 390, 391, 727, 390, 391, 568, 568, + 568, 568, 571, 571, 571, 571, 340, 341, 962, 565, + + 390, 736, 581, 581, 581, 581, 390, 391, 390, 391, + 943, 722, 961, 578, 335, 565, 365, 366, 728, 731, + 960, 731, 582, 582, 732, 732, 732, 732, 959, 578, + 390, 391, 573, 573, 573, 573, 390, 391, 981, 831, + 1016, 573, 573, 573, 390, 391, 584, 584, 584, 584, + 390, 742, 585, 585, 585, 573, 573, 573, 573, 573, + 573, 364, 364, 365, 366, 364, 364, 364, 364, 364, + 364, 364, 364, 364, 364, 364, 384, 364, 364, 384, + 384, 384, 384, 385, 364, 364, 364, 384, 384, 384, + 384, 384, 384, 384, 384, 384, 384, 384, 384, 384, + + 364, 384, 384, 384, 384, 384, 384, 729, 384, 384, + 384, 730, 384, 384, 384, 384, 384, 384, 384, 384, + 384, 384, 384, 364, 364, 390, 391, 753, 390, 736, + 390, 742, 737, 752, 743, 759, 753, 415, 958, 340, + 708, 584, 584, 584, 584, 390, 391, 747, 705, 747, + 365, 724, 748, 748, 748, 748, 808, 264, 415, 721, + 754, 586, 586, 586, 586, 738, 415, 744, 760, 754, + 586, 586, 586, 597, 597, 597, 597, 674, 674, 674, + 674, 598, 598, 598, 586, 586, 586, 586, 586, 586, + 389, 389, 390, 391, 389, 389, 389, 389, 389, 389, + + 389, 389, 389, 389, 389, 409, 389, 389, 409, 409, + 409, 409, 410, 389, 389, 389, 409, 409, 409, 409, + 409, 409, 409, 409, 409, 409, 409, 409, 409, 389, + 409, 409, 409, 409, 409, 409, 745, 409, 409, 409, + 746, 409, 409, 409, 409, 409, 409, 409, 409, 409, + 409, 409, 389, 389, 415, 245, 365, 366, 415, 311, + 890, 981, 289, 692, 692, 692, 692, 365, 366, 594, + 594, 594, 594, 597, 597, 597, 597, 244, 244, 244, + 591, 244, 335, 894, 245, 245, 245, 244, 245, 815, + 957, 247, 247, 247, 245, 247, 591, 415, 982, 834, + + 956, 247, 692, 692, 692, 692, 311, 321, 365, 724, + 835, 654, 599, 599, 599, 599, 696, 721, 390, 740, + 804, 599, 599, 599, 983, 806, 1015, 737, 805, 340, + 341, 340, 341, 359, 896, 599, 599, 599, 599, 599, + 599, 414, 414, 311, 415, 414, 414, 414, 414, 414, + 414, 414, 414, 414, 414, 414, 434, 414, 414, 434, + 434, 434, 434, 435, 414, 414, 414, 434, 434, 434, + 434, 434, 434, 434, 434, 434, 434, 434, 434, 434, + 414, 434, 434, 434, 434, 434, 434, 761, 434, 434, + 434, 762, 434, 434, 434, 434, 434, 434, 434, 434, + + 434, 434, 434, 414, 414, 244, 340, 341, 390, 391, + 340, 341, 245, 340, 704, 365, 366, 705, 952, 247, + 365, 366, 700, 700, 700, 700, 700, 700, 700, 700, + 415, 716, 716, 716, 716, 932, 716, 716, 716, 716, + 390, 740, 365, 366, 931, 748, 748, 748, 748, 737, + 706, 838, 944, 807, 294, 294, 359, 294, 294, 294, + 294, 294, 294, 294, 294, 294, 294, 294, 294, 311, + 294, 294, 311, 311, 311, 311, 312, 294, 294, 294, + 311, 311, 311, 311, 311, 311, 311, 311, 311, 311, + 311, 311, 311, 294, 311, 311, 311, 311, 311, 311, + + 311, 311, 311, 818, 311, 311, 311, 311, 311, 311, + 311, 311, 311, 311, 311, 311, 294, 294, 321, 321, + 321, 321, 321, 321, 930, 321, 321, 321, 321, 321, + 321, 321, 321, 335, 321, 321, 335, 335, 335, 335, + 336, 321, 321, 321, 335, 335, 335, 335, 335, 335, + 335, 335, 335, 335, 335, 335, 335, 321, 335, 335, + 335, 335, 335, 335, 335, 335, 335, 828, 335, 335, + 335, 335, 335, 335, 335, 335, 335, 335, 335, 335, + 321, 321, 340, 704, 340, 710, 705, 415, 711, 340, + 710, 390, 391, 711, 929, 390, 391, 365, 366, 384, + + 898, 928, 748, 748, 748, 748, 927, 732, 732, 732, + 732, 732, 732, 732, 732, 390, 391, 390, 391, 706, + 926, 712, 409, 900, 434, 902, 712, 339, 339, 340, + 341, 339, 339, 339, 339, 339, 339, 339, 339, 339, + 339, 339, 359, 339, 339, 359, 359, 359, 359, 360, + 339, 339, 339, 359, 359, 359, 359, 359, 359, 359, + 359, 359, 359, 359, 359, 359, 339, 359, 359, 359, + 359, 359, 359, 359, 359, 359, 832, 359, 359, 359, + 359, 359, 359, 359, 359, 359, 359, 359, 359, 339, + 339, 365, 720, 365, 720, 721, 863, 721, 365, 726, + + 365, 726, 727, 409, 727, 434, 901, 244, 903, 945, + 864, 244, 925, 359, 245, 924, 865, 935, 245, 935, + 935, 247, 946, 947, 923, 247, 384, 384, 722, 948, + 722, 922, 949, 409, 921, 728, 409, 728, 364, 364, + 365, 366, 364, 364, 364, 364, 364, 364, 364, 364, + 364, 364, 364, 384, 364, 364, 384, 384, 384, 384, + 385, 364, 364, 364, 384, 384, 384, 384, 384, 384, + 384, 384, 384, 384, 384, 384, 384, 364, 384, 384, + 384, 384, 384, 384, 384, 384, 384, 836, 384, 384, + 384, 384, 384, 384, 384, 384, 384, 384, 384, 384, + + 364, 364, 390, 391, 390, 736, 390, 736, 737, 245, + 737, 390, 742, 390, 742, 743, 289, 743, 950, 245, + 951, 953, 434, 920, 434, 935, 289, 935, 935, 979, + 340, 341, 985, 954, 1017, 340, 341, 986, 919, 955, + 245, 738, 918, 738, 888, 839, 917, 289, 744, 937, + 744, 389, 389, 390, 391, 389, 389, 389, 389, 389, + 389, 389, 389, 389, 389, 389, 409, 389, 389, 409, + 409, 409, 409, 410, 389, 389, 389, 409, 409, 409, + 409, 409, 409, 409, 409, 409, 409, 409, 409, 409, + 389, 409, 409, 409, 409, 409, 409, 409, 409, 409, + + 840, 409, 409, 409, 409, 409, 409, 409, 409, 409, + 409, 409, 409, 389, 389, 758, 979, 245, 759, 980, + 244, 980, 916, 244, 289, 415, 991, 245, 1020, 915, + 245, 914, 245, 913, 247, 415, 992, 247, 912, 289, + 365, 366, 987, 911, 1018, 365, 366, 988, 390, 391, + 990, 760, 414, 414, 889, 415, 414, 414, 414, 414, + 414, 414, 414, 414, 414, 414, 414, 434, 414, 414, + 434, 434, 434, 434, 435, 414, 414, 414, 434, 434, + 434, 434, 434, 434, 434, 434, 434, 434, 434, 434, + 434, 414, 434, 434, 434, 434, 434, 434, 434, 434, + + 434, 844, 434, 434, 434, 434, 434, 434, 434, 434, + 434, 434, 434, 434, 414, 414, 244, 244, 244, 244, + 983, 984, 244, 245, 245, 245, 245, 244, 985, 245, + 247, 247, 247, 247, 245, 986, 247, 987, 988, 989, + 990, 247, 991, 992, 390, 391, 989, 910, 1019, 340, + 341, 365, 366, 390, 391, 909, 908, 885, 883, 933, + 907, 884, 906, 905, 934, 335, 335, 886, 904, 415, + 415, 820, 887, 359, 882, 881, 880, 879, 878, 877, + 359, 876, 384, 384, 409, 409, 875, 434, 434, 182, + 874, 182, 182, 182, 182, 182, 182, 182, 182, 182, + + 185, 873, 872, 185, 185, 193, 871, 193, 193, 193, + 193, 193, 193, 193, 193, 193, 246, 246, 246, 246, + 246, 246, 246, 246, 262, 262, 262, 262, 262, 262, + 262, 262, 262, 262, 262, 281, 281, 281, 281, 284, + 870, 284, 869, 284, 284, 284, 284, 288, 288, 288, + 288, 288, 288, 288, 294, 868, 294, 294, 294, 294, + 294, 294, 294, 294, 294, 296, 867, 296, 296, 296, + 296, 296, 296, 296, 296, 296, 299, 866, 299, 299, + 299, 299, 299, 299, 299, 299, 299, 311, 862, 311, + 311, 311, 311, 311, 311, 311, 311, 311, 245, 245, + + 245, 245, 245, 245, 245, 321, 321, 861, 321, 321, + 321, 321, 321, 321, 321, 321, 322, 322, 322, 322, + 322, 322, 322, 322, 322, 322, 322, 335, 335, 860, + 335, 335, 335, 335, 335, 335, 335, 335, 339, 339, + 339, 339, 339, 339, 339, 339, 339, 339, 339, 342, + 342, 342, 342, 342, 342, 342, 342, 342, 342, 342, + 346, 346, 346, 346, 346, 346, 346, 346, 346, 346, + 346, 364, 364, 364, 364, 364, 364, 364, 364, 364, + 364, 364, 367, 367, 367, 367, 367, 367, 367, 367, + 367, 367, 367, 371, 371, 371, 371, 371, 371, 371, + + 371, 371, 371, 371, 389, 389, 389, 389, 389, 389, + 389, 389, 389, 389, 389, 392, 392, 392, 392, 392, + 392, 392, 392, 392, 392, 392, 396, 396, 396, 396, + 396, 396, 396, 396, 396, 396, 396, 414, 859, 414, + 414, 414, 414, 414, 414, 414, 414, 414, 417, 858, + 417, 417, 417, 417, 417, 417, 417, 417, 417, 421, + 857, 421, 421, 421, 421, 421, 421, 421, 421, 421, + 434, 856, 434, 434, 434, 434, 434, 434, 434, 434, + 434, 185, 855, 854, 185, 185, 193, 853, 193, 193, + 193, 193, 193, 193, 193, 193, 193, 445, 852, 848, + + 445, 445, 445, 474, 847, 846, 474, 245, 245, 245, + 245, 245, 245, 245, 246, 246, 246, 246, 246, 246, + 246, 246, 262, 262, 262, 262, 262, 262, 262, 262, + 262, 262, 262, 514, 514, 514, 514, 514, 514, 517, + 517, 517, 517, 518, 845, 518, 518, 518, 518, 288, + 288, 288, 288, 288, 288, 288, 294, 758, 294, 294, + 294, 294, 294, 294, 294, 294, 294, 296, 415, 296, + 296, 296, 296, 296, 296, 296, 296, 296, 299, 753, + 299, 299, 299, 299, 299, 299, 299, 299, 299, 311, + 752, 311, 311, 311, 311, 311, 311, 311, 311, 311, + + 321, 321, 415, 321, 321, 321, 321, 321, 321, 321, + 321, 322, 322, 322, 322, 322, 322, 322, 322, 322, + 322, 322, 335, 335, 841, 335, 335, 335, 335, 335, + 335, 335, 335, 339, 339, 339, 339, 339, 339, 339, + 339, 339, 339, 339, 342, 342, 342, 342, 342, 342, + 342, 342, 342, 342, 342, 346, 346, 346, 346, 346, + 346, 346, 346, 346, 346, 346, 364, 364, 364, 364, + 364, 364, 364, 364, 364, 364, 364, 367, 367, 367, + 367, 367, 367, 367, 367, 367, 367, 367, 371, 371, + 371, 371, 371, 371, 371, 371, 371, 371, 371, 389, + + 389, 389, 389, 389, 389, 389, 389, 389, 389, 389, + 392, 392, 392, 392, 392, 392, 392, 392, 392, 392, + 392, 396, 396, 396, 396, 396, 396, 396, 396, 396, + 396, 396, 414, 837, 414, 414, 414, 414, 414, 414, + 414, 414, 414, 417, 833, 417, 417, 417, 417, 417, + 417, 417, 417, 417, 421, 829, 421, 421, 421, 421, + 421, 421, 421, 421, 421, 434, 827, 434, 434, 434, + 434, 434, 434, 434, 434, 434, 185, 826, 823, 185, + 185, 445, 822, 819, 445, 445, 445, 474, 678, 817, + 474, 651, 816, 651, 651, 651, 651, 651, 651, 651, + + 651, 651, 654, 813, 654, 654, 654, 654, 654, 654, + 654, 654, 654, 656, 812, 656, 656, 656, 656, 656, + 656, 656, 656, 656, 246, 246, 246, 246, 246, 246, + 246, 246, 262, 262, 262, 262, 262, 262, 262, 262, + 262, 262, 262, 514, 514, 514, 514, 514, 514, 666, + 811, 666, 666, 666, 666, 518, 810, 518, 518, 518, + 518, 288, 288, 288, 288, 288, 288, 288, 294, 652, + 294, 294, 294, 294, 294, 294, 294, 294, 294, 677, + 803, 677, 677, 677, 677, 677, 677, 677, 677, 677, + 680, 802, 680, 680, 680, 680, 680, 680, 680, 680, + + 680, 681, 801, 681, 681, 681, 681, 681, 681, 681, + 681, 681, 245, 245, 245, 245, 245, 245, 245, 321, + 321, 800, 321, 321, 321, 321, 321, 321, 321, 321, + 695, 695, 695, 695, 695, 695, 695, 695, 695, 695, + 695, 339, 339, 339, 339, 339, 339, 339, 339, 339, + 339, 339, 703, 703, 703, 703, 703, 703, 703, 703, + 703, 703, 703, 707, 707, 707, 707, 707, 707, 707, + 707, 707, 707, 707, 709, 709, 709, 709, 709, 709, + 709, 709, 709, 709, 709, 364, 364, 364, 364, 364, + 364, 364, 364, 364, 364, 364, 719, 719, 719, 719, + + 719, 719, 719, 719, 719, 719, 719, 723, 723, 723, + 723, 723, 723, 723, 723, 723, 723, 723, 725, 725, + 725, 725, 725, 725, 725, 725, 725, 725, 725, 389, + 389, 389, 389, 389, 389, 389, 389, 389, 389, 389, + 735, 735, 735, 735, 735, 735, 735, 735, 735, 735, + 735, 739, 739, 739, 739, 739, 739, 739, 739, 739, + 739, 739, 741, 741, 741, 741, 741, 741, 741, 741, + 741, 741, 741, 414, 799, 414, 414, 414, 414, 414, + 414, 414, 414, 414, 751, 796, 751, 751, 751, 751, + 751, 751, 751, 751, 751, 755, 795, 755, 755, 755, + + 755, 755, 755, 755, 755, 755, 757, 794, 757, 757, + 757, 757, 757, 757, 757, 757, 757, 445, 793, 792, + 445, 445, 445, 651, 791, 651, 651, 651, 651, 651, + 651, 651, 651, 651, 654, 790, 654, 654, 654, 654, + 654, 654, 654, 654, 654, 656, 789, 656, 656, 656, + 656, 656, 656, 656, 656, 656, 246, 246, 246, 246, + 246, 246, 246, 246, 262, 262, 262, 262, 262, 262, + 262, 262, 262, 262, 262, 666, 788, 666, 666, 666, + 666, 518, 787, 518, 518, 518, 518, 288, 288, 288, + 288, 288, 288, 288, 294, 786, 294, 294, 294, 294, + + 294, 294, 294, 294, 294, 677, 785, 677, 677, 677, + 677, 677, 677, 677, 677, 677, 680, 784, 680, 680, + 680, 680, 680, 680, 680, 680, 680, 681, 783, 681, + 681, 681, 681, 681, 681, 681, 681, 681, 245, 245, + 245, 245, 245, 245, 245, 321, 321, 782, 321, 321, + 321, 321, 321, 321, 321, 321, 695, 695, 695, 695, + 695, 695, 695, 695, 695, 695, 695, 339, 339, 339, + 339, 339, 339, 339, 339, 339, 339, 339, 703, 703, + 703, 703, 703, 703, 703, 703, 703, 703, 703, 707, + 707, 707, 707, 707, 707, 707, 707, 707, 707, 707, + + 709, 709, 709, 709, 709, 709, 709, 709, 709, 709, + 709, 364, 364, 364, 364, 364, 364, 364, 364, 364, + 364, 364, 719, 719, 719, 719, 719, 719, 719, 719, + 719, 719, 719, 723, 723, 723, 723, 723, 723, 723, + 723, 723, 723, 723, 725, 725, 725, 725, 725, 725, + 725, 725, 725, 725, 725, 389, 389, 389, 389, 389, + 389, 389, 389, 389, 389, 389, 735, 735, 735, 735, + 735, 735, 735, 735, 735, 735, 735, 739, 739, 739, + 739, 739, 739, 739, 739, 739, 739, 739, 741, 741, + 741, 741, 741, 741, 741, 741, 741, 741, 741, 414, + + 781, 414, 414, 414, 414, 414, 414, 414, 414, 414, + 751, 780, 751, 751, 751, 751, 751, 751, 751, 751, + 751, 755, 779, 755, 755, 755, 755, 755, 755, 755, + 755, 755, 757, 778, 757, 757, 757, 757, 757, 757, + 757, 757, 757, 445, 777, 776, 445, 445, 445, 246, + 246, 246, 246, 246, 246, 246, 246, 262, 262, 262, + 262, 262, 262, 262, 262, 262, 262, 262, 518, 775, + 518, 518, 518, 518, 288, 288, 288, 288, 288, 288, + 288, 774, 773, 772, 771, 770, 769, 768, 767, 766, + 765, 764, 763, 694, 693, 688, 687, 686, 678, 676, + + 675, 670, 669, 668, 667, 515, 634, 619, 615, 655, + 652, 650, 649, 648, 647, 646, 645, 644, 643, 642, + 641, 640, 639, 638, 637, 633, 632, 631, 630, 629, + 628, 627, 626, 625, 624, 623, 622, 621, 618, 617, + 614, 613, 612, 611, 610, 609, 608, 607, 606, 419, + 418, 415, 415, 590, 577, 564, 500, 543, 542, 539, + 538, 537, 535, 526, 525, 297, 500, 520, 519, 515, + 488, 486, 462, 511, 450, 500, 289, 499, 493, 492, + 489, 477, 476, 475, 468, 467, 466, 463, 460, 459, + 455, 452, 451, 448, 447, 446, 183, 416, 415, 411, + + 386, 361, 334, 289, 315, 310, 297, 295, 276, 183, + 276, 183, 190, 181, 1049, 23, 1049, 1049, 1049, 1049, + 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, + 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, + 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, + 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, + 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, + 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049 } ; -static yyconst flex_int16_t yy_chk[5877] = +static yyconst flex_int16_t yy_chk[5881] = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, @@ -1488,7 +1481,7 @@ static yyconst flex_int16_t yy_chk[5877] = 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 33, 2, 2, 29, 35, - 4, 434, 4, 4, 434, 6, 40, 6, 6, 33, + 4, 435, 4, 4, 435, 6, 40, 6, 6, 33, 55, 35, 8, 40, 8, 8, 56, 2, 3, 74, 3, 3, 3, 4, 44, 44, 3, 3, 6, 3, @@ -1496,7 +1489,7 @@ static yyconst flex_int16_t yy_chk[5877] = 3, 3, 3, 10, 13, 10, 10, 12, 55, 12, 12, 16, 74, 16, 16, 56, 13, 13, 13, 13, 18, 108, 18, 18, 3, 20, 3, 20, 20, 3, - 168, 3, 1040, 3, 22, 3, 22, 22, 168, 3, + 168, 3, 1043, 3, 22, 3, 22, 22, 168, 3, 3, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, @@ -1526,8 +1519,8 @@ static yyconst flex_int16_t yy_chk[5877] = 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 14, 206, 14, - 14, 31, 14, 31, 642, 31, 31, 46, 46, 60, - 206, 60, 60, 642, 14, 14, 14, 14, 15, 15, + 14, 31, 14, 31, 644, 31, 31, 46, 46, 60, + 206, 60, 60, 644, 14, 14, 14, 14, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, @@ -1561,576 +1554,576 @@ static yyconst flex_int16_t yy_chk[5877] = 36, 47, 38, 27, 38, 38, 38, 38, 47, 82, 38, 39, 39, 39, 39, 47, 82, 39, 91, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, - 39, 39, 1037, 39, 39, 39, 39, 39, 39, 39, + 39, 39, 1040, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 41, 51, 41, 41, 41, - 41, 1036, 49, 51, 84, 52, 54, 41, 41, 49, - 51, 84, 52, 54, 41, 173, 49, 41, 121, 52, - 54, 41, 1035, 42, 41, 42, 42, 42, 42, 233, - 48, 50, 41, 233, 84, 173, 42, 48, 50, 41, - - 48, 48, 48, 48, 48, 50, 51, 49, 52, 182, - 54, 121, 42, 43, 67, 43, 67, 67, 43, 1033, - 53, 43, 43, 43, 43, 43, 43, 53, 43, 50, - 57, 43, 57, 57, 53, 50, 58, 58, 58, 58, - 59, 59, 182, 69, 69, 57, 61, 61, 61, 61, - 62, 58, 62, 62, 62, 62, 230, 53, 68, 68, - 68, 68, 59, 59, 230, 64, 75, 216, 75, 53, - 75, 75, 66, 64, 64, 64, 64, 64, 64, 66, - 216, 59, 63, 64, 69, 425, 66, 71, 71, 71, - 71, 73, 73, 73, 73, 85, 85, 85, 85, 287, - - 63, 63, 214, 63, 214, 63, 287, 63, 63, 66, - 87, 87, 63, 63, 63, 63, 78, 1032, 77, 63, - 77, 77, 77, 77, 122, 122, 78, 78, 78, 78, - 80, 425, 80, 80, 80, 80, 86, 86, 86, 86, - 232, 83, 1030, 80, 83, 83, 83, 83, 83, 124, - 124, 87, 112, 78, 78, 232, 112, 1027, 78, 80, - 93, 112, 93, 93, 93, 93, 94, 94, 94, 94, - 100, 746, 100, 100, 1025, 96, 101, 101, 101, 101, - 235, 109, 96, 109, 109, 96, 126, 126, 235, 96, - 105, 105, 105, 105, 94, 126, 136, 136, 94, 95, - - 96, 95, 95, 95, 95, 275, 120, 96, 120, 120, - 275, 95, 95, 746, 104, 104, 104, 104, 95, 131, - 131, 95, 125, 125, 1024, 95, 125, 113, 95, 113, - 113, 113, 113, 138, 138, 318, 95, 150, 150, 1023, - 131, 426, 104, 95, 98, 98, 104, 98, 98, 98, - 98, 98, 98, 98, 98, 98, 98, 98, 98, 125, - 98, 98, 114, 114, 114, 114, 98, 98, 98, 98, - 318, 106, 116, 106, 106, 106, 106, 454, 130, 116, - 140, 140, 116, 98, 106, 130, 116, 426, 130, 140, - 114, 245, 130, 454, 114, 152, 152, 116, 245, 176, - - 106, 176, 176, 130, 116, 245, 98, 98, 99, 99, - 130, 99, 99, 99, 99, 99, 99, 99, 99, 99, - 99, 99, 99, 1021, 99, 99, 127, 127, 222, 222, - 99, 99, 99, 99, 134, 134, 134, 134, 128, 128, - 127, 309, 127, 127, 127, 127, 309, 99, 135, 135, - 135, 135, 821, 99, 128, 128, 128, 128, 139, 139, - 145, 145, 139, 148, 148, 148, 148, 224, 224, 224, - 99, 99, 115, 1020, 115, 115, 115, 115, 154, 154, - 821, 145, 128, 144, 115, 115, 128, 154, 141, 141, - 144, 115, 1019, 144, 115, 139, 686, 144, 115, 153, - - 153, 115, 141, 153, 141, 141, 141, 141, 144, 115, - 149, 149, 149, 149, 1018, 144, 115, 118, 118, 118, - 118, 118, 118, 686, 118, 118, 118, 118, 118, 118, - 118, 118, 816, 118, 118, 816, 153, 159, 159, 118, - 118, 118, 118, 155, 155, 162, 162, 162, 162, 229, - 229, 167, 142, 142, 167, 1017, 118, 155, 159, 155, - 155, 155, 155, 163, 163, 163, 163, 591, 142, 142, - 142, 142, 177, 177, 177, 177, 242, 242, 295, 118, - 118, 119, 119, 119, 119, 119, 119, 167, 119, 119, - 119, 119, 119, 119, 119, 119, 142, 119, 119, 179, - - 142, 179, 179, 119, 119, 119, 119, 158, 172, 261, - 261, 295, 156, 156, 158, 172, 591, 158, 172, 211, - 119, 158, 172, 211, 263, 263, 119, 211, 156, 156, - 156, 156, 158, 172, 169, 186, 186, 186, 186, 158, - 172, 264, 264, 119, 119, 129, 129, 169, 1007, 169, - 169, 169, 169, 265, 265, 178, 156, 178, 178, 129, - 156, 129, 129, 129, 129, 187, 187, 187, 187, 933, - 178, 129, 129, 188, 188, 188, 188, 237, 129, 249, - 933, 129, 237, 272, 272, 129, 249, 933, 129, 189, - 189, 189, 189, 249, 286, 237, 129, 196, 196, 196, - - 196, 1006, 286, 129, 132, 132, 132, 132, 132, 132, + 41, 1039, 49, 51, 288, 52, 54, 41, 41, 49, + 51, 288, 52, 54, 41, 84, 49, 41, 121, 52, + 54, 41, 84, 42, 41, 42, 42, 42, 42, 173, + 48, 67, 41, 67, 67, 1038, 42, 48, 592, 41, + + 48, 48, 48, 48, 48, 84, 51, 49, 52, 173, + 54, 121, 42, 43, 100, 43, 100, 100, 43, 216, + 50, 43, 43, 43, 43, 43, 43, 50, 43, 43, + 53, 43, 216, 57, 50, 57, 57, 53, 58, 58, + 58, 58, 122, 122, 53, 592, 59, 59, 57, 61, + 61, 61, 61, 58, 69, 69, 66, 62, 50, 62, + 62, 62, 62, 66, 50, 64, 1036, 53, 59, 59, + 66, 87, 87, 64, 64, 64, 64, 64, 64, 53, + 75, 64, 75, 64, 75, 75, 230, 59, 63, 68, + 68, 68, 68, 66, 230, 69, 71, 71, 71, 71, + + 73, 73, 73, 73, 124, 124, 63, 63, 214, 63, + 214, 63, 87, 63, 63, 182, 131, 131, 63, 63, + 63, 63, 78, 892, 77, 63, 77, 77, 77, 77, + 136, 136, 78, 78, 78, 78, 80, 131, 80, 80, + 80, 80, 85, 85, 85, 85, 892, 83, 182, 80, + 83, 83, 83, 83, 83, 86, 86, 86, 86, 78, + 78, 138, 138, 231, 78, 80, 93, 231, 93, 93, + 93, 93, 94, 94, 94, 94, 101, 101, 101, 101, + 231, 96, 1035, 104, 104, 104, 104, 109, 96, 109, + 109, 96, 126, 126, 1033, 96, 105, 105, 105, 105, + + 94, 126, 150, 150, 94, 95, 96, 95, 95, 95, + 95, 104, 112, 96, 276, 104, 112, 95, 95, 276, + 120, 112, 120, 120, 95, 152, 152, 95, 125, 125, + 1030, 95, 125, 113, 95, 113, 113, 113, 113, 140, + 140, 319, 95, 134, 134, 134, 134, 310, 140, 95, + 98, 98, 310, 98, 98, 98, 98, 98, 98, 98, + 98, 98, 98, 98, 98, 125, 98, 98, 114, 114, + 114, 114, 98, 98, 98, 98, 319, 106, 116, 106, + 106, 106, 106, 1028, 130, 116, 145, 145, 116, 98, + 106, 130, 116, 211, 130, 455, 114, 211, 130, 167, + + 114, 211, 167, 116, 222, 222, 106, 145, 426, 130, + 116, 455, 98, 98, 99, 99, 130, 99, 99, 99, + 99, 99, 99, 99, 99, 99, 99, 99, 99, 238, + 99, 99, 127, 127, 238, 167, 99, 99, 99, 99, + 135, 135, 135, 135, 128, 128, 127, 238, 127, 127, + 127, 127, 232, 99, 426, 141, 141, 154, 154, 99, + 128, 128, 128, 128, 139, 139, 154, 232, 139, 141, + 1027, 141, 141, 141, 141, 233, 99, 99, 115, 233, + 115, 115, 115, 115, 148, 148, 148, 148, 128, 144, + 115, 115, 128, 334, 142, 142, 144, 115, 334, 144, + + 115, 139, 940, 144, 115, 229, 229, 115, 159, 159, + 142, 142, 142, 142, 144, 115, 149, 149, 149, 149, + 940, 144, 115, 118, 118, 118, 118, 118, 118, 159, + 118, 118, 118, 118, 118, 118, 118, 118, 142, 118, + 118, 176, 142, 176, 176, 118, 118, 118, 118, 155, + 155, 162, 162, 162, 162, 941, 153, 153, 156, 156, + 153, 427, 118, 155, 1026, 155, 155, 155, 155, 163, + 163, 163, 163, 941, 156, 156, 156, 156, 177, 177, + 177, 177, 224, 224, 224, 118, 118, 119, 119, 119, + 119, 119, 119, 153, 119, 119, 119, 119, 119, 119, + + 119, 119, 156, 119, 119, 825, 156, 427, 158, 119, + 119, 119, 119, 170, 179, 158, 179, 179, 158, 235, + 296, 169, 158, 243, 243, 1024, 119, 235, 170, 170, + 170, 170, 119, 158, 169, 825, 169, 169, 169, 169, + 158, 246, 458, 178, 458, 178, 178, 172, 246, 119, + 119, 129, 129, 296, 172, 246, 170, 172, 178, 671, + 170, 172, 262, 262, 1023, 129, 671, 129, 129, 129, + 129, 1022, 172, 186, 186, 186, 186, 129, 129, 172, + 187, 187, 187, 187, 129, 250, 261, 129, 261, 261, + 1021, 129, 250, 671, 129, 188, 188, 188, 188, 250, + + 1020, 261, 129, 189, 189, 189, 189, 264, 264, 129, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, - 132, 132, 132, 132, 132, 132, 132, 132, 143, 143, - 223, 590, 223, 170, 1003, 223, 223, 223, 223, 305, - 305, 417, 143, 889, 143, 143, 143, 143, 170, 170, - 170, 170, 329, 329, 143, 143, 200, 200, 200, 200, - - 260, 143, 260, 260, 143, 231, 889, 200, 143, 231, - 267, 143, 267, 267, 417, 260, 170, 270, 590, 143, - 170, 270, 231, 200, 1002, 270, 143, 146, 146, 146, - 146, 146, 146, 146, 146, 146, 146, 146, 146, 146, + 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, + 132, 132, 132, 132, 143, 143, 196, 196, 196, 196, + 265, 265, 197, 1010, 197, 197, 197, 197, 143, 1009, + 143, 143, 143, 143, 1006, 197, 266, 266, 273, 273, + + 143, 143, 200, 200, 200, 200, 268, 143, 268, 268, + 143, 197, 287, 200, 143, 890, 223, 143, 223, 890, + 287, 223, 223, 223, 223, 143, 306, 306, 277, 200, + 277, 277, 143, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146, - 146, 157, 157, 197, 333, 197, 197, 197, 197, 333, - - 492, 221, 221, 221, 221, 157, 197, 157, 157, 157, - 157, 276, 221, 276, 276, 338, 338, 157, 157, 307, - 307, 307, 197, 826, 157, 247, 826, 157, 221, 340, - 340, 157, 247, 492, 157, 247, 247, 247, 247, 247, - 343, 343, 157, 277, 277, 277, 277, 344, 344, 157, - 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, + 146, 146, 146, 146, 146, 146, 146, 157, 157, 221, + + 221, 221, 221, 330, 330, 249, 278, 278, 278, 278, + 221, 157, 249, 157, 157, 157, 157, 1005, 253, 249, + 308, 308, 308, 157, 157, 253, 221, 332, 332, 332, + 157, 248, 253, 157, 339, 339, 819, 157, 248, 819, + 157, 248, 248, 248, 248, 248, 341, 341, 157, 280, + 280, 280, 280, 253, 249, 157, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 171, 279, 279, 279, 279, 248, - 687, 250, 291, 291, 291, 291, 248, 171, 250, 171, - 171, 171, 171, 248, 457, 250, 457, 266, 266, 171, - 171, 1001, 313, 253, 313, 313, 171, 687, 251, 171, - 253, 254, 252, 171, 1000, 251, 171, 253, 254, 252, - 255, 420, 251, 998, 171, 254, 252, 255, 248, 420, - 250, 171, 174, 174, 255, 174, 174, 174, 174, 174, - 174, 174, 174, 174, 174, 174, 174, 252, 174, 174, - 251, 251, 253, 266, 174, 174, 174, 174, 254, 331, - - 331, 331, 255, 281, 281, 281, 281, 281, 822, 289, - 997, 174, 289, 289, 289, 289, 289, 345, 345, 935, - 290, 292, 292, 292, 292, 996, 345, 290, 299, 299, - 299, 299, 350, 350, 174, 174, 175, 175, 822, 175, - 175, 175, 175, 175, 175, 175, 175, 175, 175, 175, - 175, 887, 175, 175, 319, 887, 319, 319, 175, 175, - 175, 175, 290, 300, 935, 300, 300, 300, 300, 301, - 301, 301, 301, 359, 359, 175, 300, 359, 995, 350, - 301, 175, 304, 304, 304, 304, 323, 323, 323, 323, - 363, 363, 300, 304, 993, 306, 301, 306, 175, 175, - - 306, 306, 306, 306, 325, 325, 325, 325, 498, 304, - 308, 308, 308, 308, 321, 325, 346, 346, 321, 308, - 308, 308, 330, 321, 330, 346, 992, 330, 330, 330, - 330, 325, 531, 308, 308, 308, 308, 308, 308, 310, - 310, 498, 310, 310, 310, 310, 310, 310, 310, 310, - 310, 310, 310, 310, 888, 310, 310, 337, 888, 337, - 337, 310, 310, 310, 310, 531, 317, 533, 317, 317, - 317, 317, 328, 328, 328, 328, 353, 353, 310, 317, - 991, 341, 341, 328, 478, 341, 342, 342, 365, 365, - 342, 478, 353, 353, 478, 317, 648, 351, 351, 328, - - 533, 310, 310, 312, 312, 981, 312, 312, 312, 312, - 312, 312, 312, 312, 312, 312, 312, 312, 341, 312, - 312, 347, 347, 342, 979, 312, 312, 312, 312, 648, - 324, 977, 324, 324, 324, 324, 975, 347, 347, 347, - 347, 974, 312, 324, 351, 349, 349, 357, 357, 368, - 368, 357, 361, 361, 361, 361, 357, 355, 355, 324, - 312, 349, 349, 349, 349, 312, 312, 332, 332, 332, - 332, 973, 349, 355, 355, 355, 332, 332, 332, 362, - 362, 362, 362, 369, 369, 366, 366, 747, 349, 366, - 332, 332, 332, 332, 332, 332, 334, 334, 334, 334, - - 334, 334, 971, 334, 334, 334, 334, 334, 334, 334, - 334, 890, 334, 334, 348, 348, 370, 370, 334, 334, - 334, 334, 366, 388, 388, 370, 354, 354, 348, 747, - 348, 348, 348, 348, 890, 334, 937, 354, 970, 354, - 599, 348, 354, 354, 354, 354, 371, 371, 599, 367, - 367, 375, 375, 367, 937, 371, 653, 348, 334, 334, - 336, 336, 336, 336, 336, 336, 969, 336, 336, 336, - 336, 336, 336, 336, 336, 936, 336, 336, 352, 352, - 376, 376, 336, 336, 336, 336, 367, 378, 378, 653, - 372, 372, 390, 390, 352, 352, 352, 352, 375, 336, - - 393, 393, 968, 378, 378, 352, 372, 372, 372, 372, - 384, 384, 373, 373, 384, 394, 394, 336, 374, 374, - 936, 352, 336, 336, 356, 356, 373, 376, 373, 373, - 373, 373, 469, 469, 374, 374, 374, 374, 752, 373, - 356, 356, 356, 356, 428, 374, 752, 395, 395, 356, - 356, 356, 967, 382, 382, 373, 395, 382, 966, 428, - 428, 374, 382, 356, 356, 356, 356, 356, 356, 358, - 358, 358, 358, 358, 358, 358, 358, 358, 358, 358, - 358, 358, 358, 358, 358, 358, 358, 358, 358, 358, - 358, 358, 358, 358, 358, 358, 358, 358, 358, 358, - - 358, 358, 358, 358, 358, 358, 358, 358, 358, 358, - 358, 358, 358, 358, 358, 358, 358, 358, 358, 358, - 358, 358, 358, 358, 358, 358, 358, 358, 358, 358, - 358, 358, 358, 377, 377, 400, 400, 380, 380, 386, - 386, 386, 386, 391, 391, 379, 379, 391, 674, 377, - 377, 377, 377, 380, 380, 380, 379, 976, 379, 976, - 377, 379, 379, 379, 379, 387, 387, 387, 387, 392, - 392, 397, 397, 392, 396, 396, 377, 381, 381, 965, - 391, 674, 400, 396, 403, 403, 962, 397, 397, 397, - 397, 405, 405, 381, 381, 381, 381, 472, 472, 472, - - 403, 403, 381, 381, 381, 961, 392, 405, 405, 405, - 409, 409, 526, 526, 409, 959, 381, 381, 381, 381, - 381, 381, 383, 383, 383, 383, 383, 383, 383, 383, - 383, 383, 383, 383, 383, 383, 383, 383, 383, 383, - 383, 383, 383, 383, 383, 383, 383, 383, 383, 383, - 383, 383, 383, 383, 383, 383, 383, 383, 383, 383, - 383, 383, 383, 383, 383, 383, 383, 383, 383, 383, - 383, 383, 383, 383, 383, 383, 383, 383, 383, 383, - 383, 383, 383, 383, 383, 383, 398, 398, 401, 401, - 399, 399, 407, 407, 416, 430, 407, 416, 543, 543, - - 398, 407, 398, 398, 398, 398, 399, 399, 399, 399, - 430, 430, 430, 398, 662, 662, 436, 399, 436, 436, - 402, 402, 411, 411, 411, 411, 529, 529, 529, 398, - 416, 551, 551, 399, 957, 401, 402, 402, 402, 402, - 404, 404, 412, 412, 412, 412, 432, 402, 499, 432, - 956, 404, 422, 404, 432, 499, 404, 404, 404, 404, - 423, 955, 499, 402, 406, 406, 938, 422, 422, 422, - 422, 683, 683, 423, 954, 423, 423, 423, 423, 551, - 406, 406, 406, 406, 938, 437, 423, 437, 437, 406, - 406, 406, 438, 953, 438, 438, 439, 439, 439, 439, - - 702, 702, 423, 406, 406, 406, 406, 406, 406, 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, 408, 408, 408, 408, 408, 408, 408, - 408, 408, 408, 408, 408, 408, 408, 408, 408, 408, - 408, 408, 408, 424, 508, 508, 538, 427, 440, 440, - 440, 440, 441, 441, 441, 441, 564, 564, 424, 424, - 424, 424, 427, 427, 427, 427, 429, 703, 703, 424, - - 538, 548, 500, 427, 538, 548, 429, 952, 429, 500, - 548, 429, 429, 429, 429, 424, 500, 560, 560, 427, - 431, 442, 442, 442, 442, 443, 560, 443, 951, 508, - 443, 443, 443, 443, 564, 431, 431, 431, 431, 468, - 468, 468, 468, 950, 431, 431, 431, 500, 708, 708, - 468, 470, 470, 470, 470, 546, 546, 546, 431, 431, - 431, 431, 431, 431, 433, 433, 468, 433, 433, 433, - 433, 433, 433, 433, 433, 433, 433, 433, 433, 949, - 433, 433, 471, 471, 471, 471, 433, 433, 433, 433, - 501, 503, 504, 527, 527, 527, 527, 501, 503, 504, - - 978, 502, 978, 433, 501, 503, 504, 506, 502, 927, - 507, 573, 573, 678, 506, 502, 505, 507, 552, 552, - 573, 506, 749, 505, 507, 926, 433, 433, 435, 435, - 505, 435, 435, 435, 435, 435, 435, 435, 435, 435, - 435, 435, 435, 502, 435, 435, 678, 507, 506, 521, - 435, 435, 435, 435, 505, 749, 521, 925, 505, 514, - 514, 514, 514, 514, 522, 924, 522, 435, 552, 522, - 522, 522, 522, 586, 586, 525, 525, 525, 525, 692, - 521, 922, 586, 692, 521, 435, 525, 980, 692, 980, - 435, 435, 528, 528, 528, 528, 921, 542, 542, 542, - - 542, 755, 525, 530, 530, 530, 530, 920, 542, 709, - 709, 656, 530, 530, 530, 539, 830, 539, 656, 830, - 539, 539, 539, 539, 542, 656, 530, 530, 530, 530, - 530, 530, 534, 534, 755, 534, 534, 534, 534, 534, - 534, 534, 534, 534, 534, 534, 534, 534, 534, 534, - 534, 534, 534, 534, 534, 534, 534, 534, 534, 534, - 534, 534, 534, 534, 534, 534, 534, 534, 534, 534, - 534, 534, 534, 534, 534, 534, 534, 534, 534, 534, - 534, 534, 534, 534, 534, 534, 534, 534, 534, 534, - 534, 534, 534, 534, 534, 534, 544, 544, 544, 544, - - 545, 545, 545, 545, 547, 547, 547, 547, 554, 554, - 718, 718, 919, 547, 547, 547, 602, 602, 602, 602, - 603, 603, 603, 603, 554, 554, 918, 547, 547, 547, - 547, 547, 547, 549, 549, 549, 549, 549, 549, 917, - 549, 549, 549, 549, 549, 549, 549, 549, 549, 549, - 549, 549, 549, 549, 549, 549, 549, 549, 549, 549, - 549, 549, 549, 549, 549, 549, 549, 549, 549, 549, - 549, 549, 549, 549, 549, 549, 549, 549, 549, 549, - 549, 549, 549, 549, 549, 549, 549, 549, 549, 549, - 549, 549, 549, 549, 549, 549, 549, 550, 550, 559, - - 559, 553, 553, 559, 598, 555, 555, 598, 550, 916, - 550, 565, 565, 550, 550, 550, 550, 553, 553, 553, - 553, 555, 555, 555, 555, 557, 557, 915, 553, 556, - 556, 719, 719, 561, 561, 913, 559, 561, 567, 567, - 598, 557, 557, 557, 553, 556, 556, 556, 556, 558, - 558, 912, 668, 669, 567, 567, 580, 580, 911, 668, - 669, 565, 568, 568, 910, 558, 558, 558, 558, 593, - 561, 909, 580, 580, 558, 558, 558, 908, 568, 568, - 568, 568, 724, 724, 593, 593, 668, 669, 558, 558, - 558, 558, 558, 558, 562, 562, 562, 562, 562, 562, - - 562, 562, 562, 562, 562, 562, 562, 562, 562, 562, - 562, 562, 562, 562, 562, 562, 562, 562, 562, 562, - 562, 562, 562, 562, 562, 562, 562, 562, 562, 562, - 562, 562, 562, 562, 562, 562, 562, 562, 562, 562, - 562, 562, 562, 562, 562, 562, 562, 562, 562, 562, - 562, 562, 562, 562, 562, 562, 562, 562, 563, 563, - 572, 572, 566, 566, 572, 600, 569, 569, 600, 563, - 907, 563, 577, 577, 563, 563, 563, 563, 566, 566, - 566, 566, 569, 569, 569, 569, 570, 570, 906, 566, - 574, 574, 578, 578, 574, 725, 725, 572, 576, 576, - - 905, 600, 570, 570, 570, 566, 571, 571, 904, 576, - 903, 576, 583, 583, 576, 576, 576, 576, 581, 581, - 577, 901, 571, 571, 571, 571, 879, 574, 583, 583, - 583, 571, 571, 571, 581, 581, 581, 581, 670, 670, - 670, 670, 578, 734, 734, 571, 571, 571, 571, 571, - 571, 575, 575, 575, 575, 575, 575, 575, 575, 575, - 575, 575, 575, 575, 575, 575, 575, 575, 575, 575, - 575, 575, 575, 575, 575, 575, 575, 575, 575, 575, - 575, 575, 575, 575, 575, 575, 575, 575, 575, 575, - 575, 575, 575, 575, 575, 575, 575, 575, 575, 575, - - 575, 575, 575, 575, 575, 575, 575, 575, 575, 575, - 575, 575, 575, 575, 575, 579, 579, 585, 585, 582, - 582, 585, 735, 735, 587, 587, 740, 740, 587, 589, - 877, 579, 579, 579, 579, 582, 582, 582, 582, 589, - 596, 589, 579, 876, 589, 589, 589, 589, 592, 698, - 698, 874, 594, 873, 585, 596, 596, 596, 579, 584, - 584, 587, 872, 592, 592, 592, 592, 594, 594, 594, - 594, 741, 741, 657, 592, 584, 584, 584, 584, 595, - 657, 869, 704, 704, 584, 584, 584, 657, 806, 806, - 592, 704, 698, 868, 595, 595, 595, 595, 584, 584, - - 584, 584, 584, 584, 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, 588, 588, - 588, 588, 588, 588, 588, 588, 588, 588, 588, 588, - 588, 588, 588, 588, 588, 588, 588, 588, 597, 671, - 671, 671, 671, 658, 688, 688, 688, 688, 815, 815, - 658, 696, 696, 597, 597, 597, 597, 658, 689, 689, - 689, 689, 597, 597, 597, 705, 705, 696, 696, 696, - - 696, 825, 825, 867, 705, 866, 597, 597, 597, 597, - 597, 597, 601, 601, 658, 601, 601, 601, 601, 601, - 601, 601, 601, 601, 601, 601, 601, 601, 601, 601, - 601, 601, 601, 601, 601, 601, 601, 601, 601, 601, - 601, 601, 601, 601, 601, 601, 601, 601, 601, 601, - 601, 601, 601, 601, 601, 601, 601, 601, 601, 601, - 601, 601, 601, 601, 601, 601, 601, 601, 601, 601, - 601, 601, 601, 601, 601, 601, 659, 660, 661, 697, - 697, 699, 699, 659, 660, 661, 712, 712, 827, 827, - 659, 660, 661, 713, 713, 697, 697, 697, 697, 720, - - 720, 865, 712, 712, 712, 712, 721, 721, 720, 713, - 713, 713, 713, 736, 736, 721, 863, 659, 828, 828, - 834, 660, 736, 834, 699, 891, 661, 681, 681, 891, - 681, 681, 681, 681, 681, 681, 681, 681, 681, 681, - 681, 681, 681, 681, 681, 681, 681, 681, 681, 681, - 681, 681, 681, 681, 681, 681, 681, 681, 681, 681, - 681, 681, 681, 681, 681, 681, 681, 681, 681, 681, - 681, 681, 681, 681, 681, 681, 681, 681, 681, 681, - 681, 681, 681, 681, 681, 681, 681, 681, 681, 681, - 681, 694, 694, 694, 694, 694, 694, 862, 694, 694, - - 694, 694, 694, 694, 694, 694, 694, 694, 694, 694, - 694, 694, 694, 694, 694, 694, 694, 694, 694, 694, - 694, 694, 694, 694, 694, 694, 694, 694, 694, 694, - 694, 694, 694, 694, 694, 694, 694, 694, 694, 694, - 694, 694, 694, 694, 694, 694, 694, 694, 694, 694, - 694, 694, 694, 694, 694, 700, 700, 701, 701, 700, - 744, 701, 706, 706, 707, 707, 706, 861, 707, 728, - 728, 764, 737, 737, 860, 744, 744, 744, 744, 729, - 729, 737, 934, 764, 859, 728, 728, 728, 728, 764, - 829, 829, 700, 934, 701, 729, 729, 729, 729, 706, - - 934, 707, 710, 710, 710, 710, 710, 710, 710, 710, - 710, 710, 710, 710, 710, 710, 710, 710, 710, 710, - 710, 710, 710, 710, 710, 710, 710, 710, 710, 710, - 710, 710, 710, 710, 710, 710, 710, 710, 710, 710, - 710, 710, 710, 710, 710, 710, 710, 710, 710, 710, - 710, 710, 710, 710, 710, 710, 710, 710, 710, 710, - 710, 710, 710, 710, 710, 710, 714, 714, 715, 715, - 716, 716, 730, 730, 716, 717, 717, 722, 722, 717, - 745, 722, 723, 723, 858, 778, 723, 831, 831, 832, - 832, 833, 833, 835, 835, 745, 745, 745, 745, 778, - - 836, 836, 837, 837, 892, 778, 856, 716, 892, 714, - 838, 715, 717, 838, 722, 730, 841, 841, 855, 723, - 726, 726, 726, 726, 726, 726, 726, 726, 726, 726, - 726, 726, 726, 726, 726, 726, 726, 726, 726, 726, - 726, 726, 726, 726, 726, 726, 726, 726, 726, 726, - 726, 726, 726, 726, 726, 726, 726, 726, 726, 726, - 726, 726, 726, 726, 726, 726, 726, 726, 726, 726, - 726, 726, 726, 726, 726, 726, 726, 726, 726, 726, - 726, 726, 726, 726, 731, 731, 732, 732, 733, 733, - 732, 811, 733, 738, 738, 739, 739, 738, 811, 739, - - 842, 882, 883, 842, 884, 853, 884, 884, 882, 883, - 893, 989, 989, 894, 893, 882, 883, 894, 895, 852, - 896, 851, 895, 732, 896, 733, 811, 731, 988, 988, - 738, 988, 739, 742, 742, 742, 742, 742, 742, 742, - 742, 742, 742, 742, 742, 742, 742, 742, 742, 742, - 742, 742, 742, 742, 742, 742, 742, 742, 742, 742, - 742, 742, 742, 742, 742, 742, 742, 742, 742, 742, - 742, 742, 742, 742, 742, 742, 742, 742, 742, 742, - 742, 742, 742, 742, 742, 742, 742, 742, 742, 742, - 742, 742, 742, 742, 742, 742, 742, 748, 754, 885, - - 748, 754, 886, 897, 898, 902, 885, 897, 898, 886, - 899, 900, 1014, 1014, 899, 900, 932, 902, 932, 932, - 982, 982, 982, 902, 982, 983, 983, 983, 850, 885, - 1015, 1015, 886, 748, 754, 758, 758, 849, 758, 758, - 758, 758, 758, 758, 758, 758, 758, 758, 758, 758, - 758, 758, 758, 758, 758, 758, 758, 758, 758, 758, - 758, 758, 758, 758, 758, 758, 758, 758, 758, 758, - 758, 758, 758, 758, 758, 758, 758, 758, 758, 758, - 758, 758, 758, 758, 758, 758, 758, 758, 758, 758, - 758, 758, 758, 758, 758, 758, 758, 758, 758, 801, - - 802, 803, 804, 848, 939, 812, 801, 802, 803, 804, - 880, 881, 812, 801, 802, 803, 804, 880, 881, 930, - 940, 941, 942, 930, 880, 881, 943, 931, 944, 945, - 930, 931, 946, 947, 948, 1016, 1016, 930, 931, 847, - 803, 801, 812, 846, 802, 931, 844, 880, 881, 939, - 804, 984, 984, 984, 843, 984, 985, 985, 985, 986, - 986, 986, 840, 986, 839, 940, 941, 942, 987, 987, - 987, 943, 818, 944, 945, 809, 800, 946, 947, 948, - 1047, 799, 1047, 1047, 1047, 1047, 1047, 1047, 1047, 1047, - 1047, 1048, 798, 797, 1048, 1048, 1049, 796, 1049, 1049, - - 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1050, 1050, 1050, - 1050, 1050, 1050, 1050, 1050, 1051, 1051, 1051, 1051, 1051, - 1051, 1051, 1051, 1051, 1051, 1051, 1052, 1052, 1052, 1052, - 1053, 795, 1053, 794, 1053, 1053, 1053, 1053, 1054, 1054, - 1054, 1054, 1054, 1054, 1054, 1055, 793, 1055, 1055, 1055, - 1055, 1055, 1055, 1055, 1055, 1055, 1056, 792, 1056, 1056, - 1056, 1056, 1056, 1056, 1056, 1056, 1056, 1057, 791, 1057, - 1057, 1057, 1057, 1057, 1057, 1057, 1057, 1057, 1058, 790, - 1058, 1058, 1058, 1058, 1058, 1058, 1058, 1058, 1058, 1059, - 1059, 1059, 1059, 1059, 1059, 1059, 1060, 1060, 787, 1060, - - 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1061, 1061, 1061, + 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, + 171, 291, 271, 344, 344, 251, 271, 254, 291, 689, + 271, 1004, 251, 171, 254, 171, 171, 171, 171, 251, + 314, 254, 314, 314, 417, 171, 171, 417, 267, 267, + 829, 255, 171, 829, 252, 171, 689, 256, 255, 171, + 418, 252, 171, 291, 256, 255, 345, 345, 252, 1003, + 171, 256, 364, 364, 251, 1001, 254, 171, 174, 174, + 417, 174, 174, 174, 174, 174, 174, 174, 174, 174, + 174, 174, 174, 418, 174, 174, 252, 252, 255, 256, + + 174, 174, 174, 174, 267, 282, 282, 282, 282, 282, + 292, 292, 292, 292, 593, 290, 893, 174, 290, 290, + 290, 290, 290, 293, 293, 293, 293, 300, 300, 300, + 300, 301, 1000, 301, 301, 301, 301, 366, 366, 893, + 174, 174, 175, 175, 301, 175, 175, 175, 175, 175, + 175, 175, 175, 175, 175, 175, 175, 999, 175, 175, + 301, 354, 354, 593, 175, 175, 175, 175, 302, 302, + 302, 302, 305, 305, 305, 305, 322, 354, 354, 302, + 322, 175, 998, 305, 307, 322, 307, 175, 996, 307, + 307, 307, 307, 995, 320, 302, 320, 320, 318, 305, + + 318, 318, 318, 318, 175, 175, 309, 309, 309, 309, + 338, 318, 338, 338, 749, 309, 309, 309, 324, 324, + 324, 324, 360, 360, 342, 342, 360, 318, 342, 309, + 309, 309, 309, 309, 309, 311, 311, 994, 311, 311, + 311, 311, 311, 311, 311, 311, 311, 311, 311, 311, + 690, 311, 311, 984, 346, 346, 749, 311, 311, 311, + 311, 342, 325, 346, 325, 325, 325, 325, 326, 326, + 326, 326, 369, 369, 311, 325, 331, 690, 331, 326, + 479, 331, 331, 331, 331, 347, 347, 479, 343, 343, + 479, 325, 343, 421, 347, 326, 982, 311, 311, 313, + + 313, 421, 313, 313, 313, 313, 313, 313, 313, 313, + 313, 313, 313, 313, 980, 313, 313, 329, 329, 329, + 329, 313, 313, 313, 313, 343, 370, 370, 329, 348, + 348, 351, 351, 352, 352, 356, 356, 978, 313, 367, + 367, 349, 349, 367, 329, 348, 348, 348, 348, 389, + 389, 356, 356, 356, 977, 349, 313, 349, 349, 349, + 349, 313, 313, 333, 333, 333, 333, 601, 349, 755, + 371, 371, 333, 333, 333, 601, 367, 755, 351, 371, + 352, 385, 385, 976, 349, 385, 333, 333, 333, 333, + 333, 333, 335, 335, 335, 335, 335, 335, 974, 335, + + 335, 335, 335, 335, 335, 335, 335, 973, 335, 335, + 350, 350, 391, 391, 335, 335, 335, 335, 362, 362, + 362, 362, 355, 355, 376, 376, 350, 350, 350, 350, + 972, 335, 891, 355, 824, 355, 891, 350, 355, 355, + 355, 355, 358, 358, 394, 394, 358, 363, 363, 363, + 363, 358, 750, 350, 335, 335, 337, 337, 337, 337, + 337, 337, 824, 337, 337, 337, 337, 337, 337, 337, + 337, 376, 337, 337, 353, 353, 395, 395, 337, 337, + 337, 337, 377, 377, 971, 368, 368, 372, 372, 368, + 353, 353, 353, 353, 750, 337, 372, 387, 387, 387, + + 387, 353, 383, 383, 470, 470, 383, 373, 373, 401, + 401, 383, 970, 337, 374, 374, 494, 353, 337, 337, + 357, 357, 368, 373, 373, 373, 373, 429, 374, 377, + 374, 374, 374, 374, 379, 379, 357, 357, 357, 357, + 894, 374, 429, 429, 894, 357, 357, 357, 969, 494, + 379, 379, 388, 388, 388, 388, 401, 374, 968, 357, + 357, 357, 357, 357, 357, 359, 359, 359, 359, 359, + 359, 359, 359, 359, 359, 359, 359, 359, 359, 359, + 359, 359, 359, 359, 359, 359, 359, 359, 359, 359, + 359, 359, 359, 359, 359, 359, 359, 359, 359, 359, + + 359, 359, 359, 359, 359, 359, 359, 359, 359, 359, + 359, 359, 359, 359, 359, 359, 359, 359, 359, 359, + 359, 359, 359, 359, 359, 359, 359, 359, 359, 375, + 375, 392, 392, 378, 378, 392, 500, 381, 381, 965, + 393, 393, 528, 528, 393, 375, 375, 375, 375, 378, + 378, 378, 378, 381, 381, 381, 375, 396, 396, 533, + 378, 964, 380, 380, 402, 402, 396, 962, 392, 500, + 398, 398, 375, 380, 960, 380, 378, 393, 380, 380, + 380, 380, 382, 382, 397, 397, 398, 398, 398, 398, + 410, 410, 533, 397, 410, 959, 404, 404, 382, 382, + + 382, 382, 406, 406, 473, 473, 473, 382, 382, 382, + 958, 402, 404, 404, 412, 412, 412, 412, 406, 406, + 406, 382, 382, 382, 382, 382, 382, 384, 384, 384, + 384, 384, 384, 384, 384, 384, 384, 384, 384, 384, + 384, 384, 384, 384, 384, 384, 384, 384, 384, 384, + 384, 384, 384, 384, 384, 384, 384, 384, 384, 384, + 384, 384, 384, 384, 384, 384, 384, 384, 384, 384, + 384, 384, 384, 384, 384, 384, 384, 384, 384, 384, + 384, 384, 384, 384, 384, 384, 384, 384, 384, 384, + 384, 399, 399, 408, 408, 400, 400, 408, 413, 413, + + 413, 413, 408, 833, 431, 399, 833, 399, 399, 399, + 399, 400, 400, 400, 400, 423, 535, 957, 399, 431, + 431, 431, 400, 403, 403, 437, 651, 437, 437, 956, + 423, 423, 423, 423, 399, 405, 405, 656, 400, 403, + 403, 403, 403, 545, 545, 424, 405, 955, 405, 535, + 403, 405, 405, 405, 405, 531, 531, 531, 424, 651, + 424, 424, 424, 424, 430, 954, 403, 407, 407, 433, + 656, 424, 433, 953, 430, 837, 430, 433, 837, 430, + 430, 430, 430, 407, 407, 407, 407, 424, 438, 501, + 438, 438, 407, 407, 407, 439, 501, 439, 439, 440, + + 440, 440, 440, 501, 665, 665, 407, 407, 407, 407, + 407, 407, 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, 409, 409, 425, 540, 554, 554, + 428, 441, 441, 441, 441, 442, 442, 442, 442, 553, + 553, 425, 425, 425, 425, 428, 428, 428, 428, 510, + + 510, 540, 425, 686, 686, 540, 428, 443, 443, 443, + 443, 471, 471, 471, 471, 548, 548, 548, 425, 444, + 952, 444, 428, 432, 444, 444, 444, 444, 554, 705, + 705, 469, 469, 469, 469, 567, 567, 553, 432, 432, + 432, 432, 469, 472, 472, 472, 472, 432, 432, 432, + 529, 529, 529, 529, 510, 706, 706, 930, 469, 711, + 711, 432, 432, 432, 432, 432, 432, 434, 434, 929, + 434, 434, 434, 434, 434, 434, 434, 434, 434, 434, + 434, 434, 928, 434, 434, 567, 503, 505, 502, 434, + 434, 434, 434, 503, 505, 502, 506, 927, 562, 562, + + 503, 505, 502, 506, 504, 550, 434, 562, 508, 550, + 506, 504, 925, 509, 550, 508, 600, 924, 504, 600, + 509, 888, 508, 530, 530, 530, 530, 509, 888, 434, + 434, 436, 436, 502, 436, 436, 436, 436, 436, 436, + 436, 436, 436, 436, 436, 436, 504, 436, 436, 508, + 509, 888, 600, 436, 436, 436, 436, 507, 516, 516, + 516, 516, 516, 923, 507, 523, 546, 546, 546, 546, + 436, 507, 523, 524, 922, 524, 566, 566, 524, 524, + 524, 524, 701, 701, 541, 979, 541, 979, 436, 541, + 541, 541, 541, 436, 436, 507, 523, 579, 579, 507, + + 523, 527, 527, 527, 527, 595, 544, 544, 544, 544, + 556, 556, 527, 547, 547, 547, 547, 544, 557, 557, + 595, 595, 712, 712, 566, 701, 556, 556, 527, 532, + 532, 532, 532, 544, 557, 557, 557, 557, 532, 532, + 532, 575, 575, 721, 721, 579, 604, 604, 604, 604, + 575, 921, 532, 532, 532, 532, 532, 532, 536, 536, + 920, 536, 536, 536, 536, 536, 536, 536, 536, 536, + 536, 536, 536, 536, 536, 536, 536, 536, 536, 536, + 536, 536, 536, 536, 536, 536, 536, 536, 536, 536, + 536, 536, 536, 536, 536, 536, 536, 536, 536, 536, + + 536, 536, 536, 536, 536, 536, 536, 536, 536, 536, + 536, 536, 536, 536, 536, 536, 536, 536, 536, 536, + 536, 536, 549, 549, 549, 549, 559, 559, 588, 588, + 919, 549, 549, 549, 722, 722, 918, 588, 605, 605, + 605, 605, 559, 559, 559, 549, 549, 549, 549, 549, + 549, 551, 551, 551, 551, 551, 551, 916, 551, 551, + 551, 551, 551, 551, 551, 551, 551, 551, 551, 551, + 551, 551, 551, 551, 551, 551, 551, 551, 551, 551, + 551, 551, 551, 551, 551, 551, 551, 551, 551, 551, + 551, 551, 551, 551, 551, 551, 551, 551, 551, 551, + + 551, 551, 551, 551, 551, 551, 551, 551, 551, 551, + 551, 551, 551, 551, 551, 552, 552, 561, 561, 555, + 555, 561, 602, 558, 558, 602, 552, 915, 552, 727, + 727, 552, 552, 552, 552, 555, 555, 555, 555, 558, + 558, 558, 558, 569, 569, 677, 555, 563, 563, 580, + 580, 563, 707, 707, 561, 565, 565, 914, 602, 569, + 569, 707, 555, 560, 560, 767, 565, 681, 565, 572, + 572, 565, 565, 565, 565, 570, 570, 767, 677, 560, + 560, 560, 560, 767, 563, 572, 572, 572, 560, 560, + 560, 570, 570, 570, 570, 673, 673, 673, 673, 580, + + 681, 913, 560, 560, 560, 560, 560, 560, 564, 564, + 564, 564, 564, 564, 564, 564, 564, 564, 564, 564, + 564, 564, 564, 564, 564, 564, 564, 564, 564, 564, + 564, 564, 564, 564, 564, 564, 564, 564, 564, 564, + 564, 564, 564, 564, 564, 564, 564, 564, 564, 564, + 564, 564, 564, 564, 564, 564, 564, 564, 564, 564, + 564, 564, 564, 564, 564, 564, 564, 564, 564, 564, + 564, 564, 568, 568, 574, 574, 571, 571, 574, 728, + 728, 576, 576, 737, 737, 576, 581, 581, 568, 568, + 568, 568, 571, 571, 571, 571, 702, 702, 912, 568, + + 738, 738, 581, 581, 581, 581, 582, 582, 578, 578, + 895, 574, 911, 581, 895, 568, 573, 573, 576, 578, + 910, 578, 582, 582, 578, 578, 578, 578, 909, 581, + 583, 583, 573, 573, 573, 573, 585, 585, 981, 702, + 981, 573, 573, 573, 743, 743, 583, 583, 583, 583, + 744, 744, 585, 585, 585, 573, 573, 573, 573, 573, + 573, 577, 577, 577, 577, 577, 577, 577, 577, 577, + 577, 577, 577, 577, 577, 577, 577, 577, 577, 577, + 577, 577, 577, 577, 577, 577, 577, 577, 577, 577, + 577, 577, 577, 577, 577, 577, 577, 577, 577, 577, + + 577, 577, 577, 577, 577, 577, 577, 577, 577, 577, + 577, 577, 577, 577, 577, 577, 577, 577, 577, 577, + 577, 577, 577, 577, 577, 584, 584, 752, 587, 587, + 589, 589, 587, 751, 589, 758, 751, 591, 908, 708, + 708, 584, 584, 584, 584, 586, 586, 591, 708, 591, + 723, 723, 591, 591, 591, 591, 809, 809, 596, 723, + 752, 586, 586, 586, 586, 587, 598, 589, 758, 751, + 586, 586, 586, 596, 596, 596, 596, 674, 674, 674, + 674, 598, 598, 598, 586, 586, 586, 586, 586, 586, + 590, 590, 590, 590, 590, 590, 590, 590, 590, 590, + + 590, 590, 590, 590, 590, 590, 590, 590, 590, 590, + 590, 590, 590, 590, 590, 590, 590, 590, 590, 590, + 590, 590, 590, 590, 590, 590, 590, 590, 590, 590, + 590, 590, 590, 590, 590, 590, 590, 590, 590, 590, + 590, 590, 590, 590, 590, 590, 590, 590, 590, 590, + 590, 590, 590, 590, 594, 672, 717, 717, 597, 818, + 818, 938, 672, 691, 691, 691, 691, 718, 718, 594, + 594, 594, 594, 597, 597, 597, 597, 659, 660, 661, + 594, 663, 828, 828, 659, 660, 661, 662, 663, 672, + 907, 659, 660, 661, 662, 663, 594, 599, 939, 717, + + 906, 662, 692, 692, 692, 692, 938, 695, 724, 724, + 718, 695, 599, 599, 599, 599, 695, 724, 739, 739, + 661, 599, 599, 599, 983, 663, 983, 739, 662, 830, + 830, 831, 831, 832, 832, 599, 599, 599, 599, 599, + 599, 603, 603, 939, 603, 603, 603, 603, 603, 603, + 603, 603, 603, 603, 603, 603, 603, 603, 603, 603, + 603, 603, 603, 603, 603, 603, 603, 603, 603, 603, + 603, 603, 603, 603, 603, 603, 603, 603, 603, 603, + 603, 603, 603, 603, 603, 603, 603, 603, 603, 603, + 603, 603, 603, 603, 603, 603, 603, 603, 603, 603, + + 603, 603, 603, 603, 603, 664, 699, 699, 733, 733, + 700, 700, 664, 703, 703, 715, 715, 703, 904, 664, + 716, 716, 699, 699, 699, 699, 700, 700, 700, 700, + 747, 715, 715, 715, 715, 882, 716, 716, 716, 716, + 740, 740, 834, 834, 880, 747, 747, 747, 747, 740, + 703, 733, 896, 664, 684, 684, 896, 684, 684, 684, + 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, + 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, + 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, + 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, + + 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, + 684, 684, 684, 684, 684, 684, 684, 684, 697, 697, + 697, 697, 697, 697, 879, 697, 697, 697, 697, 697, + 697, 697, 697, 697, 697, 697, 697, 697, 697, 697, + 697, 697, 697, 697, 697, 697, 697, 697, 697, 697, + 697, 697, 697, 697, 697, 697, 697, 697, 697, 697, + 697, 697, 697, 697, 697, 697, 697, 697, 697, 697, + 697, 697, 697, 697, 697, 697, 697, 697, 697, 697, + 697, 697, 704, 704, 709, 709, 704, 748, 709, 710, + 710, 731, 731, 710, 877, 732, 732, 835, 835, 836, + + 836, 876, 748, 748, 748, 748, 875, 731, 731, 731, + 731, 732, 732, 732, 732, 838, 838, 839, 839, 704, + 872, 709, 840, 840, 844, 844, 710, 713, 713, 713, + 713, 713, 713, 713, 713, 713, 713, 713, 713, 713, + 713, 713, 713, 713, 713, 713, 713, 713, 713, 713, + 713, 713, 713, 713, 713, 713, 713, 713, 713, 713, + 713, 713, 713, 713, 713, 713, 713, 713, 713, 713, + 713, 713, 713, 713, 713, 713, 713, 713, 713, 713, + 713, 713, 713, 713, 713, 713, 713, 713, 713, 713, + 713, 719, 719, 720, 720, 719, 781, 720, 725, 725, + + 726, 726, 725, 841, 726, 845, 841, 885, 845, 897, + 781, 886, 871, 897, 885, 870, 781, 887, 886, 887, + 887, 885, 898, 899, 869, 886, 898, 899, 719, 900, + 720, 868, 901, 900, 866, 725, 901, 726, 729, 729, + 729, 729, 729, 729, 729, 729, 729, 729, 729, 729, + 729, 729, 729, 729, 729, 729, 729, 729, 729, 729, + 729, 729, 729, 729, 729, 729, 729, 729, 729, 729, + 729, 729, 729, 729, 729, 729, 729, 729, 729, 729, + 729, 729, 729, 729, 729, 729, 729, 729, 729, 729, + 729, 729, 729, 729, 729, 729, 729, 729, 729, 729, + + 729, 729, 734, 734, 735, 735, 736, 736, 735, 814, + 736, 741, 741, 742, 742, 741, 814, 742, 902, 889, + 903, 905, 902, 865, 903, 935, 889, 935, 935, 936, + 985, 985, 985, 905, 985, 986, 986, 986, 864, 905, + 936, 735, 863, 736, 814, 734, 862, 936, 741, 889, + 742, 745, 745, 745, 745, 745, 745, 745, 745, 745, + 745, 745, 745, 745, 745, 745, 745, 745, 745, 745, + 745, 745, 745, 745, 745, 745, 745, 745, 745, 745, + 745, 745, 745, 745, 745, 745, 745, 745, 745, 745, + 745, 745, 745, 745, 745, 745, 745, 745, 745, 745, + + 745, 745, 745, 745, 745, 745, 745, 745, 745, 745, + 745, 745, 745, 745, 745, 757, 933, 815, 757, 934, + 933, 937, 861, 934, 815, 991, 991, 933, 991, 859, + 934, 858, 937, 856, 933, 992, 992, 934, 855, 937, + 987, 987, 987, 854, 987, 988, 988, 988, 990, 990, + 990, 757, 761, 761, 815, 761, 761, 761, 761, 761, + 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, + 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, + 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, + 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, + + 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, + 761, 761, 761, 761, 761, 761, 804, 805, 806, 807, + 942, 943, 883, 804, 805, 806, 807, 884, 944, 883, + 804, 805, 806, 807, 884, 945, 883, 946, 947, 948, + 949, 884, 950, 951, 989, 989, 989, 853, 989, 1017, + 1017, 1018, 1018, 1019, 1019, 852, 851, 806, 804, 883, + 850, 805, 849, 847, 884, 942, 943, 807, 846, 843, + 842, 821, 812, 944, 803, 802, 801, 800, 799, 798, + 945, 797, 946, 947, 948, 949, 796, 950, 951, 1050, + 795, 1050, 1050, 1050, 1050, 1050, 1050, 1050, 1050, 1050, + + 1051, 794, 793, 1051, 1051, 1052, 790, 1052, 1052, 1052, + 1052, 1052, 1052, 1052, 1052, 1052, 1053, 1053, 1053, 1053, + 1053, 1053, 1053, 1053, 1054, 1054, 1054, 1054, 1054, 1054, + 1054, 1054, 1054, 1054, 1054, 1055, 1055, 1055, 1055, 1056, + 789, 1056, 787, 1056, 1056, 1056, 1056, 1057, 1057, 1057, + 1057, 1057, 1057, 1057, 1058, 785, 1058, 1058, 1058, 1058, + 1058, 1058, 1058, 1058, 1058, 1059, 783, 1059, 1059, 1059, + 1059, 1059, 1059, 1059, 1059, 1059, 1060, 782, 1060, 1060, + 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1061, 780, 1061, 1061, 1061, 1061, 1061, 1061, 1061, 1061, 1061, 1062, 1062, - 786, 1062, 1062, 1062, 1062, 1062, 1062, 1062, 1062, 1063, - 1063, 1063, 1063, 1063, 1063, 1063, 1063, 1063, 1063, 1063, - 1064, 1064, 1064, 1064, 1064, 1064, 1064, 1064, 1064, 1064, - 1064, 1065, 1065, 1065, 1065, 1065, 1065, 1065, 1065, 1065, - 1065, 1065, 1066, 1066, 1066, 1066, 1066, 1066, 1066, 1066, - 1066, 1066, 1066, 1067, 1067, 1067, 1067, 1067, 1067, 1067, - 1067, 1067, 1067, 1067, 1068, 1068, 1068, 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, 784, - 1072, 1072, 1072, 1072, 1072, 1072, 1072, 1072, 1072, 1073, - 782, 1073, 1073, 1073, 1073, 1073, 1073, 1073, 1073, 1073, - 1074, 780, 1074, 1074, 1074, 1074, 1074, 1074, 1074, 1074, - 1074, 1075, 779, 1075, 1075, 1075, 1075, 1075, 1075, 1075, - 1075, 1075, 1076, 777, 776, 1076, 1076, 1077, 775, 1077, - 1077, 1077, 1077, 1077, 1077, 1077, 1077, 1077, 1078, 774, - 773, 1078, 1078, 1078, 1079, 772, 771, 1079, 1080, 1080, - - 1080, 1080, 1080, 1080, 1080, 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, - 1084, 1084, 1084, 1084, 1085, 769, 1085, 1085, 1085, 1085, - 1086, 1086, 1086, 1086, 1086, 1086, 1086, 1087, 768, 1087, - 1087, 1087, 1087, 1087, 1087, 1087, 1087, 1087, 1088, 767, - 1088, 1088, 1088, 1088, 1088, 1088, 1088, 1088, 1088, 1089, - 766, 1089, 1089, 1089, 1089, 1089, 1089, 1089, 1089, 1089, - 1090, 763, 1090, 1090, 1090, 1090, 1090, 1090, 1090, 1090, - 1090, 1091, 1091, 761, 1091, 1091, 1091, 1091, 1091, 1091, - - 1091, 1091, 1092, 1092, 1092, 1092, 1092, 1092, 1092, 1092, - 1092, 1092, 1092, 1093, 1093, 760, 1093, 1093, 1093, 1093, - 1093, 1093, 1093, 1093, 1094, 1094, 1094, 1094, 1094, 1094, - 1094, 1094, 1094, 1094, 1094, 1095, 1095, 1095, 1095, 1095, - 1095, 1095, 1095, 1095, 1095, 1095, 1096, 1096, 1096, 1096, - 1096, 1096, 1096, 1096, 1096, 1096, 1096, 1097, 1097, 1097, - 1097, 1097, 1097, 1097, 1097, 1097, 1097, 1097, 1098, 1098, - 1098, 1098, 1098, 1098, 1098, 1098, 1098, 1098, 1098, 1099, - 1099, 1099, 1099, 1099, 1099, 1099, 1099, 1099, 1099, 1099, - 1100, 1100, 1100, 1100, 1100, 1100, 1100, 1100, 1100, 1100, - - 1100, 1101, 1101, 1101, 1101, 1101, 1101, 1101, 1101, 1101, - 1101, 1101, 1102, 1102, 1102, 1102, 1102, 1102, 1102, 1102, - 1102, 1102, 1102, 1103, 759, 1103, 1103, 1103, 1103, 1103, - 1103, 1103, 1103, 1103, 1104, 757, 1104, 1104, 1104, 1104, - 1104, 1104, 1104, 1104, 1104, 1105, 756, 1105, 1105, 1105, - 1105, 1105, 1105, 1105, 1105, 1105, 1106, 753, 1106, 1106, - 1106, 1106, 1106, 1106, 1106, 1106, 1106, 1107, 751, 750, - 1107, 1107, 1108, 743, 727, 1108, 1108, 1108, 1109, 711, - 695, 1109, 1110, 691, 1110, 1110, 1110, 1110, 1110, 1110, - 1110, 1110, 1110, 1111, 690, 1111, 1111, 1111, 1111, 1111, - - 1111, 1111, 1111, 1111, 1112, 685, 1112, 1112, 1112, 1112, - 1112, 1112, 1112, 1112, 1112, 1113, 1113, 1113, 1113, 1113, - 1113, 1113, 1113, 1114, 1114, 1114, 1114, 1114, 1114, 1114, - 1114, 1114, 1114, 1114, 1115, 1115, 1115, 1115, 1115, 1115, - 1116, 684, 1116, 1116, 1116, 1116, 1117, 682, 1117, 1117, - 1117, 1117, 1118, 1118, 1118, 1118, 1118, 1118, 1118, 1119, - 677, 1119, 1119, 1119, 1119, 1119, 1119, 1119, 1119, 1119, - 1120, 673, 1120, 1120, 1120, 1120, 1120, 1120, 1120, 1120, - 1120, 1121, 672, 1121, 1121, 1121, 1121, 1121, 1121, 1121, - 1121, 1121, 1122, 667, 1122, 1122, 1122, 1122, 1122, 1122, - - 1122, 1122, 1122, 1123, 1123, 1123, 1123, 1123, 1123, 1123, - 1124, 1124, 666, 1124, 1124, 1124, 1124, 1124, 1124, 1124, - 1124, 1125, 1125, 1125, 1125, 1125, 1125, 1125, 1125, 1125, - 1125, 1125, 1126, 1126, 1126, 1126, 1126, 1126, 1126, 1126, - 1126, 1126, 1126, 1127, 1127, 1127, 1127, 1127, 1127, 1127, - 1127, 1127, 1127, 1127, 1128, 1128, 1128, 1128, 1128, 1128, - 1128, 1128, 1128, 1128, 1128, 1129, 1129, 1129, 1129, 1129, - 1129, 1129, 1129, 1129, 1129, 1129, 1130, 1130, 1130, 1130, - 1130, 1130, 1130, 1130, 1130, 1130, 1130, 1131, 1131, 1131, - 1131, 1131, 1131, 1131, 1131, 1131, 1131, 1131, 1132, 1132, - - 1132, 1132, 1132, 1132, 1132, 1132, 1132, 1132, 1132, 1133, - 1133, 1133, 1133, 1133, 1133, 1133, 1133, 1133, 1133, 1133, - 1134, 1134, 1134, 1134, 1134, 1134, 1134, 1134, 1134, 1134, - 1134, 1135, 1135, 1135, 1135, 1135, 1135, 1135, 1135, 1135, - 1135, 1135, 1136, 1136, 1136, 1136, 1136, 1136, 1136, 1136, - 1136, 1136, 1136, 1137, 1137, 1137, 1137, 1137, 1137, 1137, - 1137, 1137, 1137, 1137, 1138, 665, 1138, 1138, 1138, 1138, - 1138, 1138, 1138, 1138, 1138, 1139, 664, 1139, 1139, 1139, - 1139, 1139, 1139, 1139, 1139, 1139, 1140, 651, 1140, 1140, - 1140, 1140, 1140, 1140, 1140, 1140, 1140, 1141, 647, 1141, - - 1141, 1141, 1141, 1141, 1141, 1141, 1141, 1141, 1142, 646, - 645, 1142, 1142, 1142, 1143, 644, 1143, 1143, 1143, 1143, - 1143, 1143, 1143, 1143, 1143, 1144, 643, 1144, 1144, 1144, - 1144, 1144, 1144, 1144, 1144, 1144, 1145, 641, 1145, 1145, - 1145, 1145, 1145, 1145, 1145, 1145, 1145, 1146, 1146, 1146, - 1146, 1146, 1146, 1146, 1146, 1147, 1147, 1147, 1147, 1147, - 1147, 1147, 1147, 1147, 1147, 1147, 1148, 640, 1148, 1148, - 1148, 1148, 1149, 639, 1149, 1149, 1149, 1149, 1150, 1150, - 1150, 1150, 1150, 1150, 1150, 1151, 638, 1151, 1151, 1151, - 1151, 1151, 1151, 1151, 1151, 1151, 1152, 637, 1152, 1152, - - 1152, 1152, 1152, 1152, 1152, 1152, 1152, 1153, 636, 1153, - 1153, 1153, 1153, 1153, 1153, 1153, 1153, 1153, 1154, 634, - 1154, 1154, 1154, 1154, 1154, 1154, 1154, 1154, 1154, 1155, - 1155, 1155, 1155, 1155, 1155, 1155, 1156, 1156, 633, 1156, - 1156, 1156, 1156, 1156, 1156, 1156, 1156, 1157, 1157, 1157, + + 1062, 1062, 1062, 1062, 1062, 1063, 1063, 779, 1063, 1063, + 1063, 1063, 1063, 1063, 1063, 1063, 1064, 1064, 1064, 1064, + 1064, 1064, 1064, 1064, 1064, 1064, 1064, 1065, 1065, 778, + 1065, 1065, 1065, 1065, 1065, 1065, 1065, 1065, 1066, 1066, + 1066, 1066, 1066, 1066, 1066, 1066, 1066, 1066, 1066, 1067, + 1067, 1067, 1067, 1067, 1067, 1067, 1067, 1067, 1067, 1067, + 1068, 1068, 1068, 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, 777, 1075, + 1075, 1075, 1075, 1075, 1075, 1075, 1075, 1075, 1076, 776, + 1076, 1076, 1076, 1076, 1076, 1076, 1076, 1076, 1076, 1077, + 775, 1077, 1077, 1077, 1077, 1077, 1077, 1077, 1077, 1077, + 1078, 774, 1078, 1078, 1078, 1078, 1078, 1078, 1078, 1078, + 1078, 1079, 772, 771, 1079, 1079, 1080, 770, 1080, 1080, + 1080, 1080, 1080, 1080, 1080, 1080, 1080, 1081, 769, 766, + + 1081, 1081, 1081, 1082, 764, 763, 1082, 1083, 1083, 1083, + 1083, 1083, 1083, 1083, 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, 1087, + 1087, 1087, 1087, 1088, 762, 1088, 1088, 1088, 1088, 1089, + 1089, 1089, 1089, 1089, 1089, 1089, 1090, 760, 1090, 1090, + 1090, 1090, 1090, 1090, 1090, 1090, 1090, 1091, 759, 1091, + 1091, 1091, 1091, 1091, 1091, 1091, 1091, 1091, 1092, 756, + 1092, 1092, 1092, 1092, 1092, 1092, 1092, 1092, 1092, 1093, + 754, 1093, 1093, 1093, 1093, 1093, 1093, 1093, 1093, 1093, + + 1094, 1094, 753, 1094, 1094, 1094, 1094, 1094, 1094, 1094, + 1094, 1095, 1095, 1095, 1095, 1095, 1095, 1095, 1095, 1095, + 1095, 1095, 1096, 1096, 746, 1096, 1096, 1096, 1096, 1096, + 1096, 1096, 1096, 1097, 1097, 1097, 1097, 1097, 1097, 1097, + 1097, 1097, 1097, 1097, 1098, 1098, 1098, 1098, 1098, 1098, + 1098, 1098, 1098, 1098, 1098, 1099, 1099, 1099, 1099, 1099, + 1099, 1099, 1099, 1099, 1099, 1099, 1100, 1100, 1100, 1100, + 1100, 1100, 1100, 1100, 1100, 1100, 1100, 1101, 1101, 1101, + 1101, 1101, 1101, 1101, 1101, 1101, 1101, 1101, 1102, 1102, + 1102, 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, 730, 1106, 1106, 1106, 1106, 1106, 1106, + 1106, 1106, 1106, 1107, 714, 1107, 1107, 1107, 1107, 1107, + 1107, 1107, 1107, 1107, 1108, 698, 1108, 1108, 1108, 1108, + 1108, 1108, 1108, 1108, 1108, 1109, 694, 1109, 1109, 1109, + 1109, 1109, 1109, 1109, 1109, 1109, 1110, 693, 688, 1110, + 1110, 1111, 687, 685, 1111, 1111, 1111, 1112, 680, 676, + 1112, 1113, 675, 1113, 1113, 1113, 1113, 1113, 1113, 1113, + + 1113, 1113, 1114, 670, 1114, 1114, 1114, 1114, 1114, 1114, + 1114, 1114, 1114, 1115, 669, 1115, 1115, 1115, 1115, 1115, + 1115, 1115, 1115, 1115, 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, 1119, + 668, 1119, 1119, 1119, 1119, 1120, 667, 1120, 1120, 1120, + 1120, 1121, 1121, 1121, 1121, 1121, 1121, 1121, 1122, 654, + 1122, 1122, 1122, 1122, 1122, 1122, 1122, 1122, 1122, 1123, + 650, 1123, 1123, 1123, 1123, 1123, 1123, 1123, 1123, 1123, + 1124, 648, 1124, 1124, 1124, 1124, 1124, 1124, 1124, 1124, + + 1124, 1125, 647, 1125, 1125, 1125, 1125, 1125, 1125, 1125, + 1125, 1125, 1126, 1126, 1126, 1126, 1126, 1126, 1126, 1127, + 1127, 646, 1127, 1127, 1127, 1127, 1127, 1127, 1127, 1127, + 1128, 1128, 1128, 1128, 1128, 1128, 1128, 1128, 1128, 1128, + 1128, 1129, 1129, 1129, 1129, 1129, 1129, 1129, 1129, 1129, + 1129, 1129, 1130, 1130, 1130, 1130, 1130, 1130, 1130, 1130, + 1130, 1130, 1130, 1131, 1131, 1131, 1131, 1131, 1131, 1131, + 1131, 1131, 1131, 1131, 1132, 1132, 1132, 1132, 1132, 1132, + 1132, 1132, 1132, 1132, 1132, 1133, 1133, 1133, 1133, 1133, + 1133, 1133, 1133, 1133, 1133, 1133, 1134, 1134, 1134, 1134, + + 1134, 1134, 1134, 1134, 1134, 1134, 1134, 1135, 1135, 1135, + 1135, 1135, 1135, 1135, 1135, 1135, 1135, 1135, 1136, 1136, + 1136, 1136, 1136, 1136, 1136, 1136, 1136, 1136, 1136, 1137, + 1137, 1137, 1137, 1137, 1137, 1137, 1137, 1137, 1137, 1137, + 1138, 1138, 1138, 1138, 1138, 1138, 1138, 1138, 1138, 1138, + 1138, 1139, 1139, 1139, 1139, 1139, 1139, 1139, 1139, 1139, + 1139, 1139, 1140, 1140, 1140, 1140, 1140, 1140, 1140, 1140, + 1140, 1140, 1140, 1141, 645, 1141, 1141, 1141, 1141, 1141, + 1141, 1141, 1141, 1141, 1142, 643, 1142, 1142, 1142, 1142, + 1142, 1142, 1142, 1142, 1142, 1143, 642, 1143, 1143, 1143, + + 1143, 1143, 1143, 1143, 1143, 1143, 1144, 641, 1144, 1144, + 1144, 1144, 1144, 1144, 1144, 1144, 1144, 1145, 640, 639, + 1145, 1145, 1145, 1146, 638, 1146, 1146, 1146, 1146, 1146, + 1146, 1146, 1146, 1146, 1147, 636, 1147, 1147, 1147, 1147, + 1147, 1147, 1147, 1147, 1147, 1148, 635, 1148, 1148, 1148, + 1148, 1148, 1148, 1148, 1148, 1148, 1149, 1149, 1149, 1149, + 1149, 1149, 1149, 1149, 1150, 1150, 1150, 1150, 1150, 1150, + 1150, 1150, 1150, 1150, 1150, 1151, 634, 1151, 1151, 1151, + 1151, 1152, 633, 1152, 1152, 1152, 1152, 1153, 1153, 1153, + 1153, 1153, 1153, 1153, 1154, 632, 1154, 1154, 1154, 1154, + + 1154, 1154, 1154, 1154, 1154, 1155, 631, 1155, 1155, 1155, + 1155, 1155, 1155, 1155, 1155, 1155, 1156, 630, 1156, 1156, + 1156, 1156, 1156, 1156, 1156, 1156, 1156, 1157, 629, 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, 1163, 1163, 1163, 1163, 1163, 1163, - 1163, 1163, 1163, 1163, 1164, 1164, 1164, 1164, 1164, 1164, - 1164, 1164, 1164, 1164, 1164, 1165, 1165, 1165, 1165, 1165, - 1165, 1165, 1165, 1165, 1165, 1165, 1166, 1166, 1166, 1166, - 1166, 1166, 1166, 1166, 1166, 1166, 1166, 1167, 1167, 1167, - 1167, 1167, 1167, 1167, 1167, 1167, 1167, 1167, 1168, 1168, - 1168, 1168, 1168, 1168, 1168, 1168, 1168, 1168, 1168, 1169, - 1169, 1169, 1169, 1169, 1169, 1169, 1169, 1169, 1169, 1169, - 1170, 632, 1170, 1170, 1170, 1170, 1170, 1170, 1170, 1170, - - 1170, 1171, 631, 1171, 1171, 1171, 1171, 1171, 1171, 1171, - 1171, 1171, 1172, 630, 1172, 1172, 1172, 1172, 1172, 1172, - 1172, 1172, 1172, 1173, 629, 1173, 1173, 1173, 1173, 1173, - 1173, 1173, 1173, 1173, 1174, 628, 627, 1174, 1174, 1174, - 1175, 1175, 1175, 1175, 1175, 1175, 1175, 1175, 1176, 1176, - 1176, 1176, 1176, 1176, 1176, 1176, 1176, 1176, 1176, 1177, - 626, 1177, 1177, 1177, 1177, 1178, 1178, 1178, 1178, 1178, - 1178, 1178, 624, 623, 622, 621, 620, 619, 618, 617, - 616, 614, 613, 612, 611, 610, 609, 608, 607, 606, - 605, 541, 540, 537, 536, 535, 532, 524, 523, 520, - - 519, 518, 517, 512, 511, 510, 509, 496, 493, 491, - 490, 489, 488, 487, 486, 485, 484, 483, 482, 481, - 480, 479, 477, 476, 475, 474, 466, 465, 464, 463, - 462, 461, 460, 459, 458, 456, 455, 453, 452, 451, - 450, 449, 448, 447, 446, 445, 421, 419, 418, 413, - 410, 385, 360, 335, 327, 326, 316, 315, 314, 311, - 303, 302, 298, 288, 285, 284, 280, 274, 273, 271, - 269, 268, 246, 244, 243, 236, 234, 228, 227, 226, - 219, 218, 217, 215, 213, 212, 210, 208, 207, 205, - 204, 203, 193, 166, 164, 161, 147, 133, 117, 107, - - 102, 97, 92, 90, 81, 76, 65, 34, 32, 28, - 23, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, - 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, - 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, - 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, - 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, - 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, - 1046, 1046, 1046, 1046, 1046, 1046 + 1158, 1158, 1158, 1158, 1158, 1159, 1159, 628, 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, + 1163, 1163, 1163, 1163, 1163, 1163, 1163, 1163, 1163, 1163, + + 1164, 1164, 1164, 1164, 1164, 1164, 1164, 1164, 1164, 1164, + 1164, 1165, 1165, 1165, 1165, 1165, 1165, 1165, 1165, 1165, + 1165, 1165, 1166, 1166, 1166, 1166, 1166, 1166, 1166, 1166, + 1166, 1166, 1166, 1167, 1167, 1167, 1167, 1167, 1167, 1167, + 1167, 1167, 1167, 1167, 1168, 1168, 1168, 1168, 1168, 1168, + 1168, 1168, 1168, 1168, 1168, 1169, 1169, 1169, 1169, 1169, + 1169, 1169, 1169, 1169, 1169, 1169, 1170, 1170, 1170, 1170, + 1170, 1170, 1170, 1170, 1170, 1170, 1170, 1171, 1171, 1171, + 1171, 1171, 1171, 1171, 1171, 1171, 1171, 1171, 1172, 1172, + 1172, 1172, 1172, 1172, 1172, 1172, 1172, 1172, 1172, 1173, + + 626, 1173, 1173, 1173, 1173, 1173, 1173, 1173, 1173, 1173, + 1174, 625, 1174, 1174, 1174, 1174, 1174, 1174, 1174, 1174, + 1174, 1175, 624, 1175, 1175, 1175, 1175, 1175, 1175, 1175, + 1175, 1175, 1176, 623, 1176, 1176, 1176, 1176, 1176, 1176, + 1176, 1176, 1176, 1177, 622, 621, 1177, 1177, 1177, 1178, + 1178, 1178, 1178, 1178, 1178, 1178, 1178, 1179, 1179, 1179, + 1179, 1179, 1179, 1179, 1179, 1179, 1179, 1179, 1180, 620, + 1180, 1180, 1180, 1180, 1181, 1181, 1181, 1181, 1181, 1181, + 1181, 619, 618, 616, 615, 614, 613, 612, 611, 610, + 609, 608, 607, 543, 542, 539, 538, 537, 534, 526, + + 525, 522, 521, 520, 519, 514, 513, 512, 511, 498, + 495, 493, 492, 491, 490, 489, 488, 487, 486, 485, + 484, 483, 482, 481, 480, 478, 477, 476, 475, 467, + 466, 465, 464, 463, 462, 461, 460, 459, 457, 456, + 454, 453, 452, 451, 450, 449, 448, 447, 446, 422, + 420, 419, 414, 411, 386, 361, 336, 328, 327, 317, + 316, 315, 312, 304, 303, 299, 289, 286, 285, 281, + 275, 274, 272, 270, 269, 247, 245, 244, 237, 236, + 234, 228, 227, 226, 219, 218, 217, 215, 213, 212, + 210, 208, 207, 205, 204, 203, 193, 166, 164, 161, + + 147, 133, 117, 107, 102, 97, 92, 90, 81, 76, + 65, 34, 32, 28, 23, 1049, 1049, 1049, 1049, 1049, + 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, + 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, + 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, + 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, + 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, + 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049 } ; /* Table of booleans, true if rule could match eol. */ -static yyconst flex_int32_t yy_rule_can_match_eol[145] = +static yyconst flex_int32_t yy_rule_can_match_eol[146] = { 0, 0, 1, 1, 0, 1, 0, 0, 0, 0, 1, 1, 0, 1, 1, 1, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, @@ -2138,8 +2131,8 @@ static yyconst flex_int32_t yy_rule_can_match_eol[145] = 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, }; /* The intent behind this definition is that it'll catch * any uses of REJECT which flex missed. @@ -2226,7 +2219,7 @@ static int handle_identifier(ARGMOD(imc_info_t *imcc), YYSTYPE *valp, ARGIN(cons -#line 2230 "compilers/imcc/imclexer.c" +#line 2223 "compilers/imcc/imclexer.c" #define INITIAL 0 #define emit 1 @@ -2321,6 +2314,10 @@ int yyget_lineno (yyscan_t yyscanner ); void yyset_lineno (int line_number ,yyscan_t yyscanner ); +int yyget_column (yyscan_t yyscanner ); + +void yyset_column (int column_no ,yyscan_t yyscanner ); + /* Macros after this point can all be overridden by user definitions in * section 1. */ @@ -2361,12 +2358,7 @@ static int input (yyscan_t yyscanner ); /* Amount of stuff to slurp up with each read. */ #ifndef YY_READ_BUF_SIZE -#ifdef __ia64__ -/* On IA-64, the buffer size is 16k, not 8k */ -#define YY_READ_BUF_SIZE 16384 -#else #define YY_READ_BUF_SIZE 8192 -#endif /* __ia64__ */ #endif /* Copy whatever the last rule matched to the standard output. */ @@ -2385,7 +2377,7 @@ static int input (yyscan_t yyscanner ); if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \ { \ int c = '*'; \ - size_t n; \ + unsigned n; \ for ( n = 0; n < max_size && \ (c = getc( yyin )) != EOF && c != '\n'; ++n ) \ buf[n] = (char) c; \ @@ -2490,7 +2482,7 @@ YY_DECL return 0; } -#line 2494 "compilers/imcc/imclexer.c" +#line 2486 "compilers/imcc/imclexer.c" if ( !yyg->yy_init ) { @@ -2544,13 +2536,13 @@ YY_DECL 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 >= 1047 ) + if ( yy_current_state >= 1050 ) 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 != 1046 ); + while ( yy_current_state != 1049 ); yy_cp = yyg->yy_last_accepting_cpos; yy_current_state = yyg->yy_last_accepting_state; @@ -2809,7 +2801,7 @@ return ARG; case 24: YY_RULE_SETUP #line 292 "compilers/imcc/imcc.l" -return SUB; +{ SET_LINE_NUMBER; return SUB; } YY_BREAK case 25: YY_RULE_SETUP @@ -2899,336 +2891,341 @@ return POSTCOMP; case 42: YY_RULE_SETUP #line 311 "compilers/imcc/imcc.l" -return ANON; +return SUBTAG; YY_BREAK case 43: YY_RULE_SETUP #line 312 "compilers/imcc/imcc.l" -return OUTER; +return ANON; YY_BREAK case 44: YY_RULE_SETUP #line 313 "compilers/imcc/imcc.l" -return NEED_LEX; +return OUTER; YY_BREAK case 45: YY_RULE_SETUP #line 314 "compilers/imcc/imcc.l" -return VTABLE_METHOD; +return NEED_LEX; YY_BREAK case 46: YY_RULE_SETUP #line 315 "compilers/imcc/imcc.l" -return NS_ENTRY; +return VTABLE_METHOD; YY_BREAK case 47: YY_RULE_SETUP #line 316 "compilers/imcc/imcc.l" -return SUB_INSTANCE_OF; +return NS_ENTRY; YY_BREAK case 48: YY_RULE_SETUP #line 317 "compilers/imcc/imcc.l" -return SUBID; +return SUB_INSTANCE_OF; YY_BREAK case 49: YY_RULE_SETUP -#line 319 "compilers/imcc/imcc.l" -return RESULT; +#line 318 "compilers/imcc/imcc.l" +return SUBID; YY_BREAK case 50: YY_RULE_SETUP #line 320 "compilers/imcc/imcc.l" -return GET_RESULTS; +return RESULT; YY_BREAK case 51: YY_RULE_SETUP #line 321 "compilers/imcc/imcc.l" -return YIELDT; +return GET_RESULTS; YY_BREAK case 52: YY_RULE_SETUP #line 322 "compilers/imcc/imcc.l" -return SET_YIELD; +return YIELDT; YY_BREAK case 53: YY_RULE_SETUP #line 323 "compilers/imcc/imcc.l" -return RETURN; +return SET_YIELD; YY_BREAK case 54: YY_RULE_SETUP #line 324 "compilers/imcc/imcc.l" -return SET_RETURN; +return RETURN; YY_BREAK case 55: YY_RULE_SETUP #line 325 "compilers/imcc/imcc.l" -return TAILCALL; +return SET_RETURN; YY_BREAK case 56: YY_RULE_SETUP #line 326 "compilers/imcc/imcc.l" -return LOADLIB; +return TAILCALL; YY_BREAK case 57: YY_RULE_SETUP -#line 328 "compilers/imcc/imcc.l" -return ADV_FLAT; +#line 327 "compilers/imcc/imcc.l" +return LOADLIB; YY_BREAK case 58: YY_RULE_SETUP #line 329 "compilers/imcc/imcc.l" -return ADV_SLURPY; +return ADV_FLAT; YY_BREAK case 59: YY_RULE_SETUP #line 330 "compilers/imcc/imcc.l" -return ADV_OPTIONAL; +return ADV_SLURPY; YY_BREAK case 60: YY_RULE_SETUP #line 331 "compilers/imcc/imcc.l" -return ADV_OPT_FLAG; +return ADV_OPTIONAL; YY_BREAK case 61: YY_RULE_SETUP #line 332 "compilers/imcc/imcc.l" -return ADV_NAMED; +return ADV_OPT_FLAG; YY_BREAK case 62: YY_RULE_SETUP #line 333 "compilers/imcc/imcc.l" -return ADV_ARROW; +return ADV_NAMED; YY_BREAK case 63: YY_RULE_SETUP #line 334 "compilers/imcc/imcc.l" -return ADV_INVOCANT; +return ADV_ARROW; YY_BREAK case 64: YY_RULE_SETUP #line 335 "compilers/imcc/imcc.l" -return ADV_CALL_SIG; +return ADV_INVOCANT; YY_BREAK case 65: YY_RULE_SETUP -#line 337 "compilers/imcc/imcc.l" -return NAMESPACE; +#line 336 "compilers/imcc/imcc.l" +return ADV_CALL_SIG; YY_BREAK case 66: YY_RULE_SETUP #line 338 "compilers/imcc/imcc.l" -return HLL; +return NAMESPACE; YY_BREAK case 67: YY_RULE_SETUP -#line 340 "compilers/imcc/imcc.l" -return LOCAL; +#line 339 "compilers/imcc/imcc.l" +return HLL; YY_BREAK case 68: YY_RULE_SETUP #line 341 "compilers/imcc/imcc.l" -return CONST; +return LOCAL; YY_BREAK case 69: YY_RULE_SETUP #line 342 "compilers/imcc/imcc.l" -return GLOBAL_CONST; +return CONST; YY_BREAK case 70: YY_RULE_SETUP #line 343 "compilers/imcc/imcc.l" -return PARAM; +return GLOBAL_CONST; YY_BREAK case 71: YY_RULE_SETUP #line 344 "compilers/imcc/imcc.l" -return GOTO; +return PARAM; YY_BREAK case 72: YY_RULE_SETUP #line 345 "compilers/imcc/imcc.l" -return IF; +return GOTO; YY_BREAK case 73: YY_RULE_SETUP #line 346 "compilers/imcc/imcc.l" -return UNLESS; +return IF; YY_BREAK case 74: YY_RULE_SETUP #line 347 "compilers/imcc/imcc.l" -return PNULL; +return UNLESS; YY_BREAK case 75: YY_RULE_SETUP #line 348 "compilers/imcc/imcc.l" -return INTV; +return PNULL; YY_BREAK case 76: YY_RULE_SETUP #line 349 "compilers/imcc/imcc.l" -return FLOATV; +return INTV; YY_BREAK case 77: YY_RULE_SETUP -#line 351 "compilers/imcc/imcc.l" -return PMCV; +#line 350 "compilers/imcc/imcc.l" +return FLOATV; YY_BREAK case 78: YY_RULE_SETUP #line 352 "compilers/imcc/imcc.l" -return STRINGV; +return PMCV; YY_BREAK case 79: YY_RULE_SETUP #line 353 "compilers/imcc/imcc.l" -return SHIFT_LEFT; +return STRINGV; YY_BREAK case 80: YY_RULE_SETUP #line 354 "compilers/imcc/imcc.l" -return SHIFT_RIGHT; +return SHIFT_LEFT; YY_BREAK case 81: YY_RULE_SETUP #line 355 "compilers/imcc/imcc.l" -return SHIFT_RIGHT_U; +return SHIFT_RIGHT; YY_BREAK case 82: YY_RULE_SETUP #line 356 "compilers/imcc/imcc.l" -return LOG_AND; +return SHIFT_RIGHT_U; YY_BREAK case 83: YY_RULE_SETUP #line 357 "compilers/imcc/imcc.l" -return LOG_OR; +return LOG_AND; YY_BREAK case 84: YY_RULE_SETUP #line 358 "compilers/imcc/imcc.l" -return LOG_XOR; +return LOG_OR; YY_BREAK case 85: YY_RULE_SETUP #line 359 "compilers/imcc/imcc.l" -return RELOP_LT; +return LOG_XOR; YY_BREAK case 86: YY_RULE_SETUP #line 360 "compilers/imcc/imcc.l" -return RELOP_LTE; +return RELOP_LT; YY_BREAK case 87: YY_RULE_SETUP #line 361 "compilers/imcc/imcc.l" -return RELOP_GT; +return RELOP_LTE; YY_BREAK case 88: YY_RULE_SETUP #line 362 "compilers/imcc/imcc.l" -return RELOP_GTE; +return RELOP_GT; YY_BREAK case 89: YY_RULE_SETUP #line 363 "compilers/imcc/imcc.l" -return RELOP_EQ; +return RELOP_GTE; YY_BREAK case 90: YY_RULE_SETUP #line 364 "compilers/imcc/imcc.l" -return RELOP_NE; +return RELOP_EQ; YY_BREAK case 91: YY_RULE_SETUP #line 365 "compilers/imcc/imcc.l" -return POW; +return RELOP_NE; YY_BREAK case 92: YY_RULE_SETUP -#line 367 "compilers/imcc/imcc.l" -return CONCAT; +#line 366 "compilers/imcc/imcc.l" +return POW; YY_BREAK case 93: YY_RULE_SETUP #line 368 "compilers/imcc/imcc.l" -return DOT; +return CONCAT; YY_BREAK case 94: YY_RULE_SETUP -#line 370 "compilers/imcc/imcc.l" -return PLUS_ASSIGN; +#line 369 "compilers/imcc/imcc.l" +return DOT; YY_BREAK case 95: YY_RULE_SETUP #line 371 "compilers/imcc/imcc.l" -return MINUS_ASSIGN; +return PLUS_ASSIGN; YY_BREAK case 96: YY_RULE_SETUP #line 372 "compilers/imcc/imcc.l" -return MUL_ASSIGN; +return MINUS_ASSIGN; YY_BREAK case 97: YY_RULE_SETUP #line 373 "compilers/imcc/imcc.l" -return DIV_ASSIGN; +return MUL_ASSIGN; YY_BREAK case 98: YY_RULE_SETUP #line 374 "compilers/imcc/imcc.l" -return MOD_ASSIGN; +return DIV_ASSIGN; YY_BREAK case 99: YY_RULE_SETUP #line 375 "compilers/imcc/imcc.l" -return FDIV; +return MOD_ASSIGN; YY_BREAK case 100: YY_RULE_SETUP #line 376 "compilers/imcc/imcc.l" -return FDIV_ASSIGN; +return FDIV; YY_BREAK case 101: YY_RULE_SETUP #line 377 "compilers/imcc/imcc.l" -return BAND_ASSIGN; +return FDIV_ASSIGN; YY_BREAK case 102: YY_RULE_SETUP #line 378 "compilers/imcc/imcc.l" -return BOR_ASSIGN; +return BAND_ASSIGN; YY_BREAK case 103: YY_RULE_SETUP #line 379 "compilers/imcc/imcc.l" -return BXOR_ASSIGN; +return BOR_ASSIGN; YY_BREAK case 104: YY_RULE_SETUP #line 380 "compilers/imcc/imcc.l" -return SHR_ASSIGN; +return BXOR_ASSIGN; YY_BREAK case 105: YY_RULE_SETUP #line 381 "compilers/imcc/imcc.l" -return SHL_ASSIGN; +return SHR_ASSIGN; YY_BREAK case 106: YY_RULE_SETUP #line 382 "compilers/imcc/imcc.l" -return SHR_U_ASSIGN; +return SHL_ASSIGN; YY_BREAK case 107: YY_RULE_SETUP #line 383 "compilers/imcc/imcc.l" -return CONCAT_ASSIGN; +return SHR_U_ASSIGN; YY_BREAK case 108: YY_RULE_SETUP -#line 385 "compilers/imcc/imcc.l" +#line 384 "compilers/imcc/imcc.l" +return CONCAT_ASSIGN; + YY_BREAK +case 109: +YY_RULE_SETUP +#line 386 "compilers/imcc/imcc.l" { char *macro_name = NULL; int start_cond = YY_START; @@ -3272,18 +3269,18 @@ YY_RULE_SETUP return MACRO; } YY_BREAK -case 109: +case 110: YY_RULE_SETUP -#line 428 "compilers/imcc/imcc.l" +#line 429 "compilers/imcc/imcc.l" { /* the initial whitespace catcher misses this one */ SET_LINE_NUMBER; return read_macro(valp, imcc, yyscanner); } YY_BREAK -case 110: +case 111: YY_RULE_SETUP -#line 434 "compilers/imcc/imcc.l" +#line 435 "compilers/imcc/imcc.l" { const int c = yylex(valp,yyscanner,imcc); STRING *filename; @@ -3298,9 +3295,9 @@ YY_RULE_SETUP include_file(imcc, filename, yyscanner); } YY_BREAK -case 111: +case 112: YY_RULE_SETUP -#line 448 "compilers/imcc/imcc.l" +#line 449 "compilers/imcc/imcc.l" { if (valp) { char *label; @@ -3323,9 +3320,9 @@ YY_RULE_SETUP return LABEL; } YY_BREAK -case 112: +case 113: YY_RULE_SETUP -#line 470 "compilers/imcc/imcc.l" +#line 471 "compilers/imcc/imcc.l" { if (valp) { char *label; @@ -3346,14 +3343,14 @@ YY_RULE_SETUP return IDENTIFIER; } YY_BREAK -case 113: +case 114: YY_RULE_SETUP -#line 490 "compilers/imcc/imcc.l" +#line 491 "compilers/imcc/imcc.l" return COMMA; YY_BREAK -case 114: +case 115: YY_RULE_SETUP -#line 492 "compilers/imcc/imcc.l" +#line 493 "compilers/imcc/imcc.l" { /* trim last ':' */ YYCHOP(); @@ -3364,9 +3361,9 @@ YY_RULE_SETUP return LABEL; } YY_BREAK -case 115: +case 116: YY_RULE_SETUP -#line 502 "compilers/imcc/imcc.l" +#line 503 "compilers/imcc/imcc.l" { char * const macro_name = mem_sys_strndup(yytext + 1, yyleng - 1); int failed = expand_macro(imcc, macro_name, yyscanner); @@ -3377,15 +3374,10 @@ YY_RULE_SETUP } } YY_BREAK -case 116: -YY_RULE_SETUP -#line 514 "compilers/imcc/imcc.l" -DUP_AND_RET(valp, FLOATC); - YY_BREAK case 117: YY_RULE_SETUP #line 515 "compilers/imcc/imcc.l" -DUP_AND_RET(valp, INTC); +DUP_AND_RET(valp, FLOATC); YY_BREAK case 118: YY_RULE_SETUP @@ -3404,16 +3396,21 @@ DUP_AND_RET(valp, INTC); YY_BREAK case 121: YY_RULE_SETUP -#line 520 "compilers/imcc/imcc.l" +#line 519 "compilers/imcc/imcc.l" +DUP_AND_RET(valp, INTC); + YY_BREAK +case 122: +YY_RULE_SETUP +#line 521 "compilers/imcc/imcc.l" { valp->s = mem_sys_strndup(yytext, yyleng); return STRINGC; } YY_BREAK -case 122: +case 123: YY_RULE_SETUP -#line 526 "compilers/imcc/imcc.l" +#line 527 "compilers/imcc/imcc.l" { macro_frame_t *frame; @@ -3442,9 +3439,9 @@ YY_RULE_SETUP yy_push_state(heredoc1, yyscanner); } YY_BREAK -case 123: +case 124: YY_RULE_SETUP -#line 554 "compilers/imcc/imcc.l" +#line 555 "compilers/imcc/imcc.l" { /* charset:"..." */ valp->s = mem_sys_strndup(yytext, yyleng); @@ -3453,9 +3450,9 @@ YY_RULE_SETUP return USTRINGC; } YY_BREAK -case 124: +case 125: YY_RULE_SETUP -#line 562 "compilers/imcc/imcc.l" +#line 563 "compilers/imcc/imcc.l" { if (valp) (valp)->s = yytext; if (imcc->state->pasm_file) @@ -3464,9 +3461,9 @@ YY_RULE_SETUP return IREG; } YY_BREAK -case 125: +case 126: YY_RULE_SETUP -#line 570 "compilers/imcc/imcc.l" +#line 571 "compilers/imcc/imcc.l" { if (valp) (valp)->s = yytext; @@ -3476,9 +3473,9 @@ YY_RULE_SETUP return NREG; } YY_BREAK -case 126: +case 127: YY_RULE_SETUP -#line 579 "compilers/imcc/imcc.l" +#line 580 "compilers/imcc/imcc.l" { if (valp) (valp)->s = yytext; @@ -3488,9 +3485,9 @@ YY_RULE_SETUP return SREG; } YY_BREAK -case 127: +case 128: YY_RULE_SETUP -#line 588 "compilers/imcc/imcc.l" +#line 589 "compilers/imcc/imcc.l" { if (valp) (valp)->s = yytext; @@ -3500,17 +3497,17 @@ YY_RULE_SETUP return PREG; } YY_BREAK -case 128: +case 129: YY_RULE_SETUP -#line 597 "compilers/imcc/imcc.l" +#line 598 "compilers/imcc/imcc.l" { IMCC_fataly(imcc, EXCEPTION_SYNTAX_ERROR, "'%s' is not a valid register name", yytext); } YY_BREAK -case 129: +case 130: YY_RULE_SETUP -#line 602 "compilers/imcc/imcc.l" +#line 603 "compilers/imcc/imcc.l" { if (imcc->state->pasm_file == 0) IMCC_fataly(imcc, EXCEPTION_SYNTAX_ERROR, @@ -3522,26 +3519,26 @@ YY_RULE_SETUP return REG; } YY_BREAK -case 130: +case 131: YY_RULE_SETUP -#line 614 "compilers/imcc/imcc.l" +#line 615 "compilers/imcc/imcc.l" { return handle_identifier(imcc, valp, yytext); } YY_BREAK -case 131: +case 132: YY_RULE_SETUP -#line 616 "compilers/imcc/imcc.l" +#line 617 "compilers/imcc/imcc.l" /* skip */; YY_BREAK -case 132: +case 133: YY_RULE_SETUP -#line 618 "compilers/imcc/imcc.l" +#line 619 "compilers/imcc/imcc.l" { /* catch all except for state macro */ return yytext[0]; } YY_BREAK case YY_STATE_EOF(emit): -#line 623 "compilers/imcc/imcc.l" +#line 624 "compilers/imcc/imcc.l" { BEGIN(INITIAL); @@ -3554,34 +3551,34 @@ case YY_STATE_EOF(emit): } YY_BREAK case YY_STATE_EOF(INITIAL): -#line 634 "compilers/imcc/imcc.l" +#line 635 "compilers/imcc/imcc.l" yyterminate(); YY_BREAK -case 133: +case 134: YY_RULE_SETUP -#line 636 "compilers/imcc/imcc.l" +#line 637 "compilers/imcc/imcc.l" { /* the initial whitespace catcher misses this one */ SET_LINE_NUMBER; DUP_AND_RET(valp, ENDM); } YY_BREAK -case 134: -/* rule 134 can match eol */ +case 135: +/* rule 135 can match eol */ YY_RULE_SETUP -#line 642 "compilers/imcc/imcc.l" +#line 643 "compilers/imcc/imcc.l" { DUP_AND_RET(valp, '\n'); } YY_BREAK -case 135: +case 136: YY_RULE_SETUP -#line 646 "compilers/imcc/imcc.l" +#line 647 "compilers/imcc/imcc.l" return LABEL; YY_BREAK -case 136: +case 137: YY_RULE_SETUP -#line 648 "compilers/imcc/imcc.l" +#line 649 "compilers/imcc/imcc.l" { if (yylex(valp,yyscanner,imcc) != LABEL) @@ -3606,9 +3603,9 @@ YY_RULE_SETUP return LABEL; } YY_BREAK -case 137: +case 138: YY_RULE_SETUP -#line 672 "compilers/imcc/imcc.l" +#line 673 "compilers/imcc/imcc.l" { if (valp) { if (!imcc->cur_macro_name) { @@ -3637,15 +3634,10 @@ YY_RULE_SETUP return IDENTIFIER; } YY_BREAK -case 138: -YY_RULE_SETUP -#line 700 "compilers/imcc/imcc.l" -DUP_AND_RET(valp, ' '); - YY_BREAK case 139: YY_RULE_SETUP #line 701 "compilers/imcc/imcc.l" -DUP_AND_RET(valp, REG); +DUP_AND_RET(valp, ' '); YY_BREAK case 140: YY_RULE_SETUP @@ -3655,28 +3647,33 @@ DUP_AND_RET(valp, REG); case 141: YY_RULE_SETUP #line 703 "compilers/imcc/imcc.l" -DUP_AND_RET(valp, IDENTIFIER); +DUP_AND_RET(valp, REG); YY_BREAK case 142: YY_RULE_SETUP #line 704 "compilers/imcc/imcc.l" -DUP_AND_RET(valp, MACRO); +DUP_AND_RET(valp, IDENTIFIER); YY_BREAK case 143: YY_RULE_SETUP #line 705 "compilers/imcc/imcc.l" +DUP_AND_RET(valp, MACRO); + YY_BREAK +case 144: +YY_RULE_SETUP +#line 706 "compilers/imcc/imcc.l" DUP_AND_RET(valp, yytext[0]); YY_BREAK case YY_STATE_EOF(macro): -#line 706 "compilers/imcc/imcc.l" +#line 707 "compilers/imcc/imcc.l" yyterminate(); YY_BREAK -case 144: +case 145: YY_RULE_SETUP -#line 708 "compilers/imcc/imcc.l" +#line 709 "compilers/imcc/imcc.l" ECHO; YY_BREAK -#line 3680 "compilers/imcc/imclexer.c" +#line 3677 "compilers/imcc/imclexer.c" case YY_STATE_EOF(pod): case YY_STATE_EOF(cmt1): case YY_STATE_EOF(cmt2): @@ -3979,7 +3976,7 @@ static int yy_get_next_buffer (yyscan_t yyscanner) 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 >= 1047 ) + if ( yy_current_state >= 1050 ) yy_c = yy_meta[(unsigned int) yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; @@ -4008,11 +4005,11 @@ static int yy_get_next_buffer (yyscan_t yyscanner) 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 >= 1047 ) + if ( yy_current_state >= 1050 ) 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 == 1046); + yy_is_jam = (yy_current_state == 1049); return yy_is_jam ? 0 : yy_current_state; } @@ -4465,8 +4462,8 @@ YY_BUFFER_STATE yy_scan_string (yyconst char * yystr , yyscan_t yyscanner) /** Setup the input buffer state to scan the given bytes. The next call to yylex() will * scan from a @e copy of @a bytes. - * @param yybytes the byte buffer to scan - * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes. + * @param bytes the byte buffer to scan + * @param len the number of bytes in the buffer pointed to by @a bytes. * @param yyscanner The scanner object. * @return the newly allocated buffer state object. */ @@ -4888,7 +4885,7 @@ void yyfree (void * ptr , yyscan_t yyscanner) #define YYTABLES_NAME "yytables" -#line 708 "compilers/imcc/imcc.l" +#line 709 "compilers/imcc/imcc.l" @@ -5384,7 +5381,7 @@ include_file(ARGMOD(imc_info_t *imcc), ARGIN(STRING *file_name), void *yyscanner if (STRING_IS_NULL(s) || (file = PIO_OPEN(imcc->interp, s, PIO_F_READ)) == PIO_INVALID_HANDLE) { IMCC_fataly(imcc, EXCEPTION_EXTERNAL_ERROR, - "No such file or directory"); + "No such file or directory '%Ss'", file_name); } frame->s.file = file_name; diff --git a/compilers/imcc/imcparser.c b/compilers/imcc/imcparser.c index aa5bb42905..20157eec62 100644 --- a/compilers/imcc/imcparser.c +++ b/compilers/imcc/imcparser.c @@ -570,6 +570,12 @@ mk_pmc_const_named(ARGMOD(imc_info_t *imcc), ARGMOD(IMC_Unit *unit), rhs->usage |= U_FIXUP | U_SUBID_LOOKUP; } + else if (strncmp(unquoted_name, "LexInfo", name_length) == 0) { + rhs = mk_const(imcc, const_name, 'l'); + if (!ascii) + rhs->type |= VT_ENCODED; + rhs->usage |= U_FIXUP | U_LEXINFO_LOOKUP; + } else { rhs = mk_const(imcc, const_name, 'P'); } @@ -1095,7 +1101,7 @@ do_loadlib(ARGMOD(imc_info_t *imcc), ARGIN(const char *lib)) /* TODO: This is very ugly and heavily nested. Can we avoid this? */ if (!STRING_equal(imcc->interp, VTABLE_get_string(imcc->interp, - VTABLE_getprop(imcc->interp, lib_pmc, + Parrot_pmc_getprop(imcc->interp, lib_pmc, Parrot_str_new_constant(imcc->interp, "_type"))), Parrot_str_new_constant(imcc->interp, "Ops"))) imcc_pbc_add_libdep(imcc, s); @@ -1106,7 +1112,7 @@ do_loadlib(ARGMOD(imc_info_t *imcc), ARGIN(const char *lib)) /* Line 189 of yacc.c */ -#line 1099 "compilers/imcc/imcparser.c" +#line 1105 "compilers/imcc/imcparser.c" /* Enabling traces. */ #ifndef YYDEBUG @@ -1221,32 +1227,33 @@ do_loadlib(ARGMOD(imc_info_t *imcc), ARGIN(const char *lib)) OUTER = 343, NEED_LEX = 344, MULTI = 345, - VTABLE_METHOD = 346, - LOADLIB = 347, - SUB_INSTANCE_OF = 348, - SUBID = 349, - NS_ENTRY = 350, - LABEL = 351, - EMIT = 352, - EOM = 353, - IREG = 354, - NREG = 355, - SREG = 356, - PREG = 357, - IDENTIFIER = 358, - REG = 359, - MACRO = 360, - ENDM = 361, - STRINGC = 362, - INTC = 363, - FLOATC = 364, - USTRINGC = 365, - PARROT_OP = 366, - VAR = 367, - LINECOMMENT = 368, - FILECOMMENT = 369, - DOT = 370, - CONCAT = 371 + SUBTAG = 346, + VTABLE_METHOD = 347, + LOADLIB = 348, + SUB_INSTANCE_OF = 349, + SUBID = 350, + NS_ENTRY = 351, + LABEL = 352, + EMIT = 353, + EOM = 354, + IREG = 355, + NREG = 356, + SREG = 357, + PREG = 358, + IDENTIFIER = 359, + REG = 360, + MACRO = 361, + ENDM = 362, + STRINGC = 363, + INTC = 364, + FLOATC = 365, + USTRINGC = 366, + PARROT_OP = 367, + VAR = 368, + LINECOMMENT = 369, + FILECOMMENT = 370, + DOT = 371, + CONCAT = 372 }; #endif /* Tokens. */ @@ -1338,32 +1345,33 @@ do_loadlib(ARGMOD(imc_info_t *imcc), ARGIN(const char *lib)) #define OUTER 343 #define NEED_LEX 344 #define MULTI 345 -#define VTABLE_METHOD 346 -#define LOADLIB 347 -#define SUB_INSTANCE_OF 348 -#define SUBID 349 -#define NS_ENTRY 350 -#define LABEL 351 -#define EMIT 352 -#define EOM 353 -#define IREG 354 -#define NREG 355 -#define SREG 356 -#define PREG 357 -#define IDENTIFIER 358 -#define REG 359 -#define MACRO 360 -#define ENDM 361 -#define STRINGC 362 -#define INTC 363 -#define FLOATC 364 -#define USTRINGC 365 -#define PARROT_OP 366 -#define VAR 367 -#define LINECOMMENT 368 -#define FILECOMMENT 369 -#define DOT 370 -#define CONCAT 371 +#define SUBTAG 346 +#define VTABLE_METHOD 347 +#define LOADLIB 348 +#define SUB_INSTANCE_OF 349 +#define SUBID 350 +#define NS_ENTRY 351 +#define LABEL 352 +#define EMIT 353 +#define EOM 354 +#define IREG 355 +#define NREG 356 +#define SREG 357 +#define PREG 358 +#define IDENTIFIER 359 +#define REG 360 +#define MACRO 361 +#define ENDM 362 +#define STRINGC 363 +#define INTC 364 +#define FLOATC 365 +#define USTRINGC 366 +#define PARROT_OP 367 +#define VAR 368 +#define LINECOMMENT 369 +#define FILECOMMENT 370 +#define DOT 371 +#define CONCAT 372 @@ -1373,7 +1381,7 @@ typedef union YYSTYPE { /* Line 214 of yacc.c */ -#line 1026 "compilers/imcc/imcc.y" +#line 1032 "compilers/imcc/imcc.y" IdList * idlist; int t; @@ -1384,7 +1392,7 @@ typedef union YYSTYPE /* Line 214 of yacc.c */ -#line 1377 "compilers/imcc/imcparser.c" +#line 1385 "compilers/imcc/imcparser.c" } YYSTYPE; # define YYSTYPE_IS_TRIVIAL 1 # define yystype YYSTYPE /* obsolescent; will be withdrawn */ @@ -1396,7 +1404,7 @@ typedef union YYSTYPE /* Line 264 of yacc.c */ -#line 1389 "compilers/imcc/imcparser.c" +#line 1397 "compilers/imcc/imcparser.c" #ifdef short # undef short @@ -1611,20 +1619,20 @@ union yyalloc /* YYFINAL -- State number of the termination state. */ #define YYFINAL 31 /* YYLAST -- Last index in YYTABLE. */ -#define YYLAST 641 +#define YYLAST 659 /* YYNTOKENS -- Number of terminals. */ -#define YYNTOKENS 133 +#define YYNTOKENS 134 /* YYNNTS -- Number of nonterminals. */ -#define YYNNTS 127 +#define YYNNTS 129 /* YYNRULES -- Number of rules. */ -#define YYNRULES 331 +#define YYNRULES 335 /* YYNRULES -- Number of states. */ -#define YYNSTATES 523 +#define YYNSTATES 531 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ #define YYUNDEFTOK 2 -#define YYMAXUTOK 371 +#define YYMAXUTOK 372 #define YYTRANSLATE(YYX) \ ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) @@ -1635,16 +1643,16 @@ static const yytype_uint8 yytranslate[] = 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, 124, 2, 2, 2, 130, 131, 2, - 122, 123, 128, 127, 2, 126, 2, 129, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 121, - 2, 118, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 125, 2, 2, 2, 131, 132, 2, + 123, 124, 129, 128, 2, 127, 2, 130, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 122, + 2, 119, 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, 119, 2, 120, 2, 2, 2, 2, 2, 2, + 2, 120, 2, 121, 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, 132, 2, 125, 2, 2, 2, + 2, 2, 2, 2, 133, 2, 126, 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, @@ -1669,7 +1677,7 @@ static const yytype_uint8 yytranslate[] = 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 + 116, 117, 118 }; #if YYDEBUG @@ -1683,171 +1691,172 @@ static const yytype_uint16 yyprhs[] = 86, 88, 90, 92, 94, 95, 99, 100, 105, 108, 113, 114, 116, 117, 122, 123, 125, 129, 133, 136, 137, 140, 142, 146, 147, 148, 149, 159, 160, 161, - 167, 171, 176, 181, 186, 188, 193, 195, 200, 202, - 207, 212, 214, 219, 220, 224, 226, 228, 230, 232, - 234, 236, 238, 242, 243, 245, 246, 256, 257, 260, - 261, 265, 266, 268, 270, 273, 275, 277, 279, 281, - 283, 285, 287, 289, 291, 293, 295, 297, 299, 301, - 307, 311, 312, 316, 319, 320, 324, 328, 329, 334, - 335, 338, 340, 342, 344, 346, 351, 356, 358, 359, - 365, 367, 368, 374, 375, 378, 382, 383, 386, 390, - 394, 398, 399, 405, 407, 409, 410, 412, 416, 420, - 426, 428, 431, 432, 434, 437, 440, 442, 444, 446, - 448, 449, 451, 454, 456, 458, 462, 465, 467, 471, - 473, 475, 477, 478, 483, 488, 493, 494, 501, 503, - 504, 511, 514, 517, 520, 523, 525, 527, 529, 531, - 532, 534, 536, 538, 540, 544, 549, 555, 562, 569, - 573, 574, 584, 586, 588, 590, 594, 596, 598, 600, - 602, 604, 606, 608, 610, 612, 614, 616, 618, 620, - 622, 624, 626, 628, 630, 632, 634, 636, 638, 640, - 642, 644, 646, 647, 653, 657, 661, 663, 665, 667, - 669, 671, 673, 675, 677, 679, 681, 683, 685, 690, - 692, 694, 696, 698, 702, 706, 710, 714, 715, 721, - 722, 726, 728, 734, 738, 742, 745, 746, 749, 751, - 753, 755, 760, 765, 768, 772, 778, 780, 784, 785, - 787, 789, 796, 802, 807, 812, 819, 825, 827, 829, - 831, 833, 835, 837, 839, 841, 843, 845, 846, 848, - 852, 854, 856, 861, 865, 867, 869, 871, 873, 875, - 877, 879, 881, 883, 885, 887, 888, 891, 892, 895, - 897, 901, 903, 905, 907, 909, 911, 913, 915, 917, - 919, 921 + 167, 171, 176, 177, 181, 183, 185, 187, 189, 191, + 193, 195, 199, 204, 208, 210, 215, 220, 222, 227, + 229, 234, 236, 241, 246, 248, 253, 254, 256, 257, + 267, 268, 271, 272, 276, 277, 279, 281, 284, 286, + 288, 290, 292, 294, 296, 298, 300, 302, 304, 306, + 308, 310, 312, 314, 320, 324, 325, 329, 332, 333, + 337, 341, 342, 347, 348, 351, 353, 355, 357, 359, + 364, 369, 371, 372, 378, 380, 381, 387, 388, 391, + 395, 396, 399, 403, 407, 411, 412, 418, 420, 422, + 423, 425, 429, 433, 439, 441, 444, 445, 447, 450, + 453, 455, 457, 459, 461, 462, 464, 467, 469, 471, + 475, 478, 480, 484, 486, 488, 490, 491, 496, 501, + 506, 507, 514, 516, 517, 524, 527, 530, 533, 536, + 538, 540, 542, 544, 545, 547, 549, 551, 553, 557, + 562, 568, 575, 582, 586, 587, 597, 599, 601, 603, + 607, 609, 611, 613, 615, 617, 619, 621, 623, 625, + 627, 629, 631, 633, 635, 637, 639, 641, 643, 645, + 647, 649, 651, 653, 655, 657, 659, 660, 666, 670, + 674, 676, 678, 680, 682, 684, 686, 688, 690, 692, + 694, 696, 698, 703, 705, 707, 709, 711, 715, 719, + 723, 727, 728, 734, 735, 739, 741, 747, 751, 755, + 758, 759, 762, 764, 766, 768, 773, 778, 781, 785, + 791, 793, 797, 798, 800, 802, 809, 815, 820, 825, + 832, 838, 840, 842, 844, 846, 848, 850, 852, 854, + 856, 858, 859, 861, 865, 867, 869, 874, 878, 880, + 882, 884, 886, 888, 890, 892, 894, 896, 898, 900, + 901, 904, 905, 908, 910, 914, 916, 918, 920, 922, + 924, 926, 928, 930, 932, 934 }; /* YYRHS -- A `-1'-separated list of the rules' RHS. */ static const yytype_int16 yyrhs[] = { - 134, 0, -1, 135, -1, 136, -1, 135, 136, -1, - 155, -1, 141, -1, 160, -1, 152, -1, 106, 4, - -1, 137, -1, 138, -1, 4, -1, 140, 4, -1, - 93, 108, 4, -1, 8, 109, 70, 108, 4, -1, - 9, 108, 4, -1, 32, 108, 70, 259, -1, 7, - 108, -1, -1, 31, 142, 218, 104, 118, 259, -1, - -1, 31, 144, 108, 249, 118, 145, -1, 108, -1, - 111, -1, 147, -1, 146, 147, -1, 208, 148, 4, - -1, 106, 4, -1, 115, -1, 114, -1, 155, -1, - 143, -1, 137, -1, -1, 149, 112, 151, -1, -1, - 76, 150, 182, 97, -1, 14, 250, -1, 30, 108, - 70, 105, -1, -1, 243, -1, -1, 98, 153, 154, - 99, -1, -1, 146, -1, 25, 156, 4, -1, 119, - 157, 120, -1, 119, 120, -1, -1, 158, 159, -1, - 258, -1, 159, 121, 258, -1, -1, -1, -1, 27, - 161, 246, 162, 182, 4, 163, 177, 71, -1, -1, - -1, 5, 165, 167, 4, 166, -1, 218, 104, 191, - -1, 91, 122, 175, 123, -1, 89, 122, 108, 123, - -1, 89, 122, 104, 123, -1, 92, -1, 92, 122, - 108, 123, -1, 87, -1, 87, 122, 145, 123, -1, - 96, -1, 96, 122, 145, 123, -1, 94, 122, 108, - 123, -1, 95, -1, 95, 122, 145, 123, -1, -1, - 175, 70, 176, -1, 176, -1, 50, -1, 51, -1, - 53, -1, 52, -1, 104, -1, 108, -1, 119, 251, - 120, -1, -1, 205, -1, -1, 73, 4, 179, 186, - 181, 185, 180, 188, 74, -1, -1, 210, 4, -1, - -1, 81, 250, 4, -1, -1, 183, -1, 184, -1, - 183, 184, -1, 83, -1, 84, -1, 82, -1, 85, - -1, 86, -1, 88, -1, 90, -1, 168, -1, 169, - -1, 170, -1, 171, -1, 172, -1, 173, -1, 174, - -1, 75, 250, 70, 250, 4, -1, 75, 250, 4, - -1, -1, 186, 187, 4, -1, 11, 232, -1, -1, - 188, 189, 4, -1, 61, 242, 191, -1, -1, 29, - 190, 218, 213, -1, -1, 191, 192, -1, 18, -1, - 19, -1, 20, -1, 21, -1, 21, 122, 108, 123, - -1, 21, 122, 111, 123, -1, 24, -1, -1, 77, - 4, 194, 197, 78, -1, 201, -1, -1, 79, 4, - 196, 198, 80, -1, -1, 197, 4, -1, 197, 199, - 4, -1, -1, 198, 4, -1, 198, 200, 4, -1, - 15, 250, 233, -1, 16, 250, 233, -1, -1, 203, - 122, 202, 204, 123, -1, 62, -1, 64, -1, -1, - 232, -1, 108, 22, 250, -1, 204, 70, 232, -1, - 204, 70, 108, 22, 250, -1, 207, -1, 205, 207, - -1, -1, 164, -1, 206, 211, -1, 106, 4, -1, - 115, -1, 114, -1, 138, -1, 139, -1, -1, 209, - -1, 209, 210, -1, 210, -1, 97, -1, 208, 214, - 4, -1, 1, 4, -1, 213, -1, 212, 70, 213, - -1, 104, -1, 219, -1, 237, -1, -1, 29, 215, - 218, 212, -1, 30, 108, 70, 242, -1, 30, 111, - 70, 242, -1, -1, 31, 216, 218, 104, 118, 259, - -1, 143, -1, -1, 33, 217, 218, 104, 118, 259, - -1, 63, 229, -1, 10, 248, -1, 112, 243, -1, - 14, 250, -1, 229, -1, 178, -1, 193, -1, 195, - -1, -1, 50, -1, 51, -1, 52, -1, 53, -1, - 242, 118, 250, -1, 242, 118, 221, 250, -1, 242, - 118, 250, 222, 250, -1, 242, 118, 250, 119, 251, - 120, -1, 242, 119, 251, 120, 118, 250, -1, 242, - 118, 229, -1, -1, 122, 220, 236, 123, 118, 228, - 122, 231, 123, -1, 223, -1, 225, -1, 227, -1, - 242, 118, 14, -1, 124, -1, 125, -1, 126, -1, - 126, -1, 127, -1, 128, -1, 129, -1, 130, -1, - 42, -1, 66, -1, 117, -1, 55, -1, 56, -1, - 57, -1, 58, -1, 59, -1, 60, -1, 48, -1, - 49, -1, 67, -1, 68, -1, 69, -1, 54, -1, - 131, -1, 132, -1, 125, -1, -1, 65, 224, 122, - 236, 123, -1, 242, 226, 250, -1, 242, 38, 250, - -1, 34, -1, 35, -1, 36, -1, 37, -1, 44, - -1, 43, -1, 39, -1, 40, -1, 41, -1, 45, - -1, 46, -1, 47, -1, 242, 118, 112, 151, -1, - 104, -1, 108, -1, 111, -1, 242, -1, 242, 116, - 247, -1, 242, 116, 111, -1, 242, 116, 108, -1, - 242, 116, 242, -1, -1, 228, 230, 122, 231, 123, - -1, -1, 231, 70, 232, -1, 232, -1, 231, 70, - 108, 22, 250, -1, 250, 22, 250, -1, 108, 22, - 250, -1, 250, 233, -1, -1, 233, 234, -1, 17, - -1, 21, -1, 24, -1, 21, 122, 111, 123, -1, - 21, 122, 108, 123, -1, 242, 191, -1, 236, 70, - 235, -1, 236, 70, 108, 22, 242, -1, 235, -1, - 108, 22, 242, -1, -1, 239, -1, 238, -1, 13, - 250, 241, 250, 10, 248, -1, 13, 14, 250, 10, - 248, -1, 13, 250, 240, 248, -1, 12, 250, 240, - 248, -1, 12, 250, 241, 250, 10, 248, -1, 12, - 14, 250, 10, 248, -1, 70, -1, 10, -1, 55, + 135, 0, -1, 136, -1, 137, -1, 136, 137, -1, + 156, -1, 142, -1, 161, -1, 153, -1, 107, 4, + -1, 138, -1, 139, -1, 4, -1, 141, 4, -1, + 94, 109, 4, -1, 8, 110, 70, 109, 4, -1, + 9, 109, 4, -1, 32, 109, 70, 262, -1, 7, + 109, -1, -1, 31, 143, 221, 105, 119, 262, -1, + -1, 31, 145, 109, 252, 119, 146, -1, 109, -1, + 112, -1, 148, -1, 147, 148, -1, 211, 149, 4, + -1, 107, 4, -1, 116, -1, 115, -1, 156, -1, + 144, -1, 138, -1, -1, 150, 113, 152, -1, -1, + 76, 151, 185, 98, -1, 14, 253, -1, 30, 109, + 70, 106, -1, -1, 246, -1, -1, 99, 154, 155, + 100, -1, -1, 147, -1, 25, 157, 4, -1, 120, + 158, 121, -1, 120, 121, -1, -1, 159, 160, -1, + 261, -1, 160, 122, 261, -1, -1, -1, -1, 27, + 162, 249, 163, 185, 4, 164, 180, 71, -1, -1, + -1, 5, 166, 168, 4, 167, -1, 221, 105, 194, + -1, 91, 123, 170, 124, -1, -1, 170, 70, 171, + -1, 171, -1, 50, -1, 51, -1, 53, -1, 52, + -1, 105, -1, 109, -1, 120, 254, 121, -1, 92, + 123, 173, 124, -1, 173, 70, 109, -1, 109, -1, + 89, 123, 109, 124, -1, 89, 123, 105, 124, -1, + 93, -1, 93, 123, 109, 124, -1, 87, -1, 87, + 123, 146, 124, -1, 97, -1, 97, 123, 146, 124, + -1, 95, 123, 109, 124, -1, 96, -1, 96, 123, + 146, 124, -1, -1, 208, -1, -1, 73, 4, 182, + 189, 184, 188, 183, 191, 74, -1, -1, 213, 4, + -1, -1, 81, 253, 4, -1, -1, 186, -1, 187, + -1, 186, 187, -1, 83, -1, 84, -1, 82, -1, + 85, -1, 86, -1, 88, -1, 90, -1, 169, -1, + 172, -1, 174, -1, 175, -1, 176, -1, 177, -1, + 178, -1, 179, -1, 75, 253, 70, 253, 4, -1, + 75, 253, 4, -1, -1, 189, 190, 4, -1, 11, + 235, -1, -1, 191, 192, 4, -1, 61, 245, 194, + -1, -1, 29, 193, 221, 216, -1, -1, 194, 195, + -1, 18, -1, 19, -1, 20, -1, 21, -1, 21, + 123, 109, 124, -1, 21, 123, 112, 124, -1, 24, + -1, -1, 77, 4, 197, 200, 78, -1, 204, -1, + -1, 79, 4, 199, 201, 80, -1, -1, 200, 4, + -1, 200, 202, 4, -1, -1, 201, 4, -1, 201, + 203, 4, -1, 15, 253, 236, -1, 16, 253, 236, + -1, -1, 206, 123, 205, 207, 124, -1, 62, -1, + 64, -1, -1, 235, -1, 109, 22, 253, -1, 207, + 70, 235, -1, 207, 70, 109, 22, 253, -1, 210, + -1, 208, 210, -1, -1, 165, -1, 209, 214, -1, + 107, 4, -1, 116, -1, 115, -1, 139, -1, 140, + -1, -1, 212, -1, 212, 213, -1, 213, -1, 98, + -1, 211, 217, 4, -1, 1, 4, -1, 216, -1, + 215, 70, 216, -1, 105, -1, 222, -1, 240, -1, + -1, 29, 218, 221, 215, -1, 30, 109, 70, 245, + -1, 30, 112, 70, 245, -1, -1, 31, 219, 221, + 105, 119, 262, -1, 144, -1, -1, 33, 220, 221, + 105, 119, 262, -1, 63, 232, -1, 10, 251, -1, + 113, 246, -1, 14, 253, -1, 232, -1, 181, -1, + 196, -1, 198, -1, -1, 50, -1, 51, -1, 52, + -1, 53, -1, 245, 119, 253, -1, 245, 119, 224, + 253, -1, 245, 119, 253, 225, 253, -1, 245, 119, + 253, 120, 254, 121, -1, 245, 120, 254, 121, 119, + 253, -1, 245, 119, 232, -1, -1, 123, 223, 239, + 124, 119, 231, 123, 234, 124, -1, 226, -1, 228, + -1, 230, -1, 245, 119, 14, -1, 125, -1, 126, + -1, 127, -1, 127, -1, 128, -1, 129, -1, 130, + -1, 131, -1, 42, -1, 66, -1, 118, -1, 55, -1, 56, -1, 57, -1, 58, -1, 59, -1, 60, - -1, 113, -1, 257, -1, -1, 244, -1, 244, 70, - 245, -1, 245, -1, 249, -1, 242, 119, 251, 120, - -1, 119, 253, 120, -1, 247, -1, 108, -1, 111, - -1, 104, -1, 112, -1, 104, -1, 112, -1, 248, - -1, 250, -1, 242, -1, 259, -1, -1, 252, 255, - -1, -1, 254, 255, -1, 256, -1, 255, 121, 256, - -1, 250, -1, 100, -1, 101, -1, 102, -1, 103, - -1, 105, -1, 108, -1, 111, -1, 109, -1, 110, - -1, 258, -1 + -1, 48, -1, 49, -1, 67, -1, 68, -1, 69, + -1, 54, -1, 132, -1, 133, -1, 126, -1, -1, + 65, 227, 123, 239, 124, -1, 245, 229, 253, -1, + 245, 38, 253, -1, 34, -1, 35, -1, 36, -1, + 37, -1, 44, -1, 43, -1, 39, -1, 40, -1, + 41, -1, 45, -1, 46, -1, 47, -1, 245, 119, + 113, 152, -1, 105, -1, 109, -1, 112, -1, 245, + -1, 245, 117, 250, -1, 245, 117, 112, -1, 245, + 117, 109, -1, 245, 117, 245, -1, -1, 231, 233, + 123, 234, 124, -1, -1, 234, 70, 235, -1, 235, + -1, 234, 70, 109, 22, 253, -1, 253, 22, 253, + -1, 109, 22, 253, -1, 253, 236, -1, -1, 236, + 237, -1, 17, -1, 21, -1, 24, -1, 21, 123, + 112, 124, -1, 21, 123, 109, 124, -1, 245, 194, + -1, 239, 70, 238, -1, 239, 70, 109, 22, 245, + -1, 238, -1, 109, 22, 245, -1, -1, 242, -1, + 241, -1, 13, 253, 244, 253, 10, 251, -1, 13, + 14, 253, 10, 251, -1, 13, 253, 243, 251, -1, + 12, 253, 243, 251, -1, 12, 253, 244, 253, 10, + 251, -1, 12, 14, 253, 10, 251, -1, 70, -1, + 10, -1, 55, -1, 56, -1, 57, -1, 58, -1, + 59, -1, 60, -1, 114, -1, 260, -1, -1, 247, + -1, 247, 70, 248, -1, 248, -1, 252, -1, 245, + 120, 254, 121, -1, 120, 256, 121, -1, 250, -1, + 109, -1, 112, -1, 105, -1, 113, -1, 105, -1, + 113, -1, 251, -1, 253, -1, 245, -1, 262, -1, + -1, 255, 258, -1, -1, 257, 258, -1, 259, -1, + 258, 122, 259, -1, 253, -1, 101, -1, 102, -1, + 103, -1, 104, -1, 106, -1, 109, -1, 112, -1, + 110, -1, 111, -1, 261, -1 }; /* YYRLINE[YYN] -- source line where rule number YYN was defined. */ static const yytype_uint16 yyrline[] = { - 0, 1116, 1116, 1120, 1121, 1125, 1126, 1127, 1133, 1139, - 1140, 1141, 1142, 1146, 1147, 1156, 1162, 1170, 1182, 1195, - 1195, 1204, 1204, 1213, 1214, 1218, 1219, 1223, 1224, 1225, - 1226, 1227, 1228, 1229, 1232, 1232, 1240, 1239, 1250, 1254, - 1267, 1271, 1275, 1275, 1287, 1289, 1293, 1308, 1309, 1313, - 1313, 1323, 1324, 1333, 1337, 1341, 1332, 1353, 1355, 1352, - 1382, 1407, 1411, 1417, 1426, 1432, 1441, 1447, 1456, 1462, - 1471, 1479, 1484, 1496, 1499, 1504, 1512, 1513, 1514, 1515, - 1516, 1527, 1538, 1541, 1543, 1548, 1547, 1573, 1574, 1578, - 1579, 1583, 1584, 1588, 1589, 1593, 1594, 1595, 1596, 1597, - 1598, 1599, 1600, 1601, 1602, 1603, 1604, 1605, 1606, 1610, - 1615, 1622, 1623, 1636, 1641, 1642, 1650, 1651, 1651, 1663, - 1664, 1668, 1669, 1670, 1671, 1672, 1673, 1674, 1679, 1679, - 1682, 1690, 1690, 1696, 1697, 1702, 1710, 1711, 1716, 1724, - 1728, 1733, 1732, 1745, 1746, 1750, 1751, 1761, 1766, 1776, - 1785, 1786, 1798, 1802, 1803, 1805, 1806, 1807, 1808, 1809, - 1813, 1814, 1818, 1819, 1823, 1835, 1836, 1847, 1854, 1863, - 1872, 1873, 1874, 1874, 1887, 1897, 1903, 1903, 1910, 1911, - 1911, 1917, 1923, 1927, 1933, 1934, 1935, 1936, 1937, 1938, - 1942, 1943, 1944, 1945, 1949, 1951, 1953, 1955, 1957, 1960, - 1967, 1966, 1975, 1976, 1977, 1978, 1986, 1987, 1988, 1992, - 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, - 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, - 2013, 2014, 2020, 2019, 2031, 2033, 2043, 2044, 2045, 2046, - 2047, 2048, 2049, 2050, 2051, 2052, 2053, 2054, 2059, 2068, - 2069, 2070, 2071, 2077, 2091, 2097, 2103, 2113, 2112, 2121, - 2122, 2132, 2142, 2148, 2153, 2163, 2167, 2168, 2172, 2173, - 2174, 2176, 2182, 2191, 2195, 2205, 2211, 2221, 2226, 2230, - 2231, 2235, 2239, 2243, 2250, 2254, 2258, 2265, 2266, 2270, - 2271, 2272, 2273, 2274, 2275, 2279, 2280, 2284, 2285, 2289, - 2290, 2294, 2295, 2302, 2309, 2310, 2311, 2315, 2316, 2320, - 2321, 2325, 2326, 2330, 2331, 2335, 2335, 2345, 2345, 2357, - 2358, 2366, 2373, 2374, 2375, 2376, 2377, 2381, 2382, 2386, - 2387, 2388 + 0, 1123, 1123, 1127, 1128, 1132, 1133, 1134, 1140, 1146, + 1147, 1148, 1149, 1153, 1154, 1163, 1169, 1177, 1189, 1202, + 1202, 1211, 1211, 1220, 1221, 1225, 1226, 1230, 1231, 1232, + 1233, 1234, 1235, 1236, 1239, 1239, 1247, 1246, 1257, 1261, + 1274, 1278, 1282, 1282, 1294, 1296, 1300, 1315, 1316, 1320, + 1320, 1330, 1331, 1340, 1344, 1348, 1339, 1360, 1362, 1359, + 1389, 1414, 1419, 1422, 1427, 1435, 1436, 1437, 1438, 1439, + 1450, 1461, 1466, 1470, 1477, 1488, 1494, 1503, 1509, 1518, + 1524, 1533, 1539, 1548, 1556, 1561, 1571, 1573, 1578, 1577, + 1603, 1604, 1608, 1609, 1613, 1614, 1618, 1619, 1623, 1631, + 1639, 1640, 1641, 1642, 1643, 1644, 1645, 1646, 1647, 1648, + 1649, 1650, 1651, 1655, 1660, 1667, 1668, 1681, 1686, 1687, + 1695, 1696, 1696, 1708, 1709, 1713, 1714, 1715, 1716, 1717, + 1718, 1719, 1724, 1724, 1727, 1735, 1735, 1741, 1742, 1747, + 1755, 1756, 1761, 1769, 1773, 1778, 1777, 1790, 1791, 1795, + 1796, 1806, 1811, 1821, 1830, 1831, 1843, 1847, 1848, 1850, + 1851, 1852, 1853, 1854, 1858, 1859, 1863, 1864, 1868, 1880, + 1881, 1892, 1899, 1908, 1917, 1918, 1919, 1919, 1932, 1942, + 1948, 1948, 1955, 1956, 1956, 1962, 1968, 1972, 1978, 1979, + 1980, 1981, 1982, 1983, 1987, 1988, 1989, 1990, 1994, 1996, + 1998, 2000, 2002, 2005, 2012, 2011, 2020, 2021, 2022, 2023, + 2031, 2032, 2033, 2037, 2038, 2039, 2040, 2041, 2042, 2043, + 2044, 2045, 2046, 2047, 2048, 2049, 2050, 2051, 2052, 2053, + 2054, 2055, 2056, 2057, 2058, 2059, 2065, 2064, 2076, 2078, + 2088, 2089, 2090, 2091, 2092, 2093, 2094, 2095, 2096, 2097, + 2098, 2099, 2104, 2113, 2114, 2115, 2116, 2122, 2136, 2142, + 2148, 2158, 2157, 2166, 2167, 2177, 2187, 2193, 2198, 2208, + 2212, 2213, 2217, 2218, 2219, 2221, 2227, 2236, 2240, 2250, + 2256, 2266, 2271, 2275, 2276, 2280, 2284, 2288, 2295, 2299, + 2303, 2310, 2311, 2315, 2316, 2317, 2318, 2319, 2320, 2324, + 2325, 2329, 2330, 2334, 2335, 2339, 2340, 2347, 2354, 2355, + 2356, 2360, 2361, 2365, 2366, 2370, 2371, 2375, 2376, 2380, + 2380, 2390, 2390, 2402, 2403, 2411, 2418, 2419, 2420, 2421, + 2422, 2426, 2427, 2431, 2432, 2433 }; #endif @@ -1871,7 +1880,7 @@ static const char *const yytname[] = "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", "INVOCANT", "MAIN", "LOAD", "INIT", "IMMEDIATE", - "POSTCOMP", "METHOD", "ANON", "OUTER", "NEED_LEX", "MULTI", + "POSTCOMP", "METHOD", "ANON", "OUTER", "NEED_LEX", "MULTI", "SUBTAG", "VTABLE_METHOD", "LOADLIB", "SUB_INSTANCE_OF", "SUBID", "NS_ENTRY", "LABEL", "EMIT", "EOM", "IREG", "NREG", "SREG", "PREG", "IDENTIFIER", "REG", "MACRO", "ENDM", "STRINGC", "INTC", "FLOATC", "USTRINGC", @@ -1883,9 +1892,9 @@ static const char *const yytname[] = "pasmcode", "pasmline", "pasm_inst", "$@3", "$@4", "pasm_args", "emit", "$@5", "opt_pasmcode", "class_namespace", "maybe_ns", "nslist", "$@6", "_nslist", "sub", "$@7", "$@8", "$@9", "sub_param", "$@10", "$@11", - "sub_param_type_def", "multi", "outer", "vtable", "method", - "ns_entry_name", "instanceof", "subid", "multi_types", "multi_type", - "sub_body", "pcc_sub_call", "@12", "opt_label", "opt_invocant", + "sub_param_type_def", "multi", "multi_types", "multi_type", "subtag", + "subtags", "outer", "vtable", "method", "ns_entry_name", "instanceof", + "subid", "sub_body", "pcc_sub_call", "@12", "opt_label", "opt_invocant", "sub_proto", "sub_proto_list", "proto", "pcc_call", "pcc_args", "pcc_arg", "pcc_results", "pcc_result", "$@13", "paramtype_list", "paramtype", "pcc_ret", "$@14", "pcc_yield", "$@15", "pcc_returns", @@ -1920,49 +1929,49 @@ static const yytype_uint16 yytoknum[] = 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 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, 61, 91, - 93, 59, 40, 41, 33, 126, 45, 43, 42, 47, - 37, 38, 124 + 364, 365, 366, 367, 368, 369, 370, 371, 372, 61, + 91, 93, 59, 40, 41, 33, 126, 45, 43, 42, + 47, 37, 38, 124 }; # endif /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ static const yytype_uint16 yyr1[] = { - 0, 133, 134, 135, 135, 136, 136, 136, 136, 136, - 136, 136, 136, 137, 137, 138, 138, 139, 140, 142, - 141, 144, 143, 145, 145, 146, 146, 147, 147, 147, - 147, 147, 147, 147, 149, 148, 150, 148, 148, 148, - 148, 151, 153, 152, 154, 154, 155, 156, 156, 158, - 157, 159, 159, 161, 162, 163, 160, 165, 166, 164, - 167, 168, 169, 169, 170, 170, 171, 171, 172, 172, - 173, 174, 174, 175, 175, 175, 176, 176, 176, 176, - 176, 176, 176, 177, 177, 179, 178, 180, 180, 181, - 181, 182, 182, 183, 183, 184, 184, 184, 184, 184, - 184, 184, 184, 184, 184, 184, 184, 184, 184, 185, - 185, 186, 186, 187, 188, 188, 189, 190, 189, 191, - 191, 192, 192, 192, 192, 192, 192, 192, 194, 193, - 193, 196, 195, 197, 197, 197, 198, 198, 198, 199, - 200, 202, 201, 203, 203, 204, 204, 204, 204, 204, - 205, 205, 206, 207, 207, 207, 207, 207, 207, 207, - 208, 208, 209, 209, 210, 211, 211, 212, 212, 213, - 214, 214, 215, 214, 214, 214, 216, 214, 214, 217, - 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, - 218, 218, 218, 218, 219, 219, 219, 219, 219, 219, - 220, 219, 219, 219, 219, 219, 221, 221, 221, 222, - 222, 222, 222, 222, 222, 222, 222, 222, 222, 222, - 222, 222, 222, 222, 222, 222, 222, 222, 222, 222, - 222, 222, 224, 223, 225, 225, 226, 226, 226, 226, - 226, 226, 226, 226, 226, 226, 226, 226, 227, 228, - 228, 228, 228, 228, 228, 228, 228, 230, 229, 231, - 231, 231, 231, 231, 231, 232, 233, 233, 234, 234, - 234, 234, 234, 235, 236, 236, 236, 236, 236, 237, - 237, 238, 238, 238, 239, 239, 239, 240, 240, 241, - 241, 241, 241, 241, 241, 242, 242, 243, 243, 244, - 244, 245, 245, 245, 246, 246, 246, 247, 247, 248, - 248, 249, 249, 250, 250, 252, 251, 254, 253, 255, - 255, 256, 257, 257, 257, 257, 257, 258, 258, 259, - 259, 259 + 0, 134, 135, 136, 136, 137, 137, 137, 137, 137, + 137, 137, 137, 138, 138, 139, 139, 140, 141, 143, + 142, 145, 144, 146, 146, 147, 147, 148, 148, 148, + 148, 148, 148, 148, 150, 149, 151, 149, 149, 149, + 149, 152, 154, 153, 155, 155, 156, 157, 157, 159, + 158, 160, 160, 162, 163, 164, 161, 166, 167, 165, + 168, 169, 170, 170, 170, 171, 171, 171, 171, 171, + 171, 171, 172, 173, 173, 174, 174, 175, 175, 176, + 176, 177, 177, 178, 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, 187, 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, 210, 211, 211, 212, 212, 213, 214, + 214, 215, 215, 216, 217, 217, 218, 217, 217, 217, + 219, 217, 217, 220, 217, 217, 217, 217, 217, 217, + 217, 217, 217, 217, 221, 221, 221, 221, 222, 222, + 222, 222, 222, 222, 223, 222, 222, 222, 222, 222, + 224, 224, 224, 225, 225, 225, 225, 225, 225, 225, + 225, 225, 225, 225, 225, 225, 225, 225, 225, 225, + 225, 225, 225, 225, 225, 225, 227, 226, 228, 228, + 229, 229, 229, 229, 229, 229, 229, 229, 229, 229, + 229, 229, 230, 231, 231, 231, 231, 231, 231, 231, + 231, 233, 232, 234, 234, 234, 234, 234, 234, 235, + 236, 236, 237, 237, 237, 237, 237, 238, 239, 239, + 239, 239, 239, 240, 240, 241, 241, 241, 242, 242, + 242, 243, 243, 244, 244, 244, 244, 244, 244, 245, + 245, 246, 246, 247, 247, 248, 248, 248, 249, 249, + 249, 250, 250, 251, 251, 252, 252, 253, 253, 255, + 254, 257, 256, 258, 258, 259, 260, 260, 260, 260, + 260, 261, 261, 262, 262, 262 }; /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ @@ -1974,34 +1983,34 @@ static const yytype_uint8 yyr2[] = 1, 1, 1, 1, 0, 3, 0, 4, 2, 4, 0, 1, 0, 4, 0, 1, 3, 3, 2, 0, 2, 1, 3, 0, 0, 0, 9, 0, 0, 5, - 3, 4, 4, 4, 1, 4, 1, 4, 1, 4, - 4, 1, 4, 0, 3, 1, 1, 1, 1, 1, - 1, 1, 3, 0, 1, 0, 9, 0, 2, 0, - 3, 0, 1, 1, 2, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 5, - 3, 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, 1, 2, 2, 1, 1, 1, 1, - 0, 1, 2, 1, 1, 3, 2, 1, 3, 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, 3, 4, 5, 6, 6, 3, - 0, 9, 1, 1, 1, 3, 1, 1, 1, 1, + 3, 4, 0, 3, 1, 1, 1, 1, 1, 1, + 1, 3, 4, 3, 1, 4, 4, 1, 4, 1, + 4, 1, 4, 4, 1, 4, 0, 1, 0, 9, + 0, 2, 0, 3, 0, 1, 1, 2, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 5, 3, 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, 1, 2, 2, + 1, 1, 1, 1, 0, 1, 2, 1, 1, 3, + 2, 1, 3, 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, 3, 4, + 5, 6, 6, 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, 0, 5, 3, 3, 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, 1 + 1, 1, 1, 1, 1, 1, 0, 5, 3, 3, + 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, 1 }; /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state @@ -2011,355 +2020,360 @@ static const yytype_uint16 yydefact[] = { 0, 12, 0, 0, 0, 0, 53, 19, 0, 42, 0, 0, 2, 3, 10, 11, 0, 6, 8, 5, - 7, 18, 0, 0, 49, 0, 0, 0, 0, 160, + 7, 18, 0, 0, 49, 0, 0, 0, 0, 164, 9, 1, 4, 13, 0, 16, 48, 0, 0, 46, - 307, 305, 306, 308, 54, 304, 190, 191, 192, 193, - 0, 14, 21, 164, 0, 30, 29, 33, 32, 160, - 25, 0, 31, 34, 161, 163, 0, 47, 327, 328, - 50, 51, 91, 0, 0, 28, 26, 43, 0, 0, - 36, 0, 0, 162, 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, 322, 323, 324, 325, 326, 329, 330, 295, - 313, 38, 296, 331, 314, 0, 91, 27, 297, 52, - 0, 0, 73, 0, 0, 0, 0, 55, 94, 20, - 309, 310, 311, 0, 312, 0, 0, 317, 35, 313, - 41, 298, 300, 301, 23, 24, 0, 0, 0, 76, - 77, 79, 78, 80, 81, 315, 0, 75, 0, 0, - 0, 0, 152, 0, 39, 37, 0, 0, 315, 0, - 67, 63, 62, 0, 0, 0, 61, 65, 70, 72, - 69, 57, 0, 0, 157, 156, 158, 159, 153, 0, - 152, 0, 150, 22, 303, 321, 318, 319, 0, 299, - 82, 316, 74, 0, 0, 155, 56, 151, 0, 189, - 154, 0, 302, 0, 0, 0, 166, 0, 0, 0, - 0, 172, 0, 176, 179, 143, 0, 144, 232, 0, - 0, 0, 249, 250, 251, 297, 200, 178, 186, 187, - 188, 130, 0, 0, 170, 202, 203, 204, 257, 185, - 171, 280, 279, 252, 320, 58, 119, 17, 182, 0, - 0, 0, 0, 184, 0, 0, 0, 0, 0, 181, - 252, 0, 85, 128, 131, 183, 278, 141, 165, 0, - 236, 237, 238, 239, 0, 242, 243, 244, 241, 240, - 245, 246, 247, 0, 0, 315, 0, 59, 60, 0, - 288, 289, 290, 291, 292, 293, 294, 287, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 278, 111, - 133, 136, 0, 276, 0, 119, 145, 259, 235, 255, - 254, 256, 253, 205, 327, 328, 297, 206, 207, 208, - 0, 199, 313, 194, 0, 234, 121, 122, 123, 124, - 127, 120, 0, 284, 0, 0, 283, 0, 169, 173, - 167, 174, 175, 0, 0, 0, 89, 0, 0, 0, - 0, 0, 273, 327, 0, 146, 266, 327, 0, 261, - 266, 248, 195, 214, 223, 224, 228, 217, 218, 219, - 220, 221, 222, 215, 225, 226, 227, 216, 315, 231, - 209, 210, 211, 212, 213, 229, 230, 0, 0, 0, - 286, 0, 282, 0, 0, 0, 0, 233, 0, 0, - 0, 0, 134, 0, 129, 0, 137, 0, 132, 0, - 277, 0, 274, 0, 0, 0, 142, 265, 0, 0, - 258, 0, 0, 196, 0, 0, 0, 285, 281, 168, - 177, 180, 113, 0, 0, 87, 112, 266, 135, 266, - 138, 0, 0, 147, 327, 148, 268, 269, 270, 267, - 264, 327, 260, 263, 197, 198, 125, 126, 90, 0, - 114, 0, 139, 140, 275, 259, 0, 0, 0, 110, - 0, 0, 88, 0, 149, 0, 0, 262, 0, 117, - 0, 86, 0, 201, 272, 271, 109, 0, 119, 115, - 0, 116, 118 + 311, 309, 310, 312, 54, 308, 194, 195, 196, 197, + 0, 14, 21, 168, 0, 30, 29, 33, 32, 164, + 25, 0, 31, 34, 165, 167, 0, 47, 331, 332, + 50, 51, 94, 0, 0, 28, 26, 43, 0, 0, + 36, 0, 0, 166, 15, 0, 100, 98, 99, 101, + 102, 79, 103, 0, 104, 0, 0, 77, 0, 84, + 81, 105, 106, 107, 108, 109, 110, 111, 112, 0, + 95, 96, 0, 0, 326, 327, 328, 329, 330, 333, + 334, 299, 317, 38, 300, 335, 318, 0, 94, 27, + 301, 52, 0, 0, 62, 0, 0, 0, 0, 0, + 55, 97, 20, 313, 314, 315, 0, 316, 0, 0, + 321, 35, 317, 41, 302, 304, 305, 23, 24, 0, + 0, 0, 65, 66, 68, 67, 69, 70, 319, 0, + 64, 74, 0, 0, 0, 0, 0, 156, 0, 39, + 37, 0, 0, 319, 0, 80, 76, 75, 0, 0, + 0, 61, 0, 72, 78, 83, 85, 82, 57, 0, + 0, 161, 160, 162, 163, 157, 0, 156, 0, 154, + 22, 307, 325, 322, 323, 0, 303, 71, 320, 63, + 73, 0, 0, 159, 56, 155, 0, 193, 158, 0, + 306, 0, 0, 0, 170, 0, 0, 0, 0, 176, + 0, 180, 183, 147, 0, 148, 236, 0, 0, 0, + 253, 254, 255, 301, 204, 182, 190, 191, 192, 134, + 0, 0, 174, 206, 207, 208, 261, 189, 175, 284, + 283, 256, 324, 58, 123, 17, 186, 0, 0, 0, + 0, 188, 0, 0, 0, 0, 0, 185, 256, 0, + 88, 132, 135, 187, 282, 145, 169, 0, 240, 241, + 242, 243, 0, 246, 247, 248, 245, 244, 249, 250, + 251, 0, 0, 319, 0, 59, 60, 0, 292, 293, + 294, 295, 296, 297, 298, 291, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 282, 115, 137, 140, + 0, 280, 0, 123, 149, 263, 239, 259, 258, 260, + 257, 209, 331, 332, 301, 210, 211, 212, 0, 203, + 317, 198, 0, 238, 125, 126, 127, 128, 131, 124, + 0, 288, 0, 0, 287, 0, 173, 177, 171, 178, + 179, 0, 0, 0, 92, 0, 0, 0, 0, 0, + 277, 331, 0, 150, 270, 331, 0, 265, 270, 252, + 199, 218, 227, 228, 232, 221, 222, 223, 224, 225, + 226, 219, 229, 230, 231, 220, 319, 235, 213, 214, + 215, 216, 217, 233, 234, 0, 0, 0, 290, 0, + 286, 0, 0, 0, 0, 237, 0, 0, 0, 0, + 138, 0, 133, 0, 141, 0, 136, 0, 281, 0, + 278, 0, 0, 0, 146, 269, 0, 0, 262, 0, + 0, 200, 0, 0, 0, 289, 285, 172, 181, 184, + 117, 0, 0, 90, 116, 270, 139, 270, 142, 0, + 0, 151, 331, 152, 272, 273, 274, 271, 268, 331, + 264, 267, 201, 202, 129, 130, 93, 0, 118, 0, + 143, 144, 279, 263, 0, 0, 0, 114, 0, 0, + 91, 0, 153, 0, 0, 266, 0, 121, 0, 89, + 0, 205, 276, 275, 113, 0, 123, 119, 0, 120, + 122 }; /* YYDEFGOTO[NTERM-NUM]. */ static const yytype_int16 yydefgoto[] = { - -1, 11, 12, 13, 14, 15, 197, 16, 17, 27, - 58, 74, 156, 59, 60, 81, 82, 126, 148, 18, + -1, 11, 12, 13, 14, 15, 204, 16, 17, 27, + 58, 74, 159, 59, 60, 81, 82, 128, 151, 18, 29, 61, 19, 25, 37, 38, 70, 20, 26, 72, - 172, 198, 213, 307, 223, 100, 101, 102, 103, 104, - 105, 106, 166, 167, 199, 248, 329, 490, 430, 107, - 108, 109, 465, 376, 431, 501, 512, 517, 308, 361, - 249, 330, 250, 331, 377, 378, 435, 439, 251, 336, - 252, 384, 200, 201, 202, 63, 64, 65, 220, 369, - 370, 253, 274, 277, 278, 50, 254, 286, 350, 417, - 255, 281, 256, 306, 257, 258, 259, 289, 388, 389, - 447, 479, 333, 334, 260, 261, 262, 318, 319, 120, - 150, 151, 152, 44, 45, 142, 153, 144, 183, 184, - 176, 177, 206, 207, 122, 123, 124 + 177, 205, 221, 315, 231, 101, 169, 170, 102, 172, + 103, 104, 105, 106, 107, 108, 206, 256, 337, 498, + 438, 109, 110, 111, 473, 384, 439, 509, 520, 525, + 316, 369, 257, 338, 258, 339, 385, 386, 443, 447, + 259, 344, 260, 392, 207, 208, 209, 63, 64, 65, + 228, 377, 378, 261, 282, 285, 286, 50, 262, 294, + 358, 425, 263, 289, 264, 314, 265, 266, 267, 297, + 396, 397, 455, 487, 341, 342, 268, 269, 270, 326, + 327, 122, 153, 154, 155, 44, 45, 145, 156, 147, + 188, 189, 181, 182, 213, 214, 124, 125, 126 }; /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing STATE-NUM. */ -#define YYPACT_NINF -417 +#define YYPACT_NINF -442 static const yytype_int16 yypact[] = { - 242, -417, -97, -73, -68, -72, -417, -417, -47, -417, - 75, 88, 242, -417, -417, -417, 91, -417, -417, -417, - -417, -417, 30, 99, -13, 107, 64, 246, 117, 56, - -417, -417, -417, -417, 20, -417, -417, -12, -6, -417, - -417, -417, -417, -417, -417, -417, -417, -417, -417, -417, - 32, -417, -417, -417, 142, -417, -417, -417, -417, 250, - -417, 58, -417, 50, 66, -417, 143, -417, -417, -417, - 53, -417, 447, 51, 71, -417, -417, -417, 395, 80, - -417, 188, 96, -417, -417, -6, -417, -417, -417, -417, - -417, 78, -417, 97, -417, 101, 102, 103, 105, 118, - -417, -417, -417, -417, -417, -417, -417, 206, 447, -417, - 252, 444, -417, -417, -417, -417, -417, -417, -417, -417, - -417, -417, -417, -417, -417, 151, 447, -417, 380, -417, - 22, -81, 114, 121, 135, 22, 22, -417, -417, -417, - -417, -417, -417, 127, -417, 147, 150, -417, -417, 129, - -417, 185, -417, -417, -417, -417, 133, 138, 139, -417, - -417, -417, -417, -417, -417, -417, -56, -417, 145, 148, - 153, 154, 23, 22, -417, -417, 140, 395, -417, 380, - -417, -417, -417, 159, 395, 114, -417, -417, -417, -417, - -417, -417, 162, 282, -417, -417, -417, -417, -417, 217, - 25, 12, -417, -417, -417, -417, 168, -417, 180, -417, - -417, 168, -417, 246, 237, -417, -417, -417, 306, 201, - -417, 395, -417, 307, 211, 252, -417, -52, 182, 280, - 395, -417, 48, 208, -417, -417, 225, -417, -417, 316, - 317, 318, -417, -417, -417, 380, -417, -417, -417, -417, - -417, -417, 202, 327, -417, -417, -417, -417, -417, -417, - -417, -417, -417, 360, -417, -417, -417, -417, -417, 395, - 125, 395, 125, -417, 246, 262, 264, 246, 246, -417, - 226, 219, -417, -417, -417, -417, 104, -417, -417, 222, - -417, -417, -417, -417, 395, -417, -417, -417, -417, -417, - -417, -417, -417, 458, 323, -417, 395, -417, 218, 336, - -417, -417, -417, -417, -417, -417, -417, -417, -52, 395, - 342, -52, 395, 249, 528, 528, 253, 254, 104, -417, - -417, -417, 332, -417, -53, -417, 472, 486, -417, -417, - -417, -417, -417, -417, 247, 255, 380, -417, -417, -417, - 395, -417, -66, 396, 248, -417, -417, -417, -417, 256, - -417, -417, -52, -417, 362, -52, -417, 364, -417, 305, - -417, -417, -417, 261, 269, -51, 1, 5, 42, 528, - 308, 274, 218, 390, -33, -417, -417, 392, -31, -417, - 393, -417, -417, -417, -417, -417, -417, -417, -417, -417, - -417, -417, -417, -417, -417, -417, -417, -417, -417, -417, - -417, -417, -417, -417, -417, -417, -417, 395, 301, 79, - -417, -52, -417, -52, 249, 252, 252, -417, 395, 395, - 354, 426, -417, 395, -417, 433, -417, 395, -417, 435, - -417, 418, -417, 225, 395, 500, -417, 137, 395, 514, - -417, 395, 321, -417, 395, 319, 320, -417, -417, -417, - -417, -417, -417, 442, 395, 66, -417, -417, -417, -417, - -417, 528, 335, -417, 436, -417, -417, 337, -417, -417, - -417, 438, -417, -417, -417, -417, -417, -417, -417, 14, - -417, 457, 137, 137, -417, 486, 395, 86, 395, -417, - 395, 112, -417, -26, -417, 343, 344, -417, 464, -417, - 528, -417, 465, -417, -417, -417, -417, 246, -417, -417, - 249, 218, -417 + 208, -442, -66, -43, -34, -61, -442, -442, -32, -442, + 85, 93, 208, -442, -442, -442, 105, -442, -442, -442, + -442, -442, 44, 123, 21, 124, 52, 177, 139, 81, + -442, -442, -442, -442, 40, -442, -442, 41, -52, -442, + -442, -442, -442, -442, -442, -442, -442, -442, -442, -442, + 58, -442, -442, -442, 163, -442, -442, -442, -442, 125, + -442, 76, -442, 19, 70, -442, 174, -442, -442, -442, + 64, -442, 457, 74, 94, -442, -442, -442, 461, 97, + -442, 205, 100, -442, -442, -52, -442, -442, -442, -442, + -442, 87, -442, 91, -442, 95, 98, 108, 114, 127, + 128, -442, -442, -442, -442, -442, -442, -442, -442, 216, + 457, -442, 144, 408, -442, -442, -442, -442, -442, -442, + -442, -442, -442, -442, -442, -442, -442, 178, 457, -442, + 388, -442, 1, -33, 102, 138, 148, 149, 1, 1, + -442, -442, -442, -442, -442, -442, 145, -442, 166, 203, + -442, -442, 184, -442, 236, -442, -442, -442, -442, 186, + 188, 189, -442, -442, -442, -442, -442, -442, -442, -58, + -442, -442, -54, 190, 193, 194, 195, 30, 1, -442, + -442, 199, 461, -442, 388, -442, -442, -442, 200, 461, + 102, -442, 213, -442, -442, -442, -442, -442, -442, 221, + 327, -442, -442, -442, -442, -442, 268, 32, 17, -442, + -442, -442, -442, 218, -442, 222, -442, -442, 218, -442, + -442, 177, 272, -442, -442, -442, 345, 232, -442, 461, + -442, 346, 247, 144, -442, -50, 302, 334, 461, -442, + 24, 244, -442, -442, 68, -442, -442, 350, 352, 353, + -442, -442, -442, 388, -442, -442, -442, -442, -442, -442, + 237, 357, -442, -442, -442, -442, -442, -442, -442, -442, + -442, 441, -442, -442, -442, -442, -442, 461, 233, 461, + 233, -442, 177, 292, 294, 177, 177, -442, 248, 243, + -442, -442, -442, -442, 318, -442, -442, 245, -442, -442, + -442, -442, 461, -442, -442, -442, -442, -442, -442, -442, + -442, 475, 173, -442, 461, -442, 308, 359, -442, -442, + -442, -442, -442, -442, -442, -442, -50, 461, 360, -50, + 461, 266, 167, 167, 267, 271, 318, -442, -442, -442, + 351, -442, -53, -442, 489, 503, -442, -442, -442, -442, + -442, -442, 254, 257, 388, -442, -442, -442, 461, -442, + -15, 405, 261, -442, -442, -442, -442, 260, -442, -442, + -50, -442, 375, -50, -442, 376, -442, 317, -442, -442, + -442, 269, 270, -51, 2, 7, 4, 167, 545, 273, + 308, 369, -38, -442, -442, 371, -26, -442, 373, -442, + -442, -442, -442, -442, -442, -442, -442, -442, -442, -442, + -442, -442, -442, -442, -442, -442, -442, -442, -442, -442, + -442, -442, -442, -442, -442, 461, 277, 82, -442, -50, + -442, -50, 266, 144, 144, -442, 461, 461, 322, 394, + -442, 461, -442, 395, -442, 461, -442, 396, -442, 379, + -442, 68, 461, 517, -442, 168, 461, 531, -442, 461, + 281, -442, 461, 283, 285, -442, -442, -442, -442, -442, + -442, 411, 461, 70, -442, -442, -442, -442, -442, 167, + 295, -442, 401, -442, -442, 306, -442, -442, -442, 409, + -442, -442, -442, -442, -442, -442, -442, 22, -442, 413, + 168, 168, -442, 503, 461, 86, 461, -442, 461, 13, + -442, -17, -442, 309, 310, -442, 435, -442, 167, -442, + 437, -442, -442, -442, -442, 177, -442, -442, 266, 308, + -442 }; /* YYPGOTO[NTERM-NUM]. */ static const yytype_int16 yypgoto[] = { - -417, -417, -417, 459, -8, -134, -417, -417, -417, -417, - 251, -417, -87, -417, 413, -417, -417, -417, 128, -417, - -417, -417, 0, -417, -417, -417, -417, -417, -417, -417, - -417, -417, -417, -417, -417, -417, -417, -417, -417, -417, - -417, -417, -417, 288, -417, -417, -417, -417, -417, 349, - -417, 369, -417, -417, -417, -417, -417, -417, -329, -417, - -417, -417, -417, -417, -417, -417, -417, -417, -417, -417, - -417, -417, -417, -417, 286, 293, -417, -63, -417, -417, - -416, -417, -417, -417, -417, -209, -417, -417, -417, -417, - -417, -417, -417, -417, -417, 44, -226, -417, 6, -301, - -396, -417, 122, 179, -417, -417, -417, 238, 239, -126, - 267, -417, 330, -417, 213, -220, 403, -78, -173, -417, - -417, -417, 333, 297, -417, -23, -107 + -442, -442, -442, 430, -14, -153, -442, -442, -442, -442, + 223, -442, -87, -442, 390, -442, -442, -442, 101, -442, + -442, -442, -1, -442, -442, -442, -442, -442, -442, -442, + -442, -442, -442, -442, -442, -442, -442, 262, -442, -442, + -442, -442, -442, -442, -442, -442, -442, -442, -442, -442, + -442, 323, -442, 347, -442, -442, -442, -442, -442, -442, + -336, -442, -442, -442, -442, -442, -442, -442, -442, -442, + -442, -442, -442, -442, -442, -442, 249, 250, -442, -63, + -442, -442, -423, -442, -442, -442, -442, -217, -442, -442, + -442, -442, -442, -442, -442, -442, -442, 15, -234, -442, + -36, -319, -441, -442, 80, 133, -442, -442, -442, 215, + 224, -128, 217, -442, 299, -442, 185, -229, 392, -78, + -178, -442, -442, -442, 314, 278, -442, -24, -109 }; /* 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 -253 +#define YYTABLE_NINF -257 static const yytype_int16 yytable[] = { - 121, 83, 149, 139, 224, 208, 382, 268, 459, 432, - 279, 21, 428, 218, 185, 71, -160, 380, 499, 380, - 433, 57, -160, 157, -160, -160, -160, 158, 191, 62, - 191, 3, 4, 3, 4, 385, 22, 445, 196, 449, - 23, -160, -160, -160, 449, -160, 436, 24, 170, 171, - 303, 57, 140, 149, -40, 192, -252, 192, 437, 62, - 141, 28, 129, 2, 78, 323, 196, 186, 326, 327, - 381, 492, 427, 493, -160, -160, -160, -160, 351, 30, - 79, 5, 429, 434, 500, -160, 203, 52, 31, -160, - 446, -160, 450, 263, -83, 33, -84, 513, 363, 205, - 34, 366, 68, 35, 522, 69, 205, 36, 67, 53, - 280, 39, -160, -160, -160, -160, -160, -160, 267, 149, - -160, 51, 438, -160, -160, -160, 80, 462, 66, 193, - 154, 193, 354, 155, -160, 310, 73, 194, 195, 194, - 195, 509, 420, 205, 475, 422, 75, 84, 482, 8, - 270, 272, 273, 53, 476, -44, 275, 77, 477, 276, - 335, 478, 54, 53, 159, 160, 161, 162, 40, 110, - 55, 56, 41, 510, 85, 42, 43, 341, 352, 111, - 311, 312, 313, 314, 315, 316, 511, 455, 125, 521, - 456, 309, 127, 320, 505, 317, 269, 506, 371, 372, - 130, 457, 335, 458, 112, 113, 114, 115, 128, 116, - 137, 227, 332, 228, 229, 230, 338, 119, 163, 131, - 149, 145, 164, 132, 133, 134, 353, 135, 355, 168, - 231, 232, 233, 165, 234, 452, 356, 357, 358, 359, - 136, 364, 360, 169, 367, 173, 1, 175, 178, 2, - 3, 4, 174, 440, 335, 179, 180, 2, 386, 390, - 204, 181, 182, 235, 236, 237, 238, 5, 187, 6, - 214, 188, 392, 7, 239, 5, 189, 190, 240, 210, - 241, 52, 112, 113, 114, 115, 215, 116, 216, 221, - 68, 117, 118, 69, 271, 119, 46, 47, 48, 49, - 222, 112, 113, 114, 115, 242, 116, 225, 520, 243, - 226, 265, 244, 245, 119, 266, -21, 280, 460, 461, - 282, 283, 284, 246, 287, 112, 113, 114, 115, 242, - 116, 288, 324, 243, 325, 8, 244, 343, 119, 453, - 9, 328, 303, 8, 337, 494, 362, 53, 10, -45, - 386, 463, 365, 368, 379, 467, 54, 373, 374, 469, - 68, 117, 118, 69, 55, 56, 473, 386, 418, -250, - 480, 386, 421, 483, 423, 424, 485, -251, 419, 425, - 112, 113, 114, 115, 518, 116, 489, 426, 68, 117, - 118, 69, 443, 119, 290, 291, 292, 293, 294, 295, - 296, 297, 491, 298, 299, 300, 301, 302, 112, 113, - 114, 115, 444, 116, 448, 451, 441, 390, 504, 454, - 507, 119, 508, 112, 113, 114, 115, 242, 116, 464, - 466, 344, 117, 118, 345, 346, 119, 468, 393, 470, - 471, 484, 486, 487, 394, 395, 488, 347, 348, 349, - 396, 397, 398, 399, 400, 401, 402, 495, 496, 497, - 498, 502, 403, 404, 405, 406, 514, 515, 516, 519, - 247, 32, 76, 212, 391, 146, 303, 138, 304, 305, - 112, 113, 114, 115, 140, 116, 217, 472, 68, 117, - 118, 69, 141, 119, 219, 112, 113, 114, 115, 147, - 116, 503, 442, 68, 117, 118, 69, 375, 119, 209, - 321, 322, 285, 407, 143, 408, 342, 211, 264, 0, - 0, 409, 410, 411, 412, 413, 414, 415, 416, 86, + 123, 83, 152, 142, 232, 215, 276, 390, 444, 467, + 287, 440, 190, 436, 71, 57, 192, 388, 226, 388, + 445, -164, 441, -40, 203, 393, 507, -164, 62, -164, + -164, -164, 453, 78, 500, 198, 501, 198, 3, 4, + 3, 4, 517, 21, 457, 57, -164, -164, -164, 79, + -164, 175, 176, 457, 203, 143, 152, 68, 62, 24, + 69, 131, 199, 144, 199, 331, 191, 22, 334, 335, + 193, 389, 160, 435, 518, 23, 161, 28, 359, -164, + -164, -164, -164, 437, 446, 442, 454, 519, 2, 30, + -164, 210, 508, 31, -164, 80, -164, 371, 458, 271, + 374, -86, 311, -87, 212, 530, 5, 521, -256, 33, + 157, 212, 52, 158, 34, 53, 288, 470, -164, -164, + -164, -164, -164, -164, 275, 152, -164, 35, 39, -164, + -164, -164, 2, 283, 483, 362, 284, 200, 490, 200, + -164, 428, 36, 51, 430, 201, 202, 201, 202, 66, + 5, 212, 162, 163, 164, 165, 52, 40, 278, 280, + 281, 41, 67, 73, 42, 43, 343, 75, 53, 114, + 115, 116, 117, 250, 118, 8, 77, 251, 84, 53, + 252, -44, 121, 349, 360, 484, 85, 351, 54, 485, + 529, 463, 486, 112, 464, 513, 55, 56, 514, 317, + 465, 328, 466, 113, 379, 380, 127, 166, 343, 129, + 132, 167, 1, 130, 133, 2, 3, 4, 134, 8, + 140, 135, 168, 53, 346, -45, 152, 46, 47, 48, + 49, 136, 54, 5, 361, 6, 363, 137, 460, 7, + 55, 56, 235, 318, 236, 237, 238, 171, 148, 372, + 138, 139, 375, 68, 119, 120, 69, 173, 174, 448, + 343, 239, 240, 241, 178, 242, 394, 398, 114, 115, + 116, 117, 179, 118, 114, 115, 116, 117, 250, 118, + 400, 121, 352, 119, 120, 353, 354, 121, 319, 320, + 321, 322, 323, 324, 243, 244, 245, 246, 355, 356, + 357, 180, 8, 325, 183, 247, 184, 9, 528, 248, + 185, 249, 186, 187, 194, 10, 277, 195, 196, 197, + 211, 217, 220, 288, 468, 469, 364, 365, 366, 367, + 222, 223, 368, 114, 115, 116, 117, 250, 118, 224, + 229, 251, 233, 230, 252, 253, 121, 461, 279, 234, + 273, 502, 274, -21, 290, 254, 291, 292, 394, 471, + 295, 296, 332, 475, 333, 311, 336, 477, 345, 370, + 373, 376, 381, 387, 481, 394, 382, -254, 488, 394, + -255, 491, 426, 427, 493, 429, 431, 432, 433, 434, + 526, 452, 451, 456, 497, 459, 462, 472, 474, 476, + 478, 479, 492, 114, 115, 116, 117, 494, 118, 495, + 499, 68, 119, 120, 69, 496, 121, 510, 503, 114, + 115, 116, 117, 504, 118, 398, 512, 340, 515, 505, + 516, 506, 121, 522, 523, 114, 115, 116, 117, 524, + 118, 527, 32, 68, 119, 120, 69, 401, 121, 76, + 255, 149, 219, 402, 403, 399, 225, 141, 227, 404, + 405, 406, 407, 408, 409, 410, 480, 511, 450, 383, + 293, 411, 412, 413, 414, 298, 299, 300, 301, 302, + 303, 304, 305, 216, 306, 307, 308, 309, 310, 114, + 115, 116, 117, 143, 118, 329, 350, 68, 119, 120, + 69, 144, 121, 218, 330, 146, 0, 272, 150, 114, + 115, 116, 117, 143, 118, 0, 0, 68, 119, 120, + 69, 144, 121, 415, 0, 416, 0, 0, 0, 0, + 0, 417, 418, 419, 420, 421, 422, 423, 424, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, - 0, 97, 98, 99, 112, 113, 114, 115, 140, 116, - 0, 0, 68, 117, 118, 69, 141, 119, 112, 113, - 114, 115, 40, 116, 0, 0, 339, 0, 0, 340, - 43, 119, 112, 113, 114, 115, 0, 116, 0, 0, - 383, 117, 118, 69, 0, 119, 112, 113, 114, 115, - 0, 116, 0, 0, 387, 117, 118, 69, 0, 119, - 112, 113, 114, 115, 0, 116, 0, 0, 474, 117, - 118, 69, 0, 119, 112, 113, 114, 115, 0, 116, - 0, 0, 481, 117, 118, 69, 0, 119, 112, 113, - 114, 115, 0, 116, 0, 0, 0, 0, 0, 0, - 0, 119 + 97, 0, 98, 99, 100, 0, 0, 0, 311, 0, + 312, 313, 114, 115, 116, 117, 0, 118, 0, 0, + 68, 119, 120, 69, 0, 121, 114, 115, 116, 117, + 40, 118, 0, 0, 347, 0, 0, 348, 43, 121, + 114, 115, 116, 117, 0, 118, 0, 0, 391, 119, + 120, 69, 0, 121, 114, 115, 116, 117, 0, 118, + 0, 0, 395, 119, 120, 69, 0, 121, 114, 115, + 116, 117, 0, 118, 0, 0, 482, 119, 120, 69, + 0, 121, 114, 115, 116, 117, 0, 118, 0, 0, + 489, 119, 120, 69, 0, 121, 114, 115, 116, 117, + 0, 118, 0, 0, 449, 0, 0, 0, 0, 121 }; static const yytype_int16 yycheck[] = { - 78, 64, 128, 110, 213, 178, 335, 227, 424, 4, - 236, 108, 11, 1, 70, 38, 4, 70, 4, 70, - 15, 29, 10, 104, 12, 13, 14, 108, 5, 29, - 5, 8, 9, 8, 9, 336, 109, 70, 172, 70, - 108, 29, 30, 31, 70, 33, 4, 119, 135, 136, - 116, 59, 104, 179, 4, 32, 122, 32, 16, 59, - 112, 108, 85, 7, 14, 274, 200, 123, 277, 278, - 123, 467, 123, 469, 62, 63, 64, 65, 304, 4, - 30, 25, 81, 78, 70, 73, 173, 31, 0, 77, - 123, 79, 123, 219, 71, 4, 71, 123, 318, 177, - 70, 321, 108, 4, 520, 111, 184, 120, 120, 97, - 236, 4, 100, 101, 102, 103, 104, 105, 225, 245, - 108, 4, 80, 111, 112, 113, 76, 428, 108, 106, - 108, 106, 305, 111, 122, 10, 104, 114, 115, 114, - 115, 29, 362, 221, 445, 365, 4, 4, 449, 93, - 228, 229, 230, 97, 17, 99, 108, 99, 21, 111, - 286, 24, 106, 97, 50, 51, 52, 53, 104, 118, - 114, 115, 108, 61, 121, 111, 112, 303, 304, 108, - 55, 56, 57, 58, 59, 60, 74, 108, 108, 518, - 111, 269, 4, 271, 108, 70, 14, 111, 324, 325, - 122, 421, 328, 423, 100, 101, 102, 103, 112, 105, - 4, 10, 108, 12, 13, 14, 294, 113, 104, 122, - 346, 70, 108, 122, 122, 122, 304, 122, 306, 108, - 29, 30, 31, 119, 33, 408, 18, 19, 20, 21, - 122, 319, 24, 108, 322, 118, 4, 97, 119, 7, - 8, 9, 105, 379, 380, 70, 123, 7, 336, 337, - 120, 123, 123, 62, 63, 64, 65, 25, 123, 27, - 108, 123, 350, 31, 73, 25, 123, 123, 77, 120, - 79, 31, 100, 101, 102, 103, 4, 105, 71, 121, - 108, 109, 110, 111, 14, 113, 50, 51, 52, 53, - 120, 100, 101, 102, 103, 104, 105, 70, 517, 108, - 4, 4, 111, 112, 113, 104, 108, 443, 425, 426, - 4, 4, 4, 122, 122, 100, 101, 102, 103, 104, - 105, 4, 70, 108, 70, 93, 111, 14, 113, 417, - 98, 122, 116, 93, 122, 471, 10, 97, 106, 99, - 428, 429, 10, 104, 22, 433, 106, 104, 104, 437, - 108, 109, 110, 111, 114, 115, 444, 445, 120, 122, - 448, 449, 10, 451, 10, 70, 454, 122, 122, 118, - 100, 101, 102, 103, 510, 105, 464, 118, 108, 109, - 110, 111, 118, 113, 34, 35, 36, 37, 38, 39, - 40, 41, 465, 43, 44, 45, 46, 47, 100, 101, - 102, 103, 22, 105, 22, 22, 108, 495, 496, 118, - 498, 113, 500, 100, 101, 102, 103, 104, 105, 75, - 4, 108, 109, 110, 111, 112, 113, 4, 42, 4, - 22, 120, 123, 123, 48, 49, 4, 124, 125, 126, - 54, 55, 56, 57, 58, 59, 60, 122, 22, 122, - 22, 4, 66, 67, 68, 69, 123, 123, 4, 4, - 219, 12, 59, 185, 346, 126, 116, 108, 118, 119, - 100, 101, 102, 103, 104, 105, 200, 443, 108, 109, - 110, 111, 112, 113, 201, 100, 101, 102, 103, 119, - 105, 495, 380, 108, 109, 110, 111, 328, 113, 179, - 272, 272, 245, 117, 111, 119, 303, 184, 221, -1, - -1, 125, 126, 127, 128, 129, 130, 131, 132, 82, + 78, 64, 130, 112, 221, 183, 235, 343, 4, 432, + 244, 4, 70, 11, 38, 29, 70, 70, 1, 70, + 16, 4, 15, 4, 177, 344, 4, 10, 29, 12, + 13, 14, 70, 14, 475, 5, 477, 5, 8, 9, + 8, 9, 29, 109, 70, 59, 29, 30, 31, 30, + 33, 138, 139, 70, 207, 105, 184, 109, 59, 120, + 112, 85, 32, 113, 32, 282, 124, 110, 285, 286, + 124, 124, 105, 124, 61, 109, 109, 109, 312, 62, + 63, 64, 65, 81, 80, 78, 124, 74, 7, 4, + 73, 178, 70, 0, 77, 76, 79, 326, 124, 227, + 329, 71, 117, 71, 182, 528, 25, 124, 123, 4, + 109, 189, 31, 112, 70, 98, 244, 436, 101, 102, + 103, 104, 105, 106, 233, 253, 109, 4, 4, 112, + 113, 114, 7, 109, 453, 313, 112, 107, 457, 107, + 123, 370, 121, 4, 373, 115, 116, 115, 116, 109, + 25, 229, 50, 51, 52, 53, 31, 105, 236, 237, + 238, 109, 121, 105, 112, 113, 294, 4, 98, 101, + 102, 103, 104, 105, 106, 94, 100, 109, 4, 98, + 112, 100, 114, 311, 312, 17, 122, 14, 107, 21, + 526, 109, 24, 119, 112, 109, 115, 116, 112, 277, + 429, 279, 431, 109, 332, 333, 109, 105, 336, 4, + 123, 109, 4, 113, 123, 7, 8, 9, 123, 94, + 4, 123, 120, 98, 302, 100, 354, 50, 51, 52, + 53, 123, 107, 25, 312, 27, 314, 123, 416, 31, + 115, 116, 10, 10, 12, 13, 14, 109, 70, 327, + 123, 123, 330, 109, 110, 111, 112, 109, 109, 387, + 388, 29, 30, 31, 119, 33, 344, 345, 101, 102, + 103, 104, 106, 106, 101, 102, 103, 104, 105, 106, + 358, 114, 109, 110, 111, 112, 113, 114, 55, 56, + 57, 58, 59, 60, 62, 63, 64, 65, 125, 126, + 127, 98, 94, 70, 120, 73, 70, 99, 525, 77, + 124, 79, 124, 124, 124, 107, 14, 124, 124, 124, + 121, 121, 109, 451, 433, 434, 18, 19, 20, 21, + 109, 4, 24, 101, 102, 103, 104, 105, 106, 71, + 122, 109, 70, 121, 112, 113, 114, 425, 14, 4, + 4, 479, 105, 109, 4, 123, 4, 4, 436, 437, + 123, 4, 70, 441, 70, 117, 123, 445, 123, 10, + 10, 105, 105, 22, 452, 453, 105, 123, 456, 457, + 123, 459, 121, 123, 462, 10, 10, 70, 119, 119, + 518, 22, 119, 22, 472, 22, 119, 75, 4, 4, + 4, 22, 121, 101, 102, 103, 104, 124, 106, 124, + 473, 109, 110, 111, 112, 4, 114, 4, 123, 101, + 102, 103, 104, 22, 106, 503, 504, 109, 506, 123, + 508, 22, 114, 124, 124, 101, 102, 103, 104, 4, + 106, 4, 12, 109, 110, 111, 112, 42, 114, 59, + 227, 128, 190, 48, 49, 354, 207, 110, 208, 54, + 55, 56, 57, 58, 59, 60, 451, 503, 388, 336, + 253, 66, 67, 68, 69, 34, 35, 36, 37, 38, + 39, 40, 41, 184, 43, 44, 45, 46, 47, 101, + 102, 103, 104, 105, 106, 280, 311, 109, 110, 111, + 112, 113, 114, 189, 280, 113, -1, 229, 120, 101, + 102, 103, 104, 105, 106, -1, -1, 109, 110, 111, + 112, 113, 114, 118, -1, 120, -1, -1, -1, -1, + -1, 126, 127, 128, 129, 130, 131, 132, 133, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, - -1, 94, 95, 96, 100, 101, 102, 103, 104, 105, - -1, -1, 108, 109, 110, 111, 112, 113, 100, 101, - 102, 103, 104, 105, -1, -1, 108, -1, -1, 111, - 112, 113, 100, 101, 102, 103, -1, 105, -1, -1, - 108, 109, 110, 111, -1, 113, 100, 101, 102, 103, - -1, 105, -1, -1, 108, 109, 110, 111, -1, 113, - 100, 101, 102, 103, -1, 105, -1, -1, 108, 109, - 110, 111, -1, 113, 100, 101, 102, 103, -1, 105, - -1, -1, 108, 109, 110, 111, -1, 113, 100, 101, - 102, 103, -1, 105, -1, -1, -1, -1, -1, -1, - -1, 113 + 93, -1, 95, 96, 97, -1, -1, -1, 117, -1, + 119, 120, 101, 102, 103, 104, -1, 106, -1, -1, + 109, 110, 111, 112, -1, 114, 101, 102, 103, 104, + 105, 106, -1, -1, 109, -1, -1, 112, 113, 114, + 101, 102, 103, 104, -1, 106, -1, -1, 109, 110, + 111, 112, -1, 114, 101, 102, 103, 104, -1, 106, + -1, -1, 109, 110, 111, 112, -1, 114, 101, 102, + 103, 104, -1, 106, -1, -1, 109, 110, 111, 112, + -1, 114, 101, 102, 103, 104, -1, 106, -1, -1, + 109, 110, 111, 112, -1, 114, 101, 102, 103, 104, + -1, 106, -1, -1, 109, -1, -1, -1, -1, 114 }; /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing symbol of state STATE-NUM. */ static const yytype_uint16 yystos[] = { - 0, 4, 7, 8, 9, 25, 27, 31, 93, 98, - 106, 134, 135, 136, 137, 138, 140, 141, 152, 155, - 160, 108, 109, 108, 119, 156, 161, 142, 108, 153, - 4, 0, 136, 4, 70, 4, 120, 157, 158, 4, - 104, 108, 111, 112, 246, 247, 50, 51, 52, 53, - 218, 4, 31, 97, 106, 114, 115, 137, 143, 146, - 147, 154, 155, 208, 209, 210, 108, 120, 108, 111, - 159, 258, 162, 104, 144, 4, 147, 99, 14, 30, - 76, 148, 149, 210, 4, 121, 82, 83, 84, 85, - 86, 87, 88, 89, 90, 91, 92, 94, 95, 96, - 168, 169, 170, 171, 172, 173, 174, 182, 183, 184, - 118, 108, 100, 101, 102, 103, 105, 109, 110, 113, - 242, 250, 257, 258, 259, 108, 150, 4, 112, 258, - 122, 122, 122, 122, 122, 122, 122, 4, 184, 259, - 104, 112, 248, 249, 250, 70, 182, 119, 151, 242, - 243, 244, 245, 249, 108, 111, 145, 104, 108, 50, - 51, 52, 53, 104, 108, 119, 175, 176, 108, 108, - 145, 145, 163, 118, 105, 97, 253, 254, 119, 70, - 123, 123, 123, 251, 252, 70, 123, 123, 123, 123, - 123, 5, 32, 106, 114, 115, 138, 139, 164, 177, - 205, 206, 207, 145, 120, 250, 255, 256, 251, 245, - 120, 255, 176, 165, 108, 4, 71, 207, 1, 208, - 211, 121, 120, 167, 218, 70, 4, 10, 12, 13, - 14, 29, 30, 31, 33, 62, 63, 64, 65, 73, - 77, 79, 104, 108, 111, 112, 122, 143, 178, 193, - 195, 201, 203, 214, 219, 223, 225, 227, 228, 229, - 237, 238, 239, 242, 256, 4, 104, 259, 248, 14, - 250, 14, 250, 250, 215, 108, 111, 216, 217, 229, - 242, 224, 4, 4, 4, 243, 220, 122, 4, 230, - 34, 35, 36, 37, 38, 39, 40, 41, 43, 44, - 45, 46, 47, 116, 118, 119, 226, 166, 191, 250, - 10, 55, 56, 57, 58, 59, 60, 70, 240, 241, - 250, 240, 241, 218, 70, 70, 218, 218, 122, 179, - 194, 196, 108, 235, 236, 242, 202, 122, 250, 108, - 111, 242, 247, 14, 108, 111, 112, 124, 125, 126, - 221, 229, 242, 250, 251, 250, 18, 19, 20, 21, - 24, 192, 10, 248, 250, 10, 248, 250, 104, 212, - 213, 242, 242, 104, 104, 236, 186, 197, 198, 22, - 70, 123, 191, 108, 204, 232, 250, 108, 231, 232, - 250, 151, 250, 42, 48, 49, 54, 55, 56, 57, - 58, 59, 60, 66, 67, 68, 69, 117, 119, 125, - 126, 127, 128, 129, 130, 131, 132, 222, 120, 122, - 248, 10, 248, 10, 70, 118, 118, 123, 11, 81, - 181, 187, 4, 15, 78, 199, 4, 16, 80, 200, - 242, 108, 235, 118, 22, 70, 123, 233, 22, 70, - 123, 22, 251, 250, 118, 108, 111, 248, 248, 213, - 259, 259, 232, 250, 75, 185, 4, 250, 4, 250, - 4, 22, 228, 250, 108, 232, 17, 21, 24, 234, - 250, 108, 232, 250, 120, 250, 123, 123, 4, 250, - 180, 210, 233, 233, 242, 122, 22, 122, 22, 4, - 70, 188, 4, 231, 250, 108, 111, 250, 250, 29, - 61, 74, 189, 123, 123, 123, 4, 190, 242, 4, - 218, 191, 213 + 0, 4, 7, 8, 9, 25, 27, 31, 94, 99, + 107, 135, 136, 137, 138, 139, 141, 142, 153, 156, + 161, 109, 110, 109, 120, 157, 162, 143, 109, 154, + 4, 0, 137, 4, 70, 4, 121, 158, 159, 4, + 105, 109, 112, 113, 249, 250, 50, 51, 52, 53, + 221, 4, 31, 98, 107, 115, 116, 138, 144, 147, + 148, 155, 156, 211, 212, 213, 109, 121, 109, 112, + 160, 261, 163, 105, 145, 4, 148, 100, 14, 30, + 76, 149, 150, 213, 4, 122, 82, 83, 84, 85, + 86, 87, 88, 89, 90, 91, 92, 93, 95, 96, + 97, 169, 172, 174, 175, 176, 177, 178, 179, 185, + 186, 187, 119, 109, 101, 102, 103, 104, 106, 110, + 111, 114, 245, 253, 260, 261, 262, 109, 151, 4, + 113, 261, 123, 123, 123, 123, 123, 123, 123, 123, + 4, 187, 262, 105, 113, 251, 252, 253, 70, 185, + 120, 152, 245, 246, 247, 248, 252, 109, 112, 146, + 105, 109, 50, 51, 52, 53, 105, 109, 120, 170, + 171, 109, 173, 109, 109, 146, 146, 164, 119, 106, + 98, 256, 257, 120, 70, 124, 124, 124, 254, 255, + 70, 124, 70, 124, 124, 124, 124, 124, 5, 32, + 107, 115, 116, 139, 140, 165, 180, 208, 209, 210, + 146, 121, 253, 258, 259, 254, 248, 121, 258, 171, + 109, 166, 109, 4, 71, 210, 1, 211, 214, 122, + 121, 168, 221, 70, 4, 10, 12, 13, 14, 29, + 30, 31, 33, 62, 63, 64, 65, 73, 77, 79, + 105, 109, 112, 113, 123, 144, 181, 196, 198, 204, + 206, 217, 222, 226, 228, 230, 231, 232, 240, 241, + 242, 245, 259, 4, 105, 262, 251, 14, 253, 14, + 253, 253, 218, 109, 112, 219, 220, 232, 245, 227, + 4, 4, 4, 246, 223, 123, 4, 233, 34, 35, + 36, 37, 38, 39, 40, 41, 43, 44, 45, 46, + 47, 117, 119, 120, 229, 167, 194, 253, 10, 55, + 56, 57, 58, 59, 60, 70, 243, 244, 253, 243, + 244, 221, 70, 70, 221, 221, 123, 182, 197, 199, + 109, 238, 239, 245, 205, 123, 253, 109, 112, 245, + 250, 14, 109, 112, 113, 125, 126, 127, 224, 232, + 245, 253, 254, 253, 18, 19, 20, 21, 24, 195, + 10, 251, 253, 10, 251, 253, 105, 215, 216, 245, + 245, 105, 105, 239, 189, 200, 201, 22, 70, 124, + 194, 109, 207, 235, 253, 109, 234, 235, 253, 152, + 253, 42, 48, 49, 54, 55, 56, 57, 58, 59, + 60, 66, 67, 68, 69, 118, 120, 126, 127, 128, + 129, 130, 131, 132, 133, 225, 121, 123, 251, 10, + 251, 10, 70, 119, 119, 124, 11, 81, 184, 190, + 4, 15, 78, 202, 4, 16, 80, 203, 245, 109, + 238, 119, 22, 70, 124, 236, 22, 70, 124, 22, + 254, 253, 119, 109, 112, 251, 251, 216, 262, 262, + 235, 253, 75, 188, 4, 253, 4, 253, 4, 22, + 231, 253, 109, 235, 17, 21, 24, 237, 253, 109, + 235, 253, 121, 253, 124, 124, 4, 253, 183, 213, + 236, 236, 245, 123, 22, 123, 22, 4, 70, 191, + 4, 234, 253, 109, 112, 253, 253, 29, 61, 74, + 192, 124, 124, 124, 4, 193, 245, 4, 221, 194, + 216 }; #define yyerrok (yyerrstatus = 0) @@ -3185,28 +3199,28 @@ YYSTYPE yylval; case 2: /* Line 1455 of yacc.c */ -#line 1116 "compilers/imcc/imcc.y" +#line 1123 "compilers/imcc/imcc.y" { if (yynerrs) YYABORT; (yyval.i) = 0; } break; case 5: /* Line 1455 of yacc.c */ -#line 1125 "compilers/imcc/imcc.y" +#line 1132 "compilers/imcc/imcc.y" { (yyval.i) = (yyvsp[(1) - (1)].i); } break; case 6: /* Line 1455 of yacc.c */ -#line 1126 "compilers/imcc/imcc.y" +#line 1133 "compilers/imcc/imcc.y" { (yyval.i) = (yyvsp[(1) - (1)].i); } break; case 7: /* Line 1455 of yacc.c */ -#line 1128 "compilers/imcc/imcc.y" +#line 1135 "compilers/imcc/imcc.y" { (yyval.i) = (yyvsp[(1) - (1)].i); imc_close_unit(imcc, imcc->cur_unit); @@ -3217,7 +3231,7 @@ YYSTYPE yylval; case 8: /* Line 1455 of yacc.c */ -#line 1134 "compilers/imcc/imcc.y" +#line 1141 "compilers/imcc/imcc.y" { (yyval.i) = (yyvsp[(1) - (1)].i); imc_close_unit(imcc, imcc->cur_unit); @@ -3228,42 +3242,42 @@ YYSTYPE yylval; case 9: /* Line 1455 of yacc.c */ -#line 1139 "compilers/imcc/imcc.y" +#line 1146 "compilers/imcc/imcc.y" { (yyval.i) = 0; } break; case 10: /* Line 1455 of yacc.c */ -#line 1140 "compilers/imcc/imcc.y" +#line 1147 "compilers/imcc/imcc.y" { (yyval.i) = 0; } break; case 11: /* Line 1455 of yacc.c */ -#line 1141 "compilers/imcc/imcc.y" +#line 1148 "compilers/imcc/imcc.y" { (yyval.i) = 0; } break; case 12: /* Line 1455 of yacc.c */ -#line 1142 "compilers/imcc/imcc.y" +#line 1149 "compilers/imcc/imcc.y" { (yyval.i) = 0; } break; case 13: /* Line 1455 of yacc.c */ -#line 1146 "compilers/imcc/imcc.y" +#line 1153 "compilers/imcc/imcc.y" { (yyval.i) = 0; } break; case 14: /* Line 1455 of yacc.c */ -#line 1148 "compilers/imcc/imcc.y" +#line 1155 "compilers/imcc/imcc.y" { (yyval.i) = 0; do_loadlib(imcc, (yyvsp[(2) - (3)].s)); @@ -3274,7 +3288,7 @@ YYSTYPE yylval; case 15: /* Line 1455 of yacc.c */ -#line 1157 "compilers/imcc/imcc.y" +#line 1164 "compilers/imcc/imcc.y" { imcc->line = atoi((yyvsp[(2) - (5)].s)); /* set_filename() frees the STRINGC */ @@ -3285,7 +3299,7 @@ YYSTYPE yylval; case 16: /* Line 1455 of yacc.c */ -#line 1163 "compilers/imcc/imcc.y" +#line 1170 "compilers/imcc/imcc.y" { /* set_filename() frees the STRINGC */ set_filename(imcc, (yyvsp[(2) - (3)].s)); @@ -3295,7 +3309,7 @@ YYSTYPE yylval; case 17: /* Line 1455 of yacc.c */ -#line 1171 "compilers/imcc/imcc.y" +#line 1178 "compilers/imcc/imcc.y" { /* We'll want to store an entry while emitting instructions, so just * store annotation like it's an instruction. */ @@ -3308,7 +3322,7 @@ YYSTYPE yylval; case 18: /* Line 1455 of yacc.c */ -#line 1183 "compilers/imcc/imcc.y" +#line 1190 "compilers/imcc/imcc.y" { STRING * const hll_name = Parrot_str_unescape(imcc->interp, (yyvsp[(2) - (2)].s) + 1, '"', NULL); Parrot_pcc_set_HLL(imcc->interp, CURRENT_CONTEXT(imcc->interp), @@ -3323,14 +3337,14 @@ YYSTYPE yylval; case 19: /* Line 1455 of yacc.c */ -#line 1195 "compilers/imcc/imcc.y" +#line 1202 "compilers/imcc/imcc.y" { imcc->is_def = 1; } break; case 20: /* Line 1455 of yacc.c */ -#line 1196 "compilers/imcc/imcc.y" +#line 1203 "compilers/imcc/imcc.y" { mk_const_ident(imcc, (yyvsp[(4) - (6)].s), (yyvsp[(3) - (6)].t), (yyvsp[(6) - (6)].sr), 1); mem_sys_free((yyvsp[(4) - (6)].s)); @@ -3341,14 +3355,14 @@ YYSTYPE yylval; case 21: /* Line 1455 of yacc.c */ -#line 1204 "compilers/imcc/imcc.y" +#line 1211 "compilers/imcc/imcc.y" { imcc->is_def = 1; } break; case 22: /* Line 1455 of yacc.c */ -#line 1205 "compilers/imcc/imcc.y" +#line 1212 "compilers/imcc/imcc.y" { (yyval.i) = mk_pmc_const_named(imcc, imcc->cur_unit, (yyvsp[(3) - (6)].s), (yyvsp[(4) - (6)].sr), (yyvsp[(6) - (6)].s)); mem_sys_free((yyvsp[(3) - (6)].s)); @@ -3360,49 +3374,49 @@ YYSTYPE yylval; case 27: /* Line 1455 of yacc.c */ -#line 1223 "compilers/imcc/imcc.y" +#line 1230 "compilers/imcc/imcc.y" { (yyval.i) = 0; } break; case 28: /* Line 1455 of yacc.c */ -#line 1224 "compilers/imcc/imcc.y" +#line 1231 "compilers/imcc/imcc.y" { (yyval.i) = 0; } break; case 29: /* Line 1455 of yacc.c */ -#line 1225 "compilers/imcc/imcc.y" +#line 1232 "compilers/imcc/imcc.y" { (yyval.i) = 0; } break; case 30: /* Line 1455 of yacc.c */ -#line 1226 "compilers/imcc/imcc.y" +#line 1233 "compilers/imcc/imcc.y" { (yyval.i) = 0; } break; case 31: /* Line 1455 of yacc.c */ -#line 1227 "compilers/imcc/imcc.y" +#line 1234 "compilers/imcc/imcc.y" { (yyval.i) = (yyvsp[(1) - (1)].i); } break; case 34: /* Line 1455 of yacc.c */ -#line 1232 "compilers/imcc/imcc.y" +#line 1239 "compilers/imcc/imcc.y" { clear_state(imcc); } break; case 35: /* Line 1455 of yacc.c */ -#line 1234 "compilers/imcc/imcc.y" +#line 1241 "compilers/imcc/imcc.y" { (yyval.i) = INS(imcc, imcc->cur_unit, (yyvsp[(2) - (3)].s), 0, imcc->regs, imcc->nargs, imcc -> keyvec, 1); @@ -3413,7 +3427,7 @@ YYSTYPE yylval; case 36: /* Line 1455 of yacc.c */ -#line 1240 "compilers/imcc/imcc.y" +#line 1247 "compilers/imcc/imcc.y" { imc_close_unit(imcc, imcc->cur_unit); imcc->cur_unit = imc_open_unit(imcc, IMC_PASM); @@ -3423,7 +3437,7 @@ YYSTYPE yylval; case 37: /* Line 1455 of yacc.c */ -#line 1245 "compilers/imcc/imcc.y" +#line 1252 "compilers/imcc/imcc.y" { (yyval.i) = iSUBROUTINE(imcc, imcc->cur_unit, mk_sub_label(imcc, (yyvsp[(4) - (4)].s))); imcc->cur_call->pcc_sub->pragma = (yyvsp[(3) - (4)].t); @@ -3434,7 +3448,7 @@ YYSTYPE yylval; case 38: /* Line 1455 of yacc.c */ -#line 1251 "compilers/imcc/imcc.y" +#line 1258 "compilers/imcc/imcc.y" { (yyval.i) = MK_I(imcc, imcc->cur_unit, "null", 1, (yyvsp[(2) - (2)].sr)); } @@ -3443,7 +3457,7 @@ YYSTYPE yylval; case 39: /* Line 1455 of yacc.c */ -#line 1255 "compilers/imcc/imcc.y" +#line 1262 "compilers/imcc/imcc.y" { char *name = mem_sys_strdup((yyvsp[(2) - (4)].s) + 1); SymReg *r = mk_pasm_reg(imcc, (yyvsp[(4) - (4)].s)); @@ -3461,21 +3475,21 @@ YYSTYPE yylval; case 40: /* Line 1455 of yacc.c */ -#line 1267 "compilers/imcc/imcc.y" +#line 1274 "compilers/imcc/imcc.y" { (yyval.i) = 0;} break; case 42: /* Line 1455 of yacc.c */ -#line 1275 "compilers/imcc/imcc.y" +#line 1282 "compilers/imcc/imcc.y" { imcc->cur_unit = imc_open_unit(imcc, IMC_PASM); } break; case 43: /* Line 1455 of yacc.c */ -#line 1278 "compilers/imcc/imcc.y" +#line 1285 "compilers/imcc/imcc.y" { /* if (optimizer_level & OPT_PASM) imc_compile_unit(interp, imcc->cur_unit); @@ -3488,7 +3502,7 @@ YYSTYPE yylval; case 46: /* Line 1455 of yacc.c */ -#line 1294 "compilers/imcc/imcc.y" +#line 1301 "compilers/imcc/imcc.y" { int re_open = 0; (yyval.i) = 0; @@ -3505,21 +3519,21 @@ YYSTYPE yylval; case 47: /* Line 1455 of yacc.c */ -#line 1308 "compilers/imcc/imcc.y" +#line 1315 "compilers/imcc/imcc.y" { (yyval.sr) = (yyvsp[(2) - (3)].sr); } break; case 48: /* Line 1455 of yacc.c */ -#line 1309 "compilers/imcc/imcc.y" +#line 1316 "compilers/imcc/imcc.y" { (yyval.sr) = NULL; } break; case 49: /* Line 1455 of yacc.c */ -#line 1313 "compilers/imcc/imcc.y" +#line 1320 "compilers/imcc/imcc.y" { imcc->nkeys = 0; } @@ -3528,7 +3542,7 @@ YYSTYPE yylval; case 50: /* Line 1455 of yacc.c */ -#line 1317 "compilers/imcc/imcc.y" +#line 1324 "compilers/imcc/imcc.y" { (yyval.sr) = link_keys(imcc, imcc->nkeys, imcc->keys, 0); } @@ -3537,14 +3551,14 @@ YYSTYPE yylval; case 51: /* Line 1455 of yacc.c */ -#line 1323 "compilers/imcc/imcc.y" +#line 1330 "compilers/imcc/imcc.y" { imcc->keys[imcc->nkeys++] = (yyvsp[(1) - (1)].sr); } break; case 52: /* Line 1455 of yacc.c */ -#line 1325 "compilers/imcc/imcc.y" +#line 1332 "compilers/imcc/imcc.y" { imcc->keys[imcc->nkeys++] = (yyvsp[(3) - (3)].sr); (yyval.sr) = imcc->keys[0]; @@ -3554,7 +3568,7 @@ YYSTYPE yylval; case 53: /* Line 1455 of yacc.c */ -#line 1333 "compilers/imcc/imcc.y" +#line 1340 "compilers/imcc/imcc.y" { imcc->cur_unit = imc_open_unit(imcc, IMC_PCCSUB); } @@ -3563,7 +3577,7 @@ YYSTYPE yylval; case 54: /* Line 1455 of yacc.c */ -#line 1337 "compilers/imcc/imcc.y" +#line 1344 "compilers/imcc/imcc.y" { iSUBROUTINE(imcc, imcc->cur_unit, (yyvsp[(3) - (3)].sr)); } @@ -3572,7 +3586,7 @@ YYSTYPE yylval; case 55: /* Line 1455 of yacc.c */ -#line 1341 "compilers/imcc/imcc.y" +#line 1348 "compilers/imcc/imcc.y" { imcc->cur_call->pcc_sub->pragma = (yyvsp[(5) - (6)].t); if (!imcc->cur_unit->instructions->symregs[0]->subid) { @@ -3585,21 +3599,21 @@ YYSTYPE yylval; case 56: /* Line 1455 of yacc.c */ -#line 1348 "compilers/imcc/imcc.y" +#line 1355 "compilers/imcc/imcc.y" { (yyval.i) = 0; imcc->cur_call = NULL; } break; case 57: /* Line 1455 of yacc.c */ -#line 1353 "compilers/imcc/imcc.y" +#line 1360 "compilers/imcc/imcc.y" { imcc->is_def = 1; } break; case 58: /* Line 1455 of yacc.c */ -#line 1355 "compilers/imcc/imcc.y" +#line 1362 "compilers/imcc/imcc.y" { if (/* IMCC_INFO(interp)->cur_unit->last_ins->op || */ !(imcc->cur_unit->last_ins->type & ITPCCPARAM)) { @@ -3628,14 +3642,14 @@ YYSTYPE yylval; case 59: /* Line 1455 of yacc.c */ -#line 1378 "compilers/imcc/imcc.y" +#line 1385 "compilers/imcc/imcc.y" { imcc->is_def = 0; } break; case 60: /* Line 1455 of yacc.c */ -#line 1383 "compilers/imcc/imcc.y" +#line 1390 "compilers/imcc/imcc.y" { if ((yyvsp[(3) - (3)].t) & VT_OPT_FLAG && (yyvsp[(1) - (3)].t) != 'I') { const char *type; @@ -3660,231 +3674,262 @@ YYSTYPE yylval; case 61: /* Line 1455 of yacc.c */ -#line 1407 "compilers/imcc/imcc.y" +#line 1414 "compilers/imcc/imcc.y" { (yyval.t) = 0; } break; case 62: /* Line 1455 of yacc.c */ -#line 1412 "compilers/imcc/imcc.y" +#line 1419 "compilers/imcc/imcc.y" { - (yyval.t) = 0; - imcc->cur_unit->outer = mk_sub_address_fromc(imcc, (yyvsp[(3) - (4)].s)); - mem_sys_free((yyvsp[(3) - (4)].s)); + add_pcc_multi(imcc, imcc->cur_call, NULL); } break; case 63: /* Line 1455 of yacc.c */ -#line 1418 "compilers/imcc/imcc.y" +#line 1423 "compilers/imcc/imcc.y" { (yyval.t) = 0; - imcc->cur_unit->outer = mk_const(imcc, (yyvsp[(3) - (4)].s), 'S'); - mem_sys_free((yyvsp[(3) - (4)].s)); + add_pcc_multi(imcc, imcc->cur_call, (yyvsp[(3) - (3)].sr)); } break; case 64: /* Line 1455 of yacc.c */ -#line 1427 "compilers/imcc/imcc.y" +#line 1428 "compilers/imcc/imcc.y" { - (yyval.t) = P_VTABLE; - imcc->cur_unit->vtable_name = NULL; - imcc->cur_unit->is_vtable_method = 1; + (yyval.t) = 0; + add_pcc_multi(imcc, imcc->cur_call, (yyvsp[(1) - (1)].sr)); } break; case 65: /* Line 1455 of yacc.c */ -#line 1433 "compilers/imcc/imcc.y" - { - (yyval.t) = P_VTABLE; - imcc->cur_unit->vtable_name = (yyvsp[(3) - (4)].s); - imcc->cur_unit->is_vtable_method = 1; - } +#line 1435 "compilers/imcc/imcc.y" + { (yyval.sr) = mk_const(imcc, "INTVAL", 'S'); } break; case 66: /* Line 1455 of yacc.c */ -#line 1442 "compilers/imcc/imcc.y" - { - (yyval.t) = P_METHOD; - imcc->cur_unit->method_name = NULL; - imcc->cur_unit->is_method = 1; - } +#line 1436 "compilers/imcc/imcc.y" + { (yyval.sr) = mk_const(imcc, "FLOATVAL", 'S'); } break; case 67: /* Line 1455 of yacc.c */ -#line 1448 "compilers/imcc/imcc.y" - { - (yyval.t) = P_METHOD; - imcc->cur_unit->method_name = (yyvsp[(3) - (4)].s); - imcc->cur_unit->is_method = 1; - } +#line 1437 "compilers/imcc/imcc.y" + { (yyval.sr) = mk_const(imcc, "PMC", 'S'); } break; case 68: /* Line 1455 of yacc.c */ -#line 1457 "compilers/imcc/imcc.y" - { - (yyval.t) = P_NSENTRY; - imcc->cur_unit->ns_entry_name = NULL; - imcc->cur_unit->has_ns_entry_name = 1; - } +#line 1438 "compilers/imcc/imcc.y" + { (yyval.sr) = mk_const(imcc, "STRING", 'S'); } break; case 69: /* Line 1455 of yacc.c */ -#line 1463 "compilers/imcc/imcc.y" +#line 1440 "compilers/imcc/imcc.y" { - (yyval.t) = P_NSENTRY; - imcc->cur_unit->ns_entry_name = (yyvsp[(3) - (4)].s); - imcc->cur_unit->has_ns_entry_name = 1; + SymReg *r; + if (strcmp((yyvsp[(1) - (1)].s), "_") != 0) + r = mk_const(imcc, (yyvsp[(1) - (1)].s), 'S'); + else { + r = mk_const(imcc, "PMC", 'S'); + } + mem_sys_free((yyvsp[(1) - (1)].s)); + (yyval.sr) = r; } break; case 70: /* Line 1455 of yacc.c */ -#line 1472 "compilers/imcc/imcc.y" +#line 1451 "compilers/imcc/imcc.y" { - (yyval.t) = 0; - imcc->cur_unit->instance_of = (yyvsp[(3) - (4)].s); + SymReg *r; + if (strcmp((yyvsp[(1) - (1)].s), "\"_\"") == 0 || strcmp((yyvsp[(1) - (1)].s), "'_'") == 0) + r = mk_const(imcc, "PMC", 'S'); + else { + r = mk_const(imcc, (yyvsp[(1) - (1)].s), 'S'); + } + mem_sys_free((yyvsp[(1) - (1)].s)); + (yyval.sr) = r; } break; case 71: /* Line 1455 of yacc.c */ -#line 1480 "compilers/imcc/imcc.y" - { - (yyval.t) = 0; - imcc->cur_unit->subid = NULL; - } +#line 1461 "compilers/imcc/imcc.y" + { (yyval.sr) = (yyvsp[(2) - (3)].sr); } break; case 72: /* Line 1455 of yacc.c */ -#line 1485 "compilers/imcc/imcc.y" - { - SymReg *r = mk_const(imcc, (yyvsp[(3) - (4)].s), 'S'); - (yyval.t) = 0; - imcc->cur_unit->subid = r; - imcc->cur_unit->instructions->symregs[0]->subid = r; - mem_sys_free((yyvsp[(3) - (4)].s)); - } +#line 1466 "compilers/imcc/imcc.y" + { (yyval.t) = 0; } break; case 73: /* Line 1455 of yacc.c */ -#line 1496 "compilers/imcc/imcc.y" +#line 1471 "compilers/imcc/imcc.y" { - add_pcc_multi(imcc, imcc->cur_call, NULL); + SymReg * const r = mk_const(imcc, (yyvsp[(3) - (3)].s), 'S'); + add_pcc_flag_str(imcc, imcc->cur_call, r); + mem_sys_free((yyvsp[(3) - (3)].s)); + (yyval.sr) = r; } break; case 74: /* Line 1455 of yacc.c */ -#line 1500 "compilers/imcc/imcc.y" +#line 1478 "compilers/imcc/imcc.y" { - (yyval.t) = 0; - add_pcc_multi(imcc, imcc->cur_call, (yyvsp[(3) - (3)].sr)); + SymReg * const r = mk_const(imcc, (yyvsp[(1) - (1)].s), 'S'); + add_pcc_flag_str(imcc, imcc->cur_call, r); + mem_sys_free((yyvsp[(1) - (1)].s)); + (yyval.sr) = r; } break; case 75: /* Line 1455 of yacc.c */ -#line 1505 "compilers/imcc/imcc.y" +#line 1489 "compilers/imcc/imcc.y" { (yyval.t) = 0; - add_pcc_multi(imcc, imcc->cur_call, (yyvsp[(1) - (1)].sr)); + imcc->cur_unit->outer = mk_sub_address_fromc(imcc, (yyvsp[(3) - (4)].s)); + mem_sys_free((yyvsp[(3) - (4)].s)); } break; case 76: /* Line 1455 of yacc.c */ -#line 1512 "compilers/imcc/imcc.y" - { (yyval.sr) = mk_const(imcc, "INTVAL", 'S'); } +#line 1495 "compilers/imcc/imcc.y" + { + (yyval.t) = 0; + imcc->cur_unit->outer = mk_const(imcc, (yyvsp[(3) - (4)].s), 'S'); + mem_sys_free((yyvsp[(3) - (4)].s)); + } break; case 77: /* Line 1455 of yacc.c */ -#line 1513 "compilers/imcc/imcc.y" - { (yyval.sr) = mk_const(imcc, "FLOATVAL", 'S'); } +#line 1504 "compilers/imcc/imcc.y" + { + (yyval.t) = P_VTABLE; + imcc->cur_unit->vtable_name = NULL; + imcc->cur_unit->is_vtable_method = 1; + } break; case 78: /* Line 1455 of yacc.c */ -#line 1514 "compilers/imcc/imcc.y" - { (yyval.sr) = mk_const(imcc, "PMC", 'S'); } +#line 1510 "compilers/imcc/imcc.y" + { + (yyval.t) = P_VTABLE; + imcc->cur_unit->vtable_name = (yyvsp[(3) - (4)].s); + imcc->cur_unit->is_vtable_method = 1; + } break; case 79: /* Line 1455 of yacc.c */ -#line 1515 "compilers/imcc/imcc.y" - { (yyval.sr) = mk_const(imcc, "STRING", 'S'); } +#line 1519 "compilers/imcc/imcc.y" + { + (yyval.t) = P_METHOD; + imcc->cur_unit->method_name = NULL; + imcc->cur_unit->is_method = 1; + } break; case 80: /* Line 1455 of yacc.c */ -#line 1517 "compilers/imcc/imcc.y" +#line 1525 "compilers/imcc/imcc.y" { - SymReg *r; - if (strcmp((yyvsp[(1) - (1)].s), "_") != 0) - r = mk_const(imcc, (yyvsp[(1) - (1)].s), 'S'); - else { - r = mk_const(imcc, "PMC", 'S'); - } - mem_sys_free((yyvsp[(1) - (1)].s)); - (yyval.sr) = r; + (yyval.t) = P_METHOD; + imcc->cur_unit->method_name = (yyvsp[(3) - (4)].s); + imcc->cur_unit->is_method = 1; } break; case 81: /* Line 1455 of yacc.c */ -#line 1528 "compilers/imcc/imcc.y" +#line 1534 "compilers/imcc/imcc.y" { - SymReg *r; - if (strcmp((yyvsp[(1) - (1)].s), "_") != 0) - r = mk_const(imcc, (yyvsp[(1) - (1)].s), 'S'); - else { - r = mk_const(imcc, "PMC", 'S'); - } - mem_sys_free((yyvsp[(1) - (1)].s)); - (yyval.sr) = r; + (yyval.t) = P_NSENTRY; + imcc->cur_unit->ns_entry_name = NULL; + imcc->cur_unit->has_ns_entry_name = 1; } break; case 82: /* Line 1455 of yacc.c */ -#line 1538 "compilers/imcc/imcc.y" - { (yyval.sr) = (yyvsp[(2) - (3)].sr); } +#line 1540 "compilers/imcc/imcc.y" + { + (yyval.t) = P_NSENTRY; + imcc->cur_unit->ns_entry_name = (yyvsp[(3) - (4)].s); + imcc->cur_unit->has_ns_entry_name = 1; + } + break; + + case 83: + +/* Line 1455 of yacc.c */ +#line 1549 "compilers/imcc/imcc.y" + { + (yyval.t) = 0; + imcc->cur_unit->instance_of = (yyvsp[(3) - (4)].s); + } + break; + + case 84: + +/* Line 1455 of yacc.c */ +#line 1557 "compilers/imcc/imcc.y" + { + (yyval.t) = 0; + imcc->cur_unit->subid = NULL; + } break; case 85: /* Line 1455 of yacc.c */ -#line 1548 "compilers/imcc/imcc.y" +#line 1562 "compilers/imcc/imcc.y" + { + SymReg *r = mk_const(imcc, (yyvsp[(3) - (4)].s), 'S'); + (yyval.t) = 0; + imcc->cur_unit->subid = r; + imcc->cur_unit->instructions->symregs[0]->subid = r; + mem_sys_free((yyvsp[(3) - (4)].s)); + } + break; + + case 88: + +/* Line 1455 of yacc.c */ +#line 1578 "compilers/imcc/imcc.y" { char name[128]; SymReg *r; @@ -3903,141 +3948,155 @@ YYSTYPE yylval; } break; - case 86: + case 89: /* Line 1455 of yacc.c */ -#line 1569 "compilers/imcc/imcc.y" +#line 1599 "compilers/imcc/imcc.y" { (yyval.i) = 0; imcc->cur_call = NULL; } break; - case 87: + case 90: /* Line 1455 of yacc.c */ -#line 1573 "compilers/imcc/imcc.y" +#line 1603 "compilers/imcc/imcc.y" { (yyval.i) = NULL; imcc->cur_call->pcc_sub->label = 0; } break; - case 88: + case 91: /* Line 1455 of yacc.c */ -#line 1574 "compilers/imcc/imcc.y" +#line 1604 "compilers/imcc/imcc.y" { (yyval.i) = NULL; imcc->cur_call->pcc_sub->label = 1; } break; - case 89: + case 92: /* Line 1455 of yacc.c */ -#line 1578 "compilers/imcc/imcc.y" +#line 1608 "compilers/imcc/imcc.y" { (yyval.i) = NULL; } break; - case 90: + case 93: /* Line 1455 of yacc.c */ -#line 1579 "compilers/imcc/imcc.y" +#line 1609 "compilers/imcc/imcc.y" { (yyval.i) = NULL; imcc->cur_call->pcc_sub->object = (yyvsp[(2) - (3)].sr); } break; - case 91: + case 94: /* Line 1455 of yacc.c */ -#line 1583 "compilers/imcc/imcc.y" +#line 1613 "compilers/imcc/imcc.y" { (yyval.t) = 0; } break; - case 93: + case 96: /* Line 1455 of yacc.c */ -#line 1588 "compilers/imcc/imcc.y" +#line 1618 "compilers/imcc/imcc.y" { (yyval.t) = (yyvsp[(1) - (1)].t); } break; - case 94: + case 97: /* Line 1455 of yacc.c */ -#line 1589 "compilers/imcc/imcc.y" +#line 1619 "compilers/imcc/imcc.y" { (yyval.t) = (yyvsp[(1) - (2)].t) | (yyvsp[(2) - (2)].t); } break; - case 95: + case 98: /* Line 1455 of yacc.c */ -#line 1593 "compilers/imcc/imcc.y" - { (yyval.t) = P_LOAD; } +#line 1623 "compilers/imcc/imcc.y" + { + (yyval.t) = P_LOAD; + /* + SymReg * const r = mk_const(imcc, "load", 'S'); + add_pcc_flag_str(imcc, imcc->cur_call, r); + $$ = r; + */ + } break; - case 96: + case 99: /* Line 1455 of yacc.c */ -#line 1594 "compilers/imcc/imcc.y" - { (yyval.t) = P_INIT; } +#line 1631 "compilers/imcc/imcc.y" + { + (yyval.t) = P_INIT; + /* + SymReg * const r = mk_const(imcc, "load", 'S'); + add_pcc_flag_str(imcc, imcc->cur_call, r); + $$ = r; + */ + } break; - case 97: + case 100: /* Line 1455 of yacc.c */ -#line 1595 "compilers/imcc/imcc.y" +#line 1639 "compilers/imcc/imcc.y" { (yyval.t) = P_MAIN; } break; - case 98: + case 101: /* Line 1455 of yacc.c */ -#line 1596 "compilers/imcc/imcc.y" +#line 1640 "compilers/imcc/imcc.y" { (yyval.t) = P_IMMEDIATE; } break; - case 99: + case 102: /* Line 1455 of yacc.c */ -#line 1597 "compilers/imcc/imcc.y" +#line 1641 "compilers/imcc/imcc.y" { (yyval.t) = P_POSTCOMP; } break; - case 100: + case 103: /* Line 1455 of yacc.c */ -#line 1598 "compilers/imcc/imcc.y" +#line 1642 "compilers/imcc/imcc.y" { (yyval.t) = P_ANON; } break; - case 101: + case 104: /* Line 1455 of yacc.c */ -#line 1599 "compilers/imcc/imcc.y" +#line 1643 "compilers/imcc/imcc.y" { (yyval.t) = P_NEED_LEX; } break; - case 109: + case 113: /* Line 1455 of yacc.c */ -#line 1611 "compilers/imcc/imcc.y" +#line 1656 "compilers/imcc/imcc.y" { add_pcc_sub(imcc->cur_call, (yyvsp[(2) - (5)].sr)); add_pcc_cc(imcc->cur_call, (yyvsp[(4) - (5)].sr)); } break; - case 110: + case 114: /* Line 1455 of yacc.c */ -#line 1616 "compilers/imcc/imcc.y" +#line 1661 "compilers/imcc/imcc.y" { add_pcc_sub(imcc->cur_call, (yyvsp[(2) - (3)].sr)); } break; - case 111: + case 115: /* Line 1455 of yacc.c */ -#line 1622 "compilers/imcc/imcc.y" +#line 1667 "compilers/imcc/imcc.y" { (yyval.sr) = 0; } break; - case 112: + case 116: /* Line 1455 of yacc.c */ -#line 1624 "compilers/imcc/imcc.y" +#line 1669 "compilers/imcc/imcc.y" { if (imcc->adv_named_id) { add_pcc_named_param(imcc, imcc->cur_call, @@ -4049,48 +4108,48 @@ YYSTYPE yylval; } break; - case 113: + case 117: /* Line 1455 of yacc.c */ -#line 1636 "compilers/imcc/imcc.y" +#line 1681 "compilers/imcc/imcc.y" { (yyval.sr) = (yyvsp[(2) - (2)].sr); } break; - case 114: + case 118: /* Line 1455 of yacc.c */ -#line 1641 "compilers/imcc/imcc.y" +#line 1686 "compilers/imcc/imcc.y" { (yyval.sr) = 0; } break; - case 115: + case 119: /* Line 1455 of yacc.c */ -#line 1643 "compilers/imcc/imcc.y" +#line 1688 "compilers/imcc/imcc.y" { if ((yyvsp[(2) - (3)].sr)) add_pcc_result(imcc, imcc->cur_call, (yyvsp[(2) - (3)].sr)); } break; - case 116: + case 120: /* Line 1455 of yacc.c */ -#line 1650 "compilers/imcc/imcc.y" +#line 1695 "compilers/imcc/imcc.y" { (yyval.sr) = (yyvsp[(2) - (3)].sr); (yyval.sr)->type |= (yyvsp[(3) - (3)].t); } break; - case 117: + case 121: /* Line 1455 of yacc.c */ -#line 1651 "compilers/imcc/imcc.y" +#line 1696 "compilers/imcc/imcc.y" { imcc->is_def = 1; } break; - case 118: + case 122: /* Line 1455 of yacc.c */ -#line 1652 "compilers/imcc/imcc.y" +#line 1697 "compilers/imcc/imcc.y" { IdList * const l = (yyvsp[(4) - (4)].idlist); SymReg *ignored; @@ -4101,220 +4160,220 @@ YYSTYPE yylval; } break; - case 119: + case 123: /* Line 1455 of yacc.c */ -#line 1663 "compilers/imcc/imcc.y" +#line 1708 "compilers/imcc/imcc.y" { (yyval.t) = 0; } break; - case 120: + case 124: /* Line 1455 of yacc.c */ -#line 1664 "compilers/imcc/imcc.y" +#line 1709 "compilers/imcc/imcc.y" { (yyval.t) = (yyvsp[(1) - (2)].t) | (yyvsp[(2) - (2)].t); } break; - case 121: + case 125: /* Line 1455 of yacc.c */ -#line 1668 "compilers/imcc/imcc.y" +#line 1713 "compilers/imcc/imcc.y" { (yyval.t) = VT_FLAT; } break; - case 122: + case 126: /* Line 1455 of yacc.c */ -#line 1669 "compilers/imcc/imcc.y" +#line 1714 "compilers/imcc/imcc.y" { (yyval.t) = VT_OPTIONAL; } break; - case 123: + case 127: /* Line 1455 of yacc.c */ -#line 1670 "compilers/imcc/imcc.y" +#line 1715 "compilers/imcc/imcc.y" { (yyval.t) = VT_OPT_FLAG; } break; - case 124: + case 128: /* Line 1455 of yacc.c */ -#line 1671 "compilers/imcc/imcc.y" +#line 1716 "compilers/imcc/imcc.y" { (yyval.t) = VT_NAMED; } break; - case 125: + case 129: /* Line 1455 of yacc.c */ -#line 1672 "compilers/imcc/imcc.y" +#line 1717 "compilers/imcc/imcc.y" { adv_named_set(imcc, (yyvsp[(3) - (4)].s)); (yyval.t) = VT_NAMED; mem_sys_free((yyvsp[(3) - (4)].s)); } break; - case 126: + case 130: /* Line 1455 of yacc.c */ -#line 1673 "compilers/imcc/imcc.y" +#line 1718 "compilers/imcc/imcc.y" { adv_named_set_u(imcc, (yyvsp[(3) - (4)].s)); (yyval.t) = VT_NAMED; mem_sys_free((yyvsp[(3) - (4)].s)); } break; - case 127: + case 131: /* Line 1455 of yacc.c */ -#line 1674 "compilers/imcc/imcc.y" +#line 1719 "compilers/imcc/imcc.y" { (yyval.t) = VT_CALL_SIG; } break; - case 128: + case 132: /* Line 1455 of yacc.c */ -#line 1679 "compilers/imcc/imcc.y" +#line 1724 "compilers/imcc/imcc.y" { begin_return_or_yield(imcc, 0); } break; - case 129: + case 133: /* Line 1455 of yacc.c */ -#line 1681 "compilers/imcc/imcc.y" +#line 1726 "compilers/imcc/imcc.y" { (yyval.i) = 0; imcc->asm_state = AsmDefault; } break; - case 130: + case 134: /* Line 1455 of yacc.c */ -#line 1683 "compilers/imcc/imcc.y" +#line 1728 "compilers/imcc/imcc.y" { imcc->asm_state = AsmDefault; (yyval.i) = 0; } break; - case 131: + case 135: /* Line 1455 of yacc.c */ -#line 1690 "compilers/imcc/imcc.y" +#line 1735 "compilers/imcc/imcc.y" { begin_return_or_yield(imcc, 1); } break; - case 132: + case 136: /* Line 1455 of yacc.c */ -#line 1692 "compilers/imcc/imcc.y" +#line 1737 "compilers/imcc/imcc.y" { (yyval.i) = 0; imcc->asm_state = AsmDefault; } break; - case 133: + case 137: /* Line 1455 of yacc.c */ -#line 1696 "compilers/imcc/imcc.y" +#line 1741 "compilers/imcc/imcc.y" { (yyval.sr) = 0; } break; - case 134: + case 138: /* Line 1455 of yacc.c */ -#line 1698 "compilers/imcc/imcc.y" +#line 1743 "compilers/imcc/imcc.y" { if ((yyvsp[(1) - (2)].sr)) add_pcc_result(imcc, imcc->sr_return, (yyvsp[(1) - (2)].sr)); } break; - case 135: + case 139: /* Line 1455 of yacc.c */ -#line 1703 "compilers/imcc/imcc.y" +#line 1748 "compilers/imcc/imcc.y" { if ((yyvsp[(2) - (3)].sr)) add_pcc_result(imcc, imcc->sr_return, (yyvsp[(2) - (3)].sr)); } break; - case 136: + case 140: /* Line 1455 of yacc.c */ -#line 1710 "compilers/imcc/imcc.y" +#line 1755 "compilers/imcc/imcc.y" { (yyval.sr) = 0; } break; - case 137: + case 141: /* Line 1455 of yacc.c */ -#line 1712 "compilers/imcc/imcc.y" +#line 1757 "compilers/imcc/imcc.y" { if ((yyvsp[(1) - (2)].sr)) add_pcc_result(imcc, imcc->sr_return, (yyvsp[(1) - (2)].sr)); } break; - case 138: + case 142: /* Line 1455 of yacc.c */ -#line 1717 "compilers/imcc/imcc.y" +#line 1762 "compilers/imcc/imcc.y" { if ((yyvsp[(2) - (3)].sr)) add_pcc_result(imcc, imcc->sr_return, (yyvsp[(2) - (3)].sr)); } break; - case 139: + case 143: /* Line 1455 of yacc.c */ -#line 1724 "compilers/imcc/imcc.y" +#line 1769 "compilers/imcc/imcc.y" { (yyval.sr) = (yyvsp[(2) - (3)].sr); (yyval.sr)->type |= (yyvsp[(3) - (3)].t); } break; - case 140: + case 144: /* Line 1455 of yacc.c */ -#line 1728 "compilers/imcc/imcc.y" +#line 1773 "compilers/imcc/imcc.y" { (yyval.sr) = (yyvsp[(2) - (3)].sr); (yyval.sr)->type |= (yyvsp[(3) - (3)].t); } break; - case 141: + case 145: /* Line 1455 of yacc.c */ -#line 1733 "compilers/imcc/imcc.y" +#line 1778 "compilers/imcc/imcc.y" { if (imcc->asm_state == AsmDefault) begin_return_or_yield(imcc, (yyvsp[(1) - (2)].t)); } break; - case 142: + case 146: /* Line 1455 of yacc.c */ -#line 1738 "compilers/imcc/imcc.y" +#line 1783 "compilers/imcc/imcc.y" { imcc->asm_state = AsmDefault; (yyval.t) = 0; } break; - case 143: + case 147: /* Line 1455 of yacc.c */ -#line 1745 "compilers/imcc/imcc.y" +#line 1790 "compilers/imcc/imcc.y" { (yyval.t) = 0; } break; - case 144: + case 148: /* Line 1455 of yacc.c */ -#line 1746 "compilers/imcc/imcc.y" +#line 1791 "compilers/imcc/imcc.y" { (yyval.t) = 1; } break; - case 145: + case 149: /* Line 1455 of yacc.c */ -#line 1750 "compilers/imcc/imcc.y" +#line 1795 "compilers/imcc/imcc.y" { (yyval.i) = 0; } break; - case 146: + case 150: /* Line 1455 of yacc.c */ -#line 1752 "compilers/imcc/imcc.y" +#line 1797 "compilers/imcc/imcc.y" { if (imcc->adv_named_id) { add_pcc_named_return(imcc, imcc->sr_return, @@ -4326,20 +4385,20 @@ YYSTYPE yylval; } break; - case 147: + case 151: /* Line 1455 of yacc.c */ -#line 1762 "compilers/imcc/imcc.y" +#line 1807 "compilers/imcc/imcc.y" { SymReg * const name = mk_const(imcc, (yyvsp[(1) - (3)].s), 'S'); add_pcc_named_return(imcc, imcc->sr_return, name, (yyvsp[(3) - (3)].sr)); } break; - case 148: + case 152: /* Line 1455 of yacc.c */ -#line 1767 "compilers/imcc/imcc.y" +#line 1812 "compilers/imcc/imcc.y" { if (imcc->adv_named_id) { add_pcc_named_return(imcc, imcc->sr_return, @@ -4351,83 +4410,83 @@ YYSTYPE yylval; } break; - case 149: + case 153: /* Line 1455 of yacc.c */ -#line 1777 "compilers/imcc/imcc.y" +#line 1822 "compilers/imcc/imcc.y" { SymReg * const name = mk_const(imcc, (yyvsp[(3) - (5)].s), 'S'); add_pcc_named_return(imcc, imcc->sr_return, name, (yyvsp[(5) - (5)].sr)); } break; - case 152: + case 156: /* Line 1455 of yacc.c */ -#line 1798 "compilers/imcc/imcc.y" +#line 1843 "compilers/imcc/imcc.y" { clear_state(imcc); } break; - case 153: + case 157: /* Line 1455 of yacc.c */ -#line 1802 "compilers/imcc/imcc.y" +#line 1847 "compilers/imcc/imcc.y" { (yyval.i) = 0; } break; - case 154: + case 158: /* Line 1455 of yacc.c */ -#line 1804 "compilers/imcc/imcc.y" +#line 1849 "compilers/imcc/imcc.y" { (yyval.i) = (yyvsp[(2) - (2)].i); } break; - case 155: + case 159: /* Line 1455 of yacc.c */ -#line 1805 "compilers/imcc/imcc.y" +#line 1850 "compilers/imcc/imcc.y" { (yyval.i) = 0; } break; - case 156: + case 160: /* Line 1455 of yacc.c */ -#line 1806 "compilers/imcc/imcc.y" +#line 1851 "compilers/imcc/imcc.y" { (yyval.i) = 0; } break; - case 157: + case 161: /* Line 1455 of yacc.c */ -#line 1807 "compilers/imcc/imcc.y" +#line 1852 "compilers/imcc/imcc.y" { (yyval.i) = 0; } break; - case 158: + case 162: /* Line 1455 of yacc.c */ -#line 1808 "compilers/imcc/imcc.y" +#line 1853 "compilers/imcc/imcc.y" { (yyval.i) = 0; } break; - case 159: + case 163: /* Line 1455 of yacc.c */ -#line 1809 "compilers/imcc/imcc.y" +#line 1854 "compilers/imcc/imcc.y" { (yyval.i) = (yyvsp[(1) - (1)].i); } break; - case 160: + case 164: /* Line 1455 of yacc.c */ -#line 1813 "compilers/imcc/imcc.y" +#line 1858 "compilers/imcc/imcc.y" { (yyval.i) = NULL; } break; - case 164: + case 168: /* Line 1455 of yacc.c */ -#line 1824 "compilers/imcc/imcc.y" +#line 1869 "compilers/imcc/imcc.y" { Instruction * const i = iLABEL(imcc, imcc->cur_unit, mk_local_label(imcc, (yyvsp[(1) - (1)].s))); @@ -4436,17 +4495,17 @@ YYSTYPE yylval; } break; - case 165: + case 169: /* Line 1455 of yacc.c */ -#line 1835 "compilers/imcc/imcc.y" +#line 1880 "compilers/imcc/imcc.y" { (yyval.i) = (yyvsp[(2) - (3)].i); } break; - case 166: + case 170: /* Line 1455 of yacc.c */ -#line 1837 "compilers/imcc/imcc.y" +#line 1882 "compilers/imcc/imcc.y" { if (yynerrs >= PARROT_MAX_RECOVER_ERRORS) { IMCC_warning(imcc, "Too many errors. Correct some first.\n"); @@ -4456,10 +4515,10 @@ YYSTYPE yylval; } break; - case 167: + case 171: /* Line 1455 of yacc.c */ -#line 1848 "compilers/imcc/imcc.y" +#line 1893 "compilers/imcc/imcc.y" { IdList* const l = (yyvsp[(1) - (1)].idlist); l->next = NULL; @@ -4467,10 +4526,10 @@ YYSTYPE yylval; } break; - case 168: + case 172: /* Line 1455 of yacc.c */ -#line 1855 "compilers/imcc/imcc.y" +#line 1900 "compilers/imcc/imcc.y" { IdList* const l = (yyvsp[(3) - (3)].idlist); l->next = (yyvsp[(1) - (3)].idlist); @@ -4478,10 +4537,10 @@ YYSTYPE yylval; } break; - case 169: + case 173: /* Line 1455 of yacc.c */ -#line 1864 "compilers/imcc/imcc.y" +#line 1909 "compilers/imcc/imcc.y" { IdList* const l = mem_gc_allocate_n_zeroed_typed(imcc->interp, 1, IdList); l->id = (yyvsp[(1) - (1)].s); @@ -4489,17 +4548,17 @@ YYSTYPE yylval; } break; - case 172: + case 176: /* Line 1455 of yacc.c */ -#line 1874 "compilers/imcc/imcc.y" +#line 1919 "compilers/imcc/imcc.y" { imcc->is_def = 1; } break; - case 173: + case 177: /* Line 1455 of yacc.c */ -#line 1875 "compilers/imcc/imcc.y" +#line 1920 "compilers/imcc/imcc.y" { IdList *l = (yyvsp[(4) - (4)].idlist); while (l) { @@ -4514,10 +4573,10 @@ YYSTYPE yylval; } break; - case 174: + case 178: /* Line 1455 of yacc.c */ -#line 1888 "compilers/imcc/imcc.y" +#line 1933 "compilers/imcc/imcc.y" { SymReg *n; char *name = mem_sys_strdup((yyvsp[(2) - (4)].s) + 1); @@ -4529,10 +4588,10 @@ YYSTYPE yylval; } break; - case 175: + case 179: /* Line 1455 of yacc.c */ -#line 1898 "compilers/imcc/imcc.y" +#line 1943 "compilers/imcc/imcc.y" { SymReg *n = mk_const(imcc, (yyvsp[(2) - (4)].s), 'U'); set_lexical(imcc, (yyvsp[(4) - (4)].sr), n); (yyval.i) = 0; @@ -4540,17 +4599,17 @@ YYSTYPE yylval; } break; - case 176: + case 180: /* Line 1455 of yacc.c */ -#line 1903 "compilers/imcc/imcc.y" +#line 1948 "compilers/imcc/imcc.y" { imcc->is_def = 1; } break; - case 177: + case 181: /* Line 1455 of yacc.c */ -#line 1904 "compilers/imcc/imcc.y" +#line 1949 "compilers/imcc/imcc.y" { mk_const_ident(imcc, (yyvsp[(4) - (6)].s), (yyvsp[(3) - (6)].t), (yyvsp[(6) - (6)].sr), 0); imcc->is_def = 0; @@ -4558,17 +4617,17 @@ YYSTYPE yylval; } break; - case 179: + case 183: /* Line 1455 of yacc.c */ -#line 1911 "compilers/imcc/imcc.y" +#line 1956 "compilers/imcc/imcc.y" { imcc->is_def = 1; } break; - case 180: + case 184: /* Line 1455 of yacc.c */ -#line 1912 "compilers/imcc/imcc.y" +#line 1957 "compilers/imcc/imcc.y" { mk_const_ident(imcc, (yyvsp[(4) - (6)].s), (yyvsp[(3) - (6)].t), (yyvsp[(6) - (6)].sr), 1); imcc->is_def = 0; @@ -4576,10 +4635,10 @@ YYSTYPE yylval; } break; - case 181: + case 185: /* Line 1455 of yacc.c */ -#line 1918 "compilers/imcc/imcc.y" +#line 1963 "compilers/imcc/imcc.y" { (yyval.i) = NULL; imcc->cur_call->pcc_sub->tailcall = 1; @@ -4587,19 +4646,19 @@ YYSTYPE yylval; } break; - case 182: + case 186: /* Line 1455 of yacc.c */ -#line 1924 "compilers/imcc/imcc.y" +#line 1969 "compilers/imcc/imcc.y" { (yyval.i) = MK_I(imcc, imcc->cur_unit, "branch", 1, (yyvsp[(2) - (2)].sr)); } break; - case 183: + case 187: /* Line 1455 of yacc.c */ -#line 1928 "compilers/imcc/imcc.y" +#line 1973 "compilers/imcc/imcc.y" { (yyval.i) = INS(imcc, imcc->cur_unit, (yyvsp[(1) - (2)].s), 0, imcc->regs, imcc->nargs, imcc->keyvec, 1); @@ -4607,101 +4666,101 @@ YYSTYPE yylval; } break; - case 184: + case 188: /* Line 1455 of yacc.c */ -#line 1933 "compilers/imcc/imcc.y" +#line 1978 "compilers/imcc/imcc.y" { (yyval.i) = MK_I(imcc, imcc->cur_unit, "null", 1, (yyvsp[(2) - (2)].sr)); } break; - case 185: + case 189: /* Line 1455 of yacc.c */ -#line 1934 "compilers/imcc/imcc.y" +#line 1979 "compilers/imcc/imcc.y" { (yyval.i) = 0; imcc->cur_call = NULL; } break; - case 186: + case 190: /* Line 1455 of yacc.c */ -#line 1935 "compilers/imcc/imcc.y" +#line 1980 "compilers/imcc/imcc.y" { (yyval.i) = 0; } break; - case 189: + case 193: /* Line 1455 of yacc.c */ -#line 1938 "compilers/imcc/imcc.y" +#line 1983 "compilers/imcc/imcc.y" { (yyval.i) = 0;} break; - case 190: + case 194: /* Line 1455 of yacc.c */ -#line 1942 "compilers/imcc/imcc.y" +#line 1987 "compilers/imcc/imcc.y" {(yyval.t) = 'I'; } break; - case 191: + case 195: /* Line 1455 of yacc.c */ -#line 1943 "compilers/imcc/imcc.y" +#line 1988 "compilers/imcc/imcc.y" { (yyval.t) = 'N'; } break; - case 192: + case 196: /* Line 1455 of yacc.c */ -#line 1944 "compilers/imcc/imcc.y" +#line 1989 "compilers/imcc/imcc.y" { (yyval.t) = 'S'; } break; - case 193: + case 197: /* Line 1455 of yacc.c */ -#line 1945 "compilers/imcc/imcc.y" +#line 1990 "compilers/imcc/imcc.y" { (yyval.t) = 'P'; } break; - case 194: + case 198: /* Line 1455 of yacc.c */ -#line 1950 "compilers/imcc/imcc.y" +#line 1995 "compilers/imcc/imcc.y" { (yyval.i) = MK_I(imcc, imcc->cur_unit, "set", 2, (yyvsp[(1) - (3)].sr), (yyvsp[(3) - (3)].sr)); } break; - case 195: + case 199: /* Line 1455 of yacc.c */ -#line 1952 "compilers/imcc/imcc.y" +#line 1997 "compilers/imcc/imcc.y" { (yyval.i) = MK_I(imcc, imcc->cur_unit, (yyvsp[(3) - (4)].s), 2, (yyvsp[(1) - (4)].sr), (yyvsp[(4) - (4)].sr)); } break; - case 196: + case 200: /* Line 1455 of yacc.c */ -#line 1954 "compilers/imcc/imcc.y" +#line 1999 "compilers/imcc/imcc.y" { (yyval.i) = MK_I(imcc, imcc->cur_unit, (yyvsp[(4) - (5)].s), 3, (yyvsp[(1) - (5)].sr), (yyvsp[(3) - (5)].sr), (yyvsp[(5) - (5)].sr)); } break; - case 197: + case 201: /* Line 1455 of yacc.c */ -#line 1956 "compilers/imcc/imcc.y" +#line 2001 "compilers/imcc/imcc.y" { (yyval.i) = iINDEXFETCH(imcc, imcc->cur_unit, (yyvsp[(1) - (6)].sr), (yyvsp[(3) - (6)].sr), (yyvsp[(5) - (6)].sr)); } break; - case 198: + case 202: /* Line 1455 of yacc.c */ -#line 1958 "compilers/imcc/imcc.y" +#line 2003 "compilers/imcc/imcc.y" { (yyval.i) = iINDEXSET(imcc, imcc->cur_unit, (yyvsp[(1) - (6)].sr), (yyvsp[(3) - (6)].sr), (yyvsp[(6) - (6)].sr)); } break; - case 199: + case 203: /* Line 1455 of yacc.c */ -#line 1961 "compilers/imcc/imcc.y" +#line 2006 "compilers/imcc/imcc.y" { add_pcc_result(imcc, (yyvsp[(3) - (3)].i)->symregs[0], (yyvsp[(1) - (3)].sr)); imcc->cur_call = NULL; @@ -4709,220 +4768,220 @@ YYSTYPE yylval; } break; - case 200: + case 204: /* Line 1455 of yacc.c */ -#line 1967 "compilers/imcc/imcc.y" +#line 2012 "compilers/imcc/imcc.y" { (yyval.i) = IMCC_create_itcall_label(imcc); } break; - case 201: + case 205: /* Line 1455 of yacc.c */ -#line 1971 "compilers/imcc/imcc.y" +#line 2016 "compilers/imcc/imcc.y" { IMCC_itcall_sub(imcc, (yyvsp[(6) - (9)].sr)); imcc->cur_call = NULL; } break; - case 205: + case 209: /* Line 1455 of yacc.c */ -#line 1979 "compilers/imcc/imcc.y" +#line 2024 "compilers/imcc/imcc.y" { (yyval.i) = MK_I(imcc, imcc->cur_unit, "null", 1, (yyvsp[(1) - (3)].sr)); } break; - case 206: + case 210: /* Line 1455 of yacc.c */ -#line 1986 "compilers/imcc/imcc.y" +#line 2031 "compilers/imcc/imcc.y" { (yyval.s) = (char *)"not"; } break; - case 207: + case 211: /* Line 1455 of yacc.c */ -#line 1987 "compilers/imcc/imcc.y" +#line 2032 "compilers/imcc/imcc.y" { (yyval.s) = (char *)"bnot"; } break; - case 208: + case 212: /* Line 1455 of yacc.c */ -#line 1988 "compilers/imcc/imcc.y" +#line 2033 "compilers/imcc/imcc.y" { (yyval.s) = (char *)"neg"; } break; - case 209: + case 213: /* Line 1455 of yacc.c */ -#line 1992 "compilers/imcc/imcc.y" +#line 2037 "compilers/imcc/imcc.y" { (yyval.s) = (char *)"sub"; } break; - case 210: + case 214: /* Line 1455 of yacc.c */ -#line 1993 "compilers/imcc/imcc.y" +#line 2038 "compilers/imcc/imcc.y" { (yyval.s) = (char *)"add"; } break; - case 211: + case 215: /* Line 1455 of yacc.c */ -#line 1994 "compilers/imcc/imcc.y" +#line 2039 "compilers/imcc/imcc.y" { (yyval.s) = (char *)"mul"; } break; - case 212: + case 216: /* Line 1455 of yacc.c */ -#line 1995 "compilers/imcc/imcc.y" +#line 2040 "compilers/imcc/imcc.y" { (yyval.s) = (char *)"div"; } break; - case 213: + case 217: /* Line 1455 of yacc.c */ -#line 1996 "compilers/imcc/imcc.y" +#line 2041 "compilers/imcc/imcc.y" { (yyval.s) = (char *)"mod"; } break; - case 214: + case 218: /* Line 1455 of yacc.c */ -#line 1997 "compilers/imcc/imcc.y" +#line 2042 "compilers/imcc/imcc.y" { (yyval.s) = (char *)"fdiv"; } break; - case 215: + case 219: /* Line 1455 of yacc.c */ -#line 1998 "compilers/imcc/imcc.y" +#line 2043 "compilers/imcc/imcc.y" { (yyval.s) = (char *)"pow"; } break; - case 216: + case 220: /* Line 1455 of yacc.c */ -#line 1999 "compilers/imcc/imcc.y" +#line 2044 "compilers/imcc/imcc.y" { (yyval.s) = (char *)"concat"; } break; - case 217: + case 221: /* Line 1455 of yacc.c */ -#line 2000 "compilers/imcc/imcc.y" +#line 2045 "compilers/imcc/imcc.y" { (yyval.s) = (char *)"iseq"; } break; - case 218: + case 222: /* Line 1455 of yacc.c */ -#line 2001 "compilers/imcc/imcc.y" +#line 2046 "compilers/imcc/imcc.y" { (yyval.s) = (char *)"isne"; } break; - case 219: + case 223: /* Line 1455 of yacc.c */ -#line 2002 "compilers/imcc/imcc.y" +#line 2047 "compilers/imcc/imcc.y" { (yyval.s) = (char *)"isgt"; } break; - case 220: + case 224: /* Line 1455 of yacc.c */ -#line 2003 "compilers/imcc/imcc.y" +#line 2048 "compilers/imcc/imcc.y" { (yyval.s) = (char *)"isge"; } break; - case 221: + case 225: /* Line 1455 of yacc.c */ -#line 2004 "compilers/imcc/imcc.y" +#line 2049 "compilers/imcc/imcc.y" { (yyval.s) = (char *)"islt"; } break; - case 222: + case 226: /* Line 1455 of yacc.c */ -#line 2005 "compilers/imcc/imcc.y" +#line 2050 "compilers/imcc/imcc.y" { (yyval.s) = (char *)"isle"; } break; - case 223: + case 227: /* Line 1455 of yacc.c */ -#line 2006 "compilers/imcc/imcc.y" +#line 2051 "compilers/imcc/imcc.y" { (yyval.s) = (char *)"shl"; } break; - case 224: + case 228: /* Line 1455 of yacc.c */ -#line 2007 "compilers/imcc/imcc.y" +#line 2052 "compilers/imcc/imcc.y" { (yyval.s) = (char *)"shr"; } break; - case 225: + case 229: /* Line 1455 of yacc.c */ -#line 2008 "compilers/imcc/imcc.y" +#line 2053 "compilers/imcc/imcc.y" { (yyval.s) = (char *)"lsr"; } break; - case 226: + case 230: /* Line 1455 of yacc.c */ -#line 2009 "compilers/imcc/imcc.y" +#line 2054 "compilers/imcc/imcc.y" { (yyval.s) = (char *)"and"; } break; - case 227: + case 231: /* Line 1455 of yacc.c */ -#line 2010 "compilers/imcc/imcc.y" +#line 2055 "compilers/imcc/imcc.y" { (yyval.s) = (char *)"or"; } break; - case 228: + case 232: /* Line 1455 of yacc.c */ -#line 2011 "compilers/imcc/imcc.y" +#line 2056 "compilers/imcc/imcc.y" { (yyval.s) = (char *)"xor"; } break; - case 229: + case 233: /* Line 1455 of yacc.c */ -#line 2012 "compilers/imcc/imcc.y" +#line 2057 "compilers/imcc/imcc.y" { (yyval.s) = (char *)"band"; } break; - case 230: + case 234: /* Line 1455 of yacc.c */ -#line 2013 "compilers/imcc/imcc.y" +#line 2058 "compilers/imcc/imcc.y" { (yyval.s) = (char *)"bor"; } break; - case 231: + case 235: /* Line 1455 of yacc.c */ -#line 2014 "compilers/imcc/imcc.y" +#line 2059 "compilers/imcc/imcc.y" { (yyval.s) = (char *)"bxor"; } break; - case 232: + case 236: /* Line 1455 of yacc.c */ -#line 2020 "compilers/imcc/imcc.y" +#line 2065 "compilers/imcc/imcc.y" { (yyval.i) = IMCC_create_itcall_label(imcc); (yyval.i)->type &= ~ITCALL; @@ -4930,24 +4989,24 @@ YYSTYPE yylval; } break; - case 233: + case 237: /* Line 1455 of yacc.c */ -#line 2025 "compilers/imcc/imcc.y" +#line 2070 "compilers/imcc/imcc.y" { (yyval.i) = 0; } break; - case 234: + case 238: /* Line 1455 of yacc.c */ -#line 2032 "compilers/imcc/imcc.y" +#line 2077 "compilers/imcc/imcc.y" { (yyval.i) = MK_I(imcc, imcc->cur_unit, (yyvsp[(2) - (3)].s), 2, (yyvsp[(1) - (3)].sr), (yyvsp[(3) - (3)].sr)); } break; - case 235: + case 239: /* Line 1455 of yacc.c */ -#line 2034 "compilers/imcc/imcc.y" +#line 2079 "compilers/imcc/imcc.y" { if ((yyvsp[(1) - (3)].sr)->set == 'P') (yyval.i) = MK_I(imcc, imcc->cur_unit, "concat", 2, (yyvsp[(1) - (3)].sr), (yyvsp[(3) - (3)].sr)); @@ -4956,94 +5015,94 @@ YYSTYPE yylval; } break; - case 236: + case 240: /* Line 1455 of yacc.c */ -#line 2043 "compilers/imcc/imcc.y" +#line 2088 "compilers/imcc/imcc.y" { (yyval.s) = (char *)"add"; } break; - case 237: + case 241: /* Line 1455 of yacc.c */ -#line 2044 "compilers/imcc/imcc.y" +#line 2089 "compilers/imcc/imcc.y" { (yyval.s) = (char *)"sub"; } break; - case 238: + case 242: /* Line 1455 of yacc.c */ -#line 2045 "compilers/imcc/imcc.y" +#line 2090 "compilers/imcc/imcc.y" { (yyval.s) = (char *)"mul"; } break; - case 239: + case 243: /* Line 1455 of yacc.c */ -#line 2046 "compilers/imcc/imcc.y" +#line 2091 "compilers/imcc/imcc.y" { (yyval.s) = (char *)"div"; } break; - case 240: + case 244: /* Line 1455 of yacc.c */ -#line 2047 "compilers/imcc/imcc.y" +#line 2092 "compilers/imcc/imcc.y" { (yyval.s) = (char *)"mod"; } break; - case 241: + case 245: /* Line 1455 of yacc.c */ -#line 2048 "compilers/imcc/imcc.y" +#line 2093 "compilers/imcc/imcc.y" { (yyval.s) = (char *)"fdiv"; } break; - case 242: + case 246: /* Line 1455 of yacc.c */ -#line 2049 "compilers/imcc/imcc.y" +#line 2094 "compilers/imcc/imcc.y" { (yyval.s) = (char *)"band"; } break; - case 243: + case 247: /* Line 1455 of yacc.c */ -#line 2050 "compilers/imcc/imcc.y" +#line 2095 "compilers/imcc/imcc.y" { (yyval.s) = (char *)"bor"; } break; - case 244: + case 248: /* Line 1455 of yacc.c */ -#line 2051 "compilers/imcc/imcc.y" +#line 2096 "compilers/imcc/imcc.y" { (yyval.s) = (char *)"bxor"; } break; - case 245: + case 249: /* Line 1455 of yacc.c */ -#line 2052 "compilers/imcc/imcc.y" +#line 2097 "compilers/imcc/imcc.y" { (yyval.s) = (char *)"shr"; } break; - case 246: + case 250: /* Line 1455 of yacc.c */ -#line 2053 "compilers/imcc/imcc.y" +#line 2098 "compilers/imcc/imcc.y" { (yyval.s) = (char *)"shl"; } break; - case 247: + case 251: /* Line 1455 of yacc.c */ -#line 2054 "compilers/imcc/imcc.y" +#line 2099 "compilers/imcc/imcc.y" { (yyval.s) = (char *)"lsr"; } break; - case 248: + case 252: /* Line 1455 of yacc.c */ -#line 2060 "compilers/imcc/imcc.y" +#line 2105 "compilers/imcc/imcc.y" { (yyval.i) = func_ins(imcc, imcc->cur_unit, (yyvsp[(1) - (4)].sr), (yyvsp[(3) - (4)].s), imcc -> regs, imcc -> nargs, imcc -> keyvec, 1); @@ -5051,31 +5110,31 @@ YYSTYPE yylval; } break; - case 249: + case 253: /* Line 1455 of yacc.c */ -#line 2068 "compilers/imcc/imcc.y" +#line 2113 "compilers/imcc/imcc.y" { (yyval.sr) = mk_sub_address(imcc, (yyvsp[(1) - (1)].s)); mem_sys_free((yyvsp[(1) - (1)].s)); } break; - case 250: + case 254: /* Line 1455 of yacc.c */ -#line 2069 "compilers/imcc/imcc.y" +#line 2114 "compilers/imcc/imcc.y" { (yyval.sr) = mk_sub_address_fromc(imcc, (yyvsp[(1) - (1)].s)); mem_sys_free((yyvsp[(1) - (1)].s)); } break; - case 251: + case 255: /* Line 1455 of yacc.c */ -#line 2070 "compilers/imcc/imcc.y" +#line 2115 "compilers/imcc/imcc.y" { (yyval.sr) = mk_sub_address_u(imcc, (yyvsp[(1) - (1)].s)); mem_sys_free((yyvsp[(1) - (1)].s)); } break; - case 252: + case 256: /* Line 1455 of yacc.c */ -#line 2072 "compilers/imcc/imcc.y" +#line 2117 "compilers/imcc/imcc.y" { (yyval.sr) = (yyvsp[(1) - (1)].sr); if ((yyvsp[(1) - (1)].sr)->set != 'P') @@ -5083,10 +5142,10 @@ YYSTYPE yylval; } break; - case 253: + case 257: /* Line 1455 of yacc.c */ -#line 2078 "compilers/imcc/imcc.y" +#line 2123 "compilers/imcc/imcc.y" { /* disallow bareword method names; SREG name constants are fine */ const char * const name = (yyvsp[(3) - (3)].sr)->name; @@ -5102,10 +5161,10 @@ YYSTYPE yylval; } break; - case 254: + case 258: /* Line 1455 of yacc.c */ -#line 2092 "compilers/imcc/imcc.y" +#line 2137 "compilers/imcc/imcc.y" { imcc->cur_obj = (yyvsp[(1) - (3)].sr); (yyval.sr) = mk_const(imcc, (yyvsp[(3) - (3)].s), 'U'); @@ -5113,10 +5172,10 @@ YYSTYPE yylval; } break; - case 255: + case 259: /* Line 1455 of yacc.c */ -#line 2098 "compilers/imcc/imcc.y" +#line 2143 "compilers/imcc/imcc.y" { imcc->cur_obj = (yyvsp[(1) - (3)].sr); (yyval.sr) = mk_const(imcc, (yyvsp[(3) - (3)].s), 'S'); @@ -5124,44 +5183,44 @@ YYSTYPE yylval; } break; - case 256: + case 260: /* Line 1455 of yacc.c */ -#line 2104 "compilers/imcc/imcc.y" +#line 2149 "compilers/imcc/imcc.y" { imcc->cur_obj = (yyvsp[(1) - (3)].sr); (yyval.sr) = (yyvsp[(3) - (3)].sr); } break; - case 257: + case 261: /* Line 1455 of yacc.c */ -#line 2113 "compilers/imcc/imcc.y" +#line 2158 "compilers/imcc/imcc.y" { (yyval.i) = IMCC_create_itcall_label(imcc); IMCC_itcall_sub(imcc, (yyvsp[(1) - (1)].sr)); } break; - case 258: + case 262: /* Line 1455 of yacc.c */ -#line 2117 "compilers/imcc/imcc.y" +#line 2162 "compilers/imcc/imcc.y" { (yyval.i) = (yyvsp[(2) - (5)].i); } break; - case 259: + case 263: /* Line 1455 of yacc.c */ -#line 2121 "compilers/imcc/imcc.y" +#line 2166 "compilers/imcc/imcc.y" { (yyval.sr) = 0; } break; - case 260: + case 264: /* Line 1455 of yacc.c */ -#line 2123 "compilers/imcc/imcc.y" +#line 2168 "compilers/imcc/imcc.y" { (yyval.sr) = 0; if (imcc->adv_named_id) { @@ -5173,10 +5232,10 @@ YYSTYPE yylval; } break; - case 261: + case 265: /* Line 1455 of yacc.c */ -#line 2133 "compilers/imcc/imcc.y" +#line 2178 "compilers/imcc/imcc.y" { (yyval.sr) = 0; if (imcc->adv_named_id) { @@ -5188,10 +5247,10 @@ YYSTYPE yylval; } break; - case 262: + case 266: /* Line 1455 of yacc.c */ -#line 2143 "compilers/imcc/imcc.y" +#line 2188 "compilers/imcc/imcc.y" { (yyval.sr) = 0; add_pcc_named_arg(imcc, imcc->cur_call, mk_const(imcc, (yyvsp[(3) - (5)].s), 'S'), (yyvsp[(5) - (5)].sr)); @@ -5199,20 +5258,20 @@ YYSTYPE yylval; } break; - case 263: + case 267: /* Line 1455 of yacc.c */ -#line 2149 "compilers/imcc/imcc.y" +#line 2194 "compilers/imcc/imcc.y" { (yyval.sr) = 0; add_pcc_named_arg_var(imcc, imcc->cur_call, (yyvsp[(1) - (3)].sr), (yyvsp[(3) - (3)].sr)); } break; - case 264: + case 268: /* Line 1455 of yacc.c */ -#line 2154 "compilers/imcc/imcc.y" +#line 2199 "compilers/imcc/imcc.y" { (yyval.sr) = 0; add_pcc_named_arg(imcc, imcc->cur_call, @@ -5221,52 +5280,52 @@ YYSTYPE yylval; } break; - case 265: + case 269: /* Line 1455 of yacc.c */ -#line 2163 "compilers/imcc/imcc.y" +#line 2208 "compilers/imcc/imcc.y" { (yyval.sr) = (yyvsp[(1) - (2)].sr); (yyval.sr)->type |= (yyvsp[(2) - (2)].t); } break; - case 266: + case 270: /* Line 1455 of yacc.c */ -#line 2167 "compilers/imcc/imcc.y" +#line 2212 "compilers/imcc/imcc.y" { (yyval.t) = 0; } break; - case 267: + case 271: /* Line 1455 of yacc.c */ -#line 2168 "compilers/imcc/imcc.y" +#line 2213 "compilers/imcc/imcc.y" { (yyval.t) = (yyvsp[(1) - (2)].t) | (yyvsp[(2) - (2)].t); } break; - case 268: + case 272: /* Line 1455 of yacc.c */ -#line 2172 "compilers/imcc/imcc.y" +#line 2217 "compilers/imcc/imcc.y" { (yyval.t) = VT_FLAT; } break; - case 269: + case 273: /* Line 1455 of yacc.c */ -#line 2173 "compilers/imcc/imcc.y" +#line 2218 "compilers/imcc/imcc.y" { (yyval.t) = VT_NAMED; } break; - case 270: + case 274: /* Line 1455 of yacc.c */ -#line 2174 "compilers/imcc/imcc.y" +#line 2219 "compilers/imcc/imcc.y" { (yyval.t) = VT_CALL_SIG; } break; - case 271: + case 275: /* Line 1455 of yacc.c */ -#line 2177 "compilers/imcc/imcc.y" +#line 2222 "compilers/imcc/imcc.y" { adv_named_set_u(imcc, (yyvsp[(3) - (4)].s)); mem_sys_free((yyvsp[(3) - (4)].s)); @@ -5274,10 +5333,10 @@ YYSTYPE yylval; } break; - case 272: + case 276: /* Line 1455 of yacc.c */ -#line 2183 "compilers/imcc/imcc.y" +#line 2228 "compilers/imcc/imcc.y" { adv_named_set(imcc, (yyvsp[(3) - (4)].s)); mem_sys_free((yyvsp[(3) - (4)].s)); @@ -5285,17 +5344,17 @@ YYSTYPE yylval; } break; - case 273: + case 277: /* Line 1455 of yacc.c */ -#line 2191 "compilers/imcc/imcc.y" +#line 2236 "compilers/imcc/imcc.y" { (yyval.sr) = (yyvsp[(1) - (2)].sr); (yyval.sr)->type |= (yyvsp[(2) - (2)].t); } break; - case 274: + case 278: /* Line 1455 of yacc.c */ -#line 2196 "compilers/imcc/imcc.y" +#line 2241 "compilers/imcc/imcc.y" { (yyval.sr) = 0; if (imcc->adv_named_id) { @@ -5307,10 +5366,10 @@ YYSTYPE yylval; } break; - case 275: + case 279: /* Line 1455 of yacc.c */ -#line 2206 "compilers/imcc/imcc.y" +#line 2251 "compilers/imcc/imcc.y" { add_pcc_named_result(imcc, imcc->cur_call, mk_const(imcc, (yyvsp[(3) - (5)].s), 'S'), (yyvsp[(5) - (5)].sr)); @@ -5318,10 +5377,10 @@ YYSTYPE yylval; } break; - case 276: + case 280: /* Line 1455 of yacc.c */ -#line 2212 "compilers/imcc/imcc.y" +#line 2257 "compilers/imcc/imcc.y" { (yyval.sr) = 0; if (imcc->adv_named_id) { @@ -5333,179 +5392,179 @@ YYSTYPE yylval; } break; - case 277: + case 281: /* Line 1455 of yacc.c */ -#line 2222 "compilers/imcc/imcc.y" +#line 2267 "compilers/imcc/imcc.y" { add_pcc_named_result(imcc, imcc->cur_call, mk_const(imcc, (yyvsp[(1) - (3)].s), 'S'), (yyvsp[(3) - (3)].sr)); mem_sys_free((yyvsp[(1) - (3)].s)); } break; - case 278: + case 282: /* Line 1455 of yacc.c */ -#line 2226 "compilers/imcc/imcc.y" +#line 2271 "compilers/imcc/imcc.y" { (yyval.sr) = 0; } break; - case 279: + case 283: /* Line 1455 of yacc.c */ -#line 2230 "compilers/imcc/imcc.y" +#line 2275 "compilers/imcc/imcc.y" { (yyval.i) = (yyvsp[(1) - (1)].i); } break; - case 280: + case 284: /* Line 1455 of yacc.c */ -#line 2231 "compilers/imcc/imcc.y" +#line 2276 "compilers/imcc/imcc.y" { (yyval.i) = (yyvsp[(1) - (1)].i); } break; - case 281: + case 285: /* Line 1455 of yacc.c */ -#line 2236 "compilers/imcc/imcc.y" +#line 2281 "compilers/imcc/imcc.y" { (yyval.i) = MK_I(imcc, imcc->cur_unit, inv_op((yyvsp[(3) - (6)].s)), 3, (yyvsp[(2) - (6)].sr), (yyvsp[(4) - (6)].sr), (yyvsp[(6) - (6)].sr)); } break; - case 282: + case 286: /* Line 1455 of yacc.c */ -#line 2240 "compilers/imcc/imcc.y" +#line 2285 "compilers/imcc/imcc.y" { (yyval.i) = MK_I(imcc, imcc->cur_unit, "unless_null", 2, (yyvsp[(3) - (5)].sr), (yyvsp[(5) - (5)].sr)); } break; - case 283: + case 287: /* Line 1455 of yacc.c */ -#line 2244 "compilers/imcc/imcc.y" +#line 2289 "compilers/imcc/imcc.y" { (yyval.i) = MK_I(imcc, imcc->cur_unit, "unless", 2, (yyvsp[(2) - (4)].sr), (yyvsp[(4) - (4)].sr)); } break; - case 284: + case 288: /* Line 1455 of yacc.c */ -#line 2251 "compilers/imcc/imcc.y" +#line 2296 "compilers/imcc/imcc.y" { (yyval.i) = MK_I(imcc, imcc->cur_unit, "if", 2, (yyvsp[(2) - (4)].sr), (yyvsp[(4) - (4)].sr)); } break; - case 285: + case 289: /* Line 1455 of yacc.c */ -#line 2255 "compilers/imcc/imcc.y" +#line 2300 "compilers/imcc/imcc.y" { (yyval.i) = MK_I(imcc, imcc->cur_unit, (yyvsp[(3) - (6)].s), 3, (yyvsp[(2) - (6)].sr), (yyvsp[(4) - (6)].sr), (yyvsp[(6) - (6)].sr)); } break; - case 286: + case 290: /* Line 1455 of yacc.c */ -#line 2259 "compilers/imcc/imcc.y" +#line 2304 "compilers/imcc/imcc.y" { (yyval.i) = MK_I(imcc, imcc->cur_unit, "if_null", 2, (yyvsp[(3) - (5)].sr), (yyvsp[(5) - (5)].sr)); } break; - case 287: + case 291: /* Line 1455 of yacc.c */ -#line 2265 "compilers/imcc/imcc.y" +#line 2310 "compilers/imcc/imcc.y" { (yyval.t) = 0; } break; - case 288: + case 292: /* Line 1455 of yacc.c */ -#line 2266 "compilers/imcc/imcc.y" +#line 2311 "compilers/imcc/imcc.y" { (yyval.t) = 0; } break; - case 289: + case 293: /* Line 1455 of yacc.c */ -#line 2270 "compilers/imcc/imcc.y" +#line 2315 "compilers/imcc/imcc.y" { (yyval.s) = (char *)"eq"; } break; - case 290: + case 294: /* Line 1455 of yacc.c */ -#line 2271 "compilers/imcc/imcc.y" +#line 2316 "compilers/imcc/imcc.y" { (yyval.s) = (char *)"ne"; } break; - case 291: + case 295: /* Line 1455 of yacc.c */ -#line 2272 "compilers/imcc/imcc.y" +#line 2317 "compilers/imcc/imcc.y" { (yyval.s) = (char *)"gt"; } break; - case 292: + case 296: /* Line 1455 of yacc.c */ -#line 2273 "compilers/imcc/imcc.y" +#line 2318 "compilers/imcc/imcc.y" { (yyval.s) = (char *)"ge"; } break; - case 293: + case 297: /* Line 1455 of yacc.c */ -#line 2274 "compilers/imcc/imcc.y" +#line 2319 "compilers/imcc/imcc.y" { (yyval.s) = (char *)"lt"; } break; - case 294: + case 298: /* Line 1455 of yacc.c */ -#line 2275 "compilers/imcc/imcc.y" +#line 2320 "compilers/imcc/imcc.y" { (yyval.s) = (char *)"le"; } break; - case 297: + case 301: /* Line 1455 of yacc.c */ -#line 2284 "compilers/imcc/imcc.y" +#line 2329 "compilers/imcc/imcc.y" { (yyval.sr) = NULL; } break; - case 298: + case 302: /* Line 1455 of yacc.c */ -#line 2285 "compilers/imcc/imcc.y" +#line 2330 "compilers/imcc/imcc.y" { (yyval.sr) = (yyvsp[(1) - (1)].sr); } break; - case 299: + case 303: /* Line 1455 of yacc.c */ -#line 2289 "compilers/imcc/imcc.y" +#line 2334 "compilers/imcc/imcc.y" { (yyval.sr) = imcc->regs[0]; } break; - case 301: + case 305: /* Line 1455 of yacc.c */ -#line 2294 "compilers/imcc/imcc.y" +#line 2339 "compilers/imcc/imcc.y" { imcc->regs[imcc->nargs++] = (yyvsp[(1) - (1)].sr); } break; - case 302: + case 306: /* Line 1455 of yacc.c */ -#line 2296 "compilers/imcc/imcc.y" +#line 2341 "compilers/imcc/imcc.y" { imcc -> regs[imcc->nargs++] = (yyvsp[(1) - (4)].sr); imcc -> keyvec |= KEY_BIT(imcc->nargs); @@ -5514,89 +5573,89 @@ YYSTYPE yylval; } break; - case 303: + case 307: /* Line 1455 of yacc.c */ -#line 2303 "compilers/imcc/imcc.y" +#line 2348 "compilers/imcc/imcc.y" { imcc -> regs[imcc->nargs++] = (yyvsp[(2) - (3)].sr); (yyval.sr) = (yyvsp[(2) - (3)].sr); } break; - case 305: + case 309: /* Line 1455 of yacc.c */ -#line 2310 "compilers/imcc/imcc.y" +#line 2355 "compilers/imcc/imcc.y" { (yyval.sr) = mk_sub_address_fromc(imcc, (yyvsp[(1) - (1)].s)); mem_sys_free((yyvsp[(1) - (1)].s)); } break; - case 306: + case 310: /* Line 1455 of yacc.c */ -#line 2311 "compilers/imcc/imcc.y" +#line 2356 "compilers/imcc/imcc.y" { (yyval.sr) = mk_sub_address_u(imcc, (yyvsp[(1) - (1)].s)); mem_sys_free((yyvsp[(1) - (1)].s)); } break; - case 307: + case 311: /* Line 1455 of yacc.c */ -#line 2315 "compilers/imcc/imcc.y" +#line 2360 "compilers/imcc/imcc.y" { (yyval.sr) = mk_sub_address(imcc, (yyvsp[(1) - (1)].s)); mem_sys_free((yyvsp[(1) - (1)].s)); } break; - case 308: + case 312: /* Line 1455 of yacc.c */ -#line 2316 "compilers/imcc/imcc.y" +#line 2361 "compilers/imcc/imcc.y" { (yyval.sr) = mk_sub_address(imcc, (yyvsp[(1) - (1)].s)); mem_sys_free((yyvsp[(1) - (1)].s)); } break; - case 309: + case 313: /* Line 1455 of yacc.c */ -#line 2320 "compilers/imcc/imcc.y" +#line 2365 "compilers/imcc/imcc.y" { (yyval.sr) = mk_label_address(imcc, (yyvsp[(1) - (1)].s)); mem_sys_free((yyvsp[(1) - (1)].s)); } break; - case 310: + case 314: /* Line 1455 of yacc.c */ -#line 2321 "compilers/imcc/imcc.y" +#line 2366 "compilers/imcc/imcc.y" { (yyval.sr) = mk_label_address(imcc, (yyvsp[(1) - (1)].s)); mem_sys_free((yyvsp[(1) - (1)].s)); } break; - case 315: + case 319: /* Line 1455 of yacc.c */ -#line 2335 "compilers/imcc/imcc.y" +#line 2380 "compilers/imcc/imcc.y" { imcc->nkeys = 0; } break; - case 316: + case 320: /* Line 1455 of yacc.c */ -#line 2339 "compilers/imcc/imcc.y" +#line 2384 "compilers/imcc/imcc.y" { (yyval.sr) = link_keys(imcc, imcc->nkeys, imcc->keys, 0); } break; - case 317: + case 321: /* Line 1455 of yacc.c */ -#line 2345 "compilers/imcc/imcc.y" +#line 2390 "compilers/imcc/imcc.y" { imcc->nkeys = 0; } break; - case 318: + case 322: /* Line 1455 of yacc.c */ -#line 2349 "compilers/imcc/imcc.y" +#line 2394 "compilers/imcc/imcc.y" { (yyval.sr) = link_keys(imcc, imcc->nkeys, @@ -5604,106 +5663,106 @@ YYSTYPE yylval; } break; - case 319: + case 323: /* Line 1455 of yacc.c */ -#line 2357 "compilers/imcc/imcc.y" +#line 2402 "compilers/imcc/imcc.y" { imcc->keys[imcc->nkeys++] = (yyvsp[(1) - (1)].sr); } break; - case 320: + case 324: /* Line 1455 of yacc.c */ -#line 2359 "compilers/imcc/imcc.y" +#line 2404 "compilers/imcc/imcc.y" { imcc->keys[imcc->nkeys++] = (yyvsp[(3) - (3)].sr); (yyval.sr) = imcc->keys[0]; } break; - case 321: + case 325: /* Line 1455 of yacc.c */ -#line 2367 "compilers/imcc/imcc.y" +#line 2412 "compilers/imcc/imcc.y" { (yyval.sr) = (yyvsp[(1) - (1)].sr); } break; - case 322: + case 326: /* Line 1455 of yacc.c */ -#line 2373 "compilers/imcc/imcc.y" +#line 2418 "compilers/imcc/imcc.y" { (yyval.sr) = mk_symreg(imcc, (yyvsp[(1) - (1)].s), 'I'); } break; - case 323: + case 327: /* Line 1455 of yacc.c */ -#line 2374 "compilers/imcc/imcc.y" +#line 2419 "compilers/imcc/imcc.y" { (yyval.sr) = mk_symreg(imcc, (yyvsp[(1) - (1)].s), 'N'); } break; - case 324: + case 328: /* Line 1455 of yacc.c */ -#line 2375 "compilers/imcc/imcc.y" +#line 2420 "compilers/imcc/imcc.y" { (yyval.sr) = mk_symreg(imcc, (yyvsp[(1) - (1)].s), 'S'); } break; - case 325: + case 329: /* Line 1455 of yacc.c */ -#line 2376 "compilers/imcc/imcc.y" +#line 2421 "compilers/imcc/imcc.y" { (yyval.sr) = mk_symreg(imcc, (yyvsp[(1) - (1)].s), 'P'); } break; - case 326: + case 330: /* Line 1455 of yacc.c */ -#line 2377 "compilers/imcc/imcc.y" +#line 2422 "compilers/imcc/imcc.y" { (yyval.sr) = mk_pasm_reg(imcc, (yyvsp[(1) - (1)].s)); mem_sys_free((yyvsp[(1) - (1)].s)); } break; - case 327: + case 331: /* Line 1455 of yacc.c */ -#line 2381 "compilers/imcc/imcc.y" +#line 2426 "compilers/imcc/imcc.y" { (yyval.sr) = mk_const(imcc, (yyvsp[(1) - (1)].s), 'S'); mem_sys_free((yyvsp[(1) - (1)].s)); } break; - case 328: + case 332: /* Line 1455 of yacc.c */ -#line 2382 "compilers/imcc/imcc.y" +#line 2427 "compilers/imcc/imcc.y" { (yyval.sr) = mk_const(imcc, (yyvsp[(1) - (1)].s), 'U'); mem_sys_free((yyvsp[(1) - (1)].s)); } break; - case 329: + case 333: /* Line 1455 of yacc.c */ -#line 2386 "compilers/imcc/imcc.y" +#line 2431 "compilers/imcc/imcc.y" { (yyval.sr) = mk_const(imcc, (yyvsp[(1) - (1)].s), 'I'); mem_sys_free((yyvsp[(1) - (1)].s)); } break; - case 330: + case 334: /* Line 1455 of yacc.c */ -#line 2387 "compilers/imcc/imcc.y" +#line 2432 "compilers/imcc/imcc.y" { (yyval.sr) = mk_const(imcc, (yyvsp[(1) - (1)].s), 'N'); mem_sys_free((yyvsp[(1) - (1)].s)); } break; - case 331: + case 335: /* Line 1455 of yacc.c */ -#line 2388 "compilers/imcc/imcc.y" +#line 2433 "compilers/imcc/imcc.y" { (yyval.sr) = (yyvsp[(1) - (1)].sr); } break; /* Line 1455 of yacc.c */ -#line 5696 "compilers/imcc/imcparser.c" +#line 5755 "compilers/imcc/imcparser.c" default: break; } YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); @@ -5915,7 +5974,7 @@ YYSTYPE yylval; /* Line 1675 of yacc.c */ -#line 2392 "compilers/imcc/imcc.y" +#line 2437 "compilers/imcc/imcc.y" /* I need this prototype somewhere... */ diff --git a/compilers/imcc/imcparser.h b/compilers/imcc/imcparser.h index f19c1cfdd6..5a60da5353 100644 --- a/compilers/imcc/imcparser.h +++ b/compilers/imcc/imcparser.h @@ -138,32 +138,33 @@ OUTER = 343, NEED_LEX = 344, MULTI = 345, - VTABLE_METHOD = 346, - LOADLIB = 347, - SUB_INSTANCE_OF = 348, - SUBID = 349, - NS_ENTRY = 350, - LABEL = 351, - EMIT = 352, - EOM = 353, - IREG = 354, - NREG = 355, - SREG = 356, - PREG = 357, - IDENTIFIER = 358, - REG = 359, - MACRO = 360, - ENDM = 361, - STRINGC = 362, - INTC = 363, - FLOATC = 364, - USTRINGC = 365, - PARROT_OP = 366, - VAR = 367, - LINECOMMENT = 368, - FILECOMMENT = 369, - DOT = 370, - CONCAT = 371 + SUBTAG = 346, + VTABLE_METHOD = 347, + LOADLIB = 348, + SUB_INSTANCE_OF = 349, + SUBID = 350, + NS_ENTRY = 351, + LABEL = 352, + EMIT = 353, + EOM = 354, + IREG = 355, + NREG = 356, + SREG = 357, + PREG = 358, + IDENTIFIER = 359, + REG = 360, + MACRO = 361, + ENDM = 362, + STRINGC = 363, + INTC = 364, + FLOATC = 365, + USTRINGC = 366, + PARROT_OP = 367, + VAR = 368, + LINECOMMENT = 369, + FILECOMMENT = 370, + DOT = 371, + CONCAT = 372 }; #endif /* Tokens. */ @@ -255,32 +256,33 @@ #define OUTER 343 #define NEED_LEX 344 #define MULTI 345 -#define VTABLE_METHOD 346 -#define LOADLIB 347 -#define SUB_INSTANCE_OF 348 -#define SUBID 349 -#define NS_ENTRY 350 -#define LABEL 351 -#define EMIT 352 -#define EOM 353 -#define IREG 354 -#define NREG 355 -#define SREG 356 -#define PREG 357 -#define IDENTIFIER 358 -#define REG 359 -#define MACRO 360 -#define ENDM 361 -#define STRINGC 362 -#define INTC 363 -#define FLOATC 364 -#define USTRINGC 365 -#define PARROT_OP 366 -#define VAR 367 -#define LINECOMMENT 368 -#define FILECOMMENT 369 -#define DOT 370 -#define CONCAT 371 +#define SUBTAG 346 +#define VTABLE_METHOD 347 +#define LOADLIB 348 +#define SUB_INSTANCE_OF 349 +#define SUBID 350 +#define NS_ENTRY 351 +#define LABEL 352 +#define EMIT 353 +#define EOM 354 +#define IREG 355 +#define NREG 356 +#define SREG 357 +#define PREG 358 +#define IDENTIFIER 359 +#define REG 360 +#define MACRO 361 +#define ENDM 362 +#define STRINGC 363 +#define INTC 364 +#define FLOATC 365 +#define USTRINGC 366 +#define PARROT_OP 367 +#define VAR 368 +#define LINECOMMENT 369 +#define FILECOMMENT 370 +#define DOT 371 +#define CONCAT 372 @@ -290,7 +292,7 @@ typedef union YYSTYPE { /* Line 1676 of yacc.c */ -#line 1026 "compilers/imcc/imcc.y" +#line 1032 "compilers/imcc/imcc.y" IdList * idlist; int t; @@ -301,7 +303,7 @@ typedef union YYSTYPE /* Line 1676 of yacc.c */ -#line 294 "compilers/imcc/imcparser.h" +#line 296 "compilers/imcc/imcparser.h" } YYSTYPE; # define YYSTYPE_IS_TRIVIAL 1 # define yystype YYSTYPE /* obsolescent; will be withdrawn */ diff --git a/compilers/imcc/main.c b/compilers/imcc/main.c index 4a689fc410..679da3d3d2 100644 --- a/compilers/imcc/main.c +++ b/compilers/imcc/main.c @@ -29,7 +29,7 @@ IMCC helpers. #include #include "imc.h" -#include "parrot/embed.h" +#include "parrot/parrot.h" #include "parrot/longopt.h" #include "parrot/runcore_api.h" #include "pmc/pmc_callcontext.h" @@ -43,8 +43,7 @@ extern int yydebug; /* defined in imcc.l */ PIOHANDLE determine_input_file_type(imc_info_t * imcc, STRING *sourcefile); -/* XXX non-reentrant */ -static Parrot_mutex eval_nr_lock; +/* XXX non-reentrant because of global variables */ static INTVAL eval_nr = 0; /* HEADERIZER HFILE: include/imcc/embed.h */ @@ -64,12 +63,6 @@ static void imcc_destroy_macro_values(ARGMOD(void *value)) __attribute__nonnull__(1) FUNC_MODIFIES(*value); -static void imcc_destroy_scanner( - ARGMOD(imc_info_t *imcc), - yyscan_t yyscanner) - __attribute__nonnull__(1) - FUNC_MODIFIES(*imcc); - static yyscan_t imcc_get_scanner(ARGMOD(imc_info_t *imcc)) __attribute__nonnull__(1) FUNC_MODIFIES(*imcc); @@ -106,8 +99,6 @@ static struct _imc_info_t* prepare_reentrant_compile( , PARROT_ASSERT_ARG(sourcefile)) #define ASSERT_ARGS_imcc_destroy_macro_values __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ PARROT_ASSERT_ARG(value)) -#define ASSERT_ARGS_imcc_destroy_scanner __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ - PARROT_ASSERT_ARG(imcc)) #define ASSERT_ARGS_imcc_get_scanner __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ PARROT_ASSERT_ARG(imcc)) #define ASSERT_ARGS_imcc_run_compilation_internal __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ @@ -298,23 +289,6 @@ imcc_get_scanner(ARGMOD(imc_info_t *imcc)) /* -=item C - -Cleanup and destroy a bison scanner object - -=cut - -*/ - -static void -imcc_destroy_scanner(ARGMOD(imc_info_t *imcc), yyscan_t yyscanner) -{ - ASSERT_ARGS(imcc_destroy_scanner) - yylex_destroy(yyscanner); -} - -/* - =item C Preprocess the given file. Dump the output to stdout. @@ -553,8 +527,10 @@ imcc_run_compilation_internal(ARGMOD(imc_info_t *imcc), ARGIN(STRING *source), ASSERT_ARGS(imcc_run_compilation_internal) yyscan_t yyscanner = imcc_get_scanner(imcc); PackFile * const pf_raw = PackFile_new(imcc->interp, 0); - PMC * const packfilepmc = Parrot_pf_get_packfile_pmc(imcc->interp, pf_raw); - INTVAL success = 0; + PMC * const old_packfilepmc = Parrot_pf_get_current_packfile(imcc->interp); + STRING * const pf_path = is_file ? source : STRINGNULL; + PMC * const packfilepmc = Parrot_pf_get_packfile_pmc(imcc->interp, pf_raw, pf_path); + INTVAL success = 0; /* TODO: Don't set current packfile in the interpreter. Leave the interpreter alone */ @@ -578,7 +554,8 @@ imcc_run_compilation_internal(ARGMOD(imc_info_t *imcc), ARGIN(STRING *source), /* XXX Parrot_pf_get_packfile_pmc registers PMC */ Parrot_pmc_gc_unregister(imcc->interp, packfilepmc); - + if (!PMC_IS_NULL(old_packfilepmc)) + Parrot_pf_set_current_packfile(imcc->interp, old_packfilepmc); return PMCNULL; } @@ -592,6 +569,8 @@ imcc_run_compilation_internal(ARGMOD(imc_info_t *imcc), ARGIN(STRING *source), PackFile_fixup_subs(imcc->interp, PBC_IMMEDIATE, packfilepmc); PackFile_fixup_subs(imcc->interp, PBC_POSTCOMP, packfilepmc); + if (!PMC_IS_NULL(old_packfilepmc)) + Parrot_pf_set_current_packfile(imcc->interp, old_packfilepmc); return packfilepmc; } @@ -671,9 +650,6 @@ imcc_destroy(ARGFREE(imc_info_t * imcc)) mem_sys_free(imcc->globals); mem_sys_free(imcc); - - if (eval_nr != 0) - MUTEX_DESTROY(eval_nr_lock); } /* diff --git a/compilers/imcc/optimizer.c b/compilers/imcc/optimizer.c index e267ac13f2..73088b585b 100644 --- a/compilers/imcc/optimizer.c +++ b/compilers/imcc/optimizer.c @@ -686,7 +686,8 @@ constant_propagation(ARGMOD(imc_info_t *imcc), ARGMOD(IMC_Unit *unit)) found = 1; c = ins->symregs[1]; o = ins->symregs[0]; - } else if (STREQ(ins->opname, "null") && ins->symregs[0]->set == 'I') { + } + else if (STREQ(ins->opname, "null") && ins->symregs[0]->set == 'I') { found = 1; c = mk_const(imcc, "0", 'I'); o = ins->symregs[0]; @@ -1374,12 +1375,13 @@ branch_cond_loop(ARGMOD(imc_info_t *imcc), ARGMOD(IMC_Unit *unit)) /* no good if it's an unconditional branch*/ if (cond->type & IF_goto && STREQ(cond->opname, "branch")) { break; - } else if (cond->type & ITPCCRET || cond->type & ITPCCSUB - || cond->type & ITCALL) { + } + else if ((cond->type & ITPCCRET) || (cond->type & ITPCCSUB) + || (cond->type & ITCALL)) { break; /* just until we can copy set_args et al */ - } else if (cond->type & ITBRANCH && - get_branch_regno(cond) >= 0) { + } + else if ((cond->type & ITBRANCH) && (get_branch_regno(cond) >= 0)) { found = 1; break; } diff --git a/compilers/imcc/parser_util.c b/compilers/imcc/parser_util.c index 84aa610741..f1a899eb62 100644 --- a/compilers/imcc/parser_util.c +++ b/compilers/imcc/parser_util.c @@ -19,7 +19,6 @@ #include "imc.h" #include "parrot/dynext.h" -#include "parrot/embed.h" #include "pmc/pmc_sub.h" #include "pmc/pmc_callcontext.h" #include "pbc.h" diff --git a/compilers/imcc/pbc.c b/compilers/imcc/pbc.c index 2761ffd5ea..0e57c71ef6 100644 --- a/compilers/imcc/pbc.c +++ b/compilers/imcc/pbc.c @@ -260,6 +260,17 @@ static void store_sub_size( __attribute__nonnull__(1) FUNC_MODIFIES(* imcc); +static void store_sub_tags( + ARGMOD(imc_info_t * imcc), + ARGIN(pcc_sub_t * sub), + const int sub_idx, + ARGMOD(PackFile_ConstTable * ct)) + __attribute__nonnull__(1) + __attribute__nonnull__(2) + __attribute__nonnull__(4) + FUNC_MODIFIES(* imcc) + FUNC_MODIFIES(* ct); + static void verify_signature( ARGMOD(imc_info_t * imcc), ARGIN(const Instruction *ins), @@ -350,6 +361,10 @@ static void verify_signature( , PARROT_ASSERT_ARG(str)) #define ASSERT_ARGS_store_sub_size __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ PARROT_ASSERT_ARG(imcc)) +#define ASSERT_ARGS_store_sub_tags __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ + PARROT_ASSERT_ARG(imcc) \ + , PARROT_ASSERT_ARG(sub) \ + , PARROT_ASSERT_ARG(ct)) #define ASSERT_ARGS_verify_signature __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ PARROT_ASSERT_ARG(imcc) \ , PARROT_ASSERT_ARG(ins) \ @@ -475,12 +490,7 @@ e_pbc_open(ARGMOD(imc_info_t * imcc)) else cs->prev->next = cs; - /* we need some segments */ - if (!current_bc) { - STRING * const name = imcc->state->file; - - cs->seg = PF_create_default_segs(imcc->interp, name, 1, 1); - } + PARROT_ASSERT(current_bc); imcc->globals->cs = cs; @@ -506,6 +516,7 @@ make_new_sub(ARGMOD(imc_info_t * imcc), ARGIN(IMC_Unit *unit)) s->prev = imcc->globals->cs->subs; s->unit = unit; s->pmc_const = -1; + s->lexinfo_const = -1; if (imcc->globals->cs->subs) imcc->globals->cs->subs->next = s; @@ -599,6 +610,9 @@ store_fixup(ARGMOD(imc_info_t * imcc), ARGIN(const SymReg *r), int pc, int offse if (r->usage & U_SUBID_LOOKUP) fixup->usage = U_SUBID_LOOKUP; + if (r->usage & U_LEXINFO_LOOKUP) + fixup->usage = U_LEXINFO_LOOKUP; + if (r->usage & U_LEXICAL) fixup->usage |= U_LEXICAL; @@ -660,34 +674,39 @@ get_code_size(ARGMOD(imc_info_t * imcc), ARGIN(const IMC_Unit *unit), *src_lines = 0; for (code_size = 0; ins ; ins = ins->next) { + char * const opname = ins->opname; + const int opsize = ins->opsize; + if (ins->type & ITLABEL) ins->symregs[0]->color = code_size; - if (ins->opname && STREQ(ins->opname, ".annotate")) { + if (!opname || !*opname) { + if (opsize) + IMCC_fatal(imcc, 1, "get_code_size: non instruction with size found\n"); + continue; + } + + if (STREQ(opname, ".annotate")) { /* Annotations contribute nothing to code size, since they do not * end up in bytecode segment. */ - (*src_lines)++; + continue; } - else if (ins->opname && *ins->opname) { - (*src_lines)++; - if (!ins->op) - IMCC_fatal(imcc, 1, "get_code_size: " - "no opnum ins#%d %d\n", - ins->index, ins); - - if (ins->op == &core_ops->op_info_table[PARROT_OP_set_p_pc]) { - /* set_p_pc opcode */ - IMCC_debug(imcc, DEBUG_PBC_FIXUP, "PMC constant %s\n", - ins->symregs[1]->name); - - if (ins->symregs[1]->usage & U_FIXUP) - store_fixup(imcc, ins->symregs[1], code_size, 2); - } - - code_size += ins->opsize; + (*src_lines)++; + if (!ins->op) + IMCC_fatal(imcc, 1, "get_code_size: " + "no opnum ins#%d %d\n", + ins->index, ins); + + if (ins->op == &core_ops->op_info_table[PARROT_OP_set_p_pc]) { + /* set_p_pc opcode */ + IMCC_debug(imcc, DEBUG_PBC_FIXUP, "PMC constant %s\n", + ins->symregs[1]->name); + + if (ins->symregs[1]->usage & U_FIXUP) + store_fixup(imcc, ins->symregs[1], code_size, 2); } - else if (ins->opsize) - IMCC_fatal(imcc, 1, "get_code_size: non instruction with size found\n"); + + code_size += opsize; } return code_size; @@ -918,6 +937,24 @@ fixup_globals(ARGMOD(imc_info_t * imcc)) /* s1 = find_sub_by_subid(interp, fixup->name, &pc); */ s1 = find_sub_by_subid(imcc, fixup->name, s, &pc); } + else if (fixup->usage & U_LEXINFO_LOOKUP) { + s1 = find_sub_by_subid(imcc, fixup->name, s, &pc); + if (!s1 || s1->pmc_const == -1) + IMCC_fataly(imcc, EXCEPTION_INVALID_OPERATION, + "Sub '%s' not found\n", fixup->name); + if (s1->lexinfo_const == -1) { + PackFile_ConstTable * const ct = bc->const_table; + PMC *sub_pmc = ct->pmc.constants[s1->pmc_const]; + Parrot_Sub_attributes *sub; + PMC_get_sub(imcc->interp, sub_pmc, sub); + if (!sub->lex_info) + IMCC_fataly(imcc, EXCEPTION_INVALID_OPERATION, + "Sub '%s' does not have a lexinfo\n", fixup->name); + s1->lexinfo_const = add_const_table_pmc(imcc, sub->lex_info); + } + bc->base.data[addr+fixup->offset] = s1->lexinfo_const; + continue; + } else s1 = find_global_label(imcc, fixup->name, s, &pc); @@ -1423,8 +1460,8 @@ add_const_pmc_sub(ARGMOD(imc_info_t * imcc), ARGMOD(SymReg *r), size_t offs, PMC *ns_pmc; PMC *sub_pmc; Parrot_Sub_attributes *sub; - PackFile_ByteCode * const interp_code = Parrot_pf_get_current_code_segment(imcc->interp); - PackFile_ConstTable * const ct = interp_code->const_table; + PackFile_ByteCode * const interp_code = Parrot_pf_get_current_code_segment(imcc->interp); + PackFile_ConstTable * const ct = interp_code->const_table; IMC_Unit * const unit = imcc->globals->cs->subs->unit; int i; @@ -1523,7 +1560,7 @@ add_const_pmc_sub(ARGMOD(imc_info_t * imcc), ARGMOD(SymReg *r), size_t offs, break; case 'S': if (ns_const >= 0 && ns_const < ct->str.const_count) { - ns_pmc = Parrot_pmc_new_constant(imcc->interp, enum_class_String); + ns_pmc = Parrot_pmc_new(imcc->interp, enum_class_String); VTABLE_set_string_native(imcc->interp, ns_pmc, ct->str.constants[ns_const]); } @@ -1646,11 +1683,40 @@ add_const_pmc_sub(ARGMOD(imc_info_t * imcc), ARGMOD(SymReg *r), size_t offs, } } + store_sub_tags(imcc, r->pcc_sub, k, ct); + return k; } } +/* + +=item C + +Store the tags associated with a sub in the provided constant table. + +=cut + +*/ + +static void +store_sub_tags(ARGMOD(imc_info_t * imcc), ARGIN(pcc_sub_t * sub), const int sub_idx, + ARGMOD(PackFile_ConstTable * ct)) +{ + ASSERT_ARGS(store_sub_tags) + opcode_t i; + for (i = 0; i < sub->nflags; i++) { + SymReg * const flag = sub->flags[i]; + + STRING * const tag = Parrot_str_new(imcc->interp, flag->name + 1, + strlen(flag->name) - 2); + const int tag_idx = add_const_str(imcc, tag, ct->code); + Parrot_pf_tag_constant(imcc->interp, ct, tag_idx, sub_idx); + } +} + /* =item Cinterp, enum_class_Key); + PMC * temp = Parrot_pmc_new(imcc->interp, enum_class_Key); SETATTR_Key_next_key(imcc->interp, tail, temp); GETATTR_Key_next_key(imcc->interp, tail, tail); } else { - head = tail = Parrot_pmc_new_constant(imcc->interp, enum_class_Key); + head = tail = Parrot_pmc_new(imcc->interp, enum_class_Key); } switch (r->type) { @@ -1695,8 +1761,8 @@ build_key(ARGMOD(imc_info_t * imcc), ARGIN(SymReg *key_reg), case VTPASM: /* P[S0] */ case VTREG: /* P[S0] */ - /* if key is a register, the original sym is in r->reg */ - if (r->reg) + /* if key is a copy created by link_keys, use the original */ + if (r->reg && r->reg->type == r->type) r = r->reg; /* don't emit mapped regs in key parts */ @@ -1837,8 +1903,8 @@ init_fixedintegerarray_from_string(ARGMOD(imc_info_t * imcc), ARGIN(PMC *p), ARGIN(STRING *s)) { ASSERT_ARGS(init_fixedintegerarray_from_string) - INTVAL n, elem, i, l; - char *src, *chr, *start; + INTVAL n, elem, l; + char *src, *chr, *start, *end; int base; if (STRING_max_bytes_per_codepoint(s) != 1) @@ -1850,68 +1916,97 @@ init_fixedintegerarray_from_string(ARGMOD(imc_info_t * imcc), ARGIN(PMC *p), if (!l) return; - chr = src = Parrot_str_to_cstring(imcc->interp, s); + start = src = Parrot_str_to_cstring(imcc->interp, s); + end = src + l - 1; + + /* Skip leading whitespace and ( */ + while (*start == ' ' || *start == '\t' || *start == '(') { ++start; } + + /* Skip trailing whitespace and ) */ + while (end >= start && (*end == ' ' || *end == '\t' || *end == ')')) { + --end; + } + ++end; - /* "()" - no args */ - if (l <= 2 && *src == '(') { + /* no content */ + if (start == end) { Parrot_str_free_cstring(src); return; } /* count commas */ - n = 0; - while (*chr) { + for (chr = start, n = 0; chr < end; chr++) { if (*chr == ',') n++; - chr++; } /* presize the array */ VTABLE_set_integer_native(imcc->interp, p, n + 1); /* parse string */ - chr = src; + for (chr = start, n = 0; chr < end;) { + /* Check for comma */ + if (n > 0) { + if (*chr == ',') { + ++chr; + } + else { + Parrot_ex_throw_from_c_args(imcc->interp, NULL, + EXCEPTION_INVALID_STRING_REPRESENTATION, + "expected ',' in FixedIntegerArray initialization"); + } + } - for (i = l, n = 0; i; --i, ++chr) { + /* Skip value-leading whitespace */ + while (*chr == ' ' || *chr == '\t') { ++chr; } + + /* Leading 0, 0b, 0x */ + base = 10; + if (*chr == '0') { + ++chr; + switch (*chr) { + case 'b': + case 'B': + base = 2; + ++chr; + break; + case 'x': + case 'X': + base = 16; + ++chr; + break; + default: + base = 8; + } + } + + /* Store value */ + elem = strtoul(chr, &chr, base); + VTABLE_set_integer_keyed_int(imcc->interp, p, n++, elem); + + /* See if there are any garbage characters after the number */ switch (*chr) { case ' ': - continue; case '\t': - continue; - case '(': - continue; case ')': + ++chr; + /* Fallthrough */ + case '\0': break; case ',': - n++; + /* Hold onto the , for the test at the start of the loop */ 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(imcc->interp, p, n, elem); - break; + Parrot_ex_throw_from_c_args(imcc->interp, NULL, + EXCEPTION_INVALID_STRING_REPRESENTATION, + "invalid number in FixedIntegerArray initialization"); } + + /* Skip value-trailing whitespace */ + while (*chr == ' ' || *chr == '\t') { ++chr; } } Parrot_str_free_cstring(src); - } /* @@ -1946,7 +2041,7 @@ make_pmc_const(ARGMOD(imc_info_t * imcc), ARGMOD(SymReg *r)) else s = Parrot_str_unescape(imcc->interp, r->name, 0, NULL); - p = Parrot_pmc_new_constant(imcc->interp, r->pmc_type); + p = Parrot_pmc_new(imcc->interp, r->pmc_type); switch (r->pmc_type) { case enum_class_Integer: diff --git a/compilers/imcc/pcc.c b/compilers/imcc/pcc.c index 25a2814a52..48384abb29 100644 --- a/compilers/imcc/pcc.c +++ b/compilers/imcc/pcc.c @@ -83,16 +83,6 @@ static Instruction* pcc_get_args( FUNC_MODIFIES(* imcc) FUNC_MODIFIES(*unit); -static int pcc_reg_mov( - ARGMOD(imc_info_t * imcc), - unsigned char d, - unsigned char s, - ARGMOD(void *vinfo)) - __attribute__nonnull__(1) - __attribute__nonnull__(4) - FUNC_MODIFIES(* imcc) - FUNC_MODIFIES(*vinfo); - static void unshift_self( ARGMOD(imc_info_t * imcc), ARGIN(SymReg *sub), @@ -118,9 +108,6 @@ static void unshift_self( , 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(imcc) \ - , PARROT_ASSERT_ARG(vinfo)) #define ASSERT_ARGS_unshift_self __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ PARROT_ASSERT_ARG(imcc) \ , PARROT_ASSERT_ARG(sub) \ @@ -404,7 +391,8 @@ expand_pcc_sub(ARGMOD(imc_info_t * imcc), ARGMOD(IMC_Unit *unit), ARGIN(Instruct self->type = VTIDENTIFIER; } - unshift_self(imcc, sub, self); + if (sub->pcc_sub->nargs == 0 || STRNEQ(sub->pcc_sub->args[0]->name, "self")) + unshift_self(imcc, sub, self); } /* Don't generate any parameter checking code if there @@ -445,9 +433,7 @@ expand_pcc_sub(ARGMOD(imc_info_t * imcc), ARGMOD(IMC_Unit *unit), ARGIN(Instruct Parrot_ex_throw_from_c_args(imcc->interp, NULL, 1, "NULL sub->pcc_sub detected"); - if (sub->pcc_sub->pragma & P_MAIN) - tmp = INS(imcc, unit, "end", NULL, regs, 0, 0, 0); - else { + { Instruction *unused_ins = pcc_get_args(imcc, unit, unit->last_ins, "set_returns", 0, NULL, NULL); UNUSED(unused_ins); @@ -507,82 +493,6 @@ typedef struct move_info_t { /* -=item C - -Callback for C. Inserts move instructions in stead of -actually moving the registers. - -=cut - -*/ - -static int -pcc_reg_mov(ARGMOD(imc_info_t * imcc), unsigned char d, unsigned char s, - ARGMOD(void *vinfo)) -{ - ASSERT_ARGS(pcc_reg_mov) - static const char types[] = "INSP"; - /* XXX non-reentrant */ - static SymReg *temps[4]; - move_info_t *info = (move_info_t *)vinfo; - SymReg *src = NULL; - SymReg *dest = NULL; - SymReg *regs[3]; - - if (d == 255) { - int t; - - /* handle temp use/create temp of src type */ - PARROT_ASSERT(s != 255); - PARROT_ASSERT(s < 2 * info->n); - - src = s < info->n ? info->dest[(int)s] : info->src[(int)s - info->n]; - - for (t = 0; t < 4; ++t) { - if (types[t] == src->set) { - if (temps[t]) - dest = temps[t]; - else { - dest = temps[t] = mk_temp_reg(imcc, src->set); - } - break; - } - - } - } - else if (s == 255) { - int t; - /* handle temp use/create temp of dest type */ - PARROT_ASSERT(d < 2 * info->n); - - dest = d < info->n ? info->dest[(int)d] : info->src[(int)d - info->n]; - - for (t = 0; t < 4; ++t) { - if (types[t] == dest->set) { - if (!temps[t]) - temps[t] = mk_temp_reg(imcc, dest->set); - src = temps[t]; - break; - } - } - } - - if (!dest) - dest = d < info->n ? info->dest[(int)d] : info->src[(int)d - info->n]; - - if (!src) - src = s < info->n ? info->dest[(int)s] : info->src[(int)s - info->n]; - - regs[0] = dest; - regs[1] = src; - info->ins = insINS(imcc, info->unit, info->ins, "set", regs, 2); - - return 1; -} - -/* - =item C diff --git a/compilers/imcc/reg_alloc.c b/compilers/imcc/reg_alloc.c index e63447f7a5..029e69e90c 100644 --- a/compilers/imcc/reg_alloc.c +++ b/compilers/imcc/reg_alloc.c @@ -621,7 +621,7 @@ first_avail(ARGMOD(imc_info_t * imcc), ARGIN(const IMC_Unit *unit), int reg_set, for (r = hsh->data[i]; r; r = r->next) { if (r->set == reg_set) if (REG_NEEDS_ALLOC(r)) - if (r->color >= (int)0) + if (r->color >= 0) set_add(allocated, (unsigned int)r->color); } } diff --git a/compilers/imcc/symreg.c b/compilers/imcc/symreg.c index cc8085c819..1fba248723 100644 --- a/compilers/imcc/symreg.c +++ b/compilers/imcc/symreg.c @@ -484,6 +484,27 @@ add_pcc_multi(ARGMOD(imc_info_t * imcc), ARGMOD(SymReg *r), ARGIN_NULLOK(SymReg } +/* + +=item C + +Associate a tag with a sub. + +=cut + +*/ + +void +add_pcc_flag_str(ARGMOD(imc_info_t * imcc), ARGMOD(SymReg * r), ARGIN(SymReg * arg)) +{ + ASSERT_ARGS(add_pcc_flag_str) + pcc_sub_t * const sub = r->pcc_sub; + const int n = sub->nflags; + sub->flags = mem_gc_realloc_n_typed(imcc->interp, sub->flags, n + 1, SymReg*); + sub->flags[n] = arg; + sub->nflags++; +} + /* =item C diff --git a/compilers/imcc/symreg.h b/compilers/imcc/symreg.h index 4846feee1a..b43b46ca61 100644 --- a/compilers/imcc/symreg.h +++ b/compilers/imcc/symreg.h @@ -32,12 +32,13 @@ enum VARTYPE { /* variable type can be */ #define REG_NEEDS_ALLOC(r) ((r)->type & VTREGISTER) enum USAGE { - U_KEYED = 1 << 0, /* array, hash, keyed */ - U_NEW = 1 << 1, /* PMC was inited */ - U_GLOBAL = 1 << 3, /* symbol is global (fixup) */ - U_LEXICAL = 1 << 4, /* symbol is lexical */ - U_FIXUP = 1 << 5, /* maybe not global, force fixup */ - U_SUBID_LOOKUP = 1 << 6 /* .const 'Sub' lookup is done by subid */ + U_KEYED = 1 << 0, /* array, hash, keyed */ + U_NEW = 1 << 1, /* PMC was inited */ + U_GLOBAL = 1 << 3, /* symbol is global (fixup) */ + U_LEXICAL = 1 << 4, /* symbol is lexical */ + U_FIXUP = 1 << 5, /* maybe not global, force fixup */ + U_SUBID_LOOKUP = 1 << 6, /* .const 'Sub' lookup is done by subid */ + U_LEXINFO_LOOKUP = 1 << 7 /* .const 'LexInfo' lookup is done by subid */ }; typedef struct _SymReg { @@ -104,11 +105,13 @@ typedef struct pcc_sub_t { SymReg **multi; SymReg **ret; SymReg *object; + SymReg **flags; /* "load", "init", etc */ int *arg_flags; /* :slurpy, :optional, ... */ int *ret_flags; /* :slurpy, :optional, ... */ int nargs; int nret; int nmulti; + int nflags; int yield; int tailcall; int label; @@ -204,6 +207,16 @@ void add_pcc_cc(ARGMOD(SymReg *r), ARGIN(SymReg *arg)) __attribute__nonnull__(2) FUNC_MODIFIES(*r); +void add_pcc_flag_str( + ARGMOD(imc_info_t * imcc), + ARGMOD(SymReg * r), + ARGIN(SymReg * arg)) + __attribute__nonnull__(1) + __attribute__nonnull__(2) + __attribute__nonnull__(3) + FUNC_MODIFIES(* imcc) + FUNC_MODIFIES(* r); + void add_pcc_multi( ARGMOD(imc_info_t * imcc), ARGMOD(SymReg *r), @@ -425,6 +438,10 @@ char * symreg_to_str(ARGIN(const SymReg *s)) #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_flag_str __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ + PARROT_ASSERT_ARG(imcc) \ + , PARROT_ASSERT_ARG(r) \ + , PARROT_ASSERT_ARG(arg)) #define ASSERT_ARGS_add_pcc_multi __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ PARROT_ASSERT_ARG(imcc) \ , PARROT_ASSERT_ARG(r)) diff --git a/compilers/opsc/src/Ops/Compiler/Actions.pm b/compilers/opsc/src/Ops/Compiler/Actions.pm index 0563d2d692..15e8d2da1f 100644 --- a/compilers/opsc/src/Ops/Compiler/Actions.pm +++ b/compilers/opsc/src/Ops/Compiler/Actions.pm @@ -520,7 +520,7 @@ method term:sym ($/) { method term:sym ($/) { # longer to work-around lack of LTM make PAST::Val.new( - :value(~$/), + :value(~$/[0]), :returns ); } diff --git a/compilers/opsc/src/Ops/Compiler/Grammar.pm b/compilers/opsc/src/Ops/Compiler/Grammar.pm index 9440c5bbff..97749666a7 100644 --- a/compilers/opsc/src/Ops/Compiler/Grammar.pm +++ b/compilers/opsc/src/Ops/Compiler/Grammar.pm @@ -183,7 +183,7 @@ token statement { token label { [ - | 'case' <.ws> [ | ] ':' + | 'case' <.ws> [ | | "'" "'" ] ':' | 'default:' | ':' ] @@ -198,24 +198,23 @@ rule statement_control:sym { } rule statement_control:sym { - '(' ')' + '(' ~ ')' } rule statement_control:sym { - '(' ? ';' ? ';' ? ')' + '(' ~ ')' [ ? ';' ? ';' ? ] } rule statement_control:sym { - 'do' 'while' '(' ')' + 'do' 'while' '(' ~ ')' } # Not real "C" switch. Just close enough rule statement_control:sym { - '(' ')' '{' + '(' ')' '{' ~ '}' - '}' } rule statement_control:sym { } @@ -232,16 +231,17 @@ token term:sym { # Long-long name as LTM workaround } token term:sym { - <.ws> '(' ')' + <.ws> '(' ~ ')' } token term:sym { ('u'|'U'|'l'|'L')* } token term:sym { } token term:sym { # longer to work-around lack of LTM - [ + ( | \d+ '.' \d* | \d* '.' \d+ - ] + ) + <[fF]>? } token term:sym { @@ -350,7 +350,7 @@ token prefix:sym<~> { ')> } token prefix:sym { ')> } rule blockoid { - '{' '}' + '{' ~ '}' } rule mixed_content { @@ -371,17 +371,18 @@ rule pointer { 'const'? } token star { '*' } rule pointerless_type { - 'struct'? 'const'? + 'struct'? 'const'? 'unsigned'? } rule type_declarator { - 'struct'? 'const'? * + 'struct'? 'const'? 'unsigned'? * } token eat_terminator { | ';' | | $ + | <.panic('Statement not properly terminated')> } token pod_ws { diff --git a/compilers/opsc/src/Ops/Emitter.pm b/compilers/opsc/src/Ops/Emitter.pm index 8eebba3374..a7b3c315f2 100644 --- a/compilers/opsc/src/Ops/Emitter.pm +++ b/compilers/opsc/src/Ops/Emitter.pm @@ -23,7 +23,8 @@ method new(:$ops_file!, :$trans!, :$script!, :$file, :%flags!) { if !%flags { $base := subst( $file, /.ops$$/, ''); - $base := subst( $base, /.*\//, ''); + $base := subst( $base, /.*\//, ''); # Unix slash + $base := subst( $base, /.*\\/, ''); # Win backslash } my $base_ops_stub := $base ~ '_ops' ~ $suffix; diff --git a/compilers/opsc/src/Ops/File.pm b/compilers/opsc/src/Ops/File.pm index fa6a8a04d4..84d2c2cae7 100644 --- a/compilers/opsc/src/Ops/File.pm +++ b/compilers/opsc/src/Ops/File.pm @@ -244,7 +244,7 @@ method read_ops($file, $nolines) { self || say("# Parsing $file..."); my $start_time := pir::time__N(); - my $buffer := slurp($file); + my $buffer := transcode_slurp($file); my $start_ops := +self; self.compile_ops($buffer, :experimental( $file ~~ /experimental\.ops/)); my $end_ops := +self; diff --git a/compilers/opsc/src/Ops/Trans/C.pm b/compilers/opsc/src/Ops/Trans/C.pm index 8ae5185551..4d645217bc 100644 --- a/compilers/opsc/src/Ops/Trans/C.pm +++ b/compilers/opsc/src/Ops/Trans/C.pm @@ -1,5 +1,5 @@ #! nqp -# Copyright (C) 2010-2011, Parrot Foundation. +# Copyright (C) 2010-2012, Parrot Foundation. class Ops::Trans::C is Ops::Trans; @@ -76,7 +76,7 @@ method emit_c_op_funcs_header_part($fh) { method access_arg($type, $num) { my $access := self{$type}; - die("unrecognized arg type '$type'") unless $access; + die("unrecognized arg type '$type' (register \$$num)") unless $access; subst($access, /NUM/, $num); } @@ -90,7 +90,7 @@ method restart_offset($offset) { method goto_address($addr) { "return (opcode_t *)$addr"; } -method goto_offset($offset) { "return (opcode_t *)cur_opcode + $offset"; } +method goto_offset($offset) { "return cur_opcode + $offset"; } method expr_address($addr) { $addr; } @@ -350,14 +350,15 @@ static int get_op(PARROT_INTERP, ARGIN(const char *name), int full) static void hop_init(PARROT_INTERP) { op_info_t * const info = [[BS]]op_lib.op_info_table; + opcode_t i; /* allocate the storage all in one chunk * yes, this is profligate, but we can tighten it later */ - HOP * const hop_buckets = - mem_gc_allocate_n_zeroed_typed(interp, [[BS]]op_lib.op_count * 2, HOP ); - HOP *hops = hop_buckets; + HOP *hops; + + hop_buckets = mem_gc_allocate_n_zeroed_typed(interp, [[BS]]op_lib.op_count * 2, HOP ); + hops = hop_buckets; - opcode_t i; /* store full names */ for (i = 0; i < [[BS]]op_lib.op_count; i++) { diff --git a/compilers/opsc/src/builtins.pir b/compilers/opsc/src/builtins.pir index 4ae83ce8b1..5818634d79 100644 --- a/compilers/opsc/src/builtins.pir +++ b/compilers/opsc/src/builtins.pir @@ -89,14 +89,41 @@ Variour helper builtins. die why .end -.sub 'slurp' +.sub 'transcode_slurp' .param string file .local pmc pio pio = new ['FileHandle'] pio.'open'(file) $S0 = pio.'readall'() pio.'close'() - .return ($S0) + ($I0, $S1) = transcode( $S0, 'ascii' ) + if $I0 goto return_result + ($I0, $S1) = transcode( $S0, 'iso-8859-1' ) + if $I0 goto return_result + $S1 = $S0 + + return_result: + .return ($S1) +.end + +.sub 'transcode' + .param string source + .param string encoding + .local int result + + push_eh transcoding_failure + $I0 = find_encoding encoding + $S0 = trans_encoding source, $I0 + goto return_result + + transcoding_failure: + result = 0 + $S0 = source + + return_result: + pop_eh + .return( result, $S0 ) + .end .sub 'split' :multi(_,_) diff --git a/compilers/pct/src/PAST/Compiler.pir b/compilers/pct/src/PAST/Compiler.pir index 45896be612..8d6bfb49b9 100644 --- a/compilers/pct/src/PAST/Compiler.pir +++ b/compilers/pct/src/PAST/Compiler.pir @@ -87,7 +87,7 @@ any value type. piropsig['find_dynamic_lex'] = 'Ps' piropsig['find_name'] = 'Ps' piropsig['getinterp'] = 'P' - piropsig['getprop'] = 'P~P' + piropsig['getprop'] = 'PP~' piropsig['getstderr'] = 'P' piropsig['getstdin'] = 'P' piropsig['getstdout'] = 'P' @@ -155,7 +155,7 @@ any value type. ## type of exception handler we support .local pmc controltypes controltypes = new 'Hash' - controltypes['CONTROL'] = '.CONTROL_RETURN, .CONTROL_OK, .CONTROL_BREAK, .CONTROL_CONTINUE, .CONTROL_TAKE, .CONTROL_LEAVE, .CONTROL_EXIT, .CONTROL_LOOP_NEXT, .CONTROL_LOOP_LAST, .CONTROL_LOOP_REDO' + controltypes['CONTROL'] = '.CONTROL_ALL' controltypes['RETURN'] = '.CONTROL_RETURN' controltypes['OK'] = '.CONTROL_OK' controltypes['BREAK'] = '.CONTROL_BREAK' @@ -202,6 +202,8 @@ Compile the abstract syntax tree given by C into POST. .lex '@*BLOCKPAST', blockpast null $P99 .lex '$*SUB', $P99 + null $P98 + .lex '%*LEXREGS', $P98 .local pmc tempregs tempregs = find_dynamic_lex '%*TEMPREGS' @@ -849,17 +851,15 @@ Return the POST representation of a C. .param pmc options :slurpy :named # Probably not safe to use tempregs in an exception handler - .local pmc tempregs - null tempregs + .local pmc tempregs + null tempregs .lex '%*TEMPREGS', tempregs - .local pmc ops, children, ishandled, nothandled + .local pmc ops, children, ishandled .local string handled $P0 = get_hll_global ['POST'], 'Label' $S0 = self.'unique'('handled_') ishandled = $P0.'new'('result'=>$S0) - $S0 = self.'unique'('nothandled_') - nothandled = $P0.'new'('result'=>$S0) $P0 = get_hll_global ['POST'], 'Ops' ops = $P0.'new'('node'=>node) .local string rtype @@ -874,88 +874,140 @@ Return the POST representation of a C. ops.'push'(children) handled = self.'uniquereg'('I') ops.'push_pirop'('set', handled, 'exception["handled"]') - ops.'push_pirop'('ne', handled, 1, nothandled) - ops.'push'(ishandled) - ops.'push_pirop'('return', 'exception') - ops.'push'(nothandled) + ops.'push_pirop'('eq', handled, 1, ishandled) ops.'push_pirop'('rethrow', 'exception') + ops.'push'(ishandled) + ops.'result'('exception') .return (ops) .end +.sub 'push_exception_handler' :method + .param pmc node + .param pmc ops + .param pmc label + + .local string type, extype + type = node.'handle_types'() + extype = node.'handle_types_except'() + if type goto handler_need_exhandler + if extype goto handler_need_exhandler + ops.'push_pirop'('push_eh', label) + .return () + + handler_need_exhandler: + .local pmc controltypes, subpost + .local string ehreg + subpost = find_dynamic_lex '$*SUB' + ehreg = self.'uniquereg'('P') + unless type, no_handle_types + controltypes = get_global '%!controltypes' + type = controltypes[type] + unless type, no_handle_types + $P0 = split ',', type + $S0 = join ';', $P0 + $S0 = concat '[', $S0 + $S0 = concat $S0, ']' + ops.'push_pirop'('new', ehreg, "'ExceptionHandler'", $S0) + subpost.'add_directive'('.include "except_types.pasm"') + goto handle_types_done + no_handle_types: + ops.'push_pirop'('new', ehreg, "'ExceptionHandler'") + handle_types_done: + ops.'push_pirop'('set_label', ehreg, label) + unless extype, handle_types_except_done + controltypes = get_global '%!controltypes' + extype = controltypes[extype] + unless extype, handle_types_except_done + $P0 = split ',', extype + ops.'push_pirop'('callmethod', '"handle_types_except"', ehreg, $P0 :flat) + subpost.'add_directive'('.include "except_types.pasm"') + handle_types_except_done: + ops.'push_pirop'('push_eh', ehreg) + .return () +.end + .sub 'wrap_handlers' :method .param pmc child .param pmc ehs .param pmc options :slurpy :named - .local string rtype + .local string rtype, result + .local int addreturn rtype = options['rtype'] + addreturn = options['addreturn'] + if addreturn goto wrap_no_result + result = self.'tempreg'(rtype) + wrap_no_result: - # Probably not safe to use tempregs in an exception handler - .local pmc tempregs - null tempregs + # Probably not safe to use tempregs in an exception handler + .local pmc tempregs + null tempregs .lex '%*TEMPREGS', tempregs - .local pmc it, node, ops, pops, tail, skip + .local pmc it, node, ops, tail, skip + .local int depth $P0 = get_hll_global ['POST'], 'Ops' ops = $P0.'new'('node'=>node) $P0 = get_hll_global ['POST'], 'Ops' - pops = $P0.'new'('node'=>node) - $P0 = get_hll_global ['POST'], 'Ops' tail = $P0.'new'('node'=>node) $P0 = get_hll_global ['POST'], 'Label' $S0 = self.'unique'('skip_handler_') skip = $P0.'new'('result'=>$S0) + ops.'result'(result) + unless result goto wrap_child_no_result + child = self.'coerce'(child, result) + wrap_child_no_result: + it = iter ehs + depth = 0 handler_loop: unless it, handler_loop_done node = shift it - .local pmc ehpir, label, controltypes, subpost - .local string ehreg, type + .local pmc ehpir, label + .local string exceptreg $P0 = get_hll_global ['POST'], 'Label' $S0 = self.'unique'('control_') label = $P0.'new'('result'=>$S0) - - subpost = find_dynamic_lex '$*SUB' - - ehreg = self.'uniquereg'('P') - ops.'push_pirop'('new', ehreg, "'ExceptionHandler'") - ops.'push_pirop'('set_label', ehreg, label) - controltypes = get_global '%!controltypes' - type = node.'handle_types'() - unless type, handle_types_done - type = controltypes[type] - unless type, handle_types_done - $P0 = split ',', type - ops.'push_pirop'('callmethod', '"handle_types"', ehreg, $P0 :flat) - subpost.'add_directive'('.include "except_types.pasm"') - handle_types_done: - type = node.'handle_types_except'() - unless type, handle_types_except_done - type = controltypes[type] - unless type, handle_types_except_done - $P0 = split ',', type - ops.'push_pirop'('callmethod', '"handle_types_except"', ehreg, $P0 :flat) - subpost.'add_directive'('.include "except_types.pasm"') - handle_types_except_done: - ops.'push_pirop'('push_eh', ehreg) - - # Add one pop_eh for every handler we push_eh - pops.'push_pirop'('pop_eh') + self.'push_exception_handler'(node, ops, label) + inc depth # Push the handler itself tail.'push'(label) + exceptreg = self.'uniquereg'('P') + tail.'push_pirop'('peek_exception', exceptreg) ehpir = self.'as_post'(node, 'rtype'=>rtype) + unless result goto handler_loop_no_result + ehpir = self.'coerce'(ehpir, result) + handler_loop_no_result: tail.'push'(ehpir) - + tail.'push_pirop'('finalize', exceptreg) + unless addreturn goto handler_loop_no_return + .local pmc retval + retval = ehpir.'result'() + tail.'push_pirop'('return', retval) + goto handler_loop + handler_loop_no_return: + tail.'push_pirop'('pop_upto_eh', exceptreg) + $I0 = depth + pops_loop_handler: + tail.'push_pirop'('pop_eh') + dec $I0 + if $I0 goto pops_loop_handler + unless it, handler_loop_done + tail.'push_pirop'('goto', skip) goto handler_loop handler_loop_done: ops.'push'(child) - - - ops.'push'(pops) + $I0 = depth + unless $I0 goto pops_done + pops_loop: + ops.'push_pirop'('pop_eh') + dec $I0 + if $I0 goto pops_loop + pops_done: ops.'push_pirop'('goto', skip) ops.'push'(tail) ops.'push'(skip) @@ -1066,7 +1118,7 @@ Return the POST representation of a C. $I0 = defined symtable[''] if $I0 goto have_symtable ## merge the Block's symtable with outersym - symtable = clone symtable + symtable = 'shallow_clone_hash'(symtable) symtable_merge: .local pmc it it = iter outersym @@ -1095,6 +1147,11 @@ Return the POST representation of a C. have_tempregs: .lex '%*TEMPREGS', tempregs + .local pmc lexregs, outerlexregs + outerlexregs = find_dynamic_lex '%*LEXREGS' + null lexregs + .lex '%*LEXREGS', lexregs + ## control exception handler .local pmc ctrlpast, ctrllabel ctrlpast = node.'control'() @@ -1103,7 +1160,7 @@ Return the POST representation of a C. $S0 = self.'unique'('control_') ctrllabel = $P0.'new'('result'=>$S0) $S0 = self.'uniquereg'('P') - bpost.'push_pirop'('new', $S0, "['ExceptionHandler']", '.CONTROL_RETURN') + bpost.'push_pirop'('new', $S0, "'ExceptionHandler'", '[.CONTROL_RETURN]') bpost.'push_pirop'('set_label', $S0, ctrllabel) bpost.'push_pirop'('push_eh', $S0) bpost.'add_directive'('.include "except_types.pasm"') @@ -1117,18 +1174,15 @@ Return the POST representation of a C. ## convert children to post .local pmc ops, retval ops = self.'post_children'(node, 'signature'=>$S0) + ## result of last child is return from block + retval = ops[-1] + ops.'result'(retval) ## wrap the child with appropriate exception handlers, if any .local pmc eh eh = node.'handlers'() unless eh, no_eh - $S0 = options['rtype'] - retval = ops[-1] - ops = self.'wrap_handlers'(ops, eh, 'rtype'=>$S0) - goto had_eh + ops = self.'wrap_handlers'(ops, eh, 'rtype'=>'*', 'addreturn'=>1) no_eh: - ## result of last child is return from block - retval = ops[-1] - had_eh: bpost.'push'(ops) bpost.'push_pirop'('return', retval) @@ -1180,6 +1234,9 @@ Return the POST representation of a C. ## restore the outer temporary register bank store_lex '%*TEMPREGS', outerregs + ## restore the outer lexical register hash + store_lex '%*LEXREGS', outerlexregs + ## restore previous outer scope and symtable setattribute self, '%!symtable', outersym @@ -1226,6 +1283,20 @@ Return the POST representation of a C. .return (bpost) .end +.sub 'shallow_clone_hash' + .param pmc to_clone + $P0 = new ['Hash'] + $P1 = iter to_clone + it_loop: + unless $P1 goto it_loop_end + $S0 = shift $P1 + $P2 = to_clone[$S0] + $P0[$S0] = $P2 + goto it_loop + it_loop_end: + .return ($P0) +.end + =back @@ -1572,9 +1643,8 @@ Generate a standard loop with NEXT/LAST/REDO exception handling. .local string handreg handreg = self.'tempreg'('P') - ops.'push_pirop'('new', handreg, "'ExceptionHandler'") + ops.'push_pirop'('new', handreg, "'ExceptionHandler'", "[.CONTROL_LOOP_NEXT;.CONTROL_LOOP_REDO;.CONTROL_LOOP_LAST]") ops.'push_pirop'('set_label', handreg, handlabel) - ops.'push_pirop'('callmethod', '"handle_types"', handreg, '.CONTROL_LOOP_NEXT', '.CONTROL_LOOP_REDO', '.CONTROL_LOOP_LAST') ops.'push_pirop'('push_eh', handreg) unless bodyfirst goto bodyfirst_done @@ -1600,6 +1670,8 @@ Generate a standard loop with NEXT/LAST/REDO exception handling. ops.'push'(handlabel) ops.'push_pirop'('.local pmc exception') ops.'push_pirop'('.get_results (exception)') + # should probably also finalize the exception + ops.'push_pirop'('pop_upto_eh', 'exception') $S0 = self.'tempreg'('P') ops.'push_pirop'('getattribute', $S0, 'exception', "'type'") ops.'push_pirop'('eq', $S0, '.CONTROL_LOOP_NEXT', nextlabel) @@ -1861,7 +1933,7 @@ a return value. =item try(PAST::Op node) Return the POST representation of a C -node with a 'pasttype' of bind. The first child +node with a 'pasttype' of try. The first child is the code to be surrounded by an exception handler, the second child (if any) is the code to process the handler. @@ -1883,13 +1955,18 @@ handler. $S0 = concat $S0, '_end' endlabel = $P0.'new'('result'=>$S0) - .local string rtype + .local string rtype, result rtype = options['rtype'] + result = self.'tempreg'(rtype) + ops.'result'(result) .local pmc trypast, trypost trypast = node[0] trypost = self.'as_post'(trypast, 'rtype'=>rtype) - ops.'push_pirop'('push_eh', catchlabel) + unless result goto trypost_no_result + trypost = self.'coerce'(trypost, result) + trypost_no_result: + self.'push_exception_handler'(node, ops, catchlabel) ops.'push'(trypost) ops.'push_pirop'('pop_eh') .local pmc elsepast, elsepost @@ -1900,15 +1977,23 @@ handler. else_done: ops.'push_pirop'('goto', endlabel) ops.'push'(catchlabel) + .local string exceptreg + exceptreg = self.'uniquereg'('P') + ops.'push_pirop'('peek_exception', exceptreg) .local pmc catchpast, catchpost catchpast = node[1] - if null catchpast goto catch_done - catchpost = self.'as_post'(catchpast, 'rtype'=>'v') + if null catchpast goto catchpost_done + catchpost = self.'as_post'(catchpast, 'rtype'=>rtype) + unless result goto catchpost_no_result + catchpost = self.'coerce'(catchpost, result) + catchpost_no_result: ops.'push'(catchpost) - ops.'push_pirop'('pop_eh') # FIXME: should be before catchpost + catchpost_done: + ops.'push_pirop'('finalize', exceptreg) + ops.'push_pirop'('pop_upto_eh', exceptreg) + ops.'push_pirop'('pop_eh') catch_done: ops.'push'(endlabel) - ops.'result'(trypost) .return (ops) .end @@ -2348,6 +2433,16 @@ attribute. unless $I0 goto param_lex_done name = self.'escape'(name) ops.'push_pirop'('.lex', name, ops) + .local int directaccess + directaccess = node.'directaccess'() + unless directaccess goto param_lex_done + .local pmc lexregs + lexregs = find_dynamic_lex '%*LEXREGS' + unless null lexregs goto have_lexregs + lexregs = new 'Hash' + store_dynamic_lex '%*LEXREGS', lexregs + have_lexregs: + lexregs[name] = pname param_lex_done: .return (ops) .end @@ -2406,6 +2501,9 @@ attribute. name = node.'name'() name = self.'escape'(name) + .local pmc lexregs + lexregs = find_dynamic_lex '%*LEXREGS' + .local int isdecl isdecl = node.'isdecl'() @@ -2416,6 +2514,14 @@ attribute. $P0 = get_hll_global ['POST'], 'Ops' ops = $P0.'new'('node'=>node) $P0 = get_hll_global ['POST'], 'Op' + if null lexregs goto no_lexregs + .local string lexreg + lexreg = lexregs[name] + unless lexreg goto no_lexregs + fetchop = $P0.'new'(ops, lexreg, 'pirop'=>'set') + storeop = $P0.'new'(lexreg, ops, 'pirop'=>'set') + .tailcall self.'vivify'(node, ops, fetchop, storeop) + no_lexregs: fetchop = $P0.'new'(ops, name, 'pirop'=>'find_lex') storeop = $P0.'new'(name, ops, 'pirop'=>'store_lex') .tailcall self.'vivify'(node, ops, fetchop, storeop) @@ -2437,10 +2543,25 @@ attribute. have_lexreg: ops.'push_pirop'('.lex', name, lexreg) ops.'result'(lexreg) + .local int directaccess + directaccess = node.'directaccess'() + unless directaccess goto no_directaccess + unless null lexregs goto have_lexregs + lexregs = new 'Hash' + store_dynamic_lex '%*LEXREGS', lexregs + have_lexregs: + lexregs[name] = lexreg + no_directaccess: .return (ops) lexical_bind: $P0 = get_hll_global ['POST'], 'Op' + if null lexregs goto no_lexregs_bind + .local string lexreg + lexreg = lexregs[name] + unless lexreg goto no_lexregs_bind + .tailcall $P0.'new'(lexreg, bindpost, 'pirop'=>'set', 'result'=>bindpost) + no_lexregs_bind: .tailcall $P0.'new'(name, bindpost, 'pirop'=>'store_lex', 'result'=>bindpost) .end @@ -2751,7 +2872,16 @@ to have a PMC generated containing the constant value. value_block: .local string blockreg, blockref blockreg = self.'uniquereg'('P') + returns = node.'returns'() + if null returns goto value_block_no_returns + $S0 = returns + blockref = concat ".const '", $S0 + blockref = concat blockref, "' " + blockref = concat blockref, blockreg + goto value_block_blockref_set + value_block_no_returns: blockref = concat ".const 'Sub' ", blockreg + value_block_blockref_set: blockref = concat blockref, ' = ' $P0 = value.'subid'() $S0 = self.'escape'($P0) diff --git a/compilers/pct/src/PAST/Node.pir b/compilers/pct/src/PAST/Node.pir index 3930626985..e932575f24 100644 --- a/compilers/pct/src/PAST/Node.pir +++ b/compilers/pct/src/PAST/Node.pir @@ -104,6 +104,14 @@ Accessor method -- sets/returns the "flatten" flag on arguments. .tailcall self.'attr'('flat', value, has_value) .end + +=item handlers([node array]) + +Accessor method -- sets/returns handlers associated with this node. +Handlers can be used for PAST::Block and PAST::Stmts nodes. + +=cut + .sub 'handlers' :method .param pmc value :optional .param int has_value :opt_flag @@ -111,6 +119,37 @@ Accessor method -- sets/returns the "flatten" flag on arguments. .end +=item handle_types([value]) + +Accessor method -- sets/returns the exception types this node +handles. This is evaluated if the node is used as a block +handler, the node is a PAST::Control node, or the node is +a PAST::Op node of type 'try'. + +=cut + +.sub 'handle_types' :method + .param pmc value :optional + .param int has_value :opt_flag + .tailcall self.'attr'('handle_types', value, has_value) +.end + + +=item handle_types_except([value]) + +Accessor method -- sets/returns the exception types this node +does not handle. Same as handle_types, but all exceptions not +matching the specified ones will be caught. + +=cut + +.sub 'handle_types_except' :method + .param pmc value :optional + .param int has_value :opt_flag + .tailcall self.'attr'('handle_types_except', value, has_value) +.end + + =item lvalue([flag]) Get/set the C attribute, which indicates whether this @@ -239,6 +278,23 @@ Otherwise, the node refers to a lexical variable from an outer scope. .end +=item directaccess([flag]) + +Get/set the node's C attribute (for lexical variables) to C. +A true value of C indicates that the variable given by this node +can be accessed directly through the assigned register without going +through the lexpad. Otherwise, find_lex/store_lex instructions will be used +for retrieval and storage. + +=cut + +.sub 'directaccess' :method + .param pmc value :optional + .param int has_value :opt_flag + .tailcall self.'attr'('directaccess', value, has_value) +.end + + =item namespace([namespace]) Get/set the variable's namespace attribute to the array of strings @@ -842,21 +898,6 @@ outer statement. .end -.namespace [ 'PAST';'Control' ] - -.sub 'handle_types' :method - .param pmc value :optional - .param int has_value :opt_flag - .tailcall self.'attr'('handle_types', value, has_value) -.end - -.sub 'handle_types_except' :method - .param pmc value :optional - .param int has_value :opt_flag - .tailcall self.'attr'('handle_types_except', value, has_value) -.end - - .namespace [ 'PAST';'VarList' ] .sub 'bindvalue' :method diff --git a/compilers/pct/src/PCT/HLLCompiler.pir b/compilers/pct/src/PCT/HLLCompiler.pir index ea79a675d2..0724383ad5 100644 --- a/compilers/pct/src/PCT/HLLCompiler.pir +++ b/compilers/pct/src/PCT/HLLCompiler.pir @@ -51,23 +51,18 @@ running compilers from a command line. options_end: setattribute self, '$usage', $P1 - $S0 = '???' - push_eh _handler + $S0 = 'This compiler is built with the Parrot Compiler Toolkit, parrot ' $P0 = getinterp $P0 = $P0[.IGLOBALS_CONFIG_HASH] - $S0 = $P0['revision'] # also $I0 = P0['installed'] could be used - _handler: - pop_eh - $P2 = box 'This compiler is built with the Parrot Compiler Toolkit, parrot ' - if $S0 goto _revision_lab - $P2 .= 'version ' - $S0 = $P0['VERSION'] - goto _is_version - _revision_lab: - $P2 .= 'revision ' - _is_version: - $P2 .= $S0 - $P2 .= '.' + $S1 = $P0['VERSION'] + $S0 .= $S1 + $S1 = $P0['git_describe'] + unless $S1 goto version_done + $S0 .= ' revision ' + $S0 .= $S1 + version_done: + + $P2 = box $S0 setattribute self, '$version', $P2 .end @@ -855,6 +850,10 @@ Generic method for compilers invoked from a shell command line. $I0 = adverbs['version'] if $I0 goto version + .local string target + target = adverbs['target'] + target = downcase target + .local int can_backtrace, ll_backtrace can_backtrace = can self, 'backtrace' unless can_backtrace goto no_push_eh @@ -882,6 +881,9 @@ Generic method for compilers invoked from a shell command line. goto save_output eval_line: result = self.'eval'($S0, '-e', args :flat, adverbs :flat :named) + if target == '' goto save_output + if target == 'pir' goto save_output + '_dumper'(result, target) save_output: unless can_backtrace goto no_pop_eh @@ -890,9 +892,6 @@ Generic method for compilers invoked from a shell command line. if null result goto end $I0 = defined result unless $I0 goto end - .local string target - target = adverbs['target'] - target = downcase target if target != 'pir' goto end .local string output .local pmc ofh @@ -974,7 +973,7 @@ memoize the line offsets as a C property on C. # If we've previously cached C for target, we use it. unless cache goto linepos_build - linepos = getprop '!linepos', target + linepos = getprop target, '!linepos' unless null linepos goto linepos_done # calculate a new linepos array. @@ -992,7 +991,7 @@ memoize the line offsets as a C property on C. # find one, mark the ending offset of the line in C. linepos_loop: jpos = find_cclass .CCLASS_NEWLINE, s, jpos, eos - unless jpos < eos goto linepos_done + unless jpos < eos goto linepos_done_1 $I0 = ord s, jpos inc jpos push linepos, jpos @@ -1002,23 +1001,27 @@ memoize the line offsets as a C property on C. if $I0 != 10 goto linepos_loop inc jpos goto linepos_loop + linepos_done_1: linepos_done: - # We have C, so now we search the array for the largest - # element that is not greater than C. The index of that - # element is the line number to be returned. - # (Potential optimization: use a binary search.) - .local int line, count - count = elements linepos - line = 0 - line_loop: - if line >= count goto line_done + # We have C, so now we (binary) search the array + # for the largest element that is not greater than C. + .local int lo, hi, line + lo = 0 + hi = elements linepos + binary_loop: + if lo >= hi goto binary_done + line = lo + hi + line = line / 2 $I0 = linepos[line] - if $I0 > pos goto line_done - inc line - goto line_loop - line_done: - .return (line) + if $I0 > pos goto binary_hi + lo = line + 1 + goto binary_loop + binary_hi: + hi = line + goto binary_loop + binary_done: + .return (lo) .end diff --git a/compilers/pct/src/PCT/Node.pir b/compilers/pct/src/PCT/Node.pir index 2451a3fb82..e150b11369 100644 --- a/compilers/pct/src/PCT/Node.pir +++ b/compilers/pct/src/PCT/Node.pir @@ -46,7 +46,7 @@ Other node attributes are generally defined by subclasses of C. =item init([child1, child2, ..., ] [attr1=>val1, attr2=>val2, ... ]) Initialize a node with the given children and attributes. -Adds each child to the node (using the C method, below) and +Adds each child to the node (using the C method, below) and calls the appropriate accessor method for each attribute. And returns the node. @@ -56,15 +56,13 @@ And returns the node. .param pmc children :slurpy .param pmc adverbs :slurpy :named - .local pmc it - it = iter children - children_loop: - unless it goto children_end - $P0 = shift it - push self, $P0 - goto children_loop + $I0 = elements children + unless $I0 goto children_end + $P0 = self.'list'() + $P0.'append'(children) children_end: + .local pmc it it = iter adverbs adverbs_loop: unless it goto adverbs_end @@ -74,7 +72,6 @@ And returns the node. self.$P1($P0) goto adverbs_loop adverbs_end: - end: .return (self) .end diff --git a/compilers/pge/PGE/Exp.pir b/compilers/pge/PGE/Exp.pir index 2af8b8622a..21bf62cc8a 100644 --- a/compilers/pge/PGE/Exp.pir +++ b/compilers/pge/PGE/Exp.pir @@ -1272,6 +1272,7 @@ tree as a PIR code object that can be compiled. dec rep goto %L_2 CODE + .return (1) .end diff --git a/config/auto/arch.pm b/config/auto/arch.pm index 3219444730..2a28df8af0 100644 --- a/config/auto/arch.pm +++ b/config/auto/arch.pm @@ -1,4 +1,4 @@ -# Copyright (C) 2001-2007, Parrot Foundation. +# Copyright (C) 2001-2011, Parrot Foundation. =head1 NAME @@ -79,6 +79,16 @@ sub runstep { $cpuarch = 'i386'; $osname = 'cygwin'; } + elsif ( $osname =~ /msys/i || $cpuarch =~ /msys/i ) { + # msys-perl is 32bit-only, so we use the information provided by + # the OS. Might be incorrect in case of mingw32 on 64bit hardware. + $cpuarch = lc ( + $ENV{PROCESSOR_ARCHITEW6432} || + $ENV{PROCESSOR_ARCHITECTURE} || + 'x86' + ); + $osname = 'msys'; + } elsif ( $cpuarch eq 'i86pc' and $osname eq 'solaris' ) { # That's only the perl value, and is the same for both i386 # and amd64. Use uname -p instead to find the processor type. @@ -93,6 +103,7 @@ sub runstep { $cpuarch =~ s/armv[34]l?/arm/i; $cpuarch =~ s/i[456]86/i386/i; $cpuarch =~ s/x86_64/amd64/i; + $cpuarch =~ s/x86/i386/i; $conf->data->set( cpuarch => $cpuarch, diff --git a/config/auto/backtrace/test_dlinfo_c.in b/config/auto/backtrace/test_dlinfo_c.in index ae52dff5f9..c5c0a854e8 100644 --- a/config/auto/backtrace/test_dlinfo_c.in +++ b/config/auto/backtrace/test_dlinfo_c.in @@ -1,7 +1,7 @@ /* Copyright (C) 2009, Parrot Foundation. -check that Dl_info is avaible +check that Dl_info is available */ #include diff --git a/config/auto/byteorder.pm b/config/auto/byteorder.pm index 42d8647fef..2e25d86d90 100644 --- a/config/auto/byteorder.pm +++ b/config/auto/byteorder.pm @@ -57,7 +57,7 @@ sub _evaluate_byteorder { ); $self->set_result('little-endian'); } - elsif ( $byteorder =~ /^(8765|4321)/ ) { + elsif ( $byteorder =~ /^(?:8765|4321)/ ) { $conf->data->set( byteorder => $byteorder, bigendian => 1 diff --git a/config/auto/gcc.pm b/config/auto/gcc.pm index 8e6d317470..088f742085 100644 --- a/config/auto/gcc.pm +++ b/config/auto/gcc.pm @@ -90,9 +90,13 @@ sub _evaluate_gcc { # sneaky check for g++ my $gpp = (index($conf->data->get('cc'), '++') > 0) ? 1 : 0; + # even sneakier check for clang + my $clang = $conf->data->get('cc') =~ /clang/ ? 1 : 0; + $conf->data->set( gccversion => $gccversion, 'g++' => $gpp, + clang => $clang ); return 1; } diff --git a/config/auto/headers.pm b/config/auto/headers.pm index 8f2338dbe0..54f0cfcc3e 100644 --- a/config/auto/headers.pm +++ b/config/auto/headers.pm @@ -101,7 +101,7 @@ sub _list_extra_headers { # more extra_headers needed on mingw/msys; *BSD fails if they are present if ( $conf->data->get('OSNAME_provisional') eq "msys" ) { - push @extra_headers, qw(sysmman.h netdb.h); + push @extra_headers, qw(sysmman.h netdb.h sys/utsname.h); } if ( $conf->data->get('OSNAME_provisional') eq "MSWin32" ) { @@ -110,7 +110,7 @@ sub _list_extra_headers { # annotation language (SAL), introduced with Visual C++ 8.0. See # , # . - push @extra_headers, qw(sal.h); + push @extra_headers, qw(sal.h process.h); } return @extra_headers; diff --git a/config/auto/icu.pm b/config/auto/icu.pm index f78ec8681a..91ee6c6def 100644 --- a/config/auto/icu.pm +++ b/config/auto/icu.pm @@ -387,15 +387,11 @@ sub _handle_ccflags_status { } else { my $icuheaders = $arg->{icuheaders}; + my $incflag = defined $conf->data->get('gccversion') + ? '-isystem' + : '-I'; - my $icuflags; - if ($icuheaders =~ /\s/) { - $icuflags = "-I \"$arg->{icuheaders}\""; - } - else { - $icuflags = "-I $arg->{icuheaders}"; - } - + my $icuflags = qq{$incflag "$icuheaders"}; $conf->debug( "Adding $icuflags to ccflags for icu headers.\n"); $conf->data->add( ' ', ccflags => $icuflags ); } diff --git a/config/auto/pmc.pm b/config/auto/pmc.pm index 699e115a1b..93f497c4f7 100644 --- a/config/auto/pmc.pm +++ b/config/auto/pmc.pm @@ -391,14 +391,6 @@ include/parrot/oo.h include/parrot/feature.h include/parrot/oplib.h include/parrot/library.h -include/parrot/thread.h -include/parrot/thr_pthread.h -include/parrot/thr_windows.h -include/parrot/atomic.h -include/parrot/atomic/fallback.h -include/parrot/atomic/gcc_pcc.h -include/parrot/atomic/gcc_x86.h -include/parrot/atomic/sparc.h include/parrot/string.h include/parrot/settings.h include/parrot/namespace.h diff --git a/config/auto/warnings.pm b/config/auto/warnings.pm index 6920ecaabe..5a01ebafcd 100644 --- a/config/auto/warnings.pm +++ b/config/auto/warnings.pm @@ -98,7 +98,7 @@ sub _init { my $gpp = {}; my $icc = {}; - my @gcc_or_gpp = qw( + my @gcc_or_gpp_basic = qw( -falign-functions=16 -funit-at-a-time -fexcess-precision=standard @@ -127,7 +127,8 @@ sub _init { -Winvalid-pch -Wjump-misses-init -Wlogical-op - -Wmissing-braces + -Werror=missing-braces + -Wmissing-declarations -Wmissing-field-initializers -Wno-missing-format-attribute -Wmissing-include-dirs @@ -144,7 +145,7 @@ sub _init { -Wswitch -Wswitch-default -Wtrigraphs - -Wundef + -Werror=undef -Wno-unused -Wunknown-pragmas -Wvariadic-macros @@ -152,28 +153,23 @@ sub _init { -Wstack-usage=500 ); - $gcc->{'basic'} = [ @gcc_or_gpp ]; - $gpp->{'basic'} = [ @gcc_or_gpp ]; - - # Add some gcc-only warnings that would break g++ - push @{$gcc->{'basic'}}, qw( + # gcc-only warnings that would break g++ + my @gcc_basic = qw( -Wc++-compat - -Wdeclaration-after-statement -Werror=declaration-after-statement - -Wimplicit-function-declaration - -Wimplicit-int - -Wmain - -Wmissing-declarations + -Werror=implicit-function-declaration -Wmissing-prototypes - -Wnested-externs - -Wnonnull - -Wold-style-definition - -Wstrict-prototypes + -Werror=nested-externs + -Werror=old-style-definition + -Werror=strict-prototypes ); - my $gcc_or_gpp_cage = [ qw( + $gcc->{'basic'} = [ @gcc_or_gpp_basic, @gcc_basic ]; + $gpp->{'basic'} = [ @gcc_or_gpp_basic ]; + + my @gcc_or_gpp_cage = qw( -std=c89 - -Werror=implicit-function-declaration + -Wfloat-equal -Wformat=2 -Wlarger-than-4096 -Wlong-long @@ -181,19 +177,32 @@ sub _init { -Wdeprecated-declarations -Wno-format-extra-args -Wno-import + -Wredundant-decls + -Wshadow + -Wstrict-overflow=5 -Wsuggest-attribute=const -Wsuggest-attribute=noreturn -Wsuggest-attribute=pure + -Wtrampolines -Wunreachable-code + -Wunsafe-loop-optimizations -Wunused -Wunused-function -Wunused-label -Wunused-value -Wunused-variable - ) ]; + -Wvolatile-register-var + ); - $gcc->{'cage'} = $gcc_or_gpp_cage; - $gpp->{'cage'} = $gcc_or_gpp_cage; + my @gpp_cage = qw( + -Weffc++ + -Wstrict-null-sentinel + -Wtraditional + -Wuseless-cast + ); + + $gcc->{'cage'} = [ @gcc_or_gpp_cage ]; + $gpp->{'cage'} = [ @gcc_or_gpp_cage, @gpp_cage ]; $gcc->{'todo'} = $gpp->{'todo'} = { '-Wformat-nonliteral' => [ qw( @@ -279,14 +288,12 @@ sub runstep { my $compiler = ''; if ( defined $conf->data->get('gccversion') ) { - $compiler = $conf->data->get('g++') ? 'g++' : 'gcc'; + $compiler = $conf->data->get('g++') ? 'g++' : + $conf->data->get('clang') ? 'clang' : 'gcc'; } elsif ( $conf->option_or_data('cc') =~ /icc/ ) { $compiler = 'icc'; } - elsif ( $conf->option_or_data('cc') =~ /clang/ ) { - $compiler = 'clang'; - } if ($compiler eq '') { $conf->debug("We do not (yet) probe for warnings for your compiler\n"); diff --git a/config/gen/config_pm.pm b/config/gen/config_pm.pm index 604ef0d5ba..9f1b2ae2fd 100644 --- a/config/gen/config_pm.pm +++ b/config/gen/config_pm.pm @@ -1,4 +1,4 @@ -# Copyright (C) 2001-2010, Parrot Foundation. +# Copyright (C) 2001-2011, Parrot Foundation. =head1 NAME @@ -16,7 +16,7 @@ package gen::config_pm; use strict; use warnings; - +use Data::Dumper;$Data::Dumper::Indent=1; use base qw(Parrot::Configure::Step); use Parrot::Configure::Utils ':gen'; @@ -67,12 +67,33 @@ sub runstep { # add some keys convenient for embedders $conf->data->add( ' ', 'embed-cflags' => '-I' . $conf->data->get('includedir') . $conf->data->get('versiondir') ); - $conf->data->add( ' ', 'embed-ldflags' => - '-L' . $conf->data->get('libdir') . ' -lparrot ' . $conf->data->get('icu_shared') . - ' ' . $conf->data->get('libs') ); + my $embed_ldflags_str = join(' ' => ( + '-L' . $conf->data->get('libdir'), + '-lparrot', + $conf->data->get('icu_shared'), + $conf->data->get('libs'), + ) ); + $embed_ldflags_str =~ s/\s+/ /g; + $embed_ldflags_str =~ s/\s+$//g; + # Eliminate duplicate entries + my @embeds = split / /, $embed_ldflags_str; + my %embeds_seen = (); + my @deduped = (); + for my $em (@embeds) { + if (! $embeds_seen{$em}) { + push @deduped, $em; + $embeds_seen{$em}++; + } + } + $conf->data->add( ' ', 'embed-ldflags' => join(' ' => @deduped) ); - # escape spaces in current directory my $cwd = cwd(); + + # expand msys virtual paths + $cwd = `cd '$cwd' && pwd -W`, chomp $cwd + if $conf->data->get('osname') eq 'msys'; + + # escape spaces in current directory $cwd =~ s{ }{\\ }g; # Build directory can have non ascii characters diff --git a/config/gen/config_pm/config_pir.in b/config/gen/config_pm/config_pir.in index 65ecc1a1e9..eb3e6cf93a 100644 --- a/config/gen/config_pm/config_pir.in +++ b/config/gen/config_pm/config_pir.in @@ -42,6 +42,7 @@ undefined values) is undefined, and may be rather funky. .sub _config .local string prefix, conf_file + .local pmc ex prefix = interpinfo .INTERPINFO_RUNTIME_PREFIX $S0 = concat prefix, "/runtime" @@ -58,6 +59,8 @@ undefined values) is undefined, and may be rather funky. $P0.'stat'($S0) goto L1 file_not_found: + .get_results (ex) + finalize ex # Treat it as installed parrot. conf_file = "@libdir@@versiondir@/include/config.fpmc" goto L2 @@ -85,7 +88,6 @@ undefined values) is undefined, and may be rather funky. .return( conf_hash ) error: - .local pmc ex .get_results (ex) $S0 = "Can't read '" $S0 .= conf_file diff --git a/config/gen/makefiles.pm b/config/gen/makefiles.pm index c6c959cfd5..355b74557c 100644 --- a/config/gen/makefiles.pm +++ b/config/gen/makefiles.pm @@ -29,9 +29,6 @@ sub _init { 'Makefile' => { SOURCE => 'config/gen/makefiles/root.in', }, - 'ext/Makefile' => { - SOURCE => 'config/gen/makefiles/ext.in', - }, 'compilers/imcc/Rules.mak' => { SOURCE => 'compilers/imcc/Rules.in', }, @@ -42,11 +39,6 @@ sub _init { SOURCE => 'src/dynoplibs/Defines.in', }, - 'ext/Parrot-Embed/Makefile.PL' => { - SOURCE => 'config/gen/makefiles/parrot_embed_pl.in', - conditioned_lines => 1, - }, - 'src/dynpmc/Rules.mak' => { SOURCE => 'src/dynpmc/Rules.in', }, diff --git a/config/gen/makefiles/docs.in b/config/gen/makefiles/docs.in index dfb2729233..6bd9efda96 100644 --- a/config/gen/makefiles/docs.in +++ b/config/gen/makefiles/docs.in @@ -37,7 +37,7 @@ help : clean: htmlhelp-clean html-clean html: - $(PERL) -I../lib ../tools/docs/make_html_docs.pl --version=$(VERSION) + $(PERL) -I../lib ../tools/docs/mk_html_docs.pl --version=$(VERSION) html-clean: $(RM_RF) html diff --git a/config/gen/makefiles/ext.in b/config/gen/makefiles/ext.in deleted file mode 100644 index e52c998e8a..0000000000 --- a/config/gen/makefiles/ext.in +++ /dev/null @@ -1,67 +0,0 @@ -# Copyright (C) 2006-2009, Parrot Foundation. - -# setup of commands -@make_set_make@ -MAKE = @make@ -PERL = @perl@ -RM_F = @rm_f@ - -# add new languages here -# remove obsolete languages here -EXT = \ - Parrot-Embed - -# the default target -all: $(EXT) - -# hard-code these for now -test: Parrot-Embed - - cd Parrot-Embed && $(MAKE) test - - -# 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: Make a lot of language implementations." - @echo " This is the default." - @echo " test: Unified test suite for a lot of languages." - @echo "" - @echo " clean: Clean up a lot of languages." - @echo "" - @echo " help: Print this help message." - @echo "" - @echo "Following languages are available:" - @echo " $(LANGUAGES)" - @echo "A particular language can be built, tested and cleand up" - @echo " make " - @echo " make .test" - @echo " make .clean" - @echo "For the status of individual languages see:" - @echo " https://trac.parrot.org/parrot/wiki/Languages" - @echo "" - -clean: \ - Parrot-Embed.clean - -# -# Extension specific targets -# - -# The *.dummy targets are a replacement for the target .PHONY in 'GNU make' - -Parrot-Embed : Parrot-Embed.dummy - -Parrot-Embed.dummy: -#IF(win32): - cd Parrot-Embed && $(PERL) Makefile.PL && nmake -#UNLESS(win32): - cd Parrot-Embed && $(PERL) Makefile.PL && $(MAKE) - -Parrot-Embed.clean: -#IF(win32): - cd Parrot-Embed && nmake clean -#UNLESS(win32): - cd Parrot-Embed && $(MAKE) clean - -# Local variables: -# mode: makefile -# End: -# vim: ft=make: diff --git a/config/gen/makefiles/root.in b/config/gen/makefiles/root.in index 2914aa6b96..7d89f8beba 100644 --- a/config/gen/makefiles/root.in +++ b/config/gen/makefiles/root.in @@ -1,4 +1,4 @@ -# Copyright (C) 2001-2011, Parrot Foundation. +# Copyright (C) 2001-2012, Parrot Foundation. ############################################################################### # @@ -7,6 +7,9 @@ # This makefile makes use of specific .dummy targets (rather than .PHONY # or .VIRTUAL targets) in an effort to work with various flavors of make. # +# When revising this makefile template, please make sure to have changes +# tested with both 'make' and 'make -jN' (where N > 1) on multi-core machines. +# ############################################################################### ############################################################################### @@ -52,17 +55,24 @@ BUILD_DIR = @build_dir@ # programs, templates, configuration files invoked by 'make all' # (with or without command-line options) BUILD_TOOLS_DIR = tools/build -# directory for developers' tools +# directories for developers' tools # programs, templates, configuration files NOT invoked by 'make all' DEV_TOOLS_DIR = tools/dev RELEASE_TOOLS_DIR = tools/release -# directory for header files +# directories for header files INC_DIR = include/parrot +INC_PMC_DIR = include/pmc +RUN_INC_DIR = runtime/parrot/include -# directory with Parrot modules +# directories with Parrot modules LIBRARY_DIR = runtime/parrot/library +# directories for frontend +FR_DIR = frontend +FRP_DIR = $(FR_DIR)/parrot +FRPTWO_DIR = $(FR_DIR)/parrot2 + ############################################################################### # # BUILD TOOL CONFIGURATIONS: @@ -81,6 +91,7 @@ MKPATH = @mkpath@ RM_F = @rm_f@ RM_RF = @rm_rf@ TOUCH = @touch@ +TAR = @tar@ AR_CR = @ar@ @arflags@ RANLIB = @ranlib@ YACC = @yacc@ @@ -149,7 +160,6 @@ GEN_MAKEFILES = \ Makefile \ docs/Makefile \ editor/Makefile \ - ext/Makefile \ src/dynoplibs/Rules.mak \ src/dynoplibs/Defines.mak \ src/dynpmc/Rules.mak \ @@ -165,7 +175,7 @@ GEN_CONFIGS = \ src/exec_dep.h \ lib/Parrot/Config/Generated.pm \ lib/Parrot/PMC.pm \ - runtime/parrot/include/config.fpmc \ + $(RUN_INC_DIR)/config.fpmc \ $(LIBRARY_DIR)/config.pir \ #IF(has_opengl): src/glut_nci_thunks.nci \ #IF(has_glut): src/glut_callbacks.c \ @@ -175,36 +185,36 @@ GEN_CONFIGS = \ compilers/imcc/imcc.l.flag GEN_PASM_INCLUDES = \ - runtime/parrot/include/cclass.pasm \ - runtime/parrot/include/datatypes.pasm \ - runtime/parrot/include/iterator.pasm \ - runtime/parrot/include/call_bits.pasm \ - runtime/parrot/include/timer.pasm \ - runtime/parrot/include/except_types.pasm \ - runtime/parrot/include/except_severity.pasm \ - runtime/parrot/include/hash_key_type.pasm \ - runtime/parrot/include/interpflags.pasm \ - runtime/parrot/include/interpdebug.pasm \ - runtime/parrot/include/interptrace.pasm \ - runtime/parrot/include/interpcores.pasm \ - runtime/parrot/include/cloneflags.pasm \ - runtime/parrot/include/iglobals.pasm \ - runtime/parrot/include/sysinfo.pasm \ - runtime/parrot/include/stdio.pasm \ - runtime/parrot/include/socket.pasm \ - runtime/parrot/include/libpaths.pasm \ - runtime/parrot/include/dlopenflags.pasm \ - runtime/parrot/include/longopt.pasm \ - runtime/parrot/include/packfile_segments.pasm \ - runtime/parrot/include/packfile_annotation_key_type.pasm \ - runtime/parrot/include/stat.pasm \ - runtime/parrot/include/stringinfo.pasm \ - runtime/parrot/include/warnings.pasm \ - runtime/parrot/include/errors.pasm \ - runtime/parrot/include/interpinfo.pasm \ - runtime/parrot/include/tm.pasm \ - runtime/parrot/include/pmctypes.pasm \ - runtime/parrot/include/parrot_version.pir + $(RUN_INC_DIR)/cclass.pasm \ + $(RUN_INC_DIR)/datatypes.pasm \ + $(RUN_INC_DIR)/iterator.pasm \ + $(RUN_INC_DIR)/call_bits.pasm \ + $(RUN_INC_DIR)/timer.pasm \ + $(RUN_INC_DIR)/except_types.pasm \ + $(RUN_INC_DIR)/except_severity.pasm \ + $(RUN_INC_DIR)/hash_key_type.pasm \ + $(RUN_INC_DIR)/interpflags.pasm \ + $(RUN_INC_DIR)/interpdebug.pasm \ + $(RUN_INC_DIR)/interptrace.pasm \ + $(RUN_INC_DIR)/interpcores.pasm \ + $(RUN_INC_DIR)/cloneflags.pasm \ + $(RUN_INC_DIR)/iglobals.pasm \ + $(RUN_INC_DIR)/sysinfo.pasm \ + $(RUN_INC_DIR)/stdio.pasm \ + $(RUN_INC_DIR)/socket.pasm \ + $(RUN_INC_DIR)/libpaths.pasm \ + $(RUN_INC_DIR)/dlopenflags.pasm \ + $(RUN_INC_DIR)/longopt.pasm \ + $(RUN_INC_DIR)/packfile_segments.pasm \ + $(RUN_INC_DIR)/packfile_annotation_key_type.pasm \ + $(RUN_INC_DIR)/stat.pasm \ + $(RUN_INC_DIR)/stringinfo.pasm \ + $(RUN_INC_DIR)/warnings.pasm \ + $(RUN_INC_DIR)/errors.pasm \ + $(RUN_INC_DIR)/interpinfo.pasm \ + $(RUN_INC_DIR)/tm.pasm \ + $(RUN_INC_DIR)/pmctypes.pasm \ + $(RUN_INC_DIR)/parrot_version.pir GEN_PM_INCLUDES = \ lib/Parrot/Pmc2c/PCCMETHOD_BITS.pm @@ -212,16 +222,15 @@ GEN_PM_INCLUDES = \ CONFIGURE_GENERATED_FILES = \ $(GEN_CONFIGS) \ $(GEN_MAKEFILES) \ - ext/Parrot-Embed/Makefile.PL \ myconfig \ MANIFEST.configure.generated \ .configure_trace.sto \ .parrot_current_rev \ .parrot_current_sha1 \ .parrot_current_git_describe \ -#IF(has_opengl): runtime/parrot/include/opengl_defines.pasm \ -#IF(has_opengl): runtime/parrot/library/OpenGL_funcs.pir \ - runtime/parrot/include/signal.pasm \ +#IF(has_opengl): $(RUN_INC_DIR)/opengl_defines.pasm \ +#IF(has_opengl): $(LIBRARY_DIR)/OpenGL_funcs.pir \ + $(RUN_INC_DIR)/signal.pasm \ tools/dev/mk_language_shell.pl @@ -344,8 +353,8 @@ FLUID_FILES_2 = \ $(LIBRARY_DIR)/ProfTest/Matcher.pbc \ $(LIBRARY_DIR)/ProfTest/Want.pbc \ $(LIBRARY_DIR)/YAML/Tiny.pbc \ - runtime/parrot/include/parrotlib.pbc - + $(RUN_INC_DIR)/parrotlib.pbc \ + $(FRPTWO_DIR)/prt0.pbc* ############################################################################### # @@ -353,6 +362,10 @@ FLUID_FILES_2 = \ # ############################################################################### +EXTEND_HEADERS = \ + $(INC_DIR)/extend.h \ + $(INC_DIR)/extend_vtable.h + # parrot.h and all the includes it causes to be included PARROT_H_HEADERS = \ $(INC_DIR)/parrot.h \ @@ -370,6 +383,7 @@ PARROT_H_HEADERS = \ $(INC_DIR)/pmc_freeze.h \ $(INC_DIR)/vtable.h \ $(INC_DIR)/context.h \ + $(INC_DIR)/disassemble.h \ $(INC_DIR)/exceptions.h \ $(INC_DIR)/warnings.h \ $(INC_DIR)/memory.h \ @@ -385,14 +399,6 @@ PARROT_H_HEADERS = \ $(INC_DIR)/key.h \ $(INC_DIR)/exit.h \ $(INC_DIR)/nci.h \ - $(INC_DIR)/thread.h \ - $(INC_DIR)/thr_pthread.h \ - $(INC_DIR)/thr_windows.h \ - $(INC_DIR)/atomic.h \ - $(INC_DIR)/atomic/fallback.h \ - $(INC_DIR)/atomic/gcc_pcc.h \ - $(INC_DIR)/atomic/gcc_x86.h \ - $(INC_DIR)/atomic/sparc.h \ $(INC_DIR)/scheduler.h \ $(INC_DIR)/oo.h \ $(INC_DIR)/vtables.h \ @@ -410,7 +416,7 @@ PARROT_H_HEADERS = \ $(INC_DIR)/core_pmcs.h \ $(INC_DIR)/compiler.h \ $(INC_DIR)/cclass.h \ - include/pmc/pmc_callcontext.h + $(INC_PMC_DIR)/pmc_callcontext.h CLASS_PMC_FILES = @TEMP_pmc_classes_pmc@ CLASS_O_FILES = @TEMP_pmc_classes_o@ @@ -438,12 +444,11 @@ IO_O_FILES = \ INTERP_O_FILES = \ src/string/api$(O) \ src/ops/core_ops$(O) \ -#IF(i386_has_gcc_cmpxchg): src/atomic/gcc_x86$(O) \ src/core_pmcs$(O) \ src/datatypes$(O) \ src/debug$(O) \ + src/disassemble$(O) \ src/dynext$(O) \ - src/embed$(O) \ src/embed/api$(O) \ src/embed/bytecode$(O) \ src/embed/strings$(O) \ @@ -453,6 +458,7 @@ INTERP_O_FILES = \ src/exit$(O) \ src/extend$(O) \ src/extend_vtable$(O) \ + src/alarm$(O) \ src/gc/alloc_memory$(O) \ src/gc/alloc_resources$(O) \ src/gc/api$(O) \ @@ -471,8 +477,7 @@ INTERP_O_FILES = \ src/call/pcc$(O) \ src/call/args$(O) \ src/interp/inter_cb$(O) \ - src/interp/inter_create$(O) \ - src/interp/inter_misc$(O) \ + src/interp/api$(O) \ src/call/ops$(O) \ src/call/context$(O) \ src/call/context_accessors$(O) \ @@ -494,11 +499,12 @@ INTERP_O_FILES = \ src/runcore/main$(O) \ src/runcore/cores$(O) \ src/runcore/profiling$(O) \ + src/runcore/subprof$(O) \ src/scheduler$(O) \ + src/events$(O) \ src/spf_render$(O) \ src/spf_vtable$(O) \ src/sub$(O) \ - src/thread$(O) \ src/runcore/trace$(O) \ src/utils$(O) \ src/vtables$(O) \ @@ -509,7 +515,6 @@ INTERP_O_FILES = \ src/packfile/segments$(O) \ src/longopt$(O) \ @TEMP_platform_o@ \ - @TEMP_atomic_o@ \ OPS_FILES = @ops@ @@ -521,6 +526,7 @@ OPS_FILES = @ops@ # Executables PARROT = .@slash@@test_prog@$(EXE) +PARROTOLD = .@slash@parrot_old$(EXE) MINIPARROT = .@slash@miniparrot$(EXE) DIS = .@slash@pbc_disassemble$(EXE) PDUMP = .@slash@pbc_dump$(EXE) @@ -530,7 +536,7 @@ PBC_TO_EXE = .@slash@pbc_to_exe$(EXE) PARROT_CONFIG = .@slash@parrot_config$(EXE) NQP_RX = .@slash@parrot-nqp$(EXE) NCI_THUNK_GEN = .@slash@parrot_nci_thunk_gen$(EXE) -PROVE = .@slash@parrot-prove$(EXE) +PARROT_PROVE = .@slash@parrot-prove$(EXE) OPS2C = .@slash@ops2c$(EXE) WINXED = .@slash@winxed$(EXE) @@ -543,15 +549,15 @@ INSTALLABLEPBCTOEXE = .@slash@installable_pbc_to_exe$(EXE) INSTALLABLEPDB = .@slash@installable_parrot_debugger$(EXE) INSTALLABLECONFIG = .@slash@installable_parrot_config$(EXE) INSTALLABLENQP = .@slash@installable_parrot-nqp$(EXE) -INSTALLABLENCITHUNKGEN = .@slash@installable_parrot_nci_thunk_gen$(EXE) -INSTALLABLEPROVE = .@slash@installable_parrot-prove$(EXE) +INSTALLABLENCITHUNKGEN = .@slash@installable_parrot_nci_thunk_gen$(EXE) +INSTALLABLEPARROT_PROVE = .@slash@installable_parrot-prove$(EXE) INSTALLABLEOPS2C = .@slash@installable_ops2c$(EXE) INSTALLABLEWINXED = .@slash@installable_winxed$(EXE) # Libraries LIBPARROT_STATIC = @blib_dir@/@libparrot_static@ #IF(darwin):export DYLD_LIBRARY_PATH := @build_dir@/@blib_dir@:$(DYLD_LIBRARY_PATH) -#IF(win32):LIBPARROT_SHARED = @libparrot_shared@ +#IF(win32 or msys or cygwin):LIBPARROT_SHARED = @libparrot_shared@ #ELSE:LIBPARROT_SHARED = @blib_dir@/@libparrot_shared@ # This line controls whether a static or shared library is built @@ -635,13 +641,13 @@ all : \ $(GEN_LIBRARY) \ src/install_config$(O) -# We build DYNPMC_TARGET in corevm. It's kinda hack to test t/pmc/threads.t CLONE_LIBRARIES corevm : \ $(GEN_PM_INCLUDES) \ PARROT_LIBS \ $(PARROT) \ - runtime/parrot/include/parrotlib.pbc \ - runtime/parrot/include/config.fpmc \ + $(PARROTOLD) \ + $(RUN_INC_DIR)/parrotlib.pbc \ + $(RUN_INC_DIR)/config.fpmc \ #IF(has_dynamic_linking): $(DYNPMC_TARGETS) \ $(LIBRARY_DIR)/Test/More.pbc @@ -687,8 +693,7 @@ STR_FILES = \ src/call/pcc.str \ src/call/args.str \ src/interp/inter_cb.str \ - src/interp/inter_create.str \ - src/interp/inter_misc.str \ + src/interp/api.str \ src/io/api.str \ src/key.str \ src/library.str \ @@ -707,13 +712,14 @@ STR_FILES = \ src/runcore/cores.str \ src/runcore/main.str \ src/runcore/profiling.str \ + src/runcore/subprof.str \ src/scheduler.str \ + src/events.str \ src/spf_render.str \ src/spf_vtable.str \ src/string/api.str \ src/string/encoding.str \ src/sub.str \ - src/embed.str \ $(CLASS_STR_FILES) src/string/private_cstring.h : $(STR_FILES) $(BUILD_TOOLS_DIR)/c2str.pl @@ -757,7 +763,7 @@ help : @echo " installable: same as 'world', but targets for installation" @echo "" @echo "Installation:" - @echo " install: Install under '$(PREFIX)' on Unix systems." + @echo " install: Install under '$(PREFIX)'." @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." @@ -774,9 +780,11 @@ help : @echo " coretest: Run the minimal 'core functionality' suite." @echo " codetest: Run file metadata and coding standards tests." @echo " fulltest: Run the full test suite under many runcores." + @echo " all_hll_test: Run the test suite for all known languages and libraries." @echo " test: Run the test suite with a specified runcore." @echo " Valid runcores are b, f, g, j, r." - @echo " src_tests: Run test in C-file." + @echo " src_tests: Run tests in C files." + @echo " interop_tests: Run HLL interop tests." @echo " run_tests: Command line and various environments." @echo " perl_tests: Test the Perl modules in the distribution." @echo " codingstd_tests: Test pdd07_codingstd." @@ -792,7 +800,9 @@ help : @echo "Smoke Testing:" @echo " smolder_test: Run the test suite and send report to the smolder server" @echo " smolder_coretest: Run the minimal 'core functionality' suite and send report to the smolder server." + @echo " smolder_fulltest: Run 'make fulltest' and send report to the smolder server" @echo " smoke: Alias for smolder_test." + @echo " resubmit_smolder: Resubmit a smoke test if transmission failed." @echo "" @echo "Benchmarks:" @echo " mopsbench: Million operations" @@ -801,20 +811,20 @@ help : @echo " clean: Basic cleaning up." @echo " archclean: Remove any platform dependent files." @echo " realclean: Removes also files generated by 'Configure.pl'" - @echo " distclean: Alias for realclean." - @echo " reconfig: 'clean' and redo configuration." + @echo " distclean: Alias for 'realclean'." + @echo " reconfig: Run 'realclean' and redo configuration." @echo "" @echo "Fetch from source repository:" @echo " update: git pull." @echo " status: git status." - @echo " patch: Create a patch to attach to https://trac.parrot.org/" + @echo " patch: Create a patch to attach to https://github.com/parrot/parrot/issues" @echo "" @echo "Development:" @echo " lint: An alias for sunlint." @echo " bsdlint: Code checking with bsdlint." @echo " sunlint: Code checking with Sun Studio's sunlint." @echo " splint: Code checking with splint." - @echo " headerizer: Recreate header files for C-source files" + @echo " headerizer: Rebuild function declarations in .h files and static declarations in .c files." @echo " apilist: Show list of PARROT_API functions" @echo " exportlist: Show list of PARROT_EXPORT functions" @echo " malloclist: Show list of PARROT_MALLOC functions" @@ -825,7 +835,8 @@ help : @echo " perlcritic: Check Perl code with Perl::Critic." @echo " cagecritic: Extra strict checking with Perl::Critic." @echo " bootstrap-ops: Generate C code from .ops files. Requires already built parrot." - @echo " bootstrap-nci Generate C code for NCI. Requires already built parrot." + @echo " bootstrap-nci: Generate C code for NCI. Requires already built parrot." + @echo " bootstrap-prt0: Generate prt0.pir. Requires already built parrot." @echo "" @echo "Release:" @echo " release: Create a tarball." @@ -838,35 +849,62 @@ help : world : parrot_utils -parrot_utils : all $(PDUMP) $(DIS) $(PDB) $(PBC_MERGE) $(PBC_TO_EXE) $(PARROT_CONFIG) src/install_config$(O) $(PROVE) $(OPS2C) +parrot_utils : all $(PDUMP) $(DIS) $(PDB) $(PBC_MERGE) $(PBC_TO_EXE) $(PARROT_CONFIG) src/install_config$(O) $(PARROT_PROVE) $(OPS2C) -installable: all $(INSTALLABLEPARROT) $(INSTALLABLEPDUMP) $(INSTALLABLEDIS) $(INSTALLABLEPDB) $(INSTALLABLEPBC_MERGE) $(INSTALLABLEPBCTOEXE) $(INSTALLABLECONFIG) $(INSTALLABLENQP) $(INSTALLABLENCITHUNKGEN) $(INSTALLABLEPROVE) $(INSTALLABLEOPS2C) $(INSTALLABLEWINXED) +installable: all $(INSTALLABLEPARROT) $(INSTALLABLEPDUMP) $(INSTALLABLEDIS) $(INSTALLABLEPDB) $(INSTALLABLEPBC_MERGE) $(INSTALLABLEPBCTOEXE) $(INSTALLABLECONFIG) $(INSTALLABLENQP) $(INSTALLABLENCITHUNKGEN) $(INSTALLABLEPARROT_PROVE) $(INSTALLABLEOPS2C) $(INSTALLABLEWINXED) bootstrap-ops : $(OPS2C) $(OPS2C) --core --quiet $(MAKE_C) . -runtime/parrot/include/parrotlib.pbc: runtime/parrot/library/parrotlib.pir $(PARROT) $(GEN_PASM_INCLUDES) - $(PARROT) -o $@ runtime/parrot/library/parrotlib.pir +$(RUN_INC_DIR)/parrotlib.pbc: $(LIBRARY_DIR)/parrotlib.pir $(PARROT) $(GEN_PASM_INCLUDES) + $(PARROT) -o $@ $(LIBRARY_DIR)/parrotlib.pir -runtime/parrot/include/parrot_version.pir: - $(PERL) tools/build/gen_version.pl >runtime/parrot/include/parrot_version.pir +$(RUN_INC_DIR)/parrot_version.pir: + $(PERL) tools/build/gen_version.pl >$(RUN_INC_DIR)/parrot_version.pir -runtime/parrot/include/config.fpmc : myconfig config_lib.pir \ - runtime/parrot/include/datatypes.pasm $(MINIPARROT) +$(RUN_INC_DIR)/config.fpmc : myconfig config_lib.pir \ + $(RUN_INC_DIR)/datatypes.pasm $(MINIPARROT) # always rebuid parrot_version.pir when building config.fpmc - $(PERL) tools/build/gen_version.pl >runtime/parrot/include/parrot_version.pir - $(MINIPARROT) -Iruntime/parrot/include config_lib.pir > $@ + $(PERL) tools/build/gen_version.pl >$(RUN_INC_DIR)/parrot_version.pir + $(MINIPARROT) -I$(RUN_INC_DIR) config_lib.pir > $@ + +$(FRPTWO_DIR)/prt0.pbc : $(FRPTWO_DIR)/prt0.pir $(MINIPARROT) + $(MINIPARROT) -I$(RUN_INC_DIR) -o $(FRPTWO_DIR)/prt0.pbc $(FRPTWO_DIR)/prt0.pir + +$(FRPTWO_DIR)/prt0.pbc.c : $(FRPTWO_DIR)/prt0.pbc $(FRPTWO_DIR)/build.pir $(MINIPARROT) + $(MINIPARROT) $(FRPTWO_DIR)/build.pir $(FRPTWO_DIR)/prt0.pbc + + +$(FRPTWO_DIR)/prt0.pbc$(O) : $(FRPTWO_DIR)/prt0.pbc.c \ + $(INC_DIR)/feature.h \ + $(INC_DIR)/core_types.h \ + $(INC_DIR)/compiler.h \ + $(INC_DIR)/has_header.h \ + $(INC_DIR)/api.h \ + $(INC_DIR)/config.h + +bootstrap-prt0: $(WINXED) $(FRPTWO_DIR)/prt0.winxed + $(WINXED) --noan -c $(FRPTWO_DIR)/prt0.winxed -$(PARROT) : frontend/parrot/main$(O) $(GEN_HEADERS) $(LIBPARROT) \ +$(PARROTOLD) : $(FRP_DIR)/main$(O) $(GEN_HEADERS) $(LIBPARROT) \ src/parrot_config$(O) src/longopt$(O) \ $(MINIPARROT) $(LINK) @ld_out@$@ \ - frontend/parrot/main$(O) src/parrot_config$(O) src/longopt$(O) \ + $(FRP_DIR)/main$(O) src/parrot_config$(O) src/longopt$(O) \ $(RPATH_BLIB) $(ALL_PARROT_LIBS) $(LINKFLAGS) $(LINK_DYNAMIC) #IF(win32): if exist $@.manifest mt.exe -nologo -manifest $@.manifest -outputresource:$@;1 -$(PBC_TO_EXE) : $(DEV_TOOLS_DIR)/pbc_to_exe.pir runtime/parrot/library/config.pir $(PARROT) $(DYNEXT_DIR)/os$(LOAD_EXT) $(DYNEXT_DIR)/file$(LOAD_EXT) +$(PARROT) : $(FRPTWO_DIR)/main$(O) $(GEN_HEADERS) $(LIBPARROT) \ + src/parrot_config$(O) src/longopt$(O) \ + $(MINIPARROT) $(FRPTWO_DIR)/prt0.pbc$(O) $(GEN_PASM_INCLUDES) + $(LINK) @ld_out@$@ \ + $(FRPTWO_DIR)/main$(O) $(FRPTWO_DIR)/prt0.pbc$(O) src/parrot_config$(O) src/longopt$(O) \ + $(RPATH_BLIB) $(ALL_PARROT_LIBS) $(LINKFLAGS) $(LINK_DYNAMIC) +#IF(win32): if exist $@.manifest mt.exe -nologo -manifest $@.manifest -outputresource:$@;1 + + +$(PBC_TO_EXE) : $(DEV_TOOLS_DIR)/pbc_to_exe.pir $(LIBRARY_DIR)/config.pir $(PARROT) $(DYNEXT_DIR)/os$(LOAD_EXT) $(DYNEXT_DIR)/file$(LOAD_EXT) $(PARROT) -o pbc_to_exe.pbc $(DEV_TOOLS_DIR)/pbc_to_exe.pir $(PARROT) pbc_to_exe.pbc pbc_to_exe.pbc @@ -875,8 +913,8 @@ parrot_nci_thunk_gen.pbc : \ $(DATA_JSON_LIB_PBCS) $(PARROT) \ $(DYNEXT_DIR)/bit_ops$(LOAD_EXT) \ $(LIBRARY_DIR)/pcre.pbc \ - runtime/parrot/include/hash_key_type.pasm \ - runtime/parrot/include/datatypes.pasm + $(RUN_INC_DIR)/hash_key_type.pasm \ + $(RUN_INC_DIR)/datatypes.pasm $(PARROT) -o parrot_nci_thunk_gen.pbc $(DEV_TOOLS_DIR)/nci_thunk_gen.pir $(NCI_THUNK_GEN) : parrot_nci_thunk_gen.pbc $(PBC_TO_EXE) @@ -885,33 +923,34 @@ $(NCI_THUNK_GEN) : parrot_nci_thunk_gen.pbc $(PBC_TO_EXE) parrot-prove.pbc : runtime/parrot/bin/prove.pir $(PARROT) $(PARROT) -o parrot-prove.pbc runtime/parrot/bin/prove.pir -$(PROVE) : parrot-prove.pbc $(PARROT) $(PBC_TO_EXE) +$(PARROT_PROVE) : parrot-prove.pbc $(PARROT) $(PBC_TO_EXE) $(PBC_TO_EXE) parrot-prove.pbc $(PARROT_CONFIG) : $(DEV_TOOLS_DIR)/parrot-config.pir $(PARROT) $(PBC_TO_EXE) $(PARROT) -o parrot_config.pbc $(DEV_TOOLS_DIR)/parrot-config.pir $(PARROT) pbc_to_exe.pbc parrot_config.pbc -$(MINIPARROT) : frontend/parrot/main$(O) include/parrot/api.h include/parrot/longopt.h $(LIBPARROT) \ +$(MINIPARROT) : $(FRP_DIR)/main$(O) $(INC_DIR)/api.h $(INC_DIR)/longopt.h $(LIBPARROT) \ src/null_config$(O) src/longopt$(O) - $(LINK) @ld_out@$@ frontend/parrot/main$(O) src/null_config$(O) src/longopt$(O) \ + $(LINK) @ld_out@$@ $(FRP_DIR)/main$(O) src/null_config$(O) src/longopt$(O) \ $(RPATH_BLIB) $(ALL_PARROT_LIBS) $(LINKFLAGS) #IF(win32): if exist $@.manifest mt.exe -nologo -manifest $@.manifest -outputresource:$@;1 -$(INSTALLABLEPARROT) : frontend/parrot/main$(O) $(GEN_HEADERS) $(LIBPARROT) \ +#IF(cygwin and optimize):$(INSTALLABLEPARROT) : LINK += -s +$(INSTALLABLEPARROT) : $(FRPTWO_DIR)/main$(O) $(GEN_HEADERS) $(LIBPARROT) \ src/install_config$(O) src/longopt$(O) \ - $(PARROT) + $(FRPTWO_DIR)/prt0.pbc$(O) $(PARROT) $(LINK) @ld_out@$@ \ - frontend/parrot/main$(O) src/install_config$(O) src/longopt$(O) \ - @rpath_lib@ $(ALL_PARROT_LIBS) $(LINKFLAGS) + $(FRPTWO_DIR)/main$(O) src/install_config$(O) src/longopt$(O) \ + $(FRPTWO_DIR)/prt0.pbc$(O) @rpath_lib@ $(ALL_PARROT_LIBS) $(LINKFLAGS) #IF(win32): if exist $@.manifest mt.exe -nologo -manifest $@.manifest -outputresource:$@;1 -$(INC_DIR)/context.h : include/pmc/pmc_callcontext.h +$(INC_DIR)/context.h : $(INC_PMC_DIR)/pmc_callcontext.h $(INC_DIR)/pbcversion.h : PBC_COMPAT $(PERL) $(BUILD_TOOLS_DIR)/pbcversion_h.pl > $(INC_DIR)/pbcversion.h -src/parrot_config.c : runtime/parrot/include/config.fpmc \ +src/parrot_config.c : $(RUN_INC_DIR)/config.fpmc \ $(BUILD_TOOLS_DIR)/parrot_config_c.pl $(PERL) $(BUILD_TOOLS_DIR)/parrot_config_c.pl > \ src/parrot_config.c @@ -966,30 +1005,45 @@ src/pointer_array$(O) : \ src/pointer_array.c \ $(INC_DIR)/pointer_array.h -src/oo$(O) : $(PARROT_H_HEADERS) include/pmc/pmc_class.h src/oo.c \ - include/pmc/pmc_object.h src/oo.str $(INC_DIR)/oo_private.h \ - include/pmc/pmc_namespace.h +src/oo$(O) : $(PARROT_H_HEADERS) $(INC_PMC_DIR)/pmc_class.h src/oo.c \ + $(INC_PMC_DIR)/pmc_object.h src/oo.str $(INC_DIR)/oo_private.h \ + $(INC_PMC_DIR)/pmc_namespace.h src/scheduler$(O) : \ $(PARROT_H_HEADERS) \ src/scheduler.str \ src/scheduler.c \ - include/pmc/pmc_scheduler.h \ - include/pmc/pmc_task.h \ - include/pmc/pmc_timer.h \ - $(INC_DIR)/extend.h \ - $(INC_DIR)/extend_vtable.h \ + $(INC_PMC_DIR)/pmc_scheduler.h \ + $(INC_PMC_DIR)/pmc_task.h \ + $(INC_PMC_DIR)/pmc_timer.h \ + $(EXTEND_HEADERS) \ $(INC_DIR)/scheduler_private.h \ + $(INC_DIR)/alarm.h \ + $(INC_PMC_DIR)/pmc_pmclist.h \ + $(INC_PMC_DIR)/pmc_alarm.h \ + $(INC_PMC_DIR)/pmc_continuation.h \ + $(INC_DIR)/runcore_api.h + +src/events$(O) : \ + $(PARROT_H_HEADERS) \ + $(INC_DIR)/events.h \ + src/events.c \ + src/events.str \ + $(INC_PMC_DIR)/pmc_arrayiterator.h \ + $(INC_PMC_DIR)/pmc_exception.h \ $(INC_DIR)/runcore_api.h +src/alarm$(O) : $(PARROT_H_HEADERS) src/alarm.c \ + $(INC_DIR)/alarm.h + src/io/core$(O) : $(PARROT_H_HEADERS) src/io/io_private.h src/io/core.c src/io/socket_api$(O) : \ $(PARROT_H_HEADERS) \ src/io/io_private.h \ src/io/api.str \ - include/pmc/pmc_socket.h \ - include/pmc/pmc_sockaddr.h \ + $(INC_PMC_DIR)/pmc_socket.h \ + $(INC_PMC_DIR)/pmc_sockaddr.h \ src/io/socket_api.c O_FILES = \ @@ -1025,6 +1079,7 @@ $(LIBPARROT_STATIC) : $(O_FILES) $(LIBPARROT_SHARED) : $(O_FILES) $(MKPATH) @blib_dir@ $(LD) $(LD_SHARE_FLAGS) $(LDFLAGS) @ld_out@$@ @libparrot_soname@ \ +#IF(cygwin and optimize): -s \ #IF(cygwin): -Wl,--out-implib=libparrot.dll.a \ #IF(win32 and cc==gcc): -Wl,--out-implib=libparrot.lib \ $(O_FILES) $(C_LIBS) $(ICU_SHARED) @@ -1044,29 +1099,29 @@ $(INSTALLABLEPBCTOEXE) : $(PBC_TO_EXE) src/install_config$(O) $(INSTALLABLENCITHUNKGEN) : parrot_nci_thunk_gen.pbc $(PBC_TO_EXE) src/install_config$(O) $(PBC_TO_EXE) parrot_nci_thunk_gen.pbc --install -$(INSTALLABLEPROVE) : parrot-prove.pbc $(PBC_TO_EXE) src/install_config$(O) +$(INSTALLABLEPARROT_PROVE) : parrot-prove.pbc $(PBC_TO_EXE) src/install_config$(O) $(PBC_TO_EXE) parrot-prove.pbc --install # # Parrot Debugger # -frontend/parrot_debugger/main$(O) : \ +$(FR_DIR)/parrot_debugger/main$(O) : \ $(PARROT_H_HEADERS) \ - frontend/parrot_debugger/main.c \ - $(INC_DIR)/runcore_api.h \ - $(INC_DIR)/embed.h + $(FR_DIR)/parrot_debugger/main.c \ + $(INC_DIR)/runcore_api.h -$(PDB) : frontend/parrot_debugger/main$(O) src/parrot_config$(O) $(LIBPARROT) +$(PDB) : $(FR_DIR)/parrot_debugger/main$(O) src/parrot_config$(O) $(LIBPARROT) $(LINK) @ld_out@$@ \ - frontend/parrot_debugger/main$(O) \ + $(FR_DIR)/parrot_debugger/main$(O) \ src/parrot_config$(O) \ $(RPATH_BLIB) $(ALL_PARROT_LIBS) $(LINKFLAGS) #IF(win32): if exist $@.manifest mt.exe -nologo -manifest $@.manifest -outputresource:$@;1 -$(INSTALLABLEPDB) : frontend/parrot_debugger/main$(O) $(LIBPARROT) src/parrot_config$(O) +#IF(cygwin and optimize):$(INSTALLABLEPDB) : LINK += -s +$(INSTALLABLEPDB) : $(FR_DIR)/parrot_debugger/main$(O) $(LIBPARROT) src/parrot_config$(O) $(LINK) @ld_out@$@ \ - frontend/parrot_debugger/main$(O) \ + $(FR_DIR)/parrot_debugger/main$(O) \ src/parrot_config$(O) \ @rpath_lib@ $(ALL_PARROT_LIBS) $(LINKFLAGS) #IF(win32): if exist $@.manifest mt.exe -nologo -manifest $@.manifest -outputresource:$@;1 @@ -1075,23 +1130,24 @@ $(INSTALLABLEPDB) : frontend/parrot_debugger/main$(O) $(LIBPARROT) src/parrot_co # Parrot Disassembler # -frontend/pbc_disassemble/main$(O) : \ +$(FR_DIR)/pbc_disassemble/main$(O) : \ $(PARROT_H_HEADERS) \ $(INC_DIR)/api.h \ $(INC_DIR)/longopt.h \ - frontend/pbc_disassemble/main.c + $(FR_DIR)/pbc_disassemble/main.c -$(DIS) : frontend/pbc_disassemble/main$(O) $(LIBPARROT) +$(DIS) : $(FR_DIR)/pbc_disassemble/main$(O) $(LIBPARROT) $(LINK) @ld_out@$@ \ - frontend/pbc_disassemble/main$(O) \ + $(FR_DIR)/pbc_disassemble/main$(O) \ src/longopt$(O) \ $(RPATH_BLIB) $(ALL_PARROT_LIBS) $(LINKFLAGS) #IF(win32): if exist $@.manifest mt.exe -nologo -manifest $@.manifest -outputresource:$@;1 -$(INSTALLABLEDIS) : frontend/pbc_disassemble/main$(O) \ +#IF(cygwin and optimize):$(INSTALLABLEDIS) : LINK += -s +$(INSTALLABLEDIS) : $(FR_DIR)/pbc_disassemble/main$(O) \ src/install_config$(O) $(LIBPARROT) $(LINK) @ld_out@$@ \ - frontend/pbc_disassemble/main$(O) \ + $(FR_DIR)/pbc_disassemble/main$(O) \ src/longopt$(O) \ @rpath_lib@ $(ALL_PARROT_LIBS) $(LINKFLAGS) #IF(win32): if exist $@.manifest mt.exe -nologo -manifest $@.manifest -outputresource:$@;1 @@ -1099,31 +1155,31 @@ $(INSTALLABLEDIS) : frontend/pbc_disassemble/main$(O) \ # # Parrot Dump # -frontend/pbc_dump/packdump$(O) : $(PARROT_H_HEADERS) include/pmc/pmc_sub.h \ - include/pmc/pmc_key.h frontend/pbc_dump/packdump.c +$(FR_DIR)/pbc_dump/packdump$(O) : $(PARROT_H_HEADERS) $(INC_PMC_DIR)/pmc_sub.h \ + $(INC_PMC_DIR)/pmc_key.h $(FR_DIR)/pbc_dump/packdump.c -$(PDUMP) : frontend/pbc_dump/main$(O) frontend/pbc_dump/packdump$(O) $(LIBPARROT) $(INC_DIR)/api.h +$(PDUMP) : $(FR_DIR)/pbc_dump/main$(O) $(FR_DIR)/pbc_dump/packdump$(O) $(LIBPARROT) $(INC_DIR)/api.h $(LINK) @ld_out@$@ \ - frontend/pbc_dump/main$(O) \ + $(FR_DIR)/pbc_dump/main$(O) \ src/longopt$(O) \ - frontend/pbc_dump/packdump$(O) $(RPATH_BLIB) $(ALL_PARROT_LIBS) $(LINKFLAGS) + $(FR_DIR)/pbc_dump/packdump$(O) $(RPATH_BLIB) $(ALL_PARROT_LIBS) $(LINKFLAGS) #IF(win32): if exist $@.manifest mt.exe -nologo -manifest $@.manifest -outputresource:$@;1 -frontend/pbc_dump/main$(O) : \ +$(FR_DIR)/pbc_dump/main$(O) : \ $(INC_DIR)/longopt.h \ $(INC_DIR)/api.h \ - $(INC_DIR)/embed.h \ $(INC_DIR)/oplib/ops.h \ $(INC_DIR)/oplib/core_ops.h \ $(PARROT_H_HEADERS) \ $(INC_DIR)/runcore_api.h \ - frontend/pbc_dump/main.c + $(FR_DIR)/pbc_dump/main.c -$(INSTALLABLEPDUMP) : frontend/pbc_dump/main$(O) frontend/pbc_dump/packdump$(O) \ +#IF(cygwin and optimize):$(INSTALLABLEPDUMP) : LINK += -s +$(INSTALLABLEPDUMP) : $(FR_DIR)/pbc_dump/main$(O) $(FR_DIR)/pbc_dump/packdump$(O) \ src/install_config$(O) $(LIBPARROT) $(LINK) @ld_out@$@ \ - frontend/pbc_dump/main$(O) \ - frontend/pbc_dump/packdump$(O) \ + $(FR_DIR)/pbc_dump/main$(O) \ + $(FR_DIR)/pbc_dump/packdump$(O) \ src/longopt$(O) \ @rpath_lib@ $(ALL_PARROT_LIBS) $(LINKFLAGS) #IF(win32): if exist $@.manifest mt.exe -nologo -manifest $@.manifest -outputresource:$@;1 @@ -1134,17 +1190,18 @@ $(INSTALLABLEPDUMP) : frontend/pbc_dump/main$(O) frontend/pbc_dump/packdump$(O) # Parrot Bytecode File Merger # -$(PBC_MERGE) : frontend/pbc_merge/main$(O) $(LIBPARROT) src/parrot_config$(O) +$(PBC_MERGE) : $(FR_DIR)/pbc_merge/main$(O) $(LIBPARROT) src/parrot_config$(O) $(LINK) @ld_out@$@ \ - frontend/pbc_merge/main$(O) \ + $(FR_DIR)/pbc_merge/main$(O) \ src/parrot_config$(O) \ src/longopt$(O) \ $(RPATH_BLIB) $(ALL_PARROT_LIBS) $(LINK_DYNAMIC) $(LINKFLAGS) #IF(win32): if exist $@.manifest mt.exe -nologo -manifest $@.manifest -outputresource:$@;1 -$(INSTALLABLEPBC_MERGE) : frontend/pbc_merge/main$(O) $(LIBPARROT) $(INSTALLABLECONFIG) +#IF(cygwin and optimize):$(INSTALLABLEPBC_MERGE) : LINK += -s +$(INSTALLABLEPBC_MERGE) : $(FR_DIR)/pbc_merge/main$(O) $(LIBPARROT) $(INSTALLABLECONFIG) $(LINK) @ld_out@$@ \ - frontend/pbc_merge/main$(O) \ + $(FR_DIR)/pbc_merge/main$(O) \ src/install_config$(O) \ src/longopt$(O) \ @rpath_lib@ $(ALL_PARROT_LIBS) $(LINKFLAGS) @@ -1206,82 +1263,82 @@ $(LIBRARY_DIR)/YAML/Tiny.pbc: $(LIBRARY_DIR)/YAML/Tiny.pir ############################################################################### -runtime/parrot/include/interpflags.pasm : $(INC_DIR)/interpreter.h $(H2INC) +$(RUN_INC_DIR)/interpflags.pasm : $(INC_DIR)/interpreter.h $(H2INC) $(PERL) $(H2INC) $(INC_DIR)/interpreter.h $@ -runtime/parrot/include/interpdebug.pasm : $(INC_DIR)/interpreter.h $(H2INC) +$(RUN_INC_DIR)/interpdebug.pasm : $(INC_DIR)/interpreter.h $(H2INC) $(PERL) $(H2INC) $(INC_DIR)/interpreter.h $@ -runtime/parrot/include/interptrace.pasm : $(INC_DIR)/interpreter.h $(H2INC) +$(RUN_INC_DIR)/interptrace.pasm : $(INC_DIR)/interpreter.h $(H2INC) $(PERL) $(H2INC) $(INC_DIR)/interpreter.h $@ -runtime/parrot/include/interpcores.pasm : $(INC_DIR)/interpreter.h $(H2INC) +$(RUN_INC_DIR)/interpcores.pasm : $(INC_DIR)/interpreter.h $(H2INC) $(PERL) $(H2INC) $(INC_DIR)/interpreter.h $@ -runtime/parrot/include/cloneflags.pasm : $(INC_DIR)/interpreter.h $(H2INC) +$(RUN_INC_DIR)/cloneflags.pasm : $(INC_DIR)/interpreter.h $(H2INC) $(PERL) $(H2INC) $(INC_DIR)/interpreter.h $@ -runtime/parrot/include/iglobals.pasm : $(INC_DIR)/interpreter.h $(H2INC) +$(RUN_INC_DIR)/iglobals.pasm : $(INC_DIR)/interpreter.h $(H2INC) $(PERL) $(H2INC) $(INC_DIR)/interpreter.h $@ -runtime/parrot/include/sysinfo.pasm : $(INC_DIR)/interpreter.h $(H2INC) +$(RUN_INC_DIR)/sysinfo.pasm : $(INC_DIR)/interpreter.h $(H2INC) $(PERL) $(H2INC) $(INC_DIR)/interpreter.h $@ -runtime/parrot/include/interpinfo.pasm : $(INC_DIR)/gc_api.h $(H2INC) +$(RUN_INC_DIR)/interpinfo.pasm : $(INC_DIR)/gc_api.h $(H2INC) $(PERL) $(H2INC) $(INC_DIR)/gc_api.h $@ -runtime/parrot/include/timer.pasm : $(INC_DIR)/scheduler.h $(H2INC) +$(RUN_INC_DIR)/timer.pasm : $(INC_DIR)/scheduler.h $(H2INC) $(PERL) $(H2INC) $(INC_DIR)/scheduler.h $@ -runtime/parrot/include/pmctypes.pasm : $(INC_DIR)/core_pmcs.h $(H2INC) +$(RUN_INC_DIR)/pmctypes.pasm : $(INC_DIR)/core_pmcs.h $(H2INC) $(PERL) $(H2INC) $(INC_DIR)/core_pmcs.h $@ -runtime/parrot/include/stdio.pasm : $(INC_DIR)/io.h $(H2INC) +$(RUN_INC_DIR)/stdio.pasm : $(INC_DIR)/io.h $(H2INC) $(PERL) $(H2INC) $(INC_DIR)/io.h $@ -runtime/parrot/include/socket.pasm : $(INC_DIR)/io.h $(H2INC) +$(RUN_INC_DIR)/socket.pasm : $(INC_DIR)/io.h $(H2INC) $(PERL) $(H2INC) $(INC_DIR)/io.h $@ -runtime/parrot/include/hash_key_type.pasm : $(INC_DIR)/hash.h $(H2INC) +$(RUN_INC_DIR)/hash_key_type.pasm : $(INC_DIR)/hash.h $(H2INC) $(PERL) $(H2INC) $(INC_DIR)/hash.h $@ -runtime/parrot/include/iterator.pasm : $(INC_DIR)/enums.h $(H2INC) +$(RUN_INC_DIR)/iterator.pasm : $(INC_DIR)/enums.h $(H2INC) $(PERL) $(H2INC) $(INC_DIR)/enums.h $@ -runtime/parrot/include/call_bits.pasm : $(INC_DIR)/enums.h $(H2INC) +$(RUN_INC_DIR)/call_bits.pasm : $(INC_DIR)/enums.h $(H2INC) $(PERL) $(H2INC) $(INC_DIR)/enums.h $@ lib/Parrot/Pmc2c/PCCMETHOD_BITS.pm : $(INC_DIR)/enums.h $(H2INC) $(PERL) $(H2INC) $(INC_DIR)/enums.h $@ -runtime/parrot/include/libpaths.pasm : $(INC_DIR)/library.h $(H2INC) +$(RUN_INC_DIR)/libpaths.pasm : $(INC_DIR)/library.h $(H2INC) $(PERL) $(H2INC) $(INC_DIR)/library.h $@ -runtime/parrot/include/dlopenflags.pasm : $(INC_DIR)/platform_interface.h $(H2INC) +$(RUN_INC_DIR)/dlopenflags.pasm : $(INC_DIR)/platform_interface.h $(H2INC) $(PERL) $(H2INC) $(INC_DIR)/platform_interface.h $@ -runtime/parrot/include/datatypes.pasm : $(INC_DIR)/datatypes.h $(H2INC) +$(RUN_INC_DIR)/datatypes.pasm : $(INC_DIR)/datatypes.h $(H2INC) $(PERL) $(H2INC) $(INC_DIR)/datatypes.h $@ -runtime/parrot/include/stat.pasm : $(INC_DIR)/platform_interface.h $(H2INC) +$(RUN_INC_DIR)/stat.pasm : $(INC_DIR)/platform_interface.h $(H2INC) $(PERL) $(H2INC) $(INC_DIR)/platform_interface.h $@ -runtime/parrot/include/stringinfo.pasm : $(INC_DIR)/string.h $(H2INC) +$(RUN_INC_DIR)/stringinfo.pasm : $(INC_DIR)/string.h $(H2INC) $(PERL) $(H2INC) $(INC_DIR)/string.h $@ -runtime/parrot/include/longopt.pasm : $(INC_DIR)/longopt.h $(H2INC) +$(RUN_INC_DIR)/longopt.pasm : $(INC_DIR)/longopt.h $(H2INC) $(PERL) $(H2INC) $(INC_DIR)/longopt.h $@ -runtime/parrot/include/cclass.pasm : $(INC_DIR)/cclass.h $(H2INC) +$(RUN_INC_DIR)/cclass.pasm : $(INC_DIR)/cclass.h $(H2INC) $(PERL) $(H2INC) $(INC_DIR)/cclass.h $@ -runtime/parrot/include/packfile_segments.pasm : $(INC_DIR)/packfile.h $(H2INC) +$(RUN_INC_DIR)/packfile_segments.pasm : $(INC_DIR)/packfile.h $(H2INC) $(PERL) $(H2INC) $(INC_DIR)/packfile.h $@ -runtime/parrot/include/packfile_annotation_key_type.pasm : $(INC_DIR)/packfile.h $(H2INC) +$(RUN_INC_DIR)/packfile_annotation_key_type.pasm : $(INC_DIR)/packfile.h $(H2INC) $(PERL) $(H2INC) $(INC_DIR)/packfile.h $@ -runtime/parrot/include/except_types.pasm : $(INC_DIR)/exceptions.h $(H2INC) +$(RUN_INC_DIR)/except_types.pasm : $(INC_DIR)/exceptions.h $(H2INC) $(PERL) $(H2INC) $(INC_DIR)/exceptions.h $@ -runtime/parrot/include/except_severity.pasm : $(INC_DIR)/exceptions.h $(H2INC) +$(RUN_INC_DIR)/except_severity.pasm : $(INC_DIR)/exceptions.h $(H2INC) $(PERL) $(H2INC) $(INC_DIR)/exceptions.h $@ -runtime/parrot/include/warnings.pasm : $(INC_DIR)/warnings.h $(H2INC) +$(RUN_INC_DIR)/warnings.pasm : $(INC_DIR)/warnings.h $(H2INC) $(PERL) $(H2INC) $(INC_DIR)/warnings.h $@ -runtime/parrot/include/errors.pasm : $(INC_DIR)/warnings.h $(H2INC) +$(RUN_INC_DIR)/errors.pasm : $(INC_DIR)/warnings.h $(H2INC) $(PERL) $(H2INC) $(INC_DIR)/warnings.h $@ -runtime/parrot/include/tm.pasm : src/utils.c $(H2INC) +$(RUN_INC_DIR)/tm.pasm : src/utils.c $(H2INC) $(PERL) $(H2INC) src/utils.c $@ @@ -1330,18 +1387,20 @@ examples/pasm/hello$(EXE): examples/pasm/hello.pbc $(PBC_TO_EXE) src/datatypes$(O) : $(PARROT_H_HEADERS) src/datatypes.c src/extend_vtable$(O) : $(PARROT_H_HEADERS) \ - $(INC_DIR)/extend.h $(INC_DIR)/extend_vtable.h src/extend_vtable.c + $(EXTEND_HEADERS) \ + src/extend_vtable.c src/global_setup$(O) : $(PARROT_H_HEADERS) \ src/global_setup.str \ src/global_setup.c \ + $(INC_DIR)/api.h \ $(INC_DIR)/runcore_api.h \ $(INC_DIR)/oplib/core_ops.h src/namespace$(O) : $(PARROT_H_HEADERS) src/namespace.str src/namespace.c \ - include/pmc/pmc_sub.h + $(INC_PMC_DIR)/pmc_sub.h -src/pmc$(O) : include/pmc/pmc_class.h include/pmc/pmc_integer.h src/pmc.c \ +src/pmc$(O) : $(INC_PMC_DIR)/pmc_class.h $(INC_PMC_DIR)/pmc_integer.h src/pmc.c \ src/pmc.str $(PARROT_H_HEADERS) src/packfile/object_serialization$(O) : $(PARROT_H_HEADERS) src/packfile/object_serialization.str src/packfile/object_serialization.c @@ -1355,7 +1414,7 @@ $(INC_DIR)/extend_vtable.h src/extend_vtable.c src/vtable.h : src/vtable.tbl $(B $(PERL) $(BUILD_TOOLS_DIR)/vtable_extend.pl src/key$(O) : $(PARROT_H_HEADERS) src/key.str src/key.c \ - include/pmc/pmc_key.h + $(INC_PMC_DIR)/pmc_key.h src/gc/mark_sweep$(O) : \ $(PARROT_H_HEADERS) \ @@ -1436,13 +1495,13 @@ src/hll$(O) : \ $(PARROT_H_HEADERS) \ src/hll.str \ $(INC_DIR)/dynext.h \ - include/pmc/pmc_fixedintegerarray.h \ + $(INC_PMC_DIR)/pmc_fixedintegerarray.h \ src/hll.c src/core_pmcs$(O) : $(PARROT_H_HEADERS) src/core_pmcs.c src/runcore/trace$(O) : \ - include/pmc/pmc_sub.h \ + $(INC_PMC_DIR)/pmc_sub.h \ src/runcore/trace.c \ $(INC_DIR)/oplib/ops.h \ $(INC_DIR)/runcore_trace.h \ @@ -1450,14 +1509,14 @@ src/runcore/trace$(O) : \ $(INC_DIR)/oplib/core_ops.h \ $(INC_DIR)/runcore_api.h -src/debug$(O) : $(INC_DIR)/embed.h $(INC_DIR)/extend.h \ +src/debug$(O) : \ $(PARROT_H_HEADERS) src/debug.c \ $(INC_DIR)/oplib/ops.h \ - $(INC_DIR)/oplib/core_ops.h \ + $(INC_DIR)/oplib/core_ops.h \ $(INC_DIR)/runcore_api.h $(INC_DIR)/runcore_trace.h \ - src/debug.str include/pmc/pmc_key.h \ - include/pmc/pmc_continuation.h \ - $(INC_DIR)/extend_vtable.h + src/debug.str $(INC_PMC_DIR)/pmc_key.h \ + $(INC_PMC_DIR)/pmc_continuation.h \ + $(INC_PMC_DIR)/pmc_sub.h src/sub$(O) : \ $(PARROT_H_HEADERS) \ @@ -1466,11 +1525,12 @@ src/sub$(O) : \ $(INC_DIR)/runcore_api.h \ src/sub.str \ src/sub.c \ - include/pmc/pmc_sub.h \ - include/pmc/pmc_continuation.h + $(INC_PMC_DIR)/pmc_sub.h \ + $(INC_PMC_DIR)/pmc_continuation.h src/string/api$(O) : $(PARROT_H_HEADERS) src/string/api.str \ - src/string/private_cstring.h src/string/api.c + src/string/private_cstring.h src/string/api.c \ + $(INC_DIR)/events.h src/longopt$(O) : \ $(PARROT_H_HEADERS) \ @@ -1479,51 +1539,60 @@ src/longopt$(O) : \ src/longopt.c src/dynext$(O) : $(PARROT_H_HEADERS) $(INC_DIR)/dynext.h \ - src/dynext.str include/pmc/pmc_parrotlibrary.h src/dynext.c + src/dynext.str $(INC_PMC_DIR)/pmc_parrotlibrary.h src/dynext.c src/exceptions$(O) : $(PARROT_H_HEADERS) \ src/exceptions.str src/exceptions.c \ - include/pmc/pmc_continuation.h + $(INC_DIR)/events.h \ + $(INC_PMC_DIR)/pmc_exception.h \ + $(INC_PMC_DIR)/pmc_continuation.h -src/thread$(O) : \ - $(PARROT_H_HEADERS) \ - $(INC_DIR)/extend.h \ - $(INC_DIR)/extend_vtable.h \ - src/thread.c \ - include/pmc/pmc_sub.h \ - include/pmc/pmc_parrotinterpreter.h \ - $(INC_DIR)/runcore_api.h +src/threads$(O) : $(PARROT_H_HEADERS) $(INC_DIR)/atomic.h src/threads.c ## SUFFIX OVERRIDE - dynloaded files need cc_shared -src/extend$(O) : $(PARROT_H_HEADERS) $(INC_DIR)/extend.h \ - include/pmc/pmc_sub.h $(INC_DIR)/extend_vtable.h src/extend.c +src/extend$(O) : \ + $(PARROT_H_HEADERS) \ + $(EXTEND_HEADERS) \ + $(INC_PMC_DIR)/pmc_sub.h \ + $(INC_DIR)/events.h \ + src/extend.c $(CC) $(CFLAGS) @optimize::src/extend.c@ @ccwarn::src/extend.c@ @cc_shared@ -I$(@D) @cc_o_out@$@ -c src/extend.c src/runcore/main$(O) : \ src/runcore/main.c \ src/runcore/main.str \ - include/pmc/pmc_parrotlibrary.h \ + $(INC_PMC_DIR)/pmc_parrotlibrary.h \ + $(INC_PMC_DIR)/pmc_sub.h \ $(INC_DIR)/dynext.h $(INC_DIR)/oplib/core_ops.h \ $(INC_DIR)/oplib/ops.h \ $(PARROT_H_HEADERS) $(INC_DIR)/runcore_api.h \ + $(INC_DIR)/runcore_subprof.h \ $(INC_DIR)/runcore_profiling.h +src/runcore/subprof$(O) : src/runcore/subprof.str src/runcore/subprof.c \ + $(INC_DIR)/dynext.h \ + $(INC_DIR)/oplib/core_ops.h \ + $(INC_DIR)/oplib/ops.h \ + $(INC_DIR)/runcore_api.h \ + $(INC_DIR)/runcore_subprof.h \ + $(INC_PMC_DIR)/pmc_sub.h \ + $(PARROT_H_HEADERS) + src/runcore/profiling$(O) : src/runcore/profiling.str src/runcore/profiling.c \ - include/pmc/pmc_sub.h \ - include/pmc/pmc_namespace.h \ + $(INC_PMC_DIR)/pmc_sub.h \ + $(INC_PMC_DIR)/pmc_namespace.h \ $(INC_DIR)/oplib/core_ops.h $(INC_DIR)/runcore_api.h \ - $(INC_DIR)/runcore_profiling.h $(INC_DIR)/embed.h \ + $(INC_DIR)/runcore_profiling.h \ $(PARROT_H_HEADERS) \ - $(INC_DIR)/extend.h \ - $(INC_DIR)/extend_vtable.h + $(EXTEND_HEADERS) src/call/args$(O) : \ $(PARROT_H_HEADERS) $(INC_DIR)/oplib/ops.h \ src/call/args.c \ src/call/args.str \ - include/pmc/pmc_key.h \ - include/pmc/pmc_fixedintegerarray.h + $(INC_PMC_DIR)/pmc_key.h \ + $(INC_PMC_DIR)/pmc_fixedintegerarray.h src/call/context_accessors$(O): $(PARROT_H_HEADERS) \ src/call/context_accessors.c @@ -1533,35 +1602,32 @@ src/call/pcc$(O) : $(INC_DIR)/oplib/ops.h \ $(INC_DIR)/runcore_api.h \ src/call/pcc.c \ src/call/pcc.str \ - include/pmc/pmc_key.h include/pmc/pmc_continuation.h + $(INC_PMC_DIR)/pmc_key.h $(INC_PMC_DIR)/pmc_continuation.h src/call/context$(O) : $(PARROT_H_HEADERS) \ - include/pmc/pmc_sub.h src/call/context.c + src/call/context.c \ + $(INC_PMC_DIR)/pmc_sub.h \ + $(INC_PMC_DIR)/pmc_continuation.h src/interp/inter_cb$(O) : $(PARROT_H_HEADERS) \ - include/pmc/pmc_parrotinterpreter.h \ - $(INC_DIR)/extend.h \ - $(INC_DIR)/extend_vtable.h \ + $(INC_PMC_DIR)/pmc_parrotinterpreter.h \ + $(EXTEND_HEADERS) \ + $(INC_PMC_DIR)/pmc_callback.h \ src/interp/inter_cb.str src/interp/inter_cb.c -src/interp/inter_misc$(O) : $(PARROT_H_HEADERS) \ - src/interp/inter_misc.c \ - src/interp/inter_misc.str \ +src/interp/api$(O) : $(PARROT_H_HEADERS) \ + src/interp/api.c \ + src/interp/api.str \ include/imcc/embed.h \ - include/imcc/yyscanner.h \ + include/imcc/yyscanner.h \ $(INC_DIR)/runcore_api.h \ - include/pmc/pmc_parrotinterpreter.h - -src/interp/inter_create$(O) : $(PARROT_H_HEADERS) \ - $(INC_DIR)/oplib/core_ops.h \ + $(INC_PMC_DIR)/pmc_parrotinterpreter.h \ + $(INC_DIR)/oplib/core_ops.h \ src/gc/gc_private.h \ - src/interp/inter_create.c \ - src/interp/inter_create.str \ - $(INC_DIR)/runcore_api.h \ - src/gc/variable_size_pool.h + src/gc/variable_size_pool.h src/call/ops$(O) : $(INC_DIR)/oplib/ops.h \ - $(PARROT_H_HEADERS) include/pmc/pmc_continuation.h \ + $(PARROT_H_HEADERS) $(INC_PMC_DIR)/pmc_continuation.h \ $(INC_DIR)/runcore_api.h src/call/ops.c src/io/api$(O) : \ @@ -1569,18 +1635,28 @@ src/io/api$(O) : \ src/io/io_private.h \ src/io/api.c \ src/io/api.str \ - include/pmc/pmc_filehandle.h \ - include/pmc/pmc_stringhandle.h \ - include/pmc/pmc_socket.h \ - $(INC_DIR)/extend.h \ - $(INC_DIR)/extend_vtable.h + $(INC_PMC_DIR)/pmc_filehandle.h \ + $(INC_PMC_DIR)/pmc_stringhandle.h \ + $(INC_PMC_DIR)/pmc_socket.h \ + $(EXTEND_HEADERS) src/io/buffer$(O) : $(PARROT_H_HEADERS) src/io/io_private.h src/io/buffer.c \ - include/pmc/pmc_handle.h + $(INC_PMC_DIR)/pmc_handle.h src/gc/alloc_memory$(O) : $(PARROT_H_HEADERS) src/gc/alloc_memory.c -frontend/parrot/main$(O) : \ +$(FRPTWO_DIR)/main$(O) : \ + $(INC_DIR)/api.h \ + $(INC_DIR)/compiler.h \ + $(INC_DIR)/config.h \ + $(INC_DIR)/core_types.h \ + $(INC_DIR)/feature.h \ + $(INC_DIR)/has_header.h \ + $(INC_DIR)/longopt.h \ + include/imcc/api.h \ + $(FRPTWO_DIR)/main.c + +$(FRP_DIR)/main$(O) : \ $(INC_DIR)/api.h \ $(INC_DIR)/compiler.h \ $(INC_DIR)/config.h \ @@ -1589,46 +1665,41 @@ frontend/parrot/main$(O) : \ $(INC_DIR)/has_header.h \ $(INC_DIR)/longopt.h \ include/imcc/api.h \ - frontend/parrot/main.c + $(FRP_DIR)/main.c src/multidispatch$(O) : \ src/multidispatch.c \ src/multidispatch.str \ $(INC_DIR)/oplib/ops.h \ $(PARROT_H_HEADERS) \ - include/pmc/pmc_nativepccmethod.h \ - include/pmc/pmc_nci.h \ - include/pmc/pmc_sub.h + $(INC_PMC_DIR)/pmc_nativepccmethod.h \ + $(INC_PMC_DIR)/pmc_nci.h \ + $(INC_PMC_DIR)/pmc_sub.h src/packfile/api$(O) : \ src/packfile/api.str \ src/packfile/api.c \ src/packfile/pf_private.h \ - include/pmc/pmc_sub.h \ - include/pmc/pmc_packfileview.h \ + $(INC_PMC_DIR)/pmc_sub.h \ + $(INC_PMC_DIR)/pmc_packfileview.h \ $(INC_DIR)/oplib/core_ops.h \ $(INC_DIR)/dynext.h \ - $(INC_DIR)/embed.h \ - $(INC_DIR)/extend.h \ - $(INC_DIR)/extend_vtable.h \ + $(EXTEND_HEADERS) \ $(PARROT_H_HEADERS) \ $(INC_DIR)/runcore_api.h src/packfile/output$(O) : \ $(PARROT_H_HEADERS) \ - include/pmc/pmc_key.h \ + $(EXTEND_HEADERS) \ + $(INC_PMC_DIR)/pmc_key.h \ $(INC_DIR)/dynext.h \ - $(INC_DIR)/extend_vtable.h \ - $(INC_DIR)/extend.h \ $(INC_DIR)/runcore_api.h \ src/packfile/pf_private.h \ - $(INC_DIR)/embed.h \ $(INC_DIR)/oplib/core_ops.h \ src/packfile/output.c src/packfile/pf_items$(O) : \ $(PARROT_H_HEADERS) \ - src/packfile/byteorder.h \ src/packfile/pf_items.str \ src/packfile/pf_items.c @@ -1636,12 +1707,10 @@ src/packfile/segments$(O) : \ src/packfile/segments.str \ $(INC_DIR)/oplib/core_ops.h \ $(INC_DIR)/dynext.h \ - $(INC_DIR)/embed.h \ - $(INC_DIR)/extend.h \ - $(INC_DIR)/extend_vtable.h \ $(PARROT_H_HEADERS) \ + $(EXTEND_HEADERS) \ src/packfile/pf_private.h \ - include/pmc/pmc_parrotlibrary.h \ + $(INC_PMC_DIR)/pmc_parrotlibrary.h \ $(INC_DIR)/runcore_api.h \ src/packfile/segments.c @@ -1682,8 +1751,8 @@ src/platform/generic/math$(O) : src/platform/generic/math.c $(PARROT_H_HEADERS) src/platform/generic/misc$(O) : src/platform/generic/misc.c $(PARROT_H_HEADERS) -src/platform/generic/socket$(O) : $(PARROT_H_HEADERS) include/pmc/pmc_socket.h \ - src/io/io_private.h include/pmc/pmc_sockaddr.h src/platform/generic/socket.c +src/platform/generic/socket$(O) : $(PARROT_H_HEADERS) $(INC_PMC_DIR)/pmc_socket.h \ + src/io/io_private.h $(INC_PMC_DIR)/pmc_sockaddr.h src/platform/generic/socket.c src/platform/generic/sysmem$(O) : src/platform/generic/sysmem.c $(PARROT_H_HEADERS) @@ -1730,57 +1799,49 @@ src/platform/win32/uid$(O) : src/platform/win32/uid.c $(PARROT_H_HEADERS) src/runcore/cores$(O) : src/runcore/cores.str \ src/runcore/cores.c \ - include/pmc/pmc_sub.h \ - $(INC_DIR)/dynext.h $(INC_DIR)/embed.h $(INC_DIR)/oplib/core_ops.h \ + $(INC_PMC_DIR)/pmc_sub.h \ + $(INC_DIR)/dynext.h $(INC_DIR)/oplib/core_ops.h \ $(INC_DIR)/oplib/ops.h \ $(INC_DIR)/runcore_api.h $(INC_DIR)/runcore_trace.h \ $(PARROT_H_HEADERS) -src/embed$(O) : \ +src/disassemble$(O) : \ $(PARROT_H_HEADERS) \ - src/embed.c \ - src/embed.str \ + src/disassemble.c \ $(INC_DIR)/oplib/ops.h \ - $(INC_DIR)/extend.h \ - $(INC_DIR)/embed.h \ $(INC_DIR)/runcore_api.h \ - $(INC_DIR)/extend_vtable.h \ $(INC_DIR)/oplib/core_ops.h \ - include/pmc/pmc_sub.h \ - include/imcc/embed.h \ - include/imcc/yyscanner.h \ + $(INC_PMC_DIR)/pmc_sub.h \ src/embed/api$(O) : \ $(PARROT_H_HEADERS) \ $(INC_DIR)/api.h \ - $(INC_DIR)/embed.h \ $(INC_DIR)/runcore_api.h \ src/embed/api.c \ src/embed/embed_private.h \ - include/pmc/pmc_parrotinterpreter.h + $(INC_PMC_DIR)/pmc_parrotinterpreter.h src/embed/bytecode$(O) : \ $(PARROT_H_HEADERS) \ $(INC_DIR)/api.h \ - $(INC_DIR)/embed.h \ $(INC_DIR)/runcore_api.h \ src/embed/bytecode.c \ src/embed/embed_private.h \ - include/pmc/pmc_parrotinterpreter.h + $(INC_PMC_DIR)/pmc_parrotinterpreter.h src/embed/strings$(O) : \ $(PARROT_H_HEADERS) \ $(INC_DIR)/api.h \ src/embed/strings.c \ src/embed/embed_private.h \ - include/pmc/pmc_parrotinterpreter.h + $(INC_PMC_DIR)/pmc_parrotinterpreter.h src/embed/pmc$(O) : \ $(PARROT_H_HEADERS) \ $(INC_DIR)/api.h \ src/embed/pmc.c \ src/embed/embed_private.h \ - include/pmc/pmc_parrotinterpreter.h + $(INC_PMC_DIR)/pmc_parrotinterpreter.h src/dataypes$(O) : $(GEN_HEADERS) src/dataypes.c @@ -1793,27 +1854,27 @@ src/nci/api$(O) : src/nci/api.str \ src/nci/core_thunks$(O) : src/nci/core_thunks.str \ src/nci/core_thunks.c \ $(PARROT_H_HEADERS) \ - include/pmc/pmc_nci.h + $(INC_PMC_DIR)/pmc_nci.h src/nci/libffi$(O) : src/nci/libffi.c \ $(PARROT_H_HEADERS) \ - include/pmc/pmc_nci.h \ - include/pmc/pmc_unmanagedstruct.h \ - include/pmc/pmc_managedstruct.h \ + $(INC_PMC_DIR)/pmc_nci.h \ + $(INC_PMC_DIR)/pmc_unmanagedstruct.h \ + $(INC_PMC_DIR)/pmc_managedstruct.h \ ## SUFFIX OVERRIDE src/nci/extra_thunks$(O) : \ $(PARROT_H_HEADERS) \ - include/pmc/pmc_nci.h \ + $(INC_PMC_DIR)/pmc_nci.h \ src/nci/extra_thunks.str \ src/nci/extra_thunks.c $(CC) $(CFLAGS) @optimize::src/nci/extra_thunks.c@ @ccwarn::src/nci/extra_thunks.c@ @cc_shared@ -I$(@D) @cc_o_out@$@ -c src/nci/extra_thunks.c src/nci/libffi$(O) : src/nci/libffi.c \ $(PARROT_H_HEADERS) \ - include/pmc/pmc_nci.h \ - include/pmc/pmc_unmanagedstruct.h \ - include/pmc/pmc_managedstruct.h + $(INC_PMC_DIR)/pmc_nci.h \ + $(INC_PMC_DIR)/pmc_unmanagedstruct.h \ + $(INC_PMC_DIR)/pmc_managedstruct.h src/nci/signatures$(O) : \ src/nci/signatures.c \ @@ -1840,10 +1901,9 @@ src/misc$(O) : $(PARROT_H_HEADERS) src/misc.c src/utils$(O) : \ $(PARROT_H_HEADERS) \ - include/pmc/pmc_nci.h \ + $(INC_PMC_DIR)/pmc_nci.h \ src/utils.c \ - $(INC_DIR)/extend.h \ - $(INC_DIR)/extend_vtable.h + $(EXTEND_HEADERS) ## SUFFIX OVERRIDE src/spf_render$(O) : $(PARROT_H_HEADERS) src/spf_render.str src/spf_render.c @@ -1913,37 +1973,38 @@ src/string/encoding/ucs4$(O) : \ src/string/encoding/ucs4.c \ src/string/encoding/unicode.h -frontend/pbc_merge/main$(O) : \ - $(INC_DIR)/embed.h \ +$(FR_DIR)/pbc_merge/main$(O) : \ $(INC_DIR)/api.h \ $(INC_DIR)/longopt.h \ - frontend/pbc_merge/main.c \ - include/pmc/pmc_sub.h \ + $(FR_DIR)/pbc_merge/main.c \ + $(INC_PMC_DIR)/pmc_sub.h \ $(INC_DIR)/oplib/ops.h \ $(INC_DIR)/oplib/core_ops.h \ $(INC_DIR)/runcore_api.h \ $(PARROT_H_HEADERS) -src/io/filehandle$(O) : $(PARROT_H_HEADERS) include/pmc/pmc_filehandle.h \ +src/io/filehandle$(O) : $(PARROT_H_HEADERS) $(INC_PMC_DIR)/pmc_filehandle.h \ src/io/io_private.h src/io/filehandle.c src/gc/malloc_trace$(O) : src/gc/malloc.c src/gc/malloc_trace.c src/packfile/pf_items$(O) : $(PARROT_H_HEADERS) src/packfile/pf_items.c -src/atomic/gcc_x86$(O) : $(PARROT_H_HEADERS) src/atomic/gcc_x86.c - # core_ops depends upon config.h so that it gets updated along with # updates to config.h's version numbers src/ops/core_ops$(O) : src/ops/core_ops.c \ $(PARROT_H_HEADERS) \ $(INC_DIR)/dynext.h \ - $(INC_DIR)/embed.h \ $(INC_DIR)/oplib/core_ops.h \ $(INC_DIR)/runcore_api.h \ - include/pmc/pmc_continuation.h \ - include/pmc/pmc_fixedintegerarray.h \ - include/pmc/pmc_parrotlibrary.h \ + $(INC_PMC_DIR)/pmc_continuation.h \ + $(INC_PMC_DIR)/pmc_exception.h \ + $(INC_PMC_DIR)/pmc_exceptionhandler.h \ + $(INC_PMC_DIR)/pmc_fixedintegerarray.h \ + $(INC_PMC_DIR)/pmc_parrotlibrary.h \ + $(INC_PMC_DIR)/pmc_task.h \ + $(INC_DIR)/events.h \ + $(INC_DIR)/scheduler_private.h \ src/io/io_private.h @@ -2048,6 +2109,8 @@ DYNOPLIBS_TEST_FILES = $(DYNOPLIBS_TESTS_DIR)/*.t DYNPMC_TEST_FILES = $(DYNPMC_TESTS_DIR)/*.t EXAMPLES_TEST_FILES = \ t/examples/*.t +INTEROP_TEST_FILES = \ + t/pir/interop.t HEADERIZER_TEST_FILES = $(TOOLS_TESTS_DIR)/dev/headerizer/*.t LIBRARY_TEST_FILES = @library_tests@ MANIFEST_TEST_FILES = \ @@ -2113,8 +2176,14 @@ smolder_test : test_prep smolder_coretest : corevm pbctestfiles $(PERL) t/harness $(EXTRA_TEST_ARGS) --core-tests --archive --send-to-smolder +smolder_fulltest : test_prep + $(PERL) t/fullharness --archive --send-to-smolder + smoke : smolder_test +resubmit_smolder : + $(PERL) $(DEV_TOOLS_DIR)/resubmit_smolder.pl + # "core tests" -- test basic functionality but not ancillaries coretest : corevm pbctestfiles $(PERL) t/harness $(EXTRA_TEST_ARGS) --core-tests @@ -2125,21 +2194,11 @@ check : test # Test various run cores and other stuff # 'testg' and 'testj' are tested only # when the needed runcores are available -fulltest : - -@make@ testb \ - testf \ - testr \ - src_tests \ - run_tests \ - buildtools_tests \ - perl_tests \ - library_tests \ - codetest \ - benchmark_tests \ - manifest_tests \ - examples_tests \ - distro_tests \ - headerizer_tests +fulltest : test_prep + $(PERL) t/fullharness + +all_hll_test : + $(PERL) tools/dev/all_hll_test.pl # bounds checking, slow core testb : test_prep @@ -2177,6 +2236,9 @@ testexec: test_prep src_tests : test_prep $(PERL) t/harness $(SRC_TEST_FILES) +interop_tests: test_prep + $(PERL) t/harness $(INTEROP_TEST_FILES) + dynoplibs_tests : test_prep $(PERL) t/harness $(DYNOPLIBS_TEST_FILES) @@ -2303,7 +2365,7 @@ prog-clean : $(INSTALLABLECONFIG) \ $(INSTALLABLENQP) \ $(INSTALLABLENCITHUNKGEN) \ - $(INSTALLABLEPROVE) \ + $(INSTALLABLEPARROT_PROVE) \ $(INSTALLABLEWINXED) \ pbc_to_exe.pbc pbc_to_exe.c pbc_to_exe$(O) pbc_to_exe$(EXE) \ $(NCI_THUNK_GEN) parrot_nci_thunk_gen.c parrot_nci_thunk_gen$(O) parrot_nci_thunk_gen.pbc \ @@ -2312,12 +2374,13 @@ prog-clean : parrot_config$(EXE) parrot_config.c parrot_config$(O) parrot_config.pbc \ winxed.pbc winxed.c winxed$(O) $(WINXED) \ compilers/imcc/main$(O) \ - $(PDUMP) frontend/pbc_dump/main$(O) frontend/pbc_dump/packdump$(O) \ - $(PDB) frontend/parrot_debugger/main$(O) \ - $(PBC_MERGE) frontend/pbc_merge/main$(O) \ - $(DIS) frontend/pbc_disassemble/main$(O) + $(PDUMP) $(FR_DIR)/pbc_dump/main$(O) $(FR_DIR)/pbc_dump/packdump$(O) \ + $(PDB) $(FR_DIR)/parrot_debugger/main$(O) \ + $(PBC_MERGE) $(FR_DIR)/pbc_merge/main$(O) \ + $(DIS) $(FR_DIR)/pbc_disassemble/main$(O) $(RM_F) \ - frontend/parrot/main$(O) \ + $(FRPTWO_DIR)/main$(O) \ + parrot_old \ src/null_config$(O) \ src/parrot_config$(O) \ src/install_config$(O) \ @@ -2331,7 +2394,7 @@ prog-clean : $(PERL) $(BUILD_TOOLS_DIR)/c2str.pl --init $(RM_F) \ $(STR_FILES) \ - src/string/private_cstring.h "src/pmc/*.c" "include/pmc/pmc_*.h" \ + src/string/private_cstring.h "src/pmc/*.c" "$(INC_PMC_DIR)/pmc_*.h" \ "src/pmc/*.dump" vtable.dump "*.def" "*.lib" "*.exp" archclean: dynext-clean @@ -2349,10 +2412,10 @@ archclean: dynext-clean $(INSTALLABLECONFIG) \ $(INSTALLABLENQP) \ compilers/imcc/main$(O) \ - $(PDUMP) frontend/pbc_dump/main$(O) frontend/pbc_dump/packdump$(O) \ - $(PDB) frontend/parrot_debugger/main$(O) \ - $(PBC_MERGE) frontend/pbc_merge/main$(O) \ - $(DIS) frontend/pbc_disassemble/main$(O) \ + $(PDUMP) $(FR_DIR)/pbc_dump/main$(O) $(FR_DIR)/pbc_dump/packdump$(O) \ + $(PDB) $(FR_DIR)/parrot_debugger/main$(O) \ + $(PBC_MERGE) $(FR_DIR)/pbc_merge/main$(O) \ + $(DIS) $(FR_DIR)/pbc_disassemble/main$(O) \ $(PARROT_CONFIG) parrot_config$(O) parrot_config.c \ src/parrot_config$(O) parrot_config.pbc \ pbc_to_exe$(EXE) pbc_to_exe$(O) pbc_to_exe.pbc \ @@ -2419,7 +2482,10 @@ test-clean : $(RM_F) \ "t/src/*.c" \ "t/src/*.pdb" \ - "t/src/*.manifest" + "t/src/*.manifest" \ + "t/src/*.exp" \ + "t/src/*.lib" \ + "t/src/*.exe" $(RM_F) \ "t/src/embed/*.c" \ "t/src/embed/*.pdb" \ @@ -2432,7 +2498,7 @@ test-clean : "test$(EXE)" \ "test.*" $(RM_F) \ - "parrot_test_run.tar.gz" \ + "t/archive/parrot_test_run.tar.gz" \ ".pod_examinable*.sto" # a failing step of cleaning, usually doesn't concern the following steps @@ -2470,7 +2536,7 @@ status : patch : git diff -LINTABLE_CFILES = `echo frontend/parrot/main$(O) $(O_FILES) src/parrot_config$(O) | $(PERL) -pe @PQ@s/\.o/\.c/g@PQ@` +LINTABLE_CFILES = `echo $(FRPTWO_DIR)/main$(O) $(O_FILES) src/parrot_config$(O) | $(PERL) -pe @PQ@s/\.o/\.c/g@PQ@` lint : sunlint @@ -2527,8 +2593,6 @@ BSD_LINT_FLAGS = -a -aa -b -c -e -h -n -p -r -u -x -z -F -H -V # 236: static function unused # 241: dubious operation on enum # 247: pointer casts may be troublesome -# 249: syntax error (huh? this appears in atomic/gcc_x86.h but doesn't -# cause any compiler to barf) # 259: conversion to '...' due to prototype # 265: ANSI C does not support 'long long' # 277: initialisation of '...' with '...' @@ -2709,10 +2773,10 @@ FULLCOVER_DIRS = \ src/runcore \ src/string \ src/string/encoding \ - frontend/parrot \ - frontend/parrot_debugger \ - frontend/pbc_dump \ - frontend/pbc_merge \ + $(FRPTWO_DIR) \ + $(FR_DIR)/parrot_debugger \ + $(FR_DIR)/pbc_dump \ + $(FR_DIR)/pbc_merge \ $(BUILD_DIR) \ $(BUILD_DIR)/t/perl \ compilers/imcc @@ -2757,10 +2821,10 @@ COVER_DIRS = \ src/runcore \ src/string \ src/string/encoding \ - frontend/parrot \ - frontend/parrot_debugger \ - frontend/pbc_dump \ - frontend/pbc_merge \ + $(FRPTWO_DIR) \ + $(FR_DIR)/parrot_debugger \ + $(FR_DIR)/pbc_dump \ + $(FR_DIR)/pbc_merge \ compilers/imcc HAVE_COVER = @have_cover@ @@ -2932,21 +2996,14 @@ install-doc: ############################################################################### release : MANIFEST MANIFEST.generated - [ -d parrot-$(VERSION) ] || ln -s . parrot-$(VERSION) - @$(RM_F) MANIFEST.real - mv MANIFEST MANIFEST.real - grep -v DEVELOPING MANIFEST.real > MANIFEST - $(PERL) -lane 'print"parrot-$(VERSION)/$$F[0]"unless!length||/#/' MANIFEST | \ - tar -zcv -T - -f parrot-$(VERSION).tar.gz - $(PERL) -lane 'print"parrot-$(VERSION)/$$F[0]"unless!length||/#/' \ - MANIFEST | tar -jcv -T - -f parrot-$(VERSION).tar.bz2 - sha256sum parrot-$(VERSION).tar.gz > parrot-$(VERSION).tar.gz.sha256 - sha256sum parrot-$(VERSION).tar.bz2 > parrot-$(VERSION).tar.bz2.sha256 - mv MANIFEST.real MANIFEST - rm parrot-$(VERSION) + $(PERL) $(RELEASE_TOOLS_DIR)/cut.pl $(VERSION) + $(PERL) $(RELEASE_TOOLS_DIR)/sha256sum.pl \ + parrot-$(VERSION).tar.gz > parrot-$(VERSION).tar.gz.sha256 + $(PERL) $(RELEASE_TOOLS_DIR)/sha256sum.pl \ + parrot-$(VERSION).tar.bz2 > parrot-$(VERSION).tar.bz2.sha256 release_check: - make release VERSION=$(SOVERSION) + $(MAKE) release VERSION=$(SOVERSION) $(PERL) $(RELEASE_TOOLS_DIR)/releasecheck.pl relcheck : release_check @@ -2975,9 +3032,11 @@ $(LIBNCI_TEST_SO): src/nci_test$(O) $(LD) $(LD_LOAD_FLAGS) @ncilib_link_extra@ $(LDFLAGS) \ @ld_out@$@ src/nci_test$(O) $(C_LIBS) -# for use by runtime/parrot/library/OpenGL.pir -src/glut_callbacks$(O): $(PARROT_H_HEADERS) \ - $(INC_DIR)/extend.h $(INC_DIR)/extend_vtable.h src/glut_callbacks.c +# for use by $(LIBRARY_DIR)/OpenGL.pir +src/glut_callbacks$(O): \ + $(PARROT_H_HEADERS) \ + $(EXTEND_HEADERS) \ + src/glut_callbacks.c src/glut_nci_thunks.c: $(NCI_THUNK_GEN) $(NCI_THUNK_GEN) \ @@ -2988,7 +3047,7 @@ src/glut_nci_thunks.c: $(NCI_THUNK_GEN) src/glut_nci_thunks$(O) : $(PARROT_H_HEADERS) \ src/glut_nci_thunks.c \ - include/pmc/pmc_nci.h + $(INC_PMC_DIR)/pmc_nci.h $(LIBGLUTCB_SO): $(LIBPARROT) src/glut_callbacks$(O) src/glut_nci_thunks$(O) $(LD) $(LD_LOAD_FLAGS) $(LDFLAGS) \ @@ -3004,7 +3063,7 @@ bootstrap-nci : src/nci/core_thunks.nci src/nci/extra_thunks.nci $(NCI_THUNK_GEN ## SUFFIX OVERRIDE src/extra_nci_thunks$(O) : $(PARROT_H_HEADERS) src/extra_nci_thunks.c \ - include/pmc/pmc_nci.h + $(INC_PMC_DIR)/pmc_nci.h $(CC) $(CFLAGS) @optimize::src/extra_nci_thunks.c@ @ccwarn::src/extra_nci_thunks.c@ @cc_shared@ -I$(@D) @cc_o_out@$@ -c src/extra_nci_thunks.c # emacs etags @@ -3064,9 +3123,17 @@ cagecritic: HEADERIZER_O_FILES = \ $(O_FILES) \ - frontend/parrot/main$(O) \ - frontend/pbc_dump/packdump$(O) \ - frontend/pbc_merge/main$(O) \ + \ + $(FR_DIR)/parrot_debugger/main$(O) \ + \ + $(FRPTWO_DIR)/main$(O) \ + \ + $(FR_DIR)/pbc_disassemble/main$(O) \ + \ + $(FR_DIR)/pbc_dump/packdump$(O) \ + $(FR_DIR)/pbc_dump/main$(O) \ + \ + $(FR_DIR)/pbc_merge/main$(O) headerizer : src/core_pmcs.c src/extend_vtable.c $(HEADERIZER) $(HEADERIZER_O_FILES) compilers/imcc/imcc.y diff --git a/config/init/defaults.pm b/config/init/defaults.pm index 20e5d867fa..96d5f62206 100644 --- a/config/init/defaults.pm +++ b/config/init/defaults.pm @@ -18,6 +18,7 @@ use warnings; use base qw(Parrot::Configure::Step); use Config; +use File::Which; use FindBin; # see build_dir use Parrot::BuildUtil; use Parrot::Configure::Step; @@ -62,7 +63,6 @@ sub runstep { scriptdirexp sig_name sPRIgldbl - sPRIgldbl | ) { $conf->data->set( qq|${orig}_provisional| => $Config{$orig} ); } @@ -203,6 +203,9 @@ sub runstep { rm_rf => '$(PERL) -MExtUtils::Command -e rm_rf', touch => '$(PERL) -MExtUtils::Command -e touch', + # tar is currently used only in 'make release'. + tar => which('tar') || '', + ar => $Config{ar}, arflags => 'cr', @@ -257,7 +260,7 @@ sub runstep { coveragedir => $conf->options->get('coveragedir') || $build_dir, ); - # TT #855: Profiling options are too specific to GCC + # GH #383: Profiling options are too specific to GCC if ( $conf->options->get('profile') ) { $conf->data->set( cc_debug => " -pg ", diff --git a/config/init/hints.pm b/config/init/hints.pm index 1aaf45a9ba..781b695296 100644 --- a/config/init/hints.pm +++ b/config/init/hints.pm @@ -63,6 +63,9 @@ sub runstep { $hints_used++; } } + elsif ( $conf->options->get('hintsfile') ) { + die "No $hints_file found"; + } else { $conf->debug("No $hints_file found. "); } diff --git a/config/init/hints/cygwin.pm b/config/init/hints/cygwin.pm index b567c21708..e5e42df41e 100644 --- a/config/init/hints/cygwin.pm +++ b/config/init/hints/cygwin.pm @@ -18,15 +18,15 @@ sub runstep { my $build_dir = $conf->data->get('build_dir'); $build_dir =~ s/ /\\ /g; - my $bindir = $conf->data->get('bindir'); - $bindir =~ s/ /\\ /g; + my $libdir = $conf->data->get('libdir'); + $libdir =~ s/ /\\ /g; my $libparrot_shared = $conf->data->get('libparrot_shared'); # force cyg prefix $libparrot_shared =~ s/^lib/cyg/g; # force the dll versioning my @parrot_version = Parrot::BuildUtil::parrot_version(); - my $dllsuffix = join("_",@parrot_version); - $libparrot_shared =~ s/parrot\.dll/parrot$dllsuffix\.dll/; + my $dllsuffix = join('.', @parrot_version); + $libparrot_shared =~ s/parrot\.dll/parrot-$dllsuffix\.dll/; # An old note about building shared libraries: Perl5 used the 'ld2' tool until # 5.8.8-4, which is installed as part of the perl5 installation. So far, it @@ -49,11 +49,10 @@ sub runstep { sym_export => '__declspec(dllexport)', sym_import => '__declspec(dllimport)', libparrot_shared => $libparrot_shared, - blib_dir => '.', libparrot_ldflags => '-L' . $build_dir . ' -lparrot', - inst_libparrot_ldflags => '-L' . $bindir . ' -lparrot', + inst_libparrot_ldflags => '-L' . $libdir . ' -lparrot', libparrot_linkflags => '-L' . $build_dir . ' -lparrot', - inst_libparrot_linkflags => '-L' . $bindir . ' -lparrot', + inst_libparrot_linkflags => '-L' . $libdir . ' -lparrot', ); # inet_aton needs to be defined on Cygwin. diff --git a/config/init/hints/darwin.pm b/config/init/hints/darwin.pm index bae5836cb6..2085be6781 100644 --- a/config/init/hints/darwin.pm +++ b/config/init/hints/darwin.pm @@ -63,7 +63,7 @@ sub runstep { my $osvers = `/usr/sbin/sysctl -n kern.osrelease`; chomp $osvers; - $conf->data->set( + my %darwin_selections = ( darwin => 1, osx_version => $deploy_target, osvers => $osvers, @@ -96,6 +96,14 @@ sub runstep { . $conf->data->get('share_ext') . '"' ); + my $darwin_hints = "Darwin hints settings:\n"; + for my $k (sort keys %darwin_selections) { + $darwin_hints .= sprintf(" %-24s => %s\n" => ( + $k, qq|'$darwin_selections{$k}'|, + ) ); + } + $conf->debug($darwin_hints); + $conf->data->set( %darwin_selections ); } #################### INTERNAL SUBROUTINES #################### @@ -204,7 +212,7 @@ sub _probe_for_fink { my %addl_flags = ( linkflags => "-L$fink_lib_dir", ldflags => "-L$fink_lib_dir", - ccflags => "-I$fink_include_dir", + ccflags => "-isystem $fink_include_dir", ); return \%addl_flags; } @@ -227,7 +235,7 @@ sub _probe_for_macports { my %addl_flags = ( linkflags => "-L$ports_lib_dir", ldflags => "-L$ports_lib_dir", - ccflags => "-I$ports_include_dir", + ccflags => "-isystem $ports_include_dir", ); return \%addl_flags; } diff --git a/config/init/hints/linux.pm b/config/init/hints/linux.pm index c389732bb9..885a19b13f 100644 --- a/config/init/hints/linux.pm +++ b/config/init/hints/linux.pm @@ -71,7 +71,7 @@ sub runstep { my $osvers = `/sbin/sysctl -n kernel.osrelease`; chomp $osvers; - $conf->data->set( + my %linux_selections = ( ccflags => $ccflags, libs => $libs, ld_share_flags => $ld_share_flags, @@ -88,11 +88,19 @@ sub runstep { libparrot_shared_alias => "libparrot$share_ext", libparrot_soname => "-Wl,-soname=libparrot$share_ext.$version", ); + if ( ( split( m/-/, $conf->data->get('archname_provisional'), 2 ) )[0] eq 'ia64' ) { - if ( ( split( m/-/, $conf->data->get('archname_provisional'), 2 ) )[0] eq 'ia64' ) { - - $conf->data->set( platform_asm => 1 ); + $linux_selections{platform_asm} = 1; + } + my $linux_hints = "Linux hints settings:\n"; + for my $k (sort keys %linux_selections) { + $linux_hints .= sprintf(" %-24s => %s\n" => ( + $k, qq|'$linux_selections{$k}'|, + ) ); } + $conf->debug($linux_hints); + + $conf->data->set( %linux_selections ); return; } diff --git a/config/init/hints/mswin32.pm b/config/init/hints/mswin32.pm index 87003c572d..7c80d7455e 100644 --- a/config/init/hints/mswin32.pm +++ b/config/init/hints/mswin32.pm @@ -1,4 +1,4 @@ -# Copyright (C) 2005-2007, Parrot Foundation. +# Copyright (C) 2005-2012, Parrot Foundation. package init::hints::mswin32; @@ -19,10 +19,10 @@ sub runstep { # We do one bit of its work early here, because we need the result now. $cc = $conf->options->get('cc') if defined $conf->options->get('cc'); - my $is_msvc = $cc =~ m/\bcl(?:\.exe)?/i; - my $is_intel = $cc =~ m/\bicl(?:\.exe)?/i; - my $is_mingw = $cc =~ m/\bgcc(?:\.exe)?/i; - my $is_bcc = $cc =~ m/\bbcc32(?:\.exe)?/i; + my $is_msvc = $cc =~ m/\bcl\b/i; + my $is_intel = $cc =~ m/\bicl\b/i; + my $is_mingw = $cc =~ m/\b(?:gcc|g\+\+|clang)\b/i; + my $is_bcc = $cc =~ m/\bbcc32\b/i; $conf->data->set( win32 => 1, @@ -235,6 +235,14 @@ sub runstep { optimize => '', ); } + elsif ( $make =~ /gmake/i ) { + # also Strawberry Perl + $conf->data->set( + ccflags => "-DWINVER=$winver ", + make => 'gmake', + make_c => 'gmake -C', + ); + } elsif ( $make =~ /mingw32-make/i ) { ; # Vanilla Perl $conf->data->set( diff --git a/config/init/hints/msys.pm b/config/init/hints/msys.pm index f5aa7852e9..b5b56acb94 100644 --- a/config/init/hints/msys.pm +++ b/config/init/hints/msys.pm @@ -1,21 +1,63 @@ -# Copyright (C) 2005-2007, Parrot Foundation. +# Copyright (C) 2005-2011, Parrot Foundation. package init::hints::msys; use strict; use warnings; +sub _real_path { + my ( $path ) = @_; + $path = `mkdir -p '$path' && cd '$path' && pwd -W`; + chomp $path; + return $path; +} + sub runstep { - my ( $self, $conf ) = @_; + my (undef, $conf) = @_; + + # Translate absolute paths from UNIX-style to Windows-style + my @keys = qw{bindir build_dir tempdir libdir includedir}; + my %dirs; + @dirs{@keys} = map { _real_path $conf->data->get($_) } @keys; + $conf->data->set(%dirs); + + # Identify as msys instead of win32 + $conf->data->set(msys => 1); + # Assume Windows 2000 or above + $conf->data->set(ccflags => '-DWINVER=0x0500 '); + + # Create Parrot as shared library $conf->data->set( - ld => '$(PERL) /bin/perlld', - ld_load_flags => '-shared ', - libs => -'-lmsvcrt -lmoldname -lkernel32 -luser32 -lgdi32 -lwinspool -lcomdlg32 -ladvapi32 -lshell32 -lole32 -loleaut32 -lnetapi32 -luuid -lws2_32 -lmpr -lwinmm -lversion -lodbc32 ', - ncilib_link_extra => 'src/libnci_test.def', - has_socklen_t => 0, + parrot_is_shared => 1, + has_dynamic_linking => 1, + has_static_linking => 0, + ld_share_flags => '-shared', + ld_load_flags => '-shared', + sym_export => '__declspec(dllexport)', + sym_import => '__declspec(dllimport)' ); + + # Link non-default Windows libs and setup path for MSYS libs + # Use /bin instead of /lib to avoid incorrectly pulling in other MSYS libs + $conf->data->set(libs => '-lws2_32 -L/bin'); + + # Setup built Parrot + $conf->data->set( + libparrot_ldflags => '-L. -lparrot', + libparrot_linkflags => '-L. -lparrot', + ); + + # Setup installed Parrot + my $bindir = $conf->data->get('bindir'); + $bindir =~ s{ }{\\ }g; + $conf->data->set( + inst_libparrot_ldflags => "-L$bindir -lparrot", + inst_libparrot_linkflags => "-L$bindir -lparrot" + ); + + # NCI testing + $conf->data->set(ncilib_link_extra => 'src/libnci_test.def'); } 1; diff --git a/docs/binaries/ops2c.pod b/docs/binaries/ops2c.pod new file mode 100644 index 0000000000..968dc13165 --- /dev/null +++ b/docs/binaries/ops2c.pod @@ -0,0 +1,54 @@ +# Copyright (C) 2011, Parrot Foundation. + +=head1 Name + +ops2c - Convert Parrot opcodes to C + +=head1 Description + +Translate Parrot opcode files (.ops) to C files. + +=head1 Usage + +ops2c [option] + +=head2 Command line Options + +For help, use : + + -h + --help + +To generate the C code for core ops (must be run from within Parrot's build directory), use : + + -c + --core + +To generate the C code for dynamic ops in a single .ops file, use : + + -d + --dynamic + +To suppress error messages, use : + + -q + --quiet + +To suppress #line directives in generated C code (line numbers are not currently supported), use : + + -n + --no-lines + +For debugging option : +To perform all processing without writing to any files, use : + + -g + --debug + +=head1 Help + +For more help or any other question you go to L or +L.Or you can send email to 'parrot-dev@parrot.org'. +You are also invited to join the #parrot IRC channel on irc.parrot.org. + +=cut diff --git a/docs/binaries/parrot-nqp.pod b/docs/binaries/parrot-nqp.pod new file mode 100644 index 0000000000..6dfde2dec2 --- /dev/null +++ b/docs/binaries/parrot-nqp.pod @@ -0,0 +1,80 @@ +# Copyright (C) 2001-2011, Parrot Foundation. + +=head1 Name + +parrot-nqp - Not Quite Perl (6) + +=head1 Description + +This is "Not Quite Perl (6)" -- a High Level Language (HLL) which allows one to +write Perl6-like code. The key feature of NQP is that it's designed to be an +easy-to-parse subset of Perl 6. It is geared towards being a high-level way to +create transformers for Parrot (especially HLL compilers). It is based on +PCT::HLLCompiler. + +NQP is used as a bootstrapping language in for Rakudo, and hence developed +outside of the main Parrot git repository. It is occasionally snapshotted into +the main Parrot codebase so it can be bundled with Parrot releases and be used +by core Parrot developers as well as HLL developers. + +=head1 Usage + +parrot-nqp + +=head2 Command Line Usage + +For help use : + + -h + --help + +To show version use : + + -v + --version + +To display the parse tree for regular expression use : + + --target=parse + +To dispaly the PIR subroutine gererated to match the regular expression use : + + --target=pir + +For dumper use : + + --dumper=s + +To trace use : + + -t=s + --trace=s + +For encoding use : + + --encoding=s + +To combine use : + + --combine + +For stage stats use : + + --stagestats + +For backtrace use : + + --ll-backtrace + +For output use : + + -o=s + --output=s + +=head1 Help + +For more help or any other question you go to L or +L.Or you can send email to 'parrot-dev@parrot.org'. +You are also invited to join the #parrot IRC channel on irc.parrot.org. + +=cut diff --git a/docs/binaries/parrot-prove.pod b/docs/binaries/parrot-prove.pod new file mode 100644 index 0000000000..a1c9814f8d --- /dev/null +++ b/docs/binaries/parrot-prove.pod @@ -0,0 +1,98 @@ +# Copyright (C) 2001-2011, Parrot Foundation. + +=head1 Name + +parrot-prove - Prove is a PIR-based TAP (Test Anything Protocol) Harness + +=head1 Description + +It eats test output (i.e. is a TAP consumer) and tells humans if the +test suite passed, and if not, which kind of pretty colors of smoke +came out. It is mostly equivalent to 'prove' from Perl 5. + +=head1 Usage + +parrot-prove [option] [files] + +=head2 Command line boolean options + +To print all test lines use : + + -v + --verbose + +To run the tests in random order use : + + -s + --shuffle + +To show failed tests use : + + -f + --failures + +To show comments use : + + -o + --comments + +To ignore exit status from test scripts use : + + --ignore-exit + +To merge test scripts STDERR with their STDOUT use : + + -m + --merge + +To run tests in reverse order use : + + --reverse + +To suppress some test output while running tests use : + + -q + --quiet + +To print only summary result use : + + -Q + --QUIET + +To show only results with TODO or SKIP directives use : + + --directives + +To normalize TAP output in verbose output use : + + --normalize + +To display help use : + + -h + --help + +To display version use : + + -v + --version + +=head2 Command line options that take arguments + +To interpreter to run the tests (' ' for compiled tests.) use : + + -e + --exec + +To store the resulting TAP in an archive file use : + + -a + --archive + +=head1 Help + +For more help or any other question you go to L or +L.Or you can send email to 'parrot-dev@parrot.org'. +You are also invited to join the #parrot IRC channel on irc.parrot.org. + +=cut diff --git a/docs/binaries/parrot.pod b/docs/binaries/parrot.pod new file mode 100644 index 0000000000..eff6068a0a --- /dev/null +++ b/docs/binaries/parrot.pod @@ -0,0 +1,414 @@ +# Copyright (C) 2011, Parrot Foundation. + +=pod + +=head1 NAME + +parrot - Parrot Virtual Machine + +=head1 SYNOPSIS + +B [-options] [arguments ...] + +=head1 DESCRIPTION + +Parrot is a virtual machine designed to efficiently compile and execute +bytecode for dynamic languages. Parrot currently hosts a variety of language +implementations in various stages of completion, including Tcl, Javascript, +Ruby, Lua, Scheme, PHP, Python, Perl 6, APL, and a .NET bytecode translator. +Parrot is not about parrots, but we are rather fond of them, for obvious +reasons. + +=head1 OPTIONS + +=over 4 + +=item B<-h> + +=item B<--help> Print the option summary on the command line. + +=item + +=item B<-V> + +=item B<--version> Print version information and exit. + +=item + +=item B<-I> + +=item B<--include> Add C to the include search path. + +=item + +=item B<-L> + +=item B<--library> Add C to the library search path. + +=item + +=item B<--hash-seed> [hexnum] + +=over 11 + +Sets the hash seed to the specified value. This option is useful for debugging intermittent +failures, but should I be used in production. For more information about this option, +I F, F, F, +and F. + +=back + +=item B<-X> + +=item B<--dynext> Add C to the dynamic extension search path. + +=back + +=head2 Run core options + +These options select the runcore, which is useful for performance tuning and debugging. For more +information about these options, I the "About runcores" section in F. + +=over 4 + +=item B<-R> + +=item B<--runcore> [CORE] + +=over 11 + +Select the runcore. The following cores are available in Parrot, but not all +may be available on your system: + + slow, bounds bounds checking core (default) + + fast bare-bones core without bounds-checking or + context-updating + + subprof subroutine-level profiler + (see POD in 'src/runcore/subprof.c') + + trace bounds checking core with trace info + (see 'parrot --help-debug') + + profiling see 'docs/dev/profilling.pod' + + gcdebug performs a full GC run before every op dispatch + (good for debugging GC problems) + +=back + +=item B<-p> + +=item B<--profile> Run with the slow core and print an execution profile. + +=item + +=item B<-t> + +=item B<--trace> Run with the slow core and print trace information to B. + +=over 11 + +I C for available flag bits. + +=back + +=back + +=head2 VM options + +=over 4 + +=item B<-D> + +=item B<--parrot-debug>[=HEXFLAGS] + +=over 11 + +Turn on interpreter debug flag. I C for available flag bits. + +=back + +=item B<--help-debug> Print the summary of debugging and tracing flag bits. + +=item + +=item B<-w> + +=item B<--warnings> Turn on warnings. + +=over 11 + +I C for available flag bits. + +=back + +=item B<-G> + +=item B<--no-gc> Turn off GC. + +=over 11 + +This may prove useful for finding GC-related bugs. + +=back + +=over 11 + +=item Note: + +Do not use this option for longer running programs: since memory is no longer recycled, it may +quickly become exhausted. + +=back + +=item B<-g> + +=item B<--gc> [GC-type] + +=back + +=head3 GC MS2 options + +=over 4 + +=item B<--gc-dynamic-threshold>=percentage + +=over 11 + +Maximum memory wasted by GC + +=back + +=item B<--gc-min-threshold>=Kb + +=back + +=head3 GC GMS options + +=over 4 + +=item B<--gc-nursery-size>=percent of system + +=over 11 + +Size of gen0 (default 2) + +=back + +=item B<--gc-debug> Turn on GC (Garbage Collection) debugging. + +=over 11 + +This imposes some stress on the GC subsystem and can considerably slow +down execution. + +=back + +=item B<--leak-test|--destroy-at-end> + +=over 11 + +Free all memory of the last interpreter. This is useful when running leak +checkers. + +=back + +=item B<-.> + +=item B<--wait> Read a keystroke before starting. + +=over 11 + +This is useful when you want to attach a debugger on platforms such as Windows. + +=back + +=item B<--runtime-prefix> + +=over 11 + +Print the runtime prefix path and exit. + +=back + +=back + +=head2 Compiler options + +=over 4 + +=item B<-d> + +=item B<--imcc-debug>=[HEXFLAGS] + +=over 11 + +The B<-d> switch takes an optional argument, consisting of a hexadecimal value +of debug bits. If no value is supplied, 'debug' is set to 1. + +To list the individual bits on the command line, use the B<--help-debug> switch. + +To produce a vary large output on F, run C<"parrot B<-d 0ffff> ...">. + +=back + +=item B<-v> + +=item B<--verbose> One C<-v> shows which files are worked on and prints + +=over 11 + +a summary over register usage and optimization stats per I. With +two C<-v> switches, C prints a line per individual processing step too. + +=back + +=item B<-E> + +=item B<--pre-process-only> + +=over 11 + +Preprocess source file (expand macros) and print result to C: + + $> parrot -E t/op/macro_10.pasm + $> parrot -E t/op/macro_10.pasm | parrot -- - + +=back + +=item B<-o> + +=item B<--output>=FILE Act like an assembler, but do not execute the code, + +=over 11 + +unless the B<-r> is supplied as well. If 'outputfile' ends with F<.pbc>, +'parrot' will write a PBC file. If it ends with F<.pasm>, 'parrot' will output +a PASM file, even from PASM input. This can be useful when needing to check +various optimizations, including C<-Op>. + +=back + +=item B<--output-pbc> Act like an assembler, but always output bytecode, + +=over 11 + +even if the output file does not end in F<.pbc> + +=back + +=item B<-O> + +=item B<--optimize>[=LEVEL] + +=over 11 + +Optimization levels + + -O0 no optimization (default) + -O1 optimizations without life info (e.g. branches) + -O same + -O2 optimizations with life info + -Op rewrite I and N PASM registers most used first + -Ot select fastest runcore + -Oc turns on the optional/experimental tail call optimizations + +I F for more information on the optimizer. + +=back + +=over 11 + +=item Note: + +Optimization is currently an experimental feature and these options are likely to change. + +=back + +=item B<-a> + +=item B<--pasm> Assume PASM input on C. + +=item B<-c> + +=item B<--pbc> Assume PBC file on C and execute it. + +=over 11 + +NOTE: If whitespace separates the B<-d> switch from the argument, the argument +I start with a number, I, a decimal digit. + +=back + +=item B<-r> + +=item B<--run-pbc> Only useful after C<-o> or C<--output-pbc>. + +=over 11 + +Execute the program from the compiled in-memory image. If two C<-r> options are +supplied, the F<.pbc> file is read from disc and executed. This is needed, +primarily, for tests. + +=back + +=item B<-y> + +=item B<--yydebug> Turn on yydebug in F/F. + +=back + +=head2 + +If the file ends in F<.pbc> it will be interpreted immediately. + +If the file ends in F<.pasm>, then it is parsed as PASM code. Otherwise, it is +parsed as PIR code. In both cases, it will then be executed, unless the C<-o> +flag was supplied. + +If the C is a single dash, input from C is read. + +=head2 [arguments ...] + +Optional arguments passed to the running program as ARGV. The program is +assumed to know what to do with the arguments. + +=head1 ENVIRONMENT + +=over 4 + +=item PARROT_RUNTIME + +If this environment variable is set, parrot will use this path as its runtime +prefix instead of the compiled-in path. This is useful if you want to execute +a version of parrot different from the one on the "compiled-in" path. + +=item PARROT_GC_DEBUG + +Turn on the I<--gc-debug> flag. + +=back + +=head1 SEE ALSO + +'docs/running.pod' Additional information on command line options. +http://www.parrot.org/ The official Parrot web site. +http://docs.parrot.org/ Parrot's official documentation site. +http://parrot.github.com/ An alternative documentation site. + +=head1 REPORTING BUGS + +For information on how to submit a bug report, I F. + +=head1 AUTHORS + +Parrot is a product of the contributions of a great many people. For a list of +most of these people, I F. + +=head1 COPYRIGHT + +Copyright (C) 2001-2011, Parrot Foundation. + +=cut diff --git a/docs/binaries/parrot_config.pod b/docs/binaries/parrot_config.pod new file mode 100644 index 0000000000..40fd7d3e9d --- /dev/null +++ b/docs/binaries/parrot_config.pod @@ -0,0 +1,36 @@ +# Copyright (C) 2011 Parrot Foundation. + +=head1 Name + +parrot_config - Parrot Configuration + +=head1 DESCRIPTION + +parrot_config can be used find out compile-time configuration information about +the Parrot executable. + +=head1 SYNOPSIS + +To print every available key: + + parrot_config --dump + +With specific key it will print only it's corresponding value. + +To get the current version of Parrot: + + parrot_config VERSION + +To get a descriptive version string that will uniquely identify +commits which are not releases: + + parrot_config git_describe + +=head1 Help + +For more help or any other question you go to L or +L.Or you can send email to +'parrot-dev@parrot.org'. You can also join Parrot IRC channel: #parrot +on irc.parrot.org . + +=cut diff --git a/docs/binaries/parrot_nci_thunk_gen.pod b/docs/binaries/parrot_nci_thunk_gen.pod new file mode 100644 index 0000000000..869bd0c6f2 --- /dev/null +++ b/docs/binaries/parrot_nci_thunk_gen.pod @@ -0,0 +1,73 @@ +# Copyright (C) 2001-2011, Parrot Foundation. + +=head1 Name + +parrot_nci_thunk_gen - Create Parrot NCI thunks + +=head1 Description + +This utility creates C file of routines suitable for use as Parrot Native Call Interface thunks. + +=head1 Usage + + parrot_nci_thunk_gen [option] -o output_c_file.c < input_signature_list.nci + +=head2 Command line Options + +To print help message and exit use : + + --help + +To print version number of this utility use : + + --version + +Not to complain about duplicated signatures (default is to warn) use : + + -f + --no-warn-dups + +To output a thunk file suitable for inclusion in Parrot core (default is no) use : + + --core + +To use default values for loader-name, loader-storage-class, and target suitable +for use in Parrot dyntex library use : + + --dyntex + +To specify output file use : + + -o + --output + +To select what to output (valid operation are 'head', 'thunks', 'loader', +'loader-dyntex', 'coda', 'all', 'all-dyntex', 'names' and 'signatures') +(default is 'all') use : + + --target + +To set storage class used for the thunks (default value is static) use : + + --thunk-storage-class + +To set the prototype used for the thunk function names.Must be a printf +format with arity 1 (default value is 'pcf_%s') use : + + --thunk-name-proto + +To set the storage class used for the loader funtion (default value is none) use : + + --loader-storage-class + +To set the name used for the leader function (default value is 'Parrot_load_nci_thunks') use : + + --loader-name + +=head1 Help + +For more help or any other question you go to L or +L.Or you can send email to 'parrot-dev@parrot.org'. +You are also invited to join the #parrot IRC channel on irc.parrot.org. + +=cut diff --git a/docs/binaries/parrotbug.pod b/docs/binaries/parrotbug.pod new file mode 100644 index 0000000000..3d5bd7034b --- /dev/null +++ b/docs/binaries/parrotbug.pod @@ -0,0 +1,95 @@ +# Copyright (C) 2001-2011, Parrot Foundation. + +=head1 Name + +parrotbug.pod - Parrot bug report + +=head1 Description + +A program to help generate bug reports about parrot, and mail them. +It is designed to be used interactively. Normally no arguments will +be needed. + +=head1 Usage + +parrotbug [option] [action] + +=head2 Comman line Options + +To report successful build on this system to parrot developers use : + + --ok + +Only use C<--ok> if everything was ok.If there were any problems at all, use : + + --nok + +It is used to Report unsuccessful build on system. + +To include specific summary with the message use : + + --summary + +To include specific category to the bug report use : + + --category + +To include severity to the bug report use : + + --severity + +To set your emal addres use : + + --from
+ +To open editor to use for editing the bug report use : + + --editor + +Not to send a bug report which receive acknowledgement use : + + --ack + --noack + +To open a file containing the body of the report use : + + --input-file + +Use this to quickly send a prepared message. + +To view file where parrotbug will save it's bug report use : + + --output-file + +Note: you will be prompted if the program miss some information. + +=head2 Command line Actions + +To dump message use : + + --dump + +To save message use : + + --save + +To print help message and exit after that use : + + --help + +To print version information and exit after that use : + + --version + +=head1 Help + +For more help or any other question you go to L or +L.Or you can send email to 'parrot-dev@parrot.org'. +You are also invited to join the #parrot IRC channel on irc.parrot.org. + +=cut + + + + + diff --git a/docs/binaries/pbc_to_exe.pod b/docs/binaries/pbc_to_exe.pod new file mode 100644 index 0000000000..3aae981c2d --- /dev/null +++ b/docs/binaries/pbc_to_exe.pod @@ -0,0 +1,67 @@ +# Copyright (C) 2011, Parrot Foundation. + +=head1 Name + +pbc_to_exe - Generate executables from Parrot bytecode + +=head1 Description + +This utility compiles bytecode to native executables. These are called +"fakecutables", because they are actually just the bytecode packaged up as raw +data inside a C skeleton. + +=head1 Usage + +pbc_to_exe [option] + +=head2 Command line Options + +For help use : + + -h + --help + +To install use : + + -i + --install + +To runcore or to change runcore use : + + -R + --runcore=slow|fast + +For output file use : + + -o + --output=FILE + +To change garbage collector algorithm use : + + --gc=ms2|gms + +C is default. C is older and slower + +=head2 Synopsis + + pbc_to_exe my.pbc + +Will generate : + + my.exe + +And + + pbc_to_exe my.pbc --install + +Will generate : + + installable_my.exe + +=head1 Help + +For more help or any other question you go to L or +L.Or you can send email to 'parrot-dev@parrot.org'. +You are also invited to join the #parrot IRC channel on irc.parrot.org. + +=cut diff --git a/docs/binaries/plumage.pod b/docs/binaries/plumage.pod new file mode 100644 index 0000000000..2c42e745cc --- /dev/null +++ b/docs/binaries/plumage.pod @@ -0,0 +1,147 @@ +# Copyright (C) 2001-2011, Parrot Foundation. + +=head1 Name + +plumage.pod - Parrot Plumage + +=head1 Description + +Parrot Plumage is the Parrot Virtual Machine module ecosystem. It includes +tools to search metadata, handle dependencies, install modules, and so forth. + +=head1 Usage + +plumage [] [] + +=head1 Command line options + +For help about options and commands you can type: + + plumage usage + +Or to use command line option help : + + plumage -h + plumage --help + +To read additional config file use : + + -c + +Or if you want to use specific path use : + + --config-file= + +To ignore any failed build stages use : + + -i + --ignore-fail + +To ignore fails only for specific stage use : + + --ignore-fail= + +You can repeat to select more than one stage. +Not to ignore fail in specific stage use : + + --ignore-fail==0 + +=head1 Command line commands + +=head2 General commands + +To start interactive command-line interface (default with no commands) use : + + cli + +To display Plumage version and copyright statement use : + + version + +To display help message on specific command use : + + help [] + +=head2 Query metadata and project info + +To list all known projects use : + + projects + +To show status of specific project use : + + status [] + +To display detailed description of specific project use : + + info + +To dispay JSON metadata for specific project use : + + metadata + +To Show dependencies for specific project use : + + show-deps + +To display top directory for specific project use : + + project-dir + +=head2 Perform actions on a project + +To downloads source code for specific project use : + + fetch + +To update source code for specific project use (it fall bacj to fetch) : + + update + +To configure source code for specific project use (runs 'update' furst) : + + configure + +To build specific project in current directory (runs 'configure' first) : + + build + +To run test suite for specific project use (runs 'build' first) : + + test + +To send test result po Parrot's Smolder server use (runs 'build' first) : + + smoke + +To install specific project use (runs 'test' first) : + + install + +To uninstall specific project from system use (not always available) : + + uninstall + +To perform basic cleanup of source tree for specific project use : + + clean + +To remove all generated files during the build process for specific project use : + + reaclean + +=head1 Help + +For more help or any other question you go to L or +L.Or you can send email to 'parrot-dev@parrot.org'. +You are also invited to join the #parrot IRC channel on irc.parrot.org. + +=cut + + + + + + + + diff --git a/docs/binaries/winxed.pod b/docs/binaries/winxed.pod new file mode 100644 index 0000000000..ae9a7b3808 --- /dev/null +++ b/docs/binaries/winxed.pod @@ -0,0 +1,40 @@ +# Copyright (C) 2001-2011, Parrot Foundation. + +=head1 Name + +winxed.pod - The Winxed Language + +=head1 Description + +This is Winxed, a High Level Language (HLL) that is packaged with Parrot +for tool, library and language development. + +Winxed is Javascript-ish. If you are looking for something more Perl-ish, +you want NQP. + +=head1 Usage + +winxed [option] [program] [args] + +=head2 Command line otions + + '-c' : is used to compile to pir. + '-e==s' : is used to evaluate. + '-o==s' : is used to get Object name. + '-target=s' : is used to set target type. + '-L=s' : is used to add to parrot library search path. + '-I=s' : is used to add to parrot include search path. + '-X=s' : is used to add to parrot dyntex search path. + '--debug' : is used to set debug mode. + '--nowarn' : is used to hide warnings. + '--noan' : is used to hide code annotations. + '--help' : is used to show help for options. + '--version' : is used to show the version of winxed and exit. + +=head1 Help + +For more help or any other question you go to L or +L.Or you can send email to 'parrot-dev@parrot.org'. +You are also invited to join the #parrot IRC channel on irc.parrot.org. + +=cut diff --git a/docs/book/draft/appe_source_code.pod b/docs/book/draft/appe_source_code.pod index 86590a7512..df2958a1a5 100644 --- a/docs/book/draft/appe_source_code.pod +++ b/docs/book/draft/appe_source_code.pod @@ -15,7 +15,7 @@ If you plan to get involved in development, you'll want to check out the source from the git repository directly. Anyone can get anonymous access to read the files and download a working copy to explore and test. For commit access, volunteers need a -U username, and need to be approved by a +U username, and need to be approved by a Metacommitter. To download the most recent version from git, type this command into your terminal N: @@ -42,7 +42,7 @@ There are a number of existing language implementations for Parrot: Perl 6, Python ("Pynie"), Ruby ("Cardinal"), PHP ("Pipp"), Lisp, Lua, Tcl ("partcl"), WMLScript, Forth, Scheme, Befunge, BASIC, and many others. These language compilers are in various stages of partial -completion. The page L +completion. The page L provides meta information on these languages and where to find them. If you have a language you're particularly interested to see implemented on Parrot, you can see how far along the effort is, or you can start the diff --git a/docs/book/draft/ch01_introduction.pod b/docs/book/draft/ch01_introduction.pod index 0a2000a2c2..2d35f75899 100644 --- a/docs/book/draft/ch01_introduction.pod +++ b/docs/book/draft/ch01_introduction.pod @@ -55,13 +55,13 @@ questions or see how things are progressing. =head3 Issue Tracking & Wiki -X -X +X +X -Parrot developers track issues with a Trac site at U. -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. +Parrot developers track issues using the Github issues system at +L Users can submit new tickets and +track the status of existing tickets. Github also provides a wiki used in +project development and a source code browser. =head2 Parrot Development @@ -150,7 +150,7 @@ Developers who work on any of the high-level languages that target ParrotEsuch as Lua, Perl, PHP, Python, Ruby, or TclEare high-level language developers. The Parrot repository includes a few example languages. A full list of languages is available at -U. +L =item Build Manager diff --git a/docs/book/draft/ch10_opcode_reference.pod b/docs/book/draft/ch10_opcode_reference.pod index e16a23e532..aef86c60e9 100644 --- a/docs/book/draft/ch10_opcode_reference.pod +++ b/docs/book/draft/ch10_opcode_reference.pod @@ -1088,11 +1088,11 @@ I X - getprop R, R, R + getprop R, R, R Return the value of a named property on a PMC. -I +I See also: C and C. diff --git a/docs/book/pct/ch01_introduction.pod b/docs/book/pct/ch01_introduction.pod index 0a2000a2c2..2d35f75899 100644 --- a/docs/book/pct/ch01_introduction.pod +++ b/docs/book/pct/ch01_introduction.pod @@ -55,13 +55,13 @@ questions or see how things are progressing. =head3 Issue Tracking & Wiki -X -X +X +X -Parrot developers track issues with a Trac site at U. -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. +Parrot developers track issues using the Github issues system at +L Users can submit new tickets and +track the status of existing tickets. Github also provides a wiki used in +project development and a source code browser. =head2 Parrot Development @@ -150,7 +150,7 @@ Developers who work on any of the high-level languages that target ParrotEsuch as Lua, Perl, PHP, Python, Ruby, or TclEare high-level language developers. The Parrot repository includes a few example languages. A full list of languages is available at -U. +L =item Build Manager diff --git a/docs/book/pct/ch04_pge.pod b/docs/book/pct/ch04_pge.pod index 0b99db8281..0d3511836e 100644 --- a/docs/book/pct/ch04_pge.pod +++ b/docs/book/pct/ch04_pge.pod @@ -65,7 +65,16 @@ X There are two different kinds of rules: C, which we saw above, and C. A C performs smart whitespace matching between the various pieces of the pattern. The C rule given previously would match -"6355 John" or "6355 John" but not "6355John". + + 6355 John + +or + + 6355 John + +but not + + 6355John A C 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<+> @@ -1334,7 +1343,7 @@ 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 +implies that a high-level language itself can modify its own grammar at run time, by overriding the proto definitions for its operator table. Some languages call this process X I. diff --git a/docs/book/pir/ch01_introduction.pod b/docs/book/pir/ch01_introduction.pod index ca7e50e9bf..baf10e464f 100644 --- a/docs/book/pir/ch01_introduction.pod +++ b/docs/book/pir/ch01_introduction.pod @@ -69,14 +69,13 @@ Parrot in real time. =head3 Issue Tracking & Wiki -X -X - -Parrot developers track bugs, feature requests, and roadmap tasks at -U, the open source Trac issue tracker. 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. +X +X + +Parrot developers track issues using the Github issues system at +L Users can submit new tickets and +track the status of existing tickets. Github also provides a wiki used in +project development and a source code browser. =head2 Parrot Development diff --git a/docs/book/pir/ch04_variables.pod b/docs/book/pir/ch04_variables.pod index ba2e487c80..41b79f4b6a 100644 --- a/docs/book/pir/ch04_variables.pod +++ b/docs/book/pir/ch04_variables.pod @@ -1524,7 +1524,7 @@ retrieve the property value. =begin PIR_FRAGMENT - $P2 = getprop "name", $P0 + $P2 = getprop $P0, "name" =end PIR_FRAGMENT @@ -1541,7 +1541,7 @@ value of the property "eric" on C<$P0> and stores it in C<$P2>. $P1 = 1 setprop $P0, "eric", $P1 # set a property on $P0 - $P2 = getprop "eric", $P0 # retrieve a property from $P0 + $P2 = getprop $P0, "eric" # retrieve a property from $P0 say $P2 # prints 1 diff --git a/docs/book/pir/ch05_control_structures.pod b/docs/book/pir/ch05_control_structures.pod index f9dd2448d5..77622813e6 100644 --- a/docs/book/pir/ch05_control_structures.pod +++ b/docs/book/pir/ch05_control_structures.pod @@ -326,7 +326,7 @@ PIR requires one conditional branch and two unconditional branches. The first time through the loop, this example sets the initial value of the counter in C. It then goes on to test that the loop condition is met in C. If the condition is true (C is less than or equal to -10) it jumps to C and executes the body of the loop. If the the +10) it jumps to C and executes the body of the loop. If the condition is false, it will jump straight to C and the loop will end. The body of the loop prints the current counter then goes on to C, which increments the counter and jumps back up to diff --git a/docs/book/pir/ch06_subroutines.pod b/docs/book/pir/ch06_subroutines.pod index 2f8785fe18..9d705e627b 100644 --- a/docs/book/pir/ch06_subroutines.pod +++ b/docs/book/pir/ch06_subroutines.pod @@ -189,7 +189,7 @@ X 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. Consequently you may pass named -parameters in any order. Declare named parameters with with the +parameters in any order. Declare named parameters with the C<:named>X<:named parameter modifier> modifier. This example declares two named parameters in the subroutine C diff --git a/docs/book/pir/ch08_io.pod b/docs/book/pir/ch08_io.pod index ce88b8d40a..e5eecfe8c8 100644 --- a/docs/book/pir/ch08_io.pod +++ b/docs/book/pir/ch08_io.pod @@ -241,17 +241,6 @@ filehandle. The argument can be an integer, number, string, or PMC. =end PIR_FRAGMENT -=head3 puts - -The CX method is similar to C, but it only -takes a string argument. - -=begin PIR_FRAGMENT - - $P0.'puts'('Hello!') - -=end PIR_FRAGMENT - =head3 read The CX method reads a specified number of bytes from the filehandle diff --git a/docs/configuration.pod b/docs/configuration.pod index e2cfd8224b..b5766f4138 100644 --- a/docs/configuration.pod +++ b/docs/configuration.pod @@ -1,4 +1,4 @@ -# Copyright (C) 2004-2008, Parrot Foundation. +# Copyright (C) 2004-2012, Parrot Foundation. =pod @@ -25,7 +25,7 @@ add a new step unless that component I belongs in a current step. For example, if you added a new user-configurable type called C, you would add the code used to determine its size in F. However, if you were determining what dynaloading capabilities are available, you would -create a new step. It is strongly recommended that you file a Trac ticket in +create a new step. It is strongly recommended that you file a Github issue in which you state the rationale for adding a new configuration step and sketch out what the code in the step would look like. diff --git a/docs/deprecations/deprecations.pod b/docs/deprecations/deprecations.pod index 7de05e27c8..b65db92e7e 100644 --- a/docs/deprecations/deprecations.pod +++ b/docs/deprecations/deprecations.pod @@ -66,7 +66,7 @@ notice here and F, so the list should be exhaustive. If you find a deprecation that should be listed here, file a ticket - L + L or hop on #parrot on irc.parrot.org and let us know. =over 4 @@ -146,7 +146,7 @@ This list is a summary. A more complete description and migration path for each change is at F. If you find a deprecation that should be listed here, file a ticket - L + L or hop on #parrot on irc.parrot.org and let us know. =over 4 diff --git a/docs/deprecations/deprecations_3_0.pod b/docs/deprecations/deprecations_3_0.pod index a2aebdfa71..c4abad5089 100644 --- a/docs/deprecations/deprecations_3_0.pod +++ b/docs/deprecations/deprecations_3_0.pod @@ -92,7 +92,7 @@ magic of virtual dispatch. =head3 Rational -They're old, crufty, and don't do anything that cannot be acheived by .call. +They're old, crufty, and don't do anything that cannot be achieved by .call. Except obfuscasion of course. diff --git a/docs/deprecations/how_to_deprecate.pod b/docs/deprecations/how_to_deprecate.pod index 4d65ca1cac..ce781bb98a 100644 --- a/docs/deprecations/how_to_deprecate.pod +++ b/docs/deprecations/how_to_deprecate.pod @@ -97,7 +97,7 @@ page (e.g. [wiki:ParrotDeprecationsFor2.6 ParrotDeprecationsFor2.6]) =item * -walk through the the documentation to ensure that it's sufficient for a user to +walk through the documentation to ensure that it's sufficient for a user to use to upgrade his or her code =item * diff --git a/docs/dev/pccmethods.pod b/docs/dev/pcc_methods.pod similarity index 63% rename from docs/dev/pccmethods.pod rename to docs/dev/pcc_methods.pod index f11ec20c9f..35b619aca0 100644 --- a/docs/dev/pccmethods.pod +++ b/docs/dev/pcc_methods.pod @@ -1,31 +1,30 @@ -# Copyright (C) 2007, Parrot Foundation. +# Copyright (C) 2007-2011, Parrot Foundation. =head1 NAME -docs/dev/pccmethods.pod - Parrot Calling Conventions in C +docs/dev/pcc_methods.pod - Parrot Calling Conventions in C =head1 OVERVIEW -A C is a PMC method that follows Parrot Calling Conventions +A C is a PMC method that follows the Parrot Calling Conventions (a.k.a. PCC). This allows PIR code to call PMC methods using slurpy, named, -and other types of arguments as specified in F. This offers flexibility +and other types of arguments as specified in I. This offers flexibility not found in a PMC C or a vtable function using C calling conventions. C is used to call a method using the Parrot Calling Conventions. -It uses the standard find_method/invoke approach that the callmethodcc opcode -would. You can use C in any PMC method (including v-table methods), -even if they are not Cs. You can call methods that are not -implemented with C, too. - +It uses the standard C/C approach that the +C opcode would. You can use C in any PMC method +(including vtable methods), even if they are not C's. You can call +methods that are not implemented with C, too. =head1 SYNTAX -=head2 PCCMETHOD +=head2 C To declare that a method in a PMC should take arguments using the Parrot Calling Conventions, prefix its name with the keyword C. -Where you would put the C parameter list, put a PCC parameter list. -Do not specify a return type for Cs -- the true +The PCC parameter list is put where you would normally put the C +parameter list. Do not specify a return type for C's; the true signature of the return is specified inside the method using C, described below. @@ -39,8 +38,7 @@ described below. For full details of the parameter list syntax, see L. - -=head2 RETURN +=head2 C To return arguments using the Parrot Calling Conventions, which you should do if you have implemented a C (unless it returns no arguments, of @@ -49,23 +47,28 @@ the L section. RETURN(PMC *status, INTVAL count); - -=head2 PCCINVOKE +=head2 C To call a method on an object using the Parrot Calling Conventions, use -C. This takes 3 arguments, followed by the signature of the call +C. It takes 3 arguments, followed by the signature of the call and the arguments as specified in the L section. The first three arguments, in order, are: =over 4 -=item The current interpreter; use C in a PMC. +=item * + +The current interpreter; use C in a PMC. + +=item * -=item The object to call the method on. Use the C macro for the - current PMC. +The object to call the method on. Use the C macro for the +current PMC. -=item The double-quoted name of the method to call. +=item * + +The double-quoted name of the method to call. =back @@ -82,7 +85,6 @@ For example: PCCINVOKE(interp, SELF, value :named("key") :optional) - =head2 Parameter List Syntax The syntax for a PCC parameter list is a comma separated list of zero or more @@ -95,34 +97,37 @@ more flags specified as adverbs. The list of supported adverbs is listed in F, the calling conventions design document. -Note that unlike PIR, single quotes B be used to quote values +Note that unlike PIR, single quotes I be used to quote values in C-based PCC calls. Also note that in line with the Parrot code standards, you should put the pointer symbol next to the variable, - PMC *param :optional + PMC *param :optional # Good not next to the type. - PMC* param :optional - + PMC* param :optional # Bad =head1 OTHER CONSIDERATIONS =head2 Performance When a C or vtable function is called, C is used to map the -arguments held in the current Parrot_Context onto the C calling conventions. +arguments held in the current C into the C calling conventions. That is, you still end up involving the Parrot Calling Conventions anyway, so there is no reason to expect a C to be any slower. It may well be faster. It's probably best to just not care. :-) It is clearly true that C is going to be more costly than an -invocation of a C method from another C method, if you do the call directly at -the C level. However, if you do that you are ignoring any method overrides if -you have been subclassed, and you wouldn't want to do that now, would you? - +invocation of a C function from another C function, if you do the call directly +at the C level. However, if you do that, you are ignoring any method overrides if +you have been subclassed and you wouldn't want to do that now, would you? -# vim: expandtab shiftwidth=2 tw=70: +=cut +__END__ +Local Variables: + fill-column:78 +End: +vim: expandtab shiftwidth=4: diff --git a/docs/dev/profiling.pod b/docs/dev/profiling.pod index cef9adc318..bde818edc1 100644 --- a/docs/dev/profiling.pod +++ b/docs/dev/profiling.pod @@ -1,4 +1,4 @@ -# Copyright (C) 2001-2005, Parrot Foundation. +# Copyright (C) 2001-2011, Parrot Foundation. =head1 NAME @@ -10,74 +10,112 @@ 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 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. +This file provides an introduction on how to profile code written in a +Parrot-hosted language. Parrot includes profiling as a built-in runcore which +outputs a textual line-based format. This file will generally need to be +post-processed, either by a custom script or by C, which +is installed under C in a standard +installation. + +The profiling runcore can record any annotations added by HLL compilers, though +annotations are ignored by C and are not recorded by default. +This and various other aspects of profiling can be controlled through +environment variables, as described below. =head2 Running Code Under the Profiler - +In Parrot, profiling capability is provided in the form of a built-in runcore +and is available with any installed version of Parrot. The only condition is +that you be able to run your code as a series of arguments passed directly to +the parrot executable, rather than a "fakecutable" (a native executable that +runs built-in hard-coded Parrot bytecode). If you usually run your code via a +fakecutable such as C, you'll need to run C directly instead. +For example, if you run C<./perl6 foo.p6>, instead run C. +If your code can run normally when passed to the C executable +directly, you can easily profile it. -=head2 Profile Post-processing Tools +To profile, add C<-Rprofiling> to the command-line invocation of C +before any C<.pbc> files are added, e.g. C<./parrot -Rprofiling perl6.pbc foo.p6>. +Your program will run more slowly and will end with a message such as - + PROFILING RUNCORE: wrote profile to parrot.pprof.4251 -=head3 Interpreting Post-processed Output +Use F to generate Callgrind-compatible output from this file. - +You now have a raw profile of your code. -=head2 Bugs and Surprises +=head2 Profile Post-processing Tools - +The profiling runcore spits out a line-oriented plain-text file which contains +the timing information for each executed instruction and a description of each +context change. This data should be sufficient to determine any information +about the timing of instructions and subs. The format is intended to be +straightforward and amenable to processing by external tools. +F is included with Parrot and attempts to read a profile +generated by the profiling runcore and produce a profile which +callgrind-compatible tools (e.g. F) can understand. -=head2 Manually Post-processing +=head2 Bugs and Surprises - +In theory the output of F should be compatible with F. In +practice, it isn't. If you have a use case that reliably produces non-sensical +results, talk to cotto on #parrot or file a ticket. =head2 Environment Variables +=head3 Generally Useful Variables + +This section includes environment variables which are likely to be of interest +to developers wishing to profile HLL code. + =over 4 =item C 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. +writing and will happily truncate and overwrite any existing files, including +previous profiles. -If no value is specified, Parrot will write to a file named C, +If no value is specified, Parrot will write to a file named F, 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 and C. When either of these values are detected (case-insensitively), Parrot will print its -profiling output the stdout or stderr. +profiling output to STDOUT or STDERR. + +=item C + +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. =item C This determines the type of output which will contain the profile. Current options are C and C. C 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 writes nothing to the output file. +format by C. C 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 +=back -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. +=head3 Debugging-Related Variables + +These variables are intended primarly for testing of the profiling code itself. +You can play with them if you want, but they probably won't help you get any +useful work done. + +=over 4 =item C When this is set, the profiling runcore will record all addresses as a single -constant value and all times as 1. This options is useful primarily for +constant value and all times as C<1>. This option is useful primarily for testing, where it's helpful to have a way to ensure that a given chunk of code will always produce exactly the same profile. If you want this feature enabled, you also probably want to pass a fixed hash seed to Parrot via diff --git a/docs/embed.pod b/docs/embed.pod index 14f001c9a0..dcbb657f40 100644 --- a/docs/embed.pod +++ b/docs/embed.pod @@ -12,8 +12,8 @@ for the newer API is located at F. =head1 SYNOPSIS - #include - #include + #include "parrot/parrot.h" + #include "parrot/extend.h" int main(int argc, char* argv[]) { @@ -39,8 +39,6 @@ for the newer API is located at F. =over 4 -=item F - =item F =back @@ -462,7 +460,6 @@ performing both compiling and linking in one step. =head2 Load bytecode as a library and run a single subroutine #include - #include #include int main(int argc, char *argv[]) @@ -1227,7 +1224,7 @@ The list may also be augmented if additional functionality is required. =item C -=item C +=item C =item C @@ -1565,8 +1562,6 @@ The list may also be augmented if additional functionality is required. =item C -=item C - =item C =item C diff --git a/docs/faq.pod b/docs/faq.pod index d8480812b0..04bca0f5b0 100644 --- a/docs/faq.pod +++ b/docs/faq.pod @@ -39,7 +39,7 @@ PIR is a high-level assembly language. See the L directory. While the languages that are shipped with our pre-release versions of parrot are in varying states of development, many of them are quite -functional. See L +functional. See L for information about the various languages that are targeting parrot. =head2 What language is Parrot written in? diff --git a/docs/gettingstarted.pod b/docs/gettingstarted.pod index 3e6f99e3e6..195dd320f1 100644 --- a/docs/gettingstarted.pod +++ b/docs/gettingstarted.pod @@ -81,18 +81,18 @@ help us fix them, or let us know where we should fix them. Luckily, all of the current Parrot documentation is included along with the Parrot distribution, in the /docs/ directory. -There is also some experimental auto-generated HTML documentation available by -running the following command in the Parrot distribution's root directory: +We also have auto-generated HTML documentation, which is available through +executing the following command in the Parrot distribution's root directory: % make html -To view the HTML documentation start with the page F. +To view the HTML documentation, start with the F page. -There are a few categories of documentation, each with different intents. It'll -probably help to be aware of them before you go digging in. I highly suggest -you check out F for guidelines on how -documentation is supposed to be laid out. For now, here's the executive -summary: +We have several categories of documentation, each with a different purpose. It +will, probably, prove useful to you if you are aware of them I you go +digging around in them. We strongly suggest you review +F for guidance on how best to layout the +documentation. But for now, here's the executive summary: =over 4 @@ -194,4 +194,4 @@ See F for details. =head2 What other useful resources are there for developers? A number of other useful resources that can be found via on the Parrot -wiki, located at L. +wiki, located at L diff --git a/docs/glossary.pod b/docs/glossary.pod index 08578f8863..6aa4e7919f 100644 --- a/docs/glossary.pod +++ b/docs/glossary.pod @@ -248,13 +248,8 @@ be added, or overridden (for instance, the PAST to PIR transformation). Parrot Design Document: documents that describe the features parrot must implement. -See also L<< http://github.com/parrot/parrot/docs/pdds/pdd00_pdd.pod.html >>. - -=begin html - -pdd00_pdd.pod - -=end html +See also L<< Running|http://docs.parrot.org/parrot/latest/html/docs/running.pod.html >> and +L<< PDD 0: Design Document Format|http://docs.parrot.org/parrot/latest/html/docs/pdds/pdd00_pdd.pod.html >>. =item PGE @@ -262,10 +257,6 @@ Parrot Grammar Engine. See also L<"PCT">. -=item PIL - -Pugs' Intermediate Language. - =item PIR Parrot Intermediate Representation: A medium-level assembly language for Parrot @@ -273,17 +264,6 @@ that hides messy details like register allocation so language compiler writers who target Parrot don't have to roll their own. Files have the extension C<.pir>. -=item PIRATE - -PIRATE is Parrot's next generation compiler, and is currently under development. -IMCC is still the current compiler. - -=item PIRC - -Parrot Intermediate Representation Compiler. It is an experimental attempt -to replace IMCC, but could the PIR for IMCC. Work on PIRC is incomplete, -and the next generation compiler is PIRATE. - =item PMC Polymorphic Container: these classes are the primitives that @@ -302,49 +282,16 @@ See also L<"PCT">. =item Predereferencing -=for comment -XXX This section needs to be edited down. - A bytecode transformation technique which reduces the amount of pointer dereferencing done in the inner loop of the interpreter by pre-converting opcode numbers into pointers to their opfuncs, and also converting the register numbers and constant numbers in the arguments to the ops into pointers. -The original implementation by Gregor Purdy was posted on 2001-12-11. On one -test system, it resulted in a 22% speed increase on a test program with a tight -inner loop. - -L - -On 2001-12-18, predereferencing got a speed boost (to about 47% faster than the -regular DO_OP inner loop -- without compiler optimizations turned on). This was -due to an off-list (actually over lunch) suggestion by John Kennedy that -instead of pre-initializing the new copy of the bytecode with NULL pointers, we -pre-initialize it with pointers to a pseudo-opfunc that does the -predereferencing whenever it is encountered. - -On 2002-04-11, Jason Gloudon suggested combining aspects of the Computed Goto -Core and the Prederef[erencing] Core. - -L - -The week of 2003-02-09, Leopold Toetsch combined Computed Goto and -Predereferencing to produce the CGP core. - -L - -Later, on 2003-02-14, Leopold Totsch and Nicholas Clark combined the JIT and -the Computed Goto Prederef cores to great effect. - -L - =item run core aka run loop, aka runcore. The way Parrot executes PBCs. See running.pod for a list of available runcores, and how to tell -parrot which one to use. - -running.pod: L<< https://github.com/parrot/parrot/parrot/docs/running.pod >> +parrot which one to use. L<< Running|http://docs.parrot.org/parrot/latest/html/docs/running.pod.html >> =item SMOP diff --git a/docs/index/pct_tutorial.json b/docs/index/pct_tutorial.json index 97002e03f9..3fb47564a2 100644 --- a/docs/index/pct_tutorial.json +++ b/docs/index/pct_tutorial.json @@ -13,8 +13,11 @@ "examples/languages/squaak/doc/tutorial_episode_8.pod", "examples/languages/squaak/doc/tutorial_episode_9.pod" ], + "resource" : [ + "examples/languages/squaak/doc/*.png" + ], "title" : "Tutorial of Parrot Compiler Tools" } ], - "title" : "PCT_Tutorial" + "title" : "PCT Tutorial" } diff --git a/docs/index/pdds.json b/docs/index/pdds.json index df31c0077b..4820b90763 100644 --- a/docs/index/pdds.json +++ b/docs/index/pdds.json @@ -5,7 +5,10 @@ "source" : [ "docs/pdds/*.pod", "docs/pdds/draft/*.pod" - ], + ], + "resource" : [ + "docs/pdds/*.png" + ], "title" : "Design Documents" } ], diff --git a/docs/intro.pod b/docs/intro.pod index b0d6931633..5eafe7aba0 100644 --- a/docs/intro.pod +++ b/docs/intro.pod @@ -131,9 +131,9 @@ with. When this completes, you will have a working C executable. Please report any problems that you encounter while building Parrot so the developers can fix them. You can do this by creating a login and opening -a new ticket at L. Please include the F -file that was generated as part of the build process and any errors that you -observed. +a new ticket at L. Please +include the F file that was generated as part of the build +process and any errors that you observed. =head2 The Parrot test suite diff --git a/docs/parrot.pod b/docs/parrot.pod index 81a60c5de8..778238389c 100644 --- a/docs/parrot.pod +++ b/docs/parrot.pod @@ -135,8 +135,6 @@ See: =item * L -=item * L - =item * L =back diff --git a/docs/parrothist.pod b/docs/parrothist.pod index b1dbcba355..8504030193 100644 --- a/docs/parrothist.pod +++ b/docs/parrothist.pod @@ -11,7 +11,8 @@ This document records Parrot source code releases, and their release managers. Simon Cozens, Jeff Goff, Steve Fink, Leo Toetsch, Chip Salzenberg, Jerry Gay, Patrick Michaud, Will "coke" Coleda, Matt Diephouse, chromatic, Allison Randal, Jonathan Worthington, Bob Rogers, Bernhard Schmalhofer, Andrew Whitworth, -Francois Perrad, Jonathan Leto, Michael Hind, James E Keenan. +Francois Perrad, Jonathan "Duke" Leto, Michael Hind, James E Keenan, Alvis +Yardley. =head1 THE RECORDS @@ -129,6 +130,17 @@ Starred release numbers indicate supported releases. Gerd 3.4.0 2011-May-17 "Pacific Parakeet" cotto 3.5.0 2011-Jun-21 "Menelaus" - jkeenan 3.6.0 * 2011-Jul-19 "Pjaros del Caribe" + jkeenan 3.6.0 * 2011-Jul-19 "Pájaros del Caribe" + coke 3.7.0 2011-Aug-16 "Wanda" + soh_cah_toa 3.8.0 2011-Sep-20 "Magrathea" + dukeleto 3.9.0 * 2011-Oct-18 "Archaeopteryx" + Whiteknight 3.10.0 2011-Nov-15 "Apple Pi" + cotto 3.11.0 2011-Dec-20 "Duct Tape" + + Whiteknight 4.0.0 * 2012-Jan-17 "Hyperstasis" + alvis 4.1.0 2012-Feb-21 "Black-headed Parrot" + dukeleto 4.2.0 2012-Mar-20 "Ornithopter" + + cotto 4.3.0 * 2012-Apr-17 "In Which..." =cut diff --git a/docs/pct/gettingstarted.pod b/docs/pct/gettingstarted.pod index 07f8254a2d..3ec5758fa0 100644 --- a/docs/pct/gettingstarted.pod +++ b/docs/pct/gettingstarted.pod @@ -6,14 +6,13 @@ Getting Started with the Parrot Compiler Tools =head1 DESCRIPTION -This document can be considered your Number One entry point for starting to use -the Parrot Compiler Tools (PCT). As there's a whole lot of acronyms flying -around (see Parrot's glossary at -L), -this document will get you up and running within 10 minutes (that excludes -building Parrot). Once you begin, it's a matter of getting your hands dirty and -get experienced using the tools. Feel free to ask questions in -the #parrot channel on irc.parrot.org . +This document can be considered your Number One entry point for starting to +use the Parrot Compiler Tools (PCT). There will be a whole lot of acronyms +flying around. Consult L<< Parrot's glossary|http://docs.parrot.org/parrot/latest/html/docs/glossary.html >> about +them. This document will get you up and running within 10 minutes (that +excludes building Parrot). Once you begin, it's a matter of getting your hands +dirty and get experienced using the tools. Feel free to ask questions in the +#parrot channel on irc.parrot.org . =head1 GETTING STARTED diff --git a/docs/pdds/draft/pdd06_pasm.pod b/docs/pdds/draft/pdd06_pasm.pod index 73f7d31034..1295fd5059 100644 --- a/docs/pdds/draft/pdd06_pasm.pod +++ b/docs/pdds/draft/pdd06_pasm.pod @@ -179,9 +179,7 @@ the instruction if used on PMC registers. In all cases, the letters x, y, and z refer to register numbers. The letter t refers to a generic register (P, S, I, or N). A lowercase p, s, i, or n means either a register or constant of the appropriate type (PMC, string, integer, -or number) - -L for a list of current parrot opcodes, +or number). =head2 References diff --git a/docs/pdds/draft/pdd14_numbers.pod b/docs/pdds/draft/pdd14_numbers.pod index bb856b27a4..6dab970ad9 100644 --- a/docs/pdds/draft/pdd14_numbers.pod +++ b/docs/pdds/draft/pdd14_numbers.pod @@ -126,7 +126,7 @@ different PMC type.}} =item C -Add/subtract/multiply/divide/modulus/exponent an integer value with the the +Add/subtract/multiply/divide/modulus/exponent an integer value with the C PMC, and set the C to the resulting value, morphing it to a C. Note that these are multidispatched. diff --git a/docs/pdds/pdd03_calling_conventions.pod b/docs/pdds/pdd03_calling_conventions.pod index a4e5598caf..86a7b57685 100644 --- a/docs/pdds/pdd03_calling_conventions.pod +++ b/docs/pdds/pdd03_calling_conventions.pod @@ -116,7 +116,7 @@ contents of the aggregate, rather than the aggregate itself, will be passed. If the C bit is also set, the aggregate will be used as a hash; its contents, as key/value pairs, will be passed as named arguments. The PMC -must implement the full hash interface. {{ TT #1288: Limit the required +must implement the full hash interface. {{ GH #252: Limit the required interface. }} If the C bit is not set, the aggregate will be used as an array; its diff --git a/docs/pdds/pdd07_codingstd.pod b/docs/pdds/pdd07_codingstd.pod index 3cc6db1f52..97bed429a9 100644 --- a/docs/pdds/pdd07_codingstd.pod +++ b/docs/pdds/pdd07_codingstd.pod @@ -503,7 +503,7 @@ C that's visible after it's used, which is confusing at best. =item Filenames -Filenames must be assumed to be case-insensitive, in the sense that that you +Filenames must be assumed to be case-insensitive, in the sense that you may not have two different files called F and F. Normal source-code filenames should be all lower-case; filenames with upper-case letters in them are reserved for notice-me-first files such as F, and for files which diff --git a/docs/pdds/pdd10_embedding.pod b/docs/pdds/pdd10_embedding.pod index a8e27e522a..8cb7aa7425 100644 --- a/docs/pdds/pdd10_embedding.pod +++ b/docs/pdds/pdd10_embedding.pod @@ -108,7 +108,7 @@ do less work through the API, and more work through bytecode and the runcore. =item * The embed API uses a single header file: L. Embedding applications should use only this header file and no other header files from Parrot. Embedding applications should NOT use -L or L, or any other files. +L, or any other files. =item * libparrot does little to no signal handling. Those are typically the responsibility of the embedder. @@ -246,7 +246,7 @@ later use. Currently there are two functions to get a bytecode PMC. - Parrot_api_load_bytecode(interp, filename, *pbc) + Parrot_api_load_bytecode_file(interp, filename, *pbc) Parrot_api_load_bytecode_bytes(interp, bytecode, size, *pbc) The first function loads bytecode from a file. The second loads bytecode in diff --git a/docs/pdds/pdd17_pmc.pod b/docs/pdds/pdd17_pmc.pod index 3e2f5a46ab..95ae5bc3fb 100644 --- a/docs/pdds/pdd17_pmc.pod +++ b/docs/pdds/pdd17_pmc.pod @@ -434,6 +434,16 @@ null value passed as the initializer parameter is allowed. NOTE: It is strongly suggested that init_pmc(PMCNULL) be equivalent to init(), though there will of necessity be exceptions. +=item init_init + + void init_int(INTERP, PMC *self, INTVAL initializer) + +Alternative entry point called when a PMC is first instantiated. Accepts an +integer parameter used to initialize the given object. Interpretation of the +integer initializer is left open, each PMC is free to choose its own +implementation. This is very useful for PMCs that require an integer size +parameter and is used as such in FixedPMCArray and related. + =item instantiate PMC* instantiate(INTERP, PMC *self, PMC *init) diff --git a/docs/pdds/pdd19_pir.pod b/docs/pdds/pdd19_pir.pod index 5d35f4be9a..40ffaccb1e 100644 --- a/docs/pdds/pdd19_pir.pod +++ b/docs/pdds/pdd19_pir.pod @@ -815,7 +815,7 @@ becomes: =end PIR_FRAGMENT -Note that this only works for opcodes that have have a leading C +Note that this only works for opcodes that have a leading C parameter. [this restriction unimplemented: TT #906] =item ([ [: ...], ...]) = ([ [: ...], ...]) diff --git a/docs/pdds/pdd20_lexical_vars.pod b/docs/pdds/pdd20_lexical_vars.pod index bd4daa2e56..b9c8d4fddb 100644 --- a/docs/pdds/pdd20_lexical_vars.pod +++ b/docs/pdds/pdd20_lexical_vars.pod @@ -197,7 +197,7 @@ variable, an exception is thrown. If an inner subroutine is invoked that hasn't had a C operation performed on it, then Parrot will attempt to dynamically perform the lexical capture -using the call from from its outer sub. If the outer sub +using the call from its outer sub. If the outer sub doesn't have a call frame, as might occur when jumping directly to the inner sub without previously invoking the outer, then Parrot creates a dummy call frame for the diff --git a/docs/pdds/pdd22_io.pod b/docs/pdds/pdd22_io.pod index 5c2ea7fb7d..11cd72fe38 100644 --- a/docs/pdds/pdd22_io.pod +++ b/docs/pdds/pdd22_io.pod @@ -406,7 +406,7 @@ I/O objects, or an Iterator role applied to I/O objects.] =begin PIR_FRAGMENT - new $P0, [ 'Iterator' ], $P1 + iter $P0, $P1 =end PIR_FRAGMENT diff --git a/docs/project/cage_cleaners_guide.pod b/docs/project/cage_cleaners_guide.pod index 6a1bfb71ea..6562de7b87 100644 --- a/docs/project/cage_cleaners_guide.pod +++ b/docs/project/cage_cleaners_guide.pod @@ -292,6 +292,10 @@ To run parrot under Valgrind, the following argument set should be helpful: (adapted from a post to C by chromatic). +See also the F and F files. C +is a wrapper around running parrot with valgrind and uses a custom set +of "valgrind suppressions". + =head2 IMCC cleanup From #parrot: @@ -367,6 +371,6 @@ Paul Cochrane a.k.a. ptc; original document by Andy Lester =head1 SEE ALSO F, F -and the list of Cage items in Trac L. +and the list of Cage items in github L. =cut diff --git a/docs/project/committer_guide.pod b/docs/project/committer_guide.pod index 0432d4be99..afa2847149 100644 --- a/docs/project/committer_guide.pod +++ b/docs/project/committer_guide.pod @@ -43,7 +43,7 @@ C. This target runs only the file metadata and the basic coding standards tests. In case you want to check the POD of your changed file, you can run -C. +C. =head1 License diff --git a/docs/project/git_workflow.pod b/docs/project/git_workflow.pod index 72f3b4498f..014baabe91 100644 --- a/docs/project/git_workflow.pod +++ b/docs/project/git_workflow.pod @@ -70,7 +70,7 @@ get the latest commits with: Then use this syntax to track the remote branch with a local branch: - git checkout -b username/foo origin/username/foo + git checkout -t origin/username/foo If you are using a very old version of Git, such as 1.5.x.x or older, you will want to tell it to track the remote branch: @@ -139,7 +139,7 @@ the --force flag: git add --force ports/foo NOTE: Make sure these files should actually be added. Most files in .gitignore -should never be added, but some, such as some files in "ports/" will need need +should never be added, but some, such as some files in "ports/" will need the --force flag. Now for actually creating your commit! Since Git is a distributed version @@ -490,6 +490,20 @@ This follows the general pattern of When local_branch_name is empty, you are pushing "nothing" to the remote branch, which deletes it. +=head2 How Can I Tell If A Branch Is Merged? + +To see a list of all remote branches that are not merged into branch foo + + git branch -r --no-merged foo + +If you leave out the last argument, it defaults to HEAD (the tip of the current +branch). So, to see a list of all remote branches that have not been merged +into master: + + git checkout master + git branch -r --no-merged + + =cut __END__ diff --git a/docs/project/hacking_tips.pod b/docs/project/hacking_tips.pod index 8cd98b94e8..1498a37f3a 100644 --- a/docs/project/hacking_tips.pod +++ b/docs/project/hacking_tips.pod @@ -98,6 +98,23 @@ tools/dev/reconfigure.pl exists for that purpose: perl tools/dev/reconfigure.pl --step=gen::makefile +When hacking on Makefile template files such as +F, please: + +=over 4 + +=item * + +Pay attention to situations where F rules require hard-tabs rather than +wordspaces. + +=item * + +Make sure you test your code revisions with both F and, on multi-core +machines, F (where C 1>). + +=back + =cut __END__ diff --git a/docs/project/metacommitter_guide.pod b/docs/project/metacommitter_guide.pod index 59c90c536b..cde86fc2e6 100644 --- a/docs/project/metacommitter_guide.pod +++ b/docs/project/metacommitter_guide.pod @@ -47,34 +47,9 @@ pending list-admin approval. =head2 To manage the list of Metacommitters -Only existing Metacommitters can perform this activity. +To make somebody a new metacommitter, add their github account to the "Owners" +team at L. -=over 4 - -=item 1 - -Navigate to the Admin -> Permissions page -L and add/remove -"admin" users as desired. - -=back - -=head2 To manage the list of Bug Admins. - -Only existing Metacommitters can perform this activity. - -=over 4 - -=item 1 - -Navigate to the Admin -> Permissions page -L and add/remove -"developer" users as desired. - -Verify that the username is the one the user intends to use to -administer tickets. (Some bugadmins have multiple Trac accounts.) - -=back =head1 SEE ALSO diff --git a/docs/project/release_manager_guide.pod b/docs/project/release_manager_guide.pod index db853ddcb7..ea3635d090 100644 --- a/docs/project/release_manager_guide.pod +++ b/docs/project/release_manager_guide.pod @@ -1,166 +1,185 @@ -# Copyright (C) 2007-2011, Parrot Foundation. +# Copyright (C) 2007-2012, Parrot Foundation. =head1 RELEASE MANAGER GUIDE -To prepare a release: +This guide lays out, in detail, the steps necessary to prepare, to assemble, +and to publish a parrot release. Please ensure you carefully follow each +step in the process, and, as always, if you have any questions, please ask. -=head2 I. Preparation during Month before Release +NOTE: You can use the newish/experimental script auto_release.pl to automate +much of his guide (up to section IX): + + perl tool/release/auto_release.pl X.Y.Z + +Run perldoc on the tool to get more documentation. + +=head2 I. Preparations During the Month Before a Release =over 4 =item 1 -As soon as you become the release manager: review the goals for the release on -the Parrot roadmap (L) and -announce the tasks to the Parrot mailing list. Make sure everyone knows what -they've committed to accomplish in time for the release. +As soon as you become the release manager, review any goals for the release. +Presently, the best way to determine this is to ask on C<#parrot> or, +alternatively, email a query to the C mailing list. If there are +goals for the release, please annouce them on C. As well, please +ensure everyone understands what they've committed to accomplish in time for +the release. =item 2 -Right after the release preceding 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. +Shortly after the release preceding to your release, it is a good idea to start +tracking Parrot news in F. A good resource is the individual reports +posted in the weekly IRC meeting on C<#parrotsketch>. You may obtain a complete +log of these meetings at L. =item 3 -A couple of weeks in advance: Ask people to run C 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. +A couple of weeks in advance of the release, ask people to run C +and report (and hopefully fix!) any problems they discover. Check-in with +language project leaders (I Rakudo) for any potential release blockers. +This will, hopefully, afford them sufficient time apply any fixes. Also, +please ask people to review any issues targeted for the upcoming release at +L. =item 4 -In the course of the release you will need to be able to log in and operate on -two different servers. To oversimplify a bit, you will need to be able to -execute these two commands and their C equivalents. +During the course of the release process, you will need to be able to log in +and operate on two different servers. To oversimplify a bit, you will need to +be able to execute these two commands and their C equivalents. =over 4 =item * C -Make sure your SSH key(s) have been added to the FTP server -C. You can open a support ticket for this by sending an -email to C with your SSH keys as attachments. -Without the key you won't be able to ship the release. +In order to do this, please ensure your public SSH key(s) have been added to +the FTP server L. You can open a support ticket for this by +sending an email to C with your public SSH keys as +attachments. Without them, you will not be able to ship the release. =item * CusernameE@parrot.org> -Set up your account on L. Any previous release -manager may be able to help you, but you may also need to open a support -ticket at C in order to be added to the C group. -The C group has permissions to create the new directories needed to -hold documentation for new releases. +Also, set up your account on L. Any previous release +manager should be able to help you, but you may also need to open a support +ticket at C in order to be added to the C group. +The C group has permissions to create the new directories necessary to +contain documentation for new releases. =back =item 5 -A couple of days in advance: announce the new release to -C and to the IRC channel #parrot. Ask whether -there are any showstopping bugs. Check in again with the language -project leads. It's also good to ask for updates to F, F, -F, F, F and -L. +A couple of days in advance, announce the new release to +C and to the IRC channel C<#parrot>. Ask whether +there are any showstopping bugs. Check-in again with the language project +leads. It's also good to ask for updates to +L, +L, +L. +L, +L, +and L. =item 6 -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. +On the Saturday before the release, you should notify other developers to stop +committing non-release related code to the master branch. This will help to +avoid complications. They are, of course, free to commit to branches as much +as they want. You may also set the topic in C<#parrot>, announcing the +time you plan to start the release procedure. This will aid the committers. =item 7 -You might also select a name (and optionally a quote) for your release. -For example, you could select a name from +You may also select a name (and optionally a quote) for your release. For +example, you could select a name from L. =item 8 -NOTE: Build a recent version of Parrot to have available during the release -to help with bootstrapping. You must have a version of Parrot built and -available to you for some of the subsequent steps. +B You must have a recent version of Parrot already built for some of the +subsequent steps. =back -=head2 II. Check C Status +=head2 II. Get the Most Recent Changes -The day of the release has come. -Make sure you have the most recent version of the master branch: +The day of the release has arrived. Please ensure you have checked out the most +recent version of the master branch: - git checkout master && git pull --rebase + git checkout master + git pull --rebase -Also be sure you do not have any local commits that have not yet -been pushed out and tested thoroughly. You can check for this with +Also, ensure you do not have any local commits which have not yet been pushed +and thoroughly tested. You can do so with the following command: git log origin/master.. -If there is no output from that command, then your local master -and the master on origin are in sync. +If this produces no output, then your local master and the remote master are +in sync. -=head2 III. Update Version +=head2 III. Update the Release Version -Update files with version-specific information, but before doing this you -should have parrot configured and have run C with the old version: +First, ensure you have configured Parrot (C) and ran +C and C with the old version of Parrot. Second, save a copy +of the entire 'docs/' directory to some temporary location; you will need +them later in I
below. Next, update files with the following +version-specific information. =over 4 -=item 1 +=item 1. =over 4 -=item a +=item a. -Use C to update the version string in a -several files. +Use C to update the version string in several +files. For example, - perl tools/release/update_version.pl 3.7.0 + perl tools/release/update_version.pl 3.8.0 -=item b +B The version change you just made by running +F invalidates any existing generated bytecode. +Assuming you ran it in a directory with an existing build, you must now +run C to clear out any invalid bytecode. -B The version change you just effected by running -F effectively invalidates existing generated -bytecode. Assuming, as is likely, that you ran C in a -directory with an existing build, you must next run C to clear -out this now invalid bytecode. (Note that this script takes care of modifying -generated code, so C is no longer necessary for the -release process.) +=item b. -=item c +Update the version number, the date, and your name in L. -Also update the version number, date, and your name in the -the file: F. +=item c. -=item d - -Update this file, that is F, -to remove the pending release you're in the middle of. +Update this file +(L) +to remove the pending release you're currently building. =back =item 2 -Update F, F with the new version number and any other -changes that have occurred since the last release: Hopefully these files -are being updated as committers work. If not, it's probably a good idea -to gather the updates weekly rather than waiting until the day of the -monthly release. +Run + + perl tools/dev/new_changelog_skeleton.pl + +to update F with the new version number and a skeleton announcement. + +Add any other changes which have occurred since the last release. Hopefully, +the committers are updating these files as they work. But, if not, then it's +probably a good idea to gather the updates weekly rather than wait until the +day of the release. =item 3 -Update release-related information in F. This will -be used later when making release announcements. There are a few essential -fields that must be updated at each release: +Update release-related information in F. You will +use this later for the release announcements. There are a few, essential +fields which must be updated at each release: =over 4 =item C -The date of the next release is in L. +The date of the next release (I +L). =item C @@ -168,7 +187,7 @@ Enter the date of the Saturday before the next release. =item C -Update the date part of the link to the wiki page for the next bugday. +Enter the date part of the link to the wiki page for the next bugday. =item C @@ -186,48 +205,48 @@ Give yourself credit for the release in F. =item 6 -Configure parrot and run C, and either fix -what those tests complain about, or fix them so they don't complain. +Configure Parrot and run C. Then either fix what those +tests complain about or fix the tests so they don't complain. =item 7 -If this is a developer release, or there have been no new entries to the -F file, skip this step. +B You may skip the following step if this is a developer release or +if there have been no new entries to F. -If this is a supported release, and new entries to F have been -added since the last supported release, make a new entry with a new major -version number for this release at the top of the list. +If this is a supported release and new entries to F have been +added since the last supported release, add a new entry with a new major +version number for this release at the top of the list. For example, 3.0 2007.10.17 coke released 0.4.17 Delete all minor version numbers since the last major bytecode version number, -as these are only used in development and not relevant to the bytecode support -policy. (Those changes are all included within the major version number -increase for the supported release.) +as these are used only in development and are not relevant to the bytecode +support policy. Those changes are all included within the major version number +increase for the supported release. -Once you've updated PBC_COMPAT, running C if -necessary, then run C to update the pbc files used -in the native pbc tests. Note that you must have Parrot already built for -this to work, and that this script will reconfigure and rebuild Parrot with -various primitive size options. +Once you've updated F - running C if +necessary - then run C to update the PBC files used +in the native PBC tests. Note: Parrot must already have built Parrot for this +to work, and this script will reconfigure and rebuild Parrot with various +primitive size options. =item 8 -Make sure everything works: +Verify that the build process runs smoothly: make realclean perl Configure.pl --test ... make world html 2>&1 | tee make_world_html.log make fulltest 2>&1 | tee make_fulltest.log -Note that running "make fulltest" takes a while and that separate -harnesses are being run. +Note that running C takes a while and that separate harnesses +are being run. =back -=head2 IV. Commit Changes +=head2 IV. Push Changes to the GitHub Repository -When all is well, then commit your changes: +When all is well, commit your changes: git diff git add file1 file2 ... @@ -235,50 +254,55 @@ When all is well, then commit your changes: Instead of adding files individually, you can also tell C that you want all modified and deleted files to be in your next commit via the C<-a> -flag: +switch: git commit -a -m "awesome and informative commit message" -Be careful with C, it could add files that you do not mean to -include. Verify that the contents of your most recent commit look sane with: +Be careful with C as it could add files you do not mean to +include. Verify the contents of your most recent commit look sane with: git show -If you want you can note the SHA1 from this commit. +If you want, you can note the SHA-1 digest from this commit by running, git rev-parse master > SHA1_TO_REMEMBER -Update repository on github. +Update the repository on GitHub with, git push origin master -=head2 V. Prepare Tarballs +=head2 V. Prepare the Release Tarballs -Prepare and test the release tarball. There are two possible approaches: +There are two possible approaches to preparing and testing the release tarball: +using C or using C. =over 4 -=item 1 Via C +=item 1. Using C =over 4 -=item a +=item a. -Call: +Begin by running: make release VERSION=a.b.c -where a.b.c is a version number like C<3.6.0>. This will create the tarball -named F. This will automatically avoid including -C in the release tarball. +where a.b.c is the version number (I C<3.8.0>). This will create the +tarball named F. The F file is automatically +excluded from the release tarball. + +=item b. -=item b +Extract F into another directory: -Untar F into another area. + cp parrot-a.b.c.tar.gz ~/another/directory + cd ~/another/directory + tar -xvzf parrot-a.b.c.tar.gz -=item c +=item c. -Make sure everything works: +Verify that the build process runs smoothly: perl Configure.pl make world html 2>&1 | tee make_world_html.log @@ -286,86 +310,89 @@ Make sure everything works: =back -=item 2 Via C +=item 2. Using C -As an alternative, 5 and 6 above, you may wish to call: +As an alternative, you can package the release by running: perl Configure.pl make release_check -This target (or, for short, C), will prepare the tarballs, copy -the F<.gz> tarball to a temporary directory, and then reconfigure, rebuild, -retest (through C) and rerelease. +This target (or, for short, C), will prepare the tarball, copy it +into a temporary directory, and then reconfigure, rebuild, re-test +(with C) and re-release. =back -Whichever of these two approaches you take, verify that the version is correct -and does B contain the suffix C: +Whichever of these two approaches you use, verify the version is correct and +B contain the suffix C: ./parrot -V -=head2 VI. Tag Release +=head2 VI. Tag the Release Commit -Tag the release as "RELEASE_a_b_c", where a.b.c is the version number. +Tag the release as "RELEASE_a_b_c", where a.b.c is the version number: git tag RELEASE_a_b_c git push --tags -=head2 VII. FTP Server +=head2 VII. Push Tarballs to the FTP Server -Log in to ftp-osl.osuosl.org. +Log in to L: ssh parrot@ftp-osl.osuosl.org -(As noted above, your SSH public key must be added to the list -of authorized keys before you can log in.) +As mentioned previously, your public SSH key must be added to the list of +authorized keys before you can log in. -If the release is a monthly development release, create a new directory under -F<~/ftp/releases/devel>. +If this is a development release, create a new directory under +F<~/ftp/releases/devel>: mkdir ~/ftp/releases/devel/a.b.c -If the release is in the supported series (L) -create the new directory in F<~/ftp/releases/supported> instead. +If this is a supported release, (see +L), create the new directory in +F<~/ftp/releases/supported> instead: mkdir ~/ftp/releases/supported/a.b.c -Copy the different compressed tarballs and the according checksum files from -your machine into the new directory. +Copy all the tarballs and their respective digest files from your machine into +the new directory: scp parrot-a.b.c.tar.gz \ parrot-a.b.c.tar.bz2 \ parrot-a.b.c.tar.gz.sha256 \ parrot-a.b.c.tar.bz2.sha256 \ - parrot@ftp-osl.osuosl.org:~/ftp/releases/devel/a.b.c/ + parrot@ftp-osl.osuosl.org:~/ftp/releases/devel/a.b.c -(Or use whatever tool you prefer.) +You don't necessarily have to use C for this step. You can use whichever +tool you prefer. When you're finished making changes, run the trigger script to push the changes -out to the FTP mirrors. +out to the FTP mirrors: - ~/trigger-parrot + ~/trigger-parrot -Check your changes at F. It should +Verify your changes at F. It should only take a few minutes for the mirrors to sync. =head2 VIII. Release Announcement -Compose the release announcement. Use F to make -this part easier. You can specify the format of your announcements like so: +Compose the release announcement. Use F to make this +part easier. You can specify the format of your announcements like so, - ./parrot tools/release/crow.pir --type=text - ./parrot tools/release/crow.pir --type=html + ./parrot tools/release/crow.pir --type=text + ./parrot tools/release/crow.pir --type=html -Take the screen output and paste it into the application you need. HTML works -well for use Perl and PerlMonks, and text for the rest. It is not a bad idea -to add a "highlights" section to draw attention to major new features, just be -sure to say the same thing in both text and HTML versions. +Copy the output and paste it into the application you need. HTML works well for +Perl and PerlMonks and text works well for the rest. It's a good idea (although +not necessary) to add a "highlights" section to draw attention to major new +features. If you do, be sure to say the same thing in both the text and the +HTML versions. -Be sure to include the SHA1 sums of the tarballs in the release announcement; -They're automatically generated by C. +Please ensure you include the SHA256 sums of the tarballs in the release +announcement which are automatically generated by C. -=head2 IX. Update Website +=head2 IX. Update the Website Update the website. You will need an account with editor rights on L. @@ -374,86 +401,103 @@ on L. =item 1 -Add a new page for the release announcement with "Create content" -> "Story". -There's some additional stuff needed at the top of the page; use one of the +Create a new page for the release announcement by navigating to I +-> I. There's some additional stuff needed at the top of the page; use one of the old announcements as a guide. -The "" line marks the end of the text that will appear on the -front page. +The "" line marks the end of the text that will appear on the front page. =item 2 For the "News" category, select both "Releases" and "News". Add tags to the page for significant changes in this release (e.g. "rakudo" -for significant Rakudo language updates, or "gc" for significant garbage +for significant Rakudo language updates or "gc" for significant garbage collection subsystem updates). =item 3 -Under "URL path settings" uncheck "Automatic alias" and set the path to -news/[year]/Parrot-[release number]. +Under I, uncheck I and set the path to +I. =item 4 -Under "Publishing options" make sure "Published" and "Promoted to front page" -are checked. +Under I, make sure I and I are both checked. =item 5 -Under "Administer" -> "Site building" -> "URL Redirects", change the URL for -"release/current" to the FTP file for the new release (for example, -F). -Also update the URL for "release/developer" or "release/supported" depending +Under I -> I -> I, change the URL for +C to the FTP file for the new release (e.g. +F). +Also update the URL for C or C depending on which type of release this is. =item 6 -Update docs.parrot.org. Run C in a release copy of parrot, and save -the F and F directories created in F. ssh into the parrotvm, -and in the webroot for docs.parrot.org, expand these into a release directory -(e.g. 1.4.0). in /parrot, there are symbolic links for latest, -supported, and devel. Update the C symlink to point to your new -directory. If this is a supported release, also update the C -symlink. Do not delete any old copies of the docs, don't update the other -symlinks. +Update L. Run C in a release copy of Parrot, +and save the F and F directories created in F. Use +SSH to login to L<< @parrot.org >> and expand these into a release +directory (e.g. 3.8.0) in the webroot (I +F) for L. In +C<< /parrot >>, there are symbolic links for C, C, +and C. Update the C symlink to point to your new directory. If +this is a supported release, also update the C symlink. Do not +delete any old copies of the docs and don't update the other symlinks. -=back +=item 7 Preview the new page, and submit it. -(The old release announcement may be edited to uncheck "Promoted to front page" -to keep the main page fresh.) +=back + +The old release announcement may be edited to uncheck I +to keep the main page fresh. + +=head2 X. Update parrot.github.com and the Relevant parrot-docsx Repository -=head2 X. Publicity +To update both the C and the relevant C repositories, +execute the following command: -Publicize the release by publishing the announcement through the -following channels (and any others you can think of): + perl tools/release/parrot_github_release.pl + +Please note: To review the available options, use the C<-h | --help> option. +In addition, you may also want to review the pod with, +C. + +For more information about the update process, I +L. + +=head2 XI. Publicity + +Publicize the release by publishing the announcement through the following +channels (and any others you can think of): =over 4 =item 1 -Send a text email to parrot-dev, parrot-users, perl6-language, perl6-announce, -perl5-porters, etc. (Note: perl6-internals is no longer in use, so you don't -need to mail that list.) You should also include LWN.net in this mailing; -email to C at that domain. +Send a text email to C, C, C, +C, C, etc. You should also include L in +this mailing; email to C at that domain. =item 2 -Submit the use Perl announcement story to use Perl, Perl Monks, Slashdot, -Newsforge, etc. Don't forget to set a Reply-To: or Followup-To: header, if -your mail client lets you. +Submit the announcement story to use Perl, Perl Monks, Slashdot, Newsforge, +etc. Don't forget to set a C or C header, if your mail +client lets you. =item 3 -Modify the topic on #parrot, e.g.: +Modify the topic on C<#parrot>, for example, - /topic #parrot Parrot 0.4.8 Released | http://parrot.org/ + /topic #parrot Parrot 4.0.0 "[Name of Parrot Release]" | + http://parrot.org/ | Log: http://irclog.perlgeek.de/parrot | + #parrotsketch meeting Tuesday 19:30 UTC =item 4 -Update the wiki frontpage at L. +Update the wiki frontpage at L =item 5 @@ -466,61 +510,36 @@ Update the C2 wiki entry at L. =back -=head2 XI. Review Milestones - -Review the milestone for the current release in Trac at -L. Close any completed -release-related tickets. Edit the milestone to mark it as "Completed". -Marking a milestone as completed will migrate all open tickets to a -selected milestone (generally the next milestone). Non-critical tickets -can have their milestone unset. - -=head2 XII. Changes to Trac - -Add the version to Trac so new bug reports can be filed against the release. -L. +=head2 XII. Finish -Make the latest released version the default version for new reports. - -Remove any sufficiently old versions listed there. - -=head2 XIII. Finish - -You're done! Help yourself to a beer, cola, or other celebratory drink. - -=head1 ABOUT THIS DOCUMENT - -This document was written after a couple of subtly incorrectly assembled -releases--usually when someone forgot to delete F (which is now -automated!), but at least once where the F check failed. The intent -of this file is to document what must be done to release so that such mistakes -won't happen again. +You're done! Help yourself to a beer, cola, or other delicious celebratory drink. =head1 SEE ALSO -F, F. +L, +L. -=head1 Appendix 1 - Upcoming releases +=head1 Appendix 1 - Upcoming Releases -To make a monthly release schedule possible, we spread the burden of -releases across multiple release managers. Releases are scheduled for -the 3rd Tuesday of each month. +To make a monthly release schedule possible, we spread the burden of releases +across multiple release managers. Releases are scheduled for the 3rd Tuesday of +each month. -The starred releases are Parrot's quarterly supported releases, see -F. +To learn more about our support policy, see +L. -The calendar of releases is available at the comp.lang.parrot google calendar, -visible at +The calendar of releases is available at the C Google +calendar, visible at L. -Versions with a asterisk (*) are supported releases. - - - Aug 16, 2011 - 3.7 - coke - - Sep 20, 2011 - 3.8 - soh_cah_toa - - Oct 18, 2011 - 3.9* - dukeleto - - Nov 15, 2011 - 3.10 - ?? - - Dec 20, 2011 - 3.11 - cotto - + - May 15, 2012 - 4.4.0 - whiteknight + - Jun 19, 2012 - 4.5.0 - alvis + - Jul 17, 2012 - 4.6.0 - ?? + - Aug 21, 2012 - 4.7.0 - ?? + - Sep 18, 2012 - 4.8.0 - ?? + - Oct 16, 2012 - 4.9.0 - dukeleto + - Nov 20, 2012 - 4.10.0 - ?? + - Dec 18, 2012 - 4.11.0 - ?? =cut __END__ diff --git a/docs/project/release_parrot_github_guide.pod b/docs/project/release_parrot_github_guide.pod new file mode 100644 index 0000000000..7e3401b7ea --- /dev/null +++ b/docs/project/release_parrot_github_guide.pod @@ -0,0 +1,321 @@ +# Copyright (C) 2012, Parrot Foundation + +=pod + +=head1 NAME + +docs/project/release_parrot_github_guide.pod - Readme file on how to update +the github pages of the 'parrot.github.com' repository and the supporting +gh-pages branches of the 'parrot-docsx' repositories. + +=head1 DESCRIPTION + +The purpose of this document is to supplement the release manager guide, +I '/docs/project/release_manager_guide.pod', laying out how to publish +Parrot's documentation to the 'parrot.github.com' repository and how to +archive the previous release of Parrot's documentation in the gh-pages branch +of the supporting parrot-docx' repositories. While none of this is particularly +difficult, it is a'bit tricky; hence, this guide. + +Please note: The auto-tool, F has, +largely, superceded the functionality contained within this document.[1] +I F I +F. + +=head2 Assumptions + +This document makes two assumptions: + +=over 4 + +(1) you are the release manager and are working on C
of the release +manager guide (F<'/docs/project/release_manager_guide.pod'>). Specifically, +this document assumes you have already ran C and + +(2) you are working with the 'parrot-docs4' repository in which to archive the +previous Parrot documentation release.[2] + +=back + +=head2 Get the 'parrot.github.com' and supporting 'parrot-docsx' repositories + +The first step is to obtain the two repositories: (1) 'parrot.github.com' and +(2) the relevant repository in which to archive the previous version of +Parrot's documentation, here, 'parrot-docs4'. To do this, clone the two Parrot +repositories with the following commands: + +=over 4 + +C + +C + +=back + +=head2 The 'parrot-docsx' repository + +C to the C directory and C the C branch +of the repo: + +=over 4 + +C + +=back + +You may confirm the C branch with the following command: + +=over 4 + +C + +=back + +Next, make a new directory in which to house the old documentation. For +example,[4] + +=over 4 + +C + +=back + +If you still have a copy of the previous release of Parrot's documentation, +I all of the documents 'docs/' directory, to include the html-ized +documentation, you can just copy the entire contents of C<'docs/'> to the +newly created directory in the, in this example, C repository. +If not, you will need to do the following: + +=over 4 + +=item 1 + +Obtain the C of the previous Parrot distribution at +C; + +=item 2 + +unzip the distribution into a temporary working directory; + +=item 3 + +run C[3] on the distribution; + +=item 4 + +run C; and + +=item 5 + +copy the contents of the C directory to the newly created directory in +the C repo. + +=back + +Once the contents of the C directory are in the newly created directory +in C, it's time to commit and push the updates: + +=over 4 + +C + +C (or some +such) + +=back + +And, lastly, + +=over 4 + +C + +=back + +You are done with the 'parrot-docsx' repository. + +=head2 The 'parrot.github.com' repository + +After completing the above, it's time to move the new docs, I the +present release documentation, to the 'parrot.github.com' repository. To +accomplish this, + +=over 4 + +=item 1 + +save, in some temporary location, the following three documents: + +F; + +F; and + +F. + +=item 2 + +After saving the above files, the simplest way to proceed is to delete all of +the files in 'parrot.github.com'. Since you will need to keep both the F<.git> +directory and the F<.gitignore> file, C works nicely for this. + +It's a good idea to go ahead and commit the changes at this time, so execute, + +=over 4 + +C + +=back + +and + +=over 4 + +C (or some such) + +=back + +=item 3 + +Next, copy all of the files and directories in 'docs/' in the newly +installed distribution of Parrot to 'parrot.github.com' and + +=item 4 + +Add and commit these changes to 'parrot.github.com'. + +=item 5 + +Copy the three files you saved earlier, I, F, F, +and F, back to 'parrot.github.com'. + +=back + +Now, you need to hand-edit both F and F. Open +F in your favorite editor and update the header and footer to +reflect the present release version. That is, edit, for example, the line + +=over 4 + +Parrot 4.0.0-devel - Home + +=back + +to read + +=over 4 + +Parrot 4.1.0-devel - Home + +=back + +and also edit the line + +=over 4 + +
Parrot version 4.0.0-devel + +=back + +to read + +=over 4 + +
Parrot version 4.1.0-devel + +=back + +You also need to update the text accompanying the link to C<./releases.html>. +Edit, again, for example, the line + +=over 4 + +Parrot Documentation Releases (4.0.0 - 0.1.1) + +=back + +to read + +=over 4 + +Parrot Documentation Releases (4.1.0 - 0.1.1) + +=back + +Save your edits. + +Next, open F in your editor and make the following edits: + +=over 4 + +=item 1 + +Edit the header and footer, just as you did above in F. + +=item 2 + +Copy and paste a new list element to point to the earlier release you archived +in the 'parrot-docs4' repository. For example, copy the line, + +=over 4 + +
  • Release 4.0.0
  • + +=back + +and paste it in as the first element of the list. Edit it to read, + +=over 4 + +
  • Release 4.1.0
  • + +=back + +=back + +Save your edits. + +Finally, you are now ready to commit and push your updates to +'parrot.github.com': + +=over 4 + +C + +C (or some such message) + +C + +=back + +It will take anywhere from one to ten (or, occasionally, even fifteen) minutes +for 'parrot.github.com' to rebuild. Once it does, you need test your updates. +You may do so by navigating your browser to 'http://parrot.github.com' and +verifying your changes. Also, please ensure you test the link to the archived +documents in the 'parrot-docs4' repository. + +If everything works correctly, congratulations, you're done with both the +'parrot.github.com' and the 'parrot-docs' repositories! + +=head1 FOOTNOTES + +[1] For the present, we have elected to retain this document, primarily, for +historical purposes and as a reference document for future release managers. + +[2] If you are working with a release of Parrot's documentation greater than +v4.x.x and you do not have, for example, a 'parrot-docs5' repository, you will +need to contact an "owner" and ask him or her to create a new repository. You +will, then, need to follow all of the steps outlined in Github's gh-pages guide +at 'http://pages.github.com/' to set up the repository. + +[3] Here, you do NOT need to worry with any optimizations when configuring +Parrot because you only need the previous documentation release. + +[4] Unless there is good reason to do otherwise, please name the newly created +directory after the F of the Parrot distribution you are archiving in +the repo. Here, in our example, C<4.0.0>. + +=head1 COPYRIGHT + +Copyright (C) 2001-2012, Parrot Foundation. + +=cut diff --git a/docs/project/ticket_triaging.pod b/docs/project/ticket_triaging.pod index 28d57284a9..a131a5484b 100644 --- a/docs/project/ticket_triaging.pod +++ b/docs/project/ticket_triaging.pod @@ -16,15 +16,19 @@ F. =head1 WHAT ABOUT TRAC? -Our preferred method of bug tracking at this point is trac: -L +Our preferred method of bug tracking at this point is github issues: +L All Parrot developers are expected to pitch in and help keep the ticket tracker in a healthy state. I Most of the document below still makes sense in terms of activities in trac, but the specifics are of course different with the new system. -Our previous bug tracking system was RT. In November 2009 all remaining RT +Our previous bug tracking system was trac, hosted at +L. In January 2012 the trac tickets have been +migrated to github issues. + +The bug tracking system before trac 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. The Parrot issues are in the queue I. diff --git a/docs/submissions.pod b/docs/submissions.pod index c1d7ab9ed2..4ee1aed632 100644 --- a/docs/submissions.pod +++ b/docs/submissions.pod @@ -18,10 +18,7 @@ simplest way to use it is to run in the distribution's root directory, and follow the prompts. -If you just want to use email to create the bug report, send an email to -L. - -If you know how to fix the problem you encountered, then think about +If you know how to fix the problem you encountered, then think about submitting a patch, or (see below) getting commit privileges. =head1 A Note on Random Failures @@ -84,11 +81,9 @@ for whatever the distribution's parent directory is called on your machine. =item C -If you are working with a git repository of parrot then please generate -your patch with C. - - cd parrot - git diff > my_contribution.patch +If you are working with a git repository of parrot then please submit your +patch as a pull request on github. You can find instructions at +L =item Single C @@ -128,57 +123,9 @@ The format for entries in F is defined at the top of the file. =head1 How To Submit A Patch -=over 4 - -=item 1 - -Go to Parrot's ticket tracking system at -L. Log in, or create an account if you -don't have one yet. - -=item 2 - -If there is already a ticket for the bug or feature that your patch relates -to, just attach the patch directly to the ticket. - -=item 3 - -Otherwise select "New Ticket" at the top of the site. -L - -=item 4 - -Give a clear and concise Summary. You do B need to prefix the Summary -with a C<[PATCH]> identifier. Instead, in the lower-right corner of the -F page, select status C in the F drop-down box. - -=item 5 - -The Description should contain an explanation of the purpose of the patch, and -a list of all files affected with summary of the changes made in each file. -Optionally, the output of the C utility when run on your patch(s) -may be included at the bottom of the message body. - -=item 6 - -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. As mentioned above, select status C in -the F drop-down box. - -=item 7 - -Check the box for "I have files to attach to this ticket". Double-check -that you've actually done this, because it's easy to forget. - -B paste the patch file content into the Description. - -=item 8 - -Click the "Create ticket" button. On the next page attach your patch -file(s). - -=back +The preferrred method to submit matches to Parrot is as pull requests via +github. Please follow the instructions at +L. =head1 Applying Patches @@ -216,88 +163,21 @@ the MANIFEST and MANIFEST.SKIP file should be regenerated with: perl tools/dev/mk_manifest_and_skip.pl -=head1 How To Submit Something New - -If you have a new feature to add to Parrot, such as a new test. - -=over - -=item 1 - -Add your new file path(s), relative to F, to the file MANIFEST. Create -a patch for the MANIFEST file according to the instructions in B. - -=item 2 - -If you have a new test script ending in C<.t>, some mailers may become confused -and consider it an application/x-troff. One way around this (for *nix users) is -to diff the file against /dev/null like this: - - cd parrot - diff -u /dev/null newfile.t > newfile.patch - -=item 3 - -Go to Parrot's ticket tracking system at -L. Log in, or create an account if you -don't have one yet. - -=item 4 - -Select "New Ticket" L. - -=item 5 - -Give a clear and concise Summary. - -Prefix it with a C<[NEW]> identifier. - -=item 6 - -The Description should contain an explanation of the purpose of the feature -you are adding. Optionally, include the output of the C utility -when run on your patch(es). - -=item 7 - -Set the Type of the ticket to "patch". Set other relevant drop-down -menus, such as Version, Platform, or Severity. - -=item 8 - -Check the box for "I have files to attach to this ticket" - -Double-check that you've actually done this, because it's easy to forget. - -B paste the content of the new file or files into the body of the -message. - -=item 9 - -Click the "Create ticket" button. On the next page attach the patch for -MANIFEST and your new file(s). - -=back - =head1 What Happens Next? -If you created a new ticket for the submission, you will be taken to the page -for the new ticket and can check on the progress of your submission there. -This identifier should be used in all correspondence concerning the submission. - -Everyone on Trac sees the submission and can comment on it. A developer with -git commit privileges can commit it to git once it is clear that it is the -right thing to do. - -However developers with commit privileges may not commit your changes -immediately if they are large or complex, as we need time for peer review. +If you created a new issue, you will be taken to the issue page and can +check on the progress of discussion there. The issue number should be +used in all out-of-band correspondence concerning the issue (e.g., in +email to the C mailing list). Otherwise, everyone on the +parrot project can see the issue and can comment on it. -A list of active tickets can be found here: -L +A developer with git commit privileges can merge your changes into the +main parrot repository, once it is clear that this is the right thing to +do. However your pull request may not be processed right away if the +changes are large or complex, as we need time for peer review. -A list of all the unresolved patches is at: -L +A list of open issues can be found here: +L =head1 Patches for the Parrot website @@ -313,12 +193,12 @@ the procedure: =item 1 -Submit several high quality patches (and have them committed) via the process -described in this document. This process may take weeks or months. +Obtain a github account at L =item 2 -Obtain a Trac account at L +Submit several high quality patches (and have them committed) via the process +described in this document. This process may take weeks or months. =item 3 diff --git a/docs/tests.pod b/docs/tests.pod index 77ba6f2e91..d668b322dc 100644 --- a/docs/tests.pod +++ b/docs/tests.pod @@ -1,4 +1,4 @@ -# Copyright (C) 2001-2007, Parrot Foundation. +# Copyright (C) 2001-2012, Parrot Foundation. =head1 NAME @@ -17,8 +17,7 @@ The easy way to test parrot is running C. If you have updated your code recently and tests began failing, go for a C and recompile parrot before complaining. -C runs the test suite for most language implementations -in the languages directory. +C runs the test suite for all known working HLLs and libraries. =head2 Submitting smolder test results @@ -32,9 +31,7 @@ website. =head1 Location of the test files The parrot test files, the F<*.t> files, can be found in the F directory. -A quick overview over the subdirs in F can be found in F. - -The language implementations usually have their test files in F. +A quick overview about each test directory in F can be found in F. New tests should be added to an existing F<*.t> file. If a previously untested feature is tested, it might also make sense to create a new F<*.t> file. You @@ -97,7 +94,6 @@ C source tests are usually located in F. A simple test looks like: c_output_is(<<'CODE', <<'OUTPUT', "name for test"); #include #include "parrot/parrot.h" - #include "parrot/embed.h" int main(int argc, char* argv[]) { Parrot_Interp interp; @@ -190,7 +186,7 @@ errors if make has completed.) You can run them with any of the following: =head2 Testing language implementations -Language implementations are usually tested with +Language implementations are usually tested with C and friends. =head1 Ideal tests: diff --git a/docs/translations/README.BGR b/docs/translations/README.BGR index cbc1a30dcd..3d0a9d00ad 100644 --- a/docs/translations/README.BGR +++ b/docs/translations/README.BGR @@ -169,8 +169,8 @@ docs/submissions.pod. Тези документи са в POD формат. М Тези сайтове съдържат всичките нужна информация за Parrot: http://www.parrot.org/ - http://trac.parrot.org/ http://docs.parrot.org/ + https://github.com/parrot/parrot/ Забавлявайте се, Екипът на Parrot. diff --git a/docs/translations/README.deutsch b/docs/translations/README.deutsch index ed07a645e0..19c09ccd14 100644 --- a/docs/translations/README.deutsch +++ b/docs/translations/README.deutsch @@ -184,8 +184,8 @@ WEBSEITEN Die folgenden Webseiten geben alle Informationen, die Sie brauchen, über Parrot: http://www.parrot.org/ - http://trac.parrot.org/ http://docs.parrot.org/ + https://github.com/parrot/parrot/ Viel Spaß, Ihr Parrot-Team diff --git a/docs/translations/README.espanol b/docs/translations/README.espanol index a25522802a..4dca73bc89 100644 --- a/docs/translations/README.espanol +++ b/docs/translations/README.espanol @@ -176,8 +176,8 @@ SITIOS WEB Los siguientes sitios web contienen toda la información que necesitas sobre Parrot: http://www.parrot.org/ - http://trac.parrot.org/ http://docs.parrot.org/ + https://github.com/parrot/parrot/ Que se diviertan, El equipo de Parrot. diff --git a/docs/translations/README.francais b/docs/translations/README.francais index a1765877d5..8b191f57fb 100644 --- a/docs/translations/README.francais +++ b/docs/translations/README.francais @@ -182,8 +182,8 @@ SITES WEB Les sites web suivants contiennent toutes les informations dont vous pourriez avoir besoin sur Parrot: http://www.parrot.org/ - http://trac.parrot.org/ http://docs.parrot.org/ + https://github.com/parrot/parrot/ Amusez vous bien, L'Équipe Parrot. diff --git a/docs/translations/README.polski b/docs/translations/README.polski index 4141455318..d13b213f2b 100644 --- a/docs/translations/README.polski +++ b/docs/translations/README.polski @@ -179,8 +179,8 @@ STRONY INTERNETOWE Następujące strony przechowują wszelkie informacje o Parrocie, jakie mogą być Ci potrzebne: http://www.parrot.org/ - http://trac.parrot.org/ http://docs.parrot.org/ + https://github.com/parrot/parrot/ Miłej zabawy, The Parrot Team. diff --git a/docs/translations/README.pt-BR b/docs/translations/README.pt-BR index 11b8e5fd5c..d32e4fd334 100644 --- a/docs/translations/README.pt-BR +++ b/docs/translations/README.pt-BR @@ -184,8 +184,8 @@ WEB SITES Os seguintes sites contém todas as informações que você precisa saber sobre Parrot. http://www.parrot.org/ - http://trac.parrot.org/ http://docs.parrot.org/ + https://github.com/parrot/parrot/ Se divirta, A equipe do Parrot. diff --git a/docs/user/pir/pmcs.pod b/docs/user/pir/pmcs.pod index 64519b5b31..5c18d60627 100644 --- a/docs/user/pir/pmcs.pod +++ b/docs/user/pir/pmcs.pod @@ -220,14 +220,14 @@ environment variables: =begin PIR .sub _ :main - .local pmc env, iter + .local pmc env, it .local string key, value env = new 'Env' # line 3 - iter = new 'Iterator', env # line 4 + it = iter env # line 4 iterloop: - unless iter goto iterend - key = shift iter # line 8 + unless it goto iterend + key = shift it # line 8 value = env[key] print key print ":" @@ -270,7 +270,7 @@ over the command line this same way? Sure! .sub _ :main .param pmc args .local pmc cmdline - cmdline = new 'Iterator', args + cmdline = iter args loop: unless cmdline goto end_loop $S0 = shift cmdline diff --git a/examples/benchmarks/oo1.pir b/examples/benchmarks/oo1.pir index 77c200a15b..e5dcce0e05 100644 --- a/examples/benchmarks/oo1.pir +++ b/examples/benchmarks/oo1.pir @@ -52,13 +52,13 @@ loop: .sub 'init' :vtable .include "interpinfo.pasm" - interpinfo $P2, .INTERPINFO_CURRENT_OBJECT + .param pmc self new $P10, 'Integer' set $P10, 10 - setattribute $P2, ".i", $P10 + setattribute self, ".i", $P10 $P10 = new 'Integer' $P10 = 20 - setattribute $P2, ".j", $P10 + setattribute self, ".j", $P10 .return () .end diff --git a/examples/benchmarks/oo2.pir b/examples/benchmarks/oo2.pir index 4904f80999..fbfac1086a 100644 --- a/examples/benchmarks/oo2.pir +++ b/examples/benchmarks/oo2.pir @@ -38,13 +38,13 @@ loop: .sub 'init' :vtable .include "interpinfo.pasm" - interpinfo $P2, .INTERPINFO_CURRENT_OBJECT + .param pmc self $P10 = new 'Integer' $P10 = 10 - setattribute $P2, ".i", $P10 + setattribute self, ".i", $P10 $P10 = new 'Integer' $P10 = 20 - setattribute $P2, ".j", $P10 + setattribute self, ".j", $P10 .return () .end diff --git a/examples/benchmarks/oo3.pir b/examples/benchmarks/oo3.pir index 32ef13bf0f..1df65f18f7 100644 --- a/examples/benchmarks/oo3.pir +++ b/examples/benchmarks/oo3.pir @@ -26,14 +26,14 @@ loop: .sub init :vtable .include "interpinfo.pasm" - interpinfo $P2, .INTERPINFO_CURRENT_OBJECT + .param pmc self $P10 = new 'Integer' $P10 = 10 - setattribute $P2, ".i", $P10 + setattribute self, ".i", $P10 inc $I0 $P10 = new 'Integer' $P10 = 20 - setattribute $P2, ".j", $P10 + setattribute self, ".j", $P10 .return () .end diff --git a/examples/benchmarks/oo4.pasm b/examples/benchmarks/oo4.pasm deleted file mode 100644 index 6ecc514b6e..0000000000 --- a/examples/benchmarks/oo4.pasm +++ /dev/null @@ -1,43 +0,0 @@ -# Copyright (C) 2004-2009, Parrot Foundation. - -.namespace [ "Foo" ] - -.pcc_sub :main main: - newclass P1, "Foo" - addattribute P1, ".i" - addattribute P1, ".j" - - set I10, 1 - set I11, 500000 - new P3, "Foo" -loop: - new P4, 'Integer' - set P4, I10 - setattribute P3, ".i", P4 - new P4, 'Integer' - set P4, I10 - setattribute P3, ".j", P4 - inc I10 - le 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 - 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: diff --git a/examples/benchmarks/oo4.pl b/examples/benchmarks/oo4.pl deleted file mode 100644 index c169369613..0000000000 --- a/examples/benchmarks/oo4.pl +++ /dev/null @@ -1,29 +0,0 @@ -#! perl - -# Copyright (C) 2004-2006, Parrot Foundation. - -use strict; -use warnings; - -my $o = new Foo(); -for my $i ( 1 .. 500000 ) { - $o->[0] = $i; - $o->[1] = $i; -} -print $o->[0], "\n"; - -package Foo; - -sub new { - my $self = ref $_[0] ? ref shift : shift; - return bless [ 10, 20 ], $self; -} - -1; - -# Local Variables: -# mode: cperl -# cperl-indent-level: 4 -# fill-column: 100 -# End: -# vim: expandtab shiftwidth=4: diff --git a/examples/benchmarks/oo4.py b/examples/benchmarks/oo4.py deleted file mode 100644 index 263c146339..0000000000 --- a/examples/benchmarks/oo4.py +++ /dev/null @@ -1,14 +0,0 @@ -# Copyright (C) 2004-2011, Parrot Foundation. -class Foo: - def __init__(self): - self.i = 10 - self.j = 20 - -class main: - o = Foo() - for i in range(1,500001): - o.i = i - o.j = i - print o.i - - diff --git a/examples/benchmarks/oo4.rb b/examples/benchmarks/oo4.rb deleted file mode 100644 index 9b31f5f5f1..0000000000 --- a/examples/benchmarks/oo4.rb +++ /dev/null @@ -1,19 +0,0 @@ -#! ruby - -class Foo - attr_accessor :i, :j - - def initialize() - @i = 10 - @j = 20 - end -end - -o = Foo.new -for i in 1..500000 - o.i = i - o.j = i -end -puts o.i - - diff --git a/examples/c/pbc_info.c b/examples/c/pbc_info.c index 97bed68da2..8b022eabc3 100644 --- a/examples/c/pbc_info.c +++ b/examples/c/pbc_info.c @@ -23,7 +23,6 @@ over the main directory. */ #include "parrot/parrot.h" -#include "parrot/embed.h" /* =item C #include diff --git a/examples/compilers/japhc.c b/examples/compilers/japhc.c index 2463fe0565..563a802e81 100644 --- a/examples/compilers/japhc.c +++ b/examples/compilers/japhc.c @@ -27,7 +27,6 @@ example compiler used by japh16.pasm */ #include "parrot/parrot.h" -#include "parrot/embed.h" #include "../../src/pmc/pmc_sub.h" #define C_DEBUG 0 diff --git a/examples/config/file/configcompiler b/examples/config/file/configcompiler index 348f39baeb..9c074d27db 100644 --- a/examples/config/file/configcompiler +++ b/examples/config/file/configcompiler @@ -9,6 +9,7 @@ CX=/usr/bin/g++ cc=$CC link=$CX ld=/usr/bin/g++ +intval="long long" =steps diff --git a/t/configure/testlib/verbosefoobar b/examples/config/file/configverbose similarity index 100% rename from t/configure/testlib/verbosefoobar rename to examples/config/file/configverbose diff --git a/examples/embed/cotorra.c b/examples/embed/cotorra.c index aae9aed2b9..2435f9b2ab 100644 --- a/examples/embed/cotorra.c +++ b/examples/embed/cotorra.c @@ -25,7 +25,7 @@ options and able to run only pbc files. #include #include -#include "parrot/embed.h" +#include "parrot/parrot.h" #include "parrot/extend.h" /**********************************************************************/ @@ -136,7 +136,7 @@ Auxiliary function to shorten Parrot String creation, Parrot_String create_string(Parrot_Interp interp, const char *name) { - return Parrot_new_string(interp, name, strlen(name), (const char *) NULL, 0); + return Parrot_str_new_init(interp, name, strlen(name), (const char *) NULL, 0); } /**********************************************************************/ @@ -224,7 +224,7 @@ int cotorra_main(Parrot_Interp interp, int argc, const char **argv) } if (stname) { - Parrot_PMC rootns = Parrot_get_root_namespace(interp); + Parrot_PMC rootns = Parrot_ns_get_root_namespace(interp); Parrot_String parrotname = create_string(interp, "parrot"); Parrot_PMC parrotns = Parrot_PMC_get_pmc_keyed_str(interp, rootns, parrotname); Parrot_String name = create_string(interp, stname); @@ -233,7 +233,7 @@ int cotorra_main(Parrot_Interp interp, int argc, const char **argv) fail("start sub not found"); if (i < argc) { int pos; - Parrot_PMC arg = Parrot_PMC_new(interp, + Parrot_PMC arg = Parrot_pmc_new(interp, Parrot_PMC_typenum(interp, "FixedStringArray")); Parrot_PMC_set_integer_native(interp, arg, argc - i); for (pos = 0; i < argc; ++i, ++pos) { diff --git a/examples/io/post.pir b/examples/io/post.pir index 0a6b13f0aa..681b9f8b49 100644 --- a/examples/io/post.pir +++ b/examples/io/post.pir @@ -27,7 +27,7 @@ push contents, 'report_file' $P0 = new 'FixedStringArray' set $P0, 1 - $P0[0] = 'parrot_test_run.tar.gz' + $P0[0] = 't/archive/parrot_test_run.tar.gz' push contents, $P0 load_bytecode 'LWP/UserAgent.pir' .const string url = 'http://smolder.parrot.org/app/projects/process_add_report/1' diff --git a/examples/languages/abc/setup.pir b/examples/languages/abc/setup.pir index e57ea89b4e..65b4bee602 100755 --- a/examples/languages/abc/setup.pir +++ b/examples/languages/abc/setup.pir @@ -32,8 +32,8 @@ See F. $P0['license_uri'] = 'http://www.perlfoundation.org/artistic_license_2_0' $P0['copyright_holder'] = 'Parrot Foundation' $P0['checkout_uri'] = 'https://github.com/parrot/parrot/tree/master/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' + $P0['browser_uri'] = 'https://github.com/parrot/parrot/tree/master/examples/languages/abc' + $P0['project_uri'] = 'https://github.com/parrot/parrot/tree/master/examples/languages/abc' # build $P1 = new 'Hash' diff --git a/examples/languages/abc/src/parser/actions.nqp b/examples/languages/abc/src/parser/actions.nqp index 900db89a46..1221a30692 100644 --- a/examples/languages/abc/src/parser/actions.nqp +++ b/examples/languages/abc/src/parser/actions.nqp @@ -38,6 +38,7 @@ method TOP($/) { make PAST::Block.new( :blocktype('declaration'), :hll('abc'), + :loadlibs('trans_ops'), $.ast); } @@ -75,6 +76,7 @@ method statement:sym($/) { if pir::typeof__sp($past) ne 'PAST::Op' && ~$past.name() ne '&infix:<=>' { my $last := PAST::Var.new( :name('last'), :scope('package'), + :namespace(['abc','vars']), :lvalue(1) ); $past := PAST::Op.new( $last, $past, @@ -204,6 +206,7 @@ method term:sym($/) { else { make PAST::Var.new( :name( ~$ ), :scope('package'), + :namespace(['abc', 'vars']), :viviself('Float'), :lvalue(1), :node( $/ ) diff --git a/examples/languages/abc/t/abc_functions b/examples/languages/abc/t/abc_functions index f89784c865..a04efbbb73 100644 --- a/examples/languages/abc/t/abc_functions +++ b/examples/languages/abc/t/abc_functions @@ -2,6 +2,7 @@ length(1) 1\n length function length(11) 2\n length function length(111) 3\n length function +length(abc) 1\n abc isn't last - TT161 # read function # TODO? diff --git a/examples/languages/squaak/doc/pct-stages.png b/examples/languages/squaak/doc/pct-stages.png new file mode 100644 index 0000000000..9ab5dbddd0 Binary files /dev/null and b/examples/languages/squaak/doc/pct-stages.png differ diff --git a/examples/languages/squaak/doc/pct-stages.svg b/examples/languages/squaak/doc/pct-stages.svg new file mode 100644 index 0000000000..b15388a89c --- /dev/null +++ b/examples/languages/squaak/doc/pct-stages.svg @@ -0,0 +1,257 @@ + + + + + + + + + + image/svg+xml + + + + + + + + + Parse Tree + + + + PIR + + + + Source + + + + PAST + + + + POST + + + + + + + diff --git a/examples/languages/squaak/doc/tutorial_episode_1.pod b/examples/languages/squaak/doc/tutorial_episode_1.pod index 4ce3f9f2d3..0ab0104d96 100644 --- a/examples/languages/squaak/doc/tutorial_episode_1.pod +++ b/examples/languages/squaak/doc/tutorial_episode_1.pod @@ -1,6 +1,6 @@ # Copyright (C) 2008, Parrot Foundation. -=head1 PCT Tutorial Episode 1: Introduction +=head1 Episode 1: Introduction =head2 Introduction @@ -273,7 +273,7 @@ F. =item * Perl 6/NQP rules syntax: Synopsis 5 at http://perlcabal.org/syn/S05.html or http://svn.pugscode.org/pugs/docs/Perl6/Spec/S05-regex.pod -=item * List of HLL projects: http://trac.parrot.org/parrot/wiki/Languages +=item * List of HLL projects: https://github.com/parrot/parrot/wiki/Languages =back diff --git a/examples/languages/squaak/doc/tutorial_episode_2.pod b/examples/languages/squaak/doc/tutorial_episode_2.pod index bd7d622819..5e9fff5a4a 100644 --- a/examples/languages/squaak/doc/tutorial_episode_2.pod +++ b/examples/languages/squaak/doc/tutorial_episode_2.pod @@ -157,28 +157,23 @@ require you to know any details about this transformation. =head2 And now for the good news... -We established the general data flow of PCT-based compilers, which consists of -four stages: +We established the general data flow of PCT-based compilers which transform plain +source code into PIR through four transformations: -=over 4 - -=item 1. source to parse tree - -=item 2. parse tree to PAST +=begin html -=item 3. PAST to POST +Source -> Parse Tree -> PAST -> POST -> PIR -=item 4. POST to PIR - -=back +=end html -The first two transformations happen during the parse stage. Now, as you're -reading this tutorial, you're probably interested in using the PCT to implement -Your Favorite Language on top of Parrot. We already saw that a language grammar -is expressed in Perl 6 Rules. What about the other transformations? Well, -earlier in this episode we mentioned parse actions and that these actions -create PAST nodes. After you have written a parse action for each grammar rule, -you're done! +Now, as you're reading this tutorial, you're probably interested in using the +PCT to implement Your Favorite Language on top of Parrot. We already saw that a +language grammar is expressed in Perl 6 Rules. What about the other +transformations? Well, earlier in this episode we mentioned parse actions and +that these actions create PAST nodes. After you have written a parse action for +each grammar rule, you're done! Say what? diff --git a/examples/languages/squaak/doc/tutorial_episode_4.pod b/examples/languages/squaak/doc/tutorial_episode_4.pod index 52bc49f20d..238b2c0586 100644 --- a/examples/languages/squaak/doc/tutorial_episode_4.pod +++ b/examples/languages/squaak/doc/tutorial_episode_4.pod @@ -1,4 +1,4 @@ -# Copyright (C) 2008, Parrot Foundation. +# Copyright (C) 2008-2012, Parrot Foundation. =head1 Episode 4: PAST Nodes and More Statements @@ -62,6 +62,7 @@ programming language): a conditional expression, a "then" part and an "else" part. Implementing this in Perl 6 rules and PAST is almost trivial, but first, let's add a little infrastructure to simplify adding new statement types. Replace the statement rule with the following: + proto rule statement { <...> } Delete the statement method from Action.pm, and rename the assignment rule in both Grammar.pm and @@ -82,14 +83,17 @@ brackets. Within the body of the rule, it can be matched literally with . Note that the optional else block is stored in the match object's "else" field, and the then block is stored in the match object's "then" field. + If we hadn't written this $= part, then would have been an array, with block[0] the "then" part, and block[1] the optional else part. Assigning the optional else block to a different field, makes the action method slightly easier to read. + Note that the proto declaration for statement means that the result object for $ in any rule which calls statement as a subrule will be result object for whichever statement type matched. Because of this, we can delete the statement action method. - The relevant action methods are shown below: + +The relevant action methods are shown below: method block($/) { # create a new block, set its type to 'immediate', @@ -302,8 +306,8 @@ action methods. ## generate instruction to retrieve the exception object (and the ## exception message, that is passed automatically in PIR, this is stored ## into $S0 (but not used). - my $pir := " .get_results (%r, $S0)\n" - ~ " store_lex '" ~ $exc.name() + my $pir := ' .get_results (%r, $S0)\n' + ~ "\n store_lex '" ~ $exc.name() ~ "', %r"; $catch.unshift( PAST::Op.new( :inline($pir), :node($/) ) ); diff --git a/examples/languages/squaak/doc/tutorial_episode_5.pod b/examples/languages/squaak/doc/tutorial_episode_5.pod index 6bacec023c..4d3db2ca72 100644 --- a/examples/languages/squaak/doc/tutorial_episode_5.pod +++ b/examples/languages/squaak/doc/tutorial_episode_5.pod @@ -191,7 +191,7 @@ Now we need to modify our TOP rule to call begin_TOP. rule TOP { <.begin_TOP> - + [ $ || <.panic: "Syntax error"> ] } @@ -210,7 +210,7 @@ action for TOP. method TOP($/, $key) { our @?BLOCK; my $past := @?BLOCK.shift(); - $past.push($.ast); + $past.push($.ast); make $past; } diff --git a/examples/languages/squaak/doc/tutorial_episode_6.pod b/examples/languages/squaak/doc/tutorial_episode_6.pod index eb7a71f34d..4a7b7ad63a 100644 --- a/examples/languages/squaak/doc/tutorial_episode_6.pod +++ b/examples/languages/squaak/doc/tutorial_episode_6.pod @@ -89,7 +89,7 @@ And we need to add it to rule stat_or_def: | } -Appropriately modifying the action method is simple. It's analogous to the action method for +Update the stat_or_def action method yourself now. It's analogous to the action method for expression. "**" is the repetition specifier; " ** ','" matches separated by commas. diff --git a/examples/languages/squaak/src/Squaak/Actions.pm b/examples/languages/squaak/src/Squaak/Actions.pm index ebb4ccb949..e67e6cf158 100644 --- a/examples/languages/squaak/src/Squaak/Actions.pm +++ b/examples/languages/squaak/src/Squaak/Actions.pm @@ -160,10 +160,7 @@ method statement:sym($/) { } method statement:sym($/) { - my $invocant := $.ast; - my $past := $.ast; - $past.unshift($invocant); - make $past; + make $.ast; } method arguments($/) { @@ -258,6 +255,10 @@ method statement:sym($/) { make PAST::Op.new( $cond, $body, :pasttype('while'), :node($/) ); } +method statement:sym($/) { + make PAST::Op.new( :pirop, $.ast, :node($/) ); +} + method begin_block($/) { our $?BLOCK; our @?BLOCK; @@ -326,6 +327,8 @@ method postfix_expression:sym($/) { :node($/) ); } +method postfix_expression:sym($/) { make $.ast } + method identifier($/) { our @?BLOCK; my $name := ~$; diff --git a/examples/languages/squaak/src/Squaak/Grammar.pm b/examples/languages/squaak/src/Squaak/Grammar.pm index 09c7c21a30..b04adc14e4 100644 --- a/examples/languages/squaak/src/Squaak/Grammar.pm +++ b/examples/languages/squaak/src/Squaak/Grammar.pm @@ -77,7 +77,7 @@ rule statement:sym { } rule statement:sym { - + } rule arguments { @@ -107,6 +107,10 @@ rule statement:sym { 'do' 'end' } +rule statement:sym { + +} + token begin_block { } @@ -130,13 +134,15 @@ rule postfix_expression:sym { '{' '}' } rule postfix_expression:sym { '.' } +rule postfix_expression:sym { } + token identifier { } token keyword { - ['and'|'catch'|'do' |'else' |'end' |'for' |'if' - |'not'|'or' |'sub' |'throw'|'try' |'var'|'while']>> + ['and'|'catch' |'do' |'else' |'end'|'for'|'if' |'not' + |'or' |'return'|'sub'|'throw'|'try'|'var'|'while']>> } token term:sym { } diff --git a/examples/languages/squaak/src/Squaak/Runtime.pm b/examples/languages/squaak/src/Squaak/Runtime.pm index 93af6b4815..b04baed065 100644 --- a/examples/languages/squaak/src/Squaak/Runtime.pm +++ b/examples/languages/squaak/src/Squaak/Runtime.pm @@ -19,3 +19,12 @@ sub print(*@args) { pir::say(pir::join('', @args)); pir::return(); } + +our $STDIN; +INIT { + $STDIN := pir::getinterp().stdin_handle(); +} + +sub read() { + +$STDIN.readline(); +} diff --git a/examples/languages/squaak/t/00-sanity.t b/examples/languages/squaak/t/00-sanity.t index 50418a6109..ae9f0e3e28 100644 --- a/examples/languages/squaak/t/00-sanity.t +++ b/examples/languages/squaak/t/00-sanity.t @@ -1,5 +1,5 @@ -print("1..25") +print("1..26") # test global variable g = 1 @@ -110,4 +110,11 @@ while j < 5 do j = j + 1 end +# test return and sub as expression +sub ret(x) + return x +end +if ret(1) == 1 then + print("ok 26") +end diff --git a/examples/nci/ls.pir b/examples/nci/ls.pir index 182e5be4a5..3107fd8447 100644 --- a/examples/nci/ls.pir +++ b/examples/nci/ls.pir @@ -1,4 +1,4 @@ -# Copyright (C) 2005-2010, Parrot Foundation. +# Copyright (C) 2005-2011, Parrot Foundation. =head1 NAME @@ -21,11 +21,29 @@ In this encarnation it works on linux i386 and amd64 systems. .local pmc readdir .local pmc closedir libc = loadlib 'libc' - dlfunc opendir, libc, 'opendir', 'pt' + dlfunc opendir, libc, 'opendir', 'pp' dlfunc readdir, libc, 'readdir', 'pp' dlfunc closedir, libc, 'closedir', 'ip' + + .const string dirname = "docs" + .local pmc dirname_c + # Convert the directory name string to a C string. + dirname_c = new ["ByteBuffer"] + dirname_c = dirname + push dirname_c, 0 + .local pmc curdir - curdir = opendir("docs") + curdir = opendir(dirname_c) + unless null curdir goto opened + + .local pmc err + getstderr err + print err, "Cannot open directory '" + print err, dirname + print err, "'\n" + exit 1 + +opened: .local pmc entry .include "datatypes.pasm" diff --git a/examples/past/blocktype_immediate.pir b/examples/past/blocktype_immediate.pir index 533fa4cacf..30497141ae 100644 --- a/examples/past/blocktype_immediate.pir +++ b/examples/past/blocktype_immediate.pir @@ -11,7 +11,7 @@ examples/past/blocktype_immediate.pir - Evaluating a PAST::Block immediately =head1 DESCRIPTION Create and evaluate a PAST::Block with blocktype 'immediate'. -'immediate' means the the block is evaluated end the last value +'immediate' means the block is evaluated and the last value is returned. Beware that this doesn't work yet as expected: diff --git a/examples/pir/befunge/setup.pir b/examples/pir/befunge/setup.pir index 16b6e32ea1..4437d6a3f8 100755 --- a/examples/pir/befunge/setup.pir +++ b/examples/pir/befunge/setup.pir @@ -32,8 +32,8 @@ See F. $P0['license_uri'] = 'http://www.perlfoundation.org/artistic_license_2_0' $P0['copyright_holder'] = 'Parrot Foundation' $P0['checkout_uri'] = 'https://github.com/parrot/parrot/tree/master/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' + $P0['browser_uri'] = 'https://github.com/parrot/parrot/tree/master/examples/pir/befunge' + $P0['project_uri'] = 'https://github.com/parrot/parrot/tree/master/examples/pir/befunge' # build $P1 = new 'Hash' diff --git a/examples/pir/coop_threads.pir b/examples/pir/coop_threads.pir new file mode 100644 index 0000000000..6682c3c159 --- /dev/null +++ b/examples/pir/coop_threads.pir @@ -0,0 +1,170 @@ +# Copyright (C) 2010, Parrot Foundation. +# $Id$ + +=head1 Cooperative threads in pure PIR + +This file demonstrates cooperative concurrency using continuations +on Parrot. + +See also +http://www.parrot.org/content/threads-are-continuations + +=cut + +=head1 th_init + +First, we create an array to store unscheduled threads in. For simplicity, +this is stored in a global. + +=cut + +.include 'interpinfo.pasm' + +.sub th_init + $P0 = new 'ResizablePMCArray' + set_global 'threads', $P0 +.end + +=head1 th_create + +This is the 'spawn' call. It takes a sub and schedules it to run as a +thread. + +=cut + +.sub th_create + .param pmc in_sub + $P0 = get_global 'threads' + push $P0, in_sub +.end + +=head1 th_resched + +This is the 'yield' call. When called from a running thread, it saves the +current point in the computation as a continuation and runs the next thread. + +=cut + +.sub th_resched + .local pmc cur_th, next_th, ths + ths = get_global 'threads' + + # This gets the return continuation for the currently running sub. + # When this continuation is invoked, it will be as if this call + # to th_resched just returned. + cur_th = interpinfo .INTERPINFO_CURRENT_CONT + push ths, cur_th + +again: + next_th = shift ths + invokecc next_th + + $I0 = ths + if $I0 > 0 goto again +.end + +=head1 th_main + +This starts up the thread system (after some threads have been scheduled) and makes +sure the program doesn't exit before all the threads have run to completion. + +=cut + +.sub th_main + .local pmc ths + +again1: + ths = get_global 'threads' + + $I0 = ths + if $I0 <= 0 goto done + + th_resched() + + goto again1 +done: +.end + +=head1 + +That's it. All we need now is some test threads and a main function to run them. + +=cut + +.sub sub1 + say "sub1: Hallo" + th_resched() + + say "sub1: Dance! <(\"< >\")> <(\"<" + th_resched() + + say "sub1: Bye" +.end + +.sub sub2 + say "sub2: Hallo" + th_resched() + + say "sub2: Dance! >\")> <(\"< >\")>" + th_resched() + + say "sub2: Bye" +.end + +.sub sub3 + say "sub3: Good morning" + + th_resched() + + $I0 = 5 + $I1 = $I0 + 3 + + th_resched() + + print "sub3: 5 + 3 = " + say $I1 + + th_resched() + + say "sub3: Is leaving." +.end + +.sub main :main + th_init() + + $P0 = get_global 'sub1' + th_create($P0) + + $P0 = get_global 'sub3' + th_create($P0) + + $P0 = get_global 'sub2' + th_create($P0) + + th_main() + + say "All done" +.end + +=head1 Expected Output + +The program should (and does) produce this output: + +sub1: Hallo +sub3: Good morning +sub2: Hallo +sub1: Dance! <("< >")> <("< +sub2: Dance! >")> <("< >")> +sub1: Bye +sub3: 5 + 3 = 8 +sub2: Bye +sub3: Is leaving. +All done + +=cut + +# Local Variables: +# mode: pir +# fill-column: 100 +# End: +# vim: expandtab shiftwidth=4 ft=pir: diff --git a/examples/pir/make_hello_pbc.pir b/examples/pir/make_hello_pbc.pir index 93d2960c5a..8b18c681eb 100644 --- a/examples/pir/make_hello_pbc.pir +++ b/examples/pir/make_hello_pbc.pir @@ -67,7 +67,7 @@ $S0 = pf $P1 = new ['FileHandle'] $P1.'open'("generated_hello.pbc", "w") - $P1.'puts'($S0) + $P1.'print'($S0) $P1.'close'() # And check it! diff --git a/examples/sdl/tetris/block.pir b/examples/sdl/tetris/block.pir index a96ccde054..d4e07160a8 100644 --- a/examples/sdl/tetris/block.pir +++ b/examples/sdl/tetris/block.pir @@ -592,7 +592,7 @@ Returns the application object associated with the block's board. .sub setXPosition :method .param int pos - getprop $P0, "xpos", self + getprop $P0, self, "xpos" $P0 = pos .end diff --git a/examples/sdl/tetris/blockdata.pir b/examples/sdl/tetris/blockdata.pir index 5709e93165..8744d69142 100644 --- a/examples/sdl/tetris/blockdata.pir +++ b/examples/sdl/tetris/blockdata.pir @@ -29,7 +29,7 @@ END: =item blockdata."rotate"( dir ) -Changes the the C in a way to make +Changes the C in a way to make the block look rotated. =over 4 diff --git a/examples/sdl/tetris/board.pir b/examples/sdl/tetris/board.pir index 5a8a4b783f..0cb4eed498 100644 --- a/examples/sdl/tetris/board.pir +++ b/examples/sdl/tetris/board.pir @@ -136,7 +136,7 @@ Returns the application object to which this board belongs to. .sub application :method .local pmc app - getprop app, "app", self + getprop app, self, "app" .return (app) .end @@ -151,7 +151,7 @@ in the preview window. .sub getNextBlock :method .local pmc block - getprop block, "nextblock", self + getprop block, self, "nextblock" # return the block .return (block) @@ -249,7 +249,7 @@ This method returns the block that is now falling down. SKIP_SET_ID: # get the 'next block' and store it as the current one - getprop block, "nextblock", self + getprop block, self, "nextblock" # create a new 'next block' $P0 = self."blockID"( id ) @@ -275,7 +275,7 @@ This method returns nothing. .sub fall :method .local pmc block - getprop block, "block", self + getprop block, self, "block" block."fall"() .return () @@ -292,7 +292,7 @@ Returns 1 if the current block is falling down fast, 0 otherwise. .local pmc block .local int ret - getprop block, "block", self + getprop block, self, "block" ret = block."falling"() .return (ret) @@ -307,7 +307,7 @@ Returns the currently falling block. .sub currentBlock :method .local pmc block - getprop block, "block", self + getprop block, self, "block" .return (block) .end @@ -325,7 +325,7 @@ measured in pixels. .local pmc temp .local int i - getprop temp, "blocksize", self + getprop temp, self, "blocksize" set i, temp .return (i) @@ -619,7 +619,7 @@ This method returns nothing. blocksize = self."blockSize"() # get the field cache - getprop cache, "cache", self + getprop cache, self, "cache" # clear the field cache unless full goto NO_CLEAR_CACHE @@ -712,8 +712,8 @@ LOOPend: # # draw the next block # - getprop cache, "nextblockcache", self - getprop temp, "nextblock", self + getprop cache, self, "nextblockcache" + getprop temp, self, "nextblock" eq_addr cache, temp, SKIP_NEXTBLOCK setprop self, "nextblockcache", temp set xp, w @@ -747,7 +747,7 @@ LOOPend: temp = new ['SDL'; 'Rect'], rect color = palette[0] surface."fill_rect"( temp, color ) - getprop temp, "nextblock", self + getprop temp, self, "nextblock" temp."draw"( surface, xp, yp, blocksize ) SKIP_NEXTBLOCK: .return () @@ -785,7 +785,7 @@ one unit. .local pmc temp .local num ret - getprop temp, "FallInterval", self + getprop temp, self, "FallInterval" set ret, temp .return (ret) @@ -802,7 +802,7 @@ the next unit. .local pmc temp .local num ret - getprop temp, "NextFallTime", self + getprop temp, self, "NextFallTime" set ret, temp .return (ret) @@ -821,7 +821,7 @@ This method returns nothing. .param num val .local pmc temp - getprop temp, "NextFallTime", self + getprop temp, self, "NextFallTime" set temp, val .return () @@ -839,9 +839,9 @@ left top corner. .local int ypos .local pmc temp - getprop temp, "xpos", self + getprop temp, self, "xpos" set xpos, temp - getprop temp, "ypos", self + getprop temp, self, "ypos" set ypos, temp .return (xpos, ypos) @@ -858,9 +858,9 @@ This method returns nothing. .param int ypos .local pmc temp - getprop temp, "xpos", self + getprop temp, self, "xpos" set temp, xpos - getprop temp, "ypos", self + getprop temp, self, "ypos" set temp, ypos .return () diff --git a/examples/streams/Combiner.pir b/examples/streams/Combiner.pir index 231f69f75a..ecff32e2c3 100644 --- a/examples/streams/Combiner.pir +++ b/examples/streams/Combiner.pir @@ -87,7 +87,7 @@ LOOP: The _text sub is used as a source of the text stream. It just writes some text to the stream. -The stream is automatically diconnected when the sub returns, which +The stream is automatically disconnected when the sub returns, which will also terminate the combined stream. =cut diff --git a/ext/Parrot-Embed/Build.PL b/ext/Parrot-Embed/Build.PL deleted file mode 100644 index 511ce98991..0000000000 --- a/ext/Parrot-Embed/Build.PL +++ /dev/null @@ -1,141 +0,0 @@ -#! perl - -use strict; -use warnings; - -use Cwd; -use Config; -use Module::Build; -use File::Spec::Functions qw( rel2abs catdir catfile updir path ); - -diag( my $in_parrot_tree = in_parrot_tree() ); -diag( my $dl_env_var = get_dl_env_var() ); -diag( my ($libp, $incp) = get_paths() ); -diag( my ($cflags, $lflags) = get_compiler_flags( $in_parrot_tree ) ); -diag( my $parrot = get_parrot_path( $in_parrot_tree ) ); -diag( my $path_sep = get_path_separator() ); - -my $class = Module::Build->subclass( - code => <<"END_HERE", - use File::Spec; - - sub ACTION_build - { - my \$self = shift; - my \@cmd = ( qw( $parrot -o ), - map { File::Spec->catfile( 't', "greet.\$_" ) } qw( pbc pir ) ); - - system( \@cmd ) == 0 or die "Cannot compile PBC for test: \$?"; - - \$self->SUPER::ACTION_build( \@_ ); - } - - sub ACTION_test - { - my \$self = shift; - \$ENV{$dl_env_var} = join( '$path_sep', - split( /$path_sep/, ( \$ENV{$dl_env_var} || '' ) ), '$libp' ) - if $in_parrot_tree; - - \$self->SUPER::ACTION_test( \@_ ); - } - -END_HERE -); - -my $builder = $class->new( - module_name => 'Parrot::Embed', - license => 'perl', - dist_author => 'chromatic ', - dist_version_from => 'lib/Parrot/Embed.pm', - build_requires => - { - 'Test::More' => 0, - 'ExtUtils::CBuilder' => 0, - }, - add_to_cleanup => [ 'Parrot-Embed-*' ], - include_dirs => [ $incp ], - extra_compiler_flags => $cflags, - extra_linker_flags => $lflags, -); - -$builder->create_build_script(); - -sub in_parrot_tree -{ - my $cwd = cwd(); - return $cwd =~ /\bext\b.Parrot/; -} - -sub get_dl_env_var -{ - return $Config{ldlibpthname} if $Config{ldlibpthname}; - return 'DYLD_LIBRARY_PATH' if $^O =~ /darwin/; - return 'PATH' if $^O =~ /Win32/; - return 'LD_LIBRARY_PATH'; -} - -sub get_path_separator -{ - return ';' if $^O =~ /Win32/; - return ':'; -} - -sub get_compiler_flags -{ - my $in_parrot_tree = shift; - my $parrot_config = $in_parrot_tree ? "./parrot_config" : "parrot_config"; - return (`$parrot_config embed-cflags`, `$parrot_config embed-ldflags`); -} - -sub get_paths -{ - my $updir = updir(); - my @lib_dir = $^O =~ /Win32/ ? () : qw( blib lib ); - my $lib_path = rel2abs( catdir( ($updir) x 2, @lib_dir ) ); - my $inc_path = rel2abs( catdir( ($updir) x 2, 'include' ) ); - - return( $lib_path, $inc_path ); -} - -sub get_parrot_path -{ - my $in_parrot_tree = shift; - return get_parrot_path_internal() if $in_parrot_tree; - return get_parrot_path_external(); -} - -sub get_parrot_path_internal -{ - my $updir = updir(); - my $path = catfile(($updir) x 2, get_parrot_executable_name()); - - die "parrot apparently not built!\n" unless -e $path; - return $path; -} - -sub get_parrot_path_external -{ - my $parrot = get_parrot_executable_name(); - - for my $path ( path() ) - { - my $file = catfile( $path, $parrot ); - next unless -e $file; - return $file; - } - - die "parrot apparently not installed in \$PATH\n"; -} - -sub get_parrot_executable_name -{ - return 'parrot' unless $^O =~ /Win32/; - return 'parrot.exe'; -} - -sub diag -{ - return unless $ENV{PE_DEBUG}; - print STDERR "<$_>\n" for @_; -} diff --git a/ext/Parrot-Embed/Changes b/ext/Parrot-Embed/Changes deleted file mode 100644 index f09271fb66..0000000000 --- a/ext/Parrot-Embed/Changes +++ /dev/null @@ -1,17 +0,0 @@ -Revision history for Parrot-Embed - -20081006 Mon Oct 6 07:37:02 UTC 2008 - - removed long-removed Parrot_revision() - - applied minor cleanups to packaging - -0.02 Tue Oct 24 02:45:12 UTC 2006 - - added documentation - - fixed Parrot::Interpreter synopsis code - - Fri Oct 13 22:14:45 UTC 2006 - - made Parrot::Interpreter and Parrot::PMC objects - - attempted to make GC and refcounts work correctly - - fix in-tree build (hopefully) - -0.01 Date/time - - First version, released on an unsuspecting world. diff --git a/ext/Parrot-Embed/MANIFEST b/ext/Parrot-Embed/MANIFEST deleted file mode 100644 index d0d9508301..0000000000 --- a/ext/Parrot-Embed/MANIFEST +++ /dev/null @@ -1,12 +0,0 @@ -Build.PL -Changes -MANIFEST -README -lib/Parrot/Embed.pm -lib/Parrot/Embed.xs -lib/Parrot/Interpreter.pm -lib/Parrot/PMC.pm -t/greet.pir -t/interp.t -TODO -typemap diff --git a/ext/Parrot-Embed/README b/ext/Parrot-Embed/README deleted file mode 100644 index 7fe8499b50..0000000000 --- a/ext/Parrot-Embed/README +++ /dev/null @@ -1,28 +0,0 @@ -Parrot::Embed -------------- - -This is an embedding interface to use Parrot from Perl 5. - -Be afraid. - -INSTALLATION - -To install this module, run the following commands: - - perl Build.PL - perl ./Build - perl ./Build test - perl ./Build install - -If you're building this within the Parrot tree (that is, if you don't have a -Parrot installed somewhere else), you need to set the proper environment -variable to tell your dynamic linker where to find the F or -F or F file to load. I believe this is -C on Unix-like systems and C on Windows. - -COPYRIGHT AND LICENCE - -Copyright (C) 2006 - 2008 Parrot Foundation/chromatic - -This program is free software; you can redistribute it and/or modify it -under the same terms as Parrot itself. diff --git a/ext/Parrot-Embed/TODO b/ext/Parrot-Embed/TODO deleted file mode 100644 index 65ca23fe85..0000000000 --- a/ext/Parrot-Embed/TODO +++ /dev/null @@ -1,10 +0,0 @@ -TODO: - - move tests into ../../t during build ? - - update with new embedding strategy - - allow more signatures on call_sub() - - fill in method documentation for Parrot::Interpreter and Parrot::PMC - - store parent interpreter in Parrot::PMC objects - - allow invoke() on appropriate Parrot::PMC objects directly - - bless Parrot::PMC objects into appropriate subclasses if possible - - allow overloading magic on Parrot::PMC objects - - improve tests for failure conditions diff --git a/ext/Parrot-Embed/lib/Parrot/Embed.pm b/ext/Parrot-Embed/lib/Parrot/Embed.pm deleted file mode 100644 index 440ac2f106..0000000000 --- a/ext/Parrot-Embed/lib/Parrot/Embed.pm +++ /dev/null @@ -1,57 +0,0 @@ -package Parrot::Embed; -# Copyright (C) 2006-2009, Parrot Foundation. - -use strict; -use warnings; - -our $VERSION = '20081006'; - -use base 'DynaLoader'; - -Parrot::Embed->bootstrap($VERSION); - -1; - -__END__ - -=head1 NAME - -Parrot::Embed - use Parrot from Perl 5 - -=head1 VERSION - -Version 20081006 - -=head1 SYNOPSIS - - use Parrot::Embed qw(Parrot_revision); - -=head1 DESCRIPTION - -This module embeds libparrot in Perl 5 programs. You can load Parrot bytecode, -compile your own code, and call Parrot subroutines and send and receive values -to them. - -It provides the core implementation used by the L module. -Do consider using L first however. See also -L. - -This module provides no user-inspectable code. - -=head1 AUTHOR - -chromatic, C<< >> - -=head1 BUGS - -Please report any bugs or feature requests to the Parrot Porters mailing list. -Someday there may be a CPAN version of this code. Who knows? - -=cut - -# Local Variables: -# mode: cperl -# cperl-indent-level: 4 -# fill-column: 100 -# End: -# vim: expandtab shiftwidth=4: diff --git a/ext/Parrot-Embed/lib/Parrot/Embed.xs b/ext/Parrot-Embed/lib/Parrot/Embed.xs deleted file mode 100644 index 56708fc65e..0000000000 --- a/ext/Parrot-Embed/lib/Parrot/Embed.xs +++ /dev/null @@ -1,251 +0,0 @@ -#define PERL_NO_GET_CONTEXT -#include "parrot/parrot.h" -#include "parrot/embed.h" -#include "parrot/extend.h" -#include "EXTERN.h" -#include "perl.h" -#include "XSUB.h" - -#define get_interp( i ) (INT2PTR(Interpreter_struct*, SvIV( SvRV( (SV*)i ) )))->interp - -typedef Parrot_Interp Parrot_Interpreter; - -typedef struct Interpreter_struct -{ - SV *parent; - Parrot_Interp interp; -} Interpreter_struct; - -typedef struct PMC_struct -{ - SV *interp; - Parrot_PMC pmc; -} PMC_struct; - - -Interpreter_struct* -make_interp( pTHX_ SV *parent, PARROT_INTERP ) -{ - Interpreter_struct *interp_struct; - - if (!interp) - return NULL; - - New( 0, interp_struct, 1, Interpreter_struct ); - - SvREFCNT_inc( parent ); - interp_struct->parent = parent; - interp_struct->interp = interp; - - return interp_struct; -} - - -PMC_struct* -make_pmc( pTHX_ SV *interp, Parrot_PMC pmc ) -{ - PMC_struct *pmc_struct; - - if (!pmc) - return NULL; - - New( 0, pmc_struct, 1, PMC_struct ); - - SvREFCNT_inc( interp ); - pmc_struct->interp = interp; - pmc_struct->pmc = pmc; - - Parrot_register_pmc( get_interp( interp ), pmc ); - - return pmc_struct; -} - - -MODULE = Parrot::Embed PACKAGE = Parrot::Interpreter - -Parrot_Interp -new( class, ... ) - char *class -PREINIT: - SV *parent_sv = NULL; - Parrot_Interp parent; - Parrot_Interp interp; - Parrot_PackFile pf; -CODE: - if (items == 1) - parent = 0; - else if ( items == 2 && sv_derived_from( ST(1), "Parrot::Interpreter" )) - { - parent_sv = ST(1); - parent = get_interp( parent_sv ); - } - else - Perl_croak( aTHX_ "Usage: Parrot::Interpreter->new( [ parent ] )" ); - - interp = Parrot_new( (Parrot_Interp)parent ); - pf = PackFile_new( interp, 0 ); - Parrot_pbc_load( interp, pf ); - - /* Can't use RETVAL/OUTPUT here because typemap loses class variable */ - ST(0) = sv_newmortal(); - sv_setref_pv( ST(0), class, (void*)make_interp( aTHX_ parent_sv, interp ) ); - - -bool -load_file( interp, filename ) - Interpreter_struct *interp - char *filename -PREINIT: - Parrot_Interp real_interp; - Parrot_PackFile pf; -CODE: - real_interp = interp->interp; - pf = Parrot_pbc_read( real_interp, filename, 0 ); - - if (!pf) - Perl_croak( aTHX_ - "File '%s' not found in $parrot_interpreter->load_file()", filename ); - - Parrot_pbc_load( real_interp, pf ); - RETVAL = 1; -OUTPUT: - RETVAL - - -PMC_struct* -find_global( interp, global, ... ) - Interpreter_struct *interp - char *global -PREINIT: - SV *namespace; - Parrot_Interp real_interp; - Parrot_String p_namespace; - Parrot_String p_global; - Parrot_PMC pmc; -CODE: - if ( items < 2 || items > 3 ) - Perl_croak( aTHX_ - "Usage: $parrot_interpreter->find_global( name, [ namespace ] )"); - - real_interp = interp->interp; - p_global = Parrot_str_new_constant( real_interp, global ); - - if (items == 3) - namespace = ST(2); - else - namespace = &PL_sv_undef; - - if (namespace != &PL_sv_undef ) - { - char *ns_copy = savepv(SvPV_nolen(namespace)); - char *ns_str = ns_copy; - char *prev = ns_str; - PMC *ns = NULL; - - while (*ns_str++) - { - STRING *ns_part; - - if (! (*ns_str == ':' && *(ns_str + 1) == ':')) - continue; - - *ns_str = 0; - ns_str += 2; - - if (!ns) - ns = Parrot_ns_find_current_namespace_global(real_interp, - Parrot_str_new_constant(real_interp, prev)); - else - ns = Parrot_ns_find_namespace_global(real_interp, ns, - Parrot_str_new_constant(real_interp, prev)); - prev = ns_str; - } - - if (!ns) - ns = Parrot_ns_find_current_namespace_global(real_interp, - Parrot_str_new_constant(real_interp, prev)); - else - ns = Parrot_ns_find_namespace_global(real_interp, ns, - Parrot_str_new_constant(real_interp, prev)); - - pmc = Parrot_ns_find_namespace_global(real_interp, ns, p_global); - Safefree(ns_copy); - } - else - pmc = Parrot_ns_find_current_namespace_global( real_interp, p_global ); - - RETVAL = make_pmc( aTHX_ ST(0), pmc ); -OUTPUT: - RETVAL - - -PMC_struct* -compile( interp, code ) - Interpreter_struct *interp - char *code -PREINIT: - STRING *code_type; - STRING *error; - Parrot_Interp real_interp; - Parrot_PMC out_pmc; -CODE: - real_interp = interp->interp; - code_type = Parrot_str_new_constant( real_interp, "PIR" ); - out_pmc = Parrot_compile_string( real_interp, code_type, code, &error ); - RETVAL = make_pmc( aTHX_ ST(0), out_pmc ); -OUTPUT: - RETVAL - - -void -DESTROY( interp ) - Interpreter_struct *interp -CODE: - if (interp->parent) - SvREFCNT_dec( interp->parent ); - - Parrot_destroy( interp->interp ); - -MODULE = Parrot::Embed PACKAGE = Parrot::PMC - - -PMC_struct* -invoke( pmc, signature, argument ) - PMC_struct *pmc - const char *signature - const char *argument -PREINIT: - Parrot_PMC pmc_actual; - Parrot_PMC out_pmc; - Parrot_Interp interp; - Parrot_String arg_string; -CODE: - pmc_actual = pmc->pmc; - interp = get_interp( pmc->interp ); - arg_string = Parrot_str_new_constant( interp, argument ); - Parrot_pcc_invoke_sub_from_c_args( interp, pmc_actual, signature, arg_string, &out_pmc ); - RETVAL = make_pmc( aTHX_ pmc->interp, out_pmc ); -OUTPUT: - RETVAL - - -char * -get_string( pmc ) - PMC_struct *pmc -CODE: - RETVAL = Parrot_PMC_get_cstring( get_interp( pmc->interp ), pmc->pmc ); -OUTPUT: - RETVAL - -void -DESTROY( pmc ) - PMC_struct *pmc -PREINIT: - Parrot_Interp interp; -CODE: - interp = get_interp( pmc->interp ); - - if (interp) - SvREFCNT_dec( interp ); - - Parrot_unregister_pmc( interp, pmc->pmc ); diff --git a/ext/Parrot-Embed/lib/Parrot/Interpreter.pm b/ext/Parrot-Embed/lib/Parrot/Interpreter.pm deleted file mode 100644 index 18013514b3..0000000000 --- a/ext/Parrot-Embed/lib/Parrot/Interpreter.pm +++ /dev/null @@ -1,129 +0,0 @@ -package Parrot::Interpreter; -# Copyright (C) 2006-2009, Parrot Foundation. - -use strict; -use warnings; -our $VERSION = '20081006'; - -use Parrot::Embed; - -1; - -__END__ - -=head1 NAME - -Parrot::Interpreter - access a Parrot interpreter from Perl 5 - -=head1 VERSION - -Version 20081006 - -=head1 SYNOPSIS - - # the first interpreter created in the program - my $interp = Parrot::Interpreter->new(); - - # all subsequent interpreters need a parent - my $child_interp = $interp->new( $interp ); - - # load a file that Parrot can recognize as code - $interp->load_file( 'some_parrot_file.pbc' ); - $interp->load_file( 'some_parrot_file.pir' ); - $interp->load_file( 'some_parrot_file.pasm' ); - - # compile a string of Parrot code - $interp->compile( $some_parrot_code ); - - # find a subroutine to invoke - my $sub_pmc = $interp->find_global( 'some_parrot_sub' ); - my $other_sub_pmc = $interp->find_global( 'another_sub', 'NameSpace' ); - - # invoke the subroutine - my $result_pmc = $sub_pmc->invoke( $signature, @args ); - - # get the values out of it - print "Invoking the Sub gave ", $result_pmc->get_string( $interp ), "!\n"; - -All Parrot access goes through an I, mediated through a -C object. There is always at least one active interpreter -in a system. An interpreter allows you to load code, to compile code, and to -find and store global symbols in Parrot. These are usually subroutines but -they may be other types of PMCs. - -=head3 Memory and Resource Implications - -If you have multiple active interpreters, the second and subsequent -interpreters must each have an active interpreter as a parent. In general, -this may not be an issue, but if you forget, you will receive strange error -messages. - -Note that the parent interpreter must outlive its children, in Perl 5 terms. -In general, you do not need to worry about this. However, if you cache these -objects, be aware that they do keep references to each other appropriately -internally. - -As well, all C objects keep references to their parent -interpreters for similar reasons. - -=head1 METHODS - -This class provides several methods: - -=over 4 - -=item * C - -This class method creates and returns a new C object. If -there is an existing and active C object, pass it as -C<$parent>. Otherwise, pass no argument. - -=item * C - -Given the path to a file on disk, loads and compiles the code into the -interpreter. This will throw an exception if Parrot could not load or compile -the code successfully. - -=item * C - -Given a string containing Parrot PIR code, compiles the code into the -interpreter. This will return a C object representing the code. - -A future version of this method may allow compiling other types of code. - -=item * C - -Given the name of a global and, optionally, the namespace of the global, -attempts to find a global PMC associated with that name in the invoking -interpreter. This will return a C object if successful and -C if there is no PMC found. - -This method right now supports only single-level string namespaces; this will -change in the future. - -=back - -=head1 AUTHOR - -chromatic, C<< >> - -=head1 BUGS - -This code might be able to detect the presence or absence of a parent -interpreter and act appropriately. - -This code needs to support more operations on interpreters. - -Patches welcome. - -Please report any bugs or feature requests to the Parrot Porters mailing list. -Someday there may be a CPAN version of this code. Who knows? - -=cut - -# Local Variables: -# mode: cperl -# cperl-indent-level: 4 -# fill-column: 100 -# End: -# vim: expandtab shiftwidth=4: diff --git a/ext/Parrot-Embed/lib/Parrot/PMC.pm b/ext/Parrot-Embed/lib/Parrot/PMC.pm deleted file mode 100644 index cf0e78049f..0000000000 --- a/ext/Parrot-Embed/lib/Parrot/PMC.pm +++ /dev/null @@ -1,93 +0,0 @@ -package Parrot::PMC; -# Copyright (C) 2006-2009, Parrot Foundation. - -use strict; -use warnings; -our $VERSION = '20081006'; - -use Parrot::Embed; - -1; - -__END__ - -=head1 NAME - -Parrot::PMC - access a Parrot PMC from Perl 5 - -=head1 VERSION - -Version 20081006 - -=head1 SYNOPSIS - - # find a subroutine to invoke - my $sub_pmc = $interp->find_global( 'some_parrot_sub' ); - my $other_sub_pmc = $interp->find_global( 'another_sub', 'NameSpace' ); - - # invoke the subroutine - my $result_pmc = $sub_pmc->invoke( $signature, @args ); - - # get the values out of it - my $string_val = $result_pmc->get_string( $interp ); - -=head1 METHODS - -This object provides several methods: - -=over 4 - -=item * C - -Given a Sub PMC or derivative, calls the appropriate Parrot function, parsing -the C<$signature> and passing a single string C<$argument>. The first -character of the C<$signature> string denotes the return value. The remaining -characters are the argument values, per the list: - -=over 4 - -=item v void (return only) - -=item I integer - -=item N float - -=item S string - -=item P PMC - -=back - -In the future, this method may handle this translation for you automatically, -though it may I deduce the return type correctly. - -=item * C - -Retrieves the string value of the PMC. Not all PMCs support this. - -=back - -=head1 AUTHOR - -chromatic, C<< >> - -=head1 BUGS - -There are three known deficiencies. First, there should be separate classes -for separate Parrot PMC types. Second, there should be overloadings to handle -various types of getting and setting values on PMCs. Third, the C -methods do not handle enough signatures. - -Patches welcome. - -Please report any bugs or feature requests to the Parrot Porters mailing list. -Someday there may be a CPAN version of this code. Who knows? - -=cut - -# Local Variables: -# mode: cperl -# cperl-indent-level: 4 -# fill-column: 100 -# End: -# vim: expandtab shiftwidth=4: diff --git a/ext/Parrot-Embed/t/00-load.t b/ext/Parrot-Embed/t/00-load.t deleted file mode 100644 index ad81c07689..0000000000 --- a/ext/Parrot-Embed/t/00-load.t +++ /dev/null @@ -1,39 +0,0 @@ -#!perl - -# Copyright (C) 2006-2008, Parrot Foundation. - -use strict; -use warnings; - -use Test::More tests => 9; -use File::Spec; - -use_ok('Parrot::Embed' ) or exit; - -my $module = 'Parrot::Interpreter'; -can_ok( $module, 'new' ); - -my $interp = $module->new(); -ok( $interp, 'new() should return a valid interpreter' ); -isa_ok( $interp, $module ); - -my $interp2 = $module->new($interp); -ok( $interp, 'new() should return a valid interpreter, given a parent interp' ); -isa_ok( $interp, $module ); - -isnt( $$interp, $$interp2, '... but different interpreters' ); - -{ - local @Subclass::ISA = $module; - my $sc = Subclass->new($interp2); - isa_ok( $sc, $module ); - isa_ok( $sc, 'Subclass' ); -} - - -# Local Variables: -# mode: cperl -# cperl-indent-level: 4 -# fill-column: 100 -# End: -# vim: expandtab shiftwidth=4: diff --git a/ext/Parrot-Embed/t/greet.pir b/ext/Parrot-Embed/t/greet.pir deleted file mode 100644 index bc829cdf15..0000000000 --- a/ext/Parrot-Embed/t/greet.pir +++ /dev/null @@ -1,28 +0,0 @@ -# Copyright (C) 2006-2009, Parrot Foundation. - -.sub greet - .param pmc name - - .local string name_str - name_str = name - - .local pmc greeting - greeting = new 'String' - greeting = 'Hello, ' - greeting .= name_str - greeting .= '!' - - .return( greeting ) -.end - -.namespace [ 'Elsewhere' ] - -.sub greet - .return( 'Hiya!' ) -.end - -# Local Variables: -# mode: pir -# fill-column: 100 -# End: -# vim: expandtab shiftwidth=4 ft=pir: diff --git a/ext/Parrot-Embed/t/interp.t b/ext/Parrot-Embed/t/interp.t deleted file mode 100644 index 2a29bfb097..0000000000 --- a/ext/Parrot-Embed/t/interp.t +++ /dev/null @@ -1,108 +0,0 @@ -#!perl - -# Copyright (C) 2006-2010, Parrot Foundation. - -use strict; -use warnings; - -use Test::More tests => 23; -use File::Spec; - -my $hello_pbc = File::Spec->catfile( 't', 'greet.pbc' ); - -my $module = 'Parrot::Interpreter'; -use_ok('Parrot::Embed') or exit; - -can_ok( $module, 'new' ); -my $interp = $module->new(); -ok( $interp, 'new() should return a valid interpreter' ); -isa_ok( $interp, $module ); - -can_ok( $module, 'load_file' ); -my $result = eval { $interp->load_file('no file here') }; -my $except = $@; -ok( !$result, 'load_file() should return false unless it can load a file' ); -like( $except, qr/File 'no file here' not found/, '... throwing exception' ); -$result = eval { $interp->load_file($hello_pbc) }; -$except = $@; -ok( $result, '... returning true if it could load the file' ); -is( $except, '', '... throwing no exception if so' ); - -can_ok( $module, 'find_global' ); -my $global_greet = $interp->find_global('greet'); -ok( $global_greet, 'find_global() should return non-namespaced global, if found' ); -isa_ok( $global_greet, 'Parrot::PMC' ); - -ok( !$interp->find_global('goat'), - '... or nothing, if there is no non-namespaced global of that name' ); - -my $else_greet = $interp->find_global( 'greet', 'Elsewhere' ); -ok( $else_greet, '... or a namespaced global, if it exists in the namespace' ); -isnt( $$global_greet, $$else_greet, '... and definitely the namespaced version' ); - -ok( !$interp->find_global( 'goat', 'Elsewhere' ), - '... but again, not if there is no global of that name there' ); - -can_ok( $global_greet, 'invoke' ); -my $pmc = $global_greet->invoke( 'S->P', 'Bob' ); -ok( $pmc, 'invoke() should return a PMC, given that signature' ); - -is( $pmc->get_string(), 'Hello, Bob!', '... containing a string returned in the PMC' ); - -can_ok( $module, 'compile' ); -my $eval = $interp->compile( <compile('blah'), '... but only for valid PIR' ); -} - -$pmc = $else_greet->invoke( 'S->P', '' ); -is( $pmc->get_string(), 'Hiya!', '... calling the passed-in subroutine' ); - -my $foo = $interp->find_global('foo'); -$pmc = $foo->invoke( 'S->P', 'BAR' ); -is( $pmc->get_string(), 'BAR FOO ', - '... and compiled sub should work just like any other Sub pmc' ); - -my $foo; - -=cut - -my $foo; - -{ - my $die_interp = $module->new($interp); - eval { $die_interp->load_file($hello_pbc) }; - $foo = $die_interp->find_global('greet'); -} - -$pmc = $foo->invoke( 'S->P', 'out of scope' ); -is( - $pmc->get_string(), - 'Hello, out of scope!', - '... even if interpreter object has gone out of scope' -); - -# Local Variables: -# mode: cperl -# cperl-indent-level: 4 -# fill-column: 100 -# End: -# vim: expandtab shiftwidth=4: diff --git a/ext/Parrot-Embed/t/languages.t b/ext/Parrot-Embed/t/languages.t deleted file mode 100644 index 37fe7fefc1..0000000000 --- a/ext/Parrot-Embed/t/languages.t +++ /dev/null @@ -1,40 +0,0 @@ -#!perl - -# Copyright (C) 2009, Parrot Foundation. - -use strict; -use warnings; - -use Test::More; -use File::Spec; - -my $abc_pbc = File::Spec->catfile( '..', '..', 'languages', 'abc', 'abc.pbc' ); -plan skip_all => "Need to first run make in languages/abc" unless -e $abc_pbc; - -plan tests => 8; - -use_ok('Parrot::Embed') or exit; - -my $module = 'Parrot::Interpreter'; -my $interp = $module->new(); -ok( $interp, 'new() should return a valid interpreter' ); -isa_ok( $interp, $module ); - -my $result = eval { $interp->load_file($abc_pbc) }; -my $except = $@; -ok( $result, '... returning true if it could load the file' ); -is( $except, '', '... throwing no exception if so' ); - -my $abc = $interp->find_global( 'main', 'abc::Compiler' ); -isa_ok( $abc, 'Parrot::PMC' ); - -my $pmc = $abc->invoke('PS', '2+3'); -ok( $pmc, 'invoke() should return a PMC, given that signature' ); -is( $pmc->get_string(), 1, 'value returned in the PMC' ); - -# Local Variables: -# mode: cperl -# cperl-indent-level: 4 -# fill-column: 100 -# End: -# vim: expandtab shiftwidth=4: diff --git a/ext/Parrot-Embed/t/pipp.t b/ext/Parrot-Embed/t/pipp.t deleted file mode 100644 index 4734f01a58..0000000000 --- a/ext/Parrot-Embed/t/pipp.t +++ /dev/null @@ -1,82 +0,0 @@ -#!perl -# Copyright (C) 2008-2010, Parrot Foundation. - -use strict; -use warnings; - -use Test::More; -use File::Spec; - -my $pipp_pbc = File::Spec->catfile( '..', '..', 'languages', 'pipp', 'pipp.pbc' ); -plan skip_all => "Need to first run make in languages/pipp" if not -e $pipp_pbc; - -plan tests => 6; - -use_ok('Parrot::Embed') or exit; - - -my $module = 'Parrot::Interpreter'; -my $interp = $module->new(); -ok( $interp, 'new() should return a valid interpreter' ); -isa_ok( $interp, $module ); - -my $result = eval { $interp->load_file($pipp_pbc) }; -my $except = $@; -ok( $result, '... returning true if it could load the file' ); -is( $except, '', '... throwing no exception if so' ); - -# What is 'Pipp' in hll namespace 'parrot' ? -my $pipp_x = $interp->find_global( 'Pipp' ); -{ - local $TODO = 'Namespace and HLL not working yet'; - isa_ok( $pipp_x, 'Parrot::PMC' ); -} - -# todo: get hll id of Pipp -# todo: set hll namespace root to 'pipp' -# find sub 'eval' and hll namespace 'pipp' -my $pipp_eval = $interp->find_global( 'pipp', 'eval' ); -# isa_ok( $pipp_eval, 'Parrot::PMC', todo => '$pipp_eval is not found' ); -# can_ok($pipp, 'invoke'); - - -my $code = <<'END_CODE'; - -END_CODE - -# compile some PHP code -if (0) -{ - my $pmc = $pipp_eval->invoke( 'PS', $code ); - ok( $pmc, 'invoke() should return a PMC, given that signature' ); - is( $pmc->get_string(), 1, 'string returned in the PMC should be true?' ); -} - - -# invoke a built-in php function -if (0) -{ - my $pmc = $pipp_eval->invoke( 'PS', 'strlen', 'some string' ); - ok( $pmc, 'invoke() should return a PMC, given that signature' ); - is( $pmc->get_string(), 11, 'value returned in the PMC' ); -} - -# invoke a php function -if (0) -{ - my $pmc = $pipp_eval->invoke( 'PS', 'add', 23, 19 ); - ok( $pmc, 'invoke() should return a PMC, given that signature' ); - is( $pmc->get_string(), 42, 'value returned in the PMC' ); -} - - -# Local Variables: -# mode: cperl -# cperl-indent-level: 4 -# fill-column: 100 -# End: -# vim: expandtab shiftwidth=4: diff --git a/ext/Parrot-Embed/tools/check_embed_coverage.pl b/ext/Parrot-Embed/tools/check_embed_coverage.pl deleted file mode 100644 index 97e4df657b..0000000000 --- a/ext/Parrot-Embed/tools/check_embed_coverage.pl +++ /dev/null @@ -1,63 +0,0 @@ -#!perl - -# Copyright (C) 2007-2008, Parrot Foundation. - -use strict; -use warnings; -use 5.008; - -use Getopt::Long; - -my $opt_verbose = 0; -GetOptions( 'verbose' => \$opt_verbose ); - -die "usage: $0 path/to/embed.h path/to/Embed.xs\n" - unless @ARGV == 2; - -my ($embed_h, $embed_xs) = @ARGV; - -my $embed_funcs_h_ref = extract_parrot_funcs($embed_h); -print "$embed_h: @{[ sort keys %$embed_funcs_h_ref ]}\n" if $opt_verbose; - -my $embed_funcs_xs_ref = extract_parrot_funcs($embed_xs); -print "$embed_xs: @{[ sort keys %$embed_funcs_xs_ref ]}\n" if $opt_verbose; - -my %funcs_not_used = %{ $embed_funcs_h_ref }; -delete @funcs_not_used{ keys %{ $embed_funcs_xs_ref } }; - -if (%funcs_not_used) { - - warn sprintf "%d out of %d Parrot_* functions in %s not used in %s:\n", - scalar(keys %funcs_not_used), scalar keys %$embed_funcs_h_ref, $embed_h, $embed_xs; - - for my $func (sort keys %funcs_not_used) { - printf "\t%s\n", $func; - } - - exit 1; -} - -exit 0; - - -sub extract_parrot_funcs { - my ($filename) = @_; - - open my $fh, "<", $filename - or die "Can't open $filename $!\n"; - - my %names; - while (<$fh>) { - next unless m/ \b (Parrot_\w+) \s* \( /x; - $names{ $1 }++; - } - - return \%names; -} - -# Local Variables: -# mode: cperl -# cperl-indent-level: 4 -# fill-column: 100 -# End: -# vim: expandtab shiftwidth=4: diff --git a/ext/Parrot-Embed/tools/write_typemap.pl b/ext/Parrot-Embed/tools/write_typemap.pl deleted file mode 100644 index d8f01938c6..0000000000 --- a/ext/Parrot-Embed/tools/write_typemap.pl +++ /dev/null @@ -1,26 +0,0 @@ -#!perl - -# Copyright (C) 2007, Parrot Foundation. - -use strict; -use warnings; - -use File::Spec::Functions; -use ExtUtils::MakeMaker; - -chdir( catdir(qw( lib Parrot )) ); -my $custom_typemap = catfile(qw( .. .. typemap )); - -( my $perl_typemap = $INC{'ExtUtils/MakeMaker.pm'} ) =~ s/MakeMaker.pm/typemap/; - -my $c_file = qx/xsubpp -prototypes -typemap $perl_typemap -typemap $custom_typemap Embed.xs/; -open( my $file, '>', 'Embed.c' ) or die "Cannot write Embed.c\n"; -print {$file} $c_file; -close $file; - -# Local Variables: -# mode: cperl -# cperl-indent-level: 4 -# fill-column: 100 -# End: -# vim: expandtab shiftwidth=4: diff --git a/ext/Parrot-Embed/typemap b/ext/Parrot-Embed/typemap deleted file mode 100644 index 0342784c2a..0000000000 --- a/ext/Parrot-Embed/typemap +++ /dev/null @@ -1,35 +0,0 @@ -TYPEMAP -Parrot_Interp T_PTR -Parrot_PackFile T_PTR -Parrot_String T_PTR - -Parrot_PMC T_PTROBJ_PARROT -Parrot_Interp T_PTROBJ_PARROT -Interpreter_struct* T_PTROBJ_PARROT_STRUCT -PMC_struct* T_PTROBJ_PARROT_STRUCT - -INPUT -T_PTROBJ_PARROT_STRUCT - if (sv_derived_from($arg, \"${ (my $type = $ntype) =~ s/^(\w+)_struct.*$/Parrot::$1/; \$type}\")) - { - IV tmp = SvIV((SV*)SvRV($arg)); - $var = INT2PTR($type, tmp); - } - else - croak(\"$var is not of type Parrot::$ntype\") - -T_PTROBJ_PARROT - if (sv_derived_from($arg, \"${(my $ntt=$ntype)=~s/_/::/g;\$ntt}\")) - { - IV tmp = SvIV((SV*)SvRV($arg)); - $var = INT2PTR($type, tmp); - } - else - croak(\"$var is not of type ${(my $ntt=$ntype)=~s/_/::/g;\$ntt}\") - -OUTPUT -T_PTROBJ_PARROT - sv_setref_pv($arg, \"${(my $ntt=$ntype)=~s/_/::/g;\$ntt}\", (void*)$var); - -T_PTROBJ_PARROT_STRUCT - sv_setref_pv($arg, \"${ (my $type = $ntype) =~ s/^(\w+)_struct.*$/Parrot::$1/; \$type}\", (void*)$var); diff --git a/ext/nqp-rx/src/stage0/HLL-s0.pir b/ext/nqp-rx/src/stage0/HLL-s0.pir index d6ef6ce19d..143ce71c40 100644 --- a/ext/nqp-rx/src/stage0/HLL-s0.pir +++ b/ext/nqp-rx/src/stage0/HLL-s0.pir @@ -138,7 +138,7 @@ memoize the line offsets as a C property on C. # If we've previously cached C for target, we use it. unless cache goto linepos_build - linepos = getprop '!linepos', target + linepos = getprop target, '!linepos' unless null linepos goto linepos_done # calculate a new linepos array. diff --git a/ext/nqp-rx/src/stage0/Regex-s0.pir b/ext/nqp-rx/src/stage0/Regex-s0.pir index 99cc88c39e..5db75f0d45 100644 --- a/ext/nqp-rx/src/stage0/Regex-s0.pir +++ b/ext/nqp-rx/src/stage0/Regex-s0.pir @@ -1371,9 +1371,9 @@ create a new one and return it. # new one. .local pmc parrotclass, prototable parrotclass = typeof self - prototable = getprop '%!prototable', parrotclass + prototable = getprop parrotclass, '%!prototable' if null prototable goto make_prototable - $P0 = getprop '$!generation', prototable + $P0 = getprop prototable, '$!generation' $I0 = issame $P0, generation if $I0 goto have_prototable make_prototable: @@ -2178,7 +2178,7 @@ An alternate dump output for a Match object and all of its subcaptures. # vim: expandtab shiftwidth=4 ft=pir: ### .include 'src/PAST/Regex.pir' -# $Id: Regex.pir 41578 2009-09-30 14:45:23Z pmichaud $ +# $Id$ =head1 NAME diff --git a/ext/winxed/README b/ext/winxed/README index 7e28638ff3..c31868f2fe 100644 --- a/ext/winxed/README +++ b/ext/winxed/README @@ -19,6 +19,6 @@ How to choose and tag the release used: Releases are tagged like this: RELEASE_1_0_0 -To tag a new releease switch to the appropiate branch, like version_1_0, -verify is updated with the appropiate changes and the pir generated files +To tag a new release switch to the appropriate branch, like version_1_0, +verify is updated with the appropriate changes and the pir generated files are also updated, an tag it. Don't forget to push the tag to origin. diff --git a/ext/winxed/Rules.mak b/ext/winxed/Rules.mak index c7419b896a..970a9baa81 100644 --- a/ext/winxed/Rules.mak +++ b/ext/winxed/Rules.mak @@ -7,7 +7,7 @@ $(WINXED_LANG): ext/winxed/compiler.pir $(PARROT) winxed.pbc: ext/winxed/driver.pir $(PARROT) $(PARROT) -o $@ ext/winxed/driver.pir -$(WINXED) : winxed.pbc $(PBC_TO_EXE) +$(WINXED) : winxed.pbc $(PBC_TO_EXE) $(WINXED_LANG) $(PBC_TO_EXE) winxed.pbc $(INSTALLABLEWINXED) : winxed.pbc src/install_config$(O) $(PBC_TO_EXE) diff --git a/ext/winxed/compiler.pir b/ext/winxed/compiler.pir index 4cc1f65ef8..ef3c91a118 100644 --- a/ext/winxed/compiler.pir +++ b/ext/winxed/compiler.pir @@ -2,103 +2,121 @@ # Begin generated code .namespace [ 'Winxed'; 'Compiler' ] -# Constant VERSION_MAJOR evaluated at compile time -# Constant VERSION_MINOR evaluated at compile time -# Constant VERSION_BUILD evaluated at compile time -.sub 'isspace' :subid('WSubId_18') +.sub 'sformat' :subid('WSubId_45') .param string __ARG_1 -# Body -# { -.annotate 'file', 'winxedst1.winxed' -.annotate 'line', 22 - iseq $I1, __ARG_1, ' ' - if $I1 goto __label_2 - iseq $I1, __ARG_1, "\n" - __label_2: - if $I1 goto __label_1 - iseq $I1, __ARG_1, "\t" - __label_1: - .return($I1) -# } -.annotate 'line', 23 + .param pmc __ARG_2 :slurpy + new $P1, [ 'StringBuilder' ] + $P1.'append_format'(__ARG_1, __ARG_2 :flat) + set $S1, $P1 + .return($S1) -.end # isspace +.end # sformat -.sub 'isdigit' :subid('WSubId_9') - .param string __ARG_1 -# Body -# { -.annotate 'line', 27 -# predefined indexof - index $I2, '0123456789', __ARG_1 - isgt $I1, $I2, -1 - .return($I1) -# } -.annotate 'line', 28 +.sub 'bindfirst' :subid('WSubId_1') + .param pmc __ARG_1 + .param pmc __ARG_2 :slurpy +.const 'Sub' WSubId_2 = "WSubId_2" +.lex '__WLEX_1', __ARG_1 +.lex '__WLEX_2', __ARG_2 + newclosure $P1, WSubId_2 + .return($P1) -.end # isdigit +.end # bindfirst -.sub 'hexdigit' :subid('WSubId_10') - .param string __ARG_1 -# Body -# { -.annotate 'line', 32 -# i: $I1 -# predefined indexof - index $I1, '0123456789abcdef0123456789ABCDEF', __ARG_1 -.annotate 'line', 33 - lt $I1, 0, __label_1 - mod $I1, $I1, 16 - __label_1: # endif -.annotate 'line', 34 - .return($I1) -# } -.annotate 'line', 35 +.sub '' :anon :subid('WSubId_2') :outer('WSubId_1') + .param pmc __ARG_3 :slurpy + find_lex $P1, '__WLEX_1' + find_lex $P2, '__WLEX_2' + .tailcall $P1($P2 :flat, __ARG_3 :flat) + +.end # WSubId_2 + + +.sub 'bindlast' :subid('WSubId_3') + .param pmc __ARG_1 + .param pmc __ARG_2 :slurpy +.const 'Sub' WSubId_4 = "WSubId_4" +.lex '__WLEX_1', __ARG_1 +.lex '__WLEX_2', __ARG_2 + newclosure $P1, WSubId_4 + .return($P1) -.end # hexdigit +.end # bindlast -.sub 'isidentstart' :subid('WSubId_19') +.sub '' :anon :subid('WSubId_4') :outer('WSubId_3') + .param pmc __ARG_3 :slurpy + find_lex $P1, '__WLEX_1' + find_lex $P2, '__WLEX_2' + .tailcall $P1(__ARG_3 :flat, $P2 :flat) + +.end # WSubId_4 + + +.sub 'bindmethod' :subid('WSubId_5') .param string __ARG_1 -# Body -# { -.annotate 'line', 42 -# predefined indexof -.annotate 'line', 39 - index $I2, 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_', __ARG_1 -.annotate 'line', 42 - isgt $I1, $I2, -1 -.annotate 'line', 39 - .return($I1) -# } -.annotate 'line', 43 +.const 'Sub' WSubId_6 = "WSubId_6" +.lex '__WLEX_1', __ARG_1 + newclosure $P1, WSubId_6 + .return($P1) + +.end # bindmethod -.end # isidentstart +.sub '' :anon :subid('WSubId_6') :outer('WSubId_5') + .param pmc __ARG_2 + .param pmc __ARG_3 :slurpy + find_lex $S1, '__WLEX_1' + find_lex $S2, '__WLEX_1' + .tailcall __ARG_2.$S2(__ARG_3 :flat) + +.end # WSubId_6 + + +.sub 'method_fun' :subid('WSubId_7') + .param pmc __ARG_1 + .param string __ARG_2 +.const 'Sub' WSubId_8 = "WSubId_8" +.lex '__WLEX_1', __ARG_1 +.lex '__WLEX_2', $P1 + find_method $P1, __ARG_1, __ARG_2 + newclosure $P2, WSubId_8 + .return($P2) -.sub 'isident' :subid('WSubId_8') +.end # method_fun + + +.sub '' :anon :subid('WSubId_8') :outer('WSubId_7') + .param pmc __ARG_3 :slurpy + find_lex $P1, '__WLEX_1' + find_lex $P2, '__WLEX_2' + .tailcall $P1.$P2(__ARG_3 :flat) + +.end # WSubId_8 + + +.sub 'addprefix' :subid('WSubId_9') .param string __ARG_1 -# Body -# { -.annotate 'line', 51 -# predefined indexof -.annotate 'line', 47 - index $I2, 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_$0123456789', __ARG_1 -.annotate 'line', 51 - isgt $I1, $I2, -1 -.annotate 'line', 47 - .return($I1) -# } -.annotate 'line', 52 +.const 'Sub' WSubId_10 = "WSubId_10" +.lex '__WLEX_1', __ARG_1 + newclosure $P1, WSubId_10 + .return($P1) + +.end # addprefix + + +.sub '' :anon :subid('WSubId_10') :outer('WSubId_9') + .param string __ARG_2 + find_lex $S1, '__WLEX_1' + find_lex $S2, '__WLEX_1' + concat $S3, $S2, __ARG_2 + .return($S3) -.end # isident +.end # WSubId_10 -# Constant ERR_INTERNAL evaluated at compile time -# Constant ERR_TOKEN evaluated at compile time -# Constant ERR_PARSER evaluated at compile time .namespace [ 'Winxed'; 'Compiler'; 'WinxedCompilerError' ] .sub 'WinxedCompilerError' :method @@ -106,382 +124,238 @@ .param string __ARG_2 .param string __ARG_3 :optional .param int __ARG_4 :optional -# Body -# { -.annotate 'line', 78 box $P1, __ARG_1 setattribute self, 'type', $P1 -.annotate 'line', 79 box $P1, __ARG_2 setattribute self, 'message', $P1 -.annotate 'line', 80 box $P1, __ARG_3 setattribute self, 'filename', $P1 -.annotate 'line', 81 box $P1, __ARG_4 setattribute self, 'line', $P1 -# } -.annotate 'line', 82 .end # WinxedCompilerError .sub Winxed_class_init :anon :load :init newclass $P0, [ 'Winxed'; 'Compiler'; 'WinxedCompilerError' ] -.annotate 'line', 67 addattribute $P0, 'type' -.annotate 'line', 68 addattribute $P0, 'filename' -.annotate 'line', 69 addattribute $P0, 'line' -.annotate 'line', 70 addattribute $P0, 'message' .end .namespace [ 'Winxed'; 'Compiler' ] -.sub 'Warn' :subid('WSubId_68') +.sub 'Warn' :subid('WSubId_42') .param string __ARG_1 .param pmc __ARG_2 :optional - .param int __ARG_3 :opt_flag -# Body -# { -.annotate 'line', 87 -# var stderr: $P1 -# predefined getstderr getstderr $P1 -.annotate 'line', 88 $P1.'print'('WARNING: ') -.annotate 'line', 89 $P1.'print'(__ARG_1) -.annotate 'line', 90 - unless __ARG_3 goto __label_1 -# { -.annotate 'line', 91 + if_null __ARG_2, __label_1 $P1.'print'(' near ') -.annotate 'line', 92 $P2 = __ARG_2.'show'() $P1.'print'($P2) -# } __label_1: # endif -.annotate 'line', 94 $P1.'print'("\n") -# } -.annotate 'line', 95 .end # Warn -.sub 'InternalError' :subid('WSubId_6') +.sub 'InternalError' :subid('WSubId_30') .param string __ARG_1 .param pmc __ARG_2 :optional .param int __ARG_3 :opt_flag -# Body -# { -.annotate 'line', 99 unless __ARG_3 goto __label_1 -# { -.annotate 'line', 100 -# desc: $S1 + __ARG_2 = __ARG_2.'getstart'() $P2 = __ARG_2.'show'() null $S1 if_null $P2, __label_2 set $S1, $P2 __label_2: -.annotate 'line', 101 - concat __ARG_1, __ARG_1, ' near ' - concat __ARG_1, __ARG_1, $S1 -# } + concat $S2, __ARG_1, ' near ' + concat $S2, $S2, $S1 + set __ARG_1, $S2 __label_1: # endif -.annotate 'line', 103 -# var payload: $P1 unless __ARG_3 goto __label_4 -.annotate 'line', 104 new $P2, [ 'Winxed'; 'Compiler'; 'WinxedCompilerError' ] -.annotate 'line', 105 $P3 = __ARG_2.'filename'() $P4 = __ARG_2.'linenum'() $P2.'WinxedCompilerError'('internal', __ARG_1, $P3, $P4) set $P1, $P2 goto __label_3 __label_4: -.annotate 'line', 106 - new $P5, [ 'Winxed'; 'Compiler'; 'WinxedCompilerError' ] - $P5.'WinxedCompilerError'('internal', __ARG_1) + new $P6, [ 'Winxed'; 'Compiler'; 'WinxedCompilerError' ] + $P6.'WinxedCompilerError'('internal', __ARG_1) + set $P5, $P6 set $P1, $P5 __label_3: -.annotate 'line', 107 -# predefined Error root_new $P2, ['parrot';'Exception'] $P2['message'] = __ARG_1 $P2['severity'] = 2 $P2['type'] = 567 $P2['payload'] = $P1 throw $P2 -# } -.annotate 'line', 108 .end # InternalError -.sub 'TokenError' :subid('WSubId_7') - .param string __ARG_1 - .param pmc __ARG_2 - .param int __ARG_3 -# Body -# { -.annotate 'line', 112 -# predefined string - getattribute $P2, __ARG_2, 'filename' - set $S1, $P2 -# predefined string - set $S2, __ARG_3 - concat $S3, __ARG_1, ' in ' - concat $S3, $S3, $S1 - concat $S3, $S3, ' line ' - concat $S3, $S3, $S2 -.annotate 'line', 114 - new $P4, [ 'Winxed'; 'Compiler'; 'WinxedCompilerError' ] - getattribute $P5, __ARG_2, 'filename' - $P4.'WinxedCompilerError'('tokenizer', __ARG_1, $P5, __ARG_3) - set $P3, $P4 -# predefined Error -.annotate 'line', 112 - root_new $P1, ['parrot';'Exception'] - $P1['message'] = $S3 - $P1['severity'] = 2 - $P1['type'] = 567 - $P1['payload'] = $P3 - throw $P1 -# } -.annotate 'line', 115 - -.end # TokenError - - -.sub 'SyntaxError' :subid('WSubId_1') +.sub 'SyntaxError' :subid('WSubId_25') .param string __ARG_1 .param pmc __ARG_2 -# Body -# { -.annotate 'line', 119 -# line: $I1 + if_null __ARG_2, __label_1 + __ARG_2 = __ARG_2.'getstart'() + __label_1: # endif + if_null __ARG_2, __label_3 $P1 = __ARG_2.'linenum'() + goto __label_2 + __label_3: + box $P1, -1 + __label_2: set $I1, $P1 -.annotate 'line', 120 -# file: $S1 + if_null __ARG_2, __label_5 $P1 = __ARG_2.'filename'() + goto __label_4 + __label_5: + box $P1, "UNKNOWN" + __label_4: null $S1 - if_null $P1, __label_1 + if_null $P1, __label_6 set $S1, $P1 - __label_1: -.annotate 'line', 121 -# desc: $S2 -# predefined string + __label_6: $P1 = __ARG_2.'viewable'() set $S3, $P1 concat $S2, ' near ', $S3 -.annotate 'line', 122 -# predefined string set $S3, $I1 concat $S4, __ARG_1, ' in ' concat $S4, $S4, $S1 concat $S4, $S4, ' line ' concat $S4, $S4, $S3 concat $S4, $S4, $S2 -.annotate 'line', 124 new $P3, [ 'Winxed'; 'Compiler'; 'WinxedCompilerError' ] concat $S5, __ARG_1, $S2 -.annotate 'line', 125 $P3.'WinxedCompilerError'('parser', $S5, $S1, $I1) set $P2, $P3 -# predefined Error -.annotate 'line', 122 root_new $P1, ['parrot';'Exception'] $P1['message'] = $S4 $P1['severity'] = 2 $P1['type'] = 567 $P1['payload'] = $P2 throw $P1 -# } -.annotate 'line', 126 .end # SyntaxError -.sub 'NoLeftSide' :subid('WSubId_59') +.sub 'NoLeftSide' :subid('WSubId_89') .param pmc __ARG_1 -.const 'Sub' WSubId_1 = "WSubId_1" -# Body -# { -.annotate 'line', 130 - WSubId_1('Not a left-side expression', __ARG_1) -# } -.annotate 'line', 131 +.const 'Sub' WSubId_25 = "WSubId_25" + WSubId_25('Not a left-side expression', __ARG_1) .end # NoLeftSide -.sub 'Expected' :subid('WSubId_39') +.sub 'Expected' :subid('WSubId_70') .param string __ARG_1 .param pmc __ARG_2 -.const 'Sub' WSubId_1 = "WSubId_1" -# Body -# { -.annotate 'line', 135 +.const 'Sub' WSubId_25 = "WSubId_25" concat $S1, "Expected ", __ARG_1 - WSubId_1($S1, __ARG_2) -# } -.annotate 'line', 136 + WSubId_25($S1, __ARG_2) .end # Expected -.sub 'Unexpected' :subid('WSubId_40') +.sub 'Unexpected' :subid('WSubId_71') .param string __ARG_1 .param pmc __ARG_2 -.const 'Sub' WSubId_1 = "WSubId_1" -# Body -# { -.annotate 'line', 140 +.const 'Sub' WSubId_25 = "WSubId_25" concat $S1, "Unexpected ", __ARG_1 - WSubId_1($S1, __ARG_2) -# } -.annotate 'line', 141 + WSubId_25($S1, __ARG_2) .end # Unexpected -.sub 'ExpectedIdentifier' :subid('WSubId_3') +.sub 'ExpectedIdentifier' :subid('WSubId_27') .param pmc __ARG_1 -.const 'Sub' WSubId_1 = "WSubId_1" -# Body -# { -.annotate 'line', 145 - WSubId_1("Expected identifier", __ARG_1) -# } -.annotate 'line', 146 +.const 'Sub' WSubId_25 = "WSubId_25" + WSubId_25("Expected identifier", __ARG_1) .end # ExpectedIdentifier -.sub 'ExpectedOp' :subid('WSubId_2') +.sub 'ExpectedOp' :subid('WSubId_26') .param string __ARG_1 .param pmc __ARG_2 -.const 'Sub' WSubId_1 = "WSubId_1" -# Body -# { -.annotate 'line', 150 +.const 'Sub' WSubId_25 = "WSubId_25" concat $S1, "Expected '", __ARG_1 concat $S1, $S1, "'" - WSubId_1($S1, __ARG_2) -# } -.annotate 'line', 151 + WSubId_25($S1, __ARG_2) .end # ExpectedOp -.sub 'RequireOp' :subid('WSubId_4') +.sub 'RequireOp' :subid('WSubId_28') .param string __ARG_1 .param pmc __ARG_2 -.const 'Sub' WSubId_2 = "WSubId_2" -# Body -# { -.annotate 'line', 155 +.const 'Sub' WSubId_26 = "WSubId_26" $P1 = __ARG_2.'isop'(__ARG_1) isfalse $I1, $P1 unless $I1 goto __label_1 -.annotate 'line', 156 - WSubId_2(__ARG_1, __ARG_2) + WSubId_26(__ARG_1, __ARG_2) __label_1: # endif -# } -.annotate 'line', 157 .end # RequireOp -.sub 'RequireKeyword' :subid('WSubId_5') +.sub 'RequireKeyword' :subid('WSubId_29') .param string __ARG_1 .param pmc __ARG_2 -.const 'Sub' WSubId_2 = "WSubId_2" -# Body -# { -.annotate 'line', 161 +.const 'Sub' WSubId_26 = "WSubId_26" $P1 = __ARG_2.'iskeyword'(__ARG_1) isfalse $I1, $P1 unless $I1 goto __label_1 -.annotate 'line', 162 - WSubId_2(__ARG_1, __ARG_2) + WSubId_26(__ARG_1, __ARG_2) __label_1: # endif -# } -.annotate 'line', 163 .end # RequireKeyword -.sub 'RequireIdentifier' :subid('WSubId_93') +.sub 'RequireIdentifier' :subid('WSubId_124') .param pmc __ARG_1 -.const 'Sub' WSubId_3 = "WSubId_3" -# Body -# { -.annotate 'line', 167 +.const 'Sub' WSubId_27 = "WSubId_27" $P1 = __ARG_1.'isidentifier'() isfalse $I1, $P1 unless $I1 goto __label_1 -.annotate 'line', 168 - WSubId_3(__ARG_1) + WSubId_27(__ARG_1) __label_1: # endif -# } -.annotate 'line', 169 .end # RequireIdentifier -.sub 'ExpectOp' :subid('WSubId_53') +.sub 'ExpectOp' :subid('WSubId_84') .param string __ARG_1 .param pmc __ARG_2 -.const 'Sub' WSubId_4 = "WSubId_4" -# Body -# { -.annotate 'line', 173 -# var t: $P1 +.const 'Sub' WSubId_28 = "WSubId_28" $P1 = __ARG_2.'get'() -.annotate 'line', 174 - WSubId_4(__ARG_1, $P1) -# } -.annotate 'line', 175 + WSubId_28(__ARG_1, $P1) .end # ExpectOp -.sub 'ExpectKeyword' :subid('WSubId_95') +.sub 'ExpectKeyword' :subid('WSubId_126') .param string __ARG_1 .param pmc __ARG_2 -.const 'Sub' WSubId_5 = "WSubId_5" -# Body -# { -.annotate 'line', 179 -# var t: $P1 +.const 'Sub' WSubId_29 = "WSubId_29" $P1 = __ARG_2.'get'() -.annotate 'line', 180 - WSubId_5(__ARG_1, $P1) -# } -.annotate 'line', 181 + WSubId_29(__ARG_1, $P1) .end # ExpectKeyword -.sub 'UndefinedVariable' :subid('WSubId_61') - .param pmc __ARG_1 -.const 'Sub' WSubId_1 = "WSubId_1" -# Body -# { -.annotate 'line', 185 -# predefined string - set $S1, __ARG_1 - concat $S2, "Variable '", $S1 - concat $S2, $S2, "' is not defined" - WSubId_1($S2, __ARG_1) -# } -.annotate 'line', 186 +.sub 'UndefinedVariable' :subid('WSubId_91') + .param string __ARG_1 + .param pmc __ARG_2 +.const 'Sub' WSubId_25 = "WSubId_25" + concat $S1, "Variable '", __ARG_1 + concat $S1, $S1, "' is not defined" + WSubId_25($S1, __ARG_2) .end # UndefinedVariable @@ -490,215 +364,137 @@ .sub 'Token' :method .param string __ARG_1 .param int __ARG_2 -# Body -# { -.annotate 'line', 198 box $P1, __ARG_1 setattribute self, 'file', $P1 -.annotate 'line', 199 box $P1, __ARG_2 setattribute self, 'line', $P1 -# } -.annotate 'line', 200 .end # Token +.sub 'getstart' :method + .return(self) + +.end # getstart + + .sub 'iseof' :method -# Body -# { -.annotate 'line', 202 .return(0) -# } .end # iseof .sub 'iscomment' :method -# Body -# { -.annotate 'line', 203 .return(0) -# } .end # iscomment .sub 'isidentifier' :method -# Body -# { -.annotate 'line', 204 .return(0) -# } .end # isidentifier .sub 'isint' :method -# Body -# { -.annotate 'line', 205 .return(0) -# } .end # isint .sub 'isfloat' :method -# Body -# { -.annotate 'line', 206 .return(0) -# } .end # isfloat .sub 'isstring' :method -# Body -# { -.annotate 'line', 207 .return(0) -# } .end # isstring .sub 'issinglequoted' :method -# Body -# { -.annotate 'line', 208 .return(0) -# } .end # issinglequoted .sub 'getintvalue' :method -.const 'Sub' WSubId_6 = "WSubId_6" -# Body -# { -.annotate 'line', 212 - WSubId_6('Not a literal int', self) -# } -.annotate 'line', 213 +.const 'Sub' WSubId_30 = "WSubId_30" + WSubId_30('Not a literal int', self) .end # getintvalue .sub 'rawstring' :method -.const 'Sub' WSubId_6 = "WSubId_6" -# Body -# { -.annotate 'line', 216 - WSubId_6('Not a literal string', self) -# } -.annotate 'line', 217 +.const 'Sub' WSubId_30 = "WSubId_30" + WSubId_30('Not a literal string', self) .end # rawstring .sub 'getidentifier' :method -.const 'Sub' WSubId_3 = "WSubId_3" -# Body -# { -.annotate 'line', 220 - WSubId_3(self) -# } -.annotate 'line', 221 +.const 'Sub' WSubId_27 = "WSubId_27" + WSubId_27(self) .end # getidentifier .sub 'iskeyword' :method .param string __ARG_1 -# Body -# { -.annotate 'line', 222 .return(0) -# } .end # iskeyword .sub 'checkkeyword' :method -# Body -# { -.annotate 'line', 223 .return(0) -# } .end # checkkeyword .sub 'isop' :method .param string __ARG_1 -# Body -# { -.annotate 'line', 224 .return(0) -# } .end # isop .sub 'checkop' :method -# Body -# { -.annotate 'line', 225 .return('') -# } .end # checkop .sub 'viewable' :method -# Body -# { -.annotate 'line', 226 .return('(unknown)') -# } .end # viewable .sub 'filename' :method -# Body -# { -.annotate 'line', 227 getattribute $P1, self, 'file' .return($P1) -# } .end # filename .sub 'linenum' :method -# Body -# { -.annotate 'line', 228 getattribute $P1, self, 'line' .return($P1) -# } .end # linenum .sub 'show' :method -# Body -# { -.annotate 'line', 231 -# r: $S1 $P1 = self.'viewable'() null $S1 if_null $P1, __label_1 set $S1, $P1 __label_1: -.annotate 'line', 232 -# predefined string getattribute $P1, self, 'file' set $S2, $P1 -# predefined string getattribute $P2, self, 'line' set $S3, $P2 concat $S4, $S1, ' at ' @@ -706,54 +502,36 @@ concat $S4, $S4, ' line ' concat $S4, $S4, $S3 .return($S4) -# } -.annotate 'line', 233 .end # show .sub Winxed_class_init :anon :load :init newclass $P0, [ 'Winxed'; 'Compiler'; 'Token' ] -.annotate 'line', 194 addattribute $P0, 'file' -.annotate 'line', 195 addattribute $P0, 'line' .end .namespace [ 'Winxed'; 'Compiler'; 'TokenEof' ] .sub 'TokenEof' :method .param string __ARG_1 -# Body -# { -.annotate 'line', 240 self.'Token'(__ARG_1, 0) -# } -.annotate 'line', 241 .end # TokenEof .sub 'iseof' :method -# Body -# { -.annotate 'line', 242 .return(1) -# } .end # iseof .sub 'viewable' :method -# Body -# { -.annotate 'line', 243 .return('(End of file)') -# } .end # viewable .sub Winxed_class_init :anon :load :init newclass $P0, [ 'Winxed'; 'Compiler'; 'TokenEof' ] -.annotate 'line', 236 get_class $P1, [ 'Winxed'; 'Compiler'; 'Token' ] addparent $P0, $P1 .end @@ -763,47 +541,30 @@ .param string __ARG_1 .param int __ARG_2 .param string __ARG_3 -# Body -# { -.annotate 'line', 251 self.'Token'(__ARG_1, __ARG_2) -.annotate 'line', 252 box $P1, __ARG_3 setattribute self, 'str', $P1 -# } -.annotate 'line', 253 .end # TokenWithVal .sub 'get_string' :method :vtable -# Body -# { -.annotate 'line', 254 getattribute $P1, self, 'str' .return($P1) -# } .end # get_string .sub 'viewable' :method -# Body -# { -.annotate 'line', 257 getattribute $P1, self, 'str' .return($P1) -# } -.annotate 'line', 258 .end # viewable .sub Winxed_class_init :anon :load :init newclass $P0, [ 'Winxed'; 'Compiler'; 'TokenWithVal' ] -.annotate 'line', 246 get_class $P1, [ 'Winxed'; 'Compiler'; 'Token' ] addparent $P0, $P1 -.annotate 'line', 248 addattribute $P0, 'str' .end .namespace [ 'Winxed'; 'Compiler'; 'TokenComment' ] @@ -812,28 +573,18 @@ .param string __ARG_1 .param int __ARG_2 .param string __ARG_3 -# Body -# { -.annotate 'line', 265 self.'TokenWithVal'(__ARG_1, __ARG_2, __ARG_3) -# } -.annotate 'line', 266 .end # TokenComment .sub 'iscomment' :method -# Body -# { -.annotate 'line', 267 .return(1) -# } .end # iscomment .sub Winxed_class_init :anon :load :init newclass $P0, [ 'Winxed'; 'Compiler'; 'TokenComment' ] -.annotate 'line', 261 get_class $P1, [ 'Winxed'; 'Compiler'; 'TokenWithVal' ] addparent $P0, $P1 .end @@ -843,47 +594,30 @@ .param string __ARG_1 .param int __ARG_2 .param string __ARG_3 -# Body -# { -.annotate 'line', 274 self.'TokenWithVal'(__ARG_1, __ARG_2, __ARG_3) -# } -.annotate 'line', 275 .end # TokenOp .sub 'isop' :method .param string __ARG_1 -# Body -# { -.annotate 'line', 278 getattribute $P1, self, 'str' set $S1, $P1 iseq $I1, $S1, __ARG_1 .return($I1) -# } -.annotate 'line', 279 .end # isop .sub 'checkop' :method -# Body -# { -# predefined string -.annotate 'line', 282 getattribute $P1, self, 'str' set $S1, $P1 .return($S1) -# } -.annotate 'line', 283 .end # checkop .sub Winxed_class_init :anon :load :init newclass $P0, [ 'Winxed'; 'Compiler'; 'TokenOp' ] -.annotate 'line', 270 get_class $P1, [ 'Winxed'; 'Compiler'; 'TokenWithVal' ] addparent $P0, $P1 .end @@ -893,98 +627,62 @@ .param string __ARG_1 .param int __ARG_2 .param string __ARG_3 -# Body -# { -.annotate 'line', 290 self.'TokenWithVal'(__ARG_1, __ARG_2, __ARG_3) -# } -.annotate 'line', 291 .end # TokenIdentifier .sub 'isidentifier' :method -# Body -# { -.annotate 'line', 292 .return(1) -# } .end # isidentifier .sub 'getidentifier' :method -# Body -# { -.annotate 'line', 295 getattribute $P1, self, 'str' .return($P1) -# } -.annotate 'line', 296 .end # getidentifier .sub 'checkkeyword' :method -# Body -# { -# predefined string -.annotate 'line', 299 getattribute $P1, self, 'str' set $S1, $P1 .return($S1) -# } -.annotate 'line', 300 .end # checkkeyword .sub 'iskeyword' :method .param string __ARG_1 -# Body -# { -.annotate 'line', 303 getattribute $P1, self, 'str' set $S1, $P1 iseq $I1, $S1, __ARG_1 .return($I1) -# } -.annotate 'line', 304 .end # iskeyword .sub Winxed_class_init :anon :load :init newclass $P0, [ 'Winxed'; 'Compiler'; 'TokenIdentifier' ] -.annotate 'line', 286 get_class $P1, [ 'Winxed'; 'Compiler'; 'TokenWithVal' ] addparent $P0, $P1 .end .namespace [ 'Winxed'; 'Compiler'; 'TokenString' ] .sub 'isstring' :method -# Body -# { -.annotate 'line', 309 .return(1) -# } .end # isstring .sub 'rawstring' :method -# Body -# { -.annotate 'line', 312 getattribute $P1, self, 'str' .return($P1) -# } -.annotate 'line', 313 .end # rawstring .sub Winxed_class_init :anon :load :init newclass $P0, [ 'Winxed'; 'Compiler'; 'TokenString' ] -.annotate 'line', 307 get_class $P1, [ 'Winxed'; 'Compiler'; 'TokenWithVal' ] addparent $P0, $P1 .end @@ -994,106 +692,61 @@ .param string __ARG_1 .param int __ARG_2 .param string __ARG_3 -# Body -# { -.annotate 'line', 320 self.'TokenWithVal'(__ARG_1, __ARG_2, __ARG_3) -# } -.annotate 'line', 321 .end # TokenQuoted .sub 'get_string' :method :vtable -# Body -# { -# predefined string -.annotate 'line', 324 getattribute $P1, self, 'str' set $S1, $P1 concat $S2, '"', $S1 concat $S2, $S2, '"' .return($S2) -# } -.annotate 'line', 325 .end # get_string .sub 'viewable' :method -# Body -# { -# predefined string -.annotate 'line', 328 getattribute $P1, self, 'str' set $S1, $P1 concat $S2, '"', $S1 concat $S2, $S2, '"' .return($S2) -# } -.annotate 'line', 329 .end # viewable .sub 'getasquoted' :method -# Body -# { -.annotate 'line', 332 getattribute $P1, self, 'str' .return($P1) -# } -.annotate 'line', 333 .end # getasquoted .sub 'getPirString' :method -.const 'Sub' WSubId_1 = "WSubId_1" -# Body -# { -.annotate 'line', 336 -# str: $S1 +.const 'Sub' WSubId_25 = "WSubId_25" getattribute $P1, self, 'str' null $S1 if_null $P1, __label_1 set $S1, $P1 __label_1: -.annotate 'line', 337 -# strunesc: $S2 null $S2 -.annotate 'line', 338 -# try: create handler new $P1, 'ExceptionHandler' set_label $P1, __label_2 push_eh $P1 -# try: begin -# { -.annotate 'line', 339 -# predefined unescape $P0 = new ['String'] $P0 = $S1 $S2 = $P0.'unescape'('utf8') -# } -# try: end pop_eh goto __label_3 -.annotate 'line', 338 -# catch __label_2: .get_results($P2) finalize $P2 pop_eh -# { -.annotate 'line', 342 - WSubId_1("Invalid escape sequence in literal string", self) -# } -# catch end + WSubId_25("Invalid escape sequence in literal string", self) __label_3: -.annotate 'line', 344 -# need_encoding: $I1 null $I1 -.annotate 'line', 345 box $P1, $S2 if_null $P1, __label_5 iter $P3, $P1 @@ -1101,43 +754,28 @@ __label_4: # for iteration unless $P3 goto __label_5 shift $I2, $P3 -# { -.annotate 'line', 346 le $I2, 127, __label_6 -# { -.annotate 'line', 347 set $I1, 1 goto __label_5 # break -.annotate 'line', 348 -# } __label_6: # endif -# } goto __label_4 __label_5: # endfor -.annotate 'line', 351 -# predefined escape escape $S1, $S2 -.annotate 'line', 352 -# encoding: $S3 unless $I1 goto __label_8 set $S3, "utf8:" goto __label_7 __label_8: set $S3, "" __label_7: -.annotate 'line', 353 concat $S4, $S3, '"' concat $S4, $S4, $S1 concat $S4, $S4, '"' .return($S4) -# } -.annotate 'line', 354 .end # getPirString .sub Winxed_class_init :anon :load :init newclass $P0, [ 'Winxed'; 'Compiler'; 'TokenQuoted' ] -.annotate 'line', 316 get_class $P1, [ 'Winxed'; 'Compiler'; 'TokenString' ] addparent $P0, $P1 .end @@ -1147,65 +785,39 @@ .param string __ARG_1 .param int __ARG_2 .param string __ARG_3 -# Body -# { -.annotate 'line', 361 self.'TokenWithVal'(__ARG_1, __ARG_2, __ARG_3) -# } -.annotate 'line', 362 .end # TokenSingleQuoted .sub 'issinglequoted' :method -# Body -# { -.annotate 'line', 363 .return(1) -# } .end # issinglequoted .sub 'get_string' :method :vtable -# Body -# { -# predefined string -.annotate 'line', 366 getattribute $P1, self, 'str' set $S1, $P1 concat $S2, "'", $S1 concat $S2, $S2, "'" .return($S2) -# } -.annotate 'line', 367 .end # get_string .sub 'viewable' :method -# Body -# { -# predefined string -.annotate 'line', 370 getattribute $P1, self, 'str' set $S1, $P1 concat $S2, "'", $S1 concat $S2, $S2, "'" .return($S2) -# } -.annotate 'line', 371 .end # viewable .sub 'getasquoted' :method -# Body -# { -.annotate 'line', 374 -# s: $S1 set $S1, '' -.annotate 'line', 375 getattribute $P1, self, 'str' if_null $P1, __label_2 iter $P2, $P1 @@ -1213,55 +825,38 @@ __label_1: # for iteration unless $P2 goto __label_2 shift $S2, $P2 -# { -# switch -.annotate 'line', 376 - set $S3, $S2 - set $S4, '"' - if $S3 == $S4 goto __label_5 - set $S4, '\' - if $S3 == $S4 goto __label_6 - set $S4, "'" - if $S3 == $S4 goto __label_7 - goto __label_4 + if_null $S2, __label_3 + length $I1, $S2 + ne $I1, 1, __label_3 + ord $I1, $S2 + if $I1 == 34 goto __label_5 + if $I1 == 92 goto __label_6 + if $I1 == 39 goto __label_7 + goto __label_3 __label_5: # case __label_6: # case __label_7: # case -.annotate 'line', 380 - concat $S2, '\', $S2 - goto __label_3 # break - __label_4: # default - __label_3: # switch end -.annotate 'line', 383 + concat $S3, '\', $S2 + set $S2, $S3 + goto __label_4 # break + __label_3: # default + __label_4: # switch end concat $S1, $S1, $S2 -# } goto __label_1 __label_2: # endfor -.annotate 'line', 385 .return($S1) -# } -.annotate 'line', 386 .end # getasquoted .sub 'getPirString' :method -# Body -# { -.annotate 'line', 389 -# str: $S1 getattribute $P1, self, 'str' null $S1 if_null $P1, __label_1 set $S1, $P1 __label_1: -.annotate 'line', 390 -# quote: $S2 set $S2, "'" -.annotate 'line', 391 -# need_escape: $I1 null $I1 -.annotate 'line', 392 box $P1, $S1 if_null $P1, __label_3 iter $P2, $P1 @@ -1269,35 +864,20 @@ __label_2: # for iteration unless $P2 goto __label_3 shift $I2, $P2 -# { -.annotate 'line', 393 islt $I5, $I2, 32 if $I5 goto __label_5 isgt $I5, $I2, 127 __label_5: unless $I5 goto __label_4 -# { -.annotate 'line', 394 set $I1, 1 goto __label_3 # break -.annotate 'line', 395 -# } __label_4: # endif -# } goto __label_2 __label_3: # endfor -.annotate 'line', 398 -# need_encoding: $I3 null $I3 -.annotate 'line', 399 unless $I1 goto __label_6 -# { -.annotate 'line', 400 set $S2, '"' -.annotate 'line', 401 -# result: $S3 set $S3, '' -.annotate 'line', 402 box $P1, $S1 if_null $P1, __label_8 iter $P3, $P1 @@ -1305,75 +885,50 @@ __label_7: # for iteration unless $P3 goto __label_8 shift $S4, $P3 -# { -.annotate 'line', 403 ne $S4, '\', __label_9 -.annotate 'line', 404 concat $S3, $S3, '\\' goto __label_10 __label_9: # else -# { -.annotate 'line', 407 -# n: $I4 -# predefined ord ord $I4, $S4 -.annotate 'line', 408 islt $I5, $I4, 32 if $I5 goto __label_13 isgt $I5, $I4, 127 __label_13: unless $I5 goto __label_11 -# { -.annotate 'line', 409 le $I4, 127, __label_14 -.annotate 'line', 410 set $I3, 1 __label_14: # endif -.annotate 'line', 411 -# h: $S5 box $P4, $I4 $P1 = $P4.'get_as_base'(16) null $S5 if_null $P1, __label_15 set $S5, $P1 __label_15: -.annotate 'line', 412 concat $S3, $S3, '\x{' concat $S3, $S3, $S5 concat $S3, $S3, '}' -# } goto __label_12 __label_11: # else -.annotate 'line', 415 concat $S3, $S3, $S4 __label_12: # endif -# } __label_10: # endif -# } goto __label_7 __label_8: # endfor -.annotate 'line', 418 set $S1, $S3 -# } __label_6: # endif -.annotate 'line', 420 - concat $S1, $S2, $S1 - concat $S1, $S1, $S2 -.annotate 'line', 421 + concat $S6, $S2, $S1 + concat $S6, $S6, $S2 + set $S1, $S6 unless $I3 goto __label_16 -.annotate 'line', 422 - concat $S1, 'utf8:', $S1 + concat $S6, 'utf8:', $S1 + set $S1, $S6 __label_16: # endif -.annotate 'line', 423 .return($S1) -# } -.annotate 'line', 424 .end # getPirString .sub Winxed_class_init :anon :load :init newclass $P0, [ 'Winxed'; 'Compiler'; 'TokenSingleQuoted' ] -.annotate 'line', 357 get_class $P1, [ 'Winxed'; 'Compiler'; 'TokenString' ] addparent $P0, $P1 .end @@ -1383,42 +938,26 @@ .param string __ARG_1 .param int __ARG_2 .param string __ARG_3 -# Body -# { -.annotate 'line', 431 self.'TokenWithVal'(__ARG_1, __ARG_2, __ARG_3) -# } -.annotate 'line', 432 .end # TokenInteger .sub 'isint' :method -# Body -# { -.annotate 'line', 433 .return(1) -# } .end # isint .sub 'getintvalue' :method -# Body -# { -# predefined int -.annotate 'line', 436 getattribute $P1, self, 'str' set $I1, $P1 .return($I1) -# } -.annotate 'line', 437 .end # getintvalue .sub Winxed_class_init :anon :load :init newclass $P0, [ 'Winxed'; 'Compiler'; 'TokenInteger' ] -.annotate 'line', 427 get_class $P1, [ 'Winxed'; 'Compiler'; 'TokenWithVal' ] addparent $P0, $P1 .end @@ -1428,568 +967,437 @@ .param string __ARG_1 .param int __ARG_2 .param string __ARG_3 -# Body -# { -.annotate 'line', 444 self.'TokenWithVal'(__ARG_1, __ARG_2, __ARG_3) -# } -.annotate 'line', 445 .end # TokenFloat .sub 'isfloat' :method -# Body -# { -.annotate 'line', 446 .return(1) -# } .end # isfloat .sub 'getfloatvalue' :method -# Body -# { -# predefined float -.annotate 'line', 449 getattribute $P1, self, 'str' set $N1, $P1 .return($N1) -# } -.annotate 'line', 450 .end # getfloatvalue .sub Winxed_class_init :anon :load :init newclass $P0, [ 'Winxed'; 'Compiler'; 'TokenFloat' ] -.annotate 'line', 440 get_class $P1, [ 'Winxed'; 'Compiler'; 'TokenWithVal' ] addparent $P0, $P1 .end .namespace [ 'Winxed'; 'Compiler' ] -.sub 'getquoted' :subid('WSubId_13') +.sub 'TokenError' :subid('WSubId_31') + .param string __ARG_1 + .param pmc __ARG_2 + .param int __ARG_3 + getattribute $P2, __ARG_2, 'filename' + set $S1, $P2 + set $S2, __ARG_3 + concat $S3, __ARG_1, ' in ' + concat $S3, $S3, $S1 + concat $S3, $S3, ' line ' + concat $S3, $S3, $S2 + new $P4, [ 'Winxed'; 'Compiler'; 'WinxedCompilerError' ] + getattribute $P5, __ARG_2, 'filename' + $P4.'WinxedCompilerError'('tokenizer', __ARG_1, $P5, __ARG_3) + set $P3, $P4 + root_new $P1, ['parrot';'Exception'] + $P1['message'] = $S3 + $P1['severity'] = 2 + $P1['type'] = 567 + $P1['payload'] = $P3 + throw $P1 + +.end # TokenError + + +.sub 'UnterminatedString' :subid('WSubId_32') + .param pmc __ARG_1 + .param int __ARG_2 +.const 'Sub' WSubId_31 = "WSubId_31" + WSubId_31('Unterminated string', __ARG_1, __ARG_2) + +.end # UnterminatedString + + +.sub 'UnterminatedHeredoc' :subid('WSubId_33') + .param pmc __ARG_1 + .param int __ARG_2 +.const 'Sub' WSubId_31 = "WSubId_31" + WSubId_31('Unterminated heredoc', __ARG_1, __ARG_2) + +.end # UnterminatedHeredoc + + +.sub 'UnclosedComment' :subid('WSubId_34') + .param pmc __ARG_1 + .param int __ARG_2 +.const 'Sub' WSubId_31 = "WSubId_31" + WSubId_31("Unclosed comment", __ARG_1, __ARG_2) + +.end # UnclosedComment + + +.sub 'getquoted' :subid('WSubId_37') .param pmc __ARG_1 .param string __ARG_2 .param int __ARG_3 -.const 'Sub' WSubId_7 = "WSubId_7" -# Body -# { -.annotate 'line', 460 -# s: $S1 +.const 'Sub' WSubId_32 = "WSubId_32" set $S1, '' -.annotate 'line', 461 -# c: $S2 null $S2 -# for loop -.annotate 'line', 462 $P1 = __ARG_1.'getchar'() set $S2, $P1 __label_3: # for condition eq $S2, '"', __label_2 -# { -# switch -.annotate 'line', 463 - set $S4, $S2 - set $S5, "" - if $S4 == $S5 goto __label_6 - set $S5, "\n" - if $S4 == $S5 goto __label_7 - set $S5, '\' - if $S4 == $S5 goto __label_8 - goto __label_5 + if $S2 == "" goto __label_6 + if $S2 == "\n" goto __label_7 + if $S2 == '\' goto __label_8 + goto __label_4 __label_6: # case __label_7: # case -.annotate 'line', 466 - WSubId_7('Unterminated string', __ARG_1, __ARG_3) + WSubId_32(__ARG_1, __ARG_3) __label_8: # case -.annotate 'line', 469 -# c2: $S3 $P2 = __ARG_1.'getchar'() null $S3 if_null $P2, __label_9 set $S3, $P2 __label_9: -.annotate 'line', 470 iseq $I1, $S3, '' if $I1 goto __label_11 iseq $I1, $S3, "\n" __label_11: unless $I1 goto __label_10 -.annotate 'line', 471 - WSubId_7('Unterminated string', __ARG_1, __ARG_3) + WSubId_32(__ARG_1, __ARG_3) __label_10: # endif -.annotate 'line', 472 concat $S1, $S1, $S2 concat $S1, $S1, $S3 - goto __label_4 # break - __label_5: # default -.annotate 'line', 475 + goto __label_5 # break + __label_4: # default concat $S1, $S1, $S2 - __label_4: # switch end -# } + __label_5: # switch end __label_1: # for iteration -.annotate 'line', 462 $P1 = __ARG_1.'getchar'() set $S2, $P1 goto __label_3 __label_2: # for end -.annotate 'line', 478 new $P2, [ 'Winxed'; 'Compiler'; 'TokenQuoted' ] getattribute $P3, __ARG_1, 'filename' $P2.'TokenQuoted'($P3, __ARG_3, $S1) set $P1, $P2 .return($P1) -# } -.annotate 'line', 479 .end # getquoted -.sub 'getsinglequoted' :subid('WSubId_14') +.sub 'getsinglequoted' :subid('WSubId_38') .param pmc __ARG_1 .param string __ARG_2 .param int __ARG_3 -.const 'Sub' WSubId_7 = "WSubId_7" -# Body -# { -.annotate 'line', 483 -# s: $S1 +.const 'Sub' WSubId_32 = "WSubId_32" set $S1, '' -.annotate 'line', 484 -# c: $S2 null $S2 -# for loop -.annotate 'line', 485 $P1 = __ARG_1.'getchar'() set $S2, $P1 __label_3: # for condition eq $S2, "'", __label_2 -# { -.annotate 'line', 486 iseq $I1, $S2, "" if $I1 goto __label_5 iseq $I1, $S2, "\n" __label_5: unless $I1 goto __label_4 -.annotate 'line', 487 - WSubId_7('Unterminated string', __ARG_1, __ARG_3) + WSubId_32(__ARG_1, __ARG_3) __label_4: # endif -.annotate 'line', 488 concat $S1, $S1, $S2 -# } __label_1: # for iteration -.annotate 'line', 485 $P1 = __ARG_1.'getchar'() set $S2, $P1 goto __label_3 __label_2: # for end -.annotate 'line', 490 new $P2, [ 'Winxed'; 'Compiler'; 'TokenSingleQuoted' ] getattribute $P3, __ARG_1, 'filename' $P2.'TokenSingleQuoted'($P3, __ARG_3, $S1) set $P1, $P2 .return($P1) -# } -.annotate 'line', 491 .end # getsinglequoted -.sub 'getheredoc' :subid('WSubId_15') +.sub 'getheredoc' :subid('WSubId_39') .param pmc __ARG_1 .param string __ARG_2 .param int __ARG_3 -.const 'Sub' WSubId_7 = "WSubId_7" -# Body -# { -.annotate 'line', 495 -# mark: $S1 +.const 'Sub' WSubId_33 = "WSubId_33" set $S1, '' -.annotate 'line', 496 -# c: $S2 null $S2 -# for loop -.annotate 'line', 497 $P1 = __ARG_1.'getchar'() set $S2, $P1 __label_3: # for condition eq $S2, "\n", __label_2 -# { -# switch -.annotate 'line', 498 - set $S5, $S2 - set $S6, '' - if $S5 == $S6 goto __label_6 - set $S6, '"' - if $S5 == $S6 goto __label_7 - set $S6, '\' - if $S5 == $S6 goto __label_8 - goto __label_5 + if $S2 == '' goto __label_6 + if $S2 == '"' goto __label_7 + if $S2 == '\' goto __label_8 + goto __label_4 __label_6: # case -.annotate 'line', 500 - WSubId_7('Unterminated heredoc', __ARG_1, __ARG_3) + WSubId_33(__ARG_1, __ARG_3) __label_7: # case __label_8: # case -.annotate 'line', 505 - concat $S2, '\', $S2 - goto __label_4 # break - __label_5: # default - __label_4: # switch end -.annotate 'line', 508 - concat $S1, $S1, $S2 -# } + concat $S6, '\', $S2 + set $S2, $S6 + goto __label_5 # break + __label_4: # default + __label_5: # switch end + concat $S5, $S1, $S2 + set $S1, $S5 __label_1: # for iteration -.annotate 'line', 497 $P1 = __ARG_1.'getchar'() set $S2, $P1 goto __label_3 __label_2: # for end -.annotate 'line', 510 - concat $S1, $S1, ':>>' -.annotate 'line', 512 -# content: $S3 + concat $S5, $S1, ':>>' + set $S1, $S5 set $S3, '' -.annotate 'line', 513 -# line: $S4 null $S4 __label_9: # do -.annotate 'line', 514 -# { -.annotate 'line', 515 set $S4, '' -# for loop -.annotate 'line', 516 $P1 = __ARG_1.'getchar'() set $S2, $P1 __label_14: # for condition eq $S2, "\n", __label_13 -# { -# switch -.annotate 'line', 517 - set $S5, $S2 - set $S6, '' - if $S5 == $S6 goto __label_17 - set $S6, '"' - if $S5 == $S6 goto __label_18 - set $S6, '\' - if $S5 == $S6 goto __label_19 - goto __label_16 + if $S2 == '' goto __label_17 + if $S2 == '"' goto __label_18 + if $S2 == '\' goto __label_19 + goto __label_15 __label_17: # case -.annotate 'line', 519 - WSubId_7('Unterminated heredoc', __ARG_1, __ARG_3) + WSubId_33(__ARG_1, __ARG_3) __label_18: # case __label_19: # case -.annotate 'line', 522 - concat $S2, '\', $S2 - goto __label_15 # break - __label_16: # default - __label_15: # switch end -.annotate 'line', 525 + concat $S6, '\', $S2 + set $S2, $S6 + goto __label_16 # break + __label_15: # default + __label_16: # switch end concat $S4, $S4, $S2 -# } __label_12: # for iteration -.annotate 'line', 516 $P1 = __ARG_1.'getchar'() set $S2, $P1 goto __label_14 __label_13: # for end -.annotate 'line', 527 eq $S4, $S1, __label_20 -.annotate 'line', 528 concat $S3, $S3, $S4 concat $S3, $S3, '\n' __label_20: # endif -# } __label_11: # continue -.annotate 'line', 529 ne $S4, $S1, __label_9 __label_10: # enddo -.annotate 'line', 530 new $P2, [ 'Winxed'; 'Compiler'; 'TokenQuoted' ] getattribute $P3, __ARG_1, 'filename' $P2.'TokenQuoted'($P3, __ARG_3, $S3) set $P1, $P2 .return($P1) -# } -.annotate 'line', 531 .end # getheredoc -.sub 'getident' :subid('WSubId_11') +.sub 'getident' :subid('WSubId_35') .param pmc __ARG_1 .param string __ARG_2 .param int __ARG_3 -.const 'Sub' WSubId_8 = "WSubId_8" -# Body -# { -.annotate 'line', 535 -# s: $S1 set $S1, __ARG_2 -.annotate 'line', 536 -# c: $S2 null $S2 -# for loop -.annotate 'line', 537 $P1 = __ARG_1.'getchar'() set $S2, $P1 __label_3: # for condition - $P2 = WSubId_8($S2) - if_null $P2, __label_2 - unless $P2 goto __label_2 -.annotate 'line', 538 + set $S3, $S2 + index $I2, 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_$0123456789', $S3 + isgt $I1, $I2, -1 + goto __label_4 + __label_4: + unless $I1 goto __label_2 concat $S1, $S1, $S2 __label_1: # for iteration -.annotate 'line', 537 - $P3 = __ARG_1.'getchar'() - set $S2, $P3 + $P1 = __ARG_1.'getchar'() + set $S2, $P1 goto __label_3 __label_2: # for end -.annotate 'line', 539 __ARG_1.'ungetchar'($S2) -.annotate 'line', 540 new $P2, [ 'Winxed'; 'Compiler'; 'TokenIdentifier' ] getattribute $P3, __ARG_1, 'filename' $P2.'TokenIdentifier'($P3, __ARG_3, $S1) set $P1, $P2 .return($P1) -# } -.annotate 'line', 541 .end # getident -.sub 'getnumber' :subid('WSubId_20') +.sub 'getnumber' :subid('WSubId_43') .param pmc __ARG_1 .param string __ARG_2 .param int __ARG_3 -.const 'Sub' WSubId_9 = "WSubId_9" -.const 'Sub' WSubId_10 = "WSubId_10" -# Body -# { -.annotate 'line', 545 -# s: $S1 null $S1 -.annotate 'line', 546 -# c: $S2 set $S2, __ARG_2 __label_1: # do -.annotate 'line', 547 -# { -.annotate 'line', 548 concat $S1, $S1, $S2 -.annotate 'line', 549 $P1 = __ARG_1.'getchar'() set $S2, $P1 -# } __label_3: # continue -.annotate 'line', 550 - $P1 = WSubId_9($S2) - if_null $P1, __label_2 - if $P1 goto __label_1 + set $S3, $S2 + index $I5, '0123456789', $S3 + isgt $I4, $I5, -1 + goto __label_4 + __label_4: + if $I4 goto __label_1 __label_2: # enddo -.annotate 'line', 551 - iseq $I3, $S1, '0' - unless $I3 goto __label_5 - iseq $I3, $S2, 'x' - if $I3 goto __label_6 - iseq $I3, $S2, 'X' + iseq $I5, $S1, '0' + unless $I5 goto __label_6 + iseq $I5, $S2, 'x' + if $I5 goto __label_7 + iseq $I5, $S2, 'X' + __label_7: __label_6: - __label_5: - unless $I3 goto __label_4 -# { -.annotate 'line', 552 -# hexval: $I1 + unless $I5 goto __label_5 null $I1 -# h: $I2 null $I2 -# for loop -.annotate 'line', 553 $P1 = __ARG_1.'getchar'() set $S2, $P1 - __label_9: # for condition - $P2 = WSubId_10($S2) - set $I2, $P2 - lt $I2, 0, __label_8 -# { -.annotate 'line', 554 - mul $I3, $I1, 16 - add $I1, $I3, $I2 -.annotate 'line', 555 + __label_10: # for condition + set $S4, $S2 + index $I3, '0123456789abcdef0123456789ABCDEF', $S4 + lt $I3, 0, __label_12 + mod $I3, $I3, 16 + __label_12: # endif + set $I2, $I3 + goto __label_11 + __label_11: + lt $I2, 0, __label_9 + mul $I5, $I1, 16 + add $I1, $I5, $I2 concat $S1, $S1, $S2 -# } - __label_7: # for iteration -.annotate 'line', 553 + __label_8: # for iteration $P1 = __ARG_1.'getchar'() set $S2, $P1 - goto __label_9 - __label_8: # for end -.annotate 'line', 557 + goto __label_10 + __label_9: # for end __ARG_1.'ungetchar'($S2) -.annotate 'line', 558 set $S1, $I1 -.annotate 'line', 559 new $P2, [ 'Winxed'; 'Compiler'; 'TokenInteger' ] getattribute $P3, __ARG_1, 'filename' $P2.'TokenInteger'($P3, __ARG_3, $S1) set $P1, $P2 .return($P1) -# } - __label_4: # endif -.annotate 'line', 561 - ne $S2, '.', __label_10 -# { - __label_12: # do -.annotate 'line', 562 -# { -.annotate 'line', 563 + __label_5: # endif + ne $S2, '.', __label_13 + __label_15: # do concat $S1, $S1, $S2 -.annotate 'line', 564 $P1 = __ARG_1.'getchar'() set $S2, $P1 -# } - __label_14: # continue -.annotate 'line', 565 - $P1 = WSubId_9($S2) - if_null $P1, __label_13 - if $P1 goto __label_12 - __label_13: # enddo -.annotate 'line', 566 - iseq $I3, $S2, 'e' - if $I3 goto __label_16 - iseq $I3, $S2, 'E' - __label_16: - unless $I3 goto __label_15 -# { -.annotate 'line', 567 + __label_17: # continue + set $S5, $S2 + index $I5, '0123456789', $S5 + isgt $I6, $I5, -1 + goto __label_18 + __label_18: + if $I6 goto __label_15 + __label_16: # enddo + iseq $I5, $S2, 'e' + if $I5 goto __label_20 + iseq $I5, $S2, 'E' + __label_20: + unless $I5 goto __label_19 concat $S1, $S1, 'E' -.annotate 'line', 568 $P1 = __ARG_1.'getchar'() set $S2, $P1 - iseq $I3, $S2, '+' - if $I3 goto __label_18 - iseq $I3, $S2, '-' - __label_18: - unless $I3 goto __label_17 -# { -.annotate 'line', 569 + iseq $I5, $S2, '+' + if $I5 goto __label_22 + iseq $I5, $S2, '-' + __label_22: + unless $I5 goto __label_21 concat $S1, $S1, $S2 -.annotate 'line', 570 $P1 = __ARG_1.'getchar'() set $S2, $P1 -# } - __label_17: # endif -# for loop - __label_21: # for condition -.annotate 'line', 572 - $P1 = WSubId_9($S2) - if_null $P1, __label_20 - unless $P1 goto __label_20 -.annotate 'line', 573 + __label_21: # endif + __label_25: # for condition + set $S6, $S2 + index $I5, '0123456789', $S6 + isgt $I7, $I5, -1 + goto __label_26 + __label_26: + unless $I7 goto __label_24 concat $S1, $S1, $S2 - __label_19: # for iteration -.annotate 'line', 572 - $P2 = __ARG_1.'getchar'() - set $S2, $P2 - goto __label_21 - __label_20: # for end -# } - __label_15: # endif -.annotate 'line', 575 + __label_23: # for iteration + $P1 = __ARG_1.'getchar'() + set $S2, $P1 + goto __label_25 + __label_24: # for end + __label_19: # endif __ARG_1.'ungetchar'($S2) -.annotate 'line', 576 new $P2, [ 'Winxed'; 'Compiler'; 'TokenFloat' ] getattribute $P3, __ARG_1, 'filename' $P2.'TokenFloat'($P3, __ARG_3, $S1) set $P1, $P2 .return($P1) -# } - goto __label_11 - __label_10: # else -# { -.annotate 'line', 579 - iseq $I3, $S2, 'e' - if $I3 goto __label_24 - iseq $I3, $S2, 'E' - __label_24: - unless $I3 goto __label_22 -# { -.annotate 'line', 580 + goto __label_14 + __label_13: # else + iseq $I5, $S2, 'e' + if $I5 goto __label_29 + iseq $I5, $S2, 'E' + __label_29: + unless $I5 goto __label_27 concat $S1, $S1, 'E' -.annotate 'line', 581 $P1 = __ARG_1.'getchar'() set $S2, $P1 - iseq $I3, $S2, '+' - if $I3 goto __label_26 - iseq $I3, $S2, '-' - __label_26: - unless $I3 goto __label_25 -# { -.annotate 'line', 582 + iseq $I5, $S2, '+' + if $I5 goto __label_31 + iseq $I5, $S2, '-' + __label_31: + unless $I5 goto __label_30 concat $S1, $S1, $S2 -.annotate 'line', 583 $P1 = __ARG_1.'getchar'() set $S2, $P1 -# } - __label_25: # endif -# for loop - __label_29: # for condition -.annotate 'line', 585 - $P1 = WSubId_9($S2) - if_null $P1, __label_28 - unless $P1 goto __label_28 -.annotate 'line', 586 + __label_30: # endif + __label_34: # for condition + set $S7, $S2 + index $I5, '0123456789', $S7 + isgt $I8, $I5, -1 + goto __label_35 + __label_35: + unless $I8 goto __label_33 concat $S1, $S1, $S2 - __label_27: # for iteration -.annotate 'line', 585 - $P2 = __ARG_1.'getchar'() - set $S2, $P2 - goto __label_29 - __label_28: # for end -.annotate 'line', 587 + __label_32: # for iteration + $P1 = __ARG_1.'getchar'() + set $S2, $P1 + goto __label_34 + __label_33: # for end __ARG_1.'ungetchar'($S2) -.annotate 'line', 588 new $P2, [ 'Winxed'; 'Compiler'; 'TokenFloat' ] getattribute $P3, __ARG_1, 'filename' $P2.'TokenFloat'($P3, __ARG_3, $S1) set $P1, $P2 .return($P1) -# } - goto __label_23 - __label_22: # else -# { -.annotate 'line', 591 + goto __label_28 + __label_27: # else __ARG_1.'ungetchar'($S2) -.annotate 'line', 592 new $P2, [ 'Winxed'; 'Compiler'; 'TokenInteger' ] getattribute $P3, __ARG_1, 'filename' $P2.'TokenInteger'($P3, __ARG_3, $S1) set $P1, $P2 .return($P1) -# } - __label_23: # endif -# } - __label_11: # endif -# } -.annotate 'line', 595 + __label_28: # endif + __label_14: # endif .end # getnumber -.sub 'getlinecomment' :subid('WSubId_16') +.sub 'getlinecomment' :subid('WSubId_40') .param pmc __ARG_1 .param string __ARG_2 .param int __ARG_3 -# Body -# { -.annotate 'line', 599 -# s: $S1 set $S1, __ARG_2 -# for loop -.annotate 'line', 600 -# c: $S2 $P1 = __ARG_1.'getchar'() null $S2 if_null $P1, __label_4 @@ -2001,113 +1409,77 @@ isne $I1, $S2, "\n" __label_5: unless $I1 goto __label_2 -.annotate 'line', 601 concat $S1, $S1, $S2 __label_1: # for iteration -.annotate 'line', 600 $P2 = __ARG_1.'getchar'() set $S2, $P2 goto __label_3 __label_2: # for end -.annotate 'line', 602 new $P2, [ 'Winxed'; 'Compiler'; 'TokenComment' ] getattribute $P3, __ARG_1, 'filename' $P2.'TokenComment'($P3, __ARG_3, $S1) set $P1, $P2 .return($P1) -# } -.annotate 'line', 603 .end # getlinecomment -.sub 'getcomment' :subid('WSubId_17') +.sub 'getcomment' :subid('WSubId_41') .param pmc __ARG_1 .param string __ARG_2 .param int __ARG_3 -.const 'Sub' WSubId_7 = "WSubId_7" -# Body -# { -.annotate 'line', 607 -# s: $S1 +.const 'Sub' WSubId_34 = "WSubId_34" set $S1, __ARG_2 -.annotate 'line', 608 -# c: $S2 $P1 = __ARG_1.'getchar'() null $S2 if_null $P1, __label_1 set $S2, $P1 __label_1: __label_2: # do -.annotate 'line', 609 -# { -# for loop __label_7: # for condition -.annotate 'line', 610 isne $I1, $S2, '' unless $I1 goto __label_8 isne $I1, $S2, '*' __label_8: unless $I1 goto __label_6 -.annotate 'line', 611 concat $S1, $S1, $S2 __label_5: # for iteration -.annotate 'line', 610 $P1 = __ARG_1.'getchar'() set $S2, $P1 goto __label_7 __label_6: # for end -.annotate 'line', 612 ne $S2, '', __label_9 -.annotate 'line', 613 - WSubId_7("Unclosed comment", __ARG_1, __ARG_3) + WSubId_34(__ARG_1, __ARG_3) __label_9: # endif -.annotate 'line', 614 concat $S1, $S1, $S2 -.annotate 'line', 615 $P1 = __ARG_1.'getchar'() set $S2, $P1 -.annotate 'line', 616 ne $S2, '', __label_10 -.annotate 'line', 617 - WSubId_7("Unclosed comment", __ARG_1, __ARG_3) + WSubId_34(__ARG_1, __ARG_3) __label_10: # endif -# } __label_4: # continue -.annotate 'line', 618 ne $S2, '/', __label_2 __label_3: # enddo -.annotate 'line', 619 concat $S1, $S1, '/' -.annotate 'line', 620 new $P2, [ 'Winxed'; 'Compiler'; 'TokenComment' ] getattribute $P3, __ARG_1, 'filename' $P2.'TokenComment'($P3, __ARG_3, $S1) set $P1, $P2 .return($P1) -# } -.annotate 'line', 621 .end # getcomment -.sub 'getop' :subid('WSubId_12') +.sub 'getop' :subid('WSubId_36') .param pmc __ARG_1 .param string __ARG_2 .param int __ARG_3 -# Body -# { -.annotate 'line', 625 -# s: $S1 set $S1, __ARG_2 -.annotate 'line', 626 new $P2, [ 'Winxed'; 'Compiler'; 'TokenOp' ] getattribute $P3, __ARG_1, 'filename' $P2.'TokenOp'($P3, __ARG_3, $S1) set $P1, $P2 .return($P1) -# } -.annotate 'line', 627 .end # getop @@ -2116,665 +1488,492 @@ .sub 'Tokenizer' :method .param pmc __ARG_1 .param string __ARG_2 -.const 'Sub' WSubId_11 = "WSubId_11" -.const 'Sub' WSubId_12 = "WSubId_12" -.const 'Sub' WSubId_13 = "WSubId_13" -.const 'Sub' WSubId_14 = "WSubId_14" -.const 'Sub' WSubId_15 = "WSubId_15" -.const 'Sub' WSubId_16 = "WSubId_16" -.const 'Sub' WSubId_17 = "WSubId_17" -# Body -# { -.annotate 'line', 643 + .param int __ARG_3 +.const 'Sub' WSubId_35 = "WSubId_35" +.const 'Sub' WSubId_36 = "WSubId_36" +.const 'Sub' WSubId_37 = "WSubId_37" +.const 'Sub' WSubId_38 = "WSubId_38" +.const 'Sub' WSubId_39 = "WSubId_39" +.const 'Sub' WSubId_40 = "WSubId_40" +.const 'Sub' WSubId_41 = "WSubId_41" + not $I1, __ARG_3 + new $P3, [ 'Boolean' ], $I1 + setattribute self, 'warnings', $P3 setattribute self, 'h', __ARG_1 -.annotate 'line', 644 box $P2, '' setattribute self, 'pending', $P2 -.annotate 'line', 645 root_new $P3, ['parrot';'ResizablePMCArray'] setattribute self, 'stacked', $P3 -.annotate 'line', 646 box $P2, __ARG_2 setattribute self, 'filename', $P2 -.annotate 'line', 647 box $P2, 1 setattribute self, 'line', $P2 -.annotate 'line', 648 -# var select: $P1 root_new $P1, ['parrot';'Hash'] -.annotate 'line', 649 + root_new $P2, ['parrot';'Hash'] + $P2[''] = WSubId_35 + $P2['{'] = WSubId_36 + $P1['$'] = $P2 + $P1['"'] = WSubId_37 + $P1["'"] = WSubId_38 root_new $P3, ['parrot';'Hash'] - $P3[''] = WSubId_11 - $P3['{'] = WSubId_12 - $P1['$'] = $P3 -.annotate 'line', 650 - $P1['"'] = WSubId_13 -.annotate 'line', 651 - $P1["'"] = WSubId_14 -.annotate 'line', 652 + root_new $P4, ['parrot';'Hash'] + $P4[''] = WSubId_36 + $P4['='] = WSubId_36 + $P3['='] = $P4 + $P3[':'] = WSubId_36 + $P1['='] = $P3 + root_new $P5, ['parrot';'Hash'] + $P5['+'] = WSubId_36 + $P5['='] = WSubId_36 + $P1['+'] = $P5 + root_new $P6, ['parrot';'Hash'] + $P6['-'] = WSubId_36 + $P6['='] = WSubId_36 + $P1['-'] = $P6 + root_new $P7, ['parrot';'Hash'] + $P7['='] = WSubId_36 + $P1['*'] = $P7 + root_new $P8, ['parrot';'Hash'] + $P8['|'] = WSubId_36 + $P1['|'] = $P8 root_new $P9, ['parrot';'Hash'] -.annotate 'line', 653 + $P9['&'] = WSubId_36 + $P1['&'] = $P9 + root_new $P10, ['parrot';'Hash'] root_new $P11, ['parrot';'Hash'] - $P11[''] = WSubId_12 - $P11['='] = WSubId_12 - $P9['='] = $P11 -.annotate 'line', 654 - $P9[':'] = WSubId_12 - $P1['='] = $P9 -.annotate 'line', 656 + $P11[''] = WSubId_36 + $P11[':'] = WSubId_39 + $P10['<'] = $P11 + $P10['='] = WSubId_36 + $P1['<'] = $P10 + root_new $P12, ['parrot';'Hash'] + root_new $P13, ['parrot';'Hash'] + $P13[''] = WSubId_36 + $P13['>'] = WSubId_36 + $P12['>'] = $P13 + $P12['='] = WSubId_36 + $P1['>'] = $P12 + root_new $P14, ['parrot';'Hash'] + root_new $P15, ['parrot';'Hash'] + $P15[''] = WSubId_36 + $P15['='] = WSubId_36 + $P14['='] = $P15 + $P1['!'] = $P14 root_new $P16, ['parrot';'Hash'] - $P16['+'] = WSubId_12 - $P16['='] = WSubId_12 - $P1['+'] = $P16 -.annotate 'line', 657 - root_new $P20, ['parrot';'Hash'] - $P20['-'] = WSubId_12 - $P20['='] = WSubId_12 - $P1['-'] = $P20 -.annotate 'line', 658 - root_new $P24, ['parrot';'Hash'] - $P24['='] = WSubId_12 - $P1['*'] = $P24 -.annotate 'line', 659 - root_new $P27, ['parrot';'Hash'] - $P27['|'] = WSubId_12 - $P1['|'] = $P27 -.annotate 'line', 660 - root_new $P30, ['parrot';'Hash'] - $P30['&'] = WSubId_12 - $P1['&'] = $P30 -.annotate 'line', 661 - root_new $P33, ['parrot';'Hash'] -.annotate 'line', 662 - root_new $P35, ['parrot';'Hash'] - $P35[''] = WSubId_12 - $P35[':'] = WSubId_15 - $P33['<'] = $P35 -.annotate 'line', 663 - $P33['='] = WSubId_12 - $P1['<'] = $P33 -.annotate 'line', 665 - root_new $P40, ['parrot';'Hash'] - $P40['>'] = WSubId_12 - $P40['='] = WSubId_12 - $P1['>'] = $P40 -.annotate 'line', 666 - root_new $P44, ['parrot';'Hash'] -.annotate 'line', 667 - root_new $P46, ['parrot';'Hash'] - $P46[''] = WSubId_12 - $P46['='] = WSubId_12 - $P44['='] = $P46 - $P1['!'] = $P44 -.annotate 'line', 669 - root_new $P50, ['parrot';'Hash'] - $P50['%'] = WSubId_12 - $P50['='] = WSubId_12 - $P1['%'] = $P50 -.annotate 'line', 670 - root_new $P54, ['parrot';'Hash'] - $P54['='] = WSubId_12 - $P54['/'] = WSubId_16 - $P54['*'] = WSubId_17 - $P1['/'] = $P54 -.annotate 'line', 671 - $P1['#'] = WSubId_16 -.annotate 'line', 673 + $P16['%'] = WSubId_36 + $P16['='] = WSubId_36 + $P1['%'] = $P16 + root_new $P17, ['parrot';'Hash'] + $P17['='] = WSubId_36 + $P17['/'] = WSubId_40 + $P17['*'] = WSubId_41 + $P1['/'] = $P17 + $P1['#'] = WSubId_40 setattribute self, 'select', $P1 -# } -.annotate 'line', 674 .end # Tokenizer +.sub 'warn' :method + .param string __ARG_1 + .param pmc __ARG_2 :optional +.const 'Sub' WSubId_42 = "WSubId_42" + getattribute $P1, self, 'warnings' + if_null $P1, __label_1 + unless $P1 goto __label_1 + WSubId_42(__ARG_1, __ARG_2) + __label_1: # endif + +.end # warn + + .sub 'getchar' :method -# Body -# { -.annotate 'line', 677 -# var pending: $P1 getattribute $P1, self, 'pending' -.annotate 'line', 678 -# c: $S1 - set $P3, $P1 null $S1 - if_null $P3, __label_1 - set $S1, $P3 + if_null $P1, __label_1 + set $S1, $P1 __label_1: -.annotate 'line', 679 eq $S1, '', __label_2 -.annotate 'line', 680 assign $P1, '' goto __label_3 __label_2: # else -# { -.annotate 'line', 682 -# var h: $P2 getattribute $P2, self, 'h' -.annotate 'line', 683 $P3 = $P2.'read'(1) set $S1, $P3 -.annotate 'line', 684 ne $S1, "\n", __label_4 -.annotate 'line', 685 getattribute $P3, self, 'line' inc $P3 __label_4: # endif -# } __label_3: # endif -.annotate 'line', 687 .return($S1) -# } -.annotate 'line', 688 .end # getchar .sub 'ungetchar' :method .param string __ARG_1 -# Body -# { -.annotate 'line', 691 getattribute $P1, self, 'pending' assign $P1, __ARG_1 -# } -.annotate 'line', 692 .end # ungetchar .sub 'get_token' :method -.const 'Sub' WSubId_18 = "WSubId_18" -.const 'Sub' WSubId_19 = "WSubId_19" -.const 'Sub' WSubId_11 = "WSubId_11" -.const 'Sub' WSubId_9 = "WSubId_9" -.const 'Sub' WSubId_20 = "WSubId_20" -.const 'Sub' WSubId_12 = "WSubId_12" -# Body -# { -.annotate 'line', 695 +.const 'Sub' WSubId_35 = "WSubId_35" +.const 'Sub' WSubId_43 = "WSubId_43" +.const 'Sub' WSubId_36 = "WSubId_36" getattribute $P3, self, 'stacked' if_null $P3, __label_1 unless $P3 goto __label_1 -.annotate 'line', 696 getattribute $P4, self, 'stacked' .tailcall $P4.'pop'() __label_1: # endif -.annotate 'line', 698 -# c: $S1 $P3 = self.'getchar'() null $S1 if_null $P3, __label_2 set $S1, $P3 __label_2: __label_4: # while -.annotate 'line', 699 - $P3 = WSubId_18($S1) - if_null $P3, __label_3 - unless $P3 goto __label_3 -.annotate 'line', 700 - $P4 = self.'getchar'() - set $S1, $P4 + set $S3, $S1 + iseq $I2, $S3, ' ' + if $I2 goto __label_7 + iseq $I2, $S3, "\n" + __label_7: + if $I2 goto __label_6 + iseq $I2, $S3, "\t" + __label_6: + goto __label_5 + __label_5: + unless $I2 goto __label_3 + $P3 = self.'getchar'() + set $S1, $P3 goto __label_4 __label_3: # endwhile -.annotate 'line', 701 -# line: $I1 getattribute $P3, self, 'line' set $I1, $P3 -.annotate 'line', 702 - ne $S1, '', __label_5 -.annotate 'line', 703 + ne $S1, '', __label_8 new $P4, [ 'Winxed'; 'Compiler'; 'TokenEof' ] getattribute $P5, self, 'filename' $P4.'TokenEof'($P5) set $P3, $P4 .return($P3) - __label_5: # endif -.annotate 'line', 704 - $P3 = WSubId_19($S1) - if_null $P3, __label_6 - unless $P3 goto __label_6 -.annotate 'line', 705 - .tailcall WSubId_11(self, $S1, $I1) - __label_6: # endif -.annotate 'line', 706 - $P3 = WSubId_9($S1) - if_null $P3, __label_7 - unless $P3 goto __label_7 -.annotate 'line', 707 - .tailcall WSubId_20(self, $S1, $I1) - __label_7: # endif -.annotate 'line', 709 -# op: $S2 + __label_8: # endif + set $S4, $S1 + index $I4, 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_', $S4 + isgt $I3, $I4, -1 + goto __label_10 + __label_10: + unless $I3 goto __label_9 + .tailcall WSubId_35(self, $S1, $I1) + __label_9: # endif + set $S5, $S1 + index $I4, '0123456789', $S5 + isgt $I5, $I4, -1 + goto __label_12 + __label_12: + unless $I5 goto __label_11 + .tailcall WSubId_43(self, $S1, $I1) + __label_11: # endif set $S2, $S1 -.annotate 'line', 710 -# var select: $P1 getattribute $P1, self, 'select' -.annotate 'line', 711 -# var current: $P2 $P2 = $P1[$S1] - __label_9: # while -.annotate 'line', 713 - isnull $I2, $P2 - not $I2 - unless $I2 goto __label_10 - isa $I2, $P2, 'Hash' - __label_10: - unless $I2 goto __label_8 -# { -.annotate 'line', 714 + __label_14: # while + isnull $I4, $P2 + not $I4 + unless $I4 goto __label_15 + isa $I4, $P2, 'Hash' + __label_15: + unless $I4 goto __label_13 $P3 = self.'getchar'() set $S1, $P3 -.annotate 'line', 715 set $P1, $P2 -.annotate 'line', 716 $P2 = $P1[$S1] -.annotate 'line', 717 - unless_null $P2, __label_11 -# { -.annotate 'line', 718 + unless_null $P2, __label_16 self.'ungetchar'($S1) -.annotate 'line', 719 $P2 = $P1[''] -# } - goto __label_12 - __label_11: # else -.annotate 'line', 722 + goto __label_17 + __label_16: # else concat $S2, $S2, $S1 - __label_12: # endif -# } - goto __label_9 - __label_8: # endwhile -.annotate 'line', 724 - if_null $P2, __label_13 - unless $P2 goto __label_13 -.annotate 'line', 725 - .tailcall $P2(self, $S2, $I1) - __label_13: # endif -.annotate 'line', 726 - .tailcall WSubId_12(self, $S2, $I1) -# } -.annotate 'line', 727 + __label_17: # endif + goto __label_14 + __label_13: # endwhile + if_null $P2, __label_19 + $P3 = $P2(self, $S2, $I1) + goto __label_18 + __label_19: + $P4 = WSubId_36(self, $S2, $I1) + set $P3, $P4 + __label_18: + .return($P3) .end # get_token .sub 'get' :method .param int __ARG_1 :optional -# Body -# { -.annotate 'line', 730 -# var t: $P1 $P1 = self.'get_token'() __label_2: # while -.annotate 'line', 731 - $P2 = $P1.'iseof'() - isfalse $I1, $P2 + $P3 = $P1.'iseof'() + isfalse $I1, $P3 unless $I1 goto __label_4 not $I1, __ARG_1 __label_4: - unless $I1 goto __label_3 - $I1 = $P1.'iscomment'() + box $P2, $I1 + unless $P2 goto __label_3 + $P2 = $P1.'iscomment'() __label_3: - unless $I1 goto __label_1 -.annotate 'line', 732 + if_null $P2, __label_1 + unless $P2 goto __label_1 $P1 = self.'get_token'() goto __label_2 __label_1: # endwhile -.annotate 'line', 733 .return($P1) -# } -.annotate 'line', 734 .end # get .sub 'unget' :method .param pmc __ARG_1 -# Body -# { -.annotate 'line', 737 getattribute $P1, self, 'stacked' -# predefined push push $P1, __ARG_1 -# } -.annotate 'line', 738 .end # unget .sub Winxed_class_init :anon :load :init newclass $P0, [ 'Winxed'; 'Compiler'; 'Tokenizer' ] -.annotate 'line', 635 + addattribute $P0, 'warnings' addattribute $P0, 'h' -.annotate 'line', 636 addattribute $P0, 'pending' -.annotate 'line', 637 addattribute $P0, 'select' -.annotate 'line', 638 addattribute $P0, 'stacked' -.annotate 'line', 639 addattribute $P0, 'filename' -.annotate 'line', 640 addattribute $P0, 'line' .end .namespace [ 'Winxed'; 'Compiler' ] -# Constant REGint evaluated at compile time -# Constant REGfloat evaluated at compile time -# Constant REGstring evaluated at compile time -# Constant REGvar evaluated at compile time -# Constant REGarglist evaluated at compile time -# Constant REGany evaluated at compile time -# Constant REGs_v evaluated at compile time -# Constant REGraw1 evaluated at compile time -# Constant REGnone evaluated at compile time - -.sub 'typetoregcheck' :subid('WSubId_96') + +.sub 'typetoregcheck' :subid('WSubId_127') .param string __ARG_1 -# Body -# { -# switch -.annotate 'line', 760 - set $S1, __ARG_1 - set $S2, 'int' - if $S1 == $S2 goto __label_3 - set $S2, 'float' - if $S1 == $S2 goto __label_4 - set $S2, 'string' - if $S1 == $S2 goto __label_5 - set $S2, 'var' - if $S1 == $S2 goto __label_6 - goto __label_2 + if __ARG_1 == 'int' goto __label_3 + if __ARG_1 == 'float' goto __label_4 + if __ARG_1 == 'string' goto __label_5 + if __ARG_1 == 'var' goto __label_6 + goto __label_1 __label_3: # case -.annotate 'line', 761 .return('I') __label_4: # case -.annotate 'line', 762 .return('N') __label_5: # case -.annotate 'line', 763 .return('S') __label_6: # case -.annotate 'line', 764 .return('P') - __label_2: # default -.annotate 'line', 765 + __label_1: # default .return('') - __label_1: # switch end -# } -.annotate 'line', 767 + __label_2: # switch end .end # typetoregcheck -.sub 'typetopirname' :subid('WSubId_105') +.sub 'typetopirname' :subid('WSubId_136') .param string __ARG_1 -.const 'Sub' WSubId_6 = "WSubId_6" -# Body -# { -# switch -.annotate 'line', 771 - set $S1, __ARG_1 - set $S2, 'I' - if $S1 == $S2 goto __label_3 - set $S2, 'N' - if $S1 == $S2 goto __label_4 - set $S2, 'S' - if $S1 == $S2 goto __label_5 - set $S2, 'P' - if $S1 == $S2 goto __label_6 - goto __label_2 +.const 'Sub' WSubId_30 = "WSubId_30" + if_null __ARG_1, __label_1 + length $I1, __ARG_1 + ne $I1, 1, __label_1 + ord $I1, __ARG_1 + if $I1 == 73 goto __label_3 + if $I1 == 78 goto __label_4 + if $I1 == 83 goto __label_5 + if $I1 == 80 goto __label_6 + goto __label_1 __label_3: # case -.annotate 'line', 772 .return('int') __label_4: # case -.annotate 'line', 773 .return('num') __label_5: # case -.annotate 'line', 774 .return('string') __label_6: # case -.annotate 'line', 775 .return('pmc') - __label_2: # default -.annotate 'line', 776 - WSubId_6('Invalid reg type') - __label_1: # switch end -# } -.annotate 'line', 778 + __label_1: # default + WSubId_30('Invalid reg type') + __label_2: # switch end .end # typetopirname -# Constant INDENT evaluated at compile time -# Constant INDENTLABEL evaluated at compile time .namespace [ 'Winxed'; 'Compiler'; 'Emit' ] .sub 'Emit' :method .param pmc __ARG_1 -# Body -# { -.annotate 'line', 798 + .param int __ARG_2 setattribute self, 'handle', __ARG_1 -.annotate 'line', 799 - box $P1, '' + box $P1, "" setattribute self, 'file', $P1 -.annotate 'line', 800 box $P1, 0 setattribute self, 'line', $P1 -.annotate 'line', 801 box $P1, 0 setattribute self, 'pendingf', $P1 -.annotate 'line', 802 box $P1, 0 setattribute self, 'pendingl', $P1 -# } -.annotate 'line', 803 + not $I1, __ARG_2 + new $P2, [ 'Boolean' ], $I1 + setattribute self, 'warnings', $P2 .end # Emit +.sub 'setDebug' :method + box $P1, 1 + setattribute self, 'debug', $P1 + +.end # setDebug + + +.sub 'getDebug' :method + getattribute $P1, self, 'debug' + isnull $I1, $P1 + not $I1 + .return($I1) + +.end # getDebug + + .sub 'disable_annotations' :method -# Body -# { -.annotate 'line', 806 box $P1, 1 setattribute self, 'noan', $P1 -# } -.annotate 'line', 807 .end # disable_annotations .sub 'close' :method -# Body -# { -.annotate 'line', 810 null $P1 setattribute self, 'handle', $P1 -# } -.annotate 'line', 811 .end # close +.sub 'warn' :method + .param string __ARG_1 + .param pmc __ARG_2 :optional +.const 'Sub' WSubId_42 = "WSubId_42" + getattribute $P1, self, 'warnings' + if_null $P1, __label_1 + unless $P1 goto __label_1 + WSubId_42(__ARG_1, __ARG_2) + __label_1: # endif + +.end # warn + + .sub 'updateannot' :method -# Body -# { -.annotate 'line', 814 getattribute $P1, self, 'pendingf' if_null $P1, __label_1 unless $P1 goto __label_1 -# { -.annotate 'line', 815 getattribute $P2, self, 'handle' root_new $P3, ['parrot';'ResizablePMCArray'] - box $P4, ".annotate 'file', '" - push $P3, $P4 -.annotate 'line', 817 - getattribute $P5, self, 'file' -.annotate 'line', 815 - push $P3, $P5 - box $P4, "'\n" - push $P3, $P4 -# predefined join + assign $P3, 3 + $P3[0] = ".annotate 'file', '" + getattribute $P4, self, 'file' + $P3[1] = $P4 + $P3[2] = "'\n" join $S1, "", $P3 $P2.'print'($S1) -.annotate 'line', 820 getattribute $P1, self, 'pendingf' assign $P1, 0 -# } __label_1: # endif -.annotate 'line', 822 getattribute $P1, self, 'pendingl' if_null $P1, __label_2 unless $P1 goto __label_2 -# { -.annotate 'line', 823 getattribute $P2, self, 'handle' root_new $P3, ['parrot';'ResizablePMCArray'] - box $P4, ".annotate 'line', " - push $P3, $P4 -.annotate 'line', 825 - getattribute $P5, self, 'line' -.annotate 'line', 823 - push $P3, $P5 - box $P4, "\n" - push $P3, $P4 -# predefined join + assign $P3, 3 + $P3[0] = ".annotate 'line', " + getattribute $P4, self, 'line' + $P3[1] = $P4 + $P3[2] = "\n" join $S1, "", $P3 $P2.'print'($S1) -.annotate 'line', 828 getattribute $P1, self, 'pendingl' assign $P1, 0 -# } __label_2: # endif -# } -.annotate 'line', 830 .end # updateannot .sub 'vprint' :method .param pmc __ARG_1 -# Body -# { -.annotate 'line', 833 - if_null __ARG_1, __label_2 - iter $P2, __ARG_1 - set $P2, 0 - __label_1: # for iteration - unless $P2 goto __label_2 - shift $P1, $P2 -.annotate 'line', 834 - getattribute $P3, self, 'handle' - $P3.'print'($P1) - goto __label_1 - __label_2: # endfor -# } -.annotate 'line', 835 +.const 'Sub' WSubId_7 = "WSubId_7" + set $P1, __ARG_1 + getattribute $P4, self, 'handle' + $P2 = WSubId_7($P4, "print") + if_null $P1, __label_3 + iter $P5, $P1 + set $P5, 0 + __label_2: # for iteration + unless $P5 goto __label_3 + shift $P3, $P5 + $P2($P3) + goto __label_2 + __label_3: # endfor + __label_1: .end # vprint .sub 'print' :method .param pmc __ARG_1 :slurpy -# Body -# { -.annotate 'line', 838 self.'updateannot'() -.annotate 'line', 839 self.'vprint'(__ARG_1) -# } -.annotate 'line', 840 .end # print .sub 'say' :method .param pmc __ARG_1 :slurpy -# Body -# { -.annotate 'line', 843 self.'updateannot'() -.annotate 'line', 844 self.'vprint'(__ARG_1) -.annotate 'line', 845 getattribute $P1, self, 'handle' $P1.'print'("\n") -# } -.annotate 'line', 846 .end # say .sub 'annotate' :method .param pmc __ARG_1 -# Body -# { -.annotate 'line', 849 getattribute $P3, self, 'noan' unless_null $P3, __label_1 -# { -.annotate 'line', 851 -# var file: $P1 getattribute $P1, self, 'file' -.annotate 'line', 852 -# var line: $P2 getattribute $P2, self, 'line' -.annotate 'line', 853 -# tfile: $S1 getattribute $P3, __ARG_1, 'file' null $S1 if_null $P3, __label_2 set $S1, $P3 __label_2: -.annotate 'line', 854 -# tline: $I1 getattribute $P3, __ARG_1, 'line' set $I1, $P3 -.annotate 'line', 855 set $S2, $P1 eq $S2, $S1, __label_3 -# { -.annotate 'line', 856 assign $P1, $S1 -.annotate 'line', 857 getattribute $P3, self, 'pendingf' assign $P3, 1 -.annotate 'line', 858 assign $P2, 0 -# } __label_3: # endif -.annotate 'line', 860 set $I2, $P2 eq $I2, $I1, __label_4 -# { -.annotate 'line', 861 assign $P2, $I1 -.annotate 'line', 862 getattribute $P3, self, 'pendingl' assign $P3, 1 -# } __label_4: # endif -# } __label_1: # endif -# } -.annotate 'line', 865 .end # annotate .sub 'comment' :method .param string __ARG_1 -# Body -# { -.annotate 'line', 868 self.'updateannot'() -.annotate 'line', 869 getattribute $P1, self, 'handle' - concat $S1, '# ', __ARG_1 + concat $S1, "# ", __ARG_1 concat $S1, $S1, "\n" $P1.'print'($S1) -# } -.annotate 'line', 870 .end # comment @@ -2782,27 +1981,15 @@ .sub 'emitlabel' :method .param string __ARG_1 .param string __ARG_2 :optional -# Body -# { -.annotate 'line', 873 -# var handle: $P1 getattribute $P1, self, 'handle' -.annotate 'line', 874 $P1.'print'(' ') -.annotate 'line', 875 $P1.'print'(__ARG_1) -.annotate 'line', 876 - $P1.'print'(':') -.annotate 'line', 877 + $P1.'print'(":") if_null __ARG_2, __label_1 -.annotate 'line', 878 - concat $S1, ' # ', __ARG_2 + concat $S1, " # ", __ARG_2 $P1.'print'($S1) __label_1: # endif -.annotate 'line', 879 $P1.'print'("\n") -# } -.annotate 'line', 880 .end # emitlabel @@ -2810,25 +1997,14 @@ .sub 'emitgoto' :method .param string __ARG_1 .param string __ARG_2 :optional -# Body -# { -.annotate 'line', 883 -# var handle: $P1 getattribute $P1, self, 'handle' -.annotate 'line', 884 - $P1.'print'(' goto ') -.annotate 'line', 885 + $P1.'print'(" goto ") $P1.'print'(__ARG_1) -.annotate 'line', 886 if_null __ARG_2, __label_1 -.annotate 'line', 887 - concat $S1, ' # ', __ARG_2 + concat $S1, " # ", __ARG_2 $P1.'print'($S1) __label_1: # endif -.annotate 'line', 888 $P1.'print'("\n") -# } -.annotate 'line', 889 .end # emitgoto @@ -2836,15 +2012,7 @@ .sub 'emitarg1' :method .param string __ARG_1 .param string __ARG_2 -# Body -# { -.annotate 'line', 893 - concat $S1, ' ', __ARG_1 - concat $S1, $S1, ' ' - concat $S1, $S1, __ARG_2 - self.'say'($S1) -# } -.annotate 'line', 894 + self.'say'(' ', __ARG_1, " ", __ARG_2) .end # emitarg1 @@ -2853,39 +2021,27 @@ .param string __ARG_1 .param string __ARG_2 .param string __ARG_3 -# Body -# { -.annotate 'line', 897 - concat $S1, ' ', __ARG_1 - concat $S1, $S1, ' ' - concat $S1, $S1, __ARG_2 - concat $S1, $S1, ', ' - concat $S1, $S1, __ARG_3 - self.'say'($S1) -# } -.annotate 'line', 898 + self.'say'(' ', __ARG_1, " ", __ARG_2, ", ", __ARG_3) .end # emitarg2 +.sub 'emitarg3' :method + .param string __ARG_1 + .param string __ARG_2 + .param string __ARG_3 + .param string __ARG_4 + self.'say'(' ', __ARG_1, " ", __ARG_2, ", ", __ARG_3, ", ", __ARG_4) + +.end # emitarg3 + + .sub 'emitcompare' :method .param string __ARG_1 .param string __ARG_2 .param string __ARG_3 .param string __ARG_4 -# Body -# { -.annotate 'line', 901 - concat $S1, ' ', __ARG_1 - concat $S1, $S1, ' ' - concat $S1, $S1, __ARG_2 - concat $S1, $S1, ', ' - concat $S1, $S1, __ARG_3 - concat $S1, $S1, ', ' - concat $S1, $S1, __ARG_4 - self.'say'($S1) -# } -.annotate 'line', 902 + self.'say'(' ', __ARG_1, " ", __ARG_2, ", ", __ARG_3, ", ", __ARG_4) .end # emitcompare @@ -2893,12 +2049,7 @@ .sub 'emitif' :method .param string __ARG_1 .param string __ARG_2 -# Body -# { -.annotate 'line', 905 - self.'say'(' if ', __ARG_1, ' goto ', __ARG_2) -# } -.annotate 'line', 906 + self.'say'(" if ", __ARG_1, " goto ", __ARG_2) .end # emitif @@ -2906,12 +2057,7 @@ .sub 'emitunless' :method .param string __ARG_1 .param string __ARG_2 -# Body -# { -.annotate 'line', 909 - self.'say'(' unless ', __ARG_1, ' goto ', __ARG_2) -# } -.annotate 'line', 910 + self.'say'(" unless ", __ARG_1, " goto ", __ARG_2) .end # emitunless @@ -2919,48 +2065,36 @@ .sub 'emitif_null' :method .param string __ARG_1 .param string __ARG_2 -# Body -# { -.annotate 'line', 913 - self.'say'(' if_null ', __ARG_1, ', ', __ARG_2) -# } -.annotate 'line', 914 + self.'say'(" if_null ", __ARG_1, ", ", __ARG_2) .end # emitif_null +.sub 'emitunless_null' :method + .param string __ARG_1 + .param string __ARG_2 + self.'say'(" unless_null ", __ARG_1, ", ", __ARG_2) + +.end # emitunless_null + + .sub 'emitnull' :method .param string __ARG_1 -# Body -# { -.annotate 'line', 917 self.'say'(" null ", __ARG_1) -# } -.annotate 'line', 918 .end # emitnull .sub 'emitinc' :method .param string __ARG_1 -# Body -# { -.annotate 'line', 922 - self.'say'(' inc ', __ARG_1) -# } -.annotate 'line', 923 + self.'say'(" inc ", __ARG_1) .end # emitinc .sub 'emitdec' :method .param string __ARG_1 -# Body -# { -.annotate 'line', 926 - self.'say'(' dec ', __ARG_1) -# } -.annotate 'line', 927 + self.'say'(" dec ", __ARG_1) .end # emitdec @@ -2968,12 +2102,7 @@ .sub 'emitset' :method .param string __ARG_1 .param string __ARG_2 -# Body -# { -.annotate 'line', 930 self.'say'(" set ", __ARG_1, ", ", __ARG_2) -# } -.annotate 'line', 931 .end # emitset @@ -2981,12 +2110,7 @@ .sub 'emitassign' :method .param string __ARG_1 .param string __ARG_2 -# Body -# { -.annotate 'line', 934 self.'say'(" assign ", __ARG_1, ", ", __ARG_2) -# } -.annotate 'line', 935 .end # emitassign @@ -2994,12 +2118,7 @@ .sub 'emitbox' :method .param string __ARG_1 .param string __ARG_2 -# Body -# { -.annotate 'line', 938 self.'say'(" box ", __ARG_1, ", ", __ARG_2) -# } -.annotate 'line', 939 .end # emitbox @@ -3007,12 +2126,7 @@ .sub 'emitunbox' :method .param string __ARG_1 .param string __ARG_2 -# Body -# { -.annotate 'line', 942 self.'say'(" unbox ", __ARG_1, ", ", __ARG_2) -# } -.annotate 'line', 943 .end # emitunbox @@ -3022,12 +2136,7 @@ .param string __ARG_2 .param string __ARG_3 .param string __ARG_4 -# Body -# { -.annotate 'line', 946 self.'say'(' ', __ARG_1, " ", __ARG_2, ", ", __ARG_3, ", ", __ARG_4) -# } -.annotate 'line', 947 .end # emitbinop @@ -3035,12 +2144,7 @@ .sub 'emitaddto' :method .param string __ARG_1 .param string __ARG_2 -# Body -# { -.annotate 'line', 950 self.'say'(" add ", __ARG_1, ", ", __ARG_2) -# } -.annotate 'line', 951 .end # emitaddto @@ -3048,12 +2152,7 @@ .sub 'emitsubto' :method .param string __ARG_1 .param string __ARG_2 -# Body -# { -.annotate 'line', 954 self.'say'(" sub ", __ARG_1, ", ", __ARG_2) -# } -.annotate 'line', 955 .end # emitsubto @@ -3062,12 +2161,7 @@ .param string __ARG_1 .param string __ARG_2 .param string __ARG_3 -# Body -# { -.annotate 'line', 958 self.'say'(" add ", __ARG_1, ", ", __ARG_2, ", ", __ARG_3) -# } -.annotate 'line', 959 .end # emitadd @@ -3076,12 +2170,7 @@ .param string __ARG_1 .param string __ARG_2 .param string __ARG_3 -# Body -# { -.annotate 'line', 962 self.'say'(" sub ", __ARG_1, ", ", __ARG_2, ", ", __ARG_3) -# } -.annotate 'line', 963 .end # emitsub @@ -3090,12 +2179,7 @@ .param string __ARG_1 .param string __ARG_2 .param string __ARG_3 -# Body -# { -.annotate 'line', 966 self.'say'(" mul ", __ARG_1, ", ", __ARG_2, ", ", __ARG_3) -# } -.annotate 'line', 967 .end # emitmul @@ -3104,12 +2188,7 @@ .param string __ARG_1 .param string __ARG_2 .param string __ARG_3 -# Body -# { -.annotate 'line', 970 self.'say'(" div ", __ARG_1, ", ", __ARG_2, ", ", __ARG_3) -# } -.annotate 'line', 971 .end # emitdiv @@ -3117,12 +2196,7 @@ .sub 'emitconcat1' :method .param string __ARG_1 .param string __ARG_2 -# Body -# { -.annotate 'line', 974 self.'say'(" concat ", __ARG_1, ", ", __ARG_1, ", ", __ARG_2) -# } -.annotate 'line', 975 .end # emitconcat1 @@ -3131,12 +2205,7 @@ .param string __ARG_1 .param string __ARG_2 .param string __ARG_3 -# Body -# { -.annotate 'line', 978 self.'say'(" concat ", __ARG_1, ", ", __ARG_2, ", ", __ARG_3) -# } -.annotate 'line', 979 .end # emitconcat @@ -3145,78 +2214,73 @@ .param string __ARG_1 .param string __ARG_2 .param string __ARG_3 -# Body -# { -.annotate 'line', 982 self.'say'(" repeat ", __ARG_1, ", ", __ARG_2, ", ", __ARG_3) -# } -.annotate 'line', 983 .end # emitrepeat .sub 'emitprint' :method .param string __ARG_1 -# Body -# { -.annotate 'line', 986 - self.'say'(' print ', __ARG_1) -# } -.annotate 'line', 987 + self.'say'(" print ", __ARG_1) .end # emitprint .sub 'emitsay' :method .param string __ARG_1 -# Body -# { -.annotate 'line', 990 - self.'say'(' say ', __ARG_1) -# } -.annotate 'line', 991 + self.'say'(" say ", __ARG_1) .end # emitsay +.sub 'emitget_hll_namespace' :method + .param string __ARG_1 + .param string __ARG_2 + concat $S1, ", ", __ARG_2 + self.'say'(" get_hll_namespace ", __ARG_1, $S1) + +.end # emitget_hll_namespace + + +.sub 'emitget_root_namespace' :method + .param string __ARG_1 + .param string __ARG_2 + concat $S1, ", ", __ARG_2 + self.'say'(" get_root_namespace ", __ARG_1, $S1) + +.end # emitget_root_namespace + + .sub 'emitget_hll_global' :method .param string __ARG_1 .param string __ARG_2 .param string __ARG_3 :optional -# Body -# { -.annotate 'line', 994 - concat $S1, " get_hll_global ", __ARG_1 - self.'print'($S1) -.annotate 'line', 995 + self.'print'(" get_hll_global ", __ARG_1) if_null __ARG_3, __label_1 -.annotate 'line', 996 - concat $S1, ", ", __ARG_3 - self.'print'($S1) + self.'print'(", ", __ARG_3) __label_1: # endif -.annotate 'line', 997 - concat $S1, ", '", __ARG_2 - concat $S1, $S1, "'" - self.'say'($S1) -# } -.annotate 'line', 998 + self.'say'(", '", __ARG_2, "'") .end # emitget_hll_global +.sub 'emitget_root_global' :method + .param string __ARG_1 + .param string __ARG_2 + .param string __ARG_3 :optional + self.'print'(" get_root_global ", __ARG_1) + if_null __ARG_3, __label_1 + self.'print'(", ", __ARG_3) + __label_1: # endif + self.'say'(", '", __ARG_2, "'") + +.end # emitget_root_global + + .sub 'emitfind_lex' :method .param string __ARG_1 .param string __ARG_2 -# Body -# { -.annotate 'line', 1001 - concat $S1, " find_lex ", __ARG_1 - concat $S1, $S1, ", '" - concat $S1, $S1, __ARG_2 - concat $S1, $S1, "'" - self.'say'($S1) -# } -.annotate 'line', 1002 + self.'say'(" find_lex ", __ARG_1, ", '", __ARG_2, "'") .end # emitfind_lex @@ -3224,79 +2288,72 @@ .sub 'emitstore_lex' :method .param string __ARG_1 .param string __ARG_2 -# Body -# { -.annotate 'line', 1005 - self.'say'("store_lex '", __ARG_1, "', ", __ARG_2) -# } -.annotate 'line', 1006 + self.'say'(" store_lex '", __ARG_1, "', ", __ARG_2) .end # emitstore_lex .sub Winxed_class_init :anon :load :init newclass $P0, [ 'Winxed'; 'Compiler'; 'Emit' ] -.annotate 'line', 789 addattribute $P0, 'handle' -.annotate 'line', 790 addattribute $P0, 'file' -.annotate 'line', 791 addattribute $P0, 'line' -.annotate 'line', 792 addattribute $P0, 'pendingf' -.annotate 'line', 793 addattribute $P0, 'pendingl' -.annotate 'line', 794 + addattribute $P0, 'debug' addattribute $P0, 'noan' + addattribute $P0, 'warnings' .end .namespace [ 'Winxed'; 'Compiler' ] -.sub 'integerValue' :subid('WSubId_21') +.sub 'integerValue' :subid('WSubId_44') .param pmc __ARG_1 .param pmc __ARG_2 .param int __ARG_3 -# Body -# { -.annotate 'line', 1015 new $P2, [ 'Winxed'; 'Compiler'; 'IntegerLiteral' ] $P2.'IntegerLiteral'(__ARG_1, __ARG_2, __ARG_3) set $P1, $P2 .return($P1) -# } -.annotate 'line', 1016 .end # integerValue -.sub 'floatValue' :subid('WSubId_63') +.sub 'floatValue' :subid('WSubId_93') .param pmc __ARG_1 .param pmc __ARG_2 .param num __ARG_3 -# Body -# { -.annotate 'line', 1020 -# var t: $P1 - new $P1, [ 'Winxed'; 'Compiler'; 'TokenFloat' ] - getattribute $P2, __ARG_2, 'file' - getattribute $P3, __ARG_2, 'line' - $P1.'TokenFloat'($P2, $P3, __ARG_3) -.annotate 'line', 1021 + new $P2, [ 'Winxed'; 'Compiler'; 'TokenFloat' ] + getattribute $P3, __ARG_2, 'file' + getattribute $P4, __ARG_2, 'line' + $P2.'TokenFloat'($P3, $P4, __ARG_3) + set $P1, $P2 new $P3, [ 'Winxed'; 'Compiler'; 'FloatLiteral' ] $P3.'FloatLiteral'(__ARG_1, $P1) set $P2, $P3 .return($P2) -# } -.annotate 'line', 1022 .end # floatValue -.sub 'floatresult' :subid('WSubId_64') +.sub 'stringQuotedValue' :subid('WSubId_46') + .param pmc __ARG_1 + .param pmc __ARG_2 + .param string __ARG_3 + new $P2, [ 'Winxed'; 'Compiler'; 'TokenQuoted' ] + getattribute $P3, __ARG_2, 'file' + getattribute $P4, __ARG_2, 'line' + $P2.'TokenQuoted'($P3, $P4, __ARG_3) + set $P1, $P2 + new $P3, [ 'Winxed'; 'Compiler'; 'StringLiteral' ] + $P3.'StringLiteral'(__ARG_1, $P1) + set $P2, $P3 + .return($P2) + +.end # stringQuotedValue + + +.sub 'floatresult' :subid('WSubId_95') .param string __ARG_1 .param string __ARG_2 -# Body -# { -.annotate 'line', 1030 -# result: $I1 iseq $I1, __ARG_1, 'N' unless $I1 goto __label_2 iseq $I1, __ARG_2, 'N' @@ -3305,7 +2362,6 @@ __label_3: __label_2: if $I1 goto __label_1 -.annotate 'line', 1031 iseq $I1, __ARG_2, 'N' unless $I1 goto __label_4 iseq $I1, __ARG_1, 'N' @@ -3314,210 +2370,229 @@ __label_5: __label_4: __label_1: -.annotate 'line', 1032 .return($I1) -# } -.annotate 'line', 1033 .end # floatresult -.sub 'floatAsString' :subid('WSubId_60') +.sub 'floatAsString' :subid('WSubId_90') .param num __ARG_1 -# Body -# { -.annotate 'line', 1041 -# aux: $S1 - set $N1, __ARG_1 - set $S1, $N1 -.annotate 'line', 1042 -# predefined indexof - index $I1, $S1, '.' - ge $I1, 0, __label_1 -.annotate 'line', 1043 + set $S1, __ARG_1 + box $P2, $S1 + $P1 = $P2.'is_integer'($S1) + if_null $P1, __label_1 + unless $P1 goto __label_1 concat $S1, $S1, '.0' __label_1: # endif -.annotate 'line', 1044 .return($S1) -# } -.annotate 'line', 1045 .end # floatAsString -# Constant NULL evaluated at compile time -# Constant SELF evaluated at compile time -# Constant VAR_is_volatile evaluated at compile time -# Constant VAR_is_lexical evaluated at compile time -# Constant VAR_is_extern evaluated at compile time -# Constant PREDEFCONST_FILENAME evaluated at compile time -# Constant PREDEFCONST_LINENUM evaluated at compile time -.sub 'createPredefConstInt' :subid('WSubId_115') +.sub 'createPredefConstInt' :subid('WSubId_147') .param pmc __ARG_1 .param string __ARG_2 .param int __ARG_3 -.const 'Sub' WSubId_21 = "WSubId_21" -# Body -# { -.annotate 'line', 1063 -# var tid: $P1 - new $P1, [ 'Winxed'; 'Compiler'; 'TokenIdentifier' ] -.annotate 'line', 1064 - $P1.'TokenIdentifier'('__predefconst__', 0, __ARG_2) -.annotate 'line', 1065 -# var cst: $P2 +.const 'Sub' WSubId_44 = "WSubId_44" + new $P3, [ 'Winxed'; 'Compiler'; 'TokenIdentifier' ] + $P3.'TokenIdentifier'('__predefconst__', 0, __ARG_2) + set $P1, $P3 $P2 = __ARG_1.'createconst'($P1, 'I', 4) -.annotate 'line', 1066 - $P3 = WSubId_21(__ARG_1, $P1, __ARG_3) + $P3 = WSubId_44(__ARG_1, $P1, __ARG_3) $P2.'setvalue'($P3) -# } -.annotate 'line', 1067 .end # createPredefConstInt -.sub 'createPredefConstString' :subid('WSubId_107') +.sub 'createPredefConstString' :subid('WSubId_140') .param pmc __ARG_1 .param string __ARG_2 .param string __ARG_3 -# Body -# { -.annotate 'line', 1071 -# var tid: $P1 - new $P1, [ 'Winxed'; 'Compiler'; 'TokenIdentifier' ] -.annotate 'line', 1072 - $P1.'TokenIdentifier'('__predefconst__', 0, __ARG_2) -.annotate 'line', 1073 -# var cst: $P2 + new $P3, [ 'Winxed'; 'Compiler'; 'TokenIdentifier' ] + $P3.'TokenIdentifier'('__predefconst__', 0, __ARG_2) + set $P1, $P3 $P2 = __ARG_1.'createconst'($P1, 'S', 4) -.annotate 'line', 1074 new $P4, [ 'Winxed'; 'Compiler'; 'StringLiteral' ] -.annotate 'line', 1075 new $P6, [ 'Winxed'; 'Compiler'; 'TokenQuoted' ] $P6.'TokenQuoted'('__predefconst__', 0, __ARG_3) set $P5, $P6 $P4.'StringLiteral'(__ARG_1, $P5) set $P3, $P4 -.annotate 'line', 1074 $P2.'setvalue'($P3) -# } -.annotate 'line', 1076 .end # createPredefConstString -# Constant __DEBUG_PREDEFS evaluated at compile time -# Constant PREDEF_arglist evaluated at compile time -# Constant PREDEF_raw1 evaluated at compile time -.namespace [ 'Winxed'; 'Compiler'; 'Predef_frombody' ] -.sub 'Predef_frombody' :method +.sub 'string_from_literal' :subid('WSubId_47') + .param pmc __ARG_1 +.const 'Sub' WSubId_30 = "WSubId_30" + null $S1 + $P1 = __ARG_1.'isintegerliteral'() + set $I1, $P1 + if $I1 goto __label_3 + $P2 = __ARG_1.'isfloatliteral'() + set $I1, $P2 + if $I1 goto __label_4 + $P3 = __ARG_1.'isstringliteral'() + set $I1, $P3 + if $I1 goto __label_5 + goto __label_2 + __label_3: # case + getattribute $P4, __ARG_1, 'numval' + set $S1, $P4 + goto __label_1 # break + __label_4: # case + $P5 = __ARG_1.'getFloatValue'() + set $S1, $P5 + goto __label_1 # break + __label_5: # case + $P6 = __ARG_1.'get_value'() + set $S1, $P6 + goto __label_1 # break + __label_2: # default + WSubId_30('wrong call to string_from_literal', __ARG_1) + __label_1: # switch end + .return($S1) + +.end # string_from_literal + + +.sub 'int_from_literal' :subid('WSubId_48') + .param pmc __ARG_1 +.const 'Sub' WSubId_30 = "WSubId_30" + null $I1 + $P1 = __ARG_1.'isintegerliteral'() + set $I2, $P1 + if $I2 goto __label_3 + $P2 = __ARG_1.'isfloatliteral'() + set $I2, $P2 + if $I2 goto __label_4 + $P3 = __ARG_1.'isstringliteral'() + set $I2, $P3 + if $I2 goto __label_5 + goto __label_2 + __label_3: # case + getattribute $P4, __ARG_1, 'numval' + set $I1, $P4 + goto __label_1 # break + __label_4: # case + $P5 = __ARG_1.'getFloatValue'() + set $I1, $P5 + goto __label_1 # break + __label_5: # case + $P6 = __ARG_1.'get_value'() + set $I1, $P6 + goto __label_1 # break + __label_2: # default + WSubId_30('wrong call to int_from_literal', __ARG_1) + __label_1: # switch end + .return($I1) + +.end # int_from_literal + + +.sub 'float_from_literal' :subid('WSubId_128') + .param pmc __ARG_1 +.const 'Sub' WSubId_30 = "WSubId_30" + null $N1 + $P1 = __ARG_1.'isintegerliteral'() + set $I1, $P1 + if $I1 goto __label_3 + $P2 = __ARG_1.'isfloatliteral'() + set $I1, $P2 + if $I1 goto __label_4 + $P3 = __ARG_1.'isstringliteral'() + set $I1, $P3 + if $I1 goto __label_5 + goto __label_2 + __label_3: # case + __label_4: # case + $P4 = __ARG_1.'getFloatValue'() + set $N1, $P4 + goto __label_1 # break + __label_5: # case + $P5 = __ARG_1.'get_value'() + set $N1, $P5 + goto __label_1 # break + __label_2: # default + WSubId_30('wrong call to float_from_literal', __ARG_1) + __label_1: # switch end + .return($N1) + +.end # float_from_literal + +.namespace [ 'Winxed'; 'Compiler'; 'Builtin_frombody' ] + +.sub 'Builtin_frombody' :method .param string __ARG_1 .param string __ARG_2 -.const 'Sub' WSubId_6 = "WSubId_6" -# Body -# { -.annotate 'line', 1105 -# l: $I2 -# predefined length +.const 'Sub' WSubId_30 = "WSubId_30" length $I3, __ARG_2 sub $I2, $I3, 1 -.annotate 'line', 1106 -# predefined substr substr $S1, __ARG_2, $I2, 1 ne $S1, "\n", __label_1 -.annotate 'line', 1107 -# predefined substr substr __ARG_2, __ARG_2, 0, $I2 __label_1: # endif -.annotate 'line', 1108 -# predefined split split $P1, "\n", __ARG_2 -# predefined join join $S1, "\n ", $P1 - concat __ARG_2, ' ', $S1 -.annotate 'line', 1109 + concat $S2, ' ', $S1 + set __ARG_2, $S2 box $P1, __ARG_2 setattribute self, 'body', $P1 -.annotate 'line', 1110 box $P1, __ARG_1 setattribute self, 'typeresult', $P1 -# } -.annotate 'line', 1111 -.end # Predef_frombody +.end # Builtin_frombody .sub 'invoke' :method :vtable .param pmc __ARG_1 .param pmc __ARG_2 - .param string __ARG_3 - .param pmc __ARG_4 -.const 'Sub' WSubId_1 = "WSubId_1" -.const 'Sub' WSubId_6 = "WSubId_6" -# Body -# { -.annotate 'line', 1114 -# typeresult: $S1 - getattribute $P2, self, 'typeresult' + .param pmc __ARG_3 + .param string __ARG_4 + .param pmc __ARG_5 +.const 'Sub' WSubId_25 = "WSubId_25" +.const 'Sub' WSubId_30 = "WSubId_30" +.const 'Sub' WSubId_45 = "WSubId_45" + getattribute $P1, self, 'typeresult' null $S1 - if_null $P2, __label_1 - set $S1, $P2 + if_null $P1, __label_1 + set $S1, $P1 __label_1: -.annotate 'line', 1116 ne $S1, 'v', __label_2 -# { -.annotate 'line', 1117 - isnull $I1, __ARG_3 + isnull $I1, __ARG_4 not $I1 unless $I1 goto __label_5 - isne $I1, __ARG_3, '' + isne $I1, __ARG_4, '' __label_5: unless $I1 goto __label_4 -.annotate 'line', 1118 - WSubId_1('using return value from void predef') + WSubId_25('using return value from void builtin', __ARG_3) __label_4: # endif -# } goto __label_3 __label_2: # else -# { -.annotate 'line', 1121 - isnull $I1, __ARG_3 + isnull $I1, __ARG_4 if $I1 goto __label_7 - iseq $I1, __ARG_3, '' + iseq $I1, __ARG_4, '' __label_7: unless $I1 goto __label_6 -.annotate 'line', 1122 - WSubId_6('Bad result in non void predef') + WSubId_30('Bad result in non void builtin') __label_6: # endif -# } __label_3: # endif -.annotate 'line', 1125 -# var builder: $P1 - new $P1, [ 'StringBuilder' ] -.annotate 'line', 1126 + __ARG_1.'annotate'(__ARG_3) getattribute $P2, self, 'body' - $P1.'append_format'($P2, __ARG_3, __ARG_4 :flat) -.annotate 'line', 1127 - __ARG_1.'annotate'(__ARG_2) -.annotate 'line', 1128 -# predefined string - set $S2, $P1 - __ARG_1.'say'($S2) -# } -.annotate 'line', 1129 + $P1 = WSubId_45($P2, __ARG_4, __ARG_5 :flat) + __ARG_1.'say'($P1) .end # invoke .sub Winxed_class_init :anon :load :init - newclass $P0, [ 'Winxed'; 'Compiler'; 'Predef_frombody' ] -.annotate 'line', 1091 + newclass $P0, [ 'Winxed'; 'Compiler'; 'Builtin_frombody' ] addattribute $P0, 'body' -.annotate 'line', 1092 addattribute $P0, 'typeresult' .end -.namespace [ 'Winxed'; 'Compiler'; 'PredefBase' ] +.namespace [ 'Winxed'; 'Compiler'; 'BuiltinBase' ] -.sub 'PredefBase' :method +.sub 'BuiltinBase' :method .param string __ARG_1 .param pmc __ARG_2 .param string __ARG_3 @@ -3525,194 +2600,128 @@ .param string __ARG_5 .param string __ARG_6 .param string __ARG_7 -.const 'Sub' WSubId_6 = "WSubId_6" -# Body -# { -.annotate 'line', 1150 +.const 'Sub' WSubId_30 = "WSubId_30" box $P1, __ARG_1 setattribute self, 'name', $P1 -.annotate 'line', 1151 isa $I2, __ARG_2, 'String' unless $I2 goto __label_1 -.annotate 'line', 1152 - new $P3, [ 'Winxed'; 'Compiler'; 'Predef_frombody' ] - $P3.'Predef_frombody'(__ARG_3, __ARG_2) + new $P3, [ 'Winxed'; 'Compiler'; 'Builtin_frombody' ] + $P3.'Builtin_frombody'(__ARG_3, __ARG_2) set $P2, $P3 setattribute self, 'body', $P2 goto __label_2 __label_1: # else -.annotate 'line', 1154 setattribute self, 'body', __ARG_2 __label_2: # endif -.annotate 'line', 1155 box $P1, __ARG_3 setattribute self, 'typeresult', $P1 -.annotate 'line', 1156 -# n: $I1 null $I1 -.annotate 'line', 1157 if_null __ARG_4, __label_3 -# { -.annotate 'line', 1158 box $P1, __ARG_4 setattribute self, 'type0', $P1 -# switch -.annotate 'line', 1159 - set $S1, __ARG_4 - set $S2, '*' - if $S1 == $S2 goto __label_6 - set $S2, '!' - if $S1 == $S2 goto __label_7 - goto __label_5 + if_null __ARG_4, __label_4 + length $I2, __ARG_4 + ne $I2, 1, __label_4 + ord $I2, __ARG_4 + if $I2 == 42 goto __label_6 + if $I2 == 33 goto __label_7 + goto __label_4 __label_6: # case -.annotate 'line', 1161 set $I1, -1 - goto __label_4 # break + goto __label_5 # break __label_7: # case -.annotate 'line', 1164 set $I1, -2 -.annotate 'line', 1165 if_null __ARG_5, __label_8 -.annotate 'line', 1166 - concat $S3, "Invalid predef '", __ARG_1 - concat $S3, $S3, '"' - WSubId_6($S3) + concat $S1, "Invalid builtin '", __ARG_1 + concat $S1, $S1, '"' + WSubId_30($S1) __label_8: # endif - goto __label_4 # break - __label_5: # default -.annotate 'line', 1169 + goto __label_5 # break + __label_4: # default set $I1, 1 -.annotate 'line', 1170 if_null __ARG_5, __label_9 -# { -.annotate 'line', 1171 box $P1, __ARG_5 setattribute self, 'type1', $P1 -.annotate 'line', 1172 inc $I1 -# } __label_9: # endif -.annotate 'line', 1174 if_null __ARG_6, __label_10 -# { -.annotate 'line', 1175 box $P1, __ARG_6 setattribute self, 'type2', $P1 -.annotate 'line', 1176 inc $I1 -# } __label_10: # endif -.annotate 'line', 1178 if_null __ARG_7, __label_11 -# { -.annotate 'line', 1179 box $P1, __ARG_7 setattribute self, 'type3', $P1 -.annotate 'line', 1180 inc $I1 -# } __label_11: # endif - __label_4: # switch end -# } + __label_5: # switch end __label_3: # endif -.annotate 'line', 1184 box $P1, $I1 setattribute self, 'nparams', $P1 -# } -.annotate 'line', 1185 -.end # PredefBase +.end # BuiltinBase + + +.sub 'iscompileevaluable' :method + .return(0) + +.end # iscompileevaluable .sub 'name' :method -# Body -# { -.annotate 'line', 1188 -# name: $S1 getattribute $P1, self, 'name' null $S1 if_null $P1, __label_1 set $S1, $P1 __label_1: -.annotate 'line', 1189 .return($S1) -# } -.annotate 'line', 1190 .end # name .sub 'result' :method -# Body -# { -.annotate 'line', 1193 getattribute $P1, self, 'typeresult' .return($P1) -# } -.annotate 'line', 1194 .end # result .sub 'params' :method -# Body -# { -.annotate 'line', 1195 getattribute $P1, self, 'nparams' .return($P1) -# } .end # params .sub 'paramtype' :method .param int __ARG_1 -.const 'Sub' WSubId_6 = "WSubId_6" -# Body -# { -.annotate 'line', 1198 -# type: $S1 +.const 'Sub' WSubId_30 = "WSubId_30" null $S1 -# switch -.annotate 'line', 1199 - set $I1, __ARG_1 - null $I2 - if $I1 == $I2 goto __label_3 - set $I2, 1 - if $I1 == $I2 goto __label_4 - set $I2, 2 - if $I1 == $I2 goto __label_5 - set $I2, 3 - if $I1 == $I2 goto __label_6 - goto __label_2 + if __ARG_1 == 0 goto __label_3 + if __ARG_1 == 1 goto __label_4 + if __ARG_1 == 2 goto __label_5 + if __ARG_1 == 3 goto __label_6 + goto __label_1 __label_3: # case -.annotate 'line', 1200 getattribute $P1, self, 'type0' set $S1, $P1 - goto __label_1 # break + goto __label_2 # break __label_4: # case -.annotate 'line', 1201 getattribute $P2, self, 'type1' set $S1, $P2 - goto __label_1 # break + goto __label_2 # break __label_5: # case -.annotate 'line', 1202 getattribute $P3, self, 'type2' set $S1, $P3 - goto __label_1 # break + goto __label_2 # break __label_6: # case -.annotate 'line', 1203 getattribute $P4, self, 'type3' set $S1, $P4 - goto __label_1 # break - __label_2: # default -.annotate 'line', 1205 - WSubId_6('Invalid predef arg') - __label_1: # switch end -.annotate 'line', 1207 + goto __label_2 # break + __label_1: # default + WSubId_30('Invalid builtin arg') + __label_2: # switch end .return($S1) -# } -.annotate 'line', 1208 .end # paramtype @@ -3723,63 +2732,51 @@ .param pmc __ARG_3 .param string __ARG_4 .param pmc __ARG_5 -# Body -# { -.annotate 'line', 1211 -# predefined string getattribute $P2, self, 'name' - set $S2, $P2 - concat $S3, 'predefined ', $S2 - __ARG_1.'comment'($S3) -.annotate 'line', 1212 -# typeresult: $S1 - getattribute $P2, self, 'typeresult' null $S1 if_null $P2, __label_1 set $S1, $P2 __label_1: -.annotate 'line', 1213 - isne $I1, $S1, 'v' - unless $I1 goto __label_3 + $P2 = __ARG_1.'getDebug'() + if_null $P2, __label_2 + unless $P2 goto __label_2 + eq $S1, '__ASSERT__', __label_3 + concat $S3, 'builtin ', $S1 + __ARG_1.'comment'($S3) + __label_3: # endif + __label_2: # endif + getattribute $P2, self, 'typeresult' + null $S2 + if_null $P2, __label_4 + set $S2, $P2 + __label_4: + isne $I1, $S2, 'v' + unless $I1 goto __label_6 iseq $I1, __ARG_4, '' - __label_3: - unless $I1 goto __label_2 -.annotate 'line', 1214 - $P2 = __ARG_2.'tempreg'($S1) + __label_6: + unless $I1 goto __label_5 + $P2 = __ARG_2.'tempreg'($S2) set __ARG_4, $P2 - __label_2: # endif -.annotate 'line', 1215 -# var fun: $P1 + __label_5: # endif getattribute $P1, self, 'body' -.annotate 'line', 1216 - $P1(__ARG_1, __ARG_3, __ARG_4, __ARG_5) -# } -.annotate 'line', 1217 + $P1(__ARG_1, __ARG_2, __ARG_3, __ARG_4, __ARG_5) .end # expand .sub Winxed_class_init :anon :load :init - newclass $P0, [ 'Winxed'; 'Compiler'; 'PredefBase' ] -.annotate 'line', 1134 + newclass $P0, [ 'Winxed'; 'Compiler'; 'BuiltinBase' ] addattribute $P0, 'name' -.annotate 'line', 1135 addattribute $P0, 'body' -.annotate 'line', 1136 addattribute $P0, 'typeresult' -.annotate 'line', 1137 addattribute $P0, 'type0' -.annotate 'line', 1138 addattribute $P0, 'type1' -.annotate 'line', 1139 addattribute $P0, 'type2' -.annotate 'line', 1140 addattribute $P0, 'type3' -.annotate 'line', 1141 addattribute $P0, 'nparams' .end -.namespace [ 'Winxed'; 'Compiler'; 'PredefFunction' ] +.namespace [ 'Winxed'; 'Compiler'; 'BuiltinFunction' ] -.sub 'PredefFunction' :method +.sub 'BuiltinFunction' :method .param string __ARG_1 .param pmc __ARG_2 .param string __ARG_3 @@ -3787,24 +2784,18 @@ .param string __ARG_5 :optional .param string __ARG_6 :optional .param string __ARG_7 :optional -# Body -# { -.annotate 'line', 1229 - self.'PredefBase'(__ARG_1, __ARG_2, __ARG_3, __ARG_4, __ARG_5, __ARG_6, __ARG_7) -# } -.annotate 'line', 1230 + self.'BuiltinBase'(__ARG_1, __ARG_2, __ARG_3, __ARG_4, __ARG_5, __ARG_6, __ARG_7) -.end # PredefFunction +.end # BuiltinFunction .sub Winxed_class_init :anon :load :init - newclass $P0, [ 'Winxed'; 'Compiler'; 'PredefFunction' ] -.annotate 'line', 1220 - get_class $P1, [ 'Winxed'; 'Compiler'; 'PredefBase' ] + newclass $P0, [ 'Winxed'; 'Compiler'; 'BuiltinFunction' ] + get_class $P1, [ 'Winxed'; 'Compiler'; 'BuiltinBase' ] addparent $P0, $P1 .end -.namespace [ 'Winxed'; 'Compiler'; 'PredefFunctionEval' ] +.namespace [ 'Winxed'; 'Compiler'; 'BuiltinFunctionEval' ] -.sub 'PredefFunctionEval' :method +.sub 'BuiltinFunctionEval' :method .param string __ARG_1 .param pmc __ARG_2 .param pmc __ARG_3 @@ -3813,1226 +2804,1161 @@ .param string __ARG_6 :optional .param string __ARG_7 :optional .param string __ARG_8 :optional -# Body -# { -.annotate 'line', 1243 - self.'PredefBase'(__ARG_1, __ARG_3, __ARG_4, __ARG_5, __ARG_6, __ARG_7, __ARG_8) -.annotate 'line', 1244 + self.'BuiltinBase'(__ARG_1, __ARG_3, __ARG_4, __ARG_5, __ARG_6, __ARG_7, __ARG_8) setattribute self, 'evalfun', __ARG_2 -# } -.annotate 'line', 1245 -.end # PredefFunctionEval +.end # BuiltinFunctionEval + + +.sub 'iscompileevaluable' :method + .return(1) + +.end # iscompileevaluable .sub Winxed_class_init :anon :load :init - newclass $P0, [ 'Winxed'; 'Compiler'; 'PredefFunctionEval' ] -.annotate 'line', 1233 - get_class $P1, [ 'Winxed'; 'Compiler'; 'PredefBase' ] + newclass $P0, [ 'Winxed'; 'Compiler'; 'BuiltinFunctionEval' ] + get_class $P1, [ 'Winxed'; 'Compiler'; 'BuiltinBase' ] addparent $P0, $P1 -.annotate 'line', 1235 addattribute $P0, 'evalfun' .end -.namespace [ 'Winxed'; 'Compiler'; 'Predef_typecast' ] +.namespace [ 'Winxed'; 'Compiler'; 'Builtin_typecast' ] -.sub 'Predef_typecast' :method +.sub 'Builtin_typecast' :method .param string __ARG_1 -# Body -# { -.annotate 'line', 1253 box $P1, __ARG_1 setattribute self, 'type', $P1 -# } -.annotate 'line', 1254 -.end # Predef_typecast +.end # Builtin_typecast .sub 'invoke' :method :vtable .param pmc __ARG_1 .param pmc __ARG_2 .param pmc __ARG_3 - .param pmc __ARG_4 -.const 'Sub' WSubId_6 = "WSubId_6" -# Body -# { -.annotate 'line', 1257 -# type: $S1 + .param string __ARG_4 + .param pmc __ARG_5 +.const 'Sub' WSubId_30 = "WSubId_30" getattribute $P2, self, 'type' null $S1 if_null $P2, __label_1 set $S1, $P2 __label_1: -.annotate 'line', 1258 -# predefined elements - elements $I1, __ARG_4 + elements $I1, __ARG_5 eq $I1, 1, __label_2 -.annotate 'line', 1259 - WSubId_6("Invalid Predef_typecast.invoke call") + WSubId_30("Invalid Builtin_typecast.invoke call") __label_2: # endif -.annotate 'line', 1260 -# var rawarg: $P1 - $P1 = __ARG_4[0] -.annotate 'line', 1261 -# argtype: $S2 + $P1 = __ARG_5[0] $P2 = $P1.'checkresult'() null $S2 if_null $P2, __label_3 set $S2, $P2 __label_3: -# switch-case -.annotate 'line', 1263 iseq $I1, $S2, $S1 if $I1 goto __label_6 -.annotate 'line', 1264 isa $I1, $P1, [ 'Winxed'; 'Compiler'; 'IndexExpr' ] if $I1 goto __label_7 goto __label_5 __label_6: # case __label_7: # case -.annotate 'line', 1265 - $P1.'emit'(__ARG_1, __ARG_3) + $P1.'emit'(__ARG_1, __ARG_4) goto __label_4 # break __label_5: # default -.annotate 'line', 1268 -# arg: $S3 $P2 = $P1.'emit_get'(__ARG_1) null $S3 if_null $P2, __label_8 set $S3, $P2 __label_8: -.annotate 'line', 1269 - __ARG_1.'annotate'(__ARG_2) -.annotate 'line', 1271 + __ARG_1.'annotate'(__ARG_3) ne $S3, 'null', __label_9 -.annotate 'line', 1272 - __ARG_1.'emitnull'(__ARG_3) + __ARG_1.'emitnull'(__ARG_4) goto __label_10 __label_9: # else -.annotate 'line', 1274 - __ARG_1.'emitset'(__ARG_3, $S3) + __ARG_1.'emitset'(__ARG_4, $S3) __label_10: # endif __label_4: # switch end -# } -.annotate 'line', 1276 .end # invoke .sub Winxed_class_init :anon :load :init - newclass $P0, [ 'Winxed'; 'Compiler'; 'Predef_typecast' ] -.annotate 'line', 1250 + newclass $P0, [ 'Winxed'; 'Compiler'; 'Builtin_typecast' ] addattribute $P0, 'type' .end .namespace [ 'Winxed'; 'Compiler' ] -.sub 'Predef_say' :subid('WSubId_32') +.sub 'builtineval_stringcast' :subid('WSubId_50') .param pmc __ARG_1 .param pmc __ARG_2 - .param string __ARG_3 - .param pmc __ARG_4 -# Body -# { -.annotate 'line', 1281 - __ARG_1.'annotate'(__ARG_2) -.annotate 'line', 1282 -# n: $I1 -# predefined elements - elements $I3, __ARG_4 + .param pmc __ARG_3 +.const 'Sub' WSubId_46 = "WSubId_46" +.const 'Sub' WSubId_47 = "WSubId_47" + $P2 = __ARG_3[0] + getattribute $P1, $P2, 'arg' + $P2 = WSubId_47($P1) + .tailcall WSubId_46(__ARG_1, __ARG_2, $P2) + +.end # builtineval_stringcast + + +.sub 'builtineval_intcast' :subid('WSubId_49') + .param pmc __ARG_1 + .param pmc __ARG_2 + .param pmc __ARG_3 +.const 'Sub' WSubId_48 = "WSubId_48" +.const 'Sub' WSubId_44 = "WSubId_44" + $P2 = __ARG_3[0] + getattribute $P1, $P2, 'arg' + $P2 = WSubId_48($P1) + set $I1, $P2 + .tailcall WSubId_44(__ARG_1, __ARG_2, $I1) + +.end # builtineval_intcast + + +.sub 'Builtin_varcast' :subid('WSubId_51') + .param pmc __ARG_1 + .param pmc __ARG_2 + .param pmc __ARG_3 + .param string __ARG_4 + .param pmc __ARG_5 +.const 'Sub' WSubId_30 = "WSubId_30" + elements $I1, __ARG_5 + eq $I1, 1, __label_1 + WSubId_30("Invalid var cast") + __label_1: # endif + $P1 = __ARG_5[0] + $P10 = $P1.'checkresult'() + null $S1 + if_null $P10, __label_2 + set $S1, $P10 + __label_2: + ne $S1, 'P', __label_3 + null $S2 + null $P2 + isa $I1, $P1, [ 'Winxed'; 'Compiler'; 'IdentifierExpr' ] + if $I1 goto __label_7 + isa $I1, $P1, [ 'Winxed'; 'Compiler'; 'MemberExpr' ] + if $I1 goto __label_8 + goto __label_6 + __label_7: # case + $P10 = $P1.'getName'() + set $S2, $P10 + $P11 = $P1.'checkIdentifier'() + null $S3 + if_null $P11, __label_9 + set $S3, $P11 + __label_9: + $P3 = $P1.'checkVar'() + isne $I2, $S3, '' + unless $I2 goto __label_13 + isnull $I2, $P3 + not $I2 + __label_13: + unless $I2 goto __label_12 + $P12 = $P3.'issubid'() + isfalse $I2, $P12 + __label_12: + unless $I2 goto __label_10 + $P1.'emit'(__ARG_1, __ARG_4) + goto __label_11 + __label_10: # else + root_new $P10, ['parrot';'ResizablePMCArray'] + assign $P10, 1 + $P10[0] = $S2 + $P2 = $P1.'scopesearch'($P10, 0) + isnull $I1, $P2 + not $I1 + unless $I1 goto __label_15 + isa $I1, $P2, [ 'Winxed'; 'Compiler'; 'FunctionStatement' ] + __label_15: + unless $I1 goto __label_14 + getattribute $P10, $P2, 'owner' + $P4 = $P10.'getpath'() + set $P7, $P4 + null $S5 + elements $I1, $P7 + unless $I1 goto __label_17 + join $S9, "'; '", $P7 + concat $S10, "[ '", $S9 + concat $S10, $S10, "' ]" + set $S5, $S10 + __label_17: # endif + set $S8, $S5 + goto __label_16 + __label_16: + __ARG_1.'emitget_hll_global'(__ARG_4, $S2, $S8) + __label_14: # endif + __label_11: # endif + goto __label_5 # break + __label_8: # case + new $P5, ['ResizableStringArray'] + $P1.'buildkey'($P5) + $P2 = __ARG_2.'scopesearch'($P5, 0) + isnull $I1, $P2 + not $I1 + unless $I1 goto __label_19 + isa $I1, $P2, [ 'Winxed'; 'Compiler'; 'FunctionStatement' ] + __label_19: + unless $I1 goto __label_18 + getattribute $P10, $P2, 'owner' + $P6 = $P10.'getpath'() + __ARG_1.'annotate'(__ARG_3) + set $P8, $P6 + null $S6 + elements $I1, $P8 + unless $I1 goto __label_21 + join $S9, "'; '", $P8 + concat $S10, "[ '", $S9 + concat $S10, $S10, "' ]" + set $S6, $S10 + __label_21: # endif + set $S11, $S6 + goto __label_20 + __label_20: + __ARG_1.'emitget_hll_global'(__ARG_4, $S2, $S11) + __label_18: # endif + $P10 = $P5.'pop'() + set $S2, $P10 + __ARG_1.'annotate'(__ARG_3) + set $P9, $P5 + null $S7 + elements $I1, $P9 + unless $I1 goto __label_23 + join $S9, "'; '", $P9 + concat $S10, "[ '", $S9 + concat $S10, $S10, "' ]" + set $S7, $S10 + __label_23: # endif + set $S12, $S7 + goto __label_22 + __label_22: + __ARG_1.'emitget_hll_global'(__ARG_4, $S2, $S12) + goto __label_5 # break + __label_6: # default + __ARG_1.'annotate'(__ARG_3) + $P1.'emit'(__ARG_1, __ARG_4) + __label_5: # switch end + goto __label_4 + __label_3: # else + $P10 = $P1.'emit_get'(__ARG_1) + null $S4 + if_null $P10, __label_24 + set $S4, $P10 + __label_24: + __ARG_1.'annotate'(__ARG_3) + ne $S4, 'null', __label_25 + __ARG_1.'emitnull'(__ARG_4) + goto __label_26 + __label_25: # else + __ARG_1.'emitbox'(__ARG_4, $S4) + __label_26: # endif + __label_4: # endif + +.end # Builtin_varcast + + +.sub 'Builtin_say' :subid('WSubId_63') + .param pmc __ARG_1 + .param pmc __ARG_2 + .param pmc __ARG_3 + .param string __ARG_4 + .param pmc __ARG_5 + __ARG_1.'annotate'(__ARG_3) + elements $I3, __ARG_5 sub $I1, $I3, 1 -.annotate 'line', 1283 lt $I1, 0, __label_1 -# { -# for loop -.annotate 'line', 1284 -# i: $I2 null $I2 __label_5: # for condition ge $I2, $I1, __label_4 -.annotate 'line', 1285 - $P1 = __ARG_4[$I2] + $P1 = __ARG_5[$I2] __ARG_1.'emitprint'($P1) __label_3: # for iteration -.annotate 'line', 1284 inc $I2 goto __label_5 __label_4: # for end -.annotate 'line', 1286 - $P1 = __ARG_4[$I1] + $P1 = __ARG_5[$I1] __ARG_1.'emitsay'($P1) -# } goto __label_2 __label_1: # else -.annotate 'line', 1289 __ARG_1.'emitsay'("''") __label_2: # endif -# } -.annotate 'line', 1290 -.end # Predef_say +.end # Builtin_say -.sub 'Predef_cry' :subid('WSubId_33') +.sub 'Builtin_cry' :subid('WSubId_64') .param pmc __ARG_1 .param pmc __ARG_2 - .param string __ARG_3 - .param pmc __ARG_4 -# Body -# { -.annotate 'line', 1294 - __ARG_1.'annotate'(__ARG_2) -.annotate 'line', 1295 - __ARG_1.'say'(' ', "getstderr $P0") -.annotate 'line', 1296 - if_null __ARG_4, __label_2 - iter $P1, __ARG_4 - set $P1, 0 - __label_1: # for iteration - unless $P1 goto __label_2 - shift $S1, $P1 -.annotate 'line', 1297 - __ARG_1.'say'(' ', "print $P0, ", $S1) + .param pmc __ARG_3 + .param string __ARG_4 + .param pmc __ARG_5 +.const 'Sub' WSubId_45 = "WSubId_45" +.const 'Sub' WSubId_9 = "WSubId_9" + __ARG_1.'annotate'(__ARG_3) + set $P1, __ARG_5 + root_new $P2, ['parrot';'ResizablePMCArray'] + $P3 = WSubId_9(" print $P0, ") + if_null $P1, __label_3 + iter $P7, $P1 + set $P7, 0 + __label_2: # for iteration + unless $P7 goto __label_3 + shift $P4, $P7 + $P8 = $P3($P4) + push $P2, $P8 + goto __label_2 + __label_3: # endfor + set $P6, $P2 goto __label_1 - __label_2: # endfor -.annotate 'line', 1298 - __ARG_1.'say'(' ', "print $P0, \"\\n\"") -# } -.annotate 'line', 1299 + __label_1: + set $P5, $P6 + join $S1, "\n", $P5 + $P5 = WSubId_45(" getstderr $P0\n%0\n print $P0, \"\\n\"\n", $S1) + __ARG_1.'say'($P5) -.end # Predef_cry +.end # Builtin_cry -.sub 'Predef_print' :subid('WSubId_31') +.sub 'Builtin_print' :subid('WSubId_62') .param pmc __ARG_1 .param pmc __ARG_2 - .param string __ARG_3 - .param pmc __ARG_4 -# Body -# { -.annotate 'line', 1303 - __ARG_1.'annotate'(__ARG_2) -.annotate 'line', 1304 - if_null __ARG_4, __label_2 - iter $P1, __ARG_4 - set $P1, 0 - __label_1: # for iteration - unless $P1 goto __label_2 - shift $S1, $P1 -.annotate 'line', 1305 - __ARG_1.'emitprint'($S1) - goto __label_1 - __label_2: # endfor -# } -.annotate 'line', 1306 + .param pmc __ARG_3 + .param string __ARG_4 + .param pmc __ARG_5 +.const 'Sub' WSubId_7 = "WSubId_7" + __ARG_1.'annotate'(__ARG_3) + set $P1, __ARG_5 + $P2 = WSubId_7(__ARG_1, "emitprint") + if_null $P1, __label_3 + iter $P4, $P1 + set $P4, 0 + __label_2: # for iteration + unless $P4 goto __label_3 + shift $P3, $P4 + $P2($P3) + goto __label_2 + __label_3: # endfor + __label_1: -.end # Predef_print +.end # Builtin_print -.sub 'Predef_invoke' :subid('WSubId_34') +.sub 'Builtin_abs' :subid('WSubId_61') .param pmc __ARG_1 .param pmc __ARG_2 - .param string __ARG_3 - .param pmc __ARG_4 -.const 'Sub' WSubId_1 = "WSubId_1" -# Body -# { -.annotate 'line', 1312 -# var arg: $P1 - $P1 = __ARG_4[0] -.annotate 'line', 1313 + .param pmc __ARG_3 + .param string __ARG_4 + .param pmc __ARG_5 + $P1 = __ARG_5[0] + $P2 = $P1.'emit_get'(__ARG_1) + null $S1 + if_null $P2, __label_1 + set $S1, $P2 + __label_1: + $P2 = $P1.'checkresult'() + set $S3, $P2 + ne $S3, 'S', __label_2 + $P3 = __ARG_2.'tempreg'('N') + null $S2 + if_null $P3, __label_4 + set $S2, $P3 + __label_4: + __ARG_1.'annotate'(__ARG_3) + __ARG_1.'emitset'($S2, $S1) + __ARG_1.'emitarg2'('abs', $S2, $S2) + __ARG_1.'emitset'(__ARG_4, $S2) + goto __label_3 + __label_2: # else + __ARG_1.'annotate'(__ARG_3) + __ARG_1.'emitarg2'('abs', __ARG_4, $S1) + __label_3: # endif + +.end # Builtin_abs + + +.sub 'Builtin_ASSERT' :subid('WSubId_65') + .param pmc __ARG_1 + .param pmc __ARG_2 + .param pmc __ARG_3 + .param string __ARG_4 + .param pmc __ARG_5 +.const 'Sub' WSubId_45 = "WSubId_45" + $P3 = __ARG_1.'getDebug'() + if_null $P3, __label_1 + unless $P3 goto __label_1 + __ARG_1.'annotate'(__ARG_3) + $P3 = __ARG_2.'genlabel'() + null $S1 + if_null $P3, __label_2 + set $S1, $P3 + __label_2: + $P1 = __ARG_5[0] + $P2 = $P1.'emit_getint'(__ARG_1) + __ARG_1.'emitif'($P2, $S1) + $P4 = __ARG_3.'filename'() + $P5 = __ARG_3.'linenum'() + $P3 = WSubId_45(" getstderr $P0\n print $P0, \"Assertion failed at '%0' line \"\n print $P0, %1\n print $P0, \"\\n\"\n exit 1\n", $P4, $P5) + __ARG_1.'print'($P3) + __ARG_1.'emitlabel'($S1) + __label_1: # endif + +.end # Builtin_ASSERT + + +.sub 'Builtin_invoke' :subid('WSubId_66') + .param pmc __ARG_1 + .param pmc __ARG_2 + .param pmc __ARG_3 + .param string __ARG_4 + .param pmc __ARG_5 +.const 'Sub' WSubId_25 = "WSubId_25" + $P1 = __ARG_5[0] isa $I2, $P1, [ 'Winxed'; 'Compiler'; 'CallExpr' ] not $I1, $I2 unless $I1 goto __label_1 -.annotate 'line', 1314 - WSubId_1("invoke argument must be callable", __ARG_2) + WSubId_25("invoke argument must be callable", __ARG_3) __label_1: # endif -.annotate 'line', 1315 - concat $S1, "(", __ARG_3 + concat $S1, "(", __ARG_4 concat $S1, $S1, " :call_sig)" $P1.'emit'(__ARG_1, $S1) -# } -.annotate 'line', 1316 -.end # Predef_invoke +.end # Builtin_invoke -.sub 'predefeval_length' :subid('WSubId_22') +.sub 'builtineval_length' :subid('WSubId_53') .param pmc __ARG_1 .param pmc __ARG_2 .param pmc __ARG_3 -.const 'Sub' WSubId_21 = "WSubId_21" -# Body -# { -.annotate 'line', 1320 -# var arg: $P1 +.const 'Sub' WSubId_47 = "WSubId_47" +.const 'Sub' WSubId_44 = "WSubId_44" $P2 = __ARG_3[0] getattribute $P1, $P2, 'arg' -.annotate 'line', 1321 -# s: $S1 - $P2 = $P1.'get_value'() + $P2 = WSubId_47($P1) null $S1 if_null $P2, __label_1 set $S1, $P2 __label_1: -.annotate 'line', 1322 -# predefined length length $I1, $S1 - .tailcall WSubId_21(__ARG_1, __ARG_2, $I1) -# } -.annotate 'line', 1323 + .tailcall WSubId_44(__ARG_1, __ARG_2, $I1) -.end # predefeval_length +.end # builtineval_length -.sub 'predefeval_bytelength' :subid('WSubId_23') +.sub 'builtineval_bytelength' :subid('WSubId_54') .param pmc __ARG_1 .param pmc __ARG_2 .param pmc __ARG_3 -.const 'Sub' WSubId_21 = "WSubId_21" -# Body -# { -.annotate 'line', 1327 -# var arg: $P1 +.const 'Sub' WSubId_47 = "WSubId_47" +.const 'Sub' WSubId_44 = "WSubId_44" $P2 = __ARG_3[0] getattribute $P1, $P2, 'arg' -.annotate 'line', 1328 -# s: $S1 - $P2 = $P1.'get_value'() + $P2 = WSubId_47($P1) null $S1 if_null $P2, __label_1 set $S1, $P2 __label_1: -.annotate 'line', 1329 -# predefined bytelength bytelength $I1, $S1 - .tailcall WSubId_21(__ARG_1, __ARG_2, $I1) -# } -.annotate 'line', 1330 - -.end # predefeval_bytelength - - -.sub 'predefeval_ord' :subid('WSubId_25') - .param pmc __ARG_1 - .param pmc __ARG_2 - .param pmc __ARG_3 -.const 'Sub' WSubId_21 = "WSubId_21" -# Body -# { -.annotate 'line', 1334 -# var arg: $P1 - $P2 = __ARG_3[0] - getattribute $P1, $P2, 'arg' -.annotate 'line', 1335 -# s: $S1 - $P2 = $P1.'get_value'() - null $S1 - if_null $P2, __label_1 - set $S1, $P2 - __label_1: -.annotate 'line', 1336 -# predefined ord - ord $I1, $S1 - .tailcall WSubId_21(__ARG_1, __ARG_2, $I1) -# } -.annotate 'line', 1337 + .tailcall WSubId_44(__ARG_1, __ARG_2, $I1) -.end # predefeval_ord +.end # builtineval_bytelength -.sub 'predefeval_ord_n' :subid('WSubId_26') +.sub 'builtineval_ord' :subid('WSubId_56') .param pmc __ARG_1 .param pmc __ARG_2 .param pmc __ARG_3 -.const 'Sub' WSubId_21 = "WSubId_21" -# Body -# { -.annotate 'line', 1341 -# var arg: $P1 +.const 'Sub' WSubId_47 = "WSubId_47" +.const 'Sub' WSubId_48 = "WSubId_48" +.const 'Sub' WSubId_44 = "WSubId_44" + elements $I1, __ARG_3 $P3 = __ARG_3[0] getattribute $P1, $P3, 'arg' -.annotate 'line', 1342 -# s: $S1 - $P3 = $P1.'get_value'() + $P3 = WSubId_47($P1) null $S1 if_null $P3, __label_1 set $S1, $P3 __label_1: -.annotate 'line', 1343 -# var argn: $P2 + null $I2 + le $I1, 1, __label_2 $P3 = __ARG_3[1] getattribute $P2, $P3, 'arg' -.annotate 'line', 1344 -# n: $I1 - getattribute $P3, $P2, 'numval' - set $I1, $P3 -.annotate 'line', 1345 -# predefined ord - ord $I2, $S1, $I1 - .tailcall WSubId_21(__ARG_1, __ARG_2, $I2) -# } -.annotate 'line', 1346 + $P3 = WSubId_48($P2) + set $I2, $P3 + __label_2: # endif + ord $I3, $S1, $I2 + .tailcall WSubId_44(__ARG_1, __ARG_2, $I3) -.end # predefeval_ord_n +.end # builtineval_ord -.sub 'predefeval_chr' :subid('WSubId_24') +.sub 'builtineval_chr' :subid('WSubId_55') .param pmc __ARG_1 .param pmc __ARG_2 .param pmc __ARG_3 -# Body -# { -.annotate 'line', 1350 -# var arg: $P1 - $P3 = __ARG_3[0] - getattribute $P1, $P3, 'arg' -.annotate 'line', 1352 -# n: $I1 - getattribute $P3, $P1, 'numval' - set $I1, $P3 -.annotate 'line', 1353 -# s: $S1 -# predefined chr +.const 'Sub' WSubId_46 = "WSubId_46" +.const 'Sub' WSubId_48 = "WSubId_48" + $P2 = __ARG_3[0] + getattribute $P1, $P2, 'arg' + $P2 = WSubId_48($P1) + set $I1, $P2 chr $S0, $I1 find_encoding $I0, 'utf8' trans_encoding $S1, $S0, $I0 -.annotate 'line', 1355 -# var t: $P2 - new $P2, [ 'Winxed'; 'Compiler'; 'TokenQuoted' ] - getattribute $P3, __ARG_2, 'file' - getattribute $P4, __ARG_2, 'line' - $P2.'TokenQuoted'($P3, $P4, $S1) -.annotate 'line', 1356 - new $P4, [ 'Winxed'; 'Compiler'; 'StringLiteral' ] - $P4.'StringLiteral'(__ARG_1, $P2) - set $P3, $P4 - .return($P3) -# } -.annotate 'line', 1357 + .tailcall WSubId_46(__ARG_1, __ARG_2, $S1) -.end # predefeval_chr +.end # builtineval_chr -.sub 'predefeval_substr' :subid('WSubId_27') +.sub 'builtineval_substr' :subid('WSubId_57') .param pmc __ARG_1 .param pmc __ARG_2 .param pmc __ARG_3 -# Body -# { -.annotate 'line', 1361 -# var argstr: $P1 +.const 'Sub' WSubId_47 = "WSubId_47" +.const 'Sub' WSubId_48 = "WSubId_48" +.const 'Sub' WSubId_46 = "WSubId_46" + elements $I1, __ARG_3 $P4 = __ARG_3[0] getattribute $P1, $P4, 'arg' -.annotate 'line', 1362 -# var argpos: $P2 $P4 = __ARG_3[1] getattribute $P2, $P4, 'arg' -.annotate 'line', 1363 -# str: $S1 - $P4 = $P1.'get_value'() + $P4 = WSubId_47($P1) null $S1 if_null $P4, __label_1 set $S1, $P4 __label_1: -.annotate 'line', 1364 -# pos: $I1 - getattribute $P4, $P2, 'numval' - set $I1, $P4 -.annotate 'line', 1366 -# var t: $P3 - new $P3, [ 'Winxed'; 'Compiler'; 'TokenQuoted' ] - getattribute $P4, __ARG_2, 'file' - getattribute $P5, __ARG_2, 'line' -# predefined substr - substr $S2, $S1, $I1 - $P3.'TokenQuoted'($P4, $P5, $S2) -.annotate 'line', 1367 - new $P5, [ 'Winxed'; 'Compiler'; 'StringLiteral' ] - $P5.'StringLiteral'(__ARG_1, $P3) - set $P4, $P5 - .return($P4) -# } -.annotate 'line', 1368 - -.end # predefeval_substr - - -.sub 'predefeval_substr_l' :subid('WSubId_28') - .param pmc __ARG_1 - .param pmc __ARG_2 - .param pmc __ARG_3 -# Body -# { -.annotate 'line', 1372 -# var argstr: $P1 - $P5 = __ARG_3[0] - getattribute $P1, $P5, 'arg' -.annotate 'line', 1373 -# var argpos: $P2 - $P5 = __ARG_3[1] - getattribute $P2, $P5, 'arg' -.annotate 'line', 1374 -# var arglen: $P3 - $P5 = __ARG_3[2] - getattribute $P3, $P5, 'arg' -.annotate 'line', 1375 -# str: $S1 - $P5 = $P1.'get_value'() - null $S1 - if_null $P5, __label_1 - set $S1, $P5 - __label_1: -.annotate 'line', 1376 -# pos: $I1 - getattribute $P5, $P2, 'numval' - set $I1, $P5 -.annotate 'line', 1377 -# len: $I2 - getattribute $P5, $P3, 'numval' - set $I2, $P5 -.annotate 'line', 1379 -# var t: $P4 - new $P4, [ 'Winxed'; 'Compiler'; 'TokenQuoted' ] - getattribute $P5, __ARG_2, 'file' - getattribute $P6, __ARG_2, 'line' -# predefined substr - substr $S2, $S1, $I1, $I2 - $P4.'TokenQuoted'($P5, $P6, $S2) -.annotate 'line', 1380 - new $P6, [ 'Winxed'; 'Compiler'; 'StringLiteral' ] - $P6.'StringLiteral'(__ARG_1, $P4) - set $P5, $P6 - .return($P5) -# } -.annotate 'line', 1381 + $P4 = WSubId_48($P2) + set $I2, $P4 + null $S2 + set $I4, __ARG_3 + le $I4, 2, __label_2 + $P4 = __ARG_3[2] + getattribute $P3, $P4, 'arg' + $P4 = WSubId_48($P3) + set $I3, $P4 + substr $S2, $S1, $I2, $I3 + goto __label_3 + __label_2: # else + substr $S2, $S1, $I2 + __label_3: # endif + .tailcall WSubId_46(__ARG_1, __ARG_2, $S2) -.end # predefeval_substr_l +.end # builtineval_substr -.sub 'predefeval_indexof' :subid('WSubId_29') +.sub 'builtineval_indexof' :subid('WSubId_58') .param pmc __ARG_1 .param pmc __ARG_2 .param pmc __ARG_3 -.const 'Sub' WSubId_21 = "WSubId_21" -# Body -# { -.annotate 'line', 1385 -# var argstrfrom: $P1 +.const 'Sub' WSubId_47 = "WSubId_47" +.const 'Sub' WSubId_44 = "WSubId_44" $P3 = __ARG_3[0] getattribute $P1, $P3, 'arg' -.annotate 'line', 1386 -# var argstrsearch: $P2 $P3 = __ARG_3[1] getattribute $P2, $P3, 'arg' -.annotate 'line', 1387 -# strfrom: $S1 - $P3 = $P1.'get_value'() + $P3 = WSubId_47($P1) null $S1 if_null $P3, __label_1 set $S1, $P3 __label_1: -.annotate 'line', 1388 -# strsearch: $S2 - $P3 = $P2.'get_value'() + $P3 = WSubId_47($P2) null $S2 if_null $P3, __label_2 set $S2, $P3 __label_2: -.annotate 'line', 1389 -# predefined indexof index $I1, $S1, $S2 - .tailcall WSubId_21(__ARG_1, __ARG_2, $I1) -# } -.annotate 'line', 1390 + .tailcall WSubId_44(__ARG_1, __ARG_2, $I1) -.end # predefeval_indexof +.end # builtineval_indexof -.sub 'predefeval_indexof_pos' :subid('WSubId_30') +.sub 'builtineval_indexof_pos' :subid('WSubId_59') .param pmc __ARG_1 .param pmc __ARG_2 .param pmc __ARG_3 -.const 'Sub' WSubId_21 = "WSubId_21" -# Body -# { -.annotate 'line', 1394 -# var argstrfrom: $P1 +.const 'Sub' WSubId_47 = "WSubId_47" +.const 'Sub' WSubId_48 = "WSubId_48" +.const 'Sub' WSubId_44 = "WSubId_44" $P4 = __ARG_3[0] getattribute $P1, $P4, 'arg' -.annotate 'line', 1395 -# var argstrsearch: $P2 $P4 = __ARG_3[1] getattribute $P2, $P4, 'arg' -.annotate 'line', 1396 -# var argpos: $P3 $P4 = __ARG_3[2] getattribute $P3, $P4, 'arg' -.annotate 'line', 1397 -# strfrom: $S1 - $P4 = $P1.'get_value'() + $P4 = WSubId_47($P1) null $S1 if_null $P4, __label_1 set $S1, $P4 __label_1: -.annotate 'line', 1398 -# strsearch: $S2 - $P4 = $P2.'get_value'() + $P4 = WSubId_47($P2) null $S2 if_null $P4, __label_2 set $S2, $P4 __label_2: -.annotate 'line', 1399 -# pos: $I1 - getattribute $P4, $P3, 'numval' + $P6 = __ARG_3[2] + getattribute $P5, $P6, 'arg' + $P4 = WSubId_48($P5) set $I1, $P4 -.annotate 'line', 1400 -# predefined indexof index $I2, $S1, $S2, $I1 - .tailcall WSubId_21(__ARG_1, __ARG_2, $I2) -# } -.annotate 'line', 1401 + .tailcall WSubId_44(__ARG_1, __ARG_2, $I2) -.end # predefeval_indexof_pos +.end # builtineval_indexof_pos -.sub 'getpredefs' :subid('WSubId_116') +.sub 'builtineval_escape' :subid('WSubId_60') .param pmc __ARG_1 -.const 'Sub' WSubId_22 = "WSubId_22" -.const 'Sub' WSubId_23 = "WSubId_23" -.const 'Sub' WSubId_24 = "WSubId_24" -.const 'Sub' WSubId_25 = "WSubId_25" -.const 'Sub' WSubId_26 = "WSubId_26" -.const 'Sub' WSubId_27 = "WSubId_27" -.const 'Sub' WSubId_28 = "WSubId_28" -.const 'Sub' WSubId_29 = "WSubId_29" -.const 'Sub' WSubId_30 = "WSubId_30" -.const 'Sub' WSubId_31 = "WSubId_31" -.const 'Sub' WSubId_32 = "WSubId_32" -.const 'Sub' WSubId_33 = "WSubId_33" -.const 'Sub' WSubId_34 = "WSubId_34" -# Body -# { -.annotate 'line', 1405 - new $P2, [ 'Winxed'; 'Compiler'; 'PredefFunction' ] -.annotate 'line', 1406 - new $P4, [ 'Winxed'; 'Compiler'; 'Predef_typecast' ] - $P4.'Predef_typecast'('I') + .param pmc __ARG_2 + .param pmc __ARG_3 +.const 'Sub' WSubId_46 = "WSubId_46" +.const 'Sub' WSubId_47 = "WSubId_47" + $P2 = __ARG_3[0] + getattribute $P1, $P2, 'arg' + $P2 = WSubId_47($P1) + set $S3, $P2 + escape $S2, $S3 + escape $S1, $S2 + .tailcall WSubId_46(__ARG_1, __ARG_2, $S1) + +.end # builtineval_escape + + +.sub 'builtin_sleep' :subid('WSubId_52') + .param pmc __ARG_1 + .param pmc __ARG_2 + .param pmc __ARG_3 + .param pmc __ARG_4 + .param pmc __ARG_5 + $P1 = __ARG_5[0] + null $S1 + $P2 = $P1.'checkresult'() + null $S2 + if_null $P2, __label_1 + set $S2, $P2 + __label_1: + if_null $S2, __label_2 + length $I1, $S2 + ne $I1, 1, __label_2 + ord $I1, $S2 + if $I1 == 73 goto __label_4 + if $I1 == 78 goto __label_5 + goto __label_2 + __label_4: # case + $P2 = $P1.'emit_getint'(__ARG_1) + set $S1, $P2 + goto __label_3 # break + __label_5: # case + $P3 = $P1.'emit_get'(__ARG_1) + set $S1, $P3 + goto __label_3 # break + __label_2: # default + $P4 = $P1.'isnull'() + if_null $P4, __label_6 + unless $P4 goto __label_6 + set $S1, "0" + goto __label_7 + __label_6: # else + $P5 = $P1.'emit_get'(__ARG_1) + null $S3 + if_null $P5, __label_8 + set $S3, $P5 + __label_8: + set $S1, "$N0" + __ARG_1.'annotate'(__ARG_3) + __ARG_1.'emitset'($S1, $S3) + __label_7: # endif + __label_3: # switch end + __ARG_1.'annotate'(__ARG_3) + __ARG_1.'emitarg1'('sleep', $S1) + +.end # builtin_sleep + + +.sub 'getbuiltins' :subid('WSubId_148') + .param pmc __ARG_1 +.const 'Sub' WSubId_49 = "WSubId_49" +.const 'Sub' WSubId_50 = "WSubId_50" +.const 'Sub' WSubId_51 = "WSubId_51" +.const 'Sub' WSubId_52 = "WSubId_52" +.const 'Sub' WSubId_53 = "WSubId_53" +.const 'Sub' WSubId_54 = "WSubId_54" +.const 'Sub' WSubId_55 = "WSubId_55" +.const 'Sub' WSubId_56 = "WSubId_56" +.const 'Sub' WSubId_57 = "WSubId_57" +.const 'Sub' WSubId_58 = "WSubId_58" +.const 'Sub' WSubId_59 = "WSubId_59" +.const 'Sub' WSubId_60 = "WSubId_60" +.const 'Sub' WSubId_61 = "WSubId_61" +.const 'Sub' WSubId_62 = "WSubId_62" +.const 'Sub' WSubId_63 = "WSubId_63" +.const 'Sub' WSubId_64 = "WSubId_64" +.const 'Sub' WSubId_65 = "WSubId_65" +.const 'Sub' WSubId_66 = "WSubId_66" + new $P2, [ 'Winxed'; 'Compiler'; 'BuiltinFunctionEval' ] + new $P4, [ 'Winxed'; 'Compiler'; 'Builtin_typecast' ] + $P4.'Builtin_typecast'('I') set $P3, $P4 - $P2.'PredefFunction'('int', $P3, 'I', '!') + $P2.'BuiltinFunctionEval'('int', WSubId_49, $P3, 'I', '!') set $P1, $P2 -.annotate 'line', 1405 __ARG_1.'add'($P1) -.annotate 'line', 1409 - new $P2, [ 'Winxed'; 'Compiler'; 'PredefFunction' ] -.annotate 'line', 1410 - new $P4, [ 'Winxed'; 'Compiler'; 'Predef_typecast' ] - $P4.'Predef_typecast'('N') + new $P2, [ 'Winxed'; 'Compiler'; 'BuiltinFunction' ] + new $P4, [ 'Winxed'; 'Compiler'; 'Builtin_typecast' ] + $P4.'Builtin_typecast'('N') set $P3, $P4 - $P2.'PredefFunction'('float', $P3, 'N', '!') + $P2.'BuiltinFunction'('float', $P3, 'N', '!') set $P1, $P2 -.annotate 'line', 1409 __ARG_1.'add'($P1) -.annotate 'line', 1413 - new $P2, [ 'Winxed'; 'Compiler'; 'PredefFunction' ] -.annotate 'line', 1414 - new $P4, [ 'Winxed'; 'Compiler'; 'Predef_typecast' ] - $P4.'Predef_typecast'('S') + new $P2, [ 'Winxed'; 'Compiler'; 'BuiltinFunctionEval' ] + new $P4, [ 'Winxed'; 'Compiler'; 'Builtin_typecast' ] + $P4.'Builtin_typecast'('S') set $P3, $P4 - $P2.'PredefFunction'('string', $P3, 'S', '!') + $P2.'BuiltinFunctionEval'('string', WSubId_50, $P3, 'S', '!') set $P1, $P2 -.annotate 'line', 1413 __ARG_1.'add'($P1) -.annotate 'line', 1417 - new $P2, [ 'Winxed'; 'Compiler'; 'PredefFunction' ] - $P2.'PredefFunction'('die', 'die %1', 'v', 'S') + new $P2, [ 'Winxed'; 'Compiler'; 'BuiltinFunction' ] + $P2.'BuiltinFunction'('var', WSubId_51, 'P', '!') set $P1, $P2 __ARG_1.'add'($P1) -.annotate 'line', 1421 - new $P2, [ 'Winxed'; 'Compiler'; 'PredefFunction' ] - $P2.'PredefFunction'('exit', 'exit %1', 'v', 'I') + new $P2, [ 'Winxed'; 'Compiler'; 'BuiltinFunction' ] + $P2.'BuiltinFunction'('die', 'die %1', 'v', 'S') set $P1, $P2 __ARG_1.'add'($P1) -.annotate 'line', 1425 - new $P2, [ 'Winxed'; 'Compiler'; 'PredefFunction' ] - $P2.'PredefFunction'('time', 'time %0', 'I') + new $P2, [ 'Winxed'; 'Compiler'; 'BuiltinFunction' ] + $P2.'BuiltinFunction'('exit', 'exit %1', 'v', 'I') set $P1, $P2 __ARG_1.'add'($P1) -.annotate 'line', 1429 - new $P2, [ 'Winxed'; 'Compiler'; 'PredefFunction' ] - $P2.'PredefFunction'('floattime', 'time %0', 'N') + new $P2, [ 'Winxed'; 'Compiler'; 'BuiltinFunction' ] + $P2.'BuiltinFunction'('time', 'time %0', 'I') set $P1, $P2 __ARG_1.'add'($P1) -.annotate 'line', 1433 - new $P2, [ 'Winxed'; 'Compiler'; 'PredefFunction' ] - $P2.'PredefFunction'('spawnw', 'spawnw %0, %1', 'I', 'P') + new $P2, [ 'Winxed'; 'Compiler'; 'BuiltinFunction' ] + $P2.'BuiltinFunction'('floattime', 'time %0', 'N') set $P1, $P2 __ARG_1.'add'($P1) -.annotate 'line', 1437 - new $P2, [ 'Winxed'; 'Compiler'; 'PredefFunction' ] - $P2.'PredefFunction'('getstdin', 'getstdin %0', 'P') + new $P2, [ 'Winxed'; 'Compiler'; 'BuiltinFunction' ] + $P2.'BuiltinFunction'('sleep', WSubId_52, 'v', '!') set $P1, $P2 __ARG_1.'add'($P1) -.annotate 'line', 1441 - new $P2, [ 'Winxed'; 'Compiler'; 'PredefFunction' ] - $P2.'PredefFunction'('getstdout', 'getstdout %0', 'P') + new $P2, [ 'Winxed'; 'Compiler'; 'BuiltinFunction' ] + $P2.'BuiltinFunction'('spawnw', 'spawnw %0, %1', 'I', 'P') set $P1, $P2 __ARG_1.'add'($P1) -.annotate 'line', 1445 - new $P2, [ 'Winxed'; 'Compiler'; 'PredefFunction' ] - $P2.'PredefFunction'('getstderr', 'getstderr %0', 'P') + new $P2, [ 'Winxed'; 'Compiler'; 'BuiltinFunction' ] + $P2.'BuiltinFunction'('getstdin', 'getstdin %0', 'P') set $P1, $P2 __ARG_1.'add'($P1) -.annotate 'line', 1449 - new $P2, [ 'Winxed'; 'Compiler'; 'PredefFunction' ] - $P2.'PredefFunction'('open', "root_new %0, ['parrot';'FileHandle']\n%0.'open'(%1)\n", 'P', 'S') + new $P2, [ 'Winxed'; 'Compiler'; 'BuiltinFunction' ] + $P2.'BuiltinFunction'('getstdout', 'getstdout %0', 'P') set $P1, $P2 __ARG_1.'add'($P1) -.annotate 'line', 1456 - new $P2, [ 'Winxed'; 'Compiler'; 'PredefFunction' ] - $P2.'PredefFunction'('open', "root_new %0, ['parrot';'FileHandle']\n%0.'open'(%1,%2)\n", 'P', 'S', 'S') + new $P2, [ 'Winxed'; 'Compiler'; 'BuiltinFunction' ] + $P2.'BuiltinFunction'('getstderr', 'getstderr %0', 'P') set $P1, $P2 __ARG_1.'add'($P1) -.annotate 'line', 1463 - new $P2, [ 'Winxed'; 'Compiler'; 'PredefFunction' ] - $P2.'PredefFunction'('Error', "root_new %0, ['parrot';'Exception']\n%0['message'] = %1\n", 'P', 'S') + new $P2, [ 'Winxed'; 'Compiler'; 'BuiltinFunction' ] + $P2.'BuiltinFunction'('open', "root_new %0, ['parrot';'FileHandle']\n%0.'open'(%1)\n", 'P', 'S') set $P1, $P2 __ARG_1.'add'($P1) -.annotate 'line', 1470 - new $P2, [ 'Winxed'; 'Compiler'; 'PredefFunction' ] - $P2.'PredefFunction'('Error', "root_new %0, ['parrot';'Exception']\n%0['message'] = %1\n%0['severity'] = %2\n", 'P', 'S', 'I') + new $P2, [ 'Winxed'; 'Compiler'; 'BuiltinFunction' ] + $P2.'BuiltinFunction'('open', "root_new %0, ['parrot';'FileHandle']\n%0.'open'(%1,%2)\n", 'P', 'S', 'S') set $P1, $P2 __ARG_1.'add'($P1) -.annotate 'line', 1478 - new $P2, [ 'Winxed'; 'Compiler'; 'PredefFunction' ] - $P2.'PredefFunction'('Error', "root_new %0, ['parrot';'Exception']\n%0['message'] = %1\n%0['severity'] = %2\n%0['type'] = %3\n", 'P', 'S', 'I', 'I') + new $P2, [ 'Winxed'; 'Compiler'; 'BuiltinFunction' ] + $P2.'BuiltinFunction'('Error', "root_new %0, ['parrot';'Exception']\n%0['message'] = %1\n", 'P', 'S') set $P1, $P2 __ARG_1.'add'($P1) -.annotate 'line', 1487 - new $P2, [ 'Winxed'; 'Compiler'; 'PredefFunction' ] - $P2.'PredefFunction'('Error', "root_new %0, ['parrot';'Exception']\n%0['message'] = %1\n%0['severity'] = %2\n%0['type'] = %3\n%0['payload'] = %4\n", 'P', 'S', 'I', 'I', 'P') + new $P2, [ 'Winxed'; 'Compiler'; 'BuiltinFunction' ] + $P2.'BuiltinFunction'('Error', "root_new %0, ['parrot';'Exception']\n%0['message'] = %1\n%0['severity'] = %2\n", 'P', 'S', 'I') set $P1, $P2 __ARG_1.'add'($P1) -.annotate 'line', 1497 - new $P2, [ 'Winxed'; 'Compiler'; 'PredefFunction' ] - $P2.'PredefFunction'('elements', 'elements %0, %1', 'I', 'P') + new $P2, [ 'Winxed'; 'Compiler'; 'BuiltinFunction' ] + $P2.'BuiltinFunction'('Error', "root_new %0, ['parrot';'Exception']\n%0['message'] = %1\n%0['severity'] = %2\n%0['type'] = %3\n", 'P', 'S', 'I', 'I') set $P1, $P2 __ARG_1.'add'($P1) -.annotate 'line', 1501 - new $P2, [ 'Winxed'; 'Compiler'; 'PredefFunctionEval' ] -.annotate 'line', 1502 - $P2.'PredefFunctionEval'('length', WSubId_22, 'length %0, %1', 'I', 'S') + new $P2, [ 'Winxed'; 'Compiler'; 'BuiltinFunction' ] + $P2.'BuiltinFunction'('Error', "root_new %0, ['parrot';'Exception']\n%0['message'] = %1\n%0['severity'] = %2\n%0['type'] = %3\n%0['payload'] = %4\n", 'P', 'S', 'I', 'I', 'P') set $P1, $P2 -.annotate 'line', 1501 __ARG_1.'add'($P1) -.annotate 'line', 1506 - new $P2, [ 'Winxed'; 'Compiler'; 'PredefFunctionEval' ] -.annotate 'line', 1507 - $P2.'PredefFunctionEval'('bytelength', WSubId_23, 'bytelength %0, %1', 'I', 'S') + new $P2, [ 'Winxed'; 'Compiler'; 'BuiltinFunction' ] + $P2.'BuiltinFunction'('elements', 'elements %0, %1', 'I', 'P') set $P1, $P2 -.annotate 'line', 1506 __ARG_1.'add'($P1) -.annotate 'line', 1511 - new $P2, [ 'Winxed'; 'Compiler'; 'PredefFunctionEval' ] -.annotate 'line', 1512 - $P2.'PredefFunctionEval'('chr', WSubId_24, "chr $S0, %1\nfind_encoding $I0, 'utf8'\ntrans_encoding %0, $S0, $I0\n", 'S', 'I') + new $P2, [ 'Winxed'; 'Compiler'; 'BuiltinFunctionEval' ] + $P2.'BuiltinFunctionEval'('length', WSubId_53, 'length %0, %1', 'I', 'S') set $P1, $P2 -.annotate 'line', 1511 __ARG_1.'add'($P1) -.annotate 'line', 1520 - new $P2, [ 'Winxed'; 'Compiler'; 'PredefFunctionEval' ] -.annotate 'line', 1521 - $P2.'PredefFunctionEval'('ord', WSubId_25, 'ord %0, %1', 'I', 'S') + new $P2, [ 'Winxed'; 'Compiler'; 'BuiltinFunctionEval' ] + $P2.'BuiltinFunctionEval'('bytelength', WSubId_54, 'bytelength %0, %1', 'I', 'S') set $P1, $P2 -.annotate 'line', 1520 __ARG_1.'add'($P1) -.annotate 'line', 1525 - new $P2, [ 'Winxed'; 'Compiler'; 'PredefFunctionEval' ] -.annotate 'line', 1526 - $P2.'PredefFunctionEval'('ord', WSubId_26, 'ord %0, %1, %2', 'I', 'S', 'I') + new $P2, [ 'Winxed'; 'Compiler'; 'BuiltinFunctionEval' ] + $P2.'BuiltinFunctionEval'('chr', WSubId_55, "chr $S0, %1\nfind_encoding $I0, 'utf8'\ntrans_encoding %0, $S0, $I0\n", 'S', 'I') set $P1, $P2 -.annotate 'line', 1525 __ARG_1.'add'($P1) -.annotate 'line', 1530 - new $P2, [ 'Winxed'; 'Compiler'; 'PredefFunctionEval' ] -.annotate 'line', 1531 - $P2.'PredefFunctionEval'('substr', WSubId_27, 'substr %0, %1, %2', 'S', 'S', 'I') + new $P2, [ 'Winxed'; 'Compiler'; 'BuiltinFunctionEval' ] + $P2.'BuiltinFunctionEval'('ord', WSubId_56, 'ord %0, %1', 'I', 'S') set $P1, $P2 -.annotate 'line', 1530 __ARG_1.'add'($P1) -.annotate 'line', 1535 - new $P2, [ 'Winxed'; 'Compiler'; 'PredefFunctionEval' ] -.annotate 'line', 1536 - $P2.'PredefFunctionEval'('substr', WSubId_28, 'substr %0, %1, %2, %3', 'S', 'S', 'I', 'I') + new $P2, [ 'Winxed'; 'Compiler'; 'BuiltinFunctionEval' ] + $P2.'BuiltinFunctionEval'('ord', WSubId_56, 'ord %0, %1, %2', 'I', 'S', 'I') set $P1, $P2 -.annotate 'line', 1535 __ARG_1.'add'($P1) -.annotate 'line', 1540 - new $P2, [ 'Winxed'; 'Compiler'; 'PredefFunction' ] - $P2.'PredefFunction'('replace', 'replace %0, %1, %2, %3, %4', 'S', 'S', 'I', 'I', 'S') + new $P2, [ 'Winxed'; 'Compiler'; 'BuiltinFunctionEval' ] + $P2.'BuiltinFunctionEval'('substr', WSubId_57, 'substr %0, %1, %2', 'S', 'S', 'I') set $P1, $P2 __ARG_1.'add'($P1) -.annotate 'line', 1544 - new $P2, [ 'Winxed'; 'Compiler'; 'PredefFunctionEval' ] -.annotate 'line', 1545 - $P2.'PredefFunctionEval'('indexof', WSubId_29, 'index %0, %1, %2', 'I', 'S', 'S') + new $P2, [ 'Winxed'; 'Compiler'; 'BuiltinFunctionEval' ] + $P2.'BuiltinFunctionEval'('substr', WSubId_57, 'substr %0, %1, %2, %3', 'S', 'S', 'I', 'I') set $P1, $P2 -.annotate 'line', 1544 __ARG_1.'add'($P1) -.annotate 'line', 1549 - new $P2, [ 'Winxed'; 'Compiler'; 'PredefFunctionEval' ] -.annotate 'line', 1550 - $P2.'PredefFunctionEval'('indexof', WSubId_30, 'index %0, %1, %2, %3', 'I', 'S', 'S', 'I') + new $P2, [ 'Winxed'; 'Compiler'; 'BuiltinFunction' ] + $P2.'BuiltinFunction'('replace', 'replace %0, %1, %2, %3, %4', 'S', 'S', 'I', 'I', 'S') set $P1, $P2 -.annotate 'line', 1549 __ARG_1.'add'($P1) -.annotate 'line', 1554 - new $P2, [ 'Winxed'; 'Compiler'; 'PredefFunction' ] - $P2.'PredefFunction'('join', 'join %0, %1, %2', 'S', 'S', 'P') + new $P2, [ 'Winxed'; 'Compiler'; 'BuiltinFunctionEval' ] + $P2.'BuiltinFunctionEval'('indexof', WSubId_58, 'index %0, %1, %2', 'I', 'S', 'S') set $P1, $P2 __ARG_1.'add'($P1) -.annotate 'line', 1558 - new $P2, [ 'Winxed'; 'Compiler'; 'PredefFunction' ] - $P2.'PredefFunction'('escape', 'escape %0, %1', 'S', 'S') + new $P2, [ 'Winxed'; 'Compiler'; 'BuiltinFunctionEval' ] + $P2.'BuiltinFunctionEval'('indexof', WSubId_59, 'index %0, %1, %2, %3', 'I', 'S', 'S', 'I') set $P1, $P2 __ARG_1.'add'($P1) -.annotate 'line', 1562 - new $P2, [ 'Winxed'; 'Compiler'; 'PredefFunction' ] - $P2.'PredefFunction'('unescape', "$P0 = new ['String']\n$P0 = %1\n%0 = $P0.'unescape'('utf8')\n", 'S', 'S') + new $P2, [ 'Winxed'; 'Compiler'; 'BuiltinFunction' ] + $P2.'BuiltinFunction'('join', 'join %0, %1, %2', 'S', 'S', 'P') set $P1, $P2 __ARG_1.'add'($P1) -.annotate 'line', 1570 - new $P2, [ 'Winxed'; 'Compiler'; 'PredefFunction' ] - $P2.'PredefFunction'('unescape', "$P0 = new ['String']\n$P0 = %1\n%0 = $P0.'unescape'(%2)\n", 'S', 'S', 'S') + new $P2, [ 'Winxed'; 'Compiler'; 'BuiltinFunctionEval' ] + $P2.'BuiltinFunctionEval'('escape', WSubId_60, 'escape %0, %1', 'S', 'S') set $P1, $P2 __ARG_1.'add'($P1) -.annotate 'line', 1578 - new $P2, [ 'Winxed'; 'Compiler'; 'PredefFunction' ] - $P2.'PredefFunction'('trans_encoding', "find_encoding $I0, %2\ntrans_encoding %0, %1, $I0\n", 'S', 'S', 'S') + new $P2, [ 'Winxed'; 'Compiler'; 'BuiltinFunction' ] + $P2.'BuiltinFunction'('unescape', "$P0 = new ['String']\n$P0 = %1\n%0 = $P0.'unescape'('utf8')\n", 'S', 'S') set $P1, $P2 __ARG_1.'add'($P1) -.annotate 'line', 1585 - new $P2, [ 'Winxed'; 'Compiler'; 'PredefFunction' ] - $P2.'PredefFunction'('encoding_name', "encoding $I0, %1\nencodingname %0, $I0\n", 'S', 'S') + new $P2, [ 'Winxed'; 'Compiler'; 'BuiltinFunction' ] + $P2.'BuiltinFunction'('unescape', "$P0 = new ['String']\n$P0 = %1\n%0 = $P0.'unescape'(%2)\n", 'S', 'S', 'S') set $P1, $P2 __ARG_1.'add'($P1) -.annotate 'line', 1592 - new $P2, [ 'Winxed'; 'Compiler'; 'PredefFunction' ] - $P2.'PredefFunction'('upcase', 'upcase %0, %1', 'S', 'S') + new $P2, [ 'Winxed'; 'Compiler'; 'BuiltinFunction' ] + $P2.'BuiltinFunction'('trans_encoding', "find_encoding $I0, %2\ntrans_encoding %0, %1, $I0\n", 'S', 'S', 'S') set $P1, $P2 __ARG_1.'add'($P1) -.annotate 'line', 1596 - new $P2, [ 'Winxed'; 'Compiler'; 'PredefFunction' ] - $P2.'PredefFunction'('downcase', 'downcase %0, %1', 'S', 'S') + new $P2, [ 'Winxed'; 'Compiler'; 'BuiltinFunction' ] + $P2.'BuiltinFunction'('encoding_name', "encoding $I0, %1\nencodingname %0, $I0\n", 'S', 'S') set $P1, $P2 __ARG_1.'add'($P1) -.annotate 'line', 1600 - new $P2, [ 'Winxed'; 'Compiler'; 'PredefFunction' ] - $P2.'PredefFunction'('titlecase', 'titlecase %0, %1', 'S', 'S') + new $P2, [ 'Winxed'; 'Compiler'; 'BuiltinFunction' ] + $P2.'BuiltinFunction'('upcase', 'upcase %0, %1', 'S', 'S') set $P1, $P2 __ARG_1.'add'($P1) -.annotate 'line', 1604 - new $P2, [ 'Winxed'; 'Compiler'; 'PredefFunction' ] - $P2.'PredefFunction'('split', 'split %0, %1, %2', 'P', 'S', 'S') + new $P2, [ 'Winxed'; 'Compiler'; 'BuiltinFunction' ] + $P2.'BuiltinFunction'('downcase', 'downcase %0, %1', 'S', 'S') set $P1, $P2 __ARG_1.'add'($P1) -.annotate 'line', 1608 - new $P2, [ 'Winxed'; 'Compiler'; 'PredefFunction' ] - $P2.'PredefFunction'('chomp', "$P0 = get_root_global ['parrot';'String';'Utils'], 'chomp'\n%0 = $P0(%1)\n", 'S', 'S') + new $P2, [ 'Winxed'; 'Compiler'; 'BuiltinFunction' ] + $P2.'BuiltinFunction'('titlecase', 'titlecase %0, %1', 'S', 'S') set $P1, $P2 __ARG_1.'add'($P1) -.annotate 'line', 1615 - new $P2, [ 'Winxed'; 'Compiler'; 'PredefFunction' ] - $P2.'PredefFunction'('chomp', "$P0 = get_root_global ['parrot';'String';'Utils'], 'chomp'\n%0 = $P0(%1, %2)\n", 'S', 'S', 'S') + new $P2, [ 'Winxed'; 'Compiler'; 'BuiltinFunction' ] + $P2.'BuiltinFunction'('split', 'split %0, %1, %2', 'P', 'S', 'S') set $P1, $P2 __ARG_1.'add'($P1) -.annotate 'line', 1622 - new $P2, [ 'Winxed'; 'Compiler'; 'PredefFunction' ] - $P2.'PredefFunction'('push', 'push %1, %2', 'v', 'P', '?') + new $P2, [ 'Winxed'; 'Compiler'; 'BuiltinFunction' ] + $P2.'BuiltinFunction'('chomp', "$P0 = get_root_global ['parrot';'String';'Utils'], 'chomp'\n%0 = $P0(%1)\n", 'S', 'S') set $P1, $P2 __ARG_1.'add'($P1) -.annotate 'line', 1626 - new $P2, [ 'Winxed'; 'Compiler'; 'PredefFunction' ] - $P2.'PredefFunction'('sqrt', 'sqrt %0, %1', 'N', 'N') + new $P2, [ 'Winxed'; 'Compiler'; 'BuiltinFunction' ] + $P2.'BuiltinFunction'('chomp', "$P0 = get_root_global ['parrot';'String';'Utils'], 'chomp'\n%0 = $P0(%1, %2)\n", 'S', 'S', 'S') set $P1, $P2 __ARG_1.'add'($P1) -.annotate 'line', 1630 - new $P2, [ 'Winxed'; 'Compiler'; 'PredefFunction' ] - $P2.'PredefFunction'('pow', 'pow %0, %1, %2', 'N', 'N', 'N') + new $P2, [ 'Winxed'; 'Compiler'; 'BuiltinFunction' ] + $P2.'BuiltinFunction'('push', 'push %1, %2', 'v', 'P', '?') set $P1, $P2 __ARG_1.'add'($P1) -.annotate 'line', 1634 - new $P2, [ 'Winxed'; 'Compiler'; 'PredefFunction' ] - $P2.'PredefFunction'('exp', 'exp %0, %1', 'N', 'N') + new $P2, [ 'Winxed'; 'Compiler'; 'BuiltinFunction' ] + $P2.'BuiltinFunction'('unshift', 'unshift %1, %2', 'v', 'P', '?') set $P1, $P2 __ARG_1.'add'($P1) -.annotate 'line', 1638 - new $P2, [ 'Winxed'; 'Compiler'; 'PredefFunction' ] - $P2.'PredefFunction'('ln', 'ln %0, %1', 'N', 'N') + new $P2, [ 'Winxed'; 'Compiler'; 'BuiltinFunction' ] + $P2.'BuiltinFunction'('pop_var', 'pop %0, %1', 'P', 'P') set $P1, $P2 __ARG_1.'add'($P1) -.annotate 'line', 1642 - new $P2, [ 'Winxed'; 'Compiler'; 'PredefFunction' ] - $P2.'PredefFunction'('sin', 'sin %0, %1', 'N', 'N') + new $P2, [ 'Winxed'; 'Compiler'; 'BuiltinFunction' ] + $P2.'BuiltinFunction'('shift_var', 'shift %0, %1', 'P', 'P') set $P1, $P2 __ARG_1.'add'($P1) -.annotate 'line', 1646 - new $P2, [ 'Winxed'; 'Compiler'; 'PredefFunction' ] - $P2.'PredefFunction'('cos', 'cos %0, %1', 'N', 'N') + new $P2, [ 'Winxed'; 'Compiler'; 'BuiltinFunction' ] + $P2.'BuiltinFunction'('pop_int', 'pop %0, %1', 'I', 'P') set $P1, $P2 __ARG_1.'add'($P1) -.annotate 'line', 1650 - new $P2, [ 'Winxed'; 'Compiler'; 'PredefFunction' ] - $P2.'PredefFunction'('tan', 'tan %0, %1', 'N', 'N') + new $P2, [ 'Winxed'; 'Compiler'; 'BuiltinFunction' ] + $P2.'BuiltinFunction'('shift_int', 'shift %0, %1', 'I', 'P') set $P1, $P2 __ARG_1.'add'($P1) -.annotate 'line', 1654 - new $P2, [ 'Winxed'; 'Compiler'; 'PredefFunction' ] - $P2.'PredefFunction'('asin', 'asin %0, %1', 'N', 'N') + new $P2, [ 'Winxed'; 'Compiler'; 'BuiltinFunction' ] + $P2.'BuiltinFunction'('pop_float', 'pop %0, %1', 'N', 'P') set $P1, $P2 __ARG_1.'add'($P1) -.annotate 'line', 1658 - new $P2, [ 'Winxed'; 'Compiler'; 'PredefFunction' ] - $P2.'PredefFunction'('acos', 'acos %0, %1', 'N', 'N') + new $P2, [ 'Winxed'; 'Compiler'; 'BuiltinFunction' ] + $P2.'BuiltinFunction'('shift_float', 'shift %0, %1', 'N', 'P') set $P1, $P2 __ARG_1.'add'($P1) -.annotate 'line', 1662 - new $P2, [ 'Winxed'; 'Compiler'; 'PredefFunction' ] - $P2.'PredefFunction'('atan', 'atan %0, %1', 'N', 'N') + new $P2, [ 'Winxed'; 'Compiler'; 'BuiltinFunction' ] + $P2.'BuiltinFunction'('pop_string', 'pop %0, %1', 'S', 'P') set $P1, $P2 __ARG_1.'add'($P1) -.annotate 'line', 1666 - new $P2, [ 'Winxed'; 'Compiler'; 'PredefFunction' ] - $P2.'PredefFunction'('atan', 'atan %0, %1, %2', 'N', 'N', 'N') + new $P2, [ 'Winxed'; 'Compiler'; 'BuiltinFunction' ] + $P2.'BuiltinFunction'('shift_string', 'shift %0, %1', 'S', 'P') set $P1, $P2 __ARG_1.'add'($P1) -.annotate 'line', 1670 - new $P2, [ 'Winxed'; 'Compiler'; 'PredefFunction' ] - $P2.'PredefFunction'('getinterp', 'getinterp %0', 'P') + new $P2, [ 'Winxed'; 'Compiler'; 'BuiltinFunction' ] + $P2.'BuiltinFunction'('abs', WSubId_61, ':', '!') set $P1, $P2 __ARG_1.'add'($P1) -.annotate 'line', 1674 - new $P2, [ 'Winxed'; 'Compiler'; 'PredefFunction' ] - $P2.'PredefFunction'('getcontext', "getinterp $P0\n%0 = $P0[\"context\"]\n", 'P') + new $P2, [ 'Winxed'; 'Compiler'; 'BuiltinFunction' ] + $P2.'BuiltinFunction'('sqrt', 'sqrt %0, %1', 'N', 'N') set $P1, $P2 __ARG_1.'add'($P1) -.annotate 'line', 1687 - new $P2, [ 'Winxed'; 'Compiler'; 'PredefFunction' ] - $P2.'PredefFunction'('get_class', 'get_class %0, %1', 'P', 'p') + new $P2, [ 'Winxed'; 'Compiler'; 'BuiltinFunction' ] + $P2.'BuiltinFunction'('pow', 'pow %0, %1, %2', 'N', 'N', 'N') set $P1, $P2 __ARG_1.'add'($P1) -.annotate 'line', 1691 - new $P2, [ 'Winxed'; 'Compiler'; 'PredefFunction' ] - $P2.'PredefFunction'('typeof', 'typeof %0, %1', 'P', 'P') + new $P2, [ 'Winxed'; 'Compiler'; 'BuiltinFunction' ] + $P2.'BuiltinFunction'('exp', 'exp %0, %1', 'N', 'N') set $P1, $P2 __ARG_1.'add'($P1) -.annotate 'line', 1695 - new $P2, [ 'Winxed'; 'Compiler'; 'PredefFunction' ] - $P2.'PredefFunction'('getattribute', 'getattribute %0, %1, %2', 'P', 'P', 'S') + new $P2, [ 'Winxed'; 'Compiler'; 'BuiltinFunction' ] + $P2.'BuiltinFunction'('ln', 'ln %0, %1', 'N', 'N') set $P1, $P2 __ARG_1.'add'($P1) -.annotate 'line', 1699 - new $P2, [ 'Winxed'; 'Compiler'; 'PredefFunction' ] - $P2.'PredefFunction'('getattribute', 'getattribute %0, %1, %2, %3', 'P', 'P', 'P', 'S') + new $P2, [ 'Winxed'; 'Compiler'; 'BuiltinFunction' ] + $P2.'BuiltinFunction'('sin', 'sin %0, %1', 'N', 'N') set $P1, $P2 __ARG_1.'add'($P1) -.annotate 'line', 1703 - new $P2, [ 'Winxed'; 'Compiler'; 'PredefFunction' ] - $P2.'PredefFunction'('setattribute', 'setattribute %1, %2, %3, %4', 'v', 'P', 'P', 'S', 'P') + new $P2, [ 'Winxed'; 'Compiler'; 'BuiltinFunction' ] + $P2.'BuiltinFunction'('cos', 'cos %0, %1', 'N', 'N') set $P1, $P2 __ARG_1.'add'($P1) -.annotate 'line', 1707 - new $P2, [ 'Winxed'; 'Compiler'; 'PredefFunction' ] - $P2.'PredefFunction'('find_method', 'find_method %0, %1, %2', 'P', 'P', 'S') + new $P2, [ 'Winxed'; 'Compiler'; 'BuiltinFunction' ] + $P2.'BuiltinFunction'('tan', 'tan %0, %1', 'N', 'N') set $P1, $P2 __ARG_1.'add'($P1) -.annotate 'line', 1711 - new $P2, [ 'Winxed'; 'Compiler'; 'PredefFunction' ] - $P2.'PredefFunction'('callmethodwithargs', '%0 = %1.%2(%3 :flat)', 'P', 'P', 'P', 'P') + new $P2, [ 'Winxed'; 'Compiler'; 'BuiltinFunction' ] + $P2.'BuiltinFunction'('asin', 'asin %0, %1', 'N', 'N') set $P1, $P2 __ARG_1.'add'($P1) -.annotate 'line', 1715 - new $P2, [ 'Winxed'; 'Compiler'; 'PredefFunction' ] - $P2.'PredefFunction'('clone', 'clone %0, %1', 'P', 'P') + new $P2, [ 'Winxed'; 'Compiler'; 'BuiltinFunction' ] + $P2.'BuiltinFunction'('acos', 'acos %0, %1', 'N', 'N') set $P1, $P2 __ARG_1.'add'($P1) -.annotate 'line', 1719 - new $P2, [ 'Winxed'; 'Compiler'; 'PredefFunction' ] - $P2.'PredefFunction'('compreg', 'compreg %0, %1', 'P', 'S') + new $P2, [ 'Winxed'; 'Compiler'; 'BuiltinFunction' ] + $P2.'BuiltinFunction'('atan', 'atan %0, %1', 'N', 'N') set $P1, $P2 __ARG_1.'add'($P1) -.annotate 'line', 1723 - new $P2, [ 'Winxed'; 'Compiler'; 'PredefFunction' ] - $P2.'PredefFunction'('compreg', 'compreg %1, %2', 'v', 'S', 'P') + new $P2, [ 'Winxed'; 'Compiler'; 'BuiltinFunction' ] + $P2.'BuiltinFunction'('atan', 'atan %0, %1, %2', 'N', 'N', 'N') set $P1, $P2 __ARG_1.'add'($P1) -.annotate 'line', 1727 - new $P2, [ 'Winxed'; 'Compiler'; 'PredefFunction' ] - $P2.'PredefFunction'('load_language', "load_language %1\ncompreg %0, %1\n", 'P', 'S') + new $P2, [ 'Winxed'; 'Compiler'; 'BuiltinFunction' ] + $P2.'BuiltinFunction'('sinh', 'sinh %0, %1', 'N', 'N') set $P1, $P2 __ARG_1.'add'($P1) -.annotate 'line', 1734 - new $P2, [ 'Winxed'; 'Compiler'; 'PredefFunction' ] - $P2.'PredefFunction'('load_language', "load_language %1\ncompreg %0, %2\n", 'P', 'S', 'S') + new $P2, [ 'Winxed'; 'Compiler'; 'BuiltinFunction' ] + $P2.'BuiltinFunction'('cosh', 'cosh %0, %1', 'N', 'N') set $P1, $P2 __ARG_1.'add'($P1) -.annotate 'line', 1741 - new $P2, [ 'Winxed'; 'Compiler'; 'PredefFunction' ] - $P2.'PredefFunction'('loadlib', 'loadlib %0, %1', 'P', 'S') + new $P2, [ 'Winxed'; 'Compiler'; 'BuiltinFunction' ] + $P2.'BuiltinFunction'('tanh', 'tanh %0, %1', 'N', 'N') set $P1, $P2 __ARG_1.'add'($P1) -.annotate 'line', 1745 - new $P2, [ 'Winxed'; 'Compiler'; 'PredefFunction' ] - $P2.'PredefFunction'('load_bytecode', 'load_bytecode %1', 'v', 'S') + new $P2, [ 'Winxed'; 'Compiler'; 'BuiltinFunction' ] + $P2.'BuiltinFunction'('getinterp', 'getinterp %0', 'P') set $P1, $P2 __ARG_1.'add'($P1) -.annotate 'line', 1749 - new $P2, [ 'Winxed'; 'Compiler'; 'PredefFunction' ] - $P2.'PredefFunction'('load_packfile', 'load_bytecode %0, %1', 'P', 'S') + new $P2, [ 'Winxed'; 'Compiler'; 'BuiltinFunction' ] + $P2.'BuiltinFunction'('getcontext', "getinterp $P0\n%0 = $P0[\"context\"]\n", 'P') set $P1, $P2 __ARG_1.'add'($P1) -.annotate 'line', 1753 - new $P2, [ 'Winxed'; 'Compiler'; 'PredefFunction' ] - $P2.'PredefFunction'('dlfunc', 'dlfunc %0, %1, %2, %3', 'P', 'P', 'S', 'S') + new $P2, [ 'Winxed'; 'Compiler'; 'BuiltinFunction' ] + $P2.'BuiltinFunction'('get_class', 'get_class %0, %1', 'P', 'p') set $P1, $P2 __ARG_1.'add'($P1) -.annotate 'line', 1757 - new $P2, [ 'Winxed'; 'Compiler'; 'PredefFunction' ] - $P2.'PredefFunction'('sprintf', 'sprintf %0, %1, %2', 'S', 'S', 'P') + new $P2, [ 'Winxed'; 'Compiler'; 'BuiltinFunction' ] + $P2.'BuiltinFunction'('typeof', 'typeof %0, %1', 'P', 'P') set $P1, $P2 __ARG_1.'add'($P1) -.annotate 'line', 1761 - new $P2, [ 'Winxed'; 'Compiler'; 'PredefFunction' ] -.annotate 'line', 1762 - $P2.'PredefFunction'('print', WSubId_31, 'v', '*') + new $P2, [ 'Winxed'; 'Compiler'; 'BuiltinFunction' ] + $P2.'BuiltinFunction'('getattribute', 'getattribute %0, %1, %2', 'P', 'P', 'S') set $P1, $P2 -.annotate 'line', 1761 __ARG_1.'add'($P1) -.annotate 'line', 1765 - new $P2, [ 'Winxed'; 'Compiler'; 'PredefFunction' ] -.annotate 'line', 1766 - $P2.'PredefFunction'('say', WSubId_32, 'v', '*') + new $P2, [ 'Winxed'; 'Compiler'; 'BuiltinFunction' ] + $P2.'BuiltinFunction'('getattribute', 'getattribute %0, %1, %2, %3', 'P', 'P', 'P', 'S') set $P1, $P2 -.annotate 'line', 1765 __ARG_1.'add'($P1) -.annotate 'line', 1769 - new $P2, [ 'Winxed'; 'Compiler'; 'PredefFunction' ] -.annotate 'line', 1770 - $P2.'PredefFunction'('cry', WSubId_33, 'v', '*') + new $P2, [ 'Winxed'; 'Compiler'; 'BuiltinFunction' ] + $P2.'BuiltinFunction'('setattribute', 'setattribute %1, %2, %3, %4', 'v', 'P', 'P', 'S', 'P') set $P1, $P2 -.annotate 'line', 1769 __ARG_1.'add'($P1) -.annotate 'line', 1773 - new $P2, [ 'Winxed'; 'Compiler'; 'PredefFunction' ] -.annotate 'line', 1774 - $P2.'PredefFunction'('invoke', WSubId_34, 'P', '!') + new $P2, [ 'Winxed'; 'Compiler'; 'BuiltinFunction' ] + $P2.'BuiltinFunction'('find_method', 'find_method %0, %1, %2', 'P', 'P', 'S') + set $P1, $P2 + __ARG_1.'add'($P1) + new $P2, [ 'Winxed'; 'Compiler'; 'BuiltinFunction' ] + $P2.'BuiltinFunction'('callmethodwithargs', '%0 = %1.%2(%3 :flat)', 'P', 'P', 'P', 'P') + set $P1, $P2 + __ARG_1.'add'($P1) + new $P2, [ 'Winxed'; 'Compiler'; 'BuiltinFunction' ] + $P2.'BuiltinFunction'('clone', 'clone %0, %1', 'P', 'P') + set $P1, $P2 + __ARG_1.'add'($P1) + new $P2, [ 'Winxed'; 'Compiler'; 'BuiltinFunction' ] + $P2.'BuiltinFunction'('compreg', 'compreg %0, %1', 'P', 'S') + set $P1, $P2 + __ARG_1.'add'($P1) + new $P2, [ 'Winxed'; 'Compiler'; 'BuiltinFunction' ] + $P2.'BuiltinFunction'('compreg', 'compreg %1, %2', 'v', 'S', 'P') + set $P1, $P2 + __ARG_1.'add'($P1) + new $P2, [ 'Winxed'; 'Compiler'; 'BuiltinFunction' ] + $P2.'BuiltinFunction'('load_language', "load_language %1\ncompreg %0, %1\n", 'P', 'S') + set $P1, $P2 + __ARG_1.'add'($P1) + new $P2, [ 'Winxed'; 'Compiler'; 'BuiltinFunction' ] + $P2.'BuiltinFunction'('load_language', "load_language %1\ncompreg %0, %2\n", 'P', 'S', 'S') + set $P1, $P2 + __ARG_1.'add'($P1) + new $P2, [ 'Winxed'; 'Compiler'; 'BuiltinFunction' ] + $P2.'BuiltinFunction'('loadlib', 'loadlib %0, %1', 'P', 'S') + set $P1, $P2 + __ARG_1.'add'($P1) + new $P2, [ 'Winxed'; 'Compiler'; 'BuiltinFunction' ] + $P2.'BuiltinFunction'('load_bytecode', 'load_bytecode %1', 'v', 'S') + set $P1, $P2 + __ARG_1.'add'($P1) + new $P2, [ 'Winxed'; 'Compiler'; 'BuiltinFunction' ] + $P2.'BuiltinFunction'('load_packfile', 'load_bytecode %0, %1', 'P', 'S') + set $P1, $P2 + __ARG_1.'add'($P1) + new $P2, [ 'Winxed'; 'Compiler'; 'BuiltinFunction' ] + $P2.'BuiltinFunction'('dlfunc', 'dlfunc %0, %1, %2, %3', 'P', 'P', 'S', 'S') + set $P1, $P2 + __ARG_1.'add'($P1) + new $P2, [ 'Winxed'; 'Compiler'; 'BuiltinFunction' ] + $P2.'BuiltinFunction'('sprintf', 'sprintf %0, %1, %2', 'S', 'S', 'P') + set $P1, $P2 + __ARG_1.'add'($P1) + new $P2, [ 'Winxed'; 'Compiler'; 'BuiltinFunction' ] + $P2.'BuiltinFunction'('print', WSubId_62, 'v', '*') + set $P1, $P2 + __ARG_1.'add'($P1) + new $P2, [ 'Winxed'; 'Compiler'; 'BuiltinFunction' ] + $P2.'BuiltinFunction'('say', WSubId_63, 'v', '*') + set $P1, $P2 + __ARG_1.'add'($P1) + new $P2, [ 'Winxed'; 'Compiler'; 'BuiltinFunction' ] + $P2.'BuiltinFunction'('cry', WSubId_64, 'v', '*') + set $P1, $P2 + __ARG_1.'add'($P1) + new $P2, [ 'Winxed'; 'Compiler'; 'BuiltinFunction' ] + $P2.'BuiltinFunction'('__ASSERT__', WSubId_65, 'v', '!') + set $P1, $P2 + __ARG_1.'add'($P1) + new $P2, [ 'Winxed'; 'Compiler'; 'BuiltinFunction' ] + $P2.'BuiltinFunction'('invoke', WSubId_66, 'P', '!') set $P1, $P2 -.annotate 'line', 1773 __ARG_1.'add'($P1) -# } -.annotate 'line', 1777 - -.end # getpredefs - - -.sub 'optimize_array' :subid('WSubId_37') - .param pmc __ARG_1 -# Body -# { -.annotate 'line', 1785 - if_null __ARG_1, __label_1 -# { -.annotate 'line', 1786 -# n: $I1 -# predefined elements - elements $I1, __ARG_1 -# for loop -.annotate 'line', 1787 -# i: $I2 - null $I2 - __label_4: # for condition - ge $I2, $I1, __label_3 -.annotate 'line', 1788 - $P2 = __ARG_1[$I2] - $P1 = $P2.'optimize'() - __ARG_1[$I2] = $P1 - __label_2: # for iteration -.annotate 'line', 1787 - inc $I2 - goto __label_4 - __label_3: # for end -# } - __label_1: # endif -# } -.annotate 'line', 1790 - -.end # optimize_array - - -.sub 'emit_array' :subid('WSubId_51') - .param pmc __ARG_1 - .param pmc __ARG_2 -# Body -# { -.annotate 'line', 1794 - if_null __ARG_2, __label_2 - iter $P2, __ARG_2 - set $P2, 0 - __label_1: # for iteration - unless $P2 goto __label_2 - shift $P1, $P2 -.annotate 'line', 1795 - $P1.'emit'(__ARG_1) - goto __label_1 - __label_2: # endfor -# } -.annotate 'line', 1796 -.end # emit_array +.end # getbuiltins -.sub 'parseDotted' :subid('WSubId_54') +.sub 'parseDotted' :subid('WSubId_85') .param pmc __ARG_1 -# Body -# { -.annotate 'line', 1800 -# var list: $P1 root_new $P1, ['parrot';'ResizablePMCArray'] -.annotate 'line', 1801 -# var t: $P2 $P2 = __ARG_1.'get'() -.annotate 'line', 1802 $P3 = $P2.'isidentifier'() if_null $P3, __label_1 unless $P3 goto __label_1 -# { -.annotate 'line', 1803 -# predefined push push $P1, $P2 __label_3: # while -.annotate 'line', 1804 $P2 = __ARG_1.'get'() $P3 = $P2.'isop'('.') if_null $P3, __label_2 unless $P3 goto __label_2 -# { -.annotate 'line', 1805 $P2 = __ARG_1.'get'() -.annotate 'line', 1806 -# predefined push push $P1, $P2 -# } goto __label_3 __label_2: # endwhile -# } __label_1: # endif -.annotate 'line', 1809 __ARG_1.'unget'($P2) -.annotate 'line', 1810 .return($P1) -# } -.annotate 'line', 1811 .end # parseDotted -.sub 'parseList' :subid('WSubId_35') +.sub 'parseList' :subid('WSubId_67') .param pmc __ARG_1 .param pmc __ARG_2 .param pmc __ARG_3 .param string __ARG_4 :optional -.const 'Sub' WSubId_1 = "WSubId_1" -# Body -# { -.annotate 'line', 1819 -# var list: $P1 +.const 'Sub' WSubId_25 = "WSubId_25" root_new $P1, ['parrot';'ResizablePMCArray'] -.annotate 'line', 1820 -# var t: $P2 null $P2 __label_1: # do -.annotate 'line', 1821 -# { -.annotate 'line', 1822 -# var value: $P3 $P3 = __ARG_3(__ARG_1, __ARG_2) -.annotate 'line', 1823 -# predefined push push $P1, $P3 -# } __label_3: # continue -.annotate 'line', 1824 $P2 = __ARG_1.'get'() $P4 = $P2.'isop'(',') if_null $P4, __label_2 if $P4 goto __label_1 __label_2: # enddo -.annotate 'line', 1825 unless_null __ARG_4, __label_4 -.annotate 'line', 1826 __ARG_1.'unget'($P2) goto __label_5 __label_4: # else -.annotate 'line', 1828 $P4 = $P2.'isop'(__ARG_4) isfalse $I1, $P4 unless $I1 goto __label_6 -.annotate 'line', 1829 - WSubId_1("Unfinished argument list", $P2) + WSubId_25("Unfinished argument list", $P2) __label_6: # endif __label_5: # endif -.annotate 'line', 1830 .return($P1) -# } -.annotate 'line', 1831 .end # parseList -.sub 'parseIdentifier' :subid('WSubId_56') +.sub 'parseIdentifier' :subid('WSubId_87') .param pmc __ARG_1 .param pmc __ARG_2 -.const 'Sub' WSubId_3 = "WSubId_3" -# Body -# { -.annotate 'line', 1836 -# var t: $P1 +.const 'Sub' WSubId_27 = "WSubId_27" $P1 = __ARG_1.'get'() -.annotate 'line', 1837 $P2 = $P1.'isidentifier'() isfalse $I1, $P2 unless $I1 goto __label_1 -.annotate 'line', 1838 - WSubId_3($P1) + WSubId_27($P1) __label_1: # endif -.annotate 'line', 1839 .return($P1) -# } -.annotate 'line', 1840 .end # parseIdentifier -.sub 'toIdentifierList' :subid('WSubId_55') +.sub 'toIdentifierList' :subid('WSubId_86') .param pmc __ARG_1 -# Body -# { -.annotate 'line', 1844 +.const 'Sub' WSubId_5 = "WSubId_5" new $P1, ['ResizableStringArray'] -.annotate 'line', 1845 - if_null __ARG_1, __label_2 - iter $P3, __ARG_1 - set $P3, 0 - __label_1: # for iteration - unless $P3 goto __label_2 - shift $P2, $P3 -.annotate 'line', 1846 - $P4 = $P2.'getidentifier'() -# predefined push - push $P1, $P4 + set $P2, __ARG_1 + set $P3, $P1 + $P4 = WSubId_5("getidentifier") + if_null $P2, __label_3 + iter $P6, $P2 + set $P6, 0 + __label_2: # for iteration + unless $P6 goto __label_3 + shift $P5, $P6 + $P7 = $P4($P5) + push $P3, $P7 + goto __label_2 + __label_3: # endfor goto __label_1 - __label_2: # endfor -.annotate 'line', 1847 + __label_1: .return($P1) -# } -.annotate 'line', 1848 .end # toIdentifierList @@ -5041,198 +3967,155 @@ .sub 'initbase' :method .param pmc __ARG_1 .param pmc __ARG_2 -# Body -# { -.annotate 'line', 1861 setattribute self, 'start', __ARG_1 -.annotate 'line', 1862 setattribute self, 'owner', __ARG_2 -# } -.annotate 'line', 1863 .end # initbase -.sub 'filename' :method -# Body -# { -.annotate 'line', 1866 - getattribute $P1, self, 'start' - if_null $P1, __label_1 -.annotate 'line', 1867 - getattribute $P2, self, 'start' - .tailcall $P2.'filename'() - goto __label_2 - __label_1: # else -.annotate 'line', 1869 - .return("unknown") - __label_2: # endif -# } -.annotate 'line', 1870 +.sub 'clone' :method + .param pmc __ARG_1 +.const 'Sub' WSubId_25 = "WSubId_25" + typeof $P1, self + set $S1, $P1 + concat $S2, "Cannot use ", $S1 + concat $S2, $S2, " in inline (yet)" + WSubId_25($S2, self) -.end # filename +.end # clone -.sub 'linenum' :method -# Body -# { -.annotate 'line', 1873 +.sub 'getstart' :method getattribute $P1, self, 'start' - if_null $P1, __label_1 -.annotate 'line', 1874 - getattribute $P2, self, 'start' - .tailcall $P2.'linenum'() - goto __label_2 - __label_1: # else -.annotate 'line', 1876 - .return(0) - __label_2: # endif -# } -.annotate 'line', 1877 + .return($P1) -.end # linenum +.end # getstart .sub 'viewable' :method -# Body -# { -.annotate 'line', 1880 getattribute $P1, self, 'start' if_null $P1, __label_1 -.annotate 'line', 1881 getattribute $P2, self, 'start' .tailcall $P2.'viewable'() goto __label_2 __label_1: # else -.annotate 'line', 1883 .return("") __label_2: # endif -# } -.annotate 'line', 1884 .end # viewable .sub 'annotate' :method .param pmc __ARG_1 -# Body -# { -.annotate 'line', 1887 getattribute $P1, self, 'start' __ARG_1.'annotate'($P1) -# } -.annotate 'line', 1888 .end # annotate -.sub 'use_predef' :method +.sub 'getpath' :method + getattribute $P1, self, 'owner' + .tailcall $P1.'getpath'() + +.end # getpath + + +.sub 'use_builtin' :method .param string __ARG_1 -# Body -# { -.annotate 'line', 1891 getattribute $P1, self, 'owner' - $P1.'use_predef'(__ARG_1) -# } -.annotate 'line', 1892 + $P1.'use_builtin'(__ARG_1) -.end # use_predef +.end # use_builtin .sub 'generatesubid' :method -# Body -# { -.annotate 'line', 1895 getattribute $P1, self, 'owner' .tailcall $P1.'generatesubid'() -# } -.annotate 'line', 1896 .end # generatesubid .sub 'usesubid' :method .param string __ARG_1 -# Body -# { -.annotate 'line', 1899 getattribute $P1, self, 'owner' $P1.'usesubid'(__ARG_1) -# } -.annotate 'line', 1900 .end # usesubid .sub 'addlocalfunction' :method .param pmc __ARG_1 -# Body -# { -.annotate 'line', 1903 getattribute $P1, self, 'owner' .tailcall $P1.'addlocalfunction'(__ARG_1) -# } -.annotate 'line', 1904 .end # addlocalfunction -.sub 'findns' :method +.sub 'scopesearch' :method .param pmc __ARG_1 -# Body -# { -.annotate 'line', 1907 + .param int __ARG_2 getattribute $P1, self, 'owner' - .tailcall $P1.'findns'(__ARG_1) -# } -.annotate 'line', 1908 + .tailcall $P1.'scopesearch'(__ARG_1, __ARG_2) -.end # findns +.end # scopesearch -.sub 'findsymbol' :method - .param pmc __ARG_1 -# Body -# { -.annotate 'line', 1911 +.sub 'dowarnings' :method getattribute $P1, self, 'owner' - .tailcall $P1.'findsymbol'(__ARG_1) -# } -.annotate 'line', 1912 + .tailcall $P1.'dowarnings'() -.end # findsymbol +.end # dowarnings +.sub Winxed_class_init :anon :load :init + newclass $P0, [ 'Winxed'; 'Compiler'; 'CommonBase' ] + addattribute $P0, 'start' + addattribute $P0, 'owner' +.end +.namespace [ 'Winxed'; 'Compiler'; 'CollectValues' ] -.sub 'findclasskey' :method +.sub 'CollectValues' :method .param pmc __ARG_1 -# Body -# { -.annotate 'line', 1915 - getattribute $P1, self, 'owner' - .tailcall $P1.'findclasskey'(__ARG_1) -# } -.annotate 'line', 1916 + .param pmc __ARG_2 + setattribute self, 'owner', __ARG_1 + setattribute self, 'e', __ARG_2 -.end # findclasskey +.end # CollectValues -.sub 'dowarnings' :method -# Body -# { -.annotate 'line', 1919 - getattribute $P1, self, 'owner' - .tailcall $P1.'dowarnings'() -# } -.annotate 'line', 1920 +.sub 'add' :method + .param pmc __ARG_1 + getattribute $P1, self, 'e' + null $S1 + $P3 = __ARG_1.'isnull'() + if_null $P3, __label_1 + unless $P3 goto __label_1 + getattribute $P2, self, 'pnull' + unless_null $P2, __label_3 + getattribute $P4, self, 'owner' + $P3 = $P4.'tempreg'('P') + null $S2 + if_null $P3, __label_4 + set $S2, $P3 + __label_4: + $P1.'emitnull'($S2) + box $P2, $S2 + setattribute self, 'pnull', $P2 + __label_3: # endif + set $S1, $P2 + goto __label_2 + __label_1: # else + $P3 = __ARG_1.'emit_get'($P1) + set $S1, $P3 + __label_2: # endif + .return($S1) -.end # dowarnings +.end # add .sub Winxed_class_init :anon :load :init - newclass $P0, [ 'Winxed'; 'Compiler'; 'CommonBase' ] -.annotate 'line', 1856 - addattribute $P0, 'start' -.annotate 'line', 1857 + newclass $P0, [ 'Winxed'; 'Compiler'; 'CollectValues' ] addattribute $P0, 'owner' + addattribute $P0, 'e' + addattribute $P0, 'pnull' .end .namespace [ 'Winxed'; 'Compiler'; 'SimpleArgList' ] @@ -5240,164 +4123,159 @@ .param pmc __ARG_1 .param pmc __ARG_2 .param string __ARG_3 -.const 'Sub' WSubId_35 = "WSubId_35" -.const 'Sub' WSubId_36 = "WSubId_36" -# Body -# { -.annotate 'line', 1935 - $P2 = WSubId_35(__ARG_1, __ARG_2, WSubId_36, __ARG_3) +.const 'Sub' WSubId_67 = "WSubId_67" +.const 'Sub' WSubId_68 = "WSubId_68" + $P2 = WSubId_67(__ARG_1, __ARG_2, WSubId_68, __ARG_3) setattribute self, 'args', $P2 -# } -.annotate 'line', 1936 .end # SimpleArgList +.sub 'clone' :method + .param pmc __ARG_1 + new $P1, [ 'Winxed'; 'Compiler'; 'SimpleArgList' ] + getattribute $P2, self, 'args' + set $P3, __ARG_1 +.const 'Sub' WSubId_3 = "WSubId_3" +.const 'Sub' WSubId_5 = "WSubId_5" + set $P4, $P2 + root_new $P5, ['parrot';'ResizablePMCArray'] + $P10 = WSubId_5("clone") + $P6 = WSubId_3($P10, $P3) + if_null $P4, __label_4 + iter $P11, $P4 + set $P11, 0 + __label_3: # for iteration + unless $P11 goto __label_4 + shift $P7, $P11 + $P12 = $P6($P7) + push $P5, $P12 + goto __label_3 + __label_4: # endfor + set $P9, $P5 + goto __label_2 + __label_2: + goto __label_1 + __label_1: + set $P8, $P9 + setattribute $P1, 'args', $P8 + .return($P1) + +.end # clone + + .sub 'numargs' :method -# Body -# { -.annotate 'line', 1940 getattribute $P1, self, 'args' -# predefined elements elements $I1, $P1 .return($I1) -# } -.annotate 'line', 1941 .end # numargs .sub 'getarg' :method .param int __ARG_1 -# Body -# { -.annotate 'line', 1944 -# var args: $P1 getattribute $P1, self, 'args' -.annotate 'line', 1945 $P2 = $P1[__ARG_1] .return($P2) -# } -.annotate 'line', 1946 .end # getarg .sub 'optimizeargs' :method -.const 'Sub' WSubId_37 = "WSubId_37" -# Body -# { -.annotate 'line', 1950 getattribute $P1, self, 'args' - WSubId_37($P1) -# } -.annotate 'line', 1951 + if_null $P1, __label_3 + elements $I1, $P1 + goto __label_2 + __label_3: + null $I1 + __label_2: + null $I2 + __label_6: # for condition + ge $I2, $I1, __label_5 + $P3 = $P1[$I2] + $P2 = $P3.'optimize'() + $P1[$I2] = $P2 + __label_4: # for iteration + inc $I2 + goto __label_6 + __label_5: # for end + __label_1: .end # optimizeargs .sub 'getargvalues' :method .param pmc __ARG_1 -# Body -# { -.annotate 'line', 1954 -# var argreg: $P1 - root_new $P1, ['parrot';'ResizablePMCArray'] -.annotate 'line', 1955 - getattribute $P3, self, 'args' - if_null $P3, __label_2 - iter $P4, $P3 - set $P4, 0 - __label_1: # for iteration - unless $P4 goto __label_2 - shift $P2, $P4 -.annotate 'line', 1956 - $P5 = $P2.'emit_get'(__ARG_1) -# predefined push - push $P1, $P5 +.const 'Sub' WSubId_3 = "WSubId_3" +.const 'Sub' WSubId_5 = "WSubId_5" + getattribute $P1, self, 'args' + root_new $P2, ['parrot';'ResizablePMCArray'] + $P6 = WSubId_5("emit_get") + $P3 = WSubId_3($P6, __ARG_1) + if_null $P1, __label_3 + iter $P7, $P1 + set $P7, 0 + __label_2: # for iteration + unless $P7 goto __label_3 + shift $P4, $P7 + $P8 = $P3($P4) + push $P2, $P8 + goto __label_2 + __label_3: # endfor + set $P5, $P2 goto __label_1 - __label_2: # endfor -.annotate 'line', 1957 - .return($P1) -# } -.annotate 'line', 1958 + __label_1: + set $P6, $P5 + .return($P6) .end # getargvalues .sub 'emitargs' :method .param pmc __ARG_1 -# Body -# { -.annotate 'line', 1961 $P1 = self.'getargvalues'(__ARG_1) -# predefined join join $S1, ', ', $P1 __ARG_1.'print'($S1) -# } -.annotate 'line', 1962 .end # emitargs .sub Winxed_class_init :anon :load :init newclass $P0, [ 'Winxed'; 'Compiler'; 'SimpleArgList' ] -.annotate 'line', 1931 addattribute $P0, 'args' .end .namespace [ 'Winxed'; 'Compiler'; 'Modifier' ] .sub 'getname' :method -# Body -# { -.annotate 'line', 1974 getattribute $P1, self, 'name' .return($P1) -# } .end # getname .sub 'numargs' :method -# Body -# { -.annotate 'line', 1977 -# var args: $P1 getattribute $P1, self, 'args' -.annotate 'line', 1978 -# nargs: $I1 unless_null $P1, __label_2 null $I1 goto __label_1 __label_2: - $I1 = $P1.'numargs'() + $P2 = $P1.'numargs'() + set $I1, $P2 __label_1: -.annotate 'line', 1979 .return($I1) -# } -.annotate 'line', 1980 .end # numargs .sub 'getarg' :method .param int __ARG_1 -.const 'Sub' WSubId_6 = "WSubId_6" -# Body -# { -.annotate 'line', 1983 -# var args: $P1 +.const 'Sub' WSubId_30 = "WSubId_30" getattribute $P1, self, 'args' -.annotate 'line', 1984 $P2 = $P1.'numargs'() set $I1, $P2 lt __ARG_1, $I1, __label_1 -.annotate 'line', 1985 - WSubId_6('Wrong modifier arg number') + WSubId_30('Wrong modifier arg number') __label_1: # endif -.annotate 'line', 1986 .tailcall $P1.'getarg'(__ARG_1) -# } -.annotate 'line', 1987 .end # getarg @@ -5405,88 +4283,57 @@ .sub 'Modifier' :method .param string __ARG_1 .param pmc __ARG_2 -# Body -# { -.annotate 'line', 1990 box $P1, __ARG_1 setattribute self, 'name', $P1 -.annotate 'line', 1991 if_null __ARG_2, __label_1 -.annotate 'line', 1992 setattribute self, 'args', __ARG_2 __label_1: # endif -# } -.annotate 'line', 1993 .end # Modifier .sub 'optimize' :method -# Body -# { -.annotate 'line', 1996 getattribute $P1, self, 'args' if_null $P1, __label_1 -.annotate 'line', 1997 getattribute $P2, self, 'args' $P2.'optimizeargs'() __label_1: # endif -.annotate 'line', 1998 .return(self) -# } -.annotate 'line', 1999 .end # optimize .sub Winxed_class_init :anon :load :init newclass $P0, [ 'Winxed'; 'Compiler'; 'Modifier' ] -.annotate 'line', 1971 addattribute $P0, 'name' -.annotate 'line', 1972 addattribute $P0, 'args' .end .namespace [ 'Winxed'; 'Compiler' ] -.sub 'parseModifier' :subid('WSubId_38') +.sub 'parseModifier' :subid('WSubId_69') .param pmc __ARG_1 .param pmc __ARG_2 -# Body -# { -.annotate 'line', 2004 -# var t: $P1 $P1 = __ARG_1.'get'() -.annotate 'line', 2005 -# name: $S1 $P3 = $P1.'getidentifier'() null $S1 if_null $P3, __label_1 set $S1, $P3 __label_1: -.annotate 'line', 2006 $P1 = __ARG_1.'get'() -.annotate 'line', 2007 -# var args: $P2 null $P2 -.annotate 'line', 2008 $P3 = $P1.'isop'('(') if_null $P3, __label_2 unless $P3 goto __label_2 -.annotate 'line', 2009 new $P4, [ 'Winxed'; 'Compiler'; 'SimpleArgList' ] $P4.'SimpleArgList'(__ARG_1, __ARG_2, ')') set $P2, $P4 goto __label_3 __label_2: # else -.annotate 'line', 2011 __ARG_1.'unget'($P1) __label_3: # endif -.annotate 'line', 2012 new $P4, [ 'Winxed'; 'Compiler'; 'Modifier' ] $P4.'Modifier'($S1, $P2) set $P3, $P4 .return($P3) -# } -.annotate 'line', 2013 .end # parseModifier @@ -5495,48 +4342,46 @@ .sub 'ModifierList' :method .param pmc __ARG_1 .param pmc __ARG_2 -.const 'Sub' WSubId_35 = "WSubId_35" -.const 'Sub' WSubId_38 = "WSubId_38" -# Body -# { -.annotate 'line', 2022 - $P2 = WSubId_35(__ARG_1, __ARG_2, WSubId_38, ']') +.const 'Sub' WSubId_67 = "WSubId_67" +.const 'Sub' WSubId_69 = "WSubId_69" + $P2 = WSubId_67(__ARG_1, __ARG_2, WSubId_69, ']') setattribute self, 'list', $P2 -# } -.annotate 'line', 2023 .end # ModifierList .sub 'optimize' :method -.const 'Sub' WSubId_37 = "WSubId_37" -# Body -# { -.annotate 'line', 2026 getattribute $P1, self, 'list' - WSubId_37($P1) -# } -.annotate 'line', 2027 + if_null $P1, __label_3 + elements $I1, $P1 + goto __label_2 + __label_3: + null $I1 + __label_2: + null $I2 + __label_6: # for condition + ge $I2, $I1, __label_5 + $P3 = $P1[$I2] + $P2 = $P3.'optimize'() + $P1[$I2] = $P2 + __label_4: # for iteration + inc $I2 + goto __label_6 + __label_5: # for end + __label_1: .end # optimize .sub 'getlist' :method -# Body -# { -.annotate 'line', 2028 getattribute $P1, self, 'list' .return($P1) -# } .end # getlist .sub 'pick' :method .param string __ARG_1 -# Body -# { -.annotate 'line', 2031 getattribute $P2, self, 'list' if_null $P2, __label_2 iter $P3, $P2 @@ -5544,402 +4389,311 @@ __label_1: # for iteration unless $P3 goto __label_2 shift $P1, $P3 -# { -.annotate 'line', 2032 $P4 = $P1.'getname'() set $S1, $P4 ne $S1, __ARG_1, __label_3 -.annotate 'line', 2033 .return($P1) __label_3: # endif -# } goto __label_1 __label_2: # endfor null $P2 -.annotate 'line', 2035 .return($P2) -# } -.annotate 'line', 2036 .end # pick .sub Winxed_class_init :anon :load :init newclass $P0, [ 'Winxed'; 'Compiler'; 'ModifierList' ] -.annotate 'line', 2018 addattribute $P0, 'list' .end .namespace [ 'Winxed'; 'Compiler' ] -.sub 'getparrotkey' :subid('WSubId_57') - .param pmc __ARG_1 -# Body -# { -.annotate 'line', 2045 -# s: $S1 -# predefined join - join $S1, "'; '", __ARG_1 -.annotate 'line', 2046 - concat $S2, "[ '", $S1 - concat $S2, $S2, "' ]" - .return($S2) -# } -.annotate 'line', 2047 - -.end # getparrotkey - - -.sub 'getparrotnamespacekey' :subid('WSubId_109') - .param pmc __ARG_1 -# Body -# { -.annotate 'line', 2051 -# predefined elements - elements $I1, __ARG_1 - ne $I1, 0, __label_1 -.annotate 'line', 2052 - .return(".namespace [ ]") - goto __label_2 - __label_1: # else -# { -.annotate 'line', 2054 -# s: $S1 -# predefined join - join $S1, "'; '", __ARG_1 -.annotate 'line', 2055 - concat $S2, ".namespace [ '", $S1 - concat $S2, $S2, "' ]" - .return($S2) -# } - __label_2: # endif -# } -.annotate 'line', 2057 - -.end # getparrotnamespacekey - - -.sub 'parseUsing' :subid('WSubId_42') +.sub 'parseUsing' :subid('WSubId_73') .param pmc __ARG_1 .param pmc __ARG_2 .param pmc __ARG_3 -# Body -# { -.annotate 'line', 2061 -# var taux: $P1 $P1 = __ARG_2.'get'() -# switch-case -.annotate 'line', 2063 - $I1 = $P1.'iskeyword'('extern') + $P2 = $P1.'iskeyword'('extern') + set $I1, $P2 if $I1 goto __label_3 -.annotate 'line', 2065 - $I1 = $P1.'iskeyword'('static') + $P3 = $P1.'iskeyword'('static') + set $I1, $P3 if $I1 goto __label_4 -.annotate 'line', 2067 - $I1 = $P1.'iskeyword'('namespace') + $P4 = $P1.'iskeyword'('namespace') + set $I1, $P4 if $I1 goto __label_5 goto __label_2 __label_3: # case -.annotate 'line', 2064 - new $P3, [ 'Winxed'; 'Compiler'; 'ExternStatement' ] - $P3.'ExternStatement'(__ARG_1, __ARG_2, __ARG_3) - set $P2, $P3 - .return($P2) + new $P6, [ 'Winxed'; 'Compiler'; 'ExternStatement' ] + $P6.'ExternStatement'(__ARG_1, __ARG_2, __ARG_3) + set $P5, $P6 + .return($P5) __label_4: # case -.annotate 'line', 2066 - new $P5, [ 'Winxed'; 'Compiler'; 'StaticStatement' ] - $P5.'StaticStatement'(__ARG_1, __ARG_2, __ARG_3) - set $P4, $P5 - .return($P4) + new $P8, [ 'Winxed'; 'Compiler'; 'StaticStatement' ] + $P8.'StaticStatement'(__ARG_1, __ARG_2, __ARG_3) + set $P7, $P8 + .return($P7) __label_5: # case -.annotate 'line', 2068 - new $P7, [ 'Winxed'; 'Compiler'; 'UsingNamespaceStatement' ] - $P7.'UsingNamespaceStatement'($P1, __ARG_2, __ARG_3) - set $P6, $P7 - .return($P6) + new $P10, [ 'Winxed'; 'Compiler'; 'UsingNamespaceStatement' ] + $P10.'UsingNamespaceStatement'($P1, __ARG_2, __ARG_3) + set $P9, $P10 + .return($P9) __label_2: # default -.annotate 'line', 2070 __ARG_2.'unget'($P1) -.annotate 'line', 2071 - new $P9, [ 'Winxed'; 'Compiler'; 'UsingStatement' ] - $P9.'UsingStatement'(__ARG_1, __ARG_2, __ARG_3) - set $P8, $P9 - .return($P8) + new $P12, [ 'Winxed'; 'Compiler'; 'UsingStatement' ] + $P12.'UsingStatement'(__ARG_1, __ARG_2, __ARG_3) + set $P11, $P12 + .return($P11) __label_1: # switch end -# } -.annotate 'line', 2073 .end # parseUsing -.sub 'parseSig' :subid('WSubId_41') +.sub 'parseSig' :subid('WSubId_72') .param pmc __ARG_1 .param pmc __ARG_2 .param pmc __ARG_3 -.const 'Sub' WSubId_39 = "WSubId_39" -.const 'Sub' WSubId_36 = "WSubId_36" -# Body -# { -.annotate 'line', 2077 -# var params: $P1 - new $P1, [ 'Winxed'; 'Compiler'; 'SigParameterList' ] - $P1.'SigParameterList'(__ARG_2, __ARG_3) -.annotate 'line', 2078 -# var t: $P2 +.const 'Sub' WSubId_70 = "WSubId_70" +.const 'Sub' WSubId_68 = "WSubId_68" + new $P4, [ 'Winxed'; 'Compiler'; 'SigParameterList' ] + $P4.'SigParameterList'(__ARG_2, __ARG_3) + set $P1, $P4 $P2 = __ARG_2.'get'() -.annotate 'line', 2079 $P4 = $P2.'isop'('=') isfalse $I1, $P4 unless $I1 goto __label_1 -.annotate 'line', 2080 - WSubId_39("'='", $P2) + WSubId_70("'='", $P2) __label_1: # endif -.annotate 'line', 2081 -# var expr: $P3 - $P3 = WSubId_36(__ARG_2, __ARG_3) -.annotate 'line', 2082 + $P3 = WSubId_68(__ARG_2, __ARG_3) new $P5, [ 'Winxed'; 'Compiler'; 'MultiAssignStatement' ] $P5.'MultiAssignStatement'(__ARG_1, __ARG_3, $P1, $P3) set $P4, $P5 .return($P4) -# } -.annotate 'line', 2083 .end # parseSig -.sub 'parseStatement' :subid('WSubId_94') +.sub 'parseClassSpecifier' :subid('WSubId_92') .param pmc __ARG_1 .param pmc __ARG_2 -.const 'Sub' WSubId_40 = "WSubId_40" -.const 'Sub' WSubId_41 = "WSubId_41" -.const 'Sub' WSubId_42 = "WSubId_42" -.const 'Sub' WSubId_43 = "WSubId_43" -.const 'Sub' WSubId_44 = "WSubId_44" -.const 'Sub' WSubId_45 = "WSubId_45" -.const 'Sub' WSubId_46 = "WSubId_46" -.const 'Sub' WSubId_47 = "WSubId_47" -.const 'Sub' WSubId_48 = "WSubId_48" -.const 'Sub' WSubId_49 = "WSubId_49" -.const 'Sub' WSubId_50 = "WSubId_50" -.const 'Sub' WSubId_6 = "WSubId_6" -# Body -# { -.annotate 'line', 2087 -# var t: $P1 +.const 'Sub' WSubId_25 = "WSubId_25" $P1 = __ARG_1.'get'() -.annotate 'line', 2088 - $P4 = $P1.'isop'(';') - if_null $P4, __label_1 - unless $P4 goto __label_1 -.annotate 'line', 2089 - new $P5, [ 'Winxed'; 'Compiler'; 'EmptyStatement' ] - .return($P5) + $P2 = $P1.'isstring'() + if_null $P2, __label_1 + unless $P2 goto __label_1 + new $P4, [ 'Winxed'; 'Compiler'; 'ClassSpecifierStr' ] + $P4.'ClassSpecifierStr'(__ARG_2, $P1) + set $P3, $P4 + .return($P3) __label_1: # endif -.annotate 'line', 2090 - $P4 = $P1.'isop'('{') - if_null $P4, __label_2 - unless $P4 goto __label_2 -.annotate 'line', 2091 - new $P6, [ 'Winxed'; 'Compiler'; 'CompoundStatement' ] - $P6.'CompoundStatement'($P1, __ARG_1, __ARG_2) - set $P5, $P6 - .return($P5) + $P2 = $P1.'isop'('[') + if_null $P2, __label_2 + unless $P2 goto __label_2 + new $P4, [ 'Winxed'; 'Compiler'; 'ClassSpecifierParrotKey' ] + $P4.'ClassSpecifierParrotKey'(__ARG_1, __ARG_2, $P1) + set $P3, $P4 + .return($P3) __label_2: # endif -.annotate 'line', 2092 - $P4 = $P1.'isop'('${') - if_null $P4, __label_3 - unless $P4 goto __label_3 -.annotate 'line', 2093 - new $P6, [ 'Winxed'; 'Compiler'; 'PiropStatement' ] - $P6.'PiropStatement'($P1, __ARG_1, __ARG_2) - set $P5, $P6 - .return($P5) + $P2 = $P1.'isidentifier'() + if_null $P2, __label_3 + unless $P2 goto __label_3 + new $P4, [ 'Winxed'; 'Compiler'; 'ClassSpecifierId' ] + $P4.'ClassSpecifierId'(__ARG_1, __ARG_2, $P1) + set $P3, $P4 + .return($P3) __label_3: # endif -.annotate 'line', 2094 - $P4 = $P1.'isop'(':') - if_null $P4, __label_4 - unless $P4 goto __label_4 -# { -.annotate 'line', 2095 -# var open: $P2 - $P2 = __ARG_1.'get'() -.annotate 'line', 2096 - $P4 = $P2.'isop'('(') - isfalse $I1, $P4 + WSubId_25('Invalid class', $P1) + +.end # parseClassSpecifier + + +.sub 'parseStatement' :subid('WSubId_125') + .param pmc __ARG_1 + .param pmc __ARG_2 +.const 'Sub' WSubId_71 = "WSubId_71" +.const 'Sub' WSubId_72 = "WSubId_72" +.const 'Sub' WSubId_73 = "WSubId_73" +.const 'Sub' WSubId_74 = "WSubId_74" +.const 'Sub' WSubId_75 = "WSubId_75" +.const 'Sub' WSubId_76 = "WSubId_76" +.const 'Sub' WSubId_77 = "WSubId_77" +.const 'Sub' WSubId_78 = "WSubId_78" +.const 'Sub' WSubId_79 = "WSubId_79" +.const 'Sub' WSubId_80 = "WSubId_80" +.const 'Sub' WSubId_81 = "WSubId_81" +.const 'Sub' WSubId_82 = "WSubId_82" + $P1 = __ARG_1.'get'() + null $P2 + $P5 = $P1.'isop'(';') + if_null $P5, __label_1 + unless $P5 goto __label_1 + new $P6, [ 'Winxed'; 'Compiler'; 'EmptyStatement' ] + .return($P6) + __label_1: # endif + $P5 = $P1.'isop'('{') + if_null $P5, __label_2 + unless $P5 goto __label_2 + new $P7, [ 'Winxed'; 'Compiler'; 'CompoundStatement' ] + $P7.'CompoundStatement'($P1, __ARG_1, __ARG_2) + set $P6, $P7 + .return($P6) + __label_2: # endif + $P5 = $P1.'isop'('${') + if_null $P5, __label_3 + unless $P5 goto __label_3 + new $P7, [ 'Winxed'; 'Compiler'; 'PiropStatement' ] + $P7.'PiropStatement'($P1, __ARG_1, __ARG_2) + set $P6, $P7 + .return($P6) + __label_3: # endif + $P5 = $P1.'isop'(':') + if_null $P5, __label_4 + unless $P5 goto __label_4 + $P3 = __ARG_1.'get'() + $P5 = $P3.'isop'('(') + isfalse $I1, $P5 unless $I1 goto __label_5 -.annotate 'line', 2097 - WSubId_40("':'", $P1) + WSubId_71("':'", $P1) __label_5: # endif -.annotate 'line', 2098 - .tailcall WSubId_41($P1, __ARG_1, __ARG_2) -# } + .tailcall WSubId_72($P1, __ARG_1, __ARG_2) __label_4: # endif -# switch -.annotate 'line', 2101 - $P4 = $P1.'checkkeyword'() - set $S1, $P4 - set $S2, 'using' - if $S1 == $S2 goto __label_8 - set $S2, 'const' - if $S1 == $S2 goto __label_9 - set $S2, 'volatile' - if $S1 == $S2 goto __label_10 - set $S2, 'var' - if $S1 == $S2 goto __label_11 - set $S2, 'string' - if $S1 == $S2 goto __label_12 - set $S2, 'int' - if $S1 == $S2 goto __label_13 - set $S2, 'float' - if $S1 == $S2 goto __label_14 - set $S2, 'return' - if $S1 == $S2 goto __label_15 - set $S2, 'yield' - if $S1 == $S2 goto __label_16 - set $S2, 'goto' - if $S1 == $S2 goto __label_17 - set $S2, 'if' - if $S1 == $S2 goto __label_18 - set $S2, 'while' - if $S1 == $S2 goto __label_19 - set $S2, 'do' - if $S1 == $S2 goto __label_20 - set $S2, 'continue' - if $S1 == $S2 goto __label_21 - set $S2, 'break' - if $S1 == $S2 goto __label_22 - set $S2, 'switch' - if $S1 == $S2 goto __label_23 - set $S2, 'for' - if $S1 == $S2 goto __label_24 - set $S2, 'throw' - if $S1 == $S2 goto __label_25 - set $S2, 'try' - if $S1 == $S2 goto __label_26 - goto __label_7 + $P5 = $P1.'checkkeyword'() + set $S1, $P5 + if $S1 == 'using' goto __label_8 + if $S1 == 'const' goto __label_9 + if $S1 == 'volatile' goto __label_10 + if $S1 == 'var' goto __label_11 + if $S1 == 'string' goto __label_12 + if $S1 == 'int' goto __label_13 + if $S1 == 'float' goto __label_14 + if $S1 == 'return' goto __label_15 + if $S1 == 'yield' goto __label_16 + if $S1 == 'goto' goto __label_17 + if $S1 == 'if' goto __label_18 + if $S1 == 'while' goto __label_19 + if $S1 == 'do' goto __label_20 + if $S1 == 'continue' goto __label_21 + if $S1 == 'break' goto __label_22 + if $S1 == 'switch' goto __label_23 + if $S1 == 'for' goto __label_24 + if $S1 == 'throw' goto __label_25 + if $S1 == 'try' goto __label_26 + goto __label_6 __label_8: # case -.annotate 'line', 2103 - .tailcall WSubId_42($P1, __ARG_1, __ARG_2) + .tailcall WSubId_73($P1, __ARG_1, __ARG_2) __label_9: # case -.annotate 'line', 2105 - .tailcall WSubId_43($P1, __ARG_1, __ARG_2) - goto __label_6 # break + .tailcall WSubId_74($P1, __ARG_1, __ARG_2) + goto __label_7 # break __label_10: # case -.annotate 'line', 2108 - .tailcall WSubId_44($P1, __ARG_1, __ARG_2) - goto __label_6 # break + .tailcall WSubId_75($P1, __ARG_1, __ARG_2) + goto __label_7 # break __label_11: # case -.annotate 'line', 2111 - .tailcall WSubId_45($P1, __ARG_1, __ARG_2) + $P2 = __ARG_1.'get'() + __ARG_1.'unget'($P2) + $P6 = $P2.'isop'("(") + isfalse $I1, $P6 + unless $I1 goto __label_27 + .tailcall WSubId_76($P1, __ARG_1, __ARG_2) + __label_27: # endif + goto __label_7 # break __label_12: # case -.annotate 'line', 2113 - .tailcall WSubId_46($P1, __ARG_1, __ARG_2) + $P2 = __ARG_1.'get'() + __ARG_1.'unget'($P2) + $P7 = $P2.'isop'("(") + isfalse $I2, $P7 + unless $I2 goto __label_28 + .tailcall WSubId_77($P1, __ARG_1, __ARG_2) + __label_28: # endif + goto __label_7 # break __label_13: # case -.annotate 'line', 2115 - .tailcall WSubId_47($P1, __ARG_1, __ARG_2) + $P2 = __ARG_1.'get'() + __ARG_1.'unget'($P2) + $P8 = $P2.'isop'("(") + isfalse $I3, $P8 + unless $I3 goto __label_29 + .tailcall WSubId_78($P1, __ARG_1, __ARG_2) + __label_29: # endif + goto __label_7 # break __label_14: # case -.annotate 'line', 2117 - .tailcall WSubId_48($P1, __ARG_1, __ARG_2) + $P2 = __ARG_1.'get'() + __ARG_1.'unget'($P2) + $P9 = $P2.'isop'("(") + isfalse $I4, $P9 + unless $I4 goto __label_30 + .tailcall WSubId_79($P1, __ARG_1, __ARG_2) + __label_30: # endif + goto __label_7 # break __label_15: # case -.annotate 'line', 2119 - new $P6, [ 'Winxed'; 'Compiler'; 'ReturnStatement' ] - $P6.'ReturnStatement'($P1, __ARG_1, __ARG_2) - set $P5, $P6 - .return($P5) + .tailcall WSubId_80($P1, __ARG_1, __ARG_2) __label_16: # case -.annotate 'line', 2121 - new $P8, [ 'Winxed'; 'Compiler'; 'YieldStatement' ] - $P8.'YieldStatement'($P1, __ARG_1, __ARG_2) - set $P7, $P8 - .return($P7) + new $P11, [ 'Winxed'; 'Compiler'; 'YieldStatement' ] + $P11.'YieldStatement'($P1, __ARG_1, __ARG_2) + set $P10, $P11 + .return($P10) __label_17: # case -.annotate 'line', 2123 - new $P10, [ 'Winxed'; 'Compiler'; 'GotoStatement' ] - $P10.'GotoStatement'($P1, __ARG_1, __ARG_2) - set $P9, $P10 - .return($P9) + new $P13, [ 'Winxed'; 'Compiler'; 'GotoStatement' ] + $P13.'GotoStatement'($P1, __ARG_1, __ARG_2) + set $P12, $P13 + .return($P12) __label_18: # case -.annotate 'line', 2125 - new $P12, [ 'Winxed'; 'Compiler'; 'IfStatement' ] - $P12.'IfStatement'($P1, __ARG_1, __ARG_2) - set $P11, $P12 - .return($P11) + new $P15, [ 'Winxed'; 'Compiler'; 'IfStatement' ] + $P15.'IfStatement'($P1, __ARG_1, __ARG_2) + set $P14, $P15 + .return($P14) __label_19: # case -.annotate 'line', 2127 - new $P14, [ 'Winxed'; 'Compiler'; 'WhileStatement' ] - $P14.'WhileStatement'($P1, __ARG_1, __ARG_2) - set $P13, $P14 - .return($P13) + new $P17, [ 'Winxed'; 'Compiler'; 'WhileStatement' ] + $P17.'WhileStatement'($P1, __ARG_1, __ARG_2) + set $P16, $P17 + .return($P16) __label_20: # case -.annotate 'line', 2129 - new $P16, [ 'Winxed'; 'Compiler'; 'DoStatement' ] - $P16.'DoStatement'($P1, __ARG_1, __ARG_2) - set $P15, $P16 - .return($P15) + new $P19, [ 'Winxed'; 'Compiler'; 'DoStatement' ] + $P19.'DoStatement'($P1, __ARG_1, __ARG_2) + set $P18, $P19 + .return($P18) __label_21: # case -.annotate 'line', 2131 - new $P18, [ 'Winxed'; 'Compiler'; 'ContinueStatement' ] - $P18.'ContinueStatement'($P1, __ARG_1, __ARG_2) - set $P17, $P18 - .return($P17) + new $P21, [ 'Winxed'; 'Compiler'; 'ContinueStatement' ] + $P21.'ContinueStatement'($P1, __ARG_1, __ARG_2) + set $P20, $P21 + .return($P20) __label_22: # case -.annotate 'line', 2133 - new $P20, [ 'Winxed'; 'Compiler'; 'BreakStatement' ] - $P20.'BreakStatement'($P1, __ARG_1, __ARG_2) - set $P19, $P20 - .return($P19) + new $P23, [ 'Winxed'; 'Compiler'; 'BreakStatement' ] + $P23.'BreakStatement'($P1, __ARG_1, __ARG_2) + set $P22, $P23 + .return($P22) __label_23: # case -.annotate 'line', 2135 - .tailcall WSubId_49($P1, __ARG_1, __ARG_2) + .tailcall WSubId_81($P1, __ARG_1, __ARG_2) __label_24: # case -.annotate 'line', 2137 - .tailcall WSubId_50($P1, __ARG_1, __ARG_2) + .tailcall WSubId_82($P1, __ARG_1, __ARG_2) __label_25: # case -.annotate 'line', 2139 - new $P22, [ 'Winxed'; 'Compiler'; 'ThrowStatement' ] - $P22.'ThrowStatement'($P1, __ARG_1, __ARG_2) - set $P21, $P22 - .return($P21) + new $P25, [ 'Winxed'; 'Compiler'; 'ThrowStatement' ] + $P25.'ThrowStatement'($P1, __ARG_1, __ARG_2) + set $P24, $P25 + .return($P24) __label_26: # case -.annotate 'line', 2141 - new $P24, [ 'Winxed'; 'Compiler'; 'TryStatement' ] - $P24.'TryStatement'($P1, __ARG_1, __ARG_2) - set $P23, $P24 - .return($P23) - __label_7: # default -.annotate 'line', 2143 - $P25 = $P1.'isidentifier'() - if_null $P25, __label_27 - unless $P25 goto __label_27 -# { -.annotate 'line', 2144 -# var t2: $P3 - $P3 = __ARG_1.'get'() -.annotate 'line', 2145 - $P4 = $P3.'isop'(':') - if_null $P4, __label_28 - unless $P4 goto __label_28 -.annotate 'line', 2146 - new $P6, [ 'Winxed'; 'Compiler'; 'LabelStatement' ] - $P6.'LabelStatement'($P1, __ARG_2) + new $P27, [ 'Winxed'; 'Compiler'; 'TryStatement' ] + $P27.'TryStatement'($P1, __ARG_1, __ARG_2) + set $P26, $P27 + .return($P26) + __label_6: # default + __label_7: # switch end + $P5 = $P1.'isidentifier'() + if_null $P5, __label_31 + unless $P5 goto __label_31 + $P4 = __ARG_1.'get'() + $P5 = $P4.'isop'(':') + if_null $P5, __label_32 + unless $P5 goto __label_32 + new $P7, [ 'Winxed'; 'Compiler'; 'LabelStatement' ] + $P7.'LabelStatement'($P1, __ARG_2) + set $P6, $P7 + .return($P6) + __label_32: # endif + __ARG_1.'unget'($P4) + __label_31: # endif + __ARG_1.'unget'($P1) + new $P6, [ 'Winxed'; 'Compiler'; 'ExprStatement' ] + $P6.'ExprStatement'($P1, __ARG_1, __ARG_2) set $P5, $P6 .return($P5) - __label_28: # endif -.annotate 'line', 2147 - __ARG_1.'unget'($P3) -# } - __label_27: # endif -.annotate 'line', 2149 - __ARG_1.'unget'($P1) -.annotate 'line', 2150 - new $P5, [ 'Winxed'; 'Compiler'; 'ExprStatement' ] - $P5.'ExprStatement'($P1, __ARG_1, __ARG_2) - set $P4, $P5 - .return($P4) - __label_6: # switch end -.annotate 'line', 2152 - WSubId_6('parseStatement failure', $P1) -# } -.annotate 'line', 2153 .end # parseStatement @@ -5948,98 +4702,66 @@ .sub 'Statement' :method .param pmc __ARG_1 .param pmc __ARG_2 -# Body -# { -.annotate 'line', 2163 self.'initbase'(__ARG_1, __ARG_2) -# } -.annotate 'line', 2164 .end # Statement .sub 'isempty' :method -# Body -# { -.annotate 'line', 2165 .return(0) -# } .end # isempty +.sub 'allowtailcall' :method + getattribute $P1, self, 'owner' + .tailcall $P1.'allowtailcall'() + +.end # allowtailcall + + .sub 'createreg' :method .param string __ARG_1 -# Body -# { -.annotate 'line', 2168 getattribute $P1, self, 'owner' .tailcall $P1.'createreg'(__ARG_1) -# } -.annotate 'line', 2169 .end # createreg .sub 'tempreg' :method .param string __ARG_1 -# Body -# { -.annotate 'line', 2172 getattribute $P1, self, 'owner' .tailcall $P1.'tempreg'(__ARG_1) -# } -.annotate 'line', 2173 .end # tempreg .sub 'freetemps' :method -# Body -# { -.annotate 'line', 2176 getattribute $P1, self, 'owner' $P1.'freetemps'() -# } -.annotate 'line', 2177 .end # freetemps .sub 'genlabel' :method -# Body -# { -.annotate 'line', 2180 getattribute $P1, self, 'owner' .tailcall $P1.'genlabel'() -# } -.annotate 'line', 2181 .end # genlabel .sub 'getlabel' :method .param pmc __ARG_1 -# Body -# { -.annotate 'line', 2184 getattribute $P1, self, 'owner' .tailcall $P1.'getlabel'(__ARG_1) -# } -.annotate 'line', 2185 .end # getlabel .sub 'createlabel' :method .param pmc __ARG_1 -# Body -# { -.annotate 'line', 2188 getattribute $P1, self, 'owner' .tailcall $P1.'createlabel'(__ARG_1) -# } -.annotate 'line', 2189 .end # createlabel @@ -6048,13 +4770,8 @@ .param pmc __ARG_1 .param string __ARG_2 .param int __ARG_3 :optional -# Body -# { -.annotate 'line', 2192 getattribute $P1, self, 'owner' .tailcall $P1.'createconst'(__ARG_1, __ARG_2, __ARG_3) -# } -.annotate 'line', 2193 .end # createconst @@ -6063,13 +4780,8 @@ .param pmc __ARG_1 .param string __ARG_2 .param int __ARG_3 :optional -# Body -# { -.annotate 'line', 2196 getattribute $P1, self, 'owner' .tailcall $P1.'createvar'(__ARG_1, __ARG_2, __ARG_3) -# } -.annotate 'line', 2197 .end # createvar @@ -6077,13 +4789,8 @@ .sub 'createvarused' :method .param pmc __ARG_1 .param pmc __ARG_2 -# Body -# { -.annotate 'line', 2200 getattribute $P1, self, 'owner' .tailcall $P1.'createvarused'(__ARG_1, __ARG_2) -# } -.annotate 'line', 2201 .end # createvarused @@ -6092,223 +4799,147 @@ .param pmc __ARG_1 .param string __ARG_2 .param string __ARG_3 -# Body -# { -.annotate 'line', 2204 getattribute $P1, self, 'owner' .tailcall $P1.'createvarnamed'(__ARG_1, __ARG_2, __ARG_3) -# } -.annotate 'line', 2205 .end # createvarnamed .sub 'getvar' :method .param pmc __ARG_1 -# Body -# { -.annotate 'line', 2208 getattribute $P1, self, 'owner' .tailcall $P1.'getvar'(__ARG_1) -# } -.annotate 'line', 2209 .end # getvar .sub 'checkclass' :method .param string __ARG_1 -# Body -# { -.annotate 'line', 2212 getattribute $P1, self, 'owner' .tailcall $P1.'checkclass'(__ARG_1) -# } -.annotate 'line', 2213 .end # checkclass .sub 'usenamespace' :method .param pmc __ARG_1 -# Body -# { -.annotate 'line', 2216 getattribute $P1, self, 'owner' $P1.'usenamespace'(__ARG_1) -# } -.annotate 'line', 2217 .end # usenamespace .sub 'getouter' :method -# Body -# { -.annotate 'line', 2224 getattribute $P1, self, 'owner' .tailcall $P1.'getouter'() -# } -.annotate 'line', 2225 .end # getouter .sub 'getcontinuelabel' :method .param pmc __ARG_1 -# Body -# { -.annotate 'line', 2228 getattribute $P1, self, 'owner' .tailcall $P1.'getcontinuelabel'(__ARG_1) -# } -.annotate 'line', 2229 .end # getcontinuelabel .sub 'getbreaklabel' :method .param pmc __ARG_1 -# Body -# { -.annotate 'line', 2232 getattribute $P1, self, 'owner' .tailcall $P1.'getbreaklabel'(__ARG_1) -# } -.annotate 'line', 2233 .end # getbreaklabel .sub 'optimize' :method -.const 'Sub' WSubId_6 = "WSubId_6" -# Body -# { -.annotate 'line', 2236 +.const 'Sub' WSubId_30 = "WSubId_30" getattribute $P1, self, 'start' - WSubId_6('**checking**', $P1) -.annotate 'line', 2238 + WSubId_30('**checking**', $P1) .return(self) -# } -.annotate 'line', 2239 .end # optimize .sub Winxed_class_init :anon :load :init newclass $P0, [ 'Winxed'; 'Compiler'; 'Statement' ] -.annotate 'line', 2159 get_class $P1, [ 'Winxed'; 'Compiler'; 'CommonBase' ] addparent $P0, $P1 .end .namespace [ 'Winxed'; 'Compiler'; 'EmptyStatement' ] .sub 'isempty' :method -# Body -# { -.annotate 'line', 2244 .return(1) -# } .end # isempty +.sub 'clone' :method + .param pmc __ARG_1 + .return(self) + +.end # clone + + .sub 'annotate' :method .param pmc __ARG_1 -.const 'Sub' WSubId_6 = "WSubId_6" -# Body -# { -.annotate 'line', 2247 - WSubId_6('Attempt to annotate empty statement') -# } -.annotate 'line', 2248 +.const 'Sub' WSubId_30 = "WSubId_30" + WSubId_30('Attempt to annotate empty statement') .end # annotate .sub 'optimize' :method -# Body -# { -.annotate 'line', 2249 .return(self) -# } .end # optimize .sub 'emit' :method .param pmc __ARG_1 -# Empty body .end # emit .sub Winxed_class_init :anon :load :init newclass $P0, [ 'Winxed'; 'Compiler'; 'EmptyStatement' ] -.annotate 'line', 2242 get_class $P1, [ 'Winxed'; 'Compiler'; 'Statement' ] addparent $P0, $P1 .end .namespace [ 'Winxed'; 'Compiler'; 'MultiStatementBase' ] .sub 'optimize' :method -# Body -# { -.annotate 'line', 2262 -# var statements: $P1 getattribute $P1, self, 'statements' -.annotate 'line', 2263 -# n: $I1 -# predefined elements elements $I1, $P1 -.annotate 'line', 2264 -# empty: $I2 set $I2, 1 -# for loop -.annotate 'line', 2265 -# i: $I3 null $I3 __label_3: # for condition ge $I3, $I1, __label_2 -# { -.annotate 'line', 2266 -# var st: $P2 $P3 = $P1[$I3] $P2 = $P3.'optimize'() -.annotate 'line', 2267 set $I4, $I2 unless $I4 goto __label_5 $P3 = $P2.'isempty'() isfalse $I4, $P3 __label_5: unless $I4 goto __label_4 -.annotate 'line', 2268 null $I2 __label_4: # endif -.annotate 'line', 2269 $P1[$I3] = $P2 -# } __label_1: # for iteration -.annotate 'line', 2265 inc $I3 goto __label_3 __label_2: # for end -.annotate 'line', 2271 - unless $I2 goto __label_6 -.annotate 'line', 2272 + unless $I2 goto __label_7 new $P3, [ 'Winxed'; 'Compiler'; 'EmptyStatement' ] + goto __label_6 + __label_7: + set $P3, self + __label_6: .return($P3) - goto __label_7 - __label_6: # else -.annotate 'line', 2274 - .return(self) - __label_7: # endif -# } -.annotate 'line', 2275 .end # optimize .sub Winxed_class_init :anon :load :init newclass $P0, [ 'Winxed'; 'Compiler'; 'MultiStatementBase' ] -.annotate 'line', 2258 addattribute $P0, 'statements' .end .namespace [ 'Winxed'; 'Compiler'; 'MultiStatement' ] @@ -6316,143 +4947,117 @@ .sub 'MultiStatement' :method .param pmc __ARG_1 .param pmc __ARG_2 -# Body -# { -.annotate 'line', 2282 -# var statements: $P1 - root_new $P1, ['parrot';'ResizablePMCArray'] - push $P1, __ARG_1 - push $P1, __ARG_2 -.annotate 'line', 2283 - setattribute self, 'statements', $P1 -# } -.annotate 'line', 2284 + root_new $P2, ['parrot';'ResizablePMCArray'] + assign $P2, 2 + $P2[0] = __ARG_1 + $P2[1] = __ARG_2 + setattribute self, 'statements', $P2 .end # MultiStatement +.sub 'clone' :method + .param pmc __ARG_1 + new $P1, [ 'Winxed'; 'Compiler'; 'MultiStatement' ] + getattribute $P2, self, 'statements' + set $P3, __ARG_1 +.const 'Sub' WSubId_3 = "WSubId_3" +.const 'Sub' WSubId_5 = "WSubId_5" + set $P4, $P2 + root_new $P5, ['parrot';'ResizablePMCArray'] + $P10 = WSubId_5("clone") + $P6 = WSubId_3($P10, $P3) + if_null $P4, __label_4 + iter $P11, $P4 + set $P11, 0 + __label_3: # for iteration + unless $P11 goto __label_4 + shift $P7, $P11 + $P12 = $P6($P7) + push $P5, $P12 + goto __label_3 + __label_4: # endfor + set $P9, $P5 + goto __label_2 + __label_2: + goto __label_1 + __label_1: + set $P8, $P9 + setattribute $P1, 'statements', $P8 + .return($P1) + +.end # clone + + .sub 'isempty' :method -# Body -# { -.annotate 'line', 2285 .return(0) -# } .end # isempty .sub 'push' :method .param pmc __ARG_1 -# Body -# { -.annotate 'line', 2288 getattribute $P1, self, 'statements' -# predefined push push $P1, __ARG_1 -.annotate 'line', 2289 .return(self) -# } -.annotate 'line', 2290 .end # push .sub 'emit' :method .param pmc __ARG_1 -.const 'Sub' WSubId_51 = "WSubId_51" -# Body -# { -.annotate 'line', 2293 - getattribute $P1, self, 'statements' - WSubId_51(__ARG_1, $P1) -# } -.annotate 'line', 2294 + set $P1, __ARG_1 + getattribute $P2, self, 'statements' +.const 'Sub' WSubId_3 = "WSubId_3" +.const 'Sub' WSubId_5 = "WSubId_5" + set $P3, $P2 + $P6 = WSubId_5("emit") + $P4 = WSubId_3($P6, $P1) + if_null $P3, __label_4 + iter $P7, $P3 + set $P7, 0 + __label_3: # for iteration + unless $P7 goto __label_4 + shift $P5, $P7 + $P4($P5) + goto __label_3 + __label_4: # endfor + __label_2: + __label_1: .end # emit .sub Winxed_class_init :anon :load :init newclass $P0, [ 'Winxed'; 'Compiler'; 'MultiStatement' ] -.annotate 'line', 2278 get_class $P1, [ 'Winxed'; 'Compiler'; 'MultiStatementBase' ] addparent $P0, $P1 .end .namespace [ 'Winxed'; 'Compiler' ] -.sub 'addtomulti' :subid('WSubId_97') +.sub 'parsePiropArg' :subid('WSubId_83') .param pmc __ARG_1 .param pmc __ARG_2 -# Body -# { -.annotate 'line', 2299 - unless_null __ARG_1, __label_1 -.annotate 'line', 2300 - .return(__ARG_2) - goto __label_2 - __label_1: # else -.annotate 'line', 2301 - isa $I1, __ARG_1, [ 'Winxed'; 'Compiler'; 'MultiStatement' ] - unless $I1 goto __label_3 -.annotate 'line', 2302 - .tailcall __ARG_1.'push'(__ARG_2) - goto __label_4 - __label_3: # else -.annotate 'line', 2304 - new $P2, [ 'Winxed'; 'Compiler'; 'MultiStatement' ] - $P2.'MultiStatement'(__ARG_1, __ARG_2) - set $P1, $P2 - .return($P1) - __label_4: # endif - __label_2: # endif -# } -.annotate 'line', 2305 - -.end # addtomulti - - -.sub 'parsePiropArg' :subid('WSubId_52') - .param pmc __ARG_1 - .param pmc __ARG_2 -.const 'Sub' WSubId_36 = "WSubId_36" -# Body -# { -.annotate 'line', 2313 -# var arg: $P1 +.const 'Sub' WSubId_68 = "WSubId_68" null $P1 -.annotate 'line', 2314 -# var t: $P2 $P2 = __ARG_1.'get'() -.annotate 'line', 2315 $P3 = $P2.'isop'(':') if_null $P3, __label_1 unless $P3 goto __label_1 -# { -.annotate 'line', 2316 $P2 = __ARG_1.'get'() -.annotate 'line', 2317 -# label: $S1 $P3 = $P2.'getidentifier'() null $S1 if_null $P3, __label_3 set $S1, $P3 __label_3: -.annotate 'line', 2318 new $P3, [ 'Winxed'; 'Compiler'; 'Reflabel' ] $P3.'Reflabel'(__ARG_2, $S1) set $P1, $P3 -# } goto __label_2 __label_1: # else -# { -.annotate 'line', 2321 __ARG_1.'unget'($P2) -.annotate 'line', 2322 - $P1 = WSubId_36(__ARG_1, __ARG_2) -# } + $P1 = WSubId_68(__ARG_1, __ARG_2) __label_2: # endif -.annotate 'line', 2324 .return($P1) -# } -.annotate 'line', 2325 .end # parsePiropArg @@ -6462,33 +5067,21 @@ .param pmc __ARG_1 .param pmc __ARG_2 .param pmc __ARG_3 -.const 'Sub' WSubId_35 = "WSubId_35" -.const 'Sub' WSubId_52 = "WSubId_52" -.const 'Sub' WSubId_53 = "WSubId_53" -# Body -# { -.annotate 'line', 2334 +.const 'Sub' WSubId_67 = "WSubId_67" +.const 'Sub' WSubId_83 = "WSubId_83" +.const 'Sub' WSubId_84 = "WSubId_84" self.'Statement'(__ARG_1, __ARG_3) -.annotate 'line', 2335 -# var t: $P1 $P1 = __ARG_2.'get'() -.annotate 'line', 2336 -# dotted: $I1 $P2 = $P1.'isop'('.') set $I1, $P2 -.annotate 'line', 2337 unless $I1 goto __label_1 -.annotate 'line', 2338 $P1 = __ARG_2.'get'() __label_1: # endif -.annotate 'line', 2339 -# opname: $S1 $P2 = $P1.'getidentifier'() null $S1 if_null $P2, __label_2 set $S1, $P2 __label_2: -.annotate 'line', 2340 unless $I1 goto __label_4 set $S2, '.' goto __label_3 @@ -6498,106 +5091,131 @@ concat $S3, $S2, $S1 box $P2, $S3 setattribute self, 'opname', $P2 -.annotate 'line', 2341 $P1 = __ARG_2.'get'() -.annotate 'line', 2342 $P2 = $P1.'isop'('}') isfalse $I2, $P2 unless $I2 goto __label_5 -# { -.annotate 'line', 2343 __ARG_2.'unget'($P1) -.annotate 'line', 2344 - $P3 = WSubId_35(__ARG_2, __ARG_3, WSubId_52, '}') + $P3 = WSubId_67(__ARG_2, __ARG_3, WSubId_83, '}') setattribute self, 'args', $P3 -# } __label_5: # endif -.annotate 'line', 2346 - WSubId_53(';', __ARG_2) -# } -.annotate 'line', 2347 + WSubId_84(';', __ARG_2) .end # PiropStatement -.sub 'optimize' :method -.const 'Sub' WSubId_37 = "WSubId_37" -# Body -# { -.annotate 'line', 2350 - getattribute $P1, self, 'args' - WSubId_37($P1) -.annotate 'line', 2351 - .return(self) -# } -.annotate 'line', 2352 +.sub 'clone' :method + .param pmc __ARG_1 + new $P1, [ 'Winxed'; 'Compiler'; 'PiropStatement' ] + getattribute $P8, self, 'start' + $P1.'Statement'($P8, __ARG_1) + getattribute $P9, self, 'opname' + setattribute $P1, 'opname', $P9 + getattribute $P2, self, 'args' + set $P3, __ARG_1 +.const 'Sub' WSubId_3 = "WSubId_3" +.const 'Sub' WSubId_5 = "WSubId_5" + set $P4, $P2 + root_new $P5, ['parrot';'ResizablePMCArray'] + $P9 = WSubId_5("clone") + $P6 = WSubId_3($P9, $P3) + if_null $P4, __label_4 + iter $P11, $P4 + set $P11, 0 + __label_3: # for iteration + unless $P11 goto __label_4 + shift $P7, $P11 + $P12 = $P6($P7) + push $P5, $P12 + goto __label_3 + __label_4: # endfor + set $P10, $P5 + goto __label_2 + __label_2: + goto __label_1 + __label_1: + set $P8, $P10 + setattribute $P1, 'args', $P8 + .return($P1) -.end # optimize +.end # clone -.sub 'emit' :method - .param pmc __ARG_1 -# Body -# { -.annotate 'line', 2355 -# opname: $S1 - getattribute $P4, self, 'opname' - null $S1 - if_null $P4, __label_1 - set $S1, $P4 +.sub 'optimize' :method + getattribute $P1, self, 'args' + if_null $P1, __label_3 + elements $I1, $P1 + goto __label_2 + __label_3: + null $I1 + __label_2: + null $I2 + __label_6: # for condition + ge $I2, $I1, __label_5 + $P3 = $P1[$I2] + $P2 = $P3.'optimize'() + $P1[$I2] = $P2 + __label_4: # for iteration + inc $I2 + goto __label_6 + __label_5: # for end + __label_1: + .return(self) + +.end # optimize + + +.sub 'emit' :method + .param pmc __ARG_1 +.const 'Sub' WSubId_3 = "WSubId_3" +.const 'Sub' WSubId_5 = "WSubId_5" + getattribute $P6, self, 'opname' + null $S1 + if_null $P6, __label_1 + set $S1, $P6 __label_1: -.annotate 'line', 2356 self.'annotate'(__ARG_1) -.annotate 'line', 2357 + $P6 = __ARG_1.'getDebug'() + if_null $P6, __label_2 + unless $P6 goto __label_2 concat $S2, 'pirop ', $S1 __ARG_1.'comment'($S2) -.annotate 'line', 2358 -# var args: $P1 + __label_2: # endif getattribute $P1, self, 'args' -.annotate 'line', 2359 __ARG_1.'print'(' ') -.annotate 'line', 2360 - unless_null $P1, __label_2 -.annotate 'line', 2361 + unless_null $P1, __label_3 __ARG_1.'say'($S1) - goto __label_3 - __label_2: # else -# { -.annotate 'line', 2363 -# var argreg: $P2 - root_new $P2, ['parrot';'ResizablePMCArray'] -.annotate 'line', 2364 - if_null $P1, __label_5 - iter $P5, $P1 - set $P5, 0 - __label_4: # for iteration - unless $P5 goto __label_5 - shift $P3, $P5 -.annotate 'line', 2365 - $P4 = $P3.'emit_get'(__ARG_1) -# predefined push - push $P2, $P4 goto __label_4 - __label_5: # endfor -.annotate 'line', 2366 -# predefined join - join $S2, ', ', $P2 + __label_3: # else + set $P2, $P1 + root_new $P3, ['parrot';'ResizablePMCArray'] + $P6 = WSubId_5("emit_get") + $P4 = WSubId_3($P6, __ARG_1) + if_null $P2, __label_7 + iter $P8, $P2 + set $P8, 0 + __label_6: # for iteration + unless $P8 goto __label_7 + shift $P5, $P8 + $P9 = $P4($P5) + push $P3, $P9 + goto __label_6 + __label_7: # endfor + set $P7, $P3 + goto __label_5 + __label_5: + set $P6, $P7 + join $S2, ', ', $P6 __ARG_1.'say'($S1, ' ', $S2) -# } - __label_3: # endif -# } -.annotate 'line', 2368 + __label_4: # endif .end # emit .sub Winxed_class_init :anon :load :init newclass $P0, [ 'Winxed'; 'Compiler'; 'PiropStatement' ] -.annotate 'line', 2327 get_class $P1, [ 'Winxed'; 'Compiler'; 'Statement' ] addparent $P0, $P1 -.annotate 'line', 2329 addattribute $P0, 'opname' -.annotate 'line', 2330 addattribute $P0, 'args' .end .namespace [ 'Winxed'; 'Compiler'; 'ExternStatement' ] @@ -6606,70 +5224,44 @@ .param pmc __ARG_1 .param pmc __ARG_2 .param pmc __ARG_3 -.const 'Sub' WSubId_54 = "WSubId_54" -.const 'Sub' WSubId_3 = "WSubId_3" -.const 'Sub' WSubId_53 = "WSubId_53" -.const 'Sub' WSubId_55 = "WSubId_55" -# Body -# { -.annotate 'line', 2380 +.const 'Sub' WSubId_85 = "WSubId_85" +.const 'Sub' WSubId_27 = "WSubId_27" +.const 'Sub' WSubId_84 = "WSubId_84" +.const 'Sub' WSubId_86 = "WSubId_86" self.'Statement'(__ARG_1, __ARG_3) -.annotate 'line', 2381 -# var path: $P1 - $P1 = WSubId_54(__ARG_2) -.annotate 'line', 2382 -# predefined elements + $P1 = WSubId_85(__ARG_2) elements $I1, $P1 - ne $I1, 0, __label_1 -.annotate 'line', 2383 + if $I1 goto __label_1 $P2 = __ARG_2.'get'() - WSubId_3($P2) + WSubId_27($P2) __label_1: # endif -.annotate 'line', 2384 - WSubId_53(';', __ARG_2) -.annotate 'line', 2385 - $P3 = WSubId_55($P1) + WSubId_84(';', __ARG_2) + $P3 = WSubId_86($P1) setattribute self, 'path', $P3 -.annotate 'line', 2386 .return(self) -# } -.annotate 'line', 2387 .end # ExternStatement .sub 'optimize' :method -# Body -# { -.annotate 'line', 2388 .return(self) -# } .end # optimize .sub 'emit' :method .param pmc __ARG_1 -# Body -# { -.annotate 'line', 2391 self.'annotate'(__ARG_1) -.annotate 'line', 2392 getattribute $P1, self, 'path' -# predefined join join $S1, '/', $P1 __ARG_1.'say'(' ', "load_bytecode '", $S1, ".pbc'") -# } -.annotate 'line', 2393 .end # emit .sub Winxed_class_init :anon :load :init newclass $P0, [ 'Winxed'; 'Compiler'; 'ExternStatement' ] -.annotate 'line', 2375 get_class $P1, [ 'Winxed'; 'Compiler'; 'Statement' ] addparent $P0, $P1 -.annotate 'line', 2377 addattribute $P0, 'path' .end .namespace [ 'Winxed'; 'Compiler'; 'StaticStatement' ] @@ -6678,90 +5270,58 @@ .param pmc __ARG_1 .param pmc __ARG_2 .param pmc __ARG_3 -.const 'Sub' WSubId_35 = "WSubId_35" -.const 'Sub' WSubId_56 = "WSubId_56" -# Body -# { -.annotate 'line', 2405 +.const 'Sub' WSubId_67 = "WSubId_67" +.const 'Sub' WSubId_87 = "WSubId_87" self.'Statement'(__ARG_1, __ARG_3) -.annotate 'line', 2406 -# var names: $P1 null $P3 - $P1 = WSubId_35(__ARG_2, $P3, WSubId_56, ';') -.annotate 'line', 2407 + $P1 = WSubId_67(__ARG_2, $P3, WSubId_87, ';') if_null $P1, __label_2 iter $P4, $P1 set $P4, 0 __label_1: # for iteration unless $P4 goto __label_2 shift $P2, $P4 -# { -.annotate 'line', 2408 -# id: $S1 $P3 = self.'generatesubid'() null $S1 if_null $P3, __label_3 set $S1, $P3 __label_3: -.annotate 'line', 2409 self.'createvarnamed'($P2, 'P', $S1) -# } goto __label_1 __label_2: # endfor -.annotate 'line', 2411 setattribute self, 'names', $P1 -# } -.annotate 'line', 2412 .end # StaticStatement .sub 'optimize' :method -# Body -# { -.annotate 'line', 2415 .return(self) -# } -.annotate 'line', 2416 .end # optimize .sub 'emit' :method .param pmc __ARG_1 -# Body -# { -.annotate 'line', 2419 self.'annotate'(__ARG_1) -.annotate 'line', 2420 - getattribute $P3, self, 'names' - if_null $P3, __label_2 - iter $P4, $P3 - set $P4, 0 + getattribute $P2, self, 'names' + if_null $P2, __label_2 + iter $P3, $P2 + set $P3, 0 __label_1: # for iteration - unless $P4 goto __label_2 - shift $P1, $P4 -# { -.annotate 'line', 2421 -# var v: $P2 - $P2 = self.'getvar'($P1) -.annotate 'line', 2422 - $P3 = $P2.'getreg'() - __ARG_1.'say'(".const 'Sub' ", $P3, " = '", $P1, "'") -# } + unless $P3 goto __label_2 + shift $P1, $P3 + $P5 = self.'getvar'($P1) + $P4 = $P5.'getreg'() + __ARG_1.'say'(".const 'Sub' ", $P4, " = '", $P1, "'") goto __label_1 __label_2: # endfor -# } -.annotate 'line', 2424 .end # emit .sub Winxed_class_init :anon :load :init newclass $P0, [ 'Winxed'; 'Compiler'; 'StaticStatement' ] -.annotate 'line', 2400 get_class $P1, [ 'Winxed'; 'Compiler'; 'Statement' ] addparent $P0, $P1 -.annotate 'line', 2402 addattribute $P0, 'names' .end .namespace [ 'Winxed'; 'Compiler'; 'UsingStatement' ] @@ -6770,208 +5330,123 @@ .param pmc __ARG_1 .param pmc __ARG_2 .param pmc __ARG_3 -.const 'Sub' WSubId_54 = "WSubId_54" -.const 'Sub' WSubId_3 = "WSubId_3" -.const 'Sub' WSubId_53 = "WSubId_53" -# Body -# { -.annotate 'line', 2438 +.const 'Sub' WSubId_85 = "WSubId_85" +.const 'Sub' WSubId_27 = "WSubId_27" +.const 'Sub' WSubId_84 = "WSubId_84" self.'Statement'(__ARG_1, __ARG_3) -.annotate 'line', 2439 -# var path: $P1 - $P1 = WSubId_54(__ARG_2) -.annotate 'line', 2440 -# predefined elements + $P1 = WSubId_85(__ARG_2) elements $I1, $P1 - ne $I1, 0, __label_1 -.annotate 'line', 2441 + if $I1 goto __label_1 $P2 = __ARG_2.'get'() - WSubId_3($P2) + WSubId_27($P2) __label_1: # endif -.annotate 'line', 2442 - WSubId_53(';', __ARG_2) -.annotate 'line', 2443 + WSubId_84(';', __ARG_2) setattribute self, 'path', $P1 -# } -.annotate 'line', 2444 .end # UsingStatement .sub 'optimize' :method -# Body -# { -.annotate 'line', 2447 -# var path: $P1 getattribute $P1, self, 'path' -.annotate 'line', 2448 -# var name: $P2 $P2 = $P1[-1] -.annotate 'line', 2450 -# var symbol: $P3 - $P3 = self.'findsymbol'($P1) -# switch-case -.annotate 'line', 2452 + $P3 = self.'scopesearch'($P1, 0) isnull $I1, $P3 if $I1 goto __label_3 -.annotate 'line', 2466 isa $I1, $P3, [ 'Winxed'; 'Compiler'; 'FunctionStatement' ] if $I1 goto __label_4 goto __label_2 __label_3: # case -.annotate 'line', 2453 -# predefined elements elements $I2, $P1 - le $I2, 0, __label_5 -# { -.annotate 'line', 2454 -# var p: $P4 -# predefined clone + unless $I2 goto __label_5 clone $P4, $P1 -.annotate 'line', 2455 $P4.'pop'() -.annotate 'line', 2456 -# var ns: $P5 - $P5 = self.'findns'($P4) -.annotate 'line', 2457 + $P5 = self.'scopesearch'($P4, 1) if_null $P5, __label_6 -# { -.annotate 'line', 2458 $P3 = $P5.'getvar'($P2) -.annotate 'line', 2459 if_null $P3, __label_7 -# { -.annotate 'line', 2460 self.'createvarused'($P2, $P3) -.annotate 'line', 2461 new $P6, [ 'Winxed'; 'Compiler'; 'EmptyStatement' ] .return($P6) -# } __label_7: # endif -# } __label_6: # endif -# } __label_5: # endif goto __label_1 # break __label_4: # case -.annotate 'line', 2467 -# subid: $S1 $P6 = $P3.'makesubid'() null $S1 if_null $P6, __label_8 set $S1, $P6 __label_8: -.annotate 'line', 2468 self.'createvarnamed'($P2, 'P', $S1) -.annotate 'line', 2469 box $P7, $S1 setattribute self, 'subid', $P7 -.annotate 'line', 2470 self.'usesubid'($S1) -.annotate 'line', 2471 .return(self) __label_2: # default __label_1: # switch end -.annotate 'line', 2473 self.'createvar'($P2, 'P') -.annotate 'line', 2474 .return(self) -# } -.annotate 'line', 2475 .end # optimize .sub 'emit' :method .param pmc __ARG_1 -.const 'Sub' WSubId_57 = "WSubId_57" -# Body -# { -.annotate 'line', 2478 -# var path: $P1 getattribute $P1, self, 'path' -.annotate 'line', 2479 -# name: $S1 $S1 = $P1[-1] -.annotate 'line', 2480 -# var vdata: $P2 $P2 = self.'getvar'($S1) -.annotate 'line', 2481 - getattribute $P3, self, 'subid' - unless_null $P3, __label_1 -# { -.annotate 'line', 2482 + getattribute $P4, self, 'subid' + unless_null $P4, __label_1 self.'annotate'(__ARG_1) -.annotate 'line', 2483 -# key: $S2 null $S2 -.annotate 'line', 2484 -# predefined elements elements $I1, $P1 le $I1, 1, __label_2 -# { -.annotate 'line', 2485 $P1.'pop'() -.annotate 'line', 2486 - $P3 = WSubId_57($P1) - set $S2, $P3 -# } + set $P3, $P1 + null $S3 + elements $I1, $P3 + unless $I1 goto __label_4 + join $S4, "'; '", $P3 + concat $S5, "[ '", $S4 + concat $S5, $S5, "' ]" + set $S3, $S5 + __label_4: # endif + set $S2, $S3 + goto __label_3 + __label_3: __label_2: # endif -.annotate 'line', 2488 - $P3 = $P2.'getreg'() - __ARG_1.'emitget_hll_global'($P3, $S1, $S2) -# } + $P4 = $P2.'getreg'() + __ARG_1.'emitget_hll_global'($P4, $S1, $S2) __label_1: # endif -# } -.annotate 'line', 2490 .end # emit .sub Winxed_class_init :anon :load :init newclass $P0, [ 'Winxed'; 'Compiler'; 'UsingStatement' ] -.annotate 'line', 2431 get_class $P1, [ 'Winxed'; 'Compiler'; 'Statement' ] addparent $P0, $P1 -.annotate 'line', 2433 addattribute $P0, 'path' -.annotate 'line', 2434 addattribute $P0, 'subid' .end .namespace [ 'Winxed'; 'Compiler' ] -.sub 'usingNamespace' :subid('WSubId_58') +.sub 'usingNamespace' :subid('WSubId_88') .param pmc __ARG_1 .param pmc __ARG_2 .param pmc __ARG_3 -.const 'Sub' WSubId_54 = "WSubId_54" -.const 'Sub' WSubId_39 = "WSubId_39" -.const 'Sub' WSubId_1 = "WSubId_1" -# Body -# { -.annotate 'line', 2500 -# var nskey: $P1 - $P1 = WSubId_54(__ARG_2) -.annotate 'line', 2501 -# nlems: $I1 -# predefined elements +.const 'Sub' WSubId_85 = "WSubId_85" +.const 'Sub' WSubId_70 = "WSubId_70" +.const 'Sub' WSubId_25 = "WSubId_25" + $P1 = WSubId_85(__ARG_2) elements $I1, $P1 -.annotate 'line', 2502 - ge $I1, 1, __label_1 -.annotate 'line', 2503 - WSubId_39('namespace identifier', __ARG_1) + if $I1 goto __label_1 + WSubId_70('namespace identifier', __ARG_1) __label_1: # endif -.annotate 'line', 2504 -# var nssym: $P2 - $P2 = __ARG_3.'findns'($P1) -.annotate 'line', 2505 + $P2 = __ARG_3.'scopesearch'($P1, 1) unless_null $P2, __label_2 -.annotate 'line', 2506 - WSubId_1('unknow namespace', __ARG_1) + WSubId_25('unknow namespace', __ARG_1) __label_2: # endif -.annotate 'line', 2507 __ARG_3.'usenamespace'($P2) -# } -.annotate 'line', 2508 .end # usingNamespace @@ -6981,42 +5456,28 @@ .param pmc __ARG_1 .param pmc __ARG_2 .param pmc __ARG_3 -.const 'Sub' WSubId_58 = "WSubId_58" -.const 'Sub' WSubId_53 = "WSubId_53" -# Body -# { -.annotate 'line', 2514 +.const 'Sub' WSubId_88 = "WSubId_88" +.const 'Sub' WSubId_84 = "WSubId_84" self.'Statement'(__ARG_2, __ARG_3) -.annotate 'line', 2515 - WSubId_58(__ARG_1, __ARG_2, __ARG_3) -.annotate 'line', 2516 - WSubId_53(';', __ARG_2) -# } -.annotate 'line', 2517 + WSubId_88(__ARG_1, __ARG_2, __ARG_3) + WSubId_84(';', __ARG_2) .end # UsingNamespaceStatement .sub 'optimize' :method -# Body -# { -.annotate 'line', 2520 .return(self) -# } -.annotate 'line', 2521 .end # optimize .sub 'emit' :method .param pmc __ARG_1 -# Empty body .end # emit .sub Winxed_class_init :anon :load :init newclass $P0, [ 'Winxed'; 'Compiler'; 'UsingNamespaceStatement' ] -.annotate 'line', 2510 get_class $P1, [ 'Winxed'; 'Compiler'; 'Statement' ] addparent $P0, $P1 .end @@ -7026,56 +5487,109 @@ .param pmc __ARG_1 .param pmc __ARG_2 .param pmc __ARG_3 -.const 'Sub' WSubId_36 = "WSubId_36" -.const 'Sub' WSubId_53 = "WSubId_53" -# Body -# { -.annotate 'line', 2536 +.const 'Sub' WSubId_68 = "WSubId_68" +.const 'Sub' WSubId_28 = "WSubId_28" self.'Statement'(__ARG_1, __ARG_3) -.annotate 'line', 2537 - $P2 = WSubId_36(__ARG_2, self) - setattribute self, 'expr', $P2 -.annotate 'line', 2538 - WSubId_53(';', __ARG_2) -# } -.annotate 'line', 2539 + root_new $P1, ['parrot';'ResizablePMCArray'] + null $P2 + __label_1: # do + $P3 = WSubId_68(__ARG_2, self) + $P1.'push'($P3) + __label_3: # continue + $P2 = __ARG_2.'get'() + $P4 = $P2.'isop'(',') + if_null $P4, __label_2 + if $P4 goto __label_1 + __label_2: # enddo + WSubId_28(';', $P2) + setattribute self, 'expr', $P1 .end # ExprStatement +.sub 'clone' :method + .param pmc __ARG_1 + new $P1, [ 'Winxed'; 'Compiler'; 'ExprStatement' ] + getattribute $P8, self, 'start' + $P1.'Statement'($P8, __ARG_1) + getattribute $P2, self, 'expr' + set $P3, __ARG_1 +.const 'Sub' WSubId_3 = "WSubId_3" +.const 'Sub' WSubId_5 = "WSubId_5" + set $P4, $P2 + root_new $P5, ['parrot';'ResizablePMCArray'] + $P10 = WSubId_5("clone") + $P6 = WSubId_3($P10, $P3) + if_null $P4, __label_4 + iter $P11, $P4 + set $P11, 0 + __label_3: # for iteration + unless $P11 goto __label_4 + shift $P7, $P11 + $P12 = $P6($P7) + push $P5, $P12 + goto __label_3 + __label_4: # endfor + set $P9, $P5 + goto __label_2 + __label_2: + goto __label_1 + __label_1: + set $P8, $P9 + setattribute $P1, 'expr', $P8 + .return($P1) + +.end # clone + + .sub 'optimize' :method -# Body -# { -.annotate 'line', 2542 - getattribute $P3, self, 'expr' + getattribute $P1, self, 'expr' + if_null $P1, __label_3 + elements $I1, $P1 + goto __label_2 + __label_3: + null $I1 + __label_2: + null $I2 + __label_6: # for condition + ge $I2, $I1, __label_5 + $P3 = $P1[$I2] $P2 = $P3.'optimize'() - setattribute self, 'expr', $P2 -.annotate 'line', 2543 + $P1[$I2] = $P2 + __label_4: # for iteration + inc $I2 + goto __label_6 + __label_5: # for end + __label_1: .return(self) -# } -.annotate 'line', 2544 .end # optimize .sub 'emit' :method .param pmc __ARG_1 -# Body -# { -.annotate 'line', 2547 +.const 'Sub' WSubId_3 = "WSubId_3" +.const 'Sub' WSubId_5 = "WSubId_5" getattribute $P1, self, 'expr' - $P1.'emit'(__ARG_1, '') -# } -.annotate 'line', 2548 + $P4 = WSubId_5("emit_void") + $P2 = WSubId_3($P4, __ARG_1) + if_null $P1, __label_3 + iter $P5, $P1 + set $P5, 0 + __label_2: # for iteration + unless $P5 goto __label_3 + shift $P3, $P5 + $P2($P3) + goto __label_2 + __label_3: # endfor + __label_1: .end # emit .sub Winxed_class_init :anon :load :init newclass $P0, [ 'Winxed'; 'Compiler'; 'ExprStatement' ] -.annotate 'line', 2531 get_class $P1, [ 'Winxed'; 'Compiler'; 'Statement' ] addparent $P0, $P1 -.annotate 'line', 2533 addattribute $P0, 'expr' .end .namespace [ 'Winxed'; 'Compiler'; 'VarData' ] @@ -7085,153 +5599,110 @@ .param pmc __ARG_2 .param pmc __ARG_3 .param int __ARG_4 -# Body -# { -.annotate 'line', 2565 setattribute self, 'type', __ARG_1 -.annotate 'line', 2566 setattribute self, 'reg', __ARG_2 -.annotate 'line', 2567 setattribute self, 'scope', __ARG_3 -.annotate 'line', 2568 box $P1, __ARG_4 setattribute self, 'flags', $P1 -# } -.annotate 'line', 2569 .end # VarData .sub 'setlex' :method .param string __ARG_1 -# Body -# { -.annotate 'line', 2572 box $P1, __ARG_1 setattribute self, 'lexname', $P1 -# } -.annotate 'line', 2573 .end # setlex .sub 'gettype' :method -# Body -# { -.annotate 'line', 2574 getattribute $P1, self, 'type' .return($P1) -# } .end # gettype .sub 'getreg' :method -# Body -# { -.annotate 'line', 2575 getattribute $P1, self, 'reg' .return($P1) -# } .end # getreg .sub 'getscope' :method -# Body -# { -.annotate 'line', 2576 getattribute $P1, self, 'scope' .return($P1) -# } .end # getscope .sub 'getvalue' :method -# Body -# { -.annotate 'line', 2577 getattribute $P1, self, 'value' .return($P1) -# } .end # getvalue .sub 'isconst' :method -# Body -# { -.annotate 'line', 2578 .return(0) -# } .end # isconst .sub 'getlex' :method -# Body -# { -.annotate 'line', 2579 getattribute $P1, self, 'lexname' .return($P1) -# } .end # getlex .sub 'getflags' :method -# Body -# { -.annotate 'line', 2580 getattribute $P1, self, 'flags' .return($P1) -# } .end # getflags + +.sub 'issubid' :method + getattribute $P1, self, 'reg' + isnull $I1, $P1 + not $I1 + unless $I1 goto __label_1 + set $S2, $P1 + substr $S1, $S2, 0, 7 + iseq $I1, $S1, 'WSubId_' + __label_1: + .return($I1) + +.end # issubid + .sub Winxed_class_init :anon :load :init newclass $P0, [ 'Winxed'; 'Compiler'; 'VarData' ] -.annotate 'line', 2557 addattribute $P0, 'type' -.annotate 'line', 2558 addattribute $P0, 'reg' -.annotate 'line', 2559 addattribute $P0, 'scope' -.annotate 'line', 2560 addattribute $P0, 'flags' -.annotate 'line', 2561 addattribute $P0, 'lexname' .end .namespace [ 'Winxed'; 'Compiler'; 'ConstantInternalFail' ] .sub 'ConstantInternalFail' :method .param pmc __ARG_1 -# Body -# { -.annotate 'line', 2588 setattribute self, 'name', __ARG_1 -# } -.annotate 'line', 2589 .end # ConstantInternalFail .sub 'get_string' :method :vtable -.const 'Sub' WSubId_6 = "WSubId_6" -# Body -# { -.annotate 'line', 2592 +.const 'Sub' WSubId_30 = "WSubId_30" getattribute $P1, self, 'name' - WSubId_6('Attempt to use unexpanded constant!!!', $P1) -# } -.annotate 'line', 2593 + WSubId_30('Attempt to use unexpanded constant!!!', $P1) .end # get_string .sub Winxed_class_init :anon :load :init newclass $P0, [ 'Winxed'; 'Compiler'; 'ConstantInternalFail' ] -.annotate 'line', 2585 addattribute $P0, 'name' .end .namespace [ 'Winxed'; 'Compiler'; 'VarData_const' ] @@ -7241,113 +5712,72 @@ .param pmc __ARG_2 .param pmc __ARG_3 .param pmc __ARG_4 -# Body -# { -.annotate 'line', 2602 new $P2, [ 'Winxed'; 'Compiler'; 'ConstantInternalFail' ] $P2.'ConstantInternalFail'(__ARG_2) set $P1, $P2 self.'VarData'(__ARG_1, $P1, __ARG_3, __ARG_4) -# } -.annotate 'line', 2603 .end # VarData_const .sub 'isconst' :method -# Body -# { -.annotate 'line', 2604 .return(1) -# } .end # isconst .sub 'setvalue' :method .param pmc __ARG_1 -.const 'Sub' WSubId_6 = "WSubId_6" -# Body -# { -.annotate 'line', 2607 +.const 'Sub' WSubId_30 = "WSubId_30" getattribute $P1, self, 'value' if_null $P1, __label_1 -.annotate 'line', 2608 - WSubId_6('Attempt change value of constant!!!') + WSubId_30('Attempt change value of constant!!!') __label_1: # endif -.annotate 'line', 2609 setattribute self, 'value', __ARG_1 -# } -.annotate 'line', 2610 .end # setvalue .sub Winxed_class_init :anon :load :init newclass $P0, [ 'Winxed'; 'Compiler'; 'VarData_const' ] -.annotate 'line', 2596 get_class $P1, [ 'Winxed'; 'Compiler'; 'VarData' ] addparent $P0, $P1 -.annotate 'line', 2598 addattribute $P0, 'value' .end .namespace [ 'Winxed'; 'Compiler'; 'VarContainer' ] -.sub 'init' :method :vtable -# Body -# { -.annotate 'line', 2621 +.sub 'VarContainer' :method root_new $P2, ['parrot';'Hash'] setattribute self, 'locals', $P2 -# } -.annotate 'line', 2622 -.end # init +.end # VarContainer .sub 'createvar' :method .param pmc __ARG_1 .param string __ARG_2 .param int __ARG_3 :optional -.const 'Sub' WSubId_1 = "WSubId_1" -# Body -# { -.annotate 'line', 2625 -# var locals: $P1 +.const 'Sub' WSubId_25 = "WSubId_25" getattribute $P1, self, 'locals' -.annotate 'line', 2626 -# sname: $S1 - set $P4, __ARG_1 null $S1 - if_null $P4, __label_1 - set $S1, $P4 + if_null __ARG_1, __label_1 + set $S1, __ARG_1 __label_1: -.annotate 'line', 2627 -# var exist: $P2 $P2 = $P1[$S1] -.annotate 'line', 2628 if_null $P2, __label_2 -.annotate 'line', 2629 concat $S3, "Redeclared '", $S1 concat $S3, $S3, "'" - WSubId_1($S3, __ARG_1) + WSubId_25($S3, __ARG_1) __label_2: # endif -.annotate 'line', 2630 -# reg: $S2 $P4 = self.'createreg'(__ARG_2) null $S2 if_null $P4, __label_3 set $S2, $P4 __label_3: -.annotate 'line', 2631 -# var data: $P3 - new $P3, [ 'Winxed'; 'Compiler'; 'VarData' ] - $P3.'VarData'(__ARG_2, $S2, self, __ARG_3) -.annotate 'line', 2632 + new $P4, [ 'Winxed'; 'Compiler'; 'VarData' ] + $P4.'VarData'(__ARG_2, $S2, self, __ARG_3) + set $P3, $P4 $P1[$S1] = $P3 -.annotate 'line', 2633 .return($P3) -# } -.annotate 'line', 2634 .end # createvar @@ -7355,33 +5785,19 @@ .sub 'createvarused' :method .param pmc __ARG_1 .param pmc __ARG_2 -.const 'Sub' WSubId_1 = "WSubId_1" -# Body -# { -.annotate 'line', 2637 -# var locals: $P1 +.const 'Sub' WSubId_25 = "WSubId_25" getattribute $P1, self, 'locals' -.annotate 'line', 2638 -# sname: $S1 - set $P3, __ARG_1 null $S1 - if_null $P3, __label_1 - set $S1, $P3 + if_null __ARG_1, __label_1 + set $S1, __ARG_1 __label_1: -.annotate 'line', 2639 -# var exist: $P2 $P2 = $P1[$S1] -.annotate 'line', 2640 if_null $P2, __label_2 -.annotate 'line', 2641 concat $S2, "Redeclared '", $S1 concat $S2, $S2, "'" - WSubId_1($S2, __ARG_1) + WSubId_25($S2, __ARG_1) __label_2: # endif -.annotate 'line', 2642 $P1[$S1] = __ARG_2 -# } -.annotate 'line', 2643 .end # createvarused @@ -7390,36 +5806,22 @@ .param pmc __ARG_1 .param string __ARG_2 .param string __ARG_3 -.const 'Sub' WSubId_1 = "WSubId_1" -# Body -# { -.annotate 'line', 2646 -# var locals: $P1 +.const 'Sub' WSubId_25 = "WSubId_25" getattribute $P1, self, 'locals' -.annotate 'line', 2647 -# sname: $S1 - set $P3, __ARG_1 null $S1 - if_null $P3, __label_1 - set $S1, $P3 + if_null __ARG_1, __label_1 + set $S1, __ARG_1 __label_1: -.annotate 'line', 2648 -# var exist: $P2 $P2 = $P1[$S1] -.annotate 'line', 2649 if_null $P2, __label_2 -.annotate 'line', 2650 concat $S2, "Redeclared '", $S1 concat $S2, $S2, "'" - WSubId_1($S2, __ARG_1) + WSubId_25($S2, __ARG_1) __label_2: # endif -.annotate 'line', 2651 new $P4, [ 'Winxed'; 'Compiler'; 'VarData' ] $P4.'VarData'(__ARG_2, __ARG_3, self, 0) set $P3, $P4 $P1[$S1] = $P3 -# } -.annotate 'line', 2652 .end # createvarnamed @@ -7428,69 +5830,40 @@ .param pmc __ARG_1 .param string __ARG_2 .param int __ARG_3 :optional -.const 'Sub' WSubId_1 = "WSubId_1" -# Body -# { -.annotate 'line', 2655 -# var locals: $P1 +.const 'Sub' WSubId_25 = "WSubId_25" getattribute $P1, self, 'locals' -.annotate 'line', 2656 -# sname: $S1 - set $P4, __ARG_1 null $S1 - if_null $P4, __label_1 - set $S1, $P4 + if_null __ARG_1, __label_1 + set $S1, __ARG_1 __label_1: -.annotate 'line', 2657 -# var exist: $P2 $P2 = $P1[$S1] -.annotate 'line', 2658 if_null $P2, __label_2 -.annotate 'line', 2659 concat $S2, "Redeclared '", $S1 concat $S2, $S2, "'" - WSubId_1($S2, __ARG_1) + WSubId_25($S2, __ARG_1) __label_2: # endif -.annotate 'line', 2660 -# var data: $P3 - new $P3, [ 'Winxed'; 'Compiler'; 'VarData_const' ] - $P3.'VarData_const'(__ARG_2, __ARG_1, self, __ARG_3) -.annotate 'line', 2661 + new $P4, [ 'Winxed'; 'Compiler'; 'VarData_const' ] + $P4.'VarData_const'(__ARG_2, __ARG_1, self, __ARG_3) + set $P3, $P4 $P1[$S1] = $P3 -.annotate 'line', 2662 .return($P3) -# } -.annotate 'line', 2663 .end # createconst .sub 'getlocalvar' :method .param pmc __ARG_1 -# Body -# { -.annotate 'line', 2666 -# var locals: $P1 getattribute $P1, self, 'locals' -# predefined string -.annotate 'line', 2667 set $S1, __ARG_1 $P2 = $P1[$S1] .return($P2) -# } -.annotate 'line', 2668 .end # getlocalvar .sub 'getusedvar' :method .param pmc __ARG_1 -# Body -# { -.annotate 'line', 2671 -# var sym: $P1 null $P1 -.annotate 'line', 2672 getattribute $P3, self, 'usednamespaces' if_null $P3, __label_2 iter $P4, $P3 @@ -7498,110 +5871,75 @@ __label_1: # for iteration unless $P4 goto __label_2 shift $P2, $P4 -# { -.annotate 'line', 2673 $P1 = $P2.'getlocalvar'(__ARG_1) if_null $P1, __label_3 -.annotate 'line', 2674 .return($P1) __label_3: # endif -# } goto __label_1 __label_2: # endfor null $P3 -.annotate 'line', 2676 .return($P3) -# } -.annotate 'line', 2677 .end # getusedvar .sub 'getvar' :method .param pmc __ARG_1 -# Body -# { -.annotate 'line', 2680 -# var sym: $P1 null $P1 -.annotate 'line', 2681 $P1 = self.'getlocalvar'(__ARG_1) if_null $P1, __label_1 -.annotate 'line', 2682 .return($P1) __label_1: # endif -.annotate 'line', 2683 $P1 = self.'getusedvar'(__ARG_1) if_null $P1, __label_2 -.annotate 'line', 2684 .return($P1) __label_2: # endif -.annotate 'line', 2685 -# var owner: $P2 getattribute $P2, self, 'owner' -.annotate 'line', 2686 if_null $P2, __label_3 -.annotate 'line', 2687 .tailcall $P2.'getvar'(__ARG_1) __label_3: # endif null $P3 -.annotate 'line', 2688 .return($P3) -# } -.annotate 'line', 2689 .end # getvar .sub 'makelexical' :method .param pmc __ARG_1 -# Body -# { -.annotate 'line', 2692 -# var lexowner: $P1 $P1 = self.'getouter'() -.annotate 'line', 2693 -# lexname: $S1 $P2 = $P1.'createlex'(__ARG_1) null $S1 if_null $P2, __label_1 set $S1, $P2 __label_1: -.annotate 'line', 2694 .return($S1) -# } -.annotate 'line', 2695 .end # makelexical .sub 'makelexicalself' :method -# Body -# { -.annotate 'line', 2698 -# var lexowner: $P1 - set $P1, self -# Constant lexname evaluated at compile time -.annotate 'line', 2700 self.'setlex'('__WLEX_self', 'self') -.annotate 'line', 2701 .return('__WLEX_self') -# } -.annotate 'line', 2702 .end # makelexicalself .sub Winxed_class_init :anon :load :init newclass $P0, [ 'Winxed'; 'Compiler'; 'VarContainer' ] -.annotate 'line', 2616 addattribute $P0, 'locals' -.annotate 'line', 2617 addattribute $P0, 'usednamespaces' .end .namespace [ 'Winxed'; 'Compiler'; 'BlockStatement' ] + +.sub 'BlockStatement' :method + .param pmc __ARG_1 + .param pmc __ARG_2 + self.'Statement'(__ARG_1, __ARG_2) + self.'VarContainer'() + +.end # BlockStatement + .sub Winxed_class_init :anon :load :init newclass $P0, [ 'Winxed'; 'Compiler'; 'BlockStatement' ] -.annotate 'line', 2711 get_class $P1, [ 'Winxed'; 'Compiler'; 'VarContainer' ] addparent $P0, $P1 get_class $P2, [ 'Winxed'; 'Compiler'; 'Statement' ] @@ -7612,254 +5950,253 @@ .sub 'Expr' :method .param pmc __ARG_1 .param pmc __ARG_2 -# Body -# { -.annotate 'line', 2723 self.'initbase'(__ARG_2, __ARG_1) -# } -.annotate 'line', 2724 .end # Expr .sub 'issimple' :method -# Body -# { -.annotate 'line', 2725 .return(0) -# } .end # issimple .sub 'isliteral' :method -# Body -# { -.annotate 'line', 2726 .return(0) -# } .end # isliteral .sub 'isintegerliteral' :method -# Body -# { -.annotate 'line', 2727 .return(0) -# } .end # isintegerliteral +.sub 'isintegerzero' :method + .return(0) + +.end # isintegerzero + + .sub 'isfloatliteral' :method -# Body -# { -.annotate 'line', 2728 .return(0) -# } .end # isfloatliteral .sub 'isstringliteral' :method -# Body -# { -.annotate 'line', 2729 .return(0) -# } .end # isstringliteral .sub 'isidentifier' :method -# Body -# { -.annotate 'line', 2730 .return(0) -# } .end # isidentifier .sub 'isnull' :method -# Body -# { -.annotate 'line', 2731 .return(0) -# } .end # isnull .sub 'hascompilevalue' :method -# Body -# { -.annotate 'line', 2732 .return(0) -# } .end # hascompilevalue .sub 'isnegable' :method -# Body -# { -.annotate 'line', 2733 .return(0) -# } .end # isnegable .sub 'tempreg' :method .param pmc __ARG_1 -# Body -# { -.annotate 'line', 2736 getattribute $P1, self, 'owner' .tailcall $P1.'tempreg'(__ARG_1) -# } -.annotate 'line', 2737 .end # tempreg +.sub 'genlabel' :method + getattribute $P1, self, 'owner' + .tailcall $P1.'genlabel'() + +.end # genlabel + + .sub 'optimize' :method -# Body -# { -.annotate 'line', 2741 .return(self) -# } -.annotate 'line', 2742 .end # optimize .sub 'cantailcall' :method -# Body -# { -.annotate 'line', 2743 .return(0) -# } .end # cantailcall +.sub 'emit_init' :method + .param pmc __ARG_1 + .param string __ARG_2 + self.'emit'(__ARG_1, __ARG_2) + +.end # emit_init + + .sub 'emit_get' :method .param pmc __ARG_1 -# Body -# { -.annotate 'line', 2746 -# type: $S1 - $P1 = self.'checkresult'() + $P2 = self.'checkresult'() + $P1 = self.'tempreg'($P2) null $S1 if_null $P1, __label_1 set $S1, $P1 __label_1: -.annotate 'line', 2747 -# reg: $S2 - ne $S1, 'v', __label_3 - set $S2, '' - goto __label_2 - __label_3: - $S2 = self.'tempreg'($S1) - __label_2: -.annotate 'line', 2748 - self.'emit'(__ARG_1, $S2) -.annotate 'line', 2749 - .return($S2) -# } -.annotate 'line', 2750 + self.'emit'(__ARG_1, $S1) + .return($S1) .end # emit_get -.sub 'emit_get_nonull' :method +.sub 'emit_void' :method .param pmc __ARG_1 -.const 'Sub' WSubId_1 = "WSubId_1" -# Body -# { -.annotate 'line', 2753 - $P1 = self.'isnull'() +.const 'Sub' WSubId_30 = "WSubId_30" + $P1 = self.'checkresult'() + null $S1 if_null $P1, __label_1 - unless $P1 goto __label_1 -.annotate 'line', 2754 - WSubId_1("Invalid 'null' usage", self) - __label_1: # endif -.annotate 'line', 2755 + set $S1, $P1 + __label_1: + null $S2 + if_null $S1, __label_2 + length $I1, $S1 + ne $I1, 1, __label_2 + ord $I1, $S1 + if $I1 == 73 goto __label_4 + if $I1 == 78 goto __label_5 + if $I1 == 83 goto __label_6 + if $I1 == 80 goto __label_7 + goto __label_2 + __label_4: # case + set $S2, "$I0" + goto __label_3 # break + __label_5: # case + set $S2, "$N0" + goto __label_3 # break + __label_6: # case + set $S2, "$S0" + goto __label_3 # break + __label_7: # case + set $S2, "$P0" + goto __label_3 # break + __label_2: # default + concat $S3, "Unexcpected emit_void with type '", $S1 + concat $S3, $S3, "'" + getattribute $P1, self, 'start' + WSubId_30($S3, $P1) + __label_3: # switch end + self.'emit'(__ARG_1, $S2) + +.end # emit_void + + +.sub 'emit_get_nonull' :method + .param pmc __ARG_1 .tailcall self.'emit_get'(__ARG_1) -# } -.annotate 'line', 2756 .end # emit_get_nonull .sub 'emit_getint' :method .param pmc __ARG_1 -# Body -# { -.annotate 'line', 2759 -# reg: $S1 + $P1 = self.'emit_get_nonull'(__ARG_1) null $S1 -.annotate 'line', 2760 + if_null $P1, __label_1 + set $S1, $P1 + __label_1: $P1 = self.'checkresult'() - set $S2, $P1 - ne $S2, 'I', __label_1 -.annotate 'line', 2761 - $P2 = self.'emit_get'(__ARG_1) - set $S1, $P2 - goto __label_2 - __label_1: # else -# { -.annotate 'line', 2763 - $P3 = self.'tempreg'('I') - set $S1, $P3 -.annotate 'line', 2764 - self.'emit'(__ARG_1, $S1) -# } + set $S3, $P1 + eq $S3, 'I', __label_2 + $P2 = self.'tempreg'('I') + null $S2 + if_null $P2, __label_3 + set $S2, $P2 + __label_3: + self.'annotate'(__ARG_1) + __ARG_1.'emitset'($S2, $S1) + set $S1, $S2 __label_2: # endif -.annotate 'line', 2766 .return($S1) -# } -.annotate 'line', 2767 .end # emit_getint +.sub 'emit_getvar' :method + .param pmc __ARG_1 + $P1 = self.'checkresult'() + null $S1 + if_null $P1, __label_1 + set $S1, $P1 + __label_1: + $P1 = self.'emit_get'(__ARG_1) + null $S2 + if_null $P1, __label_2 + set $S2, $P1 + __label_2: + eq $S1, 'P', __label_3 + set $S3, $S2 + $P1 = self.'tempreg'('P') + set $S2, $P1 + __ARG_1.'emitbox'($S2, $S3) + __label_3: # endif + .return($S2) + +.end # emit_getvar + + .sub 'emit_assign_get' :method .param pmc __ARG_1 .param pmc __ARG_2 -.const 'Sub' WSubId_59 = "WSubId_59" -# Body -# { -.annotate 'line', 2770 - WSubId_59(self) -# } -.annotate 'line', 2771 +.const 'Sub' WSubId_89 = "WSubId_89" + WSubId_89(self) .end # emit_assign_get .sub Winxed_class_init :anon :load :init newclass $P0, [ 'Winxed'; 'Compiler'; 'Expr' ] -.annotate 'line', 2719 get_class $P1, [ 'Winxed'; 'Compiler'; 'CommonBase' ] addparent $P0, $P1 .end .namespace [ 'Winxed'; 'Compiler'; 'SimpleExpr' ] .sub 'issimple' :method -# Body -# { -.annotate 'line', 2776 .return(1) -# } .end # issimple .sub Winxed_class_init :anon :load :init newclass $P0, [ 'Winxed'; 'Compiler'; 'SimpleExpr' ] -.annotate 'line', 2774 + get_class $P1, [ 'Winxed'; 'Compiler'; 'Expr' ] + addparent $P0, $P1 +.end +.namespace [ 'Winxed'; 'Compiler'; 'FinalExpr' ] + +.sub 'optimize' :method +.const 'Sub' WSubId_30 = "WSubId_30" + typeof $P1, self + set $S1, $P1 + concat $S2, "misuse of ", $S1 + WSubId_30($S2, self) + +.end # optimize + +.sub Winxed_class_init :anon :load :init + newclass $P0, [ 'Winxed'; 'Compiler'; 'FinalExpr' ] get_class $P1, [ 'Winxed'; 'Compiler'; 'Expr' ] addparent $P0, $P1 .end @@ -7869,196 +6206,117 @@ .param pmc __ARG_1 .param pmc __ARG_2 .param pmc __ARG_3 -.const 'Sub' WSubId_39 = "WSubId_39" -# Body -# { -.annotate 'line', 2786 +.const 'Sub' WSubId_70 = "WSubId_70" self.'Expr'(__ARG_2, __ARG_3) -.annotate 'line', 2787 -# var t: $P1 $P1 = __ARG_1.'get'() -.annotate 'line', 2788 $P2 = $P1.'isop'('(') isfalse $I1, $P2 unless $I1 goto __label_1 -.annotate 'line', 2789 - WSubId_39('anonymous function', $P1) + WSubId_70('anonymous function', $P1) __label_1: # endif -.annotate 'line', 2790 new $P4, [ 'Winxed'; 'Compiler'; 'LocalFunctionStatement' ] $P4.'LocalFunctionStatement'(__ARG_3, __ARG_1, __ARG_2) set $P3, $P4 setattribute self, 'fn', $P3 -# } -.annotate 'line', 2791 .end # FunctionExpr .sub 'checkresult' :method -# Body -# { -.annotate 'line', 2792 .return('P') -# } .end # checkresult .sub 'optimize' :method -# Body -# { -.annotate 'line', 2795 getattribute $P3, self, 'fn' $P2 = $P3.'optimize'() setattribute self, 'fn', $P2 -.annotate 'line', 2796 getattribute $P2, self, 'fn' $P1 = $P2.'getsubid'() self.'usesubid'($P1) -.annotate 'line', 2797 .return(self) -# } -.annotate 'line', 2798 .end # optimize .sub 'emit' :method .param pmc __ARG_1 - .param pmc __ARG_2 -# Body -# { -.annotate 'line', 2801 + .param string __ARG_2 self.'annotate'(__ARG_1) -.annotate 'line', 2802 -# var fn: $P1 getattribute $P1, self, 'fn' -.annotate 'line', 2803 - set $S2, __ARG_2 - eq $S2, '', __label_1 -# { -.annotate 'line', 2804 -# subid: $S1 $P2 = $P1.'getsubid'() null $S1 - if_null $P2, __label_2 + if_null $P2, __label_1 set $S1, $P2 - __label_2: -.annotate 'line', 2805 + __label_1: $P2 = $P1.'needclosure'() - if_null $P2, __label_3 - unless $P2 goto __label_3 -.annotate 'line', 2806 + if_null $P2, __label_2 + unless $P2 goto __label_2 __ARG_1.'emitarg2'('newclosure', __ARG_2, $S1) - goto __label_4 - __label_3: # else -.annotate 'line', 2808 + goto __label_3 + __label_2: # else __ARG_1.'emitset'(__ARG_2, $S1) - __label_4: # endif -# } - __label_1: # endif -# } -.annotate 'line', 2810 + __label_3: # endif .end # emit + +.sub 'emit_void' :method + .param pmc __ARG_1 + +.end # emit_void + .sub Winxed_class_init :anon :load :init newclass $P0, [ 'Winxed'; 'Compiler'; 'FunctionExpr' ] -.annotate 'line', 2781 get_class $P1, [ 'Winxed'; 'Compiler'; 'Expr' ] addparent $P0, $P1 -.annotate 'line', 2783 addattribute $P0, 'fn' .end .namespace [ 'Winxed'; 'Compiler' ] -# Constant CONDisruntime evaluated at compile time -# Constant CONDistrue evaluated at compile time -# Constant CONDisfalse evaluated at compile time .namespace [ 'Winxed'; 'Compiler'; 'Condition' ] .sub 'set' :method .param pmc __ARG_1 -# Body -# { -.annotate 'line', 2825 setattribute self, 'condexpr', __ARG_1 -.annotate 'line', 2826 .return(self) -# } -.annotate 'line', 2827 .end # set .sub 'optimize_condition' :method -# Body -# { -.annotate 'line', 2830 getattribute $P3, self, 'condexpr' $P2 = $P3.'optimize'() setattribute self, 'condexpr', $P2 -# } -.annotate 'line', 2831 .end # optimize_condition .sub 'optimize' :method -# Body -# { -.annotate 'line', 2834 getattribute $P3, self, 'condexpr' $P2 = $P3.'optimize'() setattribute self, 'condexpr', $P2 -.annotate 'line', 2835 .return(self) -# } -.annotate 'line', 2836 .end # optimize .sub 'getvalue' :method -# Body -# { -.annotate 'line', 2839 -# var condexpr: $P1 getattribute $P1, self, 'condexpr' -.annotate 'line', 2840 - $P2 = $P1.'isliteral'() + $P2 = $P1.'isintegerliteral'() if_null $P2, __label_1 unless $P2 goto __label_1 -# { -# switch -.annotate 'line', 2841 - $P3 = $P1.'checkresult'() - set $S1, $P3 - set $S2, 'I' - if $S1 == $S2 goto __label_4 - goto __label_3 - __label_4: # case -.annotate 'line', 2843 -# n: $I1 - $P4 = $P1.'getIntegerValue'() - set $I1, $P4 -.annotate 'line', 2844 - ne $I1, 0, __label_5 -.annotate 'line', 2845 - .return(2) - goto __label_6 - __label_5: # else -.annotate 'line', 2847 - .return(1) - __label_6: # endif - __label_3: # default - __label_2: # switch end -# } + $P3 = $P1.'isintegerzero'() + if_null $P3, __label_3 + unless $P3 goto __label_3 + set $I1, 2 + goto __label_2 + __label_3: + set $I1, 1 + __label_2: + .return($I1) __label_1: # endif -.annotate 'line', 2850 .return(0) -# } -.annotate 'line', 2851 .end # getvalue @@ -8067,61 +6325,43 @@ .param pmc __ARG_1 .param string __ARG_2 .param string __ARG_3 -.const 'Sub' WSubId_6 = "WSubId_6" -# Body -# { -.annotate 'line', 2854 -# var condexpr: $P1 +.const 'Sub' WSubId_30 = "WSubId_30" getattribute $P1, self, 'condexpr' -.annotate 'line', 2856 isa $I1, $P1, [ 'Winxed'; 'Compiler'; 'ComparatorBaseExpr' ] if $I1 goto __label_3 -.annotate 'line', 2857 - isa $I1, $P1, [ 'Winxed'; 'Compiler'; 'NullCheckerExpr' ] + isa $I1, $P1, [ 'Winxed'; 'Compiler'; 'CheckerExpr' ] __label_3: unless $I1 goto __label_1 -.annotate 'line', 2858 $P1.'emit_if'(__ARG_1, __ARG_2) goto __label_2 __label_1: # else -# { -.annotate 'line', 2860 -# reg: $S1 $P2 = $P1.'emit_get'(__ARG_1) null $S1 if_null $P2, __label_4 set $S1, $P2 __label_4: -# switch -.annotate 'line', 2861 $P2 = $P1.'checkresult'() set $S2, $P2 - set $S3, 'S' - if $S2 == $S3 goto __label_7 - set $S3, 'P' - if $S2 == $S3 goto __label_8 - set $S3, 'I' - if $S2 == $S3 goto __label_9 - set $S3, 'N' - if $S2 == $S3 goto __label_10 - goto __label_6 + if_null $S2, __label_5 + length $I1, $S2 + ne $I1, 1, __label_5 + ord $I1, $S2 + if $I1 == 83 goto __label_7 + if $I1 == 80 goto __label_8 + if $I1 == 73 goto __label_9 + if $I1 == 78 goto __label_10 + goto __label_5 __label_7: # case __label_8: # case -.annotate 'line', 2864 __ARG_1.'emitif_null'($S1, __ARG_3) __label_9: # case __label_10: # case -.annotate 'line', 2867 __ARG_1.'emitif'($S1, __ARG_2) - goto __label_5 # break - __label_6: # default -.annotate 'line', 2870 - WSubId_6('Invalid if condition') - __label_5: # switch end -# } + goto __label_6 # break + __label_5: # default + WSubId_30('Invalid if condition') + __label_6: # switch end __label_2: # endif -# } -.annotate 'line', 2873 .end # emit_if @@ -8129,93 +6369,71 @@ .sub 'emit_else' :method .param pmc __ARG_1 .param string __ARG_2 -.const 'Sub' WSubId_6 = "WSubId_6" -# Body -# { -.annotate 'line', 2876 -# var condexpr: $P1 +.const 'Sub' WSubId_30 = "WSubId_30" getattribute $P1, self, 'condexpr' -.annotate 'line', 2878 isa $I1, $P1, [ 'Winxed'; 'Compiler'; 'ComparatorBaseExpr' ] if $I1 goto __label_3 -.annotate 'line', 2879 - isa $I1, $P1, [ 'Winxed'; 'Compiler'; 'NullCheckerExpr' ] + isa $I1, $P1, [ 'Winxed'; 'Compiler'; 'CheckerExpr' ] __label_3: unless $I1 goto __label_1 -.annotate 'line', 2880 $P1.'emit_else'(__ARG_1, __ARG_2) goto __label_2 __label_1: # else -# { -.annotate 'line', 2882 -# reg: $S1 $P2 = $P1.'emit_get'(__ARG_1) null $S1 if_null $P2, __label_4 set $S1, $P2 __label_4: -# switch -.annotate 'line', 2883 $P2 = $P1.'checkresult'() set $S2, $P2 - set $S3, 'S' - if $S2 == $S3 goto __label_7 - set $S3, 'P' - if $S2 == $S3 goto __label_8 - set $S3, 'I' - if $S2 == $S3 goto __label_9 - set $S3, 'N' - if $S2 == $S3 goto __label_10 - goto __label_6 + if_null $S2, __label_5 + length $I1, $S2 + ne $I1, 1, __label_5 + ord $I1, $S2 + if $I1 == 83 goto __label_7 + if $I1 == 80 goto __label_8 + if $I1 == 73 goto __label_9 + if $I1 == 78 goto __label_10 + goto __label_5 __label_7: # case __label_8: # case -.annotate 'line', 2886 __ARG_1.'emitif_null'($S1, __ARG_2) __label_9: # case __label_10: # case -.annotate 'line', 2889 __ARG_1.'emitunless'($S1, __ARG_2) - goto __label_5 # break - __label_6: # default -.annotate 'line', 2892 - WSubId_6('Invalid if condition') - __label_5: # switch end -# } + goto __label_6 # break + __label_5: # default + WSubId_30('Invalid if condition') + __label_6: # switch end __label_2: # endif -# } -.annotate 'line', 2895 .end # emit_else .sub Winxed_class_init :anon :load :init newclass $P0, [ 'Winxed'; 'Compiler'; 'Condition' ] -.annotate 'line', 2822 addattribute $P0, 'condexpr' .end .namespace [ 'Winxed'; 'Compiler'; 'Literal' ] .sub 'isliteral' :method -# Body -# { -.annotate 'line', 2902 .return(1) -# } .end # isliteral .sub 'hascompilevalue' :method -# Body -# { -.annotate 'line', 2903 .return(1) -# } .end # hascompilevalue + +.sub 'emit_void' :method + .param pmc __ARG_1 + +.end # emit_void + .sub Winxed_class_init :anon :load :init newclass $P0, [ 'Winxed'; 'Compiler'; 'Literal' ] -.annotate 'line', 2900 get_class $P1, [ 'Winxed'; 'Compiler'; 'SimpleExpr' ] addparent $P0, $P1 .end @@ -8224,124 +6442,84 @@ .sub 'StringLiteral' :method .param pmc __ARG_1 .param pmc __ARG_2 -# Body -# { -.annotate 'line', 2913 self.'Expr'(__ARG_1, __ARG_2) -.annotate 'line', 2914 setattribute self, 'strval', __ARG_2 -# } -.annotate 'line', 2915 .end # StringLiteral +.sub 'clone' :method + .param pmc __ARG_1 + new $P2, [ 'Winxed'; 'Compiler'; 'StringLiteral' ] + getattribute $P3, self, 'strval' + $P2.'StringLiteral'(__ARG_1, $P3) + set $P1, $P2 + .return($P1) + +.end # clone + + .sub 'isstringliteral' :method -# Body -# { -.annotate 'line', 2916 .return(1) -# } .end # isstringliteral .sub 'checkresult' :method -# Body -# { -.annotate 'line', 2917 .return('S') -# } .end # checkresult .sub 'getPirString' :method -# Body -# { -.annotate 'line', 2920 -# var strtok: $P1 getattribute $P1, self, 'strval' -.annotate 'line', 2921 -# str: $S1 $P2 = $P1.'getPirString'() null $S1 if_null $P2, __label_1 set $S1, $P2 __label_1: -.annotate 'line', 2922 .return($S1) -# } -.annotate 'line', 2923 .end # getPirString .sub 'get_value' :method -# Body -# { -.annotate 'line', 2926 -# var strtok: $P1 getattribute $P1, self, 'strval' -.annotate 'line', 2927 -# str: $S1 getattribute $P2, $P1, 'str' null $S1 if_null $P2, __label_1 set $S1, $P2 __label_1: -.annotate 'line', 2928 isa $I1, $P1, [ 'Winxed'; 'Compiler'; 'TokenQuoted' ] unless $I1 goto __label_2 -.annotate 'line', 2929 -# predefined unescape $P0 = new ['String'] $P0 = $S1 $S1 = $P0.'unescape'('utf8') __label_2: # endif -.annotate 'line', 2930 .return($S1) -# } -.annotate 'line', 2931 .end # get_value .sub 'emit' :method .param pmc __ARG_1 - .param pmc __ARG_2 -# Body -# { -.annotate 'line', 2934 - set $S1, __ARG_2 - eq $S1, '', __label_1 -.annotate 'line', 2935 + .param string __ARG_2 $P1 = self.'getPirString'() __ARG_1.'emitset'(__ARG_2, $P1) - __label_1: # endif -# } -.annotate 'line', 2936 .end # emit .sub 'emit_get' :method .param pmc __ARG_1 -# Body -# { -.annotate 'line', 2939 .tailcall self.'getPirString'() -# } -.annotate 'line', 2940 .end # emit_get .sub Winxed_class_init :anon :load :init newclass $P0, [ 'Winxed'; 'Compiler'; 'StringLiteral' ] -.annotate 'line', 2908 get_class $P1, [ 'Winxed'; 'Compiler'; 'Literal' ] addparent $P0, $P1 -.annotate 'line', 2910 addattribute $P0, 'strval' .end .namespace [ 'Winxed'; 'Compiler'; 'IntegerLiteral' ] @@ -8350,121 +6528,96 @@ .param pmc __ARG_1 .param pmc __ARG_2 .param pmc __ARG_3 -# Body -# { -.annotate 'line', 2951 self.'Expr'(__ARG_1, __ARG_2) -.annotate 'line', 2952 setattribute self, 'pos', __ARG_2 -.annotate 'line', 2953 -# n: $I1 - set $P1, __ARG_3 - set $I1, $P1 -.annotate 'line', 2954 + set $I1, __ARG_3 box $P1, $I1 setattribute self, 'numval', $P1 -# } -.annotate 'line', 2955 .end # IntegerLiteral +.sub 'clone' :method + .param pmc __ARG_1 + new $P2, [ 'Winxed'; 'Compiler'; 'IntegerLiteral' ] + getattribute $P3, self, 'pos' + getattribute $P4, self, 'numval' + $P2.'IntegerLiteral'(__ARG_1, $P3, $P4) + set $P1, $P2 + .return($P1) + +.end # clone + + .sub 'isintegerliteral' :method -# Body -# { -.annotate 'line', 2956 .return(1) -# } .end # isintegerliteral +.sub 'isintegerzero' :method + getattribute $P1, self, 'numval' + set $I2, $P1 + iseq $I1, $I2, 0 + .return($I1) + +.end # isintegerzero + + .sub 'checkresult' :method -# Body -# { -.annotate 'line', 2957 .return('I') -# } .end # checkresult .sub 'getIntegerValue' :method -# Body -# { -.annotate 'line', 2960 getattribute $P1, self, 'numval' .return($P1) -# } -.annotate 'line', 2961 .end # getIntegerValue .sub 'getFloatValue' :method -# Body -# { -.annotate 'line', 2964 -# value: $N1 $P1 = self.'getIntegerValue'() set $N1, $P1 -.annotate 'line', 2965 .return($N1) -# } -.annotate 'line', 2966 .end # getFloatValue .sub 'emit' :method .param pmc __ARG_1 - .param pmc __ARG_2 -# Body -# { -.annotate 'line', 2969 - set $S1, __ARG_2 - eq $S1, '', __label_1 -# { -.annotate 'line', 2970 -# value: $I1 + .param string __ARG_2 $P1 = self.'getIntegerValue'() set $I1, $P1 -.annotate 'line', 2971 - ne $I1, 0, __label_2 -.annotate 'line', 2972 + if $I1 goto __label_1 __ARG_1.'emitnull'(__ARG_2) - goto __label_3 - __label_2: # else -.annotate 'line', 2974 + goto __label_2 + __label_1: # else __ARG_1.'emitset'(__ARG_2, $I1) - __label_3: # endif -# } - __label_1: # endif -# } -.annotate 'line', 2976 + __label_2: # endif .end # emit .sub 'emit_get' :method .param pmc __ARG_1 -# Body -# { -.annotate 'line', 2979 .tailcall self.'getIntegerValue'() -# } -.annotate 'line', 2980 .end # emit_get + +.sub 'emit_getint' :method + .param pmc __ARG_1 + .tailcall self.'getIntegerValue'() + +.end # emit_getint + .sub Winxed_class_init :anon :load :init newclass $P0, [ 'Winxed'; 'Compiler'; 'IntegerLiteral' ] -.annotate 'line', 2945 get_class $P1, [ 'Winxed'; 'Compiler'; 'Literal' ] addparent $P0, $P1 -.annotate 'line', 2947 addattribute $P0, 'pos' -.annotate 'line', 2948 addattribute $P0, 'numval' .end .namespace [ 'Winxed'; 'Compiler'; 'FloatLiteral' ] @@ -8472,502 +6625,500 @@ .sub 'FloatLiteral' :method .param pmc __ARG_1 .param pmc __ARG_2 -# Body -# { -.annotate 'line', 2990 self.'Expr'(__ARG_1, __ARG_2) -.annotate 'line', 2991 setattribute self, 'numval', __ARG_2 -# } -.annotate 'line', 2992 .end # FloatLiteral +.sub 'clone' :method + .param pmc __ARG_1 + new $P2, [ 'Winxed'; 'Compiler'; 'FloatLiteral' ] + getattribute $P3, self, 'numval' + $P2.'FloatLiteral'(__ARG_1, $P3) + set $P1, $P2 + .return($P1) + +.end # clone + + .sub 'isfloatliteral' :method -# Body -# { -.annotate 'line', 2993 .return(1) -# } .end # isfloatliteral .sub 'checkresult' :method -# Body -# { -.annotate 'line', 2994 .return('N') -# } .end # checkresult .sub 'getFloatValue' :method -# Body -# { -.annotate 'line', 2997 -# value: $N1 getattribute $P2, self, 'numval' $P1 = $P2.'getfloatvalue'() set $N1, $P1 -.annotate 'line', 2998 .return($N1) -# } -.annotate 'line', 2999 .end # getFloatValue .sub 'emit' :method .param pmc __ARG_1 - .param pmc __ARG_2 -# Body -# { -.annotate 'line', 3002 - set $S2, __ARG_2 - eq $S2, '', __label_1 -# { -.annotate 'line', 3003 -# n: $S1 + .param string __ARG_2 $P1 = self.'emit_get'(__ARG_1) null $S1 - if_null $P1, __label_2 + if_null $P1, __label_1 set $S1, $P1 - __label_2: -.annotate 'line', 3004 + __label_1: __ARG_1.'emitset'(__ARG_2, $S1) -# } - __label_1: # endif -# } -.annotate 'line', 3006 .end # emit .sub 'emit_get' :method .param pmc __ARG_1 -.const 'Sub' WSubId_60 = "WSubId_60" -# Body -# { -.annotate 'line', 3009 -# value: $N1 +.const 'Sub' WSubId_90 = "WSubId_90" $P1 = self.'getFloatValue'() set $N1, $P1 -.annotate 'line', 3010 - .tailcall WSubId_60($N1) -# } -.annotate 'line', 3011 + .tailcall WSubId_90($N1) .end # emit_get .sub Winxed_class_init :anon :load :init newclass $P0, [ 'Winxed'; 'Compiler'; 'FloatLiteral' ] -.annotate 'line', 2985 get_class $P1, [ 'Winxed'; 'Compiler'; 'Literal' ] addparent $P0, $P1 -.annotate 'line', 2987 addattribute $P0, 'numval' .end -.namespace [ 'Winxed'; 'Compiler'; 'IdentifierExpr' ] +.namespace [ 'Winxed'; 'Compiler' ] -.sub 'isidentifier' :method -# Body -# { -.annotate 'line', 3020 - .return(1) -# } +.sub 'concat_literal' :subid('WSubId_94') + .param pmc __ARG_1 + .param pmc __ARG_2 + getattribute $P1, __ARG_1, 'strval' + getattribute $P2, __ARG_2, 'strval' + $P4 = $P1.'issinglequoted'() + unless $P4 goto __label_3 + $P4 = $P2.'issinglequoted'() + __label_3: + if_null $P4, __label_2 + unless $P4 goto __label_2 + new $P5, [ 'Winxed'; 'Compiler'; 'TokenSingleQuoted' ] + getattribute $P6, $P1, 'file' + getattribute $P7, $P1, 'line' + getattribute $P8, $P1, 'str' + set $S1, $P8 + getattribute $P9, $P2, 'str' + set $S2, $P9 + concat $S3, $S1, $S2 + $P5.'TokenSingleQuoted'($P6, $P7, $S3) + set $P3, $P5 + goto __label_1 + __label_2: + new $P11, [ 'Winxed'; 'Compiler'; 'TokenQuoted' ] + getattribute $P12, $P1, 'file' + getattribute $P13, $P1, 'line' + $P14 = $P1.'getasquoted'() + set $S4, $P14 + $P15 = $P2.'getasquoted'() + set $S5, $P15 + concat $S6, $S4, $S5 + $P11.'TokenQuoted'($P12, $P13, $S6) + set $P10, $P11 + set $P3, $P10 + __label_1: + new $P5, [ 'Winxed'; 'Compiler'; 'StringLiteral' ] + getattribute $P6, __ARG_1, 'owner' + $P5.'StringLiteral'($P6, $P3) + set $P4, $P5 + .return($P4) -.end # isidentifier +.end # concat_literal +.namespace [ 'Winxed'; 'Compiler'; 'FunctionId' ] -.sub 'IdentifierExpr' :method +.sub 'FunctionId' :method .param pmc __ARG_1 .param pmc __ARG_2 -# Body -# { -.annotate 'line', 3023 + .param pmc __ARG_3 + .param string __ARG_4 self.'Expr'(__ARG_1, __ARG_2) -.annotate 'line', 3024 - setattribute self, 'name', __ARG_2 -# } -.annotate 'line', 3025 - -.end # IdentifierExpr + box $P1, __ARG_4 + setattribute self, 'subid', $P1 +.end # FunctionId -.sub 'isnull' :method -# Body -# { -.annotate 'line', 3028 -# var name: $P1 - getattribute $P1, self, 'name' -.annotate 'line', 3029 - getattribute $P3, self, 'owner' - $P2 = $P3.'getvar'($P1) - if_null $P2, __label_1 -.annotate 'line', 3030 - .return(0) - __label_1: # endif -.annotate 'line', 3031 - .tailcall $P1.'iskeyword'('null') -# } -.annotate 'line', 3032 + +.sub 'checkresult' :method + .return('P') + +.end # checkresult + + +.sub 'emit_get' :method + .param pmc __ARG_1 + getattribute $P1, self, 'subid' + .return($P1) + +.end # emit_get + + +.sub 'emit' :method + .param pmc __ARG_1 + .param string __ARG_2 + getattribute $P1, self, 'subid' + __ARG_1.'emitset'(__ARG_2, $P1) + +.end # emit + +.sub Winxed_class_init :anon :load :init + newclass $P0, [ 'Winxed'; 'Compiler'; 'FunctionId' ] + get_class $P1, [ 'Winxed'; 'Compiler'; 'FinalExpr' ] + addparent $P0, $P1 + addattribute $P0, 'subid' +.end +.namespace [ 'Winxed'; 'Compiler'; 'FunctionRef' ] + +.sub 'FunctionRef' :method + .param pmc __ARG_1 + .param pmc __ARG_2 + .param pmc __ARG_3 + self.'Expr'(__ARG_1, __ARG_2) + setattribute self, 'sym', __ARG_3 + +.end # FunctionRef + + +.sub 'checkresult' :method + .return('P') + +.end # checkresult + + +.sub 'emit' :method + .param pmc __ARG_1 + .param string __ARG_2 + getattribute $P1, self, 'sym' + getattribute $P3, $P1, 'owner' + $P2 = $P3.'getpath'() + self.'annotate'(__ARG_1) + getattribute $P3, self, 'owner' + getattribute $P4, $P1, 'name' + $P2.'emit_get_global'(__ARG_1, $P3, __ARG_2, $P4) + +.end # emit + +.sub Winxed_class_init :anon :load :init + newclass $P0, [ 'Winxed'; 'Compiler'; 'FunctionRef' ] + get_class $P1, [ 'Winxed'; 'Compiler'; 'FinalExpr' ] + addparent $P0, $P1 + addattribute $P0, 'sym' +.end +.namespace [ 'Winxed'; 'Compiler'; 'IdentifierExpr' ] + +.sub 'isidentifier' :method + .return(1) + +.end # isidentifier + + +.sub 'IdentifierExpr' :method + .param pmc __ARG_1 + .param pmc __ARG_2 + self.'Expr'(__ARG_1, __ARG_2) + setattribute self, 'name', __ARG_2 + +.end # IdentifierExpr + + +.sub 'clone' :method + .param pmc __ARG_1 + new $P1, [ 'Winxed'; 'Compiler'; 'IdentifierExpr' ] + getattribute $P2, self, 'start' + $P1.'Expr'(__ARG_1, $P2) + getattribute $P3, self, 'name' + setattribute $P1, 'name', $P3 + .return($P1) + +.end # clone + + +.sub 'isnull' :method + getattribute $P1, self, 'name' + getattribute $P3, self, 'owner' + $P2 = $P3.'getvar'($P1) + if_null $P2, __label_1 + .return(0) + __label_1: # endif + .tailcall $P1.'iskeyword'('null') .end # isnull +.sub 'emit_get_nonull' :method + .param pmc __ARG_1 +.const 'Sub' WSubId_25 = "WSubId_25" + $P1 = self.'isnull'() + if_null $P1, __label_1 + unless $P1 goto __label_1 + WSubId_25("Invalid 'null' usage", self) + __label_1: # endif + .tailcall self.'emit_get'(__ARG_1) + +.end # emit_get_nonull + + .sub 'checkresult' :method -# Body -# { -.annotate 'line', 3035 -# var name: $P1 getattribute $P1, self, 'name' -.annotate 'line', 3036 -# var desc: $P2 getattribute $P3, self, 'owner' $P2 = $P3.'getvar'($P1) -.annotate 'line', 3037 if_null $P2, __label_1 -.annotate 'line', 3038 .tailcall $P2.'gettype'() goto __label_2 __label_1: # else -# { -# switch -.annotate 'line', 3040 set $S1, $P1 - set $S2, 'self' - if $S1 == $S2 goto __label_5 - set $S2, 'null' - if $S1 == $S2 goto __label_6 - goto __label_4 + if $S1 == 'self' goto __label_5 + if $S1 == 'null' goto __label_6 + goto __label_3 __label_5: # case __label_6: # case -.annotate 'line', 3043 .return('P') - __label_4: # default -.annotate 'line', 3045 + __label_3: # default .return('') - __label_3: # switch end -# } + __label_4: # switch end __label_2: # endif -# } -.annotate 'line', 3048 .end # checkresult .sub 'getName' :method -# Body -# { -.annotate 'line', 3051 -# s: $S1 getattribute $P1, self, 'name' null $S1 if_null $P1, __label_1 set $S1, $P1 __label_1: -.annotate 'line', 3052 .return($S1) -# } -.annotate 'line', 3053 .end # getName +.sub 'checkVar' :method + getattribute $P1, self, 'owner' + getattribute $P2, self, 'name' + set $S1, $P2 + .tailcall $P1.'getvar'($S1) + +.end # checkVar + + .sub 'checkIdentifier' :method -.const 'Sub' WSubId_6 = "WSubId_6" -# Body -# { -.annotate 'line', 3056 -# var name: $P1 +.const 'Sub' WSubId_30 = "WSubId_30" getattribute $P1, self, 'name' -.annotate 'line', 3057 unless_null $P1, __label_1 -.annotate 'line', 3058 - WSubId_6('Bad thing') + WSubId_30('Bad thing') __label_1: # endif -.annotate 'line', 3059 -# var desc: $P2 getattribute $P3, self, 'owner' $P2 = $P3.'getvar'($P1) -.annotate 'line', 3060 -# s: $S1 null $S1 -.annotate 'line', 3061 unless_null $P2, __label_2 -# { -# switch -.annotate 'line', 3062 set $S2, $P1 - set $S3, 'self' - if $S2 == $S3 goto __label_6 - set $S3, 'null' - if $S2 == $S3 goto __label_7 - goto __label_5 + if $S2 == 'self' goto __label_6 + if $S2 == 'null' goto __label_7 + goto __label_4 __label_6: # case __label_7: # case -.annotate 'line', 3065 set $S1, $P1 - goto __label_4 # break - __label_5: # default -.annotate 'line', 3067 + goto __label_5 # break + __label_4: # default set $S1, '' - __label_4: # switch end -# } + __label_5: # switch end goto __label_3 __label_2: # else -.annotate 'line', 3071 $P3 = $P2.'getreg'() set $S1, $P3 __label_3: # endif -.annotate 'line', 3072 .return($S1) -# } -.annotate 'line', 3073 .end # checkIdentifier .sub 'getIdentifier' :method -.const 'Sub' WSubId_61 = "WSubId_61" -# Body -# { -.annotate 'line', 3076 -# var value: $P1 +.const 'Sub' WSubId_91 = "WSubId_91" $P1 = self.'checkIdentifier'() -.annotate 'line', 3077 set $S1, $P1 ne $S1, '', __label_1 -.annotate 'line', 3078 getattribute $P2, self, 'name' - WSubId_61($P2) + WSubId_91($P2, self) __label_1: # endif -.annotate 'line', 3079 .return($P1) -# } -.annotate 'line', 3080 .end # getIdentifier .sub 'optimize' :method -# Body -# { -.annotate 'line', 3083 -# var name: $P1 getattribute $P1, self, 'name' -.annotate 'line', 3084 -# var desc: $P2 getattribute $P5, self, 'owner' $P2 = $P5.'getvar'($P1) -.annotate 'line', 3085 if_null $P2, __label_1 -# { -.annotate 'line', 3086 $P5 = $P2.'isconst'() if_null $P5, __label_3 unless $P5 goto __label_3 -.annotate 'line', 3087 .tailcall $P2.'getvalue'() __label_3: # endif -.annotate 'line', 3088 -# flags: $I1 $P5 = $P2.'getflags'() set $I1, $P5 -.annotate 'line', 3089 band $I2, $I1, 1 unless $I2 goto __label_4 -# { -.annotate 'line', 3090 band $I3, $I1, 2 unless $I3 goto __label_6 -.annotate 'line', 3091 new $P6, [ 'Winxed'; 'Compiler'; 'LexicalVolatileExpr' ] $P6.'LexicalVolatileExpr'(self, $P2) set $P5, $P6 .return($P5) __label_6: # endif -# } goto __label_5 __label_4: # else -# { -.annotate 'line', 3098 -# var reg: $P3 $P3 = $P2.'getreg'() -.annotate 'line', 3099 isnull $I2, $P3 not $I2 unless $I2 goto __label_8 set $S3, $P3 -# predefined substr substr $S2, $S3, 0, 7 iseq $I2, $S2, 'WSubId_' __label_8: unless $I2 goto __label_7 -.annotate 'line', 3100 -# predefined string - set $S4, $P3 - box $P5, $S4 - setattribute self, 'subid', $P5 + new $P6, [ 'Winxed'; 'Compiler'; 'FunctionId' ] + getattribute $P7, self, 'owner' + getattribute $P8, self, 'start' + $P6.'FunctionId'($P7, $P8, $P1, $P3) + set $P5, $P6 + .return($P5) __label_7: # endif -# } __label_5: # endif -# } goto __label_2 __label_1: # else -# { -.annotate 'line', 3104 -# var sym: $P4 root_new $P5, ['parrot';'ResizablePMCArray'] - push $P5, $P1 - $P4 = self.'findsymbol'($P5) -.annotate 'line', 3105 + assign $P5, 1 + $P5[0] = $P1 + $P4 = self.'scopesearch'($P5, 0) isnull $I2, $P4 - not $I2 - unless $I2 goto __label_10 + if $I2 goto __label_11 isa $I2, $P4, [ 'Winxed'; 'Compiler'; 'FunctionStatement' ] - __label_10: - unless $I2 goto __label_9 -# { -.annotate 'line', 3106 -# id: $S1 - $P5 = $P4.'makesubid'() + if $I2 goto __label_12 + isa $I2, $P4, [ 'Winxed'; 'Compiler'; 'FunctionExtern' ] + if $I2 goto __label_13 + isa $I2, $P4, [ 'Winxed'; 'Compiler'; 'InlineStatement' ] + if $I2 goto __label_14 + goto __label_10 + __label_11: # case + goto __label_9 # break + __label_12: # case + $P5 = $P4.'ismulti'() + isfalse $I3, $P5 + unless $I3 goto __label_15 + $P6 = $P4.'makesubid'() null $S1 - if_null $P5, __label_11 - set $S1, $P5 - __label_11: -.annotate 'line', 3107 - box $P5, $S1 - setattribute self, 'subid', $P5 -.annotate 'line', 3108 + if_null $P6, __label_17 + set $S1, $P6 + __label_17: self.'usesubid'($S1) -.annotate 'line', 3109 getattribute $P5, self, 'owner' $P5.'createvarnamed'($P1, 'P', $S1) -# } - __label_9: # endif -# } + new $P6, [ 'Winxed'; 'Compiler'; 'FunctionId' ] + getattribute $P7, self, 'owner' + getattribute $P8, self, 'start' + $P6.'FunctionId'($P7, $P8, $P1, $S1) + set $P5, $P6 + .return($P5) + goto __label_16 + __label_15: # else + new $P6, [ 'Winxed'; 'Compiler'; 'FunctionRef' ] + getattribute $P7, self, 'owner' + getattribute $P8, self, 'start' + $P6.'FunctionRef'($P7, $P8, $P4) + set $P5, $P6 + .return($P5) + __label_16: # endif + goto __label_9 # break + __label_13: # case + new $P10, [ 'Winxed'; 'Compiler'; 'FunctionRef' ] + getattribute $P11, self, 'owner' + getattribute $P12, self, 'start' + $P10.'FunctionRef'($P11, $P12, $P4) + set $P9, $P10 + .return($P9) + __label_14: # case + new $P14, [ 'Winxed'; 'Compiler'; 'InlineRef' ] + getattribute $P15, self, 'owner' + getattribute $P16, self, 'start' + $P14.'InlineRef'($P15, $P16, $P4) + set $P13, $P14 + .return($P13) + __label_10: # default + __label_9: # switch end __label_2: # endif -.annotate 'line', 3112 .return(self) -# } -.annotate 'line', 3113 .end # optimize -.sub 'emit_getid' :method +.sub 'emit' :method .param pmc __ARG_1 -# Body -# { -.annotate 'line', 3116 -# id: $S1 + .param string __ARG_2 + $P1 = self.'emit_get'(__ARG_1) null $S1 -.annotate 'line', 3117 - getattribute $P2, self, 'subid' - if_null $P2, __label_1 -.annotate 'line', 3118 - getattribute $P3, self, 'subid' - set $S1, $P3 - goto __label_2 - __label_1: # else -# { -.annotate 'line', 3120 - $P4 = self.'getIdentifier'() - set $S1, $P4 -.annotate 'line', 3121 -# var desc: $P1 + if_null $P1, __label_1 + set $S1, $P1 + __label_1: + self.'annotate'(__ARG_1) + __ARG_1.'emitset'(__ARG_2, $S1) + +.end # emit + + +.sub 'emit_void' :method + .param pmc __ARG_1 + +.end # emit_void + + +.sub 'emit_get' :method + .param pmc __ARG_1 + null $S1 + $P2 = self.'getIdentifier'() + set $S1, $P2 getattribute $P2, self, 'owner' getattribute $P3, self, 'name' $P1 = $P2.'getvar'($P3) -.annotate 'line', 3122 -# flags: $I1 - unless_null $P1, __label_4 + unless_null $P1, __label_2 null $I1 - goto __label_3 - __label_4: - $I1 = $P1.'getflags'() - __label_3: -.annotate 'line', 3123 + goto __label_1 + __label_2: + $P2 = $P1.'getflags'() + set $I1, $P2 + __label_1: band $I2, $I1, 1 - unless $I2 goto __label_5 -# { -.annotate 'line', 3124 + unless $I2 goto __label_3 band $I3, $I1, 2 - unless $I3 goto __label_6 -# { -.annotate 'line', 3125 -# lexname: $S2 + unless $I3 goto __label_4 $P2 = $P1.'getlex'() null $S2 - if_null $P2, __label_7 + if_null $P2, __label_5 set $S2, $P2 - __label_7: -.annotate 'line', 3126 + __label_5: isnull $I2, $S2 not $I2 - unless $I2 goto __label_9 + unless $I2 goto __label_7 isne $I2, $S2, '' - __label_9: - unless $I2 goto __label_8 -.annotate 'line', 3127 - __ARG_1.'emitfind_lex'($S1, $S2) - __label_8: # endif -# } + __label_7: + unless $I2 goto __label_6 + self.'annotate'(__ARG_1) __label_6: # endif -# } - __label_5: # endif -# } - __label_2: # endif -.annotate 'line', 3131 + __ARG_1.'emitfind_lex'($S1, $S2) + __label_4: # endif + __label_3: # endif .return($S1) -# } -.annotate 'line', 3132 - -.end # emit_getid - - -.sub 'emit' :method - .param pmc __ARG_1 - .param pmc __ARG_2 -# Body -# { -.annotate 'line', 3135 - set $S2, __ARG_2 - eq $S2, '', __label_1 -# { -.annotate 'line', 3136 - self.'annotate'(__ARG_1) -.annotate 'line', 3137 -# id: $S1 - $P1 = self.'emit_getid'(__ARG_1) - null $S1 - if_null $P1, __label_2 - set $S1, $P1 - __label_2: -.annotate 'line', 3138 - __ARG_1.'emitset'(__ARG_2, $S1) -# } - __label_1: # endif -# } -.annotate 'line', 3140 - -.end # emit - - -.sub 'emit_get' :method - .param pmc __ARG_1 -# Body -# { -.annotate 'line', 3143 - self.'annotate'(__ARG_1) -.annotate 'line', 3144 - .tailcall self.'emit_getid'(__ARG_1) -# } -.annotate 'line', 3145 .end # emit_get @@ -8975,177 +7126,116 @@ .sub 'emit_assign_get' :method .param pmc __ARG_1 .param pmc __ARG_2 -.const 'Sub' WSubId_1 = "WSubId_1" -# Body -# { -.annotate 'line', 3148 +.const 'Sub' WSubId_25 = "WSubId_25" self.'annotate'(__ARG_1) -.annotate 'line', 3149 $P1 = self.'isnull'() if_null $P1, __label_1 unless $P1 goto __label_1 -.annotate 'line', 3150 - WSubId_1("Cannot assign to null", self) + WSubId_25("Cannot assign to null", self) __label_1: # endif -.annotate 'line', 3151 -# typeleft: $S1 $P1 = self.'checkresult'() null $S1 if_null $P1, __label_2 set $S1, $P1 __label_2: -.annotate 'line', 3152 -# lreg: $S2 $P1 = self.'getIdentifier'() null $S2 if_null $P1, __label_3 set $S2, $P1 __label_3: -.annotate 'line', 3153 $P1 = __ARG_2.'isnull'() if_null $P1, __label_4 unless $P1 goto __label_4 -# { -# switch -.annotate 'line', 3154 - set $S5, $S1 - set $S6, 'S' - if $S5 == $S6 goto __label_8 - set $S6, 'P' - if $S5 == $S6 goto __label_9 - goto __label_7 + if_null $S1, __label_6 + length $I1, $S1 + ne $I1, 1, __label_6 + ord $I1, $S1 + if $I1 == 83 goto __label_8 + if $I1 == 80 goto __label_9 + goto __label_6 __label_8: # case __label_9: # case -.annotate 'line', 3157 __ARG_1.'emitnull'($S2) - goto __label_6 # break - __label_7: # default -.annotate 'line', 3160 - WSubId_1("Can't assign null to that type", self) - __label_6: # switch end -# } + goto __label_7 # break + __label_6: # default + WSubId_25("Can't assign null to that type", self) + __label_7: # switch end goto __label_5 __label_4: # else -.annotate 'line', 3163 isa $I1, __ARG_2, [ 'Winxed'; 'Compiler'; 'IndexExpr' ] unless $I1 goto __label_10 -.annotate 'line', 3164 __ARG_2.'emit'(__ARG_1, $S2) goto __label_11 __label_10: # else -# { -.annotate 'line', 3166 -# typeright: $S3 $P1 = __ARG_2.'checkresult'() null $S3 if_null $P1, __label_12 set $S3, $P1 __label_12: -.annotate 'line', 3167 ne $S3, 'v', __label_13 -.annotate 'line', 3168 - WSubId_1("Can't assign from void expression", self) + WSubId_25("Can't assign from void expression", self) __label_13: # endif -.annotate 'line', 3169 ne $S1, $S3, __label_14 -# { -.annotate 'line', 3170 __ARG_2.'emit'(__ARG_1, $S2) -# } goto __label_15 __label_14: # else -# { -.annotate 'line', 3173 -# rreg: $S4 $P1 = __ARG_2.'emit_get'(__ARG_1) null $S4 if_null $P1, __label_16 set $S4, $P1 __label_16: -.annotate 'line', 3174 self.'annotate'(__ARG_1) -.annotate 'line', 3175 iseq $I1, $S1, 'P' unless $I1 goto __label_19 isne $I1, $S3, 'P' __label_19: unless $I1 goto __label_17 -.annotate 'line', 3176 __ARG_1.'emitbox'($S2, $S4) goto __label_18 __label_17: # else -.annotate 'line', 3178 __ARG_1.'emitset'($S2, $S4) __label_18: # endif -# } __label_15: # endif -# } __label_11: # endif __label_5: # endif -.annotate 'line', 3181 .return($S2) -# } -.annotate 'line', 3182 .end # emit_assign_get .sub Winxed_class_init :anon :load :init newclass $P0, [ 'Winxed'; 'Compiler'; 'IdentifierExpr' ] -.annotate 'line', 3016 get_class $P1, [ 'Winxed'; 'Compiler'; 'SimpleExpr' ] addparent $P0, $P1 -.annotate 'line', 3018 addattribute $P0, 'name' -.annotate 'line', 3019 - addattribute $P0, 'subid' .end .namespace [ 'Winxed'; 'Compiler'; 'LexicalVolatileExpr' ] .sub 'LexicalVolatileExpr' :method .param pmc __ARG_1 .param pmc __ARG_2 -# Body -# { -.annotate 'line', 3192 getattribute $P1, __ARG_1, 'owner' getattribute $P2, __ARG_1, 'start' self.'Expr'($P1, $P2) -.annotate 'line', 3193 setattribute self, 'desc', __ARG_2 -# } -.annotate 'line', 3194 .end # LexicalVolatileExpr .sub 'checkresult' :method -# Body -# { -.annotate 'line', 3197 getattribute $P1, self, 'desc' .tailcall $P1.'gettype'() -# } -.annotate 'line', 3198 .end # checkresult .sub 'emit_get' :method .param pmc __ARG_1 -# Body -# { -.annotate 'line', 3201 -# var desc: $P1 getattribute $P1, self, 'desc' -.annotate 'line', 3202 -# lexname: $S1 $P2 = $P1.'getlex'() null $S1 if_null $P2, __label_1 set $S1, $P2 __label_1: -.annotate 'line', 3203 -# reg: $S2 getattribute $P3, self, 'owner' $P4 = $P1.'gettype'() $P2 = $P3.'tempreg'($P4) @@ -9153,40 +7243,22 @@ if_null $P2, __label_2 set $S2, $P2 __label_2: -.annotate 'line', 3204 __ARG_1.'emitfind_lex'($S2, $S1) -.annotate 'line', 3205 .return($S2) -# } -.annotate 'line', 3206 .end # emit_get .sub 'emit' :method .param pmc __ARG_1 - .param pmc __ARG_2 -# Body -# { -.annotate 'line', 3209 - set $S2, __ARG_2 - eq $S2, '', __label_1 -# { -.annotate 'line', 3210 + .param string __ARG_2 self.'annotate'(__ARG_1) -.annotate 'line', 3211 -# reg: $S1 $P1 = self.'emit_get'(__ARG_1) null $S1 - if_null $P1, __label_2 + if_null $P1, __label_1 set $S1, $P1 - __label_2: -.annotate 'line', 3212 + __label_1: __ARG_1.'emitset'(__ARG_2, $S1) -# } - __label_1: # endif -# } -.annotate 'line', 3214 .end # emit @@ -9194,81 +7266,52 @@ .sub 'emit_assign_get' :method .param pmc __ARG_1 .param pmc __ARG_2 -# Body -# { -.annotate 'line', 3217 -# var desc: $P1 - getattribute $P1, self, 'desc' -.annotate 'line', 3218 -# typelex: $S1 - $P2 = $P1.'gettype'() + getattribute $P1, self, 'owner' + getattribute $P2, self, 'desc' + $P3 = $P2.'gettype'() null $S1 - if_null $P2, __label_1 - set $S1, $P2 + if_null $P3, __label_1 + set $S1, $P3 __label_1: -.annotate 'line', 3219 -# lreg: $S2 - getattribute $P3, self, 'owner' - $P4 = $P1.'gettype'() - $P2 = $P3.'tempreg'($P4) null $S2 - if_null $P2, __label_2 - set $S2, $P2 - __label_2: -# switch-case -.annotate 'line', 3221 - $I1 = __ARG_2.'isnull'() - if $I1 goto __label_5 -.annotate 'line', 3224 + $P3 = __ARG_2.'isnull'() + set $I1, $P3 + if $I1 goto __label_4 isa $I1, __ARG_2, [ 'Winxed'; 'Compiler'; 'IndexExpr' ] - if $I1 goto __label_6 - goto __label_4 - __label_5: # case -.annotate 'line', 3222 + if $I1 goto __label_5 + goto __label_3 + __label_4: # case + $P4 = $P1.'tempreg'($S1) + set $S2, $P4 __ARG_1.'emitnull'($S2) - goto __label_3 # break - __label_6: # case -.annotate 'line', 3225 - __ARG_2.'emit'(__ARG_1, $S2) - goto __label_3 # break - __label_4: # default -.annotate 'line', 3228 -# typeright: $S3 - $P2 = __ARG_2.'checkresult'() - null $S3 - if_null $P2, __label_7 - set $S3, $P2 - __label_7: -.annotate 'line', 3229 - iseq $I2, $S1, $S3 - if $I2 goto __label_10 - isne $I2, $S1, 'P' - __label_10: - unless $I2 goto __label_8 -.annotate 'line', 3230 + goto __label_2 # break + __label_5: # case + $P5 = $P1.'tempreg'($S1) + set $S2, $P5 __ARG_2.'emit'(__ARG_1, $S2) + goto __label_2 # break + __label_3: # default + ne $S1, 'P', __label_6 + $P6 = __ARG_2.'emit_getvar'(__ARG_1) + set $S2, $P6 + goto __label_7 + __label_6: # else + $P7 = __ARG_2.'checkresult'() + set $S3, $P7 + ne $S1, $S3, __label_8 + $P8 = __ARG_2.'emit_get'(__ARG_1) + set $S2, $P8 goto __label_9 __label_8: # else -# { -.annotate 'line', 3232 -# rreg: $S4 - $P3 = __ARG_2.'emit_get'(__ARG_1) - null $S4 - if_null $P3, __label_11 - set $S4, $P3 - __label_11: -.annotate 'line', 3233 - self.'annotate'(__ARG_1) -.annotate 'line', 3234 - __ARG_1.'emitbox'($S2, $S4) -# } + $P9 = $P1.'tempreg'($S1) + set $S2, $P9 + __ARG_2.'emit'(__ARG_1, $S2) __label_9: # endif - __label_3: # switch end -.annotate 'line', 3238 - $P2 = $P1.'getlex'() - __ARG_1.'emitstore_lex'($P2, $S2) -# } -.annotate 'line', 3239 + __label_7: # endif + __label_2: # switch end + $P3 = $P2.'getlex'() + __ARG_1.'emitstore_lex'($P3, $S2) + .return($S2) .end # emit_assign_get @@ -9276,23 +7319,16 @@ .sub 'emit_store' :method .param pmc __ARG_1 .param pmc __ARG_2 -# Body -# { -.annotate 'line', 3242 getattribute $P2, self, 'desc' $P1 = $P2.'getlex'() __ARG_1.'emitstore_lex'($P1, __ARG_2) -# } -.annotate 'line', 3243 .end # emit_store .sub Winxed_class_init :anon :load :init newclass $P0, [ 'Winxed'; 'Compiler'; 'LexicalVolatileExpr' ] -.annotate 'line', 3187 - get_class $P1, [ 'Winxed'; 'Compiler'; 'Expr' ] + get_class $P1, [ 'Winxed'; 'Compiler'; 'FinalExpr' ] addparent $P0, $P1 -.annotate 'line', 3189 addattribute $P0, 'desc' .end .namespace [ 'Winxed'; 'Compiler'; 'OpExpr' ] @@ -9300,84 +7336,155 @@ .sub 'initop' :method .param pmc __ARG_1 .param pmc __ARG_2 -# Body -# { -.annotate 'line', 3252 self.'Expr'(__ARG_1, __ARG_2) -# } -.annotate 'line', 3253 .end # initop .sub Winxed_class_init :anon :load :init newclass $P0, [ 'Winxed'; 'Compiler'; 'OpExpr' ] -.annotate 'line', 3248 get_class $P1, [ 'Winxed'; 'Compiler'; 'Expr' ] addparent $P0, $P1 .end +.namespace [ 'Winxed'; 'Compiler'; 'OpNamespaceExpr' ] + +.sub 'OpNamespaceExpr' :method + .param pmc __ARG_1 + .param pmc __ARG_2 + .param pmc __ARG_3 +.const 'Sub' WSubId_85 = "WSubId_85" +.const 'Sub' WSubId_70 = "WSubId_70" + self.'initop'(__ARG_2, __ARG_3) + $P2 = WSubId_85(__ARG_1) + setattribute self, 'key', $P2 + getattribute $P1, self, 'key' + elements $I1, $P1 + if $I1 goto __label_1 + WSubId_70('namespace identifier', __ARG_3) + __label_1: # endif + +.end # OpNamespaceExpr + + +.sub 'checkresult' :method + .return('P') + +.end # checkresult + + +.sub 'emit' :method + .param pmc __ARG_1 + .param string __ARG_2 +.const 'Sub' WSubId_25 = "WSubId_25" + getattribute $P1, self, 'owner' + getattribute $P4, self, 'key' + $P2 = $P1.'scopesearch'($P4, 1) + unless_null $P2, __label_1 + WSubId_25('unknown namespace', self) + __label_1: # endif + $P3 = $P2.'getpath'() + $P3.'emit_get_namespace'(__ARG_1, $P1, __ARG_2) + +.end # emit + +.sub Winxed_class_init :anon :load :init + newclass $P0, [ 'Winxed'; 'Compiler'; 'OpNamespaceExpr' ] + get_class $P1, [ 'Winxed'; 'Compiler'; 'OpExpr' ] + addparent $P0, $P1 + addattribute $P0, 'key' +.end .namespace [ 'Winxed'; 'Compiler'; 'OpClassExpr' ] .sub 'OpClassExpr' :method .param pmc __ARG_1 .param pmc __ARG_2 .param pmc __ARG_3 -.const 'Sub' WSubId_62 = "WSubId_62" -# Body -# { -.annotate 'line', 3264 +.const 'Sub' WSubId_92 = "WSubId_92" self.'initop'(__ARG_2, __ARG_3) -.annotate 'line', 3265 - $P2 = WSubId_62(__ARG_1, __ARG_2) + $P2 = WSubId_92(__ARG_1, __ARG_2) setattribute self, 'clspec', $P2 -# } -.annotate 'line', 3266 .end # OpClassExpr .sub 'checkresult' :method -# Body -# { -.annotate 'line', 3267 .return('P') -# } .end # checkresult +.sub 'get_class_raw_key' :method +.const 'Sub' WSubId_25 = "WSubId_25" +.const 'Sub' WSubId_30 = "WSubId_30" + getattribute $P1, self, 'owner' + getattribute $P2, self, 'clspec' + null $P3 + isa $I1, $P2, [ 'Winxed'; 'Compiler'; 'ClassSpecifierId' ] + if $I1 goto __label_3 + isa $I1, $P2, [ 'Winxed'; 'Compiler'; 'ClassSpecifierParrotKey' ] + if $I1 goto __label_4 + isa $I1, $P2, [ 'Winxed'; 'Compiler'; 'ClassSpecifier' ] + if $I1 goto __label_5 + goto __label_2 + __label_3: # case + $P3 = $P2.'checknskey'($P1) + if_null $P3, __label_7 + getattribute $P4, $P3, 'path' + goto __label_6 + __label_7: + null $P4 + __label_6: + .return($P4) + __label_4: # case + $P3 = $P2.'checknskey'($P1) + if_null $P3, __label_9 + getattribute $P5, $P3, 'path' + goto __label_8 + __label_9: + null $P5 + __label_8: + .return($P5) + __label_5: # case + typeof $P6, $P2 + set $S1, $P6 + concat $S2, $S1, " not supported yet here" + getattribute $P7, $P2, 'start' + WSubId_25($S2, $P7) + __label_2: # default + __label_1: # switch end + getattribute $P4, $P2, 'start' + WSubId_30("Unexpected class key", $P4) + +.end # get_class_raw_key + + .sub 'emit' :method .param pmc __ARG_1 - .param pmc __ARG_2 -# Body -# { -.annotate 'line', 3270 -# var clspec: $P1 - getattribute $P1, self, 'clspec' -.annotate 'line', 3273 - set $S1, __ARG_2 - ne $S1, '', __label_1 -.annotate 'line', 3274 - getattribute $P2, self, 'owner' - __ARG_2 = $P2.'tempreg'('P') - __label_1: # endif -.annotate 'line', 3275 + .param string __ARG_2 + getattribute $P1, self, 'owner' + getattribute $P2, self, 'clspec' + isa $I1, $P2, [ 'Winxed'; 'Compiler'; 'ClassSpecifierId' ] + if $I1 goto __label_3 + goto __label_2 + __label_3: # case + $P3 = $P2.'checknskey'($P1) + if_null $P3, __label_4 + $P3.'emit_get_class'(__ARG_1, $P1, __ARG_2) + .return() + __label_4: # endif + goto __label_1 # break + __label_2: # default + __label_1: # switch end __ARG_1.'print'(' get_class ', __ARG_2, ', ') -.annotate 'line', 3276 - getattribute $P2, self, 'owner' - $P1.'emit'(__ARG_1, $P2) -.annotate 'line', 3277 + getattribute $P4, self, 'owner' + $P2.'emit'(__ARG_1, $P4) __ARG_1.'say'() -# } -.annotate 'line', 3278 .end # emit .sub Winxed_class_init :anon :load :init newclass $P0, [ 'Winxed'; 'Compiler'; 'OpClassExpr' ] -.annotate 'line', 3258 get_class $P1, [ 'Winxed'; 'Compiler'; 'OpExpr' ] addparent $P0, $P1 -.annotate 'line', 3260 addattribute $P0, 'clspec' .end .namespace [ 'Winxed'; 'Compiler'; 'OpUnaryExpr' ] @@ -9386,49 +7493,42 @@ .param pmc __ARG_1 .param pmc __ARG_2 .param pmc __ARG_3 -# Body -# { -.annotate 'line', 3288 self.'initop'(__ARG_1, __ARG_2) -.annotate 'line', 3289 setattribute self, 'subexpr', __ARG_3 -# } -.annotate 'line', 3290 .end # OpUnaryExpr +.sub 'cloneunary' :method + .param pmc __ARG_1 + .param pmc __ARG_2 + getattribute $P1, self, 'start' + getattribute $P3, self, 'subexpr' + $P2 = $P3.'clone'(__ARG_2) + __ARG_1.'OpUnaryExpr'(__ARG_2, $P1, $P2) + .return(__ARG_1) + +.end # cloneunary + + .sub 'optimizearg' :method -# Body -# { -.annotate 'line', 3293 getattribute $P3, self, 'subexpr' $P2 = $P3.'optimize'() setattribute self, 'subexpr', $P2 -# } -.annotate 'line', 3294 .end # optimizearg .sub 'optimize' :method -# Body -# { -.annotate 'line', 3297 self.'optimizearg'() -.annotate 'line', 3298 .return(self) -# } -.annotate 'line', 3299 .end # optimize .sub Winxed_class_init :anon :load :init newclass $P0, [ 'Winxed'; 'Compiler'; 'OpUnaryExpr' ] -.annotate 'line', 3283 get_class $P1, [ 'Winxed'; 'Compiler'; 'OpExpr' ] addparent $P0, $P1 -.annotate 'line', 3285 addattribute $P0, 'subexpr' .end .namespace [ 'Winxed'; 'Compiler'; 'OpBinaryExpr' ] @@ -9438,16 +7538,9 @@ .param pmc __ARG_2 .param pmc __ARG_3 .param pmc __ARG_4 -# Body -# { -.annotate 'line', 3310 self.'initop'(__ARG_1, __ARG_2) -.annotate 'line', 3311 setattribute self, 'lexpr', __ARG_3 -.annotate 'line', 3312 setattribute self, 'rexpr', __ARG_4 -# } -.annotate 'line', 3313 .end # initbinary @@ -9457,174 +7550,123 @@ .param pmc __ARG_2 .param pmc __ARG_3 .param pmc __ARG_4 -# Body -# { -.annotate 'line', 3316 self.'initbinary'(__ARG_1, __ARG_2, __ARG_3, __ARG_4) -.annotate 'line', 3317 .return(self) -# } -.annotate 'line', 3318 .end # set +.sub 'clonebinary' :method + .param pmc __ARG_1 + .param pmc __ARG_2 + getattribute $P1, self, 'start' + getattribute $P3, self, 'lexpr' + $P2 = $P3.'clone'(__ARG_2) + getattribute $P5, self, 'rexpr' + $P4 = $P5.'clone'(__ARG_2) + __ARG_1.'initbinary'(__ARG_2, $P1, $P2, $P4) + .return(__ARG_1) + +.end # clonebinary + + .sub 'setfrom' :method .param pmc __ARG_1 -# Body -# { -.annotate 'line', 3321 getattribute $P1, __ARG_1, 'owner' getattribute $P2, __ARG_1, 'start' getattribute $P3, __ARG_1, 'lexpr' getattribute $P4, __ARG_1, 'rexpr' .tailcall self.'set'($P1, $P2, $P3, $P4) -# } -.annotate 'line', 3322 .end # setfrom .sub 'optimizearg' :method -# Body -# { -.annotate 'line', 3325 getattribute $P3, self, 'lexpr' $P2 = $P3.'optimize'() setattribute self, 'lexpr', $P2 -.annotate 'line', 3326 getattribute $P3, self, 'rexpr' $P2 = $P3.'optimize'() setattribute self, 'rexpr', $P2 -# } -.annotate 'line', 3327 .end # optimizearg .sub 'optimize' :method -# Body -# { -.annotate 'line', 3330 self.'optimizearg'() -.annotate 'line', 3331 .return(self) -# } -.annotate 'line', 3332 .end # optimize .sub 'emit_intleft' :method .param pmc __ARG_1 -# Body -# { -.annotate 'line', 3335 getattribute $P1, self, 'lexpr' .tailcall $P1.'emit_getint'(__ARG_1) -# } -.annotate 'line', 3336 .end # emit_intleft .sub 'emit_intright' :method .param pmc __ARG_1 -# Body -# { -.annotate 'line', 3339 getattribute $P1, self, 'rexpr' .tailcall $P1.'emit_getint'(__ARG_1) -# } -.annotate 'line', 3340 .end # emit_intright .sub Winxed_class_init :anon :load :init newclass $P0, [ 'Winxed'; 'Compiler'; 'OpBinaryExpr' ] -.annotate 'line', 3304 get_class $P1, [ 'Winxed'; 'Compiler'; 'OpExpr' ] addparent $P0, $P1 -.annotate 'line', 3306 addattribute $P0, 'lexpr' -.annotate 'line', 3307 addattribute $P0, 'rexpr' .end .namespace [ 'Winxed'; 'Compiler'; 'OpBinaryIntExpr' ] .sub 'checkresult' :method -# Body -# { -.annotate 'line', 3349 .return('I') -# } -.annotate 'line', 3350 .end # checkresult .sub 'optimize' :method -.const 'Sub' WSubId_21 = "WSubId_21" -# Body -# { -.annotate 'line', 3353 +.const 'Sub' WSubId_44 = "WSubId_44" self.'optimizearg'() -.annotate 'line', 3354 -# var lexpr: $P1 getattribute $P1, self, 'lexpr' -.annotate 'line', 3355 -# var rexpr: $P2 getattribute $P2, self, 'rexpr' -.annotate 'line', 3356 - $I3 = $P1.'isintegerliteral'() - unless $I3 goto __label_2 - $I3 = $P2.'isintegerliteral'() + $P3 = $P1.'isintegerliteral'() + unless $P3 goto __label_2 + $P3 = $P2.'isintegerliteral'() __label_2: - unless $I3 goto __label_1 -# { -.annotate 'line', 3357 -# li: $I1 - $P3 = $P1.'getIntegerValue'() - set $I1, $P3 -.annotate 'line', 3358 -# ri: $I2 + if_null $P3, __label_1 + unless $P3 goto __label_1 + $P4 = $P1.'getIntegerValue'() + set $I1, $P4 $P3 = $P2.'getIntegerValue'() set $I2, $P3 -.annotate 'line', 3359 getattribute $P3, self, 'owner' getattribute $P4, self, 'start' $P5 = self.'do_op'($I1, $I2) - .tailcall WSubId_21($P3, $P4, $P5) -# } + .tailcall WSubId_44($P3, $P4, $P5) __label_1: # endif -.annotate 'line', 3361 .return(self) -# } -.annotate 'line', 3362 .end # optimize .sub Winxed_class_init :anon :load :init newclass $P0, [ 'Winxed'; 'Compiler'; 'OpBinaryIntExpr' ] -.annotate 'line', 3345 get_class $P1, [ 'Winxed'; 'Compiler'; 'OpBinaryExpr' ] addparent $P0, $P1 .end .namespace [ 'Winxed'; 'Compiler'; 'OpDelExBase' ] .sub 'checkresult' :method -# Body -# { -.annotate 'line', 3371 .return('I') -# } -.annotate 'line', 3372 .end # checkresult .sub Winxed_class_init :anon :load :init newclass $P0, [ 'Winxed'; 'Compiler'; 'OpDelExBase' ] -.annotate 'line', 3367 get_class $P1, [ 'Winxed'; 'Compiler'; 'OpUnaryExpr' ] addparent $P0, $P1 .end @@ -9634,64 +7676,52 @@ .param pmc __ARG_1 .param pmc __ARG_2 .param pmc __ARG_3 -# Body -# { -.annotate 'line', 3380 self.'OpUnaryExpr'(__ARG_1, __ARG_2, __ARG_3) -# } -.annotate 'line', 3381 .end # OpDeleteExpr -.sub 'emit' :method - .param pmc __ARG_1 - .param pmc __ARG_2 -.const 'Sub' WSubId_1 = "WSubId_1" -# Body -# { -.annotate 'line', 3384 -# var expr: $P1 +.sub 'optimize' :method +.const 'Sub' WSubId_25 = "WSubId_25" + self.'optimizearg'() getattribute $P1, self, 'subexpr' -.annotate 'line', 3385 - isa $I1, $P1, [ 'Winxed'; 'Compiler'; 'IndexExpr' ] - unless $I1 goto __label_3 + isa $I2, $P1, [ 'Winxed'; 'Compiler'; 'IndexExpr' ] + not $I1, $I2 + if $I1 goto __label_2 $P2 = $P1.'checkresult'() set $S1, $P2 - isne $I1, $S1, 'S' - __label_3: + iseq $I1, $S1, 'S' + __label_2: unless $I1 goto __label_1 -# { -.annotate 'line', 3386 + WSubId_25("delete with invalid operator", self) + __label_1: # endif + .return(self) + +.end # optimize + + +.sub 'emit_void' :method + .param pmc __ARG_1 + getattribute $P1, self, 'subexpr' $P1.'emit_prep'(__ARG_1) -.annotate 'line', 3387 self.'annotate'(__ARG_1) -.annotate 'line', 3388 __ARG_1.'print'(' delete ') -.annotate 'line', 3389 $P1.'emit_aux'(__ARG_1) -.annotate 'line', 3390 __ARG_1.'say'() -.annotate 'line', 3391 - set $S1, __ARG_2 - eq $S1, '', __label_4 -.annotate 'line', 3392 + +.end # emit_void + + +.sub 'emit' :method + .param pmc __ARG_1 + .param string __ARG_2 + self.'emit_void'(__ARG_1) __ARG_1.'emitset'(__ARG_2, '1') - __label_4: # endif -# } - goto __label_2 - __label_1: # else -.annotate 'line', 3395 - WSubId_1("delete with invalid operator", self) - __label_2: # endif -# } -.annotate 'line', 3396 .end # emit .sub Winxed_class_init :anon :load :init newclass $P0, [ 'Winxed'; 'Compiler'; 'OpDeleteExpr' ] -.annotate 'line', 3376 get_class $P1, [ 'Winxed'; 'Compiler'; 'OpDelExBase' ] addparent $P0, $P1 .end @@ -9701,71 +7731,37 @@ .param pmc __ARG_1 .param pmc __ARG_2 .param pmc __ARG_3 -# Body -# { -.annotate 'line', 3403 self.'OpUnaryExpr'(__ARG_1, __ARG_2, __ARG_3) -# } -.annotate 'line', 3404 .end # OpExistsExpr .sub 'emit' :method .param pmc __ARG_1 - .param pmc __ARG_2 -.const 'Sub' WSubId_1 = "WSubId_1" -# Body -# { -.annotate 'line', 3407 -# var expr: $P1 + .param string __ARG_2 +.const 'Sub' WSubId_25 = "WSubId_25" getattribute $P1, self, 'subexpr' -.annotate 'line', 3408 -# reg: $S1 - set $S2, __ARG_2 - eq $S2, '', __label_2 - set $P2, __ARG_2 - goto __label_1 - __label_2: - $P2 = self.'tempreg'('I') - __label_1: - null $S1 - if_null $P2, __label_3 - set $S1, $P2 - __label_3: -.annotate 'line', 3409 isa $I1, $P1, [ 'Winxed'; 'Compiler'; 'IndexExpr' ] - unless $I1 goto __label_6 + unless $I1 goto __label_3 $P2 = $P1.'checkresult'() - set $S2, $P2 - isne $I1, $S2, 'S' - __label_6: - unless $I1 goto __label_4 -# { -.annotate 'line', 3410 + set $S1, $P2 + isne $I1, $S1, 'S' + __label_3: + unless $I1 goto __label_1 $P1.'emit_prep'(__ARG_1) -.annotate 'line', 3411 self.'annotate'(__ARG_1) -.annotate 'line', 3412 - __ARG_1.'print'(' exists ', $S1, ', ') -.annotate 'line', 3413 + __ARG_1.'print'(' exists ', __ARG_2, ', ') $P1.'emit_aux'(__ARG_1) -.annotate 'line', 3414 __ARG_1.'say'() -# } - goto __label_5 - __label_4: # else -.annotate 'line', 3417 - WSubId_1("exists with invalid operator", self) - __label_5: # endif -# } -.annotate 'line', 3418 + goto __label_2 + __label_1: # else + WSubId_25("exists with invalid operator", self) + __label_2: # endif .end # emit .sub Winxed_class_init :anon :load :init newclass $P0, [ 'Winxed'; 'Compiler'; 'OpExistsExpr' ] -.annotate 'line', 3399 get_class $P1, [ 'Winxed'; 'Compiler'; 'OpDelExBase' ] addparent $P0, $P1 .end @@ -9775,24 +7771,22 @@ .param pmc __ARG_1 .param pmc __ARG_2 .param pmc __ARG_3 -# Body -# { -.annotate 'line', 3427 self.'OpUnaryExpr'(__ARG_1, __ARG_2, __ARG_3) -# } -.annotate 'line', 3428 .end # OpUnaryMinusExpr +.sub 'clone' :method + .param pmc __ARG_1 + new $P1, [ 'Winxed'; 'Compiler'; 'OpUnaryMinusExpr' ] + .tailcall self.'cloneunary'($P1, __ARG_1) + +.end # clone + + .sub 'checkresult' :method -# Body -# { -.annotate 'line', 3431 getattribute $P1, self, 'subexpr' .tailcall $P1.'checkresult'() -# } -.annotate 'line', 3432 .end # checkresult @@ -9801,95 +7795,58 @@ .param pmc __ARG_1 .param pmc __ARG_2 .param pmc __ARG_3 -# Body -# { -.annotate 'line', 3435 self.'OpUnaryExpr'(__ARG_1, __ARG_2, __ARG_3) -.annotate 'line', 3436 .return(self) -# } -.annotate 'line', 3437 .end # set .sub 'optimize' :method -.const 'Sub' WSubId_21 = "WSubId_21" -.const 'Sub' WSubId_63 = "WSubId_63" -# Body -# { -.annotate 'line', 3440 -# var subexpr: $P1 +.const 'Sub' WSubId_44 = "WSubId_44" +.const 'Sub' WSubId_93 = "WSubId_93" getattribute $P1, self, 'subexpr' -.annotate 'line', 3441 self.'optimizearg'() -.annotate 'line', 3442 $P2 = $P1.'isintegerliteral'() if_null $P2, __label_1 unless $P2 goto __label_1 -# { -.annotate 'line', 3443 -# i: $I1 $P3 = $P1.'getIntegerValue'() set $I1, $P3 -.annotate 'line', 3444 getattribute $P2, self, 'owner' getattribute $P3, $P1, 'start' neg $I2, $I1 - .tailcall WSubId_21($P2, $P3, $I2) -# } + .tailcall WSubId_44($P2, $P3, $I2) __label_1: # endif -# { -.annotate 'line', 3447 $P2 = $P1.'isfloatliteral'() if_null $P2, __label_2 unless $P2 goto __label_2 -# { -.annotate 'line', 3448 -# n: $N1 $P3 = $P1.'getFloatValue'() set $N1, $P3 -.annotate 'line', 3449 getattribute $P2, self, 'owner' getattribute $P3, $P1, 'start' neg $N2, $N1 - .tailcall WSubId_63($P2, $P3, $N2) -# } + .tailcall WSubId_93($P2, $P3, $N2) __label_2: # endif -# } -.annotate 'line', 3452 .return(self) -# } -.annotate 'line', 3453 .end # optimize .sub 'emit' :method .param pmc __ARG_1 - .param pmc __ARG_2 -# Body -# { -.annotate 'line', 3456 -# reg: $S1 + .param string __ARG_2 getattribute $P2, self, 'subexpr' $P1 = $P2.'emit_get'(__ARG_1) null $S1 if_null $P1, __label_1 set $S1, $P1 __label_1: -.annotate 'line', 3457 self.'annotate'(__ARG_1) -.annotate 'line', 3458 __ARG_1.'emitarg2'('neg', __ARG_2, $S1) -# } -.annotate 'line', 3459 .end # emit .sub Winxed_class_init :anon :load :init newclass $P0, [ 'Winxed'; 'Compiler'; 'OpUnaryMinusExpr' ] -.annotate 'line', 3423 get_class $P1, [ 'Winxed'; 'Compiler'; 'OpUnaryExpr' ] addparent $P0, $P1 .end @@ -9899,33 +7856,27 @@ .param pmc __ARG_1 .param pmc __ARG_2 .param pmc __ARG_3 -# Body -# { -.annotate 'line', 3468 self.'OpUnaryExpr'(__ARG_1, __ARG_2, __ARG_3) -# } -.annotate 'line', 3469 .end # OpNotExpr +.sub 'clone' :method + .param pmc __ARG_1 + new $P1, [ 'Winxed'; 'Compiler'; 'OpNotExpr' ] + .tailcall self.'cloneunary'($P1, __ARG_1) + +.end # clone + + .sub 'isnegable' :method -# Body -# { -.annotate 'line', 3470 .return(1) -# } .end # isnegable .sub 'checkresult' :method -# Body -# { -.annotate 'line', 3473 .return('I') -# } -.annotate 'line', 3474 .end # checkresult @@ -9934,129 +7885,162 @@ .param pmc __ARG_1 .param pmc __ARG_2 .param pmc __ARG_3 -# Body -# { -.annotate 'line', 3477 self.'OpUnaryExpr'(__ARG_1, __ARG_2, __ARG_3) -.annotate 'line', 3478 .return(self) -# } -.annotate 'line', 3479 .end # set .sub 'optimize' :method -.const 'Sub' WSubId_21 = "WSubId_21" -# Body -# { -.annotate 'line', 3482 +.const 'Sub' WSubId_44 = "WSubId_44" self.'optimizearg'() -.annotate 'line', 3483 -# var subexpr: $P1 getattribute $P1, self, 'subexpr' -.annotate 'line', 3484 $P2 = $P1.'isintegerliteral'() if_null $P2, __label_1 unless $P2 goto __label_1 -# { -.annotate 'line', 3485 -# n: $I1 $P3 = $P1.'getIntegerValue'() set $I1, $P3 -.annotate 'line', 3486 getattribute $P2, self, 'owner' getattribute $P3, $P1, 'start' not $I2, $I1 - .tailcall WSubId_21($P2, $P3, $I2) -# } + .tailcall WSubId_44($P2, $P3, $I2) __label_1: # endif -.annotate 'line', 3488 $P2 = $P1.'isnegable'() if_null $P2, __label_2 unless $P2 goto __label_2 -.annotate 'line', 3489 .tailcall $P1.'negated'() __label_2: # endif -.annotate 'line', 3490 .return(self) -# } -.annotate 'line', 3491 .end # optimize .sub 'negated' :method -# Body -# { -.annotate 'line', 3494 getattribute $P1, self, 'subexpr' .return($P1) -# } -.annotate 'line', 3495 .end # negated .sub 'emit' :method .param pmc __ARG_1 - .param pmc __ARG_2 -# Body -# { -.annotate 'line', 3498 -# var subexpr: $P1 + .param string __ARG_2 getattribute $P1, self, 'subexpr' -.annotate 'line', 3499 -# reg: $S1 $P2 = $P1.'emit_get'(__ARG_1) null $S1 if_null $P2, __label_1 set $S1, $P2 __label_1: -.annotate 'line', 3500 self.'annotate'(__ARG_1) -# switch -.annotate 'line', 3501 $P2 = $P1.'checkresult'() set $S2, $P2 - set $S3, 'I' - if $S2 == $S3 goto __label_4 - set $S3, 'P' - if $S2 == $S3 goto __label_5 - goto __label_3 + if_null $S2, __label_2 + length $I1, $S2 + ne $I1, 1, __label_2 + ord $I1, $S2 + if $I1 == 73 goto __label_4 + if $I1 == 80 goto __label_5 + goto __label_2 __label_4: # case -.annotate 'line', 3503 __ARG_1.'emitarg2'('not', __ARG_2, $S1) - goto __label_2 # break + goto __label_3 # break __label_5: # case -.annotate 'line', 3506 __ARG_1.'emitarg2'('isfalse', __ARG_2, $S1) - goto __label_2 # break - __label_3: # default -.annotate 'line', 3509 + goto __label_3 # break + __label_2: # default __ARG_1.'emitarg2'('isfalse', __ARG_2, $S1) - __label_2: # switch end -# } -.annotate 'line', 3511 + __label_3: # switch end .end # emit .sub Winxed_class_init :anon :load :init newclass $P0, [ 'Winxed'; 'Compiler'; 'OpNotExpr' ] -.annotate 'line', 3464 + get_class $P1, [ 'Winxed'; 'Compiler'; 'OpUnaryExpr' ] + addparent $P0, $P1 +.end +.namespace [ 'Winxed'; 'Compiler'; 'OpBinNotExpr' ] + +.sub 'OpBinNotExpr' :method + .param pmc __ARG_1 + .param pmc __ARG_2 + .param pmc __ARG_3 + self.'OpUnaryExpr'(__ARG_1, __ARG_2, __ARG_3) + +.end # OpBinNotExpr + + +.sub 'clone' :method + .param pmc __ARG_1 + new $P1, [ 'Winxed'; 'Compiler'; 'OpBinNotExpr' ] + .tailcall self.'cloneunary'($P1, __ARG_1) + +.end # clone + + +.sub 'checkresult' :method + .return('I') + +.end # checkresult + + +.sub 'set' :method + .param pmc __ARG_1 + .param pmc __ARG_2 + .param pmc __ARG_3 + self.'OpUnaryExpr'(__ARG_1, __ARG_2, __ARG_3) + .return(self) + +.end # set + + +.sub 'optimize' :method +.const 'Sub' WSubId_44 = "WSubId_44" + self.'optimizearg'() + getattribute $P1, self, 'subexpr' + $P2 = $P1.'isintegerliteral'() + if_null $P2, __label_1 + unless $P2 goto __label_1 + $P3 = $P1.'getIntegerValue'() + set $I1, $P3 + getattribute $P2, self, 'owner' + getattribute $P3, $P1, 'start' + bxor $I2, $I1, -1 + .tailcall WSubId_44($P2, $P3, $I2) + __label_1: # endif + $P2 = $P1.'isnegable'() + if_null $P2, __label_2 + unless $P2 goto __label_2 + .tailcall $P1.'negated'() + __label_2: # endif + .return(self) + +.end # optimize + + +.sub 'emit' :method + .param pmc __ARG_1 + .param string __ARG_2 + getattribute $P1, self, 'subexpr' + $P2 = $P1.'emit_getint'(__ARG_1) + null $S1 + if_null $P2, __label_1 + set $S1, $P2 + __label_1: + self.'annotate'(__ARG_1) + __ARG_1.'emitarg3'('bxor', __ARG_2, $S1, -1) + +.end # emit + +.sub Winxed_class_init :anon :load :init + newclass $P0, [ 'Winxed'; 'Compiler'; 'OpBinNotExpr' ] get_class $P1, [ 'Winxed'; 'Compiler'; 'OpUnaryExpr' ] addparent $P0, $P1 .end .namespace [ 'Winxed'; 'Compiler'; 'OpIncDec' ] .sub 'checkresult' :method -# Body -# { -.annotate 'line', 3520 getattribute $P1, self, 'subexpr' .tailcall $P1.'checkresult'() -# } -.annotate 'line', 3521 .end # checkresult @@ -10064,25 +8048,16 @@ .sub 'iflexical' :method .param pmc __ARG_1 .param pmc __ARG_2 -# Body -# { -.annotate 'line', 3524 -# var expr: $P1 getattribute $P1, self, 'subexpr' -.annotate 'line', 3525 isa $I1, $P1, [ 'Winxed'; 'Compiler'; 'LexicalVolatileExpr' ] unless $I1 goto __label_1 -.annotate 'line', 3526 $P1.'emit_store'(__ARG_1, __ARG_2) __label_1: # endif -# } -.annotate 'line', 3527 .end # iflexical .sub Winxed_class_init :anon :load :init newclass $P0, [ 'Winxed'; 'Compiler'; 'OpIncDec' ] -.annotate 'line', 3516 get_class $P1, [ 'Winxed'; 'Compiler'; 'OpUnaryExpr' ] addparent $P0, $P1 .end @@ -10090,30 +8065,25 @@ .sub 'emit' :method .param pmc __ARG_1 - .param pmc __ARG_2 -# Body -# { -.annotate 'line', 3536 -# reg: $S1 + .param string __ARG_2 $P1 = self.'emit_get'(__ARG_1) null $S1 if_null $P1, __label_1 set $S1, $P1 __label_1: -.annotate 'line', 3537 - set $S2, __ARG_2 - eq $S2, '', __label_2 -.annotate 'line', 3538 __ARG_1.'emitset'(__ARG_2, $S1) - __label_2: # endif -# } -.annotate 'line', 3539 .end # emit + +.sub 'emit_void' :method + .param pmc __ARG_1 + self.'emit_get'(__ARG_1) + +.end # emit_void + .sub Winxed_class_init :anon :load :init newclass $P0, [ 'Winxed'; 'Compiler'; 'OpPreIncDec' ] -.annotate 'line', 3532 get_class $P1, [ 'Winxed'; 'Compiler'; 'OpIncDec' ] addparent $P0, $P1 .end @@ -10123,44 +8093,36 @@ .param pmc __ARG_1 .param pmc __ARG_2 .param pmc __ARG_3 -# Body -# { -.annotate 'line', 3546 self.'OpUnaryExpr'(__ARG_1, __ARG_2, __ARG_3) -# } -.annotate 'line', 3547 .end # OpPreIncExpr +.sub 'clone' :method + .param pmc __ARG_1 + new $P1, [ 'Winxed'; 'Compiler'; 'OpPreIncExpr' ] + .tailcall self.'cloneunary'($P1, __ARG_1) + +.end # clone + + .sub 'emit_get' :method .param pmc __ARG_1 -# Body -# { -.annotate 'line', 3550 -# reg: $S1 getattribute $P2, self, 'subexpr' $P1 = $P2.'emit_get'(__ARG_1) null $S1 if_null $P1, __label_1 set $S1, $P1 __label_1: -.annotate 'line', 3551 self.'annotate'(__ARG_1) -.annotate 'line', 3552 __ARG_1.'emitinc'($S1) -.annotate 'line', 3553 self.'iflexical'(__ARG_1, $S1) -.annotate 'line', 3554 .return($S1) -# } -.annotate 'line', 3555 .end # emit_get .sub Winxed_class_init :anon :load :init newclass $P0, [ 'Winxed'; 'Compiler'; 'OpPreIncExpr' ] -.annotate 'line', 3542 get_class $P1, [ 'Winxed'; 'Compiler'; 'OpPreIncDec' ] addparent $P0, $P1 .end @@ -10170,44 +8132,36 @@ .param pmc __ARG_1 .param pmc __ARG_2 .param pmc __ARG_3 -# Body -# { -.annotate 'line', 3562 self.'OpUnaryExpr'(__ARG_1, __ARG_2, __ARG_3) -# } -.annotate 'line', 3563 .end # OpPreDecExpr +.sub 'clone' :method + .param pmc __ARG_1 + new $P1, [ 'Winxed'; 'Compiler'; 'OpPreDecExpr' ] + .tailcall self.'cloneunary'($P1, __ARG_1) + +.end # clone + + .sub 'emit_get' :method .param pmc __ARG_1 -# Body -# { -.annotate 'line', 3566 -# reg: $S1 getattribute $P2, self, 'subexpr' $P1 = $P2.'emit_get'(__ARG_1) null $S1 if_null $P1, __label_1 set $S1, $P1 __label_1: -.annotate 'line', 3567 self.'annotate'(__ARG_1) -.annotate 'line', 3568 __ARG_1.'emitdec'($S1) -.annotate 'line', 3569 self.'iflexical'(__ARG_1, $S1) -.annotate 'line', 3570 .return($S1) -# } -.annotate 'line', 3571 .end # emit_get .sub Winxed_class_init :anon :load :init newclass $P0, [ 'Winxed'; 'Compiler'; 'OpPreDecExpr' ] -.annotate 'line', 3558 get_class $P1, [ 'Winxed'; 'Compiler'; 'OpPreIncDec' ] addparent $P0, $P1 .end @@ -10217,51 +8171,95 @@ .param pmc __ARG_1 .param pmc __ARG_2 .param pmc __ARG_3 -# Body -# { -.annotate 'line', 3580 self.'OpUnaryExpr'(__ARG_1, __ARG_2, __ARG_3) -# } -.annotate 'line', 3581 .end # OpPostIncExpr +.sub 'clone' :method + .param pmc __ARG_1 + new $P1, [ 'Winxed'; 'Compiler'; 'OpPostIncExpr' ] + .tailcall self.'cloneunary'($P1, __ARG_1) + +.end # clone + + .sub 'emit' :method .param pmc __ARG_1 - .param pmc __ARG_2 -# Body -# { -.annotate 'line', 3584 -# reg: $S1 + .param string __ARG_2 getattribute $P2, self, 'subexpr' $P1 = $P2.'emit_get'(__ARG_1) null $S1 if_null $P1, __label_1 set $S1, $P1 __label_1: -.annotate 'line', 3585 self.'annotate'(__ARG_1) -.annotate 'line', 3586 - set $S2, __ARG_2 - eq $S2, '', __label_2 -.annotate 'line', 3587 + $P1 = self.'checkresult'() + set $S3, $P1 + ne $S3, 'P', __label_2 + $P2 = self.'tempreg'('P') + null $S2 + if_null $P2, __label_4 + set $S2, $P2 + __label_4: + __ARG_1.'emitarg2'('clone', $S2, $S1) + __ARG_1.'emitset'(__ARG_2, $S2) + goto __label_3 + __label_2: # else __ARG_1.'emitset'(__ARG_2, $S1) - __label_2: # endif -.annotate 'line', 3588 + __label_3: # endif __ARG_1.'emitinc'($S1) -.annotate 'line', 3589 self.'iflexical'(__ARG_1, $S1) -.annotate 'line', 3590 - .return($S1) -# } -.annotate 'line', 3591 .end # emit + +.sub 'emit_get' :method + .param pmc __ARG_1 + getattribute $P2, self, 'subexpr' + $P1 = $P2.'emit_get'(__ARG_1) + null $S1 + if_null $P1, __label_1 + set $S1, $P1 + __label_1: + self.'annotate'(__ARG_1) + $P2 = self.'checkresult'() + $P1 = self.'tempreg'($P2) + null $S2 + if_null $P1, __label_2 + set $S2, $P1 + __label_2: + $P1 = self.'checkresult'() + set $S3, $P1 + ne $S3, 'P', __label_3 + __ARG_1.'emitarg2'('clone', $S2, $S1) + goto __label_4 + __label_3: # else + __ARG_1.'emitset'($S2, $S1) + __label_4: # endif + __ARG_1.'emitinc'($S1) + self.'iflexical'(__ARG_1, $S1) + .return($S2) + +.end # emit_get + + +.sub 'emit_void' :method + .param pmc __ARG_1 + getattribute $P2, self, 'subexpr' + $P1 = $P2.'emit_get'(__ARG_1) + null $S1 + if_null $P1, __label_1 + set $S1, $P1 + __label_1: + self.'annotate'(__ARG_1) + __ARG_1.'emitinc'($S1) + self.'iflexical'(__ARG_1, $S1) + +.end # emit_void + .sub Winxed_class_init :anon :load :init newclass $P0, [ 'Winxed'; 'Compiler'; 'OpPostIncExpr' ] -.annotate 'line', 3576 get_class $P1, [ 'Winxed'; 'Compiler'; 'OpIncDec' ] addparent $P0, $P1 .end @@ -10271,51 +8269,96 @@ .param pmc __ARG_1 .param pmc __ARG_2 .param pmc __ARG_3 -# Body -# { -.annotate 'line', 3598 self.'OpUnaryExpr'(__ARG_1, __ARG_2, __ARG_3) -# } -.annotate 'line', 3599 .end # OpPostDecExpr +.sub 'clone' :method + .param pmc __ARG_1 + new $P1, [ 'Winxed'; 'Compiler'; 'OpPostDecExpr' ] + .tailcall self.'cloneunary'($P1, __ARG_1) + +.end # clone + + .sub 'emit' :method .param pmc __ARG_1 - .param pmc __ARG_2 -# Body -# { -.annotate 'line', 3602 -# reg: $S1 + .param string __ARG_2 getattribute $P2, self, 'subexpr' $P1 = $P2.'emit_get'(__ARG_1) null $S1 if_null $P1, __label_1 set $S1, $P1 __label_1: -.annotate 'line', 3603 self.'annotate'(__ARG_1) -.annotate 'line', 3604 - set $S2, __ARG_2 - eq $S2, '', __label_2 -.annotate 'line', 3605 + $P1 = self.'checkresult'() + set $S3, $P1 + ne $S3, 'P', __label_2 + $P2 = self.'tempreg'('P') + null $S2 + if_null $P2, __label_4 + set $S2, $P2 + __label_4: + __ARG_1.'emitarg2'('clone', $S2, $S1) + __ARG_1.'emitset'(__ARG_2, $S2) + goto __label_3 + __label_2: # else __ARG_1.'emitset'(__ARG_2, $S1) - __label_2: # endif -.annotate 'line', 3606 + __label_3: # endif __ARG_1.'emitdec'($S1) -.annotate 'line', 3607 self.'iflexical'(__ARG_1, $S1) -.annotate 'line', 3608 .return($S1) -# } -.annotate 'line', 3609 .end # emit + +.sub 'emit_get' :method + .param pmc __ARG_1 + getattribute $P2, self, 'subexpr' + $P1 = $P2.'emit_get'(__ARG_1) + null $S1 + if_null $P1, __label_1 + set $S1, $P1 + __label_1: + self.'annotate'(__ARG_1) + $P2 = self.'checkresult'() + $P1 = self.'tempreg'($P2) + null $S2 + if_null $P1, __label_2 + set $S2, $P1 + __label_2: + $P1 = self.'checkresult'() + set $S3, $P1 + ne $S3, 'P', __label_3 + __ARG_1.'emitarg2'('clone', $S2, $S1) + goto __label_4 + __label_3: # else + __ARG_1.'emitset'($S2, $S1) + __label_4: # endif + __ARG_1.'emitdec'($S1) + self.'iflexical'(__ARG_1, $S1) + .return($S2) + +.end # emit_get + + +.sub 'emit_void' :method + .param pmc __ARG_1 + getattribute $P2, self, 'subexpr' + $P1 = $P2.'emit_get'(__ARG_1) + null $S1 + if_null $P1, __label_1 + set $S1, $P1 + __label_1: + self.'annotate'(__ARG_1) + __ARG_1.'emitdec'($S1) + self.'iflexical'(__ARG_1, $S1) + +.end # emit_void + .sub Winxed_class_init :anon :load :init newclass $P0, [ 'Winxed'; 'Compiler'; 'OpPostDecExpr' ] -.annotate 'line', 3594 get_class $P1, [ 'Winxed'; 'Compiler'; 'OpIncDec' ] addparent $P0, $P1 .end @@ -10326,145 +8369,125 @@ .param pmc __ARG_2 .param pmc __ARG_3 .param pmc __ARG_4 -# Body -# { -.annotate 'line', 3620 self.'Expr'(__ARG_1, __ARG_2) -.annotate 'line', 3621 setattribute self, 'lexpr', __ARG_3 -.annotate 'line', 3622 setattribute self, 'rexpr', __ARG_4 -.annotate 'line', 3623 .return(self) -# } -.annotate 'line', 3624 .end # set +.sub 'cloneassign' :method + .param pmc __ARG_1 + .param pmc __ARG_2 + getattribute $P1, self, 'start' + getattribute $P3, self, 'lexpr' + $P2 = $P3.'clone'(__ARG_2) + getattribute $P5, self, 'rexpr' + $P4 = $P5.'clone'(__ARG_2) + .tailcall __ARG_1.'set'(__ARG_2, $P1, $P2, $P4) + +.end # cloneassign + + .sub 'checkresult' :method -# Body -# { -.annotate 'line', 3627 getattribute $P1, self, 'lexpr' .tailcall $P1.'checkresult'() -# } -.annotate 'line', 3628 .end # checkresult .sub 'optimize_base' :method -# Body -# { -.annotate 'line', 3631 getattribute $P3, self, 'lexpr' $P2 = $P3.'optimize'() setattribute self, 'lexpr', $P2 -.annotate 'line', 3632 getattribute $P3, self, 'rexpr' $P2 = $P3.'optimize'() setattribute self, 'rexpr', $P2 -.annotate 'line', 3633 .return(self) -# } -.annotate 'line', 3634 .end # optimize_base .sub 'optimize' :method -# Body -# { -.annotate 'line', 3637 .tailcall self.'optimize_base'() -# } -.annotate 'line', 3638 .end # optimize .sub 'checkleft' :method -.const 'Sub' WSubId_59 = "WSubId_59" -# Body -# { -.annotate 'line', 3641 -# var lexpr: $P1 +.const 'Sub' WSubId_89 = "WSubId_89" getattribute $P1, self, 'lexpr' -.annotate 'line', 3642 - $I1 = $P1.'isnull'() - if $I1 goto __label_2 - $I1 = $P1.'isliteral'() + $P2 = $P1.'isnull'() + if $P2 goto __label_2 + $P2 = $P1.'isliteral'() __label_2: - unless $I1 goto __label_1 -.annotate 'line', 3643 - WSubId_59($P1) + if_null $P2, __label_1 + unless $P2 goto __label_1 + WSubId_89($P1) __label_1: # endif -# } -.annotate 'line', 3644 .end # checkleft .sub 'emit' :method .param pmc __ARG_1 - .param pmc __ARG_2 -# Body -# { -.annotate 'line', 3647 -# reg: $S1 + .param string __ARG_2 $P1 = self.'emit_get'(__ARG_1) null $S1 if_null $P1, __label_1 set $S1, $P1 __label_1: -.annotate 'line', 3648 - set $S2, __ARG_2 - eq $S2, '', __label_2 -# { -.annotate 'line', 3649 self.'annotate'(__ARG_1) -.annotate 'line', 3650 __ARG_1.'emitset'(__ARG_2, $S1) -# } - __label_2: # endif -# } -.annotate 'line', 3652 .end # emit + +.sub 'emit_void' :method + .param pmc __ARG_1 + self.'emit_get'(__ARG_1) + +.end # emit_void + .sub Winxed_class_init :anon :load :init newclass $P0, [ 'Winxed'; 'Compiler'; 'OpBaseAssignExpr' ] -.annotate 'line', 3614 get_class $P1, [ 'Winxed'; 'Compiler'; 'Expr' ] addparent $P0, $P1 -.annotate 'line', 3616 addattribute $P0, 'lexpr' -.annotate 'line', 3617 addattribute $P0, 'rexpr' .end .namespace [ 'Winxed'; 'Compiler'; 'OpAssignExpr' ] +.sub 'clone' :method + .param pmc __ARG_1 + new $P1, [ 'Winxed'; 'Compiler'; 'OpAssignExpr' ] + .tailcall self.'cloneassign'($P1, __ARG_1) + +.end # clone + + .sub 'emit_get' :method .param pmc __ARG_1 -# Body -# { -.annotate 'line', 3661 self.'annotate'(__ARG_1) -.annotate 'line', 3662 -# var lexpr: $P1 getattribute $P1, self, 'lexpr' -.annotate 'line', 3663 getattribute $P2, self, 'rexpr' .tailcall $P1.'emit_assign_get'(__ARG_1, $P2) -# } -.annotate 'line', 3664 .end # emit_get + +.sub 'emit_void' :method + .param pmc __ARG_1 + self.'annotate'(__ARG_1) + getattribute $P1, self, 'lexpr' + getattribute $P2, self, 'rexpr' + $P1.'emit_assign_get'(__ARG_1, $P2) + +.end # emit_void + .sub Winxed_class_init :anon :load :init newclass $P0, [ 'Winxed'; 'Compiler'; 'OpAssignExpr' ] -.annotate 'line', 3657 get_class $P1, [ 'Winxed'; 'Compiler'; 'OpBaseAssignExpr' ] addparent $P0, $P1 .end @@ -10472,201 +8495,140 @@ .sub 'emit' :method .param pmc __ARG_1 - .param pmc __ARG_2 -# Body -# { -.annotate 'line', 3673 + .param string __ARG_2 self.'annotate'(__ARG_1) -.annotate 'line', 3674 -# reg: $S1 $P1 = self.'emit_get'(__ARG_1) null $S1 if_null $P1, __label_1 set $S1, $P1 __label_1: -.annotate 'line', 3675 - isnull $I1, __ARG_2 - not $I1 - unless $I1 goto __label_3 - set $S2, __ARG_2 - isne $I1, $S2, '' - __label_3: - unless $I1 goto __label_2 -.annotate 'line', 3676 __ARG_1.'emitassign'(__ARG_2, $S1) - __label_2: # endif -# } -.annotate 'line', 3677 .end # emit .sub 'emit_get' :method .param pmc __ARG_1 -.const 'Sub' WSubId_1 = "WSubId_1" -# Body -# { -.annotate 'line', 3680 +.const 'Sub' WSubId_25 = "WSubId_25" self.'checkleft'() -.annotate 'line', 3681 -# var lexpr: $P1 getattribute $P1, self, 'lexpr' -.annotate 'line', 3682 $P2 = $P1.'checkresult'() set $S3, $P2 eq $S3, 'P', __label_1 -.annotate 'line', 3683 - WSubId_1("Wrong dest type in =:", $P1) + WSubId_25("Wrong dest type in =:", $P1) __label_1: # endif -.annotate 'line', 3684 -# reg: $S1 $P2 = $P1.'emit_get'(__ARG_1) null $S1 if_null $P2, __label_2 set $S1, $P2 __label_2: -.annotate 'line', 3685 -# reg2: $S2 getattribute $P3, self, 'rexpr' $P2 = $P3.'emit_get'(__ARG_1) null $S2 if_null $P2, __label_3 set $S2, $P2 __label_3: -.annotate 'line', 3686 self.'annotate'(__ARG_1) -.annotate 'line', 3687 __ARG_1.'emitassign'($S1, $S2) -.annotate 'line', 3688 .return($S1) -# } -.annotate 'line', 3689 .end # emit_get -.sub Winxed_class_init :anon :load :init - newclass $P0, [ 'Winxed'; 'Compiler'; 'OpAssignToExpr' ] -.annotate 'line', 3669 - get_class $P1, [ 'Winxed'; 'Compiler'; 'OpBaseAssignExpr' ] - addparent $P0, $P1 + +.sub 'emit_void' :method + .param pmc __ARG_1 + self.'annotate'(__ARG_1) + $P1 = self.'emit_get'(__ARG_1) + null $S1 + if_null $P1, __label_1 + set $S1, $P1 + __label_1: + +.end # emit_void + +.sub Winxed_class_init :anon :load :init + newclass $P0, [ 'Winxed'; 'Compiler'; 'OpAssignToExpr' ] + get_class $P1, [ 'Winxed'; 'Compiler'; 'OpBaseAssignExpr' ] + addparent $P0, $P1 .end .namespace [ 'Winxed'; 'Compiler'; 'OpAddToExpr' ] .sub 'emit_get' :method .param pmc __ARG_1 -# Body -# { -.annotate 'line', 3698 self.'checkleft'() -.annotate 'line', 3699 -# var lexpr: $P1 getattribute $P1, self, 'lexpr' -.annotate 'line', 3700 -# var rexpr: $P2 getattribute $P2, self, 'rexpr' -.annotate 'line', 3701 -# ltype: $S1 $P3 = $P1.'checkresult'() null $S1 if_null $P3, __label_1 set $S1, $P3 __label_1: -.annotate 'line', 3702 -# rtype: $S2 $P3 = $P2.'checkresult'() null $S2 if_null $P3, __label_2 set $S2, $P3 __label_2: -.annotate 'line', 3703 -# reg: $S3 $P3 = $P1.'emit_get'(__ARG_1) null $S3 if_null $P3, __label_3 set $S3, $P3 __label_3: -.annotate 'line', 3704 iseq $I1, $S1, 'S' unless $I1 goto __label_6 isa $I1, $P2, [ 'Winxed'; 'Compiler'; 'ConcatString' ] __label_6: unless $I1 goto __label_4 -.annotate 'line', 3705 $P2.'emit_concat_to'(__ARG_1, $S3) goto __label_5 __label_4: # else -# { -.annotate 'line', 3707 -# reg2: $S4 $P3 = $P2.'emit_get'(__ARG_1) null $S4 if_null $P3, __label_7 set $S4, $P3 __label_7: -.annotate 'line', 3708 -# aux: $S5 null $S5 -.annotate 'line', 3709 self.'annotate'(__ARG_1) -# switch -.annotate 'line', 3710 - set $S6, $S1 - set $S7, 'S' - if $S6 == $S7 goto __label_10 - set $S7, 'I' - if $S6 == $S7 goto __label_11 - set $S7, 'N' - if $S6 == $S7 goto __label_12 - goto __label_9 + if_null $S1, __label_8 + length $I1, $S1 + ne $I1, 1, __label_8 + ord $I1, $S1 + if $I1 == 83 goto __label_10 + if $I1 == 73 goto __label_11 + if $I1 == 78 goto __label_12 + goto __label_8 __label_10: # case -.annotate 'line', 3712 eq $S2, 'S', __label_13 -# { -.annotate 'line', 3713 $P3 = self.'tempreg'('S') set $S5, $P3 -.annotate 'line', 3714 __ARG_1.'emitset'($S5, $S4) -.annotate 'line', 3715 set $S4, $S5 -# } __label_13: # endif -.annotate 'line', 3717 __ARG_1.'emitconcat1'($S3, $S4) - goto __label_8 # break + goto __label_9 # break __label_11: # case __label_12: # case -.annotate 'line', 3721 eq $S1, $S2, __label_14 -# { -.annotate 'line', 3722 $P3 = self.'tempreg'($S1) set $S5, $P3 -.annotate 'line', 3723 __ARG_1.'emitset'($S5, $S4) -.annotate 'line', 3724 set $S4, $S5 -# } __label_14: # endif -.annotate 'line', 3726 __ARG_1.'emitaddto'($S3, $S4) - goto __label_8 # break - __label_9: # default -.annotate 'line', 3729 + goto __label_9 # break + __label_8: # default __ARG_1.'emitaddto'($S3, $S4) - __label_8: # switch end -# } + __label_9: # switch end __label_5: # endif -.annotate 'line', 3732 + isa $I1, $P1, [ 'Winxed'; 'Compiler'; 'LexicalVolatileExpr' ] + unless $I1 goto __label_15 + $P1.'emit_store'(__ARG_1, $S3) + __label_15: # endif .return($S3) -# } -.annotate 'line', 3733 .end # emit_get .sub Winxed_class_init :anon :load :init newclass $P0, [ 'Winxed'; 'Compiler'; 'OpAddToExpr' ] -.annotate 'line', 3694 get_class $P1, [ 'Winxed'; 'Compiler'; 'OpBaseAssignExpr' ] addparent $P0, $P1 .end @@ -10674,94 +8636,65 @@ .sub 'emit_get' :method .param pmc __ARG_1 -.const 'Sub' WSubId_1 = "WSubId_1" -# Body -# { -.annotate 'line', 3742 +.const 'Sub' WSubId_25 = "WSubId_25" self.'checkleft'() -.annotate 'line', 3743 -# var lexpr: $P1 getattribute $P1, self, 'lexpr' -.annotate 'line', 3744 -# var rexpr: $P2 getattribute $P2, self, 'rexpr' -.annotate 'line', 3745 -# ltype: $S1 $P3 = $P1.'checkresult'() null $S1 if_null $P3, __label_1 set $S1, $P3 __label_1: -.annotate 'line', 3746 -# rtype: $S2 $P3 = $P2.'checkresult'() null $S2 if_null $P3, __label_2 set $S2, $P3 __label_2: -.annotate 'line', 3747 -# reg: $S3 $P3 = $P1.'emit_get'(__ARG_1) null $S3 if_null $P3, __label_3 set $S3, $P3 __label_3: -.annotate 'line', 3748 -# reg2: $S4 $P3 = $P2.'emit_get'(__ARG_1) null $S4 if_null $P3, __label_4 set $S4, $P3 __label_4: -.annotate 'line', 3749 -# aux: $S5 null $S5 -.annotate 'line', 3750 self.'annotate'(__ARG_1) -# switch -.annotate 'line', 3751 - set $S6, $S1 - set $S7, 'S' - if $S6 == $S7 goto __label_7 - set $S7, 'I' - if $S6 == $S7 goto __label_8 - set $S7, 'N' - if $S6 == $S7 goto __label_9 - goto __label_6 + if_null $S1, __label_5 + length $I1, $S1 + ne $I1, 1, __label_5 + ord $I1, $S1 + if $I1 == 83 goto __label_7 + if $I1 == 73 goto __label_8 + if $I1 == 78 goto __label_9 + goto __label_5 __label_7: # case -.annotate 'line', 3753 - WSubId_1("-= can't be applied to string", self) + WSubId_25("-= can't be applied to string", self) __label_8: # case __label_9: # case -.annotate 'line', 3756 eq $S1, $S2, __label_10 -# { -.annotate 'line', 3757 $P3 = self.'tempreg'($S1) set $S5, $P3 -.annotate 'line', 3758 __ARG_1.'emitset'($S5, $S4) -.annotate 'line', 3759 set $S4, $S5 -# } __label_10: # endif -.annotate 'line', 3761 __ARG_1.'emitsubto'($S3, $S4) - goto __label_5 # break - __label_6: # default -.annotate 'line', 3764 + goto __label_6 # break + __label_5: # default __ARG_1.'emitsubto'($S3, $S4) - __label_5: # switch end -.annotate 'line', 3766 + __label_6: # switch end + isa $I1, $P1, [ 'Winxed'; 'Compiler'; 'LexicalVolatileExpr' ] + unless $I1 goto __label_11 + $P1.'emit_store'(__ARG_1, $S3) + __label_11: # endif .return($S3) -# } -.annotate 'line', 3767 .end # emit_get .sub Winxed_class_init :anon :load :init newclass $P0, [ 'Winxed'; 'Compiler'; 'OpSubToExpr' ] -.annotate 'line', 3738 get_class $P1, [ 'Winxed'; 'Compiler'; 'OpBaseAssignExpr' ] addparent $P0, $P1 .end @@ -10769,86 +8702,45 @@ .sub 'emit_get' :method .param pmc __ARG_1 -# Body -# { -.annotate 'line', 3776 self.'checkleft'() -.annotate 'line', 3777 -# ltype: $S1 - getattribute $P2, self, 'lexpr' - $P1 = $P2.'checkresult'() + getattribute $P1, self, 'lexpr' + getattribute $P2, self, 'rexpr' + $P3 = $P1.'emit_get'(__ARG_1) null $S1 - if_null $P1, __label_1 - set $S1, $P1 + if_null $P3, __label_1 + set $S1, $P3 __label_1: -.annotate 'line', 3778 -# rtype: $S2 - getattribute $P2, self, 'lexpr' - $P1 = $P2.'checkresult'() null $S2 - if_null $P1, __label_2 - set $S2, $P1 - __label_2: -.annotate 'line', 3779 -# lreg: $S3 - getattribute $P2, self, 'lexpr' - $P1 = $P2.'emit_get'(__ARG_1) - null $S3 - if_null $P1, __label_3 - set $S3, $P1 - __label_3: -.annotate 'line', 3780 -# rreg: $S4 - null $S4 -# switch -.annotate 'line', 3781 - set $S5, $S1 - set $S6, 'S' - if $S5 == $S6 goto __label_6 - goto __label_5 - __label_6: # case -.annotate 'line', 3783 - ne $S2, 'I', __label_7 -.annotate 'line', 3784 - getattribute $P2, self, 'rexpr' - $P1 = $P2.'emit_get'(__ARG_1) - set $S4, $P1 - goto __label_8 - __label_7: # else -# { -.annotate 'line', 3786 - $P3 = self.'tempreg'('I') - set $S4, $P3 -.annotate 'line', 3787 - getattribute $P1, self, 'rexpr' - $P1.'emit'(__ARG_1, $S4) -# } - __label_8: # endif -.annotate 'line', 3789 + $P3 = $P1.'checkresult'() + set $S3, $P3 + if_null $S3, __label_2 + length $I1, $S3 + ne $I1, 1, __label_2 + ord $I1, $S3 + if $I1 == 83 goto __label_4 + goto __label_2 + __label_4: # case + $P4 = $P2.'emit_getint'(__ARG_1) + set $S2, $P4 self.'annotate'(__ARG_1) -.annotate 'line', 3790 - __ARG_1.'emitrepeat'($S3, $S3, $S4) - goto __label_4 # break - __label_5: # default -.annotate 'line', 3793 - getattribute $P2, self, 'rexpr' - $P1 = $P2.'emit_get'(__ARG_1) - set $S4, $P1 -.annotate 'line', 3794 + __ARG_1.'emitrepeat'($S1, $S1, $S2) + goto __label_3 # break + __label_2: # default + $P5 = $P2.'emit_get'(__ARG_1) + set $S2, $P5 self.'annotate'(__ARG_1) -.annotate 'line', 3795 - __ARG_1.'emitarg2'('mul', $S3, $S4) - __label_4: # switch end -.annotate 'line', 3797 - .return($S3) -# } -.annotate 'line', 3798 + __ARG_1.'emitarg2'('mul', $S1, $S2) + __label_3: # switch end + isa $I1, $P1, [ 'Winxed'; 'Compiler'; 'LexicalVolatileExpr' ] + unless $I1 goto __label_5 + $P1.'emit_store'(__ARG_1, $S1) + __label_5: # endif + .return($S1) .end # emit_get .sub Winxed_class_init :anon :load :init newclass $P0, [ 'Winxed'; 'Compiler'; 'OpMulToExpr' ] -.annotate 'line', 3772 get_class $P1, [ 'Winxed'; 'Compiler'; 'OpBaseAssignExpr' ] addparent $P0, $P1 .end @@ -10856,48 +8748,31 @@ .sub 'emit_get' :method .param pmc __ARG_1 -# Body -# { -.annotate 'line', 3807 self.'checkleft'() -.annotate 'line', 3808 -# type: $S1 - getattribute $P2, self, 'lexpr' - $P1 = $P2.'checkresult'() + getattribute $P1, self, 'lexpr' + $P2 = $P1.'emit_get'(__ARG_1) null $S1 - if_null $P1, __label_1 - set $S1, $P1 + if_null $P2, __label_1 + set $S1, $P2 __label_1: -.annotate 'line', 3809 -# reg: $S2 - getattribute $P2, self, 'lexpr' - $P1 = $P2.'emit_get'(__ARG_1) + getattribute $P3, self, 'rexpr' + $P2 = $P3.'emit_get'(__ARG_1) null $S2 - if_null $P1, __label_2 - set $S2, $P1 + if_null $P2, __label_2 + set $S2, $P2 __label_2: -.annotate 'line', 3810 -# reg2: $S3 - getattribute $P2, self, 'rexpr' - $P1 = $P2.'emit_get'(__ARG_1) - null $S3 - if_null $P1, __label_3 - set $S3, $P1 - __label_3: -.annotate 'line', 3811 self.'annotate'(__ARG_1) -.annotate 'line', 3812 - __ARG_1.'emitarg2'('div', $S2, $S3) -.annotate 'line', 3813 - .return($S2) -# } -.annotate 'line', 3814 + __ARG_1.'emitarg2'('div', $S1, $S2) + isa $I1, $P1, [ 'Winxed'; 'Compiler'; 'LexicalVolatileExpr' ] + unless $I1 goto __label_3 + $P1.'emit_store'(__ARG_1, $S1) + __label_3: # endif + .return($S1) .end # emit_get .sub Winxed_class_init :anon :load :init newclass $P0, [ 'Winxed'; 'Compiler'; 'OpDivToExpr' ] -.annotate 'line', 3803 get_class $P1, [ 'Winxed'; 'Compiler'; 'OpBaseAssignExpr' ] addparent $P0, $P1 .end @@ -10905,180 +8780,123 @@ .sub 'emit_get' :method .param pmc __ARG_1 -# Body -# { -.annotate 'line', 3823 self.'checkleft'() -.annotate 'line', 3824 -# type: $S1 - getattribute $P2, self, 'lexpr' - $P1 = $P2.'checkresult'() + getattribute $P1, self, 'lexpr' + $P2 = $P1.'emit_get'(__ARG_1) null $S1 - if_null $P1, __label_1 - set $S1, $P1 + if_null $P2, __label_1 + set $S1, $P2 __label_1: -.annotate 'line', 3825 -# reg: $S2 - getattribute $P2, self, 'lexpr' - $P1 = $P2.'emit_get'(__ARG_1) + getattribute $P3, self, 'rexpr' + $P2 = $P3.'emit_get'(__ARG_1) null $S2 - if_null $P1, __label_2 - set $S2, $P1 + if_null $P2, __label_2 + set $S2, $P2 __label_2: -.annotate 'line', 3826 -# reg2: $S3 - getattribute $P2, self, 'rexpr' - $P1 = $P2.'emit_get'(__ARG_1) - null $S3 - if_null $P1, __label_3 - set $S3, $P1 - __label_3: -.annotate 'line', 3827 self.'annotate'(__ARG_1) -.annotate 'line', 3828 - __ARG_1.'emitarg2'('mod', $S2, $S3) -.annotate 'line', 3829 - .return($S2) -# } -.annotate 'line', 3830 + __ARG_1.'emitarg2'('mod', $S1, $S2) + isa $I1, $P1, [ 'Winxed'; 'Compiler'; 'LexicalVolatileExpr' ] + unless $I1 goto __label_3 + $P1.'emit_store'(__ARG_1, $S1) + __label_3: # endif + .return($S1) .end # emit_get .sub Winxed_class_init :anon :load :init newclass $P0, [ 'Winxed'; 'Compiler'; 'OpModToExpr' ] -.annotate 'line', 3819 get_class $P1, [ 'Winxed'; 'Compiler'; 'OpBaseAssignExpr' ] addparent $P0, $P1 .end +.namespace [ 'Winxed'; 'Compiler' ] .namespace [ 'Winxed'; 'Compiler'; 'ComparatorBaseExpr' ] .sub 'checkresult' :method -# Body -# { -.annotate 'line', 3837 .return('I') -# } .end # checkresult .sub 'optimize' :method -.const 'Sub' WSubId_21 = "WSubId_21" -# Body -# { -.annotate 'line', 3840 +.const 'Sub' WSubId_44 = "WSubId_44" self.'optimizearg'() -.annotate 'line', 3841 -# var lexpr: $P1 getattribute $P1, self, 'lexpr' -.annotate 'line', 3842 -# var rexpr: $P2 getattribute $P2, self, 'rexpr' -.annotate 'line', 3843 - $I3 = $P1.'isintegerliteral'() - unless $I3 goto __label_2 - $I3 = $P2.'isintegerliteral'() + $P3 = $P1.'isintegerliteral'() + unless $P3 goto __label_2 + $P3 = $P2.'isintegerliteral'() __label_2: - unless $I3 goto __label_1 -# { -.annotate 'line', 3844 -# li: $I1 - $P3 = $P1.'getIntegerValue'() - set $I1, $P3 -.annotate 'line', 3845 -# ri: $I2 + if_null $P3, __label_1 + unless $P3 goto __label_1 + $P4 = $P1.'getIntegerValue'() + set $I1, $P4 $P3 = $P2.'getIntegerValue'() set $I2, $P3 -.annotate 'line', 3846 getattribute $P3, self, 'owner' getattribute $P4, self, 'start' $P5 = self.'int_op'($I1, $I2) - .tailcall WSubId_21($P3, $P4, $P5) -# } + .tailcall WSubId_44($P3, $P4, $P5) __label_1: # endif -.annotate 'line', 3848 .return(self) -# } -.annotate 'line', 3849 .end # optimize .sub 'emit_comparator' :method .param pmc __ARG_1 - .param pmc __ARG_2 + .param string __ARG_2 .param int __ARG_3 :optional -# Body -# { -.annotate 'line', 3852 -# rl: $S1 getattribute $P2, self, 'lexpr' $P1 = $P2.'checkresult'() null $S1 if_null $P1, __label_1 set $S1, $P1 __label_1: -.annotate 'line', 3853 -# rr: $S2 getattribute $P2, self, 'rexpr' $P1 = $P2.'checkresult'() null $S2 if_null $P1, __label_2 set $S2, $P1 __label_2: -.annotate 'line', 3854 -# regl: $S3 getattribute $P2, self, 'lexpr' $P1 = $P2.'emit_get'(__ARG_1) null $S3 if_null $P1, __label_3 set $S3, $P1 __label_3: -.annotate 'line', 3855 -# regr: $S4 getattribute $P2, self, 'rexpr' $P1 = $P2.'emit_get'(__ARG_1) null $S4 if_null $P1, __label_4 set $S4, $P1 __label_4: -.annotate 'line', 3856 self.'annotate'(__ARG_1) -.annotate 'line', 3857 -# aux: $S5 null $S5 -# switch-case -.annotate 'line', 3859 iseq $I1, $S1, 'I' unless $I1 goto __label_8 iseq $I1, $S2, 'N' __label_8: if $I1 goto __label_7 -.annotate 'line', 3864 iseq $I1, $S1, 'N' unless $I1 goto __label_10 iseq $I1, $S2, 'I' __label_10: if $I1 goto __label_9 -.annotate 'line', 3869 iseq $I1, $S2, 'I' unless $I1 goto __label_12 iseq $I1, $S1, 'P' __label_12: if $I1 goto __label_11 -.annotate 'line', 3874 iseq $I1, $S2, 'P' unless $I1 goto __label_14 iseq $I1, $S1, 'I' __label_14: if $I1 goto __label_13 -.annotate 'line', 3879 iseq $I1, $S2, 'S' unless $I1 goto __label_16 iseq $I1, $S1, 'P' __label_16: if $I1 goto __label_15 -.annotate 'line', 3884 iseq $I1, $S2, 'P' unless $I1 goto __label_18 iseq $I1, $S1, 'S' @@ -11086,102 +8904,66 @@ if $I1 goto __label_17 goto __label_6 __label_7: # case -.annotate 'line', 3860 $P1 = self.'tempreg'('N') set $S5, $P1 -.annotate 'line', 3861 __ARG_1.'emitset'($S5, $S3) -.annotate 'line', 3862 set $S3, $S5 goto __label_5 # break __label_9: # case -.annotate 'line', 3865 $P2 = self.'tempreg'('N') set $S5, $P2 -.annotate 'line', 3866 __ARG_1.'emitset'($S5, $S4) -.annotate 'line', 3867 set $S4, $S5 goto __label_5 # break __label_11: # case -.annotate 'line', 3870 $P3 = self.'tempreg'('I') set $S5, $P3 -.annotate 'line', 3871 __ARG_1.'emitset'($S5, $S3) -.annotate 'line', 3872 set $S3, $S5 goto __label_5 # break __label_13: # case -.annotate 'line', 3875 $P4 = self.'tempreg'('I') set $S5, $P4 -.annotate 'line', 3876 __ARG_1.'emitset'($S5, $S4) -.annotate 'line', 3877 set $S4, $S5 goto __label_5 # break __label_15: # case -.annotate 'line', 3880 $P5 = self.'tempreg'('S') set $S5, $P5 -.annotate 'line', 3881 __ARG_1.'emitset'($S5, $S3) -.annotate 'line', 3882 set $S3, $S5 goto __label_5 # break __label_17: # case -.annotate 'line', 3885 $P6 = self.'tempreg'('S') set $S5, $P6 -.annotate 'line', 3886 __ARG_1.'emitset'($S5, $S4) -.annotate 'line', 3887 set $S4, $S5 goto __label_5 # break __label_6: # default __label_5: # switch end -.annotate 'line', 3888 -# switch -.annotate 'line', 3891 - set $I1, __ARG_3 - null $I2 - if $I1 == $I2 goto __label_21 - set $I2, 1 - if $I1 == $I2 goto __label_22 - set $I2, 2 - if $I1 == $I2 goto __label_23 - goto __label_20 + if __ARG_3 == 0 goto __label_21 + if __ARG_3 == 1 goto __label_22 + if __ARG_3 == 2 goto __label_23 + goto __label_19 __label_21: # case -.annotate 'line', 3893 self.'emitop'(__ARG_1, __ARG_2, $S3, $S4) - goto __label_19 # break + goto __label_20 # break __label_22: # case -.annotate 'line', 3896 self.'emitop_if'(__ARG_1, __ARG_2, $S3, $S4) - goto __label_19 # break + goto __label_20 # break __label_23: # case -.annotate 'line', 3899 self.'emitop_else'(__ARG_1, __ARG_2, $S3, $S4) - goto __label_19 # break - __label_20: # default - __label_19: # switch end -.annotate 'line', 3900 -# } -.annotate 'line', 3902 + goto __label_20 # break + __label_19: # default + __label_20: # switch end .end # emit_comparator .sub 'emit' :method .param pmc __ARG_1 - .param pmc __ARG_2 -# Body -# { -.annotate 'line', 3905 + .param string __ARG_2 self.'emit_comparator'(__ARG_1, __ARG_2) -# } -.annotate 'line', 3906 .end # emit @@ -11189,12 +8971,7 @@ .sub 'emit_if' :method .param pmc __ARG_1 .param string __ARG_2 -# Body -# { -.annotate 'line', 3909 self.'emit_comparator'(__ARG_1, __ARG_2, 1) -# } -.annotate 'line', 3910 .end # emit_if @@ -11202,303 +8979,387 @@ .sub 'emit_else' :method .param pmc __ARG_1 .param string __ARG_2 -# Body -# { -.annotate 'line', 3913 self.'emit_comparator'(__ARG_1, __ARG_2, 2) -# } -.annotate 'line', 3914 .end # emit_else .sub Winxed_class_init :anon :load :init newclass $P0, [ 'Winxed'; 'Compiler'; 'ComparatorBaseExpr' ] -.annotate 'line', 3835 get_class $P1, [ 'Winxed'; 'Compiler'; 'OpBinaryExpr' ] addparent $P0, $P1 .end -.namespace [ 'Winxed'; 'Compiler'; 'NullCheckerExpr' ] +.namespace [ 'Winxed'; 'Compiler'; 'Negable' ] -.sub 'NullCheckerExpr' :method +.sub 'Negable' :method + .param int __ARG_1 + new $P2, [ 'Boolean' ], __ARG_1 + setattribute self, 'positive', $P2 + +.end # Negable + + +.sub 'isnegable' :method + .return(1) + +.end # isnegable + + +.sub 'negated' :method + getattribute $P1, self, 'positive' + isfalse $I1, $P1 + getattribute $P1, self, 'positive' + assign $P1, $I1 + .return(self) + +.end # negated + +.sub Winxed_class_init :anon :load :init + newclass $P0, [ 'Winxed'; 'Compiler'; 'Negable' ] + addattribute $P0, 'positive' +.end +.namespace [ 'Winxed'; 'Compiler'; 'CheckerExpr' ] + +.sub 'CheckerExpr' :method .param pmc __ARG_1 .param pmc __ARG_2 .param int __ARG_3 -# Body -# { -.annotate 'line', 3929 getattribute $P1, __ARG_1, 'owner' getattribute $P2, __ARG_1, 'start' self.'Expr'($P1, $P2) -.annotate 'line', 3930 + self.'Negable'(__ARG_3) setattribute self, 'expr', __ARG_2 -.annotate 'line', 3931 - box $P1, __ARG_3 - setattribute self, 'checknull', $P1 -# } -.annotate 'line', 3932 - -.end # NullCheckerExpr - - -.sub 'checkresult' :method -# Body -# { -.annotate 'line', 3933 - .return('I') -# } -.end # checkresult +.end # CheckerExpr .sub 'isnegable' :method -# Body -# { -.annotate 'line', 3934 .return(1) -# } .end # isnegable -.sub 'negated' :method -# Body -# { -.annotate 'line', 3937 -# checkneg: $I1 - getattribute $P1, self, 'checknull' - isfalse $I1, $P1 -.annotate 'line', 3938 - box $P1, $I1 - setattribute self, 'checknull', $P1 -.annotate 'line', 3939 - .return(self) -# } -.annotate 'line', 3940 +.sub 'checkresult' :method + .return('I') -.end # negated +.end # checkresult + +.sub Winxed_class_init :anon :load :init + newclass $P0, [ 'Winxed'; 'Compiler'; 'CheckerExpr' ] + get_class $P1, [ 'Winxed'; 'Compiler'; 'Expr' ] + addparent $P0, $P1 + get_class $P2, [ 'Winxed'; 'Compiler'; 'Negable' ] + addparent $P0, $P2 + addattribute $P0, 'expr' +.end +.namespace [ 'Winxed'; 'Compiler'; 'NullCheckerExpr' ] + +.sub 'NullCheckerExpr' :method + .param pmc __ARG_1 + .param pmc __ARG_2 + .param int __ARG_3 + self.'CheckerExpr'(__ARG_1, __ARG_2, __ARG_3) + +.end # NullCheckerExpr .sub 'emit' :method .param pmc __ARG_1 - .param pmc __ARG_2 -# Body -# { -.annotate 'line', 3943 -# reg: $S1 + .param string __ARG_2 getattribute $P2, self, 'expr' $P1 = $P2.'emit_get'(__ARG_1) null $S1 if_null $P1, __label_1 set $S1, $P1 __label_1: -.annotate 'line', 3944 self.'annotate'(__ARG_1) -.annotate 'line', 3945 __ARG_1.'emitarg2'('isnull', __ARG_2, $S1) -.annotate 'line', 3946 - getattribute $P1, self, 'checknull' + getattribute $P1, self, 'positive' isfalse $I1, $P1 unless $I1 goto __label_2 -.annotate 'line', 3947 __ARG_1.'emitarg1'('not', __ARG_2) __label_2: # endif -# } -.annotate 'line', 3948 .end # emit -.sub 'emit_else' :method +.sub 'emit_if' :method .param pmc __ARG_1 .param string __ARG_2 -# Body -# { -.annotate 'line', 3951 -# reg: $S1 getattribute $P2, self, 'expr' $P1 = $P2.'emit_get'(__ARG_1) null $S1 if_null $P1, __label_1 set $S1, $P1 __label_1: -.annotate 'line', 3952 self.'annotate'(__ARG_1) -.annotate 'line', 3953 - getattribute $P1, self, 'checknull' - if_null $P1, __label_3 - unless $P1 goto __label_3 - set $S2, 'unless' - goto __label_2 - __label_3: - set $S2, 'if' - __label_2: - __ARG_1.'say'(' ', $S2, '_null ', $S1, ', ', __ARG_2) -# } -.annotate 'line', 3954 + getattribute $P1, self, 'positive' + if_null $P1, __label_2 + unless $P1 goto __label_2 + __ARG_1.'emitif_null'($S1, __ARG_2) + goto __label_3 + __label_2: # else + __ARG_1.'emitunless_null'($S1, __ARG_2) + __label_3: # endif -.end # emit_else +.end # emit_if -.sub Winxed_class_init :anon :load :init - newclass $P0, [ 'Winxed'; 'Compiler'; 'NullCheckerExpr' ] -.annotate 'line', 3922 - get_class $P1, [ 'Winxed'; 'Compiler'; 'Expr' ] + +.sub 'emit_else' :method + .param pmc __ARG_1 + .param string __ARG_2 + getattribute $P2, self, 'expr' + $P1 = $P2.'emit_get'(__ARG_1) + null $S1 + if_null $P1, __label_1 + set $S1, $P1 + __label_1: + self.'annotate'(__ARG_1) + getattribute $P1, self, 'positive' + if_null $P1, __label_2 + unless $P1 goto __label_2 + __ARG_1.'emitunless_null'($S1, __ARG_2) + goto __label_3 + __label_2: # else + __ARG_1.'emitif_null'($S1, __ARG_2) + __label_3: # endif + +.end # emit_else + +.sub Winxed_class_init :anon :load :init + newclass $P0, [ 'Winxed'; 'Compiler'; 'NullCheckerExpr' ] + get_class $P1, [ 'Winxed'; 'Compiler'; 'CheckerExpr' ] + addparent $P0, $P1 +.end +.namespace [ 'Winxed'; 'Compiler'; 'ZeroCheckerExpr' ] + +.sub 'ZeroCheckerExpr' :method + .param pmc __ARG_1 + .param pmc __ARG_2 + .param int __ARG_3 + self.'CheckerExpr'(__ARG_1, __ARG_2, __ARG_3) + +.end # ZeroCheckerExpr + + +.sub 'emit' :method + .param pmc __ARG_1 + .param string __ARG_2 + getattribute $P1, self, 'expr' + $P2 = $P1.'emit_getint'(__ARG_1) + null $S1 + if_null $P2, __label_1 + set $S1, $P2 + __label_1: + self.'annotate'(__ARG_1) + getattribute $P2, self, 'positive' + if_null $P2, __label_2 + unless $P2 goto __label_2 + __ARG_1.'emitarg3'('iseq', __ARG_2, $S1, 0) + goto __label_3 + __label_2: # else + __ARG_1.'emitarg3'('isne', __ARG_2, $S1, 0) + __label_3: # endif + +.end # emit + + +.sub 'emit_if' :method + .param pmc __ARG_1 + .param string __ARG_2 + getattribute $P1, self, 'expr' + $P2 = $P1.'emit_getint'(__ARG_1) + null $S1 + if_null $P2, __label_1 + set $S1, $P2 + __label_1: + self.'annotate'(__ARG_1) + getattribute $P2, self, 'positive' + if_null $P2, __label_2 + unless $P2 goto __label_2 + __ARG_1.'emitunless'($S1, __ARG_2) + goto __label_3 + __label_2: # else + __ARG_1.'emitif'($S1, __ARG_2) + __label_3: # endif + +.end # emit_if + + +.sub 'emit_else' :method + .param pmc __ARG_1 + .param string __ARG_2 + getattribute $P1, self, 'expr' + $P2 = $P1.'emit_getint'(__ARG_1) + null $S1 + if_null $P2, __label_1 + set $S1, $P2 + __label_1: + self.'annotate'(__ARG_1) + getattribute $P2, self, 'positive' + if_null $P2, __label_2 + unless $P2 goto __label_2 + __ARG_1.'emitif'($S1, __ARG_2) + goto __label_3 + __label_2: # else + __ARG_1.'emitunless'($S1, __ARG_2) + __label_3: # endif + +.end # emit_else + +.sub Winxed_class_init :anon :load :init + newclass $P0, [ 'Winxed'; 'Compiler'; 'ZeroCheckerExpr' ] + get_class $P1, [ 'Winxed'; 'Compiler'; 'CheckerExpr' ] addparent $P0, $P1 -.annotate 'line', 3924 - addattribute $P0, 'expr' -.annotate 'line', 3925 - addattribute $P0, 'checknull' .end .namespace [ 'Winxed'; 'Compiler'; 'OpEqualExpr' ] -.sub 'isnegable' :method -# Body -# { -.annotate 'line', 3961 - .return(1) -# } +.sub 'OpEqualExpr' :method + .param pmc __ARG_1 + .param pmc __ARG_2 + .param pmc __ARG_3 + .param pmc __ARG_4 + .param int __ARG_5 + self.'set'(__ARG_1, __ARG_2, __ARG_3, __ARG_4) + self.'Negable'(__ARG_5) -.end # isnegable +.end # OpEqualExpr -.sub 'negated' :method -# Body -# { -.annotate 'line', 3964 - new $P1, [ 'Winxed'; 'Compiler'; 'OpNotEqualExpr' ] - .tailcall $P1.'setfrom'(self) -# } -.annotate 'line', 3965 +.sub 'clone' :method + .param pmc __ARG_1 + new $P2, [ 'Winxed'; 'Compiler'; 'OpEqualExpr' ] + $P1 = self.'clonebinary'($P2, __ARG_1) + getattribute $P2, self, 'positive' + $P1.'Negable'($P2) + .return($P1) -.end # negated +.end # clone + + +.sub 'isnegable' :method + .return(1) + +.end # isnegable .sub 'optimize' :method -.const 'Sub' WSubId_21 = "WSubId_21" -# Body -# { -.annotate 'line', 3968 +.const 'Sub' WSubId_44 = "WSubId_44" self.'optimizearg'() -.annotate 'line', 3969 -# var lexpr: $P1 getattribute $P1, self, 'lexpr' -.annotate 'line', 3970 -# var rexpr: $P2 getattribute $P2, self, 'rexpr' -.annotate 'line', 3971 -# lnull: $I1 $P3 = $P1.'isnull'() set $I1, $P3 -.annotate 'line', 3972 -# rnull: $I2 $P3 = $P2.'isnull'() set $I2, $P3 -.annotate 'line', 3973 unless $I1 goto __label_1 -# { -.annotate 'line', 3974 unless $I2 goto __label_2 -.annotate 'line', 3975 getattribute $P3, self, 'owner' getattribute $P4, self, 'start' - .tailcall WSubId_21($P3, $P4, 1) + getattribute $P5, self, 'positive' + .tailcall WSubId_44($P3, $P4, $P5) goto __label_3 __label_2: # else -.annotate 'line', 3977 - new $P6, [ 'Winxed'; 'Compiler'; 'NullCheckerExpr' ] - getattribute $P7, self, 'rexpr' - $P6.'NullCheckerExpr'(self, $P7, 1) - set $P5, $P6 - .return($P5) + new $P7, [ 'Winxed'; 'Compiler'; 'NullCheckerExpr' ] + getattribute $P8, self, 'positive' + $P7.'NullCheckerExpr'(self, $P2, $P8) + set $P6, $P7 + .return($P6) __label_3: # endif -# } __label_1: # endif -.annotate 'line', 3979 unless $I2 goto __label_4 -.annotate 'line', 3980 new $P4, [ 'Winxed'; 'Compiler'; 'NullCheckerExpr' ] - getattribute $P5, self, 'lexpr' - $P4.'NullCheckerExpr'(self, $P5, 1) + getattribute $P5, self, 'positive' + $P4.'NullCheckerExpr'(self, $P1, $P5) set $P3, $P4 .return($P3) __label_4: # endif -.annotate 'line', 3981 - $I5 = $P1.'isliteral'() - unless $I5 goto __label_6 - $I5 = $P2.'isliteral'() - __label_6: - unless $I5 goto __label_5 -# { -.annotate 'line', 3982 -# ltype: $S1 $P3 = $P1.'checkresult'() null $S1 - if_null $P3, __label_7 + if_null $P3, __label_5 set $S1, $P3 - __label_7: -.annotate 'line', 3983 -# rtype: $S2 + __label_5: $P3 = $P2.'checkresult'() null $S2 - if_null $P3, __label_8 + if_null $P3, __label_6 set $S2, $P3 + __label_6: + $P3 = $P1.'isliteral'() + unless $P3 goto __label_8 + $P3 = $P2.'isliteral'() __label_8: -.annotate 'line', 3984 + if_null $P3, __label_7 + unless $P3 goto __label_7 ne $S1, $S2, __label_9 -# { -# switch -.annotate 'line', 3985 - set $S5, $S1 - set $S6, 'I' - if $S5 == $S6 goto __label_12 - set $S6, 'S' - if $S5 == $S6 goto __label_13 - goto __label_11 + if_null $S1, __label_10 + length $I7, $S1 + ne $I7, 1, __label_10 + ord $I7, $S1 + if $I7 == 73 goto __label_12 + if $I7 == 83 goto __label_13 + goto __label_10 __label_12: # case -.annotate 'line', 3987 -# li: $I3 - $P3 = $P1.'getIntegerValue'() - set $I3, $P3 -.annotate 'line', 3988 -# ri: $I4 - $P4 = $P2.'getIntegerValue'() - set $I4, $P4 -.annotate 'line', 3989 - getattribute $P5, self, 'owner' - getattribute $P6, self, 'start' + $P4 = $P1.'getIntegerValue'() + set $I3, $P4 + $P5 = $P2.'getIntegerValue'() + set $I4, $P5 + getattribute $P6, self, 'positive' + if_null $P6, __label_15 + unless $P6 goto __label_15 iseq $I5, $I3, $I4 - .tailcall WSubId_21($P5, $P6, $I5) - __label_13: # case -.annotate 'line', 3991 -# ls: $S3 - getattribute $P8, $P1, 'strval' - getattribute $P7, $P8, 'str' - null $S3 - if_null $P7, __label_14 - set $S3, $P7 + goto __label_14 + __label_15: + isne $I5, $I3, $I4 __label_14: -.annotate 'line', 3992 -# rs: $S4 - getattribute $P10, $P2, 'strval' + getattribute $P7, self, 'owner' + getattribute $P8, self, 'start' + .tailcall WSubId_44($P7, $P8, $I5) + __label_13: # case + getattribute $P10, $P1, 'strval' getattribute $P9, $P10, 'str' + null $S3 + if_null $P9, __label_16 + set $S3, $P9 + __label_16: + getattribute $P12, $P2, 'strval' + getattribute $P11, $P12, 'str' null $S4 - if_null $P9, __label_15 - set $S4, $P9 - __label_15: -.annotate 'line', 3993 - getattribute $P11, self, 'owner' - getattribute $P12, self, 'start' + if_null $P11, __label_17 + set $S4, $P11 + __label_17: + getattribute $P13, self, 'positive' + if_null $P13, __label_19 + unless $P13 goto __label_19 iseq $I6, $S3, $S4 - .tailcall WSubId_21($P11, $P12, $I6) - __label_11: # default - __label_10: # switch end -# } + goto __label_18 + __label_19: + isne $I6, $S3, $S4 + __label_18: + getattribute $P14, self, 'owner' + getattribute $P15, self, 'start' + .tailcall WSubId_44($P14, $P15, $I6) + __label_10: # default + __label_11: # switch end __label_9: # endif -# } - __label_5: # endif -.annotate 'line', 3997 + __label_7: # endif + $P3 = $P2.'isintegerzero'() + if_null $P3, __label_20 + unless $P3 goto __label_20 + new $P5, [ 'Winxed'; 'Compiler'; 'ZeroCheckerExpr' ] + getattribute $P6, self, 'positive' + $P5.'ZeroCheckerExpr'(self, $P1, $P6) + set $P4, $P5 + .return($P4) + __label_20: # endif + $P3 = $P1.'isintegerzero'() + if_null $P3, __label_21 + unless $P3 goto __label_21 + new $P5, [ 'Winxed'; 'Compiler'; 'ZeroCheckerExpr' ] + getattribute $P6, self, 'positive' + $P5.'ZeroCheckerExpr'(self, $P2, $P6) + set $P4, $P5 + .return($P4) + __label_21: # endif .return(self) -# } -.annotate 'line', 3998 .end # optimize @@ -11508,25 +9369,25 @@ .param string __ARG_2 .param string __ARG_3 .param string __ARG_4 -# Body -# { -.annotate 'line', 4001 - __ARG_1.'emitbinop'('iseq', __ARG_2, __ARG_3, __ARG_4) -# } -.annotate 'line', 4002 + self.'annotate'(__ARG_1) + getattribute $P1, self, 'positive' + if_null $P1, __label_2 + unless $P1 goto __label_2 + set $S1, 'iseq' + goto __label_1 + __label_2: + set $S1, 'isne' + __label_1: + __ARG_1.'emitbinop'($S1, __ARG_2, __ARG_3, __ARG_4) .end # emitop .sub 'emit' :method .param pmc __ARG_1 - .param pmc __ARG_2 -# Body -# { -.annotate 'line', 4005 + .param string __ARG_2 + self.'annotate'(__ARG_1) self.'emit_comparator'(__ARG_1, __ARG_2) -# } -.annotate 'line', 4006 .end # emit @@ -11536,12 +9397,16 @@ .param string __ARG_2 .param string __ARG_3 .param string __ARG_4 -# Body -# { -.annotate 'line', 4009 - __ARG_1.'emitcompare'('eq', __ARG_3, __ARG_4, __ARG_2) -# } -.annotate 'line', 4010 + self.'annotate'(__ARG_1) + getattribute $P1, self, 'positive' + if_null $P1, __label_2 + unless $P1 goto __label_2 + set $S1, 'eq' + goto __label_1 + __label_2: + set $S1, 'ne' + __label_1: + __ARG_1.'emitcompare'($S1, __ARG_3, __ARG_4, __ARG_2) .end # emitop_if @@ -11551,312 +9416,71 @@ .param string __ARG_2 .param string __ARG_3 .param string __ARG_4 -# Body -# { -.annotate 'line', 4013 - __ARG_1.'emitcompare'('ne', __ARG_3, __ARG_4, __ARG_2) -# } -.annotate 'line', 4014 + self.'annotate'(__ARG_1) + getattribute $P1, self, 'positive' + if_null $P1, __label_2 + unless $P1 goto __label_2 + set $S1, 'ne' + goto __label_1 + __label_2: + set $S1, 'eq' + __label_1: + __ARG_1.'emitcompare'($S1, __ARG_3, __ARG_4, __ARG_2) .end # emitop_else .sub Winxed_class_init :anon :load :init newclass $P0, [ 'Winxed'; 'Compiler'; 'OpEqualExpr' ] -.annotate 'line', 3959 get_class $P1, [ 'Winxed'; 'Compiler'; 'ComparatorBaseExpr' ] addparent $P0, $P1 + get_class $P2, [ 'Winxed'; 'Compiler'; 'Negable' ] + addparent $P0, $P2 .end -.namespace [ 'Winxed'; 'Compiler'; 'OpNotEqualExpr' ] +.namespace [ 'Winxed'; 'Compiler'; 'OpSameExpr' ] + +.sub 'OpSameExpr' :method + .param pmc __ARG_1 + .param pmc __ARG_2 + .param pmc __ARG_3 + .param pmc __ARG_4 + .param int __ARG_5 + self.'initbinary'(__ARG_1, __ARG_2, __ARG_3, __ARG_4) + self.'Negable'(__ARG_5) + +.end # OpSameExpr + + +.sub 'clone' :method + .param pmc __ARG_1 + new $P2, [ 'Winxed'; 'Compiler'; 'OpSameExpr' ] + $P1 = self.'clonebinary'($P2, __ARG_1) + getattribute $P2, self, 'positive' + $P1.'Negable'($P2) + .return($P1) + +.end # clone + .sub 'isnegable' :method -# Body -# { -.annotate 'line', 4021 .return(1) -# } .end # isnegable -.sub 'negated' :method -# Body -# { -.annotate 'line', 4024 - new $P1, [ 'Winxed'; 'Compiler'; 'OpEqualExpr' ] - .tailcall $P1.'setfrom'(self) -# } -.annotate 'line', 4025 +.sub 'int_op' :method + .param int __ARG_1 + .param int __ARG_2 + getattribute $P1, self, 'positive' + if_null $P1, __label_2 + unless $P1 goto __label_2 + iseq $I1, __ARG_1, __ARG_2 + goto __label_1 + __label_2: + isne $I1, __ARG_1, __ARG_2 + __label_1: + .return($I1) -.end # negated - - -.sub 'optimize' :method -.const 'Sub' WSubId_21 = "WSubId_21" -# Body -# { -.annotate 'line', 4028 - self.'optimizearg'() -.annotate 'line', 4029 -# var lexpr: $P1 - getattribute $P1, self, 'lexpr' -.annotate 'line', 4030 -# var rexpr: $P2 - getattribute $P2, self, 'rexpr' -.annotate 'line', 4031 -# lnull: $I1 - $P3 = $P1.'isnull'() - set $I1, $P3 -.annotate 'line', 4032 -# rnull: $I2 - $P3 = $P2.'isnull'() - set $I2, $P3 -.annotate 'line', 4033 - unless $I1 goto __label_1 -# { -.annotate 'line', 4034 - unless $I2 goto __label_2 -.annotate 'line', 4035 - getattribute $P3, self, 'owner' - getattribute $P4, self, 'start' - .tailcall WSubId_21($P3, $P4, 0) - goto __label_3 - __label_2: # else -.annotate 'line', 4037 - new $P6, [ 'Winxed'; 'Compiler'; 'NullCheckerExpr' ] - getattribute $P7, self, 'rexpr' - $P6.'NullCheckerExpr'(self, $P7, 0) - set $P5, $P6 - .return($P5) - __label_3: # endif -# } - __label_1: # endif -.annotate 'line', 4039 - unless $I2 goto __label_4 -.annotate 'line', 4040 - new $P4, [ 'Winxed'; 'Compiler'; 'NullCheckerExpr' ] - getattribute $P5, self, 'lexpr' - $P4.'NullCheckerExpr'(self, $P5, 0) - set $P3, $P4 - .return($P3) - __label_4: # endif -.annotate 'line', 4041 - $I5 = $P1.'isliteral'() - unless $I5 goto __label_6 - $I5 = $P2.'isliteral'() - __label_6: - unless $I5 goto __label_5 -# { -.annotate 'line', 4042 -# ltype: $S1 - $P3 = $P1.'checkresult'() - null $S1 - if_null $P3, __label_7 - set $S1, $P3 - __label_7: -.annotate 'line', 4043 -# rtype: $S2 - $P3 = $P2.'checkresult'() - null $S2 - if_null $P3, __label_8 - set $S2, $P3 - __label_8: -.annotate 'line', 4044 - ne $S1, $S2, __label_9 -# { -# switch -.annotate 'line', 4045 - set $S5, $S1 - set $S6, 'I' - if $S5 == $S6 goto __label_12 - set $S6, 'S' - if $S5 == $S6 goto __label_13 - goto __label_11 - __label_12: # case -.annotate 'line', 4047 -# li: $I3 - $P3 = $P1.'getIntegerValue'() - set $I3, $P3 -.annotate 'line', 4048 -# ri: $I4 - $P4 = $P2.'getIntegerValue'() - set $I4, $P4 -.annotate 'line', 4049 - getattribute $P5, self, 'owner' - getattribute $P6, self, 'start' - isne $I5, $I3, $I4 - .tailcall WSubId_21($P5, $P6, $I5) - __label_13: # case -.annotate 'line', 4051 -# ls: $S3 - getattribute $P8, $P1, 'strval' - getattribute $P7, $P8, 'str' - null $S3 - if_null $P7, __label_14 - set $S3, $P7 - __label_14: -.annotate 'line', 4052 -# rs: $S4 - getattribute $P10, $P2, 'strval' - getattribute $P9, $P10, 'str' - null $S4 - if_null $P9, __label_15 - set $S4, $P9 - __label_15: -.annotate 'line', 4053 - getattribute $P11, self, 'owner' - getattribute $P12, self, 'start' - isne $I6, $S3, $S4 - .tailcall WSubId_21($P11, $P12, $I6) - __label_11: # default - __label_10: # switch end -# } - __label_9: # endif -# } - __label_5: # endif -.annotate 'line', 4057 - .return(self) -# } -.annotate 'line', 4058 - -.end # optimize - - -.sub 'emitop' :method - .param pmc __ARG_1 - .param string __ARG_2 - .param string __ARG_3 - .param string __ARG_4 -# Body -# { -.annotate 'line', 4061 - __ARG_1.'emitbinop'('isne', __ARG_2, __ARG_3, __ARG_4) -# } -.annotate 'line', 4062 - -.end # emitop - - -.sub 'emit' :method - .param pmc __ARG_1 - .param pmc __ARG_2 -# Body -# { -.annotate 'line', 4065 - self.'emit_comparator'(__ARG_1, __ARG_2) -# } -.annotate 'line', 4066 - -.end # emit - - -.sub 'emitop_if' :method - .param pmc __ARG_1 - .param string __ARG_2 - .param string __ARG_3 - .param string __ARG_4 -# Body -# { -.annotate 'line', 4069 - __ARG_1.'emitcompare'('ne', __ARG_3, __ARG_4, __ARG_2) -# } -.annotate 'line', 4070 - -.end # emitop_if - - -.sub 'emitop_else' :method - .param pmc __ARG_1 - .param string __ARG_2 - .param string __ARG_3 - .param string __ARG_4 -# Body -# { -.annotate 'line', 4073 - __ARG_1.'emitcompare'('eq', __ARG_3, __ARG_4, __ARG_2) -# } -.annotate 'line', 4074 - -.end # emitop_else - -.sub Winxed_class_init :anon :load :init - newclass $P0, [ 'Winxed'; 'Compiler'; 'OpNotEqualExpr' ] -.annotate 'line', 4019 - get_class $P1, [ 'Winxed'; 'Compiler'; 'ComparatorBaseExpr' ] - addparent $P0, $P1 -.end -.namespace [ 'Winxed'; 'Compiler'; 'OpSameExpr' ] - -.sub 'OpSameExpr' :method - .param int __ARG_1 - .param pmc __ARG_2 - .param pmc __ARG_3 - .param pmc __ARG_4 - .param pmc __ARG_5 -# Body -# { -.annotate 'line', 4084 - self.'initbinary'(__ARG_2, __ARG_3, __ARG_4, __ARG_5) -.annotate 'line', 4085 - box $P1, __ARG_1 - setattribute self, 'positive', $P1 -# } -.annotate 'line', 4086 - -.end # OpSameExpr - - -.sub 'isnegable' :method -# Body -# { -.annotate 'line', 4087 - .return(1) -# } - -.end # isnegable - - -.sub 'negated' :method -# Body -# { -.annotate 'line', 4090 -# positive: $I1 - getattribute $P1, self, 'positive' - set $I1, $P1 -.annotate 'line', 4091 - new $P2, [ 'Winxed'; 'Compiler'; 'OpSameExpr' ] - not $I2, $I1 - getattribute $P3, self, 'owner' - getattribute $P4, self, 'start' - getattribute $P5, self, 'lexpr' - getattribute $P6, self, 'rexpr' - $P2.'OpSameExpr'($I2, $P3, $P4, $P5, $P6) - set $P1, $P2 - .return($P1) -# } -.annotate 'line', 4092 - -.end # negated - - -.sub 'int_op' :method - .param int __ARG_1 - .param int __ARG_2 -# Body -# { -.annotate 'line', 4095 - getattribute $P1, self, 'positive' - if_null $P1, __label_2 - unless $P1 goto __label_2 - iseq $I1, __ARG_1, __ARG_2 - goto __label_1 - __label_2: - isne $I1, __ARG_1, __ARG_2 - __label_1: - .return($I1) -# } -.annotate 'line', 4096 - -.end # int_op +.end # int_op .sub 'emitop' :method @@ -11864,37 +9488,24 @@ .param string __ARG_2 .param string __ARG_3 .param string __ARG_4 -# Body -# { -.annotate 'line', 4099 -# positive: $I1 + self.'annotate'(__ARG_1) getattribute $P1, self, 'positive' set $I1, $P1 -.annotate 'line', 4100 -# op: $S1 unless $I1 goto __label_2 set $S1, 'issame' goto __label_1 __label_2: set $S1, 'isntsame' __label_1: -.annotate 'line', 4101 __ARG_1.'emitbinop'($S1, __ARG_2, __ARG_3, __ARG_4) -# } -.annotate 'line', 4102 .end # emitop .sub 'emit' :method .param pmc __ARG_1 - .param pmc __ARG_2 -# Body -# { -.annotate 'line', 4105 + .param string __ARG_2 self.'emit_comparator'(__ARG_1, __ARG_2) -# } -.annotate 'line', 4106 .end # emit @@ -11904,24 +9515,16 @@ .param string __ARG_2 .param string __ARG_3 .param string __ARG_4 -# Body -# { -.annotate 'line', 4109 -# positive: $I1 + self.'annotate'(__ARG_1) getattribute $P1, self, 'positive' set $I1, $P1 -.annotate 'line', 4110 -# op: $S1 unless $I1 goto __label_2 set $S1, 'eq_addr' goto __label_1 __label_2: set $S1, 'ne_addr' __label_1: -.annotate 'line', 4111 __ARG_1.'emitcompare'($S1, __ARG_3, __ARG_4, __ARG_2) -# } -.annotate 'line', 4112 .end # emitop_if @@ -11931,55 +9534,46 @@ .param string __ARG_2 .param string __ARG_3 .param string __ARG_4 -# Body -# { -.annotate 'line', 4115 -# positive: $I1 + self.'annotate'(__ARG_1) getattribute $P1, self, 'positive' set $I1, $P1 -.annotate 'line', 4116 -# op: $S1 unless $I1 goto __label_2 set $S1, 'ne_addr' goto __label_1 __label_2: set $S1, 'eq_addr' __label_1: -.annotate 'line', 4117 __ARG_1.'emitcompare'($S1, __ARG_3, __ARG_4, __ARG_2) -# } -.annotate 'line', 4118 .end # emitop_else .sub Winxed_class_init :anon :load :init newclass $P0, [ 'Winxed'; 'Compiler'; 'OpSameExpr' ] -.annotate 'line', 4079 get_class $P1, [ 'Winxed'; 'Compiler'; 'ComparatorBaseExpr' ] addparent $P0, $P1 -.annotate 'line', 4081 + get_class $P2, [ 'Winxed'; 'Compiler'; 'Negable' ] + addparent $P0, $P2 addattribute $P0, 'positive' .end .namespace [ 'Winxed'; 'Compiler'; 'OpLessExpr' ] +.sub 'clone' :method + .param pmc __ARG_1 + new $P1, [ 'Winxed'; 'Compiler'; 'OpLessExpr' ] + .tailcall self.'clonebinary'($P1, __ARG_1) + +.end # clone + + .sub 'isnegable' :method -# Body -# { -.annotate 'line', 4125 .return(1) -# } .end # isnegable .sub 'negated' :method -# Body -# { -.annotate 'line', 4128 new $P1, [ 'Winxed'; 'Compiler'; 'OpGreaterEqualExpr' ] .tailcall $P1.'setfrom'(self) -# } -.annotate 'line', 4129 .end # negated @@ -11987,13 +9581,8 @@ .sub 'int_op' :method .param int __ARG_1 .param int __ARG_2 -# Body -# { -.annotate 'line', 4132 islt $I1, __ARG_1, __ARG_2 .return($I1) -# } -.annotate 'line', 4133 .end # int_op @@ -12003,12 +9592,7 @@ .param string __ARG_2 .param string __ARG_3 .param string __ARG_4 -# Body -# { -.annotate 'line', 4136 __ARG_1.'emitbinop'('islt', __ARG_2, __ARG_3, __ARG_4) -# } -.annotate 'line', 4137 .end # emitop @@ -12018,12 +9602,7 @@ .param string __ARG_2 .param string __ARG_3 .param string __ARG_4 -# Body -# { -.annotate 'line', 4140 __ARG_1.'emitcompare'('lt', __ARG_3, __ARG_4, __ARG_2) -# } -.annotate 'line', 4141 .end # emitop_if @@ -12033,41 +9612,34 @@ .param string __ARG_2 .param string __ARG_3 .param string __ARG_4 -# Body -# { -.annotate 'line', 4144 __ARG_1.'emitcompare'('ge', __ARG_3, __ARG_4, __ARG_2) -# } -.annotate 'line', 4145 .end # emitop_else .sub Winxed_class_init :anon :load :init newclass $P0, [ 'Winxed'; 'Compiler'; 'OpLessExpr' ] -.annotate 'line', 4123 get_class $P1, [ 'Winxed'; 'Compiler'; 'ComparatorBaseExpr' ] addparent $P0, $P1 .end .namespace [ 'Winxed'; 'Compiler'; 'OpGreaterExpr' ] +.sub 'clone' :method + .param pmc __ARG_1 + new $P1, [ 'Winxed'; 'Compiler'; 'OpGreaterExpr' ] + .tailcall self.'clonebinary'($P1, __ARG_1) + +.end # clone + + .sub 'isnegable' :method -# Body -# { -.annotate 'line', 4152 .return(1) -# } .end # isnegable .sub 'negated' :method -# Body -# { -.annotate 'line', 4155 new $P1, [ 'Winxed'; 'Compiler'; 'OpLessEqualExpr' ] .tailcall $P1.'setfrom'(self) -# } -.annotate 'line', 4156 .end # negated @@ -12075,13 +9647,8 @@ .sub 'int_op' :method .param int __ARG_1 .param int __ARG_2 -# Body -# { -.annotate 'line', 4159 isgt $I1, __ARG_1, __ARG_2 .return($I1) -# } -.annotate 'line', 4160 .end # int_op @@ -12091,12 +9658,7 @@ .param string __ARG_2 .param string __ARG_3 .param string __ARG_4 -# Body -# { -.annotate 'line', 4163 __ARG_1.'emitbinop'('isgt', __ARG_2, __ARG_3, __ARG_4) -# } -.annotate 'line', 4164 .end # emitop @@ -12106,12 +9668,7 @@ .param string __ARG_2 .param string __ARG_3 .param string __ARG_4 -# Body -# { -.annotate 'line', 4167 __ARG_1.'emitcompare'('gt', __ARG_3, __ARG_4, __ARG_2) -# } -.annotate 'line', 4168 .end # emitop_if @@ -12121,41 +9678,34 @@ .param string __ARG_2 .param string __ARG_3 .param string __ARG_4 -# Body -# { -.annotate 'line', 4171 __ARG_1.'emitcompare'('le', __ARG_3, __ARG_4, __ARG_2) -# } -.annotate 'line', 4172 .end # emitop_else .sub Winxed_class_init :anon :load :init newclass $P0, [ 'Winxed'; 'Compiler'; 'OpGreaterExpr' ] -.annotate 'line', 4150 get_class $P1, [ 'Winxed'; 'Compiler'; 'ComparatorBaseExpr' ] addparent $P0, $P1 .end .namespace [ 'Winxed'; 'Compiler'; 'OpLessEqualExpr' ] +.sub 'clone' :method + .param pmc __ARG_1 + new $P1, [ 'Winxed'; 'Compiler'; 'OpLessEqualExpr' ] + .tailcall self.'clonebinary'($P1, __ARG_1) + +.end # clone + + .sub 'isnegable' :method -# Body -# { -.annotate 'line', 4179 .return(1) -# } .end # isnegable .sub 'negated' :method -# Body -# { -.annotate 'line', 4182 new $P1, [ 'Winxed'; 'Compiler'; 'OpGreaterExpr' ] .tailcall $P1.'setfrom'(self) -# } -.annotate 'line', 4183 .end # negated @@ -12163,13 +9713,8 @@ .sub 'int_op' :method .param int __ARG_1 .param int __ARG_2 -# Body -# { -.annotate 'line', 4186 isle $I1, __ARG_1, __ARG_2 .return($I1) -# } -.annotate 'line', 4187 .end # int_op @@ -12179,12 +9724,7 @@ .param string __ARG_2 .param string __ARG_3 .param string __ARG_4 -# Body -# { -.annotate 'line', 4190 __ARG_1.'emitbinop'('isle', __ARG_2, __ARG_3, __ARG_4) -# } -.annotate 'line', 4191 .end # emitop @@ -12194,12 +9734,7 @@ .param string __ARG_2 .param string __ARG_3 .param string __ARG_4 -# Body -# { -.annotate 'line', 4194 __ARG_1.'emitcompare'('le', __ARG_3, __ARG_4, __ARG_2) -# } -.annotate 'line', 4195 .end # emitop_if @@ -12209,41 +9744,34 @@ .param string __ARG_2 .param string __ARG_3 .param string __ARG_4 -# Body -# { -.annotate 'line', 4198 __ARG_1.'emitcompare'('gt', __ARG_3, __ARG_4, __ARG_2) -# } -.annotate 'line', 4199 .end # emitop_else .sub Winxed_class_init :anon :load :init newclass $P0, [ 'Winxed'; 'Compiler'; 'OpLessEqualExpr' ] -.annotate 'line', 4177 get_class $P1, [ 'Winxed'; 'Compiler'; 'ComparatorBaseExpr' ] addparent $P0, $P1 .end .namespace [ 'Winxed'; 'Compiler'; 'OpGreaterEqualExpr' ] +.sub 'clone' :method + .param pmc __ARG_1 + new $P1, [ 'Winxed'; 'Compiler'; 'OpGreaterEqualExpr' ] + .tailcall self.'clonebinary'($P1, __ARG_1) + +.end # clone + + .sub 'isnegable' :method -# Body -# { -.annotate 'line', 4206 .return(1) -# } .end # isnegable .sub 'negated' :method -# Body -# { -.annotate 'line', 4209 new $P1, [ 'Winxed'; 'Compiler'; 'OpLessExpr' ] .tailcall $P1.'setfrom'(self) -# } -.annotate 'line', 4210 .end # negated @@ -12251,13 +9779,8 @@ .sub 'int_op' :method .param int __ARG_1 .param int __ARG_2 -# Body -# { -.annotate 'line', 4213 isge $I1, __ARG_1, __ARG_2 .return($I1) -# } -.annotate 'line', 4214 .end # int_op @@ -12267,12 +9790,7 @@ .param string __ARG_2 .param string __ARG_3 .param string __ARG_4 -# Body -# { -.annotate 'line', 4217 __ARG_1.'emitbinop'('isge', __ARG_2, __ARG_3, __ARG_4) -# } -.annotate 'line', 4218 .end # emitop @@ -12282,12 +9800,7 @@ .param string __ARG_2 .param string __ARG_3 .param string __ARG_4 -# Body -# { -.annotate 'line', 4221 __ARG_1.'emitcompare'('ge', __ARG_3, __ARG_4, __ARG_2) -# } -.annotate 'line', 4222 .end # emitop_if @@ -12297,36 +9810,40 @@ .param string __ARG_2 .param string __ARG_3 .param string __ARG_4 -# Body -# { -.annotate 'line', 4225 __ARG_1.'emitcompare'('lt', __ARG_3, __ARG_4, __ARG_2) -# } -.annotate 'line', 4226 .end # emitop_else .sub Winxed_class_init :anon :load :init newclass $P0, [ 'Winxed'; 'Compiler'; 'OpGreaterEqualExpr' ] -.annotate 'line', 4204 get_class $P1, [ 'Winxed'; 'Compiler'; 'ComparatorBaseExpr' ] addparent $P0, $P1 .end .namespace [ 'Winxed'; 'Compiler'; 'OpBaseBoolExpr' ] .sub 'checkresult' :method -# Body -# { -.annotate 'line', 4235 - .return('I') -# } -.annotate 'line', 4236 + getattribute $P2, self, 'lexpr' + $P1 = $P2.'checkresult'() + set $S2, $P1 + iseq $I1, $S2, 'I' + unless $I1 goto __label_3 + getattribute $P4, self, 'rexpr' + $P3 = $P4.'checkresult'() + set $S3, $P3 + iseq $I1, $S3, 'I' + __label_3: + unless $I1 goto __label_2 + set $S1, 'I' + goto __label_1 + __label_2: + set $S1, 'P' + __label_1: + .return($S1) .end # checkresult .sub Winxed_class_init :anon :load :init newclass $P0, [ 'Winxed'; 'Compiler'; 'OpBaseBoolExpr' ] -.annotate 'line', 4231 get_class $P1, [ 'Winxed'; 'Compiler'; 'OpBinaryExpr' ] addparent $P0, $P1 .end @@ -12337,270 +9854,364 @@ .param pmc __ARG_2 .param pmc __ARG_3 .param pmc __ARG_4 -# Body -# { -.annotate 'line', 4245 self.'set'(__ARG_1, __ARG_2, __ARG_3, __ARG_4) -# } -.annotate 'line', 4246 .end # OpBoolAndExpr +.sub 'clone' :method + .param pmc __ARG_1 + new $P1, [ 'Winxed'; 'Compiler'; 'OpBoolAndExpr' ] + .tailcall self.'clonebinary'($P1, __ARG_1) + +.end # clone + + .sub 'optimize' :method -.const 'Sub' WSubId_21 = "WSubId_21" -# Body -# { -.annotate 'line', 4249 +.const 'Sub' WSubId_44 = "WSubId_44" self.'optimizearg'() -.annotate 'line', 4250 getattribute $P2, self, 'lexpr' $P1 = $P2.'isintegerliteral'() if_null $P1, __label_1 unless $P1 goto __label_1 -# { -.annotate 'line', 4251 -# ln: $I1 getattribute $P4, self, 'lexpr' $P3 = $P4.'getIntegerValue'() set $I1, $P3 -.annotate 'line', 4252 - eq $I1, 0, __label_2 -.annotate 'line', 4253 + unless $I1 goto __label_3 getattribute $P1, self, 'rexpr' + goto __label_2 + __label_3: + getattribute $P3, self, 'owner' + getattribute $P4, self, 'start' + $P2 = WSubId_44($P3, $P4, $I1) + set $P1, $P2 + __label_2: .return($P1) - goto __label_3 - __label_2: # else -.annotate 'line', 4255 - getattribute $P2, self, 'owner' - getattribute $P3, self, 'start' - .tailcall WSubId_21($P2, $P3, $I1) - __label_3: # endif -# } __label_1: # endif -.annotate 'line', 4257 .return(self) -# } -.annotate 'line', 4258 .end # optimize .sub 'emit' :method .param pmc __ARG_1 - .param pmc __ARG_2 -# Body -# { -.annotate 'line', 4261 -# res: $S1 - if_null __ARG_2, __label_2 - set $P1, __ARG_2 - goto __label_1 - __label_2: - $P1 = self.'tempreg'('I') - __label_1: - null $S1 - if_null $P1, __label_3 - set $S1, $P1 - __label_3: -.annotate 'line', 4262 + .param string __ARG_2 getattribute $P1, self, 'lexpr' - $I1 = $P1.'issimple'() - unless $I1 goto __label_6 getattribute $P2, self, 'rexpr' - $I1 = $P2.'issimple'() - __label_6: - unless $I1 goto __label_4 -# { -.annotate 'line', 4263 -# lreg: $S2 - $P3 = self.'emit_intleft'(__ARG_1) + $P3 = self.'checkresult'() + null $S1 + if_null $P3, __label_1 + set $S1, $P3 + __label_1: + iseq $I1, $S1, 'I' + box $P3, $I1 + unless $P3 goto __label_5 + $P3 = $P1.'issimple'() + __label_5: + unless $P3 goto __label_4 + $P3 = $P2.'issimple'() + __label_4: + if_null $P3, __label_2 + unless $P3 goto __label_2 + $P4 = self.'emit_intleft'(__ARG_1) null $S2 + if_null $P4, __label_6 + set $S2, $P4 + __label_6: + $P3 = self.'emit_intright'(__ARG_1) + null $S3 if_null $P3, __label_7 - set $S2, $P3 + set $S3, $P3 __label_7: -.annotate 'line', 4264 -# rreg: $S3 - $P1 = self.'emit_intright'(__ARG_1) - null $S3 - if_null $P1, __label_8 - set $S3, $P1 - __label_8: -.annotate 'line', 4265 - __ARG_1.'emitbinop'('and', $S1, $S2, $S3) -# } - goto __label_5 - __label_4: # else -# { -.annotate 'line', 4268 -# l: $S4 - getattribute $P2, self, 'owner' - $P1 = $P2.'genlabel'() + __ARG_1.'emitbinop'('and', __ARG_2, $S2, $S3) + goto __label_3 + __label_2: # else + getattribute $P4, self, 'owner' + $P3 = $P4.'genlabel'() null $S4 - if_null $P1, __label_9 - set $S4, $P1 - __label_9: -.annotate 'line', 4269 - getattribute $P1, self, 'lexpr' - $P1.'emit'(__ARG_1, $S1) -.annotate 'line', 4270 - __ARG_1.'emitunless'($S1, $S4) -.annotate 'line', 4271 - getattribute $P1, self, 'rexpr' - $P1.'emit'(__ARG_1, $S1) -.annotate 'line', 4272 - __ARG_1.'emitlabel'($S4) -# } - __label_5: # endif -# } -.annotate 'line', 4274 - -.end # emit - -.sub Winxed_class_init :anon :load :init - newclass $P0, [ 'Winxed'; 'Compiler'; 'OpBoolAndExpr' ] -.annotate 'line', 4241 - get_class $P1, [ 'Winxed'; 'Compiler'; 'OpBaseBoolExpr' ] - addparent $P0, $P1 -.end -.namespace [ 'Winxed'; 'Compiler'; 'OpBoolOrExpr' ] - -.sub 'OpBoolOrExpr' :method - .param pmc __ARG_1 + if_null $P3, __label_8 + set $S4, $P3 + __label_8: + iseq $I1, $S1, 'P' + unless $I1 goto __label_11 + $P3 = $P1.'checkresult'() + set $S7, $P3 + isne $I1, $S7, 'P' + __label_11: + unless $I1 goto __label_9 + $P4 = $P1.'emit_get'(__ARG_1) + null $S5 + if_null $P4, __label_12 + set $S5, $P4 + __label_12: + __ARG_1.'emitbox'(__ARG_2, $S5) + goto __label_10 + __label_9: # else + $P1.'emit'(__ARG_1, __ARG_2) + __label_10: # endif + __ARG_1.'emitunless'(__ARG_2, $S4) + iseq $I1, $S1, 'P' + unless $I1 goto __label_15 + $P3 = $P2.'checkresult'() + set $S7, $P3 + isne $I1, $S7, 'P' + __label_15: + unless $I1 goto __label_13 + $P4 = $P2.'emit_get'(__ARG_1) + null $S6 + if_null $P4, __label_16 + set $S6, $P4 + __label_16: + __ARG_1.'emitbox'(__ARG_2, $S6) + goto __label_14 + __label_13: # else + $P2.'emit'(__ARG_1, __ARG_2) + __label_14: # endif + __ARG_1.'emitlabel'($S4) + __label_3: # endif + +.end # emit + + +.sub 'emit_void' :method + .param pmc __ARG_1 + getattribute $P1, self, 'lexpr' + getattribute $P2, self, 'rexpr' + $P3 = self.'checkresult'() + null $S1 + if_null $P3, __label_1 + set $S1, $P3 + __label_1: + iseq $I1, $S1, 'I' + box $P3, $I1 + unless $P3 goto __label_5 + $P3 = $P1.'issimple'() + __label_5: + unless $P3 goto __label_4 + $P3 = $P2.'issimple'() + __label_4: + if_null $P3, __label_2 + unless $P3 goto __label_2 + $P4 = self.'emit_intleft'(__ARG_1) + null $S2 + if_null $P4, __label_6 + set $S2, $P4 + __label_6: + $P3 = self.'emit_intright'(__ARG_1) + null $S3 + if_null $P3, __label_7 + set $S3, $P3 + __label_7: + __ARG_1.'emitbinop'('and', "$I0", $S2, $S3) + goto __label_3 + __label_2: # else + getattribute $P4, self, 'owner' + $P3 = $P4.'genlabel'() + null $S4 + if_null $P3, __label_8 + set $S4, $P3 + __label_8: + $P3 = $P1.'emit_get'(__ARG_1) + null $S5 + if_null $P3, __label_9 + set $S5, $P3 + __label_9: + __ARG_1.'emitunless'($S5, $S4) + $P2.'emit_void'(__ARG_1) + __ARG_1.'emitlabel'($S4) + __label_3: # endif + +.end # emit_void + +.sub Winxed_class_init :anon :load :init + newclass $P0, [ 'Winxed'; 'Compiler'; 'OpBoolAndExpr' ] + get_class $P1, [ 'Winxed'; 'Compiler'; 'OpBaseBoolExpr' ] + addparent $P0, $P1 +.end +.namespace [ 'Winxed'; 'Compiler'; 'OpBoolOrExpr' ] + +.sub 'OpBoolOrExpr' :method + .param pmc __ARG_1 .param pmc __ARG_2 .param pmc __ARG_3 .param pmc __ARG_4 -# Body -# { -.annotate 'line', 4283 self.'set'(__ARG_1, __ARG_2, __ARG_3, __ARG_4) -# } -.annotate 'line', 4284 .end # OpBoolOrExpr +.sub 'clone' :method + .param pmc __ARG_1 + new $P1, [ 'Winxed'; 'Compiler'; 'OpBoolOrExpr' ] + .tailcall self.'clonebinary'($P1, __ARG_1) + +.end # clone + + .sub 'optimize' :method -.const 'Sub' WSubId_21 = "WSubId_21" -# Body -# { -.annotate 'line', 4287 +.const 'Sub' WSubId_44 = "WSubId_44" self.'optimizearg'() -.annotate 'line', 4288 getattribute $P2, self, 'lexpr' $P1 = $P2.'isintegerliteral'() if_null $P1, __label_1 unless $P1 goto __label_1 -# { -.annotate 'line', 4289 -# ln: $I1 getattribute $P4, self, 'lexpr' $P3 = $P4.'getIntegerValue'() set $I1, $P3 -.annotate 'line', 4290 - ne $I1, 0, __label_2 -.annotate 'line', 4291 + if $I1 goto __label_3 getattribute $P1, self, 'rexpr' + goto __label_2 + __label_3: + getattribute $P3, self, 'owner' + getattribute $P4, self, 'start' + $P2 = WSubId_44($P3, $P4, $I1) + set $P1, $P2 + __label_2: .return($P1) - goto __label_3 - __label_2: # else -.annotate 'line', 4293 - getattribute $P2, self, 'owner' - getattribute $P3, self, 'start' - .tailcall WSubId_21($P2, $P3, $I1) - __label_3: # endif -# } __label_1: # endif -.annotate 'line', 4295 .return(self) -# } -.annotate 'line', 4296 .end # optimize .sub 'emit' :method .param pmc __ARG_1 - .param pmc __ARG_2 -# Body -# { -.annotate 'line', 4299 -# res: $S1 - null $S1 -.annotate 'line', 4300 - if_null __ARG_2, __label_1 -.annotate 'line', 4301 - set $S1, __ARG_2 - goto __label_2 - __label_1: # else -.annotate 'line', 4303 - $P1 = self.'tempreg'('I') - set $S1, $P1 - __label_2: # endif -.annotate 'line', 4304 + .param string __ARG_2 getattribute $P1, self, 'lexpr' - $I1 = $P1.'issimple'() - unless $I1 goto __label_5 getattribute $P2, self, 'rexpr' - $I1 = $P2.'issimple'() + $P3 = self.'checkresult'() + null $S1 + if_null $P3, __label_1 + set $S1, $P3 + __label_1: + iseq $I1, $S1, 'I' + box $P3, $I1 + unless $P3 goto __label_5 + $P3 = $P1.'issimple'() __label_5: - unless $I1 goto __label_3 -# { -.annotate 'line', 4305 -# lreg: $S2 - $P3 = self.'emit_intleft'(__ARG_1) + unless $P3 goto __label_4 + $P3 = $P2.'issimple'() + __label_4: + if_null $P3, __label_2 + unless $P3 goto __label_2 + $P4 = self.'emit_intleft'(__ARG_1) null $S2 - if_null $P3, __label_6 - set $S2, $P3 + if_null $P4, __label_6 + set $S2, $P4 __label_6: -.annotate 'line', 4306 -# rreg: $S3 - $P1 = self.'emit_intright'(__ARG_1) + $P3 = self.'emit_intright'(__ARG_1) null $S3 - if_null $P1, __label_7 - set $S3, $P1 + if_null $P3, __label_7 + set $S3, $P3 __label_7: -.annotate 'line', 4307 - __ARG_1.'emitbinop'('or', $S1, $S2, $S3) -# } - goto __label_4 - __label_3: # else -# { -.annotate 'line', 4310 -# l: $S4 - getattribute $P2, self, 'owner' - $P1 = $P2.'genlabel'() + __ARG_1.'emitbinop'('or', __ARG_2, $S2, $S3) + goto __label_3 + __label_2: # else + getattribute $P4, self, 'owner' + $P3 = $P4.'genlabel'() null $S4 - if_null $P1, __label_8 - set $S4, $P1 + if_null $P3, __label_8 + set $S4, $P3 __label_8: -.annotate 'line', 4311 - getattribute $P1, self, 'lexpr' - $P1.'emit'(__ARG_1, $S1) -.annotate 'line', 4312 - __ARG_1.'emitif'($S1, $S4) -.annotate 'line', 4313 - getattribute $P1, self, 'rexpr' - $P1.'emit'(__ARG_1, $S1) -.annotate 'line', 4314 + iseq $I1, $S1, 'P' + unless $I1 goto __label_11 + $P3 = $P1.'checkresult'() + set $S7, $P3 + isne $I1, $S7, 'P' + __label_11: + unless $I1 goto __label_9 + $P4 = $P1.'emit_get'(__ARG_1) + null $S5 + if_null $P4, __label_12 + set $S5, $P4 + __label_12: + __ARG_1.'emitbox'(__ARG_2, $S5) + goto __label_10 + __label_9: # else + $P1.'emit'(__ARG_1, __ARG_2) + __label_10: # endif + __ARG_1.'emitif'(__ARG_2, $S4) + iseq $I1, $S1, 'P' + unless $I1 goto __label_15 + $P3 = $P2.'checkresult'() + set $S7, $P3 + isne $I1, $S7, 'P' + __label_15: + unless $I1 goto __label_13 + $P4 = $P2.'emit_get'(__ARG_1) + null $S6 + if_null $P4, __label_16 + set $S6, $P4 + __label_16: + __ARG_1.'emitbox'(__ARG_2, $S6) + goto __label_14 + __label_13: # else + $P2.'emit'(__ARG_1, __ARG_2) + __label_14: # endif __ARG_1.'emitlabel'($S4) -# } - __label_4: # endif -# } -.annotate 'line', 4316 + __label_3: # endif .end # emit + +.sub 'emit_void' :method + .param pmc __ARG_1 + getattribute $P1, self, 'lexpr' + getattribute $P2, self, 'rexpr' + $P3 = self.'checkresult'() + null $S1 + if_null $P3, __label_1 + set $S1, $P3 + __label_1: + iseq $I1, $S1, 'I' + box $P3, $I1 + unless $P3 goto __label_5 + $P3 = $P1.'issimple'() + __label_5: + unless $P3 goto __label_4 + $P3 = $P2.'issimple'() + __label_4: + if_null $P3, __label_2 + unless $P3 goto __label_2 + $P4 = self.'emit_intleft'(__ARG_1) + null $S2 + if_null $P4, __label_6 + set $S2, $P4 + __label_6: + $P3 = self.'emit_intright'(__ARG_1) + null $S3 + if_null $P3, __label_7 + set $S3, $P3 + __label_7: + __ARG_1.'emitbinop'('or', "$I0", $S2, $S3) + goto __label_3 + __label_2: # else + getattribute $P4, self, 'owner' + $P3 = $P4.'genlabel'() + null $S4 + if_null $P3, __label_8 + set $S4, $P3 + __label_8: + $P3 = $P1.'emit_get'(__ARG_1) + null $S5 + if_null $P3, __label_9 + set $S5, $P3 + __label_9: + __ARG_1.'emitif'($S5, $S4) + $P2.'emit_void'(__ARG_1) + __ARG_1.'emitlabel'($S4) + __label_3: # endif + +.end # emit_void + .sub Winxed_class_init :anon :load :init newclass $P0, [ 'Winxed'; 'Compiler'; 'OpBoolOrExpr' ] -.annotate 'line', 4279 get_class $P1, [ 'Winxed'; 'Compiler'; 'OpBaseBoolExpr' ] addparent $P0, $P1 .end .namespace [ 'Winxed'; 'Compiler'; 'OpBaseBinExpr' ] .sub Winxed_class_init :anon :load :init newclass $P0, [ 'Winxed'; 'Compiler'; 'OpBaseBinExpr' ] -.annotate 'line', 4321 get_class $P1, [ 'Winxed'; 'Compiler'; 'OpBinaryIntExpr' ] addparent $P0, $P1 .end @@ -12611,53 +10222,34 @@ .param pmc __ARG_2 .param pmc __ARG_3 .param pmc __ARG_4 -# Body -# { -.annotate 'line', 4331 self.'set'(__ARG_1, __ARG_2, __ARG_3, __ARG_4) -# } -.annotate 'line', 4332 .end # OpBinAndExpr +.sub 'clone' :method + .param pmc __ARG_1 + new $P1, [ 'Winxed'; 'Compiler'; 'OpBinAndExpr' ] + .tailcall self.'clonebinary'($P1, __ARG_1) + +.end # clone + + .sub 'emit' :method .param pmc __ARG_1 - .param pmc __ARG_2 -# Body -# { -.annotate 'line', 4335 -# res: $S1 - if_null __ARG_2, __label_2 - set $P1, __ARG_2 - goto __label_1 - __label_2: - $P1 = self.'tempreg'('I') - __label_1: + .param string __ARG_2 + $P1 = self.'emit_intleft'(__ARG_1) null $S1 - if_null $P1, __label_3 + if_null $P1, __label_1 set $S1, $P1 - __label_3: -.annotate 'line', 4336 -# lreg: $S2 - $P1 = self.'emit_intleft'(__ARG_1) + __label_1: + $P1 = self.'emit_intright'(__ARG_1) null $S2 - if_null $P1, __label_4 + if_null $P1, __label_2 set $S2, $P1 - __label_4: -.annotate 'line', 4337 -# rreg: $S3 - $P1 = self.'emit_intright'(__ARG_1) - null $S3 - if_null $P1, __label_5 - set $S3, $P1 - __label_5: -.annotate 'line', 4338 + __label_2: self.'annotate'(__ARG_1) -.annotate 'line', 4339 - __ARG_1.'emitbinop'('band', $S1, $S2, $S3) -# } -.annotate 'line', 4340 + __ARG_1.'emitbinop'('band', __ARG_2, $S1, $S2) .end # emit @@ -12665,19 +10257,13 @@ .sub 'do_op' :method .param int __ARG_1 .param int __ARG_2 -# Body -# { -.annotate 'line', 4343 band $I1, __ARG_1, __ARG_2 .return($I1) -# } -.annotate 'line', 4344 .end # do_op .sub Winxed_class_init :anon :load :init newclass $P0, [ 'Winxed'; 'Compiler'; 'OpBinAndExpr' ] -.annotate 'line', 4327 get_class $P1, [ 'Winxed'; 'Compiler'; 'OpBaseBinExpr' ] addparent $P0, $P1 .end @@ -12688,53 +10274,34 @@ .param pmc __ARG_2 .param pmc __ARG_3 .param pmc __ARG_4 -# Body -# { -.annotate 'line', 4353 self.'set'(__ARG_1, __ARG_2, __ARG_3, __ARG_4) -# } -.annotate 'line', 4354 .end # OpBinOrExpr +.sub 'clone' :method + .param pmc __ARG_1 + new $P1, [ 'Winxed'; 'Compiler'; 'OpBinOrExpr' ] + .tailcall self.'clonebinary'($P1, __ARG_1) + +.end # clone + + .sub 'emit' :method .param pmc __ARG_1 - .param pmc __ARG_2 -# Body -# { -.annotate 'line', 4357 -# res: $S1 - if_null __ARG_2, __label_2 - set $P1, __ARG_2 - goto __label_1 - __label_2: - $P1 = self.'tempreg'('I') - __label_1: + .param string __ARG_2 + $P1 = self.'emit_intleft'(__ARG_1) null $S1 - if_null $P1, __label_3 + if_null $P1, __label_1 set $S1, $P1 - __label_3: -.annotate 'line', 4358 -# lreg: $S2 - $P1 = self.'emit_intleft'(__ARG_1) + __label_1: + $P1 = self.'emit_intright'(__ARG_1) null $S2 - if_null $P1, __label_4 + if_null $P1, __label_2 set $S2, $P1 - __label_4: -.annotate 'line', 4359 -# rreg: $S3 - $P1 = self.'emit_intright'(__ARG_1) - null $S3 - if_null $P1, __label_5 - set $S3, $P1 - __label_5: -.annotate 'line', 4360 + __label_2: self.'annotate'(__ARG_1) -.annotate 'line', 4361 - __ARG_1.'emitbinop'('bor', $S1, $S2, $S3) -# } -.annotate 'line', 4362 + __ARG_1.'emitbinop'('bor', __ARG_2, $S1, $S2) .end # emit @@ -12742,19 +10309,13 @@ .sub 'do_op' :method .param int __ARG_1 .param int __ARG_2 -# Body -# { -.annotate 'line', 4365 bor $I1, __ARG_1, __ARG_2 .return($I1) -# } -.annotate 'line', 4366 .end # do_op .sub Winxed_class_init :anon :load :init newclass $P0, [ 'Winxed'; 'Compiler'; 'OpBinOrExpr' ] -.annotate 'line', 4349 get_class $P1, [ 'Winxed'; 'Compiler'; 'OpBaseBinExpr' ] addparent $P0, $P1 .end @@ -12765,53 +10326,26 @@ .param pmc __ARG_2 .param pmc __ARG_3 .param pmc __ARG_4 -# Body -# { -.annotate 'line', 4375 self.'set'(__ARG_1, __ARG_2, __ARG_3, __ARG_4) -# } -.annotate 'line', 4376 .end # OpBinXorExpr .sub 'emit' :method .param pmc __ARG_1 - .param pmc __ARG_2 -# Body -# { -.annotate 'line', 4379 -# res: $S1 - if_null __ARG_2, __label_2 - set $P1, __ARG_2 - goto __label_1 - __label_2: - $P1 = self.'tempreg'('I') - __label_1: + .param string __ARG_2 + $P1 = self.'emit_intleft'(__ARG_1) null $S1 - if_null $P1, __label_3 + if_null $P1, __label_1 set $S1, $P1 - __label_3: -.annotate 'line', 4380 -# lreg: $S2 - $P1 = self.'emit_intleft'(__ARG_1) + __label_1: + $P1 = self.'emit_intright'(__ARG_1) null $S2 - if_null $P1, __label_4 + if_null $P1, __label_2 set $S2, $P1 - __label_4: -.annotate 'line', 4381 -# rreg: $S3 - $P1 = self.'emit_intright'(__ARG_1) - null $S3 - if_null $P1, __label_5 - set $S3, $P1 - __label_5: -.annotate 'line', 4382 + __label_2: self.'annotate'(__ARG_1) -.annotate 'line', 4383 - __ARG_1.'emitbinop'('bxor', $S1, $S2, $S3) -# } -.annotate 'line', 4384 + __ARG_1.'emitbinop'('bxor', __ARG_2, $S1, $S2) .end # emit @@ -12819,19 +10353,13 @@ .sub 'do_op' :method .param int __ARG_1 .param int __ARG_2 -# Body -# { -.annotate 'line', 4387 bxor $I1, __ARG_1, __ARG_2 .return($I1) -# } -.annotate 'line', 4388 .end # do_op .sub Winxed_class_init :anon :load :init newclass $P0, [ 'Winxed'; 'Compiler'; 'OpBinXorExpr' ] -.annotate 'line', 4371 get_class $P1, [ 'Winxed'; 'Compiler'; 'OpBaseBinExpr' ] addparent $P0, $P1 .end @@ -12842,330 +10370,258 @@ .param pmc __ARG_2 .param pmc __ARG_3 .param pmc __ARG_4 -# Body -# { -.annotate 'line', 4398 self.'Expr'(__ARG_1, __ARG_2) -# switch-case -.annotate 'line', 4400 isa $I1, __ARG_3, [ 'Winxed'; 'Compiler'; 'ConcatString' ] if $I1 goto __label_3 -.annotate 'line', 4407 isa $I1, __ARG_4, [ 'Winxed'; 'Compiler'; 'ConcatString' ] if $I1 goto __label_4 goto __label_2 __label_3: # case -.annotate 'line', 4401 getattribute $P2, __ARG_3, 'values' setattribute self, 'values', $P2 -.annotate 'line', 4402 isa $I2, __ARG_4, [ 'Winxed'; 'Compiler'; 'ConcatString' ] unless $I2 goto __label_5 -.annotate 'line', 4403 - getattribute $P3, self, 'values' - getattribute $P4, __ARG_4, 'values' - $P3.'append'($P4) + getattribute $P3, __ARG_4, 'values' + self.'append'($P3) goto __label_6 __label_5: # else -.annotate 'line', 4405 - getattribute $P5, self, 'values' -# predefined push - push $P5, __ARG_4 + self.'pushexpr'(__ARG_4) __label_6: # endif goto __label_1 # break __label_4: # case -.annotate 'line', 4408 - getattribute $P7, __ARG_4, 'values' - setattribute self, 'values', $P7 -.annotate 'line', 4409 - getattribute $P8, self, 'values' - $P8.'unshift'(__ARG_3) + getattribute $P5, __ARG_4, 'values' + setattribute self, 'values', $P5 + self.'unshiftexpr'(__ARG_3) goto __label_1 # break __label_2: # default -.annotate 'line', 4412 - root_new $P10, ['parrot';'ResizablePMCArray'] - push $P10, __ARG_3 - push $P10, __ARG_4 - setattribute self, 'values', $P10 + root_new $P7, ['parrot';'ResizablePMCArray'] + assign $P7, 2 + $P7[0] = __ARG_3 + $P7[1] = __ARG_4 + setattribute self, 'values', $P7 __label_1: # switch end -# } -.annotate 'line', 4414 .end # ConcatString +.sub 'pushexpr' :method + .param pmc __ARG_1 +.const 'Sub' WSubId_94 = "WSubId_94" + getattribute $P1, self, 'values' + $P2 = $P1[-1] + $P3 = $P2.'isstringliteral'() + unless $P3 goto __label_3 + $P3 = __ARG_1.'isstringliteral'() + __label_3: + if_null $P3, __label_1 + unless $P3 goto __label_1 + $P4 = WSubId_94($P2, __ARG_1) + $P1[-1] = $P4 + goto __label_2 + __label_1: # else + push $P1, __ARG_1 + __label_2: # endif + +.end # pushexpr + + +.sub 'unshiftexpr' :method + .param pmc __ARG_1 +.const 'Sub' WSubId_94 = "WSubId_94" + getattribute $P1, self, 'values' + $P2 = $P1[0] + $P3 = $P2.'isstringliteral'() + unless $P3 goto __label_3 + $P3 = __ARG_1.'isstringliteral'() + __label_3: + if_null $P3, __label_1 + unless $P3 goto __label_1 + $P4 = WSubId_94(__ARG_1, $P2) + $P1[0] = $P4 + goto __label_2 + __label_1: # else + unshift $P1, __ARG_1 + __label_2: # endif + +.end # unshiftexpr + + +.sub 'append' :method + .param pmc __ARG_1 +.const 'Sub' WSubId_94 = "WSubId_94" + getattribute $P1, self, 'values' + $P2 = $P1[-1] + $P4 = $P2.'isstringliteral'() + if_null $P4, __label_1 + unless $P4 goto __label_1 + $P3 = __ARG_1[0] + $P4 = $P3.'isstringliteral'() + if_null $P4, __label_2 + unless $P4 goto __label_2 + $P5 = WSubId_94($P2, $P3) + $P1[-1] = $P5 + __ARG_1.'shift'() + __label_2: # endif + __label_1: # endif + $P1.'append'(__ARG_1) + +.end # append + + .sub 'checkresult' :method -# Body -# { -.annotate 'line', 4415 .return('S') -# } .end # checkresult .sub 'getregs' :method .param pmc __ARG_1 -# Body -# { -.annotate 'line', 4418 -# var values: $P1 getattribute $P1, self, 'values' -.annotate 'line', 4419 -# nvalues: $I1 -# predefined elements elements $I1, $P1 -.annotate 'line', 4420 new $P2, ['FixedStringArray'], $I1 -.annotate 'line', 4421 -# i: $I2 - null $I2 -# for loop -.annotate 'line', 4422 null $I2 __label_3: # for condition ge $I2, $I1, __label_2 -.annotate 'line', 4423 -# predefined string $P4 = $P1[$I2] $P3 = $P4.'emit_get'(__ARG_1) set $S1, $P3 $P2[$I2] = $S1 __label_1: # for iteration -.annotate 'line', 4422 inc $I2 goto __label_3 __label_2: # for end -.annotate 'line', 4424 .return($P2) -# } -.annotate 'line', 4425 .end # getregs .sub 'emit' :method .param pmc __ARG_1 - .param pmc __ARG_2 -# Body -# { -.annotate 'line', 4428 -# var regvalues: $P1 - $P1 = self.'getregs'(__ARG_1) -.annotate 'line', 4429 -# nvalues: $I1 -# predefined elements - elements $I1, $P1 -.annotate 'line', 4430 -# auxreg: $S1 - set $S2, __ARG_2 - eq $S2, '', __label_2 - set $P2, __ARG_2 - goto __label_1 - __label_2: - box $P2, '$S0' - __label_1: + .param string __ARG_2 + $P1 = self.'emit_get'(__ARG_1) null $S1 - if_null $P2, __label_3 - set $S1, $P2 - __label_3: -.annotate 'line', 4431 - self.'annotate'(__ARG_1) -.annotate 'line', 4432 - $P2 = $P1[0] - $P3 = $P1[1] - __ARG_1.'emitconcat'($S1, $P2, $P3) -# for loop -.annotate 'line', 4433 -# i: $I2 - set $I2, 2 - __label_6: # for condition - ge $I2, $I1, __label_5 -.annotate 'line', 4434 - $P2 = $P1[$I2] - __ARG_1.'emitconcat1'($S1, $P2) - __label_4: # for iteration -.annotate 'line', 4433 - inc $I2 - goto __label_6 - __label_5: # for end -# } -.annotate 'line', 4435 + if_null $P1, __label_1 + set $S1, $P1 + __label_1: + __ARG_1.'emitset'(__ARG_2, $S1) .end # emit .sub 'emit_get' :method .param pmc __ARG_1 -# Body -# { -.annotate 'line', 4438 -# var regvalues: $P1 $P1 = self.'getregs'(__ARG_1) -.annotate 'line', 4439 -# nvalues: $I1 -# predefined elements elements $I1, $P1 -.annotate 'line', 4440 -# auxreg: $S1 $P2 = self.'tempreg'('S') null $S1 if_null $P2, __label_1 set $S1, $P2 __label_1: -.annotate 'line', 4441 self.'annotate'(__ARG_1) -.annotate 'line', 4442 $P2 = $P1[0] $P3 = $P1[1] __ARG_1.'emitconcat'($S1, $P2, $P3) -# for loop -.annotate 'line', 4443 -# i: $I2 set $I2, 2 __label_4: # for condition ge $I2, $I1, __label_3 -.annotate 'line', 4444 $P2 = $P1[$I2] __ARG_1.'emitconcat1'($S1, $P2) __label_2: # for iteration -.annotate 'line', 4443 inc $I2 goto __label_4 __label_3: # for end -.annotate 'line', 4445 .return($S1) -# } -.annotate 'line', 4446 .end # emit_get +.sub 'emit_init' :method + .param pmc __ARG_1 + .param string __ARG_2 + $P1 = self.'getregs'(__ARG_1) + elements $I1, $P1 + self.'annotate'(__ARG_1) + $P2 = $P1[0] + $P3 = $P1[1] + __ARG_1.'emitconcat'(__ARG_2, $P2, $P3) + set $I2, 2 + __label_3: # for condition + ge $I2, $I1, __label_2 + $P2 = $P1[$I2] + __ARG_1.'emitconcat1'(__ARG_2, $P2) + __label_1: # for iteration + inc $I2 + goto __label_3 + __label_2: # for end + +.end # emit_init + + .sub 'emit_concat_to' :method .param pmc __ARG_1 - .param pmc __ARG_2 -# Body -# { -.annotate 'line', 4449 -# var regvalues: $P1 + .param string __ARG_2 $P1 = self.'getregs'(__ARG_1) -.annotate 'line', 4450 -# nvalues: $I1 -# predefined elements elements $I1, $P1 -.annotate 'line', 4451 self.'annotate'(__ARG_1) -# for loop -.annotate 'line', 4452 -# i: $I2 null $I2 __label_3: # for condition ge $I2, $I1, __label_2 -.annotate 'line', 4453 $P2 = $P1[$I2] __ARG_1.'emitconcat1'(__ARG_2, $P2) __label_1: # for iteration -.annotate 'line', 4452 inc $I2 goto __label_3 __label_2: # for end -# } -.annotate 'line', 4454 .end # emit_concat_to .sub Winxed_class_init :anon :load :init newclass $P0, [ 'Winxed'; 'Compiler'; 'ConcatString' ] -.annotate 'line', 4393 - get_class $P1, [ 'Winxed'; 'Compiler'; 'Expr' ] + get_class $P1, [ 'Winxed'; 'Compiler'; 'FinalExpr' ] addparent $P0, $P1 -.annotate 'line', 4395 addattribute $P0, 'values' .end .namespace [ 'Winxed'; 'Compiler'; 'RepeatString' ] .sub 'RepeatString' :method .param pmc __ARG_1 -# Body -# { -.annotate 'line', 4463 getattribute $P1, __ARG_1, 'owner' getattribute $P2, __ARG_1, 'start' getattribute $P3, __ARG_1, 'lexpr' getattribute $P4, __ARG_1, 'rexpr' self.'set'($P1, $P2, $P3, $P4) -# } -.annotate 'line', 4464 .end # RepeatString .sub 'checkresult' :method -# Body -# { -.annotate 'line', 4465 .return('S') -# } .end # checkresult .sub 'emit' :method .param pmc __ARG_1 - .param pmc __ARG_2 -# Body -# { -.annotate 'line', 4468 -# var rexpr: $P1 + .param string __ARG_2 getattribute $P1, self, 'rexpr' -.annotate 'line', 4469 -# lreg: $S1 getattribute $P3, self, 'lexpr' $P2 = $P3.'emit_get'(__ARG_1) null $S1 if_null $P2, __label_1 set $S1, $P2 __label_1: -.annotate 'line', 4470 -# rreg: $S2 - $P2 = $P1.'emit_get'(__ARG_1) + $P2 = $P1.'emit_getint'(__ARG_1) null $S2 if_null $P2, __label_2 set $S2, $P2 __label_2: -.annotate 'line', 4471 -# rval: $S3 - null $S3 -# switch -.annotate 'line', 4472 - $P2 = $P1.'checkresult'() - set $S4, $P2 - set $S5, 'I' - if $S4 == $S5 goto __label_5 - goto __label_4 - __label_5: # case -.annotate 'line', 4474 - set $S3, $S2 - goto __label_3 # break - __label_4: # default -.annotate 'line', 4477 - $P3 = self.'tempreg'('I') - set $S3, $P3 -.annotate 'line', 4478 - __ARG_1.'emitset'($S3, $S2) - __label_3: # switch end -.annotate 'line', 4480 self.'annotate'(__ARG_1) -.annotate 'line', 4481 - __ARG_1.'emitrepeat'(__ARG_2, $S1, $S3) -# } -.annotate 'line', 4482 + __ARG_1.'emitrepeat'(__ARG_2, $S1, $S2) .end # emit .sub Winxed_class_init :anon :load :init newclass $P0, [ 'Winxed'; 'Compiler'; 'RepeatString' ] -.annotate 'line', 4459 get_class $P1, [ 'Winxed'; 'Compiler'; 'OpBinaryExpr' ] addparent $P0, $P1 .end @@ -13176,327 +10632,188 @@ .param pmc __ARG_2 .param pmc __ARG_3 .param pmc __ARG_4 -# Body -# { -.annotate 'line', 4491 self.'set'(__ARG_1, __ARG_2, __ARG_3, __ARG_4) -# } -.annotate 'line', 4492 .end # OpAddExpr +.sub 'clone' :method + .param pmc __ARG_1 + new $P1, [ 'Winxed'; 'Compiler'; 'OpAddExpr' ] + .tailcall self.'clonebinary'($P1, __ARG_1) + +.end # clone + + .sub 'optimize' :method -.const 'Sub' WSubId_21 = "WSubId_21" -.const 'Sub' WSubId_64 = "WSubId_64" -.const 'Sub' WSubId_63 = "WSubId_63" -# Body -# { -.annotate 'line', 4495 +.const 'Sub' WSubId_94 = "WSubId_94" +.const 'Sub' WSubId_44 = "WSubId_44" +.const 'Sub' WSubId_95 = "WSubId_95" +.const 'Sub' WSubId_93 = "WSubId_93" self.'optimizearg'() -.annotate 'line', 4496 -# var lexpr: $P1 getattribute $P1, self, 'lexpr' -.annotate 'line', 4497 -# var rexpr: $P2 getattribute $P2, self, 'rexpr' -.annotate 'line', 4498 -# ltype: $S1 - $P6 = $P1.'checkresult'() + $P3 = $P1.'checkresult'() null $S1 - if_null $P6, __label_1 - set $S1, $P6 + if_null $P3, __label_1 + set $S1, $P3 __label_1: -.annotate 'line', 4499 -# rtype: $S2 - $P6 = $P2.'checkresult'() + $P3 = $P2.'checkresult'() null $S2 - if_null $P6, __label_2 - set $S2, $P6 + if_null $P3, __label_2 + set $S2, $P3 __label_2: -.annotate 'line', 4500 - $I3 = $P1.'isliteral'() - unless $I3 goto __label_4 - $I3 = $P2.'isliteral'() + $P3 = $P1.'isliteral'() + unless $P3 goto __label_4 + $P3 = $P2.'isliteral'() __label_4: - unless $I3 goto __label_3 -# { -.annotate 'line', 4501 - iseq $I4, $S1, 'S' - unless $I4 goto __label_6 - iseq $I4, $S2, 'S' + if_null $P3, __label_3 + unless $P3 goto __label_3 + iseq $I3, $S1, 'S' + unless $I3 goto __label_6 + iseq $I3, $S2, 'S' __label_6: - unless $I4 goto __label_5 -# { -.annotate 'line', 4506 -# var etok: $P3 - getattribute $P3, $P1, 'strval' -.annotate 'line', 4507 -# var rtok: $P4 - getattribute $P4, $P2, 'strval' -.annotate 'line', 4508 -# var t: $P5 - $I3 = $P3.'issinglequoted'() - unless $I3 goto __label_9 - $I3 = $P4.'issinglequoted'() - __label_9: - unless $I3 goto __label_8 -.annotate 'line', 4510 - new $P6, [ 'Winxed'; 'Compiler'; 'TokenSingleQuoted' ] - getattribute $P7, $P3, 'file' - getattribute $P8, $P3, 'line' -# predefined string -.annotate 'line', 4511 - getattribute $P9, $P3, 'str' - set $S3, $P9 -# predefined string - getattribute $P10, $P4, 'str' - set $S4, $P10 - concat $S5, $S3, $S4 - $P6.'TokenSingleQuoted'($P7, $P8, $S5) - set $P5, $P6 - goto __label_7 - __label_8: -.annotate 'line', 4513 - new $P11, [ 'Winxed'; 'Compiler'; 'TokenQuoted' ] - getattribute $P12, $P3, 'file' - getattribute $P13, $P3, 'line' -# predefined string -.annotate 'line', 4514 - $P14 = $P3.'getasquoted'() - set $S6, $P14 -# predefined string - $P15 = $P4.'getasquoted'() - set $S7, $P15 - concat $S8, $S6, $S7 - $P11.'TokenQuoted'($P12, $P13, $S8) - set $P5, $P11 - __label_7: -.annotate 'line', 4515 - new $P7, [ 'Winxed'; 'Compiler'; 'StringLiteral' ] - getattribute $P8, self, 'owner' - $P7.'StringLiteral'($P8, $P5) - set $P6, $P7 - .return($P6) -# } + unless $I3 goto __label_5 + .tailcall WSubId_94($P1, $P2) __label_5: # endif -.annotate 'line', 4517 iseq $I3, $S1, 'I' - unless $I3 goto __label_11 + unless $I3 goto __label_8 iseq $I3, $S2, 'I' - __label_11: - unless $I3 goto __label_10 -# { -.annotate 'line', 4518 -# ln: $I1 - $P6 = $P1.'getIntegerValue'() - set $I1, $P6 -.annotate 'line', 4519 -# rn: $I2 - $P6 = $P2.'getIntegerValue'() - set $I2, $P6 -.annotate 'line', 4520 - getattribute $P6, self, 'owner' - getattribute $P7, self, 'start' + __label_8: + unless $I3 goto __label_7 + $P3 = $P1.'getIntegerValue'() + set $I1, $P3 + $P3 = $P2.'getIntegerValue'() + set $I2, $P3 + getattribute $P3, self, 'owner' + getattribute $P4, self, 'start' add $I3, $I1, $I2 - .tailcall WSubId_21($P6, $P7, $I3) -# } - __label_10: # endif -# { -.annotate 'line', 4523 - $P6 = WSubId_64($S1, $S2) - if_null $P6, __label_12 - unless $P6 goto __label_12 -# { -.annotate 'line', 4524 -# lf: $N1 - $P7 = $P1.'getFloatValue'() - set $N1, $P7 -.annotate 'line', 4525 -# rf: $N2 - $P6 = $P2.'getFloatValue'() - set $N2, $P6 -.annotate 'line', 4526 - getattribute $P6, self, 'owner' - getattribute $P7, self, 'start' + .tailcall WSubId_44($P3, $P4, $I3) + __label_7: # endif + $P3 = WSubId_95($S1, $S2) + if_null $P3, __label_9 + unless $P3 goto __label_9 + $P4 = $P1.'getFloatValue'() + set $N1, $P4 + $P3 = $P2.'getFloatValue'() + set $N2, $P3 + getattribute $P3, self, 'owner' + getattribute $P4, self, 'start' add $N3, $N1, $N2 - .tailcall WSubId_63($P6, $P7, $N3) -# } - __label_12: # endif -# } -# } + .tailcall WSubId_93($P3, $P4, $N3) + __label_9: # endif __label_3: # endif -.annotate 'line', 4530 iseq $I3, $S1, 'S' - unless $I3 goto __label_14 + unless $I3 goto __label_11 iseq $I3, $S2, 'S' - __label_14: - unless $I3 goto __label_13 -# { -.annotate 'line', 4531 - new $P7, [ 'Winxed'; 'Compiler'; 'ConcatString' ] - getattribute $P8, self, 'owner' - getattribute $P9, self, 'start' - $P7.'ConcatString'($P8, $P9, $P1, $P2) - set $P6, $P7 - .return($P6) -# } - __label_13: # endif -.annotate 'line', 4533 + __label_11: + unless $I3 goto __label_10 + new $P4, [ 'Winxed'; 'Compiler'; 'ConcatString' ] + getattribute $P5, self, 'owner' + getattribute $P6, self, 'start' + $P4.'ConcatString'($P5, $P6, $P1, $P2) + set $P3, $P4 + .return($P3) + __label_10: # endif .return(self) -# } -.annotate 'line', 4534 .end # optimize .sub 'checkresult' :method -.const 'Sub' WSubId_64 = "WSubId_64" -# Body -# { -.annotate 'line', 4537 -# rl: $S1 +.const 'Sub' WSubId_95 = "WSubId_95" getattribute $P2, self, 'lexpr' $P1 = $P2.'checkresult'() null $S1 if_null $P1, __label_1 set $S1, $P1 __label_1: -.annotate 'line', 4538 -# rr: $S2 getattribute $P2, self, 'rexpr' $P1 = $P2.'checkresult'() null $S2 if_null $P1, __label_2 set $S2, $P1 __label_2: -.annotate 'line', 4539 ne $S1, $S2, __label_3 -.annotate 'line', 4540 .return($S1) __label_3: # endif -.annotate 'line', 4541 iseq $I1, $S1, 'I' unless $I1 goto __label_5 iseq $I1, $S2, 'S' __label_5: unless $I1 goto __label_4 -.annotate 'line', 4542 .return('S') __label_4: # endif -.annotate 'line', 4543 iseq $I1, $S1, 'S' unless $I1 goto __label_7 iseq $I1, $S2, 'I' __label_7: unless $I1 goto __label_6 -.annotate 'line', 4544 .return('S') __label_6: # endif -.annotate 'line', 4545 - $P1 = WSubId_64($S1, $S2) + $P1 = WSubId_95($S1, $S2) if_null $P1, __label_8 unless $P1 goto __label_8 -.annotate 'line', 4546 .return('N') __label_8: # endif -.annotate 'line', 4547 .return('I') -# } -.annotate 'line', 4548 .end # checkresult .sub 'emit' :method .param pmc __ARG_1 - .param pmc __ARG_2 -# Body -# { -.annotate 'line', 4551 -# var lexpr: $P1 + .param string __ARG_2 getattribute $P1, self, 'lexpr' -.annotate 'line', 4552 -# var rexpr: $P2 getattribute $P2, self, 'rexpr' -.annotate 'line', 4553 -# restype: $S1 $P3 = self.'checkresult'() null $S1 if_null $P3, __label_1 set $S1, $P3 __label_1: -.annotate 'line', 4554 -# ltype: $S2 $P3 = $P1.'checkresult'() null $S2 if_null $P3, __label_2 set $S2, $P3 __label_2: -.annotate 'line', 4555 -# rtype: $S3 $P3 = $P2.'checkresult'() null $S3 if_null $P3, __label_3 set $S3, $P3 __label_3: -.annotate 'line', 4557 -# rleft: $S4 $P3 = $P1.'emit_get'(__ARG_1) null $S4 if_null $P3, __label_4 set $S4, $P3 __label_4: -.annotate 'line', 4558 -# rright: $S5 $P3 = $P2.'emit_get'(__ARG_1) null $S5 if_null $P3, __label_5 set $S5, $P3 __label_5: -.annotate 'line', 4559 ne $S1, 'S', __label_6 -# { -.annotate 'line', 4560 isne $I1, $S2, 'S' if $I1 goto __label_9 isne $I1, $S3, 'S' __label_9: unless $I1 goto __label_8 -# { -.annotate 'line', 4561 -# aux: $S6 $P3 = self.'tempreg'('S') null $S6 if_null $P3, __label_10 set $S6, $P3 __label_10: -.annotate 'line', 4562 eq $S2, 'S', __label_11 -# { -.annotate 'line', 4563 __ARG_1.'emitset'($S6, $S4) -.annotate 'line', 4564 set $S4, $S6 -# } goto __label_12 __label_11: # else -# { -.annotate 'line', 4567 __ARG_1.'emitset'($S6, $S5) -.annotate 'line', 4568 set $S5, $S6 -# } __label_12: # endif -# } __label_8: # endif -.annotate 'line', 4571 __ARG_1.'emitconcat'(__ARG_2, $S4, $S5) -# } goto __label_7 __label_6: # else -# { -.annotate 'line', 4574 iseq $I1, $S1, 'I' unless $I1 goto __label_15 isne $I1, $S2, 'I' @@ -13505,57 +10822,35 @@ __label_16: __label_15: unless $I1 goto __label_13 -# { -.annotate 'line', 4575 -# l: $S7 null $S7 -.annotate 'line', 4576 ne $S2, 'I', __label_17 set $S7, $S4 goto __label_18 __label_17: # else -# { -.annotate 'line', 4578 $P3 = self.'tempreg'('I') set $S7, $P3 -.annotate 'line', 4579 __ARG_1.'emitset'($S7, $S4) -# } __label_18: # endif -.annotate 'line', 4581 -# r: $S8 null $S8 -.annotate 'line', 4582 ne $S3, 'I', __label_19 set $S8, $S5 goto __label_20 __label_19: # else -# { -.annotate 'line', 4584 $P3 = self.'tempreg'('I') set $S8, $P3 -.annotate 'line', 4585 __ARG_1.'emitset'($S8, $S5) -# } __label_20: # endif -.annotate 'line', 4587 __ARG_1.'emitadd'(__ARG_2, $S7, $S8) -# } goto __label_14 __label_13: # else -.annotate 'line', 4590 __ARG_1.'emitadd'(__ARG_2, $S4, $S5) __label_14: # endif -# } __label_7: # endif -# } -.annotate 'line', 4592 .end # emit .sub Winxed_class_init :anon :load :init newclass $P0, [ 'Winxed'; 'Compiler'; 'OpAddExpr' ] -.annotate 'line', 4487 get_class $P1, [ 'Winxed'; 'Compiler'; 'OpBinaryExpr' ] addparent $P0, $P1 .end @@ -13566,162 +10861,165 @@ .param pmc __ARG_2 .param pmc __ARG_3 .param pmc __ARG_4 -# Body -# { -.annotate 'line', 4601 self.'set'(__ARG_1, __ARG_2, __ARG_3, __ARG_4) -# } -.annotate 'line', 4602 .end # OpSubExpr +.sub 'clone' :method + .param pmc __ARG_1 + new $P1, [ 'Winxed'; 'Compiler'; 'OpSubExpr' ] + .tailcall self.'clonebinary'($P1, __ARG_1) + +.end # clone + + .sub 'optimize' :method -.const 'Sub' WSubId_21 = "WSubId_21" -# Body -# { -.annotate 'line', 4605 +.const 'Sub' WSubId_44 = "WSubId_44" self.'optimizearg'() -.annotate 'line', 4606 -# var lexpr: $P1 getattribute $P1, self, 'lexpr' -.annotate 'line', 4607 -# var rexpr: $P2 getattribute $P2, self, 'rexpr' -.annotate 'line', 4608 - $I3 = $P1.'isliteral'() - unless $I3 goto __label_2 - $I3 = $P2.'isliteral'() + $P3 = $P1.'isliteral'() + unless $P3 goto __label_2 + $P3 = $P2.'isliteral'() __label_2: - unless $I3 goto __label_1 -# { -.annotate 'line', 4609 -# ltype: $S1 - $P3 = $P1.'checkresult'() + if_null $P3, __label_1 + unless $P3 goto __label_1 + $P4 = $P1.'checkresult'() null $S1 - if_null $P3, __label_3 - set $S1, $P3 + if_null $P4, __label_3 + set $S1, $P4 __label_3: -.annotate 'line', 4610 -# rtype: $S2 $P3 = $P2.'checkresult'() null $S2 if_null $P3, __label_4 set $S2, $P3 __label_4: -.annotate 'line', 4611 iseq $I3, $S1, 'I' unless $I3 goto __label_6 iseq $I3, $S2, 'I' __label_6: unless $I3 goto __label_5 -# { -.annotate 'line', 4612 -# ln: $I1 $P3 = $P1.'getIntegerValue'() set $I1, $P3 -.annotate 'line', 4613 -# rn: $I2 $P3 = $P2.'getIntegerValue'() set $I2, $P3 -.annotate 'line', 4614 getattribute $P3, self, 'owner' getattribute $P4, self, 'start' sub $I3, $I1, $I2 - .tailcall WSubId_21($P3, $P4, $I3) -# } + .tailcall WSubId_44($P3, $P4, $I3) __label_5: # endif -# } __label_1: # endif -.annotate 'line', 4617 .return(self) -# } -.annotate 'line', 4618 .end # optimize .sub 'checkresult' :method -# Body -# { -.annotate 'line', 4621 -# rl: $S1 getattribute $P2, self, 'lexpr' $P1 = $P2.'checkresult'() null $S1 if_null $P1, __label_1 set $S1, $P1 __label_1: -.annotate 'line', 4622 -# rr: $S2 getattribute $P2, self, 'rexpr' $P1 = $P2.'checkresult'() null $S2 if_null $P1, __label_2 set $S2, $P1 __label_2: -.annotate 'line', 4623 - ne $S1, $S2, __label_3 -.annotate 'line', 4624 - .return($S1) - __label_3: # endif -.annotate 'line', 4625 + iseq $I1, $S1, $S2 + if $I1 goto __label_5 + iseq $I1, $S1, 'P' + if $I1 goto __label_7 + iseq $I1, $S2, 'P' + __label_7: + if $I1 goto __label_6 iseq $I1, $S1, 'I' - unless $I1 goto __label_5 + unless $I1 goto __label_9 iseq $I1, $S2, 'N' - __label_5: - unless $I1 goto __label_4 -.annotate 'line', 4626 - .return('N') - __label_4: # endif -.annotate 'line', 4627 + __label_9: + if $I1 goto __label_8 iseq $I1, $S1, 'N' - unless $I1 goto __label_7 + unless $I1 goto __label_11 iseq $I1, $S2, 'I' - __label_7: - unless $I1 goto __label_6 -.annotate 'line', 4628 + __label_11: + if $I1 goto __label_10 + goto __label_4 + __label_5: # case + .return($S1) + __label_6: # case + .return('P') + __label_8: # case .return('N') - __label_6: # endif -.annotate 'line', 4629 + __label_10: # case + .return('N') + __label_4: # default .return('I') -# } -.annotate 'line', 4630 + __label_3: # switch end .end # checkresult .sub 'emit' :method .param pmc __ARG_1 - .param pmc __ARG_2 -# Body -# { -.annotate 'line', 4633 -# lreg: $S1 - getattribute $P2, self, 'lexpr' - $P1 = $P2.'emit_get'(__ARG_1) + .param string __ARG_2 + $P3 = self.'checkresult'() null $S1 - if_null $P1, __label_1 - set $S1, $P1 + if_null $P3, __label_1 + set $S1, $P3 __label_1: -.annotate 'line', 4634 -# rreg: $S2 + getattribute $P1, self, 'lexpr' getattribute $P2, self, 'rexpr' - $P1 = $P2.'emit_get'(__ARG_1) + $P3 = $P1.'checkresult'() null $S2 - if_null $P1, __label_2 - set $S2, $P1 + if_null $P3, __label_2 + set $S2, $P3 __label_2: -.annotate 'line', 4635 - __ARG_1.'emitsub'(__ARG_2, $S1, $S2) -# } -.annotate 'line', 4636 + $P3 = $P2.'checkresult'() + null $S3 + if_null $P3, __label_3 + set $S3, $P3 + __label_3: + $P3 = $P1.'emit_get'(__ARG_1) + null $S4 + if_null $P3, __label_4 + set $S4, $P3 + __label_4: + $P3 = $P2.'emit_get'(__ARG_1) + null $S5 + if_null $P3, __label_5 + set $S5, $P3 + __label_5: + null $S6 + eq $S2, $S1, __label_6 + $P3 = self.'tempreg'($S1) + set $S6, $P3 + ne $S1, 'P', __label_7 + __ARG_1.'emitbox'($S6, $S4) + goto __label_8 + __label_7: # else + __ARG_1.'emitset'($S6, $S4) + __label_8: # endif + set $S4, $S6 + __label_6: # endif + eq $S3, $S1, __label_9 + $P3 = self.'tempreg'($S1) + set $S6, $P3 + ne $S1, 'P', __label_10 + __ARG_1.'emitbox'($S6, $S5) + goto __label_11 + __label_10: # else + __ARG_1.'emitset'($S6, $S5) + __label_11: # endif + set $S5, $S6 + __label_9: # endif + __ARG_1.'emitsub'(__ARG_2, $S4, $S5) .end # emit .sub Winxed_class_init :anon :load :init newclass $P0, [ 'Winxed'; 'Compiler'; 'OpSubExpr' ] -.annotate 'line', 4597 get_class $P1, [ 'Winxed'; 'Compiler'; 'OpBinaryExpr' ] addparent $P0, $P1 .end @@ -13732,186 +11030,124 @@ .param pmc __ARG_2 .param pmc __ARG_3 .param pmc __ARG_4 -# Body -# { -.annotate 'line', 4645 self.'set'(__ARG_1, __ARG_2, __ARG_3, __ARG_4) -# } -.annotate 'line', 4646 .end # OpMulExpr +.sub 'clone' :method + .param pmc __ARG_1 + new $P1, [ 'Winxed'; 'Compiler'; 'OpMulExpr' ] + .tailcall self.'clonebinary'($P1, __ARG_1) + +.end # clone + + .sub 'optimize' :method -.const 'Sub' WSubId_21 = "WSubId_21" -.const 'Sub' WSubId_64 = "WSubId_64" -.const 'Sub' WSubId_63 = "WSubId_63" -# Body -# { -.annotate 'line', 4649 +.const 'Sub' WSubId_44 = "WSubId_44" +.const 'Sub' WSubId_95 = "WSubId_95" +.const 'Sub' WSubId_93 = "WSubId_93" self.'optimizearg'() -.annotate 'line', 4650 -# var lexpr: $P1 getattribute $P1, self, 'lexpr' -.annotate 'line', 4651 -# var rexpr: $P2 getattribute $P2, self, 'rexpr' -.annotate 'line', 4652 -# ltype: $S1 $P3 = $P1.'checkresult'() null $S1 if_null $P3, __label_1 set $S1, $P3 __label_1: -.annotate 'line', 4653 -# rtype: $S2 $P3 = $P2.'checkresult'() null $S2 if_null $P3, __label_2 set $S2, $P3 __label_2: -.annotate 'line', 4654 - $I3 = $P1.'isliteral'() - unless $I3 goto __label_4 - $I3 = $P2.'isliteral'() + $P3 = $P1.'isliteral'() + unless $P3 goto __label_4 + $P3 = $P2.'isliteral'() __label_4: - unless $I3 goto __label_3 -# { -.annotate 'line', 4655 - iseq $I4, $S1, 'I' - unless $I4 goto __label_6 - iseq $I4, $S2, 'I' + if_null $P3, __label_3 + unless $P3 goto __label_3 + iseq $I3, $S1, 'I' + unless $I3 goto __label_6 + iseq $I3, $S2, 'I' __label_6: - unless $I4 goto __label_5 -# { -.annotate 'line', 4656 -# ln: $I1 - $P3 = $P1.'getIntegerValue'() - set $I1, $P3 -.annotate 'line', 4657 -# rn: $I2 + unless $I3 goto __label_5 + $P4 = $P1.'getIntegerValue'() + set $I1, $P4 $P3 = $P2.'getIntegerValue'() set $I2, $P3 -.annotate 'line', 4658 getattribute $P3, self, 'owner' getattribute $P4, self, 'start' mul $I3, $I1, $I2 - .tailcall WSubId_21($P3, $P4, $I3) -# } + .tailcall WSubId_44($P3, $P4, $I3) __label_5: # endif -# { -.annotate 'line', 4661 - $P3 = WSubId_64($S1, $S2) + $P3 = WSubId_95($S1, $S2) if_null $P3, __label_7 unless $P3 goto __label_7 -# { -.annotate 'line', 4662 -# lf: $N1 $P4 = $P1.'getFloatValue'() set $N1, $P4 -.annotate 'line', 4663 -# rf: $N2 $P3 = $P2.'getFloatValue'() set $N2, $P3 -.annotate 'line', 4664 getattribute $P3, self, 'owner' getattribute $P4, self, 'start' mul $N3, $N1, $N2 - .tailcall WSubId_63($P3, $P4, $N3) -# } + .tailcall WSubId_93($P3, $P4, $N3) __label_7: # endif -# } -# } __label_3: # endif -.annotate 'line', 4668 ne $S1, 'S', __label_8 -.annotate 'line', 4669 new $P4, [ 'Winxed'; 'Compiler'; 'RepeatString' ] $P4.'RepeatString'(self) set $P3, $P4 .return($P3) __label_8: # endif -.annotate 'line', 4670 .return(self) -# } -.annotate 'line', 4671 .end # optimize .sub 'checkresult' :method -# Body -# { -.annotate 'line', 4674 -# var lexpr: $P1 getattribute $P1, self, 'lexpr' -.annotate 'line', 4675 -# rl: $S1 getattribute $P3, self, 'lexpr' $P2 = $P3.'checkresult'() null $S1 if_null $P2, __label_1 set $S1, $P2 __label_1: -.annotate 'line', 4676 -# rr: $S2 getattribute $P3, self, 'rexpr' $P2 = $P3.'checkresult'() null $S2 if_null $P2, __label_2 set $S2, $P2 __label_2: -.annotate 'line', 4677 ne $S1, $S2, __label_3 -.annotate 'line', 4678 .return($S1) __label_3: # endif -.annotate 'line', 4679 ne $S1, 'S', __label_4 -.annotate 'line', 4680 .return('S') goto __label_5 __label_4: # else -.annotate 'line', 4682 .return('N') __label_5: # endif -# } -.annotate 'line', 4683 .end # checkresult .sub 'emit' :method .param pmc __ARG_1 - .param pmc __ARG_2 -# Body -# { -.annotate 'line', 4686 -# var lexpr: $P1 + .param string __ARG_2 getattribute $P1, self, 'lexpr' -.annotate 'line', 4687 -# var rexpr: $P2 getattribute $P2, self, 'rexpr' -.annotate 'line', 4688 -# ltype: $S1 $P3 = $P1.'checkresult'() null $S1 if_null $P3, __label_1 set $S1, $P3 __label_1: -.annotate 'line', 4689 -# rtype: $S2 $P3 = $P2.'checkresult'() null $S2 if_null $P3, __label_2 set $S2, $P3 __label_2: -.annotate 'line', 4690 -# lreg: $S3 null $S3 -# rreg: $S4 null $S4 -.annotate 'line', 4691 iseq $I3, $S1, $S2 unless $I3 goto __label_4 iseq $I3, $S1, 'I' @@ -13923,175 +11159,111 @@ __label_5: __label_4: unless $I3 goto __label_3 -# { -.annotate 'line', 4692 $P3 = $P1.'emit_get'(__ARG_1) set $S3, $P3 -.annotate 'line', 4693 $P3 = $P2.'emit_get'(__ARG_1) set $S4, $P3 -.annotate 'line', 4694 __ARG_1.'emitmul'(__ARG_2, $S3, $S4) -.annotate 'line', 4695 .return() -# } __label_3: # endif -.annotate 'line', 4700 ne $S1, 'N', __label_7 -# { -.annotate 'line', 4701 $P3 = $P1.'emit_get'(__ARG_1) set $S3, $P3 -.annotate 'line', 4702 $P3 = $P2.'emit_get'(__ARG_1) set $S4, $P3 -.annotate 'line', 4703 -# rval: $S5 null $S5 -# switch -.annotate 'line', 4704 - set $S6, $S2 - set $S7, 'I' - if $S6 == $S7 goto __label_10 - set $S7, 'N' - if $S6 == $S7 goto __label_11 - goto __label_9 + if_null $S2, __label_8 + length $I3, $S2 + ne $I3, 1, __label_8 + ord $I3, $S2 + if $I3 == 73 goto __label_10 + if $I3 == 78 goto __label_11 + goto __label_8 __label_10: # case -.annotate 'line', 4706 $P3 = self.'tempreg'('N') set $S5, $P3 -.annotate 'line', 4707 __ARG_1.'emitset'($S5, $S4) -.annotate 'line', 4708 set $S5, $S4 - goto __label_8 # break + goto __label_9 # break __label_11: # case -.annotate 'line', 4711 set $S5, $S4 - goto __label_8 # break - __label_9: # default -.annotate 'line', 4714 + goto __label_9 # break + __label_8: # default $P4 = self.'tempreg'('N') set $S5, $P4 -.annotate 'line', 4715 __ARG_1.'emitset'($S5, $S4) - __label_8: # switch end -.annotate 'line', 4717 - set $S6, __ARG_2 - eq $S6, '', __label_12 -# { -.annotate 'line', 4718 + __label_9: # switch end self.'annotate'(__ARG_1) -.annotate 'line', 4719 __ARG_1.'emitmul'(__ARG_2, $S3, $S5) -# } - __label_12: # endif -.annotate 'line', 4721 .return() -# } __label_7: # endif -.annotate 'line', 4724 -# nleft: $I1 null $I1 -# nright: $I2 null $I2 -.annotate 'line', 4725 - $P3 = $P1.'issimple'() - isfalse $I3, $P3 - if $I3 goto __label_15 - $I3 = $P1.'isidentifier'() - __label_15: - unless $I3 goto __label_13 -# { -.annotate 'line', 4726 - $P5 = self.'checkresult'() - $P4 = self.'tempreg'($P5) - set $S3, $P4 -.annotate 'line', 4727 + $P4 = $P1.'issimple'() + isfalse $I3, $P4 + box $P3, $I3 + if $P3 goto __label_14 + $P3 = $P1.'isidentifier'() + __label_14: + if_null $P3, __label_12 + unless $P3 goto __label_12 + $P6 = self.'checkresult'() + $P5 = self.'tempreg'($P6) + set $S3, $P5 $P1.'emit'(__ARG_1, $S3) -# } - goto __label_14 - __label_13: # else -# { -.annotate 'line', 4730 + goto __label_13 + __label_12: # else $P3 = $P1.'getIntegerValue'() set $I1, $P3 -.annotate 'line', 4731 set $S3, $I1 -# } - __label_14: # endif -.annotate 'line', 4733 - $P3 = $P2.'issimple'() - isfalse $I3, $P3 - if $I3 goto __label_18 - $I3 = $P2.'isidentifier'() - __label_18: - unless $I3 goto __label_16 -# { -.annotate 'line', 4734 - $P5 = self.'checkresult'() - $P4 = self.'tempreg'($P5) - set $S4, $P4 -.annotate 'line', 4735 + __label_13: # endif + $P4 = $P2.'issimple'() + isfalse $I3, $P4 + box $P3, $I3 + if $P3 goto __label_17 + $P3 = $P2.'isidentifier'() + __label_17: + if_null $P3, __label_15 + unless $P3 goto __label_15 + $P6 = self.'checkresult'() + $P5 = self.'tempreg'($P6) + set $S4, $P5 $P2.'emit'(__ARG_1, $S4) -# } - goto __label_17 - __label_16: # else -# { -# switch -.annotate 'line', 4738 - set $S6, $S2 - set $S7, 'S' - if $S6 == $S7 goto __label_21 - set $S7, 'N' - if $S6 == $S7 goto __label_22 - set $S7, 'I' - if $S6 == $S7 goto __label_23 - goto __label_20 - __label_21: # case -.annotate 'line', 4740 + goto __label_16 + __label_15: # else + if_null $S2, __label_18 + length $I3, $S2 + ne $I3, 1, __label_18 + ord $I3, $S2 + if $I3 == 83 goto __label_20 + if $I3 == 78 goto __label_21 + if $I3 == 73 goto __label_22 + goto __label_18 + __label_20: # case $P4 = self.'checkresult'() $P3 = self.'tempreg'($P4) set $S4, $P3 -.annotate 'line', 4741 $P2.'emit'(__ARG_1, $S4) goto __label_19 # break - __label_22: # case -.annotate 'line', 4744 + __label_21: # case $P5 = $P2.'emit_get'(__ARG_1) set $S4, $P5 goto __label_19 # break - __label_23: # case - __label_20: # default -.annotate 'line', 4748 + __label_22: # case + __label_18: # default $P6 = $P2.'getIntegerValue'() set $I2, $P6 -.annotate 'line', 4749 set $S4, $I2 goto __label_19 # break __label_19: # switch end -.annotate 'line', 4750 -# } - __label_17: # endif -.annotate 'line', 4753 + __label_16: # endif self.'annotate'(__ARG_1) -.annotate 'line', 4754 - set $S6, __ARG_2 - ne $S6, '', __label_24 -.annotate 'line', 4755 - $P3 = self.'checkresult'() - __ARG_2 = self.'tempreg'($P3) - __label_24: # endif -.annotate 'line', 4756 __ARG_1.'emitmul'(__ARG_2, $S3, $S4) -# } -.annotate 'line', 4757 .end # emit .sub Winxed_class_init :anon :load :init newclass $P0, [ 'Winxed'; 'Compiler'; 'OpMulExpr' ] -.annotate 'line', 4641 get_class $P1, [ 'Winxed'; 'Compiler'; 'OpBinaryExpr' ] addparent $P0, $P1 .end @@ -14102,189 +11274,117 @@ .param pmc __ARG_2 .param pmc __ARG_3 .param pmc __ARG_4 -# Body -# { -.annotate 'line', 4766 self.'set'(__ARG_1, __ARG_2, __ARG_3, __ARG_4) -# } -.annotate 'line', 4767 .end # OpDivExpr +.sub 'clone' :method + .param pmc __ARG_1 + new $P1, [ 'Winxed'; 'Compiler'; 'OpDivExpr' ] + .tailcall self.'clonebinary'($P1, __ARG_1) + +.end # clone + + .sub 'optimize' :method -.const 'Sub' WSubId_21 = "WSubId_21" -.const 'Sub' WSubId_64 = "WSubId_64" -.const 'Sub' WSubId_63 = "WSubId_63" -# Body -# { -.annotate 'line', 4770 +.const 'Sub' WSubId_93 = "WSubId_93" +.const 'Sub' WSubId_95 = "WSubId_95" self.'optimizearg'() -.annotate 'line', 4771 -# var lexpr: $P1 getattribute $P1, self, 'lexpr' -.annotate 'line', 4772 -# var rexpr: $P2 getattribute $P2, self, 'rexpr' -.annotate 'line', 4773 - $I3 = $P1.'isliteral'() - unless $I3 goto __label_2 - $I3 = $P2.'isliteral'() + $P5 = $P1.'isliteral'() + unless $P5 goto __label_2 + $P5 = $P2.'isliteral'() __label_2: - unless $I3 goto __label_1 -# { -.annotate 'line', 4774 -# ltype: $S1 - $P5 = $P1.'checkresult'() + if_null $P5, __label_1 + unless $P5 goto __label_1 + $P6 = $P1.'checkresult'() null $S1 - if_null $P5, __label_3 - set $S1, $P5 + if_null $P6, __label_3 + set $S1, $P6 __label_3: -.annotate 'line', 4775 -# rtype: $S2 $P5 = $P2.'checkresult'() null $S2 if_null $P5, __label_4 set $S2, $P5 __label_4: -.annotate 'line', 4776 -# var lval: $P3 null $P3 -.annotate 'line', 4777 -# var rval: $P4 null $P4 -.annotate 'line', 4778 iseq $I3, $S1, 'I' unless $I3 goto __label_6 iseq $I3, $S2, 'I' __label_6: unless $I3 goto __label_5 -# { -.annotate 'line', 4779 -# ln: $I1 $P5 = $P1.'getIntegerValue'() set $I1, $P5 -.annotate 'line', 4780 -# rn: $I2 $P5 = $P2.'getIntegerValue'() set $I2, $P5 -.annotate 'line', 4781 - eq $I2, 0, __label_7 -.annotate 'line', 4782 + unless $I2 goto __label_7 getattribute $P5, self, 'owner' getattribute $P6, self, 'start' set $N4, $I1 set $N5, $I2 div $N3, $N4, $N5 - .tailcall WSubId_21($P5, $P6, $N3) + .tailcall WSubId_93($P5, $P6, $N3) __label_7: # endif -# } __label_5: # endif -# { -.annotate 'line', 4785 - $P5 = WSubId_64($S1, $S2) + $P5 = WSubId_95($S1, $S2) if_null $P5, __label_8 unless $P5 goto __label_8 -# { -.annotate 'line', 4786 -# lf: $N1 $P6 = $P1.'getFloatValue'() set $N1, $P6 -.annotate 'line', 4787 -# rf: $N2 $P5 = $P2.'getFloatValue'() set $N2, $P5 -.annotate 'line', 4788 - set $N3, 0 - eq $N2, $N3, __label_9 -.annotate 'line', 4789 + set $I3, $N2 + unless $I3 goto __label_9 getattribute $P5, self, 'owner' getattribute $P6, self, 'start' - div $N4, $N1, $N2 - .tailcall WSubId_63($P5, $P6, $N4) + div $N3, $N1, $N2 + .tailcall WSubId_93($P5, $P6, $N3) __label_9: # endif -# } __label_8: # endif -# } -# } __label_1: # endif -.annotate 'line', 4793 .return(self) -# } -.annotate 'line', 4794 .end # optimize .sub 'checkresult' :method -# Body -# { -.annotate 'line', 4797 .return('N') -# } -.annotate 'line', 4798 .end # checkresult .sub 'emit' :method .param pmc __ARG_1 - .param pmc __ARG_2 -# Body -# { -.annotate 'line', 4801 -# var lexpr: $P1 + .param string __ARG_2 getattribute $P1, self, 'lexpr' -.annotate 'line', 4802 -# var aux: $P2 null $P2 -.annotate 'line', 4803 -# var lreg: $P3 $P3 = $P1.'emit_get'(__ARG_1) -.annotate 'line', 4804 $P6 = $P1.'checkresult'() set $S1, $P6 eq $S1, 'N', __label_1 -# { -.annotate 'line', 4805 $P2 = self.'tempreg'('N') -.annotate 'line', 4806 __ARG_1.'emitset'($P2, $P3) -.annotate 'line', 4807 set $P3, $P2 -# } __label_1: # endif -.annotate 'line', 4809 -# var rexpr: $P4 getattribute $P4, self, 'rexpr' -.annotate 'line', 4810 -# var rreg: $P5 $P5 = $P4.'emit_get'(__ARG_1) -.annotate 'line', 4811 $P6 = $P4.'checkresult'() set $S1, $P6 eq $S1, 'N', __label_2 -# { -.annotate 'line', 4812 $P2 = self.'tempreg'('N') -.annotate 'line', 4813 __ARG_1.'emitset'($P2, $P5) -.annotate 'line', 4814 set $P5, $P2 -# } __label_2: # endif -.annotate 'line', 4816 self.'annotate'(__ARG_1) -.annotate 'line', 4817 __ARG_1.'emitdiv'(__ARG_2, $P3, $P5) -# } -.annotate 'line', 4818 .end # emit .sub Winxed_class_init :anon :load :init newclass $P0, [ 'Winxed'; 'Compiler'; 'OpDivExpr' ] -.annotate 'line', 4762 get_class $P1, [ 'Winxed'; 'Compiler'; 'OpBinaryExpr' ] addparent $P0, $P1 .end @@ -14295,41 +11395,34 @@ .param pmc __ARG_2 .param pmc __ARG_3 .param pmc __ARG_4 -# Body -# { -.annotate 'line', 4827 self.'set'(__ARG_1, __ARG_2, __ARG_3, __ARG_4) -# } -.annotate 'line', 4828 .end # OpModExpr +.sub 'clone' :method + .param pmc __ARG_1 + new $P1, [ 'Winxed'; 'Compiler'; 'OpModExpr' ] + .tailcall self.'clonebinary'($P1, __ARG_1) + +.end # clone + + .sub 'emit' :method .param pmc __ARG_1 - .param pmc __ARG_2 -# Body -# { -.annotate 'line', 4831 -# lreg: $S1 + .param string __ARG_2 $P1 = self.'emit_intleft'(__ARG_1) null $S1 if_null $P1, __label_1 set $S1, $P1 __label_1: -.annotate 'line', 4832 -# rreg: $S2 $P1 = self.'emit_intright'(__ARG_1) null $S2 if_null $P1, __label_2 set $S2, $P1 __label_2: -.annotate 'line', 4833 self.'annotate'(__ARG_1) -.annotate 'line', 4834 __ARG_1.'emitbinop'('mod', __ARG_2, $S1, $S2) -# } -.annotate 'line', 4835 .end # emit @@ -14337,19 +11430,13 @@ .sub 'do_op' :method .param int __ARG_1 .param int __ARG_2 -# Body -# { -.annotate 'line', 4838 mod $I1, __ARG_1, __ARG_2 .return($I1) -# } -.annotate 'line', 4839 .end # do_op .sub Winxed_class_init :anon :load :init newclass $P0, [ 'Winxed'; 'Compiler'; 'OpModExpr' ] -.annotate 'line', 4823 get_class $P1, [ 'Winxed'; 'Compiler'; 'OpBinaryIntExpr' ] addparent $P0, $P1 .end @@ -14360,58 +11447,45 @@ .param pmc __ARG_2 .param pmc __ARG_3 .param pmc __ARG_4 -# Body -# { -.annotate 'line', 4848 self.'set'(__ARG_1, __ARG_2, __ARG_3, __ARG_4) -# } -.annotate 'line', 4849 .end # OpCModExpr +.sub 'clone' :method + .param pmc __ARG_1 + new $P1, [ 'Winxed'; 'Compiler'; 'OpCModExpr' ] + .tailcall self.'clonebinary'($P1, __ARG_1) + +.end # clone + + .sub 'checkresult' :method -# Body -# { -.annotate 'line', 4852 .return('I') -# } -.annotate 'line', 4853 .end # checkresult .sub 'emit' :method .param pmc __ARG_1 - .param pmc __ARG_2 -# Body -# { -.annotate 'line', 4856 -# lreg: $S1 + .param string __ARG_2 $P1 = self.'emit_intleft'(__ARG_1) null $S1 if_null $P1, __label_1 set $S1, $P1 __label_1: -.annotate 'line', 4857 -# rreg: $S2 $P1 = self.'emit_intright'(__ARG_1) null $S2 if_null $P1, __label_2 set $S2, $P1 __label_2: -.annotate 'line', 4858 self.'annotate'(__ARG_1) -.annotate 'line', 4863 __ARG_1.'emitbinop'('mod', __ARG_2, $S1, $S2) -# } -.annotate 'line', 4864 .end # emit .sub Winxed_class_init :anon :load :init newclass $P0, [ 'Winxed'; 'Compiler'; 'OpCModExpr' ] -.annotate 'line', 4844 get_class $P1, [ 'Winxed'; 'Compiler'; 'OpBinaryExpr' ] addparent $P0, $P1 .end @@ -14422,53 +11496,34 @@ .param pmc __ARG_2 .param pmc __ARG_3 .param pmc __ARG_4 -# Body -# { -.annotate 'line', 4873 self.'set'(__ARG_1, __ARG_2, __ARG_3, __ARG_4) -# } -.annotate 'line', 4874 .end # OpShiftleftExpr +.sub 'clone' :method + .param pmc __ARG_1 + new $P1, [ 'Winxed'; 'Compiler'; 'OpShiftleftExpr' ] + .tailcall self.'clonebinary'($P1, __ARG_1) + +.end # clone + + .sub 'emit' :method .param pmc __ARG_1 - .param pmc __ARG_2 -# Body -# { -.annotate 'line', 4877 -# res: $S1 - if_null __ARG_2, __label_2 - set $P1, __ARG_2 - goto __label_1 - __label_2: - $P1 = self.'tempreg'('I') - __label_1: + .param string __ARG_2 + $P1 = self.'emit_intleft'(__ARG_1) null $S1 - if_null $P1, __label_3 + if_null $P1, __label_1 set $S1, $P1 - __label_3: -.annotate 'line', 4878 -# lreg: $S2 - $P1 = self.'emit_intleft'(__ARG_1) + __label_1: + $P1 = self.'emit_intright'(__ARG_1) null $S2 - if_null $P1, __label_4 + if_null $P1, __label_2 set $S2, $P1 - __label_4: -.annotate 'line', 4879 -# rreg: $S3 - $P1 = self.'emit_intright'(__ARG_1) - null $S3 - if_null $P1, __label_5 - set $S3, $P1 - __label_5: -.annotate 'line', 4880 + __label_2: self.'annotate'(__ARG_1) -.annotate 'line', 4881 - __ARG_1.'emitbinop'('shl', $S1, $S2, $S3) -# } -.annotate 'line', 4882 + __ARG_1.'emitbinop'('shl', __ARG_2, $S1, $S2) .end # emit @@ -14476,19 +11531,13 @@ .sub 'do_op' :method .param int __ARG_1 .param int __ARG_2 -# Body -# { -.annotate 'line', 4885 shl $I1, __ARG_1, __ARG_2 .return($I1) -# } -.annotate 'line', 4886 .end # do_op .sub Winxed_class_init :anon :load :init newclass $P0, [ 'Winxed'; 'Compiler'; 'OpShiftleftExpr' ] -.annotate 'line', 4869 get_class $P1, [ 'Winxed'; 'Compiler'; 'OpBinaryIntExpr' ] addparent $P0, $P1 .end @@ -14499,53 +11548,34 @@ .param pmc __ARG_2 .param pmc __ARG_3 .param pmc __ARG_4 -# Body -# { -.annotate 'line', 4895 self.'set'(__ARG_1, __ARG_2, __ARG_3, __ARG_4) -# } -.annotate 'line', 4896 .end # OpShiftrightExpr +.sub 'clone' :method + .param pmc __ARG_1 + new $P1, [ 'Winxed'; 'Compiler'; 'OpShiftrightExpr' ] + .tailcall self.'clonebinary'($P1, __ARG_1) + +.end # clone + + .sub 'emit' :method .param pmc __ARG_1 - .param pmc __ARG_2 -# Body -# { -.annotate 'line', 4899 -# res: $S1 - if_null __ARG_2, __label_2 - set $P1, __ARG_2 - goto __label_1 - __label_2: - $P1 = self.'tempreg'('I') - __label_1: + .param string __ARG_2 + $P1 = self.'emit_intleft'(__ARG_1) null $S1 - if_null $P1, __label_3 + if_null $P1, __label_1 set $S1, $P1 - __label_3: -.annotate 'line', 4900 -# lreg: $S2 - $P1 = self.'emit_intleft'(__ARG_1) - null $S2 - if_null $P1, __label_4 - set $S2, $P1 - __label_4: -.annotate 'line', 4901 -# rreg: $S3 + __label_1: $P1 = self.'emit_intright'(__ARG_1) - null $S3 - if_null $P1, __label_5 - set $S3, $P1 - __label_5: -.annotate 'line', 4902 + null $S2 + if_null $P1, __label_2 + set $S2, $P1 + __label_2: self.'annotate'(__ARG_1) -.annotate 'line', 4903 - __ARG_1.'emitbinop'('shr', $S1, $S2, $S3) -# } -.annotate 'line', 4904 + __ARG_1.'emitbinop'('shr', __ARG_2, $S1, $S2) .end # emit @@ -14553,19 +11583,65 @@ .sub 'do_op' :method .param int __ARG_1 .param int __ARG_2 -# Body -# { -.annotate 'line', 4907 shr $I1, __ARG_1, __ARG_2 .return($I1) -# } -.annotate 'line', 4908 .end # do_op .sub Winxed_class_init :anon :load :init newclass $P0, [ 'Winxed'; 'Compiler'; 'OpShiftrightExpr' ] -.annotate 'line', 4891 + get_class $P1, [ 'Winxed'; 'Compiler'; 'OpBinaryIntExpr' ] + addparent $P0, $P1 +.end +.namespace [ 'Winxed'; 'Compiler'; 'OpShiftlrightExpr' ] + +.sub 'OpShiftlrightExpr' :method + .param pmc __ARG_1 + .param pmc __ARG_2 + .param pmc __ARG_3 + .param pmc __ARG_4 + self.'set'(__ARG_1, __ARG_2, __ARG_3, __ARG_4) + +.end # OpShiftlrightExpr + + +.sub 'clone' :method + .param pmc __ARG_1 + new $P1, [ 'Winxed'; 'Compiler'; 'OpShiftlrightExpr' ] + .tailcall self.'clonebinary'($P1, __ARG_1) + +.end # clone + + +.sub 'emit' :method + .param pmc __ARG_1 + .param string __ARG_2 + $P1 = self.'emit_intleft'(__ARG_1) + null $S1 + if_null $P1, __label_1 + set $S1, $P1 + __label_1: + $P1 = self.'emit_intright'(__ARG_1) + null $S2 + if_null $P1, __label_2 + set $S2, $P1 + __label_2: + self.'annotate'(__ARG_1) + __ARG_1.'emitbinop'('lsr', __ARG_2, $S1, $S2) + +.end # emit + + +.sub 'do_op' :method + .param int __ARG_1 + .param int __ARG_2 + lsr $I1, __ARG_1, __ARG_2 + .return($I1) + +.end # do_op + +.sub Winxed_class_init :anon :load :init + newclass $P0, [ 'Winxed'; 'Compiler'; 'OpShiftlrightExpr' ] get_class $P1, [ 'Winxed'; 'Compiler'; 'OpBinaryIntExpr' ] addparent $P0, $P1 .end @@ -14574,30 +11650,17 @@ .sub 'ArgumentModifierList' :method .param pmc __ARG_1 .param pmc __ARG_2 -# Body -# { -.annotate 'line', 4917 self.'ModifierList'(__ARG_1, __ARG_2) -# } -.annotate 'line', 4918 .end # ArgumentModifierList .sub 'emitmodifiers' :method .param pmc __ARG_1 -.const 'Sub' WSubId_1 = "WSubId_1" -# Body -# { -.annotate 'line', 4921 -# isflat: $I1 +.const 'Sub' WSubId_25 = "WSubId_25" null $I1 -# isnamed: $I2 null $I2 -.annotate 'line', 4922 -# setname: $S1 set $S1, '' -.annotate 'line', 4923 $P3 = self.'getlist'() if_null $P3, __label_2 iter $P4, $P3 @@ -14605,97 +11668,66 @@ __label_1: # for iteration unless $P4 goto __label_2 shift $P1, $P4 -# { -# switch -.annotate 'line', 4924 $P5 = $P1.'getname'() set $S2, $P5 - set $S3, 'flat' - if $S2 == $S3 goto __label_5 - set $S3, 'named' - if $S2 == $S3 goto __label_6 - goto __label_4 + if $S2 == 'flat' goto __label_5 + if $S2 == 'named' goto __label_6 + goto __label_3 __label_5: # case -.annotate 'line', 4926 set $I1, 1 - goto __label_3 # break + goto __label_4 # break __label_6: # case -.annotate 'line', 4929 set $I2, 1 -# switch -.annotate 'line', 4930 $P6 = $P1.'numargs'() set $I3, $P6 - null $I4 - if $I3 == $I4 goto __label_9 - set $I4, 1 - if $I3 == $I4 goto __label_10 - goto __label_8 + if $I3 == 0 goto __label_9 + if $I3 == 1 goto __label_10 + goto __label_7 __label_9: # case - goto __label_7 # break + goto __label_8 # break __label_10: # case -.annotate 'line', 4934 -# var argmod: $P2 $P2 = $P1.'getarg'(0) -.annotate 'line', 4935 $P7 = $P2.'isstringliteral'() isfalse $I5, $P7 unless $I5 goto __label_11 -.annotate 'line', 4936 - WSubId_1('Invalid modifier', self) + WSubId_25('Invalid modifier', self) __label_11: # endif -.annotate 'line', 4937 $P8 = $P2.'getPirString'() set $S1, $P8 - goto __label_7 # break - __label_8: # default -.annotate 'line', 4940 - WSubId_1('Invalid modifier', self) - __label_7: # switch end - __label_4: # default - __label_3: # switch end -# } + goto __label_8 # break + __label_7: # default + WSubId_25('Invalid modifier', self) + __label_8: # switch end + __label_3: # default + __label_4: # switch end goto __label_1 __label_2: # endfor -# switch-case -.annotate 'line', 4945 and $I3, $I1, $I2 if $I3 goto __label_14 -.annotate 'line', 4948 set $I3, $I1 if $I3 goto __label_15 -.annotate 'line', 4951 set $I3, $I2 if $I3 goto __label_16 goto __label_13 __label_14: # case -.annotate 'line', 4946 __ARG_1.'print'(' :flat :named') goto __label_12 # break __label_15: # case -.annotate 'line', 4949 __ARG_1.'print'(' :flat') goto __label_12 # break __label_16: # case -.annotate 'line', 4952 __ARG_1.'print'(' :named') -.annotate 'line', 4953 eq $S1, '', __label_17 -.annotate 'line', 4954 __ARG_1.'print'("(", $S1, ")") __label_17: # endif goto __label_12 # break __label_13: # default __label_12: # switch end -.annotate 'line', 4955 -# } -.annotate 'line', 4957 .end # emitmodifiers .sub Winxed_class_init :anon :load :init newclass $P0, [ 'Winxed'; 'Compiler'; 'ArgumentModifierList' ] -.annotate 'line', 4913 get_class $P1, [ 'Winxed'; 'Compiler'; 'ModifierList' ] addparent $P0, $P1 .end @@ -14704,104 +11736,75 @@ .sub 'Argument' :method .param pmc __ARG_1 .param pmc __ARG_2 -# Body -# { -.annotate 'line', 4966 setattribute self, 'arg', __ARG_1 -.annotate 'line', 4967 setattribute self, 'modifiers', __ARG_2 -# } -.annotate 'line', 4968 .end # Argument +.sub 'clone' :method + .param pmc __ARG_1 + new $P1, [ 'Winxed'; 'Compiler'; 'Argument' ] + getattribute $P4, self, 'arg' + $P3 = $P4.'clone'(__ARG_1) + setattribute $P1, 'arg', $P3 + .return($P1) + +.end # clone + + .sub 'optimize' :method -# Body -# { -.annotate 'line', 4971 getattribute $P3, self, 'arg' $P2 = $P3.'optimize'() setattribute self, 'arg', $P2 -.annotate 'line', 4972 .return(self) -# } -.annotate 'line', 4973 .end # optimize .sub 'hascompilevalue' :method -# Body -# { -.annotate 'line', 4976 getattribute $P1, self, 'arg' .tailcall $P1.'hascompilevalue'() -# } -.annotate 'line', 4977 .end # hascompilevalue .sub Winxed_class_init :anon :load :init newclass $P0, [ 'Winxed'; 'Compiler'; 'Argument' ] -.annotate 'line', 4962 addattribute $P0, 'arg' -.annotate 'line', 4963 addattribute $P0, 'modifiers' .end .namespace [ 'Winxed'; 'Compiler' ] -.sub 'parseArgument' :subid('WSubId_65') +.sub 'parseArgument' :subid('WSubId_96') .param pmc __ARG_1 .param pmc __ARG_2 -.const 'Sub' WSubId_36 = "WSubId_36" -.const 'Sub' WSubId_39 = "WSubId_39" -# Body -# { -.annotate 'line', 4982 -# var modifier: $P1 +.const 'Sub' WSubId_68 = "WSubId_68" +.const 'Sub' WSubId_70 = "WSubId_70" null $P1 -.annotate 'line', 4983 -# var expr: $P2 - $P2 = WSubId_36(__ARG_1, __ARG_2) -.annotate 'line', 4984 -# var t: $P3 + $P2 = WSubId_68(__ARG_1, __ARG_2) $P3 = __ARG_1.'get'() -.annotate 'line', 4985 $P4 = $P3.'isop'(':') if_null $P4, __label_1 unless $P4 goto __label_1 -# { -.annotate 'line', 4986 $P3 = __ARG_1.'get'() -.annotate 'line', 4987 $P4 = $P3.'isop'('[') if_null $P4, __label_3 unless $P4 goto __label_3 -# { -.annotate 'line', 4988 new $P5, [ 'Winxed'; 'Compiler'; 'ArgumentModifierList' ] $P5.'ArgumentModifierList'(__ARG_1, __ARG_2) set $P1, $P5 -# } goto __label_4 __label_3: # else -.annotate 'line', 4991 - WSubId_39('modifier list', $P3) + WSubId_70('modifier list', $P3) __label_4: # endif -# } goto __label_2 __label_1: # else -.annotate 'line', 4994 __ARG_1.'unget'($P3) __label_2: # endif -.annotate 'line', 4995 new $P5, [ 'Winxed'; 'Compiler'; 'Argument' ] $P5.'Argument'($P2, $P1) set $P4, $P5 .return($P4) -# } -.annotate 'line', 4996 .end # parseArgument @@ -14812,705 +11815,560 @@ .param pmc __ARG_2 .param pmc __ARG_3 .param string __ARG_4 -.const 'Sub' WSubId_35 = "WSubId_35" -.const 'Sub' WSubId_65 = "WSubId_65" -# Body -# { -.annotate 'line', 5007 +.const 'Sub' WSubId_67 = "WSubId_67" +.const 'Sub' WSubId_96 = "WSubId_96" setattribute self, 'owner', __ARG_1 -.annotate 'line', 5008 setattribute self, 'start', __ARG_2 -.annotate 'line', 5009 -# var t: $P1 $P1 = __ARG_3.'get'() -.annotate 'line', 5010 $P2 = $P1.'isop'(__ARG_4) isfalse $I1, $P2 unless $I1 goto __label_1 -# { -.annotate 'line', 5011 __ARG_3.'unget'($P1) -.annotate 'line', 5012 - $P3 = WSubId_35(__ARG_3, __ARG_1, WSubId_65, __ARG_4) + $P3 = WSubId_67(__ARG_3, __ARG_1, WSubId_96, __ARG_4) setattribute self, 'args', $P3 -# } __label_1: # endif -# } -.annotate 'line', 5014 .end # ArgumentList +.sub 'clone' :method + .param pmc __ARG_1 + new $P1, [ 'Winxed'; 'Compiler'; 'ArgumentList' ] + setattribute $P1, 'owner', __ARG_1 + getattribute $P10, self, 'start' + setattribute $P1, 'start', $P10 + getattribute $P2, self, 'args' + if_null $P2, __label_1 + set $P3, $P2 + set $P4, __ARG_1 +.const 'Sub' WSubId_3 = "WSubId_3" +.const 'Sub' WSubId_5 = "WSubId_5" + set $P5, $P3 + root_new $P6, ['parrot';'ResizablePMCArray'] + $P10 = WSubId_5("clone") + $P7 = WSubId_3($P10, $P4) + if_null $P5, __label_5 + iter $P12, $P5 + set $P12, 0 + __label_4: # for iteration + unless $P12 goto __label_5 + shift $P8, $P12 + $P13 = $P7($P8) + push $P6, $P13 + goto __label_4 + __label_5: # endfor + set $P11, $P6 + goto __label_3 + __label_3: + goto __label_2 + __label_2: + set $P9, $P11 + setattribute $P1, 'args', $P9 + __label_1: # endif + .return($P1) + +.end # clone + + .sub 'numargs' :method -# Body -# { -.annotate 'line', 5017 -# var args: $P1 getattribute $P1, self, 'args' -.annotate 'line', 5018 unless_null $P1, __label_2 null $I1 goto __label_1 __label_2: -# predefined elements elements $I1, $P1 __label_1: .return($I1) -# } -.annotate 'line', 5019 .end # numargs .sub 'getrawargs' :method -# Body -# { -.annotate 'line', 5022 getattribute $P1, self, 'args' .return($P1) -# } -.annotate 'line', 5023 .end # getrawargs .sub 'getarg' :method .param int __ARG_1 -# Body -# { -.annotate 'line', 5026 -# var args: $P1 getattribute $P1, self, 'args' -.annotate 'line', 5027 $P2 = $P1[__ARG_1] .return($P2) -# } -.annotate 'line', 5028 .end # getarg .sub 'getfreearg' :method .param int __ARG_1 -# Body -# { -.annotate 'line', 5031 -# var args: $P1 getattribute $P1, self, 'args' -.annotate 'line', 5032 $P3 = $P1[__ARG_1] getattribute $P2, $P3, 'arg' .return($P2) -# } -.annotate 'line', 5033 .end # getfreearg .sub 'optimize' :method -.const 'Sub' WSubId_37 = "WSubId_37" -# Body -# { -.annotate 'line', 5036 getattribute $P1, self, 'args' - WSubId_37($P1) -.annotate 'line', 5037 + if_null $P1, __label_3 + elements $I1, $P1 + goto __label_2 + __label_3: + null $I1 + __label_2: + null $I2 + __label_6: # for condition + ge $I2, $I1, __label_5 + $P3 = $P1[$I2] + $P2 = $P3.'optimize'() + $P1[$I2] = $P2 + __label_4: # for iteration + inc $I2 + goto __label_6 + __label_5: # for end + __label_1: .return(self) -# } -.annotate 'line', 5038 .end # optimize .sub 'getargvalues' :method .param pmc __ARG_1 -# Body -# { -.annotate 'line', 5041 -# var argregs: $P1 getattribute $P1, self, 'argregs' -.annotate 'line', 5042 unless_null $P1, __label_1 -# { -.annotate 'line', 5043 new $P2, ['ResizableStringArray'] -.annotate 'line', 5044 -# pnull: $S1 - set $S1, '' -.annotate 'line', 5045 + new $P5, [ 'Winxed'; 'Compiler'; 'CollectValues' ] + getattribute $P6, self, 'owner' + $P5.'CollectValues'($P6, __ARG_1) + set $P3, $P5 getattribute $P5, self, 'args' if_null $P5, __label_3 - iter $P6, $P5 - set $P6, 0 + iter $P7, $P5 + set $P7, 0 __label_2: # for iteration - unless $P6 goto __label_3 - shift $P3, $P6 -# { -.annotate 'line', 5046 -# var arg: $P4 - getattribute $P4, $P3, 'arg' -.annotate 'line', 5047 -# reg: $S2 - null $S2 -.annotate 'line', 5048 - $P5 = $P4.'isnull'() - if_null $P5, __label_4 - unless $P5 goto __label_4 -# { -.annotate 'line', 5049 - ne $S1, '', __label_6 -# { -.annotate 'line', 5050 - getattribute $P8, self, 'owner' - $P7 = $P8.'tempreg'('P') - set $S1, $P7 -.annotate 'line', 5051 - __ARG_1.'emitnull'($S1) -# } - __label_6: # endif -.annotate 'line', 5053 - set $S2, $S1 -# } - goto __label_5 - __label_4: # else -.annotate 'line', 5056 - $P5 = $P4.'emit_get'(__ARG_1) - set $S2, $P5 - __label_5: # endif -.annotate 'line', 5057 -# predefined push - push $P2, $S2 -# } + unless $P7 goto __label_3 + shift $P4, $P7 + getattribute $P8, $P4, 'arg' + $P6 = $P3.'add'($P8) + null $S1 + if_null $P6, __label_4 + set $S1, $P6 + __label_4: + push $P2, $S1 goto __label_2 __label_3: # endfor -.annotate 'line', 5059 setattribute self, 'argregs', $P2 -# } __label_1: # endif -.annotate 'line', 5061 .return($P1) -# } -.annotate 'line', 5062 .end # getargvalues .sub 'emitargs' :method .param pmc __ARG_1 -# Body -# { -.annotate 'line', 5065 -# var args: $P1 getattribute $P1, self, 'args' -.annotate 'line', 5066 -# var argreg: $P2 $P2 = self.'getargvalues'(__ARG_1) -.annotate 'line', 5068 -# sep: $S1 set $S1, '' -.annotate 'line', 5069 -# n: $I1 $P4 = self.'numargs'() set $I1, $P4 -# for loop -.annotate 'line', 5070 -# i: $I2 null $I2 __label_3: # for condition ge $I2, $I1, __label_2 -# { -.annotate 'line', 5071 $P4 = $P2[$I2] __ARG_1.'print'($S1, $P4) -.annotate 'line', 5072 -# var modifiers: $P3 $P4 = $P1[$I2] getattribute $P3, $P4, 'modifiers' -.annotate 'line', 5073 if_null $P3, __label_4 -.annotate 'line', 5074 $P3.'emitmodifiers'(__ARG_1) __label_4: # endif -.annotate 'line', 5075 set $S1, ', ' -# } __label_1: # for iteration -.annotate 'line', 5070 inc $I2 goto __label_3 __label_2: # for end -# } -.annotate 'line', 5077 .end # emitargs .sub Winxed_class_init :anon :load :init newclass $P0, [ 'Winxed'; 'Compiler'; 'ArgumentList' ] -.annotate 'line', 5000 addattribute $P0, 'owner' -.annotate 'line', 5001 addattribute $P0, 'start' -.annotate 'line', 5002 addattribute $P0, 'args' -.annotate 'line', 5003 addattribute $P0, 'argregs' .end .namespace [ 'Winxed'; 'Compiler' ] -.sub 'arglist_hascompilevalue' :subid('WSubId_66') +.sub 'arglist_hascompilevalue' :subid('WSubId_97') .param pmc __ARG_1 -# Body -# { -.annotate 'line', 5082 if_null __ARG_1, __label_2 iter $P2, __ARG_1 set $P2, 0 __label_1: # for iteration unless $P2 goto __label_2 shift $P1, $P2 -.annotate 'line', 5083 $P3 = $P1.'hascompilevalue'() isfalse $I1, $P3 unless $I1 goto __label_3 -.annotate 'line', 5084 .return(0) __label_3: # endif goto __label_1 __label_2: # endfor -.annotate 'line', 5085 .return(1) -# } -.annotate 'line', 5086 .end # arglist_hascompilevalue -.namespace [ 'Winxed'; 'Compiler'; 'CallPredefExpr' ] +.namespace [ 'Winxed'; 'Compiler'; 'CallBuiltinExpr' ] -.sub 'CallPredefExpr' :method +.sub 'CallBuiltinExpr' :method .param pmc __ARG_1 .param pmc __ARG_2 .param pmc __ARG_3 .param pmc __ARG_4 -# Body -# { -.annotate 'line', 5097 self.'Expr'(__ARG_1, __ARG_2) -.annotate 'line', 5098 - setattribute self, 'predef', __ARG_3 -.annotate 'line', 5099 + setattribute self, 'builtin', __ARG_3 setattribute self, 'args', __ARG_4 -# } -.annotate 'line', 5100 -.end # CallPredefExpr +.end # CallBuiltinExpr .sub 'checkresult' :method -# Body -# { -.annotate 'line', 5103 - getattribute $P1, self, 'predef' - .tailcall $P1.'result'() -# } -.annotate 'line', 5104 + getattribute $P2, self, 'builtin' + $P1 = $P2.'result'() + null $S1 + if_null $P1, __label_1 + set $S1, $P1 + __label_1: + ne $S1, ':', __label_2 + getattribute $P4, self, 'args' + $P3 = $P4[0] + getattribute $P2, $P3, 'arg' + $P1 = $P2.'checkresult'() + set $S1, $P1 + __label_2: # endif + .return($S1) .end # checkresult +.sub 'emit_void' :method + .param pmc __ARG_1 + self.'emit'(__ARG_1, "") + +.end # emit_void + + +.sub 'emit_get' :method + .param pmc __ARG_1 +.const 'Sub' WSubId_25 = "WSubId_25" +.const 'Sub' WSubId_30 = "WSubId_30" + $P1 = self.'checkresult'() + null $S1 + if_null $P1, __label_1 + set $S1, $P1 + __label_1: + if_null $S1, __label_2 + length $I1, $S1 + ne $I1, 1, __label_2 + ord $I1, $S1 + if $I1 == 73 goto __label_4 + if $I1 == 78 goto __label_5 + if $I1 == 83 goto __label_6 + if $I1 == 80 goto __label_7 + if $I1 == 118 goto __label_8 + goto __label_2 + __label_4: # case + __label_5: # case + __label_6: # case + __label_7: # case + goto __label_3 # break + __label_8: # case + WSubId_25("Can't use result of a void builtin", self) + __label_2: # default + concat $S3, "Unexpected result type '", $S1 + concat $S3, $S3, "'" + WSubId_30($S3, self) + __label_3: # switch end + $P1 = self.'tempreg'($S1) + null $S2 + if_null $P1, __label_9 + set $S2, $P1 + __label_9: + self.'emit'(__ARG_1, $S2) + .return($S2) + +.end # emit_get + + .sub 'emit' :method .param pmc __ARG_1 - .param pmc __ARG_2 -# Body -# { -.annotate 'line', 5107 -# var predef: $P1 - getattribute $P1, self, 'predef' -.annotate 'line', 5108 -# var args: $P2 + .param string __ARG_2 + getattribute $P1, self, 'builtin' getattribute $P2, self, 'args' -.annotate 'line', 5109 new $P3, ['ResizableStringArray'] -.annotate 'line', 5110 -# var arg: $P4 null $P4 -.annotate 'line', 5111 -# pnull: $S1 - set $S1, '' -# switch -.annotate 'line', 5112 - $P6 = $P1.'params'() - set $I3, $P6 - set $I4, -1 - if $I3 == $I4 goto __label_3 - set $I4, -2 - if $I3 == $I4 goto __label_4 - goto __label_2 + $P8 = $P1.'params'() + set $I3, $P8 + if $I3 == -1 goto __label_3 + if $I3 == -2 goto __label_4 + goto __label_1 __label_3: # case -.annotate 'line', 5114 + new $P9, [ 'Winxed'; 'Compiler'; 'CollectValues' ] + getattribute $P10, self, 'owner' + $P9.'CollectValues'($P10, __ARG_1) + set $P5, $P9 if_null $P2, __label_6 - iter $P7, $P2 - set $P7, 0 + iter $P11, $P2 + set $P11, 0 __label_5: # for iteration - unless $P7 goto __label_6 - shift $P4, $P7 -# { -.annotate 'line', 5115 -# reg: $S2 - getattribute $P9, $P4, 'arg' - $P8 = $P9.'emit_get'(__ARG_1) - null $S2 - if_null $P8, __label_7 - set $S2, $P8 - __label_7: -.annotate 'line', 5117 - ne $S2, 'null', __label_8 -# { -.annotate 'line', 5118 - ne $S1, '', __label_9 -# { -.annotate 'line', 5119 - $P6 = self.'tempreg'('P') - set $S1, $P6 -.annotate 'line', 5120 - __ARG_1.'emitnull'($S1) -# } - __label_9: # endif -.annotate 'line', 5122 - set $S2, $S1 -# } - __label_8: # endif -.annotate 'line', 5124 -# predefined push - push $P3, $S2 -# } + unless $P11 goto __label_6 + shift $P4, $P11 + getattribute $P13, $P4, 'arg' + $P12 = $P5.'add'($P13) + push $P3, $P12 goto __label_5 __label_6: # endfor - goto __label_1 # break + goto __label_2 # break __label_4: # case -.annotate 'line', 5128 -# var rawargs: $P5 - root_new $P5, ['parrot';'ResizablePMCArray'] -.annotate 'line', 5129 - if_null $P2, __label_11 - iter $P10, $P2 - set $P10, 0 - __label_10: # for iteration - unless $P10 goto __label_11 - shift $P4, $P10 -.annotate 'line', 5130 - getattribute $P8, $P4, 'arg' -# predefined push - push $P5, $P8 - goto __label_10 - __label_11: # endfor -.annotate 'line', 5131 - getattribute $P9, self, 'predef' - getattribute $P11, self, 'start' - $P9.'expand'(__ARG_1, self, $P11, __ARG_2, $P5) -.annotate 'line', 5132 + root_new $P6, ['parrot';'ResizablePMCArray'] + if_null $P2, __label_8 + iter $P14, $P2 + set $P14, 0 + __label_7: # for iteration + unless $P14 goto __label_8 + shift $P4, $P14 + getattribute $P15, $P4, 'arg' + push $P6, $P15 + goto __label_7 + __label_8: # endfor + getattribute $P16, self, 'builtin' + getattribute $P17, self, 'start' + $P16.'expand'(__ARG_1, self, $P17, __ARG_2, $P6) .return() - __label_2: # default -.annotate 'line', 5134 -# n: $I1 - getattribute $P12, self, 'args' - set $I1, $P12 -# for loop -.annotate 'line', 5135 -# i: $I2 + __label_1: # default + getattribute $P18, self, 'args' + set $I1, $P18 + new $P19, [ 'Winxed'; 'Compiler'; 'CollectValues' ] + getattribute $P20, self, 'owner' + $P19.'CollectValues'($P20, __ARG_1) + set $P7, $P19 null $I2 - __label_14: # for condition - ge $I2, $I1, __label_13 -# { -.annotate 'line', 5136 - $P13 = $P2[$I2] - getattribute $P4, $P13, 'arg' -.annotate 'line', 5137 -# argtype: $S3 - $P6 = $P4.'checkresult'() + __label_11: # for condition + ge $I2, $I1, __label_10 + $P21 = $P2[$I2] + getattribute $P4, $P21, 'arg' + $P8 = $P4.'checkresult'() + null $S1 + if_null $P8, __label_12 + set $S1, $P8 + __label_12: + $P8 = $P1.'paramtype'($I2) + null $S2 + if_null $P8, __label_13 + set $S2, $P8 + __label_13: null $S3 - if_null $P6, __label_15 - set $S3, $P6 - __label_15: -.annotate 'line', 5138 -# paramtype: $S4 - $P6 = $P1.'paramtype'($I2) - null $S4 - if_null $P6, __label_16 - set $S4, $P6 - __label_16: -.annotate 'line', 5139 -# argr: $S5 - null $S5 -.annotate 'line', 5140 - $P6 = $P4.'isnull'() - if_null $P6, __label_17 - unless $P6 goto __label_17 -# { -# switch -.annotate 'line', 5141 - set $S7, $S4 - set $S8, 'I' - if $S7 == $S8 goto __label_21 - set $S8, 'N' - if $S7 == $S8 goto __label_22 - set $S8, 'S' - if $S7 == $S8 goto __label_23 - goto __label_20 - __label_21: # case - __label_22: # case - __label_23: # case -.annotate 'line', 5145 - $P8 = self.'tempreg'($S4) - set $S5, $P8 -.annotate 'line', 5146 - __ARG_1.'emitnull'($S5) - goto __label_19 # break - __label_20: # default -.annotate 'line', 5149 - ne $S1, '', __label_24 -# { -.annotate 'line', 5150 - $P9 = self.'tempreg'('P') - set $S1, $P9 -.annotate 'line', 5151 - __ARG_1.'emitnull'($S1) -# } - __label_24: # endif -.annotate 'line', 5153 - set $S5, $S1 - __label_19: # switch end -# } - goto __label_18 - __label_17: # else -# { -.annotate 'line', 5157 - iseq $I3, $S3, $S4 - if $I3 goto __label_28 - iseq $I3, $S4, '?' - __label_28: - if $I3 goto __label_27 -.annotate 'line', 5158 - iseq $I3, $S4, 'p' - unless $I3 goto __label_29 -.annotate 'line', 5159 - iseq $I3, $S3, 'S' - if $I3 goto __label_30 - iseq $I3, $S3, 'P' - __label_30: - __label_29: - __label_27: + $P8 = $P4.'isnull'() + if_null $P8, __label_14 + unless $P8 goto __label_14 + if_null $S2, __label_16 + length $I3, $S2 + ne $I3, 1, __label_16 + ord $I3, $S2 + if $I3 == 73 goto __label_18 + if $I3 == 78 goto __label_19 + if $I3 == 83 goto __label_20 + goto __label_16 + __label_18: # case + __label_19: # case + __label_20: # case + $P9 = self.'tempreg'($S2) + set $S3, $P9 + __ARG_1.'emitnull'($S3) + goto __label_17 # break + __label_16: # default + $P10 = $P7.'add'($P4) + set $S3, $P10 + __label_17: # switch end + goto __label_15 + __label_14: # else + iseq $I3, $S1, $S2 + if $I3 goto __label_24 + iseq $I3, $S2, '?' + __label_24: + if $I3 goto __label_23 + iseq $I3, $S2, 'p' unless $I3 goto __label_25 -.annotate 'line', 5160 - $P6 = $P4.'emit_get'(__ARG_1) - set $S5, $P6 - goto __label_26 - __label_25: # else -# { -.annotate 'line', 5162 -# aux: $S6 - null $S6 -.annotate 'line', 5163 - ne $S4, 'p', __label_31 -.annotate 'line', 5164 - set $S4, 'P' - __label_31: # endif -.annotate 'line', 5165 - $P6 = self.'tempreg'($S4) - set $S5, $P6 -# switch -.annotate 'line', 5166 - set $S7, $S4 - set $S8, 'P' - if $S7 == $S8 goto __label_34 - set $S8, 'I' - if $S7 == $S8 goto __label_35 - set $S8, 'N' - if $S7 == $S8 goto __label_36 - set $S8, 'S' - if $S7 == $S8 goto __label_37 - goto __label_33 - __label_34: # case -# switch -.annotate 'line', 5168 - set $S9, $S3 - set $S10, 'I' - if $S9 == $S10 goto __label_40 - set $S10, 'N' - if $S9 == $S10 goto __label_41 - set $S10, 'S' - if $S9 == $S10 goto __label_42 - goto __label_39 - __label_40: # case - __label_41: # case - __label_42: # case -.annotate 'line', 5172 - $P6 = $P4.'emit_get'(__ARG_1) - set $S6, $P6 -.annotate 'line', 5173 - __ARG_1.'emitbox'($S5, $S6) - goto __label_38 # break - __label_39: # default -.annotate 'line', 5176 - $P4.'emit'(__ARG_1, $S5) - __label_38: # switch end - goto __label_32 # break - __label_35: # case - __label_36: # case - __label_37: # case -.annotate 'line', 5182 + iseq $I3, $S1, 'S' + if $I3 goto __label_26 + iseq $I3, $S1, 'P' + __label_26: + __label_25: + __label_23: + unless $I3 goto __label_21 $P8 = $P4.'emit_get'(__ARG_1) - set $S6, $P8 -.annotate 'line', 5183 - __ARG_1.'emitset'($S5, $S6) - goto __label_32 # break - __label_33: # default -.annotate 'line', 5186 - $P4.'emit'(__ARG_1, $S5) - __label_32: # switch end -# } - __label_26: # endif -# } - __label_18: # endif -.annotate 'line', 5190 -# predefined push - push $P3, $S5 -# } - __label_12: # for iteration -.annotate 'line', 5135 + set $S3, $P8 + goto __label_22 + __label_21: # else + ne $S2, 'p', __label_27 + set $S2, 'P' + __label_27: # endif + $P8 = $P4.'emit_get'(__ARG_1) + null $S4 + if_null $P8, __label_28 + set $S4, $P8 + __label_28: + if_null $S2, __label_29 + length $I3, $S2 + ne $I3, 1, __label_29 + ord $I3, $S2 + if $I3 == 80 goto __label_31 + if $I3 == 73 goto __label_32 + if $I3 == 78 goto __label_33 + if $I3 == 83 goto __label_34 + goto __label_29 + __label_31: # case + if_null $S1, __label_35 + length $I4, $S1 + ne $I4, 1, __label_35 + ord $I4, $S1 + if $I4 == 73 goto __label_37 + if $I4 == 78 goto __label_38 + if $I4 == 83 goto __label_39 + goto __label_35 + __label_37: # case + __label_38: # case + __label_39: # case + $P8 = self.'tempreg'($S2) + set $S3, $P8 + __ARG_1.'emitbox'($S3, $S4) + goto __label_36 # break + __label_35: # default + set $S3, $S4 + __label_36: # switch end + goto __label_30 # break + __label_32: # case + __label_33: # case + __label_34: # case + $P9 = self.'tempreg'($S2) + set $S3, $P9 + __ARG_1.'emitset'($S3, $S4) + goto __label_30 # break + __label_29: # default + set $S3, $S4 + __label_30: # switch end + __label_22: # endif + __label_15: # endif + push $P3, $S3 + __label_9: # for iteration inc $I2 - goto __label_14 - __label_13: # for end - __label_1: # switch end -.annotate 'line', 5193 - getattribute $P6, self, 'predef' - getattribute $P8, self, 'start' - $P6.'expand'(__ARG_1, self, $P8, __ARG_2, $P3) -# } -.annotate 'line', 5194 + goto __label_11 + __label_10: # for end + __label_2: # switch end + getattribute $P8, self, 'builtin' + getattribute $P9, self, 'start' + $P8.'expand'(__ARG_1, self, $P9, __ARG_2, $P3) .end # emit .sub Winxed_class_init :anon :load :init - newclass $P0, [ 'Winxed'; 'Compiler'; 'CallPredefExpr' ] -.annotate 'line', 5090 - get_class $P1, [ 'Winxed'; 'Compiler'; 'Expr' ] + newclass $P0, [ 'Winxed'; 'Compiler'; 'CallBuiltinExpr' ] + get_class $P1, [ 'Winxed'; 'Compiler'; 'FinalExpr' ] addparent $P0, $P1 -.annotate 'line', 5092 - addattribute $P0, 'predef' -.annotate 'line', 5093 + addattribute $P0, 'builtin' addattribute $P0, 'args' .end .namespace [ 'Winxed'; 'Compiler' ] -.sub 'gencallbuiltin' :subid('WSubId_67') +.sub 'gencallbuiltin' :subid('WSubId_98') .param pmc __ARG_1 .param pmc __ARG_2 .param pmc __ARG_3 .param pmc __ARG_4 -.const 'Sub' WSubId_1 = "WSubId_1" -.const 'Sub' WSubId_66 = "WSubId_66" -# Body -# { -.annotate 'line', 5201 -# callname: $S1 - $P6 = __ARG_3.'getname'() +.const 'Sub' WSubId_25 = "WSubId_25" +.const 'Sub' WSubId_97 = "WSubId_97" + $P7 = __ARG_3.'getname'() null $S1 - if_null $P6, __label_1 - set $S1, $P6 + if_null $P7, __label_1 + set $S1, $P7 __label_1: -.annotate 'line', 5202 - __ARG_1.'use_predef'($S1) -.annotate 'line', 5203 -# nargs: $I1 + __ARG_1.'use_builtin'($S1) unless_null __ARG_4, __label_3 null $I1 goto __label_2 __label_3: - $I1 = __ARG_4.'numargs'() + $P7 = __ARG_4.'numargs'() + set $I1, $P7 __label_2: -.annotate 'line', 5204 -# var rawargs: $P1 - ne $I1, 0, __label_5 - root_new $P6, ['parrot';'ResizablePMCArray'] - set $P1, $P6 + if $I1 goto __label_5 + root_new $P7, ['parrot';'ResizablePMCArray'] + set $P1, $P7 goto __label_4 __label_5: - $P1 = __ARG_4.'getrawargs'() + $P8 = __ARG_4.'getrawargs'() + set $P1, $P8 __label_4: -.annotate 'line', 5206 -# var variants: $P2 getattribute $P2, __ARG_3, 'variants' -.annotate 'line', 5207 -# nvariants: $I2 -# predefined elements - elements $I2, $P2 -.annotate 'line', 5208 -# var predef: $P3 null $P3 -.annotate 'line', 5209 if_null $P2, __label_7 - iter $P8, $P2 - set $P8, 0 + iter $P9, $P2 + set $P9, 0 __label_6: # for iteration - unless $P8 goto __label_7 - shift $P4, $P8 -# { -.annotate 'line', 5210 -# pargs: $I3 - getattribute $P6, $P4, 'nparams' - set $I3, $P6 -.annotate 'line', 5211 - iseq $I4, $I3, $I1 - if $I4 goto __label_10 -.annotate 'line', 5212 - iseq $I4, $I3, -1 + unless $P9 goto __label_7 + shift $P4, $P9 + getattribute $P7, $P4, 'nparams' + set $I2, $P7 + iseq $I3, $I2, $I1 + if $I3 goto __label_10 + iseq $I3, $I2, -1 __label_10: - if $I4 goto __label_9 -.annotate 'line', 5213 - iseq $I4, $I3, -2 - unless $I4 goto __label_11 - iseq $I4, $I1, 1 + if $I3 goto __label_9 + iseq $I3, $I2, -2 + unless $I3 goto __label_11 + iseq $I3, $I1, 1 __label_11: __label_9: - unless $I4 goto __label_8 -.annotate 'line', 5214 + unless $I3 goto __label_8 set $P3, $P4 __label_8: # endif -# } goto __label_6 __label_7: # endfor -.annotate 'line', 5216 unless_null $P3, __label_12 -.annotate 'line', 5217 - WSubId_1("Wrong arguments for builtin", __ARG_2) + WSubId_25("Wrong arguments for builtin", __ARG_2) __label_12: # endif -.annotate 'line', 5220 - isa $I4, $P3, [ 'Winxed'; 'Compiler'; 'PredefFunctionEval' ] - unless $I4 goto __label_13 -# { -.annotate 'line', 5221 - $P6 = WSubId_66($P1) - if_null $P6, __label_14 - unless $P6 goto __label_14 -# { -.annotate 'line', 5222 -# var evalfun: $P5 + $P7 = $P3.'iscompileevaluable'() + if_null $P7, __label_13 + unless $P7 goto __label_13 + $P8 = WSubId_97($P1) + if_null $P8, __label_14 + unless $P8 goto __label_14 getattribute $P5, $P3, 'evalfun' -.annotate 'line', 5223 - getattribute $P6, __ARG_1, 'owner' - getattribute $P7, __ARG_1, 'start' - .tailcall $P5($P6, $P7, $P1) -# } + new $P7, 'ExceptionHandler' + set_label $P7, __label_15 + push_eh $P7 + getattribute $P10, __ARG_1, 'owner' + getattribute $P11, __ARG_1, 'start' + $P8 = $P5($P10, $P11, $P1) + .return($P8) + pop_eh + goto __label_16 + __label_15: + .get_results($P6) + finalize $P6 + pop_eh + $S2 = $P6["message"] + concat $S3, "Compile time evaluation of builtin ", $S1 + concat $S3, $S3, " failed: '" + concat $S3, $S3, $S2 + concat $S3, $S3, "'" + WSubId_25($S3, __ARG_2) + __label_16: __label_14: # endif -# } __label_13: # endif -.annotate 'line', 5227 - new $P7, [ 'Winxed'; 'Compiler'; 'CallPredefExpr' ] - $P7.'CallPredefExpr'(__ARG_1, __ARG_2, $P3, $P1) - set $P6, $P7 - .return($P6) -# } -.annotate 'line', 5228 + new $P8, [ 'Winxed'; 'Compiler'; 'CallBuiltinExpr' ] + $P8.'CallBuiltinExpr'(__ARG_1, __ARG_2, $P3, $P1) + set $P7, $P8 + .return($P7) .end # gencallbuiltin @@ -15521,477 +12379,396 @@ .param pmc __ARG_2 .param pmc __ARG_3 .param pmc __ARG_4 -# Body -# { -.annotate 'line', 5237 self.'Expr'(__ARG_2, __ARG_3) -.annotate 'line', 5238 setattribute self, 'funref', __ARG_4 -.annotate 'line', 5239 -# var t: $P1 $P1 = __ARG_1.'get'() -.annotate 'line', 5240 $P2 = $P1.'isop'(')') isfalse $I1, $P2 unless $I1 goto __label_1 -# { -.annotate 'line', 5241 __ARG_1.'unget'($P1) -.annotate 'line', 5242 new $P4, [ 'Winxed'; 'Compiler'; 'ArgumentList' ] $P4.'ArgumentList'(__ARG_2, __ARG_3, __ARG_1, ')') set $P3, $P4 setattribute self, 'args', $P3 -# } __label_1: # endif -# } -.annotate 'line', 5244 .end # CallExpr +.sub 'clone' :method + .param pmc __ARG_1 + new $P1, [ 'Winxed'; 'Compiler'; 'CallExpr' ] + getattribute $P3, self, 'start' + $P1.'Expr'(__ARG_1, $P3) + getattribute $P5, self, 'funref' + $P4 = $P5.'clone'(__ARG_1) + setattribute $P1, 'funref', $P4 + getattribute $P2, self, 'args' + if_null $P2, __label_1 + $P4 = $P2.'clone'(__ARG_1) + setattribute $P1, 'args', $P4 + __label_1: # endif + .return($P1) + +.end # clone + + .sub 'checkresult' :method -# Body -# { -.annotate 'line', 5245 .return('P') -# } .end # checkresult .sub 'optimize' :method -.const 'Sub' WSubId_67 = "WSubId_67" -# Body -# { -.annotate 'line', 5248 -# var funref: $P1 - getattribute $P9, self, 'funref' - $P1 = $P9.'optimize'() -.annotate 'line', 5249 -# var args: $P2 +.const 'Sub' WSubId_98 = "WSubId_98" +.const 'Sub' WSubId_30 = "WSubId_30" + getattribute $P6, self, 'funref' + $P1 = $P6.'optimize'() getattribute $P2, self, 'args' -.annotate 'line', 5250 if_null $P2, __label_1 -.annotate 'line', 5251 $P2 = $P2.'optimize'() __label_1: # endif -.annotate 'line', 5253 isa $I1, $P1, [ 'Winxed'; 'Compiler'; 'MemberExpr' ] unless $I1 goto __label_2 -# { -.annotate 'line', 5257 -# var sym: $P3 - null $P3 -.annotate 'line', 5258 -# var subid: $P4 - null $P4 -.annotate 'line', 5259 -# var first: $P5 - getattribute $P5, $P1, 'left' - __label_4: # while -.annotate 'line', 5260 - isa $I1, $P5, [ 'Winxed'; 'Compiler'; 'MemberExpr' ] - unless $I1 goto __label_3 -.annotate 'line', 5261 - getattribute $P5, $P5, 'left' - goto __label_4 - __label_3: # endwhile -.annotate 'line', 5262 - isa $I1, $P5, [ 'Winxed'; 'Compiler'; 'IdentifierExpr' ] - unless $I1 goto __label_5 -# { -.annotate 'line', 5263 -# var idfirst: $P6 - $P6 = $P5.'checkIdentifier'() -.annotate 'line', 5264 - isnull $I1, $P6 - if $I1 goto __label_7 - set $S1, $P6 - iseq $I1, $S1, '' - __label_7: - unless $I1 goto __label_6 -# { -.annotate 'line', 5265 -# var key: $P7 - root_new $P7, ['parrot';'ResizablePMCArray'] -.annotate 'line', 5266 - $P1.'buildkey'($P7) -.annotate 'line', 5267 - $P3 = self.'findsymbol'($P7) -.annotate 'line', 5268 - if_null $P3, __label_8 -# { -.annotate 'line', 5269 + $P3 = $P1.'search_nonmember'() + isnull $I1, $P3 + if $I1 goto __label_5 isa $I1, $P3, [ 'Winxed'; 'Compiler'; 'FunctionStatement' ] - unless $I1 goto __label_9 -# { -.annotate 'line', 5270 + if $I1 goto __label_6 + isa $I1, $P3, [ 'Winxed'; 'Compiler'; 'FunctionExtern' ] + if $I1 goto __label_7 + isa $I1, $P3, [ 'Winxed'; 'Compiler'; 'Builtin' ] + if $I1 goto __label_8 + goto __label_4 + __label_5: # case + new $P7, [ 'Winxed'; 'Compiler'; 'CallMemberExpr' ] + $P7.'CallMemberExpr'(self, $P1, $P2) + set $P6, $P7 + .return($P6) + __label_6: # case + $P8 = $P3.'ismulti'() + isfalse $I2, $P8 + unless $I2 goto __label_9 $P4 = $P3.'makesubid'() -.annotate 'line', 5271 self.'usesubid'($P4) -# } - __label_9: # endif -.annotate 'line', 5273 - isa $I1, $P3, [ 'Winxed'; 'Compiler'; 'Builtin' ] - unless $I1 goto __label_10 -.annotate 'line', 5274 + new $P7, [ 'Winxed'; 'Compiler'; 'CallSubid' ] + $P7.'CallSubid'(self, $P1, $P2, $P4) + set $P6, $P7 + .return($P6) + goto __label_10 + __label_9: # else + new $P8, [ 'Winxed'; 'Compiler'; 'FunctionRef' ] getattribute $P9, self, 'owner' - getattribute $P10, $P1, 'start' - .tailcall WSubId_67($P9, $P10, $P3, $P2) + getattribute $P10, self, 'start' + $P8.'FunctionRef'($P9, $P10, $P3) + set $P7, $P8 + setattribute self, 'funref', $P7 + .return(self) __label_10: # endif -# } - __label_8: # endif -# } - __label_6: # endif -# } - __label_5: # endif -.annotate 'line', 5278 - new $P10, [ 'Winxed'; 'Compiler'; 'CallMemberExpr' ] - $P10.'CallMemberExpr'(self, $P1, $P2, $P3, $P4) - set $P9, $P10 - .return($P9) -# } + goto __label_3 # break + __label_7: # case + new $P8, [ 'Winxed'; 'Compiler'; 'FunctionRef' ] + getattribute $P9, self, 'owner' + getattribute $P10, self, 'start' + $P8.'FunctionRef'($P9, $P10, $P3) + set $P7, $P8 + setattribute self, 'funref', $P7 + .return(self) + __label_8: # case + getattribute $P11, self, 'owner' + getattribute $P12, $P1, 'start' + .tailcall WSubId_98($P11, $P12, $P3, $P2) + goto __label_3 # break + __label_4: # default + getattribute $P13, self, 'start' + WSubId_30("unexpected type found in scope", $P13) + __label_3: # switch end __label_2: # endif -.annotate 'line', 5280 isa $I1, $P1, [ 'Winxed'; 'Compiler'; 'MemberRefExpr' ] unless $I1 goto __label_11 -.annotate 'line', 5281 - new $P10, [ 'Winxed'; 'Compiler'; 'CallMemberRefExpr' ] - $P10.'CallMemberRefExpr'(self, $P1, $P2) - set $P9, $P10 - .return($P9) + new $P7, [ 'Winxed'; 'Compiler'; 'CallMemberRefExpr' ] + $P7.'CallMemberRefExpr'(self, $P1, $P2) + set $P6, $P7 + .return($P6) __label_11: # endif -.annotate 'line', 5284 - $P9 = $P1.'isidentifier'() - if_null $P9, __label_12 - unless $P9 goto __label_12 -# { -.annotate 'line', 5285 - $P10 = $P1.'checkIdentifier'() - set $S1, $P10 - ne $S1, '', __label_13 -# { -.annotate 'line', 5286 -# var sym: $P8 - root_new $P11, ['parrot';'ResizablePMCArray'] - $P13 = $P1.'getName'() - push $P11, $P13 - $P8 = self.'findsymbol'($P11) -.annotate 'line', 5287 - isnull $I1, $P8 + isa $I1, $P1, [ 'Winxed'; 'Compiler'; 'InlineRef' ] + unless $I1 goto __label_12 + new $P7, [ 'Winxed'; 'Compiler'; 'CallInlineExpr' ] + $P7.'CallInlineExpr'(self, $P1, $P2) + set $P6, $P7 + .return($P6) + __label_12: # endif + $P6 = $P1.'isidentifier'() + if_null $P6, __label_13 + unless $P6 goto __label_13 + $P7 = $P1.'checkIdentifier'() + set $S1, $P7 + ne $S1, '', __label_14 + root_new $P8, ['parrot';'ResizablePMCArray'] + assign $P8, 1 + $P9 = $P1.'getName'() + $P8[0] = $P9 + $P5 = self.'scopesearch'($P8, 0) + isnull $I1, $P5 not $I1 + unless $I1 goto __label_16 + isa $I1, $P5, [ 'Winxed'; 'Compiler'; 'Builtin' ] + __label_16: unless $I1 goto __label_15 - isa $I1, $P8, [ 'Winxed'; 'Compiler'; 'Builtin' ] - __label_15: - unless $I1 goto __label_14 -.annotate 'line', 5288 - getattribute $P9, self, 'owner' - getattribute $P10, $P1, 'start' - .tailcall WSubId_67($P9, $P10, $P8, $P2) + getattribute $P6, self, 'owner' + getattribute $P7, $P1, 'start' + .tailcall WSubId_98($P6, $P7, $P5, $P2) + __label_15: # endif __label_14: # endif -# } __label_13: # endif -# } - __label_12: # endif -.annotate 'line', 5292 setattribute self, 'funref', $P1 -.annotate 'line', 5293 setattribute self, 'args', $P2 -.annotate 'line', 5294 .return(self) -# } -.annotate 'line', 5295 .end # optimize .sub 'cantailcall' :method -# Body -# { -.annotate 'line', 5298 .return(1) -# } -.annotate 'line', 5299 .end # cantailcall .sub 'emitcall' :method .param pmc __ARG_1 -.const 'Sub' WSubId_6 = "WSubId_6" -# Body -# { -.annotate 'line', 5302 -# var funref: $P1 +.const 'Sub' WSubId_30 = "WSubId_30" getattribute $P1, self, 'funref' -.annotate 'line', 5303 -# call: $S1 null $S1 -.annotate 'line', 5305 - $I1 = $P1.'isidentifier'() - unless $I1 goto __label_3 - getattribute $P3, $P1, 'subid' - isnull $I1, $P3 - __label_3: - unless $I1 goto __label_1 -# { -.annotate 'line', 5306 + $P3 = $P1.'isidentifier'() + if_null $P3, __label_1 + unless $P3 goto __label_1 $P4 = $P1.'checkIdentifier'() set $S1, $P4 -.annotate 'line', 5307 - ne $S1, '', __label_4 -# { -.annotate 'line', 5308 -# var sym: $P2 + ne $S1, '', __label_3 root_new $P3, ['parrot';'ResizablePMCArray'] - $P5 = $P1.'getName'() - push $P3, $P5 - $P2 = self.'findsymbol'($P3) -# switch-case -.annotate 'line', 5310 + assign $P3, 1 + $P4 = $P1.'getName'() + $P3[0] = $P4 + $P2 = self.'scopesearch'($P3, 0) isnull $I1, $P2 - if $I1 goto __label_7 -.annotate 'line', 5313 + if $I1 goto __label_6 isa $I1, $P2, [ 'Winxed'; 'Compiler'; 'FunctionExtern' ] - if $I1 goto __label_8 -.annotate 'line', 5316 + if $I1 goto __label_7 isa $I1, $P2, [ 'Winxed'; 'Compiler'; 'Builtin' ] - if $I1 goto __label_9 - goto __label_6 - __label_7: # case -.annotate 'line', 5311 + if $I1 goto __label_8 + goto __label_5 + __label_6: # case root_new $P3, ['parrot';'ResizablePMCArray'] - box $P4, "'" - push $P3, $P4 - $P5 = $P1.'getName'() - push $P3, $P5 - box $P4, "'" - push $P3, $P4 -# predefined join + assign $P3, 3 + $P3[0] = "'" + $P4 = $P1.'getName'() + $P3[1] = $P4 + $P3[2] = "'" join $S1, "", $P3 - goto __label_5 # break + goto __label_4 # break + __label_7: # case + $P5 = $P2.'emit_get'(__ARG_1, self) + set $S1, $P5 + goto __label_4 # break __label_8: # case -.annotate 'line', 5314 - $P6 = $P2.'emit_get'(__ARG_1, self) - set $S1, $P6 - goto __label_5 # break - __label_9: # case -.annotate 'line', 5317 - WSubId_6("Builtin unexpeted here", self) - __label_6: # default -.annotate 'line', 5319 - root_new $P7, ['parrot';'ResizablePMCArray'] - box $P8, "'" - push $P7, $P8 - $P9 = $P1.'getName'() - push $P7, $P9 - box $P8, "'" - push $P7, $P8 -# predefined join - join $S1, "", $P7 - __label_5: # switch end -# } - __label_4: # endif -# } + WSubId_30("Builtin unexpected here", self) + __label_5: # default + root_new $P6, ['parrot';'ResizablePMCArray'] + assign $P6, 3 + $P6[0] = "'" + $P7 = $P1.'getName'() + $P6[1] = $P7 + $P6[2] = "'" + join $S1, "", $P6 + __label_4: # switch end + __label_3: # endif goto __label_2 __label_1: # else -.annotate 'line', 5324 $P3 = $P1.'emit_get'(__ARG_1) set $S1, $P3 __label_2: # endif -.annotate 'line', 5325 .return($S1) -# } -.annotate 'line', 5326 .end # emitcall .sub 'prepareargs' :method .param pmc __ARG_1 -# Body -# { -.annotate 'line', 5329 -# var args: $P1 getattribute $P1, self, 'args' -.annotate 'line', 5330 if_null $P1, __label_1 -.annotate 'line', 5331 $P1.'getargvalues'(__ARG_1) __label_1: # endif -# } -.annotate 'line', 5332 .end # prepareargs .sub 'emitargs' :method .param pmc __ARG_1 -# Body -# { -.annotate 'line', 5335 __ARG_1.'print'('(') -.annotate 'line', 5336 -# var args: $P1 getattribute $P1, self, 'args' -.annotate 'line', 5337 if_null $P1, __label_1 -.annotate 'line', 5338 $P1.'emitargs'(__ARG_1) __label_1: # endif -.annotate 'line', 5339 __ARG_1.'say'(')') -# } -.annotate 'line', 5340 .end # emitargs .sub 'emit' :method .param pmc __ARG_1 - .param pmc __ARG_2 -# Body -# { -.annotate 'line', 5343 -# call: $S1 + .param string __ARG_2 $P1 = self.'emitcall'(__ARG_1) null $S1 if_null $P1, __label_1 set $S1, $P1 __label_1: -.annotate 'line', 5344 self.'prepareargs'(__ARG_1) -.annotate 'line', 5346 self.'annotate'(__ARG_1) -.annotate 'line', 5348 __ARG_1.'print'(' ') -.annotate 'line', 5349 - isnull $I1, __ARG_2 - not $I1 - unless $I1 goto __label_3 - set $S2, __ARG_2 - isne $I1, $S2, '' - __label_3: - unless $I1 goto __label_2 -# { -.annotate 'line', 5350 - set $S3, __ARG_2 - ne $S3, '.tailcall', __label_4 -.annotate 'line', 5351 + ne __ARG_2, '.tailcall', __label_2 __ARG_1.'print'('.tailcall ') - goto __label_5 - __label_4: # else -.annotate 'line', 5353 + goto __label_3 + __label_2: # else __ARG_1.'print'(__ARG_2, ' = ') - __label_5: # endif -# } - __label_2: # endif -.annotate 'line', 5356 + __label_3: # endif __ARG_1.'print'($S1) -.annotate 'line', 5357 self.'emitargs'(__ARG_1) -# } -.annotate 'line', 5358 .end # emit -.sub Winxed_class_init :anon :load :init - newclass $P0, [ 'Winxed'; 'Compiler'; 'CallExpr' ] -.annotate 'line', 5230 - get_class $P1, [ 'Winxed'; 'Compiler'; 'Expr' ] - addparent $P0, $P1 -.annotate 'line', 5232 - addattribute $P0, 'funref' -.annotate 'line', 5233 - addattribute $P0, 'args' -.end -.namespace [ 'Winxed'; 'Compiler'; 'CallMemberExpr' ] -.sub 'CallMemberExpr' :method +.sub 'emit_void' :method .param pmc __ARG_1 - .param pmc __ARG_2 + $P1 = self.'emitcall'(__ARG_1) + null $S1 + if_null $P1, __label_1 + set $S1, $P1 + __label_1: + self.'prepareargs'(__ARG_1) + self.'annotate'(__ARG_1) + __ARG_1.'print'(' ') + __ARG_1.'print'($S1) + self.'emitargs'(__ARG_1) + +.end # emit_void + +.sub Winxed_class_init :anon :load :init + newclass $P0, [ 'Winxed'; 'Compiler'; 'CallExpr' ] + get_class $P1, [ 'Winxed'; 'Compiler'; 'Expr' ] + addparent $P0, $P1 + addattribute $P0, 'funref' + addattribute $P0, 'args' +.end +.namespace [ 'Winxed'; 'Compiler'; 'CallSubid' ] + +.sub 'CallSubid' :method + .param pmc __ARG_1 + .param pmc __ARG_2 .param pmc __ARG_3 .param pmc __ARG_4 - .param pmc __ARG_5 -# Body -# { -.annotate 'line', 5372 getattribute $P1, __ARG_1, 'owner' getattribute $P2, __ARG_1, 'start' self.'Expr'($P1, $P2) -.annotate 'line', 5373 setattribute self, 'funref', __ARG_2 -.annotate 'line', 5374 setattribute self, 'args', __ARG_3 -.annotate 'line', 5375 - setattribute self, 'sym', __ARG_4 -.annotate 'line', 5376 - setattribute self, 'subid', __ARG_5 -# } -.annotate 'line', 5377 + setattribute self, 'subid', __ARG_4 + +.end # CallSubid + + +.sub 'emitcall' :method + .param pmc __ARG_1 + getattribute $P1, self, 'subid' + .return($P1) + +.end # emitcall + +.sub Winxed_class_init :anon :load :init + newclass $P0, [ 'Winxed'; 'Compiler'; 'CallSubid' ] + get_class $P1, [ 'Winxed'; 'Compiler'; 'CallExpr' ] + addparent $P0, $P1 + addattribute $P0, 'subid' +.end +.namespace [ 'Winxed'; 'Compiler'; 'CallMemberExpr' ] + +.sub 'CallMemberExpr' :method + .param pmc __ARG_1 + .param pmc __ARG_2 + .param pmc __ARG_3 + getattribute $P1, __ARG_1, 'owner' + getattribute $P2, __ARG_1, 'start' + self.'Expr'($P1, $P2) + setattribute self, 'funref', __ARG_2 + setattribute self, 'args', __ARG_3 .end # CallMemberExpr .sub 'emitcall' :method .param pmc __ARG_1 -# Body -# { -.annotate 'line', 5380 - getattribute $P3, self, 'sym' - if_null $P3, __label_1 -# { -.annotate 'line', 5381 - getattribute $P4, self, 'subid' - if_null $P4, __label_2 -.annotate 'line', 5382 - getattribute $P5, self, 'subid' - .return($P5) - __label_2: # endif -.annotate 'line', 5383 -# var sym: $P1 - getattribute $P1, self, 'sym' -.annotate 'line', 5384 - isa $I1, $P1, [ 'Winxed'; 'Compiler'; 'FunctionExtern' ] - unless $I1 goto __label_3 -.annotate 'line', 5385 - .tailcall $P1.'emit_get'(__ARG_1, self) + getattribute $P1, self, 'funref' + getattribute $P2, $P1, 'left' + __label_2: # while + isa $I1, $P2, [ 'Winxed'; 'Compiler'; 'MemberExpr' ] + unless $I1 goto __label_1 + getattribute $P2, $P2, 'left' + goto __label_2 + __label_1: # endwhile + $P6 = $P2.'isidentifier'() + if_null $P6, __label_3 + unless $P6 goto __label_3 + $P7 = $P2.'checkIdentifier'() + null $S1 + if_null $P7, __label_4 + set $S1, $P7 + __label_4: + isnull $I1, $S1 + if $I1 goto __label_6 + iseq $I1, $S1, '' + __label_6: + unless $I1 goto __label_5 + new $P3, ['ResizableStringArray'] + $P1.'buildkey'($P3) + $P6 = $P3.'pop'() + null $S2 + if_null $P6, __label_7 + set $S2, $P6 + __label_7: + $P4 = self.'tempreg'('P') + self.'annotate'(__ARG_1) + set $P5, $P3 + null $S3 + elements $I1, $P5 + unless $I1 goto __label_9 + join $S5, "'; '", $P5 + concat $S6, "[ '", $S5 + concat $S6, $S6, "' ]" + set $S3, $S6 + __label_9: # endif + set $S4, $S3 + goto __label_8 + __label_8: + __ARG_1.'emitget_hll_global'($P4, $S2, $S4) + .return($P4) + __label_5: # endif __label_3: # endif -# } - __label_1: # endif -.annotate 'line', 5387 -# var funref: $P2 - getattribute $P2, self, 'funref' -.annotate 'line', 5388 - root_new $P3, ['parrot';'ResizablePMCArray'] - $P5 = $P2.'emit_left_get'(__ARG_1) - push $P3, $P5 - box $P4, ".'" - push $P3, $P4 -.annotate 'line', 5389 - $P6 = $P2.'get_member'() -.annotate 'line', 5388 - push $P3, $P6 - box $P4, "'" - push $P3, $P4 -# predefined join - join $S1, "", $P3 - .return($S1) -# } -.annotate 'line', 5390 + root_new $P6, ['parrot';'ResizablePMCArray'] + assign $P6, 4 + $P7 = $P1.'emit_left_get'(__ARG_1) + $P6[0] = $P7 + $P6[1] = ".'" + $P8 = $P1.'get_member'() + $P6[2] = $P8 + $P6[3] = "'" + join $S5, "", $P6 + .return($S5) .end # emitcall .sub Winxed_class_init :anon :load :init newclass $P0, [ 'Winxed'; 'Compiler'; 'CallMemberExpr' ] -.annotate 'line', 5366 get_class $P1, [ 'Winxed'; 'Compiler'; 'CallExpr' ] addparent $P0, $P1 -.annotate 'line', 5368 - addattribute $P0, 'sym' -.annotate 'line', 5369 - addattribute $P0, 'subid' .end .namespace [ 'Winxed'; 'Compiler'; 'CallMemberRefExpr' ] @@ -15999,37 +12776,21 @@ .param pmc __ARG_1 .param pmc __ARG_2 .param pmc __ARG_3 -# Body -# { -.annotate 'line', 5400 getattribute $P1, __ARG_1, 'owner' getattribute $P2, __ARG_1, 'start' self.'Expr'($P1, $P2) -.annotate 'line', 5401 setattribute self, 'funref', __ARG_2 -.annotate 'line', 5402 setattribute self, 'args', __ARG_3 -# } -.annotate 'line', 5403 .end # CallMemberRefExpr .sub 'emitcall' :method .param pmc __ARG_1 -.const 'Sub' WSubId_1 = "WSubId_1" -# Body -# { -.annotate 'line', 5406 -# var funref: $P1 +.const 'Sub' WSubId_25 = "WSubId_25" getattribute $P1, self, 'funref' -.annotate 'line', 5407 -# var right: $P2 getattribute $P2, $P1, 'right' -.annotate 'line', 5408 -# var type: $P3 $P3 = $P2.'checkresult'() -.annotate 'line', 5409 set $S3, $P3 isne $I1, $S3, 'P' unless $I1 goto __label_2 @@ -16037,35 +12798,26 @@ isne $I1, $S4, 'S' __label_2: unless $I1 goto __label_1 -.annotate 'line', 5410 - WSubId_1("Invalid expression type in '.*'", $P1) + WSubId_25("Invalid expression type in '.*'", $P1) __label_1: # endif -.annotate 'line', 5413 -# lreg: $S1 $P4 = $P1.'emit_left_get'(__ARG_1) null $S1 if_null $P4, __label_3 set $S1, $P4 __label_3: -.annotate 'line', 5414 -# rreg: $S2 $P4 = $P2.'emit_get'(__ARG_1) null $S2 if_null $P4, __label_4 set $S2, $P4 __label_4: -.annotate 'line', 5415 concat $S3, $S1, '.' concat $S3, $S3, $S2 .return($S3) -# } -.annotate 'line', 5416 .end # emitcall .sub Winxed_class_init :anon :load :init newclass $P0, [ 'Winxed'; 'Compiler'; 'CallMemberRefExpr' ] -.annotate 'line', 5396 get_class $P1, [ 'Winxed'; 'Compiler'; 'CallExpr' ] addparent $P0, $P1 .end @@ -16075,65 +12827,23 @@ .param pmc __ARG_1 .param pmc __ARG_2 .param pmc __ARG_3 -# Body -# { -.annotate 'line', 5426 self.'Expr'(__ARG_1, __ARG_2) -.annotate 'line', 5427 setattribute self, 'left', __ARG_3 -# } -.annotate 'line', 5428 .end # MemberExprBase .sub 'emit_left_get' :method .param pmc __ARG_1 -# Body -# { -.annotate 'line', 5431 -# var left: $P1 getattribute $P1, self, 'left' -.annotate 'line', 5432 -# type: $S1 - $P2 = $P1.'checkresult'() - null $S1 - if_null $P2, __label_1 - set $S1, $P2 - __label_1: -.annotate 'line', 5433 -# reg: $S2 - $P2 = $P1.'emit_get'(__ARG_1) - null $S2 - if_null $P2, __label_2 - set $S2, $P2 - __label_2: -.annotate 'line', 5434 - eq $S1, 'P', __label_3 -# { -.annotate 'line', 5435 -# auxreg: $S3 - set $S3, $S2 -.annotate 'line', 5436 - $P2 = self.'tempreg'('P') - set $S2, $P2 -.annotate 'line', 5437 - __ARG_1.'emitbox'($S2, $S3) -# } - __label_3: # endif -.annotate 'line', 5439 - .return($S2) -# } -.annotate 'line', 5440 + .tailcall $P1.'emit_getvar'(__ARG_1) .end # emit_left_get .sub Winxed_class_init :anon :load :init newclass $P0, [ 'Winxed'; 'Compiler'; 'MemberExprBase' ] -.annotate 'line', 5421 get_class $P1, [ 'Winxed'; 'Compiler'; 'Expr' ] addparent $P0, $P1 -.annotate 'line', 5423 addattribute $P0, 'left' .end .namespace [ 'Winxed'; 'Compiler'; 'MemberExpr' ] @@ -16143,289 +12853,231 @@ .param pmc __ARG_2 .param pmc __ARG_3 .param pmc __ARG_4 -# Body -# { -.annotate 'line', 5449 self.'MemberExprBase'(__ARG_1, __ARG_2, __ARG_3) -.annotate 'line', 5450 setattribute self, 'right', __ARG_4 -# } -.annotate 'line', 5451 .end # MemberExpr +.sub 'clone' :method + .param pmc __ARG_1 + new $P1, [ 'Winxed'; 'Compiler'; 'MemberExpr' ] + getattribute $P2, self, 'start' + getattribute $P4, self, 'left' + $P3 = $P4.'clone'(__ARG_1) + $P1.'MemberExprBase'(__ARG_1, $P2, $P3) + getattribute $P3, self, 'right' + setattribute $P1, 'right', $P3 + .return($P1) + +.end # clone + + .sub 'checkresult' :method -# Body -# { -.annotate 'line', 5452 .return('P') -# } .end # checkresult +.sub 'search_nonmember' :method + null $P1 + getattribute $P2, self, 'left' + __label_2: # while + isa $I1, $P2, [ 'Winxed'; 'Compiler'; 'MemberExpr' ] + unless $I1 goto __label_1 + getattribute $P2, $P2, 'left' + goto __label_2 + __label_1: # endwhile + isa $I1, $P2, [ 'Winxed'; 'Compiler'; 'IdentifierExpr' ] + unless $I1 goto __label_3 + $P3 = $P2.'checkIdentifier'() + isnull $I1, $P3 + if $I1 goto __label_5 + set $S1, $P3 + iseq $I1, $S1, '' + __label_5: + unless $I1 goto __label_4 + root_new $P4, ['parrot';'ResizablePMCArray'] + self.'buildkey'($P4) + .tailcall self.'scopesearch'($P4, 0) + __label_4: # endif + __label_3: # endif + null $P5 + .return($P5) + +.end # search_nonmember + + .sub 'optimize' :method -# Body -# { -.annotate 'line', 5455 - getattribute $P3, self, 'left' - $P2 = $P3.'optimize'() - setattribute self, 'left', $P2 -.annotate 'line', 5456 + getattribute $P4, self, 'left' + $P3 = $P4.'optimize'() + setattribute self, 'left', $P3 + $P1 = self.'search_nonmember'() + isnull $I1, $P1 + if $I1 goto __label_3 + isa $I1, $P1, [ 'Winxed'; 'Compiler'; 'FunctionStatement' ] + if $I1 goto __label_4 + isa $I1, $P1, [ 'Winxed'; 'Compiler'; 'FunctionExtern' ] + if $I1 goto __label_5 + isa $I2, $P1, [ 'Winxed'; 'Compiler'; 'VarData' ] + box $P2, $I2 + unless $P2 goto __label_7 + $P2 = $P1.'isconst'() + __label_7: + set $I1, $P2 + if $I1 goto __label_6 + goto __label_2 + __label_3: # case + goto __label_1 # break + __label_4: # case + $P3 = $P1.'ismulti'() + if_null $P3, __label_8 + unless $P3 goto __label_8 + new $P5, [ 'Winxed'; 'Compiler'; 'FunctionRef' ] + getattribute $P6, self, 'owner' + getattribute $P7, self, 'start' + $P5.'FunctionRef'($P6, $P7, $P1) + set $P4, $P5 + .return($P4) + __label_8: # endif + goto __label_1 # break + __label_5: # case + new $P9, [ 'Winxed'; 'Compiler'; 'FunctionRef' ] + getattribute $P10, self, 'owner' + getattribute $P11, self, 'start' + $P9.'FunctionRef'($P10, $P11, $P1) + set $P8, $P9 + .return($P8) + __label_6: # case + .tailcall $P1.'getvalue'() + __label_2: # default + __label_1: # switch end .return(self) -# } -.annotate 'line', 5457 .end # optimize .sub 'buildkey' :method .param pmc __ARG_1 -# Body -# { -.annotate 'line', 5460 -# var left: $P1 getattribute $P1, self, 'left' -.annotate 'line', 5461 isa $I1, $P1, [ 'Winxed'; 'Compiler'; 'IdentifierExpr' ] unless $I1 goto __label_1 -.annotate 'line', 5462 $P2 = $P1.'getName'() -# predefined push push __ARG_1, $P2 goto __label_2 __label_1: # else -.annotate 'line', 5464 $P1.'buildkey'(__ARG_1) __label_2: # endif -.annotate 'line', 5465 getattribute $P3, self, 'right' $P2 = $P3.'getidentifier'() -# predefined push push __ARG_1, $P2 -# } -.annotate 'line', 5466 .end # buildkey .sub 'get_member' :method -# Body -# { -.annotate 'line', 5469 getattribute $P1, self, 'right' .return($P1) -# } -.annotate 'line', 5470 .end # get_member -.sub '__emit_assign_aux' :method +.sub '__emit_get_left' :method .param pmc __ARG_1 - .param string __ARG_2 - .param string __ARG_3 -# Body -# { -.annotate 'line', 5473 -# ident: $S1 - getattribute $P2, self, 'right' - $P1 = $P2.'getidentifier'() - null $S1 - if_null $P1, __label_1 - set $S1, $P1 - __label_1: -.annotate 'line', 5474 - self.'annotate'(__ARG_1) -.annotate 'line', 5475 - __ARG_1.'say'(' ', "setattribute ", __ARG_2, ", '", $S1, "', ", __ARG_3) -# } -.annotate 'line', 5476 +.const 'Sub' WSubId_25 = "WSubId_25" + getattribute $P1, self, 'left' + $P2 = $P1.'checkresult'() + set $S1, $P2 + eq $S1, 'P', __label_1 + WSubId_25("non-var at left of '.'", self) + __label_1: # endif + .tailcall $P1.'emit_get_nonull'(__ARG_1) -.end # __emit_assign_aux +.end # __emit_get_left .sub 'emit_get' :method .param pmc __ARG_1 -# Body -# { -.annotate 'line', 5479 -# result: $S1 $P1 = self.'tempreg'('P') null $S1 if_null $P1, __label_1 set $S1, $P1 __label_1: -.annotate 'line', 5480 self.'emit'(__ARG_1, $S1) -.annotate 'line', 5481 .return($S1) -# } -.annotate 'line', 5482 .end # emit_get .sub 'emit' :method .param pmc __ARG_1 - .param pmc __ARG_2 -# Body -# { -.annotate 'line', 5485 -# obj: $S1 - getattribute $P2, self, 'left' - $P1 = $P2.'emit_get'(__ARG_1) + .param string __ARG_2 + $P1 = self.'__emit_get_left'(__ARG_1) null $S1 if_null $P1, __label_1 set $S1, $P1 __label_1: -.annotate 'line', 5486 -# ident: $S2 getattribute $P2, self, 'right' $P1 = $P2.'getidentifier'() null $S2 if_null $P1, __label_2 set $S2, $P1 __label_2: -.annotate 'line', 5487 self.'annotate'(__ARG_1) -.annotate 'line', 5488 __ARG_1.'say'(' ', 'getattribute ', __ARG_2, ', ', $S1, ", '", $S2, "'") -# } -.annotate 'line', 5489 .end # emit -.sub 'emit_init' :method - .param pmc __ARG_1 - .param pmc __ARG_2 -# Body -# { -.annotate 'line', 5492 - self.'emit'(__ARG_1, __ARG_2) -# } -.annotate 'line', 5493 - -.end # emit_init - - -.sub 'emit_assign' :method - .param pmc __ARG_1 - .param string __ARG_2 - .param string __ARG_3 -# Body -# { -.annotate 'line', 5496 -# obj: $S1 - getattribute $P2, self, 'left' - $P1 = $P2.'emit_get_nonull'(__ARG_1) - null $S1 - if_null $P1, __label_1 - set $S1, $P1 - __label_1: -.annotate 'line', 5497 -# value: $S2 - null $S2 -.annotate 'line', 5498 - ne __ARG_2, 'P', __label_2 -# { -.annotate 'line', 5500 - ne __ARG_3, 'null', __label_4 -# { -.annotate 'line', 5501 - $P1 = self.'tempreg'('P') - set __ARG_3, $P1 -.annotate 'line', 5502 - __ARG_1.'emitnull'(__ARG_3) -# } - __label_4: # endif -.annotate 'line', 5504 - set $S2, __ARG_3 -# } - goto __label_3 - __label_2: # else -# { -.annotate 'line', 5507 - $P1 = self.'tempreg'('P') - set $S2, $P1 -.annotate 'line', 5508 - __ARG_1.'emitbox'($S2, __ARG_3) -# } - __label_3: # endif -.annotate 'line', 5510 - self.'__emit_assign_aux'(__ARG_1, $S1, $S2) -# } -.annotate 'line', 5511 - -.end # emit_assign - - .sub 'emit_assign_get' :method .param pmc __ARG_1 .param pmc __ARG_2 -# Body -# { -.annotate 'line', 5514 -# obj: $S1 - getattribute $P2, self, 'left' - $P1 = $P2.'emit_get_nonull'(__ARG_1) + $P1 = self.'__emit_get_left'(__ARG_1) null $S1 if_null $P1, __label_1 set $S1, $P1 __label_1: -.annotate 'line', 5515 -# value: $S2 $P1 = self.'tempreg'('P') null $S2 if_null $P1, __label_2 set $S2, $P1 __label_2: -.annotate 'line', 5516 $P1 = __ARG_2.'isnull'() if_null $P1, __label_3 unless $P1 goto __label_3 -.annotate 'line', 5517 __ARG_1.'emitnull'($S2) goto __label_4 __label_3: # else -# { -.annotate 'line', 5519 -# rreg: $S3 $P2 = __ARG_2.'emit_get'(__ARG_1) null $S3 if_null $P2, __label_5 set $S3, $P2 __label_5: -.annotate 'line', 5520 $P1 = __ARG_2.'checkresult'() - set $S4, $P1 - eq $S4, 'P', __label_6 -.annotate 'line', 5521 + set $S5, $P1 + eq $S5, 'P', __label_6 __ARG_1.'emitbox'($S2, $S3) goto __label_7 __label_6: # else -.annotate 'line', 5523 set $S2, $S3 __label_7: # endif -# } __label_4: # endif -.annotate 'line', 5525 - self.'__emit_assign_aux'(__ARG_1, $S1, $S2) -.annotate 'line', 5526 + getattribute $P2, self, 'right' + $P1 = $P2.'getidentifier'() + null $S4 + if_null $P1, __label_8 + set $S4, $P1 + __label_8: + self.'annotate'(__ARG_1) + __ARG_1.'say'(' ', "setattribute ", $S1, ", '", $S4, "', ", $S2) .return($S2) -# } -.annotate 'line', 5527 .end # emit_assign_get .sub Winxed_class_init :anon :load :init newclass $P0, [ 'Winxed'; 'Compiler'; 'MemberExpr' ] -.annotate 'line', 5443 get_class $P1, [ 'Winxed'; 'Compiler'; 'MemberExprBase' ] addparent $P0, $P1 -.annotate 'line', 5445 addattribute $P0, 'right' .end .namespace [ 'Winxed'; 'Compiler'; 'MemberRefExpr' ] @@ -16435,92 +13087,53 @@ .param pmc __ARG_2 .param pmc __ARG_3 .param pmc __ARG_4 -# Body -# { -.annotate 'line', 5538 self.'MemberExprBase'(__ARG_1, __ARG_2, __ARG_3) -.annotate 'line', 5539 setattribute self, 'right', __ARG_4 -# } -.annotate 'line', 5540 .end # MemberRefExpr .sub 'checkresult' :method -# Body -# { -.annotate 'line', 5541 .return('P') -# } .end # checkresult .sub 'optimize' :method -# Body -# { -.annotate 'line', 5544 getattribute $P3, self, 'left' $P2 = $P3.'optimize'() setattribute self, 'left', $P2 -.annotate 'line', 5545 getattribute $P3, self, 'right' $P2 = $P3.'optimize'() setattribute self, 'right', $P2 -.annotate 'line', 5546 .return(self) -# } -.annotate 'line', 5547 .end # optimize .sub 'emit' :method .param pmc __ARG_1 - .param pmc __ARG_2 -.const 'Sub' WSubId_39 = "WSubId_39" -# Body -# { -.annotate 'line', 5550 -# var left: $P1 + .param string __ARG_2 +.const 'Sub' WSubId_70 = "WSubId_70" getattribute $P1, self, 'left' -.annotate 'line', 5551 -# var right: $P2 getattribute $P2, self, 'right' -.annotate 'line', 5552 $P3 = $P2.'checkresult'() set $S3, $P3 eq $S3, 'S', __label_1 -.annotate 'line', 5553 - WSubId_39("string expression", $P2) + WSubId_70("string expression", $P2) __label_1: # endif -.annotate 'line', 5554 -# lreg: $S1 $P3 = $P1.'emit_get_nonull'(__ARG_1) null $S1 if_null $P3, __label_2 set $S1, $P3 __label_2: -.annotate 'line', 5555 -# rreg: $S2 $P3 = $P2.'emit_get'(__ARG_1) null $S2 if_null $P3, __label_3 set $S2, $P3 __label_3: -.annotate 'line', 5556 self.'annotate'(__ARG_1) -.annotate 'line', 5557 - set $S3, __ARG_2 - ne $S3, '', __label_4 -.annotate 'line', 5558 - __ARG_2 = self.'tempreg'('P') - __label_4: # endif -.annotate 'line', 5559 __ARG_1.'say'(' ', 'getattribute ', __ARG_2, ', ', $S1, ", ", $S2) -# } -.annotate 'line', 5560 .end # emit @@ -16528,216 +13141,213 @@ .sub 'emit_assign_get' :method .param pmc __ARG_1 .param pmc __ARG_2 -.const 'Sub' WSubId_39 = "WSubId_39" -# Body -# { -.annotate 'line', 5563 -# var left: $P1 +.const 'Sub' WSubId_70 = "WSubId_70" getattribute $P1, self, 'left' -.annotate 'line', 5564 -# var right: $P2 getattribute $P2, self, 'right' -.annotate 'line', 5565 $P3 = $P2.'checkresult'() set $S5, $P3 eq $S5, 'S', __label_1 -.annotate 'line', 5566 - WSubId_39("string expression", $P2) + WSubId_70("string expression", $P2) __label_1: # endif -.annotate 'line', 5567 -# lreg: $S1 $P3 = $P1.'emit_get_nonull'(__ARG_1) null $S1 if_null $P3, __label_2 set $S1, $P3 __label_2: -.annotate 'line', 5568 -# rreg: $S2 $P3 = $P2.'emit_get'(__ARG_1) null $S2 if_null $P3, __label_3 set $S2, $P3 __label_3: -.annotate 'line', 5569 -# vreg: $S3 null $S3 -# switch -.annotate 'line', 5570 $P3 = __ARG_2.'checkresult'() set $S5, $P3 - set $S6, 'P' - if $S5 == $S6 goto __label_6 - goto __label_5 + if_null $S5, __label_4 + length $I1, $S5 + ne $I1, 1, __label_4 + ord $I1, $S5 + if $I1 == 80 goto __label_6 + goto __label_4 __label_6: # case -.annotate 'line', 5572 $P4 = __ARG_2.'emit_get'(__ARG_1) set $S3, $P4 -.annotate 'line', 5574 ne $S3, 'null', __label_7 -# { -.annotate 'line', 5575 $P5 = self.'tempreg'('P') set $S3, $P5 -.annotate 'line', 5576 __ARG_1.'emitnull'($S3) -# } __label_7: # endif - goto __label_4 # break - __label_5: # default -.annotate 'line', 5580 + goto __label_5 # break + __label_4: # default $P3 = self.'tempreg'('P') set $S3, $P3 -.annotate 'line', 5581 -# aux: $S4 $P4 = __ARG_2.'emit_get'(__ARG_1) null $S4 if_null $P4, __label_8 set $S4, $P4 __label_8: -.annotate 'line', 5582 __ARG_1.'emitbox'($S3, $S4) - __label_4: # switch end -.annotate 'line', 5585 + __label_5: # switch end self.'annotate'(__ARG_1) -.annotate 'line', 5586 __ARG_1.'say'(' ', "setattribute ", $S1, ", ", $S2, ", ", $S3) -.annotate 'line', 5587 .return($S3) -# } -.annotate 'line', 5588 .end # emit_assign_get .sub Winxed_class_init :anon :load :init newclass $P0, [ 'Winxed'; 'Compiler'; 'MemberRefExpr' ] -.annotate 'line', 5533 get_class $P1, [ 'Winxed'; 'Compiler'; 'MemberExprBase' ] addparent $P0, $P1 -.annotate 'line', 5535 addattribute $P0, 'right' .end -.namespace [ 'Winxed'; 'Compiler'; 'IndexExpr' ] +.namespace [ 'Winxed'; 'Compiler'; 'StringIndexExpr' ] -.sub 'IndexExpr' :method +.sub 'StringIndexExpr' :method .param pmc __ARG_1 .param pmc __ARG_2 .param pmc __ARG_3 .param pmc __ARG_4 -# Body -# { -.annotate 'line', 5602 - self.'Expr'(__ARG_2, __ARG_3) -.annotate 'line', 5603 - setattribute self, 'left', __ARG_4 -.annotate 'line', 5604 - new $P3, [ 'Winxed'; 'Compiler'; 'SimpleArgList' ] - $P3.'SimpleArgList'(__ARG_1, __ARG_2, ']') - set $P2, $P3 - setattribute self, 'args', $P2 -# } -.annotate 'line', 5605 - -.end # IndexExpr + self.'Expr'(__ARG_1, __ARG_2) + setattribute self, 'left', __ARG_3 + setattribute self, 'arg', __ARG_4 + +.end # StringIndexExpr .sub 'checkresult' :method -# Body -# { -.annotate 'line', 5608 + .return('S') + +.end # checkresult + + +.sub 'emit' :method + .param pmc __ARG_1 + .param string __ARG_2 +.const 'Sub' WSubId_45 = "WSubId_45" getattribute $P2, self, 'left' - $P1 = $P2.'checkresult'() + $P1 = $P2.'emit_get'(__ARG_1) + null $S1 + if_null $P1, __label_1 set $S1, $P1 - ne $S1, 'S', __label_1 -.annotate 'line', 5609 - .return('S') - goto __label_2 - __label_1: # else -.annotate 'line', 5611 + __label_1: + getattribute $P2, self, 'arg' + $P1 = $P2.'emit_getint'(__ARG_1) + null $S2 + if_null $P1, __label_2 + set $S2, $P1 + __label_2: + self.'annotate'(__ARG_1) + $P1 = WSubId_45(" substr %0, %1, %2, 1", __ARG_2, $S1, $S2) + __ARG_1.'say'($P1) + +.end # emit + +.sub Winxed_class_init :anon :load :init + newclass $P0, [ 'Winxed'; 'Compiler'; 'StringIndexExpr' ] + get_class $P1, [ 'Winxed'; 'Compiler'; 'Expr' ] + addparent $P0, $P1 + addattribute $P0, 'left' + addattribute $P0, 'arg' +.end +.namespace [ 'Winxed'; 'Compiler'; 'IndexExpr' ] + +.sub 'IndexExpr' :method + .param pmc __ARG_1 + .param pmc __ARG_2 + .param pmc __ARG_3 + .param pmc __ARG_4 + self.'Expr'(__ARG_2, __ARG_3) + setattribute self, 'left', __ARG_4 + new $P3, [ 'Winxed'; 'Compiler'; 'SimpleArgList' ] + $P3.'SimpleArgList'(__ARG_1, __ARG_2, ']') + set $P2, $P3 + setattribute self, 'args', $P2 + +.end # IndexExpr + + +.sub 'clone' :method + .param pmc __ARG_1 + new $P1, [ 'Winxed'; 'Compiler'; 'IndexExpr' ] + getattribute $P2, self, 'start' + $P1.'Expr'(__ARG_1, $P2) + getattribute $P4, self, 'left' + $P3 = $P4.'clone'(__ARG_1) + setattribute $P1, 'left', $P3 + getattribute $P4, self, 'args' + $P3 = $P4.'clone'(__ARG_1) + setattribute $P1, 'args', $P3 + .return($P1) + +.end # clone + + +.sub 'checkresult' :method .return('P') - __label_2: # endif -# } -.annotate 'line', 5612 .end # checkresult .sub 'optimize' :method -# Body -# { -.annotate 'line', 5615 -# var left: $P1 - getattribute $P5, self, 'left' - $P1 = $P5.'optimize'() -.annotate 'line', 5616 +.const 'Sub' WSubId_25 = "WSubId_25" +.const 'Sub' WSubId_46 = "WSubId_46" + getattribute $P4, self, 'left' + $P1 = $P4.'optimize'() setattribute self, 'left', $P1 -.annotate 'line', 5617 -# var args: $P2 getattribute $P2, self, 'args' -.annotate 'line', 5618 $P2.'optimizeargs'() -.annotate 'line', 5622 - $I2 = $P1.'isstringliteral'() - unless $I2 goto __label_2 + $P4 = $P1.'checkresult'() + set $S2, $P4 + if_null $S2, __label_1 + length $I2, $S2 + ne $I2, 1, __label_1 + ord $I2, $S2 + if $I2 == 83 goto __label_3 + if $I2 == 80 goto __label_4 + goto __label_1 + __label_3: # case $P5 = $P2.'numargs'() set $I3, $P5 - iseq $I2, $I3, 1 - __label_2: - unless $I2 goto __label_1 -# { -.annotate 'line', 5623 -# var arg: $P3 + eq $I3, 1, __label_5 + WSubId_25('Bad string index', self) + __label_5: # endif $P3 = $P2.'getarg'(0) -.annotate 'line', 5624 - $P5 = $P3.'isintegerliteral'() - if_null $P5, __label_3 - unless $P5 goto __label_3 -# { -.annotate 'line', 5625 -# ival: $I1 - $P6 = $P3.'getIntegerValue'() - set $I1, $P6 -.annotate 'line', 5626 -# sval: $S1 - $P5 = $P1.'get_value'() + $P6 = $P1.'isstringliteral'() + unless $P6 goto __label_7 + $P6 = $P3.'isintegerliteral'() + __label_7: + if_null $P6, __label_6 + unless $P6 goto __label_6 + $P7 = $P3.'getIntegerValue'() + set $I1, $P7 + $P4 = $P1.'get_value'() null $S1 - if_null $P5, __label_4 - set $S1, $P5 - __label_4: -.annotate 'line', 5627 -# var t: $P4 - new $P4, [ 'Winxed'; 'Compiler'; 'TokenQuoted' ] - getattribute $P6, self, 'start' - getattribute $P5, $P6, 'file' - getattribute $P8, self, 'start' - getattribute $P7, $P8, 'line' -.annotate 'line', 5628 -# predefined substr + if_null $P4, __label_8 + set $S1, $P4 + __label_8: + getattribute $P4, self, 'owner' + getattribute $P5, self, 'start' substr $S2, $S1, $I1, 1 - $P4.'TokenQuoted'($P5, $P7, $S2) -.annotate 'line', 5629 - new $P6, [ 'Winxed'; 'Compiler'; 'StringLiteral' ] - getattribute $P7, self, 'owner' - $P6.'StringLiteral'($P7, $P4) - set $P5, $P6 - .return($P5) -# } - __label_3: # endif -# } - __label_1: # endif -.annotate 'line', 5632 + .tailcall WSubId_46($P4, $P5, $S2) + __label_6: # endif + new $P5, [ 'Winxed'; 'Compiler'; 'StringIndexExpr' ] + getattribute $P6, self, 'owner' + getattribute $P7, self, 'start' + $P5.'StringIndexExpr'($P6, $P7, $P1, $P3) + set $P4, $P5 + .return($P4) + __label_4: # case + goto __label_2 # break + __label_1: # default + WSubId_25("Type not valid for indexing", $P1) + __label_2: # switch end .return(self) -# } -.annotate 'line', 5633 .end # optimize .sub 'emit_prep' :method .param pmc __ARG_1 -.const 'Sub' WSubId_6 = "WSubId_6" -# Body -# { -.annotate 'line', 5636 +.const 'Sub' WSubId_30 = "WSubId_30" getattribute $P2, self, 'regleft' isnull $I1, $P2 not $I1 @@ -16747,208 +13357,105 @@ not $I1 __label_2: unless $I1 goto __label_1 -.annotate 'line', 5637 getattribute $P4, self, 'start' - WSubId_6('wrong call to IndexExpr.emit_args', $P4) + WSubId_30('wrong call to IndexExpr.emit_args', $P4) __label_1: # endif -.annotate 'line', 5638 -# var left: $P1 getattribute $P1, self, 'left' -.annotate 'line', 5639 $P4 = $P1.'isidentifier'() if_null $P4, __label_4 unless $P4 goto __label_4 -.annotate 'line', 5640 $P3 = $P1.'getIdentifier'() goto __label_3 __label_4: -.annotate 'line', 5641 - $P3 = $P1.'emit_get'(__ARG_1) + $P5 = $P1.'emit_get'(__ARG_1) + set $P3, $P5 __label_3: -.annotate 'line', 5639 setattribute self, 'regleft', $P3 -.annotate 'line', 5642 getattribute $P4, self, 'args' $P3 = $P4.'getargvalues'(__ARG_1) setattribute self, 'argregs', $P3 -# } -.annotate 'line', 5643 .end # emit_prep .sub 'emit_aux' :method .param pmc __ARG_1 -.const 'Sub' WSubId_6 = "WSubId_6" -# Body -# { -.annotate 'line', 5646 -# var regleft: $P1 +.const 'Sub' WSubId_30 = "WSubId_30" getattribute $P1, self, 'regleft' -.annotate 'line', 5647 -# var argregs: $P2 getattribute $P2, self, 'argregs' -.annotate 'line', 5648 isnull $I1, $P1 if $I1 goto __label_2 isnull $I1, $P2 __label_2: unless $I1 goto __label_1 -.annotate 'line', 5649 getattribute $P3, self, 'start' - WSubId_6('wrong call to IndexExpr.emit_aux', $P3) + WSubId_30('wrong call to IndexExpr.emit_aux', $P3) __label_1: # endif -.annotate 'line', 5650 getattribute $P3, self, 'regleft' __ARG_1.'print'($P3, '[') -.annotate 'line', 5651 -# predefined join join $S1, '; ', $P2 __ARG_1.'print'($S1) -.annotate 'line', 5652 __ARG_1.'print'(']') -# } -.annotate 'line', 5653 .end # emit_aux .sub 'emit' :method .param pmc __ARG_1 - .param pmc __ARG_2 -.const 'Sub' WSubId_1 = "WSubId_1" -# Body -# { -.annotate 'line', 5656 + .param string __ARG_2 self.'emit_prep'(__ARG_1) -.annotate 'line', 5657 -# type: $S1 - $P2 = self.'checkresult'() - null $S1 - if_null $P2, __label_1 - set $S1, $P2 - __label_1: -.annotate 'line', 5658 - ne $S1, 'S', __label_2 -# { -.annotate 'line', 5659 -# var argregs: $P1 - getattribute $P1, self, 'argregs' -.annotate 'line', 5660 -# nargs: $I1 -# predefined elements - elements $I1, $P1 -.annotate 'line', 5661 - eq $I1, 1, __label_4 -.annotate 'line', 5662 - WSubId_1('Bad string index', self) - __label_4: # endif -.annotate 'line', 5663 - set $S2, __ARG_2 - ne $S2, '', __label_5 -.annotate 'line', 5664 - __ARG_2 = self.'tempreg'('S') - __label_5: # endif -.annotate 'line', 5665 - getattribute $P2, self, 'regleft' - $P3 = $P1[0] - __ARG_1.'say'(' ', 'substr ', __ARG_2, ', ', $P2, ', ', $P3, ', ', 1) -# } - goto __label_3 - __label_2: # else -# { -.annotate 'line', 5668 self.'annotate'(__ARG_1) -.annotate 'line', 5669 __ARG_1.'print'(' ', __ARG_2, ' = ') -.annotate 'line', 5670 self.'emit_aux'(__ARG_1) -.annotate 'line', 5671 __ARG_1.'say'('') -# } - __label_3: # endif -# } -.annotate 'line', 5673 .end # emit -.sub 'emit_assign' :method +.sub 'emit_getint' :method .param pmc __ARG_1 - .param string __ARG_2 - .param string __ARG_3 -# Body -# { -.annotate 'line', 5676 - self.'emit_prep'(__ARG_1) -.annotate 'line', 5677 - self.'annotate'(__ARG_1) -.annotate 'line', 5678 - __ARG_1.'print'(' ') -.annotate 'line', 5679 - self.'emit_aux'(__ARG_1) -.annotate 'line', 5680 - __ARG_1.'say'(' = ', __ARG_3) -# } -.annotate 'line', 5681 + $P1 = self.'tempreg'('I') + null $S1 + if_null $P1, __label_1 + set $S1, $P1 + __label_1: + self.'emit'(__ARG_1, $S1) + .return($S1) -.end # emit_assign +.end # emit_getint .sub 'emit_assign_get' :method .param pmc __ARG_1 .param pmc __ARG_2 -# Body -# { -.annotate 'line', 5684 self.'emit_prep'(__ARG_1) -.annotate 'line', 5685 -# rreg: $S1 null $S1 -.annotate 'line', 5686 $P1 = __ARG_2.'isnull'() if_null $P1, __label_1 unless $P1 goto __label_1 -# { -.annotate 'line', 5687 $P2 = self.'tempreg'('P') set $S1, $P2 -.annotate 'line', 5688 __ARG_1.'emitnull'($S1) -# } goto __label_2 __label_1: # else -.annotate 'line', 5691 $P1 = __ARG_2.'emit_get'(__ARG_1) set $S1, $P1 __label_2: # endif -.annotate 'line', 5692 self.'annotate'(__ARG_1) -.annotate 'line', 5693 __ARG_1.'print'(' ') -.annotate 'line', 5694 self.'emit_aux'(__ARG_1) -.annotate 'line', 5695 __ARG_1.'say'(' = ', $S1) -.annotate 'line', 5696 .return($S1) -# } -.annotate 'line', 5697 .end # emit_assign_get .sub Winxed_class_init :anon :load :init newclass $P0, [ 'Winxed'; 'Compiler'; 'IndexExpr' ] -.annotate 'line', 5593 get_class $P1, [ 'Winxed'; 'Compiler'; 'Expr' ] addparent $P0, $P1 -.annotate 'line', 5595 addattribute $P0, 'left' -.annotate 'line', 5596 addattribute $P0, 'regleft' -.annotate 'line', 5597 addattribute $P0, 'args' -.annotate 'line', 5598 addattribute $P0, 'argregs' .end .namespace [ 'Winxed'; 'Compiler'; 'ArrayExpr' ] @@ -16957,107 +13464,118 @@ .param pmc __ARG_1 .param pmc __ARG_2 .param pmc __ARG_3 -.const 'Sub' WSubId_35 = "WSubId_35" -.const 'Sub' WSubId_36 = "WSubId_36" -# Body -# { -.annotate 'line', 5708 +.const 'Sub' WSubId_67 = "WSubId_67" +.const 'Sub' WSubId_68 = "WSubId_68" self.'Expr'(__ARG_2, __ARG_3) -.annotate 'line', 5709 -# var t: $P1 $P1 = __ARG_1.'get'() -.annotate 'line', 5710 $P2 = $P1.'isop'(']') isfalse $I1, $P2 unless $I1 goto __label_1 -# { -.annotate 'line', 5711 __ARG_1.'unget'($P1) -.annotate 'line', 5712 - $P3 = WSubId_35(__ARG_1, __ARG_2, WSubId_36, ']') + $P3 = WSubId_67(__ARG_1, __ARG_2, WSubId_68, ']') setattribute self, 'values', $P3 -# } __label_1: # endif -# } -.annotate 'line', 5714 .end # ArrayExpr +.sub 'clone' :method + .param pmc __ARG_1 + new $P1, [ 'Winxed'; 'Compiler'; 'ArrayExpr' ] + getattribute $P8, self, 'start' + $P1.'Expr'(__ARG_1, $P8) + getattribute $P8, self, 'values' + if_null $P8, __label_1 + getattribute $P2, self, 'values' + set $P3, __ARG_1 +.const 'Sub' WSubId_3 = "WSubId_3" +.const 'Sub' WSubId_5 = "WSubId_5" + set $P4, $P2 + root_new $P5, ['parrot';'ResizablePMCArray'] + $P11 = WSubId_5("clone") + $P6 = WSubId_3($P11, $P3) + if_null $P4, __label_5 + iter $P12, $P4 + set $P12, 0 + __label_4: # for iteration + unless $P12 goto __label_5 + shift $P7, $P12 + $P13 = $P6($P7) + push $P5, $P13 + goto __label_4 + __label_5: # endfor + set $P10, $P5 + goto __label_3 + __label_3: + goto __label_2 + __label_2: + set $P8, $P10 + setattribute $P1, 'values', $P8 + __label_1: # endif + .return($P1) + +.end # clone + + .sub 'checkresult' :method -# Body -# { -.annotate 'line', 5715 .return('P') -# } .end # checkresult .sub 'optimize' :method -.const 'Sub' WSubId_37 = "WSubId_37" -# Body -# { -.annotate 'line', 5718 getattribute $P1, self, 'values' - WSubId_37($P1) -.annotate 'line', 5719 + if_null $P1, __label_3 + elements $I1, $P1 + goto __label_2 + __label_3: + null $I1 + __label_2: + null $I2 + __label_6: # for condition + ge $I2, $I1, __label_5 + $P3 = $P1[$I2] + $P2 = $P3.'optimize'() + $P1[$I2] = $P2 + __label_4: # for iteration + inc $I2 + goto __label_6 + __label_5: # for end + __label_1: .return(self) -# } -.annotate 'line', 5720 .end # optimize .sub 'emit' :method .param pmc __ARG_1 - .param pmc __ARG_2 -# Body -# { -.annotate 'line', 5723 - set $S2, __ARG_2 - eq $S2, '', __label_1 -# { -.annotate 'line', 5724 -# value: $S1 + .param string __ARG_2 $P1 = self.'emit_get'(__ARG_1) null $S1 - if_null $P1, __label_3 + if_null $P1, __label_1 set $S1, $P1 - __label_3: -.annotate 'line', 5725 + __label_1: __ARG_1.'emitset'(__ARG_2, $S1) -# } - goto __label_2 - __label_1: # else -# { -.annotate 'line', 5731 - self.'emit_init'(__ARG_1, '') -# } - __label_2: # endif -# } -.annotate 'line', 5733 .end # emit +.sub 'emit_void' :method + .param pmc __ARG_1 + self.'emit_init'(__ARG_1, '') + +.end # emit_void + + .sub 'emit_get' :method .param pmc __ARG_1 -# Body -# { -.annotate 'line', 5736 -# container: $S1 $P1 = self.'tempreg'('P') null $S1 if_null $P1, __label_1 set $S1, $P1 __label_1: -.annotate 'line', 5737 self.'emit_init'(__ARG_1, $S1) -.annotate 'line', 5738 .return($S1) -# } -.annotate 'line', 5739 .end # emit_get @@ -17065,113 +13583,52 @@ .sub 'emit_init' :method .param pmc __ARG_1 .param string __ARG_2 -# Body -# { -.annotate 'line', 5742 +.const 'Sub' WSubId_45 = "WSubId_45" self.'annotate'(__ARG_1) -.annotate 'line', 5743 -# itemreg: $S1 - null $S1 -.annotate 'line', 5744 -# it_p: $S2 - null $S2 -.annotate 'line', 5745 - eq __ARG_2, '', __label_1 -# { -.annotate 'line', 5746 + getattribute $P1, self, 'values' + unless_null $P1, __label_2 + null $I1 + goto __label_1 + __label_2: + elements $I1, $P1 + __label_1: + eq __ARG_2, '', __label_3 __ARG_1.'say'(' ', 'root_new ', __ARG_2, ", ['parrot';'ResizablePMCArray']") -.annotate 'line', 5747 - $P2 = self.'tempreg'('P') - set $S2, $P2 -# } - __label_1: # endif -.annotate 'line', 5749 - getattribute $P2, self, 'values' - if_null $P2, __label_3 - iter $P3, $P2 - set $P3, 0 - __label_2: # for iteration - unless $P3 goto __label_3 - shift $P1, $P3 -# { -# switch -.annotate 'line', 5750 - $P4 = $P1.'checkresult'() - set $S4, $P4 - set $S5, 'I' - if $S4 == $S5 goto __label_6 - set $S5, 'N' - if $S4 == $S5 goto __label_7 - set $S5, 'S' - if $S4 == $S5 goto __label_8 - goto __label_5 - __label_6: # case - __label_7: # case - __label_8: # case -.annotate 'line', 5752 -# aux: $S3 - $P5 = $P1.'emit_get'(__ARG_1) - null $S3 - if_null $P5, __label_9 - set $S3, $P5 - __label_9: -.annotate 'line', 5753 - eq __ARG_2, '', __label_10 -# { -.annotate 'line', 5754 - __ARG_1.'emitbox'($S2, $S3) -.annotate 'line', 5755 - set $S1, $S2 -# } - __label_10: # endif - goto __label_4 # break - __label_5: # default -.annotate 'line', 5759 - $P2 = $P1.'isnull'() - if_null $P2, __label_11 - unless $P2 goto __label_11 -# { -.annotate 'line', 5760 - eq __ARG_2, '', __label_13 -# { -.annotate 'line', 5761 - $P4 = self.'tempreg'('P') + le $I1, 0, __label_4 + __ARG_1.'emitassign'(__ARG_2, $I1) + __label_4: # endif + __label_3: # endif + new $P4, [ 'Winxed'; 'Compiler'; 'CollectValues' ] + getattribute $P5, self, 'owner' + $P4.'CollectValues'($P5, __ARG_1) + set $P2, $P4 + null $I2 + if_null $P1, __label_6 + iter $P6, $P1 + set $P6, 0 + __label_5: # for iteration + unless $P6 goto __label_6 + shift $P3, $P6 + $P4 = $P2.'add'($P3) + null $S1 + if_null $P4, __label_7 set $S1, $P4 -.annotate 'line', 5762 - __ARG_1.'emitnull'($S1) -# } - __label_13: # endif -# } - goto __label_12 - __label_11: # else -.annotate 'line', 5766 - $P2 = $P1.'emit_get'(__ARG_1) - set $S1, $P2 - __label_12: # endif - __label_4: # switch end -.annotate 'line', 5768 - eq __ARG_2, '', __label_14 -# { -.annotate 'line', 5769 + __label_7: + eq __ARG_2, '', __label_8 self.'annotate'(__ARG_1) -.annotate 'line', 5770 - __ARG_1.'emitarg2'('push', __ARG_2, $S1) -# } - __label_14: # endif -# } - goto __label_2 - __label_3: # endfor -# } -.annotate 'line', 5773 + $P4 = WSubId_45(" %0[%1] = %2", __ARG_2, $I2, $S1) + __ARG_1.'say'($P4) + inc $I2 + __label_8: # endif + goto __label_5 + __label_6: # endfor .end # emit_init .sub Winxed_class_init :anon :load :init newclass $P0, [ 'Winxed'; 'Compiler'; 'ArrayExpr' ] -.annotate 'line', 5702 get_class $P1, [ 'Winxed'; 'Compiler'; 'Expr' ] addparent $P0, $P1 -.annotate 'line', 5704 addattribute $P0, 'values' .end .namespace [ 'Winxed'; 'Compiler'; 'HashExpr' ] @@ -17180,337 +13637,220 @@ .param pmc __ARG_1 .param pmc __ARG_2 .param pmc __ARG_3 -.const 'Sub' WSubId_36 = "WSubId_36" -.const 'Sub' WSubId_53 = "WSubId_53" -.const 'Sub' WSubId_39 = "WSubId_39" -# Body -# { -.annotate 'line', 5785 +.const 'Sub' WSubId_68 = "WSubId_68" +.const 'Sub' WSubId_84 = "WSubId_84" +.const 'Sub' WSubId_70 = "WSubId_70" self.'Expr'(__ARG_2, __ARG_3) -.annotate 'line', 5786 -# var t: $P1 $P1 = __ARG_1.'get'() -.annotate 'line', 5787 -# var keys: $P2 root_new $P2, ['parrot';'ResizablePMCArray'] -.annotate 'line', 5788 -# var values: $P3 root_new $P3, ['parrot';'ResizablePMCArray'] -.annotate 'line', 5789 $P6 = $P1.'isop'('}') isfalse $I1, $P6 unless $I1 goto __label_1 -# { -.annotate 'line', 5790 __ARG_1.'unget'($P1) __label_2: # do -.annotate 'line', 5791 -# { -.annotate 'line', 5792 -# var key: $P4 - $P4 = WSubId_36(__ARG_1, __ARG_2) -.annotate 'line', 5793 - WSubId_53(':', __ARG_1) -.annotate 'line', 5794 -# var value: $P5 - $P5 = WSubId_36(__ARG_1, __ARG_2) -.annotate 'line', 5795 -# predefined push + $P4 = WSubId_68(__ARG_1, __ARG_2) + WSubId_84(':', __ARG_1) + $P5 = WSubId_68(__ARG_1, __ARG_2) push $P2, $P4 -.annotate 'line', 5796 -# predefined push push $P3, $P5 -# } __label_4: # continue -.annotate 'line', 5798 $P1 = __ARG_1.'get'() $P6 = $P1.'isop'(',') if_null $P6, __label_3 if $P6 goto __label_2 __label_3: # enddo -.annotate 'line', 5799 $P6 = $P1.'isop'('}') isfalse $I1, $P6 unless $I1 goto __label_5 -.annotate 'line', 5800 - WSubId_39("',' or '}'", $P1) + WSubId_70("',' or '}'", $P1) __label_5: # endif -# } __label_1: # endif -.annotate 'line', 5802 setattribute self, 'keys', $P2 -.annotate 'line', 5803 setattribute self, 'values', $P3 -# } -.annotate 'line', 5804 .end # HashExpr .sub 'checkresult' :method -# Body -# { -.annotate 'line', 5805 .return('P') -# } .end # checkresult .sub 'optimize' :method -.const 'Sub' WSubId_37 = "WSubId_37" -# Body -# { -.annotate 'line', 5808 getattribute $P1, self, 'keys' - WSubId_37($P1) -.annotate 'line', 5809 - getattribute $P1, self, 'values' - WSubId_37($P1) -.annotate 'line', 5810 + if_null $P1, __label_3 + elements $I1, $P1 + goto __label_2 + __label_3: + null $I1 + __label_2: + null $I2 + __label_6: # for condition + ge $I2, $I1, __label_5 + $P4 = $P1[$I2] + $P3 = $P4.'optimize'() + $P1[$I2] = $P3 + __label_4: # for iteration + inc $I2 + goto __label_6 + __label_5: # for end + __label_1: + getattribute $P2, self, 'values' + if_null $P2, __label_9 + elements $I3, $P2 + goto __label_8 + __label_9: + null $I3 + __label_8: + null $I4 + __label_12: # for condition + ge $I4, $I3, __label_11 + $P4 = $P2[$I4] + $P3 = $P4.'optimize'() + $P2[$I4] = $P3 + __label_10: # for iteration + inc $I4 + goto __label_12 + __label_11: # for end + __label_7: .return(self) -# } -.annotate 'line', 5811 .end # optimize .sub 'emit' :method .param pmc __ARG_1 - .param pmc __ARG_2 -# Body -# { -.annotate 'line', 5814 + .param string __ARG_2 self.'annotate'(__ARG_1) -.annotate 'line', 5819 - set $S6, __ARG_2 - eq $S6, '', __label_1 -.annotate 'line', 5820 + eq __ARG_2, '', __label_1 __ARG_1.'say'(' ', 'root_new ', __ARG_2, ", ['parrot';'Hash']") __label_1: # endif -.annotate 'line', 5822 -# var keys: $P1 getattribute $P1, self, 'keys' -.annotate 'line', 5823 -# var values: $P2 getattribute $P2, self, 'values' -.annotate 'line', 5824 -# n: $I1 - set $P5, $P1 - set $I1, $P5 -# for loop -.annotate 'line', 5825 -# i: $I2 + new $P5, [ 'Winxed'; 'Compiler'; 'CollectValues' ] + getattribute $P6, self, 'owner' + $P5.'CollectValues'($P6, __ARG_1) + set $P3, $P5 + set $I1, $P1 null $I2 __label_4: # for condition ge $I2, $I1, __label_3 -# { -.annotate 'line', 5826 -# var key: $P3 - $P3 = $P1[$I2] -.annotate 'line', 5827 -# item: $S1 + $P4 = $P1[$I2] null $S1 -.annotate 'line', 5828 - $P5 = $P3.'isidentifier'() + $P5 = $P4.'isidentifier'() + unless $P5 goto __label_7 + $P6 = $P4.'checkIdentifier'() + set $S4, $P6 + iseq $I3, $S4, '' + box $P5, $I3 + __label_7: if_null $P5, __label_5 unless $P5 goto __label_5 -# { -.annotate 'line', 5829 -# id: $S2 - $P6 = $P3.'getName'() + $P7 = $P4.'getName'() null $S2 - if_null $P6, __label_7 - set $S2, $P6 - __label_7: -.annotate 'line', 5830 + if_null $P7, __label_8 + set $S2, $P7 + __label_8: $P5 = self.'tempreg'('P') set $S1, $P5 -.annotate 'line', 5831 __ARG_1.'emitget_hll_global'($S1, $S2) -# } goto __label_6 __label_5: # else -.annotate 'line', 5834 - $P5 = $P3.'emit_get'(__ARG_1) + $P5 = $P4.'emit_get'(__ARG_1) set $S1, $P5 __label_6: # endif -.annotate 'line', 5836 -# var value: $P4 - $P4 = $P2[$I2] -.annotate 'line', 5837 -# itemreg: $S3 + $P6 = $P2[$I2] + $P5 = $P3.'add'($P6) null $S3 -.annotate 'line', 5838 -# it_p: $S4 - null $S4 -.annotate 'line', 5839 - set $S6, __ARG_2 - eq $S6, '', __label_8 -.annotate 'line', 5840 - $P5 = self.'tempreg'('P') - set $S4, $P5 - __label_8: # endif -.annotate 'line', 5841 -# aux: $S5 - null $S5 -# switch -.annotate 'line', 5842 - $P5 = $P4.'checkresult'() - set $S6, $P5 - set $S7, 'I' - if $S6 == $S7 goto __label_11 - set $S7, 'N' - if $S6 == $S7 goto __label_12 - set $S7, 'S' - if $S6 == $S7 goto __label_13 - goto __label_10 - __label_11: # case - __label_12: # case - __label_13: # case -.annotate 'line', 5844 - $P6 = $P4.'emit_get'(__ARG_1) - set $S5, $P6 -.annotate 'line', 5845 - set $S8, __ARG_2 - eq $S8, '', __label_14 -# { -.annotate 'line', 5846 - __ARG_1.'emitbox'($S4, $S5) -.annotate 'line', 5847 - set $S3, $S4 -# } - __label_14: # endif - goto __label_9 # break - __label_10: # default -.annotate 'line', 5851 - $P5 = $P4.'isnull'() - if_null $P5, __label_15 - unless $P5 goto __label_15 -# { -.annotate 'line', 5852 - set $S6, __ARG_2 - eq $S6, '', __label_17 -# { -.annotate 'line', 5853 - $P6 = self.'tempreg'('P') - set $S3, $P6 -.annotate 'line', 5854 - __ARG_1.'emitnull'($S3) -# } - __label_17: # endif -# } - goto __label_16 - __label_15: # else -.annotate 'line', 5858 - $P5 = $P4.'emit_get'(__ARG_1) + if_null $P5, __label_9 set $S3, $P5 - __label_16: # endif - __label_9: # switch end -.annotate 'line', 5860 - set $S6, __ARG_2 - eq $S6, '', __label_18 -.annotate 'line', 5861 + __label_9: + eq __ARG_2, '', __label_10 __ARG_1.'say'(' ', __ARG_2, '[', $S1, '] = ', $S3) - __label_18: # endif -# } + __label_10: # endif __label_2: # for iteration -.annotate 'line', 5825 inc $I2 goto __label_4 __label_3: # for end -# } -.annotate 'line', 5863 .end # emit +.sub 'emit_void' :method + .param pmc __ARG_1 + self.'emit'(__ARG_1, '') + +.end # emit_void + + .sub 'emit_get' :method .param pmc __ARG_1 -# Body -# { -.annotate 'line', 5866 -# container: $S1 $P1 = self.'tempreg'('P') null $S1 if_null $P1, __label_1 set $S1, $P1 __label_1: -.annotate 'line', 5867 self.'emit'(__ARG_1, $S1) -.annotate 'line', 5868 .return($S1) -# } -.annotate 'line', 5869 .end # emit_get .sub Winxed_class_init :anon :load :init newclass $P0, [ 'Winxed'; 'Compiler'; 'HashExpr' ] -.annotate 'line', 5778 get_class $P1, [ 'Winxed'; 'Compiler'; 'Expr' ] addparent $P0, $P1 -.annotate 'line', 5780 addattribute $P0, 'keys' -.annotate 'line', 5781 addattribute $P0, 'values' .end .namespace [ 'Winxed'; 'Compiler'; 'NewBaseExpr' ] .sub 'checkresult' :method -# Body -# { -.annotate 'line', 5882 .return('P') -# } .end # checkresult .sub 'parseinitializer' :method .param pmc __ARG_1 -# Body -# { -.annotate 'line', 5887 new $P3, [ 'Winxed'; 'Compiler'; 'ArgumentList' ] getattribute $P4, self, 'owner' getattribute $P5, self, 'start' $P3.'ArgumentList'($P4, $P5, __ARG_1, ')') set $P2, $P3 setattribute self, 'initializer', $P2 -# } -.annotate 'line', 5888 .end # parseinitializer +.sub 'numargs' :method + getattribute $P1, self, 'initializer' + unless_null $P1, __label_2 + set $I1, -1 + goto __label_1 + __label_2: + $P2 = $P1.'numargs'() + set $I1, $P2 + __label_1: + .return($I1) + +.end # numargs + + .sub 'optimize_initializer' :method -# Body -# { -.annotate 'line', 5891 -# var initializer: $P1 getattribute $P1, self, 'initializer' -.annotate 'line', 5892 if_null $P1, __label_1 -.annotate 'line', 5893 $P3 = $P1.'optimize'() setattribute self, 'initializer', $P3 __label_1: # endif -# } -.annotate 'line', 5894 .end # optimize_initializer .sub 'optimize' :method -# Body -# { -.annotate 'line', 5897 self.'optimize_initializer'() -.annotate 'line', 5898 .return(self) -# } -.annotate 'line', 5899 .end # optimize @@ -17519,38 +13859,36 @@ .param pmc __ARG_1 .param string __ARG_2 .param string __ARG_3 -# Body -# { -.annotate 'line', 5902 -# var initializer: $P1 getattribute $P1, self, 'initializer' -.annotate 'line', 5903 if_null $P1, __label_1 -.annotate 'line', 5904 $P1.'getargvalues'(__ARG_1) __label_1: # endif -.annotate 'line', 5905 __ARG_1.'print'(' ', __ARG_2, ".'", __ARG_3, "'(") -.annotate 'line', 5906 if_null $P1, __label_2 -.annotate 'line', 5907 $P1.'emitargs'(__ARG_1) __label_2: # endif -.annotate 'line', 5908 __ARG_1.'say'(")") -# } -.annotate 'line', 5909 .end # emit_constructor .sub Winxed_class_init :anon :load :init newclass $P0, [ 'Winxed'; 'Compiler'; 'NewBaseExpr' ] -.annotate 'line', 5874 get_class $P1, [ 'Winxed'; 'Compiler'; 'Expr' ] addparent $P0, $P1 -.annotate 'line', 5876 addattribute $P0, 'initializer' .end +.namespace [ 'Winxed'; 'Compiler' ] + +.sub 'warn_class_unknown' :subid('WSubId_99') + .param pmc __ARG_1 + .param string __ARG_2 + .param pmc __ARG_3 + concat $S1, "class ", __ARG_2 + concat $S1, $S1, " not found at compile time" + __ARG_1.'warn'($S1, __ARG_3) + +.end # warn_class_unknown + .namespace [ 'Winxed'; 'Compiler'; 'NewExpr' ] .sub 'NewExpr' :method @@ -17558,348 +13896,222 @@ .param pmc __ARG_2 .param pmc __ARG_3 .param pmc __ARG_4 -.const 'Sub' WSubId_1 = "WSubId_1" -# Body -# { -.annotate 'line', 5920 +.const 'Sub' WSubId_25 = "WSubId_25" self.'Expr'(__ARG_2, __ARG_3) -.annotate 'line', 5922 - $I2 = __ARG_4.'isstring'() - if $I2 goto __label_2 - $I2 = __ARG_4.'isidentifier'() + $P2 = __ARG_4.'isstring'() + if $P2 goto __label_2 + $P2 = __ARG_4.'isidentifier'() __label_2: - not $I1, $I2 + isfalse $I1, $P2 unless $I1 goto __label_1 -.annotate 'line', 5923 - WSubId_1("Unimplemented", __ARG_4) + WSubId_25("Unimplemented", __ARG_4) __label_1: # endif -.annotate 'line', 5924 setattribute self, 'value', __ARG_4 -.annotate 'line', 5925 -# var t: $P1 $P1 = __ARG_1.'get'() -.annotate 'line', 5927 $P2 = $P1.'isop'('(') if_null $P2, __label_3 unless $P2 goto __label_3 -.annotate 'line', 5928 self.'parseinitializer'(__ARG_1) goto __label_4 __label_3: # else -.annotate 'line', 5930 __ARG_1.'unget'($P1) __label_4: # endif -# } -.annotate 'line', 5931 .end # NewExpr +.sub 'clone' :method + .param pmc __ARG_1 + new $P1, [ 'Winxed'; 'Compiler'; 'NewExpr' ] + getattribute $P2, self, 'start' + $P1.'Expr'(__ARG_1, $P2) + getattribute $P3, self, 'value' + setattribute $P1, 'value', $P3 + getattribute $P2, self, 'initializer' + if_null $P2, __label_1 + getattribute $P5, self, 'initializer' + $P4 = $P5.'clone'(__ARG_1) + setattribute $P1, 'initializer', $P4 + __label_1: # endif + .return($P1) + +.end # clone + + .sub 'optimize' :method -.const 'Sub' WSubId_1 = "WSubId_1" -# Body -# { -.annotate 'line', 5934 -# var value: $P1 +.const 'Sub' WSubId_25 = "WSubId_25" getattribute $P1, self, 'value' -.annotate 'line', 5935 - isa $I1, $P1, [ 'Winxed'; 'Compiler'; 'Token' ] - unless $I1 goto __label_2 - $I1 = $P1.'isidentifier'() - __label_2: - unless $I1 goto __label_1 -# { -.annotate 'line', 5938 -# var desc: $P2 - getattribute $P3, self, 'owner' - $P4 = $P1.'getidentifier'() - $P2 = $P3.'getvar'($P4) -.annotate 'line', 5939 + $P3 = $P1.'isidentifier'() + if_null $P3, __label_1 + unless $P3 goto __label_1 + getattribute $P4, self, 'owner' + $P5 = $P1.'getidentifier'() + $P2 = $P4.'getvar'($P5) isnull $I1, $P2 not $I1 - unless $I1 goto __label_4 - $I1 = $P2.'isconst'() - __label_4: - unless $I1 goto __label_3 -# { -.annotate 'line', 5940 + box $P3, $I1 + unless $P3 goto __label_3 + $P3 = $P2.'isconst'() + __label_3: + if_null $P3, __label_2 + unless $P3 goto __label_2 $P1 = $P2.'getvalue'() -.annotate 'line', 5941 isa $I2, $P1, [ 'Winxed'; 'Compiler'; 'StringLiteral' ] not $I1, $I2 - unless $I1 goto __label_5 -.annotate 'line', 5942 - WSubId_1('Constant value must evaluate to a string', $P1) - __label_5: # endif -.annotate 'line', 5943 + unless $I1 goto __label_4 + WSubId_25('Constant value must evaluate to a string', $P1) + __label_4: # endif getattribute $P4, $P1, 'strval' setattribute self, 'value', $P4 -# } - __label_3: # endif -# } + __label_2: # endif __label_1: # endif -.annotate 'line', 5946 self.'optimize_initializer'() -.annotate 'line', 5947 .return(self) -# } -.annotate 'line', 5948 .end # optimize .sub 'emit' :method .param pmc __ARG_1 - .param pmc __ARG_2 + .param string __ARG_2 .param int __ARG_3 :optional -.const 'Sub' WSubId_1 = "WSubId_1" -.const 'Sub' WSubId_68 = "WSubId_68" -.const 'Sub' WSubId_6 = "WSubId_6" -# Body -# { -.annotate 'line', 5951 +.const 'Sub' WSubId_25 = "WSubId_25" +.const 'Sub' WSubId_99 = "WSubId_99" +.const 'Sub' WSubId_30 = "WSubId_30" self.'annotate'(__ARG_1) -.annotate 'line', 5953 -# var initializer: $P1 getattribute $P1, self, 'initializer' -.annotate 'line', 5954 -# numinits: $I1 - unless_null $P1, __label_2 - set $I1, -1 + getattribute $P2, self, 'value' + $P8 = self.'numargs'() + set $I1, $P8 + $P8 = $P2.'isstring'() + if_null $P8, __label_2 + unless $P8 goto __label_2 + null $I2 goto __label_1 __label_2: - $I1 = $P1.'numargs'() - __label_1: -# Constant BYNAME evaluated at compile time -# Constant BYIDENT evaluated at compile time -.annotate 'line', 5957 -# type: $I2 - getattribute $P7, self, 'value' - $P6 = $P7.'isstring'() - if_null $P6, __label_4 - unless $P6 goto __label_4 - null $I2 + $P9 = $P2.'isidentifier'() + if_null $P9, __label_4 + unless $P9 goto __label_4 + set $I2, 1 goto __label_3 __label_4: -.annotate 'line', 5958 - getattribute $P9, self, 'value' - $P8 = $P9.'isidentifier'() - if_null $P8, __label_6 - unless $P8 goto __label_6 - set $I2, 1 - goto __label_5 - __label_6: set $I2, -1 - __label_5: __label_3: -.annotate 'line', 5960 -# reginit: $S1 + __label_1: set $S1, '' -.annotate 'line', 5961 -# regnew: $S2 - set $P6, __ARG_2 - null $S2 - if_null $P6, __label_7 - set $S2, $P6 - __label_7: -.annotate 'line', 5962 -# constructor: $S3 + set $S2, __ARG_2 null $S3 -# switch -.annotate 'line', 5963 - set $I3, $I1 - set $I4, -1 - if $I3 == $I4 goto __label_10 - null $I4 - if $I3 == $I4 goto __label_11 - set $I4, 1 - if $I3 == $I4 goto __label_12 - goto __label_9 - __label_10: # case - __label_11: # case - goto __label_8 # break - __label_12: # case -.annotate 'line', 5968 - ne $I2, 1, __label_13 -# { -.annotate 'line', 5969 - not $I5, __ARG_3 - unless $I5 goto __label_15 -.annotate 'line', 5970 - $P6 = self.'tempreg'('P') - set $S2, $P6 - __label_15: # endif -# } - goto __label_14 - __label_13: # else -# { -.annotate 'line', 5973 -# var initval: $P2 - $P2 = $P1.'getfreearg'(0) -.annotate 'line', 5974 - $P6 = $P2.'emit_get'(__ARG_1) - set $S1, $P6 -.annotate 'line', 5975 - concat $S1, ', ', $S1 -# } - __label_14: # endif - goto __label_8 # break - __label_9: # default -.annotate 'line', 5979 - eq $I2, 1, __label_16 -.annotate 'line', 5980 - WSubId_1('Multiple init arguments not allowed here', self) - __label_16: # endif -.annotate 'line', 5981 + if $I1 == -1 goto __label_7 + if $I1 == 0 goto __label_8 + if $I1 == 1 goto __label_9 + goto __label_5 + __label_7: # case + __label_8: # case + goto __label_6 # break + __label_9: # case + ne $I2, 1, __label_10 + not $I4, __ARG_3 + unless $I4 goto __label_12 + $P8 = self.'tempreg'('P') + set $S2, $P8 + __label_12: # endif + goto __label_11 + __label_10: # else + $P3 = $P1.'getfreearg'(0) + $P8 = $P3.'emit_get'(__ARG_1) + set $S1, $P8 + concat $S5, ', ', $S1 + set $S1, $S5 + __label_11: # endif + goto __label_6 # break + __label_5: # default + eq $I2, 1, __label_13 + WSubId_25('Multiple init arguments not allowed here', self) + __label_13: # endif not $I3, __ARG_3 - unless $I3 goto __label_17 -.annotate 'line', 5982 - $P6 = self.'tempreg'('P') - set $S2, $P6 - __label_17: # endif - __label_8: # switch end -# switch -.annotate 'line', 5985 - set $I3, $I2 - null $I4 - if $I3 == $I4 goto __label_20 - set $I4, 1 - if $I3 == $I4 goto __label_21 - goto __label_19 - __label_20: # case -.annotate 'line', 5988 -# name: $S4 - getattribute $P7, self, 'value' - $P6 = $P7.'rawstring'() + unless $I3 goto __label_14 + $P8 = self.'tempreg'('P') + set $S2, $P8 + __label_14: # endif + __label_6: # switch end + ne $S2, '', __label_15 + $P8 = self.'tempreg'('P') + set $S2, $P8 + __label_15: # endif + if $I2 == 0 goto __label_18 + if $I2 == 1 goto __label_19 + goto __label_16 + __label_18: # case + $P8 = $P2.'rawstring'() null $S4 - if_null $P6, __label_22 - set $S4, $P6 - __label_22: -.annotate 'line', 5989 -# var aux: $P3 -# predefined get_class - get_class $P3, $S4 -.annotate 'line', 5990 - isnull $I5, $P3 - unless $I5 goto __label_24 - $I5 = self.'dowarnings'() - __label_24: - unless $I5 goto __label_23 -.annotate 'line', 5991 - concat $S5, "Can't locate class ", $S4 - concat $S5, $S5, " at compile time" - getattribute $P8, self, 'value' - WSubId_68($S5, $P8) - __label_23: # endif -.annotate 'line', 5995 - getattribute $P9, self, 'value' - __ARG_1.'say'(' ', 'new ', $S2, ", [ ", $P9, " ]", $S1) -.annotate 'line', 5996 - le $I1, 1, __label_25 -# { -.annotate 'line', 5997 - getattribute $P10, self, 'value' - __ARG_1.'say'($S2, ".'", $P10, "'()") -# } - __label_25: # endif - goto __label_18 # break - __label_21: # case -.annotate 'line', 6001 -# var id: $P4 - getattribute $P6, self, 'owner' - getattribute $P7, self, 'value' - $P4 = $P6.'getvar'($P7) -.annotate 'line', 6002 - unless_null $P4, __label_26 -# { -.annotate 'line', 6004 -# var cl: $P5 + if_null $P8, __label_20 + set $S4, $P8 + __label_20: + get_class $P4, $S4 + unless_null $P4, __label_21 + WSubId_99(__ARG_1, $S4, $P2) + __label_21: # endif + __ARG_1.'say'(' ', 'new ', $S2, ", [ ", $P2, " ]", $S1) + le $I1, 1, __label_22 + __ARG_1.'say'($S2, ".'", $P2, "'()") + __label_22: # endif + goto __label_17 # break + __label_19: # case getattribute $P8, self, 'owner' - getattribute $P9, self, 'value' - $P5 = $P8.'checkclass'($P9) -.annotate 'line', 6005 - if_null $P5, __label_28 -# { -.annotate 'line', 6006 - $P6 = $P5.'getclasskey'() - __ARG_1.'say'(' ', 'new ', $S2, ", ", $P6, $S1) -# } - goto __label_29 - __label_28: # else -# { -.annotate 'line', 6009 - $P6 = self.'dowarnings'() - if_null $P6, __label_30 - unless $P6 goto __label_30 -.annotate 'line', 6010 - WSubId_68('Checking: new unknown type') - __label_30: # endif -.annotate 'line', 6011 - getattribute $P6, self, 'value' - __ARG_1.'say'(' ', 'new ', $S2, ", ['", $P6, "']", $S1) -# } - __label_29: # endif -.annotate 'line', 6013 - getattribute $P6, self, 'value' - set $S3, $P6 -# } - goto __label_27 - __label_26: # else -# { -.annotate 'line', 6017 - $P6 = $P4.'getreg'() - __ARG_1.'say'(' ', 'new ', $S2, ", ", $P6, "", $S1) -# } - __label_27: # endif - goto __label_18 # break - __label_19: # default -.annotate 'line', 6021 - WSubId_6('Unexpected type in new') - __label_18: # switch end -.annotate 'line', 6023 + $P5 = $P8.'getvar'($P2) + unless_null $P5, __label_23 + getattribute $P9, self, 'owner' + $P6 = $P9.'checkclass'($P2) + if_null $P6, __label_25 + $P7 = $P6.'getpath'() + $P7.'emit_new'(__ARG_1, self, $S2, $S1) + goto __label_26 + __label_25: # else + root_new $P8, ['parrot';'ResizablePMCArray'] + assign $P8, 1 + $P8[0] = $P2 + $P5 = self.'scopesearch'($P8, 2) + if_null $P5, __label_27 + $P8 = $P5.'getclasskey'() + __ARG_1.'say'(' ', 'new ', $S2, ", ", $P8, $S1) + goto __label_28 + __label_27: # else + $P9 = $P2.'getidentifier'() + WSubId_99(__ARG_1, $P9, $P2) + __ARG_1.'say'(' ', 'new ', $S2, ", ['", $P2, "']", $S1) + __label_28: # endif + __label_26: # endif + set $S3, $P2 + goto __label_24 + __label_23: # else + $P8 = $P5.'getreg'() + __ARG_1.'say'(' ', 'new ', $S2, ", ", $P8, "", $S1) + __label_24: # endif + goto __label_17 # break + __label_16: # default + WSubId_30('Unexpected type in new') + __label_17: # switch end isgt $I3, $I1, 1 - if $I3 goto __label_32 + if $I3 goto __label_30 isge $I3, $I1, 0 - unless $I3 goto __label_33 - iseq $I3, $I2, 1 - __label_33: - __label_32: unless $I3 goto __label_31 -# { -.annotate 'line', 6024 + iseq $I3, $I2, 1 + __label_31: + __label_30: + unless $I3 goto __label_29 self.'emit_constructor'(__ARG_1, $S2, $S3) -.annotate 'line', 6025 not $I3, __ARG_3 - unless $I3 goto __label_34 -.annotate 'line', 6026 + unless $I3 goto __label_32 __ARG_1.'emitset'(__ARG_2, $S2) - __label_34: # endif -# } - __label_31: # endif -# } -.annotate 'line', 6028 + __label_32: # endif + __label_29: # endif .end # emit - -.sub 'emit_init' :method - .param pmc __ARG_1 - .param pmc __ARG_2 -# Body -# { -.annotate 'line', 6031 - .tailcall self.'emit'(__ARG_1, __ARG_2, 1) -# } -.annotate 'line', 6032 - -.end # emit_init - .sub Winxed_class_init :anon :load :init newclass $P0, [ 'Winxed'; 'Compiler'; 'NewExpr' ] -.annotate 'line', 5914 get_class $P1, [ 'Winxed'; 'Compiler'; 'NewBaseExpr' ] addparent $P0, $P1 -.annotate 'line', 5916 addattribute $P0, 'value' .end .namespace [ 'Winxed'; 'Compiler'; 'NewIndexedExpr' ] @@ -17908,115 +14120,69 @@ .param pmc __ARG_1 .param pmc __ARG_2 .param pmc __ARG_3 -# Body -# { -.annotate 'line', 6043 self.'Expr'(__ARG_2, __ARG_3) -.annotate 'line', 6044 setattribute self, 'owner', __ARG_2 -.annotate 'line', 6045 -# var nskey: $P1 - new $P1, [ 'Winxed'; 'Compiler'; 'ClassSpecifierParrotKey' ] - $P1.'ClassSpecifierParrotKey'(__ARG_1, __ARG_2, __ARG_3) -.annotate 'line', 6046 + new $P3, [ 'Winxed'; 'Compiler'; 'ClassSpecifierParrotKey' ] + $P3.'ClassSpecifierParrotKey'(__ARG_1, __ARG_2, __ARG_3) + set $P1, $P3 setattribute self, 'nskey', $P1 -.annotate 'line', 6047 -# var t: $P2 $P2 = __ARG_1.'get'() -.annotate 'line', 6048 $P3 = $P2.'isop'('(') if_null $P3, __label_1 unless $P3 goto __label_1 -.annotate 'line', 6049 self.'parseinitializer'(__ARG_1) goto __label_2 __label_1: # else -.annotate 'line', 6051 __ARG_1.'unget'($P2) __label_2: # endif -# } -.annotate 'line', 6052 .end # NewIndexedExpr .sub 'emit' :method .param pmc __ARG_1 - .param pmc __ARG_2 -.const 'Sub' WSubId_1 = "WSubId_1" -# Body -# { -.annotate 'line', 6055 -# reginit: $S1 + .param string __ARG_2 +.const 'Sub' WSubId_25 = "WSubId_25" null $S1 -.annotate 'line', 6056 -# var initializer: $P1 - getattribute $P1, self, 'initializer' -.annotate 'line', 6057 -# numinits: $I1 - unless_null $P1, __label_2 - null $I1 + $P3 = self.'numargs'() + set $I1, $P3 + if $I1 == -1 goto __label_3 + if $I1 == 0 goto __label_4 + if $I1 == 1 goto __label_5 goto __label_1 - __label_2: - $I1 = $P1.'numargs'() - __label_1: -# switch -.annotate 'line', 6058 - set $I2, $I1 - null $I3 - if $I2 == $I3 goto __label_5 - set $I3, 1 - if $I2 == $I3 goto __label_6 - goto __label_4 + __label_3: # case + __label_4: # case + goto __label_2 # break __label_5: # case - goto __label_3 # break - __label_6: # case -.annotate 'line', 6062 -# var initval: $P2 - $P2 = $P1.'getfreearg'(0) -.annotate 'line', 6063 - $P4 = $P2.'emit_get'(__ARG_1) - set $S1, $P4 - goto __label_3 # break - __label_4: # default -.annotate 'line', 6066 - WSubId_1('Multiple init arguments not allowed here', self) - __label_3: # switch end -.annotate 'line', 6068 -# var nskey: $P3 - getattribute $P3, self, 'nskey' -.annotate 'line', 6069 + getattribute $P4, self, 'initializer' + $P1 = $P4.'getfreearg'(0) + $P5 = $P1.'emit_get'(__ARG_1) + set $S1, $P5 + goto __label_2 # break + __label_1: # default + WSubId_25('Multiple init arguments not allowed here', self) + __label_2: # switch end + getattribute $P2, self, 'nskey' __ARG_1.'print'(' ') -.annotate 'line', 6070 - $P4 = $P3.'hasHLL'() - if_null $P4, __label_7 - unless $P4 goto __label_7 -.annotate 'line', 6071 + $P3 = $P2.'hasHLL'() + if_null $P3, __label_6 + unless $P3 goto __label_6 __ARG_1.'print'("root_") - __label_7: # endif -.annotate 'line', 6072 + __label_6: # endif __ARG_1.'print'("new ", __ARG_2, ", ") -.annotate 'line', 6073 - null $P4 - $P3.'emit'(__ARG_1, $P4) -.annotate 'line', 6074 - if_null $S1, __label_8 -.annotate 'line', 6075 + null $P3 + $P2.'emit'(__ARG_1, $P3) + if_null $S1, __label_7 __ARG_1.'print'(', ', $S1) - __label_8: # endif -.annotate 'line', 6076 + __label_7: # endif __ARG_1.'say'() -# } -.annotate 'line', 6077 .end # emit .sub Winxed_class_init :anon :load :init newclass $P0, [ 'Winxed'; 'Compiler'; 'NewIndexedExpr' ] -.annotate 'line', 6037 get_class $P1, [ 'Winxed'; 'Compiler'; 'NewBaseExpr' ] addparent $P0, $P1 -.annotate 'line', 6039 addattribute $P0, 'nskey' .end .namespace [ 'Winxed'; 'Compiler'; 'NewQualifiedExpr' ] @@ -18025,175 +14191,106 @@ .param pmc __ARG_1 .param pmc __ARG_2 .param pmc __ARG_3 -# Body -# { -.annotate 'line', 6088 self.'Expr'(__ARG_2, __ARG_3) -.annotate 'line', 6089 setattribute self, 'owner', __ARG_2 -.annotate 'line', 6090 -# var nskey: $P1 - new $P1, [ 'Winxed'; 'Compiler'; 'ClassSpecifierId' ] - $P1.'ClassSpecifierId'(__ARG_1, __ARG_2, __ARG_3) -.annotate 'line', 6091 + new $P3, [ 'Winxed'; 'Compiler'; 'ClassSpecifierId' ] + $P3.'ClassSpecifierId'(__ARG_1, __ARG_2, __ARG_3) + set $P1, $P3 setattribute self, 'nskey', $P1 -.annotate 'line', 6092 -# var t: $P2 $P2 = __ARG_1.'get'() -.annotate 'line', 6093 $P3 = $P2.'isop'('(') if_null $P3, __label_1 unless $P3 goto __label_1 -.annotate 'line', 6094 self.'parseinitializer'(__ARG_1) goto __label_2 __label_1: # else -.annotate 'line', 6096 __ARG_1.'unget'($P2) __label_2: # endif -# } -.annotate 'line', 6097 .end # NewQualifiedExpr .sub 'emit' :method .param pmc __ARG_1 - .param pmc __ARG_2 -# Body -# { -.annotate 'line', 6100 -# reginit: $S1 - null $S1 -.annotate 'line', 6101 -# var initializer: $P1 - getattribute $P1, self, 'initializer' -.annotate 'line', 6103 -# numinits: $I1 - unless_null $P1, __label_2 - set $I1, -1 - goto __label_1 - __label_2: - $I1 = $P1.'numargs'() - __label_1: -.annotate 'line', 6104 -# regnew: $S2 - set $P3, __ARG_2 + .param string __ARG_2 + $P2 = self.'numargs'() + set $I1, $P2 + set $S1, __ARG_2 + le $I1, 0, __label_1 + $P2 = self.'tempreg'('P') + set $S1, $P2 + __label_1: # endif + getattribute $P1, self, 'nskey' + ne $S1, '', __label_2 + $P2 = self.'tempreg'('P') + set $S1, $P2 + __label_2: # endif + $P1.'emit_new'(__ARG_1, self, $S1) + lt $I1, 0, __label_3 + $P2 = $P1.'last'() null $S2 - if_null $P3, __label_3 - set $S2, $P3 - __label_3: -.annotate 'line', 6105 - le $I1, 0, __label_4 -.annotate 'line', 6106 - $P3 = self.'tempreg'('P') - set $S2, $P3 - __label_4: # endif -.annotate 'line', 6107 -# var nskey: $P2 - getattribute $P2, self, 'nskey' -.annotate 'line', 6108 - __ARG_1.'print'(' ', 'new ', $S2, ", ") -.annotate 'line', 6109 - getattribute $P3, self, 'owner' - $P2.'emit'(__ARG_1, $P3) -.annotate 'line', 6110 - __ARG_1.'say'() -.annotate 'line', 6112 - lt $I1, 0, __label_5 -# { -.annotate 'line', 6113 -# constructor: $S3 - $P3 = $P2.'last'() - null $S3 - if_null $P3, __label_6 - set $S3, $P3 - __label_6: -.annotate 'line', 6114 - self.'emit_constructor'(__ARG_1, $S2, $S3) -.annotate 'line', 6115 - __ARG_1.'emitset'(__ARG_2, $S2) -# } - __label_5: # endif -# } -.annotate 'line', 6117 + if_null $P2, __label_4 + set $S2, $P2 + __label_4: + self.'emit_constructor'(__ARG_1, $S1, $S2) + __ARG_1.'emitset'(__ARG_2, $S1) + __label_3: # endif .end # emit .sub Winxed_class_init :anon :load :init newclass $P0, [ 'Winxed'; 'Compiler'; 'NewQualifiedExpr' ] -.annotate 'line', 6082 get_class $P1, [ 'Winxed'; 'Compiler'; 'NewBaseExpr' ] addparent $P0, $P1 -.annotate 'line', 6084 addattribute $P0, 'nskey' .end .namespace [ 'Winxed'; 'Compiler' ] -.sub 'parseNew' :subid('WSubId_69') +.sub 'parseNew' :subid('WSubId_100') .param pmc __ARG_1 .param pmc __ARG_2 .param pmc __ARG_3 -# Body -# { -.annotate 'line', 6124 -# var t: $P1 $P1 = __ARG_1.'get'() -# switch-case -.annotate 'line', 6127 - $I1 = $P1.'isop'('(') + $P3 = $P1.'isop'('(') + set $I1, $P3 if $I1 goto __label_3 -.annotate 'line', 6131 - $I1 = $P1.'isop'('[') + $P4 = $P1.'isop'('[') + set $I1, $P4 if $I1 goto __label_4 -.annotate 'line', 6134 - $I1 = $P1.'isidentifier'() + $P5 = $P1.'isidentifier'() + set $I1, $P5 if $I1 goto __label_5 goto __label_2 __label_3: # case -.annotate 'line', 6129 - new $P4, [ 'Winxed'; 'Compiler'; 'CallExpr' ] -.annotate 'line', 6130 - new $P6, [ 'Winxed'; 'Compiler'; 'StringLiteral' ] - $P6.'StringLiteral'(__ARG_2, __ARG_3) - set $P5, $P6 - $P4.'CallExpr'(__ARG_1, __ARG_2, __ARG_3, $P5) - set $P3, $P4 -.annotate 'line', 6129 - .return($P3) + new $P7, [ 'Winxed'; 'Compiler'; 'CallExpr' ] + new $P9, [ 'Winxed'; 'Compiler'; 'StringLiteral' ] + $P9.'StringLiteral'(__ARG_2, __ARG_3) + set $P8, $P9 + $P7.'CallExpr'(__ARG_1, __ARG_2, __ARG_3, $P8) + set $P6, $P7 + .return($P6) __label_4: # case -.annotate 'line', 6133 - new $P8, [ 'Winxed'; 'Compiler'; 'NewIndexedExpr' ] - $P8.'NewIndexedExpr'(__ARG_1, __ARG_2, __ARG_3) - set $P7, $P8 - .return($P7) + new $P11, [ 'Winxed'; 'Compiler'; 'NewIndexedExpr' ] + $P11.'NewIndexedExpr'(__ARG_1, __ARG_2, __ARG_3) + set $P10, $P11 + .return($P10) __label_5: # case -.annotate 'line', 6137 -# var t2: $P2 $P2 = __ARG_1.'get'() -.annotate 'line', 6138 __ARG_1.'unget'($P2) -.annotate 'line', 6139 - $P9 = $P2.'isop'('.') - if_null $P9, __label_6 - unless $P9 goto __label_6 -# { -.annotate 'line', 6141 - new $P11, [ 'Winxed'; 'Compiler'; 'NewQualifiedExpr' ] - $P11.'NewQualifiedExpr'(__ARG_1, __ARG_2, $P1) - set $P10, $P11 - .return($P10) -# } + $P12 = $P2.'isop'('.') + if_null $P12, __label_6 + unless $P12 goto __label_6 + new $P14, [ 'Winxed'; 'Compiler'; 'NewQualifiedExpr' ] + $P14.'NewQualifiedExpr'(__ARG_1, __ARG_2, $P1) + set $P13, $P14 + .return($P13) __label_6: # endif __label_2: # default -.annotate 'line', 6146 new $P4, [ 'Winxed'; 'Compiler'; 'NewExpr' ] $P4.'NewExpr'(__ARG_1, __ARG_2, __ARG_3, $P1) set $P3, $P4 .return($P3) __label_1: # switch end -# } -.annotate 'line', 6148 .end # parseNew @@ -18204,113 +14301,78 @@ .param pmc __ARG_2 .param pmc __ARG_3 .param pmc __ARG_4 -.const 'Sub' WSubId_62 = "WSubId_62" -# Body -# { -.annotate 'line', 6159 +.const 'Sub' WSubId_92 = "WSubId_92" self.'Expr'(__ARG_1, __ARG_2) -.annotate 'line', 6160 setattribute self, 'lexpr', __ARG_3 -.annotate 'line', 6161 - $P2 = WSubId_62(__ARG_4, self) + $P2 = WSubId_92(__ARG_4, self) setattribute self, 'checked', $P2 -# } -.annotate 'line', 6162 .end # OpInstanceOfExpr +.sub 'clone' :method + .param pmc __ARG_1 + new $P1, [ 'Winxed'; 'Compiler'; 'OpInstanceOfExpr' ] + getattribute $P2, self, 'start' + $P1.'Expr'(__ARG_1, $P2) + getattribute $P4, self, 'lexpr' + $P3 = $P4.'clone'(__ARG_1) + setattribute $P1, 'lexpr', $P3 + getattribute $P4, self, 'checked' + $P3 = $P4.'clone'(self) + setattribute $P1, 'checked', $P3 + .return($P1) + +.end # clone + + .sub 'optimize' :method -# Body -# { -.annotate 'line', 6165 getattribute $P3, self, 'lexpr' $P2 = $P3.'optimize'() setattribute self, 'lexpr', $P2 -.annotate 'line', 6166 .return(self) -# } -.annotate 'line', 6167 .end # optimize .sub 'checkresult' :method -# Body -# { -.annotate 'line', 6168 .return('I') -# } .end # checkresult .sub 'emit' :method .param pmc __ARG_1 - .param pmc __ARG_2 -.const 'Sub' WSubId_1 = "WSubId_1" -# Body -# { -.annotate 'line', 6171 -# var lexpr: $P1 + .param string __ARG_2 +.const 'Sub' WSubId_25 = "WSubId_25" getattribute $P1, self, 'lexpr' -.annotate 'line', 6172 -# ltype: $S1 $P3 = $P1.'checkresult'() null $S1 if_null $P3, __label_1 set $S1, $P3 __label_1: -.annotate 'line', 6173 eq $S1, 'P', __label_2 -.annotate 'line', 6174 - WSubId_1('Invalid instanceof left operand', $P1) + WSubId_25('Invalid instanceof left operand', $P1) __label_2: # endif -.annotate 'line', 6175 -# var checked: $P2 getattribute $P2, self, 'checked' -.annotate 'line', 6177 -# r: $S2 - set $S4, __ARG_2 - ne $S4, '', __label_4 - $P3 = self.'tempreg'('I') - goto __label_3 - __label_4: - set $P3, __ARG_2 - __label_3: + $P3 = $P1.'emit_get'(__ARG_1) null $S2 - if_null $P3, __label_5 + if_null $P3, __label_3 set $S2, $P3 - __label_5: -.annotate 'line', 6178 -# check: $S3 - $P3 = $P1.'emit_get'(__ARG_1) - null $S3 - if_null $P3, __label_6 - set $S3, $P3 - __label_6: -.annotate 'line', 6179 + __label_3: self.'annotate'(__ARG_1) -.annotate 'line', 6180 - __ARG_1.'print'(' isa ', $S2, ', ', $S3, ', ') -.annotate 'line', 6181 + __ARG_1.'print'(' isa ', __ARG_2, ', ', $S2, ', ') getattribute $P3, self, 'owner' $P2.'emit'(__ARG_1, $P3) -.annotate 'line', 6182 __ARG_1.'say'() -# } -.annotate 'line', 6183 .end # emit .sub Winxed_class_init :anon :load :init newclass $P0, [ 'Winxed'; 'Compiler'; 'OpInstanceOfExpr' ] -.annotate 'line', 6152 get_class $P1, [ 'Winxed'; 'Compiler'; 'Expr' ] addparent $P0, $P1 -.annotate 'line', 6154 addattribute $P0, 'lexpr' -.annotate 'line', 6155 addattribute $P0, 'checked' .end .namespace [ 'Winxed'; 'Compiler'; 'OpConditionalExpr' ] @@ -18321,1729 +14383,1171 @@ .param pmc __ARG_3 .param pmc __ARG_4 .param pmc __ARG_5 -# Body -# { -.annotate 'line', 6200 self.'Expr'(__ARG_1, __ARG_2) -.annotate 'line', 6201 new $P3, [ 'Winxed'; 'Compiler'; 'Condition' ] $P2 = $P3.'set'(__ARG_3) setattribute self, 'condition', $P2 -.annotate 'line', 6202 setattribute self, 'etrue', __ARG_4 -.annotate 'line', 6203 setattribute self, 'efalse', __ARG_5 -.annotate 'line', 6204 .return(self) -# } -.annotate 'line', 6205 .end # OpConditionalExpr +.sub 'clone' :method + .param pmc __ARG_1 + new $P1, [ 'Winxed'; 'Compiler'; 'OpConditionalExpr' ] + getattribute $P2, self, 'start' + $P1.'Expr'(__ARG_1, $P2) + new $P4, [ 'Winxed'; 'Compiler'; 'Condition' ] + getattribute $P7, self, 'condition' + getattribute $P6, $P7, 'condexpr' + $P5 = $P6.'clone'(__ARG_1) + $P3 = $P4.'set'($P5) + setattribute $P1, 'condition', $P3 + getattribute $P4, self, 'etrue' + $P3 = $P4.'clone'(__ARG_1) + setattribute $P1, 'etrue', $P3 + getattribute $P4, self, 'efalse' + $P3 = $P4.'clone'(__ARG_1) + setattribute $P1, 'efalse', $P3 + .return($P1) + +.end # clone + + .sub 'optimize' :method -# Body -# { -.annotate 'line', 6208 getattribute $P3, self, 'condition' $P2 = $P3.'optimize'() setattribute self, 'condition', $P2 -# switch -.annotate 'line', 6209 getattribute $P2, self, 'condition' $P1 = $P2.'getvalue'() set $I1, $P1 - set $I2, 1 - if $I1 == $I2 goto __label_3 - set $I2, 2 - if $I1 == $I2 goto __label_4 - goto __label_2 + if $I1 == 1 goto __label_3 + if $I1 == 2 goto __label_4 + goto __label_1 __label_3: # case -.annotate 'line', 6211 getattribute $P3, self, 'etrue' .tailcall $P3.'optimize'() __label_4: # case -.annotate 'line', 6213 getattribute $P4, self, 'efalse' .tailcall $P4.'optimize'() - __label_2: # default -.annotate 'line', 6215 + __label_1: # default getattribute $P7, self, 'etrue' $P6 = $P7.'optimize'() setattribute self, 'etrue', $P6 -.annotate 'line', 6216 getattribute $P10, self, 'efalse' $P9 = $P10.'optimize'() setattribute self, 'efalse', $P9 -.annotate 'line', 6217 .return(self) - __label_1: # switch end -# } -.annotate 'line', 6219 + __label_2: # switch end .end # optimize .sub 'checkresult' :method -# Body -# { -.annotate 'line', 6222 -# var etrue: $P1 getattribute $P1, self, 'etrue' -.annotate 'line', 6223 $P2 = $P1.'isnull'() if_null $P2, __label_1 unless $P2 goto __label_1 -.annotate 'line', 6224 getattribute $P3, self, 'efalse' .tailcall $P3.'checkresult'() goto __label_2 __label_1: # else -.annotate 'line', 6226 .tailcall $P1.'checkresult'() __label_2: # endif -# } -.annotate 'line', 6227 .end # checkresult .sub 'emit' :method .param pmc __ARG_1 - .param pmc __ARG_2 -# Body -# { -.annotate 'line', 6230 -# cond_end: $S1 - getattribute $P4, self, 'owner' - $P3 = $P4.'genlabel'() + .param string __ARG_2 + getattribute $P1, self, 'owner' + $P5 = $P1.'genlabel'() null $S1 - if_null $P3, __label_1 - set $S1, $P3 + if_null $P5, __label_1 + set $S1, $P5 __label_1: -.annotate 'line', 6231 -# cond_false: $S2 - getattribute $P4, self, 'owner' - $P3 = $P4.'genlabel'() + $P5 = $P1.'genlabel'() null $S2 - if_null $P3, __label_2 - set $S2, $P3 + if_null $P5, __label_2 + set $S2, $P5 __label_2: -.annotate 'line', 6232 - getattribute $P3, self, 'condition' - $P3.'emit_else'(__ARG_1, $S2) -.annotate 'line', 6233 -# var etrue: $P1 - getattribute $P1, self, 'etrue' -.annotate 'line', 6234 -# tres: $S3 - $P3 = self.'checkresult'() + getattribute $P5, self, 'condition' + $P5.'emit_else'(__ARG_1, $S2) + getattribute $P2, self, 'etrue' + $P5 = self.'checkresult'() null $S3 - if_null $P3, __label_3 - set $S3, $P3 + if_null $P5, __label_3 + set $S3, $P5 __label_3: -.annotate 'line', 6235 - $P3 = $P1.'isnull'() - if_null $P3, __label_4 - unless $P3 goto __label_4 -.annotate 'line', 6236 + $P5 = $P2.'isnull'() + if_null $P5, __label_4 + unless $P5 goto __label_4 __ARG_1.'emitnull'(__ARG_2) goto __label_5 __label_4: # else -.annotate 'line', 6238 - $P1.'emit'(__ARG_1, __ARG_2) + $P2.'emit'(__ARG_1, __ARG_2) __label_5: # endif -.annotate 'line', 6239 __ARG_1.'emitgoto'($S1) -.annotate 'line', 6240 __ARG_1.'emitlabel'($S2) -.annotate 'line', 6241 -# var efalse: $P2 - getattribute $P2, self, 'efalse' -.annotate 'line', 6242 - $P3 = $P2.'isnull'() - if_null $P3, __label_6 - unless $P3 goto __label_6 -.annotate 'line', 6243 + getattribute $P3, self, 'efalse' + $P5 = $P3.'isnull'() + if_null $P5, __label_6 + unless $P5 goto __label_6 __ARG_1.'emitnull'(__ARG_2) goto __label_7 __label_6: # else -# { -.annotate 'line', 6245 -# tfalse: $S4 - $P4 = $P2.'checkresult'() + $P6 = $P3.'checkresult'() null $S4 - if_null $P4, __label_8 - set $S4, $P4 + if_null $P6, __label_8 + set $S4, $P6 __label_8: -.annotate 'line', 6246 iseq $I1, $S3, 'P' unless $I1 goto __label_11 isne $I1, $S4, 'P' __label_11: unless $I1 goto __label_9 -# { -.annotate 'line', 6247 -# r: $S5 - $P3 = $P2.'emit_get'(__ARG_1) + $P5 = $P3.'emit_get'(__ARG_1) null $S5 - if_null $P3, __label_12 - set $S5, $P3 + if_null $P5, __label_12 + set $S5, $P5 __label_12: -.annotate 'line', 6248 __ARG_1.'emitbox'(__ARG_2, $S5) -# } goto __label_10 __label_9: # else -.annotate 'line', 6251 - $P2.'emit'(__ARG_1, __ARG_2) + ne $S4, 'P', __label_13 + $P4 = $P3.'emit_get'(__ARG_1) + __ARG_1.'emitset'(__ARG_2, $P4) + goto __label_14 + __label_13: # else + $P3.'emit'(__ARG_1, __ARG_2) + __label_14: # endif __label_10: # endif -# } __label_7: # endif -.annotate 'line', 6253 __ARG_1.'emitlabel'($S1) -# } -.annotate 'line', 6254 .end # emit + +.sub 'emit_void' :method + .param pmc __ARG_1 + getattribute $P1, self, 'owner' + $P2 = $P1.'genlabel'() + null $S1 + if_null $P2, __label_1 + set $S1, $P2 + __label_1: + $P2 = $P1.'genlabel'() + null $S2 + if_null $P2, __label_2 + set $S2, $P2 + __label_2: + getattribute $P2, self, 'condition' + $P2.'emit_else'(__ARG_1, $S2) + getattribute $P2, self, 'etrue' + $P2.'emit_void'(__ARG_1) + __ARG_1.'emitgoto'($S1) + __ARG_1.'emitlabel'($S2) + getattribute $P2, self, 'efalse' + $P2.'emit_void'(__ARG_1) + __ARG_1.'emitlabel'($S1) + +.end # emit_void + .sub Winxed_class_init :anon :load :init newclass $P0, [ 'Winxed'; 'Compiler'; 'OpConditionalExpr' ] -.annotate 'line', 6188 get_class $P1, [ 'Winxed'; 'Compiler'; 'Expr' ] addparent $P0, $P1 -.annotate 'line', 6194 addattribute $P0, 'condition' -.annotate 'line', 6195 addattribute $P0, 'etrue' -.annotate 'line', 6196 addattribute $P0, 'efalse' .end .namespace [ 'Winxed'; 'Compiler' ] -# Constant Code_none evaluated at compile time -# Constant Code_paren evaluated at compile time -# Constant Code_bracket evaluated at compile time -# Constant Code_dot evaluated at compile time -# Constant Code_assign evaluated at compile time -# Constant Code_assign_to evaluated at compile time -# Constant Code_add_assign evaluated at compile time -# Constant Code_add evaluated at compile time -# Constant Code_minus evaluated at compile time -# Constant Code_inc evaluated at compile time -# Constant Code_dec evaluated at compile time -# Constant Code_not evaluated at compile time -# Constant Code_equal evaluated at compile time -# Constant Code_not_equal evaluated at compile time -# Constant Code_less evaluated at compile time -# Constant Code_less_equal evaluated at compile time -# Constant Code_greater evaluated at compile time -# Constant Code_greater_equal evaluated at compile time -# Constant Code_sub_assign evaluated at compile time -# Constant Code_mul evaluated at compile time -# Constant Code_div evaluated at compile time -# Constant Code_mod evaluated at compile time -# Constant Code_cmod evaluated at compile time -# Constant Code_mul_assign evaluated at compile time -# Constant Code_div_assign evaluated at compile time -# Constant Code_same evaluated at compile time -# Constant Code_not_same evaluated at compile time -# Constant Code_instanceof evaluated at compile time -# Constant Code_shiftleft evaluated at compile time -# Constant Code_shiftright evaluated at compile time -# Constant Code_mod_assign evaluated at compile time -# Constant Code_delete evaluated at compile time -# Constant Code_exists evaluated at compile time - -.sub 'getOpCode_2' :subid('WSubId_71') - .param pmc __ARG_1 -# Body -# { -# switch -.annotate 'line', 6298 + +.sub 'getOpCode_2' :subid('WSubId_102') + .param pmc __ARG_1 $P1 = __ARG_1.'checkop'() set $S1, $P1 - set $S2, '(' - if $S1 == $S2 goto __label_3 - set $S2, '[' - if $S1 == $S2 goto __label_4 - set $S2, '.' - if $S1 == $S2 goto __label_5 - goto __label_2 + if_null $S1, __label_1 + length $I1, $S1 + ne $I1, 1, __label_1 + ord $I1, $S1 + if $I1 == 40 goto __label_3 + if $I1 == 91 goto __label_4 + if $I1 == 46 goto __label_5 + goto __label_1 __label_3: # case -.annotate 'line', 6299 .return(1) __label_4: # case -.annotate 'line', 6300 .return(2) __label_5: # case -.annotate 'line', 6301 .return(3) - __label_2: # default -.annotate 'line', 6302 + __label_1: # default .return(0) - __label_1: # switch end -# } -.annotate 'line', 6304 + __label_2: # switch end .end # getOpCode_2 -.sub 'getOpCode_4' :subid('WSubId_73') +.sub 'getOpCode_4' :subid('WSubId_104') .param pmc __ARG_1 -# Body -# { -# switch -.annotate 'line', 6308 $P1 = __ARG_1.'checkop'() set $S1, $P1 - set $S2, '-' - if $S1 == $S2 goto __label_3 - set $S2, '!' - if $S1 == $S2 goto __label_4 - set $S2, '++' - if $S1 == $S2 goto __label_5 - set $S2, '--' - if $S1 == $S2 goto __label_6 - goto __label_2 + if $S1 == '-' goto __label_3 + if $S1 == '!' goto __label_4 + if $S1 == '~' goto __label_5 + if $S1 == '++' goto __label_6 + if $S1 == '--' goto __label_7 + goto __label_1 __label_3: # case -.annotate 'line', 6309 .return(8) __label_4: # case -.annotate 'line', 6310 .return(11) __label_5: # case -.annotate 'line', 6311 - .return(9) + .return(34) __label_6: # case -.annotate 'line', 6312 + .return(9) + __label_7: # case .return(10) - __label_2: # default -.annotate 'line', 6314 + __label_1: # default $P2 = __ARG_1.'iskeyword'('delete') - if_null $P2, __label_7 - unless $P2 goto __label_7 - .return(31) - goto __label_8 - __label_7: # else -.annotate 'line', 6315 - $P3 = __ARG_1.'iskeyword'('exists') - if_null $P3, __label_9 - unless $P3 goto __label_9 + if_null $P2, __label_8 + unless $P2 goto __label_8 .return(32) - goto __label_10 - __label_9: # else -.annotate 'line', 6316 + goto __label_9 + __label_8: # else + $P3 = __ARG_1.'iskeyword'('exists') + if_null $P3, __label_10 + unless $P3 goto __label_10 + .return(33) + goto __label_11 + __label_10: # else .return(0) - __label_10: # endif - __label_8: # endif - __label_1: # switch end -# } -.annotate 'line', 6318 + __label_11: # endif + __label_9: # endif + __label_2: # switch end .end # getOpCode_4 -.sub 'getOpCode_5' :subid('WSubId_76') +.sub 'getOpCode_5' :subid('WSubId_107') .param pmc __ARG_1 -# Body -# { -# switch -.annotate 'line', 6322 $P1 = __ARG_1.'checkop'() set $S1, $P1 - set $S2, '*' - if $S1 == $S2 goto __label_3 - set $S2, '/' - if $S1 == $S2 goto __label_4 - set $S2, '%' - if $S1 == $S2 goto __label_5 - set $S2, '%%' - if $S1 == $S2 goto __label_6 - goto __label_2 + if $S1 == '*' goto __label_3 + if $S1 == '/' goto __label_4 + if $S1 == '%' goto __label_5 + if $S1 == '%%' goto __label_6 + goto __label_1 __label_3: # case -.annotate 'line', 6323 .return(19) __label_4: # case -.annotate 'line', 6324 .return(20) __label_5: # case -.annotate 'line', 6325 .return(21) __label_6: # case -.annotate 'line', 6326 .return(22) - __label_2: # default -.annotate 'line', 6327 + __label_1: # default .return(0) - __label_1: # switch end -# } -.annotate 'line', 6329 + __label_2: # switch end .end # getOpCode_5 -.sub 'getOpCode_7' :subid('WSubId_79') +.sub 'getOpCode_7' :subid('WSubId_110') .param pmc __ARG_1 -# Body -# { -# switch -.annotate 'line', 6333 $P1 = __ARG_1.'checkop'() set $S1, $P1 - set $S2, '<<' - if $S1 == $S2 goto __label_3 - set $S2, '>>' - if $S1 == $S2 goto __label_4 - goto __label_2 + if $S1 == '<<' goto __label_3 + if $S1 == '>>' goto __label_4 + if $S1 == '>>>' goto __label_5 + goto __label_1 __label_3: # case -.annotate 'line', 6334 .return(28) __label_4: # case -.annotate 'line', 6335 .return(29) - __label_2: # default -.annotate 'line', 6336 + __label_5: # case + .return(30) + __label_1: # default .return(0) - __label_1: # switch end -# } -.annotate 'line', 6338 + __label_2: # switch end .end # getOpCode_7 -.sub 'getOpCode_8' :subid('WSubId_81') +.sub 'getOpCode_8' :subid('WSubId_112') .param pmc __ARG_1 -# Body -# { -# switch -.annotate 'line', 6342 $P1 = __ARG_1.'checkop'() set $S1, $P1 - set $S2, '<' - if $S1 == $S2 goto __label_3 - set $S2, '>' - if $S1 == $S2 goto __label_4 - set $S2, '<=' - if $S1 == $S2 goto __label_5 - set $S2, '>=' - if $S1 == $S2 goto __label_6 - goto __label_2 + if $S1 == '<' goto __label_3 + if $S1 == '>' goto __label_4 + if $S1 == '<=' goto __label_5 + if $S1 == '>=' goto __label_6 + goto __label_1 __label_3: # case -.annotate 'line', 6343 .return(14) __label_4: # case -.annotate 'line', 6344 .return(16) __label_5: # case -.annotate 'line', 6345 .return(15) __label_6: # case -.annotate 'line', 6346 .return(17) - __label_2: # default -.annotate 'line', 6348 + __label_1: # default $P2 = __ARG_1.'iskeyword'('instanceof') if_null $P2, __label_7 unless $P2 goto __label_7 .return(27) goto __label_8 __label_7: # else -.annotate 'line', 6349 .return(0) __label_8: # endif - __label_1: # switch end -# } -.annotate 'line', 6351 + __label_2: # switch end .end # getOpCode_8 -.sub 'getOpCode_9' :subid('WSubId_83') +.sub 'getOpCode_9' :subid('WSubId_114') .param pmc __ARG_1 -# Body -# { -# switch -.annotate 'line', 6355 $P1 = __ARG_1.'checkop'() set $S1, $P1 - set $S2, '==' - if $S1 == $S2 goto __label_3 - set $S2, '!=' - if $S1 == $S2 goto __label_4 - set $S2, '===' - if $S1 == $S2 goto __label_5 - set $S2, '!==' - if $S1 == $S2 goto __label_6 - goto __label_2 + if $S1 == '==' goto __label_3 + if $S1 == '!=' goto __label_4 + if $S1 == '===' goto __label_5 + if $S1 == '!==' goto __label_6 + goto __label_1 __label_3: # case -.annotate 'line', 6356 .return(12) __label_4: # case -.annotate 'line', 6357 .return(13) __label_5: # case -.annotate 'line', 6358 .return(25) __label_6: # case -.annotate 'line', 6359 .return(26) - __label_2: # default -.annotate 'line', 6360 + __label_1: # default .return(0) - __label_1: # switch end -# } -.annotate 'line', 6362 + __label_2: # switch end .end # getOpCode_9 -.sub 'getOpCode_16' :subid('WSubId_92') +.sub 'getOpCode_16' :subid('WSubId_123') .param pmc __ARG_1 -# Body -# { -# switch -.annotate 'line', 6366 $P1 = __ARG_1.'checkop'() set $S1, $P1 - set $S2, '=' - if $S1 == $S2 goto __label_3 - set $S2, '=:' - if $S1 == $S2 goto __label_4 - set $S2, '+=' - if $S1 == $S2 goto __label_5 - set $S2, '-=' - if $S1 == $S2 goto __label_6 - set $S2, '*=' - if $S1 == $S2 goto __label_7 - set $S2, '/=' - if $S1 == $S2 goto __label_8 - set $S2, '%=' - if $S1 == $S2 goto __label_9 - goto __label_2 + if $S1 == '=' goto __label_3 + if $S1 == '=:' goto __label_4 + if $S1 == '+=' goto __label_5 + if $S1 == '-=' goto __label_6 + if $S1 == '*=' goto __label_7 + if $S1 == '/=' goto __label_8 + if $S1 == '%=' goto __label_9 + goto __label_1 __label_3: # case -.annotate 'line', 6367 .return(4) __label_4: # case -.annotate 'line', 6368 .return(5) __label_5: # case -.annotate 'line', 6369 .return(6) __label_6: # case -.annotate 'line', 6370 .return(18) __label_7: # case -.annotate 'line', 6371 .return(23) __label_8: # case -.annotate 'line', 6372 .return(24) __label_9: # case -.annotate 'line', 6373 - .return(30) - __label_2: # default -.annotate 'line', 6374 + .return(31) + __label_1: # default .return(0) - __label_1: # switch end -# } -.annotate 'line', 6376 + __label_2: # switch end .end # getOpCode_16 -.sub 'parseExpr_0' :subid('WSubId_70') +.sub 'parseExpr_0' :subid('WSubId_101') .param pmc __ARG_1 .param pmc __ARG_2 -.const 'Sub' WSubId_36 = "WSubId_36" -.const 'Sub' WSubId_53 = "WSubId_53" -.const 'Sub' WSubId_21 = "WSubId_21" -.const 'Sub' WSubId_69 = "WSubId_69" -.const 'Sub' WSubId_39 = "WSubId_39" -# Body -# { -.annotate 'line', 6380 -# var t: $P1 +.const 'Sub' WSubId_68 = "WSubId_68" +.const 'Sub' WSubId_84 = "WSubId_84" +.const 'Sub' WSubId_44 = "WSubId_44" +.const 'Sub' WSubId_100 = "WSubId_100" +.const 'Sub' WSubId_70 = "WSubId_70" $P1 = __ARG_1.'get'() -.annotate 'line', 6381 -# var expr: $P2 null $P2 -# switch-case -.annotate 'line', 6384 - $I1 = $P1.'isop'('(') + $P3 = $P1.'isop'('(') + set $I1, $P3 if $I1 goto __label_3 -.annotate 'line', 6388 - $I1 = $P1.'isop'('[') + $P4 = $P1.'isop'('[') + set $I1, $P4 if $I1 goto __label_4 -.annotate 'line', 6390 - $I1 = $P1.'isop'('{') + $P5 = $P1.'isop'('{') + set $I1, $P5 if $I1 goto __label_5 -.annotate 'line', 6392 - $I1 = $P1.'isstring'() + $P6 = $P1.'isstring'() + set $I1, $P6 if $I1 goto __label_6 -.annotate 'line', 6394 - $I1 = $P1.'isint'() + $P7 = $P1.'isint'() + set $I1, $P7 if $I1 goto __label_7 -.annotate 'line', 6396 - $I1 = $P1.'isfloat'() + $P8 = $P1.'isfloat'() + set $I1, $P8 if $I1 goto __label_8 -.annotate 'line', 6398 - $I1 = $P1.'iskeyword'('new') + $P9 = $P1.'iskeyword'('new') + set $I1, $P9 if $I1 goto __label_9 -.annotate 'line', 6400 - $I1 = $P1.'iskeyword'('function') + $P10 = $P1.'iskeyword'('function') + set $I1, $P10 if $I1 goto __label_10 -.annotate 'line', 6402 - $I1 = $P1.'iskeyword'('class') + $P11 = $P1.'iskeyword'('class') + set $I1, $P11 if $I1 goto __label_11 -.annotate 'line', 6404 - $I1 = $P1.'isidentifier'() + $P12 = $P1.'iskeyword'('namespace') + set $I1, $P12 if $I1 goto __label_12 + $P13 = $P1.'isidentifier'() + set $I1, $P13 + if $I1 goto __label_13 goto __label_2 __label_3: # case -.annotate 'line', 6385 - $P2 = WSubId_36(__ARG_1, __ARG_2) -.annotate 'line', 6386 - WSubId_53(')', __ARG_1) -.annotate 'line', 6387 + $P2 = WSubId_68(__ARG_1, __ARG_2) + WSubId_84(')', __ARG_1) .return($P2) __label_4: # case -.annotate 'line', 6389 - new $P4, [ 'Winxed'; 'Compiler'; 'ArrayExpr' ] - $P4.'ArrayExpr'(__ARG_1, __ARG_2, $P1) - set $P3, $P4 - .return($P3) + new $P15, [ 'Winxed'; 'Compiler'; 'ArrayExpr' ] + $P15.'ArrayExpr'(__ARG_1, __ARG_2, $P1) + set $P14, $P15 + .return($P14) __label_5: # case -.annotate 'line', 6391 - new $P6, [ 'Winxed'; 'Compiler'; 'HashExpr' ] - $P6.'HashExpr'(__ARG_1, __ARG_2, $P1) - set $P5, $P6 - .return($P5) + new $P17, [ 'Winxed'; 'Compiler'; 'HashExpr' ] + $P17.'HashExpr'(__ARG_1, __ARG_2, $P1) + set $P16, $P17 + .return($P16) __label_6: # case -.annotate 'line', 6393 - new $P8, [ 'Winxed'; 'Compiler'; 'StringLiteral' ] - $P8.'StringLiteral'(__ARG_2, $P1) - set $P7, $P8 - .return($P7) + new $P19, [ 'Winxed'; 'Compiler'; 'StringLiteral' ] + $P19.'StringLiteral'(__ARG_2, $P1) + set $P18, $P19 + .return($P18) __label_7: # case -.annotate 'line', 6395 - $P9 = $P1.'getintvalue'() - .tailcall WSubId_21(__ARG_2, $P1, $P9) + $P20 = $P1.'getintvalue'() + .tailcall WSubId_44(__ARG_2, $P1, $P20) __label_8: # case -.annotate 'line', 6397 - new $P11, [ 'Winxed'; 'Compiler'; 'FloatLiteral' ] - $P11.'FloatLiteral'(__ARG_2, $P1) - set $P10, $P11 - .return($P10) + new $P22, [ 'Winxed'; 'Compiler'; 'FloatLiteral' ] + $P22.'FloatLiteral'(__ARG_2, $P1) + set $P21, $P22 + .return($P21) __label_9: # case -.annotate 'line', 6399 - .tailcall WSubId_69(__ARG_1, __ARG_2, $P1) + .tailcall WSubId_100(__ARG_1, __ARG_2, $P1) __label_10: # case -.annotate 'line', 6401 - new $P13, [ 'Winxed'; 'Compiler'; 'FunctionExpr' ] - $P13.'FunctionExpr'(__ARG_1, __ARG_2, $P1) - set $P12, $P13 - .return($P12) + new $P24, [ 'Winxed'; 'Compiler'; 'FunctionExpr' ] + $P24.'FunctionExpr'(__ARG_1, __ARG_2, $P1) + set $P23, $P24 + .return($P23) __label_11: # case -.annotate 'line', 6403 - new $P15, [ 'Winxed'; 'Compiler'; 'OpClassExpr' ] - $P15.'OpClassExpr'(__ARG_1, __ARG_2, $P1) - set $P14, $P15 - .return($P14) + new $P26, [ 'Winxed'; 'Compiler'; 'OpClassExpr' ] + $P26.'OpClassExpr'(__ARG_1, __ARG_2, $P1) + set $P25, $P26 + .return($P25) __label_12: # case -.annotate 'line', 6405 - new $P17, [ 'Winxed'; 'Compiler'; 'IdentifierExpr' ] - $P17.'IdentifierExpr'(__ARG_2, $P1) - set $P16, $P17 - .return($P16) + new $P28, [ 'Winxed'; 'Compiler'; 'OpNamespaceExpr' ] + $P28.'OpNamespaceExpr'(__ARG_1, __ARG_2, $P1) + set $P27, $P28 + .return($P27) + __label_13: # case + new $P30, [ 'Winxed'; 'Compiler'; 'IdentifierExpr' ] + $P30.'IdentifierExpr'(__ARG_2, $P1) + set $P29, $P30 + .return($P29) __label_2: # default -.annotate 'line', 6407 - WSubId_39('expression', $P1) + WSubId_70('expression', $P1) __label_1: # switch end -# } -.annotate 'line', 6409 .end # parseExpr_0 -.sub 'parseExpr_2' :subid('WSubId_72') +.sub 'parseExpr_2' :subid('WSubId_103') .param pmc __ARG_1 .param pmc __ARG_2 -.const 'Sub' WSubId_70 = "WSubId_70" -.const 'Sub' WSubId_71 = "WSubId_71" -.const 'Sub' WSubId_6 = "WSubId_6" -# Body -# { -.annotate 'line', 6413 -# var subexp: $P1 - $P1 = WSubId_70(__ARG_1, __ARG_2) -.annotate 'line', 6414 -# var t: $P2 +.const 'Sub' WSubId_101 = "WSubId_101" +.const 'Sub' WSubId_102 = "WSubId_102" +.const 'Sub' WSubId_30 = "WSubId_30" + $P1 = WSubId_101(__ARG_1, __ARG_2) null $P2 -.annotate 'line', 6415 -# var start: $P3 null $P3 -.annotate 'line', 6416 -# code: $I1 null $I1 __label_2: # while -.annotate 'line', 6417 $P2 = __ARG_1.'get'() - $P5 = WSubId_71($P2) + $P5 = WSubId_102($P2) set $I1, $P5 - eq $I1, 0, __label_1 -# { -# switch -.annotate 'line', 6418 - set $I2, $I1 - set $I3, 1 - if $I2 == $I3 goto __label_5 - set $I3, 2 - if $I2 == $I3 goto __label_6 - set $I3, 3 - if $I2 == $I3 goto __label_7 - goto __label_4 + unless $I1 goto __label_1 + if $I1 == 1 goto __label_5 + if $I1 == 2 goto __label_6 + if $I1 == 3 goto __label_7 + goto __label_3 __label_5: # case -.annotate 'line', 6420 new $P6, [ 'Winxed'; 'Compiler'; 'CallExpr' ] $P6.'CallExpr'(__ARG_1, __ARG_2, $P2, $P1) set $P1, $P6 - goto __label_3 # break + goto __label_4 # break __label_6: # case -.annotate 'line', 6423 new $P7, [ 'Winxed'; 'Compiler'; 'IndexExpr' ] $P7.'IndexExpr'(__ARG_1, __ARG_2, $P2, $P1) set $P1, $P7 - goto __label_3 # break + goto __label_4 # break __label_7: # case -.annotate 'line', 6426 set $P3, $P2 -.annotate 'line', 6427 $P2 = __ARG_1.'get'() -.annotate 'line', 6428 $P8 = $P2.'isop'('*') if_null $P8, __label_8 unless $P8 goto __label_8 -# { -.annotate 'line', 6429 -# var right: $P4 - $P4 = WSubId_70(__ARG_1, __ARG_2) -.annotate 'line', 6430 + $P4 = WSubId_101(__ARG_1, __ARG_2) new $P5, [ 'Winxed'; 'Compiler'; 'MemberRefExpr' ] $P5.'MemberRefExpr'(__ARG_2, $P2, $P1, $P4) set $P1, $P5 -# } goto __label_9 __label_8: # else -.annotate 'line', 6433 new $P5, [ 'Winxed'; 'Compiler'; 'MemberExpr' ] $P5.'MemberExpr'(__ARG_2, $P3, $P1, $P2) set $P1, $P5 __label_9: # endif - goto __label_3 # break - __label_4: # default -.annotate 'line', 6436 - WSubId_6('Unexpected code in parseExpr_2') - __label_3: # switch end -# } + goto __label_4 # break + __label_3: # default + WSubId_30('Unexpected code in parseExpr_2') + __label_4: # switch end goto __label_2 __label_1: # endwhile -.annotate 'line', 6439 __ARG_1.'unget'($P2) -.annotate 'line', 6440 .return($P1) -# } -.annotate 'line', 6441 .end # parseExpr_2 -.sub 'parseExpr_3' :subid('WSubId_75') +.sub 'parseExpr_3' :subid('WSubId_106') .param pmc __ARG_1 .param pmc __ARG_2 -.const 'Sub' WSubId_72 = "WSubId_72" -# Body -# { -.annotate 'line', 6445 -# var subexp: $P1 - $P1 = WSubId_72(__ARG_1, __ARG_2) -.annotate 'line', 6446 -# var t: $P2 +.const 'Sub' WSubId_103 = "WSubId_103" + $P1 = WSubId_103(__ARG_1, __ARG_2) $P2 = __ARG_1.'get'() -# switch-case -.annotate 'line', 6448 - $I1 = $P2.'isop'('++') + $P3 = $P2.'isop'('++') + set $I1, $P3 if $I1 goto __label_3 -.annotate 'line', 6450 - $I1 = $P2.'isop'('--') + $P4 = $P2.'isop'('--') + set $I1, $P4 if $I1 goto __label_4 goto __label_2 __label_3: # case -.annotate 'line', 6449 - new $P4, [ 'Winxed'; 'Compiler'; 'OpPostIncExpr' ] - $P4.'OpPostIncExpr'(__ARG_2, $P2, $P1) - set $P3, $P4 - .return($P3) - __label_4: # case -.annotate 'line', 6451 - new $P6, [ 'Winxed'; 'Compiler'; 'OpPostDecExpr' ] - $P6.'OpPostDecExpr'(__ARG_2, $P2, $P1) + new $P6, [ 'Winxed'; 'Compiler'; 'OpPostIncExpr' ] + $P6.'OpPostIncExpr'(__ARG_2, $P2, $P1) set $P5, $P6 .return($P5) + __label_4: # case + new $P8, [ 'Winxed'; 'Compiler'; 'OpPostDecExpr' ] + $P8.'OpPostDecExpr'(__ARG_2, $P2, $P1) + set $P7, $P8 + .return($P7) __label_2: # default -.annotate 'line', 6453 __ARG_1.'unget'($P2) -.annotate 'line', 6454 .return($P1) __label_1: # switch end -# } -.annotate 'line', 6456 .end # parseExpr_3 -.sub 'parseExpr_4' :subid('WSubId_74') +.sub 'parseExpr_4' :subid('WSubId_105') .param pmc __ARG_1 .param pmc __ARG_2 -.const 'Sub' WSubId_73 = "WSubId_73" -.const 'Sub' WSubId_74 = "WSubId_74" -.const 'Sub' WSubId_6 = "WSubId_6" -.const 'Sub' WSubId_75 = "WSubId_75" -# Body -# { -.annotate 'line', 6460 -# var t: $P1 +.const 'Sub' WSubId_104 = "WSubId_104" +.const 'Sub' WSubId_105 = "WSubId_105" +.const 'Sub' WSubId_30 = "WSubId_30" +.const 'Sub' WSubId_106 = "WSubId_106" $P1 = __ARG_1.'get'() -.annotate 'line', 6461 -# code: $I1 - $P3 = WSubId_73($P1) + $P3 = WSubId_104($P1) set $I1, $P3 -.annotate 'line', 6462 - eq $I1, 0, __label_1 -# { -.annotate 'line', 6463 -# var subexpr: $P2 - $P2 = WSubId_74(__ARG_1, __ARG_2) -# switch -.annotate 'line', 6464 - set $I2, $I1 - set $I3, 8 - if $I2 == $I3 goto __label_5 - set $I3, 11 - if $I2 == $I3 goto __label_6 - set $I3, 9 - if $I2 == $I3 goto __label_7 - set $I3, 10 - if $I2 == $I3 goto __label_8 - set $I3, 31 - if $I2 == $I3 goto __label_9 - set $I3, 32 - if $I2 == $I3 goto __label_10 - goto __label_4 + unless $I1 goto __label_1 + $P2 = WSubId_105(__ARG_1, __ARG_2) + if $I1 == 8 goto __label_5 + if $I1 == 11 goto __label_6 + if $I1 == 34 goto __label_7 + if $I1 == 9 goto __label_8 + if $I1 == 10 goto __label_9 + if $I1 == 32 goto __label_10 + if $I1 == 33 goto __label_11 + goto __label_3 __label_5: # case -.annotate 'line', 6466 new $P4, [ 'Winxed'; 'Compiler'; 'OpUnaryMinusExpr' ] $P4.'OpUnaryMinusExpr'(__ARG_2, $P1, $P2) set $P3, $P4 .return($P3) __label_6: # case -.annotate 'line', 6468 new $P6, [ 'Winxed'; 'Compiler'; 'OpNotExpr' ] $P6.'OpNotExpr'(__ARG_2, $P1, $P2) set $P5, $P6 .return($P5) __label_7: # case -.annotate 'line', 6470 - new $P8, [ 'Winxed'; 'Compiler'; 'OpPreIncExpr' ] - $P8.'OpPreIncExpr'(__ARG_2, $P1, $P2) + new $P8, [ 'Winxed'; 'Compiler'; 'OpBinNotExpr' ] + $P8.'OpBinNotExpr'(__ARG_2, $P1, $P2) set $P7, $P8 .return($P7) __label_8: # case -.annotate 'line', 6472 - new $P10, [ 'Winxed'; 'Compiler'; 'OpPreDecExpr' ] - $P10.'OpPreDecExpr'(__ARG_2, $P1, $P2) + new $P10, [ 'Winxed'; 'Compiler'; 'OpPreIncExpr' ] + $P10.'OpPreIncExpr'(__ARG_2, $P1, $P2) set $P9, $P10 .return($P9) __label_9: # case -.annotate 'line', 6474 - new $P12, [ 'Winxed'; 'Compiler'; 'OpDeleteExpr' ] - $P12.'OpDeleteExpr'(__ARG_2, $P1, $P2) + new $P12, [ 'Winxed'; 'Compiler'; 'OpPreDecExpr' ] + $P12.'OpPreDecExpr'(__ARG_2, $P1, $P2) set $P11, $P12 .return($P11) __label_10: # case -.annotate 'line', 6476 - new $P14, [ 'Winxed'; 'Compiler'; 'OpExistsExpr' ] - $P14.'OpExistsExpr'(__ARG_2, $P1, $P2) + new $P14, [ 'Winxed'; 'Compiler'; 'OpDeleteExpr' ] + $P14.'OpDeleteExpr'(__ARG_2, $P1, $P2) set $P13, $P14 .return($P13) - __label_4: # default -.annotate 'line', 6478 - WSubId_6('Invalid code in parseExpr_4', $P1) - __label_3: # switch end -# } + __label_11: # case + new $P16, [ 'Winxed'; 'Compiler'; 'OpExistsExpr' ] + $P16.'OpExistsExpr'(__ARG_2, $P1, $P2) + set $P15, $P16 + .return($P15) + __label_3: # default + WSubId_30('Invalid code in parseExpr_4', $P1) + __label_4: # switch end goto __label_2 __label_1: # else -# { -.annotate 'line', 6482 __ARG_1.'unget'($P1) -.annotate 'line', 6483 - .tailcall WSubId_75(__ARG_1, __ARG_2) -# } + .tailcall WSubId_106(__ARG_1, __ARG_2) __label_2: # endif -# } -.annotate 'line', 6485 .end # parseExpr_4 -.sub 'parseExpr_5' :subid('WSubId_77') +.sub 'parseExpr_5' :subid('WSubId_108') .param pmc __ARG_1 .param pmc __ARG_2 -.const 'Sub' WSubId_74 = "WSubId_74" -.const 'Sub' WSubId_76 = "WSubId_76" -.const 'Sub' WSubId_6 = "WSubId_6" -# Body -# { -.annotate 'line', 6489 -# var lexpr: $P1 - $P1 = WSubId_74(__ARG_1, __ARG_2) -.annotate 'line', 6490 -# var t: $P2 +.const 'Sub' WSubId_105 = "WSubId_105" +.const 'Sub' WSubId_107 = "WSubId_107" +.const 'Sub' WSubId_30 = "WSubId_30" + $P1 = WSubId_105(__ARG_1, __ARG_2) null $P2 -.annotate 'line', 6491 -# code: $I1 null $I1 __label_2: # while -.annotate 'line', 6492 $P2 = __ARG_1.'get'() - $P4 = WSubId_76($P2) + $P4 = WSubId_107($P2) set $I1, $P4 - eq $I1, 0, __label_1 -# { -.annotate 'line', 6493 -# var rexpr: $P3 - $P3 = WSubId_74(__ARG_1, __ARG_2) -# switch -.annotate 'line', 6494 - set $I2, $I1 - set $I3, 19 - if $I2 == $I3 goto __label_5 - set $I3, 20 - if $I2 == $I3 goto __label_6 - set $I3, 21 - if $I2 == $I3 goto __label_7 - set $I3, 22 - if $I2 == $I3 goto __label_8 - goto __label_4 + unless $I1 goto __label_1 + $P3 = WSubId_105(__ARG_1, __ARG_2) + if $I1 == 19 goto __label_5 + if $I1 == 20 goto __label_6 + if $I1 == 21 goto __label_7 + if $I1 == 22 goto __label_8 + goto __label_3 __label_5: # case -.annotate 'line', 6496 new $P4, [ 'Winxed'; 'Compiler'; 'OpMulExpr' ] $P4.'OpMulExpr'(__ARG_2, $P2, $P1, $P3) set $P1, $P4 - goto __label_3 # break + goto __label_4 # break __label_6: # case -.annotate 'line', 6499 new $P5, [ 'Winxed'; 'Compiler'; 'OpDivExpr' ] $P5.'OpDivExpr'(__ARG_2, $P2, $P1, $P3) set $P1, $P5 - goto __label_3 # break + goto __label_4 # break __label_7: # case -.annotate 'line', 6502 new $P6, [ 'Winxed'; 'Compiler'; 'OpModExpr' ] $P6.'OpModExpr'(__ARG_2, $P2, $P1, $P3) set $P1, $P6 - goto __label_3 # break + goto __label_4 # break __label_8: # case -.annotate 'line', 6505 new $P7, [ 'Winxed'; 'Compiler'; 'OpCModExpr' ] $P7.'OpCModExpr'(__ARG_2, $P2, $P1, $P3) set $P1, $P7 - goto __label_3 # break - __label_4: # default -.annotate 'line', 6508 - WSubId_6('Invalid code in parseExpr_5', $P2) - __label_3: # switch end -# } + goto __label_4 # break + __label_3: # default + WSubId_30('Invalid code in parseExpr_5', $P2) + __label_4: # switch end goto __label_2 __label_1: # endwhile -.annotate 'line', 6511 __ARG_1.'unget'($P2) -.annotate 'line', 6512 .return($P1) -# } -.annotate 'line', 6513 .end # parseExpr_5 -.sub 'parseExpr_6' :subid('WSubId_78') +.sub 'parseExpr_6' :subid('WSubId_109') .param pmc __ARG_1 .param pmc __ARG_2 -.const 'Sub' WSubId_77 = "WSubId_77" -# Body -# { -.annotate 'line', 6517 -# var lexpr: $P1 - $P1 = WSubId_77(__ARG_1, __ARG_2) -.annotate 'line', 6518 -# var t: $P2 +.const 'Sub' WSubId_108 = "WSubId_108" + $P1 = WSubId_108(__ARG_1, __ARG_2) null $P2 __label_2: # while -.annotate 'line', 6519 $P2 = __ARG_1.'get'() - $I1 = $P2.'isop'('+') - if $I1 goto __label_3 - $I1 = $P2.'isop'('-') + $P5 = $P2.'isop'('+') + if $P5 goto __label_3 + $P5 = $P2.'isop'('-') __label_3: - unless $I1 goto __label_1 -# { -.annotate 'line', 6520 -# var rexpr: $P3 - $P3 = WSubId_77(__ARG_1, __ARG_2) -.annotate 'line', 6521 -# var expr: $P4 + if_null $P5, __label_1 + unless $P5 goto __label_1 + $P3 = WSubId_108(__ARG_1, __ARG_2) null $P4 -.annotate 'line', 6522 $P5 = $P2.'isop'('+') if_null $P5, __label_4 unless $P5 goto __label_4 -.annotate 'line', 6523 new $P6, [ 'Winxed'; 'Compiler'; 'OpAddExpr' ] $P6.'OpAddExpr'(__ARG_2, $P2, $P1, $P3) set $P4, $P6 goto __label_5 __label_4: # else -.annotate 'line', 6525 new $P7, [ 'Winxed'; 'Compiler'; 'OpSubExpr' ] $P7.'OpSubExpr'(__ARG_2, $P2, $P1, $P3) set $P4, $P7 __label_5: # endif -.annotate 'line', 6526 set $P1, $P4 -# } goto __label_2 __label_1: # endwhile -.annotate 'line', 6528 __ARG_1.'unget'($P2) -.annotate 'line', 6529 .return($P1) -# } -.annotate 'line', 6530 .end # parseExpr_6 -.sub 'parseExpr_7' :subid('WSubId_80') +.sub 'parseExpr_7' :subid('WSubId_111') .param pmc __ARG_1 .param pmc __ARG_2 -.const 'Sub' WSubId_78 = "WSubId_78" -.const 'Sub' WSubId_79 = "WSubId_79" -.const 'Sub' WSubId_6 = "WSubId_6" -# Body -# { -.annotate 'line', 6534 -# var lexpr: $P1 - $P1 = WSubId_78(__ARG_1, __ARG_2) -.annotate 'line', 6535 -# var rexpr: $P2 +.const 'Sub' WSubId_109 = "WSubId_109" +.const 'Sub' WSubId_110 = "WSubId_110" +.const 'Sub' WSubId_30 = "WSubId_30" + $P1 = WSubId_109(__ARG_1, __ARG_2) null $P2 -.annotate 'line', 6536 -# var t: $P3 null $P3 -.annotate 'line', 6537 -# code: $I1 null $I1 __label_2: # while -.annotate 'line', 6538 $P3 = __ARG_1.'get'() - $P4 = WSubId_79($P3) + $P4 = WSubId_110($P3) set $I1, $P4 - eq $I1, 0, __label_1 -# { -# switch -.annotate 'line', 6539 - set $I2, $I1 - set $I3, 28 - if $I2 == $I3 goto __label_5 - set $I3, 29 - if $I2 == $I3 goto __label_6 - goto __label_4 + unless $I1 goto __label_1 + if $I1 == 28 goto __label_5 + if $I1 == 29 goto __label_6 + if $I1 == 30 goto __label_7 + goto __label_3 __label_5: # case -.annotate 'line', 6541 - $P2 = WSubId_78(__ARG_1, __ARG_2) -.annotate 'line', 6542 + $P2 = WSubId_109(__ARG_1, __ARG_2) new $P5, [ 'Winxed'; 'Compiler'; 'OpShiftleftExpr' ] $P5.'OpShiftleftExpr'(__ARG_2, $P3, $P1, $P2) set $P1, $P5 - goto __label_3 # break + goto __label_4 # break __label_6: # case -.annotate 'line', 6545 - $P2 = WSubId_78(__ARG_1, __ARG_2) -.annotate 'line', 6546 + $P2 = WSubId_109(__ARG_1, __ARG_2) new $P6, [ 'Winxed'; 'Compiler'; 'OpShiftrightExpr' ] $P6.'OpShiftrightExpr'(__ARG_2, $P3, $P1, $P2) set $P1, $P6 - goto __label_3 # break - __label_4: # default -.annotate 'line', 6549 - WSubId_6('Invalid code in parseExpr_7', $P3) - __label_3: # switch end -# } + goto __label_4 # break + __label_7: # case + $P2 = WSubId_109(__ARG_1, __ARG_2) + new $P7, [ 'Winxed'; 'Compiler'; 'OpShiftlrightExpr' ] + $P7.'OpShiftlrightExpr'(__ARG_2, $P3, $P1, $P2) + set $P1, $P7 + goto __label_4 # break + __label_3: # default + WSubId_30('Invalid code in parseExpr_7', $P3) + __label_4: # switch end goto __label_2 __label_1: # endwhile -.annotate 'line', 6552 __ARG_1.'unget'($P3) -.annotate 'line', 6553 .return($P1) -# } -.annotate 'line', 6554 .end # parseExpr_7 -.sub 'parseExpr_8' :subid('WSubId_82') +.sub 'parseExpr_8' :subid('WSubId_113') .param pmc __ARG_1 .param pmc __ARG_2 -.const 'Sub' WSubId_80 = "WSubId_80" -.const 'Sub' WSubId_81 = "WSubId_81" -.const 'Sub' WSubId_6 = "WSubId_6" -# Body -# { -.annotate 'line', 6558 -# var lexpr: $P1 - $P1 = WSubId_80(__ARG_1, __ARG_2) -.annotate 'line', 6559 -# var rexpr: $P2 +.const 'Sub' WSubId_111 = "WSubId_111" +.const 'Sub' WSubId_112 = "WSubId_112" +.const 'Sub' WSubId_30 = "WSubId_30" + $P1 = WSubId_111(__ARG_1, __ARG_2) null $P2 -.annotate 'line', 6560 -# var t: $P3 null $P3 -.annotate 'line', 6561 -# code: $I1 null $I1 __label_2: # while -.annotate 'line', 6562 $P3 = __ARG_1.'get'() - $P4 = WSubId_81($P3) + $P4 = WSubId_112($P3) set $I1, $P4 - eq $I1, 0, __label_1 -# { -# switch -.annotate 'line', 6563 - set $I2, $I1 - set $I3, 14 - if $I2 == $I3 goto __label_5 - set $I3, 16 - if $I2 == $I3 goto __label_6 - set $I3, 15 - if $I2 == $I3 goto __label_7 - set $I3, 17 - if $I2 == $I3 goto __label_8 - set $I3, 27 - if $I2 == $I3 goto __label_9 - goto __label_4 + unless $I1 goto __label_1 + if $I1 == 14 goto __label_5 + if $I1 == 16 goto __label_6 + if $I1 == 15 goto __label_7 + if $I1 == 17 goto __label_8 + if $I1 == 27 goto __label_9 + goto __label_3 __label_5: # case -.annotate 'line', 6565 - $P2 = WSubId_80(__ARG_1, __ARG_2) -.annotate 'line', 6566 + $P2 = WSubId_111(__ARG_1, __ARG_2) new $P5, [ 'Winxed'; 'Compiler'; 'OpLessExpr' ] $P1 = $P5.'set'(__ARG_2, $P3, $P1, $P2) - goto __label_3 # break + goto __label_4 # break __label_6: # case -.annotate 'line', 6569 - $P2 = WSubId_80(__ARG_1, __ARG_2) -.annotate 'line', 6570 + $P2 = WSubId_111(__ARG_1, __ARG_2) new $P6, [ 'Winxed'; 'Compiler'; 'OpGreaterExpr' ] $P1 = $P6.'set'(__ARG_2, $P3, $P1, $P2) - goto __label_3 # break + goto __label_4 # break __label_7: # case -.annotate 'line', 6573 - $P2 = WSubId_80(__ARG_1, __ARG_2) -.annotate 'line', 6574 + $P2 = WSubId_111(__ARG_1, __ARG_2) new $P7, [ 'Winxed'; 'Compiler'; 'OpLessEqualExpr' ] $P1 = $P7.'set'(__ARG_2, $P3, $P1, $P2) - goto __label_3 # break + goto __label_4 # break __label_8: # case -.annotate 'line', 6577 - $P2 = WSubId_80(__ARG_1, __ARG_2) -.annotate 'line', 6578 + $P2 = WSubId_111(__ARG_1, __ARG_2) new $P8, [ 'Winxed'; 'Compiler'; 'OpGreaterEqualExpr' ] $P1 = $P8.'set'(__ARG_2, $P3, $P1, $P2) - goto __label_3 # break + goto __label_4 # break __label_9: # case -.annotate 'line', 6581 new $P9, [ 'Winxed'; 'Compiler'; 'OpInstanceOfExpr' ] $P9.'OpInstanceOfExpr'(__ARG_2, $P3, $P1, __ARG_1) set $P1, $P9 - goto __label_3 # break - __label_4: # default -.annotate 'line', 6584 - WSubId_6('Invalid code in parseExpr_9', $P3) - __label_3: # switch end -# } + goto __label_4 # break + __label_3: # default + WSubId_30('Invalid code in parseExpr_9', $P3) + __label_4: # switch end goto __label_2 __label_1: # endwhile -.annotate 'line', 6587 __ARG_1.'unget'($P3) -.annotate 'line', 6588 .return($P1) -# } -.annotate 'line', 6589 .end # parseExpr_8 -.sub 'parseExpr_9' :subid('WSubId_84') +.sub 'parseExpr_9' :subid('WSubId_115') .param pmc __ARG_1 .param pmc __ARG_2 -.const 'Sub' WSubId_82 = "WSubId_82" -.const 'Sub' WSubId_83 = "WSubId_83" -.const 'Sub' WSubId_6 = "WSubId_6" -# Body -# { -.annotate 'line', 6593 -# var lexpr: $P1 - $P1 = WSubId_82(__ARG_1, __ARG_2) -.annotate 'line', 6594 -# var rexpr: $P2 +.const 'Sub' WSubId_113 = "WSubId_113" +.const 'Sub' WSubId_114 = "WSubId_114" +.const 'Sub' WSubId_30 = "WSubId_30" + $P1 = WSubId_113(__ARG_1, __ARG_2) null $P2 -.annotate 'line', 6595 -# var t: $P3 null $P3 -.annotate 'line', 6596 -# code: $I1 null $I1 __label_2: # while -.annotate 'line', 6597 $P3 = __ARG_1.'get'() - $P4 = WSubId_83($P3) + $P4 = WSubId_114($P3) set $I1, $P4 - eq $I1, 0, __label_1 -# { -# switch -.annotate 'line', 6598 - set $I2, $I1 - set $I3, 12 - if $I2 == $I3 goto __label_5 - set $I3, 13 - if $I2 == $I3 goto __label_6 - set $I3, 25 - if $I2 == $I3 goto __label_7 - set $I3, 26 - if $I2 == $I3 goto __label_8 - goto __label_4 + unless $I1 goto __label_1 + if $I1 == 12 goto __label_5 + if $I1 == 13 goto __label_6 + if $I1 == 25 goto __label_7 + if $I1 == 26 goto __label_8 + goto __label_3 __label_5: # case -.annotate 'line', 6600 - $P2 = WSubId_82(__ARG_1, __ARG_2) -.annotate 'line', 6601 + $P2 = WSubId_113(__ARG_1, __ARG_2) new $P5, [ 'Winxed'; 'Compiler'; 'OpEqualExpr' ] - $P1 = $P5.'set'(__ARG_2, $P3, $P1, $P2) - goto __label_3 # break + $P5.'OpEqualExpr'(__ARG_2, $P3, $P1, $P2, 1) + set $P1, $P5 + goto __label_4 # break __label_6: # case -.annotate 'line', 6604 - $P2 = WSubId_82(__ARG_1, __ARG_2) -.annotate 'line', 6605 - new $P6, [ 'Winxed'; 'Compiler'; 'OpNotEqualExpr' ] - $P1 = $P6.'set'(__ARG_2, $P3, $P1, $P2) - goto __label_3 # break + $P2 = WSubId_113(__ARG_1, __ARG_2) + new $P6, [ 'Winxed'; 'Compiler'; 'OpEqualExpr' ] + $P6.'OpEqualExpr'(__ARG_2, $P3, $P1, $P2, 0) + set $P1, $P6 + goto __label_4 # break __label_7: # case -.annotate 'line', 6608 - $P2 = WSubId_82(__ARG_1, __ARG_2) -.annotate 'line', 6609 + $P2 = WSubId_113(__ARG_1, __ARG_2) new $P7, [ 'Winxed'; 'Compiler'; 'OpSameExpr' ] - $P7.'OpSameExpr'(1, __ARG_2, $P3, $P1, $P2) + $P7.'OpSameExpr'(__ARG_2, $P3, $P1, $P2, 1) set $P1, $P7 - goto __label_3 # break + goto __label_4 # break __label_8: # case -.annotate 'line', 6612 - $P2 = WSubId_82(__ARG_1, __ARG_2) -.annotate 'line', 6613 + $P2 = WSubId_113(__ARG_1, __ARG_2) new $P8, [ 'Winxed'; 'Compiler'; 'OpSameExpr' ] - $P8.'OpSameExpr'(0, __ARG_2, $P3, $P1, $P2) + $P8.'OpSameExpr'(__ARG_2, $P3, $P1, $P2, 0) set $P1, $P8 - goto __label_3 # break - __label_4: # default -.annotate 'line', 6616 - WSubId_6('Invalid code in parseExpr_8', $P3) - __label_3: # switch end -# } + goto __label_4 # break + __label_3: # default + WSubId_30('Invalid code in parseExpr_8', $P3) + __label_4: # switch end goto __label_2 __label_1: # endwhile -.annotate 'line', 6619 __ARG_1.'unget'($P3) -.annotate 'line', 6620 .return($P1) -# } -.annotate 'line', 6621 .end # parseExpr_9 -.sub 'parseExpr_10' :subid('WSubId_85') +.sub 'parseExpr_10' :subid('WSubId_116') .param pmc __ARG_1 .param pmc __ARG_2 -.const 'Sub' WSubId_84 = "WSubId_84" -# Body -# { -.annotate 'line', 6625 -# var lexpr: $P1 - $P1 = WSubId_84(__ARG_1, __ARG_2) -.annotate 'line', 6626 -# var t: $P2 +.const 'Sub' WSubId_115 = "WSubId_115" + $P1 = WSubId_115(__ARG_1, __ARG_2) null $P2 __label_2: # while -.annotate 'line', 6627 $P2 = __ARG_1.'get'() $P4 = $P2.'isop'('&') if_null $P4, __label_1 unless $P4 goto __label_1 -# { -.annotate 'line', 6628 -# var rexpr: $P3 - $P3 = WSubId_84(__ARG_1, __ARG_2) -.annotate 'line', 6629 + $P3 = WSubId_115(__ARG_1, __ARG_2) new $P4, [ 'Winxed'; 'Compiler'; 'OpBinAndExpr' ] $P4.'OpBinAndExpr'(__ARG_2, $P2, $P1, $P3) set $P1, $P4 -# } goto __label_2 __label_1: # endwhile -.annotate 'line', 6631 __ARG_1.'unget'($P2) -.annotate 'line', 6632 .return($P1) -# } -.annotate 'line', 6633 .end # parseExpr_10 -.sub 'parseExpr_11' :subid('WSubId_86') +.sub 'parseExpr_11' :subid('WSubId_117') .param pmc __ARG_1 .param pmc __ARG_2 -.const 'Sub' WSubId_85 = "WSubId_85" -# Body -# { -.annotate 'line', 6637 -# var lexpr: $P1 - $P1 = WSubId_85(__ARG_1, __ARG_2) -.annotate 'line', 6638 -# var t: $P2 +.const 'Sub' WSubId_116 = "WSubId_116" + $P1 = WSubId_116(__ARG_1, __ARG_2) null $P2 __label_2: # while -.annotate 'line', 6639 $P2 = __ARG_1.'get'() $P4 = $P2.'isop'('^') if_null $P4, __label_1 unless $P4 goto __label_1 -# { -.annotate 'line', 6640 -# var rexpr: $P3 - $P3 = WSubId_85(__ARG_1, __ARG_2) -.annotate 'line', 6641 + $P3 = WSubId_116(__ARG_1, __ARG_2) new $P4, [ 'Winxed'; 'Compiler'; 'OpBinXorExpr' ] $P4.'OpBinXorExpr'(__ARG_2, $P2, $P1, $P3) set $P1, $P4 -# } goto __label_2 __label_1: # endwhile -.annotate 'line', 6643 __ARG_1.'unget'($P2) -.annotate 'line', 6644 .return($P1) -# } -.annotate 'line', 6645 .end # parseExpr_11 -.sub 'parseExpr_12' :subid('WSubId_87') +.sub 'parseExpr_12' :subid('WSubId_118') .param pmc __ARG_1 .param pmc __ARG_2 -.const 'Sub' WSubId_86 = "WSubId_86" -# Body -# { -.annotate 'line', 6649 -# var lexpr: $P1 - $P1 = WSubId_86(__ARG_1, __ARG_2) -.annotate 'line', 6650 -# var t: $P2 +.const 'Sub' WSubId_117 = "WSubId_117" + $P1 = WSubId_117(__ARG_1, __ARG_2) null $P2 __label_2: # while -.annotate 'line', 6651 $P2 = __ARG_1.'get'() $P4 = $P2.'isop'('|') if_null $P4, __label_1 unless $P4 goto __label_1 -# { -.annotate 'line', 6652 -# var rexpr: $P3 - $P3 = WSubId_86(__ARG_1, __ARG_2) -.annotate 'line', 6653 + $P3 = WSubId_117(__ARG_1, __ARG_2) new $P4, [ 'Winxed'; 'Compiler'; 'OpBinOrExpr' ] $P4.'OpBinOrExpr'(__ARG_2, $P2, $P1, $P3) set $P1, $P4 -# } goto __label_2 __label_1: # endwhile -.annotate 'line', 6655 __ARG_1.'unget'($P2) -.annotate 'line', 6656 .return($P1) -# } -.annotate 'line', 6657 .end # parseExpr_12 -.sub 'parseExpr_13' :subid('WSubId_88') +.sub 'parseExpr_13' :subid('WSubId_119') .param pmc __ARG_1 .param pmc __ARG_2 -.const 'Sub' WSubId_87 = "WSubId_87" -# Body -# { -.annotate 'line', 6661 -# var lexpr: $P1 - $P1 = WSubId_87(__ARG_1, __ARG_2) -.annotate 'line', 6662 -# var t: $P2 +.const 'Sub' WSubId_118 = "WSubId_118" + $P1 = WSubId_118(__ARG_1, __ARG_2) null $P2 __label_2: # while -.annotate 'line', 6663 $P2 = __ARG_1.'get'() $P4 = $P2.'isop'('&&') if_null $P4, __label_1 unless $P4 goto __label_1 -# { -.annotate 'line', 6664 -# var rexpr: $P3 - $P3 = WSubId_87(__ARG_1, __ARG_2) -.annotate 'line', 6665 + $P3 = WSubId_118(__ARG_1, __ARG_2) new $P4, [ 'Winxed'; 'Compiler'; 'OpBoolAndExpr' ] $P4.'OpBoolAndExpr'(__ARG_2, $P2, $P1, $P3) set $P1, $P4 -# } goto __label_2 __label_1: # endwhile -.annotate 'line', 6667 __ARG_1.'unget'($P2) -.annotate 'line', 6668 .return($P1) -# } -.annotate 'line', 6669 .end # parseExpr_13 -.sub 'parseExpr_14' :subid('WSubId_89') +.sub 'parseExpr_14' :subid('WSubId_120') .param pmc __ARG_1 .param pmc __ARG_2 -.const 'Sub' WSubId_88 = "WSubId_88" -.const 'Sub' WSubId_87 = "WSubId_87" -# Body -# { -.annotate 'line', 6673 -# var lexpr: $P1 - $P1 = WSubId_88(__ARG_1, __ARG_2) -.annotate 'line', 6674 -# var t: $P2 +.const 'Sub' WSubId_119 = "WSubId_119" +.const 'Sub' WSubId_118 = "WSubId_118" + $P1 = WSubId_119(__ARG_1, __ARG_2) null $P2 __label_2: # while -.annotate 'line', 6675 $P2 = __ARG_1.'get'() $P4 = $P2.'isop'('||') if_null $P4, __label_1 unless $P4 goto __label_1 -# { -.annotate 'line', 6676 -# var rexpr: $P3 - $P3 = WSubId_87(__ARG_1, __ARG_2) -.annotate 'line', 6677 + $P3 = WSubId_118(__ARG_1, __ARG_2) new $P4, [ 'Winxed'; 'Compiler'; 'OpBoolOrExpr' ] $P4.'OpBoolOrExpr'(__ARG_2, $P2, $P1, $P3) set $P1, $P4 -# } goto __label_2 __label_1: # endwhile -.annotate 'line', 6679 __ARG_1.'unget'($P2) -.annotate 'line', 6680 .return($P1) -# } -.annotate 'line', 6681 .end # parseExpr_14 -.sub 'parseExpr_15' :subid('WSubId_91') +.sub 'parseExpr_15' :subid('WSubId_122') .param pmc __ARG_1 .param pmc __ARG_2 -.const 'Sub' WSubId_89 = "WSubId_89" -.const 'Sub' WSubId_90 = "WSubId_90" -.const 'Sub' WSubId_53 = "WSubId_53" -# Body -# { -.annotate 'line', 6685 -# var econd: $P1 - $P1 = WSubId_89(__ARG_1, __ARG_2) -.annotate 'line', 6686 -# var t: $P2 +.const 'Sub' WSubId_120 = "WSubId_120" +.const 'Sub' WSubId_121 = "WSubId_121" +.const 'Sub' WSubId_84 = "WSubId_84" + $P1 = WSubId_120(__ARG_1, __ARG_2) $P2 = __ARG_1.'get'() -.annotate 'line', 6687 $P5 = $P2.'isop'('?') if_null $P5, __label_1 unless $P5 goto __label_1 -# { -.annotate 'line', 6688 -# var etrue: $P3 - $P3 = WSubId_90(__ARG_1, __ARG_2) -.annotate 'line', 6689 - WSubId_53(':', __ARG_1) -.annotate 'line', 6690 -# var efalse: $P4 - $P4 = WSubId_90(__ARG_1, __ARG_2) -.annotate 'line', 6691 + $P3 = WSubId_121(__ARG_1, __ARG_2) + WSubId_84(':', __ARG_1) + $P4 = WSubId_121(__ARG_1, __ARG_2) new $P6, [ 'Winxed'; 'Compiler'; 'OpConditionalExpr' ] $P6.'OpConditionalExpr'(__ARG_2, $P2, $P1, $P3, $P4) set $P5, $P6 .return($P5) -# } goto __label_2 __label_1: # else -# { -.annotate 'line', 6694 __ARG_1.'unget'($P2) -.annotate 'line', 6695 .return($P1) -# } __label_2: # endif -# } -.annotate 'line', 6697 .end # parseExpr_15 -.sub 'parseExpr_16' :subid('WSubId_90') +.sub 'parseExpr_16' :subid('WSubId_121') .param pmc __ARG_1 .param pmc __ARG_2 -.const 'Sub' WSubId_91 = "WSubId_91" -.const 'Sub' WSubId_92 = "WSubId_92" -.const 'Sub' WSubId_90 = "WSubId_90" -.const 'Sub' WSubId_6 = "WSubId_6" -# Body -# { -.annotate 'line', 6701 -# var lexpr: $P1 - $P1 = WSubId_91(__ARG_1, __ARG_2) -.annotate 'line', 6702 -# var t: $P2 +.const 'Sub' WSubId_122 = "WSubId_122" +.const 'Sub' WSubId_123 = "WSubId_123" +.const 'Sub' WSubId_121 = "WSubId_121" +.const 'Sub' WSubId_30 = "WSubId_30" + $P1 = WSubId_122(__ARG_1, __ARG_2) null $P2 -.annotate 'line', 6703 -# code: $I1 null $I1 __label_2: # while -.annotate 'line', 6704 $P2 = __ARG_1.'get'() - $P5 = WSubId_92($P2) + $P5 = WSubId_123($P2) set $I1, $P5 - eq $I1, 0, __label_1 -# { -.annotate 'line', 6705 -# var rexpr: $P3 - $P3 = WSubId_90(__ARG_1, __ARG_2) -.annotate 'line', 6706 -# var expr: $P4 + unless $I1 goto __label_1 + $P3 = WSubId_121(__ARG_1, __ARG_2) null $P4 -# switch -.annotate 'line', 6707 - set $I2, $I1 - set $I3, 4 - if $I2 == $I3 goto __label_5 - set $I3, 5 - if $I2 == $I3 goto __label_6 - set $I3, 6 - if $I2 == $I3 goto __label_7 - set $I3, 18 - if $I2 == $I3 goto __label_8 - set $I3, 23 - if $I2 == $I3 goto __label_9 - set $I3, 24 - if $I2 == $I3 goto __label_10 - set $I3, 30 - if $I2 == $I3 goto __label_11 - goto __label_4 + if $I1 == 4 goto __label_5 + if $I1 == 5 goto __label_6 + if $I1 == 6 goto __label_7 + if $I1 == 18 goto __label_8 + if $I1 == 23 goto __label_9 + if $I1 == 24 goto __label_10 + if $I1 == 31 goto __label_11 + goto __label_3 __label_5: # case -.annotate 'line', 6709 new $P4, [ 'Winxed'; 'Compiler'; 'OpAssignExpr' ] - goto __label_3 # break + goto __label_4 # break __label_6: # case -.annotate 'line', 6712 new $P4, [ 'Winxed'; 'Compiler'; 'OpAssignToExpr' ] - goto __label_3 # break + goto __label_4 # break __label_7: # case -.annotate 'line', 6715 new $P4, [ 'Winxed'; 'Compiler'; 'OpAddToExpr' ] - goto __label_3 # break + goto __label_4 # break __label_8: # case -.annotate 'line', 6718 new $P4, [ 'Winxed'; 'Compiler'; 'OpSubToExpr' ] - goto __label_3 # break + goto __label_4 # break __label_9: # case -.annotate 'line', 6721 new $P4, [ 'Winxed'; 'Compiler'; 'OpMulToExpr' ] - goto __label_3 # break + goto __label_4 # break __label_10: # case -.annotate 'line', 6724 new $P4, [ 'Winxed'; 'Compiler'; 'OpDivToExpr' ] - goto __label_3 # break + goto __label_4 # break __label_11: # case -.annotate 'line', 6727 new $P4, [ 'Winxed'; 'Compiler'; 'OpModToExpr' ] - goto __label_3 # break - __label_4: # default -.annotate 'line', 6730 - WSubId_6('Unexpected code in parseExpr_16', $P2) - __label_3: # switch end -.annotate 'line', 6732 + goto __label_4 # break + __label_3: # default + WSubId_30('Unexpected code in parseExpr_16', $P2) + __label_4: # switch end $P4.'set'(__ARG_2, $P2, $P1, $P3) -.annotate 'line', 6733 set $P1, $P4 -# } goto __label_2 __label_1: # endwhile -.annotate 'line', 6735 __ARG_1.'unget'($P2) -.annotate 'line', 6736 .return($P1) -# } -.annotate 'line', 6737 .end # parseExpr_16 -.sub 'parseExpr' :subid('WSubId_36') +.sub 'parseExpr' :subid('WSubId_68') .param pmc __ARG_1 .param pmc __ARG_2 -.const 'Sub' WSubId_90 = "WSubId_90" -# Body -# { -.annotate 'line', 6741 - .tailcall WSubId_90(__ARG_1, __ARG_2) -# } -.annotate 'line', 6742 +.const 'Sub' WSubId_121 = "WSubId_121" + .tailcall WSubId_121(__ARG_1, __ARG_2) .end # parseExpr .namespace [ 'Winxed'; 'Compiler'; 'Breakable' ] .sub 'genbreaklabel' :method -.const 'Sub' WSubId_6 = "WSubId_6" -# Body -# { -.annotate 'line', 6757 +.const 'Sub' WSubId_30 = "WSubId_30" getattribute $P1, self, 'brlabel' if_null $P1, __label_1 -.annotate 'line', 6758 - WSubId_6('attempt to generate break label twice') + WSubId_30('attempt to generate break label twice') __label_1: # endif -.annotate 'line', 6759 -# label: $S1 $P1 = self.'genlabel'() null $S1 if_null $P1, __label_2 set $S1, $P1 __label_2: -.annotate 'line', 6760 box $P1, $S1 setattribute self, 'brlabel', $P1 -.annotate 'line', 6761 .return($S1) -# } -.annotate 'line', 6762 .end # genbreaklabel .sub 'getbreaklabel' :method .param pmc __ARG_1 -.const 'Sub' WSubId_6 = "WSubId_6" -# Body -# { -.annotate 'line', 6765 -# var label: $P1 +.const 'Sub' WSubId_30 = "WSubId_30" getattribute $P1, self, 'brlabel' -.annotate 'line', 6766 unless_null $P1, __label_1 -.annotate 'line', 6767 - WSubId_6('attempt to get break label before creating it') + WSubId_30('attempt to get break label before creating it') __label_1: # endif -.annotate 'line', 6768 .return($P1) -# } -.annotate 'line', 6769 .end # getbreaklabel .sub Winxed_class_init :anon :load :init newclass $P0, [ 'Winxed'; 'Compiler'; 'Breakable' ] -.annotate 'line', 6753 addattribute $P0, 'brlabel' .end .namespace [ 'Winxed'; 'Compiler'; 'Continuable' ] .sub 'gencontinuelabel' :method -.const 'Sub' WSubId_6 = "WSubId_6" -# Body -# { -.annotate 'line', 6778 +.const 'Sub' WSubId_30 = "WSubId_30" getattribute $P1, self, 'cntlabel' if_null $P1, __label_1 -.annotate 'line', 6779 - WSubId_6('attempt to generate continue label twice') + WSubId_30('attempt to generate continue label twice') __label_1: # endif -.annotate 'line', 6780 -# label: $S1 $P1 = self.'genlabel'() null $S1 if_null $P1, __label_2 set $S1, $P1 __label_2: -.annotate 'line', 6781 box $P1, $S1 setattribute self, 'cntlabel', $P1 -.annotate 'line', 6782 .return($S1) -# } -.annotate 'line', 6783 .end # gencontinuelabel .sub 'getcontinuelabel' :method .param pmc __ARG_1 -.const 'Sub' WSubId_6 = "WSubId_6" -# Body -# { -.annotate 'line', 6786 -# var label: $P1 +.const 'Sub' WSubId_30 = "WSubId_30" getattribute $P1, self, 'cntlabel' -.annotate 'line', 6787 unless_null $P1, __label_1 -.annotate 'line', 6788 - WSubId_6('attempt to get continue label before creating it') + WSubId_30('attempt to get continue label before creating it') __label_1: # endif -.annotate 'line', 6789 .return($P1) -# } -.annotate 'line', 6790 .end # getcontinuelabel .sub Winxed_class_init :anon :load :init newclass $P0, [ 'Winxed'; 'Compiler'; 'Continuable' ] -.annotate 'line', 6772 get_class $P1, [ 'Winxed'; 'Compiler'; 'Breakable' ] addparent $P0, $P1 -.annotate 'line', 6774 addattribute $P0, 'cntlabel' .end .namespace [ 'Winxed'; 'Compiler'; 'ReturnYieldStatement' ] @@ -20052,119 +15556,74 @@ .param pmc __ARG_1 .param pmc __ARG_2 .param pmc __ARG_3 -# Body -# { -.annotate 'line', 6806 self.'Statement'(__ARG_1, __ARG_3) -.annotate 'line', 6807 -# var t: $P1 $P1 = __ARG_2.'get'() -.annotate 'line', 6808 $P2 = $P1.'isop'(';') isfalse $I1, $P2 unless $I1 goto __label_1 -# { -.annotate 'line', 6809 __ARG_2.'unget'($P1) -.annotate 'line', 6810 new $P4, [ 'Winxed'; 'Compiler'; 'ArgumentList' ] $P4.'ArgumentList'(__ARG_3, __ARG_1, __ARG_2, ";") set $P3, $P4 setattribute self, 'values', $P3 -# } __label_1: # endif -# } -.annotate 'line', 6812 .end # parse .sub 'optimize' :method -# Body -# { -.annotate 'line', 6815 -# var values: $P1 getattribute $P1, self, 'values' -.annotate 'line', 6816 if_null $P1, __label_1 -.annotate 'line', 6817 $P1 = $P1.'optimize'() __label_1: # endif -.annotate 'line', 6818 .return(self) -# } -.annotate 'line', 6819 .end # optimize .sub 'emit' :method .param pmc __ARG_1 -# Body -# { -.annotate 'line', 6823 -# var values: $P1 getattribute $P1, self, 'values' -.annotate 'line', 6824 -# n: $I1 unless_null $P1, __label_2 null $I1 goto __label_1 __label_2: -# predefined int $P3 = $P1.'numargs'() set $I1, $P3 __label_1: -.annotate 'line', 6827 iseq $I2, $I1, 1 unless $I2 goto __label_4 isa $I2, self, [ 'Winxed'; 'Compiler'; 'ReturnStatement' ] __label_4: unless $I2 goto __label_3 -# { -.annotate 'line', 6828 -# var func: $P2 $P2 = $P1.'getfreearg'(0) -.annotate 'line', 6829 $P3 = $P2.'cantailcall'() + unless $P3 goto __label_6 + getattribute $P4, self, 'owner' + $P3 = $P4.'allowtailcall'() + __label_6: if_null $P3, __label_5 unless $P3 goto __label_5 -# { -.annotate 'line', 6830 self.'annotate'(__ARG_1) -.annotate 'line', 6831 .tailcall $P2.'emit'(__ARG_1, '.tailcall') -# } __label_5: # endif -# } __label_3: # endif -.annotate 'line', 6835 - le $I1, 0, __label_6 -.annotate 'line', 6836 + le $I1, 0, __label_7 $P1.'getargvalues'(__ARG_1) - __label_6: # endif -.annotate 'line', 6838 + __label_7: # endif self.'annotate'(__ARG_1) -.annotate 'line', 6839 self.'emitret'(__ARG_1) -.annotate 'line', 6840 - le $I1, 0, __label_7 -.annotate 'line', 6841 + le $I1, 0, __label_8 $P1.'emitargs'(__ARG_1) - __label_7: # endif -.annotate 'line', 6842 + __label_8: # endif __ARG_1.'say'(')') -# } -.annotate 'line', 6843 .end # emit .sub Winxed_class_init :anon :load :init newclass $P0, [ 'Winxed'; 'Compiler'; 'ReturnYieldStatement' ] -.annotate 'line', 6800 get_class $P1, [ 'Winxed'; 'Compiler'; 'Statement' ] addparent $P0, $P1 -.annotate 'line', 6802 addattribute $P0, 'values' .end .namespace [ 'Winxed'; 'Compiler'; 'ReturnStatement' ] @@ -20173,30 +15632,19 @@ .param pmc __ARG_1 .param pmc __ARG_2 .param pmc __ARG_3 -# Body -# { -.annotate 'line', 6850 self.'parse'(__ARG_1, __ARG_2, __ARG_3) -# } -.annotate 'line', 6851 .end # ReturnStatement .sub 'emitret' :method .param pmc __ARG_1 -# Body -# { -.annotate 'line', 6854 __ARG_1.'print'(' ', '.return(') -# } -.annotate 'line', 6855 .end # emitret .sub Winxed_class_init :anon :load :init newclass $P0, [ 'Winxed'; 'Compiler'; 'ReturnStatement' ] -.annotate 'line', 6846 get_class $P1, [ 'Winxed'; 'Compiler'; 'ReturnYieldStatement' ] addparent $P0, $P1 .end @@ -20206,90 +15654,199 @@ .param pmc __ARG_1 .param pmc __ARG_2 .param pmc __ARG_3 -# Body -# { -.annotate 'line', 6862 self.'parse'(__ARG_1, __ARG_2, __ARG_3) -# } -.annotate 'line', 6863 .end # YieldStatement +.sub 'clone' :method + .param pmc __ARG_1 +.const 'Sub' WSubId_25 = "WSubId_25" + WSubId_25("inlined yield not allowed", self) + +.end # clone + + .sub 'emitret' :method .param pmc __ARG_1 -# Body -# { -.annotate 'line', 6866 __ARG_1.'print'(' ', '.yield(') -# } -.annotate 'line', 6867 .end # emitret .sub Winxed_class_init :anon :load :init newclass $P0, [ 'Winxed'; 'Compiler'; 'YieldStatement' ] -.annotate 'line', 6858 get_class $P1, [ 'Winxed'; 'Compiler'; 'ReturnYieldStatement' ] addparent $P0, $P1 .end +.namespace [ 'Winxed'; 'Compiler'; 'InlineReturnStatement' ] + +.sub 'InlineReturnStatement' :method + .param pmc __ARG_1 + .param pmc __ARG_2 + .param pmc __ARG_3 +.const 'Sub' WSubId_68 = "WSubId_68" + self.'Statement'(__ARG_1, __ARG_3) + $P1 = __ARG_2.'get'() + __ARG_2.'unget'($P1) + $P2 = $P1.'isop'(";") + isfalse $I1, $P2 + unless $I1 goto __label_1 + $P4 = WSubId_68(__ARG_2, __ARG_3) + setattribute self, 'expr', $P4 + __label_1: # endif + +.end # InlineReturnStatement + + +.sub 'clone' :method + .param pmc __ARG_1 + new $P1, [ 'Winxed'; 'Compiler'; 'InlineReturnStatement' ] + getattribute $P3, self, 'start' + $P1.'Statement'($P3, __ARG_1) + getattribute $P2, self, 'expr' + if_null $P2, __label_1 + $P4 = $P2.'clone'(__ARG_1) + setattribute $P1, 'expr', $P4 + __label_1: # endif + .return($P1) + +.end # clone + + +.sub 'optimize' :method + getattribute $P1, self, 'expr' + if_null $P1, __label_1 + $P3 = $P1.'optimize'() + setattribute self, 'expr', $P3 + __label_1: # endif + .return(self) + +.end # optimize + + +.sub 'emit' :method + .param pmc __ARG_1 + getattribute $P4, self, 'owner' + $P1 = $P4.'getouter'() + getattribute $P2, self, 'expr' + $P4 = $P1.'getrettype'() + null $S1 + if_null $P4, __label_1 + set $S1, $P4 + __label_1: + self.'annotate'(__ARG_1) + if_null $P2, __label_2 + $P3 = $P1.'getretreg'() + unless_null $P3, __label_3 + $P2.'emit_void'(__ARG_1) + goto __label_4 + __label_3: # else + $P4 = $P2.'isnull'() + if_null $P4, __label_5 + unless $P4 goto __label_5 + __ARG_1.'emitnull'($P3) + goto __label_6 + __label_5: # else + $P5 = $P2.'checkresult'() + null $S2 + if_null $P5, __label_7 + set $S2, $P5 + __label_7: + ne $S2, $S1, __label_8 + $P2.'emit'(__ARG_1, $P3) + goto __label_9 + __label_8: # else + $P4 = $P2.'emit_get'(__ARG_1) + null $S3 + if_null $P4, __label_10 + set $S3, $P4 + __label_10: + self.'annotate'(__ARG_1) + ne $S1, 'P', __label_11 + __ARG_1.'emitbox'($P3, $S3) + goto __label_12 + __label_11: # else + __ARG_1.'emitset'($P3, $S3) + __label_12: # endif + __label_9: # endif + __label_6: # endif + __label_4: # endif + __label_2: # endif + $P4 = $P1.'getendlabel'() + null $S4 + if_null $P4, __label_13 + set $S4, $P4 + __label_13: + self.'annotate'(__ARG_1) + __ARG_1.'emitgoto'($S4) + +.end # emit + +.sub Winxed_class_init :anon :load :init + newclass $P0, [ 'Winxed'; 'Compiler'; 'InlineReturnStatement' ] + get_class $P1, [ 'Winxed'; 'Compiler'; 'Statement' ] + addparent $P0, $P1 + addattribute $P0, 'expr' +.end +.namespace [ 'Winxed'; 'Compiler' ] + +.sub 'parseReturn' :subid('WSubId_80') + .param pmc __ARG_1 + .param pmc __ARG_2 + .param pmc __ARG_3 + $P1 = __ARG_3.'getouter'() + isa $I1, $P1, [ 'Winxed'; 'Compiler'; 'InlineStatement' ] + unless $I1 goto __label_1 + new $P3, [ 'Winxed'; 'Compiler'; 'InlineReturnStatement' ] + $P3.'InlineReturnStatement'(__ARG_1, __ARG_2, __ARG_3) + set $P2, $P3 + .return($P2) + goto __label_2 + __label_1: # else + new $P5, [ 'Winxed'; 'Compiler'; 'ReturnStatement' ] + $P5.'ReturnStatement'(__ARG_1, __ARG_2, __ARG_3) + set $P4, $P5 + .return($P4) + __label_2: # endif + +.end # parseReturn + .namespace [ 'Winxed'; 'Compiler'; 'LabelStatement' ] .sub 'LabelStatement' :method .param pmc __ARG_1 .param pmc __ARG_2 -# Body -# { -.annotate 'line', 6880 self.'Statement'(__ARG_1, __ARG_2) -.annotate 'line', 6881 setattribute self, 'name', __ARG_1 -.annotate 'line', 6882 getattribute $P3, self, 'owner' $P2 = $P3.'createlabel'(__ARG_1) setattribute self, 'value', $P2 -# } -.annotate 'line', 6883 .end # LabelStatement .sub 'optimize' :method -# Body -# { -.annotate 'line', 6884 .return(self) -# } .end # optimize .sub 'emit' :method .param pmc __ARG_1 -# Body -# { -.annotate 'line', 6887 self.'annotate'(__ARG_1) -.annotate 'line', 6888 getattribute $P1, self, 'value' -# predefined string getattribute $P2, self, 'name' set $S1, $P2 concat $S2, 'label ', $S1 __ARG_1.'emitlabel'($P1, $S2) -# } -.annotate 'line', 6889 .end # emit .sub Winxed_class_init :anon :load :init newclass $P0, [ 'Winxed'; 'Compiler'; 'LabelStatement' ] -.annotate 'line', 6874 get_class $P1, [ 'Winxed'; 'Compiler'; 'Statement' ] addparent $P0, $P1 -.annotate 'line', 6876 addattribute $P0, 'name' -.annotate 'line', 6877 addattribute $P0, 'value' .end .namespace [ 'Winxed'; 'Compiler'; 'Reflabel' ] @@ -20297,60 +15854,39 @@ .sub 'Reflabel' :method .param pmc __ARG_1 .param string __ARG_2 -# Body -# { -.annotate 'line', 6903 setattribute self, 'owner', __ARG_1 -.annotate 'line', 6904 box $P1, __ARG_2 setattribute self, 'label', $P1 -# } -.annotate 'line', 6905 .end # Reflabel .sub 'optimize' :method -# Body -# { -.annotate 'line', 6906 .return(self) -# } .end # optimize .sub 'emit_get' :method .param pmc __ARG_1 -# Body -# { -.annotate 'line', 6909 -# label: $S1 getattribute $P1, self, 'label' null $S1 if_null $P1, __label_1 set $S1, $P1 __label_1: -.annotate 'line', 6910 -# value: $S2 getattribute $P2, self, 'owner' $P1 = $P2.'getlabel'($S1) null $S2 if_null $P1, __label_2 set $S2, $P1 __label_2: -.annotate 'line', 6911 .return($S2) -# } -.annotate 'line', 6912 .end # emit_get .sub Winxed_class_init :anon :load :init newclass $P0, [ 'Winxed'; 'Compiler'; 'Reflabel' ] -.annotate 'line', 6898 addattribute $P0, 'owner' -.annotate 'line', 6899 addattribute $P0, 'label' .end .namespace [ 'Winxed'; 'Compiler'; 'GotoStatement' ] @@ -20359,110 +15895,71 @@ .param pmc __ARG_1 .param pmc __ARG_2 .param pmc __ARG_3 -.const 'Sub' WSubId_93 = "WSubId_93" -.const 'Sub' WSubId_53 = "WSubId_53" -# Body -# { -.annotate 'line', 6925 +.const 'Sub' WSubId_124 = "WSubId_124" +.const 'Sub' WSubId_84 = "WSubId_84" self.'Statement'(__ARG_1, __ARG_3) -.annotate 'line', 6926 -# var t: $P1 $P1 = __ARG_2.'get'() -.annotate 'line', 6927 - WSubId_93($P1) -.annotate 'line', 6928 + WSubId_124($P1) setattribute self, 'label', $P1 -.annotate 'line', 6929 - WSubId_53(';', __ARG_2) -# } -.annotate 'line', 6930 + WSubId_84(';', __ARG_2) .end # GotoStatement .sub 'optimize' :method -# Body -# { -.annotate 'line', 6931 .return(self) -# } .end # optimize .sub 'emit' :method .param pmc __ARG_1 -# Body -# { -.annotate 'line', 6934 self.'annotate'(__ARG_1) -.annotate 'line', 6935 -# label: $S1 getattribute $P1, self, 'label' null $S1 if_null $P1, __label_1 set $S1, $P1 __label_1: -.annotate 'line', 6936 -# value: $S2 $P1 = self.'getlabel'($S1) null $S2 if_null $P1, __label_2 set $S2, $P1 __label_2: -.annotate 'line', 6937 concat $S3, 'goto ', $S1 __ARG_1.'emitgoto'($S2, $S3) -# } -.annotate 'line', 6938 .end # emit .sub Winxed_class_init :anon :load :init newclass $P0, [ 'Winxed'; 'Compiler'; 'GotoStatement' ] -.annotate 'line', 6919 get_class $P1, [ 'Winxed'; 'Compiler'; 'Statement' ] addparent $P0, $P1 -.annotate 'line', 6921 addattribute $P0, 'label' .end .namespace [ 'Winxed'; 'Compiler'; 'ConditionalStatement' ] .sub 'parseconditionshort' :method .param pmc __ARG_1 -.const 'Sub' WSubId_36 = "WSubId_36" -# Body -# { -.annotate 'line', 6949 - $P1 = WSubId_36(__ARG_1, self) +.const 'Sub' WSubId_68 = "WSubId_68" + $P1 = WSubId_68(__ARG_1, self) self.'set'($P1) -# } -.annotate 'line', 6950 .end # parseconditionshort .sub 'parsecondition' :method .param pmc __ARG_1 -.const 'Sub' WSubId_53 = "WSubId_53" -.const 'Sub' WSubId_36 = "WSubId_36" -# Body -# { -.annotate 'line', 6953 - WSubId_53('(', __ARG_1) -.annotate 'line', 6954 - $P1 = WSubId_36(__ARG_1, self) +.const 'Sub' WSubId_84 = "WSubId_84" +.const 'Sub' WSubId_68 = "WSubId_68" + WSubId_84('(', __ARG_1) + $P1 = WSubId_68(__ARG_1, self) self.'set'($P1) -.annotate 'line', 6955 - WSubId_53(')', __ARG_1) -# } -.annotate 'line', 6956 + WSubId_84(')', __ARG_1) .end # parsecondition .sub Winxed_class_init :anon :load :init newclass $P0, [ 'Winxed'; 'Compiler'; 'ConditionalStatement' ] -.annotate 'line', 6945 get_class $P1, [ 'Winxed'; 'Compiler'; 'Statement' ] addparent $P0, $P1 get_class $P2, [ 'Winxed'; 'Compiler'; 'Condition' ] @@ -20474,216 +15971,153 @@ .param pmc __ARG_1 .param pmc __ARG_2 .param pmc __ARG_3 -.const 'Sub' WSubId_94 = "WSubId_94" -# Body -# { -.annotate 'line', 6969 +.const 'Sub' WSubId_125 = "WSubId_125" self.'Statement'(__ARG_1, __ARG_3) -.annotate 'line', 6970 self.'parsecondition'(__ARG_2) -.annotate 'line', 6971 - $P3 = WSubId_94(__ARG_2, self) + $P3 = WSubId_125(__ARG_2, self) setattribute self, 'truebranch', $P3 -.annotate 'line', 6972 -# var t: $P1 $P1 = __ARG_2.'get'() -.annotate 'line', 6973 $P2 = $P1.'iskeyword'("else") if_null $P2, __label_1 unless $P2 goto __label_1 -.annotate 'line', 6974 - $P4 = WSubId_94(__ARG_2, self) + $P4 = WSubId_125(__ARG_2, self) setattribute self, 'falsebranch', $P4 goto __label_2 __label_1: # else -# { -.annotate 'line', 6976 new $P6, [ 'Winxed'; 'Compiler'; 'EmptyStatement' ] setattribute self, 'falsebranch', $P6 -.annotate 'line', 6977 __ARG_2.'unget'($P1) -# } __label_2: # endif -# } -.annotate 'line', 6979 .end # IfStatement +.sub 'clone' :method + .param pmc __ARG_1 + new $P1, [ 'Winxed'; 'Compiler'; 'IfStatement' ] + getattribute $P2, self, 'start' + $P1.'Statement'($P2, __ARG_1) + getattribute $P4, self, 'condexpr' + $P3 = $P4.'clone'(__ARG_1) + setattribute $P1, 'condexpr', $P3 + getattribute $P4, self, 'truebranch' + $P3 = $P4.'clone'(__ARG_1) + setattribute $P1, 'truebranch', $P3 + getattribute $P4, self, 'falsebranch' + $P3 = $P4.'clone'(__ARG_1) + setattribute $P1, 'falsebranch', $P3 + .return($P1) + +.end # clone + + .sub 'optimize' :method -# Body -# { -.annotate 'line', 6982 self.'optimize_condition'() -.annotate 'line', 6983 getattribute $P3, self, 'truebranch' $P2 = $P3.'optimize'() setattribute self, 'truebranch', $P2 -.annotate 'line', 6984 getattribute $P3, self, 'falsebranch' $P2 = $P3.'optimize'() setattribute self, 'falsebranch', $P2 -# switch -.annotate 'line', 6985 $P1 = self.'getvalue'() set $I1, $P1 - set $I2, 1 - if $I1 == $I2 goto __label_3 - set $I2, 2 - if $I1 == $I2 goto __label_4 - goto __label_2 + if $I1 == 1 goto __label_3 + if $I1 == 2 goto __label_4 + goto __label_1 __label_3: # case -.annotate 'line', 6987 getattribute $P2, self, 'truebranch' .return($P2) __label_4: # case -.annotate 'line', 6989 getattribute $P3, self, 'falsebranch' .return($P3) - __label_2: # default - __label_1: # switch end -.annotate 'line', 6991 + __label_1: # default + __label_2: # switch end .return(self) -# } -.annotate 'line', 6992 .end # optimize .sub 'emit' :method .param pmc __ARG_1 -# Body -# { -.annotate 'line', 6995 -# var truebranch: $P1 getattribute $P1, self, 'truebranch' -.annotate 'line', 6996 -# var falsebranch: $P2 getattribute $P2, self, 'falsebranch' -.annotate 'line', 6997 -# t_empty: $I1 $P3 = $P1.'isempty'() set $I1, $P3 -.annotate 'line', 6998 -# f_empty: $I2 $P3 = $P2.'isempty'() set $I2, $P3 -.annotate 'line', 6999 -# elselabel: $S1 set $S1, '' -.annotate 'line', 7000 not $I3, $I2 unless $I3 goto __label_1 -.annotate 'line', 7001 $P3 = self.'genlabel'() set $S1, $P3 __label_1: # endif -.annotate 'line', 7002 -# endlabel: $S2 $P3 = self.'genlabel'() null $S2 if_null $P3, __label_2 set $S2, $P3 __label_2: -.annotate 'line', 7003 -# cond_false: $S3 unless $I2 goto __label_4 set $S3, $S2 goto __label_3 __label_4: set $S3, $S1 __label_3: -.annotate 'line', 7004 self.'annotate'(__ARG_1) -.annotate 'line', 7005 self.'emit_else'(__ARG_1, $S3) -.annotate 'line', 7006 $P1.'emit'(__ARG_1) -.annotate 'line', 7008 not $I3, $I2 unless $I3 goto __label_5 -# { -.annotate 'line', 7009 __ARG_1.'emitgoto'($S2) -.annotate 'line', 7010 __ARG_1.'emitlabel'($S1, 'else') -.annotate 'line', 7011 $P2.'emit'(__ARG_1) -# } __label_5: # endif -.annotate 'line', 7013 __ARG_1.'emitlabel'($S2, 'endif') -# } -.annotate 'line', 7014 .end # emit .sub Winxed_class_init :anon :load :init newclass $P0, [ 'Winxed'; 'Compiler'; 'IfStatement' ] -.annotate 'line', 6963 get_class $P1, [ 'Winxed'; 'Compiler'; 'ConditionalStatement' ] addparent $P0, $P1 -.annotate 'line', 6965 addattribute $P0, 'truebranch' -.annotate 'line', 6966 addattribute $P0, 'falsebranch' .end .namespace [ 'Winxed'; 'Compiler'; 'LoopStatement' ] .sub 'parsebody' :method .param pmc __ARG_1 -.const 'Sub' WSubId_94 = "WSubId_94" -# Body -# { -.annotate 'line', 7026 - $P2 = WSubId_94(__ARG_1, self) +.const 'Sub' WSubId_125 = "WSubId_125" + $P2 = WSubId_125(__ARG_1, self) setattribute self, 'body', $P2 -# } -.annotate 'line', 7027 .end # parsebody .sub 'emit_infinite' :method .param pmc __ARG_1 -# Body -# { -.annotate 'line', 7030 -# breaklabel: $S1 $P1 = self.'genbreaklabel'() null $S1 if_null $P1, __label_1 set $S1, $P1 __label_1: -.annotate 'line', 7031 -# continuelabel: $S2 $P1 = self.'gencontinuelabel'() null $S2 if_null $P1, __label_2 set $S2, $P1 __label_2: -.annotate 'line', 7033 self.'annotate'(__ARG_1) -.annotate 'line', 7034 __ARG_1.'emitlabel'($S2, 'Infinite loop') -.annotate 'line', 7035 getattribute $P1, self, 'body' $P1.'emit'(__ARG_1) -.annotate 'line', 7036 __ARG_1.'emitgoto'($S2) -.annotate 'line', 7037 __ARG_1.'emitlabel'($S1, 'Infinite loop end') -# } -.annotate 'line', 7038 .end # emit_infinite .sub Winxed_class_init :anon :load :init newclass $P0, [ 'Winxed'; 'Compiler'; 'LoopStatement' ] -.annotate 'line', 7021 get_class $P1, [ 'Winxed'; 'Compiler'; 'Continuable' ] addparent $P0, $P1 -.annotate 'line', 7023 addattribute $P0, 'body' .end .namespace [ 'Winxed'; 'Compiler'; 'WhileStatement' ] @@ -20692,95 +16126,80 @@ .param pmc __ARG_1 .param pmc __ARG_2 .param pmc __ARG_3 -# Body -# { -.annotate 'line', 7049 self.'Statement'(__ARG_1, __ARG_3) -.annotate 'line', 7050 self.'parsecondition'(__ARG_2) -.annotate 'line', 7051 self.'parsebody'(__ARG_2) -# } -.annotate 'line', 7052 .end # WhileStatement +.sub 'clone' :method + .param pmc __ARG_1 + new $P1, [ 'Winxed'; 'Compiler'; 'WhileStatement' ] + getattribute $P2, self, 'start' + $P1.'Statement'($P2, __ARG_1) + getattribute $P4, self, 'condexpr' + $P3 = $P4.'clone'($P1) + setattribute $P1, 'condexpr', $P3 + getattribute $P4, self, 'body' + $P3 = $P4.'clone'($P1) + setattribute $P1, 'body', $P3 + .return($P1) + +.end # clone + + .sub 'optimize' :method -# Body -# { -.annotate 'line', 7055 self.'optimize_condition'() -.annotate 'line', 7056 getattribute $P3, self, 'body' $P2 = $P3.'optimize'() setattribute self, 'body', $P2 -.annotate 'line', 7057 .return(self) -# } -.annotate 'line', 7058 .end # optimize .sub 'emit' :method .param pmc __ARG_1 -# Body -# { -# switch -.annotate 'line', 7061 $P1 = self.'getvalue'() set $I1, $P1 - set $I2, 1 - if $I1 == $I2 goto __label_3 - set $I2, 2 - if $I1 == $I2 goto __label_4 - goto __label_2 + if $I1 == 1 goto __label_3 + if $I1 == 2 goto __label_4 + goto __label_1 __label_3: # case -.annotate 'line', 7063 self.'emit_infinite'(__ARG_1) - goto __label_1 # break + goto __label_2 # break __label_4: # case -.annotate 'line', 7066 + $P2 = __ARG_1.'getDebug'() + if_null $P2, __label_5 + unless $P2 goto __label_5 __ARG_1.'comment'('while(false) optimized out') - goto __label_1 # break - __label_2: # default -.annotate 'line', 7069 -# breaklabel: $S1 - $P2 = self.'genbreaklabel'() + __label_5: # endif + goto __label_2 # break + __label_1: # default + $P3 = self.'genbreaklabel'() null $S1 - if_null $P2, __label_5 - set $S1, $P2 - __label_5: -.annotate 'line', 7070 -# continuelabel: $S2 - $P3 = self.'gencontinuelabel'() - null $S2 if_null $P3, __label_6 - set $S2, $P3 + set $S1, $P3 __label_6: -.annotate 'line', 7072 + $P4 = self.'gencontinuelabel'() + null $S2 + if_null $P4, __label_7 + set $S2, $P4 + __label_7: self.'annotate'(__ARG_1) -.annotate 'line', 7073 __ARG_1.'emitlabel'($S2, 'while') -.annotate 'line', 7074 self.'emit_else'(__ARG_1, $S1) -.annotate 'line', 7075 - getattribute $P4, self, 'body' - $P4.'emit'(__ARG_1) -.annotate 'line', 7076 + getattribute $P5, self, 'body' + $P5.'emit'(__ARG_1) __ARG_1.'emitgoto'($S2) -.annotate 'line', 7077 __ARG_1.'emitlabel'($S1, 'endwhile') - __label_1: # switch end -# } -.annotate 'line', 7079 + __label_2: # switch end .end # emit .sub Winxed_class_init :anon :load :init newclass $P0, [ 'Winxed'; 'Compiler'; 'WhileStatement' ] -.annotate 'line', 7045 get_class $P1, [ 'Winxed'; 'Compiler'; 'LoopStatement' ] addparent $P0, $P1 get_class $P2, [ 'Winxed'; 'Compiler'; 'ConditionalStatement' ] @@ -20792,121 +16211,93 @@ .param pmc __ARG_1 .param pmc __ARG_2 .param pmc __ARG_3 -.const 'Sub' WSubId_95 = "WSubId_95" -# Body -# { -.annotate 'line', 7090 +.const 'Sub' WSubId_126 = "WSubId_126" self.'Statement'(__ARG_1, __ARG_3) -.annotate 'line', 7091 self.'parsebody'(__ARG_2) -.annotate 'line', 7092 - WSubId_95('while', __ARG_2) -.annotate 'line', 7093 + WSubId_126('while', __ARG_2) self.'parsecondition'(__ARG_2) -# } -.annotate 'line', 7094 .end # DoStatement +.sub 'clone' :method + .param pmc __ARG_1 + new $P1, [ 'Winxed'; 'Compiler'; 'DoStatement' ] + getattribute $P2, self, 'start' + $P1.'Statement'($P2, __ARG_1) + getattribute $P4, self, 'condexpr' + $P3 = $P4.'clone'($P1) + setattribute $P1, 'condexpr', $P3 + getattribute $P4, self, 'body' + $P3 = $P4.'clone'($P1) + setattribute $P1, 'body', $P3 + .return($P1) + +.end # clone + + .sub 'optimize' :method -# Body -# { -.annotate 'line', 7097 self.'optimize_condition'() -.annotate 'line', 7098 -# var body: $P1 getattribute $P2, self, 'body' $P1 = $P2.'optimize'() -.annotate 'line', 7099 - $I1 = $P1.'isempty'() - unless $I1 goto __label_2 - $P2 = self.'getvalue'() - set $I2, $P2 + $P2 = $P1.'isempty'() + unless $P2 goto __label_2 + $P3 = self.'getvalue'() + set $I2, $P3 iseq $I1, $I2, 2 + box $P2, $I1 __label_2: - unless $I1 goto __label_1 -.annotate 'line', 7100 - new $P3, [ 'Winxed'; 'Compiler'; 'EmptyStatement' ] - .return($P3) + if_null $P2, __label_1 + unless $P2 goto __label_1 + new $P4, [ 'Winxed'; 'Compiler'; 'EmptyStatement' ] + .return($P4) __label_1: # endif -.annotate 'line', 7101 setattribute self, 'body', $P1 -.annotate 'line', 7102 .return(self) -# } -.annotate 'line', 7103 .end # optimize .sub 'emit' :method .param pmc __ARG_1 -# Body -# { -.annotate 'line', 7106 -# var body: $P1 getattribute $P1, self, 'body' -.annotate 'line', 7107 -# condvalue: $I1 $P2 = self.'getvalue'() set $I1, $P2 -# switch -.annotate 'line', 7108 - set $I2, $I1 - set $I3, 1 - if $I2 == $I3 goto __label_3 - goto __label_2 + if $I1 == 1 goto __label_3 + goto __label_1 __label_3: # case -.annotate 'line', 7110 self.'emit_infinite'(__ARG_1) - goto __label_1 # break - __label_2: # default -.annotate 'line', 7113 -# looplabel: $S1 + goto __label_2 # break + __label_1: # default $P2 = self.'genlabel'() null $S1 if_null $P2, __label_4 set $S1, $P2 __label_4: -.annotate 'line', 7114 -# breaklabel: $S2 $P3 = self.'genbreaklabel'() null $S2 if_null $P3, __label_5 set $S2, $P3 __label_5: -.annotate 'line', 7115 -# continuelabel: $S3 $P4 = self.'gencontinuelabel'() null $S3 if_null $P4, __label_6 set $S3, $P4 __label_6: -.annotate 'line', 7117 self.'annotate'(__ARG_1) -.annotate 'line', 7118 __ARG_1.'emitlabel'($S1, 'do') -.annotate 'line', 7120 $P1.'emit'(__ARG_1) -.annotate 'line', 7121 __ARG_1.'emitlabel'($S3, 'continue') -.annotate 'line', 7122 eq $I1, 2, __label_7 -.annotate 'line', 7123 self.'emit_if'(__ARG_1, $S1, $S2) __label_7: # endif -.annotate 'line', 7124 __ARG_1.'emitlabel'($S2, 'enddo') - __label_1: # switch end -# } -.annotate 'line', 7126 + __label_2: # switch end .end # emit .sub Winxed_class_init :anon :load :init newclass $P0, [ 'Winxed'; 'Compiler'; 'DoStatement' ] -.annotate 'line', 7086 get_class $P1, [ 'Winxed'; 'Compiler'; 'LoopStatement' ] addparent $P0, $P1 get_class $P2, [ 'Winxed'; 'Compiler'; 'ConditionalStatement' ] @@ -20918,53 +16309,44 @@ .param pmc __ARG_1 .param pmc __ARG_2 .param pmc __ARG_3 -.const 'Sub' WSubId_53 = "WSubId_53" -# Body -# { -.annotate 'line', 7137 +.const 'Sub' WSubId_84 = "WSubId_84" self.'Statement'(__ARG_1, __ARG_3) -.annotate 'line', 7138 - WSubId_53(';', __ARG_2) -# } -.annotate 'line', 7139 + WSubId_84(';', __ARG_2) .end # ContinueStatement +.sub 'clone' :method + .param pmc __ARG_1 + new $P1, [ 'Winxed'; 'Compiler'; 'ContinueStatement' ] + getattribute $P2, self, 'start' + $P1.'Statement'($P2, __ARG_1) + .return($P1) + +.end # clone + + .sub 'optimize' :method -# Body -# { -.annotate 'line', 7140 .return(self) -# } .end # optimize .sub 'emit' :method .param pmc __ARG_1 -# Body -# { -.annotate 'line', 7143 self.'annotate'(__ARG_1) -.annotate 'line', 7144 -# label: $S1 getattribute $P2, self, 'start' $P1 = self.'getcontinuelabel'($P2) null $S1 if_null $P1, __label_1 set $S1, $P1 __label_1: -.annotate 'line', 7145 __ARG_1.'emitgoto'($S1, 'continue') -# } -.annotate 'line', 7146 .end # emit .sub Winxed_class_init :anon :load :init newclass $P0, [ 'Winxed'; 'Compiler'; 'ContinueStatement' ] -.annotate 'line', 7133 get_class $P1, [ 'Winxed'; 'Compiler'; 'Statement' ] addparent $P0, $P1 .end @@ -20974,53 +16356,44 @@ .param pmc __ARG_1 .param pmc __ARG_2 .param pmc __ARG_3 -.const 'Sub' WSubId_53 = "WSubId_53" -# Body -# { -.annotate 'line', 7157 +.const 'Sub' WSubId_84 = "WSubId_84" self.'Statement'(__ARG_1, __ARG_3) -.annotate 'line', 7158 - WSubId_53(';', __ARG_2) -# } -.annotate 'line', 7159 + WSubId_84(';', __ARG_2) .end # BreakStatement +.sub 'clone' :method + .param pmc __ARG_1 + new $P1, [ 'Winxed'; 'Compiler'; 'BreakStatement' ] + getattribute $P2, self, 'start' + $P1.'Statement'($P2, __ARG_1) + .return($P1) + +.end # clone + + .sub 'optimize' :method -# Body -# { -.annotate 'line', 7160 .return(self) -# } .end # optimize .sub 'emit' :method .param pmc __ARG_1 -# Body -# { -.annotate 'line', 7163 self.'annotate'(__ARG_1) -.annotate 'line', 7164 -# label: $S1 getattribute $P2, self, 'start' $P1 = self.'getbreaklabel'($P2) null $S1 if_null $P1, __label_1 set $S1, $P1 __label_1: -.annotate 'line', 7165 __ARG_1.'emitgoto'($S1, 'break') -# } -.annotate 'line', 7166 .end # emit .sub Winxed_class_init :anon :load :init newclass $P0, [ 'Winxed'; 'Compiler'; 'BreakStatement' ] -.annotate 'line', 7153 get_class $P1, [ 'Winxed'; 'Compiler'; 'Statement' ] addparent $P0, $P1 .end @@ -21029,189 +16402,288 @@ .sub 'SwitchBaseStatement' :method .param pmc __ARG_1 .param pmc __ARG_2 -# Body -# { -.annotate 'line', 7181 self.'Statement'(__ARG_1, __ARG_2) -.annotate 'line', 7182 root_new $P2, ['parrot';'ResizablePMCArray'] setattribute self, 'case_value', $P2 -.annotate 'line', 7183 root_new $P2, ['parrot';'ResizablePMCArray'] setattribute self, 'case_st', $P2 -.annotate 'line', 7184 root_new $P2, ['parrot';'ResizablePMCArray'] setattribute self, 'default_st', $P2 -# } -.annotate 'line', 7185 .end # SwitchBaseStatement -.sub 'parse_cases' :method +.sub 'cloneswitchto' :subid('WSubId_11') :method .param pmc __ARG_1 -.const 'Sub' WSubId_36 = "WSubId_36" -.const 'Sub' WSubId_39 = "WSubId_39" -.const 'Sub' WSubId_94 = "WSubId_94" -# Body -# { -.annotate 'line', 7188 -# var t: $P1 - null $P1 - __label_2: # while -.annotate 'line', 7189 - $P1 = __ARG_1.'get'() - $I1 = $P1.'iskeyword'('case') - if $I1 goto __label_3 - $I1 = $P1.'iskeyword'('default') - __label_3: - unless $I1 goto __label_1 -# { -.annotate 'line', 7190 - $P3 = $P1.'iskeyword'('case') + .param pmc __ARG_2 +.const 'Sub' WSubId_12 = "WSubId_12" +.lex '__WLEX_1', __ARG_2 + getattribute $P17, self, 'start' + __ARG_1.'Statement'($P17, __ARG_2) + getattribute $P1, self, 'case_value' + set $P2, __ARG_2 +.const 'Sub' WSubId_3 = "WSubId_3" +.const 'Sub' WSubId_5 = "WSubId_5" + set $P3, $P1 + root_new $P4, ['parrot';'ResizablePMCArray'] + $P19 = WSubId_5("clone") + $P5 = WSubId_3($P19, $P2) if_null $P3, __label_4 - unless $P3 goto __label_4 -# { -.annotate 'line', 7191 - getattribute $P4, self, 'case_value' - $P5 = WSubId_36(__ARG_1, self) -# predefined push - push $P4, $P5 -.annotate 'line', 7192 - $P1 = __ARG_1.'get'() -.annotate 'line', 7193 - $P3 = $P1.'isop'(':') - isfalse $I1, $P3 - unless $I1 goto __label_6 -.annotate 'line', 7194 - WSubId_39("':' in case", $P1) - __label_6: # endif -.annotate 'line', 7195 -# var st: $P2 - root_new $P2, ['parrot';'ResizablePMCArray'] + iter $P20, $P3 + set $P20, 0 + __label_3: # for iteration + unless $P20 goto __label_4 + shift $P6, $P20 + $P21 = $P5($P6) + push $P4, $P21 + goto __label_3 + __label_4: # endfor + set $P18, $P4 + goto __label_2 + __label_2: + goto __label_1 + __label_1: + set $P17, $P18 + setattribute __ARG_1, 'case_value', $P17 + getattribute $P7, self, 'case_st' + root_new $P8, ['parrot';'ResizablePMCArray'] + newclosure $P9, WSubId_12 + if_null $P7, __label_7 + iter $P23, $P7 + set $P23, 0 + __label_6: # for iteration + unless $P23 goto __label_7 + shift $P10, $P23 + $P19 = $P9($P10) + push $P8, $P19 + goto __label_6 + __label_7: # endfor + set $P22, $P8 + goto __label_5 + __label_5: + set $P17, $P22 + setattribute __ARG_1, 'case_st', $P17 + getattribute $P11, self, 'default_st' + set $P12, __ARG_2 +.const 'Sub' WSubId_3 = "WSubId_3" +.const 'Sub' WSubId_5 = "WSubId_5" + set $P13, $P11 + root_new $P14, ['parrot';'ResizablePMCArray'] + $P19 = WSubId_5("clone") + $P15 = WSubId_3($P19, $P12) + if_null $P13, __label_11 + iter $P25, $P13 + set $P25, 0 + __label_10: # for iteration + unless $P25 goto __label_11 + shift $P16, $P25 + $P21 = $P15($P16) + push $P14, $P21 + goto __label_10 + __label_11: # endfor + set $P24, $P14 + goto __label_9 + __label_9: + goto __label_8 + __label_8: + set $P17, $P24 + setattribute __ARG_1, 'default_st', $P17 + .return(__ARG_1) + +.end # cloneswitchto + + +.sub '' :anon :subid('WSubId_12') :outer('WSubId_11') + .param pmc __ARG_3 + find_lex $P1, '__WLEX_1' + set $P2, __ARG_3 + set $P3, $P1 +.const 'Sub' WSubId_3 = "WSubId_3" +.const 'Sub' WSubId_5 = "WSubId_5" + set $P4, $P2 + root_new $P5, ['parrot';'ResizablePMCArray'] + $P9 = WSubId_5("clone") + $P6 = WSubId_3($P9, $P3) + if_null $P4, __label_4 + iter $P10, $P4 + set $P10, 0 + __label_3: # for iteration + unless $P10 goto __label_4 + shift $P7, $P10 + $P11 = $P6($P7) + push $P5, $P11 + goto __label_3 + __label_4: # endfor + set $P8, $P5 + goto __label_2 + __label_2: + goto __label_1 + __label_1: + set $P9, $P8 + .return($P9) + +.end # WSubId_12 + + +.sub 'parse_cases' :method + .param pmc __ARG_1 +.const 'Sub' WSubId_68 = "WSubId_68" +.const 'Sub' WSubId_70 = "WSubId_70" +.const 'Sub' WSubId_125 = "WSubId_125" + null $P1 + __label_2: # while + $P1 = __ARG_1.'get'() + $P3 = $P1.'iskeyword'('case') + if $P3 goto __label_3 + $P3 = $P1.'iskeyword'('default') + __label_3: + if_null $P3, __label_1 + unless $P3 goto __label_1 + $P4 = $P1.'iskeyword'('case') + if_null $P4, __label_4 + unless $P4 goto __label_4 + getattribute $P5, self, 'case_value' + $P6 = WSubId_68(__ARG_1, self) + push $P5, $P6 + $P1 = __ARG_1.'get'() + $P3 = $P1.'isop'(':') + isfalse $I1, $P3 + unless $I1 goto __label_6 + WSubId_70("':' in case", $P1) + __label_6: # endif + root_new $P2, ['parrot';'ResizablePMCArray'] __label_8: # while -.annotate 'line', 7196 $P1 = __ARG_1.'get'() - $I2 = $P1.'isop'('}') - if $I2 goto __label_10 - $I2 = $P1.'iskeyword'('case') + $P3 = $P1.'isop'('}') + if $P3 goto __label_10 + $P3 = $P1.'iskeyword'('case') __label_10: - if $I2 goto __label_9 - $I2 = $P1.'iskeyword'('default') + if $P3 goto __label_9 + $P3 = $P1.'iskeyword'('default') __label_9: - not $I1, $I2 + isfalse $I1, $P3 unless $I1 goto __label_7 -# { -.annotate 'line', 7197 __ARG_1.'unget'($P1) -.annotate 'line', 7198 - $P3 = WSubId_94(__ARG_1, self) -# predefined push + $P3 = WSubId_125(__ARG_1, self) push $P2, $P3 -# } goto __label_8 __label_7: # endwhile -.annotate 'line', 7200 getattribute $P3, self, 'case_st' -# predefined push push $P3, $P2 -.annotate 'line', 7201 __ARG_1.'unget'($P1) -# } goto __label_5 __label_4: # else -# { -.annotate 'line', 7204 $P1 = __ARG_1.'get'() -.annotate 'line', 7205 $P3 = $P1.'isop'(':') isfalse $I1, $P3 unless $I1 goto __label_11 -.annotate 'line', 7206 - WSubId_39("':' in default", $P1) + WSubId_70("':' in default", $P1) __label_11: # endif __label_13: # while -.annotate 'line', 7207 $P1 = __ARG_1.'get'() - $I2 = $P1.'isop'('}') - if $I2 goto __label_15 - $I2 = $P1.'iskeyword'('case') + $P3 = $P1.'isop'('}') + if $P3 goto __label_15 + $P3 = $P1.'iskeyword'('case') __label_15: - if $I2 goto __label_14 - $I2 = $P1.'iskeyword'('default') + if $P3 goto __label_14 + $P3 = $P1.'iskeyword'('default') __label_14: - not $I1, $I2 + isfalse $I1, $P3 unless $I1 goto __label_12 -# { -.annotate 'line', 7208 __ARG_1.'unget'($P1) -.annotate 'line', 7209 getattribute $P3, self, 'default_st' - $P4 = WSubId_94(__ARG_1, self) -# predefined push + $P4 = WSubId_125(__ARG_1, self) push $P3, $P4 -# } goto __label_13 __label_12: # endwhile -.annotate 'line', 7211 __ARG_1.'unget'($P1) -# } __label_5: # endif -# } goto __label_2 __label_1: # endwhile -.annotate 'line', 7214 $P3 = $P1.'isop'('}') isfalse $I1, $P3 unless $I1 goto __label_16 -.annotate 'line', 7215 - WSubId_39("'}' in switch", $P1) + WSubId_70("'}' in switch", $P1) __label_16: # endif -# } -.annotate 'line', 7216 .end # parse_cases .sub 'optimize_cases' :method -.const 'Sub' WSubId_37 = "WSubId_37" -# Body -# { -.annotate 'line', 7219 getattribute $P2, self, 'case_value' - WSubId_37($P2) -.annotate 'line', 7220 - getattribute $P2, self, 'case_st' - if_null $P2, __label_2 - iter $P3, $P2 - set $P3, 0 - __label_1: # for iteration - unless $P3 goto __label_2 - shift $P1, $P3 -.annotate 'line', 7221 - WSubId_37($P1) - goto __label_1 - __label_2: # endfor -.annotate 'line', 7222 - getattribute $P2, self, 'default_st' - WSubId_37($P2) -# } -.annotate 'line', 7223 + if_null $P2, __label_3 + elements $I1, $P2 + goto __label_2 + __label_3: + null $I1 + __label_2: + null $I2 + __label_6: # for condition + ge $I2, $I1, __label_5 + $P6 = $P2[$I2] + $P5 = $P6.'optimize'() + $P2[$I2] = $P5 + __label_4: # for iteration + inc $I2 + goto __label_6 + __label_5: # for end + __label_1: + getattribute $P5, self, 'case_st' + if_null $P5, __label_8 + iter $P7, $P5 + set $P7, 0 + __label_7: # for iteration + unless $P7 goto __label_8 + shift $P1, $P7 + set $P3, $P1 + if_null $P3, __label_11 + elements $I3, $P3 + goto __label_10 + __label_11: + null $I3 + __label_10: + null $I4 + __label_14: # for condition + ge $I4, $I3, __label_13 + $P6 = $P3[$I4] + $P5 = $P6.'optimize'() + $P3[$I4] = $P5 + __label_12: # for iteration + inc $I4 + goto __label_14 + __label_13: # for end + __label_9: + goto __label_7 + __label_8: # endfor + getattribute $P4, self, 'default_st' + if_null $P4, __label_17 + elements $I5, $P4 + goto __label_16 + __label_17: + null $I5 + __label_16: + null $I6 + __label_20: # for condition + ge $I6, $I5, __label_19 + $P6 = $P4[$I6] + $P5 = $P6.'optimize'() + $P4[$I6] = $P5 + __label_18: # for iteration + inc $I6 + goto __label_20 + __label_19: # for end + __label_15: .end # optimize_cases .sub Winxed_class_init :anon :load :init newclass $P0, [ 'Winxed'; 'Compiler'; 'SwitchBaseStatement' ] -.annotate 'line', 7173 get_class $P1, [ 'Winxed'; 'Compiler'; 'Breakable' ] addparent $P0, $P1 get_class $P2, [ 'Winxed'; 'Compiler'; 'Statement' ] addparent $P0, $P2 -.annotate 'line', 7175 addattribute $P0, 'case_value' -.annotate 'line', 7176 addattribute $P0, 'case_st' -.annotate 'line', 7177 addattribute $P0, 'default_st' .end .namespace [ 'Winxed'; 'Compiler'; 'SwitchStatement' ] @@ -21220,237 +16692,285 @@ .param pmc __ARG_1 .param pmc __ARG_2 .param pmc __ARG_3 -.const 'Sub' WSubId_36 = "WSubId_36" -.const 'Sub' WSubId_39 = "WSubId_39" -# Body -# { -.annotate 'line', 7236 +.const 'Sub' WSubId_68 = "WSubId_68" +.const 'Sub' WSubId_70 = "WSubId_70" self.'SwitchBaseStatement'(__ARG_1, __ARG_3) -.annotate 'line', 7237 - $P3 = WSubId_36(__ARG_2, self) + $P3 = WSubId_68(__ARG_2, self) setattribute self, 'condition', $P3 -.annotate 'line', 7238 -# var t: $P1 $P1 = __ARG_2.'get'() -.annotate 'line', 7239 $P2 = $P1.'isop'(')') isfalse $I1, $P2 unless $I1 goto __label_1 -.annotate 'line', 7240 - WSubId_39("')' in switch", $P1) + WSubId_70("')' in switch", $P1) __label_1: # endif -.annotate 'line', 7241 $P1 = __ARG_2.'get'() -.annotate 'line', 7242 $P2 = $P1.'isop'('{') isfalse $I1, $P2 unless $I1 goto __label_2 -.annotate 'line', 7243 - WSubId_39("'{' in switch", $P1) + WSubId_70("'{' in switch", $P1) __label_2: # endif -.annotate 'line', 7244 self.'parse_cases'(__ARG_2) -# } -.annotate 'line', 7245 .end # SwitchStatement +.sub 'clone' :method + .param pmc __ARG_1 + new $P2, [ 'Winxed'; 'Compiler'; 'SwitchStatement' ] + $P1 = self.'cloneswitchto'($P2, __ARG_1) + getattribute $P4, self, 'condition' + $P3 = $P4.'clone'($P1) + setattribute $P1, 'condition', $P3 + .return($P1) + +.end # clone + + .sub 'optimize' :method -# Body -# { -.annotate 'line', 7248 getattribute $P3, self, 'condition' $P2 = $P3.'optimize'() setattribute self, 'condition', $P2 -.annotate 'line', 7249 self.'optimize_cases'() -.annotate 'line', 7250 .return(self) -# } -.annotate 'line', 7251 .end # optimize .sub 'emit' :method .param pmc __ARG_1 -.const 'Sub' WSubId_1 = "WSubId_1" -.const 'Sub' WSubId_51 = "WSubId_51" -# Body -# { -.annotate 'line', 7255 -# type: $S1 +.const 'Sub' WSubId_25 = "WSubId_25" +.const 'Sub' WSubId_47 = "WSubId_47" +.const 'Sub' WSubId_45 = "WSubId_45" set $S1, '' -.annotate 'line', 7256 - getattribute $P7, self, 'case_value' - if_null $P7, __label_2 - iter $P8, $P7 - set $P8, 0 + getattribute $P19, self, 'case_value' + if_null $P19, __label_2 + iter $P20, $P19 + set $P20, 0 __label_1: # for iteration - unless $P8 goto __label_2 - shift $P1, $P8 -# { -.annotate 'line', 7257 -# t: $S2 - $P9 = $P1.'checkresult'() + unless $P20 goto __label_2 + shift $P1, $P20 + $P21 = $P1.'checkresult'() null $S2 - if_null $P9, __label_3 - set $S2, $P9 + if_null $P21, __label_3 + set $S2, $P21 __label_3: -.annotate 'line', 7258 ne $S2, 'N', __label_4 -.annotate 'line', 7259 - WSubId_1("Invalid type in case", self) + WSubId_25("Invalid type in case", self) __label_4: # endif -.annotate 'line', 7260 - ne $S1, '', __label_5 -.annotate 'line', 7261 + ne $S2, 'S', __label_5 + iseq $I4, $S1, '' + if $I4 goto __label_7 + iseq $I4, $S1, 'char' + __label_7: + unless $I4 goto __label_6 + $P19 = $P1.'isstringliteral'() + unless $P19 goto __label_10 + $P21 = WSubId_47($P1) + set $S11, $P21 + length $I6, $S11 + iseq $I5, $I6, 1 + box $P19, $I5 + __label_10: + if_null $P19, __label_8 + unless $P19 goto __label_8 + set $S2, 'char' + goto __label_9 + __label_8: # else + set $S1, 'S' + __label_9: # endif + __label_6: # endif + __label_5: # endif + ne $S1, '', __label_11 set $S1, $S2 - goto __label_6 - __label_5: # else -.annotate 'line', 7262 - eq $S1, $S2, __label_7 -.annotate 'line', 7263 + goto __label_12 + __label_11: # else + eq $S1, $S2, __label_13 set $S1, 'P' - __label_7: # endif - __label_6: # endif -# } + __label_13: # endif + __label_12: # endif goto __label_1 __label_2: # endfor -.annotate 'line', 7266 -# var condition: $P2 getattribute $P2, self, 'condition' -.annotate 'line', 7267 -# var condtype: $P3 $P3 = $P2.'checkresult'() -.annotate 'line', 7271 - ne $S1, '', __label_8 -.annotate 'line', 7272 + ne $S1, '', __label_14 set $S1, $P3 - __label_8: # endif -.annotate 'line', 7274 + __label_14: # endif + $P19 = __ARG_1.'getDebug'() + if_null $P19, __label_15 + unless $P19 goto __label_15 __ARG_1.'comment'('switch') -.annotate 'line', 7275 -# reg: $S3 - $P7 = self.'tempreg'($S1) + __label_15: # endif + $P19 = self.'genlabel'() null $S3 - if_null $P7, __label_9 - set $S3, $P7 - __label_9: -.annotate 'line', 7276 - set $S8, $P3 - ne $S8, $S1, __label_10 -.annotate 'line', 7277 - $P2.'emit'(__ARG_1, $S3) - goto __label_11 - __label_10: # else -# { -.annotate 'line', 7279 -# regcond: $S4 - $P7 = $P2.'emit_get'(__ARG_1) + if_null $P19, __label_16 + set $S3, $P19 + __label_16: null $S4 - if_null $P7, __label_12 - set $S4, $P7 - __label_12: -.annotate 'line', 7280 - __ARG_1.'emitset'($S3, $S4) -# } - __label_11: # endif -.annotate 'line', 7284 - self.'genbreaklabel'() -.annotate 'line', 7285 -# defaultlabel: $S5 - $P7 = self.'genlabel'() + ne $S1, 'char', __label_17 + isa $I4, $P2, [ 'Winxed'; 'Compiler'; 'CallBuiltinExpr' ] + unless $I4 goto __label_21 + getattribute $P21, $P2, 'builtin' + $P19 = $P21.'name'() + set $S11, $P19 + iseq $I4, $S11, "chr" + __label_21: + unless $I4 goto __label_19 + getattribute $P4, $P2, 'args' + $P19 = $P4[0] + getattribute $P5, $P19, 'arg' + $P19 = $P5.'emit_getint'(__ARG_1) + set $S4, $P19 + goto __label_20 + __label_19: # else null $S5 - if_null $P7, __label_13 - set $S5, $P7 - __label_13: -.annotate 'line', 7286 - new $P4, ['ResizableStringArray'] -.annotate 'line', 7287 -# regval: $S6 - $P7 = self.'tempreg'($S1) + set $S11, $P3 + eq $S11, 'S', __label_22 + $P19 = $P2.'emit_get'(__ARG_1) null $S6 - if_null $P7, __label_14 - set $S6, $P7 - __label_14: -.annotate 'line', 7288 - getattribute $P7, self, 'case_value' - if_null $P7, __label_16 - iter $P10, $P7 - set $P10, 0 - __label_15: # for iteration - unless $P10 goto __label_16 - shift $P5, $P10 -# { -.annotate 'line', 7289 -# label: $S7 - $P9 = self.'genlabel'() + if_null $P19, __label_24 + set $S6, $P19 + __label_24: + $P19 = self.'tempreg'('S') + set $S5, $P19 + __ARG_1.'emitset'($S5, $S6) + goto __label_23 + __label_22: # else + $P19 = $P2.'emit_get'(__ARG_1) + set $S5, $P19 + __label_23: # endif + __ARG_1.'emitif_null'($S5, $S3) + $P19 = self.'tempreg'('I') + set $S4, $P19 + __ARG_1.'emitarg2'('length', $S4, $S5) + __ARG_1.'emitarg3'('ne', $S4, "1", $S3) + __ARG_1.'emitarg2'('ord', $S4, $S5) + __label_20: # endif + goto __label_18 + __label_17: # else + set $S11, $P3 + ne $S11, $S1, __label_25 + $P19 = $P2.'emit_get'(__ARG_1) + set $S4, $P19 + goto __label_26 + __label_25: # else + $P21 = self.'tempreg'($S1) + set $S4, $P21 + $P19 = $P2.'emit_get'(__ARG_1) null $S7 - if_null $P9, __label_17 - set $S7, $P9 - __label_17: -.annotate 'line', 7290 -# predefined push - push $P4, $S7 -.annotate 'line', 7291 - $P5.'emit'(__ARG_1, $S6) -.annotate 'line', 7292 - __ARG_1.'say'(' ', 'if ', $S3, ' == ', $S6, ' goto ', $S7) -# } - goto __label_15 - __label_16: # endfor -.annotate 'line', 7294 - __ARG_1.'emitgoto'($S5) -.annotate 'line', 7297 + if_null $P19, __label_27 + set $S7, $P19 + __label_27: + __ARG_1.'emitset'($S4, $S7) + __label_26: # endif + __label_18: # endif + self.'genbreaklabel'() + new $P6, ['ResizableStringArray'] + null $S8 + eq $S1, 'char', __label_28 + self.'tempreg'($S1) + __label_28: # endif + getattribute $P19, self, 'case_value' + if_null $P19, __label_30 + iter $P22, $P19 + set $P22, 0 + __label_29: # for iteration + unless $P22 goto __label_30 + shift $P7, $P22 + $P21 = self.'genlabel'() + null $S9 + if_null $P21, __label_31 + set $S9, $P21 + __label_31: + push $P6, $S9 + null $S10 + ne $S1, 'I', __label_32 + $P19 = $P7.'emit_getint'(__ARG_1) + set $S10, $P19 + goto __label_33 + __label_32: # else + ne $S1, 'char', __label_34 + $P21 = WSubId_47($P7) + set $S11, $P21 + ord $I1, $S11 + set $S10, $I1 + goto __label_35 + __label_34: # else + $P19 = $P7.'checkresult'() + set $S11, $P19 + ne $S1, $S11, __label_36 + $P21 = $P7.'emit_get'(__ARG_1) + set $S10, $P21 + goto __label_37 + __label_36: # else + $P7.'emit'(__ARG_1, $S8) + set $S10, $S8 + __label_37: # endif + __label_35: # endif + __label_33: # endif + $P19 = WSubId_45(" if %0 == %1 goto %2", $S4, $S10, $S9) + __ARG_1.'say'($P19) + goto __label_29 + __label_30: # endfor + __ARG_1.'emitgoto'($S3) self.'annotate'(__ARG_1) -.annotate 'line', 7298 -# var case_st: $P6 - getattribute $P6, self, 'case_st' -.annotate 'line', 7299 -# n: $I1 - set $P7, $P6 - set $I1, $P7 -# for loop -.annotate 'line', 7300 -# i: $I2 - null $I2 - __label_20: # for condition - ge $I2, $I1, __label_19 -# { -.annotate 'line', 7301 - $P7 = $P4[$I2] - __ARG_1.'emitlabel'($P7, 'case') -.annotate 'line', 7302 - $P7 = $P6[$I2] - WSubId_51(__ARG_1, $P7) -# } - __label_18: # for iteration -.annotate 'line', 7300 - inc $I2 - goto __label_20 - __label_19: # for end -.annotate 'line', 7305 - __ARG_1.'emitlabel'($S5, 'default') -.annotate 'line', 7306 - getattribute $P7, self, 'default_st' - WSubId_51(__ARG_1, $P7) -.annotate 'line', 7308 - getattribute $P9, self, 'start' - $P7 = self.'getbreaklabel'($P9) - __ARG_1.'emitlabel'($P7, 'switch end') -# } -.annotate 'line', 7309 + getattribute $P8, self, 'case_st' + set $I2, $P8 + null $I3 + __label_40: # for condition + ge $I3, $I2, __label_39 + $P19 = $P6[$I3] + __ARG_1.'emitlabel'($P19, 'case') + set $P9, __ARG_1 + $P10 = $P8[$I3] +.const 'Sub' WSubId_3 = "WSubId_3" +.const 'Sub' WSubId_5 = "WSubId_5" + set $P11, $P10 + $P19 = WSubId_5("emit") + $P12 = WSubId_3($P19, $P9) + if_null $P11, __label_44 + iter $P23, $P11 + set $P23, 0 + __label_43: # for iteration + unless $P23 goto __label_44 + shift $P13, $P23 + $P12($P13) + goto __label_43 + __label_44: # endfor + __label_42: + __label_41: + __label_38: # for iteration + inc $I3 + goto __label_40 + __label_39: # for end + __ARG_1.'emitlabel'($S3, 'default') + set $P14, __ARG_1 + getattribute $P15, self, 'default_st' +.const 'Sub' WSubId_3 = "WSubId_3" +.const 'Sub' WSubId_5 = "WSubId_5" + set $P16, $P15 + $P19 = WSubId_5("emit") + $P17 = WSubId_3($P19, $P14) + if_null $P16, __label_48 + iter $P24, $P16 + set $P24, 0 + __label_47: # for iteration + unless $P24 goto __label_48 + shift $P18, $P24 + $P17($P18) + goto __label_47 + __label_48: # endfor + __label_46: + __label_45: + getattribute $P21, self, 'start' + $P19 = self.'getbreaklabel'($P21) + __ARG_1.'emitlabel'($P19, 'switch end') .end # emit .sub Winxed_class_init :anon :load :init newclass $P0, [ 'Winxed'; 'Compiler'; 'SwitchStatement' ] -.annotate 'line', 7230 get_class $P1, [ 'Winxed'; 'Compiler'; 'SwitchBaseStatement' ] addparent $P0, $P1 -.annotate 'line', 7232 addattribute $P0, 'condition' .end .namespace [ 'Winxed'; 'Compiler'; 'SwitchCaseStatement' ] @@ -21459,168 +16979,161 @@ .param pmc __ARG_1 .param pmc __ARG_2 .param pmc __ARG_3 -# Body -# { -.annotate 'line', 7321 self.'SwitchBaseStatement'(__ARG_1, __ARG_3) -.annotate 'line', 7322 self.'parse_cases'(__ARG_2) -# } -.annotate 'line', 7323 .end # SwitchCaseStatement +.sub 'clone' :method + .param pmc __ARG_1 + new $P1, [ 'Winxed'; 'Compiler'; 'SwitchCaseStatement' ] + .tailcall self.'cloneswitchto'($P1, __ARG_1) + +.end # clone + + .sub 'optimize' :method -# Body -# { -.annotate 'line', 7326 self.'optimize_cases'() -.annotate 'line', 7327 .return(self) -# } -.annotate 'line', 7328 .end # optimize .sub 'emit' :method .param pmc __ARG_1 -.const 'Sub' WSubId_51 = "WSubId_51" -# Body -# { -.annotate 'line', 7332 self.'genbreaklabel'() -.annotate 'line', 7333 -# defaultlabel: $S1 - $P4 = self.'genlabel'() + $P14 = self.'genlabel'() null $S1 - if_null $P4, __label_1 - set $S1, $P4 + if_null $P14, __label_1 + set $S1, $P14 __label_1: -.annotate 'line', 7334 new $P1, ['ResizableStringArray'] -.annotate 'line', 7336 + $P14 = __ARG_1.'getDebug'() + if_null $P14, __label_2 + unless $P14 goto __label_2 __ARG_1.'comment'('switch-case') -.annotate 'line', 7337 -# reg: $S2 - $P4 = self.'tempreg'('I') + __label_2: # endif + $P14 = self.'tempreg'('I') null $S2 - if_null $P4, __label_2 - set $S2, $P4 - __label_2: -.annotate 'line', 7338 - getattribute $P4, self, 'case_value' - if_null $P4, __label_4 - iter $P5, $P4 - set $P5, 0 - __label_3: # for iteration - unless $P5 goto __label_4 - shift $P2, $P5 -# { -.annotate 'line', 7339 -# label: $S3 - $P6 = self.'genlabel'() + if_null $P14, __label_3 + set $S2, $P14 + __label_3: + getattribute $P14, self, 'case_value' + if_null $P14, __label_5 + iter $P15, $P14 + set $P15, 0 + __label_4: # for iteration + unless $P15 goto __label_5 + shift $P2, $P15 + $P16 = self.'genlabel'() null $S3 - if_null $P6, __label_5 - set $S3, $P6 - __label_5: -.annotate 'line', 7340 -# predefined push + if_null $P16, __label_6 + set $S3, $P16 + __label_6: push $P1, $S3 -.annotate 'line', 7341 + $P14 = $P2.'checkresult'() + set $S5, $P14 + ne $S5, 'I', __label_7 $P2.'emit'(__ARG_1, $S2) -.annotate 'line', 7342 - __ARG_1.'say'(' ', 'if ', $S2, ' goto ', $S3) -# } - goto __label_3 - __label_4: # endfor -.annotate 'line', 7344 + goto __label_8 + __label_7: # else + $P16 = $P2.'emit_get'(__ARG_1) + null $S4 + if_null $P16, __label_9 + set $S4, $P16 + __label_9: + __ARG_1.'emitset'($S2, $S4) + __label_8: # endif + __ARG_1.'emitif'($S2, $S3) + goto __label_4 + __label_5: # endfor __ARG_1.'emitgoto'($S1) -.annotate 'line', 7347 self.'annotate'(__ARG_1) -.annotate 'line', 7348 -# var case_st: $P3 getattribute $P3, self, 'case_st' -.annotate 'line', 7349 -# n: $I1 - set $P4, $P3 - set $I1, $P4 -# for loop -.annotate 'line', 7350 -# i: $I2 + set $I1, $P3 null $I2 - __label_8: # for condition - ge $I2, $I1, __label_7 -# { -.annotate 'line', 7351 - $P4 = $P1[$I2] - __ARG_1.'emitlabel'($P4, 'case') -.annotate 'line', 7352 - $P4 = $P3[$I2] - WSubId_51(__ARG_1, $P4) -# } - __label_6: # for iteration -.annotate 'line', 7350 + __label_12: # for condition + ge $I2, $I1, __label_11 + $P14 = $P1[$I2] + __ARG_1.'emitlabel'($P14, 'case') + set $P4, __ARG_1 + $P5 = $P3[$I2] +.const 'Sub' WSubId_3 = "WSubId_3" +.const 'Sub' WSubId_5 = "WSubId_5" + set $P6, $P5 + $P14 = WSubId_5("emit") + $P7 = WSubId_3($P14, $P4) + if_null $P6, __label_16 + iter $P17, $P6 + set $P17, 0 + __label_15: # for iteration + unless $P17 goto __label_16 + shift $P8, $P17 + $P7($P8) + goto __label_15 + __label_16: # endfor + __label_14: + __label_13: + __label_10: # for iteration inc $I2 - goto __label_8 - __label_7: # for end -.annotate 'line', 7355 + goto __label_12 + __label_11: # for end __ARG_1.'emitlabel'($S1, 'default') -.annotate 'line', 7356 - getattribute $P4, self, 'default_st' - WSubId_51(__ARG_1, $P4) -.annotate 'line', 7358 - getattribute $P6, self, 'start' - $P4 = self.'getbreaklabel'($P6) - __ARG_1.'emitlabel'($P4, 'switch end') -# } -.annotate 'line', 7359 + set $P9, __ARG_1 + getattribute $P10, self, 'default_st' +.const 'Sub' WSubId_3 = "WSubId_3" +.const 'Sub' WSubId_5 = "WSubId_5" + set $P11, $P10 + $P14 = WSubId_5("emit") + $P12 = WSubId_3($P14, $P9) + if_null $P11, __label_20 + iter $P18, $P11 + set $P18, 0 + __label_19: # for iteration + unless $P18 goto __label_20 + shift $P13, $P18 + $P12($P13) + goto __label_19 + __label_20: # endfor + __label_18: + __label_17: + getattribute $P16, self, 'start' + $P14 = self.'getbreaklabel'($P16) + __ARG_1.'emitlabel'($P14, 'switch end') .end # emit .sub Winxed_class_init :anon :load :init newclass $P0, [ 'Winxed'; 'Compiler'; 'SwitchCaseStatement' ] -.annotate 'line', 7316 get_class $P1, [ 'Winxed'; 'Compiler'; 'SwitchBaseStatement' ] addparent $P0, $P1 .end .namespace [ 'Winxed'; 'Compiler' ] -.sub 'parseSwitch' :subid('WSubId_49') +.sub 'parseSwitch' :subid('WSubId_81') .param pmc __ARG_1 .param pmc __ARG_2 .param pmc __ARG_3 -.const 'Sub' WSubId_39 = "WSubId_39" -# Body -# { -.annotate 'line', 7366 -# var t: $P1 +.const 'Sub' WSubId_70 = "WSubId_70" $P1 = __ARG_2.'get'() -.annotate 'line', 7367 $P2 = $P1.'isop'('(') if_null $P2, __label_1 unless $P2 goto __label_1 -.annotate 'line', 7368 new $P4, [ 'Winxed'; 'Compiler'; 'SwitchStatement' ] $P4.'SwitchStatement'(__ARG_1, __ARG_2, __ARG_3) set $P3, $P4 .return($P3) __label_1: # endif -.annotate 'line', 7369 $P2 = $P1.'isop'('{') if_null $P2, __label_2 unless $P2 goto __label_2 -.annotate 'line', 7370 new $P4, [ 'Winxed'; 'Compiler'; 'SwitchCaseStatement' ] $P4.'SwitchCaseStatement'(__ARG_1, __ARG_2, __ARG_3) set $P3, $P4 .return($P3) __label_2: # endif -.annotate 'line', 7371 - WSubId_39("'(' in switch", $P1) -# } -.annotate 'line', 7372 + WSubId_70("'(' in switch", $P1) .end # parseSwitch @@ -21630,225 +17143,228 @@ .param pmc __ARG_1 .param pmc __ARG_2 .param pmc __ARG_3 -.const 'Sub' WSubId_94 = "WSubId_94" -.const 'Sub' WSubId_53 = "WSubId_53" -.const 'Sub' WSubId_36 = "WSubId_36" -# Body -# { -.annotate 'line', 7385 - self.'Statement'(__ARG_1, __ARG_3) -.annotate 'line', 7386 -# var t: $P1 +.const 'Sub' WSubId_125 = "WSubId_125" +.const 'Sub' WSubId_84 = "WSubId_84" +.const 'Sub' WSubId_68 = "WSubId_68" +.const 'Sub' WSubId_28 = "WSubId_28" + self.'BlockStatement'(__ARG_1, __ARG_3) $P1 = __ARG_2.'get'() -.annotate 'line', 7387 - $P2 = $P1.'isop'(';') - isfalse $I1, $P2 + $P3 = $P1.'isop'(';') + isfalse $I1, $P3 unless $I1 goto __label_1 -# { -.annotate 'line', 7388 __ARG_2.'unget'($P1) -.annotate 'line', 7389 - $P3 = WSubId_94(__ARG_2, self) - setattribute self, 'initializer', $P3 -# } + $P4 = WSubId_125(__ARG_2, self) + setattribute self, 'initializer', $P4 __label_1: # endif -.annotate 'line', 7391 $P1 = __ARG_2.'get'() -.annotate 'line', 7392 - $P2 = $P1.'isop'(';') - isfalse $I1, $P2 + $P3 = $P1.'isop'(';') + isfalse $I1, $P3 unless $I1 goto __label_2 -# { -.annotate 'line', 7393 __ARG_2.'unget'($P1) -.annotate 'line', 7394 self.'parseconditionshort'(__ARG_2) -.annotate 'line', 7395 - WSubId_53(';', __ARG_2) -# } + WSubId_84(';', __ARG_2) __label_2: # endif -.annotate 'line', 7397 $P1 = __ARG_2.'get'() -.annotate 'line', 7398 - $P2 = $P1.'isop'(')') - isfalse $I1, $P2 + $P3 = $P1.'isop'(')') + isfalse $I1, $P3 unless $I1 goto __label_3 -# { -.annotate 'line', 7399 __ARG_2.'unget'($P1) -.annotate 'line', 7400 - $P3 = WSubId_36(__ARG_2, self) - setattribute self, 'iteration', $P3 -.annotate 'line', 7401 - WSubId_53(')', __ARG_2) -# } + root_new $P2, ['parrot';'ResizablePMCArray'] + __label_4: # do + $P3 = WSubId_68(__ARG_2, self) + push $P2, $P3 + __label_6: # continue + $P1 = __ARG_2.'get'() + $P3 = $P1.'isop'(',') + if_null $P3, __label_5 + if $P3 goto __label_4 + __label_5: # enddo + setattribute self, 'iteration', $P2 + WSubId_28(')', $P1) __label_3: # endif -.annotate 'line', 7403 self.'parsebody'(__ARG_2) -# } -.annotate 'line', 7404 .end # ForStatement +.sub 'clone' :method + .param pmc __ARG_1 + new $P1, [ 'Winxed'; 'Compiler'; 'ForStatement' ] + getattribute $P8, self, 'start' + $P1.'BlockStatement'($P8, __ARG_1) + getattribute $P8, self, 'initializer' + if_null $P8, __label_1 + getattribute $P11, self, 'initializer' + $P10 = $P11.'clone'($P1) + setattribute $P1, 'initializer', $P10 + __label_1: # endif + getattribute $P8, self, 'condexpr' + if_null $P8, __label_2 + getattribute $P11, self, 'condexpr' + $P10 = $P11.'clone'($P1) + setattribute $P1, 'condexpr', $P10 + __label_2: # endif + getattribute $P8, self, 'iteration' + if_null $P8, __label_3 + getattribute $P2, self, 'iteration' + set $P3, $P1 +.const 'Sub' WSubId_3 = "WSubId_3" +.const 'Sub' WSubId_5 = "WSubId_5" + set $P4, $P2 + root_new $P5, ['parrot';'ResizablePMCArray'] + $P10 = WSubId_5("clone") + $P6 = WSubId_3($P10, $P3) + if_null $P4, __label_7 + iter $P13, $P4 + set $P13, 0 + __label_6: # for iteration + unless $P13 goto __label_7 + shift $P7, $P13 + $P11 = $P6($P7) + push $P5, $P11 + goto __label_6 + __label_7: # endfor + set $P12, $P5 + goto __label_5 + __label_5: + goto __label_4 + __label_4: + set $P8, $P12 + setattribute $P1, 'iteration', $P8 + __label_3: # endif + getattribute $P10, self, 'body' + $P9 = $P10.'clone'($P1) + setattribute $P1, 'body', $P9 + .return($P1) + +.end # clone + + .sub 'optimize' :method -# Body -# { -.annotate 'line', 7407 -# var initializer: $P1 getattribute $P1, self, 'initializer' -.annotate 'line', 7408 if_null $P1, __label_1 -.annotate 'line', 7409 $P1 = $P1.'optimize'() setattribute self, 'initializer', $P1 __label_1: # endif -.annotate 'line', 7410 - getattribute $P2, self, 'condexpr' - if_null $P2, __label_2 -# { -.annotate 'line', 7411 + getattribute $P3, self, 'condexpr' + if_null $P3, __label_2 self.'optimize_condition'() -.annotate 'line', 7412 - $P2 = self.'getvalue'() - set $I1, $P2 - ne $I1, 2, __label_3 -# { -.annotate 'line', 7413 + $P3 = self.'getvalue'() + set $I3, $P3 + ne $I3, 2, __label_3 if_null $P1, __label_4 -.annotate 'line', 7414 .return($P1) goto __label_5 __label_4: # else -.annotate 'line', 7416 - new $P3, [ 'Winxed'; 'Compiler'; 'EmptyStatement' ] - .return($P3) + new $P4, [ 'Winxed'; 'Compiler'; 'EmptyStatement' ] + .return($P4) __label_5: # endif -# } __label_3: # endif -# } __label_2: # endif -.annotate 'line', 7419 getattribute $P2, self, 'iteration' - if_null $P2, __label_6 -.annotate 'line', 7420 - getattribute $P5, self, 'iteration' - $P4 = $P5.'optimize'() - setattribute self, 'iteration', $P4 - __label_6: # endif -.annotate 'line', 7421 - getattribute $P4, self, 'body' + if_null $P2, __label_8 + elements $I1, $P2 + goto __label_7 + __label_8: + null $I1 + __label_7: + null $I2 + __label_11: # for condition + ge $I2, $I1, __label_10 + $P4 = $P2[$I2] $P3 = $P4.'optimize'() - setattribute self, 'body', $P3 -.annotate 'line', 7422 + $P2[$I2] = $P3 + __label_9: # for iteration + inc $I2 + goto __label_11 + __label_10: # for end + __label_6: + getattribute $P5, self, 'body' + $P4 = $P5.'optimize'() + setattribute self, 'body', $P4 .return(self) -# } -.annotate 'line', 7423 .end # optimize .sub 'emit' :method .param pmc __ARG_1 -# Body -# { -.annotate 'line', 7426 - getattribute $P1, self, 'initializer' + getattribute $P1, self, 'iteration' isnull $I1, $P1 - unless $I1 goto __label_3 -.annotate 'line', 7427 - getattribute $P2, self, 'condexpr' - isnull $I1, $P2 + not $I1 + getattribute $P3, self, 'initializer' + isnull $I2, $P3 + unless $I2 goto __label_3 + getattribute $P4, self, 'condexpr' + isnull $I2, $P4 __label_3: - unless $I1 goto __label_2 -.annotate 'line', 7428 - getattribute $P3, self, 'iteration' - isnull $I1, $P3 + unless $I2 goto __label_2 + not $I2, $I1 __label_2: - unless $I1 goto __label_1 -# { -.annotate 'line', 7429 + unless $I2 goto __label_1 self.'emit_infinite'(__ARG_1) -.annotate 'line', 7430 .return() -# } __label_1: # endif -.annotate 'line', 7432 + $P3 = __ARG_1.'getDebug'() + if_null $P3, __label_4 + unless $P3 goto __label_4 __ARG_1.'comment'('for loop') -.annotate 'line', 7433 -# continuelabel: $S1 - $P1 = self.'gencontinuelabel'() + __label_4: # endif + $P3 = self.'gencontinuelabel'() null $S1 - if_null $P1, __label_4 - set $S1, $P1 - __label_4: -.annotate 'line', 7434 -# breaklabel: $S2 - $P1 = self.'genbreaklabel'() - null $S2 - if_null $P1, __label_5 - set $S2, $P1 + if_null $P3, __label_5 + set $S1, $P3 __label_5: -.annotate 'line', 7435 -# condlabel: $S3 - $P1 = self.'genlabel'() - null $S3 - if_null $P1, __label_6 - set $S3, $P1 + $P3 = self.'genbreaklabel'() + null $S2 + if_null $P3, __label_6 + set $S2, $P3 __label_6: -.annotate 'line', 7436 - getattribute $P1, self, 'initializer' - if_null $P1, __label_7 -.annotate 'line', 7437 - getattribute $P2, self, 'initializer' - $P2.'emit'(__ARG_1) - __label_7: # endif -.annotate 'line', 7439 + unless $I1 goto __label_8 + $P3 = self.'genlabel'() + set $S3, $P3 + goto __label_7 + __label_8: + set $S3, $S1 + __label_7: + getattribute $P3, self, 'initializer' + if_null $P3, __label_9 + getattribute $P4, self, 'initializer' + $P4.'emit'(__ARG_1) + __label_9: # endif __ARG_1.'emitlabel'($S3, 'for condition') -.annotate 'line', 7440 - getattribute $P1, self, 'condexpr' - if_null $P1, __label_8 -.annotate 'line', 7441 + getattribute $P3, self, 'condexpr' + if_null $P3, __label_10 self.'emit_else'(__ARG_1, $S2) - __label_8: # endif -.annotate 'line', 7443 - getattribute $P1, self, 'body' - $P1.'emit'(__ARG_1) -.annotate 'line', 7444 + __label_10: # endif + getattribute $P3, self, 'body' + $P3.'emit'(__ARG_1) + unless $I1 goto __label_11 __ARG_1.'emitlabel'($S1, 'for iteration') -.annotate 'line', 7445 - getattribute $P1, self, 'iteration' - if_null $P1, __label_9 -.annotate 'line', 7446 -# unused: $S4 - getattribute $P3, self, 'iteration' - $P2 = $P3.'emit_get'(__ARG_1) - null $S4 - if_null $P2, __label_10 - set $S4, $P2 - __label_10: - __label_9: # endif -.annotate 'line', 7447 + if_null $P1, __label_13 + iter $P5, $P1 + set $P5, 0 + __label_12: # for iteration + unless $P5 goto __label_13 + shift $P2, $P5 + $P2.'emit_void'(__ARG_1) + goto __label_12 + __label_13: # endfor + __label_11: # endif __ARG_1.'emitgoto'($S3) -.annotate 'line', 7449 __ARG_1.'emitlabel'($S2, 'for end') -# } -.annotate 'line', 7450 .end # emit .sub Winxed_class_init :anon :load :init newclass $P0, [ 'Winxed'; 'Compiler'; 'ForStatement' ] -.annotate 'line', 7378 get_class $P1, [ 'Winxed'; 'Compiler'; 'LoopStatement' ] addparent $P0, $P1 get_class $P2, [ 'Winxed'; 'Compiler'; 'BlockStatement' ] addparent $P0, $P2 get_class $P3, [ 'Winxed'; 'Compiler'; 'ConditionalStatement' ] addparent $P0, $P3 -.annotate 'line', 7380 addattribute $P0, 'initializer' -.annotate 'line', 7381 addattribute $P0, 'iteration' .end .namespace [ 'Winxed'; 'Compiler'; 'ForeachStatement' ] @@ -21859,256 +17375,185 @@ .param pmc __ARG_3 .param pmc __ARG_4 .param string __ARG_5 -.const 'Sub' WSubId_96 = "WSubId_96" -.const 'Sub' WSubId_36 = "WSubId_36" -.const 'Sub' WSubId_53 = "WSubId_53" -# Body -# { -.annotate 'line', 7465 - self.'Statement'(__ARG_1, __ARG_3) -.annotate 'line', 7466 -# sname: $S1 - set $P1, __ARG_4 +.const 'Sub' WSubId_127 = "WSubId_127" +.const 'Sub' WSubId_68 = "WSubId_68" +.const 'Sub' WSubId_84 = "WSubId_84" + self.'BlockStatement'(__ARG_1, __ARG_3) + eq __ARG_5, '', __label_1 + $P1 = WSubId_127(__ARG_5) null $S1 - if_null $P1, __label_1 + if_null $P1, __label_2 set $S1, $P1 - __label_1: -.annotate 'line', 7467 - eq __ARG_5, '', __label_2 -# { -.annotate 'line', 7468 -# deftype: $S2 - $P1 = WSubId_96(__ARG_5) - null $S2 - if_null $P1, __label_3 - set $S2, $P1 - __label_3: -.annotate 'line', 7469 - self.'createvar'($S1, $S2) -.annotate 'line', 7470 - box $P1, $S2 + __label_2: + self.'createvar'(__ARG_4, $S1) + box $P1, $S1 setattribute self, 'deftype', $P1 -# } - __label_2: # endif -.annotate 'line', 7472 + __label_1: # endif setattribute self, 'varname', __ARG_4 -.annotate 'line', 7473 - $P2 = WSubId_36(__ARG_2, self) + $P2 = WSubId_68(__ARG_2, self) setattribute self, 'container', $P2 -.annotate 'line', 7474 - WSubId_53(')', __ARG_2) -.annotate 'line', 7475 + WSubId_84(')', __ARG_2) self.'parsebody'(__ARG_2) -# } -.annotate 'line', 7476 .end # ForeachStatement +.sub 'clone' :method + .param pmc __ARG_1 + new $P1, [ 'Winxed'; 'Compiler'; 'ForeachStatement' ] + getattribute $P4, self, 'start' + $P1.'BlockStatement'($P4, __ARG_1) + getattribute $P2, self, 'deftype' + getattribute $P3, self, 'varname' + if_null $P2, __label_1 + $P1.'createvar'($P3, $P2) + __label_1: # endif + setattribute $P1, 'deftype', $P2 + setattribute $P1, 'varname', $P3 + getattribute $P6, self, 'container' + $P5 = $P6.'clone'($P1) + setattribute $P1, 'container', $P5 + getattribute $P6, self, 'body' + $P5 = $P6.'clone'($P1) + setattribute $P1, 'body', $P5 + .return($P1) + +.end # clone + + .sub 'optimize' :method -# Body -# { -.annotate 'line', 7479 -# var container: $P1 getattribute $P2, self, 'container' $P1 = $P2.'optimize'() -.annotate 'line', 7483 - $I1 = $P1.'isnull'() - if $I1 goto __label_2 -.annotate 'line', 7484 - $I1 = $P1.'isstringliteral'() - unless $I1 goto __label_3 -.annotate 'line', 7485 - $P2 = $P1.'get_value'() - set $S1, $P2 -# predefined length + $P2 = $P1.'isnull'() + if $P2 goto __label_2 + $P2 = $P1.'isstringliteral'() + unless $P2 goto __label_3 + $P3 = $P1.'get_value'() + set $S1, $P3 length $I2, $S1 iseq $I1, $I2, 0 + box $P2, $I1 __label_3: __label_2: - unless $I1 goto __label_1 -.annotate 'line', 7486 - new $P3, [ 'Winxed'; 'Compiler'; 'EmptyStatement' ] - .return($P3) + if_null $P2, __label_1 + unless $P2 goto __label_1 + new $P4, [ 'Winxed'; 'Compiler'; 'EmptyStatement' ] + .return($P4) __label_1: # endif -.annotate 'line', 7488 setattribute self, 'container', $P1 -.annotate 'line', 7489 getattribute $P4, self, 'body' $P3 = $P4.'optimize'() setattribute self, 'body', $P3 -.annotate 'line', 7490 .return(self) -# } -.annotate 'line', 7491 .end # optimize .sub 'emit' :method .param pmc __ARG_1 -.const 'Sub' WSubId_61 = "WSubId_61" -# Body -# { -.annotate 'line', 7494 +.const 'Sub' WSubId_91 = "WSubId_91" self.'annotate'(__ARG_1) -.annotate 'line', 7495 -# regcont: $S1 null $S1 -.annotate 'line', 7496 getattribute $P3, self, 'container' $P2 = $P3.'checkresult'() set $S6, $P2 ne $S6, 'S', __label_1 -# { -.annotate 'line', 7497 -# value: $S2 getattribute $P5, self, 'container' $P4 = $P5.'emit_get'(__ARG_1) null $S2 if_null $P4, __label_3 set $S2, $P4 __label_3: -.annotate 'line', 7498 $P2 = self.'tempreg'('P') set $S1, $P2 -.annotate 'line', 7499 __ARG_1.'emitbox'($S1, $S2) -# } goto __label_2 __label_1: # else -.annotate 'line', 7502 getattribute $P3, self, 'container' $P2 = $P3.'emit_get'(__ARG_1) set $S1, $P2 __label_2: # endif -.annotate 'line', 7504 -# var itvar: $P1 getattribute $P2, self, 'varname' $P1 = self.'getvar'($P2) -.annotate 'line', 7505 unless_null $P1, __label_4 -.annotate 'line', 7506 getattribute $P2, self, 'varname' - WSubId_61($P2) + WSubId_91($P2, self) __label_4: # endif -.annotate 'line', 7508 -# iterator: $S3 $P2 = self.'createreg'('P') null $S3 if_null $P2, __label_5 set $S3, $P2 __label_5: -.annotate 'line', 7509 -# continuelabel: $S4 $P2 = self.'gencontinuelabel'() null $S4 if_null $P2, __label_6 set $S4, $P2 __label_6: -.annotate 'line', 7510 -# breaklabel: $S5 $P2 = self.'genbreaklabel'() null $S5 if_null $P2, __label_7 set $S5, $P2 __label_7: -.annotate 'line', 7511 __ARG_1.'emitif_null'($S1, $S5) -.annotate 'line', 7512 __ARG_1.'emitarg2'('iter', $S3, $S1) -.annotate 'line', 7513 __ARG_1.'emitset'($S3, '0') -.annotate 'line', 7514 __ARG_1.'emitlabel'($S4, 'for iteration') -.annotate 'line', 7515 __ARG_1.'emitunless'($S3, $S5) -.annotate 'line', 7516 $P2 = $P1.'getreg'() __ARG_1.'emitarg2'('shift', $P2, $S3) -.annotate 'line', 7517 getattribute $P2, self, 'body' $P2.'emit'(__ARG_1) -.annotate 'line', 7518 __ARG_1.'emitgoto'($S4) -.annotate 'line', 7519 __ARG_1.'emitlabel'($S5, 'endfor') -# } -.annotate 'line', 7520 .end # emit .sub Winxed_class_init :anon :load :init newclass $P0, [ 'Winxed'; 'Compiler'; 'ForeachStatement' ] -.annotate 'line', 7457 get_class $P1, [ 'Winxed'; 'Compiler'; 'LoopStatement' ] addparent $P0, $P1 get_class $P2, [ 'Winxed'; 'Compiler'; 'BlockStatement' ] addparent $P0, $P2 -.annotate 'line', 7459 addattribute $P0, 'deftype' -.annotate 'line', 7460 addattribute $P0, 'varname' -.annotate 'line', 7461 addattribute $P0, 'container' .end .namespace [ 'Winxed'; 'Compiler' ] -.sub 'parseFor' :subid('WSubId_50') +.sub 'parseFor' :subid('WSubId_82') .param pmc __ARG_1 .param pmc __ARG_2 .param pmc __ARG_3 -.const 'Sub' WSubId_53 = "WSubId_53" -# Body -# { -.annotate 'line', 7527 - WSubId_53('(', __ARG_2) -.annotate 'line', 7528 -# var aux: $P1 +.const 'Sub' WSubId_84 = "WSubId_84" + WSubId_84('(', __ARG_2) $P1 = __ARG_2.'get'() -.annotate 'line', 7529 -# var in1: $P2 $P2 = __ARG_2.'get'() -.annotate 'line', 7530 $P4 = $P2.'iskeyword'('in') if_null $P4, __label_1 unless $P4 goto __label_1 -.annotate 'line', 7531 new $P6, [ 'Winxed'; 'Compiler'; 'ForeachStatement' ] $P6.'ForeachStatement'(__ARG_1, __ARG_2, __ARG_3, $P1, '') set $P5, $P6 .return($P5) goto __label_2 __label_1: # else -# { -.annotate 'line', 7533 -# var in2: $P3 $P3 = __ARG_2.'get'() -.annotate 'line', 7534 $P4 = $P3.'iskeyword'('in') if_null $P4, __label_3 unless $P4 goto __label_3 -.annotate 'line', 7535 new $P6, [ 'Winxed'; 'Compiler'; 'ForeachStatement' ] $P6.'ForeachStatement'(__ARG_1, __ARG_2, __ARG_3, $P2, $P1) set $P5, $P6 .return($P5) __label_3: # endif -.annotate 'line', 7536 __ARG_2.'unget'($P3) -.annotate 'line', 7537 __ARG_2.'unget'($P2) -.annotate 'line', 7538 __ARG_2.'unget'($P1) -# } __label_2: # endif -.annotate 'line', 7540 new $P5, [ 'Winxed'; 'Compiler'; 'ForStatement' ] $P5.'ForStatement'(__ARG_1, __ARG_2, __ARG_3) set $P4, $P5 .return($P4) -# } -.annotate 'line', 7541 .end # parseFor @@ -22118,84 +17563,76 @@ .param pmc __ARG_1 .param pmc __ARG_2 .param pmc __ARG_3 -.const 'Sub' WSubId_36 = "WSubId_36" -# Body -# { -.annotate 'line', 7553 +.const 'Sub' WSubId_68 = "WSubId_68" self.'Statement'(__ARG_1, __ARG_3) -.annotate 'line', 7554 - $P2 = WSubId_36(__ARG_2, self) + $P2 = WSubId_68(__ARG_2, self) setattribute self, 'excep', $P2 -# } -.annotate 'line', 7555 .end # ThrowStatement +.sub 'clone' :method + .param pmc __ARG_1 + new $P1, [ 'Winxed'; 'Compiler'; 'ThrowStatement' ] + getattribute $P2, self, 'start' + $P1.'Statement'($P2, __ARG_1) + getattribute $P4, self, 'excep' + $P3 = $P4.'clone'(__ARG_1) + setattribute $P1, 'excep', $P3 + .return($P1) + +.end # clone + + .sub 'optimize' :method -# Body -# { -.annotate 'line', 7558 getattribute $P3, self, 'excep' $P2 = $P3.'optimize'() setattribute self, 'excep', $P2 -.annotate 'line', 7559 .return(self) -# } -.annotate 'line', 7560 .end # optimize .sub 'emit' :method .param pmc __ARG_1 -.const 'Sub' WSubId_1 = "WSubId_1" -# Body -# { -.annotate 'line', 7563 -# var excep: $P1 +.const 'Sub' WSubId_45 = "WSubId_45" +.const 'Sub' WSubId_25 = "WSubId_25" getattribute $P1, self, 'excep' -.annotate 'line', 7564 -# reg: $S1 $P2 = $P1.'emit_get'(__ARG_1) null $S1 if_null $P2, __label_1 set $S1, $P2 __label_1: -.annotate 'line', 7565 self.'annotate'(__ARG_1) -# switch -.annotate 'line', 7566 $P2 = $P1.'checkresult'() - set $S2, $P2 - set $S3, 'P' - if $S2 == $S3 goto __label_4 - set $S3, 'S' - if $S2 == $S3 goto __label_5 - goto __label_3 + set $S3, $P2 + if_null $S3, __label_2 + length $I1, $S3 + ne $I1, 1, __label_2 + ord $I1, $S3 + if $I1 == 80 goto __label_4 + if $I1 == 83 goto __label_5 + goto __label_2 __label_4: # case -.annotate 'line', 7568 - __ARG_1.'emitarg1'('throw', $S1) - goto __label_2 # break + goto __label_3 # break __label_5: # case -.annotate 'line', 7571 - __ARG_1.'emitarg1'('die', $S1) - goto __label_2 # break - __label_3: # default -.annotate 'line', 7574 - WSubId_1("Invalid throw argument", self) - __label_2: # switch end -# } -.annotate 'line', 7576 + set $S2, $S1 + $P3 = self.'tempreg'('P') + set $S1, $P3 + $P4 = WSubId_45(" root_new %0, ['parrot';'Exception']\n %0['message'] = %1\n", $S1, $S2) + __ARG_1.'print'($P4) + goto __label_3 # break + __label_2: # default + WSubId_25("Invalid throw argument", self) + __label_3: # switch end + __ARG_1.'emitarg1'('throw', $S1) .end # emit .sub Winxed_class_init :anon :load :init newclass $P0, [ 'Winxed'; 'Compiler'; 'ThrowStatement' ] -.annotate 'line', 7547 get_class $P1, [ 'Winxed'; 'Compiler'; 'Statement' ] addparent $P0, $P1 -.annotate 'line', 7549 addattribute $P0, 'excep' .end .namespace [ 'Winxed'; 'Compiler'; 'TryModifierList' ] @@ -22204,128 +17641,89 @@ .param pmc __ARG_1 .param pmc __ARG_2 .param pmc __ARG_3 -# Body -# { -.annotate 'line', 7588 setattribute self, 'start', __ARG_1 -.annotate 'line', 7589 self.'ModifierList'(__ARG_2, __ARG_3) -# } -.annotate 'line', 7590 .end # TryModifierList +.sub 'allowtailcall' :method + $P1 = self.'pick'('allowtailcall') + isnull $I1, $P1 + not $I1 + .return($I1) + +.end # allowtailcall + + .sub 'emitmodifiers' :method .param pmc __ARG_1 .param string __ARG_2 -.const 'Sub' WSubId_1 = "WSubId_1" -# Body -# { -.annotate 'line', 7593 -# var modiflist: $P1 +.const 'Sub' WSubId_25 = "WSubId_25" +.const 'Sub' WSubId_45 = "WSubId_45" $P1 = self.'getlist'() -.annotate 'line', 7594 if_null $P1, __label_2 iter $P6, $P1 set $P6, 0 __label_1: # for iteration unless $P6 goto __label_2 shift $P2, $P6 -# { -.annotate 'line', 7595 -# modifname: $S1 $P7 = $P2.'getname'() null $S1 if_null $P7, __label_3 set $S1, $P7 __label_3: -.annotate 'line', 7596 -# nargs: $I1 $P7 = $P2.'numargs'() set $I1, $P7 -# switch -.annotate 'line', 7597 - set $S3, $S1 - set $S4, 'min_severity' - if $S3 == $S4 goto __label_6 - set $S4, 'max_severity' - if $S3 == $S4 goto __label_7 - set $S4, 'handle_types' - if $S3 == $S4 goto __label_8 - set $S4, 'handle_types_except' - if $S3 == $S4 goto __label_9 - goto __label_5 + if $S1 == 'min_severity' goto __label_6 + if $S1 == 'max_severity' goto __label_7 + if $S1 == 'handle_types' goto __label_8 + if $S1 == 'handle_types_except' goto __label_9 + if $S1 == 'allowtailcall' goto __label_10 + goto __label_4 __label_6: # case __label_7: # case -.annotate 'line', 7600 - eq $I1, 1, __label_10 -.annotate 'line', 7601 - WSubId_1('Wrong modifier args', self) - __label_10: # endif -.annotate 'line', 7602 -# var arg: $P3 + eq $I1, 1, __label_11 + WSubId_25('Wrong modifier args', self) + __label_11: # endif $P3 = $P2.'getarg'(0) -.annotate 'line', 7603 -# argreg: $S2 - $P7 = $P3.'emit_get'(__ARG_1) - null $S2 - if_null $P7, __label_11 - set $S2, $P7 - __label_11: -.annotate 'line', 7604 - __ARG_1.'say'(' ', __ARG_2, ".'", $S1, "'(", $S2, ")") - goto __label_4 # break + $P8 = $P3.'emit_get'(__ARG_1) + $P7 = WSubId_45(" %0.'%1'(%2)", __ARG_2, $S1, $P8) + __ARG_1.'say'($P7) + goto __label_5 # break __label_8: # case __label_9: # case -.annotate 'line', 7608 new $P4, ['ResizableStringArray'] -# for loop -.annotate 'line', 7609 -# i: $I2 null $I2 __label_14: # for condition ge $I2, $I1, __label_13 -# { -.annotate 'line', 7610 -# var arg: $P5 $P5 = $P2.'getarg'($I2) -.annotate 'line', 7611 $P7 = $P5.'emit_get'(__ARG_1) -# predefined push push $P4, $P7 -# } __label_12: # for iteration -.annotate 'line', 7609 inc $I2 goto __label_14 __label_13: # for end -.annotate 'line', 7614 -# predefined join - join $S3, ', ', $P4 -.annotate 'line', 7613 - __ARG_1.'say'(' ', __ARG_2, ".'", $S1, "'(", $S3, ")") - goto __label_4 # break - __label_5: # default -.annotate 'line', 7617 - concat $S4, "Modifier '", $S1 - concat $S4, $S4, "' not valid for try" - WSubId_1($S4, self) - __label_4: # switch end -# } + join $S2, ', ', $P4 + $P7 = WSubId_45(" %0.'%1'(%2)", __ARG_2, $S1, $S2) + __ARG_1.'say'($P7) + goto __label_5 # break + __label_10: # case + goto __label_5 # break + __label_4: # default + concat $S3, "Modifier '", $S1 + concat $S3, $S3, "' not valid for try" + WSubId_25($S3, self) + __label_5: # switch end goto __label_1 __label_2: # endfor -# } -.annotate 'line', 7620 .end # emitmodifiers .sub Winxed_class_init :anon :load :init newclass $P0, [ 'Winxed'; 'Compiler'; 'TryModifierList' ] -.annotate 'line', 7583 get_class $P1, [ 'Winxed'; 'Compiler'; 'ModifierList' ] addparent $P0, $P1 -.annotate 'line', 7585 addattribute $P0, 'start' .end .namespace [ 'Winxed'; 'Compiler'; 'TryStatement' ] @@ -22334,221 +17732,170 @@ .param pmc __ARG_1 .param pmc __ARG_2 .param pmc __ARG_3 -.const 'Sub' WSubId_94 = "WSubId_94" -.const 'Sub' WSubId_2 = "WSubId_2" -.const 'Sub' WSubId_39 = "WSubId_39" -# Body -# { -.annotate 'line', 7632 - self.'Statement'(__ARG_1, __ARG_3) -.annotate 'line', 7633 -# var t: $P1 +.const 'Sub' WSubId_125 = "WSubId_125" +.const 'Sub' WSubId_26 = "WSubId_26" +.const 'Sub' WSubId_70 = "WSubId_70" + self.'BlockStatement'(__ARG_1, __ARG_3) $P1 = __ARG_2.'get'() -.annotate 'line', 7634 $P2 = $P1.'isop'('[') if_null $P2, __label_1 unless $P2 goto __label_1 -.annotate 'line', 7635 new $P5, [ 'Winxed'; 'Compiler'; 'TryModifierList' ] $P5.'TryModifierList'($P1, __ARG_2, self) set $P4, $P5 setattribute self, 'modifiers', $P4 goto __label_2 __label_1: # else -.annotate 'line', 7637 __ARG_2.'unget'($P1) __label_2: # endif -.annotate 'line', 7639 - $P3 = WSubId_94(__ARG_2, self) + $P3 = WSubId_125(__ARG_2, self) setattribute self, 'stry', $P3 -.annotate 'line', 7640 $P1 = __ARG_2.'get'() -.annotate 'line', 7641 $P2 = $P1.'iskeyword'('catch') isfalse $I1, $P2 unless $I1 goto __label_3 -.annotate 'line', 7642 - WSubId_2('catch', $P1) + WSubId_26('catch', $P1) __label_3: # endif -.annotate 'line', 7643 $P1 = __ARG_2.'get'() -.annotate 'line', 7644 $P2 = $P1.'isop'('(') isfalse $I1, $P2 unless $I1 goto __label_4 -.annotate 'line', 7645 - WSubId_39("'(' after 'catch'", $P1) + WSubId_70("'(' after 'catch'", $P1) __label_4: # endif -.annotate 'line', 7646 $P1 = __ARG_2.'get'() -.annotate 'line', 7647 $P2 = $P1.'isop'(')') isfalse $I1, $P2 unless $I1 goto __label_5 -# { -.annotate 'line', 7648 -# exname: $S1 $P3 = $P1.'getidentifier'() null $S1 if_null $P3, __label_6 set $S1, $P3 __label_6: -.annotate 'line', 7649 setattribute self, 'exname', $P1 -.annotate 'line', 7650 self.'createvar'($S1, 'P') -.annotate 'line', 7651 $P1 = __ARG_2.'get'() -.annotate 'line', 7652 $P2 = $P1.'isop'(')') isfalse $I1, $P2 unless $I1 goto __label_7 -.annotate 'line', 7653 - WSubId_39("')' in 'catch'", $P1) + WSubId_70("')' in 'catch'", $P1) __label_7: # endif -# } __label_5: # endif -.annotate 'line', 7655 - $P3 = WSubId_94(__ARG_2, self) + $P3 = WSubId_125(__ARG_2, self) setattribute self, 'scatch', $P3 -# } -.annotate 'line', 7656 .end # TryStatement +.sub 'allowtailcall' :method + getattribute $P1, self, 'modifiers' + if_null $P1, __label_1 + getattribute $P2, self, 'modifiers' + .tailcall $P2.'allowtailcall'() + goto __label_2 + __label_1: # else + .return(0) + __label_2: # endif + +.end # allowtailcall + + .sub 'optimize' :method -# Body -# { -.annotate 'line', 7659 getattribute $P1, self, 'modifiers' if_null $P1, __label_1 -.annotate 'line', 7660 getattribute $P2, self, 'modifiers' $P2.'optimize'() __label_1: # endif -.annotate 'line', 7661 getattribute $P3, self, 'stry' $P2 = $P3.'optimize'() setattribute self, 'stry', $P2 -.annotate 'line', 7662 getattribute $P3, self, 'scatch' $P2 = $P3.'optimize'() setattribute self, 'scatch', $P2 -.annotate 'line', 7663 .return(self) -# } -.annotate 'line', 7664 .end # optimize .sub 'emit' :method .param pmc __ARG_1 -# Body -# { -.annotate 'line', 7667 -# reghandler: $S1 +.const 'Sub' WSubId_45 = "WSubId_45" $P1 = self.'tempreg'('P') null $S1 if_null $P1, __label_1 set $S1, $P1 __label_1: -.annotate 'line', 7668 -# labelhandler: $S2 $P1 = self.'genlabel'() null $S2 if_null $P1, __label_2 set $S2, $P1 __label_2: -.annotate 'line', 7669 -# labelpasthandler: $S3 $P1 = self.'genlabel'() null $S3 if_null $P1, __label_3 set $S3, $P1 __label_3: -.annotate 'line', 7670 -# exreg: $S4 getattribute $P2, self, 'exname' if_null $P2, __label_5 -.annotate 'line', 7671 getattribute $P4, self, 'exname' $P3 = self.'getvar'($P4) $P1 = $P3.'getreg'() goto __label_4 __label_5: -.annotate 'line', 7672 - $P1 = self.'tempreg'('P') + $P5 = self.'tempreg'('P') + set $P1, $P5 __label_4: null $S4 if_null $P1, __label_6 set $S4, $P1 __label_6: -.annotate 'line', 7674 + $P1 = __ARG_1.'getDebug'() + set $I1, $P1 self.'annotate'(__ARG_1) -.annotate 'line', 7675 + unless $I1 goto __label_7 __ARG_1.'comment'('try: create handler') -.annotate 'line', 7677 - __ARG_1.'say'(' ', 'new ', $S1, ", 'ExceptionHandler'") -.annotate 'line', 7678 - __ARG_1.'say'(' ', 'set_label ', $S1, ', ', $S2) -.annotate 'line', 7680 + __label_7: # endif + $P1 = WSubId_45(" new %0, 'ExceptionHandler'\n set_label %0, %1\n", $S1, $S2) + __ARG_1.'print'($P1) getattribute $P1, self, 'modifiers' - if_null $P1, __label_7 -.annotate 'line', 7681 + if_null $P1, __label_8 getattribute $P2, self, 'modifiers' $P2.'emitmodifiers'(__ARG_1, $S1) - __label_7: # endif -.annotate 'line', 7683 + __label_8: # endif __ARG_1.'emitarg1'('push_eh', $S1) -.annotate 'line', 7684 + unless $I1 goto __label_9 __ARG_1.'comment'('try: begin') -.annotate 'line', 7685 + __label_9: # endif getattribute $P1, self, 'stry' $P1.'emit'(__ARG_1) -.annotate 'line', 7686 + unless $I1 goto __label_10 __ARG_1.'comment'('try: end') -.annotate 'line', 7687 + __label_10: # endif __ARG_1.'say'(' ', 'pop_eh') -.annotate 'line', 7689 self.'annotate'(__ARG_1) -.annotate 'line', 7690 __ARG_1.'emitgoto'($S3) -.annotate 'line', 7692 + unless $I1 goto __label_11 __ARG_1.'comment'('catch') -.annotate 'line', 7693 + __label_11: # endif __ARG_1.'emitlabel'($S2) -.annotate 'line', 7694 __ARG_1.'say'(' ', '.get_results(', $S4, ')') -.annotate 'line', 7695 __ARG_1.'emitarg1'('finalize', $S4) -.annotate 'line', 7696 __ARG_1.'say'(' ', 'pop_eh') -.annotate 'line', 7697 getattribute $P1, self, 'scatch' $P1.'emit'(__ARG_1) -.annotate 'line', 7699 + unless $I1 goto __label_12 __ARG_1.'comment'('catch end') -.annotate 'line', 7700 + __label_12: # endif __ARG_1.'emitlabel'($S3) -# } -.annotate 'line', 7701 .end # emit .sub Winxed_class_init :anon :load :init newclass $P0, [ 'Winxed'; 'Compiler'; 'TryStatement' ] -.annotate 'line', 7623 get_class $P1, [ 'Winxed'; 'Compiler'; 'BlockStatement' ] addparent $P0, $P1 -.annotate 'line', 7625 addattribute $P0, 'stry' -.annotate 'line', 7626 addattribute $P0, 'modifiers' -.annotate 'line', 7627 addattribute $P0, 'exname' -.annotate 'line', 7628 addattribute $P0, 'scatch' .end .namespace [ 'Winxed'; 'Compiler'; 'VarBaseStatement' ] @@ -22558,32 +17905,23 @@ .param pmc __ARG_2 .param pmc __ARG_3 .param int __ARG_4 :optional -# Body -# { -.annotate 'line', 7714 self.'Statement'(__ARG_1, __ARG_2) -.annotate 'line', 7715 setattribute self, 'name', __ARG_3 -.annotate 'line', 7716 -# var vdata: $P1 $P1 = self.'createvar'(__ARG_3, 'P', __ARG_4) -.annotate 'line', 7717 $P3 = $P1.'getreg'() setattribute self, 'reg', $P3 -# } -.annotate 'line', 7718 + box $P2, __ARG_4 + setattribute self, 'flags', $P2 .end # initvarbase .sub Winxed_class_init :anon :load :init newclass $P0, [ 'Winxed'; 'Compiler'; 'VarBaseStatement' ] -.annotate 'line', 7708 get_class $P1, [ 'Winxed'; 'Compiler'; 'Statement' ] addparent $P0, $P1 -.annotate 'line', 7710 addattribute $P0, 'name' -.annotate 'line', 7711 addattribute $P0, 'reg' + addattribute $P0, 'flags' .end .namespace [ 'Winxed'; 'Compiler'; 'DeclareBase' ] @@ -22592,30 +17930,26 @@ .param pmc __ARG_2 .param pmc __ARG_3 .param string __ARG_4 -# Body -# { -.annotate 'line', 7733 + .param string __ARG_5 self.'Statement'(__ARG_1, __ARG_2) -.annotate 'line', 7734 setattribute self, 'name', __ARG_3 -.annotate 'line', 7735 - box $P1, __ARG_4 - setattribute self, 'basetype', $P1 -# } -.annotate 'line', 7736 + box $P2, __ARG_4 + setattribute self, 'basetype', $P2 + box $P2, __ARG_5 + setattribute self, 'regtype', $P2 + $P1 = self.'createvar'(__ARG_3, __ARG_5) + $P3 = $P1.'getreg'() + setattribute self, 'reg', $P3 .end # DeclareBase .sub Winxed_class_init :anon :load :init newclass $P0, [ 'Winxed'; 'Compiler'; 'DeclareBase' ] -.annotate 'line', 7725 get_class $P1, [ 'Winxed'; 'Compiler'; 'Statement' ] addparent $P0, $P1 -.annotate 'line', 7727 addattribute $P0, 'name' -.annotate 'line', 7728 addattribute $P0, 'basetype' -.annotate 'line', 7729 + addattribute $P0, 'regtype' addattribute $P0, 'reg' .end .namespace [ 'Winxed'; 'Compiler'; 'DeclareSingleStatement' ] @@ -22626,203 +17960,180 @@ .param pmc __ARG_3 .param string __ARG_4 .param pmc __ARG_5 -.const 'Sub' WSubId_36 = "WSubId_36" -# Body -# { -.annotate 'line', 7747 - self.'DeclareBase'(__ARG_1, __ARG_2, __ARG_3, __ARG_4) -.annotate 'line', 7748 -# var vdata: $P1 - getattribute $P3, self, 'name' - getattribute $P4, self, 'basetype' - $P1 = self.'createvar'($P3, $P4) -.annotate 'line', 7749 - $P4 = $P1.'getreg'() - setattribute self, 'reg', $P4 -.annotate 'line', 7750 -# var t: $P2 - $P2 = __ARG_5.'get'() -.annotate 'line', 7751 - $P3 = $P2.'isop'('=') - if_null $P3, __label_1 - unless $P3 goto __label_1 -# { -.annotate 'line', 7753 - $P5 = WSubId_36(__ARG_5, self) - setattribute self, 'init', $P5 -# } +.const 'Sub' WSubId_68 = "WSubId_68" + self.'DeclareBase'(__ARG_1, __ARG_2, __ARG_3, __ARG_4, __ARG_4) + $P1 = __ARG_5.'get'() + $P2 = $P1.'isop'('=') + if_null $P2, __label_1 + unless $P2 goto __label_1 + $P4 = WSubId_68(__ARG_5, self) + setattribute self, 'init', $P4 goto __label_2 __label_1: # else -.annotate 'line', 7756 - __ARG_5.'unget'($P2) + __ARG_5.'unget'($P1) __label_2: # endif -# } -.annotate 'line', 7757 .end # DeclareSingleStatement +.sub 'clonedeclare' :method + .param pmc __ARG_1 + .param pmc __ARG_2 + getattribute $P1, self, 'start' + getattribute $P2, self, 'name' + getattribute $P3, self, 'basetype' + getattribute $P4, self, 'regtype' + __ARG_1.'DeclareBase'($P1, __ARG_2, $P2, $P3, $P4) + getattribute $P1, self, 'init' + if_null $P1, __label_1 + getattribute $P4, self, 'init' + $P3 = $P4.'clone'(__ARG_2) + setattribute __ARG_1, 'init', $P3 + __label_1: # endif + .return(__ARG_1) + +.end # clonedeclare + + .sub 'optimize' :method -# Body -# { -.annotate 'line', 7760 -# var init: $P1 getattribute $P1, self, 'init' -.annotate 'line', 7761 if_null $P1, __label_1 -.annotate 'line', 7762 $P3 = $P1.'optimize'() setattribute self, 'init', $P3 __label_1: # endif -.annotate 'line', 7763 .return(self) -# } -.annotate 'line', 7764 .end # optimize .sub 'emit' :method .param pmc __ARG_1 -.const 'Sub' WSubId_1 = "WSubId_1" -# Body -# { -.annotate 'line', 7767 +.const 'Sub' WSubId_48 = "WSubId_48" +.const 'Sub' WSubId_128 = "WSubId_128" +.const 'Sub' WSubId_47 = "WSubId_47" +.const 'Sub' WSubId_30 = "WSubId_30" +.const 'Sub' WSubId_25 = "WSubId_25" self.'annotate'(__ARG_1) -.annotate 'line', 7768 -# name: $S1 getattribute $P2, self, 'name' null $S1 if_null $P2, __label_1 set $S1, $P2 __label_1: -.annotate 'line', 7769 -# reg: $S2 getattribute $P2, self, 'reg' null $S2 if_null $P2, __label_2 set $S2, $P2 __label_2: -.annotate 'line', 7770 -# basetype: $S3 - getattribute $P2, self, 'basetype' null $S3 + getattribute $P2, self, 'basetype' + null $S4 if_null $P2, __label_3 - set $S3, $P2 + set $S4, $P2 __label_3: -.annotate 'line', 7771 -# var init: $P1 getattribute $P1, self, 'init' -.annotate 'line', 7772 + $P2 = __ARG_1.'getDebug'() + if_null $P2, __label_4 + unless $P2 goto __label_4 concat $S7, $S1, ': ' concat $S7, $S7, $S2 __ARG_1.'comment'($S7) -.annotate 'line', 7774 + __label_4: # endif isnull $I1, $P1 - if $I1 goto __label_6 - $I1 = $P1.'isnull'() - __label_6: - unless $I1 goto __label_4 -.annotate 'line', 7775 - __ARG_1.'emitnull'($S2) - goto __label_5 - __label_4: # else -# { -.annotate 'line', 7777 -# itype: $S4 - $P2 = $P1.'checkresult'() - null $S4 - if_null $P2, __label_7 - set $S4, $P2 + box $P2, $I1 + if $P2 goto __label_7 + $P2 = $P1.'isnull'() __label_7: -.annotate 'line', 7778 - ne $S4, $S3, __label_8 -.annotate 'line', 7779 - $P1.'emit'(__ARG_1, $S2) - goto __label_9 - __label_8: # else -# { -.annotate 'line', 7781 + if_null $P2, __label_5 + unless $P2 goto __label_5 + __ARG_1.'emitnull'($S2) + goto __label_6 + __label_5: # else + $P3 = $P1.'checkresult'() + null $S5 + if_null $P3, __label_8 + set $S5, $P3 + __label_8: + ne $S5, $S4, __label_9 + $P1.'emit_init'(__ARG_1, $S2) + goto __label_10 + __label_9: # else isa $I1, $P1, [ 'Winxed'; 'Compiler'; 'IndexExpr' ] - unless $I1 goto __label_10 -# { -.annotate 'line', 7783 + unless $I1 goto __label_11 $P1.'emit'(__ARG_1, $S2) -# } - goto __label_11 - __label_10: # else -# { -.annotate 'line', 7786 -# ireg: $S5 - null $S5 -# switch -.annotate 'line', 7787 - set $S7, $S4 - set $S8, 'v' - if $S7 == $S8 goto __label_14 - set $S8, '' - if $S7 == $S8 goto __label_15 - goto __label_13 - __label_14: # case -.annotate 'line', 7789 - WSubId_1('Invalid initialization from void value', self) - __label_15: # case -.annotate 'line', 7791 + goto __label_12 + __label_11: # else + $P2 = $P1.'isliteral'() + if_null $P2, __label_13 + unless $P2 goto __label_13 + if_null $S4, __label_15 + length $I1, $S4 + ne $I1, 1, __label_15 + ord $I1, $S4 + if $I1 == 73 goto __label_17 + if $I1 == 78 goto __label_18 + if $I1 == 83 goto __label_19 + goto __label_15 + __label_17: # case + $P3 = WSubId_48($P1) + set $S3, $P3 + __ARG_1.'emitset'($S2, $S3) + goto __label_16 # break + __label_18: # case + $P4 = WSubId_128($P1) + set $S3, $P4 + __ARG_1.'emitset'($S2, $S3) + goto __label_16 # break + __label_19: # case + $P5 = WSubId_47($P1) + set $S3, $P5 + __ARG_1.'emitset'($S2, $S3) + goto __label_16 # break + __label_15: # default + WSubId_30("Wrong type", self) + __label_16: # switch end + goto __label_14 + __label_13: # else + if_null $S5, __label_20 + length $I1, $S5 + ne $I1, 1, __label_20 + ord $I1, $S5 + if $I1 == 118 goto __label_22 + goto __label_20 + __label_22: # case + WSubId_25('Invalid initialization from void value', self) + __label_20: # default $P2 = $P1.'emit_get'(__ARG_1) - set $S5, $P2 - goto __label_12 # break - __label_13: # default -.annotate 'line', 7794 - $P3 = self.'tempreg'($S4) - set $S5, $P3 -.annotate 'line', 7795 - $P1.'emit'(__ARG_1, $S5) - __label_12: # switch end -.annotate 'line', 7797 - iseq $I1, $S3, 'S' - unless $I1 goto __label_18 - iseq $I1, $S4, 'P' - __label_18: - unless $I1 goto __label_16 -# { -.annotate 'line', 7798 -# auxlabel: $S6 + set $S3, $P2 + __label_21: # switch end + iseq $I1, $S4, 'S' + unless $I1 goto __label_25 + iseq $I1, $S5, 'P' + __label_25: + unless $I1 goto __label_23 $P2 = self.'genlabel'() null $S6 - if_null $P2, __label_19 + if_null $P2, __label_26 set $S6, $P2 - __label_19: -.annotate 'line', 7799 + __label_26: __ARG_1.'emitnull'($S2) -.annotate 'line', 7800 - __ARG_1.'emitif_null'($S5, $S6) -.annotate 'line', 7801 - __ARG_1.'emitset'($S2, $S5) -.annotate 'line', 7802 + __ARG_1.'emitif_null'($S3, $S6) + __ARG_1.'emitset'($S2, $S3) __ARG_1.'emitlabel'($S6) -# } - goto __label_17 - __label_16: # else -.annotate 'line', 7805 - __ARG_1.'emitset'($S2, $S5) - __label_17: # endif -# } - __label_11: # endif -# } - __label_9: # endif -# } - __label_5: # endif -# } -.annotate 'line', 7809 + goto __label_24 + __label_23: # else + __ARG_1.'emitset'($S2, $S3) + __label_24: # endif + __label_14: # endif + __label_12: # endif + __label_10: # endif + __label_6: # endif .end # emit .sub Winxed_class_init :anon :load :init newclass $P0, [ 'Winxed'; 'Compiler'; 'DeclareSingleStatement' ] -.annotate 'line', 7741 get_class $P1, [ 'Winxed'; 'Compiler'; 'DeclareBase' ] addparent $P0, $P1 -.annotate 'line', 7743 addattribute $P0, 'init' .end .namespace [ 'Winxed'; 'Compiler'; 'DeclareArrayStatement' ] @@ -22834,280 +18145,236 @@ .param string __ARG_4 .param string __ARG_5 .param pmc __ARG_6 -.const 'Sub' WSubId_36 = "WSubId_36" -.const 'Sub' WSubId_53 = "WSubId_53" -.const 'Sub' WSubId_39 = "WSubId_39" -.const 'Sub' WSubId_35 = "WSubId_35" -# Body -# { -.annotate 'line', 7824 - self.'DeclareBase'(__ARG_1, __ARG_2, __ARG_3, __ARG_4) -.annotate 'line', 7825 - box $P3, __ARG_5 - setattribute self, 'arraytype', $P3 -.annotate 'line', 7826 -# var vdata: $P1 - getattribute $P3, self, 'name' - $P1 = self.'createvar'($P3, 'P') -.annotate 'line', 7827 - $P4 = $P1.'getreg'() - setattribute self, 'reg', $P4 -.annotate 'line', 7828 -# var t: $P2 - $P2 = __ARG_6.'get'() -.annotate 'line', 7829 - $P3 = $P2.'isop'(']') - isfalse $I1, $P3 +.const 'Sub' WSubId_68 = "WSubId_68" +.const 'Sub' WSubId_84 = "WSubId_84" +.const 'Sub' WSubId_70 = "WSubId_70" +.const 'Sub' WSubId_67 = "WSubId_67" + self.'DeclareBase'(__ARG_1, __ARG_2, __ARG_3, __ARG_4, 'P') + box $P2, __ARG_5 + setattribute self, 'arraytype', $P2 + $P1 = __ARG_6.'get'() + $P2 = $P1.'isop'(']') + isfalse $I1, $P2 unless $I1 goto __label_1 -# { -.annotate 'line', 7831 - __ARG_6.'unget'($P2) -.annotate 'line', 7832 - $P4 = WSubId_36(__ARG_6, self) - setattribute self, 'size', $P4 -.annotate 'line', 7833 - WSubId_53(']', __ARG_6) -# } + __ARG_6.'unget'($P1) + $P3 = WSubId_68(__ARG_6, self) + setattribute self, 'size', $P3 + WSubId_84(']', __ARG_6) __label_1: # endif -.annotate 'line', 7835 - $P2 = __ARG_6.'get'() -.annotate 'line', 7836 - $P3 = $P2.'isop'('=') - if_null $P3, __label_2 - unless $P3 goto __label_2 -# { -.annotate 'line', 7837 - $P2 = __ARG_6.'get'() -.annotate 'line', 7838 - $P3 = $P2.'isop'('[') - isfalse $I1, $P3 + $P1 = __ARG_6.'get'() + $P2 = $P1.'isop'('=') + if_null $P2, __label_2 + unless $P2 goto __label_2 + $P1 = __ARG_6.'get'() + $P2 = $P1.'isop'('[') + isfalse $I1, $P2 unless $I1 goto __label_4 -.annotate 'line', 7839 - WSubId_39("array initializer", $P2) + WSubId_70("array initializer", $P1) __label_4: # endif -.annotate 'line', 7840 - $P2 = __ARG_6.'get'() -.annotate 'line', 7841 - $P3 = $P2.'isop'(']') - isfalse $I1, $P3 + $P1 = __ARG_6.'get'() + $P2 = $P1.'isop'(']') + isfalse $I1, $P2 unless $I1 goto __label_5 -# { -.annotate 'line', 7842 - __ARG_6.'unget'($P2) -.annotate 'line', 7843 - $P4 = WSubId_35(__ARG_6, self, WSubId_36, ']') - setattribute self, 'initarray', $P4 -# } + __ARG_6.'unget'($P1) + $P3 = WSubId_67(__ARG_6, self, WSubId_68, ']') + setattribute self, 'initarray', $P3 __label_5: # endif -# } goto __label_3 __label_2: # else -.annotate 'line', 7847 - __ARG_6.'unget'($P2) + __ARG_6.'unget'($P1) __label_3: # endif -# } -.annotate 'line', 7848 .end # DeclareArrayStatement +.sub 'clonedeclare' :method + .param pmc __ARG_1 + .param pmc __ARG_2 + getattribute $P7, self, 'start' + getattribute $P8, self, 'name' + getattribute $P9, self, 'basetype' + __ARG_1.'DeclareBase'($P7, __ARG_2, $P8, $P9, 'P') + getattribute $P8, self, 'arraytype' + setattribute __ARG_1, 'arraytype', $P8 + getattribute $P7, self, 'size' + if_null $P7, __label_1 + unless $P7 goto __label_1 + getattribute $P10, self, 'size' + $P9 = $P10.'clone'(__ARG_1) + setattribute __ARG_1, 'size', $P9 + __label_1: # endif + getattribute $P7, self, 'initarray' + if_null $P7, __label_2 + getattribute $P1, self, 'initarray' + set $P2, __ARG_2 +.const 'Sub' WSubId_3 = "WSubId_3" +.const 'Sub' WSubId_5 = "WSubId_5" + set $P3, $P1 + root_new $P4, ['parrot';'ResizablePMCArray'] + $P9 = WSubId_5("clone") + $P5 = WSubId_3($P9, $P2) + if_null $P3, __label_6 + iter $P12, $P3 + set $P12, 0 + __label_5: # for iteration + unless $P12 goto __label_6 + shift $P6, $P12 + $P10 = $P5($P6) + push $P4, $P10 + goto __label_5 + __label_6: # endfor + set $P11, $P4 + goto __label_4 + __label_4: + goto __label_3 + __label_3: + set $P7, $P11 + setattribute __ARG_1, 'initarray', $P7 + __label_2: # endif + .return(__ARG_1) + +.end # clonedeclare + + .sub 'optimize' :method -.const 'Sub' WSubId_37 = "WSubId_37" -# Body -# { -.annotate 'line', 7851 - getattribute $P1, self, 'size' - if_null $P1, __label_1 -.annotate 'line', 7852 - getattribute $P4, self, 'size' - $P3 = $P4.'optimize'() - setattribute self, 'size', $P3 + getattribute $P2, self, 'size' + if_null $P2, __label_1 + getattribute $P5, self, 'size' + $P4 = $P5.'optimize'() + setattribute self, 'size', $P4 __label_1: # endif -.annotate 'line', 7853 getattribute $P1, self, 'initarray' - WSubId_37($P1) -.annotate 'line', 7854 + if_null $P1, __label_4 + elements $I1, $P1 + goto __label_3 + __label_4: + null $I1 + __label_3: + null $I2 + __label_7: # for condition + ge $I2, $I1, __label_6 + $P3 = $P1[$I2] + $P2 = $P3.'optimize'() + $P1[$I2] = $P2 + __label_5: # for iteration + inc $I2 + goto __label_7 + __label_6: # for end + __label_2: .return(self) -# } -.annotate 'line', 7855 .end # optimize .sub 'emit' :method .param pmc __ARG_1 -# Body -# { -.annotate 'line', 7858 +.const 'Sub' WSubId_45 = "WSubId_45" self.'annotate'(__ARG_1) -.annotate 'line', 7860 -# var reg: $P1 getattribute $P1, self, 'reg' -.annotate 'line', 7861 -# var size: $P2 getattribute $P2, self, 'size' -.annotate 'line', 7862 -# var init: $P3 getattribute $P3, self, 'initarray' -.annotate 'line', 7863 -# var basetype: $P4 getattribute $P4, self, 'basetype' -.annotate 'line', 7864 -# arraytype: $S1 -# predefined string - getattribute $P6, self, 'arraytype' - set $S4, $P6 - concat $S1, $S4, 'Array' -.annotate 'line', 7865 + getattribute $P5, self, 'arraytype' if_null $P2, __label_1 -# { -.annotate 'line', 7867 -# regsize: $S2 - $P6 = $P2.'emit_get'(__ARG_1) - null $S2 - if_null $P6, __label_3 - set $S2, $P6 - __label_3: -.annotate 'line', 7868 - __ARG_1.'say'(' ', 'new ', $P1, ", ['Fixed", $S1, "'], ", $S2) -# } + $P8 = $P2.'emit_get'(__ARG_1) + $P7 = WSubId_45(" new %0, ['Fixed%1Array'], %2", $P1, $P5, $P8) + __ARG_1.'say'($P7) goto __label_2 __label_1: # else -# { -.annotate 'line', 7872 - __ARG_1.'say'(' ', 'new ', $P1, ", ['Resizable", $S1, "']") -# } + $P7 = WSubId_45(" new %0, ['Resizable%1Array']", $P1, $P5) + __ARG_1.'say'($P7) __label_2: # endif -.annotate 'line', 7874 - if_null $P3, __label_4 -# { -.annotate 'line', 7875 -# itemreg: $S3 - $P6 = self.'tempreg'($P4) - null $S3 - if_null $P6, __label_5 - set $S3, $P6 - __label_5: -.annotate 'line', 7876 -# n: $I1 -# predefined elements + if_null $P3, __label_3 + $P7 = self.'tempreg'($P4) + null $S1 + if_null $P7, __label_4 + set $S1, $P7 + __label_4: elements $I1, $P3 -.annotate 'line', 7877 - unless_null $P2, __label_6 -# { -.annotate 'line', 7878 - le $I1, 0, __label_7 -# { -.annotate 'line', 7880 + unless_null $P2, __label_5 + unless $I1 goto __label_6 __ARG_1.'emitset'($P1, $I1) -# } - __label_7: # endif -# } __label_6: # endif -.annotate 'line', 7883 -# i: $I2 + __label_5: # endif null $I2 -.annotate 'line', 7884 - if_null $P3, __label_9 - iter $P7, $P3 - set $P7, 0 - __label_8: # for iteration - unless $P7 goto __label_9 - shift $P5, $P7 -# { -.annotate 'line', 7885 - $P5.'emit'(__ARG_1, $S3) -.annotate 'line', 7886 - __ARG_1.'say'(' ', $P1, '[', $I2, '] = ', $S3) -.annotate 'line', 7887 + if_null $P3, __label_8 + iter $P9, $P3 + set $P9, 0 + __label_7: # for iteration + unless $P9 goto __label_8 + shift $P6, $P9 + $P6.'emit'(__ARG_1, $S1) + $P7 = WSubId_45(" %0[%1] = %2", $P1, $I2, $S1) + __ARG_1.'say'($P7) inc $I2 -# } - goto __label_8 - __label_9: # endfor -# } - __label_4: # endif -# } -.annotate 'line', 7890 + goto __label_7 + __label_8: # endfor + __label_3: # endif .end # emit .sub Winxed_class_init :anon :load :init newclass $P0, [ 'Winxed'; 'Compiler'; 'DeclareArrayStatement' ] -.annotate 'line', 7814 get_class $P1, [ 'Winxed'; 'Compiler'; 'DeclareBase' ] addparent $P0, $P1 -.annotate 'line', 7816 addattribute $P0, 'size' -.annotate 'line', 7817 addattribute $P0, 'initarray' -.annotate 'line', 7818 addattribute $P0, 'arraytype' .end .namespace [ 'Winxed'; 'Compiler' ] -.sub 'parseDeclareHelper' :subid('WSubId_98') +.sub 'parseDeclareHelper' :subid('WSubId_129') .param pmc __ARG_1 .param pmc __ARG_2 .param pmc __ARG_3 .param pmc __ARG_4 .param pmc __ARG_5 -.const 'Sub' WSubId_93 = "WSubId_93" -.const 'Sub' WSubId_97 = "WSubId_97" -.const 'Sub' WSubId_4 = "WSubId_4" -# Body -# { -.annotate 'line', 7897 -# var next: $P1 +.const 'Sub' WSubId_124 = "WSubId_124" +.const 'Sub' WSubId_28 = "WSubId_28" null $P1 -.annotate 'line', 7898 -# var r: $P2 null $P2 __label_1: # do -.annotate 'line', 7899 -# { -.annotate 'line', 7900 -# var name: $P3 $P3 = __ARG_4.'get'() -.annotate 'line', 7901 - WSubId_93($P3) -.annotate 'line', 7902 -# var t: $P4 + WSubId_124($P3) $P4 = __ARG_4.'get'() -.annotate 'line', 7903 -# var item: $P5 null $P5 -.annotate 'line', 7904 - $P6 = $P4.'isop'('[') - if_null $P6, __label_4 - unless $P6 goto __label_4 -.annotate 'line', 7905 + $P8 = $P4.'isop'('[') + if_null $P8, __label_4 + unless $P8 goto __label_4 $P5 = __ARG_2(__ARG_3, __ARG_5, __ARG_4, $P3) goto __label_5 __label_4: # else -# { -.annotate 'line', 7907 __ARG_4.'unget'($P4) -.annotate 'line', 7908 $P5 = __ARG_1(__ARG_3, __ARG_5, $P3, __ARG_4) -# } __label_5: # endif -.annotate 'line', 7910 - $P2 = WSubId_97($P2, $P5) -.annotate 'line', 7911 + set $P6, $P2 + set $P7, $P5 + isnull $I1, $P6 + if $I1 goto __label_9 + isa $I1, $P6, [ 'Winxed'; 'Compiler'; 'MultiStatement' ] + if $I1 goto __label_10 + goto __label_8 + __label_9: # case + set $P2, $P7 + goto __label_6 + __label_10: # case + $P2 = $P6.'push'($P7) + goto __label_6 + __label_8: # default + new $P8, [ 'Winxed'; 'Compiler'; 'MultiStatement' ] + $P8.'MultiStatement'($P6, $P7) + set $P2, $P8 + goto __label_6 + __label_7: # switch end + __label_6: $P1 = __ARG_4.'get'() -# } __label_3: # continue -.annotate 'line', 7912 - $P6 = $P1.'isop'(',') - if_null $P6, __label_2 - if $P6 goto __label_1 + $P8 = $P1.'isop'(',') + if_null $P8, __label_2 + if $P8 goto __label_1 __label_2: # enddo -.annotate 'line', 7913 - WSubId_4(';', $P1) -.annotate 'line', 7914 + WSubId_28(';', $P1) .return($P2) -# } -.annotate 'line', 7915 .end # parseDeclareHelper @@ -23118,18 +18385,20 @@ .param pmc __ARG_2 .param pmc __ARG_3 .param pmc __ARG_4 -# Body -# { -.annotate 'line', 7923 self.'DeclareSingleStatement'(__ARG_1, __ARG_2, __ARG_3, 'I', __ARG_4) -# } -.annotate 'line', 7924 .end # IntStatement + +.sub 'clone' :method + .param pmc __ARG_1 + new $P1, [ 'Winxed'; 'Compiler'; 'IntStatement' ] + .tailcall self.'clonedeclare'($P1, __ARG_1) + +.end # clone + .sub Winxed_class_init :anon :load :init newclass $P0, [ 'Winxed'; 'Compiler'; 'IntStatement' ] -.annotate 'line', 7919 get_class $P1, [ 'Winxed'; 'Compiler'; 'DeclareSingleStatement' ] addparent $P0, $P1 .end @@ -23140,72 +18409,59 @@ .param pmc __ARG_2 .param pmc __ARG_3 .param pmc __ARG_4 -# Body -# { -.annotate 'line', 7931 self.'DeclareArrayStatement'(__ARG_1, __ARG_2, __ARG_3, 'I', 'Integer', __ARG_4) -# } -.annotate 'line', 7932 .end # IntArrayStatement + +.sub 'clone' :method + .param pmc __ARG_1 + new $P1, [ 'Winxed'; 'Compiler'; 'IntArrayStatement' ] + .tailcall self.'clonedeclare'($P1, __ARG_1) + +.end # clone + .sub Winxed_class_init :anon :load :init newclass $P0, [ 'Winxed'; 'Compiler'; 'IntArrayStatement' ] -.annotate 'line', 7927 get_class $P1, [ 'Winxed'; 'Compiler'; 'DeclareArrayStatement' ] addparent $P0, $P1 .end .namespace [ 'Winxed'; 'Compiler' ] -.sub 'newIntSingle' :subid('WSubId_99') +.sub 'newIntSingle' :subid('WSubId_130') .param pmc __ARG_1 .param pmc __ARG_2 .param pmc __ARG_3 .param pmc __ARG_4 -# Body -# { -.annotate 'line', 7938 new $P2, [ 'Winxed'; 'Compiler'; 'IntStatement' ] $P2.'IntStatement'(__ARG_1, __ARG_2, __ARG_3, __ARG_4) set $P1, $P2 .return($P1) -# } -.annotate 'line', 7939 .end # newIntSingle -.sub 'newIntArray' :subid('WSubId_100') +.sub 'newIntArray' :subid('WSubId_131') .param pmc __ARG_1 .param pmc __ARG_2 .param pmc __ARG_3 .param pmc __ARG_4 -# Body -# { -.annotate 'line', 7943 new $P2, [ 'Winxed'; 'Compiler'; 'IntArrayStatement' ] $P2.'IntArrayStatement'(__ARG_1, __ARG_2, __ARG_4, __ARG_3) set $P1, $P2 .return($P1) -# } -.annotate 'line', 7944 .end # newIntArray -.sub 'parseInt' :subid('WSubId_47') +.sub 'parseInt' :subid('WSubId_78') .param pmc __ARG_1 .param pmc __ARG_2 .param pmc __ARG_3 -.const 'Sub' WSubId_98 = "WSubId_98" -.const 'Sub' WSubId_99 = "WSubId_99" -.const 'Sub' WSubId_100 = "WSubId_100" -# Body -# { -.annotate 'line', 7948 - .tailcall WSubId_98(WSubId_99, WSubId_100, __ARG_1, __ARG_2, __ARG_3) -# } -.annotate 'line', 7949 +.const 'Sub' WSubId_129 = "WSubId_129" +.const 'Sub' WSubId_130 = "WSubId_130" +.const 'Sub' WSubId_131 = "WSubId_131" + .tailcall WSubId_129(WSubId_130, WSubId_131, __ARG_1, __ARG_2, __ARG_3) .end # parseInt @@ -23216,18 +18472,20 @@ .param pmc __ARG_2 .param pmc __ARG_3 .param pmc __ARG_4 -# Body -# { -.annotate 'line', 7957 self.'DeclareSingleStatement'(__ARG_1, __ARG_2, __ARG_3, 'N', __ARG_4) -# } -.annotate 'line', 7958 .end # FloatStatement + +.sub 'clone' :method + .param pmc __ARG_1 + new $P1, [ 'Winxed'; 'Compiler'; 'FloatStatement' ] + .tailcall self.'clonedeclare'($P1, __ARG_1) + +.end # clone + .sub Winxed_class_init :anon :load :init newclass $P0, [ 'Winxed'; 'Compiler'; 'FloatStatement' ] -.annotate 'line', 7953 get_class $P1, [ 'Winxed'; 'Compiler'; 'DeclareSingleStatement' ] addparent $P0, $P1 .end @@ -23238,72 +18496,59 @@ .param pmc __ARG_2 .param pmc __ARG_3 .param pmc __ARG_4 -# Body -# { -.annotate 'line', 7965 self.'DeclareArrayStatement'(__ARG_1, __ARG_2, __ARG_3, 'N', 'Float', __ARG_4) -# } -.annotate 'line', 7966 .end # FloatArrayStatement + +.sub 'clone' :method + .param pmc __ARG_1 + new $P1, [ 'Winxed'; 'Compiler'; 'FloatArrayStatement' ] + .tailcall self.'clonedeclare'($P1, __ARG_1) + +.end # clone + .sub Winxed_class_init :anon :load :init newclass $P0, [ 'Winxed'; 'Compiler'; 'FloatArrayStatement' ] -.annotate 'line', 7961 get_class $P1, [ 'Winxed'; 'Compiler'; 'DeclareArrayStatement' ] addparent $P0, $P1 .end .namespace [ 'Winxed'; 'Compiler' ] -.sub 'newFloatSingle' :subid('WSubId_101') +.sub 'newFloatSingle' :subid('WSubId_132') .param pmc __ARG_1 .param pmc __ARG_2 .param pmc __ARG_3 .param pmc __ARG_4 -# Body -# { -.annotate 'line', 7972 new $P2, [ 'Winxed'; 'Compiler'; 'FloatStatement' ] $P2.'FloatStatement'(__ARG_1, __ARG_2, __ARG_3, __ARG_4) set $P1, $P2 .return($P1) -# } -.annotate 'line', 7973 .end # newFloatSingle -.sub 'newFloatArray' :subid('WSubId_102') +.sub 'newFloatArray' :subid('WSubId_133') .param pmc __ARG_1 .param pmc __ARG_2 .param pmc __ARG_3 .param pmc __ARG_4 -# Body -# { -.annotate 'line', 7977 new $P2, [ 'Winxed'; 'Compiler'; 'FloatArrayStatement' ] $P2.'FloatArrayStatement'(__ARG_1, __ARG_2, __ARG_4, __ARG_3) set $P1, $P2 .return($P1) -# } -.annotate 'line', 7978 .end # newFloatArray -.sub 'parseFloat' :subid('WSubId_48') +.sub 'parseFloat' :subid('WSubId_79') .param pmc __ARG_1 .param pmc __ARG_2 .param pmc __ARG_3 -.const 'Sub' WSubId_98 = "WSubId_98" -.const 'Sub' WSubId_101 = "WSubId_101" -.const 'Sub' WSubId_102 = "WSubId_102" -# Body -# { -.annotate 'line', 7982 - .tailcall WSubId_98(WSubId_101, WSubId_102, __ARG_1, __ARG_2, __ARG_3) -# } -.annotate 'line', 7983 +.const 'Sub' WSubId_129 = "WSubId_129" +.const 'Sub' WSubId_132 = "WSubId_132" +.const 'Sub' WSubId_133 = "WSubId_133" + .tailcall WSubId_129(WSubId_132, WSubId_133, __ARG_1, __ARG_2, __ARG_3) .end # parseFloat @@ -23314,18 +18559,20 @@ .param pmc __ARG_2 .param pmc __ARG_3 .param pmc __ARG_4 -# Body -# { -.annotate 'line', 7991 self.'DeclareSingleStatement'(__ARG_1, __ARG_2, __ARG_3, 'S', __ARG_4) -# } -.annotate 'line', 7992 .end # StringStatement + +.sub 'clone' :method + .param pmc __ARG_1 + new $P1, [ 'Winxed'; 'Compiler'; 'StringStatement' ] + .tailcall self.'clonedeclare'($P1, __ARG_1) + +.end # clone + .sub Winxed_class_init :anon :load :init newclass $P0, [ 'Winxed'; 'Compiler'; 'StringStatement' ] -.annotate 'line', 7987 get_class $P1, [ 'Winxed'; 'Compiler'; 'DeclareSingleStatement' ] addparent $P0, $P1 .end @@ -23336,72 +18583,59 @@ .param pmc __ARG_2 .param pmc __ARG_3 .param pmc __ARG_4 -# Body -# { -.annotate 'line', 7999 self.'DeclareArrayStatement'(__ARG_1, __ARG_2, __ARG_3, 'S', 'String', __ARG_4) -# } -.annotate 'line', 8000 .end # StringArrayStatement + +.sub 'clone' :method + .param pmc __ARG_1 + new $P1, [ 'Winxed'; 'Compiler'; 'StringArrayStatement' ] + .tailcall self.'clonedeclare'($P1, __ARG_1) + +.end # clone + .sub Winxed_class_init :anon :load :init newclass $P0, [ 'Winxed'; 'Compiler'; 'StringArrayStatement' ] -.annotate 'line', 7995 get_class $P1, [ 'Winxed'; 'Compiler'; 'DeclareArrayStatement' ] addparent $P0, $P1 .end .namespace [ 'Winxed'; 'Compiler' ] -.sub 'newStringSingle' :subid('WSubId_103') +.sub 'newStringSingle' :subid('WSubId_134') .param pmc __ARG_1 .param pmc __ARG_2 .param pmc __ARG_3 .param pmc __ARG_4 -# Body -# { -.annotate 'line', 8006 new $P2, [ 'Winxed'; 'Compiler'; 'StringStatement' ] $P2.'StringStatement'(__ARG_1, __ARG_2, __ARG_3, __ARG_4) set $P1, $P2 .return($P1) -# } -.annotate 'line', 8007 .end # newStringSingle -.sub 'newStringArray' :subid('WSubId_104') +.sub 'newStringArray' :subid('WSubId_135') .param pmc __ARG_1 .param pmc __ARG_2 .param pmc __ARG_3 .param pmc __ARG_4 -# Body -# { -.annotate 'line', 8011 new $P2, [ 'Winxed'; 'Compiler'; 'StringArrayStatement' ] $P2.'StringArrayStatement'(__ARG_1, __ARG_2, __ARG_4, __ARG_3) set $P1, $P2 .return($P1) -# } -.annotate 'line', 8012 .end # newStringArray -.sub 'parseString' :subid('WSubId_46') +.sub 'parseString' :subid('WSubId_77') .param pmc __ARG_1 .param pmc __ARG_2 .param pmc __ARG_3 -.const 'Sub' WSubId_98 = "WSubId_98" -.const 'Sub' WSubId_103 = "WSubId_103" -.const 'Sub' WSubId_104 = "WSubId_104" -# Body -# { -.annotate 'line', 8016 - .tailcall WSubId_98(WSubId_103, WSubId_104, __ARG_1, __ARG_2, __ARG_3) -# } -.annotate 'line', 8017 +.const 'Sub' WSubId_129 = "WSubId_129" +.const 'Sub' WSubId_134 = "WSubId_134" +.const 'Sub' WSubId_135 = "WSubId_135" + .tailcall WSubId_129(WSubId_134, WSubId_135, __ARG_1, __ARG_2, __ARG_3) .end # parseString @@ -23413,132 +18647,114 @@ .param string __ARG_3 .param pmc __ARG_4 .param pmc __ARG_5 -# Body -# { -.annotate 'line', 8033 self.'Statement'(__ARG_1, __ARG_2) -.annotate 'line', 8034 box $P1, __ARG_3 setattribute self, 'type', $P1 -.annotate 'line', 8035 setattribute self, 'name', __ARG_4 -.annotate 'line', 8036 setattribute self, 'value', __ARG_5 -.annotate 'line', 8037 $P2 = self.'createconst'(__ARG_4, __ARG_3) setattribute self, 'data', $P2 -# } -.annotate 'line', 8038 .end # ConstStatement .sub 'optimize' :method -.const 'Sub' WSubId_1 = "WSubId_1" -# Body -# { -.annotate 'line', 8041 -# var value: $P1 +.const 'Sub' WSubId_25 = "WSubId_25" getattribute $P1, self, 'value' -.annotate 'line', 8042 -# var name: $P2 - getattribute $P2, self, 'name' -.annotate 'line', 8043 -# type: $S1 - getattribute $P3, self, 'type' + getattribute $P2, self, 'type' null $S1 - if_null $P3, __label_1 - set $S1, $P3 + if_null $P2, __label_1 + set $S1, $P2 __label_1: -.annotate 'line', 8044 $P1 = $P1.'optimize'() -.annotate 'line', 8045 - $P3 = $P1.'hascompilevalue'() - isfalse $I1, $P3 + $P2 = $P1.'hascompilevalue'() + isfalse $I1, $P2 unless $I1 goto __label_2 -# { -.annotate 'line', 8046 - WSubId_1('Value for const is not evaluable at compile time', self) -# } + WSubId_25('Value for const is not evaluable at compile time', self) __label_2: # endif -.annotate 'line', 8049 - getattribute $P3, self, 'data' - $P3.'setvalue'($P1) -.annotate 'line', 8050 + getattribute $P2, self, 'data' + $P2.'setvalue'($P1) .return(self) -# } -.annotate 'line', 8051 .end # optimize .sub 'checkresult' :method -.const 'Sub' WSubId_6 = "WSubId_6" -# Body -# { -.annotate 'line', 8054 +.const 'Sub' WSubId_30 = "WSubId_30" getattribute $P1, self, 'start' - WSubId_6('Direct use of const', $P1) -# } -.annotate 'line', 8055 + WSubId_30('Direct use of const', $P1) .end # checkresult .sub 'emit' :method .param pmc __ARG_1 -# Body -# { -.annotate 'line', 8058 -# predefined string - getattribute $P1, self, 'name' - set $S1, $P1 - concat $S2, 'Constant ', $S1 - concat $S2, $S2, ' evaluated at compile time' - __ARG_1.'comment'($S2) -# } -.annotate 'line', 8059 + $P2 = __ARG_1.'getDebug'() + if_null $P2, __label_1 + unless $P2 goto __label_1 + getattribute $P3, self, 'data' + $P1 = $P3.'getvalue'() + null $S1 + getattribute $P2, self, 'type' + set $S2, $P2 + if_null $S2, __label_2 + length $I1, $S2 + ne $I1, 1, __label_2 + ord $I1, $S2 + if $I1 == 73 goto __label_4 + if $I1 == 78 goto __label_5 + if $I1 == 83 goto __label_6 + goto __label_2 + __label_4: # case + $P3 = $P1.'getIntegerValue'() + set $S1, $P3 + goto __label_3 # break + __label_5: # case + $P4 = $P1.'getFloatValue'() + set $S1, $P4 + goto __label_3 # break + __label_6: # case + $P5 = $P1.'getPirString'() + set $S1, $P5 + goto __label_3 # break + __label_2: # default + __label_3: # switch end + getattribute $P2, self, 'name' + set $S2, $P2 + concat $S3, "Constant '", $S2 + concat $S3, $S3, "' set to: " + concat $S3, $S3, $S1 + __ARG_1.'comment'($S3) + __label_1: # endif .end # emit .sub Winxed_class_init :anon :load :init newclass $P0, [ 'Winxed'; 'Compiler'; 'ConstStatement' ] -.annotate 'line', 8023 get_class $P1, [ 'Winxed'; 'Compiler'; 'Statement' ] addparent $P0, $P1 -.annotate 'line', 8025 addattribute $P0, 'type' -.annotate 'line', 8026 addattribute $P0, 'name' -.annotate 'line', 8027 addattribute $P0, 'data' -.annotate 'line', 8028 addattribute $P0, 'value' .end .namespace [ 'Winxed'; 'Compiler' ] -.sub 'parseConst' :subid('WSubId_43') +.sub 'parseConst' :subid('WSubId_74') .param pmc __ARG_1 .param pmc __ARG_2 .param pmc __ARG_3 -.const 'Sub' WSubId_96 = "WSubId_96" -.const 'Sub' WSubId_1 = "WSubId_1" -.const 'Sub' WSubId_53 = "WSubId_53" -.const 'Sub' WSubId_36 = "WSubId_36" -.const 'Sub' WSubId_97 = "WSubId_97" -# Body -# { -.annotate 'line', 8064 -# var t: $P1 +.const 'Sub' WSubId_127 = "WSubId_127" +.const 'Sub' WSubId_25 = "WSubId_25" +.const 'Sub' WSubId_84 = "WSubId_84" +.const 'Sub' WSubId_68 = "WSubId_68" +.const 'Sub' WSubId_28 = "WSubId_28" $P1 = __ARG_2.'get'() -.annotate 'line', 8065 -# type: $S1 - $P5 = WSubId_96($P1) + $P7 = WSubId_127($P1) null $S1 - if_null $P5, __label_1 - set $S1, $P5 + if_null $P7, __label_1 + set $S1, $P7 __label_1: -.annotate 'line', 8066 isne $I1, $S1, 'I' unless $I1 goto __label_4 isne $I1, $S1, 'N' @@ -23547,43 +18763,43 @@ isne $I1, $S1, 'S' __label_3: unless $I1 goto __label_2 -.annotate 'line', 8067 - WSubId_1('Invalid type for const', __ARG_1) + WSubId_25('Invalid type for const', __ARG_1) __label_2: # endif -.annotate 'line', 8069 -# var multi: $P2 null $P2 __label_5: # do -.annotate 'line', 8070 -# { -.annotate 'line', 8071 - $P1 = __ARG_2.'get'() -.annotate 'line', 8072 -# var name: $P3 - set $P3, $P1 -.annotate 'line', 8073 - WSubId_53('=', __ARG_2) -.annotate 'line', 8074 -# var value: $P4 - $P4 = WSubId_36(__ARG_2, __ARG_3) -.annotate 'line', 8076 - new $P6, [ 'Winxed'; 'Compiler'; 'ConstStatement' ] - $P6.'ConstStatement'($P1, __ARG_3, $S1, $P3, $P4) - set $P5, $P6 -.annotate 'line', 8075 - $P2 = WSubId_97($P2, $P5) -# } + $P3 = __ARG_2.'get'() + WSubId_84('=', __ARG_2) + $P4 = WSubId_68(__ARG_2, __ARG_3) + set $P5, $P2 + new $P7, [ 'Winxed'; 'Compiler'; 'ConstStatement' ] + $P7.'ConstStatement'($P1, __ARG_3, $S1, $P3, $P4) + set $P6, $P7 + isnull $I1, $P5 + if $I1 goto __label_11 + isa $I1, $P5, [ 'Winxed'; 'Compiler'; 'MultiStatement' ] + if $I1 goto __label_12 + goto __label_10 + __label_11: # case + set $P2, $P6 + goto __label_8 + __label_12: # case + $P2 = $P5.'push'($P6) + goto __label_8 + __label_10: # default + new $P8, [ 'Winxed'; 'Compiler'; 'MultiStatement' ] + $P8.'MultiStatement'($P5, $P6) + set $P2, $P8 + goto __label_8 + __label_9: # switch end + __label_8: __label_7: # continue -.annotate 'line', 8077 $P1 = __ARG_2.'get'() - $P5 = $P1.'isop'(',') - if_null $P5, __label_6 - if $P5 goto __label_5 + $P7 = $P1.'isop'(',') + if_null $P7, __label_6 + if $P7 goto __label_5 __label_6: # enddo -.annotate 'line', 8078 + WSubId_28(';', $P1) .return($P2) -# } -.annotate 'line', 8079 .end # parseConst @@ -23595,179 +18811,130 @@ .param pmc __ARG_3 .param pmc __ARG_4 .param int __ARG_5 -.const 'Sub' WSubId_36 = "WSubId_36" -.const 'Sub' WSubId_4 = "WSubId_4" -# Body -# { -.annotate 'line', 8090 +.const 'Sub' WSubId_68 = "WSubId_68" +.const 'Sub' WSubId_28 = "WSubId_28" self.'initvarbase'(__ARG_1, __ARG_3, __ARG_4, __ARG_5) -.annotate 'line', 8091 -# var t: $P1 $P1 = __ARG_2.'get'() -.annotate 'line', 8092 $P2 = $P1.'isop'('=') if_null $P2, __label_1 unless $P2 goto __label_1 -# { -.annotate 'line', 8093 - $P4 = WSubId_36(__ARG_2, self) + $P4 = WSubId_68(__ARG_2, self) setattribute self, 'init', $P4 -.annotate 'line', 8094 $P1 = __ARG_2.'get'() -# } __label_1: # endif -.annotate 'line', 8096 - WSubId_4(';', $P1) -# } -.annotate 'line', 8097 + WSubId_28(';', $P1) .end # VarStatement +.sub 'clone' :method + .param pmc __ARG_1 + new $P1, [ 'Winxed'; 'Compiler'; 'VarStatement' ] + getattribute $P2, self, 'start' + getattribute $P3, self, 'name' + getattribute $P4, self, 'flags' + $P1.'initvarbase'($P2, __ARG_1, $P3, $P4) + getattribute $P2, self, 'init' + if_null $P2, __label_1 + getattribute $P5, self, 'init' + $P4 = $P5.'clone'($P1) + setattribute $P1, 'init', $P4 + __label_1: # endif + .return($P1) + +.end # clone + + .sub 'optimize_init' :method -# Body -# { -.annotate 'line', 8100 getattribute $P1, self, 'init' if_null $P1, __label_1 -.annotate 'line', 8101 getattribute $P4, self, 'init' $P3 = $P4.'optimize'() setattribute self, 'init', $P3 __label_1: # endif -.annotate 'line', 8102 .return(self) -# } -.annotate 'line', 8103 .end # optimize_init .sub 'optimize' :method -# Body -# { -.annotate 'line', 8106 .tailcall self.'optimize_init'() -# } -.annotate 'line', 8107 .end # optimize .sub 'emit' :method .param pmc __ARG_1 -.const 'Sub' WSubId_1 = "WSubId_1" -# Body -# { -.annotate 'line', 8110 +.const 'Sub' WSubId_25 = "WSubId_25" self.'annotate'(__ARG_1) -.annotate 'line', 8111 -# name: $S1 getattribute $P2, self, 'name' null $S1 if_null $P2, __label_1 set $S1, $P2 __label_1: -.annotate 'line', 8112 -# reg: $S2 getattribute $P2, self, 'reg' null $S2 if_null $P2, __label_2 set $S2, $P2 __label_2: -.annotate 'line', 8113 -# var init: $P1 getattribute $P1, self, 'init' -.annotate 'line', 8114 + $P2 = __ARG_1.'getDebug'() + if_null $P2, __label_3 + unless $P2 goto __label_3 concat $S4, 'var ', $S1 concat $S4, $S4, ': ' concat $S4, $S4, $S2 __ARG_1.'comment'($S4) -.annotate 'line', 8115 - if_null $P1, __label_3 -.annotate 'line', 8116 + __label_3: # endif + if_null $P1, __label_4 $P2 = $P1.'isnull'() - if_null $P2, __label_4 - unless $P2 goto __label_4 -.annotate 'line', 8117 + if_null $P2, __label_5 + unless $P2 goto __label_5 null $P1 + __label_5: # endif __label_4: # endif - __label_3: # endif -.annotate 'line', 8118 - if_null $P1, __label_5 -# { -# switch -.annotate 'line', 8119 + if_null $P1, __label_6 $P2 = $P1.'checkresult'() set $S4, $P2 - set $S5, 'P' - if $S4 == $S5 goto __label_9 - set $S5, 'S' - if $S4 == $S5 goto __label_10 - set $S5, 'I' - if $S4 == $S5 goto __label_11 - set $S5, 'N' - if $S4 == $S5 goto __label_12 - set $S5, 'v' - if $S4 == $S5 goto __label_13 + if_null $S4, __label_8 + length $I1, $S4 + ne $I1, 1, __label_8 + ord $I1, $S4 + if $I1 == 80 goto __label_10 + if $I1 == 83 goto __label_11 + if $I1 == 73 goto __label_12 + if $I1 == 78 goto __label_13 + if $I1 == 118 goto __label_14 goto __label_8 - __label_9: # case -.annotate 'line', 8121 - isa $I1, $P1, [ 'Winxed'; 'Compiler'; 'MemberExpr' ] - if $I1 goto __label_17 - isa $I1, $P1, [ 'Winxed'; 'Compiler'; 'ArrayExpr' ] - __label_17: - if $I1 goto __label_16 - isa $I1, $P1, [ 'Winxed'; 'Compiler'; 'NewExpr' ] - __label_16: - unless $I1 goto __label_14 -.annotate 'line', 8122 - $P1.'emit_init'(__ARG_1, $S2) - goto __label_15 - __label_14: # else -.annotate 'line', 8124 - $P1.'emit'(__ARG_1, $S2) - __label_15: # endif - goto __label_7 # break __label_10: # case + $P1.'emit_init'(__ARG_1, $S2) + goto __label_9 # break __label_11: # case __label_12: # case -.annotate 'line', 8129 -# value: $S3 + __label_13: # case $P3 = $P1.'emit_get'(__ARG_1) null $S3 - if_null $P3, __label_18 + if_null $P3, __label_15 set $S3, $P3 - __label_18: -.annotate 'line', 8130 + __label_15: __ARG_1.'emitbox'($S2, $S3) - goto __label_7 # break - __label_13: # case -.annotate 'line', 8133 - getattribute $P4, self, 'name' - WSubId_1("Can't use void function as initializer", $P4) + goto __label_9 # break + __label_14: # case + WSubId_25("Can't use void function as initializer", self) __label_8: # default -.annotate 'line', 8135 - getattribute $P5, self, 'name' - WSubId_1("Invalid var initializer", $P5) - __label_7: # switch end -# } - goto __label_6 - __label_5: # else -.annotate 'line', 8139 + WSubId_25("Invalid var initializer", self) + __label_9: # switch end + goto __label_7 + __label_6: # else __ARG_1.'emitnull'($S2) - __label_6: # endif -# } -.annotate 'line', 8140 + __label_7: # endif .end # emit .sub Winxed_class_init :anon :load :init newclass $P0, [ 'Winxed'; 'Compiler'; 'VarStatement' ] -.annotate 'line', 8085 get_class $P1, [ 'Winxed'; 'Compiler'; 'VarBaseStatement' ] addparent $P0, $P1 -.annotate 'line', 8087 addattribute $P0, 'init' .end .namespace [ 'Winxed'; 'Compiler'; 'ResizableVarStatement' ] @@ -23777,50 +18944,36 @@ .param pmc __ARG_2 .param pmc __ARG_3 .param pmc __ARG_4 -.const 'Sub' WSubId_53 = "WSubId_53" -# Body -# { -.annotate 'line', 8147 +.const 'Sub' WSubId_84 = "WSubId_84" self.'initvarbase'(__ARG_1, __ARG_3, __ARG_4) -.annotate 'line', 8148 - WSubId_53(';', __ARG_2) -# } -.annotate 'line', 8149 + WSubId_84(';', __ARG_2) .end # ResizableVarStatement .sub 'emit' :method .param pmc __ARG_1 -# Body -# { -.annotate 'line', 8152 +.const 'Sub' WSubId_45 = "WSubId_45" self.'annotate'(__ARG_1) -.annotate 'line', 8153 -# reg: $S1 getattribute $P1, self, 'reg' null $S1 if_null $P1, __label_1 set $S1, $P1 __label_1: -.annotate 'line', 8154 -# predefined string - getattribute $P1, self, 'name' - set $S2, $P1 - concat $S3, 'var ', $S2 - concat $S3, $S3, '[] : ' - concat $S3, $S3, $S1 - __ARG_1.'comment'($S3) -.annotate 'line', 8155 - __ARG_1.'say'(' ', 'new ', $S1, ", 'ResizablePMCArray'") -# } -.annotate 'line', 8156 + $P1 = __ARG_1.'getDebug'() + if_null $P1, __label_2 + unless $P1 goto __label_2 + getattribute $P3, self, 'name' + $P2 = WSubId_45("var %0[] : %1", $P3, $S1) + __ARG_1.'comment'($P2) + __label_2: # endif + $P1 = WSubId_45(" new %0, 'ResizablePMCArray'", $S1) + __ARG_1.'say'($P1) .end # emit .sub Winxed_class_init :anon :load :init newclass $P0, [ 'Winxed'; 'Compiler'; 'ResizableVarStatement' ] -.annotate 'line', 8143 get_class $P1, [ 'Winxed'; 'Compiler'; 'VarStatement' ] addparent $P0, $P1 .end @@ -23831,171 +18984,114 @@ .param pmc __ARG_2 .param pmc __ARG_3 .param pmc __ARG_4 -.const 'Sub' WSubId_36 = "WSubId_36" -.const 'Sub' WSubId_53 = "WSubId_53" -# Body -# { -.annotate 'line', 8165 +.const 'Sub' WSubId_68 = "WSubId_68" +.const 'Sub' WSubId_84 = "WSubId_84" self.'initvarbase'(__ARG_1, __ARG_3, __ARG_4) -.annotate 'line', 8166 - $P2 = WSubId_36(__ARG_2, self) + $P2 = WSubId_68(__ARG_2, self) setattribute self, 'exprsize', $P2 -.annotate 'line', 8167 - WSubId_53(']', __ARG_2) -.annotate 'line', 8168 - WSubId_53(';', __ARG_2) -# } -.annotate 'line', 8169 + WSubId_84(']', __ARG_2) + WSubId_84(';', __ARG_2) .end # FixedVarStatement .sub 'optimize' :method -# Body -# { -.annotate 'line', 8172 getattribute $P3, self, 'exprsize' $P2 = $P3.'optimize'() setattribute self, 'exprsize', $P2 -.annotate 'line', 8173 .tailcall self.'optimize_init'() -# } -.annotate 'line', 8174 .end # optimize .sub 'emit' :method .param pmc __ARG_1 -# Body -# { -.annotate 'line', 8177 -# regsize: $S1 +.const 'Sub' WSubId_45 = "WSubId_45" getattribute $P2, self, 'exprsize' $P1 = $P2.'emit_get'(__ARG_1) null $S1 if_null $P1, __label_1 set $S1, $P1 __label_1: -.annotate 'line', 8178 self.'annotate'(__ARG_1) -.annotate 'line', 8179 -# reg: $S2 getattribute $P1, self, 'reg' null $S2 if_null $P1, __label_2 set $S2, $P1 __label_2: -.annotate 'line', 8180 -# predefined string - getattribute $P1, self, 'name' - set $S3, $P1 - concat $S4, 'var ', $S3 - concat $S4, $S4, '[] : ' - concat $S4, $S4, $S2 - __ARG_1.'comment'($S4) -.annotate 'line', 8181 - __ARG_1.'say'(' ', 'new ', $S2, ", 'FixedPMCArray', ", $S1) -# } -.annotate 'line', 8182 + $P1 = __ARG_1.'getDebug'() + if_null $P1, __label_3 + unless $P1 goto __label_3 + getattribute $P3, self, 'name' + $P2 = WSubId_45("var %0[] : %1", $P3, $S2) + __ARG_1.'comment'($P2) + __label_3: # endif + $P1 = WSubId_45(" new %0, 'FixedPMCArray', %1", $S2, $S1) + __ARG_1.'say'($P1) .end # emit .sub Winxed_class_init :anon :load :init newclass $P0, [ 'Winxed'; 'Compiler'; 'FixedVarStatement' ] -.annotate 'line', 8159 get_class $P1, [ 'Winxed'; 'Compiler'; 'VarStatement' ] addparent $P0, $P1 -.annotate 'line', 8161 addattribute $P0, 'exprsize' .end .namespace [ 'Winxed'; 'Compiler' ] -.sub 'parseVar' :subid('WSubId_45') +.sub 'parseVar' :subid('WSubId_76') .param pmc __ARG_1 .param pmc __ARG_2 .param pmc __ARG_3 .param int __ARG_4 :optional -.const 'Sub' WSubId_93 = "WSubId_93" -# Body -# { -.annotate 'line', 8187 -# var name: $P1 +.const 'Sub' WSubId_124 = "WSubId_124" $P1 = __ARG_2.'get'() -.annotate 'line', 8188 - WSubId_93($P1) -.annotate 'line', 8189 -# var t: $P2 + WSubId_124($P1) $P2 = __ARG_2.'get'() -.annotate 'line', 8190 $P3 = $P2.'isop'('[') if_null $P3, __label_1 unless $P3 goto __label_1 -# { -.annotate 'line', 8191 $P2 = __ARG_2.'get'() -.annotate 'line', 8192 $P3 = $P2.'isop'(']') if_null $P3, __label_3 unless $P3 goto __label_3 -.annotate 'line', 8193 new $P5, [ 'Winxed'; 'Compiler'; 'ResizableVarStatement' ] $P5.'ResizableVarStatement'(__ARG_1, __ARG_2, __ARG_3, $P1) set $P4, $P5 .return($P4) goto __label_4 __label_3: # else -# { -.annotate 'line', 8195 __ARG_2.'unget'($P2) -.annotate 'line', 8196 new $P4, [ 'Winxed'; 'Compiler'; 'FixedVarStatement' ] $P4.'FixedVarStatement'(__ARG_1, __ARG_2, __ARG_3, $P1) set $P3, $P4 .return($P3) -# } __label_4: # endif -# } goto __label_2 __label_1: # else -# { -.annotate 'line', 8200 __ARG_2.'unget'($P2) -.annotate 'line', 8201 new $P4, [ 'Winxed'; 'Compiler'; 'VarStatement' ] $P4.'VarStatement'(__ARG_1, __ARG_2, __ARG_3, $P1, __ARG_4) set $P3, $P4 .return($P3) -# } __label_2: # endif -# } -.annotate 'line', 8203 .end # parseVar -.sub 'parseVolatile' :subid('WSubId_44') +.sub 'parseVolatile' :subid('WSubId_75') .param pmc __ARG_1 .param pmc __ARG_2 .param pmc __ARG_3 -.const 'Sub' WSubId_1 = "WSubId_1" -.const 'Sub' WSubId_45 = "WSubId_45" -# Body -# { -.annotate 'line', 8207 -# var t: $P1 +.const 'Sub' WSubId_25 = "WSubId_25" +.const 'Sub' WSubId_76 = "WSubId_76" $P1 = __ARG_2.'get'() -.annotate 'line', 8208 $P2 = $P1.'iskeyword'('var') isfalse $I1, $P2 unless $I1 goto __label_1 -.annotate 'line', 8209 - WSubId_1("invalid volatile type", $P1) + WSubId_25("invalid volatile type", $P1) __label_1: # endif -.annotate 'line', 8210 - .tailcall WSubId_45(__ARG_1, __ARG_2, __ARG_3, 1) -# } -.annotate 'line', 8211 + .tailcall WSubId_76(__ARG_1, __ARG_2, __ARG_3, 1) .end # parseVolatile @@ -24005,326 +19101,235 @@ .param pmc __ARG_1 .param pmc __ARG_2 .param pmc __ARG_3 -.const 'Sub' WSubId_94 = "WSubId_94" -.const 'Sub' WSubId_6 = "WSubId_6" -# Body -# { -.annotate 'line', 8224 - self.'Statement'(__ARG_1, __ARG_3) -.annotate 'line', 8225 +.const 'Sub' WSubId_125 = "WSubId_125" +.const 'Sub' WSubId_30 = "WSubId_30" + self.'BlockStatement'(__ARG_1, __ARG_3) root_new $P4, ['parrot';'Hash'] setattribute self, 'labels', $P4 -.annotate 'line', 8226 root_new $P4, ['parrot';'ResizablePMCArray'] setattribute self, 'statements', $P4 -.annotate 'line', 8227 -# var t: $P1 null $P1 __label_2: # while -.annotate 'line', 8228 $P1 = __ARG_2.'get'() $P3 = $P1.'isop'('}') isfalse $I1, $P3 unless $I1 goto __label_1 -# { -.annotate 'line', 8229 __ARG_2.'unget'($P1) -.annotate 'line', 8230 -# var c: $P2 - $P2 = WSubId_94(__ARG_2, self) -.annotate 'line', 8231 + $P2 = WSubId_125(__ARG_2, self) unless_null $P2, __label_3 -.annotate 'line', 8232 - WSubId_6('Unexpected null statement') + WSubId_30('Unexpected null statement') __label_3: # endif -.annotate 'line', 8233 getattribute $P3, self, 'statements' -# predefined push push $P3, $P2 -# } goto __label_2 __label_1: # endwhile -.annotate 'line', 8235 setattribute self, 'end', $P1 -# } -.annotate 'line', 8236 .end # CompoundStatement -.sub 'getlabel' :method +.sub 'clone' :method .param pmc __ARG_1 -# Body -# { -.annotate 'line', 8239 -# s: $S1 - set $P2, __ARG_1 - null $S1 - if_null $P2, __label_1 - set $S1, $P2 + new $P1, [ 'Winxed'; 'Compiler'; 'CompoundStatement' ] + getattribute $P8, self, 'start' + $P1.'BlockStatement'($P8, __ARG_1) + root_new $P9, ['parrot';'Hash'] + setattribute $P1, 'labels', $P9 + getattribute $P9, self, 'end' + setattribute $P1, 'end', $P9 + getattribute $P2, self, 'statements' + set $P3, __ARG_1 +.const 'Sub' WSubId_3 = "WSubId_3" +.const 'Sub' WSubId_5 = "WSubId_5" + set $P4, $P2 + root_new $P5, ['parrot';'ResizablePMCArray'] + $P9 = WSubId_5("clone") + $P6 = WSubId_3($P9, $P3) + if_null $P4, __label_4 + iter $P11, $P4 + set $P11, 0 + __label_3: # for iteration + unless $P11 goto __label_4 + shift $P7, $P11 + $P12 = $P6($P7) + push $P5, $P12 + goto __label_3 + __label_4: # endfor + set $P10, $P5 + goto __label_2 + __label_2: + goto __label_1 + __label_1: + set $P8, $P10 + setattribute $P1, 'statements', $P8 + .return($P1) + +.end # clone + + +.sub 'getlabel' :method + .param pmc __ARG_1 + null $S1 + if_null __ARG_1, __label_1 + set $S1, __ARG_1 __label_1: -.annotate 'line', 8240 -# var labels: $P1 getattribute $P1, self, 'labels' -.annotate 'line', 8241 -# exist: $S2 $S2 = $P1[$S1] -.annotate 'line', 8242 isnull $I1, $S2 if $I1 goto __label_3 iseq $I1, $S2, '' __label_3: unless $I1 goto __label_2 -.annotate 'line', 8243 getattribute $P3, self, 'owner' $P2 = $P3.'getlabel'(__ARG_1) set $S2, $P2 __label_2: # endif -.annotate 'line', 8244 .return($S2) -# } -.annotate 'line', 8245 .end # getlabel .sub 'createlabel' :method .param pmc __ARG_1 -.const 'Sub' WSubId_1 = "WSubId_1" -# Body -# { -.annotate 'line', 8248 -# s: $S1 - set $P2, __ARG_1 +.const 'Sub' WSubId_25 = "WSubId_25" null $S1 - if_null $P2, __label_1 - set $S1, $P2 + if_null __ARG_1, __label_1 + set $S1, __ARG_1 __label_1: -.annotate 'line', 8249 -# var labels: $P1 getattribute $P1, self, 'labels' -.annotate 'line', 8250 -# exist: $S2 $S2 = $P1[$S1] -.annotate 'line', 8251 isnull $I1, $S2 not $I1 unless $I1 goto __label_3 isne $I1, $S2, '' __label_3: unless $I1 goto __label_2 -.annotate 'line', 8252 - WSubId_1('Label already defined', __ARG_1) + WSubId_25('Label already defined', __ARG_1) __label_2: # endif -.annotate 'line', 8253 -# value: $S3 $P2 = self.'genlabel'() null $S3 if_null $P2, __label_4 set $S3, $P2 __label_4: -.annotate 'line', 8254 $P1[$S1] = $S3 -.annotate 'line', 8255 .return($S3) -# } -.annotate 'line', 8256 .end # createlabel .sub 'getend' :method -# Body -# { -.annotate 'line', 8257 getattribute $P1, self, 'end' .return($P1) -# } .end # getend .sub 'emit' :method .param pmc __ARG_1 -# Body -# { -.annotate 'line', 8260 + $P2 = __ARG_1.'getDebug'() + set $I1, $P2 + unless $I1 goto __label_1 __ARG_1.'comment'('{') -.annotate 'line', 8261 + __label_1: # endif getattribute $P2, self, 'statements' - if_null $P2, __label_2 + if_null $P2, __label_3 iter $P3, $P2 set $P3, 0 - __label_1: # for iteration - unless $P3 goto __label_2 + __label_2: # for iteration + unless $P3 goto __label_3 shift $P1, $P3 -# { -.annotate 'line', 8262 $P1.'emit'(__ARG_1) -.annotate 'line', 8263 self.'freetemps'() -# } - goto __label_1 - __label_2: # endfor -.annotate 'line', 8265 + goto __label_2 + __label_3: # endfor + unless $I1 goto __label_4 __ARG_1.'comment'('}') -# } -.annotate 'line', 8266 + __label_4: # endif .end # emit .sub Winxed_class_init :anon :load :init newclass $P0, [ 'Winxed'; 'Compiler'; 'CompoundStatement' ] -.annotate 'line', 8217 get_class $P1, [ 'Winxed'; 'Compiler'; 'MultiStatementBase' ] addparent $P0, $P1 get_class $P2, [ 'Winxed'; 'Compiler'; 'BlockStatement' ] addparent $P0, $P2 -.annotate 'line', 8219 addattribute $P0, 'end' -.annotate 'line', 8220 addattribute $P0, 'labels' .end .namespace [ 'Winxed'; 'Compiler'; 'RegisterStore' ] .sub 'RegisterStore' :method .param string __ARG_1 -# Body -# { -.annotate 'line', 8281 box $P3, __ARG_1 setattribute self, 'type', $P3 -.annotate 'line', 8283 box $P3, 1 setattribute self, 'nreg', $P3 -.annotate 'line', 8284 new $P1, ['ResizableStringArray'] -.annotate 'line', 8285 new $P2, ['ResizableStringArray'] -.annotate 'line', 8286 setattribute self, 'tempreg', $P1 -.annotate 'line', 8287 setattribute self, 'freereg', $P2 -# } -.annotate 'line', 8288 .end # RegisterStore .sub 'createreg' :method -# Body -# { -.annotate 'line', 8291 -# var n: $P1 getattribute $P1, self, 'nreg' -.annotate 'line', 8292 -# i: $I1 - set $P2, $P1 - set $I1, $P2 -.annotate 'line', 8293 -# reg: $S1 + set $I1, $P1 set $I2, $I1 inc $I1 set $S1, $I2 -.annotate 'line', 8294 assign $P1, $I1 -# predefined string -.annotate 'line', 8295 getattribute $P2, self, 'type' set $S2, $P2 concat $S3, '$', $S2 concat $S3, $S3, $S1 .return($S3) -# } -.annotate 'line', 8296 .end # createreg .sub 'tempreg' :method -# Body -# { -.annotate 'line', 8299 -# var freereg: $P1 getattribute $P1, self, 'freereg' -.annotate 'line', 8300 -# var tempreg: $P2 getattribute $P2, self, 'tempreg' -.annotate 'line', 8301 -# reg: $S1 null $S1 -.annotate 'line', 8302 -# predefined elements elements $I1, $P1 - le $I1, 0, __label_1 -.annotate 'line', 8303 + unless $I1 goto __label_1 $P3 = $P1.'pop'() set $S1, $P3 goto __label_2 __label_1: # else -.annotate 'line', 8305 $P4 = self.'createreg'() set $S1, $P4 __label_2: # endif -.annotate 'line', 8306 -# predefined push push $P2, $S1 -.annotate 'line', 8307 .return($S1) -# } -.annotate 'line', 8308 .end # tempreg .sub 'freetemps' :method -# Body -# { -.annotate 'line', 8311 -# var freereg: $P1 getattribute $P1, self, 'freereg' -.annotate 'line', 8312 -# var tempreg: $P2 getattribute $P2, self, 'tempreg' -.annotate 'line', 8313 -# n: $I1 -# predefined elements elements $I1, $P2 -# for loop -.annotate 'line', 8314 -# i: $I2 sub $I2, $I1, 1 __label_3: # for condition lt $I2, 0, __label_2 -# { -.annotate 'line', 8315 -# s: $S1 $S1 = $P2[$I2] -.annotate 'line', 8316 -# predefined push push $P1, $S1 -# } __label_1: # for iteration -.annotate 'line', 8314 dec $I2 goto __label_3 __label_2: # for end -.annotate 'line', 8318 assign $P2, 0 -# } -.annotate 'line', 8319 .end # freetemps .sub Winxed_class_init :anon :load :init newclass $P0, [ 'Winxed'; 'Compiler'; 'RegisterStore' ] -.annotate 'line', 8275 addattribute $P0, 'type' -.annotate 'line', 8276 addattribute $P0, 'nreg' -.annotate 'line', 8277 addattribute $P0, 'tempreg' -.annotate 'line', 8278 addattribute $P0, 'freereg' .end .namespace [ 'Winxed'; 'Compiler'; 'ParameterModifierList' ] @@ -24332,12 +19337,7 @@ .sub 'ParameterModifierList' :method .param pmc __ARG_1 .param pmc __ARG_2 -# Body -# { -.annotate 'line', 8330 self.'ModifierList'(__ARG_1, __ARG_2) -# } -.annotate 'line', 8331 .end # ParameterModifierList @@ -24346,58 +19346,35 @@ .param pmc __ARG_1 .param pmc __ARG_2 .param string __ARG_3 -.const 'Sub' WSubId_1 = "WSubId_1" -# Body -# { -.annotate 'line', 8334 -# var named: $P1 +.const 'Sub' WSubId_25 = "WSubId_25" null $P1 -.annotate 'line', 8335 -# var slurpy: $P2 null $P2 -.annotate 'line', 8336 -# var modarglist: $P3 $P3 = self.'getlist'() -.annotate 'line', 8337 if_null $P3, __label_2 iter $P6, $P3 set $P6, 0 __label_1: # for iteration unless $P6 goto __label_2 shift $P4, $P6 -# { -.annotate 'line', 8338 -# modname: $S1 $P7 = $P4.'getname'() null $S1 if_null $P7, __label_3 set $S1, $P7 __label_3: -# switch -.annotate 'line', 8339 - set $S3, $S1 - set $S4, 'named' - if $S3 == $S4 goto __label_6 - set $S4, 'slurpy' - if $S3 == $S4 goto __label_7 - goto __label_5 + if $S1 == 'named' goto __label_6 + if $S1 == 'slurpy' goto __label_7 + goto __label_4 __label_6: # case -.annotate 'line', 8341 set $P1, $P4 - goto __label_4 # break + goto __label_5 # break __label_7: # case -.annotate 'line', 8344 set $P2, $P4 - goto __label_4 # break - __label_5: # default -.annotate 'line', 8347 + goto __label_5 # break + __label_4: # default __ARG_1.'print'(' :', $S1) - __label_4: # switch end -# } + __label_5: # switch end goto __label_1 __label_2: # endfor -# switch-case -.annotate 'line', 8351 isnull $I1, $P1 not $I1 unless $I1 goto __label_11 @@ -24405,74 +19382,53 @@ not $I1 __label_11: if $I1 goto __label_10 -.annotate 'line', 8358 isnull $I1, $P1 not $I1 if $I1 goto __label_12 -.annotate 'line', 8375 isnull $I1, $P2 not $I1 if $I1 goto __label_13 goto __label_9 __label_10: # case -.annotate 'line', 8356 __ARG_1.'print'(" :named :slurpy") goto __label_8 # break __label_12: # case -.annotate 'line', 8359 -# setname: $S2 null $S2 -# switch -.annotate 'line', 8360 $P7 = $P1.'numargs'() set $I2, $P7 - null $I3 - if $I2 == $I3 goto __label_16 - set $I3, 1 - if $I2 == $I3 goto __label_17 - goto __label_15 + if $I2 == 0 goto __label_16 + if $I2 == 1 goto __label_17 + goto __label_14 __label_16: # case -.annotate 'line', 8362 - concat $S2, "'", __ARG_3 - concat $S2, $S2, "'" - goto __label_14 # break + concat $S3, "'", __ARG_3 + concat $S3, $S3, "'" + set $S2, $S3 + goto __label_15 # break __label_17: # case -.annotate 'line', 8365 -# var argmod: $P5 $P5 = $P1.'getarg'(0) -.annotate 'line', 8366 $P8 = $P5.'isstringliteral'() isfalse $I4, $P8 unless $I4 goto __label_18 -.annotate 'line', 8367 - WSubId_1('Invalid modifier', __ARG_2) + WSubId_25('Invalid modifier', __ARG_2) __label_18: # endif -.annotate 'line', 8368 $P9 = $P5.'getPirString'() set $S2, $P9 - goto __label_14 # break - __label_15: # default -.annotate 'line', 8371 - WSubId_1('Invalid modifier', __ARG_2) - __label_14: # switch end -.annotate 'line', 8373 + goto __label_15 # break + __label_14: # default + WSubId_25('Invalid modifier', __ARG_2) + __label_15: # switch end __ARG_1.'print'(" :named(", $S2, ")") goto __label_8 # break __label_13: # case -.annotate 'line', 8376 __ARG_1.'print'(" :slurpy") goto __label_8 # break __label_9: # default __label_8: # switch end -.annotate 'line', 8377 -# } -.annotate 'line', 8379 .end # emitmodifiers .sub Winxed_class_init :anon :load :init newclass $P0, [ 'Winxed'; 'Compiler'; 'ParameterModifierList' ] -.annotate 'line', 8326 get_class $P1, [ 'Winxed'; 'Compiler'; 'ModifierList' ] addparent $P0, $P1 .end @@ -24481,135 +19437,247 @@ .sub 'FunctionParameter' :method .param pmc __ARG_1 .param pmc __ARG_2 -.const 'Sub' WSubId_96 = "WSubId_96" -# Body -# { -.annotate 'line', 8389 +.const 'Sub' WSubId_127 = "WSubId_127" setattribute self, 'func', __ARG_1 -.annotate 'line', 8390 -# var t: $P1 $P1 = __ARG_2.'get'() -.annotate 'line', 8391 -# type: $S1 $P3 = $P1.'checkkeyword'() - $P2 = WSubId_96($P3) + $P2 = WSubId_127($P3) null $S1 if_null $P2, __label_1 set $S1, $P2 __label_1: -.annotate 'line', 8392 eq $S1, '', __label_2 -.annotate 'line', 8393 $P1 = __ARG_2.'get'() goto __label_3 __label_2: # else -.annotate 'line', 8395 set $S1, 'P' __label_3: # endif -.annotate 'line', 8396 -# argname: $S2 -# predefined string + box $P2, $S1 + setattribute self, 'type', $P2 $P2 = __ARG_1.'getparamnum'() set $S3, $P2 concat $S2, '__ARG_', $S3 -.annotate 'line', 8397 __ARG_1.'createvarnamed'($P1, $S1, $S2) -.annotate 'line', 8399 -# predefined string set $S3, $P1 box $P2, $S3 setattribute self, 'name', $P2 -.annotate 'line', 8400 $P1 = __ARG_2.'get'() -.annotate 'line', 8401 $P2 = $P1.'isop'('[') if_null $P2, __label_4 unless $P2 goto __label_4 -.annotate 'line', 8402 new $P5, [ 'Winxed'; 'Compiler'; 'ParameterModifierList' ] getattribute $P6, __ARG_1, 'owner' $P5.'ParameterModifierList'(__ARG_2, $P6) set $P4, $P5 setattribute self, 'modifiers', $P4 - goto __label_5 - __label_4: # else -.annotate 'line', 8404 + $P1 = __ARG_2.'get'() + __label_4: # endif + $P2 = $P1.'isop'('=') + if_null $P2, __label_5 + unless $P2 goto __label_5 + new $P5, [ 'Winxed'; 'Compiler'; 'FunctionParameterDefault' ] + $P5.'FunctionParameterDefault'(__ARG_2, __ARG_1, self) + set $P4, $P5 + setattribute self, 'defaultexpr', $P4 + goto __label_6 + __label_5: # else __ARG_2.'unget'($P1) - __label_5: # endif -# } -.annotate 'line', 8405 + __label_6: # endif .end # FunctionParameter +.sub 'optimize' :method + getattribute $P1, self, 'defaultexpr' + if_null $P1, __label_1 + $P1.'optimize'() + $P3 = self.'getvar'() + $P2 = $P3.'getreg'() + set $S1, $P2 + concat $S2, "__opt_flag", $S1 + $P1.'setoptflag'($S2) + __label_1: # endif + .return(self) + +.end # optimize + + .sub 'emit' :method .param pmc __ARG_1 -.const 'Sub' WSubId_105 = "WSubId_105" -# Body -# { -.annotate 'line', 8408 -# var func: $P1 +.const 'Sub' WSubId_136 = "WSubId_136" getattribute $P1, self, 'func' -.annotate 'line', 8409 -# paramname: $S1 - getattribute $P4, self, 'name' + getattribute $P5, self, 'name' null $S1 - if_null $P4, __label_1 - set $S1, $P4 + if_null $P5, __label_1 + set $S1, $P5 __label_1: -.annotate 'line', 8410 -# var param: $P2 - $P2 = $P1.'getvar'($S1) -.annotate 'line', 8411 -# ptype: $S2 - $P5 = $P2.'gettype'() - $P4 = WSubId_105($P5) + $P2 = self.'getvar'() + $P6 = $P2.'gettype'() + $P5 = WSubId_136($P6) null $S2 - if_null $P4, __label_2 - set $S2, $P4 + if_null $P5, __label_2 + set $S2, $P5 __label_2: -.annotate 'line', 8412 - $P4 = $P2.'getreg'() - __ARG_1.'print'(' .param ', $S2, ' ', $P4) -.annotate 'line', 8413 -# var modarg: $P3 + $P5 = $P2.'getreg'() + __ARG_1.'print'(' .param ', $S2, ' ', $P5) getattribute $P3, self, 'modifiers' -.annotate 'line', 8414 if_null $P3, __label_3 -.annotate 'line', 8415 - getattribute $P4, $P1, 'start' - $P3.'emitmodifiers'(__ARG_1, $P4, $S1) + getattribute $P5, $P1, 'start' + $P3.'emitmodifiers'(__ARG_1, $P5, $S1) __label_3: # endif -.annotate 'line', 8416 + getattribute $P4, self, 'defaultexpr' + if_null $P4, __label_4 + $P5 = $P4.'getoptflag'() + __ARG_1.'print'(" :optional\n .param int ", $P5, " :opt_flag") + __label_4: # endif __ARG_1.'say'('') -# } -.annotate 'line', 8417 .end # emit + +.sub 'emitdefault' :method + .param pmc __ARG_1 + getattribute $P1, self, 'defaultexpr' + if_null $P1, __label_1 + $P1.'emit'(__ARG_1) + __label_1: # endif + +.end # emitdefault + + +.sub 'get_type' :method + getattribute $P1, self, 'type' + .return($P1) + +.end # get_type + + +.sub 'getvar' :method + getattribute $P1, self, 'func' + getattribute $P2, self, 'name' + .tailcall $P1.'getvar'($P2) + +.end # getvar + .sub Winxed_class_init :anon :load :init newclass $P0, [ 'Winxed'; 'Compiler'; 'FunctionParameter' ] -.annotate 'line', 8384 addattribute $P0, 'func' -.annotate 'line', 8385 addattribute $P0, 'name' -.annotate 'line', 8386 addattribute $P0, 'modifiers' + addattribute $P0, 'type' + addattribute $P0, 'defaultexpr' +.end +.namespace [ 'Winxed'; 'Compiler'; 'FunctionParameterDefault' ] + +.sub 'FunctionParameterDefault' :method + .param pmc __ARG_1 + .param pmc __ARG_2 + .param pmc __ARG_3 +.const 'Sub' WSubId_68 = "WSubId_68" + setattribute self, 'owner', __ARG_2 + setattribute self, 'param', __ARG_3 + $P2 = WSubId_68(__ARG_1, __ARG_2) + setattribute self, 'expr', $P2 + +.end # FunctionParameterDefault + + +.sub 'optimize' :method + getattribute $P4, self, 'expr' + $P3 = $P4.'optimize'() + setattribute self, 'expr', $P3 + getattribute $P2, self, 'param' + $P1 = $P2.'getvar'() + +.end # optimize + + +.sub 'setoptflag' :method + .param string __ARG_1 + box $P1, __ARG_1 + setattribute self, 'reg', $P1 + +.end # setoptflag + + +.sub 'getoptflag' :method +.const 'Sub' WSubId_30 = "WSubId_30" + getattribute $P1, self, 'reg' + unless_null $P1, __label_1 + getattribute $P2, self, 'param' + WSubId_30("Invalid parameter default usage", $P2) + __label_1: # endif + set $S1, $P1 + .return($S1) + +.end # getoptflag + + +.sub 'emit' :method + .param pmc __ARG_1 + getattribute $P1, self, 'expr' + $P5 = $P1.'isnull'() + isfalse $I1, $P5 + unless $I1 goto __label_1 + getattribute $P2, self, 'param' + $P3 = $P2.'getvar'() + getattribute $P6, self, 'owner' + $P5 = $P6.'genlabel'() + null $S1 + if_null $P5, __label_2 + set $S1, $P5 + __label_2: + $P5 = self.'getoptflag'() + null $S2 + if_null $P5, __label_3 + set $S2, $P5 + __label_3: + __ARG_1.'emitif'($S2, $S1) + $P5 = $P3.'getreg'() + null $S3 + if_null $P5, __label_4 + set $S3, $P5 + __label_4: + $P5 = $P3.'gettype'() + null $S4 + if_null $P5, __label_5 + set $S4, $P5 + __label_5: + $P5 = $P1.'checkresult'() + set $S5, $P5 + ne $S4, $S5, __label_6 + $P1.'emit_init'(__ARG_1, $S3) + goto __label_7 + __label_6: # else + $P4 = $P1.'emit_get'(__ARG_1) + ne $S4, 'P', __label_8 + __ARG_1.'emitbox'($S3, $P4) + goto __label_9 + __label_8: # else + __ARG_1.'emitset'($S3, $P4) + __label_9: # endif + __label_7: # endif + __ARG_1.'emitlabel'($S1) + __label_1: # endif + +.end # emit + +.sub Winxed_class_init :anon :load :init + newclass $P0, [ 'Winxed'; 'Compiler'; 'FunctionParameterDefault' ] + addattribute $P0, 'owner' + addattribute $P0, 'param' + addattribute $P0, 'expr' + addattribute $P0, 'reg' .end .namespace [ 'Winxed'; 'Compiler' ] -.sub 'parseParameter' :subid('WSubId_106') +.sub 'parseParameter' :subid('WSubId_137') .param pmc __ARG_1 .param pmc __ARG_2 -# Body -# { -.annotate 'line', 8422 new $P2, [ 'Winxed'; 'Compiler'; 'FunctionParameter' ] $P2.'FunctionParameter'(__ARG_2, __ARG_1) set $P1, $P2 .return($P1) -# } -.annotate 'line', 8423 .end # parseParameter @@ -24618,14 +19686,8 @@ .sub 'FunctionExtern' :method .param pmc __ARG_1 .param pmc __ARG_2 -# Body -# { -.annotate 'line', 8434 self.'initbase'(__ARG_1, __ARG_2) -.annotate 'line', 8435 setattribute self, 'name', __ARG_1 -# } -.annotate 'line', 8436 .end # FunctionExtern @@ -24633,72 +19695,51 @@ .sub 'emit_get' :method .param pmc __ARG_1 .param pmc __ARG_2 -.const 'Sub' WSubId_57 = "WSubId_57" -# Body -# { -.annotate 'line', 8439 -# var ns: $P1 - getattribute $P1, self, 'owner' -.annotate 'line', 8440 -# var path: $P2 - $P2 = $P1.'getpath'() -.annotate 'line', 8441 -# key: $S1 + getattribute $P2, self, 'owner' + $P1 = $P2.'getpath'() + $P2 = __ARG_2.'tempreg'('P') null $S1 -.annotate 'line', 8442 -# predefined elements - elements $I1, $P2 - le $I1, 0, __label_1 -.annotate 'line', 8443 - $P3 = WSubId_57($P2) - set $S1, $P3 - __label_1: # endif -.annotate 'line', 8444 -# reg: $S2 - $P3 = __ARG_2.'tempreg'('P') - null $S2 - if_null $P3, __label_2 - set $S2, $P3 - __label_2: -.annotate 'line', 8445 - getattribute $P3, self, 'name' - __ARG_1.'emitget_hll_global'($S2, $P3, $S1) -.annotate 'line', 8446 - .return($S2) -# } -.annotate 'line', 8447 + if_null $P2, __label_1 + set $S1, $P2 + __label_1: + self.'annotate'(__ARG_1) + getattribute $P2, self, 'name' + $P1.'emit_get_global'(__ARG_1, __ARG_2, $S1, $P2) + .return($S1) .end # emit_get .sub Winxed_class_init :anon :load :init newclass $P0, [ 'Winxed'; 'Compiler'; 'FunctionExtern' ] -.annotate 'line', 8429 get_class $P1, [ 'Winxed'; 'Compiler'; 'CommonBase' ] addparent $P0, $P1 -.annotate 'line', 8431 addattribute $P0, 'name' .end +.namespace [ 'Winxed'; 'Compiler' ] + +.sub 'emit_subid' :subid('WSubId_139') + .param string __ARG_1 + concat $S1, ".const 'Sub' ", __ARG_1 + concat $S1, $S1, ' = "' + concat $S1, $S1, __ARG_1 + concat $S1, $S1, "\"\n" + .return($S1) + +.end # emit_subid + .namespace [ 'Winxed'; 'Compiler'; 'FunctionModifierList' ] .sub 'FunctionModifierList' :method .param pmc __ARG_1 .param pmc __ARG_2 -# Body -# { -.annotate 'line', 8458 self.'ModifierList'(__ARG_1, __ARG_2) -# } -.annotate 'line', 8459 .end # FunctionModifierList .sub 'emit' :method .param pmc __ARG_1 -.const 'Sub' WSubId_1 = "WSubId_1" -# Body -# { -.annotate 'line', 8462 +.const 'Sub' WSubId_25 = "WSubId_25" $P3 = self.'getlist'() if_null $P3, __label_2 iter $P4, $P3 @@ -24706,320 +19747,343 @@ __label_1: # for iteration unless $P4 goto __label_2 shift $P1, $P4 -# { -.annotate 'line', 8463 -# nargmods: $I1 - $P5 = $P1.'numargs'() - set $I1, $P5 -.annotate 'line', 8464 - $P3 = $P1.'getname'() - __ARG_1.'print'(' :', $P3) -.annotate 'line', 8465 - le $I1, 0, __label_3 -# { -.annotate 'line', 8466 + $P5 = $P1.'getname'() + null $S1 + if_null $P5, __label_3 + set $S1, $P5 + __label_3: + ne $S1, 'multi', __label_4 + goto __label_1 # continue + __label_4: # endif + $P3 = $P1.'numargs'() + set $I1, $P3 + __ARG_1.'print'(' :', $S1) + le $I1, 0, __label_5 __ARG_1.'print'('(') -# for loop -.annotate 'line', 8467 -# iargmod: $I2 null $I2 - __label_6: # for condition - ge $I2, $I1, __label_5 -# { -.annotate 'line', 8468 -# var argmod: $P2 + __label_8: # for condition + ge $I2, $I1, __label_7 $P2 = $P1.'getarg'($I2) -.annotate 'line', 8469 $P3 = $P2.'isstringliteral'() isfalse $I3, $P3 - unless $I3 goto __label_7 -.annotate 'line', 8470 - WSubId_1('Invalid modifier', $P2) - __label_7: # endif -.annotate 'line', 8471 + unless $I3 goto __label_9 + WSubId_25('Invalid modifier', $P2) + __label_9: # endif $P3 = $P2.'getPirString'() __ARG_1.'print'($P3) -# } - __label_4: # for iteration -.annotate 'line', 8467 + sub $I3, $I1, 1 + ge $I2, $I3, __label_10 + __ARG_1.'print'(", ") + __label_10: # endif + __label_6: # for iteration inc $I2 - goto __label_6 - __label_5: # for end -.annotate 'line', 8473 + goto __label_8 + __label_7: # for end __ARG_1.'print'(')') -# } - __label_3: # endif -# } + __label_5: # endif goto __label_1 __label_2: # endfor -# } -.annotate 'line', 8476 .end # emit .sub Winxed_class_init :anon :load :init newclass $P0, [ 'Winxed'; 'Compiler'; 'FunctionModifierList' ] -.annotate 'line', 8454 get_class $P1, [ 'Winxed'; 'Compiler'; 'ModifierList' ] addparent $P0, $P1 .end -.namespace [ 'Winxed'; 'Compiler'; 'FunctionBase' ] +.namespace [ 'Winxed'; 'Compiler' ] -.sub 'FunctionBase' :method +.sub 'multi_sig_from_multi_modifier' :subid('WSubId_138') .param pmc __ARG_1 .param pmc __ARG_2 -# Body -# { -.annotate 'line', 8499 - self.'Statement'(__ARG_1, __ARG_2) -.annotate 'line', 8500 - box $P1, 0 - setattribute self, 'nlabel', $P1 -.annotate 'line', 8501 - new $P3, [ 'Winxed'; 'Compiler'; 'RegisterStore' ] - $P3.'RegisterStore'('I') - set $P2, $P3 - setattribute self, 'regstI', $P2 -.annotate 'line', 8502 - new $P3, [ 'Winxed'; 'Compiler'; 'RegisterStore' ] - $P3.'RegisterStore'('N') - set $P2, $P3 - setattribute self, 'regstN', $P2 -.annotate 'line', 8503 - new $P3, [ 'Winxed'; 'Compiler'; 'RegisterStore' ] - $P3.'RegisterStore'('S') - set $P2, $P3 +.const 'Sub' WSubId_25 = "WSubId_25" + $P5 = __ARG_2.'numargs'() + set $I1, $P5 + null $P1 + unless $I1 goto __label_1 + root_new $P5, ['parrot';'ResizablePMCArray'] + set $P1, $P5 + null $I2 + __label_4: # for condition + ge $I2, $I1, __label_3 + $P2 = __ARG_2.'getarg'($I2) + $P5 = $P2.'isstringliteral'() + set $I3, $P5 + if $I3 goto __label_7 + $P6 = $P2.'isidentifier'() + set $I3, $P6 + if $I3 goto __label_8 + isa $I3, $P2, [ 'Winxed'; 'Compiler'; 'OpClassExpr' ] + if $I3 goto __label_9 + goto __label_6 + __label_7: # case + $P7 = $P2.'get_value'() + push $P1, $P7 + goto __label_5 # break + __label_8: # case + $P8 = $P2.'getName'() + null $S1 + if_null $P8, __label_10 + set $S1, $P8 + __label_10: + if $S1 == "int" goto __label_13 + if $S1 == "string" goto __label_14 + if $S1 == "float" goto __label_15 + if $S1 == "var" goto __label_16 + goto __label_11 + __label_13: # case + __label_14: # case + push $P1, $S1 + goto __label_12 # break + __label_15: # case + push $P1, "num" + goto __label_12 # break + __label_16: # case + push $P1, "pmc" + goto __label_12 # break + __label_11: # default + WSubId_25("unsupported multi signature", $P2) + __label_12: # switch end + goto __label_5 # break + __label_9: # case + $P3 = $P2.'get_class_raw_key'() + unless_null $P3, __label_17 + WSubId_25("class not found", $P2) + __label_17: # endif + set $P4, $P3 + null $S2 + elements $I3, $P4 + unless $I3 goto __label_19 + join $S3, "'; '", $P4 + concat $S5, "[ '", $S3 + concat $S5, $S5, "' ]" + set $S2, $S5 + __label_19: # endif + set $S4, $S2 + goto __label_18 + __label_18: + push $P1, $S4 + goto __label_5 # break + __label_6: # default + WSubId_25("unsupported multi signature", $P2) + __label_5: # switch end + __label_2: # for iteration + inc $I2 + goto __label_4 + __label_3: # for end + __label_1: # endif + .return($P1) + +.end # multi_sig_from_multi_modifier + +.namespace [ 'Winxed'; 'Compiler'; 'FunctionBase' ] + +.sub 'FunctionBase' :method + .param pmc __ARG_1 + .param pmc __ARG_2 + self.'BlockStatement'(__ARG_1, __ARG_2) + box $P1, 0 + setattribute self, 'nlabel', $P1 + new $P3, [ 'Winxed'; 'Compiler'; 'RegisterStore' ] + $P3.'RegisterStore'('I') + set $P2, $P3 + setattribute self, 'regstI', $P2 + new $P3, [ 'Winxed'; 'Compiler'; 'RegisterStore' ] + $P3.'RegisterStore'('N') + set $P2, $P3 + setattribute self, 'regstN', $P2 + new $P3, [ 'Winxed'; 'Compiler'; 'RegisterStore' ] + $P3.'RegisterStore'('S') + set $P2, $P3 setattribute self, 'regstS', $P2 -.annotate 'line', 8504 new $P3, [ 'Winxed'; 'Compiler'; 'RegisterStore' ] $P3.'RegisterStore'('P') set $P2, $P3 setattribute self, 'regstP', $P2 -# } -.annotate 'line', 8505 .end # FunctionBase .sub 'getouter' :method -# Body -# { -.annotate 'line', 8507 .return(self) -# } .end # getouter +.sub 'allowtailcall' :method + .return(1) + +.end # allowtailcall + + .sub 'makesubid' :method -# Body -# { -.annotate 'line', 8511 -# var subid: $P1 getattribute $P1, self, 'subid' -.annotate 'line', 8512 unless_null $P1, __label_1 -.annotate 'line', 8513 $P1 = self.'generatesubid'() setattribute self, 'subid', $P1 __label_1: # endif -.annotate 'line', 8514 .return($P1) -# } -.annotate 'line', 8515 .end # makesubid .sub 'usesubid' :method .param string __ARG_1 -# Body -# { -.annotate 'line', 8518 -# var used: $P1 getattribute $P1, self, 'usedsubids' -.annotate 'line', 8519 unless_null $P1, __label_1 -.annotate 'line', 8520 root_new $P1, ['parrot';'Hash'] setattribute self, 'usedsubids', $P1 __label_1: # endif -.annotate 'line', 8521 $P1[__ARG_1] = 1 -# } -.annotate 'line', 8522 .end # usesubid .sub 'same_scope_as' :method .param pmc __ARG_1 -# Body -# { -.annotate 'line', 8526 -# r: $I1 issame $I1, self, __ARG_1 -.annotate 'line', 8527 .return($I1) -# } -.annotate 'line', 8528 .end # same_scope_as .sub 'parse_parameters' :method .param pmc __ARG_1 -.const 'Sub' WSubId_35 = "WSubId_35" -.const 'Sub' WSubId_106 = "WSubId_106" -# Body -# { -.annotate 'line', 8531 -# var t: $P1 +.const 'Sub' WSubId_67 = "WSubId_67" +.const 'Sub' WSubId_137 = "WSubId_137" $P1 = __ARG_1.'get'() -.annotate 'line', 8532 $P2 = $P1.'isop'(')') isfalse $I1, $P2 unless $I1 goto __label_1 -# { -.annotate 'line', 8533 __ARG_1.'unget'($P1) -.annotate 'line', 8534 - $P3 = WSubId_35(__ARG_1, self, WSubId_106, ')') + $P3 = WSubId_67(__ARG_1, self, WSubId_137, ')') setattribute self, 'params', $P3 -# } __label_1: # endif -# } -.annotate 'line', 8536 .end # parse_parameters .sub 'addlocalfunction' :method .param pmc __ARG_1 -# Body -# { -.annotate 'line', 8540 -# var localfun: $P1 getattribute $P1, self, 'localfun' -.annotate 'line', 8541 unless_null $P1, __label_1 -.annotate 'line', 8542 root_new $P3, ['parrot';'ResizablePMCArray'] - push $P3, __ARG_1 + assign $P3, 1 + $P3[0] = __ARG_1 setattribute self, 'localfun', $P3 goto __label_2 __label_1: # else -.annotate 'line', 8544 -# predefined push push $P1, __ARG_1 __label_2: # endif -# } -.annotate 'line', 8545 .end # addlocalfunction .sub 'usenamespace' :method .param pmc __ARG_1 -# Body -# { -.annotate 'line', 8548 -# var usedns: $P1 getattribute $P1, self, 'usednamespaces' -.annotate 'line', 8549 unless_null $P1, __label_1 -# { -.annotate 'line', 8551 - root_new $P4, ['parrot';'ResizablePMCArray'] - push $P4, __ARG_1 - setattribute self, 'usednamespaces', $P4 -# } + root_new $P6, ['parrot';'ResizablePMCArray'] + assign $P6, 1 + $P6[0] = __ARG_1 + setattribute self, 'usednamespaces', $P6 goto __label_2 __label_1: # else -# { -.annotate 'line', 8554 - if_null $P1, __label_4 - iter $P6, $P1 - set $P6, 0 - __label_3: # for iteration - unless $P6 goto __label_4 - shift $P2, $P6 -.annotate 'line', 8555 - ne_addr __ARG_1, $P2, __label_5 -.annotate 'line', 8556 + set $P2, $P1 + set $P3, __ARG_1 + if_null $P2, __label_6 + iter $P8, $P2 + set $P8, 0 + __label_5: # for iteration + unless $P8 goto __label_6 + shift $P4, $P8 + ne_addr $P4, $P3, __label_7 + set $P7, $P4 + goto __label_4 + __label_7: # endif + goto __label_5 + __label_6: # endfor + null $P7 + goto __label_4 + __label_4: + set $P5, $P7 + if_null $P5, __label_3 .return() - __label_5: # endif - goto __label_3 - __label_4: # endfor -.annotate 'line', 8557 -# predefined push + __label_3: # endif push $P1, __ARG_1 -# } __label_2: # endif -# } -.annotate 'line', 8559 .end # usenamespace -.sub 'findsymbol' :method +.sub 'scopesearch' :method .param pmc __ARG_1 -# Body -# { -.annotate 'line', 8562 -# var found: $P1 - null $P1 -.annotate 'line', 8563 + .param int __ARG_2 getattribute $P3, self, 'usednamespaces' if_null $P3, __label_2 iter $P4, $P3 set $P4, 0 __label_1: # for iteration unless $P4 goto __label_2 - shift $P2, $P4 -# { -.annotate 'line', 8564 - $P1 = $P2.'findsymbol'(__ARG_1) -.annotate 'line', 8565 - if_null $P1, __label_3 -.annotate 'line', 8566 - .return($P1) + shift $P1, $P4 + $P2 = $P1.'scopesearch'(__ARG_1, __ARG_2) + if_null $P2, __label_3 + .return($P2) __label_3: # endif -# } goto __label_1 __label_2: # endfor -.annotate 'line', 8568 getattribute $P3, self, 'owner' - .tailcall $P3.'findsymbol'(__ARG_1) -# } -.annotate 'line', 8569 + .tailcall $P3.'scopesearch'(__ARG_1, __ARG_2) -.end # findsymbol +.end # scopesearch .sub 'optimize' :method -# Body -# { -.annotate 'line', 8573 - getattribute $P2, self, 'usednamespaces' +.const 'Sub' WSubId_138 = "WSubId_138" +.const 'Sub' WSubId_5 = "WSubId_5" + getattribute $P1, self, 'modifiers' + if_null $P1, __label_1 + $P2 = $P1.'pick'('multi') if_null $P2, __label_2 - iter $P3, $P2 - set $P3, 0 - __label_1: # for iteration - unless $P3 goto __label_2 - shift $P1, $P3 -.annotate 'line', 8574 - $P1.'fixnamespaces'() - goto __label_1 - __label_2: # endfor -.annotate 'line', 8575 - getattribute $P5, self, 'body' - $P4 = $P5.'optimize'() - setattribute self, 'body', $P4 -.annotate 'line', 8576 + self.'setmulti'() + $P8 = WSubId_138(self, $P2) + setattribute self, 'multi_sig', $P8 + __label_2: # endif + __label_1: # endif + getattribute $P3, self, 'params' + if_null $P3, __label_5 + elements $I1, $P3 + goto __label_4 + __label_5: + null $I1 + __label_4: + null $I2 + __label_8: # for condition + ge $I2, $I1, __label_7 + $P8 = $P3[$I2] + $P7 = $P8.'optimize'() + $P3[$I2] = $P7 + __label_6: # for iteration + inc $I2 + goto __label_8 + __label_7: # for end + __label_3: + getattribute $P4, self, 'usednamespaces' + $P5 = WSubId_5("fixnamespaces") + if_null $P4, __label_11 + iter $P9, $P4 + set $P9, 0 + __label_10: # for iteration + unless $P9 goto __label_11 + shift $P6, $P9 + $P5($P6) + goto __label_10 + __label_11: # endfor + __label_9: + getattribute $P10, self, 'body' + $P8 = $P10.'optimize'() + setattribute self, 'body', $P8 .return(self) -# } -.annotate 'line', 8577 .end # optimize @@ -25027,21 +20091,12 @@ .sub 'setusedlex' :method .param string __ARG_1 .param string __ARG_2 -# Body -# { -.annotate 'line', 8581 -# var lexicals: $P1 getattribute $P1, self, 'usedlexicals' -.annotate 'line', 8582 unless_null $P1, __label_1 -.annotate 'line', 8583 root_new $P1, ['parrot';'Hash'] setattribute self, 'usedlexicals', $P1 __label_1: # endif -.annotate 'line', 8584 $P1[__ARG_2] = __ARG_1 -# } -.annotate 'line', 8585 .end # setusedlex @@ -25049,481 +20104,378 @@ .sub 'setlex' :method .param string __ARG_1 .param string __ARG_2 -# Body -# { -.annotate 'line', 8588 -# var lexicals: $P1 getattribute $P1, self, 'lexicals' -.annotate 'line', 8589 unless_null $P1, __label_1 -.annotate 'line', 8590 root_new $P1, ['parrot';'Hash'] setattribute self, 'lexicals', $P1 __label_1: # endif -.annotate 'line', 8591 $P1[__ARG_2] = __ARG_1 -# } -.annotate 'line', 8592 .end # setlex .sub 'createlex' :method .param pmc __ARG_1 -# Body -# { -.annotate 'line', 8597 -# var lex: $P1 $P1 = __ARG_1.'getlex'() -.annotate 'line', 8598 -# lexname: $S1 null $S1 -.annotate 'line', 8599 if_null $P1, __label_1 -.annotate 'line', 8600 set $S1, $P1 goto __label_2 __label_1: # else -# { -.annotate 'line', 8602 -# reg: $S2 $P2 = __ARG_1.'getreg'() null $S2 if_null $P2, __label_3 set $S2, $P2 __label_3: -.annotate 'line', 8603 -# lexnum: $I1 $P2 = self.'getlexnum'() set $I1, $P2 -.annotate 'line', 8604 -# predefined string set $S3, $I1 - concat $S1, '__WLEX_', $S3 -.annotate 'line', 8605 + concat $S4, '__WLEX_', $S3 + set $S1, $S4 self.'setlex'($S1, $S2) -.annotate 'line', 8606 __ARG_1.'setlex'($S1) -# } __label_2: # endif -.annotate 'line', 8608 .return($S1) -# } -.annotate 'line', 8609 .end # createlex .sub 'createreg' :method .param string __ARG_1 -.const 'Sub' WSubId_6 = "WSubId_6" -# Body -# { -.annotate 'line', 8613 -# var store: $P1 +.const 'Sub' WSubId_30 = "WSubId_30" null $P1 -# switch -.annotate 'line', 8614 - set $S2, __ARG_1 - set $S3, 'I' - if $S2 == $S3 goto __label_3 - set $S3, 'N' - if $S2 == $S3 goto __label_4 - set $S3, 'S' - if $S2 == $S3 goto __label_5 - set $S3, 'P' - if $S2 == $S3 goto __label_6 - goto __label_2 + if_null __ARG_1, __label_1 + length $I1, __ARG_1 + ne $I1, 1, __label_1 + ord $I1, __ARG_1 + if $I1 == 73 goto __label_3 + if $I1 == 78 goto __label_4 + if $I1 == 83 goto __label_5 + if $I1 == 80 goto __label_6 + goto __label_1 __label_3: # case -.annotate 'line', 8616 getattribute $P1, self, 'regstI' - goto __label_1 # break + goto __label_2 # break __label_4: # case -.annotate 'line', 8618 getattribute $P1, self, 'regstN' - goto __label_1 # break + goto __label_2 # break __label_5: # case -.annotate 'line', 8620 getattribute $P1, self, 'regstS' - goto __label_1 # break + goto __label_2 # break __label_6: # case -.annotate 'line', 8622 getattribute $P1, self, 'regstP' - goto __label_1 # break - __label_2: # default -.annotate 'line', 8624 - concat $S4, 'Invalid type in createreg: ', __ARG_1 - WSubId_6($S4) - __label_1: # switch end -.annotate 'line', 8626 -# reg: $S1 + goto __label_2 # break + __label_1: # default + concat $S2, "Invalid type in createreg: ", __ARG_1 + WSubId_30($S2) + __label_2: # switch end $P2 = $P1.'createreg'() null $S1 if_null $P2, __label_7 set $S1, $P2 __label_7: -.annotate 'line', 8627 .return($S1) -# } -.annotate 'line', 8628 .end # createreg .sub 'tempreg' :method .param string __ARG_1 -.const 'Sub' WSubId_6 = "WSubId_6" -# Body -# { -.annotate 'line', 8631 -# var store: $P1 +.const 'Sub' WSubId_30 = "WSubId_30" null $P1 -# switch -.annotate 'line', 8632 - set $S2, __ARG_1 - set $S3, 'I' - if $S2 == $S3 goto __label_3 - set $S3, 'N' - if $S2 == $S3 goto __label_4 - set $S3, 'S' - if $S2 == $S3 goto __label_5 - set $S3, 'P' - if $S2 == $S3 goto __label_6 - goto __label_2 + if_null __ARG_1, __label_1 + length $I1, __ARG_1 + ne $I1, 1, __label_1 + ord $I1, __ARG_1 + if $I1 == 73 goto __label_3 + if $I1 == 78 goto __label_4 + if $I1 == 83 goto __label_5 + if $I1 == 80 goto __label_6 + goto __label_1 __label_3: # case -.annotate 'line', 8634 getattribute $P1, self, 'regstI' - goto __label_1 # break + goto __label_2 # break __label_4: # case -.annotate 'line', 8636 getattribute $P1, self, 'regstN' - goto __label_1 # break + goto __label_2 # break __label_5: # case -.annotate 'line', 8638 getattribute $P1, self, 'regstS' - goto __label_1 # break + goto __label_2 # break __label_6: # case -.annotate 'line', 8640 getattribute $P1, self, 'regstP' - goto __label_1 # break - __label_2: # default -.annotate 'line', 8642 - concat $S4, "Invalid type '", __ARG_1 - concat $S4, $S4, "' in tempreg" - WSubId_6($S4) - __label_1: # switch end -.annotate 'line', 8644 -# reg: $S1 + goto __label_2 # break + __label_1: # default + concat $S2, "Invalid type in tempreg: ", __ARG_1 + WSubId_30($S2) + __label_2: # switch end $P2 = $P1.'tempreg'() null $S1 if_null $P2, __label_7 set $S1, $P2 __label_7: -.annotate 'line', 8645 .return($S1) -# } -.annotate 'line', 8646 .end # tempreg .sub 'freetemps' :method -# Body -# { -.annotate 'line', 8649 - root_new $P2, ['parrot';'ResizablePMCArray'] +.const 'Sub' WSubId_5 = "WSubId_5" + root_new $P1, ['parrot';'ResizablePMCArray'] + assign $P1, 4 getattribute $P4, self, 'regstI' - push $P2, $P4 + $P1[0] = $P4 getattribute $P5, self, 'regstN' - push $P2, $P5 + $P1[1] = $P5 getattribute $P6, self, 'regstS' - push $P2, $P6 + $P1[2] = $P6 getattribute $P7, self, 'regstP' - push $P2, $P7 - if_null $P2, __label_2 - iter $P8, $P2 + $P1[3] = $P7 + $P2 = WSubId_5("freetemps") + if_null $P1, __label_3 + iter $P8, $P1 set $P8, 0 - __label_1: # for iteration - unless $P8 goto __label_2 - shift $P1, $P8 -.annotate 'line', 8650 - $P1.'freetemps'() - goto __label_1 - __label_2: # endfor -# } -.annotate 'line', 8651 + __label_2: # for iteration + unless $P8 goto __label_3 + shift $P3, $P8 + $P2($P3) + goto __label_2 + __label_3: # endfor + __label_1: .end # freetemps .sub 'genlabel' :method -# Body -# { -.annotate 'line', 8654 -# n: $I1 - getattribute $P2, self, 'nlabel' - inc $P2 - set $P1, $P2 + getattribute $P1, self, 'nlabel' + inc $P1 set $I1, $P1 -# predefined string -.annotate 'line', 8655 set $S1, $I1 concat $S2, '__label_', $S1 .return($S2) -# } -.annotate 'line', 8656 .end # genlabel .sub 'getbreaklabel' :method .param pmc __ARG_1 -.const 'Sub' WSubId_1 = "WSubId_1" -# Body -# { -.annotate 'line', 8659 - WSubId_1('break not allowed here', __ARG_1) -# } -.annotate 'line', 8660 +.const 'Sub' WSubId_25 = "WSubId_25" + WSubId_25('break not allowed here', __ARG_1) .end # getbreaklabel .sub 'getcontinuelabel' :method .param pmc __ARG_1 -.const 'Sub' WSubId_1 = "WSubId_1" -# Body -# { -.annotate 'line', 8663 - WSubId_1('continue not allowed here', __ARG_1) -# } -.annotate 'line', 8664 +.const 'Sub' WSubId_25 = "WSubId_25" + WSubId_25('continue not allowed here', __ARG_1) .end # getcontinuelabel +.sub 'emit_extra_modifiers' :method + .param pmc __ARG_1 + +.end # emit_extra_modifiers + + .sub 'emit' :method .param pmc __ARG_1 -.const 'Sub' WSubId_51 = "WSubId_51" -# Body -# { -.annotate 'line', 8668 -# name: $S1 - getattribute $P8, self, 'name' +.const 'Sub' WSubId_139 = "WSubId_139" +.const 'Sub' WSubId_3 = "WSubId_3" +.const 'Sub' WSubId_5 = "WSubId_5" +.const 'Sub' WSubId_45 = "WSubId_45" + getattribute $P23, self, 'name' null $S1 - if_null $P8, __label_1 - set $S1, $P8 + if_null $P23, __label_1 + set $S1, $P23 __label_1: -.annotate 'line', 8669 __ARG_1.'say'() -.annotate 'line', 8670 __ARG_1.'print'(".sub ") -.annotate 'line', 8671 - $P8 = self.'isanonymous'() - if_null $P8, __label_2 - unless $P8 goto __label_2 -.annotate 'line', 8672 + $P23 = self.'isanonymous'() + if_null $P23, __label_2 + unless $P23 goto __label_2 __ARG_1.'print'("'' :anon") goto __label_3 __label_2: # else -.annotate 'line', 8674 __ARG_1.'print'("'", $S1, "'") __label_3: # endif -.annotate 'line', 8675 - getattribute $P8, self, 'subid' - if_null $P8, __label_4 -.annotate 'line', 8676 - getattribute $P9, self, 'subid' - __ARG_1.'print'(" :subid('", $P9, "')") + getattribute $P23, self, 'subid' + if_null $P23, __label_4 + getattribute $P24, self, 'subid' + __ARG_1.'print'(" :subid('", $P24, "')") __label_4: # endif -.annotate 'line', 8677 - getattribute $P8, self, 'outer' - if_null $P8, __label_5 -# { -.annotate 'line', 8678 -# var outer: $P1 getattribute $P1, self, 'outer' -.annotate 'line', 8679 -# var outerid: $P2 + isnull $I2, $P1 + not $I2 + unless $I2 goto __label_6 + getattribute $P23, self, 'usedlexicals' + isnull $I2, $P23 + not $I2 + __label_6: + unless $I2 goto __label_5 getattribute $P2, $P1, 'subid' -.annotate 'line', 8680 - if_null $P2, __label_6 -.annotate 'line', 8681 + if_null $P2, __label_7 __ARG_1.'print'(" :outer('", $P2, "')") - __label_6: # endif -# } + __label_7: # endif __label_5: # endif -.annotate 'line', 8685 - $P8 = self.'ismethod'() - if_null $P8, __label_7 - unless $P8 goto __label_7 -.annotate 'line', 8686 + $P23 = self.'ismethod'() + if_null $P23, __label_8 + unless $P23 goto __label_8 __ARG_1.'print'(' :method') - __label_7: # endif -.annotate 'line', 8687 -# var modifiers: $P3 + __label_8: # endif getattribute $P3, self, 'modifiers' -.annotate 'line', 8688 - if_null $P3, __label_8 -.annotate 'line', 8689 + if_null $P3, __label_9 $P3.'emit'(__ARG_1) - goto __label_9 - __label_8: # else -# { -.annotate 'line', 8691 - ne $S1, 'main', __label_10 -.annotate 'line', 8692 + goto __label_10 + __label_9: # else + ne $S1, 'main', __label_11 __ARG_1.'print'(' :main') + __label_11: # endif __label_10: # endif -# } - __label_9: # endif -.annotate 'line', 8694 + self.'emit_extra_modifiers'(__ARG_1) __ARG_1.'say'() -.annotate 'line', 8697 - getattribute $P8, self, 'params' - WSubId_51(__ARG_1, $P8) -.annotate 'line', 8699 -# var lexicals: $P4 - getattribute $P4, self, 'lexicals' -.annotate 'line', 8700 -# var usedlexicals: $P5 - getattribute $P5, self, 'usedlexicals' -.annotate 'line', 8701 - isnull $I1, $P4 - not $I1 - if $I1 goto __label_12 - isnull $I1, $P5 - not $I1 + getattribute $P4, self, 'params' + set $P8, __ARG_1 + set $P9, $P4 +.const 'Sub' WSubId_3 = "WSubId_3" +.const 'Sub' WSubId_5 = "WSubId_5" + set $P10, $P9 + $P23 = WSubId_5("emit") + $P11 = WSubId_3($P23, $P8) + if_null $P10, __label_15 + iter $P25, $P10 + set $P25, 0 + __label_14: # for iteration + unless $P25 goto __label_15 + shift $P12, $P25 + $P11($P12) + goto __label_14 + __label_15: # endfor + __label_13: __label_12: - unless $I1 goto __label_11 -# { -.annotate 'line', 8702 - getattribute $P8, self, 'start' - __ARG_1.'annotate'($P8) -.annotate 'line', 8704 - if_null $P4, __label_14 - iter $P10, $P4 - set $P10, 0 - __label_13: # for iteration - unless $P10 goto __label_14 - shift $S2, $P10 -.annotate 'line', 8705 - $P8 = $P4[$S2] - __ARG_1.'say'(".lex '", $P8, "', ", $S2) - goto __label_13 - __label_14: # endfor -.annotate 'line', 8707 - if_null $P5, __label_16 - iter $P11, $P5 - set $P11, 0 - __label_15: # for iteration - unless $P11 goto __label_16 - shift $S3, $P11 -# { -.annotate 'line', 8708 -# predefined substr - substr $S5, $S3, 0, 1 - eq $S5, '$', __label_17 -.annotate 'line', 8709 - concat $S6, " .local pmc ", $S3 - __ARG_1.'say'($S6) - __label_17: # endif -.annotate 'line', 8710 - $P8 = $P5[$S3] - __ARG_1.'emitfind_lex'($S3, $P8) -# } - goto __label_15 - __label_16: # endfor -# } - __label_11: # endif -.annotate 'line', 8714 - getattribute $P8, self, 'usedsubids' - if_null $P8, __label_19 - iter $P12, $P8 - set $P12, 0 - __label_18: # for iteration - unless $P12 goto __label_19 - shift $S4, $P12 -# { -.annotate 'line', 8716 - __ARG_1.'say'(".const 'Sub' ", $S4, ' = "', $S4, '"') -# } - goto __label_18 - __label_19: # endfor -.annotate 'line', 8719 -# var body: $P6 - getattribute $P6, self, 'body' -.annotate 'line', 8720 - $P8 = $P6.'isempty'() - if_null $P8, __label_20 - unless $P8 goto __label_20 -.annotate 'line', 8721 + getattribute $P13, self, 'usedsubids' + root_new $P14, ['parrot';'ResizablePMCArray'] + set $P15, WSubId_139 + if_null $P13, __label_18 + iter $P27, $P13 + set $P27, 0 + __label_17: # for iteration + unless $P27 goto __label_18 + shift $P16, $P27 + $P23 = $P15($P16) + push $P14, $P23 + goto __label_17 + __label_18: # endfor + set $P26, $P14 + goto __label_16 + __label_16: + set $P23, $P26 + join $S4, "", $P23 + __ARG_1.'print'($S4) + set $P17, $P4 + $P23 = WSubId_5("emitdefault") + $P18 = WSubId_3($P23, __ARG_1) + if_null $P17, __label_21 + iter $P28, $P17 + set $P28, 0 + __label_20: # for iteration + unless $P28 goto __label_21 + shift $P19, $P28 + $P18($P19) + goto __label_20 + __label_21: # endfor + __label_19: + getattribute $P5, self, 'lexicals' + getattribute $P6, self, 'usedlexicals' + isnull $I2, $P5 + not $I2 + if $I2 goto __label_23 + isnull $I2, $P6 + not $I2 + __label_23: + unless $I2 goto __label_22 + getattribute $P23, self, 'start' + __ARG_1.'annotate'($P23) + if_null $P5, __label_25 + iter $P29, $P5 + set $P29, 0 + __label_24: # for iteration + unless $P29 goto __label_25 + shift $S2, $P29 + $P24 = $P5[$S2] + $P23 = WSubId_45(".lex '%0', %1", $P24, $S2) + __ARG_1.'say'($P23) + goto __label_24 + __label_25: # endfor + if_null $P6, __label_27 + iter $P30, $P6 + set $P30, 0 + __label_26: # for iteration + unless $P30 goto __label_27 + shift $S3, $P30 + substr $S4, $S3, 0, 1 + eq $S4, '$', __label_28 + concat $S5, " .local pmc ", $S3 + __ARG_1.'say'($S5) + __label_28: # endif + $P23 = $P6[$S3] + __ARG_1.'emitfind_lex'($S3, $P23) + goto __label_26 + __label_27: # endfor + __label_22: # endif + $P23 = __ARG_1.'getDebug'() + set $I1, $P23 + getattribute $P7, self, 'body' + $P23 = $P7.'isempty'() + if_null $P23, __label_29 + unless $P23 goto __label_29 + unless $I1 goto __label_31 __ARG_1.'comment'('Empty body') - goto __label_21 - __label_20: # else -# { -.annotate 'line', 8723 + __label_31: # endif + goto __label_30 + __label_29: # else + unless $I1 goto __label_32 __ARG_1.'comment'('Body') -.annotate 'line', 8724 - $P6.'emit'(__ARG_1) -.annotate 'line', 8725 - $P8 = $P6.'getend'() - __ARG_1.'annotate'($P8) -# } - __label_21: # endif -.annotate 'line', 8727 - __ARG_1.'say'("\n.end # ", $S1, "\n") -.annotate 'line', 8730 - getattribute $P8, self, 'localfun' - if_null $P8, __label_23 - iter $P13, $P8 - set $P13, 0 - __label_22: # for iteration - unless $P13 goto __label_23 - shift $P7, $P13 -.annotate 'line', 8731 + __label_32: # endif $P7.'emit'(__ARG_1) - goto __label_22 - __label_23: # endfor -# } -.annotate 'line', 8732 + $P23 = $P7.'getend'() + __ARG_1.'annotate'($P23) + __label_30: # endif + __ARG_1.'say'("\n.end # ", $S1, "\n") + getattribute $P20, self, 'localfun' + $P23 = WSubId_5("emit") + $P21 = WSubId_3($P23, __ARG_1) + if_null $P20, __label_35 + iter $P31, $P20 + set $P31, 0 + __label_34: # for iteration + unless $P31 goto __label_35 + shift $P22, $P31 + $P21($P22) + goto __label_34 + __label_35: # endfor + __label_33: .end # emit .sub Winxed_class_init :anon :load :init newclass $P0, [ 'Winxed'; 'Compiler'; 'FunctionBase' ] -.annotate 'line', 8479 get_class $P1, [ 'Winxed'; 'Compiler'; 'BlockStatement' ] addparent $P0, $P1 -.annotate 'line', 8481 addattribute $P0, 'name' -.annotate 'line', 8482 addattribute $P0, 'subid' -.annotate 'line', 8483 addattribute $P0, 'modifiers' -.annotate 'line', 8484 addattribute $P0, 'params' -.annotate 'line', 8485 addattribute $P0, 'body' -.annotate 'line', 8486 addattribute $P0, 'regstI' -.annotate 'line', 8487 addattribute $P0, 'regstN' -.annotate 'line', 8488 addattribute $P0, 'regstS' -.annotate 'line', 8489 addattribute $P0, 'regstP' -.annotate 'line', 8490 addattribute $P0, 'nlabel' -.annotate 'line', 8491 addattribute $P0, 'localfun' -.annotate 'line', 8492 addattribute $P0, 'lexicals' -.annotate 'line', 8493 addattribute $P0, 'usedlexicals' -.annotate 'line', 8494 addattribute $P0, 'usedsubids' -.annotate 'line', 8495 addattribute $P0, 'outer' .end .namespace [ 'Winxed'; 'Compiler'; 'FunctionStatement' ] @@ -25532,152 +20484,170 @@ .param pmc __ARG_1 .param pmc __ARG_2 .param pmc __ARG_3 -# Body -# { -.annotate 'line', 8746 self.'FunctionBase'(__ARG_1, __ARG_3) -.annotate 'line', 8747 box $P1, 0 setattribute self, 'paramnum', $P1 -.annotate 'line', 8748 box $P1, 0 setattribute self, 'lexnum', $P1 -.annotate 'line', 8749 self.'parse'(__ARG_2) -# } -.annotate 'line', 8750 + new $P2, [ 'Boolean' ] + setattribute self, 'is_multi', $P2 .end # FunctionStatement .sub 'isanonymous' :method -# Body -# { -.annotate 'line', 8752 .return(0) -# } .end # isanonymous .sub 'getparamnum' :method -# Body -# { -# predefined int -.annotate 'line', 8756 getattribute $P1, self, 'paramnum' inc $P1 set $I1, $P1 .return($I1) -# } -.annotate 'line', 8757 .end # getparamnum .sub 'getlexnum' :method -# Body -# { -# predefined int -.annotate 'line', 8761 getattribute $P1, self, 'lexnum' inc $P1 set $I1, $P1 .return($I1) -# } -.annotate 'line', 8762 .end # getlexnum .sub 'ismethod' :method -# Body -# { -.annotate 'line', 8763 .return(0) -# } .end # ismethod +.sub 'ismulti' :method + getattribute $P1, self, 'is_multi' + if_null $P1, __label_2 + unless $P1 goto __label_2 + set $I1, 1 + goto __label_1 + __label_2: + null $I1 + __label_1: + .return($I1) + +.end # ismulti + + +.sub 'setmulti' :method + getattribute $P1, self, 'is_multi' + assign $P1, 1 + +.end # setmulti + + +.sub 'default_multi_sig' :subid('WSubId_13') :method +.const 'Sub' WSubId_14 = "WSubId_14" + root_new $P1, ['parrot';'ResizablePMCArray'] + $P6 = self.'ismethod'() + if_null $P6, __label_1 + unless $P6 goto __label_1 + push $P1, "_" + __label_1: # endif + getattribute $P2, self, 'params' + set $P3, $P1 + set $P4, WSubId_14 + if_null $P2, __label_4 + iter $P7, $P2 + set $P7, 0 + __label_3: # for iteration + unless $P7 goto __label_4 + shift $P5, $P7 + $P6 = $P4($P5) + push $P3, $P6 + goto __label_3 + __label_4: # endfor + goto __label_2 + __label_2: + .return($P1) + +.end # default_multi_sig + + +.sub '' :anon :subid('WSubId_14') + .param pmc __ARG_1 +.const 'Sub' WSubId_136 = "WSubId_136" + $P1 = __ARG_1.'get_type'() + .tailcall WSubId_136($P1) + +.end # WSubId_14 + + .sub 'parse' :method .param pmc __ARG_1 -.const 'Sub' WSubId_4 = "WSubId_4" -.const 'Sub' WSubId_107 = "WSubId_107" -.const 'Sub' WSubId_2 = "WSubId_2" -# Body -# { -.annotate 'line', 8767 -# var name: $P1 +.const 'Sub' WSubId_28 = "WSubId_28" +.const 'Sub' WSubId_140 = "WSubId_140" +.const 'Sub' WSubId_26 = "WSubId_26" $P1 = __ARG_1.'get'() -.annotate 'line', 8768 setattribute self, 'name', $P1 -.annotate 'line', 8769 -# var t: $P2 $P2 = __ARG_1.'get'() -.annotate 'line', 8770 $P4 = $P2.'isop'('[') if_null $P4, __label_1 unless $P4 goto __label_1 -# { -.annotate 'line', 8771 new $P7, [ 'Winxed'; 'Compiler'; 'FunctionModifierList' ] getattribute $P8, self, 'owner' $P7.'FunctionModifierList'(__ARG_1, $P8) set $P6, $P7 setattribute self, 'modifiers', $P6 -.annotate 'line', 8772 $P2 = __ARG_1.'get'() -# } __label_1: # endif -.annotate 'line', 8774 - WSubId_4('(', $P2) -.annotate 'line', 8775 + WSubId_28('(', $P2) self.'parse_parameters'(__ARG_1) -.annotate 'line', 8777 -# var fullname: $P3 getattribute $P5, self, 'owner' $P4 = $P5.'getpath'() -# predefined clone - clone $P3, $P4 -.annotate 'line', 8778 - $P4 = $P1.'getidentifier'() -# predefined push - push $P3, $P4 -.annotate 'line', 8779 -# predefined join - join $S1, '.', $P3 - WSubId_107(self, '__FUNCTION__', $S1) -.annotate 'line', 8781 + $P6 = $P1.'getidentifier'() + $P3 = $P4.'createchild'($P6) + $P4 = $P3.'fullname'() + WSubId_140(self, '__FUNCTION__', $P4) $P2 = __ARG_1.'get'() -.annotate 'line', 8782 $P4 = $P2.'isop'('{') isfalse $I1, $P4 unless $I1 goto __label_2 -.annotate 'line', 8783 - WSubId_2('{', $P2) + WSubId_26('{', $P2) __label_2: # endif -.annotate 'line', 8784 new $P6, [ 'Winxed'; 'Compiler'; 'CompoundStatement' ] $P6.'CompoundStatement'($P2, __ARG_1, self) set $P5, $P6 setattribute self, 'body', $P5 -.annotate 'line', 8785 .return(self) -# } -.annotate 'line', 8786 .end # parse + +.sub 'emit_extra_modifiers' :method + .param pmc __ARG_1 + getattribute $P2, self, 'is_multi' + if_null $P2, __label_1 + unless $P2 goto __label_1 + getattribute $P1, self, 'multi_sig' + unless_null $P1, __label_2 + $P1 = self.'default_multi_sig'() + __label_2: # endif + join $S1, ", ", $P1 + __ARG_1.'print'(' :multi(', $S1, ')') + __label_1: # endif + +.end # emit_extra_modifiers + .sub Winxed_class_init :anon :load :init newclass $P0, [ 'Winxed'; 'Compiler'; 'FunctionStatement' ] -.annotate 'line', 8739 get_class $P1, [ 'Winxed'; 'Compiler'; 'FunctionBase' ] addparent $P0, $P1 -.annotate 'line', 8741 addattribute $P0, 'paramnum' -.annotate 'line', 8742 addattribute $P0, 'lexnum' + addattribute $P0, 'is_multi' + addattribute $P0, 'multi_sig' .end .namespace [ 'Winxed'; 'Compiler'; 'LocalFunctionStatement' ] @@ -25685,470 +20655,958 @@ .param pmc __ARG_1 .param pmc __ARG_2 .param pmc __ARG_3 -.const 'Sub' WSubId_4 = "WSubId_4" -# Body -# { -.annotate 'line', 8797 +.const 'Sub' WSubId_25 = "WSubId_25" +.const 'Sub' WSubId_28 = "WSubId_28" self.'FunctionBase'(__ARG_1, __ARG_3) -.annotate 'line', 8798 - $P4 = __ARG_3.'getouter'() - setattribute self, 'outer', $P4 -.annotate 'line', 8799 - getattribute $P3, self, 'outer' - $P3.'makesubid'() -.annotate 'line', 8800 -# var subid: $P1 - $P1 = self.'makesubid'() -.annotate 'line', 8801 - setattribute self, 'name', $P1 -.annotate 'line', 8802 + $P1 = __ARG_3.'getouter'() + isa $I1, $P1, [ 'Winxed'; 'Compiler'; 'InlineStatement' ] + unless $I1 goto __label_1 + $P4 = WSubId_25("local functions not allowed in inline", self) + throw $P4 + __label_1: # endif + $P1.'makesubid'() + setattribute self, 'outer', $P1 + $P2 = self.'makesubid'() + setattribute self, 'name', $P2 self.'parse_parameters'(__ARG_2) -.annotate 'line', 8803 -# var t: $P2 - $P2 = __ARG_2.'get'() -.annotate 'line', 8804 - WSubId_4('{', $P2) -.annotate 'line', 8805 - new $P5, [ 'Winxed'; 'Compiler'; 'CompoundStatement' ] - $P5.'CompoundStatement'($P2, __ARG_2, self) - set $P4, $P5 - setattribute self, 'body', $P4 -.annotate 'line', 8806 + $P3 = __ARG_2.'get'() + WSubId_28('{', $P3) + new $P6, [ 'Winxed'; 'Compiler'; 'CompoundStatement' ] + $P6.'CompoundStatement'($P3, __ARG_2, self) + set $P5, $P6 + setattribute self, 'body', $P5 __ARG_3.'addlocalfunction'(self) -# } -.annotate 'line', 8807 .end # LocalFunctionStatement .sub 'isanonymous' :method -# Body -# { -.annotate 'line', 8808 .return(1) -# } .end # isanonymous .sub 'ismethod' :method -# Body -# { -.annotate 'line', 8809 .return(0) -# } .end # ismethod .sub 'needclosure' :method -# Body -# { -.annotate 'line', 8812 - getattribute $P2, self, 'lexicals' - isnull $I1, $P2 +.const 'Sub' WSubId_5 = "WSubId_5" + getattribute $P4, self, 'lexicals' + isnull $I1, $P4 not $I1 if $I1 goto __label_2 - getattribute $P3, self, 'usedlexicals' - isnull $I1, $P3 + getattribute $P5, self, 'usedlexicals' + isnull $I1, $P5 not $I1 __label_2: unless $I1 goto __label_1 -.annotate 'line', 8813 .return(1) __label_1: # endif -.annotate 'line', 8814 - getattribute $P2, self, 'localfun' - if_null $P2, __label_4 - iter $P4, $P2 - set $P4, 0 - __label_3: # for iteration - unless $P4 goto __label_4 - shift $P1, $P4 -.annotate 'line', 8815 - $P3 = $P1.'needclosure'() - if_null $P3, __label_5 - unless $P3 goto __label_5 -.annotate 'line', 8816 - .return(1) - __label_5: # endif + getattribute $P1, self, 'localfun' + $P2 = WSubId_5("needclosure") + if_null $P1, __label_5 + iter $P7, $P1 + set $P7, 0 + __label_4: # for iteration + unless $P7 goto __label_5 + shift $P3, $P7 + $P4 = $P2($P3) + if_null $P4, __label_6 + unless $P4 goto __label_6 + set $P6, $P3 goto __label_3 - __label_4: # endfor -.annotate 'line', 8817 - .return(0) -# } -.annotate 'line', 8818 + __label_6: # endif + goto __label_4 + __label_5: # endfor + null $P6 + goto __label_3 + __label_3: + set $P4, $P6 + isnull $I1, $P4 + not $I1 + .return($I1) .end # needclosure .sub 'getsubid' :method -# Body -# { -.annotate 'line', 8821 getattribute $P1, self, 'subid' .return($P1) -# } -.annotate 'line', 8822 -.end # getsubid +.end # getsubid + + +.sub 'getparamnum' :method + getattribute $P1, self, 'outer' + .tailcall $P1.'getparamnum'() + +.end # getparamnum + + +.sub 'getlexnum' :method + getattribute $P1, self, 'outer' + .tailcall $P1.'getlexnum'() + +.end # getlexnum + + +.sub 'checkvarlexical' :method + .param pmc __ARG_1 + .param pmc __ARG_2 + $P5 = __ARG_2.'isconst'() + if_null $P5, __label_1 + unless $P5 goto __label_1 + .return(__ARG_2) + __label_1: # endif + $P5 = __ARG_2.'getreg'() + null $S1 + if_null $P5, __label_2 + set $S1, $P5 + __label_2: + substr $S4, $S1, 0, 6 + ne $S4, 'WSubId', __label_3 + self.'usesubid'($S1) + .return(__ARG_2) + __label_3: # endif + $P1 = __ARG_2.'getscope'() + $P2 = $P1.'getouter'() + getattribute $P3, self, 'outer' + isa $I2, $P2, [ 'Winxed'; 'Compiler'; 'FunctionBase' ] + unless $I2 goto __label_4 + $P5 = $P2.'same_scope_as'($P3) + if_null $P5, __label_5 + unless $P5 goto __label_5 + $P6 = $P1.'makelexical'(__ARG_2) + null $S2 + if_null $P6, __label_6 + set $S2, $P6 + __label_6: + $P5 = __ARG_2.'getflags'() + set $I2, $P5 + bor $I1, $I2, 2 + $P5 = __ARG_2.'gettype'() + null $S3 + if_null $P5, __label_7 + set $S3, $P5 + __label_7: + eq $S3, 'P', __label_8 + bor $I1, $I1, 1 + __label_8: # endif + $P5 = __ARG_2.'gettype'() + $P4 = self.'createvar'(__ARG_1, $P5, $I1) + box $P5, $S2 + setattribute $P4, 'lexname', $P5 + $P5 = $P4.'getreg'() + self.'setusedlex'($S2, $P5) + .return($P4) + __label_5: # endif + __label_4: # endif + .return(__ARG_2) + +.end # checkvarlexical + + +.sub 'getvar' :method + .param pmc __ARG_1 +.const 'Sub' WSubId_30 = "WSubId_30" + $P1 = self.'getlocalvar'(__ARG_1) + unless_null $P1, __label_1 + $P1 = self.'getusedvar'(__ARG_1) + __label_1: # endif + unless_null $P1, __label_2 + getattribute $P3, self, 'owner' + $P1 = $P3.'getvar'(__ARG_1) + unless_null $P1, __label_3 + set $S3, __ARG_1 + ne $S3, 'self', __label_5 + getattribute $P2, self, 'outer' + getattribute $P4, self, 'outer' + $P3 = $P4.'ismethod'() + if_null $P3, __label_6 + unless $P3 goto __label_6 + $P5 = $P2.'makelexicalself'() + null $S1 + if_null $P5, __label_7 + set $S1, $P5 + __label_7: + $P1 = self.'createvar'(__ARG_1, 'P') + $P3 = $P1.'getreg'() + null $S2 + if_null $P3, __label_8 + set $S2, $P3 + __label_8: + self.'setusedlex'($S1, $S2) + __label_6: # endif + __label_5: # endif + goto __label_4 + __label_3: # else + $P1 = self.'checkvarlexical'(__ARG_1, $P1) + __label_4: # endif + __label_2: # endif + isnull $I1, $P1 + not $I1 + unless $I1 goto __label_10 + isa $I2, $P1, [ 'Winxed'; 'Compiler'; 'VarData' ] + not $I1, $I2 + __label_10: + unless $I1 goto __label_9 + WSubId_30('Incorrect data for variable in LocalFunction') + __label_9: # endif + .return($P1) + +.end # getvar + +.sub Winxed_class_init :anon :load :init + newclass $P0, [ 'Winxed'; 'Compiler'; 'LocalFunctionStatement' ] + get_class $P1, [ 'Winxed'; 'Compiler'; 'FunctionBase' ] + addparent $P0, $P1 +.end +.namespace [ 'Winxed'; 'Compiler'; 'MethodStatement' ] + +.sub 'MethodStatement' :method + .param pmc __ARG_1 + .param pmc __ARG_2 + .param pmc __ARG_3 + self.'FunctionStatement'(__ARG_1, __ARG_2, __ARG_3) + +.end # MethodStatement + + +.sub 'ismethod' :method + .return(1) + +.end # ismethod + +.sub Winxed_class_init :anon :load :init + newclass $P0, [ 'Winxed'; 'Compiler'; 'MethodStatement' ] + get_class $P1, [ 'Winxed'; 'Compiler'; 'FunctionStatement' ] + addparent $P0, $P1 +.end +.namespace [ 'Winxed'; 'Compiler'; 'InlineParam' ] + +.sub 'InlineParam' :method + .param pmc __ARG_1 + .param pmc __ARG_2 +.const 'Sub' WSubId_127 = "WSubId_127" + null $I1 + $P1 = __ARG_1.'get'() + self.'initbase'($P1, __ARG_2) + $P3 = $P1.'getidentifier'() + set $S2, $P3 + ne $S2, "const", __label_1 + bor $I1, $I1, 1 + $P1 = __ARG_1.'get'() + __label_1: # endif + null $S1 + $P2 = __ARG_1.'get'() + $P3 = $P2.'isop'(",") + if $P3 goto __label_4 + $P3 = $P2.'isop'(")") + __label_4: + if_null $P3, __label_2 + unless $P3 goto __label_2 + set $S1, '?' + __ARG_1.'unget'($P2) + goto __label_3 + __label_2: # else + $P4 = $P1.'getidentifier'() + $P3 = WSubId_127($P4) + set $S1, $P3 + set $P1, $P2 + __label_3: # endif + box $P3, $I1 + setattribute self, 'flags', $P3 + box $P3, $S1 + setattribute self, 'type', $P3 + setattribute self, 'name', $P1 + +.end # InlineParam + + +.sub 'isconst' :method + getattribute $P1, self, 'flags' + set $I2, $P1 + band $I1, $I2, 1 + .return($I1) + +.end # isconst + + +.sub 'getname' :method + getattribute $P1, self, 'name' + .return($P1) + +.end # getname + + +.sub 'gettype' :method + getattribute $P1, self, 'type' + .return($P1) + +.end # gettype + +.sub Winxed_class_init :anon :load :init + newclass $P0, [ 'Winxed'; 'Compiler'; 'InlineParam' ] + get_class $P1, [ 'Winxed'; 'Compiler'; 'CommonBase' ] + addparent $P0, $P1 + addattribute $P0, 'flags' + addattribute $P0, 'type' + addattribute $P0, 'name' +.end +.namespace [ 'Winxed'; 'Compiler'; 'InlineStatement' ] + +.sub 'InlineStatement' :method + .param pmc __ARG_1 + .param pmc __ARG_2 + .param pmc __ARG_3 +.const 'Sub' WSubId_84 = "WSubId_84" +.const 'Sub' WSubId_28 = "WSubId_28" +.const 'Sub' WSubId_127 = "WSubId_127" +.const 'Sub' WSubId_25 = "WSubId_25" +.const 'Sub' WSubId_125 = "WSubId_125" + self.'BlockStatement'(__ARG_1, __ARG_3) + $P1 = __ARG_2.'get'() + WSubId_84("(", __ARG_2) + $P2 = __ARG_2.'get'() + null $P3 + $P6 = $P2.'isop'(")") + isfalse $I1, $P6 + unless $I1 goto __label_1 + __ARG_2.'unget'($P2) + root_new $P6, ['parrot';'ResizablePMCArray'] + set $P3, $P6 + __label_2: # do + new $P6, [ 'Winxed'; 'Compiler'; 'InlineParam' ] + $P6.'InlineParam'(__ARG_2, self) + set $P4, $P6 + $P3.'push'($P4) + __label_4: # continue + $P2 = __ARG_2.'get'() + $P6 = $P2.'isop'(",") + if_null $P6, __label_3 + if $P6 goto __label_2 + __label_3: # enddo + WSubId_28(")", $P2) + __label_1: # endif + $P2 = __ARG_2.'get'() + null $S1 + $P6 = $P2.'iskeyword'('return') + if_null $P6, __label_5 + unless $P6 goto __label_5 + $P2 = __ARG_2.'get'() + $P6 = $P2.'getidentifier'() + null $S2 + if_null $P6, __label_7 + set $S2, $P6 + __label_7: + $P6 = WSubId_127($S2) + set $S1, $P6 + ne $S1, '', __label_8 + WSubId_25("Invalid return type", $P2) + __label_8: # endif + $P2 = __ARG_2.'get'() + goto __label_6 + __label_5: # else + set $S1, 'v' + __label_6: # endif + WSubId_28("{", $P2) + __ARG_2.'unget'($P2) + $P5 = WSubId_125(__ARG_2, self) + setattribute self, 'name', $P1 + box $P6, $S1 + setattribute self, 'rettype', $P6 + setattribute self, 'params', $P3 + setattribute self, 'body', $P5 + +.end # InlineStatement + + +.sub 'getouter' :method + .return(self) + +.end # getouter + + +.sub 'createreg' :method + .param string __ARG_1 + .return("FAKEREG") + +.end # createreg + +.sub Winxed_class_init :anon :load :init + newclass $P0, [ 'Winxed'; 'Compiler'; 'InlineStatement' ] + get_class $P1, [ 'Winxed'; 'Compiler'; 'BlockStatement' ] + addparent $P0, $P1 + get_class $P2, [ 'Winxed'; 'Compiler'; 'VarContainer' ] + addparent $P0, $P2 + addattribute $P0, 'name' + addattribute $P0, 'rettype' + addattribute $P0, 'body' + addattribute $P0, 'params' +.end +.namespace [ 'Winxed'; 'Compiler'; 'InlinedBlock' ] + +.sub 'InlinedBlock' :method + .param pmc __ARG_1 + .param pmc __ARG_2 + .param pmc __ARG_3 +.const 'Sub' WSubId_25 = "WSubId_25" + getattribute $P7, __ARG_2, 'start' + self.'BlockStatement'($P7, __ARG_1) + setattribute self, 'inliner', __ARG_2 + setattribute self, 'inlined', __ARG_1 + getattribute $P1, __ARG_1, 'params' + unless_null $P1, __label_2 + null $I1 + goto __label_1 + __label_2: + elements $I1, $P1 + __label_1: + unless_null __ARG_3, __label_4 + null $I2 + goto __label_3 + __label_4: + $P7 = __ARG_3.'numargs'() + set $I2, $P7 + __label_3: + eq $I1, $I2, __label_5 + WSubId_25("Wrong arguments in inline expansion", __ARG_2) + __label_5: # endif + null $I3 + __label_8: # for condition + ge $I3, $I1, __label_7 + $P2 = $P1[$I3] + $P3 = $P2.'getname'() + $P4 = __ARG_3.'getfreearg'($I3) + $P7 = $P2.'gettype'() + null $S1 + if_null $P7, __label_9 + set $S1, $P7 + __label_9: + ne $S1, '?', __label_10 + $P7 = $P4.'checkresult'() + set $S1, $P7 + __label_10: # endif + $P7 = $P2.'isconst'() + set $I4, $P7 + box $P7, $I4 + unless $P7 goto __label_13 + $P7 = $P4.'hascompilevalue'() + __label_13: + if_null $P7, __label_11 + unless $P7 goto __label_11 + $P5 = self.'createconst'($P3, $S1) + $P5.'setvalue'($P4) + goto __label_12 + __label_11: # else + self.'createvar'($P3, $S1, 0) + __label_12: # endif + __label_6: # for iteration + inc $I3 + goto __label_8 + __label_7: # for end + setattribute self, 'params', $P1 + setattribute self, 'args', __ARG_3 + getattribute $P6, __ARG_1, 'body' + $P6 = $P6.'clone'(self) + $P6 = $P6.'optimize'() + setattribute self, 'body', $P6 + +.end # InlinedBlock + + +.sub 'getouter' :method + .return(self) + +.end # getouter + + +.sub 'createreg' :method + .param string __ARG_1 + getattribute $P2, self, 'inliner' + getattribute $P1, $P2, 'owner' + .tailcall $P1.'createreg'(__ARG_1) + +.end # createreg + + +.sub 'tempreg' :method + .param string __ARG_1 + getattribute $P1, self, 'inliner' + .tailcall $P1.'tempreg'(__ARG_1) + +.end # tempreg + + +.sub 'freetemps' :method + getattribute $P2, self, 'inliner' + getattribute $P1, $P2, 'owner' + $P1.'freetemps'() + +.end # freetemps + + +.sub 'usesubid' :method + .param string __ARG_1 + getattribute $P1, self, 'usedsubids' + unless_null $P1, __label_1 + root_new $P1, ['parrot';'Hash'] + setattribute self, 'usedsubids', $P1 + __label_1: # endif + $P1[__ARG_1] = 1 + +.end # usesubid + + +.sub 'genlabel' :method + getattribute $P1, self, 'inliner' + .tailcall $P1.'genlabel'() + +.end # genlabel + + +.sub 'getendlabel' :method + getattribute $P1, self, 'endlabel' + .return($P1) + +.end # getendlabel + + +.sub 'getrettype' :method + getattribute $P2, self, 'inlined' + getattribute $P1, $P2, 'rettype' + .return($P1) + +.end # getrettype + + +.sub 'checkresult' :method + getattribute $P2, self, 'inlined' + getattribute $P1, $P2, 'rettype' + .return($P1) + +.end # checkresult + + +.sub 'getretreg' :method + getattribute $P1, self, 'retreg' + .return($P1) + +.end # getretreg + + +.sub 'emit_it' :method + .param pmc __ARG_1 +.const 'Sub' WSubId_139 = "WSubId_139" + $P9 = __ARG_1.'getDebug'() + if_null $P9, __label_1 + unless $P9 goto __label_1 + __ARG_1.'comment'("inlined start") + __label_1: # endif + $P10 = self.'genlabel'() + setattribute self, 'endlabel', $P10 + getattribute $P1, self, 'params' + getattribute $P2, self, 'args' + unless_null $P1, __label_3 + null $I1 + goto __label_2 + __label_3: + elements $I1, $P1 + __label_2: + null $I2 + __label_6: # for condition + ge $I2, $I1, __label_5 + $P3 = $P1[$I2] + $P4 = $P2.'getfreearg'($I2) + $P9 = $P3.'isconst'() + unless $P9 goto __label_8 + $P9 = $P4.'hascompilevalue'() + __label_8: + if_null $P9, __label_7 + unless $P9 goto __label_7 + goto __label_4 # continue + __label_7: # endif + $P9 = $P3.'gettype'() + null $S1 + if_null $P9, __label_9 + set $S1, $P9 + __label_9: + $P9 = $P4.'checkresult'() + null $S2 + if_null $P9, __label_10 + set $S2, $P9 + __label_10: + $P11 = $P3.'getname'() + $P10 = self.'getvar'($P11) + $P9 = $P10.'getreg'() + null $S3 + if_null $P9, __label_11 + set $S3, $P9 + __label_11: + iseq $I3, $S1, '?' + if $I3 goto __label_14 + iseq $I3, $S2, $S1 + __label_14: + unless $I3 goto __label_12 + $P4.'emit_init'(__ARG_1, $S3) + goto __label_13 + __label_12: # else + $P9 = $P4.'emit_get'(__ARG_1) + null $S4 + if_null $P9, __label_15 + set $S4, $P9 + __label_15: + ne $S1, 'P', __label_16 + __ARG_1.'emitbox'($S3, $S4) + goto __label_17 + __label_16: # else + __ARG_1.'emitset'($S3, $S4) + __label_17: # endif + __label_13: # endif + __label_4: # for iteration + inc $I2 + goto __label_6 + __label_5: # for end + getattribute $P5, self, 'usedsubids' + root_new $P6, ['parrot';'ResizablePMCArray'] + set $P7, WSubId_139 + if_null $P5, __label_20 + iter $P13, $P5 + set $P13, 0 + __label_19: # for iteration + unless $P13 goto __label_20 + shift $P8, $P13 + $P9 = $P7($P8) + push $P6, $P9 + goto __label_19 + __label_20: # endfor + set $P12, $P6 + goto __label_18 + __label_18: + set $P9, $P12 + join $S5, "", $P9 + __ARG_1.'print'($S5) + getattribute $P9, self, 'body' + $P9.'emit'(__ARG_1) + getattribute $P9, self, 'endlabel' + __ARG_1.'emitlabel'($P9) + +.end # emit_it + + +.sub 'emit' :method + .param pmc __ARG_1 + .param string __ARG_2 + $P1 = self.'getrettype'() + null $S1 + if_null $P1, __label_1 + set $S1, $P1 + __label_1: + box $P1, __ARG_2 + setattribute self, 'retreg', $P1 + $P1 = __ARG_1.'getDebug'() + set $I1, $P1 + self.'emit_it'(__ARG_1) + $P1 = __ARG_1.'getDebug'() + if_null $P1, __label_2 + unless $P1 goto __label_2 + __ARG_1.'comment'("inlined end") + __label_2: # endif + +.end # emit + + +.sub 'emit_void' :method + .param pmc __ARG_1 + self.'emit_it'(__ARG_1) + $P1 = __ARG_1.'getDebug'() + if_null $P1, __label_1 + unless $P1 goto __label_1 + __ARG_1.'comment'("inlined end") + __label_1: # endif + +.end # emit_void + + +.sub 'emit_get' :method + .param pmc __ARG_1 +.const 'Sub' WSubId_25 = "WSubId_25" + $P2 = self.'checkresult'() + null $S1 + if_null $P2, __label_1 + set $S1, $P2 + __label_1: + ne $S1, 'v', __label_2 + WSubId_25("Cannot get a result from a void inline", self) + __label_2: # endif + $P2 = self.'createreg'($S1) + null $S2 + if_null $P2, __label_3 + set $S2, $P2 + __label_3: + box $P2, $S2 + setattribute self, 'retreg', $P2 + self.'emit_it'(__ARG_1) + ne $S1, 'P', __label_4 + $P1 = self.'tempreg'('P') + __ARG_1.'emitset'($P1, $S2) + set $S2, $P1 + __label_4: # endif + $P2 = __ARG_1.'getDebug'() + if_null $P2, __label_5 + unless $P2 goto __label_5 + __ARG_1.'comment'("inlined end") + __label_5: # endif + .return($S2) + +.end # emit_get + +.sub Winxed_class_init :anon :load :init + newclass $P0, [ 'Winxed'; 'Compiler'; 'InlinedBlock' ] + get_class $P1, [ 'Winxed'; 'Compiler'; 'BlockStatement' ] + addparent $P0, $P1 + addattribute $P0, 'inliner' + addattribute $P0, 'inlined' + addattribute $P0, 'usedsubids' + addattribute $P0, 'params' + addattribute $P0, 'args' + addattribute $P0, 'body' + addattribute $P0, 'endlabel' + addattribute $P0, 'retreg' +.end +.namespace [ 'Winxed'; 'Compiler'; 'InlineRef' ] + +.sub 'InlineRef' :method + .param pmc __ARG_1 + .param pmc __ARG_2 + .param pmc __ARG_3 + self.'Expr'(__ARG_2, __ARG_1) + setattribute self, 'inlined', __ARG_3 + +.end # InlineRef + + +.sub 'checkresult' :method + .return('v') +.end # checkresult -.sub 'getparamnum' :method -# Body -# { -.annotate 'line', 8826 - getattribute $P1, self, 'outer' - .tailcall $P1.'getparamnum'() -# } -.annotate 'line', 8827 -.end # getparamnum +.sub 'misused' :method +.const 'Sub' WSubId_25 = "WSubId_25" + getattribute $P1, self, 'start' + WSubId_25("inline used by reference", $P1) +.end # misused -.sub 'getlexnum' :method -# Body -# { -.annotate 'line', 8831 - getattribute $P1, self, 'outer' - .tailcall $P1.'getlexnum'() -# } -.annotate 'line', 8832 -.end # getlexnum +.sub 'emit_void' :method + .param pmc __ARG_1 + self.'misused'() +.end # emit_void -.sub 'checkvarlexical' :method + +.sub 'emit_get' :method .param pmc __ARG_1 - .param pmc __ARG_2 -# Body -# { -.annotate 'line', 8835 - $P5 = __ARG_2.'isconst'() - if_null $P5, __label_1 - unless $P5 goto __label_1 -.annotate 'line', 8836 - .return(__ARG_2) - __label_1: # endif -.annotate 'line', 8837 -# reg: $S1 - $P5 = __ARG_2.'getreg'() - null $S1 - if_null $P5, __label_2 - set $S1, $P5 - __label_2: -.annotate 'line', 8839 -# predefined substr - substr $S4, $S1, 0, 6 - ne $S4, 'WSubId', __label_3 -.annotate 'line', 8840 - .return(__ARG_2) - __label_3: # endif -.annotate 'line', 8841 -# var scope: $P1 - $P1 = __ARG_2.'getscope'() -.annotate 'line', 8842 -# var ownerscope: $P2 - $P2 = $P1.'getouter'() -.annotate 'line', 8843 -# var outer: $P3 - getattribute $P3, self, 'outer' -.annotate 'line', 8844 - isa $I2, $P2, [ 'Winxed'; 'Compiler'; 'FunctionBase' ] - unless $I2 goto __label_4 -# { -.annotate 'line', 8845 - $P5 = $P2.'same_scope_as'($P3) - if_null $P5, __label_5 - unless $P5 goto __label_5 -# { -.annotate 'line', 8846 -# lexname: $S2 - $P6 = $P1.'makelexical'(__ARG_2) - null $S2 - if_null $P6, __label_6 - set $S2, $P6 - __label_6: -.annotate 'line', 8847 -# flags: $I1 - $I2 = __ARG_2.'getflags'() - bor $I1, $I2, 2 -.annotate 'line', 8848 -# type: $S3 - $P5 = __ARG_2.'gettype'() - null $S3 - if_null $P5, __label_7 - set $S3, $P5 - __label_7: -.annotate 'line', 8849 - eq $S3, 'P', __label_8 -.annotate 'line', 8850 - bor $I1, $I1, 1 - __label_8: # endif -.annotate 'line', 8851 -# var lexused: $P4 - $P5 = __ARG_2.'gettype'() - $P4 = self.'createvar'(__ARG_1, $P5, $I1) -.annotate 'line', 8852 - box $P5, $S2 - setattribute $P4, 'lexname', $P5 -.annotate 'line', 8853 - $P5 = $P4.'getreg'() - self.'setusedlex'($S2, $P5) -.annotate 'line', 8854 - .return($P4) -# } - __label_5: # endif -# } - __label_4: # endif -.annotate 'line', 8857 - .return(__ARG_2) -# } -.annotate 'line', 8858 + self.'misused'() -.end # checkvarlexical +.end # emit_get -.sub 'getvar' :method +.sub 'emit' :method .param pmc __ARG_1 -.const 'Sub' WSubId_6 = "WSubId_6" -# Body -# { -.annotate 'line', 8861 -# var r: $P1 - $P1 = self.'getlocalvar'(__ARG_1) -.annotate 'line', 8862 - unless_null $P1, __label_1 -.annotate 'line', 8863 - $P1 = self.'getusedvar'(__ARG_1) - __label_1: # endif -.annotate 'line', 8864 - unless_null $P1, __label_2 -# { -.annotate 'line', 8867 - getattribute $P3, self, 'owner' - $P1 = $P3.'getvar'(__ARG_1) -.annotate 'line', 8868 - unless_null $P1, __label_3 -# { -.annotate 'line', 8870 - set $S3, __ARG_1 - ne $S3, 'self', __label_5 -# { -.annotate 'line', 8871 -# var ownerscope: $P2 - getattribute $P2, self, 'outer' -.annotate 'line', 8872 - getattribute $P4, self, 'outer' - $P3 = $P4.'ismethod'() - if_null $P3, __label_6 - unless $P3 goto __label_6 -# { -.annotate 'line', 8873 -# lexself: $S1 - $P5 = $P2.'makelexicalself'() - null $S1 - if_null $P5, __label_7 - set $S1, $P5 - __label_7: -.annotate 'line', 8874 - $P1 = self.'createvar'(__ARG_1, 'P') -.annotate 'line', 8875 -# reg: $S2 - $P3 = $P1.'getreg'() - null $S2 - if_null $P3, __label_8 - set $S2, $P3 - __label_8: -.annotate 'line', 8876 - self.'setusedlex'($S1, $S2) -# } - __label_6: # endif -# } - __label_5: # endif -# } - goto __label_4 - __label_3: # else -.annotate 'line', 8880 - $P1 = self.'checkvarlexical'(__ARG_1, $P1) - __label_4: # endif -# } - __label_2: # endif -.annotate 'line', 8882 - isnull $I1, $P1 - not $I1 - unless $I1 goto __label_10 - isa $I2, $P1, [ 'Winxed'; 'Compiler'; 'VarData' ] - not $I1, $I2 - __label_10: - unless $I1 goto __label_9 -.annotate 'line', 8883 - WSubId_6('Incorrect data for variable in LocalFunction') - __label_9: # endif -.annotate 'line', 8884 - .return($P1) -# } -.annotate 'line', 8885 + .param string __ARG_2 + self.'misused'() -.end # getvar +.end # emit .sub Winxed_class_init :anon :load :init - newclass $P0, [ 'Winxed'; 'Compiler'; 'LocalFunctionStatement' ] -.annotate 'line', 8793 - get_class $P1, [ 'Winxed'; 'Compiler'; 'FunctionBase' ] + newclass $P0, [ 'Winxed'; 'Compiler'; 'InlineRef' ] + get_class $P1, [ 'Winxed'; 'Compiler'; 'FinalExpr' ] addparent $P0, $P1 + addattribute $P0, 'inlined' .end -.namespace [ 'Winxed'; 'Compiler'; 'MethodStatement' ] +.namespace [ 'Winxed'; 'Compiler'; 'CallInlineExpr' ] -.sub 'MethodStatement' :method +.sub 'CallInlineExpr' :method .param pmc __ARG_1 .param pmc __ARG_2 .param pmc __ARG_3 -# Body -# { -.annotate 'line', 8896 - self.'FunctionStatement'(__ARG_1, __ARG_2, __ARG_3) -# } -.annotate 'line', 8897 + getattribute $P1, __ARG_2, 'start' + self.'Expr'($P1, __ARG_1) + new $P3, [ 'Winxed'; 'Compiler'; 'InlinedBlock' ] + getattribute $P4, __ARG_2, 'inlined' + $P3.'InlinedBlock'($P4, __ARG_1, __ARG_3) + set $P2, $P3 + setattribute self, 'block', $P2 -.end # MethodStatement +.end # CallInlineExpr -.sub 'ismethod' :method -# Body -# { -.annotate 'line', 8898 - .return(1) -# } +.sub 'checkresult' :method + getattribute $P1, self, 'block' + .tailcall $P1.'checkresult'() -.end # ismethod +.end # checkresult + + +.sub 'emit_void' :method + .param pmc __ARG_1 + getattribute $P1, self, 'block' + $P1.'emit_void'(__ARG_1) + +.end # emit_void + + +.sub 'emit_get' :method + .param pmc __ARG_1 + getattribute $P1, self, 'block' + .tailcall $P1.'emit_get'(__ARG_1) + +.end # emit_get + + +.sub 'emit' :method + .param pmc __ARG_1 + .param string __ARG_2 + getattribute $P1, self, 'block' + $P1.'emit'(__ARG_1, __ARG_2) + +.end # emit .sub Winxed_class_init :anon :load :init - newclass $P0, [ 'Winxed'; 'Compiler'; 'MethodStatement' ] -.annotate 'line', 8892 - get_class $P1, [ 'Winxed'; 'Compiler'; 'FunctionStatement' ] + newclass $P0, [ 'Winxed'; 'Compiler'; 'CallInlineExpr' ] + get_class $P1, [ 'Winxed'; 'Compiler'; 'FinalExpr' ] addparent $P0, $P1 + addattribute $P0, 'block' .end .namespace [ 'Winxed'; 'Compiler'; 'SigParameter' ] .sub 'SigParameter' :method .param pmc __ARG_1 .param pmc __ARG_2 -.const 'Sub' WSubId_3 = "WSubId_3" -.const 'Sub' WSubId_96 = "WSubId_96" -# Body -# { -.annotate 'line', 8912 -# var name: $P1 +.const 'Sub' WSubId_27 = "WSubId_27" +.const 'Sub' WSubId_127 = "WSubId_127" + setattribute self, 'owner', __ARG_2 $P1 = __ARG_1.'get'() -.annotate 'line', 8913 $P4 = $P1.'isidentifier'() isfalse $I1, $P4 unless $I1 goto __label_1 -.annotate 'line', 8914 - WSubId_3($P1) + WSubId_27($P1) __label_1: # endif -.annotate 'line', 8915 -# var t: $P2 $P2 = __ARG_1.'get'() -.annotate 'line', 8916 $P4 = $P2.'isidentifier'() if_null $P4, __label_2 unless $P4 goto __label_2 -# { -.annotate 'line', 8917 -# type: $S1 $P6 = $P1.'checkkeyword'() - $P5 = WSubId_96($P6) + $P5 = WSubId_127($P6) null $S1 if_null $P5, __label_3 set $S1, $P5 __label_3: -.annotate 'line', 8918 set $P1, $P2 -.annotate 'line', 8919 __ARG_2.'createvar'($P1, $S1) -.annotate 'line', 8920 $P2 = __ARG_1.'get'() -# } __label_2: # endif -.annotate 'line', 8922 setattribute self, 'name', $P1 -.annotate 'line', 8923 -# var data: $P3 $P4 = $P1.'getidentifier'() $P3 = __ARG_2.'getvar'($P4) -.annotate 'line', 8924 $P5 = $P3.'getreg'() setattribute self, 'reg', $P5 -.annotate 'line', 8925 $P4 = $P2.'isop'('[') if_null $P4, __label_4 unless $P4 goto __label_4 -.annotate 'line', 8926 new $P7, [ 'Winxed'; 'Compiler'; 'ParameterModifierList' ] $P7.'ParameterModifierList'(__ARG_1, self) set $P6, $P7 setattribute self, 'modifiers', $P6 - goto __label_5 - __label_4: # else -.annotate 'line', 8928 + $P2 = __ARG_1.'get'() + __label_4: # endif + $P4 = $P2.'isop'('=') + if_null $P4, __label_5 + unless $P4 goto __label_5 + new $P7, [ 'Winxed'; 'Compiler'; 'FunctionParameterDefault' ] + $P7.'FunctionParameterDefault'(__ARG_1, __ARG_2, self) + set $P6, $P7 + setattribute self, 'defaultexpr', $P6 + goto __label_6 + __label_5: # else __ARG_1.'unget'($P2) - __label_5: # endif -# } -.annotate 'line', 8929 + __label_6: # endif .end # SigParameter +.sub 'getvar' :method + getattribute $P1, self, 'owner' + getattribute $P3, self, 'name' + $P2 = $P3.'getidentifier'() + .tailcall $P1.'getvar'($P2) + +.end # getvar + + +.sub 'optimize' :method + getattribute $P1, self, 'defaultexpr' + if_null $P1, __label_1 + $P1.'optimize'() + getattribute $P3, self, 'owner' + $P2 = $P3.'createreg'('I') + $P1.'setoptflag'($P2) + __label_1: # endif + .return(self) + +.end # optimize + + .sub 'emit' :method .param pmc __ARG_1 -# Body -# { -.annotate 'line', 8932 - getattribute $P3, self, 'reg' - __ARG_1.'print'($P3) -.annotate 'line', 8933 -# var modifiers: $P1 + getattribute $P4, self, 'reg' + __ARG_1.'print'($P4) getattribute $P1, self, 'modifiers' -.annotate 'line', 8934 if_null $P1, __label_1 -# { -.annotate 'line', 8935 -# var name: $P2 getattribute $P2, self, 'name' -.annotate 'line', 8936 $P1.'emitmodifiers'(__ARG_1, $P2, $P2) -# } __label_1: # endif -# } -.annotate 'line', 8938 + getattribute $P3, self, 'defaultexpr' + if_null $P3, __label_2 + $P4 = $P3.'getoptflag'() + __ARG_1.'print'(" :optional, ", $P4, " :opt_flag") + __label_2: # endif .end # emit + +.sub 'emitdefault' :method + .param pmc __ARG_1 + getattribute $P1, self, 'defaultexpr' + if_null $P1, __label_1 + $P1.'emit'(__ARG_1) + __label_1: # endif + +.end # emitdefault + .sub Winxed_class_init :anon :load :init newclass $P0, [ 'Winxed'; 'Compiler'; 'SigParameter' ] -.annotate 'line', 8907 + addattribute $P0, 'owner' addattribute $P0, 'name' -.annotate 'line', 8908 addattribute $P0, 'modifiers' -.annotate 'line', 8909 addattribute $P0, 'reg' + addattribute $P0, 'defaultexpr' .end .namespace [ 'Winxed'; 'Compiler' ] -.sub 'parseSigParameter' :subid('WSubId_108') +.sub 'parseSigParameter' :subid('WSubId_141') .param pmc __ARG_1 .param pmc __ARG_2 -# Body -# { -.annotate 'line', 8943 new $P2, [ 'Winxed'; 'Compiler'; 'SigParameter' ] $P2.'SigParameter'(__ARG_1, __ARG_2) set $P1, $P2 .return($P1) -# } -.annotate 'line', 8944 .end # parseSigParameter @@ -26157,29 +21615,41 @@ .sub 'SigParameterList' :method .param pmc __ARG_1 .param pmc __ARG_2 -.const 'Sub' WSubId_35 = "WSubId_35" -.const 'Sub' WSubId_108 = "WSubId_108" -# Body -# { -.annotate 'line', 8951 - $P2 = WSubId_35(__ARG_1, __ARG_2, WSubId_108, ')') +.const 'Sub' WSubId_67 = "WSubId_67" +.const 'Sub' WSubId_141 = "WSubId_141" + $P2 = WSubId_67(__ARG_1, __ARG_2, WSubId_141, ')') setattribute self, 'params', $P2 -# } -.annotate 'line', 8952 .end # SigParameterList +.sub 'optimize' :method + getattribute $P1, self, 'params' + if_null $P1, __label_3 + elements $I1, $P1 + goto __label_2 + __label_3: + null $I1 + __label_2: + null $I2 + __label_6: # for condition + ge $I2, $I1, __label_5 + $P3 = $P1[$I2] + $P2 = $P3.'optimize'() + $P1[$I2] = $P2 + __label_4: # for iteration + inc $I2 + goto __label_6 + __label_5: # for end + __label_1: + +.end # optimize + + .sub 'emit' :method .param pmc __ARG_1 -# Body -# { -.annotate 'line', 8955 __ARG_1.'print'('(') -.annotate 'line', 8956 -# sep: $S1 set $S1, '' -.annotate 'line', 8957 getattribute $P2, self, 'params' if_null $P2, __label_2 iter $P3, $P2 @@ -26187,26 +21657,33 @@ __label_1: # for iteration unless $P3 goto __label_2 shift $P1, $P3 -# { -.annotate 'line', 8958 __ARG_1.'print'($S1) -.annotate 'line', 8959 $P1.'emit'(__ARG_1) -.annotate 'line', 8960 set $S1, ', ' -# } goto __label_1 __label_2: # endfor -.annotate 'line', 8962 __ARG_1.'print'(')') -# } -.annotate 'line', 8963 .end # emit + +.sub 'emitdefaults' :method + .param pmc __ARG_1 + getattribute $P2, self, 'params' + if_null $P2, __label_2 + iter $P3, $P2 + set $P3, 0 + __label_1: # for iteration + unless $P3 goto __label_2 + shift $P1, $P3 + $P1.'emitdefault'(__ARG_1) + goto __label_1 + __label_2: # endfor + +.end # emitdefaults + .sub Winxed_class_init :anon :load :init newclass $P0, [ 'Winxed'; 'Compiler'; 'SigParameterList' ] -.annotate 'line', 8948 addattribute $P0, 'params' .end .namespace [ 'Winxed'; 'Compiler'; 'MultiAssignStatement' ] @@ -26216,126 +21693,78 @@ .param pmc __ARG_2 .param pmc __ARG_3 .param pmc __ARG_4 -# Body -# { -.annotate 'line', 8972 self.'Statement'(__ARG_1, __ARG_2) -.annotate 'line', 8973 setattribute self, 'params', __ARG_3 -.annotate 'line', 8974 setattribute self, 'expr', __ARG_4 -# } -.annotate 'line', 8975 .end # MultiAssignStatement .sub 'optimize' :method -# Body -# { -.annotate 'line', 8978 getattribute $P3, self, 'expr' $P2 = $P3.'optimize'() setattribute self, 'expr', $P2 -.annotate 'line', 8979 + getattribute $P1, self, 'params' + $P1.'optimize'() .return(self) -# } -.annotate 'line', 8980 .end # optimize .sub 'emit' :method .param pmc __ARG_1 -.const 'Sub' WSubId_1 = "WSubId_1" -# Body -# { -.annotate 'line', 8983 -# var expr: $P1 +.const 'Sub' WSubId_25 = "WSubId_25" getattribute $P1, self, 'expr' -.annotate 'line', 8984 isa $I2, $P1, [ 'Winxed'; 'Compiler'; 'CallExpr' ] not $I1, $I2 unless $I1 goto __label_1 -.annotate 'line', 8985 - WSubId_1('multi assignment used with non function call', $P1) + WSubId_25('multi assignment used with non function call', $P1) __label_1: # endif -.annotate 'line', 8986 -# var call: $P2 $P2 = $P1.'emitcall'(__ARG_1) -.annotate 'line', 8987 $P1.'prepareargs'(__ARG_1) -.annotate 'line', 8988 - __ARG_1.'print'(' ') -.annotate 'line', 8989 getattribute $P3, self, 'params' + __ARG_1.'print'(' ') $P3.'emit'(__ARG_1) -.annotate 'line', 8990 __ARG_1.'print'(' = ', $P2) -.annotate 'line', 8991 $P1.'emitargs'(__ARG_1) -.annotate 'line', 8992 __ARG_1.'say'() -# } -.annotate 'line', 8993 + $P3.'emitdefaults'(__ARG_1) .end # emit .sub Winxed_class_init :anon :load :init newclass $P0, [ 'Winxed'; 'Compiler'; 'MultiAssignStatement' ] -.annotate 'line', 8966 get_class $P1, [ 'Winxed'; 'Compiler'; 'Statement' ] addparent $P0, $P1 -.annotate 'line', 8968 addattribute $P0, 'params' -.annotate 'line', 8969 addattribute $P0, 'expr' .end .namespace [ 'Winxed'; 'Compiler' ] -# Constant CLASSSPECIFIER_invalid evaluated at compile time -# Constant CLASSSPECIFIER_str evaluated at compile time -# Constant CLASSSPECIFIER_parrotkey evaluated at compile time -# Constant CLASSSPECIFIER_id evaluated at compile time .namespace [ 'Winxed'; 'Compiler'; 'ClassSpecifier' ] .sub 'ClassSpecifier' :method .param pmc __ARG_1 .param pmc __ARG_2 -# Body -# { -.annotate 'line', 9010 self.'initbase'(__ARG_2, __ARG_1) -# } -.annotate 'line', 9011 .end # ClassSpecifier .sub 'reftype' :method -# Body -# { -.annotate 'line', 9012 .return(0) -# } .end # reftype .sub 'annotate' :method .param pmc __ARG_1 -# Body -# { -.annotate 'line', 9016 getattribute $P1, self, 'start' __ARG_1.'annotate'($P1) -# } -.annotate 'line', 9017 .end # annotate .sub Winxed_class_init :anon :load :init newclass $P0, [ 'Winxed'; 'Compiler'; 'ClassSpecifier' ] -.annotate 'line', 9006 get_class $P1, [ 'Winxed'; 'Compiler'; 'CommonBase' ] addparent $P0, $P1 .end @@ -26344,24 +21773,14 @@ .sub 'ClassSpecifierStr' :method .param pmc __ARG_1 .param pmc __ARG_2 -# Body -# { -.annotate 'line', 9025 self.'ClassSpecifier'(__ARG_1, __ARG_2) -.annotate 'line', 9026 setattribute self, 'name', __ARG_2 -# } -.annotate 'line', 9027 .end # ClassSpecifierStr .sub 'reftype' :method -# Body -# { -.annotate 'line', 9028 .return(1) -# } .end # reftype @@ -26369,28 +21788,19 @@ .sub 'emit' :method .param pmc __ARG_1 .param pmc __ARG_2 -# Body -# { -.annotate 'line', 9032 -# basestr: $S1 getattribute $P1, self, 'name' null $S1 if_null $P1, __label_1 set $S1, $P1 __label_1: -.annotate 'line', 9033 __ARG_1.'print'($S1) -# } -.annotate 'line', 9034 .end # emit .sub Winxed_class_init :anon :load :init newclass $P0, [ 'Winxed'; 'Compiler'; 'ClassSpecifierStr' ] -.annotate 'line', 9020 get_class $P1, [ 'Winxed'; 'Compiler'; 'ClassSpecifier' ] addparent $P0, $P1 -.annotate 'line', 9022 addattribute $P0, 'name' .end .namespace [ 'Winxed'; 'Compiler'; 'ClassSpecifierParrotKey' ] @@ -26399,140 +21809,116 @@ .param pmc __ARG_1 .param pmc __ARG_2 .param pmc __ARG_3 -.const 'Sub' WSubId_39 = "WSubId_39" -.const 'Sub' WSubId_40 = "WSubId_40" -.const 'Sub' WSubId_4 = "WSubId_4" -# Body -# { -.annotate 'line', 9043 +.const 'Sub' WSubId_70 = "WSubId_70" +.const 'Sub' WSubId_71 = "WSubId_71" +.const 'Sub' WSubId_28 = "WSubId_28" self.'ClassSpecifier'(__ARG_2, __ARG_3) -.annotate 'line', 9044 -# var key: $P1 root_new $P1, ['parrot';'ResizablePMCArray'] -.annotate 'line', 9045 -# var t: $P2 $P2 = __ARG_1.'get'() -.annotate 'line', 9046 $P3 = $P2.'isstring'() isfalse $I1, $P3 unless $I1 goto __label_1 -.annotate 'line', 9047 - WSubId_39('literal string', $P2) + WSubId_70('literal string', $P2) __label_1: # endif -.annotate 'line', 9048 $P3 = $P2.'rawstring'() -# predefined push push $P1, $P3 -.annotate 'line', 9049 $P2 = __ARG_1.'get'() -.annotate 'line', 9050 $P3 = $P2.'isop'(']') isfalse $I1, $P3 unless $I1 goto __label_2 -# { -# switch -.annotate 'line', 9051 $P4 = $P2.'checkop'() set $S1, $P4 - set $S2, ':' - if $S1 == $S2 goto __label_5 - set $S2, ',' - if $S1 == $S2 goto __label_6 - goto __label_4 + if_null $S1, __label_3 + length $I2, $S1 + ne $I2, 1, __label_3 + ord $I2, $S1 + if $I2 == 58 goto __label_5 + if $I2 == 44 goto __label_6 + goto __label_3 __label_5: # case -.annotate 'line', 9053 box $P5, 1 setattribute self, 'hll', $P5 __label_6: # case - goto __label_3 # break - __label_4: # default -.annotate 'line', 9057 - WSubId_40('token in class key', $P2) - __label_3: # switch end + goto __label_4 # break + __label_3: # default + WSubId_71('token in class key', $P2) + __label_4: # switch end __label_7: # do -.annotate 'line', 9059 -# { -.annotate 'line', 9060 $P2 = __ARG_1.'get'() -.annotate 'line', 9061 $P3 = $P2.'isstring'() isfalse $I1, $P3 unless $I1 goto __label_10 -.annotate 'line', 9062 - WSubId_39('literal string', $P2) + WSubId_70('literal string', $P2) __label_10: # endif -.annotate 'line', 9063 $P3 = $P2.'rawstring'() -# predefined push push $P1, $P3 -# } __label_9: # continue -.annotate 'line', 9064 $P2 = __ARG_1.'get'() $P3 = $P2.'isop'(',') if_null $P3, __label_8 if $P3 goto __label_7 __label_8: # enddo -.annotate 'line', 9065 - WSubId_4(']', $P2) -# } + WSubId_28(']', $P2) __label_2: # endif -.annotate 'line', 9067 setattribute self, 'key', $P1 -# } -.annotate 'line', 9068 .end # ClassSpecifierParrotKey .sub 'reftype' :method -# Body -# { -.annotate 'line', 9069 .return(2) -# } .end # reftype .sub 'hasHLL' :method -# Body -# { -# predefined int -.annotate 'line', 9072 getattribute $P1, self, 'hll' isnull $I1, $P1 not $I1 .return($I1) -# } -.annotate 'line', 9073 -.end # hasHLL +.end # hasHLL + + +.sub 'checknskey' :method + .param pmc __ARG_1 + getattribute $P2, self, 'key' + $P1 = __ARG_1.'scopesearch'($P2, 2) + if_null $P1, __label_2 + $P2 = $P1.'getpath'() + goto __label_1 + __label_2: + null $P2 + __label_1: + .return($P2) + +.end # checknskey .sub 'emit' :method .param pmc __ARG_1 .param pmc __ARG_2 -.const 'Sub' WSubId_57 = "WSubId_57" -# Body -# { -.annotate 'line', 9077 - getattribute $P2, self, 'key' - $P1 = WSubId_57($P2) - __ARG_1.'print'($P1) -# } -.annotate 'line', 9078 + getattribute $P1, self, 'key' + null $S1 + elements $I1, $P1 + unless $I1 goto __label_2 + join $S3, "'; '", $P1 + concat $S4, "[ '", $S3 + concat $S4, $S4, "' ]" + set $S1, $S4 + __label_2: # endif + set $S2, $S1 + goto __label_1 + __label_1: + __ARG_1.'print'($S2) .end # emit .sub Winxed_class_init :anon :load :init newclass $P0, [ 'Winxed'; 'Compiler'; 'ClassSpecifierParrotKey' ] -.annotate 'line', 9037 get_class $P1, [ 'Winxed'; 'Compiler'; 'ClassSpecifier' ] addparent $P0, $P1 -.annotate 'line', 9039 addattribute $P0, 'key' -.annotate 'line', 9040 addattribute $P0, 'hll' .end .namespace [ 'Winxed'; 'Compiler'; 'ClassSpecifierId' ] @@ -26541,221 +21927,221 @@ .param pmc __ARG_1 .param pmc __ARG_2 .param pmc __ARG_3 -# Body -# { -.annotate 'line', 9086 self.'ClassSpecifier'(__ARG_2, __ARG_3) -.annotate 'line', 9087 -# var key: $P1 root_new $P1, ['parrot';'ResizablePMCArray'] -# predefined string + assign $P1, 1 set $S1, __ARG_3 - box $P3, $S1 - push $P1, $P3 -.annotate 'line', 9088 -# var t: $P2 + $P1[0] = $S1 null $P2 __label_2: # while -.annotate 'line', 9089 $P2 = __ARG_1.'get'() $P3 = $P2.'isop'('.') if_null $P3, __label_1 unless $P3 goto __label_1 -# { -.annotate 'line', 9090 $P2 = __ARG_1.'get'() -.annotate 'line', 9091 -# predefined string set $S1, $P2 -# predefined push push $P1, $S1 -# } goto __label_2 __label_1: # endwhile -.annotate 'line', 9093 __ARG_1.'unget'($P2) -.annotate 'line', 9094 setattribute self, 'key', $P1 -# } -.annotate 'line', 9095 .end # ClassSpecifierId +.sub 'clone' :method + .param pmc __ARG_1 + new $P1, [ 'Winxed'; 'Compiler'; 'ClassSpecifierId' ] + getattribute $P2, self, 'start' + $P1.'ClassSpecifier'(__ARG_1, $P2) + getattribute $P3, self, 'key' + setattribute $P1, 'key', $P3 + .return($P1) + +.end # clone + + .sub 'reftype' :method -# Body -# { -.annotate 'line', 9096 .return(3) -# } .end # reftype .sub 'last' :method -# Body -# { -.annotate 'line', 9100 -# var key: $P1 getattribute $P1, self, 'key' -.annotate 'line', 9101 $P2 = $P1[-1] .return($P2) -# } -.annotate 'line', 9102 .end # last +.sub 'checknskey' :method + .param pmc __ARG_1 + getattribute $P2, self, 'key' + $P1 = __ARG_1.'scopesearch'($P2, 2) + if_null $P1, __label_2 + $P2 = $P1.'getpath'() + goto __label_1 + __label_2: + null $P2 + __label_1: + .return($P2) + +.end # checknskey + + .sub 'emit' :method .param pmc __ARG_1 .param pmc __ARG_2 -.const 'Sub' WSubId_68 = "WSubId_68" -.const 'Sub' WSubId_57 = "WSubId_57" -# Body -# { -.annotate 'line', 9106 -# var key: $P1 - getattribute $P2, self, 'key' - $P1 = __ARG_2.'findclasskey'($P2) -.annotate 'line', 9107 - unless_null $P1, __label_1 -# { -.annotate 'line', 9108 - $P2 = self.'dowarnings'() - if_null $P2, __label_3 - unless $P2 goto __label_3 -.annotate 'line', 9109 +.const 'Sub' WSubId_99 = "WSubId_99" getattribute $P3, self, 'key' -# predefined join - join $S1, ".", $P3 - concat $S2, "class ", $S1 - concat $S2, $S2, " not found at compile time" - WSubId_68($S2) - __label_3: # endif -.annotate 'line', 9110 + $P1 = __ARG_2.'scopesearch'($P3, 2) + unless_null $P1, __label_1 getattribute $P3, self, 'key' - $P2 = WSubId_57($P3) - __ARG_1.'print'($P2) -# } + join $S2, ".", $P3 + getattribute $P4, self, 'start' + WSubId_99(__ARG_1, $S2, $P4) + getattribute $P2, self, 'key' + null $S1 + elements $I1, $P2 + unless $I1 goto __label_4 + join $S2, "'; '", $P2 + concat $S4, "[ '", $S2 + concat $S4, $S4, "' ]" + set $S1, $S4 + __label_4: # endif + set $S3, $S1 + goto __label_3 + __label_3: + __ARG_1.'print'($S3) goto __label_2 __label_1: # else -.annotate 'line', 9112 - $P2 = $P1.'getclasskey'() - __ARG_1.'print'($P2) + $P3 = $P1.'getclasskey'() + __ARG_1.'print'($P3) __label_2: # endif -# } -.annotate 'line', 9113 .end # emit -.sub Winxed_class_init :anon :load :init - newclass $P0, [ 'Winxed'; 'Compiler'; 'ClassSpecifierId' ] -.annotate 'line', 9081 - get_class $P1, [ 'Winxed'; 'Compiler'; 'ClassSpecifier' ] - addparent $P0, $P1 -.annotate 'line', 9083 - addattribute $P0, 'key' -.end -.namespace [ 'Winxed'; 'Compiler' ] -.sub 'parseClassSpecifier' :subid('WSubId_62') +.sub 'emit_new' :method .param pmc __ARG_1 .param pmc __ARG_2 -.const 'Sub' WSubId_1 = "WSubId_1" -# Body -# { -.annotate 'line', 9118 -# var t: $P1 - $P1 = __ARG_1.'get'() -.annotate 'line', 9119 - $P2 = $P1.'isstring'() - if_null $P2, __label_1 - unless $P2 goto __label_1 -.annotate 'line', 9120 - new $P4, [ 'Winxed'; 'Compiler'; 'ClassSpecifierStr' ] - $P4.'ClassSpecifierStr'(__ARG_2, $P1) - set $P3, $P4 - .return($P3) - __label_1: # endif -.annotate 'line', 9121 - $P2 = $P1.'isop'('[') - if_null $P2, __label_2 - unless $P2 goto __label_2 -.annotate 'line', 9122 - new $P4, [ 'Winxed'; 'Compiler'; 'ClassSpecifierParrotKey' ] - $P4.'ClassSpecifierParrotKey'(__ARG_1, __ARG_2, $P1) - set $P3, $P4 - .return($P3) + .param string __ARG_3 +.const 'Sub' WSubId_99 = "WSubId_99" + $P1 = self.'checknskey'(__ARG_2) + unless_null $P1, __label_1 + getattribute $P3, self, 'key' + join $S2, ".", $P3 + getattribute $P4, self, 'start' + WSubId_99(__ARG_1, $S2, $P4) + getattribute $P2, self, 'key' + null $S1 + elements $I1, $P2 + unless $I1 goto __label_4 + join $S2, "'; '", $P2 + concat $S4, "[ '", $S2 + concat $S4, $S4, "' ]" + set $S1, $S4 + __label_4: # endif + set $S3, $S1 + goto __label_3 + __label_3: + __ARG_1.'say'("new ", __ARG_3, ", ", $S3) + goto __label_2 + __label_1: # else + $P1.'emit_new'(__ARG_1, __ARG_2, __ARG_3) __label_2: # endif -.annotate 'line', 9123 - $P2 = $P1.'isidentifier'() - if_null $P2, __label_3 - unless $P2 goto __label_3 -.annotate 'line', 9124 - new $P4, [ 'Winxed'; 'Compiler'; 'ClassSpecifierId' ] - $P4.'ClassSpecifierId'(__ARG_1, __ARG_2, $P1) - set $P3, $P4 - .return($P3) - __label_3: # endif -.annotate 'line', 9125 - WSubId_1('Invalid class', $P1) -# } -.annotate 'line', 9126 -.end # parseClassSpecifier +.end # emit_new +.sub Winxed_class_init :anon :load :init + newclass $P0, [ 'Winxed'; 'Compiler'; 'ClassSpecifierId' ] + get_class $P1, [ 'Winxed'; 'Compiler'; 'ClassSpecifier' ] + addparent $P0, $P1 + addattribute $P0, 'key' +.end .namespace [ 'Winxed'; 'Compiler'; 'ClassBase' ] .sub 'ClassBase' :method .param pmc __ARG_1 .param pmc __ARG_2 .param pmc __ARG_3 -# Body -# { -.annotate 'line', 9138 self.'initbase'(__ARG_1, __ARG_3) -.annotate 'line', 9139 setattribute self, 'name', __ARG_2 -.annotate 'line', 9140 -# var classns: $P1 $P2 = __ARG_3.'getpath'() -# predefined clone - clone $P1, $P2 -.annotate 'line', 9141 - getattribute $P2, self, 'name' -# predefined push - push $P1, $P2 -.annotate 'line', 9142 + $P1 = $P2.'createchild'(__ARG_2) setattribute self, 'classns', $P1 -# } -.annotate 'line', 9143 .end # ClassBase +.sub 'getpath' :method + getattribute $P1, self, 'classns' + .return($P1) + +.end # getpath + + .sub 'getclasskey' :method -.const 'Sub' WSubId_57 = "WSubId_57" -# Body -# { -.annotate 'line', 9146 getattribute $P1, self, 'classns' - .tailcall WSubId_57($P1) -# } -.annotate 'line', 9147 + .tailcall $P1.'getparrotkey'() .end # getclasskey .sub Winxed_class_init :anon :load :init newclass $P0, [ 'Winxed'; 'Compiler'; 'ClassBase' ] -.annotate 'line', 9132 get_class $P1, [ 'Winxed'; 'Compiler'; 'CommonBase' ] addparent $P0, $P1 -.annotate 'line', 9134 addattribute $P0, 'name' -.annotate 'line', 9135 addattribute $P0, 'classns' .end +.namespace [ 'Winxed'; 'Compiler'; 'FunctionContainer' ] + +.sub 'FunctionContainer' :method + root_new $P2, ['parrot';'Hash'] + setattribute self, 'functions', $P2 + +.end # FunctionContainer + + +.sub 'addfunction' :method + .param pmc __ARG_1 + getattribute $P1, self, 'functions' + getattribute $P3, __ARG_1, 'name' + null $S1 + if_null $P3, __label_1 + set $S1, $P3 + __label_1: + $P2 = $P1[$S1] + unless_null $P2, __label_2 + $P1[$S1] = __ARG_1 + goto __label_3 + __label_2: # else + isa $I1, $P2, [ 'Winxed'; 'Compiler'; 'FunctionStatement' ] + unless $I1 goto __label_4 + $P2.'setmulti'() + __label_4: # endif + isa $I1, __ARG_1, [ 'Winxed'; 'Compiler'; 'FunctionStatement' ] + unless $I1 goto __label_5 + __ARG_1.'setmulti'() + __label_5: # endif + __label_3: # endif + +.end # addfunction + + +.sub 'find' :method + .param string __ARG_1 + getattribute $P1, self, 'functions' + $P2 = $P1[__ARG_1] + .return($P2) + +.end # find + +.sub Winxed_class_init :anon :load :init + newclass $P0, [ 'Winxed'; 'Compiler'; 'FunctionContainer' ] + addattribute $P0, 'functions' +.end .namespace [ 'Winxed'; 'Compiler'; 'ClassStatement' ] .sub 'ClassStatement' :method @@ -26763,318 +22149,220 @@ .param pmc __ARG_2 .param pmc __ARG_3 .param pmc __ARG_4 -.const 'Sub' WSubId_35 = "WSubId_35" -.const 'Sub' WSubId_62 = "WSubId_62" -.const 'Sub' WSubId_4 = "WSubId_4" -.const 'Sub' WSubId_107 = "WSubId_107" -.const 'Sub' WSubId_39 = "WSubId_39" -.const 'Sub' WSubId_43 = "WSubId_43" -.const 'Sub' WSubId_40 = "WSubId_40" -# Body -# { -.annotate 'line', 9160 +.const 'Sub' WSubId_67 = "WSubId_67" +.const 'Sub' WSubId_92 = "WSubId_92" +.const 'Sub' WSubId_28 = "WSubId_28" +.const 'Sub' WSubId_140 = "WSubId_140" +.const 'Sub' WSubId_70 = "WSubId_70" +.const 'Sub' WSubId_74 = "WSubId_74" +.const 'Sub' WSubId_71 = "WSubId_71" self.'ClassBase'(__ARG_1, __ARG_2, __ARG_3) -.annotate 'line', 9161 + self.'VarContainer'() + new $P8, [ 'Winxed'; 'Compiler'; 'FunctionContainer' ] + $P8.'FunctionContainer'() + set $P8, $P8 + setattribute self, 'funcont', $P8 setattribute self, 'parent', __ARG_3 -.annotate 'line', 9162 -# var functions: $P1 root_new $P1, ['parrot';'ResizablePMCArray'] -.annotate 'line', 9163 - setattribute self, 'functions', $P1 -.annotate 'line', 9164 -# var members: $P2 + setattribute self, 'items', $P1 root_new $P2, ['parrot';'ResizablePMCArray'] -.annotate 'line', 9165 setattribute self, 'members', $P2 -.annotate 'line', 9166 -# var constants: $P3 - root_new $P3, ['parrot';'ResizablePMCArray'] -.annotate 'line', 9167 - setattribute self, 'constants', $P3 -.annotate 'line', 9169 -# var t: $P4 - $P4 = __ARG_4.'get'() -.annotate 'line', 9170 - $P8 = $P4.'isop'(':') - if_null $P8, __label_1 - unless $P8 goto __label_1 -# { -.annotate 'line', 9171 - $P10 = WSubId_35(__ARG_4, self, WSubId_62) - setattribute self, 'bases', $P10 -.annotate 'line', 9172 - $P4 = __ARG_4.'get'() -# } + $P3 = __ARG_4.'get'() + $P7 = $P3.'isop'(':') + if_null $P7, __label_1 + unless $P7 goto __label_1 + $P9 = WSubId_67(__ARG_4, self, WSubId_92) + setattribute self, 'bases', $P9 + $P3 = __ARG_4.'get'() __label_1: # endif -.annotate 'line', 9174 - WSubId_4('{', $P4) -.annotate 'line', 9176 + WSubId_28('{', $P3) getattribute $P8, self, 'classns' -# predefined join - join $S1, '.', $P8 - WSubId_107(self, '__CLASS__', $S1) -# for loop -.annotate 'line', 9178 - $P4 = __ARG_4.'get'() + $P7 = $P8.'fullname'() + WSubId_140(self, '__CLASS__', $P7) + $P3 = __ARG_4.'get'() __label_4: # for condition - $P8 = $P4.'isop'('}') - isfalse $I1, $P8 + $P7 = $P3.'isop'('}') + isfalse $I1, $P7 unless $I1 goto __label_3 -# { -# switch -.annotate 'line', 9179 - $P9 = $P4.'checkkeyword'() - set $S1, $P9 - set $S2, 'function' - if $S1 == $S2 goto __label_7 - set $S2, 'var' - if $S1 == $S2 goto __label_8 - set $S2, 'const' - if $S1 == $S2 goto __label_9 - goto __label_6 + $P8 = $P3.'checkkeyword'() + set $S1, $P8 + if $S1 == 'function' goto __label_7 + if $S1 == 'var' goto __label_8 + if $S1 == 'const' goto __label_9 + goto __label_5 __label_7: # case -.annotate 'line', 9181 -# var f: $P5 - new $P5, [ 'Winxed'; 'Compiler'; 'MethodStatement' ] - $P5.'MethodStatement'($P4, __ARG_4, self) -.annotate 'line', 9182 -# predefined push - push $P1, $P5 - goto __label_5 # break + new $P9, [ 'Winxed'; 'Compiler'; 'MethodStatement' ] + $P9.'MethodStatement'($P3, __ARG_4, self) + set $P4, $P9 + self.'addmethod'($P4) + push $P1, $P4 + goto __label_6 # break __label_8: # case -.annotate 'line', 9185 -# var name: $P6 - $P6 = __ARG_4.'get'() -.annotate 'line', 9186 - $P10 = $P6.'isidentifier'() + $P5 = __ARG_4.'get'() + $P10 = $P5.'isidentifier'() isfalse $I2, $P10 unless $I2 goto __label_10 -.annotate 'line', 9187 - WSubId_39("member identifier", $P6) + WSubId_70("member identifier", $P5) __label_10: # endif -.annotate 'line', 9188 -# predefined push - push $P2, $P6 -.annotate 'line', 9189 - $P4 = __ARG_4.'get'() -.annotate 'line', 9190 - $P11 = $P4.'isop'(';') + push $P2, $P5 + $P3 = __ARG_4.'get'() + $P11 = $P3.'isop'(';') isfalse $I3, $P11 unless $I3 goto __label_11 -.annotate 'line', 9191 - WSubId_39("';' in member declaration", $P4) + WSubId_70("';' in member declaration", $P3) __label_11: # endif - goto __label_5 # break + goto __label_6 # break __label_9: # case -.annotate 'line', 9194 -# var cst: $P7 - $P7 = WSubId_43($P4, __ARG_4, self) -.annotate 'line', 9195 -# predefined push - push $P3, $P7 - goto __label_5 # break - __label_6: # default -.annotate 'line', 9198 - WSubId_40("item in class", $P4) - __label_5: # switch end -# } + $P6 = WSubId_74($P3, __ARG_4, self) + push $P1, $P6 + goto __label_6 # break + __label_5: # default + WSubId_71("item in class", $P3) + __label_6: # switch end __label_2: # for iteration -.annotate 'line', 9178 - $P4 = __ARG_4.'get'() + $P3 = __ARG_4.'get'() goto __label_4 __label_3: # for end -# } -.annotate 'line', 9201 .end # ClassStatement -.sub 'getpath' :method -# Body -# { -.annotate 'line', 9204 - getattribute $P1, self, 'classns' - .return($P1) -# } -.annotate 'line', 9205 +.sub 'addmethod' :method + .param pmc __ARG_1 + getattribute $P1, self, 'funcont' + $P1.'addfunction'(__ARG_1) -.end # getpath +.end # addmethod .sub 'generatesubid' :method -# Body -# { -.annotate 'line', 9208 getattribute $P1, self, 'owner' .tailcall $P1.'generatesubid'() -# } -.annotate 'line', 9209 .end # generatesubid -.sub 'findsymbol' :method - .param pmc __ARG_1 -# Body -# { -.annotate 'line', 9212 +.sub 'checkclass' :method + .param string __ARG_1 getattribute $P1, self, 'parent' - .tailcall $P1.'findsymbol'(__ARG_1) -# } -.annotate 'line', 9213 + .tailcall $P1.'checkclass'(__ARG_1) -.end # findsymbol +.end # checkclass -.sub 'findclasskey' :method +.sub 'scopesearch' :method .param pmc __ARG_1 -# Body -# { -.annotate 'line', 9216 - getattribute $P1, self, 'parent' - .tailcall $P1.'findclasskey'(__ARG_1) -# } -.annotate 'line', 9217 - -.end # findclasskey - - -.sub 'checkclass' :method - .param string __ARG_1 -# Body -# { -.annotate 'line', 9220 + .param int __ARG_2 getattribute $P1, self, 'parent' - .tailcall $P1.'checkclass'(__ARG_1) -# } -.annotate 'line', 9221 + .tailcall $P1.'scopesearch'(__ARG_1, __ARG_2) -.end # checkclass +.end # scopesearch -.sub 'use_predef' :method +.sub 'use_builtin' :method .param string __ARG_1 -# Body -# { -.annotate 'line', 9224 getattribute $P1, self, 'owner' - .tailcall $P1.'use_predef'(__ARG_1) -# } -.annotate 'line', 9225 + .tailcall $P1.'use_builtin'(__ARG_1) -.end # use_predef +.end # use_builtin .sub 'optimize' :method -.const 'Sub' WSubId_37 = "WSubId_37" -# Body -# { -.annotate 'line', 9228 - getattribute $P1, self, 'constants' - WSubId_37($P1) -.annotate 'line', 9229 - getattribute $P1, self, 'functions' - WSubId_37($P1) -.annotate 'line', 9230 + getattribute $P1, self, 'items' + if_null $P1, __label_3 + elements $I1, $P1 + goto __label_2 + __label_3: + null $I1 + __label_2: + null $I2 + __label_6: # for condition + ge $I2, $I1, __label_5 + $P3 = $P1[$I2] + $P2 = $P3.'optimize'() + $P1[$I2] = $P2 + __label_4: # for iteration + inc $I2 + goto __label_6 + __label_5: # for end + __label_1: .return(self) -# } -.annotate 'line', 9231 .end # optimize .sub 'emit' :method .param pmc __ARG_1 -.const 'Sub' WSubId_109 = "WSubId_109" -.const 'Sub' WSubId_51 = "WSubId_51" -# Body -# { -.annotate 'line', 9234 -# var classns: $P1 - getattribute $P1, self, 'classns' -.annotate 'line', 9235 - $P4 = WSubId_109($P1) - __ARG_1.'say'($P4) -.annotate 'line', 9236 - getattribute $P4, self, 'functions' - WSubId_51(__ARG_1, $P4) -.annotate 'line', 9238 - __ARG_1.'say'('.sub Winxed_class_init :anon :load :init') -.annotate 'line', 9240 - $P4 = self.'getclasskey'() - __ARG_1.'say'(' ', 'newclass $P0, ', $P4) -.annotate 'line', 9241 -# n: $I1 - set $I1, 1 -.annotate 'line', 9242 - getattribute $P4, self, 'bases' - if_null $P4, __label_2 - iter $P5, $P4 - set $P5, 0 - __label_1: # for iteration - unless $P5 goto __label_2 - shift $P2, $P5 -# { -.annotate 'line', 9243 - $P2.'annotate'(__ARG_1) -.annotate 'line', 9244 -# reg: $S1 + getattribute $P8, self, 'classns' + $P8.'emitnamespace'(__ARG_1) + set $P3, __ARG_1 + getattribute $P4, self, 'items' +.const 'Sub' WSubId_3 = "WSubId_3" +.const 'Sub' WSubId_5 = "WSubId_5" + set $P5, $P4 + $P8 = WSubId_5("emit") + $P6 = WSubId_3($P8, $P3) + if_null $P5, __label_4 + iter $P9, $P5 + set $P9, 0 + __label_3: # for iteration + unless $P9 goto __label_4 + shift $P7, $P9 + $P6($P7) + goto __label_3 + __label_4: # endfor + __label_2: + __label_1: + __ARG_1.'say'('.sub Winxed_class_init :anon :load :init') + $P8 = self.'getclasskey'() + __ARG_1.'say'(' ', 'newclass $P0, ', $P8) + set $I1, 1 + getattribute $P8, self, 'bases' + if_null $P8, __label_6 + iter $P10, $P8 + set $P10, 0 + __label_5: # for iteration + unless $P10 goto __label_6 + shift $P1, $P10 + $P1.'annotate'(__ARG_1) set $I2, $I1 inc $I1 set $S2, $I2 concat $S1, "$P", $S2 -.annotate 'line', 9245 __ARG_1.'print'(' ', 'get_class ', $S1, ', ') -.annotate 'line', 9246 - getattribute $P4, self, 'parent' - $P2.'emit'(__ARG_1, $P4) -.annotate 'line', 9247 + getattribute $P8, self, 'parent' + $P1.'emit'(__ARG_1, $P8) __ARG_1.'say'() -.annotate 'line', 9248 __ARG_1.'say'(' ', 'addparent $P0, ', $S1) -# } - goto __label_1 - __label_2: # endfor -.annotate 'line', 9250 - getattribute $P4, self, 'members' - if_null $P4, __label_4 - iter $P6, $P4 - set $P6, 0 - __label_3: # for iteration - unless $P6 goto __label_4 - shift $P3, $P6 -# { -.annotate 'line', 9251 - __ARG_1.'annotate'($P3) -.annotate 'line', 9252 - __ARG_1.'say'(' ', "addattribute $P0, '", $P3, "'") -# } - goto __label_3 - __label_4: # endfor -.annotate 'line', 9255 + goto __label_5 + __label_6: # endfor + getattribute $P8, self, 'members' + if_null $P8, __label_8 + iter $P11, $P8 + set $P11, 0 + __label_7: # for iteration + unless $P11 goto __label_8 + shift $P2, $P11 + __ARG_1.'annotate'($P2) + __ARG_1.'say'(' ', "addattribute $P0, '", $P2, "'") + goto __label_7 + __label_8: # endfor __ARG_1.'say'('.end') -# } -.annotate 'line', 9256 .end # emit .sub Winxed_class_init :anon :load :init newclass $P0, [ 'Winxed'; 'Compiler'; 'ClassStatement' ] -.annotate 'line', 9150 get_class $P1, [ 'Winxed'; 'Compiler'; 'ClassBase' ] addparent $P0, $P1 get_class $P2, [ 'Winxed'; 'Compiler'; 'VarContainer' ] addparent $P0, $P2 -.annotate 'line', 9152 addattribute $P0, 'parent' -.annotate 'line', 9153 addattribute $P0, 'bases' -.annotate 'line', 9154 addattribute $P0, 'constants' -.annotate 'line', 9155 - addattribute $P0, 'functions' -.annotate 'line', 9156 + addattribute $P0, 'items' addattribute $P0, 'members' + addattribute $P0, 'funcont' .end .namespace [ 'Winxed'; 'Compiler'; 'DeclareClassStatement' ] @@ -27082,150 +22370,106 @@ .param pmc __ARG_1 .param pmc __ARG_2 .param pmc __ARG_3 -# Body -# { -.annotate 'line', 9263 self.'ClassBase'(__ARG_1, __ARG_2, __ARG_3) -# } -.annotate 'line', 9264 .end # DeclareClassStatement .sub 'optimize' :method -# Body -# { -.annotate 'line', 9267 .return(self) -# } -.annotate 'line', 9268 .end # optimize .sub 'emit' :method .param pmc __ARG_1 -# Empty body .end # emit .sub Winxed_class_init :anon :load :init newclass $P0, [ 'Winxed'; 'Compiler'; 'DeclareClassStatement' ] -.annotate 'line', 9259 get_class $P1, [ 'Winxed'; 'Compiler'; 'ClassBase' ] addparent $P0, $P1 .end .namespace [ 'Winxed'; 'Compiler' ] -.sub 'parseClass' :subid('WSubId_111') +.sub 'parseClass' :subid('WSubId_143') .param pmc __ARG_1 .param pmc __ARG_2 .param pmc __ARG_3 -.const 'Sub' WSubId_4 = "WSubId_4" -# Body -# { -.annotate 'line', 9276 -# var name: $P1 $P1 = __ARG_2.'get'() -.annotate 'line', 9277 -# var t: $P2 $P2 = __ARG_2.'get'() -.annotate 'line', 9278 - $I1 = $P2.'isop'(';') - if $I1 goto __label_3 - $I1 = $P2.'isop'('.') - __label_3: - unless $I1 goto __label_1 -# { -# for loop - __label_6: # for condition -.annotate 'line', 9279 - $P3 = $P2.'isop'('.') - if_null $P3, __label_5 - unless $P3 goto __label_5 -# { -.annotate 'line', 9280 -# predefined string - set $S1, $P1 - __ARG_3 = __ARG_3.'declarenamespace'($P1, $S1) -.annotate 'line', 9281 + root_new $P3, ['parrot';'ResizablePMCArray'] + null $P4 + __label_3: # for condition + $P5 = $P2.'isop'('.') + if_null $P5, __label_2 + unless $P5 goto __label_2 + $P3.'push'($P1) $P1 = __ARG_2.'get'() -# } - __label_4: # for iteration -.annotate 'line', 9279 + __label_1: # for iteration $P2 = __ARG_2.'get'() + goto __label_3 + __label_2: # for end + $P5 = $P2.'isop'(';') + if_null $P5, __label_4 + unless $P5 goto __label_4 + if_null $P3, __label_7 + iter $P6, $P3 + set $P6, 0 + __label_6: # for iteration + unless $P6 goto __label_7 + shift $P4, $P6 + set $S1, $P4 + __ARG_3 = __ARG_3.'declarenamespace'($P4, $S1) goto __label_6 - __label_5: # for end -.annotate 'line', 9283 - WSubId_4(';', $P2) -.annotate 'line', 9284 - new $P4, [ 'Winxed'; 'Compiler'; 'DeclareClassStatement' ] - $P4.'DeclareClassStatement'(__ARG_1, $P1, __ARG_3) - set $P3, $P4 - __ARG_3.'declareclass'($P3) -# } - goto __label_2 - __label_1: # else -# { -.annotate 'line', 9287 + __label_7: # endfor + new $P7, [ 'Winxed'; 'Compiler'; 'DeclareClassStatement' ] + $P7.'DeclareClassStatement'(__ARG_1, $P1, __ARG_3) + set $P5, $P7 + __ARG_3.'declareclass'($P5) + goto __label_5 + __label_4: # else __ARG_2.'unget'($P2) -.annotate 'line', 9288 - new $P4, [ 'Winxed'; 'Compiler'; 'ClassStatement' ] - $P4.'ClassStatement'(__ARG_1, $P1, __ARG_3, __ARG_2) - set $P3, $P4 - __ARG_3.'addclass'($P3) -# } - __label_2: # endif -# } -.annotate 'line', 9290 + if_null $P3, __label_9 + iter $P8, $P3 + set $P8, 0 + __label_8: # for iteration + unless $P8 goto __label_9 + shift $P4, $P8 + null $P5 + __ARG_3 = __ARG_3.'childnamespace'(__ARG_1, $P4, $P5) + goto __label_8 + __label_9: # endfor + new $P7, [ 'Winxed'; 'Compiler'; 'ClassStatement' ] + $P7.'ClassStatement'(__ARG_1, $P1, __ARG_3, __ARG_2) + set $P5, $P7 + __ARG_3.'addclass'($P5) + __label_5: # endif .end # parseClass -.sub 'open_include' :subid('WSubId_110') +.sub 'open_include' :subid('WSubId_142') .param string __ARG_1 .param pmc __ARG_2 -.const 'Sub' WSubId_1 = "WSubId_1" -# Body -# { -.annotate 'line', 9298 -# var interp: $P1 -# predefined getinterp +.const 'Sub' WSubId_25 = "WSubId_25" getinterp $P1 -# Constant IGLOBALS_LIB_PATHS evaluated at compile time -# Constant PARROT_LIB_PATH_INCLUDE evaluated at compile time -.annotate 'line', 9303 -# var libpaths: $P2 $P2 = $P1[9] -.annotate 'line', 9304 -# var paths: $P3 $P3 = $P2[0] -.annotate 'line', 9305 -# var file: $P4 null $P4 -.annotate 'line', 9306 if_null $P3, __label_2 iter $P5, $P3 set $P5, 0 __label_1: # for iteration unless $P5 goto __label_2 shift $S1, $P5 -# { -.annotate 'line', 9307 -# filepath: $S2 concat $S2, $S1, __ARG_1 -.annotate 'line', 9308 -# try: create handler new $P6, 'ExceptionHandler' set_label $P6, __label_3 push_eh $P6 -# try: begin -# { -.annotate 'line', 9309 -# predefined open root_new $P4, ['parrot';'FileHandle'] $P4.'open'($S2,'r') -.annotate 'line', 9310 isnull $I1, $P4 not $I1 unless $I1 goto __label_6 @@ -27235,77 +22479,51 @@ unless $I1 goto __label_5 goto __label_2 # break __label_5: # endif -.annotate 'line', 9311 -# } -# try: end pop_eh goto __label_4 -.annotate 'line', 9308 -# catch __label_3: .get_results($P7) finalize $P7 pop_eh -# catch end __label_4: -# } goto __label_1 __label_2: # endfor -.annotate 'line', 9316 isnull $I1, $P4 - if $I1 goto __label_8 - $I1 = $P4.'is_closed'() + box $P6, $I1 + if $P6 goto __label_8 + $P6 = $P4.'is_closed'() __label_8: - unless $I1 goto __label_7 -.annotate 'line', 9317 - WSubId_1('File not found', __ARG_2) + if_null $P6, __label_7 + unless $P6 goto __label_7 + WSubId_25('File not found', __ARG_2) __label_7: # endif -.annotate 'line', 9318 $P4.'encoding'("utf8") -.annotate 'line', 9319 .return($P4) -# } -.annotate 'line', 9320 .end # open_include -.sub 'include_parrot' :subid('WSubId_113') +.sub 'include_parrot' :subid('WSubId_145') .param pmc __ARG_1 .param pmc __ARG_2 .param pmc __ARG_3 -.const 'Sub' WSubId_39 = "WSubId_39" -.const 'Sub' WSubId_53 = "WSubId_53" -.const 'Sub' WSubId_110 = "WSubId_110" -.const 'Sub' WSubId_21 = "WSubId_21" -# Body -# { -.annotate 'line', 9324 -# var tfile: $P1 +.const 'Sub' WSubId_70 = "WSubId_70" +.const 'Sub' WSubId_84 = "WSubId_84" +.const 'Sub' WSubId_142 = "WSubId_142" +.const 'Sub' WSubId_44 = "WSubId_44" $P1 = __ARG_2.'get'() -.annotate 'line', 9325 $P4 = $P1.'isstring'() isfalse $I4, $P4 unless $I4 goto __label_1 -.annotate 'line', 9326 - WSubId_39('literal string', $P1) + WSubId_70('literal string', $P1) __label_1: # endif -.annotate 'line', 9327 - WSubId_53(';', __ARG_2) -.annotate 'line', 9329 -# filename: $S1 + WSubId_84(';', __ARG_2) $P4 = $P1.'rawstring'() null $S1 if_null $P4, __label_2 set $S1, $P4 __label_2: -.annotate 'line', 9330 -# var file: $P2 - $P2 = WSubId_110($S1, __ARG_1) -# Constant MACRO_CONST evaluated at compile time -# for loop -.annotate 'line', 9335 -# line: $S2 + $P2 = WSubId_142($S1, __ARG_1) $P4 = $P2.'readline'() null $S2 if_null $P4, __label_6 @@ -27315,44 +22533,28 @@ $P5 = $P2.'eof'() isfalse $I4, $P5 unless $I4 goto __label_4 -# { -.annotate 'line', 9336 -# predefined substr substr $S6, $S2, 0, 12 ne $S6, '.macro_const', __label_7 -# { -.annotate 'line', 9337 -# pos: $I1 set $I1, 12 -.annotate 'line', 9338 -# c: $S3 null $S3 __label_9: # while -.annotate 'line', 9339 -# predefined substr substr $S3, $S2, $I1, 1 iseq $I4, $S3, " " if $I4 goto __label_10 iseq $I4, $S3, "\t" __label_10: unless $I4 goto __label_8 -.annotate 'line', 9340 inc $I1 goto __label_9 __label_8: # endwhile -.annotate 'line', 9341 -# pos2: $I2 set $I2, $I1 __label_12: # while -.annotate 'line', 9342 -# predefined substr substr $S3, $S2, $I2, 1 isne $I4, $S3, " " unless $I4 goto __label_16 isne $I4, $S3, "\t" __label_16: unless $I4 goto __label_15 -.annotate 'line', 9343 isne $I4, $S3, "\n" __label_15: unless $I4 goto __label_14 @@ -27362,44 +22564,32 @@ isne $I4, $S3, "" __label_13: unless $I4 goto __label_11 -.annotate 'line', 9344 inc $I2 goto __label_12 __label_11: # endwhile -.annotate 'line', 9345 ne $I2, $I1, __label_17 goto __label_3 # continue __label_17: # endif -.annotate 'line', 9347 -# name: $S4 sub $I4, $I2, $I1 -# predefined substr substr $S4, $S2, $I1, $I4 __label_19: # while -.annotate 'line', 9348 -# predefined substr substr $S3, $S2, $I2, 1 iseq $I4, $S3, " " if $I4 goto __label_20 iseq $I4, $S3, "\t" __label_20: unless $I4 goto __label_18 -.annotate 'line', 9349 inc $I2 goto __label_19 __label_18: # endwhile -.annotate 'line', 9350 set $I1, $I2 __label_22: # while -.annotate 'line', 9351 -# predefined substr substr $S3, $S2, $I2, 1 isne $I4, $S3, " " unless $I4 goto __label_26 isne $I4, $S3, "\t" __label_26: unless $I4 goto __label_25 -.annotate 'line', 9352 isne $I4, $S3, "\n" __label_25: unless $I4 goto __label_24 @@ -27409,916 +22599,894 @@ isne $I4, $S3, "" __label_23: unless $I4 goto __label_21 -.annotate 'line', 9353 inc $I2 goto __label_22 __label_21: # endwhile -.annotate 'line', 9354 ne $I2, $I1, __label_27 goto __label_3 # continue __label_27: # endif -.annotate 'line', 9356 -# value: $S5 sub $I4, $I2, $I1 -# predefined substr substr $S5, $S2, $I1, $I4 -.annotate 'line', 9358 -# ivalue: $I3 null $I3 -.annotate 'line', 9359 -# predefined substr substr $S6, $S5, 0, 2 iseq $I4, $S6, '0x' if $I4 goto __label_30 -# predefined substr substr $S7, $S5, 0, 2 iseq $I4, $S7, '0X' __label_30: unless $I4 goto __label_28 -.annotate 'line', 9360 -# predefined substr substr $S8, $S5, 2 box $P5, $S8 $P4 = $P5.'to_int'(16) set $I3, $P4 goto __label_29 __label_28: # else -.annotate 'line', 9362 set $I3, $S5 __label_29: # endif -.annotate 'line', 9363 -# var cst: $P3 $P3 = __ARG_3.'createconst'($S4, 'I', 4) -.annotate 'line', 9365 new $P6, [ 'Winxed'; 'Compiler'; 'TokenInteger' ] getattribute $P7, __ARG_1, 'file' getattribute $P8, __ARG_1, 'line' $P6.'TokenInteger'($P7, $P8, $S4) set $P5, $P6 -.annotate 'line', 9364 - $P4 = WSubId_21(__ARG_3, $P5, $I3) + $P4 = WSubId_44(__ARG_3, $P5, $I3) $P3.'setvalue'($P4) -# } __label_7: # endif -# } __label_3: # for iteration -.annotate 'line', 9335 $P4 = $P2.'readline'() set $S2, $P4 goto __label_5 __label_4: # for end -.annotate 'line', 9369 $P2.'close'() -# } -.annotate 'line', 9370 .end # include_parrot -.sub 'include_winxed' :subid('WSubId_114') +.sub 'include_winxed' :subid('WSubId_146') .param pmc __ARG_1 .param pmc __ARG_2 .param pmc __ARG_3 -.const 'Sub' WSubId_1 = "WSubId_1" -.const 'Sub' WSubId_39 = "WSubId_39" -.const 'Sub' WSubId_53 = "WSubId_53" -.const 'Sub' WSubId_110 = "WSubId_110" -# Body -# { -.annotate 'line', 9376 +.const 'Sub' WSubId_25 = "WSubId_25" +.const 'Sub' WSubId_70 = "WSubId_70" +.const 'Sub' WSubId_84 = "WSubId_84" +.const 'Sub' WSubId_142 = "WSubId_142" isa $I2, __ARG_3, [ 'Winxed'; 'Compiler'; 'RootNamespace' ] not $I1, $I2 unless $I1 goto __label_1 -.annotate 'line', 9377 - WSubId_1("Must be used at root namespace level") + WSubId_25("Must be used at root namespace level", __ARG_1) __label_1: # endif -.annotate 'line', 9378 -# var tfile: $P1 $P1 = __ARG_2.'get'() -.annotate 'line', 9379 $P4 = $P1.'isstring'() isfalse $I1, $P4 unless $I1 goto __label_2 -.annotate 'line', 9380 - WSubId_39('literal string', $P1) + WSubId_70('literal string', $P1) __label_2: # endif -.annotate 'line', 9381 - WSubId_53(';', __ARG_2) -.annotate 'line', 9383 -# filename: $S1 + WSubId_84(';', __ARG_2) $P4 = $P1.'rawstring'() null $S1 if_null $P4, __label_3 set $S1, $P4 __label_3: -.annotate 'line', 9384 -# var file: $P2 - $P2 = WSubId_110($S1, __ARG_1) -.annotate 'line', 9386 -# var tkinc: $P3 - new $P3, [ 'Winxed'; 'Compiler'; 'Tokenizer' ] - $P3.'Tokenizer'($P2, $S1) -.annotate 'line', 9387 + $P2 = WSubId_142($S1, __ARG_1) + new $P4, [ 'Winxed'; 'Compiler'; 'Tokenizer' ] + $P4.'Tokenizer'($P2, $S1, 0) + set $P3, $P4 __ARG_3.'parse'($P3) -.annotate 'line', 9389 $P2.'close'() -# } -.annotate 'line', 9390 .end # include_winxed -.sub 'parsensUsing' :subid('WSubId_112') +.sub 'parsensUsing' :subid('WSubId_144') .param pmc __ARG_1 .param pmc __ARG_2 .param pmc __ARG_3 -.const 'Sub' WSubId_58 = "WSubId_58" -.const 'Sub' WSubId_53 = "WSubId_53" -.const 'Sub' WSubId_54 = "WSubId_54" -.const 'Sub' WSubId_1 = "WSubId_1" -.const 'Sub' WSubId_35 = "WSubId_35" -.const 'Sub' WSubId_56 = "WSubId_56" -.const 'Sub' WSubId_39 = "WSubId_39" -# Body -# { -.annotate 'line', 9396 -# var t: $P1 +.const 'Sub' WSubId_88 = "WSubId_88" +.const 'Sub' WSubId_84 = "WSubId_84" +.const 'Sub' WSubId_85 = "WSubId_85" +.const 'Sub' WSubId_25 = "WSubId_25" +.const 'Sub' WSubId_67 = "WSubId_67" +.const 'Sub' WSubId_87 = "WSubId_87" +.const 'Sub' WSubId_70 = "WSubId_70" $P1 = __ARG_2.'get'() -.annotate 'line', 9397 $P5 = $P1.'iskeyword'('namespace') if_null $P5, __label_1 unless $P5 goto __label_1 -# { -.annotate 'line', 9398 - WSubId_58(__ARG_1, __ARG_2, __ARG_3) -.annotate 'line', 9399 - WSubId_53(';', __ARG_2) -.annotate 'line', 9400 + WSubId_88(__ARG_1, __ARG_2, __ARG_3) + WSubId_84(';', __ARG_2) .return() -# } __label_1: # endif -.annotate 'line', 9402 $P5 = $P1.'iskeyword'('extern') isfalse $I2, $P5 unless $I2 goto __label_2 -# { -.annotate 'line', 9403 __ARG_2.'unget'($P1) -.annotate 'line', 9404 -# var key: $P2 - $P2 = WSubId_54(__ARG_2) -.annotate 'line', 9405 -# nelems: $I1 -# predefined elements + $P2 = WSubId_85(__ARG_2) elements $I1, $P2 -.annotate 'line', 9406 ge $I1, 1, __label_3 -.annotate 'line', 9407 - WSubId_1('Unsupported at namespace level', $P1) + WSubId_25('Unsupported at namespace level', $P1) __label_3: # endif -.annotate 'line', 9408 - WSubId_53(';', __ARG_2) -.annotate 'line', 9409 + WSubId_84(';', __ARG_2) __ARG_3.'use'($P2) -.annotate 'line', 9410 .return() -# } __label_2: # endif -.annotate 'line', 9412 $P1 = __ARG_2.'get'() -# switch-case -.annotate 'line', 9414 - $I2 = $P1.'isstring'() + $P5 = $P1.'isstring'() + set $I2, $P5 if $I2 goto __label_6 -.annotate 'line', 9420 - $I2 = $P1.'isidentifier'() + $P6 = $P1.'isidentifier'() + set $I2, $P6 if $I2 goto __label_7 goto __label_5 __label_6: # case -.annotate 'line', 9416 -# reqlib: $S1 - set $P5, $P1 + __ARG_2.'warn'("using extern 'file'; is deprecated, use $loadlib instead.", $P1) null $S1 - if_null $P5, __label_8 - set $S1, $P5 + if_null $P1, __label_8 + set $S1, $P1 __label_8: -.annotate 'line', 9417 __ARG_3.'addlib'($S1) -.annotate 'line', 9418 - WSubId_53(';', __ARG_2) + WSubId_84(';', __ARG_2) goto __label_4 # break __label_7: # case -.annotate 'line', 9421 __ARG_2.'unget'($P1) -.annotate 'line', 9422 -# var module: $P3 - $P3 = WSubId_54(__ARG_2) -.annotate 'line', 9423 + $P3 = WSubId_85(__ARG_2) $P1 = __ARG_2.'get'() -.annotate 'line', 9424 - $P6 = $P1.'isop'(';') - isfalse $I3, $P6 + $P7 = $P1.'isop'(';') + isfalse $I3, $P7 unless $I3 goto __label_9 -# { -.annotate 'line', 9425 __ARG_2.'unget'($P1) -.annotate 'line', 9426 -# var names: $P4 null $P5 - $P4 = WSubId_35(__ARG_2, $P5, WSubId_56, ';') -.annotate 'line', 9427 + $P4 = WSubId_67(__ARG_2, $P5, WSubId_87, ';') __ARG_3.'addextern'($P3, $P4) -# } __label_9: # endif -.annotate 'line', 9429 -# reqmodule: $S2 -# predefined join join $S3, '/', $P3 concat $S2, '"', $S3 concat $S2, $S2, '.pbc"' -.annotate 'line', 9430 __ARG_3.'addload'($S2) goto __label_4 # break __label_5: # default -.annotate 'line', 9433 - WSubId_39('string literal or identifier', $P1) + WSubId_70('string literal or identifier', $P1) __label_4: # switch end -# } -.annotate 'line', 9435 -.end # parsensUsing +.end # parsensUsing + +.namespace [ 'Winxed'; 'Compiler'; 'External' ] + +.sub 'External' :method + .param pmc __ARG_1 + .param pmc __ARG_2 + setattribute self, 'module', __ARG_1 + setattribute self, 'names', __ARG_2 + +.end # External + + +.sub 'emit' :subid('WSubId_15') :method + .param pmc __ARG_1 +.const 'Sub' WSubId_16 = "WSubId_16" +.lex '__WLEX_1', __ARG_1 + __ARG_1.'say'(".sub 'importextern' :anon :load :init\n .local pmc ex, curns, srcns, symbols\n ex = new ['Exporter']\n curns = get_namespace\n symbols = new ['ResizableStringArray']\n") + getattribute $P4, self, 'module' + join $S1, "'; '", $P4 + concat $S2, "['parrot'; '", $S1 + concat $S2, $S2, "']" + __ARG_1.'emitget_root_namespace'("srcns", $S2) + getattribute $P1, self, 'names' + newclosure $P2, WSubId_16 + if_null $P1, __label_3 + iter $P5, $P1 + set $P5, 0 + __label_2: # for iteration + unless $P5 goto __label_3 + shift $P3, $P5 + $P2($P3) + goto __label_2 + __label_3: # endfor + __label_1: + __ARG_1.'say'(" ex.'destination'(curns)\n ex.'import'(srcns :named('source'), curns :named('destination'), symbols :named('globals'))\n.end\n") + +.end # emit + + +.sub '' :anon :subid('WSubId_16') :outer('WSubId_15') + .param string __ARG_2 + find_lex $P1, '__WLEX_1' + $P1.'say'(" push symbols, '", __ARG_2, "'") + +.end # WSubId_16 + +.sub Winxed_class_init :anon :load :init + newclass $P0, [ 'Winxed'; 'Compiler'; 'External' ] + addattribute $P0, 'module' + addattribute $P0, 'names' +.end +.namespace [ 'Winxed'; 'Compiler'; 'NamespacePath' ] + +.sub 'NamespacePath' :method + .param string __ARG_1 :optional + .param int __ARG_2 :optional + new $P1, ['ResizableStringArray'] + unless __ARG_2 goto __label_1 + box $P2, __ARG_1 + setattribute self, 'hll', $P2 + goto __label_2 + __label_1: # else + if_null __ARG_1, __label_3 + push $P1, __ARG_1 + __label_3: # endif + __label_2: # endif + setattribute self, 'path', $P1 + +.end # NamespacePath + + +.sub 'createchild' :method + .param string __ARG_1 + new $P1, [ 'Winxed'; 'Compiler'; 'NamespacePath' ] + getattribute $P4, self, 'hll' + setattribute $P1, 'hll', $P4 + getattribute $P3, self, 'path' + clone $P2, $P3 + push $P2, __ARG_1 + setattribute $P1, 'path', $P2 + .return($P1) + +.end # createchild + + +.sub 'samehllas' :method + .param pmc __ARG_1 + $P1 = __ARG_1.'getpath'() + getattribute $P2, self, 'hll' + if_null $P1, __label_2 + getattribute $P3, $P1, 'hll' + goto __label_1 + __label_2: + null $P3 + __label_1: + unless_null $P2, __label_3 + isnull $I1, $P3 + .return($I1) + goto __label_4 + __label_3: # else + unless_null $P3, __label_6 + null $I2 + goto __label_5 + __label_6: + iseq $I2, $P2, $P3 + __label_5: + .return($I2) + __label_4: # endif + +.end # samehllas + + +.sub 'fullname' :method + getattribute $P1, self, 'path' + join $S1, '.', $P1 + getattribute $P1, self, 'hll' + if_null $P1, __label_1 + getattribute $P2, self, 'hll' + set $S2, $P2 + concat $S3, $S2, '.' + concat $S3, $S3, $S1 + .return($S3) + goto __label_2 + __label_1: # else + .return($S1) + __label_2: # endif + +.end # fullname + + +.sub 'getparrotkey' :method + getattribute $P1, self, 'path' + null $S1 + elements $I1, $P1 + unless $I1 goto __label_1 + join $S2, "'; '", $P1 + concat $S3, "[ '", $S2 + concat $S3, $S3, "' ]" + set $S1, $S3 + __label_1: # endif + .return($S1) + +.end # getparrotkey + + +.sub 'getparrotrootkey' :method + getattribute $P1, self, 'path' + getattribute $P2, self, 'hll' + set $S1, "[ '" + if_null $P2, __label_1 + set $S3, $P2 + downcase $S2, $S3 + concat $S1, $S1, $S2 + goto __label_2 + __label_1: # else + concat $S1, $S1, "parrot" + __label_2: # endif + concat $S1, $S1, "'" + elements $I1, $P1 + unless $I1 goto __label_3 + join $S2, "'; '", $P1 + concat $S1, $S1, "; '" + concat $S1, $S1, $S2 + concat $S1, $S1, "'" + __label_3: # endif + concat $S1, $S1, " ]" + .return($S1) + +.end # getparrotrootkey + + +.sub 'emitnamespace' :method + .param pmc __ARG_1 + getattribute $P1, self, 'path' + __ARG_1.'print'(".namespace [ ") + elements $I1, $P1 + unless $I1 goto __label_1 + join $S1, "'; '", $P1 + __ARG_1.'print'("'", $S1, "' ") + __label_1: # endif + __ARG_1.'say'("]") + +.end # emitnamespace + + +.sub 'emit_new' :method + .param pmc __ARG_1 + .param pmc __ARG_2 + .param string __ARG_3 + .param string __ARG_4 :optional +.const 'Sub' WSubId_45 = "WSubId_45" + $P1 = self.'samehllas'(__ARG_2) + if_null $P1, __label_1 + unless $P1 goto __label_1 + $P3 = self.'getparrotkey'() + $P2 = WSubId_45(" new %0, %1", __ARG_3, $P3) + __ARG_1.'print'($P2) + goto __label_2 + __label_1: # else + $P5 = self.'getparrotrootkey'() + $P4 = WSubId_45(" root_new %0, %1", __ARG_3, $P5) + __ARG_1.'print'($P4) + __label_2: # endif + isnull $I1, __ARG_4 + not $I1 + unless $I1 goto __label_4 + isne $I1, __ARG_4, '' + __label_4: + unless $I1 goto __label_3 + __ARG_1.'print'(__ARG_4) + __label_3: # endif + __ARG_1.'say'() + +.end # emit_new + + +.sub 'emit_get_namespace' :method + .param pmc __ARG_1 + .param pmc __ARG_2 + .param string __ARG_3 + $P1 = self.'samehllas'(__ARG_2) + if_null $P1, __label_1 + unless $P1 goto __label_1 + $P2 = self.'getparrotkey'() + __ARG_1.'emitget_hll_namespace'(__ARG_3, $P2) + goto __label_2 + __label_1: # else + $P3 = self.'getparrotrootkey'() + __ARG_1.'emitget_root_namespace'(__ARG_3, $P3) + __label_2: # endif + +.end # emit_get_namespace -.namespace [ 'Winxed'; 'Compiler'; 'External' ] -.sub 'External' :method +.sub 'emit_get_class' :method .param pmc __ARG_1 .param pmc __ARG_2 -# Body -# { -.annotate 'line', 9445 - setattribute self, 'module', __ARG_1 -.annotate 'line', 9446 - setattribute self, 'names', __ARG_2 -# } -.annotate 'line', 9447 + .param string __ARG_3 +.const 'Sub' WSubId_45 = "WSubId_45" + $P3 = self.'samehllas'(__ARG_2) + if_null $P3, __label_1 + unless $P3 goto __label_1 + $P5 = self.'getparrotkey'() + $P4 = WSubId_45(" get_class %0, %1", __ARG_3, $P5) + __ARG_1.'say'($P4) + goto __label_2 + __label_1: # else + getattribute $P1, self, 'hll' + getattribute $P3, self, 'path' + clone $P2, $P3 + $P3 = $P2.'pop'() + null $S1 + if_null $P3, __label_3 + set $S1, $P3 + __label_3: + if_null $P1, __label_5 + set $S3, $P1 + downcase $S2, $S3 + goto __label_4 + __label_5: + set $S2, 'parrot' + __label_4: + elements $I1, $P2 + unless $I1 goto __label_6 + join $S3, "'; '", $P2 + $P3 = WSubId_45(" get_root_global %0, ['%1'; '%2'], '%3'", __ARG_3, $S2, $S3, $S1) + __ARG_1.'say'($P3) + goto __label_7 + __label_6: # else + $P4 = WSubId_45(" get_root_global %0, ['%1'], '%2'", __ARG_3, $S2, $S1) + __ARG_1.'say'($P4) + __label_7: # endif + $P3 = WSubId_45(" get_class %0, %0", __ARG_3) + __ARG_1.'say'($P3) + __label_2: # endif -.end # External +.end # emit_get_class -.sub 'emit' :method +.sub 'emit_get_global' :method .param pmc __ARG_1 -# Body -# { -.annotate 'line', 9452 - __ARG_1.'say'(".sub 'importextern' :anon :load :init\n .local pmc ex, curns, srcns, symbols\n ex = new ['Exporter']\n curns = get_namespace\n symbols = new ['ResizableStringArray']\n") -.annotate 'line', 9460 - __ARG_1.'print'(" srcns = get_root_namespace ['parrot'; '") -.annotate 'line', 9461 - getattribute $P1, self, 'module' -# predefined join - join $S2, "'; '", $P1 - __ARG_1.'print'($S2) -.annotate 'line', 9462 - __ARG_1.'say'("']") -.annotate 'line', 9463 - getattribute $P1, self, 'names' - if_null $P1, __label_2 - iter $P2, $P1 - set $P2, 0 - __label_1: # for iteration - unless $P2 goto __label_2 - shift $S1, $P2 -.annotate 'line', 9464 - __ARG_1.'say'(" push symbols, '", $S1, "'") - goto __label_1 - __label_2: # endfor -.annotate 'line', 9465 - __ARG_1.'say'(" ex.'destination'(curns)\n ex.'import'(srcns :named('source'), curns :named('destination'), symbols :named('globals'))\n.end\n") -# } -.annotate 'line', 9471 + .param pmc __ARG_2 + .param string __ARG_3 + .param string __ARG_4 + $P1 = self.'samehllas'(__ARG_2) + if_null $P1, __label_1 + unless $P1 goto __label_1 + $P2 = self.'getparrotkey'() + __ARG_1.'emitget_hll_global'(__ARG_3, __ARG_4, $P2) + goto __label_2 + __label_1: # else + $P3 = self.'getparrotrootkey'() + __ARG_1.'emitget_root_global'(__ARG_3, __ARG_4, $P3) + __label_2: # endif -.end # emit +.end # emit_get_global .sub Winxed_class_init :anon :load :init - newclass $P0, [ 'Winxed'; 'Compiler'; 'External' ] -.annotate 'line', 9441 - addattribute $P0, 'module' -.annotate 'line', 9442 - addattribute $P0, 'names' + newclass $P0, [ 'Winxed'; 'Compiler'; 'NamespacePath' ] + addattribute $P0, 'hll' + addattribute $P0, 'path' .end .namespace [ 'Winxed'; 'Compiler'; 'NamespaceBase' ] .sub 'NamespaceBase' :method .param pmc __ARG_1 .param pmc __ARG_2 -.const 'Sub' WSubId_107 = "WSubId_107" -# Body -# { -.annotate 'line', 9490 +.const 'Sub' WSubId_140 = "WSubId_140" + self.'VarContainer'() setattribute self, 'nspath', __ARG_1 -.annotate 'line', 9491 unless_null __ARG_2, __label_1 -# { -.annotate 'line', 9492 root_new $P2, ['parrot';'ResizablePMCArray'] setattribute self, 'namespaces', $P2 -.annotate 'line', 9493 root_new $P2, ['parrot';'ResizablePMCArray'] setattribute self, 'usednamespaces', $P2 -.annotate 'line', 9494 root_new $P2, ['parrot';'ResizablePMCArray'] setattribute self, 'classes', $P2 -.annotate 'line', 9495 - root_new $P2, ['parrot';'ResizablePMCArray'] - setattribute self, 'functions', $P2 -.annotate 'line', 9496 - getattribute $P1, self, 'nspath' -# predefined join - join $S1, '.', $P1 - WSubId_107(self, '__NAMESPACE__', $S1) -# } + new $P2, [ 'Winxed'; 'Compiler'; 'FunctionContainer' ] + $P2.'FunctionContainer'() + set $P2, $P2 + setattribute self, 'funcont', $P2 + $P1 = __ARG_1.'fullname'() + WSubId_140(self, '__NAMESPACE__', $P1) goto __label_2 __label_1: # else -# { -.annotate 'line', 9499 getattribute $P2, __ARG_2, 'locals' setattribute self, 'locals', $P2 -.annotate 'line', 9500 getattribute $P2, __ARG_2, 'namespaces' setattribute self, 'namespaces', $P2 -.annotate 'line', 9501 getattribute $P2, __ARG_2, 'usednamespaces' setattribute self, 'usednamespaces', $P2 -.annotate 'line', 9502 getattribute $P2, __ARG_2, 'classes' setattribute self, 'classes', $P2 -.annotate 'line', 9503 - getattribute $P2, __ARG_2, 'functions' - setattribute self, 'functions', $P2 -# } + getattribute $P2, __ARG_2, 'funcont' + setattribute self, 'funcont', $P2 __label_2: # endif -.annotate 'line', 9505 root_new $P2, ['parrot';'ResizablePMCArray'] setattribute self, 'items', $P2 -# } -.annotate 'line', 9506 .end # NamespaceBase -.sub 'fixnamespaces' :method -# Body -# { -.annotate 'line', 9509 -# var ns: $P1 - null $P1 -.annotate 'line', 9510 - getattribute $P3, self, 'namespaces' - if_null $P3, __label_2 - iter $P4, $P3 - set $P4, 0 - __label_1: # for iteration - unless $P4 goto __label_2 - shift $P1, $P4 -.annotate 'line', 9511 - $P1.'fixnamespaces'() - goto __label_1 - __label_2: # endfor -.annotate 'line', 9512 - getattribute $P3, self, 'usednamespaces' - if_null $P3, __label_4 - iter $P5, $P3 - set $P5, 0 - __label_3: # for iteration - unless $P5 goto __label_4 - shift $P1, $P5 -.annotate 'line', 9513 - getattribute $P6, $P1, 'usednamespaces' - if_null $P6, __label_6 - iter $P7, $P6 - set $P7, 0 +.sub 'addfunction' :method + .param pmc __ARG_1 + getattribute $P1, self, 'funcont' + $P1.'addfunction'(__ARG_1) + +.end # addfunction + + +.sub 'fixnamespaces' :subid('WSubId_17') :method +.const 'Sub' WSubId_5 = "WSubId_5" +.const 'Sub' WSubId_7 = "WSubId_7" +.const 'Sub' WSubId_18 = "WSubId_18" +.lex '__WLEX_1', $P1 + getattribute $P2, self, 'namespaces' + $P3 = WSubId_5("fixnamespaces") + if_null $P2, __label_3 + iter $P8, $P2 + set $P8, 0 + __label_2: # for iteration + unless $P8 goto __label_3 + shift $P4, $P8 + $P3($P4) + goto __label_2 + __label_3: # endfor + __label_1: + $P1 = WSubId_7(self, "usenamespace") + getattribute $P5, self, 'usednamespaces' + newclosure $P6, WSubId_18 + if_null $P5, __label_6 + iter $P9, $P5 + set $P9, 0 __label_5: # for iteration - unless $P7 goto __label_6 - shift $P2, $P7 -.annotate 'line', 9514 - self.'usenamespace'($P2) + unless $P9 goto __label_6 + shift $P7, $P9 + $P6($P7) goto __label_5 __label_6: # endfor - goto __label_3 - __label_4: # endfor -# } -.annotate 'line', 9515 + __label_4: .end # fixnamespaces +.sub '' :anon :subid('WSubId_18') :outer('WSubId_17') + .param pmc __ARG_1 + find_lex $P1, '__WLEX_1' + getattribute $P2, __ARG_1, 'usednamespaces' + set $P3, $P1 + if_null $P2, __label_3 + iter $P5, $P2 + set $P5, 0 + __label_2: # for iteration + unless $P5 goto __label_3 + shift $P4, $P5 + $P3($P4) + goto __label_2 + __label_3: # endfor + __label_1: + +.end # WSubId_18 + + .sub 'getpath' :method -# Body -# { -.annotate 'line', 9518 getattribute $P1, self, 'nspath' .return($P1) -# } -.annotate 'line', 9519 .end # getpath .sub 'usenamespace' :method .param pmc __ARG_1 -# Body -# { -.annotate 'line', 9522 ne_addr __ARG_1, self, __label_1 -.annotate 'line', 9523 .return() __label_1: # endif -.annotate 'line', 9524 -# var usednamespaces: $P1 getattribute $P1, self, 'usednamespaces' -.annotate 'line', 9525 - if_null $P1, __label_3 - iter $P3, $P1 - set $P3, 0 - __label_2: # for iteration - unless $P3 goto __label_3 - shift $P2, $P3 -.annotate 'line', 9526 - ne_addr $P2, __ARG_1, __label_4 -.annotate 'line', 9527 + set $P2, $P1 + set $P3, __ARG_1 + if_null $P2, __label_5 + iter $P6, $P2 + set $P6, 0 + __label_4: # for iteration + unless $P6 goto __label_5 + shift $P4, $P6 + ne_addr $P4, $P3, __label_6 + set $P5, $P4 + goto __label_3 + __label_6: # endif + goto __label_4 + __label_5: # endfor + null $P5 + goto __label_3 + __label_3: + set $P7, $P5 + if_null $P7, __label_2 .return() - __label_4: # endif - goto __label_2 - __label_3: # endfor -.annotate 'line', 9528 -# predefined push + __label_2: # endif push $P1, __ARG_1 -# } -.annotate 'line', 9529 .end # usenamespace .sub 'use' :method .param pmc __ARG_1 -# Body -# { -.annotate 'line', 9532 -# var sym: $P1 - $P1 = self.'findsymbol'(__ARG_1) -.annotate 'line', 9533 + $P1 = self.'scopesearch'(__ARG_1, 0) if_null $P1, __label_1 -# { -.annotate 'line', 9534 isa $I1, $P1, [ 'Winxed'; 'Compiler'; 'FunctionStatement' ] unless $I1 goto __label_3 -.annotate 'line', 9535 - getattribute $P3, self, 'functions' -# predefined push - push $P3, $P1 + self.'addfunction'($P1) __label_3: # endif -# } goto __label_2 __label_1: # else -# { -.annotate 'line', 9538 -# name: $S1 $P3 = __ARG_1.'pop'() null $S1 if_null $P3, __label_4 set $S1, $P3 __label_4: -.annotate 'line', 9539 -# var ns: $P2 - $P2 = self.'findns'(__ARG_1) -.annotate 'line', 9540 + $P2 = self.'scopesearch'(__ARG_1, 1) if_null $P2, __label_5 -# { -.annotate 'line', 9541 $P1 = $P2.'getvar'($S1) -.annotate 'line', 9542 if_null $P1, __label_6 -.annotate 'line', 9543 self.'createvarused'($S1, $P1) __label_6: # endif -# } __label_5: # endif -# } __label_2: # endif -# } -.annotate 'line', 9546 .end # use -.sub 'getusedns' :method +.sub 'getusedns' :subid('WSubId_19') :method .param string __ARG_1 -# Body -# { -.annotate 'line', 9549 - getattribute $P2, self, 'usednamespaces' - if_null $P2, __label_2 - iter $P3, $P2 - set $P3, 0 - __label_1: # for iteration - unless $P3 goto __label_2 - shift $P1, $P3 -.annotate 'line', 9550 - getattribute $P4, $P1, 'name' - set $S1, $P4 - ne $S1, __ARG_1, __label_3 -.annotate 'line', 9551 - .return($P1) - __label_3: # endif +.const 'Sub' WSubId_20 = "WSubId_20" +.lex '__WLEX_1', __ARG_1 + getattribute $P1, self, 'usednamespaces' + newclosure $P2, WSubId_20 + if_null $P1, __label_3 + iter $P5, $P1 + set $P5, 0 + __label_2: # for iteration + unless $P5 goto __label_3 + shift $P3, $P5 + $P6 = $P2($P3) + if_null $P6, __label_4 + unless $P6 goto __label_4 + set $P4, $P3 goto __label_1 - __label_2: # endfor - null $P2 -.annotate 'line', 9552 - .return($P2) -# } -.annotate 'line', 9553 + __label_4: # endif + goto __label_2 + __label_3: # endfor + null $P4 + goto __label_1 + __label_1: + set $P6, $P4 + .return($P6) .end # getusedns -.sub 'getlocalns' :method +.sub '' :anon :subid('WSubId_20') :outer('WSubId_19') + .param pmc __ARG_2 + find_lex $S1, '__WLEX_1' + getattribute $P1, __ARG_2, 'name' + find_lex $S2, '__WLEX_1' + set $S3, $P1 + iseq $I1, $S3, $S2 + .return($I1) + +.end # WSubId_20 + + +.sub 'getlocalns' :subid('WSubId_21') :method .param string __ARG_1 -# Body -# { -.annotate 'line', 9556 +.const 'Sub' WSubId_22 = "WSubId_22" +.lex '__WLEX_1', __ARG_1 getattribute $P2, self, 'namespaces' - if_null $P2, __label_2 - iter $P3, $P2 - set $P3, 0 - __label_1: # for iteration - unless $P3 goto __label_2 - shift $P1, $P3 -.annotate 'line', 9557 - getattribute $P4, $P1, 'name' - set $S1, $P4 - ne $S1, __ARG_1, __label_3 -.annotate 'line', 9558 - .return($P1) - __label_3: # endif + newclosure $P3, WSubId_22 + if_null $P2, __label_3 + iter $P5, $P2 + set $P5, 0 + __label_2: # for iteration + unless $P5 goto __label_3 + shift $P4, $P5 + $P6 = $P3($P4) + if_null $P6, __label_4 + unless $P6 goto __label_4 + set $P1, $P4 goto __label_1 - __label_2: # endfor -.annotate 'line', 9559 + __label_4: # endif + goto __label_2 + __label_3: # endfor + null $P1 + goto __label_1 + __label_1: + if_null $P1, __label_5 + .return($P1) + __label_5: # endif .tailcall self.'getusedns'(__ARG_1) -# } -.annotate 'line', 9560 .end # getlocalns +.sub '' :anon :subid('WSubId_22') :outer('WSubId_21') + .param pmc __ARG_2 + find_lex $S1, '__WLEX_1' + getattribute $P1, __ARG_2, 'name' + find_lex $S2, '__WLEX_1' + set $S3, $P1 + iseq $I1, $S3, $S2 + .return($I1) + +.end # WSubId_22 + + .sub 'addextern' :method .param pmc __ARG_1 .param pmc __ARG_2 -# Body -# { -.annotate 'line', 9564 -# var ext: $P1 - new $P1, [ 'Winxed'; 'Compiler'; 'External' ] - $P1.'External'(__ARG_1, __ARG_2) -.annotate 'line', 9565 -# var externals: $P2 + new $P3, [ 'Winxed'; 'Compiler'; 'External' ] + $P3.'External'(__ARG_1, __ARG_2) + set $P1, $P3 getattribute $P2, self, 'externals' -.annotate 'line', 9566 unless_null $P2, __label_1 -.annotate 'line', 9567 root_new $P4, ['parrot';'ResizablePMCArray'] - push $P4, $P1 + assign $P4, 1 + $P4[0] = $P1 set $P2, $P4 setattribute self, 'externals', $P2 goto __label_2 - __label_1: # else -.annotate 'line', 9569 -# predefined push - push $P2, $P1 - __label_2: # endif -# } -.annotate 'line', 9570 - -.end # addextern - - -.sub 'checkclass_base' :method - .param string __ARG_1 -# Body -# { -.annotate 'line', 9574 -# var classes: $P1 - getattribute $P1, self, 'classes' -.annotate 'line', 9575 -# var cl: $P2 - null $P2 -.annotate 'line', 9576 - if_null $P1, __label_2 - iter $P4, $P1 - set $P4, 0 - __label_1: # for iteration - unless $P4 goto __label_2 - shift $P2, $P4 -.annotate 'line', 9577 - getattribute $P5, $P2, 'name' - set $S1, $P5 - ne $S1, __ARG_1, __label_3 -.annotate 'line', 9578 - .return($P2) - __label_3: # endif - goto __label_1 - __label_2: # endfor -.annotate 'line', 9579 - getattribute $P5, self, 'usednamespaces' - if_null $P5, __label_5 - iter $P6, $P5 - set $P6, 0 - __label_4: # for iteration - unless $P6 goto __label_5 - shift $P3, $P6 -.annotate 'line', 9580 - $P2 = $P3.'checkclass_base'(__ARG_1) - if_null $P2, __label_6 -.annotate 'line', 9581 - .return($P2) - __label_6: # endif - goto __label_4 - __label_5: # endfor - null $P5 -.annotate 'line', 9582 - .return($P5) -# } -.annotate 'line', 9583 + __label_1: # else + push $P2, $P1 + __label_2: # endif -.end # checkclass_base +.end # addextern -.sub 'findclasskey_base' :method - .param pmc __ARG_1 - .param int __ARG_2 -# Body -# { -.annotate 'line', 9588 -# nelems: $I1 -# predefined elements - elements $I1, __ARG_1 -# switch -.annotate 'line', 9589 - sub $I2, $I1, __ARG_2 - null $I3 - if $I2 == $I3 goto __label_3 - set $I3, 1 - if $I2 == $I3 goto __label_4 +.sub 'checkclass_base' :subid('WSubId_23') :method + .param string __ARG_1 +.const 'Sub' WSubId_24 = "WSubId_24" +.lex '__WLEX_1', __ARG_1 + getattribute $P3, self, 'classes' + newclosure $P4, WSubId_24 + if_null $P3, __label_3 + iter $P6, $P3 + set $P6, 0 + __label_2: # for iteration + unless $P6 goto __label_3 + shift $P5, $P6 + $P7 = $P4($P5) + if_null $P7, __label_4 + unless $P7 goto __label_4 + set $P1, $P5 + goto __label_1 + __label_4: # endif goto __label_2 - __label_3: # case - null $P3 -.annotate 'line', 9591 - .return($P3) - __label_4: # case -.annotate 'line', 9594 - sub $I4, $I1, 1 - $P4 = __ARG_1[$I4] - .tailcall self.'checkclass_base'($P4) - __label_2: # default -.annotate 'line', 9599 -# basename: $S1 - $S1 = __ARG_1[__ARG_2] -.annotate 'line', 9600 -# var ns: $P1 - $P1 = self.'getlocalns'($S1) -.annotate 'line', 9601 + __label_3: # endfor + null $P1 + goto __label_1 + __label_1: if_null $P1, __label_5 -# { -.annotate 'line', 9602 -# var found: $P2 - add $I5, __ARG_2, 1 - $P2 = $P1.'findclasskey'(__ARG_1, $I5) -.annotate 'line', 9603 - if_null $P2, __label_6 -.annotate 'line', 9604 - .return($P2) - __label_6: # endif -# } + .return($P1) __label_5: # endif - __label_1: # switch end - null $P3 -.annotate 'line', 9607 - .return($P3) -# } -.annotate 'line', 9608 + getattribute $P7, self, 'usednamespaces' + if_null $P7, __label_7 + iter $P8, $P7 + set $P8, 0 + __label_6: # for iteration + unless $P8 goto __label_7 + shift $P2, $P8 + $P1 = $P2.'checkclass_base'(__ARG_1) + if_null $P1, __label_8 + .return($P1) + __label_8: # endif + goto __label_6 + __label_7: # endfor + null $P7 + .return($P7) -.end # findclasskey_base +.end # checkclass_base + + +.sub '' :anon :subid('WSubId_24') :outer('WSubId_23') + .param pmc __ARG_2 + find_lex $S1, '__WLEX_1' + getattribute $P1, __ARG_2, 'name' + find_lex $S2, '__WLEX_1' + set $S3, $P1 + iseq $I1, $S3, $S2 + .return($I1) + +.end # WSubId_24 .sub 'findsymbolbyname' :method .param string __ARG_1 -# Body -# { -.annotate 'line', 9611 -# var sym: $P1 $P1 = self.'checkclass_base'(__ARG_1) -.annotate 'line', 9612 if_null $P1, __label_1 -.annotate 'line', 9613 .return($P1) __label_1: # endif -.annotate 'line', 9614 - getattribute $P2, self, 'functions' - if_null $P2, __label_3 - iter $P3, $P2 - set $P3, 0 - __label_2: # for iteration - unless $P3 goto __label_3 - shift $P1, $P3 -.annotate 'line', 9615 - getattribute $P4, $P1, 'name' - set $S1, $P4 - ne $S1, __ARG_1, __label_4 -.annotate 'line', 9616 + getattribute $P2, self, 'funcont' + $P1 = $P2.'find'(__ARG_1) + if_null $P1, __label_2 .return($P1) - __label_4: # endif - goto __label_2 - __label_3: # endfor - null $P2 -.annotate 'line', 9617 - .return($P2) -# } -.annotate 'line', 9618 + __label_2: # endif + $P1 = self.'getlocalvar'(__ARG_1) + if_null $P1, __label_3 + .return($P1) + __label_3: # endif + null $P3 + .return($P3) .end # findsymbolbyname -.sub 'findlocalsymbol' :method +.sub 'scopesearchlocal' :method .param pmc __ARG_1 .param int __ARG_2 -# Body -# { -.annotate 'line', 9623 -# nelems: $I1 -# predefined elements + .param int __ARG_3 elements $I1, __ARG_1 -.annotate 'line', 9624 -# name: $S1 null $S1 -.annotate 'line', 9625 -# var sym: $P1 null $P1 -.annotate 'line', 9626 -# var ns: $P2 null $P2 -# switch -.annotate 'line', 9627 - sub $I2, $I1, __ARG_2 - null $I3 - if $I2 == $I3 goto __label_3 - set $I3, 1 - if $I2 == $I3 goto __label_4 - goto __label_2 + sub $I2, $I1, __ARG_3 + if $I2 == 0 goto __label_3 + if $I2 == 1 goto __label_4 + goto __label_1 __label_3: # case - null $P3 -.annotate 'line', 9629 - .return($P3) + goto __label_2 # break __label_4: # case -.annotate 'line', 9631 sub $I4, $I1, 1 $S1 = __ARG_1[$I4] -.annotate 'line', 9633 + if __ARG_2 == 1 goto __label_7 + if __ARG_2 == 2 goto __label_8 + goto __label_5 + __label_7: # case + .tailcall self.'getlocalns'($S1) + __label_8: # case + .tailcall self.'checkclass_base'($S1) + __label_5: # default $P1 = self.'findsymbolbyname'($S1) - if_null $P1, __label_5 -.annotate 'line', 9634 + if_null $P1, __label_9 .return($P1) - __label_5: # endif -.annotate 'line', 9635 - getattribute $P4, self, 'usednamespaces' - if_null $P4, __label_7 - iter $P5, $P4 - set $P5, 0 - __label_6: # for iteration - unless $P5 goto __label_7 - shift $P2, $P5 -.annotate 'line', 9636 + __label_9: # endif + getattribute $P3, self, 'usednamespaces' + if_null $P3, __label_11 + iter $P4, $P3 + set $P4, 0 + __label_10: # for iteration + unless $P4 goto __label_11 + shift $P2, $P4 $P1 = $P2.'findsymbolbyname'($S1) - if_null $P1, __label_8 -.annotate 'line', 9637 + if_null $P1, __label_12 .return($P1) - __label_8: # endif - goto __label_6 - __label_7: # endfor - goto __label_1 # break - __label_2: # default -.annotate 'line', 9643 - $S1 = __ARG_1[__ARG_2] -.annotate 'line', 9644 + __label_12: # endif + goto __label_10 + __label_11: # endfor + __label_6: # switch end + goto __label_2 # break + __label_1: # default + $S1 = __ARG_1[__ARG_3] $P2 = self.'getlocalns'($S1) -.annotate 'line', 9645 - isnull $I5, $P2 - not $I5 - unless $I5 goto __label_10 -.annotate 'line', 9646 - add $I6, __ARG_2, 1 - $P1 = $P2.'findlocalsymbol'(__ARG_1, $I6) - isnull $I5, $P1 - not $I5 - __label_10: - unless $I5 goto __label_9 -.annotate 'line', 9647 + isnull $I6, $P2 + not $I6 + unless $I6 goto __label_14 + add $I7, __ARG_3, 1 + $P1 = $P2.'scopesearchlocal'(__ARG_1, __ARG_2, $I7) + isnull $I6, $P1 + not $I6 + __label_14: + unless $I6 goto __label_13 .return($P1) - __label_9: # endif -.annotate 'line', 9648 + __label_13: # endif $P2 = self.'getusedns'($S1) -.annotate 'line', 9649 - isnull $I7, $P2 - not $I7 - unless $I7 goto __label_12 -.annotate 'line', 9650 - add $I8, __ARG_2, 1 - $P1 = $P2.'findlocalsymbol'(__ARG_1, $I8) - isnull $I7, $P1 - not $I7 - __label_12: - unless $I7 goto __label_11 -.annotate 'line', 9651 + isnull $I8, $P2 + not $I8 + unless $I8 goto __label_16 + add $I9, __ARG_3, 1 + $P1 = $P2.'scopesearchlocal'(__ARG_1, __ARG_2, $I9) + isnull $I8, $P1 + not $I8 + __label_16: + unless $I8 goto __label_15 .return($P1) - __label_11: # endif - __label_1: # switch end + __label_15: # endif + __label_2: # switch end null $P3 -.annotate 'line', 9653 .return($P3) -# } -.annotate 'line', 9654 - -.end # findlocalsymbol - -.sub 'findlocalns' :method - .param pmc __ARG_1 - .param int __ARG_2 -# Body -# { -.annotate 'line', 9657 -# nelems: $I1 -# predefined elements - elements $I1, __ARG_1 -# switch -.annotate 'line', 9658 - sub $I2, $I1, __ARG_2 - null $I3 - if $I2 == $I3 goto __label_3 - goto __label_2 - __label_3: # case - null $P2 -.annotate 'line', 9660 - .return($P2) - __label_2: # default -.annotate 'line', 9662 -# name: $S1 - $S1 = __ARG_1[__ARG_2] -.annotate 'line', 9663 -# var ns: $P1 - $P1 = self.'getlocalns'($S1) -.annotate 'line', 9664 - if_null $P1, __label_4 -# { -.annotate 'line', 9665 - sub $I4, $I1, __ARG_2 - ne $I4, 1, __label_5 -.annotate 'line', 9666 - .return($P1) - goto __label_6 - __label_5: # else -.annotate 'line', 9668 - add $I5, __ARG_2, 1 - .tailcall $P1.'findlocalns'(__ARG_1, $I5) - __label_6: # endif -# } - __label_4: # endif - __label_1: # switch end - null $P2 -.annotate 'line', 9671 - .return($P2) -# } -.annotate 'line', 9672 - -.end # findlocalns +.end # scopesearchlocal .sub 'declarenamespace' :method .param pmc __ARG_1 .param string __ARG_2 -# Body -# { -.annotate 'line', 9675 -# var child: $P1 - new $P1, [ 'Winxed'; 'Compiler'; 'NamespaceStatement' ] - null $P2 - $P1.'NamespaceStatement'(self, __ARG_1, $P2, __ARG_2, $P2) -.annotate 'line', 9676 + new $P2, [ 'Winxed'; 'Compiler'; 'NamespaceStatement' ] + null $P3 + $P2.'NamespaceStatement'(self, __ARG_1, $P3, __ARG_2, $P3) + set $P1, $P2 getattribute $P2, self, 'namespaces' -# predefined push push $P2, $P1 -.annotate 'line', 9677 .return($P1) -# } -.annotate 'line', 9678 .end # declarenamespace @@ -28327,59 +23495,33 @@ .param pmc __ARG_1 .param string __ARG_2 .param pmc __ARG_3 -# Body -# { -.annotate 'line', 9681 -# var existns: $P1 $P1 = self.'getlocalns'(__ARG_2) -.annotate 'line', 9682 -# var child: $P2 - new $P2, [ 'Winxed'; 'Compiler'; 'NamespaceStatement' ] - $P2.'NamespaceStatement'(self, __ARG_1, $P1, __ARG_2, __ARG_3) -.annotate 'line', 9683 + new $P3, [ 'Winxed'; 'Compiler'; 'NamespaceStatement' ] + $P3.'NamespaceStatement'(self, __ARG_1, $P1, __ARG_2, __ARG_3) + set $P2, $P3 getattribute $P3, self, 'namespaces' -# predefined push push $P3, $P2 -.annotate 'line', 9684 getattribute $P3, self, 'items' -# predefined push push $P3, $P2 -.annotate 'line', 9685 .return($P2) -# } -.annotate 'line', 9686 .end # childnamespace .sub 'declareclass' :method .param pmc __ARG_1 -# Body -# { -.annotate 'line', 9689 getattribute $P1, self, 'classes' -# predefined push push $P1, __ARG_1 -# } -.annotate 'line', 9690 .end # declareclass .sub 'addclass' :method .param pmc __ARG_1 -# Body -# { -.annotate 'line', 9693 getattribute $P1, self, 'classes' -# predefined push push $P1, __ARG_1 -.annotate 'line', 9694 getattribute $P1, self, 'items' -# predefined push push $P1, __ARG_1 -# } -.annotate 'line', 9695 .end # addclass @@ -28387,346 +23529,266 @@ .sub 'parsenamespace' :method .param pmc __ARG_1 .param pmc __ARG_2 -.const 'Sub' WSubId_4 = "WSubId_4" -# Body -# { -.annotate 'line', 9698 -# var t: $P1 +.const 'Sub' WSubId_28 = "WSubId_28" $P1 = __ARG_2.'get'() -.annotate 'line', 9699 -# name: $S1 - set $P4, $P1 null $S1 - if_null $P4, __label_1 - set $S1, $P4 + if_null $P1, __label_1 + set $S1, $P1 __label_1: -.annotate 'line', 9700 $P1 = __ARG_2.'get'() -.annotate 'line', 9702 -# var modifier: $P2 - null $P2 -.annotate 'line', 9703 - $P4 = $P1.'isop'('[') - if_null $P4, __label_2 - unless $P4 goto __label_2 -# { -.annotate 'line', 9704 - new $P5, [ 'Winxed'; 'Compiler'; 'ModifierList' ] - $P5.'ModifierList'(__ARG_2, self) - set $P2, $P5 -.annotate 'line', 9705 + set $P2, self + __label_4: # for condition + $P5 = $P1.'isop'('.') + if_null $P5, __label_3 + unless $P5 goto __label_3 + null $P6 + $P2 = $P2.'childnamespace'(__ARG_1, $S1, $P6) + $P5 = __ARG_2.'get'() + set $S1, $P5 + __label_2: # for iteration $P1 = __ARG_2.'get'() -# } - __label_2: # endif -.annotate 'line', 9708 - WSubId_4('{', $P1) -.annotate 'line', 9709 -# var child: $P3 - $P3 = self.'childnamespace'(__ARG_1, $S1, $P2) -.annotate 'line', 9710 - $P3.'parse'(__ARG_2) -# } -.annotate 'line', 9711 + goto __label_4 + __label_3: # for end + null $P3 + $P5 = $P1.'isop'('[') + if_null $P5, __label_5 + unless $P5 goto __label_5 + new $P6, [ 'Winxed'; 'Compiler'; 'ModifierList' ] + $P6.'ModifierList'(__ARG_2, self) + set $P3, $P6 + $P1 = __ARG_2.'get'() + __label_5: # endif + WSubId_28('{', $P1) + $P4 = $P2.'childnamespace'(__ARG_1, $S1, $P3) + $P4.'parse'(__ARG_2) .end # parsenamespace +.sub 'parseextern' :method + .param pmc __ARG_1 +.const 'Sub' WSubId_25 = "WSubId_25" +.const 'Sub' WSubId_124 = "WSubId_124" +.const 'Sub' WSubId_84 = "WSubId_84" + $P1 = __ARG_1.'get'() + $P3 = $P1.'iskeyword'('function') + isfalse $I1, $P3 + unless $I1 goto __label_1 + WSubId_25('Unsupported extern', $P1) + __label_1: # endif + $P1 = __ARG_1.'get'() + WSubId_124($P1) + WSubId_84(';', __ARG_1) + new $P3, [ 'Winxed'; 'Compiler'; 'FunctionExtern' ] + $P3.'FunctionExtern'($P1, self) + set $P2, $P3 + self.'addfunction'($P2) + +.end # parseextern + + .sub 'parse' :method .param pmc __ARG_1 -.const 'Sub' WSubId_43 = "WSubId_43" -.const 'Sub' WSubId_111 = "WSubId_111" -.const 'Sub' WSubId_1 = "WSubId_1" -.const 'Sub' WSubId_93 = "WSubId_93" -.const 'Sub' WSubId_53 = "WSubId_53" -.const 'Sub' WSubId_112 = "WSubId_112" -.const 'Sub' WSubId_113 = "WSubId_113" -.const 'Sub' WSubId_114 = "WSubId_114" -.const 'Sub' WSubId_39 = "WSubId_39" -.const 'Sub' WSubId_40 = "WSubId_40" -# Body -# { -.annotate 'line', 9714 -# var items: $P1 +.const 'Sub' WSubId_74 = "WSubId_74" +.const 'Sub' WSubId_143 = "WSubId_143" +.const 'Sub' WSubId_144 = "WSubId_144" +.const 'Sub' WSubId_145 = "WSubId_145" +.const 'Sub' WSubId_146 = "WSubId_146" +.const 'Sub' WSubId_70 = "WSubId_70" +.const 'Sub' WSubId_84 = "WSubId_84" +.const 'Sub' WSubId_71 = "WSubId_71" getattribute $P1, self, 'items' -.annotate 'line', 9715 -# var functions: $P2 - getattribute $P2, self, 'functions' -.annotate 'line', 9716 -# var classes: $P3 - getattribute $P3, self, 'classes' -.annotate 'line', 9717 -# var t: $P4 - null $P4 -# for loop -.annotate 'line', 9718 - $P4 = __ARG_1.'get'() + null $P2 + $P2 = __ARG_1.'get'() __label_3: # for condition - $I2 = $P4.'iseof'() - if $I2 goto __label_4 - $I2 = $P4.'isop'('}') + $P6 = $P2.'iseof'() + if $P6 goto __label_4 + $P6 = $P2.'isop'('}') __label_4: - not $I1, $I2 + isfalse $I1, $P6 unless $I1 goto __label_2 -# { -# switch -.annotate 'line', 9720 - $P9 = $P4.'checkkeyword'() - set $S1, $P9 - set $S2, 'namespace' - if $S1 == $S2 goto __label_7 - set $S2, 'const' - if $S1 == $S2 goto __label_8 - set $S2, 'function' - if $S1 == $S2 goto __label_9 - set $S2, 'class' - if $S1 == $S2 goto __label_10 - set $S2, 'extern' - if $S1 == $S2 goto __label_11 - set $S2, 'using' - if $S1 == $S2 goto __label_12 - set $S2, '$include_const' - if $S1 == $S2 goto __label_13 - set $S2, '$include' - if $S1 == $S2 goto __label_14 - set $S2, '$load' - if $S1 == $S2 goto __label_15 - set $S2, '$loadlib' - if $S1 == $S2 goto __label_16 - goto __label_6 + $P7 = $P2.'checkkeyword'() + set $S1, $P7 + if $S1 == 'namespace' goto __label_7 + if $S1 == 'const' goto __label_8 + if $S1 == 'function' goto __label_9 + if $S1 == 'inline' goto __label_10 + if $S1 == 'class' goto __label_11 + if $S1 == 'extern' goto __label_12 + if $S1 == 'using' goto __label_13 + if $S1 == '$include_const' goto __label_14 + if $S1 == '$include' goto __label_15 + if $S1 == '$load' goto __label_16 + if $S1 == '$loadlib' goto __label_17 + goto __label_5 __label_7: # case -.annotate 'line', 9722 - self.'parsenamespace'($P4, __ARG_1) - goto __label_5 # break + self.'parsenamespace'($P2, __ARG_1) + goto __label_6 # break __label_8: # case -.annotate 'line', 9725 -# var cst: $P5 - $P5 = WSubId_43($P4, __ARG_1, self) -.annotate 'line', 9726 -# predefined push - push $P1, $P5 - goto __label_5 # break + $P3 = WSubId_74($P2, __ARG_1, self) + push $P1, $P3 + goto __label_6 # break __label_9: # case -.annotate 'line', 9729 -# var f: $P6 - new $P6, [ 'Winxed'; 'Compiler'; 'FunctionStatement' ] - $P6.'FunctionStatement'($P4, __ARG_1, self) -.annotate 'line', 9730 -# predefined push - push $P2, $P6 -.annotate 'line', 9731 -# predefined push - push $P1, $P6 - goto __label_5 # break + new $P8, [ 'Winxed'; 'Compiler'; 'FunctionStatement' ] + $P8.'FunctionStatement'($P2, __ARG_1, self) + set $P4, $P8 + self.'addfunction'($P4) + push $P1, $P4 + goto __label_6 # break __label_10: # case -.annotate 'line', 9734 - WSubId_111($P4, __ARG_1, self) - goto __label_5 # break + new $P9, [ 'Winxed'; 'Compiler'; 'InlineStatement' ] + $P9.'InlineStatement'($P2, __ARG_1, self) + set $P5, $P9 + self.'addfunction'($P5) + goto __label_6 # break __label_11: # case -.annotate 'line', 9737 -# var t1: $P7 - $P7 = __ARG_1.'get'() -.annotate 'line', 9738 - $P10 = $P7.'iskeyword'('function') - isfalse $I3, $P10 - unless $I3 goto __label_17 -.annotate 'line', 9739 - WSubId_1('Unsupported extern', $P7) - __label_17: # endif -.annotate 'line', 9740 - $P7 = __ARG_1.'get'() -.annotate 'line', 9741 - WSubId_93($P7) -.annotate 'line', 9742 - WSubId_53(';', __ARG_1) -.annotate 'line', 9743 -# var fex: $P8 - new $P8, [ 'Winxed'; 'Compiler'; 'FunctionExtern' ] - $P8.'FunctionExtern'($P7, self) -.annotate 'line', 9744 -# predefined push - push $P2, $P8 - goto __label_5 # break + WSubId_143($P2, __ARG_1, self) + goto __label_6 # break __label_12: # case -.annotate 'line', 9747 - WSubId_112($P4, __ARG_1, self) - goto __label_5 # break + self.'parseextern'(__ARG_1) + goto __label_6 # break __label_13: # case -.annotate 'line', 9750 - WSubId_113($P4, __ARG_1, self) - goto __label_5 # break + WSubId_144($P2, __ARG_1, self) + goto __label_6 # break __label_14: # case -.annotate 'line', 9753 - WSubId_114($P4, __ARG_1, self) - goto __label_5 # break + WSubId_145($P2, __ARG_1, self) + goto __label_6 # break __label_15: # case -.annotate 'line', 9756 - $P4 = __ARG_1.'get'() -.annotate 'line', 9757 - $P11 = $P4.'isstring'() - isfalse $I4, $P11 - unless $I4 goto __label_18 -.annotate 'line', 9758 - WSubId_39('string literal', $P4) - __label_18: # endif -.annotate 'line', 9759 - WSubId_53(';', __ARG_1) -.annotate 'line', 9760 - new $P14, [ 'Winxed'; 'Compiler'; 'StringLiteral' ] - $P14.'StringLiteral'(self, $P4) - set $P13, $P14 - $P12 = $P13.'getPirString'() - self.'addload'($P12) - goto __label_5 # break + WSubId_146($P2, __ARG_1, self) + goto __label_6 # break __label_16: # case -.annotate 'line', 9763 - $P4 = __ARG_1.'get'() -.annotate 'line', 9764 - $P15 = $P4.'isstring'() - isfalse $I5, $P15 - unless $I5 goto __label_19 -.annotate 'line', 9765 - WSubId_39('string literal', $P4) + $P2 = __ARG_1.'get'() + $P10 = $P2.'isstring'() + isfalse $I2, $P10 + unless $I2 goto __label_18 + WSubId_70('string literal', $P2) + __label_18: # endif + WSubId_84(';', __ARG_1) + new $P13, [ 'Winxed'; 'Compiler'; 'StringLiteral' ] + $P13.'StringLiteral'(self, $P2) + set $P12, $P13 + $P11 = $P12.'getPirString'() + self.'addload'($P11) + goto __label_6 # break + __label_17: # case + $P2 = __ARG_1.'get'() + $P14 = $P2.'isstring'() + isfalse $I3, $P14 + unless $I3 goto __label_19 + WSubId_70('string literal', $P2) __label_19: # endif -.annotate 'line', 9766 - WSubId_53(';', __ARG_1) -.annotate 'line', 9767 - new $P18, [ 'Winxed'; 'Compiler'; 'StringLiteral' ] - $P18.'StringLiteral'(self, $P4) - set $P17, $P18 - $P16 = $P17.'getPirString'() - self.'addlib'($P16) - goto __label_5 # break - __label_6: # default -.annotate 'line', 9770 - WSubId_40("token", $P4) - __label_5: # switch end -# } + WSubId_84(';', __ARG_1) + new $P17, [ 'Winxed'; 'Compiler'; 'StringLiteral' ] + $P17.'StringLiteral'(self, $P2) + set $P16, $P17 + $P15 = $P16.'getPirString'() + self.'addlib'($P15) + goto __label_6 # break + __label_5: # default + WSubId_71("token", $P2) + __label_6: # switch end __label_1: # for iteration -.annotate 'line', 9718 - $P4 = __ARG_1.'get'() + $P2 = __ARG_1.'get'() goto __label_3 __label_2: # for end -.annotate 'line', 9773 - $P9 = $P4.'iseof'() - if_null $P9, __label_20 - unless $P9 goto __label_20 -.annotate 'line', 9774 + $P6 = $P2.'iseof'() + if_null $P6, __label_20 + unless $P6 goto __label_20 self.'unclosed_ns'() goto __label_21 __label_20: # else -.annotate 'line', 9776 - self.'close_ns'($P4) + self.'close_ns'($P2) __label_21: # endif -# } -.annotate 'line', 9777 .end # parse .sub 'optimize_base' :method -.const 'Sub' WSubId_37 = "WSubId_37" -# Body -# { -.annotate 'line', 9780 getattribute $P1, self, 'items' - WSubId_37($P1) -# } -.annotate 'line', 9781 + if_null $P1, __label_3 + elements $I1, $P1 + goto __label_2 + __label_3: + null $I1 + __label_2: + null $I2 + __label_6: # for condition + ge $I2, $I1, __label_5 + $P3 = $P1[$I2] + $P2 = $P3.'optimize'() + $P1[$I2] = $P2 + __label_4: # for iteration + inc $I2 + goto __label_6 + __label_5: # for end + __label_1: .end # optimize_base .sub 'emit_base' :method .param pmc __ARG_1 -.const 'Sub' WSubId_109 = "WSubId_109" -.const 'Sub' WSubId_51 = "WSubId_51" -# Body -# { -.annotate 'line', 9784 -# var path: $P1 $P1 = self.'getpath'() -.annotate 'line', 9785 -# s: $S1 - $P4 = WSubId_109($P1) - null $S1 - if_null $P4, __label_1 - set $S1, $P4 - __label_1: -.annotate 'line', 9787 -# activate: $I1 set $I1, 1 -.annotate 'line', 9789 -# var externals: $P2 getattribute $P2, self, 'externals' -.annotate 'line', 9790 - if_null $P2, __label_2 -# { -.annotate 'line', 9791 - __ARG_1.'say'($S1) -.annotate 'line', 9792 + if_null $P2, __label_1 + $P1.'emitnamespace'(__ARG_1) null $I1 -.annotate 'line', 9793 - WSubId_51(__ARG_1, $P2) -# } - __label_2: # endif -.annotate 'line', 9796 - getattribute $P4, self, 'items' - if_null $P4, __label_4 - iter $P5, $P4 - set $P5, 0 - __label_3: # for iteration - unless $P5 goto __label_4 - shift $P3, $P5 -# { -.annotate 'line', 9797 + set $P4, __ARG_1 + set $P5, $P2 +.const 'Sub' WSubId_3 = "WSubId_3" +.const 'Sub' WSubId_5 = "WSubId_5" + set $P6, $P5 + $P9 = WSubId_5("emit") + $P7 = WSubId_3($P9, $P4) + if_null $P6, __label_5 + iter $P10, $P6 + set $P10, 0 + __label_4: # for iteration + unless $P10 goto __label_5 + shift $P8, $P10 + $P7($P8) + goto __label_4 + __label_5: # endfor + __label_3: + __label_2: + __label_1: # endif + getattribute $P9, self, 'items' + if_null $P9, __label_7 + iter $P11, $P9 + set $P11, 0 + __label_6: # for iteration + unless $P11 goto __label_7 + shift $P3, $P11 isa $I2, $P3, [ 'Winxed'; 'Compiler'; 'NamespaceStatement' ] - if $I2 goto __label_7 -.annotate 'line', 9798 + if $I2 goto __label_10 isa $I2, $P3, [ 'Winxed'; 'Compiler'; 'ClassStatement' ] - __label_7: - unless $I2 goto __label_5 -.annotate 'line', 9799 + __label_10: + unless $I2 goto __label_8 set $I1, 1 - goto __label_6 - __label_5: # else -.annotate 'line', 9801 - unless $I1 goto __label_8 -# { -.annotate 'line', 9802 - __ARG_1.'say'($S1) -.annotate 'line', 9803 + goto __label_9 + __label_8: # else + unless $I1 goto __label_11 + $P1.'emitnamespace'(__ARG_1) null $I1 -# } - __label_8: # endif - __label_6: # endif -.annotate 'line', 9805 + __label_11: # endif + __label_9: # endif $P3.'emit'(__ARG_1) -# } - goto __label_3 - __label_4: # endfor -# } -.annotate 'line', 9807 + goto __label_6 + __label_7: # endfor .end # emit_base .sub Winxed_class_init :anon :load :init newclass $P0, [ 'Winxed'; 'Compiler'; 'NamespaceBase' ] -.annotate 'line', 9478 get_class $P1, [ 'Winxed'; 'Compiler'; 'VarContainer' ] addparent $P0, $P1 -.annotate 'line', 9480 addattribute $P0, 'nspath' -.annotate 'line', 9481 addattribute $P0, 'externals' -.annotate 'line', 9482 addattribute $P0, 'namespaces' -.annotate 'line', 9483 addattribute $P0, 'classes' -.annotate 'line', 9484 - addattribute $P0, 'functions' -.annotate 'line', 9485 + addattribute $P0, 'funcont' addattribute $P0, 'items' -.annotate 'line', 9486 addattribute $P0, 'owner' .end .namespace [ 'Winxed'; 'Compiler'; 'NamespaceStatement' ] @@ -28737,692 +23799,382 @@ .param pmc __ARG_3 .param string __ARG_4 .param pmc __ARG_5 -# Body -# { -.annotate 'line', 9825 -# var nspath: $P1 - $P2 = __ARG_1.'getpath'() -# predefined clone - clone $P1, $P2 -.annotate 'line', 9826 -# predefined push - push $P1, __ARG_4 -.annotate 'line', 9827 - self.'NamespaceBase'($P1, __ARG_3) -.annotate 'line', 9829 - setattribute self, 'parent', __ARG_1 -.annotate 'line', 9830 - setattribute self, 'start', __ARG_2 -.annotate 'line', 9831 - setattribute self, 'owner', __ARG_1 -.annotate 'line', 9832 - box $P2, __ARG_4 - setattribute self, 'name', $P2 -.annotate 'line', 9833 setattribute self, 'modifier', __ARG_5 -.annotate 'line', 9834 + null $I1 if_null __ARG_5, __label_1 -# { -.annotate 'line', 9835 $P2 = __ARG_5.'pick'('HLL') if_null $P2, __label_2 -.annotate 'line', 9836 - getattribute $P4, self, 'name' - setattribute self, 'hll', $P4 + box $P3, __ARG_4 + setattribute self, 'hll', $P3 + set $I1, 1 __label_2: # endif -# } __label_1: # endif -# } -.annotate 'line', 9838 + unless $I1 goto __label_4 + new $P2, [ 'Winxed'; 'Compiler'; 'NamespacePath' ] + $P2.'NamespacePath'(__ARG_4, 1) + set $P1, $P2 + goto __label_3 + __label_4: + $P4 = __ARG_1.'getpath'() + $P3 = $P4.'createchild'(__ARG_4) + set $P1, $P3 + __label_3: + self.'NamespaceBase'($P1, __ARG_3) + setattribute self, 'parent', __ARG_1 + setattribute self, 'start', __ARG_2 + setattribute self, 'owner', __ARG_1 + box $P2, __ARG_4 + setattribute self, 'name', $P2 .end # NamespaceStatement .sub 'dowarnings' :method -# Body -# { -.annotate 'line', 9841 getattribute $P1, self, 'parent' .tailcall $P1.'dowarnings'() -# } -.annotate 'line', 9842 .end # dowarnings .sub 'generatesubid' :method -# Body -# { -.annotate 'line', 9845 getattribute $P1, self, 'owner' .tailcall $P1.'generatesubid'() -# } -.annotate 'line', 9846 .end # generatesubid -.sub 'use_predef' :method +.sub 'use_builtin' :method .param string __ARG_1 -# Body -# { -.annotate 'line', 9849 getattribute $P1, self, 'owner' - $P1.'use_predef'(__ARG_1) -# } -.annotate 'line', 9850 + $P1.'use_builtin'(__ARG_1) -.end # use_predef +.end # use_builtin .sub 'addlib' :method .param string __ARG_1 -# Body -# { -.annotate 'line', 9853 getattribute $P1, self, 'parent' $P1.'addlib'(__ARG_1) -# } -.annotate 'line', 9854 .end # addlib .sub 'addload' :method .param string __ARG_1 -# Body -# { -.annotate 'line', 9857 getattribute $P1, self, 'parent' $P1.'addload'(__ARG_1) -# } -.annotate 'line', 9858 .end # addload .sub 'checkclass' :method .param string __ARG_1 -# Body -# { -.annotate 'line', 9861 -# var cl: $P1 $P1 = self.'checkclass_base'(__ARG_1) -.annotate 'line', 9862 unless_null $P1, __label_1 -.annotate 'line', 9863 getattribute $P2, self, 'parent' .tailcall $P2.'checkclass'(__ARG_1) __label_1: # endif -.annotate 'line', 9864 .return($P1) -# } -.annotate 'line', 9865 .end # checkclass -.sub 'findclasskey' :method - .param pmc __ARG_1 - .param int __ARG_2 :optional -# Body -# { -.annotate 'line', 9870 -# var cl: $P1 - $P1 = self.'findclasskey_base'(__ARG_1, __ARG_2) -.annotate 'line', 9871 - isnull $I1, $P1 - unless $I1 goto __label_2 - iseq $I1, __ARG_2, 0 - __label_2: - unless $I1 goto __label_1 -.annotate 'line', 9872 - getattribute $P2, self, 'parent' - .tailcall $P2.'findclasskey'(__ARG_1, __ARG_2) - __label_1: # endif -.annotate 'line', 9873 - .return($P1) -# } -.annotate 'line', 9874 - -.end # findclasskey - - -.sub 'findsymbol' :method - .param pmc __ARG_1 - .param int __ARG_2 :optional -# Body -# { -.annotate 'line', 9877 -# var sym: $P1 - $P1 = self.'findlocalsymbol'(__ARG_1, __ARG_2) -.annotate 'line', 9878 - isnull $I1, $P1 - unless $I1 goto __label_2 - isle $I1, __ARG_2, 0 - __label_2: - unless $I1 goto __label_1 -.annotate 'line', 9879 - getattribute $P2, self, 'parent' - .tailcall $P2.'findsymbol'(__ARG_1, __ARG_2) - __label_1: # endif -.annotate 'line', 9880 - .return($P1) -# } -.annotate 'line', 9881 - -.end # findsymbol - - -.sub 'findns' :method +.sub 'scopesearch' :method .param pmc __ARG_1 - .param int __ARG_2 :optional -# Body -# { -.annotate 'line', 9884 -# var ns: $P1 - $P1 = self.'findlocalns'(__ARG_1, __ARG_2) -.annotate 'line', 9885 + .param int __ARG_2 + .param int __ARG_3 :optional + $P1 = self.'scopesearchlocal'(__ARG_1, __ARG_2, __ARG_3) isnull $I1, $P1 unless $I1 goto __label_2 - isle $I1, __ARG_2, 0 + isle $I1, __ARG_3, 0 __label_2: unless $I1 goto __label_1 -.annotate 'line', 9886 getattribute $P2, self, 'parent' - .tailcall $P2.'findns'(__ARG_1, __ARG_2) + .tailcall $P2.'scopesearch'(__ARG_1, __ARG_2, __ARG_3) __label_1: # endif -.annotate 'line', 9887 .return($P1) -# } -.annotate 'line', 9888 -.end # findns +.end # scopesearch .sub 'unclosed_ns' :method -.const 'Sub' WSubId_1 = "WSubId_1" -# Body -# { -.annotate 'line', 9891 +.const 'Sub' WSubId_25 = "WSubId_25" getattribute $P1, self, 'start' - WSubId_1('unclosed namespace', $P1) -# } -.annotate 'line', 9892 + WSubId_25('unclosed namespace', $P1) .end # unclosed_ns .sub 'close_ns' :method .param pmc __ARG_1 -# Empty body .end # close_ns .sub 'optimize' :method -# Body -# { -.annotate 'line', 9899 -# var modifier: $P1 getattribute $P1, self, 'modifier' -.annotate 'line', 9900 if_null $P1, __label_1 -.annotate 'line', 9901 $P3 = $P1.'optimize'() setattribute self, 'modifier', $P3 __label_1: # endif -.annotate 'line', 9902 self.'optimize_base'() -.annotate 'line', 9903 .return(self) -# } -.annotate 'line', 9904 .end # optimize .sub 'emit' :method .param pmc __ARG_1 -# Body -# { -.annotate 'line', 9907 -# var hll: $P1 +.const 'Sub' WSubId_45 = "WSubId_45" getattribute $P1, self, 'hll' -.annotate 'line', 9908 if_null $P1, __label_1 -.annotate 'line', 9909 - __ARG_1.'say'(".HLL '", $P1, "'") + $P2 = WSubId_45(".HLL '%0'", $P1) + __ARG_1.'say'($P2) __label_1: # endif -.annotate 'line', 9911 self.'emit_base'(__ARG_1) -.annotate 'line', 9913 if_null $P1, __label_2 -.annotate 'line', 9914 __ARG_1.'say'(".HLL 'parrot'") __label_2: # endif -# } -.annotate 'line', 9915 .end # emit .sub Winxed_class_init :anon :load :init newclass $P0, [ 'Winxed'; 'Compiler'; 'NamespaceStatement' ] -.annotate 'line', 9814 get_class $P1, [ 'Winxed'; 'Compiler'; 'NamespaceBase' ] addparent $P0, $P1 -.annotate 'line', 9816 addattribute $P0, 'parent' -.annotate 'line', 9817 addattribute $P0, 'start' -.annotate 'line', 9818 addattribute $P0, 'name' -.annotate 'line', 9819 addattribute $P0, 'modifier' -.annotate 'line', 9820 addattribute $P0, 'hll' .end .namespace [ 'Winxed'; 'Compiler'; 'RootNamespace' ] .sub 'RootNamespace' :method .param pmc __ARG_1 -# Body -# { -.annotate 'line', 9932 - new $P1, ['ResizableStringArray'] -.annotate 'line', 9933 + new $P1, [ 'Winxed'; 'Compiler'; 'NamespacePath' ] + $P1.'NamespacePath'() + set $P1, $P1 null $P2 self.'NamespaceBase'($P1, $P2) -.annotate 'line', 9934 setattribute self, 'unit', __ARG_1 -.annotate 'line', 9935 - root_new $P3, ['parrot';'Hash'] - setattribute self, 'predefs_used', $P3 -.annotate 'line', 9936 - box $P2, 0 - setattribute self, 'subidgen', $P2 -# } -.annotate 'line', 9937 + root_new $P2, ['parrot';'Hash'] + setattribute self, 'bultins_used', $P2 + box $P1, 0 + setattribute self, 'subidgen', $P1 .end # RootNamespace -.sub 'use_predef' :method +.sub 'use_builtin' :method .param string __ARG_1 -# Body -# { -.annotate 'line', 9940 -# var predefs_used: $P1 - getattribute $P1, self, 'predefs_used' -.annotate 'line', 9941 + getattribute $P1, self, 'bultins_used' $P1[__ARG_1] = 1 -# } -.annotate 'line', 9942 - -.end # use_predef - -.sub 'predef_is_used' :method - .param string __ARG_1 -# Body -# { -.annotate 'line', 9945 -# var predefs_used: $P1 - getattribute $P1, self, 'predefs_used' -.annotate 'line', 9946 - $P2 = $P1[__ARG_1] - unless_null $P2, __label_2 - null $I1 - goto __label_1 - __label_2: - set $I1, 1 - __label_1: - .return($I1) -# } -.annotate 'line', 9947 - -.end # predef_is_used +.end # use_builtin .sub 'generatesubid' :method -# Body -# { -.annotate 'line', 9951 -# idgen: $I1 - getattribute $P2, self, 'subidgen' - inc $P2 - set $P1, $P2 + getattribute $P1, self, 'subidgen' + inc $P1 set $I1, $P1 -# predefined string -.annotate 'line', 9952 set $S1, $I1 concat $S2, 'WSubId_', $S1 .return($S2) -# } -.annotate 'line', 9953 .end # generatesubid .sub 'addlib' :method .param string __ARG_1 -# Body -# { -.annotate 'line', 9957 -# var libs: $P1 getattribute $P1, self, 'libs' -.annotate 'line', 9958 unless_null $P1, __label_1 -.annotate 'line', 9959 root_new $P1, ['parrot';'Hash'] setattribute self, 'libs', $P1 __label_1: # endif -.annotate 'line', 9960 $P1[__ARG_1] = 1 -# } -.annotate 'line', 9961 .end # addlib .sub 'addload' :method .param string __ARG_1 -# Body -# { -.annotate 'line', 9964 -# var loads: $P1 getattribute $P1, self, 'loads' -.annotate 'line', 9965 unless_null $P1, __label_1 -.annotate 'line', 9966 root_new $P1, ['parrot';'Hash'] setattribute self, 'loads', $P1 __label_1: # endif -.annotate 'line', 9967 $P1[__ARG_1] = 1 -# } -.annotate 'line', 9968 .end # addload .sub 'checkclass' :method .param string __ARG_1 -# Body -# { -.annotate 'line', 9971 .tailcall self.'checkclass_base'(__ARG_1) -# } -.annotate 'line', 9972 .end # checkclass -.sub 'findclasskey' :method - .param pmc __ARG_1 - .param int __ARG_2 :optional -# Body -# { -.annotate 'line', 9976 - .tailcall self.'findclasskey_base'(__ARG_1, __ARG_2) -# } -.annotate 'line', 9977 - -.end # findclasskey - - -.sub 'findsymbol' :method - .param pmc __ARG_1 - .param int __ARG_2 :optional -# Body -# { -.annotate 'line', 9980 - .tailcall self.'findlocalsymbol'(__ARG_1, __ARG_2) -# } -.annotate 'line', 9981 - -.end # findsymbol - - -.sub 'findns' :method +.sub 'scopesearch' :method .param pmc __ARG_1 - .param int __ARG_2 :optional -# Body -# { -.annotate 'line', 9984 - .tailcall self.'findlocalns'(__ARG_1, __ARG_2) -# } -.annotate 'line', 9985 + .param int __ARG_2 + .param int __ARG_3 :optional + .tailcall self.'scopesearchlocal'(__ARG_1, __ARG_2, __ARG_3) -.end # findns +.end # scopesearch .sub 'unclosed_ns' :method -# Empty body .end # unclosed_ns .sub 'close_ns' :method .param pmc __ARG_1 -.const 'Sub' WSubId_1 = "WSubId_1" -# Body -# { -.annotate 'line', 9992 - WSubId_1('Cannot close root namespace', __ARG_1) -# } -.annotate 'line', 9993 +.const 'Sub' WSubId_25 = "WSubId_25" + WSubId_25('Cannot close root namespace', __ARG_1) .end # close_ns .sub 'dowarnings' :method -# Body -# { -.annotate 'line', 9996 getattribute $P1, self, 'unit' .tailcall $P1.'dowarnings'() -# } -.annotate 'line', 9997 .end # dowarnings .sub 'optimize' :method -# Body -# { -.annotate 'line', 10000 self.'optimize_base'() -.annotate 'line', 10001 .return(self) -# } -.annotate 'line', 10002 .end # optimize .sub 'emit' :method .param pmc __ARG_1 -# Body -# { -.annotate 'line', 10005 -# var predefs_used: $P1 - getattribute $P1, self, 'predefs_used' -.annotate 'line', 10008 - $P5 = $P1['chomp'] - if_null $P5, __label_1 -.annotate 'line', 10009 +.const 'Sub' WSubId_9 = "WSubId_9" +.const 'Sub' WSubId_45 = "WSubId_45" + getattribute $P1, self, 'bultins_used' + $P12 = $P1['chomp'] + if_null $P12, __label_1 self.'addload'('"String/Utils.pbc"') __label_1: # endif -.annotate 'line', 10012 - new $P2, ['ResizableStringArray'] - set $P2, 9 - set $S4, 'acos' - $P2[0] = $S4 - set $S4, 'asin' - $P2[1] = $S4 - set $S4, 'atan' - $P2[2] = $S4 - set $S4, 'cos' - $P2[3] = $S4 - set $S4, 'exp' - $P2[4] = $S4 - set $S4, 'ln' - $P2[5] = $S4 - set $S4, 'sin' - $P2[6] = $S4 - set $S4, 'tan' - $P2[7] = $S4 - set $S4, 'pow' - $P2[8] = $S4 -.annotate 'line', 10015 - if_null $P2, __label_3 - iter $P6, $P2 - set $P6, 0 + split $P12, " ", "acos asin atan cos exp ln sin tan pow sinh cosh tanh" + if_null $P12, __label_3 + iter $P13, $P12 + set $P13, 0 __label_2: # for iteration - unless $P6 goto __label_3 - shift $S1, $P6 -.annotate 'line', 10016 - $P5 = $P1[$S1] - if_null $P5, __label_4 -# { -.annotate 'line', 10017 + unless $P13 goto __label_3 + shift $S1, $P13 + $P14 = $P1[$S1] + if_null $P14, __label_4 self.'addlib'("'trans_ops'") goto __label_3 # break -.annotate 'line', 10018 -# } __label_4: # endif goto __label_2 __label_3: # endfor -.annotate 'line', 10021 -# somelib: $I1 - null $I1 -.annotate 'line', 10022 -# var libs: $P3 - getattribute $P3, self, 'libs' -.annotate 'line', 10023 - if_null $P3, __label_5 -# { -.annotate 'line', 10024 - set $I1, 1 -.annotate 'line', 10025 - if_null $P3, __label_7 - iter $P7, $P3 - set $P7, 0 - __label_6: # for iteration - unless $P7 goto __label_7 - shift $S2, $P7 -.annotate 'line', 10026 - __ARG_1.'say'('.loadlib ', $S2) + getattribute $P2, self, 'libs' + if_null $P2, __label_5 + set $P4, $P2 + root_new $P5, ['parrot';'ResizablePMCArray'] + $P6 = WSubId_9(".loadlib ") + if_null $P4, __label_8 + iter $P16, $P4 + set $P16, 0 + __label_7: # for iteration + unless $P16 goto __label_8 + shift $P7, $P16 + $P12 = $P6($P7) + push $P5, $P12 + goto __label_7 + __label_8: # endfor + set $P15, $P5 goto __label_6 - __label_7: # endfor -# } + __label_6: + set $P12, $P15 + join $S2, "\n", $P12 + __ARG_1.'say'($S2) __label_5: # endif -.annotate 'line', 10029 -# someload: $I2 - null $I2 -.annotate 'line', 10030 -# var loads: $P4 - getattribute $P4, self, 'loads' -.annotate 'line', 10031 - if_null $P4, __label_8 -# { -.annotate 'line', 10032 - set $I2, 1 -.annotate 'line', 10033 - __ARG_1.'print'("\n.sub initial_load_bytecode :anon :load :init\n") -.annotate 'line', 10034 - if_null $P4, __label_10 - iter $P8, $P4 - set $P8, 0 - __label_9: # for iteration - unless $P8 goto __label_10 - shift $S3, $P8 -.annotate 'line', 10035 - __ARG_1.'say'(' load_bytecode ', $S3) - goto __label_9 - __label_10: # endfor -.annotate 'line', 10036 - __ARG_1.'print'(".end\n\n") -# } - __label_8: # endif -.annotate 'line', 10038 - or $I3, $I1, $I2 - unless $I3 goto __label_11 -.annotate 'line', 10039 + getattribute $P3, self, 'loads' + if_null $P3, __label_9 + set $P8, $P3 + root_new $P9, ['parrot';'ResizablePMCArray'] + $P10 = WSubId_9(' load_bytecode ') + if_null $P8, __label_12 + iter $P18, $P8 + set $P18, 0 + __label_11: # for iteration + unless $P18 goto __label_12 + shift $P11, $P18 + $P14 = $P10($P11) + push $P9, $P14 + goto __label_11 + __label_12: # endfor + set $P17, $P9 + goto __label_10 + __label_10: + set $P12, $P17 + join $S2, "\n", $P12 + $P12 = WSubId_45(".sub initial_load_bytecode :anon :load :init\n%0\n.end\n", $S2) + __ARG_1.'say'($P12) + __label_9: # endif + isnull $I1, $P2 + not $I1 + if $I1 goto __label_14 + isnull $I1, $P3 + not $I1 + __label_14: + unless $I1 goto __label_13 __ARG_1.'comment'('end libs') - __label_11: # endif -.annotate 'line', 10041 + __label_13: # endif self.'emit_base'(__ARG_1) -# } -.annotate 'line', 10042 .end # emit .sub 'emitinclude' :method .param pmc __ARG_1 -# Body -# { -.annotate 'line', 10045 -# var locals: $P1 getattribute $P1, self, 'locals' -.annotate 'line', 10046 if_null $P1, __label_2 iter $P4, $P1 set $P4, 0 __label_1: # for iteration unless $P4 goto __label_2 shift $S1, $P4 -# { -.annotate 'line', 10047 -# var data: $P2 $P2 = $P1[$S1] -.annotate 'line', 10048 isa $I2, $P2, [ 'Winxed'; 'Compiler'; 'VarData' ] not $I1, $I2 if $I1 goto __label_5 -.annotate 'line', 10049 $P5 = $P2.'gettype'() set $S2, $P5 isne $I1, $S2, 'I' __label_5: if $I1 goto __label_4 -.annotate 'line', 10050 - $I3 = $P2.'getflags'() + $P6 = $P2.'getflags'() + set $I3, $P6 band $I1, $I3, 4 __label_4: unless $I1 goto __label_3 goto __label_1 # continue __label_3: # endif -.annotate 'line', 10052 -# var value: $P3 $P3 = $P2.'getvalue'() -.annotate 'line', 10053 $P5 = $P3.'getIntegerValue'() __ARG_1.'say'('.macro_const ', $S1, ' ', $P5) -# } goto __label_1 __label_2: # endfor -# } -.annotate 'line', 10055 .end # emitinclude .sub Winxed_class_init :anon :load :init newclass $P0, [ 'Winxed'; 'Compiler'; 'RootNamespace' ] -.annotate 'line', 9922 get_class $P1, [ 'Winxed'; 'Compiler'; 'NamespaceBase' ] addparent $P0, $P1 -.annotate 'line', 9924 addattribute $P0, 'unit' -.annotate 'line', 9925 - addattribute $P0, 'predefs_used' -.annotate 'line', 9926 + addattribute $P0, 'bultins_used' addattribute $P0, 'libs' -.annotate 'line', 9927 addattribute $P0, 'loads' -.annotate 'line', 9928 addattribute $P0, 'subidgen' .end .namespace [ 'Winxed'; 'Compiler'; 'Builtin' ] @@ -29430,314 +24182,197 @@ .sub 'Builtin' :method .param string __ARG_1 .param pmc __ARG_2 -# Body -# { -.annotate 'line', 10067 box $P1, __ARG_1 setattribute self, 'name', $P1 -.annotate 'line', 10068 root_new $P2, ['parrot';'ResizablePMCArray'] - push $P2, __ARG_2 + assign $P2, 1 + $P2[0] = __ARG_2 setattribute self, 'variants', $P2 -# } -.annotate 'line', 10069 .end # Builtin .sub 'getname' :method -# Body -# { -# predefined string -.annotate 'line', 10070 getattribute $P1, self, 'name' set $S1, $P1 .return($S1) -# } .end # getname .sub 'addvariant' :method .param pmc __ARG_1 -# Body -# { -.annotate 'line', 10073 getattribute $P1, self, 'variants' -# predefined push push $P1, __ARG_1 -# } -.annotate 'line', 10074 .end # addvariant .sub Winxed_class_init :anon :load :init newclass $P0, [ 'Winxed'; 'Compiler'; 'Builtin' ] -.annotate 'line', 10063 addattribute $P0, 'name' -.annotate 'line', 10064 addattribute $P0, 'variants' .end .namespace [ 'Winxed'; 'Compiler' ] -# Constant EVAL_NAME evaluated at compile time .namespace [ 'Winxed'; 'Compiler'; 'BuiltinBuilder' ] .sub 'BuiltinBuilder' :method -# Body -# { -.annotate 'line', 10084 root_new $P2, ['parrot';'Hash'] setattribute self, 'entries', $P2 -# } -.annotate 'line', 10085 .end # BuiltinBuilder .sub 'add' :method .param pmc __ARG_1 -# Body -# { -.annotate 'line', 10088 -# var entries: $P1 getattribute $P1, self, 'entries' -.annotate 'line', 10089 -# name: $S1 getattribute $P2, __ARG_1, 'name' null $S1 if_null $P2, __label_1 set $S1, $P2 __label_1: -.annotate 'line', 10090 $P2 = $P1[$S1] if_null $P2, __label_2 -.annotate 'line', 10091 $P3 = $P1[$S1] $P3.'addvariant'(__ARG_1) goto __label_3 __label_2: # else -.annotate 'line', 10093 new $P5, [ 'Winxed'; 'Compiler'; 'Builtin' ] $P5.'Builtin'($S1, __ARG_1) set $P4, $P5 $P1[$S1] = $P4 __label_3: # endif -# } -.annotate 'line', 10094 .end # add .sub 'put' :method .param pmc __ARG_1 -# Body -# { -.annotate 'line', 10097 -# var entries: $P1 getattribute $P1, self, 'entries' -.annotate 'line', 10098 if_null $P1, __label_2 iter $P2, $P1 set $P2, 0 __label_1: # for iteration unless $P2 goto __label_2 shift $S1, $P2 -.annotate 'line', 10099 - getattribute $P3, __ARG_1, 'functions' - $P4 = $P1[$S1] -# predefined push - push $P3, $P4 + $P3 = $P1[$S1] + __ARG_1.'addfunction'($P3) goto __label_1 __label_2: # endfor -# } -.annotate 'line', 10100 .end # put .sub Winxed_class_init :anon :load :init newclass $P0, [ 'Winxed'; 'Compiler'; 'BuiltinBuilder' ] -.annotate 'line', 10081 addattribute $P0, 'entries' .end .namespace [ 'Winxed'; 'Compiler'; 'WinxedCompileUnit' ] .sub 'WinxedCompileUnit' :method .param int __ARG_1 -.const 'Sub' WSubId_115 = "WSubId_115" -.const 'Sub' WSubId_107 = "WSubId_107" -.const 'Sub' WSubId_116 = "WSubId_116" -# Body -# { -.annotate 'line', 10110 + .param int __ARG_2 +.const 'Sub' WSubId_147 = "WSubId_147" +.const 'Sub' WSubId_140 = "WSubId_140" +.const 'Sub' WSubId_148 = "WSubId_148" not $I1, __ARG_1 box $P4, $I1 setattribute self, 'warnings', $P4 -.annotate 'line', 10111 -# var rootns: $P1 - new $P1, [ 'Winxed'; 'Compiler'; 'RootNamespace' ] - $P1.'RootNamespace'(self) -.annotate 'line', 10115 - WSubId_115($P1, 'false', 0) -.annotate 'line', 10116 - WSubId_115($P1, 'true', 1) -.annotate 'line', 10121 -# predefined string -# predefined int -.annotate 'line', 10122 - set $I2, "2" - add $I1, $I2, 1 - set $S1, $I1 -.annotate 'line', 10121 - WSubId_107($P1, '__STAGE__', $S1) -.annotate 'line', 10125 - WSubId_115($P1, '__WINXED_ERROR__', 567) -.annotate 'line', 10128 -# var builtins_ns: $P2 + new $P4, [ 'Winxed'; 'Compiler'; 'RootNamespace' ] + $P4.'RootNamespace'(self) + set $P1, $P4 + WSubId_147($P1, 'false', 0) + WSubId_147($P1, 'true', 1) + WSubId_140($P1, '__STAGE__', "4") + WSubId_147($P1, '__DEBUG__', __ARG_2) + WSubId_147($P1, '__WINXED_ERROR__', 567) new $P5, [ 'Winxed'; 'Compiler'; 'TokenEof' ] $P5.'TokenEof'('__builtins__') set $P4, $P5 null $P6 $P2 = $P1.'childnamespace'($P4, "Winxed_Builtins", $P6) -.annotate 'line', 10130 -# var builder: $P3 new $P3, [ 'Winxed'; 'Compiler'; 'BuiltinBuilder' ] $P3.'BuiltinBuilder'() -.annotate 'line', 10131 - WSubId_116($P3) -.annotate 'line', 10132 + set $P3, $P3 + WSubId_148($P3) $P3.'put'($P2) -.annotate 'line', 10134 $P1.'usenamespace'($P2) -.annotate 'line', 10136 setattribute self, 'rootns', $P1 -# } -.annotate 'line', 10137 .end # WinxedCompileUnit .sub 'dowarnings' :method -# Body -# { -# predefined int -.annotate 'line', 10140 getattribute $P1, self, 'warnings' set $I1, $P1 .return($I1) -# } -.annotate 'line', 10141 .end # dowarnings .sub 'parse' :method .param pmc __ARG_1 -# Body -# { -.annotate 'line', 10144 getattribute $P1, self, 'rootns' $P1.'parse'(__ARG_1) -.annotate 'line', 10145 getattribute $P1, self, 'rootns' $P1.'fixnamespaces'() -# } -.annotate 'line', 10146 .end # parse .sub 'optimize' :method -# Body -# { -.annotate 'line', 10149 getattribute $P3, self, 'rootns' $P2 = $P3.'optimize'() setattribute self, 'rootns', $P2 -# } -.annotate 'line', 10150 .end # optimize .sub 'emit' :method .param pmc __ARG_1 -# Body -# { -.annotate 'line', 10153 __ARG_1.'comment'('THIS IS A GENERATED FILE! DO NOT EDIT!') -.annotate 'line', 10154 __ARG_1.'comment'('Begin generated code') -.annotate 'line', 10155 __ARG_1.'say'('') -.annotate 'line', 10157 getattribute $P1, self, 'rootns' $P1.'emit'(__ARG_1) -.annotate 'line', 10159 __ARG_1.'comment'('End generated code') -# } -.annotate 'line', 10160 .end # emit .sub 'emitinclude' :method .param pmc __ARG_1 -# Body -# { -.annotate 'line', 10163 __ARG_1.'comment'('DO NOT EDIT THIS FILE') -.annotate 'line', 10164 __ARG_1.'comment'('Generated automatically from Winxed sources') -.annotate 'line', 10166 getattribute $P1, self, 'rootns' $P1.'emitinclude'(__ARG_1) -.annotate 'line', 10168 __ARG_1.'comment'('End') -# } -.annotate 'line', 10169 .end # emitinclude .sub Winxed_class_init :anon :load :init newclass $P0, [ 'Winxed'; 'Compiler'; 'WinxedCompileUnit' ] -.annotate 'line', 10105 addattribute $P0, 'rootns' -.annotate 'line', 10106 addattribute $P0, 'warnings' .end .namespace [ 'Winxed'; 'Compiler'; 'WinxedHLL' ] .sub 'version' :method -# Body -# { -.annotate 'line', 10178 new $P1, ['FixedIntegerArray'], 3 set $I1, 1 $P1[0] = $I1 - set $I1, 1 + set $I1, 8 $P1[1] = $I1 set $I1, -1 $P1[2] = $I1 -.annotate 'line', 10179 .return($P1) -# } -.annotate 'line', 10180 .end # version .sub 'version_string' :method -# Body -# { -# predefined string -.annotate 'line', 10183 $P1 = self.'version'() -# predefined join join $S1, ".", $P1 concat $S2, "Winxed ", $S1 .return($S2) -# } -.annotate 'line', 10184 .end # version_string @@ -29746,131 +24381,92 @@ .param pmc __ARG_1 .param pmc __ARG_2 .param pmc __ARG_3 - .param pmc __ARG_4 -# Body -# { -.annotate 'line', 10187 + .param string __ARG_4 + .param int __ARG_5 + .param int __ARG_6 + .param int __ARG_7 set $S2, __ARG_2 ne $S2, 'parse', __label_1 -.annotate 'line', 10188 .return(__ARG_1) __label_1: # endif -.annotate 'line', 10189 -# var handleout: $P1 null $P1 -.annotate 'line', 10190 unless_null __ARG_3, __label_2 -# { -.annotate 'line', 10191 new $P1, [ 'StringHandle' ] -.annotate 'line', 10192 $P1.'open'('__eval__', 'w') -# } goto __label_3 __label_2: # else -.annotate 'line', 10195 set $P1, __ARG_3 __label_3: # endif -.annotate 'line', 10196 -# var emit: $P2 - new $P2, [ 'Winxed'; 'Compiler'; 'Emit' ] - $P2.'Emit'($P1) -.annotate 'line', 10197 - if_null __ARG_4, __label_4 - unless __ARG_4 goto __label_4 -.annotate 'line', 10198 - $P2.'disable_annotations'() + new $P5, [ 'Winxed'; 'Compiler'; 'Emit' ] + $P5.'Emit'($P1, __ARG_7) + set $P2, $P5 + unless __ARG_5 goto __label_4 + $P2.'setDebug'() __label_4: # endif -.annotate 'line', 10199 + unless __ARG_6 goto __label_5 + $P2.'disable_annotations'() + __label_5: # endif __ARG_1.'emit'($P2) -.annotate 'line', 10200 $P2.'close'() -.annotate 'line', 10201 - if_null __ARG_3, __label_5 -.annotate 'line', 10202 + if_null __ARG_3, __label_6 .return(__ARG_3) - goto __label_6 - __label_5: # else -# { -.annotate 'line', 10204 + goto __label_7 + __label_6: # else $P1.'close'() -.annotate 'line', 10205 -# pircode: $S1 $P5 = $P1.'read'(0) null $S1 - if_null $P5, __label_7 + if_null $P5, __label_8 set $S1, $P5 - __label_7: -.annotate 'line', 10206 -# var object: $P3 + __label_8: null $P3 -# switch -.annotate 'line', 10207 set $S2, __ARG_2 - set $S3, 'pir' - if $S2 == $S3 goto __label_10 - set $S3, 'pbc' - if $S2 == $S3 goto __label_11 - set $S3, '' - if $S2 == $S3 goto __label_12 + if $S2 == 'pir' goto __label_11 + if $S2 == 'pbc' goto __label_12 + if $S2 == '' goto __label_13 goto __label_9 - __label_10: # case -.annotate 'line', 10209 + __label_11: # case new $P3, [ 'String' ] -.annotate 'line', 10210 assign $P3, $S1 - goto __label_8 # break - __label_11: # case + goto __label_10 # break __label_12: # case -.annotate 'line', 10214 -# var pircomp: $P4 -# predefined compreg + __label_13: # case compreg $P4, 'PIR' -.annotate 'line', 10215 - $P3 = $P4($S1) - goto __label_8 # break + $P3 = $P4.'compile'($S1) + goto __label_10 # break __label_9: # default -.annotate 'line', 10216 -# predefined string -.annotate 'line', 10218 set $S4, __ARG_2 concat $S5, 'Invalid target: ', $S4 -# predefined die die $S5 - __label_8: # switch end -.annotate 'line', 10220 + __label_10: # switch end .return($P3) -# } - __label_6: # endif -# } -.annotate 'line', 10222 + __label_7: # endif .end # __private_compile_tail .sub '__private_geninclude' :method .param pmc __ARG_1 -# Body -# { -.annotate 'line', 10225 -# var handleout: $P1 + .param pmc __ARG_2 + null $P1 + unless_null __ARG_2, __label_1 new $P1, [ 'StringHandle' ] -.annotate 'line', 10226 $P1.'open'('__eval__', 'w') -.annotate 'line', 10227 -# var emit: $P2 - new $P2, [ 'Winxed'; 'Compiler'; 'Emit' ] - $P2.'Emit'($P1) -.annotate 'line', 10228 + goto __label_2 + __label_1: # else + set $P1, __ARG_2 + __label_2: # endif + new $P3, [ 'Winxed'; 'Compiler'; 'Emit' ] + $P3.'Emit'($P1, 1) + set $P2, $P3 __ARG_1.'emitinclude'($P2) -.annotate 'line', 10229 $P2.'close'() -.annotate 'line', 10230 + if_null __ARG_2, __label_3 + .return(__ARG_2) + goto __label_4 + __label_3: # else $P1.'close'() -.annotate 'line', 10231 .tailcall $P1.'read'(0) -# } -.annotate 'line', 10232 + __label_4: # endif .end # __private_geninclude @@ -29879,51 +24475,32 @@ .param string __ARG_1 .param string __ARG_2 :optional :named('target') .param pmc __ARG_3 :optional :named('output') - .param int __ARG_4 :optional :named('noan') - .param int __ARG_5 :optional :named('nowarn') -# Body -# { -.annotate 'line', 10239 + .param int __ARG_4 :optional :named('debug') + .param int __ARG_5 :optional :named('noan') + .param int __ARG_6 :optional :named('nowarn') unless_null __ARG_2, __label_1 -.annotate 'line', 10240 set __ARG_2, '' __label_1: # endif -.annotate 'line', 10241 -# var handlein: $P1 new $P1, [ 'StringHandle' ] -.annotate 'line', 10242 $P1.'open'('__eval__', 'w') -.annotate 'line', 10243 $P1.'puts'(__ARG_1) -.annotate 'line', 10244 $P1.'close'() -.annotate 'line', 10245 $P1.'open'('__eval__', 'r') -.annotate 'line', 10246 -# var tk: $P2 - new $P2, [ 'Winxed'; 'Compiler'; 'Tokenizer' ] - $P2.'Tokenizer'($P1, '__eval__') -.annotate 'line', 10247 -# var winxed: $P3 - new $P3, [ 'Winxed'; 'Compiler'; 'WinxedCompileUnit' ] - $P3.'WinxedCompileUnit'(__ARG_5) -.annotate 'line', 10248 + new $P4, [ 'Winxed'; 'Compiler'; 'Tokenizer' ] + $P4.'Tokenizer'($P1, '__eval__', __ARG_6) + set $P2, $P4 + new $P4, [ 'Winxed'; 'Compiler'; 'WinxedCompileUnit' ] + $P4.'WinxedCompileUnit'(__ARG_6, __ARG_4) + set $P3, $P4 $P3.'parse'($P2) -.annotate 'line', 10249 $P1.'close'() -.annotate 'line', 10250 $P3.'optimize'() -.annotate 'line', 10251 ne __ARG_2, 'include', __label_2 -.annotate 'line', 10252 - .tailcall self.'__private_geninclude'($P3) + .tailcall self.'__private_geninclude'($P3, __ARG_3) goto __label_3 __label_2: # else -.annotate 'line', 10254 - .tailcall self.'__private_compile_tail'($P3, __ARG_2, __ARG_3, __ARG_4) + .tailcall self.'__private_compile_tail'($P3, __ARG_2, __ARG_3, '__eval__', __ARG_4, __ARG_5, __ARG_6) __label_3: # endif -# } -.annotate 'line', 10255 .end # compile @@ -29932,47 +24509,30 @@ .param string __ARG_1 .param string __ARG_2 :optional :named('target') .param pmc __ARG_3 :optional :named('output') - .param int __ARG_4 :optional :named('noan') - .param int __ARG_5 :optional :named('nowarn') -# Body -# { -.annotate 'line', 10263 + .param int __ARG_4 :optional :named('debug') + .param int __ARG_5 :optional :named('noan') + .param int __ARG_6 :optional :named('nowarn') unless_null __ARG_2, __label_1 -.annotate 'line', 10264 set __ARG_2, '' __label_1: # endif -.annotate 'line', 10265 -# var handlein: $P1 new $P1, [ 'FileHandle' ] -.annotate 'line', 10266 $P1.'open'(__ARG_1, 'r') -.annotate 'line', 10267 $P1.'encoding'('utf8') -.annotate 'line', 10268 -# var tk: $P2 - new $P2, [ 'Winxed'; 'Compiler'; 'Tokenizer' ] - $P2.'Tokenizer'($P1, __ARG_1) -.annotate 'line', 10269 -# var winxed: $P3 - new $P3, [ 'Winxed'; 'Compiler'; 'WinxedCompileUnit' ] - $P3.'WinxedCompileUnit'(__ARG_5) -.annotate 'line', 10270 + new $P4, [ 'Winxed'; 'Compiler'; 'Tokenizer' ] + $P4.'Tokenizer'($P1, __ARG_1, __ARG_6) + set $P2, $P4 + new $P4, [ 'Winxed'; 'Compiler'; 'WinxedCompileUnit' ] + $P4.'WinxedCompileUnit'(__ARG_6, __ARG_4) + set $P3, $P4 $P3.'parse'($P2) -.annotate 'line', 10271 $P1.'close'() -.annotate 'line', 10272 $P3.'optimize'() -.annotate 'line', 10273 ne __ARG_2, 'include', __label_2 -.annotate 'line', 10274 - .tailcall self.'__private_geninclude'($P3) + .tailcall self.'__private_geninclude'($P3, __ARG_3) goto __label_3 __label_2: # else -.annotate 'line', 10276 - .tailcall self.'__private_compile_tail'($P3, __ARG_2, __ARG_3, __ARG_4) + .tailcall self.'__private_compile_tail'($P3, __ARG_2, __ARG_3, __ARG_1, __ARG_4, __ARG_5, __ARG_6) __label_3: # endif -# } -.annotate 'line', 10277 .end # compile_from_file @@ -29982,16 +24542,8 @@ .namespace [ 'Winxed'; 'Compiler' ] .sub 'initializer' :init :load -# Body -# { -.annotate 'line', 10286 -# var comp: $P1 new $P1, [ 'Winxed'; 'Compiler'; 'WinxedHLL' ] -.annotate 'line', 10287 -# predefined compreg compreg 'winxed', $P1 -# } -.annotate 'line', 10288 .end # initializer diff --git a/ext/winxed/driver.pir b/ext/winxed/driver.pir index db41a65344..6b67fc95e7 100644 --- a/ext/winxed/driver.pir +++ b/ext/winxed/driver.pir @@ -1,196 +1,130 @@ # THIS IS A GENERATED FILE! DO NOT EDIT! # Begin generated code - .sub initial_load_bytecode :anon :load :init load_bytecode 'Getopt/Obj.pbc' .end # end libs -.namespace [ ] -# Constant DEBUG evaluated at compile time .namespace [ 'WinxedDriverOptions' ] .sub 'WinxedDriverOptions' :method .param pmc __ARG_1 -# Body -# { -.annotate 'file', 'winxed_installed.winxed' -.annotate 'line', 21 -# var options: $P1 root_new $P1, ['parrot';'ResizablePMCArray'] -.annotate 'line', 22 + assign $P1, 12 + root_new $P3, ['parrot';'ResizablePMCArray'] + assign $P3, 2 + $P3[0] = 'c' + $P3[1] = 'Compile to pir' + $P1[0] = $P3 root_new $P4, ['parrot';'ResizablePMCArray'] - box $P5, 'c' - push $P4, $P5 - box $P5, 'Compile to pir' - push $P4, $P5 -.annotate 'line', 21 - push $P1, $P4 -.annotate 'line', 23 + assign $P4, 2 + $P4[0] = 'e=s' + $P4[1] = 'Evaluate' + $P1[1] = $P4 + root_new $P5, ['parrot';'ResizablePMCArray'] + assign $P5, 2 + $P5[0] = 'o=s' + $P5[1] = 'Object name' + $P1[2] = $P5 root_new $P6, ['parrot';'ResizablePMCArray'] - box $P7, 'e=s' - push $P6, $P7 - box $P7, 'Evaluate' - push $P6, $P7 -.annotate 'line', 21 - push $P1, $P6 -.annotate 'line', 24 + assign $P6, 2 + $P6[0] = 'target=s' + $P6[1] = 'Set target type' + $P1[3] = $P6 + root_new $P7, ['parrot';'ResizablePMCArray'] + assign $P7, 2 + $P7[0] = 'L=s' + $P7[1] = 'Add to parrot library search path' + $P1[4] = $P7 root_new $P8, ['parrot';'ResizablePMCArray'] - box $P9, 'o=s' - push $P8, $P9 - box $P9, 'Object name' - push $P8, $P9 -.annotate 'line', 21 - push $P1, $P8 -.annotate 'line', 25 + assign $P8, 2 + $P8[0] = 'I=s' + $P8[1] = 'Add to parrot include search path' + $P1[5] = $P8 + root_new $P9, ['parrot';'ResizablePMCArray'] + assign $P9, 2 + $P9[0] = 'X=s' + $P9[1] = 'Add to parrot dynext search path' + $P1[6] = $P9 root_new $P10, ['parrot';'ResizablePMCArray'] - box $P11, 'target=s' - push $P10, $P11 - box $P11, 'Set target type' - push $P10, $P11 -.annotate 'line', 21 - push $P1, $P10 -.annotate 'line', 26 + assign $P10, 2 + $P10[0] = 'debug' + $P10[1] = 'Set debug mode' + $P1[7] = $P10 + root_new $P11, ['parrot';'ResizablePMCArray'] + assign $P11, 2 + $P11[0] = 'nowarn' + $P11[1] = 'No warnings' + $P1[8] = $P11 root_new $P12, ['parrot';'ResizablePMCArray'] - box $P13, 'L=s' - push $P12, $P13 - box $P13, 'Add to parrot library search path' - push $P12, $P13 -.annotate 'line', 21 - push $P1, $P12 -.annotate 'line', 27 + assign $P12, 2 + $P12[0] = 'noan' + $P12[1] = 'No code annotations' + $P1[9] = $P12 + root_new $P13, ['parrot';'ResizablePMCArray'] + assign $P13, 2 + $P13[0] = 'help' + $P13[1] = 'Show this help' + $P1[10] = $P13 root_new $P14, ['parrot';'ResizablePMCArray'] - box $P15, 'I=s' - push $P14, $P15 - box $P15, 'Add to parrot include search path' - push $P14, $P15 -.annotate 'line', 21 - push $P1, $P14 -.annotate 'line', 28 - root_new $P16, ['parrot';'ResizablePMCArray'] - box $P17, 'nowarn' - push $P16, $P17 - box $P17, 'No warnings' - push $P16, $P17 -.annotate 'line', 21 - push $P1, $P16 -.annotate 'line', 29 - root_new $P18, ['parrot';'ResizablePMCArray'] - box $P19, 'noan' - push $P18, $P19 - box $P19, 'No code annotations' - push $P18, $P19 -.annotate 'line', 21 - push $P1, $P18 -.annotate 'line', 30 - root_new $P20, ['parrot';'ResizablePMCArray'] - box $P21, 'help' - push $P20, $P21 - box $P21, 'Show this help' - push $P20, $P21 -.annotate 'line', 21 - push $P1, $P20 -.annotate 'line', 31 - root_new $P22, ['parrot';'ResizablePMCArray'] - box $P23, 'version' - push $P22, $P23 - box $P23, 'Show version and exit' - push $P22, $P23 -.annotate 'line', 21 - push $P1, $P22 -.annotate 'line', 33 + assign $P14, 2 + $P14[0] = 'version' + $P14[1] = 'Show version and exit' + $P1[11] = $P14 setattribute self, 'options', $P1 -.annotate 'line', 34 if_null $P1, __label_2 - iter $P24, $P1 - set $P24, 0 + iter $P15, $P1 + set $P15, 0 __label_1: # for iteration - unless $P24 goto __label_2 - shift $P2, $P24 -.annotate 'line', 35 + unless $P15 goto __label_2 + shift $P2, $P15 $P3 = $P2[0] self.'push_string'($P3) goto __label_1 __label_2: # endfor -.annotate 'line', 36 self.'notOptStop'(1) -.annotate 'line', 37 $P4 = __ARG_1.'shift'() setattribute self, 'name', $P4 -.annotate 'line', 38 $P4 = self.'get_options'(__ARG_1) setattribute self, 'opts', $P4 -# } -.annotate 'line', 39 .end # WinxedDriverOptions .sub 'getbool' :method .param string __ARG_1 -# Body -# { -.annotate 'line', 42 -# var value: $P1 getattribute $P2, self, 'opts' $P1 = $P2[__ARG_1] -.annotate 'line', 43 isnull $I1, $P1 not $I1 .return($I1) -# } -.annotate 'line', 44 .end # getbool .sub 'getstring' :method .param string __ARG_1 -# Body -# { -.annotate 'line', 47 -# var value: $P1 getattribute $P2, self, 'opts' $P1 = $P2[__ARG_1] -.annotate 'line', 48 -# result: $S1 null $S1 -.annotate 'line', 49 if_null $P1, __label_1 -.annotate 'line', 50 set $S1, $P1 __label_1: # endif -.annotate 'line', 51 .return($S1) -# } -.annotate 'line', 52 .end # getstring .sub 'showhelp' :method -# Body -# { -.annotate 'line', 55 getattribute $P2, self, 'name' -# predefined say print 'Usage: ' print $P2 say ' [options] [program] [args]' -# predefined say -.annotate 'line', 56 say ' Available options:' -.annotate 'line', 57 -# l: $I1 null $I1 -.annotate 'line', 58 -# i: $I2 null $I2 -.annotate 'line', 59 -# var o: $P1 null $P1 -.annotate 'line', 60 getattribute $P2, self, 'options' if_null $P2, __label_2 iter $P3, $P2 @@ -198,21 +132,15 @@ __label_1: # for iteration unless $P3 goto __label_2 shift $P1, $P3 -# { -.annotate 'line', 61 $P4 = $P1[0] set $S2, $P4 -# predefined length length $I3, $S2 add $I2, $I3, 4 -.annotate 'line', 62 le $I2, $I1, __label_3 set $I1, $I2 __label_3: # endif -# } goto __label_1 __label_2: # endfor -.annotate 'line', 64 getattribute $P2, self, 'options' if_null $P2, __label_5 iter $P5, $P2 @@ -220,653 +148,433 @@ __label_4: # for iteration unless $P5 goto __label_5 shift $P1, $P5 -# { -.annotate 'line', 65 -# s: $S1 $S1 = $P1[0] -.annotate 'line', 66 -# predefined length length $I4, $S1 isgt $I3, $I4, 1 unless $I3 goto __label_8 -# predefined substr substr $S2, $S1, 1, 1 isne $I3, $S2, '=' __label_8: unless $I3 goto __label_6 -.annotate 'line', 67 - concat $S1, '--', $S1 + concat $S3, '--', $S1 + set $S1, $S3 goto __label_7 __label_6: # else -.annotate 'line', 69 - concat $S1, '-', $S1 + concat $S4, '-', $S1 + set $S1, $S4 __label_7: # endif -.annotate 'line', 70 -# predefined length length $I3, $S1 sub $I2, $I1, $I3 -.annotate 'line', 71 repeat $S2, ' ', $I2 $P2 = $P1[1] -# predefined say print ' ' print $S1 print $S2 print '-> ' say $P2 -# } goto __label_4 __label_5: # endfor -# } -.annotate 'line', 73 .end # showhelp .sub Winxed_class_init :anon :load :init newclass $P0, [ 'WinxedDriverOptions' ] -.annotate 'line', 13 get_class $P1, [ 'Getopt'; 'Obj' ] addparent $P0, $P1 -.annotate 'line', 15 addattribute $P0, 'name' -.annotate 'line', 16 addattribute $P0, 'options' -.annotate 'line', 17 addattribute $P0, 'opts' .end .namespace [ ] -.sub 'extname' :subid('WSubId_2') +.sub 'path_option' :subid('WSubId_2') + .param pmc __ARG_1 + .param string __ARG_2 + .param int __ARG_3 + $P3 = __ARG_1.'getstring'(__ARG_2) + null $S1 + if_null $P3, __label_1 + set $S1, $P3 + __label_1: + if_null $S1, __label_2 + getinterp $P3 + $P1 = $P3[9] + $P2 = $P1[__ARG_3] + $P2.'push'($S1) + __label_2: # endif + +.end # path_option + + +.sub 'extname' :subid('WSubId_3') :anon .param string __ARG_1 .param string __ARG_2 -# Body -# { -.annotate 'line', 81 -# newname: $S1 null $S1 -.annotate 'line', 82 -# l: $I1 -# predefined length length $I1, __ARG_1 -.annotate 'line', 83 isgt $I2, $I1, 7 unless $I2 goto __label_3 -# predefined substr substr $S2, __ARG_1, -7 iseq $I2, $S2, '.winxed' __label_3: unless $I2 goto __label_1 -.annotate 'line', 84 sub $I3, $I1, 7 -# predefined substr substr $S3, __ARG_1, 0, $I3 - concat $S1, $S3, __ARG_2 + concat $S4, $S3, __ARG_2 + set $S1, $S4 goto __label_2 __label_1: # else -.annotate 'line', 86 - concat $S1, __ARG_1, __ARG_2 + concat $S5, __ARG_1, __ARG_2 + set $S1, $S5 __label_2: # endif -.annotate 'line', 87 .return($S1) -# } -.annotate 'line', 88 .end # extname -.sub 'getcompiler' :subid('WSubId_1') -# Body -# { -.annotate 'line', 92 -# var compiler: $P1 +.sub 'getcompiler' :subid('WSubId_1') :anon null $P1 -.annotate 'line', 93 -# try: create handler new $P2, 'ExceptionHandler' set_label $P2, __label_1 push_eh $P2 -# try: begin -.annotate 'line', 94 -# predefined load_language load_language 'winxed' compreg $P1, 'winxed' -# try: end pop_eh goto __label_2 -.annotate 'line', 93 -# catch __label_1: .get_results($P3) finalize $P3 pop_eh -# catch end __label_2: -.annotate 'line', 96 unless_null $P1, __label_3 -# { -# predefined die -.annotate 'line', 104 die "winxed: Cannot load language" -# } __label_3: # endif -.annotate 'line', 106 .return($P1) -# } -.annotate 'line', 107 .end # getcompiler -.sub 'main' :main +.sub 'process_args' :subid('WSubId_4') :anon .param pmc __ARG_1 .const 'Sub' WSubId_1 = "WSubId_1" .const 'Sub' WSubId_2 = "WSubId_2" -# Body -# { -.annotate 'line', 111 -# var optionset: $P1 - new $P1, [ 'WinxedDriverOptions' ] - $P1.'WinxedDriverOptions'(__ARG_1) -.annotate 'line', 113 - $P20 = $P1.'getbool'('version') - if_null $P20, __label_1 - unless $P20 goto __label_1 -# { -.annotate 'line', 114 -# var compiler: $P2 +.const 'Sub' WSubId_3 = "WSubId_3" + new $P13, [ 'WinxedDriverOptions' ] + $P13.'WinxedDriverOptions'(__ARG_1) + set $P1, $P13 + $P13 = $P1.'getbool'('version') + if_null $P13, __label_1 + unless $P13 goto __label_1 $P2 = WSubId_1() -.annotate 'line', 115 - $P20 = $P2.'version_string'() -# predefined say - say $P20 -# predefined exit -.annotate 'line', 116 + $P13 = $P2.'version_string'() + say $P13 exit 0 -# } __label_1: # endif -.annotate 'line', 119 -# help: $I1 - $P20 = $P1.'getbool'('help') - set $I1, $P20 -.annotate 'line', 120 -# compileonly: $I2 - $P20 = $P1.'getbool'('c') - set $I2, $P20 -.annotate 'line', 121 -# target: $S1 - $P20 = $P1.'getstring'('target') + $P13 = $P1.'getbool'('help') + set $I1, $P13 + $P13 = $P1.'getbool'('c') + set $I2, $P13 + $P13 = $P1.'getstring'('target') null $S1 - if_null $P20, __label_2 - set $S1, $P20 + if_null $P13, __label_2 + set $S1, $P13 __label_2: -.annotate 'line', 122 -# eval: $S2 - $P20 = $P1.'getstring'('e') + $P13 = $P1.'getstring'('e') null $S2 - if_null $P20, __label_3 - set $S2, $P20 + if_null $P13, __label_3 + set $S2, $P13 __label_3: -.annotate 'line', 123 -# objectname: $S3 - $P20 = $P1.'getstring'('o') + $P13 = $P1.'getstring'('o') null $S3 - if_null $P20, __label_4 - set $S3, $P20 + if_null $P13, __label_4 + set $S3, $P13 __label_4: -.annotate 'line', 124 -# opt_L: $S4 - $P20 = $P1.'getstring'('L') - null $S4 - if_null $P20, __label_5 - set $S4, $P20 - __label_5: -.annotate 'line', 125 -# opt_I: $S5 - $P20 = $P1.'getstring'('I') - null $S5 - if_null $P20, __label_6 - set $S5, $P20 - __label_6: -.annotate 'line', 126 -# nowarn: $I3 - $P20 = $P1.'getbool'('nowarn') - set $I3, $P20 -.annotate 'line', 127 -# noan: $I4 - $P20 = $P1.'getbool'('noan') - set $I4, $P20 -.annotate 'line', 129 - unless $I1 goto __label_7 -# { -.annotate 'line', 130 + $P13 = $P1.'getbool'('debug') + set $I3, $P13 + $P13 = $P1.'getbool'('nowarn') + set $I4, $P13 + $P13 = $P1.'getbool'('noan') + set $I5, $P13 + unless $I1 goto __label_5 $P1.'showhelp'() -# predefined exit -.annotate 'line', 131 exit 0 -# } - __label_7: # endif -.annotate 'line', 134 - if_null $S4, __label_8 -# { -.annotate 'line', 135 -# var interp: $P3 - null $P3 -.annotate 'line', 136 -# pirop getinterp - getinterp $P3 -.annotate 'line', 137 -# var lpaths: $P4 - $P4 = $P3[9] -.annotate 'line', 138 -# var pathlib: $P5 - $P5 = $P4[1] -.annotate 'line', 139 -# predefined string - set $S10, $S4 - $P5.'push'($S10) -# } - __label_8: # endif -.annotate 'line', 141 - if_null $S5, __label_9 -# { -.annotate 'line', 142 -# var interp: $P6 - null $P6 -.annotate 'line', 143 -# pirop getinterp - getinterp $P6 -.annotate 'line', 144 -# var lpaths: $P7 - $P7 = $P6[9] -.annotate 'line', 145 -# var pathlib: $P8 - $P8 = $P7[0] -.annotate 'line', 146 -# predefined string - set $S10, $S5 - $P8.'push'($S10) -# } - __label_9: # endif -.annotate 'line', 149 -# var compileoptions: $P9 - root_new $P9, ['parrot';'Hash'] - box $P20, $I4 - $P9["noan"] = $P20 - box $P21, $I3 - $P9["nowarn"] = $P21 -.annotate 'line', 150 - unless $I2 goto __label_10 -# { -.annotate 'line', 151 - if_null $S1, __label_12 -# predefined die -.annotate 'line', 152 + __label_5: # endif + WSubId_2($P1, 'L', 1) + WSubId_2($P1, 'I', 0) + WSubId_2($P1, 'X', 2) + root_new $P3, ['parrot';'Hash'] + $P3["debug"] = $I3 + $P3["noan"] = $I5 + $P3["nowarn"] = $I4 + unless $I2 goto __label_6 + if_null $S1, __label_8 die "options -c and --target can't be used together" - __label_12: # endif -.annotate 'line', 153 - $P9["target"] = "pir" -# } - goto __label_11 - __label_10: # else -# { -.annotate 'line', 156 - unless_null $S1, __label_13 -.annotate 'line', 157 + __label_8: # endif + $P3["target"] = "pir" + goto __label_7 + __label_6: # else + unless_null $S1, __label_9 set $S1, '' - __label_13: # endif -# switch -.annotate 'line', 158 - set $S10, $S1 - set $S11, '' - if $S10 == $S11 goto __label_16 - set $S11, 'run' - if $S10 == $S11 goto __label_17 - set $S11, 'pir' - if $S10 == $S11 goto __label_18 - set $S11, 'include' - if $S10 == $S11 goto __label_19 - goto __label_15 - __label_16: # case - __label_17: # case - goto __label_14 # break - __label_18: # case - __label_19: # case -.annotate 'line', 164 + __label_9: # endif + if $S1 == '' goto __label_12 + if $S1 == 'run' goto __label_13 + if $S1 == 'pir' goto __label_14 + if $S1 == 'include' goto __label_15 + goto __label_10 + __label_12: # case + __label_13: # case + goto __label_11 # break + __label_14: # case + __label_15: # case set $I2, 1 -.annotate 'line', 165 - $P9["target"] = $S1 - goto __label_14 # break - __label_15: # default -.annotate 'line', 168 - concat $S12, "Invalid target '", $S1 - concat $S12, $S12, "'" -# predefined die - die $S12 - __label_14: # switch end -# } - __label_11: # endif -.annotate 'line', 172 - isnull $I8, $S3 - not $I8 - unless $I8 goto __label_21 - not $I8, $I2 - __label_21: - unless $I8 goto __label_20 -# predefined die -.annotate 'line', 173 + $P3["target"] = $S1 + goto __label_11 # break + __label_10: # default + concat $S8, "Invalid target '", $S1 + concat $S8, $S8, "'" + die $S8 + __label_11: # switch end + __label_7: # endif + isnull $I7, $S3 + not $I7 + unless $I7 goto __label_17 + not $I7, $I2 + __label_17: + unless $I7 goto __label_16 die '-o without -c or --target is not supported yet' - __label_20: # endif -.annotate 'line', 175 -# var compiler: $P10 - $P10 = WSubId_1() -.annotate 'line', 177 -# var code: $P11 - null $P11 -.annotate 'line', 178 -# outfilename: $S6 - null $S6 -.annotate 'line', 179 -# try: create handler - new $P20, 'ExceptionHandler' - set_label $P20, __label_22 - $P20.'handle_types'(567) - push_eh $P20 -# try: begin -# { -.annotate 'line', 180 - unless_null $S2, __label_24 -# { -.annotate 'line', 181 -# predefined elements - elements $I8, __ARG_1 - ge $I8, 1, __label_26 -# { -# predefined say -.annotate 'line', 182 + __label_16: # endif + $P4 = WSubId_1() + null $P5 + null $S4 + new $P13, 'ExceptionHandler' + set_label $P13, __label_18 + $P13.'handle_types'(567) + push_eh $P13 + unless_null $S2, __label_20 + elements $I7, __ARG_1 + ge $I7, 1, __label_22 say "ERROR: No program specified" -.annotate 'line', 183 $P1.'showhelp'() -# predefined exit -.annotate 'line', 184 exit 1 -# } + __label_22: # endif + $S5 = __ARG_1[0] + set $I7, $I2 + unless $I7 goto __label_24 + isnull $I7, $S3 + __label_24: + unless $I7 goto __label_23 + $P13 = WSubId_3($S5, '.pir') + set $S4, $P13 + __label_23: # endif + $P5 = $P4.'compile_from_file'($S5, $P3 :flat :named) + goto __label_21 + __label_20: # else + null $P6 + null $P7 + unless $I2 goto __label_25 + unless_null $S4, __label_26 + set $S4, $S3 __label_26: # endif -.annotate 'line', 186 -# srcfilename: $S7 - $S7 = __ARG_1[0] -.annotate 'line', 187 - set $I8, $I2 - unless $I8 goto __label_28 - isnull $I8, $S3 - __label_28: - unless $I8 goto __label_27 -.annotate 'line', 188 - $P20 = WSubId_2($S7, '.pir') - set $S6, $P20 - __label_27: # endif -.annotate 'line', 189 - $P11 = $P10.'compile_from_file'($S7, $P9 :flat :named) -# } - goto __label_25 - __label_24: # else -# { -.annotate 'line', 193 -# var output: $P12 - null $P12 -.annotate 'line', 194 -# var outfile: $P13 - null $P13 -.annotate 'line', 195 - unless $I2 goto __label_29 -# { -.annotate 'line', 196 - unless_null $S6, __label_30 -.annotate 'line', 197 - set $S6, $S3 - __label_30: # endif -.annotate 'line', 198 - isnull $I8, $S6 - not $I8 - unless $I8 goto __label_33 - isne $I8, $S6, "-" - __label_33: - unless $I8 goto __label_31 -# { -.annotate 'line', 199 -# predefined open - root_new $P13, ['parrot';'FileHandle'] - $P13.'open'($S6,'w') -.annotate 'line', 200 - set $P12, $P13 -# } - goto __label_32 - __label_31: # else -.annotate 'line', 203 -# predefined getstdout - getstdout $P12 + isnull $I7, $S4 + not $I7 + unless $I7 goto __label_29 + isne $I7, $S4, "-" + __label_29: + unless $I7 goto __label_27 + root_new $P7, ['parrot';'FileHandle'] + $P7.'open'($S4,'w') + set $P6, $P7 + goto __label_28 + __label_27: # else + getstdout $P6 + __label_28: # endif + $P3['output'] = $P6 + __label_25: # endif + concat $S6, 'function main[main](argv){', $S2 + concat $S6, $S6, ';}' + $P5 = $P4.'compile'($S6, $P3 :flat :named) + unless $I2 goto __label_30 + if_null $P7, __label_32 + $P7.'close'() __label_32: # endif -.annotate 'line', 204 - $P9['output'] = $P12 -# } - __label_29: # endif -.annotate 'line', 206 -# expr: $S8 - concat $S8, 'function main[main](argv){', $S2 - concat $S8, $S8, ';}' -.annotate 'line', 207 - $P11 = $P10.'compile'($S8, $P9 :flat :named) -.annotate 'line', 209 - unless $I2 goto __label_34 -# { -.annotate 'line', 210 - if_null $P13, __label_36 -.annotate 'line', 211 - $P13.'close'() - __label_36: # endif -# predefined exit -.annotate 'line', 212 exit 0 -# } - goto __label_35 - __label_34: # else -.annotate 'line', 215 + goto __label_31 + __label_30: # else __ARG_1.'unshift'('__EVAL__') - __label_35: # endif -# } - __label_25: # endif -# } -# try: end + __label_31: # endif + __label_21: # endif pop_eh - goto __label_23 -.annotate 'line', 179 -# catch - __label_22: - .get_results($P14) - finalize $P14 + goto __label_19 + __label_18: + .get_results($P8) + finalize $P8 pop_eh -# { -.annotate 'line', 219 -# var payload: $P15 - $P15 = $P14["payload"] -.annotate 'line', 220 - if_null $P15, __label_37 -.annotate 'line', 221 - getattribute $P20, $P15, 'filename' - getattribute $P21, $P15, 'line' - getattribute $P22, $P15, 'message' -# predefined cry + $P9 = $P8["payload"] + if_null $P9, __label_33 + getattribute $P13, $P9, 'filename' + getattribute $P14, $P9, 'line' + getattribute $P15, $P9, 'message' getstderr $P0 - print $P0, $P20 + print $P0, $P13 print $P0, ':' - print $P0, $P21 + print $P0, $P14 print $P0, ': ' - print $P0, $P22 + print $P0, $P15 print $P0, "\n" - goto __label_38 - __label_37: # else -.annotate 'line', 223 - $P23 = $P14["message"] -# predefined cry + + goto __label_34 + __label_33: # else + $P16 = $P8["message"] getstderr $P0 - print $P0, $P23 + print $P0, $P16 print $P0, "\n" - __label_38: # endif -# predefined exit -.annotate 'line', 224 + + __label_34: # endif exit 1 -# } -# catch end - __label_23: -.annotate 'line', 227 - unless $I2 goto __label_39 -# { -.annotate 'line', 228 - unless_null $S6, __label_40 -.annotate 'line', 229 - set $S6, $S3 + __label_19: + unless $I2 goto __label_35 + unless_null $S4, __label_36 + set $S4, $S3 + __label_36: # endif + isnull $I6, $S4 + not $I6 + unless $I6 goto __label_37 + isne $I6, $S4, "-" + __label_37: + unless $I6 goto __label_39 + root_new $P10, ['parrot';'FileHandle'] + $P10.'open'($S4,'w') + goto __label_38 + __label_39: + getstdout $P13 + set $P10, $P13 + __label_38: + $P10.'print'($P5) + unless $I6 goto __label_40 + $P10.'close'() __label_40: # endif -.annotate 'line', 230 -# create: $I5 - isnull $I5, $S6 - not $I5 - unless $I5 goto __label_41 - isne $I5, $S6, "-" - __label_41: -.annotate 'line', 231 -# var outfile: $P16 - unless $I5 goto __label_43 -# predefined open - root_new $P16, ['parrot';'FileHandle'] - $P16.'open'($S6,'w') - goto __label_42 - __label_43: -# predefined getstdout - getstdout $P16 - __label_42: -.annotate 'line', 232 - $P16.'print'($P11) -.annotate 'line', 233 - unless $I5 goto __label_44 -.annotate 'line', 234 - $P16.'close'() - __label_44: # endif -# predefined exit -.annotate 'line', 235 exit 0 -# } - __label_39: # endif -.annotate 'line', 240 -# var sub: $P17 - null $P17 -.annotate 'line', 241 -# try: create handler - new $P20, 'ExceptionHandler' - set_label $P20, __label_45 - push_eh $P20 -# try: begin -# { -.annotate 'line', 242 - $P17 = $P11.'get_main'() -# } -# try: end - pop_eh - goto __label_46 -.annotate 'line', 241 -# catch - __label_45: - .get_results($P21) - finalize $P21 - pop_eh -# { -# for loop -.annotate 'line', 245 -# i: $I6 - null $I6 - __label_49: # for condition -# { -.annotate 'line', 246 - $P17 = $P11[$I6] -.annotate 'line', 247 - unless_null $P17, __label_50 - goto __label_48 # break - __label_50: # endif -.annotate 'line', 248 -# predefined string - set $S10, $P17 - ne $S10, 'main', __label_51 - goto __label_48 # break - __label_51: # endif -# } - __label_47: # for iteration -.annotate 'line', 245 - inc $I6 - goto __label_49 - __label_48: # for end -.annotate 'line', 251 - unless_null $P17, __label_52 -.annotate 'line', 252 - $P17 = $P11[0] - __label_52: # endif -# } -# catch end - __label_46: -.annotate 'line', 255 -# retval: $I7 - null $I7 -.annotate 'line', 256 -# try: create handler - new $P20, 'ExceptionHandler' - set_label $P20, __label_53 - $P20.'handle_types_except'(64) - push_eh $P20 -# try: begin -# { -.annotate 'line', 257 -# var retvalp: $P18 - $P18 = $P17(__ARG_1) -.annotate 'line', 258 - if_null $P18, __label_55 -.annotate 'line', 259 - set $I7, $P18 - __label_55: # endif -# } -# try: end + __label_35: # endif + null $P11 + new $P13, 'ExceptionHandler' + set_label $P13, __label_41 + push_eh $P13 + $P15 = $P5.'subs_by_tag'("load") + if_null $P15, __label_44 + iter $P17, $P15 + set $P17, 0 + __label_43: # for iteration + unless $P17 goto __label_44 + shift $P12, $P17 + $P12() + goto __label_43 + __label_44: # endfor + $P5.'mark_initialized'("load") + $P11 = $P5.'main_sub'() pop_eh - goto __label_54 -.annotate 'line', 256 -# catch - __label_53: - .get_results($P19) - finalize $P19 + goto __label_42 + __label_41: + .get_results($P14) + finalize $P14 pop_eh -# { -.annotate 'line', 262 -# msg: $S9 - $S9 = $P19['message'] -.annotate 'line', 263 - isnull $I8, $S9 - not $I8 - unless $I8 goto __label_57 - isne $I8, $S9, '' - __label_57: - unless $I8 goto __label_56 -.annotate 'line', 264 -# predefined cry getstderr $P0 - print $P0, $S9 + print $P0, "Cannot find main sub" print $P0, "\n" - __label_56: # endif -.annotate 'line', 265 - set $I7, 1 -# } -# catch end - __label_54: -.annotate 'line', 267 -# predefined exit - exit $I7 -# } -.annotate 'line', 268 - -.end # main + + __label_42: + .return($P11) + +.end # process_args + + +.sub '__PARROT_ENTRY_WINXED_main' :main + .param pmc __ARG_1 +.const 'Sub' WSubId_4 = "WSubId_4" +.const 'Sub' WSubId_5 = "WSubId_5" + $P1 = WSubId_4(__ARG_1) + null $I1 + new $P4, 'ExceptionHandler' + set_label $P4, __label_1 + $P4.'handle_types_except'(65543) + push_eh $P4 + $P2 = $P1(__ARG_1) + if_null $P2, __label_3 + set $I1, $P2 + __label_3: # endif + pop_eh + goto __label_2 + __label_1: + .get_results($P3) + finalize $P3 + pop_eh + WSubId_5($P3) + __label_2: + exit $I1 + +.end # __PARROT_ENTRY_WINXED_main + + +.sub 'fail' :subid('WSubId_5') :anon + .param pmc __ARG_1 + getstderr $P1 + getattribute $P3, __ARG_1, 'message' + null $S1 + if_null $P3, __label_1 + set $S1, $P3 + __label_1: + isnull $I3, $S1 + if $I3 goto __label_3 + iseq $I3, $S1, "" + __label_3: + unless $I3 goto __label_2 + set $S1, "No exception handler and no message" + __label_2: # endif + root_new $P3, ['parrot';'ResizablePMCArray'] + assign $P3, 1 + $P3[0] = $S1 + sprintf $S5, "%s\n", $P3 + $P1.'print'($S5) + set $S2, "" + $P2 = __ARG_1.'backtrace_strings'() + elements $I3, $P2 + sub $I1, $I3, 1 + __label_6: # for condition + lt $I1, 0, __label_5 + $S3 = $P2[$I1] + split $P3, "\n", $S3 + if_null $P3, __label_8 + iter $P4, $P3 + set $P4, 0 + __label_7: # for iteration + unless $P4 goto __label_8 + shift $S4, $P4 + index $I3, $S4, "__PARROT_ENTRY" + lt $I3, 0, __label_9 + goto __label_7 # continue + __label_9: # endif + root_new $P3, ['parrot';'ResizablePMCArray'] + assign $P3, 2 + $P3[0] = $S2 + $P3[1] = $S4 + sprintf $S5, "%s%s", $P3 + $P1.'print'($S5) + set $S2, "\n" + goto __label_7 + __label_8: # endfor + set $S2, "\nthrown from\n" + __label_4: # for iteration + dec $I1 + goto __label_6 + __label_5: # for end + getattribute $P3, __ARG_1, 'exit_code' + set $I2, $P3 + unless $I2 goto __label_11 + set $I3, $I2 + goto __label_10 + __label_11: + set $I3, 1 + __label_10: + exit $I3 + +.end # fail # End generated code diff --git a/frontend/parrot/main.c b/frontend/parrot/main.c index c3b392cec9..ca31f30b28 100644 --- a/frontend/parrot/main.c +++ b/frontend/parrot/main.c @@ -3,7 +3,7 @@ Copyright (C) 2007-2011, Parrot Foundation. =head1 NAME -src/main.c - The PIR/PASM compiler frontend to libparrot +frontend/parrot/main.c - The PIR/PASM compiler frontend to libparrot =head1 DESCRIPTION @@ -833,7 +833,6 @@ parseflags(Parrot_PMC interp, int argc, ARGIN(const char *argv[]), case OPT_GC_DEBUG: /* #if DISABLE_GC_DEBUG - // Parrot_warn(interp, PARROT_WARNINGS_ALL_FLAG, Parrot_warn(interp, 0xFFFF, "PARROT_GC_DEBUG is set but the binary was compiled " "with DISABLE_GC_DEBUG."); diff --git a/frontend/parrot2/build.pir b/frontend/parrot2/build.pir new file mode 100644 index 0000000000..b252cec730 --- /dev/null +++ b/frontend/parrot2/build.pir @@ -0,0 +1,79 @@ +# Copyright (C) 2011-2012, Parrot Foundation. + +.sub 'main' :main + .param pmc args + .local pmc outfh, ifh + .local string infile, outfile, program_name + .local int size + program_name = shift args + infile = shift args + outfile = infile . ".c" + say outfile + ifh = new ['FileHandle'] + ifh.'open'(infile, 'rb') + outfh = new ['FileHandle'] + outfh.'open'(outfile, 'wb') + print outfh, "#include \n" + print outfh, "#include \"parrot/api.h\"\n" + print outfh, "static const unsigned char program_code[] = {" + size = 0 + + read_loop: + .local string pbcstring + .local int pbclength + + pbcstring = ifh.'read'(16384) + pbclength = length pbcstring + unless pbclength > 0 goto read_done + + .local int pos + pos = 0 + code_loop: + unless pos < pbclength goto code_done + $I0 = ord pbcstring, pos + $S0 = $I0 + print outfh, $S0 + print outfh, ',' + inc pos + inc size + $I0 = size % 32 + unless $I0 == 0 goto code_loop + print outfh, "\n" + goto code_loop + code_done: + goto read_loop + + read_done: + say "Done reading input" + ifh.'close'() + + say "writing coda" + print outfh, "\n};\n\nstatic const size_t bytecode_size = " + $S0 = size + print outfh, $S0 + print outfh, ";\n" + print outfh, <<'END_OF_FUNCTION' + const unsigned char * get_program_code(void) + { + return program_code; + } + + size_t get_program_code_size(void) + { + return bytecode_size; + } +END_OF_FUNCTION + + outfh.'flush'() + outfh.'close'() + .return () + + err_infile: + die "cannot open infile" +.end + +# Local Variables: +# mode: pir +# fill-column: 100 +# End: +# vim: expandtab shiftwidth=4 ft=pir: diff --git a/frontend/parrot2/main.c b/frontend/parrot2/main.c new file mode 100644 index 0000000000..25ad18be8c --- /dev/null +++ b/frontend/parrot2/main.c @@ -0,0 +1,710 @@ +/* + +Copyright (C) 2007-2012, Parrot Foundation. + +=head1 NAME + +frontend/parrot2/main.c - The alternate PIR/PASM compiler frontend to libparrot + +=head1 DESCRIPTION + +Start Parrot, bootstrapping to PIR as early as possible. + +=head2 Functions + +=over 4 + +=cut + +*/ + +#include +#include +#include +#include +#include "parrot/longopt.h" +#include "parrot/api.h" +#include "imcc/api.h" + +struct init_args_t { + const char *run_core_name; + Parrot_Int trace; + Parrot_Int turn_gc_off; + const char ** argv; + int argc; +}; + +extern int Parrot_set_config_hash(Parrot_PMC interp_pmc); + +/* HEADERIZER HFILE: none */ + +/* HEADERIZER BEGIN: static */ +/* Don't modify between HEADERIZER BEGIN / HEADERIZER END. Your changes will be lost. */ + +static void help_debug(void); +PARROT_WARN_UNUSED_RESULT +PARROT_PURE_FUNCTION +static int is_all_digits(ARGIN(const char *s)) + __attribute__nonnull__(1); + +PARROT_WARN_UNUSED_RESULT +PARROT_PURE_FUNCTION +static int is_all_hex_digits(ARGIN(const char *s)) + __attribute__nonnull__(1); + +PARROT_WARN_UNUSED_RESULT +PARROT_PURE_FUNCTION +static int is_float(ARGIN(const char *s)) + __attribute__nonnull__(1); + +PARROT_WARN_UNUSED_RESULT +PARROT_CANNOT_RETURN_NULL +static const struct longopt_opt_decl * Parrot_cmd_options(void); + +static void parseflags( + Parrot_PMC interp, + int argc, + ARGIN(const char *argv[]), + ARGMOD(struct init_args_t * args)) + __attribute__nonnull__(3) + __attribute__nonnull__(4) + FUNC_MODIFIES(* args); + +static void parseflags_minimal( + ARGMOD(Parrot_Init_Args * initargs), + int argc, + ARGIN(const char *argv[])) + __attribute__nonnull__(1) + __attribute__nonnull__(3) + FUNC_MODIFIES(* initargs); + +static void print_parrot_string( + Parrot_PMC interp, + ARGMOD(FILE *vector), + Parrot_String str, + int newline) + __attribute__nonnull__(2) + FUNC_MODIFIES(*vector); + +PARROT_CANNOT_RETURN_NULL +static void setup_imcc(Parrot_PMC interp); + +static void show_last_error_and_exit(Parrot_PMC interp); +static void usage(ARGMOD(FILE *fp)) + __attribute__nonnull__(1) + FUNC_MODIFIES(*fp); + +#define ASSERT_ARGS_help_debug __attribute__unused__ int _ASSERT_ARGS_CHECK = (0) +#define ASSERT_ARGS_is_all_digits __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ + PARROT_ASSERT_ARG(s)) +#define ASSERT_ARGS_is_all_hex_digits __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ + PARROT_ASSERT_ARG(s)) +#define ASSERT_ARGS_is_float __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ + PARROT_ASSERT_ARG(s)) +#define ASSERT_ARGS_Parrot_cmd_options __attribute__unused__ int _ASSERT_ARGS_CHECK = (0) +#define ASSERT_ARGS_parseflags __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ + PARROT_ASSERT_ARG(argv) \ + , PARROT_ASSERT_ARG(args)) +#define ASSERT_ARGS_parseflags_minimal __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ + PARROT_ASSERT_ARG(initargs) \ + , PARROT_ASSERT_ARG(argv)) +#define ASSERT_ARGS_print_parrot_string __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ + PARROT_ASSERT_ARG(vector)) +#define ASSERT_ARGS_setup_imcc __attribute__unused__ int _ASSERT_ARGS_CHECK = (0) +#define ASSERT_ARGS_show_last_error_and_exit __attribute__unused__ int _ASSERT_ARGS_CHECK = (0) +#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 */ + +/* + +=item C + +The entry point from the command line into Parrot. + +=cut + +*/ + +int +main(int argc, const char *argv[]) +{ + Parrot_PMC interp, bytecodepmc, args; + Parrot_Init_Args *initargs; + struct init_args_t parsed_flags; + + GET_INIT_STRUCT(initargs); + + /* Parse minimal subset of flags */ + parseflags_minimal(initargs, argc, argv); + + if (!Parrot_api_make_interpreter(NULL, 0, initargs, &interp)) { + fprintf(stderr, "PARROT VM: Could not allocate new interpreter\n"); + if (interp != NULL) + show_last_error_and_exit(interp); + else + fprintf(stderr, "PARROT VM: No interpreter. Cannot get error details\n"); + exit(EXIT_FAILURE); + } + if (!(Parrot_set_config_hash(interp) && + Parrot_api_set_executable_name(interp, argv[0]))) { + fprintf(stderr, "PARROT VM: Could not initialize new interpreter\n"); + show_last_error_and_exit(interp); + } + + /* Parse flags */ + parseflags(interp, argc, argv, &parsed_flags); + + if (!Parrot_api_set_runcore(interp, parsed_flags.run_core_name, parsed_flags.trace)) + show_last_error_and_exit(interp); + + Parrot_api_toggle_gc(interp, 0); + setup_imcc(interp); + if (!parsed_flags.turn_gc_off) + Parrot_api_toggle_gc(interp, 1); + + if (!(Parrot_api_pmc_wrap_string_array(interp, parsed_flags.argc, parsed_flags.argv, + &args) + && Parrot_api_load_bytecode_bytes(interp, get_program_code(), get_program_code_size(), + &bytecodepmc) + && Parrot_api_run_bytecode(interp, bytecodepmc, args))) + show_last_error_and_exit(interp); + + /* Clean-up after ourselves */ + Parrot_api_destroy_interpreter(interp); + exit(EXIT_SUCCESS); +} + +/* + +=item C + +Call into IMCC to either compile or preprocess the input. + +=cut + +*/ + +PARROT_CANNOT_RETURN_NULL +static void +setup_imcc(Parrot_PMC interp) +{ + ASSERT_ARGS(setup_imcc) + Parrot_PMC pir_compiler = NULL; + Parrot_PMC pasm_compiler = NULL;; + + if (!(imcc_get_pir_compreg_api(interp, 1, &pir_compiler) && + imcc_get_pasm_compreg_api(interp, 1, &pasm_compiler))) + show_last_error_and_exit(interp); +} + + +/* + +=item C + +Prints out the C's last error and exits. + +=cut + +*/ + +static void +show_last_error_and_exit(Parrot_PMC interp) +{ + ASSERT_ARGS(show_last_error_and_exit) + Parrot_String errmsg, backtrace; + Parrot_Int exit_code, is_error; + Parrot_PMC exception; + + if (!Parrot_api_get_result(interp, &is_error, &exception, &exit_code, &errmsg)) { + Parrot_api_destroy_interpreter(interp); + exit(EXIT_FAILURE); + } + if (is_error) { + if (!Parrot_api_get_exception_backtrace(interp, exception, &backtrace)) { + Parrot_api_destroy_interpreter(interp); + exit(EXIT_FAILURE); + } + print_parrot_string(interp, stderr, errmsg, 1); + print_parrot_string(interp, stderr, backtrace, 0); + } + + Parrot_api_destroy_interpreter(interp); + exit(exit_code); +} + +/* + +=item C + +Prints C parrot string into the file handle C and an optional new +line if C is set to a true value. + +=cut + +*/ + +static void +print_parrot_string(Parrot_PMC interp, ARGMOD(FILE *vector), Parrot_String str, + int newline) +{ + ASSERT_ARGS(print_parrot_string) + char * msg_raw; + if (!str) + return; + Parrot_api_string_export_ascii(interp, str, &msg_raw); + if (msg_raw) { + fprintf(vector, "%s%s", msg_raw, newline ? "\n" : ""); + Parrot_api_string_free_exported_ascii(interp, msg_raw); + } +} + +/* + +=item C + +Tests all characters in a string are decimal digits. +Returns 1 if true, 0 as soon as a non-decimal found + +=cut + +*/ + +PARROT_WARN_UNUSED_RESULT +PARROT_PURE_FUNCTION +static int +is_all_digits(ARGIN(const char *s)) +{ + ASSERT_ARGS(is_all_digits) + for (; *s; ++s) + if (!isdigit((unsigned char)*s)) + return 0; + return 1; +} + +/* +=item C + +Tests all characters in a string are decimal digits or dot. +Returns 1 if true, 0 as soon as a non-decimal found + +=cut + +*/ + +PARROT_WARN_UNUSED_RESULT +PARROT_PURE_FUNCTION +static int +is_float(ARGIN(const char *s)) +{ + ASSERT_ARGS(is_float) + for (; *s; ++s) + if (!(isdigit((unsigned char)*s) || (*s=='.'))) + return 0; + return 1; +} + +/* + +=item C + +Tests all characters in a string are hexadecimal digits. +Returns 1 if true, 0 as soon as a non-hex found + +=cut + +*/ + +PARROT_WARN_UNUSED_RESULT +PARROT_PURE_FUNCTION +static int +is_all_hex_digits(ARGIN(const char *s)) +{ + ASSERT_ARGS(is_all_hex_digits) + for (; *s; ++s) + if (!isxdigit((unsigned char)*s)) + return 0; + return 1; +} + +/* + +=item C + +Outputs usage error message. + +=cut + +*/ + +static void +usage(ARGMOD(FILE *fp)) +{ + ASSERT_ARGS(usage) + fprintf(fp, + "parrot -[acEGhrtvVwy.] [-d [FLAGS]] [-D [FLAGS]]" + "[-O [level]] [-R runcore] [-o FILE] \n"); +} + +/* + +=item C + +Print out list of debugging flag values. + +=cut + +*/ + +static void +help_debug(void) +{ + ASSERT_ARGS(help_debug) + /* split printf for C89 compliance on string length */ + printf( + "--imcc-debug -d [Flags] ...\n" + " 0002 lexer\n" + " 0004 parser\n" + " 0008 imc\n" + " 0010 CFG\n" + " 0020 optimization 1\n" + " 0040 optimization 2\n" + " 0100 AST\n" + " 1000 PBC\n" + " 2000 PBC constants\n" + " 4000 PBC fixups\n" + "\n"); + printf( + "--parrot-debug -D [Flags] ...\n" + " 0001 memory statistics\n" + " 0002 print backtrace on exception\n" + " 0004 JIT debugging\n" + " 0008 interpreter startup\n" + " 0010 thread debugging\n" + " 0020 eval/compile\n" + " 0040 fill I, N registers with garbage\n" + " 0080 show when a context is destroyed\n" + "\n" + "--trace -t [Flags] ...\n" + " 0001 opcodes\n" + " 0002 find_method\n" + " 0004 function calls\n"); +} + +/* + +=item C + +Set up the const struct declaration for cmd_options + +=cut + +*/ + + + +/* TODO: Weed out the options that are not used by this executable */ + +PARROT_WARN_UNUSED_RESULT +PARROT_CANNOT_RETURN_NULL +static const struct longopt_opt_decl * +Parrot_cmd_options(void) +{ + ASSERT_ARGS(Parrot_cmd_options) + static const struct longopt_opt_decl cmd_options[] = { + { '.', '.', (OPTION_flags)0, { "--wait" } }, + { 'D', 'D', OPTION_optional_FLAG, { "--parrot-debug" } }, + { 'E', 'E', (OPTION_flags)0, { "--pre-process-only" } }, + { 'G', 'G', (OPTION_flags)0, { "--no-gc" } }, + { '\0', OPT_HASH_SEED, OPTION_required_FLAG, { "--hash-seed" } }, + { 'I', 'I', OPTION_required_FLAG, { "--include" } }, + { 'L', 'L', OPTION_required_FLAG, { "--library" } }, + { 'O', 'O', OPTION_optional_FLAG, { "--optimize" } }, + { 'R', 'R', OPTION_required_FLAG, { "--runcore" } }, + { 'g', 'g', OPTION_required_FLAG, { "--gc" } }, + { '\0', OPT_GC_NURSERY_SIZE, OPTION_required_FLAG, { "--gc-nursery-size" } }, + { '\0', OPT_GC_DYNAMIC_THRESHOLD, OPTION_required_FLAG, { "--gc-dynamic-threshold" } }, + { '\0', OPT_GC_MIN_THRESHOLD, OPTION_required_FLAG, { "--gc-min-threshold" } }, + { '\0', OPT_GC_DEBUG, (OPTION_flags)0, { "--gc-debug" } }, + { 'V', 'V', (OPTION_flags)0, { "--version" } }, + { 'X', 'X', OPTION_required_FLAG, { "--dynext" } }, + { '\0', OPT_DESTROY_FLAG, (OPTION_flags)0, + { "--leak-test", "--destroy-at-end" } }, + { 'o', 'o', OPTION_required_FLAG, { "--output" } }, + { '\0', OPT_PBC_OUTPUT, (OPTION_flags)0, { "--output-pbc" } }, + { 'a', 'a', (OPTION_flags)0, { "--pasm" } }, + { 'c', 'c', (OPTION_flags)0, { "--pbc" } }, + { 'd', 'd', OPTION_optional_FLAG, { "--imcc-debug" } }, + { '\0', OPT_HELP_DEBUG, (OPTION_flags)0, { "--help-debug" } }, + { 'h', 'h', (OPTION_flags)0, { "--help" } }, + { 'r', 'r', (OPTION_flags)0, { "--run-pbc" } }, + { '\0', OPT_RUNTIME_PREFIX, (OPTION_flags)0, { "--runtime-prefix" } }, + { 't', 't', OPTION_optional_FLAG, { "--trace" } }, + { 'v', 'v', (OPTION_flags)0, { "--verbose" } }, + { 'w', 'w', (OPTION_flags)0, { "--warnings" } }, + { 'y', 'y', (OPTION_flags)0, { "--yydebug" } }, + { 0, 0, (OPTION_flags)0, { NULL } } + }; + return cmd_options; +} + +/* + +=item C + +Parse minimal subset of args required for initializing interpreter. + +=cut + +*/ +static void +parseflags_minimal(ARGMOD(Parrot_Init_Args * initargs), int argc, ARGIN(const char *argv[])) +{ + ASSERT_ARGS(parseflags_minimal) + struct longopt_opt_info opt = LONGOPT_OPT_INFO_INIT; + int status; + + while ((status = longopt_get(argc, argv, Parrot_cmd_options(), &opt)) > 0) { + switch (opt.opt_id) { + case 'g': + initargs->gc_system = opt.opt_arg; + break; + case OPT_GC_DYNAMIC_THRESHOLD: + if (opt.opt_arg && is_all_digits(opt.opt_arg)) { + initargs->gc_dynamic_threshold = strtoul(opt.opt_arg, NULL, 10); + + if (initargs->gc_dynamic_threshold > 1000) { + fprintf(stderr, "error: maximum GC threshold is 1000\n"); + exit(EXIT_FAILURE); + } + } + else { + fprintf(stderr, "error: invalid GC dynamic threshold specified:" + "'%s'\n", opt.opt_arg); + exit(EXIT_FAILURE); + } + break; + case OPT_GC_MIN_THRESHOLD: + if (opt.opt_arg && is_all_digits(opt.opt_arg)) { + initargs->gc_min_threshold = strtoul(opt.opt_arg, NULL, 10) + * 1024; + } + else { + fprintf(stderr, "error: invalid GC min threshold specified:" + "'%s'\n", opt.opt_arg); + exit(EXIT_FAILURE); + } + break; + case OPT_GC_NURSERY_SIZE: + if (opt.opt_arg && is_float(opt.opt_arg)) { + initargs->gc_nursery_size = (float)strtod(opt.opt_arg, NULL); + + if (initargs->gc_nursery_size > 50) { + fprintf(stderr, "error: maximum GC nursery size is 50%%\n"); + exit(EXIT_FAILURE); + } + } + else { + fprintf(stderr, "error: invalid GC nursery size specified:" + "'%s'\n", opt.opt_arg); + exit(EXIT_FAILURE); + } + break; + + case OPT_HASH_SEED: + if (opt.opt_arg && is_all_hex_digits(opt.opt_arg)) { + initargs->hash_seed = strtoul(opt.opt_arg, NULL, 16); + } + else { + fprintf(stderr, "error: invalid hash seed specified:" + "'%s'\n", opt.opt_arg); + exit(EXIT_FAILURE); + } + break; + default: + break; + } + } +} + +/* + +=item C + +Parse Parrot's command line for options and set appropriate flags. + +=cut + +*/ + +static void +parseflags(Parrot_PMC interp, int argc, ARGIN(const char *argv[]), + ARGMOD(struct init_args_t * args)) +{ + ASSERT_ARGS(parseflags) + struct longopt_opt_info opt = LONGOPT_OPT_INFO_INIT; + int status; + int result = 1; + int nargs = 0; + int i; + + /* + * Any option with an argument we handle may split an argument + * into two. So be pessimistic with the allocation. + */ + int pargs_size = argc * 2; + const char **pargs = (const char**)calloc(pargs_size, sizeof (char*)); + + if (argc == 1) { + usage(stderr); + exit(EXIT_SUCCESS); + } + + args->run_core_name = "fast"; + args->trace = 0; + args->turn_gc_off = 0; + pargs[nargs++] = argv[0]; + + while ((status = longopt_get(argc, argv, Parrot_cmd_options(), &opt)) > 0) { + switch (opt.opt_id) { + case 'R': + args->run_core_name = opt.opt_arg; + break; + case 'g': + case OPT_GC_NURSERY_SIZE: + case OPT_GC_DYNAMIC_THRESHOLD: + case OPT_GC_MIN_THRESHOLD: + /* Handled in parseflags_minimal */ + break; + case 'G': + args->turn_gc_off = 1; + break; + case 't': + if (opt.opt_arg && is_all_hex_digits(opt.opt_arg)) { + const unsigned long _temp = strtoul(opt.opt_arg, NULL, 16); + /* const Parrot_trace_flags _temp_flag = (Parrot_trace_flags)_temp; */ + const Parrot_Int _temp_flag = _temp; + args->trace = _temp_flag; + } + else + args->trace = 0x01; + /* *trace = PARROT_TRACE_OPS_FLAG; */ + break; + case 'D': + if (opt.opt_arg && is_all_hex_digits(opt.opt_arg)) + result = Parrot_api_debug_flag(interp, strtoul(opt.opt_arg, NULL, 16), 1); + else + /* Parrot_api_debug_flag(interp, PARROT_MEM_STAT_DEBUG_FLAG, 1); */ + result = Parrot_api_debug_flag(interp, 0x01, 1); + break; + + case '.': /* Give Windows Parrot hackers an opportunity to + * attach a debuggger. */ + fgetc(stdin); + break; + case 'h': + pargs[nargs++] = "-h"; + break; + case OPT_HASH_SEED: + /* handled in parseflags_minimal */ + break; + case OPT_HELP_DEBUG: + help_debug(); + exit(EXIT_FAILURE); + break; + case OPT_RUNTIME_PREFIX: + pargs[nargs++] = "--runtime-prefix"; + break; + case 'V': + pargs[nargs++] = "-V"; + break; + case OPT_PBC_OUTPUT: + case 'o': + pargs[nargs++] = "-o"; + pargs[nargs++] = opt.opt_arg; + break; + case 'r': + pargs[nargs++] = "-r"; + break; + case 'c': + pargs[nargs++] = "-c"; + break; + case OPT_GC_DEBUG: + /* +#if DISABLE_GC_DEBUG + Parrot_warn(interp, 0xFFFF, + "PARROT_GC_DEBUG is set but the binary was compiled " + "with DISABLE_GC_DEBUG."); +#endif + */ + /* Parrot_api_flag(interp, PARROT_GC_DEBUG_FLAG, 1); */ + result = Parrot_api_flag(interp, 0x10, 1); + break; + case OPT_DESTROY_FLAG: + /* Parrot_api_flag(interp, PARROT_DESTROY_FLAG, 1); */ + result = Parrot_api_flag(interp, 0x200, 1); + break; + + /* TODO: Can we do these in prt0.pir? */ + case 'I': + result = Parrot_api_add_include_search_path(interp, opt.opt_arg); + break; + case 'L': + result = Parrot_api_add_library_search_path(interp, opt.opt_arg); + break; + case 'X': + result = Parrot_api_add_dynext_search_path(interp, opt.opt_arg); + break; + case 'w': + /* result = Parrot_api_set_warnings(interp, PARROT_WARNINGS_ALL_FLAG); */ + result = Parrot_api_set_warnings(interp, 0xFFFF); + break; + + case 'E': + pargs[nargs++] = "-E"; + break; + default: + /* languages handle their arguments later (after being initialized) */ + break; + } + if (!result) { + fprintf(stderr, "Parrot VM: Error parsing option %s\n", argv[opt.opt_index]); + usage(stderr); + exit(EXIT_FAILURE); + } + } + + if (status == -1) { + fprintf(stderr, "%s\n", opt.opt_error); + usage(stderr); + exit(EXIT_FAILURE); + } + for (i = opt.opt_index; i < argc; i++) + pargs[nargs++] = argv[i]; + + /* Make sure we don't overrun the end of the array */ + PARROT_ASSERT(nargs <= pargs_size); + + args->argv = pargs; + args->argc = nargs; +} + +/* + +=back + +=cut + +*/ + +/* + * Local variables: + * c-file-style: "parrot" + * End: + * vim: expandtab shiftwidth=4 cinoptions='\:2=2' : + */ diff --git a/frontend/parrot2/prt0.pir b/frontend/parrot2/prt0.pir new file mode 100644 index 0000000000..b7a4dc3c6d --- /dev/null +++ b/frontend/parrot2/prt0.pir @@ -0,0 +1,324 @@ +# THIS IS A GENERATED FILE! DO NOT EDIT! +# Begin generated code + +.namespace [ ] + +.sub '__PARROT_ENTRY_MAIN__args' :subid('WSubId_8') :anon + .param pmc __ARG_1 +.const 'Sub' WSubId_1 = "WSubId_1" +.const 'Sub' WSubId_2 = "WSubId_2" +.const 'Sub' WSubId_3 = "WSubId_3" +.const 'Sub' WSubId_4 = "WSubId_4" +.const 'Sub' WSubId_5 = "WSubId_5" +.const 'Sub' WSubId_6 = "WSubId_6" +.const 'Sub' WSubId_7 = "WSubId_7" + null $S1 + shift $S1, __ARG_1 + null $S2 + null $I1 + null $S3 + null $P1 + null $S4 + null $I2 + __label_3: # while + elements $I3, __ARG_1 + le $I3, 0, __label_2 + $S5 = __ARG_1[0] + if $S5 == "-o" goto __label_6 + if $S5 == "-c" goto __label_7 + if $S5 == "-r" goto __label_8 + if $S5 == "-E" goto __label_9 + if $S5 == "--runtime-prefix" goto __label_10 + if $S5 == "-V" goto __label_11 + if $S5 == "-h" goto __label_12 + goto __label_4 + __label_6: # case + shift $S4, __ARG_1 + shift $S3, __ARG_1 + goto __label_5 # break + __label_7: # case + shift $S4, __ARG_1 + set $I1, 3 + goto __label_5 # break + __label_8: # case + shift $S4, __ARG_1 + set $I2, 2 + goto __label_5 # break + __label_9: # case + shift $S4, __ARG_1 + set $I2, 1 + goto __label_5 # break + __label_10: # case + WSubId_1() + __label_11: # case + WSubId_2() + __label_12: # case + WSubId_3() + __label_4: # default + set $S2, $S5 + goto __label_1 # goto done_args + __label_5: # switch end + goto __label_3 + __label_2: # endwhile + __label_1: # label done_args + isnull $I3, $S2 + if $I3 goto __label_14 + iseq $I3, $S2, "" + __label_14: + unless $I3 goto __label_13 + WSubId_4("Missing program name") + __label_13: # endif + ne $I2, 1, __label_15 + compreg $P3, "PIR" + $P3.'preprocess'($S2) + exit 0 + __label_15: # endif + if $I1 goto __label_16 + $P3 = WSubId_5($S2) + set $I1, $P3 + if $I1 goto __label_17 + concat $S7, "Invalid file type ", $S2 + WSubId_4($S7) + __label_17: # endif + __label_16: # endif + ne $I2, 2, __label_18 + $P3 = WSubId_6($S2) + null $S6 + if_null $P3, __label_19 + set $S6, $P3 + __label_19: + compreg $P3, "PIR" + $P1 = $P3.'compile_file'($S2) + $P1.'write_to_file'($S6) + new $P1, [ 'PackfileView' ] + $P1.'read_from_file'($S6) + __label_18: # endif + unless_null $P1, __label_20 + $P1 = WSubId_7($S2, $I1) + __label_20: # endif + if_null $S3, __label_21 + $P1.'write_to_file'($S3) + exit 0 + __label_21: # endif + $P3 = $P1.'subs_by_tag'("init") + if_null $P3, __label_23 + iter $P4, $P3 + set $P4, 0 + __label_22: # for iteration + unless $P4 goto __label_23 + shift $P2, $P4 + $P2() + goto __label_22 + __label_23: # endfor + .return($P1) + +.end # __PARROT_ENTRY_MAIN__args + + +.sub '__PARROT_ENTRY_MAIN__' :anon :main + .param pmc __ARG_1 +.const 'Sub' WSubId_8 = "WSubId_8" +.const 'Sub' WSubId_9 = "WSubId_9" + new $P4, 'ExceptionHandler' + set_label $P4, __label_1 + push_eh $P4 + $P1 = WSubId_8(__ARG_1) + $P2 = $P1.'main_sub'() + .tailcall $P2(__ARG_1) + pop_eh + goto __label_2 + __label_1: + .get_results($P3) + finalize $P3 + pop_eh + WSubId_9($P3) + __label_2: + +.end # __PARROT_ENTRY_MAIN__ + + +.sub '__default_get_packfile' :subid('WSubId_7') :anon + .param string __ARG_1 + .param int __ARG_2 + if __ARG_2 == 2 goto __label_3 + if __ARG_2 == 1 goto __label_4 + if __ARG_2 == 3 goto __label_5 + goto __label_1 + __label_3: # case + compreg $P1, "PIR" + $P2 = $P1.'compile_file'(__ARG_1) + .return($P2) + __label_4: # case + compreg $P3, "PASM" + .tailcall $P3.'compile_file'(__ARG_1) + __label_5: # case + new $P4, [ 'PackfileView' ] + $P4.'read_from_file'(__ARG_1) + .return($P4) + __label_1: # default + null $P5 + .return($P5) + __label_2: # switch end + +.end # __default_get_packfile + + +.sub '__get_input_file_type' :subid('WSubId_5') :anon + .param string __ARG_1 + length $I2, __ARG_1 + sub $I1, $I2, 4 + lt $I1, 0, __label_2 + substr $S1, __ARG_1, $I1 + goto __label_1 + __label_2: + set $S1, '' + __label_1: + ne $S1, ".pir", __label_3 + .return(2) + __label_3: # endif + ne $S1, ".pbc", __label_4 + .return(3) + __label_4: # endif + le $I1, 0, __label_5 + sub $I2, $I1, 1 + substr $S1, __ARG_1, $I2 + ne $S1, ".pasm", __label_6 + .return(1) + __label_6: # endif + __label_5: # endif + .return(2) + +.end # __get_input_file_type + + +.sub '__handle_error_and_exit' :subid('WSubId_9') :anon + .param pmc __ARG_1 + getattribute $P4, __ARG_1, 'severity' + set $I1, $P4 + ne $I1, 6, __label_1 + getattribute $P4, __ARG_1, 'exit_code' + set $I4, $P4 + exit $I4 + __label_1: # endif + getstderr $P1 + getattribute $P4, __ARG_1, 'message' + null $S1 + if_null $P4, __label_2 + set $S1, $P4 + __label_2: + isnull $I4, $S1 + if $I4 goto __label_4 + iseq $I4, $S1, "" + __label_4: + unless $I4 goto __label_3 + set $S1, "No exception handler and no message" + __label_3: # endif + root_new $P4, ['parrot';'ResizablePMCArray'] + assign $P4, 1 + $P4[0] = $S1 + sprintf $S5, "%s\n", $P4 + $P1.'print'($S5) + set $S2, "" + $P2 = __ARG_1.'backtrace_strings'() + elements $I4, $P2 + sub $I2, $I4, 1 + __label_7: # for condition + lt $I2, 0, __label_6 + $S3 = $P2[$I2] + split $P3, "\n", $S3 + if_null $P3, __label_9 + iter $P5, $P3 + set $P5, 0 + __label_8: # for iteration + unless $P5 goto __label_9 + shift $S4, $P5 + index $I4, $S4, "__PARROT_ENTRY_MAIN__" + eq $I4, -1, __label_10 + goto __label_8 # continue + __label_10: # endif + root_new $P4, ['parrot';'ResizablePMCArray'] + assign $P4, 2 + $P4[0] = $S2 + $P4[1] = $S4 + sprintf $S5, "%s%s", $P4 + $P1.'print'($S5) + set $S2, "\n" + goto __label_8 + __label_9: # endfor + set $S2, "\nthrown from\n" + __label_5: # for iteration + dec $I2 + goto __label_7 + __label_6: # for end + getattribute $P4, __ARG_1, 'exit_code' + set $I3, $P4 + if $I3 goto __label_11 + set $I3, 1 + __label_11: # endif + exit $I3 + +.end # __handle_error_and_exit + + +.sub '__show_runtime_prefix_and_exit' :subid('WSubId_1') :anon + null $S1 + interpinfo $S1, 24 + say $S1 + exit 0 + +.end # __show_runtime_prefix_and_exit + + +.sub '__show_version_and_exit' :subid('WSubId_2') :anon + getinterp $P3 + $P1 = $P3[8] + set $S1, "This is Parrot version %s%s built for %s-%s\nCopyright (C) 2001-2011, Parrot Foundation.\n\nThis code is distributed under the terms of the Artistic License 2.0.\nFor more details, see the full text of the license in the LICENSE file\nincluded in the Parrot source tree\n" + root_new $P3, ['parrot';'ResizablePMCArray'] + assign $P3, 4 + $P4 = $P1["VERSION"] + $P3[0] = $P4 + $P5 = $P1["DEVEL"] + $P3[1] = $P5 + $P6 = $P1["cpuarch"] + $P3[2] = $P6 + $P7 = $P1["platform"] + $P3[3] = $P7 + sprintf $S2, $S1, $P3 + box $P2, $S2 + say $P2 + exit 0 + +.end # __show_version_and_exit + + +.sub '__show_help_and_exit' :subid('WSubId_3') :anon + set $S1, "parrot [Options] []\n Options:\n -h --help\n -V --version\n -I --include add path to include search\n -L --library add path to library search\n --hash-seed F00F specify hex value to use as hash seed\n -X --dynext add path to dynamic extension search\n \n -R --runcore slow|bounds|fast|subprof\n -R --runcore trace|profiling|gcdebug\n -t --trace [flags]\n \n -D --parrot-debug[=HEXFLAGS]\n --help-debug\n -w --warnings\n -G --no-gc\n -g --gc ms2|gms|ms|inf set GC type\n \n --gc-dynamic-threshold=percentage maximum memory wasted by GC\n --gc-min-threshold=KB\n \n --gc-nursery-size=percent of sysmem size of gen0 (default 2)\n --gc-debug\n --leak-test|--destroy-at-end\n -. --wait Read a keystroke before starting\n --runtime-prefix\n \n -d --imcc-debug[=HEXFLAGS]\n -v --verbose\n -E --pre-process-only\n -o --output=FILE\n --output-pbc\n -O --optimize[=LEVEL]\n -a --pasm\n -c --pbc\n -r --run-pbc\n -y --yydebug\n \nsee docs/running.pod for more\n" + say $S1 + exit 0 + +.end # __show_help_and_exit + + +.sub '__get_temporary_output_file' :subid('WSubId_6') :anon + .param string __ARG_1 + concat $S1, __ARG_1, ".pbc" + .return($S1) + +.end # __get_temporary_output_file + + +.sub '__usage_and_exit' :subid('WSubId_4') :anon + .param string __ARG_1 :optional + .param int __ARG_2 :opt_flag + getstderr $P1 + unless __ARG_2 goto __label_1 + concat $S1, __ARG_1, "\n" + $P1.'print'($S1) + __label_1: # endif + $P1.'print'("parrot -[acEGhrtvVwy.] [-d [FLAGS]] [-D [FLAGS]] ") + $P1.'print'("[-O [level]] [-[LIX] path] [-R runcore] [-o FILE] \n") + exit 1 + +.end # __usage_and_exit + +# End generated code diff --git a/frontend/parrot2/prt0.winxed b/frontend/parrot2/prt0.winxed new file mode 100644 index 0000000000..5ff636cac9 --- /dev/null +++ b/frontend/parrot2/prt0.winxed @@ -0,0 +1,246 @@ +$include_const "iglobals.pasm"; +$include_const "interpinfo.pasm"; +$include_const "except_severity.pasm"; + +const int NO_FILE = 0; +const int PASM_FILE = 1; +const int PIR_FILE = 2; +const int PBC_FILE = 3; +const int MODE_NORMAL = 0; +const int MODE_PREPROCESS = 1; +const int MODE_RUNFILE = 2; + +function __PARROT_ENTRY_MAIN__args[anon](var args) +{ + string exe_name; + ${ shift exe_name, args }; + string prog_name; + int input_file_type = NO_FILE; + string output_file = null; + var packfile_pmc = null; + string dummy; + int mode = MODE_NORMAL; + + while (elements(args) > 0) { + string sys_arg = args[0]; + switch (sys_arg) { + case "-o": + ${ shift dummy, args }; + ${ shift output_file, args }; + break; + case "-c": + ${ shift dummy, args }; + input_file_type = PBC_FILE; + break; + case "-r": + ${ shift dummy, args }; + mode = MODE_RUNFILE; + break; + case "-E": + ${ shift dummy, args }; + mode = MODE_PREPROCESS; + break; + case "--runtime-prefix": + __show_runtime_prefix_and_exit(); + case "-V": + __show_version_and_exit(); + case "-h": + __show_help_and_exit(); + default: + prog_name = sys_arg; + goto done_args; + } + } + done_args: + if (prog_name == null || prog_name == "") + __usage_and_exit("Missing program name"); + if (mode == MODE_PREPROCESS) { + compreg("PIR").preprocess(prog_name); + exit(0); + } + if (input_file_type == NO_FILE) { + input_file_type = __get_input_file_type(prog_name); + if (input_file_type == NO_FILE) + __usage_and_exit("Invalid file type " + prog_name); + } + if (mode == MODE_RUNFILE) { + string temp_outfile = __get_temporary_output_file(prog_name); + packfile_pmc = compreg("PIR").compile_file(prog_name); + packfile_pmc.write_to_file(temp_outfile); + packfile_pmc = new 'PackfileView'; + packfile_pmc.read_from_file(temp_outfile); + } + if (packfile_pmc == null) + packfile_pmc = __default_get_packfile(prog_name, input_file_type); + if (output_file != null) { + packfile_pmc.write_to_file(output_file); + exit(0); + } + for (var init_sub in packfile_pmc.subs_by_tag("init")) + init_sub(); + return packfile_pmc; +} + +function __PARROT_ENTRY_MAIN__[anon,main](var args) +{ + try [allowtailcall] { + var packfile_pmc = __PARROT_ENTRY_MAIN__args(args); + var main_sub = packfile_pmc.main_sub(); + return main_sub(args); + } catch (e) { + __handle_error_and_exit(e); + } +} + +function __default_get_packfile[anon](string file_name, int file_type) +{ + switch (file_type) { + case PIR_FILE: + var pir_compiler = compreg("PIR"); + var pf = pir_compiler.compile_file(file_name); + return pf; + case PASM_FILE: + var pasm_compiler = compreg("PASM"); + return pasm_compiler.compile_file(file_name); + case PBC_FILE: + var packfile_pmc = new 'PackfileView'; + packfile_pmc.read_from_file(file_name); + return packfile_pmc; + default: + return null; + } +} + +function __get_input_file_type[anon](string file_name) +{ + int len = length(file_name) - 4; + string ext = len >= 0 ? substr(file_name, len) : ''; + if (ext == ".pir") return PIR_FILE; + if (ext == ".pbc") return PBC_FILE; + if (len > 0) { + ext = substr(file_name, len - 1); + if (ext == ".pasm") return PASM_FILE; + } + return PIR_FILE; +} + +function __handle_error_and_exit[anon](var exception) +{ + int severity = exception.severity; + if (severity == EXCEPT_EXIT) + exit(exception.exit_code); + var stderr_pmc = getstderr(); + string message = exception.message; + if (message == null || message == "") + message = "No exception handler and no message"; + stderr_pmc.print(sprintf("%s\n", [message])); + + string line_sep = ""; + var bts = exception.backtrace_strings(); + for (int i = elements(bts) - 1; i >= 0; i--) { + string bt = bts[i]; + var lines = split("\n", bt); + for (string line in lines) { + if (indexof(line, "__PARROT_ENTRY_MAIN__") != -1) + continue; + stderr_pmc.print(sprintf("%s%s", [line_sep, line])); + line_sep = "\n"; + } + line_sep = "\nthrown from\n"; + } + + int exit_code = exception.exit_code; + if (exit_code == 0) + exit_code = 1; + exit(exit_code); +} + +function __show_runtime_prefix_and_exit[anon]() +{ + string runtime_prefix; + ${ interpinfo runtime_prefix, INTERPINFO_RUNTIME_PREFIX }; + say(runtime_prefix); + exit(0); +} + +function __show_version_and_exit[anon]() +{ + var config = getinterp()[IGLOBALS_CONFIG_HASH]; + string msg_fmt = <<: +This is Parrot version %s%s built for %s-%s +Copyright (C) 2001-2011, Parrot Foundation. + +This code is distributed under the terms of the Artistic License 2.0. +For more details, see the full text of the license in the LICENSE file +included in the Parrot source tree +:>> +; + var msg = sprintf(msg_fmt, [config["VERSION"], config["DEVEL"], config["cpuarch"], config["platform"]]); + say(msg); + exit(0); +} + +function __show_help_and_exit[anon]() +{ + string msg = <<: +parrot [Options] [] + Options: + -h --help + -V --version + -I --include add path to include search + -L --library add path to library search + --hash-seed F00F specify hex value to use as hash seed + -X --dynext add path to dynamic extension search + + -R --runcore slow|bounds|fast|subprof + -R --runcore trace|profiling|gcdebug + -t --trace [flags] + + -D --parrot-debug[=HEXFLAGS] + --help-debug + -w --warnings + -G --no-gc + -g --gc ms2|gms|ms|inf set GC type + + --gc-dynamic-threshold=percentage maximum memory wasted by GC + --gc-min-threshold=KB + + --gc-nursery-size=percent of sysmem size of gen0 (default 2) + --gc-debug + --leak-test|--destroy-at-end + -. --wait Read a keystroke before starting + --runtime-prefix + + -d --imcc-debug[=HEXFLAGS] + -v --verbose + -E --pre-process-only + -o --output=FILE + --output-pbc + -O --optimize[=LEVEL] + -a --pasm + -c --pbc + -r --run-pbc + -y --yydebug + +see docs/running.pod for more +:>> +; + say(msg); + exit(0); +} + +function __get_temporary_output_file[anon](string infile) +{ + # TODO: Do we need anything else? + return infile + ".pbc"; +} + +function __usage_and_exit[anon](string msg [optional], int has_msg [opt_flag]) +{ + var stderr = getstderr(); + if (has_msg) + stderr.print(msg + "\n"); + stderr.print("parrot -[acEGhrtvVwy.] [-d [FLAGS]] [-D [FLAGS]] "); + stderr.print("[-O [level]] [-[LIX] path] [-R runcore] [-o FILE] \n"); + exit(1); +} diff --git a/frontend/parrot_debugger/main.c b/frontend/parrot_debugger/main.c index 85991d990e..aaf40818ef 100644 --- a/frontend/parrot_debugger/main.c +++ b/frontend/parrot_debugger/main.c @@ -1,5 +1,6 @@ /* -Copyright (C) 2001-2010, Parrot Foundation. + +Copyright (C) 2001-2012, Parrot Foundation. =head1 NAME @@ -142,15 +143,30 @@ and C ops in F. #include #include #include "parrot/parrot.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, const char *argv[]); const unsigned char * Parrot_get_config_hash_bytes(void); int Parrot_get_config_hash_length(void); +/* HEADERIZER HFILE: none */ + +/* HEADERIZER BEGIN: static */ +/* Don't modify between HEADERIZER BEGIN / HEADERIZER END. Your changes will be lost. */ + +static void PDB_printwelcome(void); +static void PDB_run_code(PARROT_INTERP, int argc, ARGIN(const char *argv[])) + __attribute__nonnull__(1) + __attribute__nonnull__(3); + +#define ASSERT_ARGS_PDB_printwelcome __attribute__unused__ int _ASSERT_ARGS_CHECK = (0) +#define ASSERT_ARGS_PDB_run_code __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ + PARROT_ASSERT_ARG(interp) \ + , PARROT_ASSERT_ARG(argv)) +/* Don't modify between HEADERIZER BEGIN / HEADERIZER END. Your changes will be lost. */ +/* HEADERIZER END: static */ + + /* =item C @@ -169,14 +185,8 @@ main(int argc, const char *argv[]) Parrot_Interp interp; PDB_t *pdb; const char *scriptname = NULL; - const unsigned char * configbytes = Parrot_get_config_hash_bytes(); - const int configlength = Parrot_get_config_hash_length(); - interp = Parrot_new(NULL); - - Parrot_set_executable_name(interp, Parrot_str_new(interp, argv[0], 0)); - - Parrot_set_configuration_hash_legacy(interp, configlength, configbytes); + interp = Parrot_interp_new(NULL); Parrot_debugger_init(interp); pdb = interp->pdb; @@ -186,55 +196,58 @@ main(int argc, const char *argv[]) Parrot_block_GC_sweep(interp); nextarg = 1; - if (argv[nextarg] && strcmp(argv[nextarg], "--script") == 0) - { + if (argv[nextarg] && strcmp(argv[nextarg], "--script") == 0) { scriptname = argv [++nextarg]; ++nextarg; } if (argv[nextarg]) { - const char *filename = argv[nextarg]; - const char *ext = strrchr(filename, '.'); + const char * const filename = argv[nextarg]; + const char * const ext = strrchr(filename, '.'); if (ext && STREQ(ext, ".pbc")) { - Parrot_PackFile pf = Parrot_pbc_read(interp, filename, 0); + STRING * const filename_str = Parrot_str_new(interp, filename, 0); + PackFile * const pfraw = Parrot_pf_read_pbc_file(interp, filename_str); + Parrot_PackFile pf; + + if (pfraw == NULL) + return 1; - if (!pf) + pf = Parrot_pf_get_packfile_pmc(interp, pfraw, filename_str); + if (pf == NULL) return 1; - Parrot_pbc_load(interp, pf); - PackFile_fixup_subs(interp, PBC_MAIN, NULL); + Parrot_pf_set_current_packfile(interp, pf); + Parrot_pf_prepare_packfile_init(interp, pf); } else { - STRING *str = Parrot_str_new(interp, filename, 0); - Parrot_PackFile pf = Parrot_pf_get_packfile_pmc(interp, PackFile_new(interp, 0)); + STRING * const str = Parrot_str_new(interp, filename, 0); + Parrot_PackFile pf = Parrot_pf_get_packfile_pmc(interp, PackFile_new(interp, 0), str); + STRING * const compiler_s = Parrot_str_new(interp, "PIR", 0); + PMC * const compiler = Parrot_interp_get_compiler(interp, compiler_s); - Parrot_pbc_load(interp, pf); - Parrot_compile_file(interp, str, 0); + Parrot_pf_set_current_packfile(interp, pf); + + Parrot_interp_compile_file(interp, compiler, str); /*if (errmsg) Parrot_ex_throw_from_c_args(interp, NULL, 1, "Could not compile file");*/ /* load the source for debugger list */ PDB_load_source(interp, filename); - PackFile_fixup_subs(interp, PBC_MAIN, NULL); + Parrot_pf_prepare_packfile_init(interp, pf); } - } else { /* Generate some code to be able to enter into runloop */ - - STRING *compiler = Parrot_str_new_constant(interp, "PIR"); - STRING *errstr = NULL; - 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)) - Parrot_io_eprintf(interp, "%Ss\n", errstr); - else - if (PMC_IS_NULL(code)) - Parrot_warn(interp, PARROT_WARNINGS_NONE_FLAG, - "Unexpected compiler problem at debugger start"); + STRING * const compiler_s = Parrot_str_new_constant(interp, "PIR"); + PMC * const compiler = Parrot_interp_get_compiler(interp, compiler_s); + STRING * const source = Parrot_str_new_constant(interp, ".sub aux :main\nexit 0\n.end\n"); + PMC * const code = Parrot_interp_compile_string(interp, compiler, source); + + if (PMC_IS_NULL(code)) + Parrot_warn(interp, PARROT_WARNINGS_NONE_FLAG, + "Unexpected compiler problem at debugger start"); } Parrot_unblock_GC_mark(interp); @@ -263,8 +276,11 @@ Runs the code, catching exceptions if they are left unhandled. */ static void -PDB_run_code(PARROT_INTERP, int argc, const char *argv[]) +PDB_run_code(PARROT_INTERP, int argc, ARGIN(const char *argv[])) { + ASSERT_ARGS(PDB_run_code) + UNUSED(argc); + new_runloop_jump_point(interp); if (setjmp(interp->current_runloop->resume)) { free_runloop_jump_point(interp); @@ -274,7 +290,8 @@ PDB_run_code(PARROT_INTERP, int argc, const char *argv[]) /* Loop to avoid exiting at program end */ do { - Parrot_runcode(interp, argc, argv); + /* TODO: Replace this with Parrot_pf_execute_bytecode_program */ + /*Parrot_runcode(interp, argc, argv);*/ interp->pdb->state |= PDB_STOPPED; } while (! (interp->pdb->state & PDB_EXIT)); free_runloop_jump_point(interp); @@ -294,6 +311,7 @@ Prints out the welcome string. static void PDB_printwelcome(void) { + ASSERT_ARGS(PDB_printwelcome) fprintf(stderr, "Parrot " PARROT_VERSION " Debugger\n" "(Please note: the debugger is currently under reconstruction)\n"); diff --git a/frontend/pbc_disassemble/main.c b/frontend/pbc_disassemble/main.c index 0b06705ac7..8be33d07ed 100644 --- a/frontend/pbc_disassemble/main.c +++ b/frontend/pbc_disassemble/main.c @@ -1,6 +1,6 @@ /* -Copyright (C) 2001-2011, Parrot Foundation. +Copyright (C) 2001-2012, Parrot Foundation. =head1 NAME @@ -63,12 +63,6 @@ Writes output to C. * which in turn uses the C function from F. */ -/* Flags indicating the presence of the -b and -h command-line switches */ -typedef enum { - enum_DIS_BARE = 1, /* -b switch */ - enum_DIS_HEADER = 2 /* -h switch */ -} Parrot_disassemble_options; - /* Longopts option table */ static struct longopt_opt_decl options[] = { { '?', '?', OPTION_optional_FLAG, { "--help" } }, @@ -78,8 +72,16 @@ static struct longopt_opt_decl options[] = { { 0 , 0, OPTION_optional_FLAG, { NULL } } }; +/* HEADERIZER HFILE: none */ +/* HEADERIZER BEGIN: static */ +/* Don't modify between HEADERIZER BEGIN / HEADERIZER END. Your changes will be lost. */ + static void help(void); static void show_last_error_and_exit(Parrot_PMC interp); +#define ASSERT_ARGS_help __attribute__unused__ int _ASSERT_ARGS_CHECK = (0) +#define ASSERT_ARGS_show_last_error_and_exit __attribute__unused__ int _ASSERT_ARGS_CHECK = (0) +/* Don't modify between HEADERIZER BEGIN / HEADERIZER END. Your changes will be lost. */ +/* HEADERIZER END: static */ /* diff --git a/frontend/pbc_dump/main.c b/frontend/pbc_dump/main.c index b764555e8e..9a1daad1ac 100644 --- a/frontend/pbc_dump/main.c +++ b/frontend/pbc_dump/main.c @@ -1,5 +1,5 @@ /* -Copyright (C) 2001-2010, Parrot Foundation. +Copyright (C) 2001-2012, Parrot Foundation. =head1 NAME @@ -50,7 +50,56 @@ efficiency on reading non-native PBCs. #include "parrot/longopt.h" #include "parrot/oplib/ops.h" #include "parrot/oplib/core_ops.h" -#include "parrot/embed.h" + +/* HEADERIZER HFILE: none */ +/* HEADERIZER BEGIN: static */ +/* Don't modify between HEADERIZER BEGIN / HEADERIZER END. Your changes will be lost. */ + +static void const_dump(PARROT_INTERP, ARGIN(const PackFile_Segment *segp)) + __attribute__nonnull__(1) + __attribute__nonnull__(2); + +static void disas_dump(PARROT_INTERP, ARGIN(const PackFile_Segment *self)) + __attribute__nonnull__(1) + __attribute__nonnull__(2); + +static void help(void); +static void null_dir_dump(PARROT_INTERP, + ARGIN(const PackFile_Segment *self)) + __attribute__nonnull__(1) + __attribute__nonnull__(2); + +static void null_dump(PARROT_INTERP, ARGIN(const PackFile_Segment *self)) + __attribute__nonnull__(2); + +static void nums_dump(PARROT_INTERP, ARGIN(const PackFile_Segment *self)) + __attribute__nonnull__(1) + __attribute__nonnull__(2); + +static void PackFile_header_dump(PARROT_INTERP, ARGIN(const PackFile *pf)) + __attribute__nonnull__(1) + __attribute__nonnull__(2); + +#define ASSERT_ARGS_const_dump __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ + PARROT_ASSERT_ARG(interp) \ + , PARROT_ASSERT_ARG(segp)) +#define ASSERT_ARGS_disas_dump __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ + PARROT_ASSERT_ARG(interp) \ + , PARROT_ASSERT_ARG(self)) +#define ASSERT_ARGS_help __attribute__unused__ int _ASSERT_ARGS_CHECK = (0) +#define ASSERT_ARGS_null_dir_dump __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ + PARROT_ASSERT_ARG(interp) \ + , PARROT_ASSERT_ARG(self)) +#define ASSERT_ARGS_null_dump __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ + PARROT_ASSERT_ARG(self)) +#define ASSERT_ARGS_nums_dump __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ + PARROT_ASSERT_ARG(interp) \ + , PARROT_ASSERT_ARG(self)) +#define ASSERT_ARGS_PackFile_header_dump __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ + PARROT_ASSERT_ARG(interp) \ + , PARROT_ASSERT_ARG(pf)) +/* Don't modify between HEADERIZER BEGIN / HEADERIZER END. Your changes will be lost. */ +/* HEADERIZER END: static */ /* @@ -63,8 +112,9 @@ Dump the constant table. */ static void -const_dump(PARROT_INTERP, const PackFile_Segment *segp) +const_dump(PARROT_INTERP, ARGIN(const PackFile_Segment *segp)) { + ASSERT_ARGS(const_dump) Parrot_io_printf(interp, "%Ss => [\n", segp->name); PackFile_ConstTable_dump(interp, (const PackFile_ConstTable *)segp); Parrot_io_printf(interp, "],\n"); @@ -82,10 +132,11 @@ Disassemble and dump. */ static void -disas_dump(PARROT_INTERP, const PackFile_Segment *self) +disas_dump(PARROT_INTERP, ARGIN(const PackFile_Segment *self)) { + ASSERT_ARGS(disas_dump) const opcode_t *pc = self->data; - const PackFile_ByteCode_OpMapping *map = &((const PackFile_ByteCode *)self)->op_mapping; + const PackFile_ByteCode_OpMapping * const map = &((const PackFile_ByteCode *)self)->op_mapping; INTVAL i; Parrot_io_printf(interp, "%Ss => [ # %d ops at offs 0x%x\n", @@ -93,8 +144,8 @@ disas_dump(PARROT_INTERP, const PackFile_Segment *self) for (i = 0; i < map->n_libs; i++) { - INTVAL j, lib_num, table_num; - PackFile_ByteCode_OpMappingEntry *entry = &map->libs[i]; + INTVAL j; + const PackFile_ByteCode_OpMappingEntry * const entry = &map->libs[i]; Parrot_io_printf(interp, " map #%d => [\n", i); Parrot_io_printf(interp, " oplib: \"%s\" version %d.%d.%d (%d ops)\n", entry->lib->name, @@ -104,8 +155,8 @@ disas_dump(PARROT_INTERP, const PackFile_Segment *self) entry->n_ops); for (j = 0; j < map->libs[i].n_ops; j++) { - lib_num = entry->lib_ops[j]; - table_num = entry->table_ops[j]; + const INTVAL lib_num = entry->lib_ops[j]; + const INTVAL table_num = entry->table_ops[j]; Parrot_io_printf(interp, " %08lx => %08lx (%s)\n", table_num, lib_num, entry->lib->op_info_table[lib_num].full_name); } @@ -115,16 +166,17 @@ disas_dump(PARROT_INTERP, const PackFile_Segment *self) while (pc < self->data + self->size) { /* n can't be const; the ADD_OP_VAR_PART macro increments it */ size_t n = (size_t)interp->code->op_info_table[*pc]->op_count; - size_t i; + size_t j; /* trace_op_dump(interp, self->pf->src, pc); */ Parrot_io_printf(interp, " %04x: ", (int)(pc - self->data)); - for (i = 0; i < 6; ++i) - if (i < n) - Parrot_io_printf(interp, "%08lx ", (unsigned long)pc[i]); + for (j = 0; j < 6; ++j) { + if (j < n) + Parrot_io_printf(interp, "%08lx ", (unsigned long)pc[j]); else Parrot_io_printf(interp, " "); + } Parrot_io_printf(interp, "%s\n", interp->code->op_info_table[*pc]->full_name); @@ -148,8 +200,9 @@ Disassembles and dumps op names and line numbers only. */ static void -nums_dump(PARROT_INTERP, const PackFile_Segment *self) +nums_dump(PARROT_INTERP, ARGIN(const PackFile_Segment *self)) { + ASSERT_ARGS(nums_dump) const STRING *debug_name = Parrot_str_concat(interp, self->name, Parrot_str_new_constant(interp, "_DB")); const PackFile_Segment *debug = PackFile_find_segment(interp, @@ -183,8 +236,9 @@ Produces no output for the given segment type. */ static void -null_dump(SHIM_INTERP, const PackFile_Segment *self) +null_dump(SHIM_INTERP, ARGIN(const PackFile_Segment *self)) { + ASSERT_ARGS(null_dump) UNUSED(self); } @@ -201,8 +255,9 @@ output for the directory itself. */ static void -null_dir_dump(PARROT_INTERP, const PackFile_Segment *self) +null_dir_dump(PARROT_INTERP, ARGIN(const PackFile_Segment *self)) { + ASSERT_ARGS(null_dir_dump) const PackFile_Directory * const dir = (const PackFile_Directory *)self; size_t i; @@ -213,7 +268,7 @@ null_dir_dump(PARROT_INTERP, const PackFile_Segment *self) /* -=item C +=item C Dump the header. @@ -222,27 +277,31 @@ Dump the header. */ static void -PackFile_header_dump(PARROT_INTERP, PackFile *pf) +PackFile_header_dump(PARROT_INTERP, ARGIN(const PackFile *pf)) { + ASSERT_ARGS(PackFile_header_dump) + const PackFile_Header * const header = pf->header; + Parrot_io_printf(interp, "HEADER => [\n"); - Parrot_io_printf(interp, "\twordsize = %d", pf->header->wordsize); + Parrot_io_printf(interp, "\twordsize = %d", header->wordsize); Parrot_io_printf(interp, "\t(interpreter's wordsize/INTVAL = %d/%d)\n", sizeof (opcode_t), sizeof (INTVAL)); - Parrot_io_printf(interp, "\tbyteorder = %d", pf->header->byteorder); + Parrot_io_printf(interp, "\tbyteorder = %d", header->byteorder); Parrot_io_printf(interp, "\t(interpreter's byteorder = %d)\n", PARROT_BIGENDIAN); - Parrot_io_printf(interp, "\tfloattype = %d", pf->header->floattype); + Parrot_io_printf(interp, "\tfloattype = %d", header->floattype); Parrot_io_printf(interp, "\t(interpreter's NUMVAL_SIZE = %d)\n", NUMVAL_SIZE); Parrot_io_printf(interp, "\tparrot-version %d.%d.%d, " "bytecode-version %d.%d\n", - pf->header->major, pf->header->minor, pf->header->patch, - pf->header->bc_major, pf->header->bc_minor); + header->major, header->minor, header->patch, + header->bc_major, header->bc_minor); + Parrot_io_printf(interp, "\tUUID: type = %d, size = %d", - pf->header->uuid_type, pf->header->uuid_size); + header->uuid_type, header->uuid_size); - if (pf->header->uuid_size) - Parrot_io_printf(interp, ", '%s'\n", pf->header->uuid_data); + if (header->uuid_size > 0) + Parrot_io_printf(interp, ", '%s'\n", header->uuid_data); else Parrot_io_printf(interp, "\n"); @@ -251,7 +310,7 @@ PackFile_header_dump(PARROT_INTERP, PackFile *pf) pf->need_wordsize ? "**need**" : "no", pf->fetch_nv ? "**need**" : "no"); - Parrot_io_printf(interp, "\tdirformat = %d\n", pf->header->dir_format); + Parrot_io_printf(interp, "\tdirformat = %d\n", header->dir_format); Parrot_io_printf(interp, "]\n"); } @@ -266,7 +325,8 @@ Print out the user help info. */ -static void help(void) +static void +help(void) { printf("pbc_dump - dump or convert parrot bytecode (PBC) files\n"); printf("usage:\n"); @@ -313,6 +373,7 @@ main(int argc, const char **argv) Parrot_PackFile pfpmc; PackFile *pf; Interp *interp; + Parrot_String infilename; const char *file = NULL; int terse = 0; @@ -328,10 +389,10 @@ main(int argc, const char **argv) if (argc < 2) help(); - interp = Parrot_new(NULL); + interp = Parrot_interp_new(NULL); /* init and set top of stack */ - Parrot_init_stacktop(interp, &status); + Parrot_interp_init_stacktop(interp, &status); while ((status = longopt_get(argc, argv, opt_options, &opt)) > 0) { switch (opt.opt_id) { @@ -364,19 +425,19 @@ main(int argc, const char **argv) argc -= opt.opt_index; argv += opt.opt_index; - pfpmc = Parrot_pbc_read(interp, *argv, options); + infilename = Parrot_str_new(interp, *argv, 0); + pf = Parrot_pf_read_pbc_file(interp, infilename); - if (pfpmc == NULL) { + if (pf == NULL) { printf("Can't read PBC\n"); return 1; } - Parrot_pbc_load(interp, pfpmc); - pf = (PackFile*)VTABLE_get_pointer(interp, pfpmc); - + pfpmc = Parrot_pf_get_packfile_pmc(interp, pf, infilename); + Parrot_pf_set_current_packfile(interp, pfpmc); if (convert) { - size_t size = PackFile_pack_size(interp, + const size_t size = PackFile_pack_size(interp, interp->code->base.pf) * sizeof (opcode_t); opcode_t *pack = (opcode_t *)Parrot_gc_allocate_memory_chunk(interp, size); diff --git a/frontend/pbc_dump/packdump.c b/frontend/pbc_dump/packdump.c index 8b3a1df3b3..b191dd19ee 100644 --- a/frontend/pbc_dump/packdump.c +++ b/frontend/pbc_dump/packdump.c @@ -1,5 +1,5 @@ /* -Copyright (C) 2001-2009, Parrot Foundation. +Copyright (C) 2001-2012, Parrot Foundation. This program is free software. It is subject to the same license as Parrot itself. @@ -22,6 +22,10 @@ This is only used by the PBC dumper C. #include "parrot/parrot.h" #include "pmc/pmc_sub.h" #include "pmc/pmc_key.h" +#ifdef WIN32 +PMC *PMCNULL; +#endif + /* HEADERIZER HFILE: include/parrot/packfile.h */ @@ -161,7 +165,7 @@ pobj_flag_dump(PARROT_INTERP, long flags) if (printed_flag_p) Parrot_io_printf(interp, ","); Parrot_io_printf(interp, "%s", flag_bit_names[idx]); - ++printed_flag_p; + printed_flag_p = 1; } ++idx; flags >>= 1; @@ -224,6 +228,8 @@ PackFile_Constant_dump_pmc(PARROT_INTERP, ARGIN(const PackFile_ConstTable *ct), /* and now type / value per component */ for (key = self; key;) { opcode_t type = PObj_get_FLAGS(key); + INTVAL int_key; + GETATTR_Key_int_key(interp, key, int_key); Parrot_io_printf(interp, " {\n"); @@ -254,19 +260,19 @@ PackFile_Constant_dump_pmc(PARROT_INTERP, ARGIN(const PackFile_ConstTable *ct), 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)); + int_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", - VTABLE_get_integer(interp, key)); + int_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", - VTABLE_get_integer(interp, key)); + int_key); Parrot_io_printf(interp, " },\n"); break; default: diff --git a/frontend/pbc_merge/main.c b/frontend/pbc_merge/main.c index 8a8501f791..b9afddbd9e 100644 --- a/frontend/pbc_merge/main.c +++ b/frontend/pbc_merge/main.c @@ -42,7 +42,6 @@ segments from the input PBC files. #include "parrot/oplib/ops.h" #include "parrot/oplib/core_ops.h" #include "pmc/pmc_sub.h" -#include "parrot/embed.h" extern const unsigned char * Parrot_get_config_hash_bytes(void); extern int Parrot_get_config_hash_length(void); @@ -270,7 +269,7 @@ pbc_merge_bytecode(PARROT_INTERP, ARGMOD(pbc_merge_input **inputs), bc_seg->main_sub = in_seg->main_sub + inputs[i]->pmc.const_start; /* XXX hide incessant warning messages triggered by implicit :main - this can be added when TT #1704 is implemented + this can be added when GH #571 is implemented else Parrot_io_eprintf(interp, @@ -701,9 +700,9 @@ pbc_merge_begin(PARROT_INTERP, ARGMOD(pbc_merge_input **inputs), int num_inputs) PackFile_Directory *pf_dir = &inputs[i]->pf->directory; unsigned int j = 0; for (j = 0; j < pf_dir->num_segments; ++j) { - PackFile_Segment *seg = (PackFile_Segment *)pf_dir->segments[j]; + const PackFile_Segment * const seg = pf_dir->segments[j]; if (seg->type == PF_CONST_SEG) { - PackFile_ConstTable *ct = (PackFile_ConstTable *)seg; + const PackFile_ConstTable * const ct = (PackFile_ConstTable *)seg; inputs[i]->num.const_map = mem_gc_allocate_n_typed(interp, ct->num.const_count, opcode_t); inputs[i]->str.const_map = mem_gc_allocate_n_typed(interp, ct->str.const_count, @@ -804,17 +803,10 @@ main(int argc, const char **argv) int i; const char *output_file = NULL; struct longopt_opt_info opt = LONGOPT_OPT_INFO_INIT; - Interp * const interp = Parrot_new(NULL); + Interp * const interp = Parrot_interp_new(NULL); STRING * pbcname = NULL; PMC * pbcpmc = NULL; - { - const int config_length = Parrot_get_config_hash_length(); - const unsigned char * const config_bytes = - Parrot_get_config_hash_bytes(); - Parrot_set_configuration_hash_legacy(interp, config_length, config_bytes); - } - Parrot_block_GC_mark(interp); /* Get options, ensuring we have at least one input @@ -858,7 +850,7 @@ main(int argc, const char **argv) strlen(input_files[i]->filename)); { PackFile * const pf = Parrot_pf_read_pbc_file(interp, pbcname); - pbcpmc = Parrot_pf_get_packfile_pmc(interp, pf); + pbcpmc = Parrot_pf_get_packfile_pmc(interp, pf, pbcname); } /* Load the packfile and unpack it. */ diff --git a/include/parrot/alarm.h b/include/parrot/alarm.h new file mode 100644 index 0000000000..739b6bfbc8 --- /dev/null +++ b/include/parrot/alarm.h @@ -0,0 +1,43 @@ +/* +Copyright (C) 2010, Parrot Foundation. +$Id$ +*/ + +#ifndef PARROT_ALARM_H_GUARD +#define PARROT_ALARM_H_GUARD + +/* HEADERIZER BEGIN: src/alarm.c */ +/* Don't modify between HEADERIZER BEGIN / HEADERIZER END. Your changes will be lost. */ + +PARROT_EXPORT +int Parrot_alarm_check(ARGMOD(UINTVAL* last_serial)) + __attribute__nonnull__(1) + FUNC_MODIFIES(* last_serial); + +PARROT_EXPORT +void Parrot_alarm_set(FLOATVAL when); + +void Parrot_alarm_callback(int sig_number); +void Parrot_alarm_init(void); +void Parrot_alarm_mask(PARROT_INTERP); +void Parrot_alarm_now(void); +void Parrot_alarm_unmask(PARROT_INTERP); +#define ASSERT_ARGS_Parrot_alarm_check __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ + PARROT_ASSERT_ARG(last_serial)) +#define ASSERT_ARGS_Parrot_alarm_set __attribute__unused__ int _ASSERT_ARGS_CHECK = (0) +#define ASSERT_ARGS_Parrot_alarm_callback __attribute__unused__ int _ASSERT_ARGS_CHECK = (0) +#define ASSERT_ARGS_Parrot_alarm_init __attribute__unused__ int _ASSERT_ARGS_CHECK = (0) +#define ASSERT_ARGS_Parrot_alarm_mask __attribute__unused__ int _ASSERT_ARGS_CHECK = (0) +#define ASSERT_ARGS_Parrot_alarm_now __attribute__unused__ int _ASSERT_ARGS_CHECK = (0) +#define ASSERT_ARGS_Parrot_alarm_unmask __attribute__unused__ int _ASSERT_ARGS_CHECK = (0) +/* Don't modify between HEADERIZER BEGIN / HEADERIZER END. Your changes will be lost. */ +/* HEADERIZER END: src/alarm.c */ + +#endif /* PARROT_ALARM_H_GUARD */ + +/* + * Local variables: + * c-file-style: "parrot" + * End: + * vim: expandtab shiftwidth=4 cinoptions='\:2=2' : + */ diff --git a/include/parrot/api.h b/include/parrot/api.h index 19dc740a42..8e6c331c51 100644 --- a/include/parrot/api.h +++ b/include/parrot/api.h @@ -1,5 +1,5 @@ /* api.h - * Copyright (C) 2001-2010, Parrot Foundation. + * Copyright (C) 2001-2012, Parrot Foundation. * Overview: * Parrot's external embedding API. This functionality is only to be used * by embedding applications, and only this functionality may be used by @@ -17,6 +17,16 @@ typedef Parrot_PMC (*imcc_hack_func_t)(Parrot_PMC, Parrot_String, int, const char **); +PARROT_EXPORT +PARROT_WARN_UNUSED_RESULT +PARROT_CONST_FUNCTION +const unsigned char * get_program_code(void); + +PARROT_EXPORT +PARROT_WARN_UNUSED_RESULT +PARROT_CONST_FUNCTION +size_t get_program_code_size(void); + /* Forward declaration of Parrot_confess. We can't include exceptions.h yet */ PARROT_EXPORT PARROT_DOES_NOT_RETURN @@ -54,6 +64,11 @@ Parrot_confess(ARGIN(const char *cond), ARGIN(const char *file), unsigned int li #endif /* NDEBUG */ +/* Static assertions are checked at compile type */ +#define PARROT_STATIC_ASSERT_HELPER(COND, MSG) typedef char static_assertion_##MSG[(!!(COND))*2-1] +#define PARROT_STATIC_ASSERT3(X, L) PARROT_STATIC_ASSERT_HELPER(X, at_line_##L) +#define PARROT_STATIC_ASSERT2(X, L) PARROT_STATIC_ASSERT3(X, L) +#define PARROT_STATIC_ASSERT(X) PARROT_STATIC_ASSERT2((X), __LINE__) typedef struct _Parrot_Init_Args { void *stacktop; @@ -119,25 +134,25 @@ PARROT_API Parrot_Int Parrot_api_get_exception_backtrace( Parrot_PMC interp_pmc, Parrot_PMC exception, - ARGOUT(Parrot_String * bt)) + ARGOUT(Parrot_String *bt)) __attribute__nonnull__(3) - FUNC_MODIFIES(* bt); + FUNC_MODIFIES(*bt); PARROT_API Parrot_Int Parrot_api_get_result( Parrot_PMC interp_pmc, ARGOUT(Parrot_Int *is_error), - ARGOUT(Parrot_PMC * exception), + ARGOUT(Parrot_PMC *exception), ARGOUT(Parrot_Int *exit_code), - ARGOUT(Parrot_String * errmsg)) + ARGOUT(Parrot_String *errmsg)) __attribute__nonnull__(2) __attribute__nonnull__(3) __attribute__nonnull__(4) __attribute__nonnull__(5) FUNC_MODIFIES(*is_error) - FUNC_MODIFIES(* exception) + FUNC_MODIFIES(*exception) FUNC_MODIFIES(*exit_code) - FUNC_MODIFIES(* errmsg); + FUNC_MODIFIES(*errmsg); PARROT_API Parrot_Int Parrot_api_get_runtime_path( @@ -184,7 +199,7 @@ Parrot_Int Parrot_api_set_configuration_hash( PARROT_API Parrot_Int Parrot_api_set_executable_name( Parrot_PMC interp_pmc, - ARGIN(const char * name)) + ARGIN(const char *name)) __attribute__nonnull__(2); PARROT_API @@ -314,7 +329,7 @@ PARROT_API Parrot_Int Parrot_api_run_bytecode( Parrot_PMC interp_pmc, Parrot_PMC pbc, - Parrot_PMC mainargs); + Parrot_PMC args); PARROT_API Parrot_Int Parrot_api_serialize_bytecode_pmc( @@ -484,6 +499,14 @@ Parrot_Int Parrot_api_string_import_wchar( /* HEADERIZER BEGIN: src/embed/pmc.c */ /* Don't modify between HEADERIZER BEGIN / HEADERIZER END. Your changes will be lost. */ +PARROT_API +Parrot_Int Parrot_api_pmc_box_float( + Parrot_PMC interp_pmc, + Parrot_Float value, + ARGOUT(Parrot_PMC * float_pmc)) + __attribute__nonnull__(3) + FUNC_MODIFIES(* float_pmc); + PARROT_API Parrot_Int Parrot_api_pmc_box_integer( Parrot_PMC interp_pmc, @@ -716,6 +739,8 @@ Parrot_Int Parrot_api_pmc_wrap_string_array( __attribute__nonnull__(4) FUNC_MODIFIES(* args); +#define ASSERT_ARGS_Parrot_api_pmc_box_float __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ + PARROT_ASSERT_ARG(float_pmc)) #define ASSERT_ARGS_Parrot_api_pmc_box_integer __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ PARROT_ASSERT_ARG(int_pmc)) #define ASSERT_ARGS_Parrot_api_pmc_box_string __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ diff --git a/include/parrot/atomic.h b/include/parrot/atomic.h deleted file mode 100644 index 189c790c21..0000000000 --- a/include/parrot/atomic.h +++ /dev/null @@ -1,87 +0,0 @@ -/* atomic.h - * Copyright (C) 2006-2008, Parrot Foundation. - * Overview: - * This header implements portable atomic operations. - * Data Structure and Algorithms: - * History: - * Notes: - * References: - */ - - -#ifndef PARROT_ATOMIC_H_GUARD -#define PARROT_ATOMIC_H_GUARD - -# include "parrot/has_header.h" - -#ifdef PARROT_HAS_THREADS -# if defined(PARROT_HAS_I386_GCC_CMPXCHG) -# include "parrot/atomic/gcc_x86.h" -# elif defined(PARROT_HAS_PPC_GCC_CMPSET) -# include "parrot/atomic/gcc_pcc.h" -# elif defined(PARROT_HAS_SPARC_ATOMIC) -# include "parrot/atomic/sparc.h" -# else -# include "parrot/atomic/fallback.h" -# endif -#else -typedef struct Parrot_atomic_pointer { - void *val; -} Parrot_atomic_pointer; - -typedef struct Parrot_atomic_integer { - INTVAL val; -} Parrot_atomic_integer; - -# define PARROT_ATOMIC_PTR_INIT(a) -# define PARROT_ATOMIC_PTR_GET(result, a) (result) = (a).val -# define PARROT_ATOMIC_PTR_SET(a, b) (a).val = (b) - -/* a is the Parrot_atomic. - * expect is the value we expect the atomic to be holding, - * update is the new value for the atomic - * result will be 1 if the value was as expected (and thus - * the update was performed) and 0 otherwise - */ -# define PARROT_ATOMIC_PTR_CAS(result, a, expect, update) \ - do { \ - void * orig; \ - PARROT_ATOMIC_PTR_GET(orig, (a)); \ - if ((expect) == (orig)) { \ - PARROT_ATOMIC_PTR_SET((a), (update)); \ - (result) = 1; \ - } \ - else { \ - (result) = 0; \ - } \ - } while (0) -# define PARROT_ATOMIC_PTR_DESTROY(a) -# define PARROT_ATOMIC_INT_INIT(a) -# define PARROT_ATOMIC_INT_DESTROY(a) -# define PARROT_ATOMIC_INT_GET(result, a) (result) = (a).val -# define PARROT_ATOMIC_INT_SET(a, value) (a).val = (value) -# define PARROT_ATOMIC_INT_CAS(result, a, expect, update) \ - do { \ - INTVAL orig; \ - PARROT_ATOMIC_INT_GET(orig, (a)); \ - if ((expect) == (orig)) { \ - PARROT_ATOMIC_INT_SET((a), (update)); \ - (result) = 1; \ - } \ - else { \ - (result) = 0; \ - } \ - } while (0) -# define PARROT_ATOMIC_INT_INC(result, a) ((result) = ++(a).val) -# define PARROT_ATOMIC_INT_DEC(result, a) ((result) = --(a).val) - -#endif /* PARROT_HAS_THREADS */ - -#endif /* PARROT_ATOMIC_H_GUARD */ - -/* - * Local variables: - * c-file-style: "parrot" - * End: - * vim: expandtab shiftwidth=4 cinoptions='\:2=2' : - */ diff --git a/include/parrot/atomic/fallback.h b/include/parrot/atomic/fallback.h deleted file mode 100644 index ce533b072d..0000000000 --- a/include/parrot/atomic/fallback.h +++ /dev/null @@ -1,121 +0,0 @@ -/* atomic/fallback.h - * Copyright (C) 2006, Parrot Foundation. - * Overview: - * This header provides an implementation of atomic - * operations in terms of threading primitives. - * Data Structure and Algorithms: - * History: - * Notes: - * References: - */ - -#ifndef PARROT_ATOMIC_FALLBACK_H_GUARD -#define PARROT_ATOMIC_FALLBACK_H_GUARD - -typedef struct Parrot_atomic_pointer { - void *val; - Parrot_mutex lock; -} Parrot_atomic_pointer; - -typedef struct Parrot_atomic_integer { - INTVAL val; - Parrot_mutex lock; -} Parrot_atomic_integer; - - -# define PARROT_ATOMIC_PTR_GET(result, a) \ - do { \ - LOCK((a).lock); \ - (result) = (a).val; \ - UNLOCK((a).lock); \ - } while (0) - -# define PARROT_ATOMIC_INT_GET(result, a) \ - do { \ - LOCK((a).lock); \ - (result) = (a).val; \ - UNLOCK((a).lock); \ - } while (0) - -# define PARROT_ATOMIC_PTR_SET(a, b) \ - do { \ - LOCK((a).lock); \ - (a).val = (b); \ - UNLOCK((a).lock); \ - } while (0) - -# define PARROT_ATOMIC_INT_SET(a, b) \ - do { \ - LOCK((a).lock); \ - (a).val = (b); \ - UNLOCK((a).lock); \ - } while (0) - -# define PARROT_ATOMIC_INT_INC(result, a) \ - do { \ - LOCK((a).lock); \ - (result) = ++(a).val; \ - UNLOCK((a).lock); \ - } while (0) - -# define PARROT_ATOMIC_INT_DEC(result, a) \ - do { \ - LOCK((a).lock); \ - (result) = --(a).val; \ - UNLOCK((a).lock); \ - } while (0) - -# define PARROT_ATOMIC_PTR_CAS(result, a, expect, update) \ - do { \ - LOCK((a).lock); \ - if ((a).val == (expect)) { \ - (a).val = (update); \ - (result) = 1; \ - } \ - else { \ - (result) = 0; \ - } \ - UNLOCK((a).lock); \ - } while (0) - -# define PARROT_ATOMIC_INT_CAS(result, a, expect, update) \ - do { \ - LOCK((a).lock); \ - if ((a).val == (expect)) { \ - (a).val = (update); \ - (result) = 1; \ - } \ - else { \ - (result) = 0; \ - } \ - UNLOCK((a).lock); \ - } while (0) - -# define PARROT_ATOMIC_PTR_INIT(a) \ - do { \ - MUTEX_INIT((a).lock); \ - } while (0) - -# define PARROT_ATOMIC_PTR_DESTROY(a) \ - do { \ - MUTEX_DESTROY((a).lock); \ - } while (0) - -# define PARROT_ATOMIC_INT_INIT(a) \ - do { \ - MUTEX_INIT((a).lock); \ - } while (0) - -# define PARROT_ATOMIC_INT_DESTROY(a) \ - do { \ - MUTEX_DESTROY((a).lock); \ - } while (0) - -#endif /* PARROT_ATOMIC_FALLBACK_H_GUARD */ - -/* - * Local variables: - * c-file-style: "parrot" - * End: - * vim: expandtab shiftwidth=4 cinoptions='\:2=2' : - */ diff --git a/include/parrot/atomic/gcc_pcc.h b/include/parrot/atomic/gcc_pcc.h deleted file mode 100644 index 7755a4fd48..0000000000 --- a/include/parrot/atomic/gcc_pcc.h +++ /dev/null @@ -1,147 +0,0 @@ -/* atomic/gcc_pcc.h - * Copyright (C) 2006-2010, Parrot Foundation. - * Overview: - * This header provides an implementation of atomic - * operations on PowerPC platforms with GCC-style - * inline assembly suppport. - * Data Structure and Algorithms: - * History: - * Notes: - * References: - */ - -#ifndef PARROT_ATOMIC_GCC_PCC_H_GUARD -#define PARROT_ATOMIC_GCC_PCC_H_GUARD - -typedef struct Parrot_atomic_pointer { - void * volatile val; -} Parrot_atomic_pointer; - -# define PARROT_ATOMIC_PTR_GET(result, a) (result) = (void *) (a).val - -# define PARROT_ATOMIC_PTR_SET(a, b) (a).val = (void *) (b) - -/* - -=over 4 - -=item C - -Generate ppc cmpset - -=cut - -*/ -inline static void *parrot_ppc_cmpset(void * volatile *ptr, - void *expect, void *update) -{ - void *tmp; - /* see http://www-128.ibm.com/developerworks/linux/library/pa-atom/ */ - __asm__ __volatile__(/*%0 = tmp, %1 = ptr, %2 = old, %3 = new */ - "1: lwarx %0, 0, %1\n" /* tmp = *ptr, with reservation */ - " cmpw %2, %0\n" /* tmp == old ? */ - " bne 2f\n" /* no, goto flush reservation, end */ - /* " sync\n" -- XXX needed on PPC 405, see - * http://www.kegel.com/xgcc3/ppc405erratum77.html */ - " stwcx. %3, 0, %1\n" /* store new using reservation */ - " bne- 1b\n" /* spin on failure of reservation; - is branch prediction hint */ - " b 3f\n" "2: stwcx. %0, 0, %1\n" /* flush reservation */ - "3: \n" /* end label */ - : /* output */ - "=&r"(tmp) - : /* input */ - "r"(ptr), "r"(expect), "r"(update) - : /* clobber */ - "memory"); - return tmp; -} - -/* - -=item C - -Generate ppc add - -=back - -=cut - -*/ - -inline static long parrot_ppc_add(volatile long *val, long what) -{ - long tmp; - __asm__ __volatile__(/*%0 = tmp, %1 = val, %2 = what */ - "1: lwarx %0, 0, %1\n" /* tmp = *val, with reservation */ - " add %0, %0, %2\n" /* tmp += what */ - /* " sync\n" -- XXX needed on PPC 405, see - * http://www.kegel.com/xgcc3/ppc405erratum77.html */ - " stwcx. %0, 0, %1\n" /* *val <- tmp using reservation */ - " bne- 1b\n" /* spin on failure of reservation; - is branch prediction hint */ - "2: \n" /* end label */ - : /* output */ - "=&r"(tmp) - : /* input */ - "r"(val), "r"(what) - : /* clobber */ - "memory"); - return tmp; -} - -# define PARROT_ATOMIC_PTR_CAS(result, a, expect, update) \ - do { \ - if (parrot_ppc_cmpset(&(a).val, (expect), (update)) == (expect)) { \ - (result) = 1; \ - } \ - else { \ - (result) = 0; \ - } \ - } while (0) - -# define PARROT_ATOMIC_PTR_INIT(a) - -# define PARROT_ATOMIC_PTR_DESTROY(a) - -typedef struct Parrot_atomic_integer { - volatile long val; -} Parrot_atomic_integer; - -# define PARROT_ATOMIC_INT_INIT(a) - -# define PARROT_ATOMIC_INT_DESTROY(a) - -# define PARROT_ATOMIC_INT_GET(result, a) ((result) = (a).val) - -# define PARROT_ATOMIC_INT_SET(a, b) ((a).val = (b)) - -# define PARROT_ATOMIC_INT_CAS(result, a, expect, update) \ - do { \ - if (parrot_ppc_cmpset(\ - (void * volatile *) &(a).val, (void *) (expect), \ - (void *) (update)) == (void *) (expect)) { \ - (result) = 1; \ - } \ - else { \ - (result) = 0; \ - } \ - } while (0) - -# define PARROT_ATOMIC_INT_INC(result, a) \ - do { \ - (result) = parrot_ppc_add(&(a).val, 1); \ - } while (0) - -# define PARROT_ATOMIC_INT_DEC(result, a) \ - do { \ - (result) = parrot_ppc_add(&(a).val, -1); \ - } while (0) - -#endif /* PARROT_ATOMIC_GCC_PCC_H_GUARD */ - -/* - * Local variables: - * c-file-style: "parrot" - * End: - * vim: expandtab shiftwidth=4 cinoptions='\:2=2' : - */ diff --git a/include/parrot/atomic/gcc_x86.h b/include/parrot/atomic/gcc_x86.h deleted file mode 100644 index 433aab7e16..0000000000 --- a/include/parrot/atomic/gcc_x86.h +++ /dev/null @@ -1,113 +0,0 @@ -/* atomic/gcc_x86.h - * Copyright (C) 2006-2008, Parrot Foundation. - * Overview: - * This header provides an implementation of atomic - * operations on x86 platforms with GCC-style - * inline assembly suppport. - * Data Structure and Algorithms: - * History: - * Notes: - * References: - */ - -#ifndef PARROT_ATOMIC_GCC_X86_H_GUARD -#define PARROT_ATOMIC_GCC_X86_H_GUARD - -/* HEADERIZER BEGIN: src/atomic/gcc_x86.c */ -/* Don't modify between HEADERIZER BEGIN / HEADERIZER END. Your changes will be lost. */ - -PARROT_EXPORT -PARROT_CANNOT_RETURN_NULL -void * parrot_i386_cmpxchg( - ARGMOD(void *volatile *ptr), - ARGIN_NULLOK(void *expect), - ARGIN_NULLOK(void *update)) - __attribute__nonnull__(1) - FUNC_MODIFIES(*ptr); - -PARROT_EXPORT -long parrot_i386_xadd(ARGIN(volatile long *l), long amount) - __attribute__nonnull__(1); - -#define ASSERT_ARGS_parrot_i386_cmpxchg __attribute__unused__ int _ASSERT_ARGS_CHECK = \ - PARROT_ASSERT_ARG(ptr) -#define ASSERT_ARGS_parrot_i386_xadd __attribute__unused__ int _ASSERT_ARGS_CHECK = \ - PARROT_ASSERT_ARG(l) -/* Don't modify between HEADERIZER BEGIN / HEADERIZER END. Your changes will be lost. */ -/* HEADERIZER END: src/atomic/gcc_x86.c */ - -typedef struct Parrot_atomic_pointer { - void *volatile val; -} Parrot_atomic_pointer; - -typedef struct Parrot_atomic_integer { - volatile long val; -} Parrot_atomic_integer; - -/* - * if both I386 and X86_64 cmpxchg are defined, we are on x86_64 - - * reuse existing code - */ -PARROT_INLINE -void *parrot_i386_cmpxchg(void *volatile *ptr, void *expect, - void *update); - -#define PARROT_ATOMIC_PTR_GET(result, a) ((result) = (a).val) - -#define PARROT_ATOMIC_PTR_SET(a, b) ((a).val = (b)) - -#define PARROT_ATOMIC_PTR_CAS(result, a, expect, update) \ - do { \ - if ((expect) == parrot_i386_cmpxchg(&(a).val, (expect), (update))) { \ - (result) = 1; \ - } \ - else { \ - (result) = 0; \ - } \ - } while (0) - -#define PARROT_ATOMIC_PTR_INIT(a) - -#define PARROT_ATOMIC_PTR_DESTROY(a) - -#define PARROT_ATOMIC_INT_INIT(a) - -#define PARROT_ATOMIC_INT_DESTROY(a) - -#define PARROT_ATOMIC_INT_GET(result, a) ((result) = (a).val) - -#define PARROT_ATOMIC_INT_SET(a, b) ((a).val = (b)) - -#define PARROT_ATOMIC_INT_CAS(result, a, expect, update) \ - do { \ - void *res = parrot_i386_cmpxchg((void * volatile *) &(a).val, \ - (void *) (expect), (void *) (update)); \ - if ((expect) == (long)res) { \ - (result) = 1; \ - } \ - else { \ - (result) = 0; \ - } \ - } while (0) - -PARROT_INLINE -long parrot_i386_xadd(volatile long *l, long amount); - -#define PARROT_ATOMIC_INT_INC(result, a) \ - do { \ - (result) = parrot_i386_xadd(&(a).val, 1); \ - } while (0) - -#define PARROT_ATOMIC_INT_DEC(result, a) \ - do { \ - (result) = parrot_i386_xadd(&(a).val, -1); \ - } while (0) - -#endif /* PARROT_ATOMIC_GCC_X86_H_GUARD */ - -/* - * Local variables: - * c-file-style: "parrot" - * End: - * vim: expandtab shiftwidth=4 cinoptions='\:2=2' : - */ diff --git a/include/parrot/atomic/sparc.h b/include/parrot/atomic/sparc.h deleted file mode 100644 index 12c65d3fc4..0000000000 --- a/include/parrot/atomic/sparc.h +++ /dev/null @@ -1,91 +0,0 @@ -/* atomic/sparc.h - * Copyright (C) 2006-2008, Parrot Foundation. - * Overview: - * This header provides an implementation of atomic - * operations on Sparc V8plus and better platforms. - * It relies on an assembler file. - * Data Structure and Algorithms: - * History: - * Notes: - * References: - */ - -#ifndef PARROT_ATOMIC_SPARC_H_GUARD -#define PARROT_ATOMIC_SPARC_H_GUARD - -extern int parrot_sparc_cas32(Parrot_UInt4 *value, Parrot_UInt4 old, Parrot_UInt4 new); -/* NB cas64 _will_ be broken when PTR_SIZE == 4 */ -#if PTR_SIZE == 8 -# if INTVAL_SIZE != 8 -# error Expected 8-byte wide INTVAL. -# endif -extern int parrot_sparc_cas64(INTVAL *value, INTVAL old, INTVAL new); -#endif - -typedef struct Parrot_atomic_pointer { - void * volatile val; -} Parrot_atomic_pointer; - -#define PARROT_ATOMIC_PTR_GET(result, a) ((result) = (a).val) - -#define PARROT_ATOMIC_PTR_SET(a, b) ((a).val = (b)) - -#if PTR_SIZE == 8 -# define PARROT_ATOMIC_PTR_CAS(result, a, expect, update) \ - do { \ - (result) = parrot_sparc_cas64((INTVAL *) &(a).val, \ - (INTVAL) (expect), (INTVAL) (update)); \ - } while (0) -#else -# define PARROT_ATOMIC_PTR_CAS(result, a, expect, update) \ - do { \ - (result) = parrot_sparc_cas32((Parrot_UInt4 *) &(a).val, \ - (Parrot_UInt4) (expect), (Parrot_UInt4) (update)); \ - } while (0) -#endif - -#define PARROT_ATOMIC_PTR_INIT(a) - -#define PARROT_ATOMIC_PTR_DESTROY(a) - -typedef struct Parrot_atomic_integer { - volatile Parrot_Int4 val; -} Parrot_atomic_integer; - -#define PARROT_ATOMIC_INT_INIT(a) - -#define PARROT_ATOMIC_INT_DESTROY(a) - -#define PARROT_ATOMIC_INT_GET(result, a) ((result) = (a).val) - -#define PARROT_ATOMIC_INT_SET(a, b) ((a).val = (b)) - -#define PARROT_ATOMIC_INT_CAS(result, a, expect, update) \ - do { \ - (result) = parrot_sparc_cas32((Parrot_UInt4*) &(a).val, \ - (Parrot_UInt4) (expect), (Parrot_UInt4) (update)); \ - } while (0) - -#define parrot_sparc_atomic_int_add(result, a, what) \ - do { \ - int successp; \ - Parrot_Int4 old; \ - do { \ - old = (a).val; \ - PARROT_ATOMIC_INT_CAS(successp, (a), old, old + (what)); \ - } while (!successp); \ - (result) = (old) + (what); \ - } while (0) - - -#define PARROT_ATOMIC_INT_DEC(result, a) parrot_sparc_atomic_int_add((result), (a), -1) -#define PARROT_ATOMIC_INT_INC(result, a) parrot_sparc_atomic_int_add((result), (a), 1) - -#endif /* PARROT_ATOMIC_SPARC_H_GUARD */ - -/* - * Local variables: - * c-file-style: "parrot" - * End: - * vim: expandtab shiftwidth=4 cinoptions='\:2=2' : - */ diff --git a/include/parrot/call.h b/include/parrot/call.h index 24edb883ec..7ca5d57da1 100644 --- a/include/parrot/call.h +++ b/include/parrot/call.h @@ -122,6 +122,9 @@ void new_runloop_jump_point(PARROT_INTERP) void destroy_runloop_jump_points(PARROT_INTERP) __attribute__nonnull__(1); +void reset_runloop_id_counter(PARROT_INTERP) + __attribute__nonnull__(1); + void runops(PARROT_INTERP, size_t offs) __attribute__nonnull__(1); @@ -131,6 +134,8 @@ void runops(PARROT_INTERP, size_t offs) PARROT_ASSERT_ARG(interp)) #define ASSERT_ARGS_destroy_runloop_jump_points __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ PARROT_ASSERT_ARG(interp)) +#define ASSERT_ARGS_reset_runloop_id_counter __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ + PARROT_ASSERT_ARG(interp)) #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. */ @@ -410,6 +415,13 @@ PARROT_CAN_RETURN_NULL PMC* Parrot_pcc_get_sub(PARROT_INTERP, ARGIN(const PMC *ctx)) __attribute__nonnull__(2); +PARROT_EXPORT +void Parrot_pcc_reuse_continuation(PARROT_INTERP, + ARGIN(PMC *call_context), + ARGIN_NULLOK(opcode_t *next)) + __attribute__nonnull__(1) + __attribute__nonnull__(2); + PARROT_EXPORT void Parrot_pcc_set_context_func(PARROT_INTERP, ARGIN(PMC *ctx)) __attribute__nonnull__(1) @@ -431,13 +443,6 @@ void Parrot_pcc_set_regs_ps(PARROT_INTERP, __attribute__nonnull__(2) __attribute__nonnull__(3); -PARROT_EXPORT -void Parrot_pcc_set_regs_used(PARROT_INTERP, - ARGIN(PMC *ctx), - int type, - INTVAL num) - __attribute__nonnull__(2); - PARROT_EXPORT void Parrot_pcc_set_sub(PARROT_INTERP, ARGIN(PMC *ctx), @@ -517,6 +522,9 @@ PMC * Parrot_set_new_context(PARROT_INTERP, , PARROT_ASSERT_ARG(ctx)) #define ASSERT_ARGS_Parrot_pcc_get_sub __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ PARROT_ASSERT_ARG(ctx)) +#define ASSERT_ARGS_Parrot_pcc_reuse_continuation __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ + PARROT_ASSERT_ARG(interp) \ + , PARROT_ASSERT_ARG(call_context)) #define ASSERT_ARGS_Parrot_pcc_set_context_func __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ PARROT_ASSERT_ARG(interp) \ , PARROT_ASSERT_ARG(ctx)) @@ -526,8 +534,6 @@ PMC * Parrot_set_new_context(PARROT_INTERP, #define ASSERT_ARGS_Parrot_pcc_set_regs_ps __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ 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(ctx)) #define ASSERT_ARGS_Parrot_pcc_set_sub __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ PARROT_ASSERT_ARG(interp) \ , PARROT_ASSERT_ARG(ctx)) diff --git a/include/parrot/compiler.h b/include/parrot/compiler.h index 30268dd73f..e0c830e972 100644 --- a/include/parrot/compiler.h +++ b/include/parrot/compiler.h @@ -244,6 +244,14 @@ /* entirely in terms of the provided annotations. */ #define ARGFREE_NOTNULL(x) /*@only@*/ /*@out@*/ /*@notnull@*/ x +#define PARROT_NO_ADDRESS_SAFETY_ANALYSIS +#if defined(__clang__) && defined(__has_feature) +# if __has_feature(address_sanitizer) +# undef PARROT_NO_ADDRESS_SAFETY_ANALYSIS +# define PARROT_NO_ADDRESS_SAFETY_ANALYSIS __attribute__((no_address_safety_analysis)) +# endif +#endif + #endif /* PARROT_COMPILER_H_GUARD */ /* diff --git a/include/parrot/context.h b/include/parrot/context.h index 1fee7c7b6f..506cc124f5 100644 --- a/include/parrot/context.h +++ b/include/parrot/context.h @@ -145,12 +145,6 @@ FLOATVAL * Parrot_pcc_get_num_constants_func(PARROT_INTERP, ARGIN(const PMC *ctx)) __attribute__nonnull__(2); -PARROT_EXPORT -PARROT_PURE_FUNCTION -PARROT_CAN_RETURN_NULL -PMC* Parrot_pcc_get_object_func(PARROT_INTERP, ARGIN(const PMC *ctx)) - __attribute__nonnull__(2); - PARROT_EXPORT PARROT_PURE_FUNCTION PARROT_CAN_RETURN_NULL @@ -259,13 +253,6 @@ void Parrot_pcc_set_namespace_func(PARROT_INTERP, __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), @@ -281,6 +268,12 @@ void Parrot_pcc_set_pc_func(PARROT_INTERP, __attribute__nonnull__(1) __attribute__nonnull__(2); +PARROT_EXPORT +UINTVAL Parrot_pcc_set_recursion_depth_func(PARROT_INTERP, + ARGIN(const PMC *ctx), + const int new_depth) + __attribute__nonnull__(2); + PARROT_EXPORT void Parrot_pcc_set_signature_func(PARROT_INTERP, ARGIN(PMC *ctx), @@ -357,8 +350,6 @@ UINTVAL Parrot_pcc_warnings_test_func(PARROT_INTERP, #define ASSERT_ARGS_Parrot_pcc_get_num_constants_func \ __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ PARROT_ASSERT_ARG(ctx)) -#define ASSERT_ARGS_Parrot_pcc_get_object_func __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ - PARROT_ASSERT_ARG(ctx)) #define ASSERT_ARGS_Parrot_pcc_get_outer_ctx_func __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ PARROT_ASSERT_ARG(ctx)) #define ASSERT_ARGS_Parrot_pcc_get_pc_func __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ @@ -408,9 +399,6 @@ UINTVAL Parrot_pcc_warnings_test_func(PARROT_INTERP, #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) \ @@ -418,6 +406,9 @@ UINTVAL Parrot_pcc_warnings_test_func(PARROT_INTERP, #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_recursion_depth_func \ + __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ + 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)) @@ -455,7 +446,6 @@ UINTVAL Parrot_pcc_warnings_test_func(PARROT_INTERP, # define Parrot_pcc_get_continuation(i, c) (CONTEXT_STRUCT(c)->current_cont) # define Parrot_pcc_get_caller_ctx(i, c) (CONTEXT_STRUCT(c)->caller_ctx) # define Parrot_pcc_get_namespace(i, c) (CONTEXT_STRUCT(c)->current_namespace) -# define Parrot_pcc_get_object(i, c) (CONTEXT_STRUCT(c)->current_object) # define Parrot_pcc_get_lex_pad(i, c) (CONTEXT_STRUCT(c)->lex_pad) # define Parrot_pcc_get_handlers(i, c) (CONTEXT_STRUCT(c)->handlers) @@ -474,8 +464,9 @@ UINTVAL Parrot_pcc_warnings_test_func(PARROT_INTERP, # define Parrot_pcc_get_pmc_constant(i, c, idx) (CONTEXT_STRUCT(c)->pmc_constants[(idx)]) # define Parrot_pcc_get_recursion_depth(i, c) (CONTEXT_STRUCT(c)->recursion_depth) +# define Parrot_pcc_set_recursion_depth(i, c, d) (CONTEXT_STRUCT(c)->recursion_depth = (d)) # define Parrot_pcc_dec_recursion_depth(i, c) (--CONTEXT_STRUCT(c)->recursion_depth) -# define Parrot_pcc_inc_recursion_depth(i, c) (CONTEXT_STRUCT(c)->recursion_depth++) +# define Parrot_pcc_inc_recursion_depth(i, c) (++CONTEXT_STRUCT(c)->recursion_depth) # define Parrot_pcc_warnings_on(i, c, flags) (CONTEXT_STRUCT(c)->warns |= (flags)) # define Parrot_pcc_warnings_off(i, c, flags) (CONTEXT_STRUCT(c)->warns &= ~(flags)) @@ -525,6 +516,7 @@ UINTVAL Parrot_pcc_warnings_test_func(PARROT_INTERP, # 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_set_recursion_depth(i, c, d) Parrot_pcc_set_recursion_depth_func((i), (c), (d)) # 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)) @@ -556,10 +548,6 @@ UINTVAL Parrot_pcc_warnings_test_func(PARROT_INTERP, CONTEXT_STRUCT(c)->current_namespace = (value); \ PARROT_GC_WRITE_BARRIER((i), (c)); \ } while (0) -# define Parrot_pcc_set_object(i, c, value) do { \ - CONTEXT_STRUCT(c)->current_object = (value); \ - PARROT_GC_WRITE_BARRIER((i), (c)); \ - } while (0) # define Parrot_pcc_set_lex_pad(i, c, value) do { \ CONTEXT_STRUCT(c)->lex_pad = (value); \ PARROT_GC_WRITE_BARRIER((i), (c)); \ diff --git a/include/parrot/datatypes.h b/include/parrot/datatypes.h index 1744d6117a..8dc92cfee3 100644 --- a/include/parrot/datatypes.h +++ b/include/parrot/datatypes.h @@ -160,6 +160,7 @@ const struct _data_types data_types[] = { # define PARROT_FLOATVAL_IS_POSINF(x) (isinf(x) && (x) > 0) # define PARROT_FLOATVAL_IS_NEGINF(x) (isinf(x) && (x) < 0) # define PARROT_FLOATVAL_IS_NAN(x) isnan(x) +# define PARROT_FLOATVAL_IS_INF_OR_NAN(x) (isnan(x) || isinf(x)) #else # define PARROT_FLOATVAL_INF_POSITIVE Parrot_dt_divide_floatval_by_zero(interp, 1.0) # define PARROT_FLOATVAL_INF_NEGATIVE Parrot_dt_divide_floatval_by_zero(interp, -1.0) @@ -167,6 +168,8 @@ const struct _data_types data_types[] = { # define PARROT_FLOATVAL_IS_POSINF(x) ((x) == PARROT_FLOATVAL_INF_POSITIVE) # define PARROT_FLOATVAL_IS_NEGINF(x) ((x) == PARROT_FLOATVAL_INF_NEGATIVE) # define PARROT_FLOATVAL_IS_NAN(x) ((x) != (x)) +# define PARROT_FLOATVAL_IS_INF_OR_NAN(x) (PARROT_FLOATVAL_IS_POSINF(x) \ + || PARROT_FLOATVAL_IS_NEGINF(x) || PARROT_FLOATVAL_IS_NAN(x)) #endif #define PARROT_CSTRING_INF_POSITIVE "Inf" diff --git a/include/parrot/disassemble.h b/include/parrot/disassemble.h new file mode 100644 index 0000000000..4a50fdae23 --- /dev/null +++ b/include/parrot/disassemble.h @@ -0,0 +1,43 @@ +/* embed.h + * Copyright (C) 2001-2010, Parrot Foundation. + * Overview: + * disassembly-related utilities + */ + +#ifndef PARROT_DISASSEMBLE_H_GUARD +#define PARROT_DISASSEMBLE_H_GUARD + +#include "parrot/core_types.h" /* types used */ +#include "parrot/compiler.h" /* compiler capabilities */ +#include "parrot/config.h" /* PARROT_VERSION... */ +#include "parrot/interpreter.h" /* give us the interpreter flags */ +#include "parrot/warnings.h" /* give us the warnings flags */ + +typedef enum { + enum_DIS_BARE = 1, + enum_DIS_HEADER = 2 +} Parrot_disassemble_options; + +/* HEADERIZER BEGIN: src/disassemble.c */ +/* Don't modify between HEADERIZER BEGIN / HEADERIZER END. Your changes will be lost. */ + +PARROT_EXPORT +void Parrot_disassemble(PARROT_INTERP, + ARGIN_NULLOK(const char *outfile), + Parrot_disassemble_options options) + __attribute__nonnull__(1); + +#define ASSERT_ARGS_Parrot_disassemble __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/disassemble.c */ + + +#endif /* PARROT_DISASSEMBLE_H_GUARD */ + +/* + * Local variables: + * c-file-style: "parrot" + * End: + * vim: expandtab shiftwidth=4 cinoptions='\:2=2' : + */ diff --git a/include/parrot/embed.h b/include/parrot/embed.h deleted file mode 100644 index b233244545..0000000000 --- a/include/parrot/embed.h +++ /dev/null @@ -1,119 +0,0 @@ -/* embed.h - * Copyright (C) 2001-2010, Parrot Foundation. - * Overview: - * This is the Parrot embedding system--the only part of Parrot that - * the outside world should see. - * References: - * embed.c, docs/embed.pod. - */ - -#ifndef PARROT_EMBED_H_GUARD -#define PARROT_EMBED_H_GUARD - -#include "parrot/parrot.h" -#include "parrot/core_types.h" /* types used */ -#include "parrot/compiler.h" /* compiler capabilities */ -#include "parrot/config.h" /* PARROT_VERSION... */ -#include "parrot/interpreter.h" /* give us the interpreter flags */ -#include "parrot/warnings.h" /* give us the warnings flags */ - -typedef enum { - enum_DIS_BARE = 1, - enum_DIS_HEADER = 2 -} Parrot_disassemble_options; - -PARROT_EXPORT -PARROT_DOES_NOT_RETURN -PARROT_COLD -void -Parrot_x_exit(PARROT_INTERP, int status); - -PARROT_EXPORT -void Parrot_destroy(PARROT_INTERP) - __attribute__nonnull__(1); - - -/* HEADERIZER BEGIN: src/embed.c */ -/* Don't modify between HEADERIZER BEGIN / HEADERIZER END. Your changes will be lost. */ - -PARROT_EXPORT -PARROT_CAN_RETURN_NULL -Parrot_Opcode * Parrot_debug(PARROT_INTERP, - ARGIN(Parrot_Interp debugger), - ARGIN(Parrot_Opcode *pc)) - __attribute__nonnull__(1) - __attribute__nonnull__(2) - __attribute__nonnull__(3); - -PARROT_EXPORT -void Parrot_disassemble(PARROT_INTERP, - ARGIN_NULLOK(const char *outfile), - Parrot_disassemble_options options) - __attribute__nonnull__(1); - -PARROT_EXPORT -void Parrot_pbc_fixup_loaded(PARROT_INTERP) - __attribute__nonnull__(1); - -PARROT_EXPORT -void Parrot_pbc_load(PARROT_INTERP, ARGIN(Parrot_PackFile pf)) - __attribute__nonnull__(1) - __attribute__nonnull__(2); - -PARROT_EXPORT -PARROT_CAN_RETURN_NULL -Parrot_PackFile Parrot_pbc_read(PARROT_INTERP, - ARGIN_NULLOK(const char *fullname), - const int debug) - __attribute__nonnull__(1); - -PARROT_EXPORT -void Parrot_runcode(PARROT_INTERP, int argc, ARGIN(const char **argv)) - __attribute__nonnull__(1) - __attribute__nonnull__(3); - -PARROT_EXPORT -void Parrot_set_configuration_hash_legacy(PARROT_INTERP, - const int length, - ARGIN(const unsigned char *bytes)) - __attribute__nonnull__(1) - __attribute__nonnull__(3); - -PARROT_CANNOT_RETURN_NULL -PMC* set_current_sub(PARROT_INTERP) - __attribute__nonnull__(1); - -#define ASSERT_ARGS_Parrot_debug __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ - PARROT_ASSERT_ARG(interp) \ - , PARROT_ASSERT_ARG(debugger) \ - , PARROT_ASSERT_ARG(pc)) -#define ASSERT_ARGS_Parrot_disassemble __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ - PARROT_ASSERT_ARG(interp)) -#define ASSERT_ARGS_Parrot_pbc_fixup_loaded __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ - PARROT_ASSERT_ARG(interp)) -#define ASSERT_ARGS_Parrot_pbc_load __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ - PARROT_ASSERT_ARG(interp) \ - , PARROT_ASSERT_ARG(pf)) -#define ASSERT_ARGS_Parrot_pbc_read __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ - PARROT_ASSERT_ARG(interp)) -#define ASSERT_ARGS_Parrot_runcode __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ - PARROT_ASSERT_ARG(interp) \ - , PARROT_ASSERT_ARG(argv)) -#define ASSERT_ARGS_Parrot_set_configuration_hash_legacy \ - __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ - PARROT_ASSERT_ARG(interp) \ - , PARROT_ASSERT_ARG(bytes)) -#define ASSERT_ARGS_set_current_sub __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/embed.c */ - - -#endif /* PARROT_EMBED_H_GUARD */ - -/* - * Local variables: - * c-file-style: "parrot" - * End: - * vim: expandtab shiftwidth=4 cinoptions='\:2=2' : - */ diff --git a/include/parrot/events.h b/include/parrot/events.h new file mode 100644 index 0000000000..2c6fb6fca9 --- /dev/null +++ b/include/parrot/events.h @@ -0,0 +1,99 @@ +/* Copyright (C) 2010, Parrot Foundation. + * $Id$ + */ + +#ifndef PARROT_EVENTS_H_GUARD +#define PARROT_EVENTS_H_GUARD + +/* HEADERIZER BEGIN: src/events.c */ +/* Don't modify between HEADERIZER BEGIN / HEADERIZER END. Your changes will be lost. */ + +PARROT_EXPORT +void Parrot_cx_add_handler(PARROT_INTERP, ARGIN(PMC *handler)) + __attribute__nonnull__(1) + __attribute__nonnull__(2); + +PARROT_EXPORT +void Parrot_cx_add_handler_local(PARROT_INTERP, ARGIN(PMC *handler)) + __attribute__nonnull__(1) + __attribute__nonnull__(2); + +PARROT_EXPORT +INTVAL Parrot_cx_count_handlers_local(PARROT_INTERP) + __attribute__nonnull__(1); + +PARROT_EXPORT +INTVAL Parrot_cx_count_handlers_typed(PARROT_INTERP, + ARGIN(STRING *handler_type)) + __attribute__nonnull__(1) + __attribute__nonnull__(2); + +PARROT_EXPORT +void Parrot_cx_delete_handler_local(PARROT_INTERP) + __attribute__nonnull__(1); + +PARROT_EXPORT +void Parrot_cx_delete_handler_typed(PARROT_INTERP, + ARGIN(STRING *handler_type)) + __attribute__nonnull__(1) + __attribute__nonnull__(2); + +PARROT_EXPORT +void Parrot_cx_delete_upto_handler_local(PARROT_INTERP, ARGIN(PMC *handler)) + __attribute__nonnull__(1) + __attribute__nonnull__(2); + +PARROT_EXPORT +PARROT_CAN_RETURN_NULL +PMC * Parrot_cx_find_handler_for_task(PARROT_INTERP, ARGIN(PMC *task)) + __attribute__nonnull__(1) + __attribute__nonnull__(2); + +PARROT_EXPORT +PARROT_CAN_RETURN_NULL +PMC * Parrot_cx_find_handler_local(PARROT_INTERP, ARGIN(PMC *task)) + __attribute__nonnull__(1) + __attribute__nonnull__(2); + +#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(interp) \ + , PARROT_ASSERT_ARG(handler)) +#define ASSERT_ARGS_Parrot_cx_count_handlers_local \ + __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ + PARROT_ASSERT_ARG(interp)) +#define ASSERT_ARGS_Parrot_cx_count_handlers_typed \ + __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ + PARROT_ASSERT_ARG(interp) \ + , PARROT_ASSERT_ARG(handler_type)) +#define ASSERT_ARGS_Parrot_cx_delete_handler_local \ + __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ + PARROT_ASSERT_ARG(interp)) +#define ASSERT_ARGS_Parrot_cx_delete_handler_typed \ + __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ + PARROT_ASSERT_ARG(interp) \ + , PARROT_ASSERT_ARG(handler_type)) +#define ASSERT_ARGS_Parrot_cx_delete_upto_handler_local \ + __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ + PARROT_ASSERT_ARG(interp) \ + , PARROT_ASSERT_ARG(handler)) +#define ASSERT_ARGS_Parrot_cx_find_handler_for_task \ + __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(interp) \ + , PARROT_ASSERT_ARG(task)) +/* Don't modify between HEADERIZER BEGIN / HEADERIZER END. Your changes will be lost. */ +/* HEADERIZER END: src/events.c */ + +#endif /* PARROT_EVENTS_H_GUARD */ + +/* + * Local variables: + * c-file-style: "parrot" + * End: + * vim: expandtab shiftwidth=4 cinoptions='\:2=2' : + */ diff --git a/include/parrot/exceptions.h b/include/parrot/exceptions.h index 73bc6e4e5e..3ba950715e 100644 --- a/include/parrot/exceptions.h +++ b/include/parrot/exceptions.h @@ -22,7 +22,7 @@ /* &gen_from_enum(except_types.pasm) */ typedef enum { - EXCEPTION_BAD_BUFFER_SIZE, + EXCEPTION_BAD_BUFFER_SIZE = 0x00000, EXCEPTION_MISSING_ENCODING_NAME, EXCEPTION_INVALID_STRING_REPRESENTATION, EXCEPTION_ICU_ERROR, @@ -80,8 +80,10 @@ typedef enum { EXCEPTION_LIBRARY_NOT_LOADED, EXCEPTION_SYNTAX_ERROR, EXCEPTION_MALFORMED_PACKFILE, + EXCEPTION_DIE, + EXCEPTION_ALL = 0x0ffff, - CONTROL_RETURN, + CONTROL_RETURN = 0x10000, CONTROL_OK, CONTROL_BREAK, CONTROL_CONTINUE, @@ -89,10 +91,12 @@ typedef enum { CONTROL_TAKE, CONTROL_LEAVE, CONTROL_EXIT, - CONTROL_LOOP_NEXT, CONTROL_LOOP_LAST, - CONTROL_LOOP_REDO + CONTROL_LOOP_REDO, + CONTROL_ALL = 0x1ffff, + + EXCEPTION_TYPE_ALL_MASK = 0xffff } exception_type_enum; /* &end_gen */ @@ -162,6 +166,12 @@ PMC * Parrot_ex_build_exception(PARROT_INTERP, ARGIN_NULLOK(STRING *msg)) __attribute__nonnull__(1); +PARROT_EXPORT +PARROT_WARN_UNUSED_RESULT +PARROT_CAN_RETURN_NULL +PMC * Parrot_ex_get_current_handler(PARROT_INTERP, ARGIN_NULLOK(PMC *expmc)) + __attribute__nonnull__(1); + PARROT_EXPORT void Parrot_ex_mark_unhandled(PARROT_INTERP, ARGIN(PMC *exception)) __attribute__nonnull__(1) @@ -244,6 +254,8 @@ void Parrot_print_backtrace(void); , 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_get_current_handler __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)) diff --git a/include/parrot/extend.h b/include/parrot/extend.h index 520af2ff47..83918d85fa 100644 --- a/include/parrot/extend.h +++ b/include/parrot/extend.h @@ -41,10 +41,6 @@ typedef const void * Parrot_Const_CharType; /* HEADERIZER BEGIN: src/extend.c */ /* Don't modify between HEADERIZER BEGIN / HEADERIZER END. Your changes will be lost. */ -PARROT_EXPORT -int Parrot_eprintf(NULLOK_INTERP, ARGIN(const char *s), ...) - __attribute__nonnull__(2); - PARROT_EXPORT void Parrot_ext_call(PARROT_INTERP, ARGIN(Parrot_PMC sub_pmc), @@ -57,191 +53,30 @@ void Parrot_ext_call(PARROT_INTERP, PARROT_EXPORT void Parrot_ext_try(PARROT_INTERP, ARGIN_NULLOK(void (*cfunction)(Parrot_Interp, - void *)), + ARGIN_NULLOK(void *))), ARGIN_NULLOK(void (*chandler)(Parrot_Interp, - PMC *, - void *)), + ARGIN_NULLOK(PMC *), + ARGIN_NULLOK(void *))), ARGIN_NULLOK(void *data)) __attribute__nonnull__(1); -PARROT_EXPORT -int Parrot_fprintf(PARROT_INTERP, - ARGIN(Parrot_PMC pio), - ARGIN(const char *s), - ...) - __attribute__nonnull__(1) - __attribute__nonnull__(2) - __attribute__nonnull__(3); - PARROT_EXPORT void Parrot_free_cstring(ARGFREE(char *string)); -PARROT_EXPORT -PARROT_PURE_FUNCTION -Parrot_Int Parrot_get_intreg(PARROT_INTERP, Parrot_Int regnum) - __attribute__nonnull__(1); - -PARROT_EXPORT -PARROT_PURE_FUNCTION -Parrot_Float Parrot_get_numreg(PARROT_INTERP, Parrot_Int regnum) - __attribute__nonnull__(1); - -PARROT_EXPORT -PARROT_PURE_FUNCTION -Parrot_PMC Parrot_get_pmcreg(PARROT_INTERP, Parrot_Int regnum) - __attribute__nonnull__(1); - -PARROT_EXPORT -PARROT_PURE_FUNCTION -Parrot_PMC Parrot_get_root_namespace(PARROT_INTERP) - __attribute__nonnull__(1); - -PARROT_EXPORT -PARROT_PURE_FUNCTION -Parrot_String Parrot_get_strreg(PARROT_INTERP, Parrot_Int regnum) - __attribute__nonnull__(1); - -PARROT_EXPORT -PARROT_WARN_UNUSED_RESULT -PARROT_CANNOT_RETURN_NULL -Parrot_String Parrot_new_string(PARROT_INTERP, - ARGIN_NULLOK(const char *buffer), - Parrot_UInt length, - ARGIN_NULLOK(const char * const encoding_name), - Parrot_UInt flags) - __attribute__nonnull__(1); - -PARROT_EXPORT -Parrot_PMC Parrot_PMC_new(PARROT_INTERP, Parrot_Int type) - __attribute__nonnull__(1); - -PARROT_EXPORT -Parrot_PMC Parrot_PMC_newclass(PARROT_INTERP, Parrot_PMC classtype) - __attribute__nonnull__(1); - -PARROT_EXPORT -PARROT_PURE_FUNCTION -PARROT_CAN_RETURN_NULL -Parrot_PMC Parrot_PMC_null(void); - PARROT_EXPORT Parrot_Int Parrot_PMC_typenum(PARROT_INTERP, ARGIN_NULLOK(const char *_class)) __attribute__nonnull__(1); -PARROT_EXPORT -int Parrot_printf(NULLOK_INTERP, ARGIN(const char *s), ...) - __attribute__nonnull__(2); - -PARROT_EXPORT -void Parrot_register_pmc(PARROT_INTERP, Parrot_PMC pmc) - __attribute__nonnull__(1); - -PARROT_EXPORT -void Parrot_register_string(PARROT_INTERP, Parrot_String s) - __attribute__nonnull__(1); - -PARROT_EXPORT -void Parrot_set_intreg(PARROT_INTERP, Parrot_Int regnum, Parrot_Int value) - __attribute__nonnull__(1); - -PARROT_EXPORT -void Parrot_set_numreg(PARROT_INTERP, Parrot_Int regnum, Parrot_Float value) - __attribute__nonnull__(1); - -PARROT_EXPORT -void Parrot_set_pmcreg(PARROT_INTERP, Parrot_Int regnum, Parrot_PMC value) - __attribute__nonnull__(1); - -PARROT_EXPORT -void Parrot_set_strreg(PARROT_INTERP, - Parrot_Int regnum, - Parrot_String value) - __attribute__nonnull__(1); - -PARROT_EXPORT -Parrot_PMC Parrot_sub_new_from_c_func(PARROT_INTERP, - ARGIN(void (*func)(void)), - ARGIN(const char * signature)) - __attribute__nonnull__(1) - __attribute__nonnull__(2) - __attribute__nonnull__(3); - -PARROT_EXPORT -void Parrot_unregister_pmc(PARROT_INTERP, Parrot_PMC pmc) - __attribute__nonnull__(1); - -PARROT_EXPORT -void Parrot_unregister_string(PARROT_INTERP, Parrot_String s) - __attribute__nonnull__(1); - -PARROT_EXPORT -int Parrot_vfprintf(PARROT_INTERP, - ARGIN(Parrot_PMC pio), - ARGIN(const char *s), - va_list args) - __attribute__nonnull__(1) - __attribute__nonnull__(2) - __attribute__nonnull__(3); - -#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_ext_try __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ PARROT_ASSERT_ARG(interp)) -#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_new_string __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_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_register_string __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_unregister_string __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)) /* Don't modify between HEADERIZER BEGIN / HEADERIZER END. Your changes will be lost. */ /* HEADERIZER END: src/extend.c */ diff --git a/include/parrot/gc_api.h b/include/parrot/gc_api.h index 06125f4b51..d5c7d5326d 100644 --- a/include/parrot/gc_api.h +++ b/include/parrot/gc_api.h @@ -99,8 +99,8 @@ typedef enum { CURRENT_CTX, CURRENT_SUB, CURRENT_CONT, - CURRENT_OBJECT, CURRENT_LEXPAD, + CURRENT_TASK, /* interpinfo_s constants */ EXECUTABLE_FULLNAME, @@ -139,7 +139,7 @@ int Parrot_gc_active_sized_buffers(PARROT_INTERP) PARROT_EXPORT void Parrot_gc_allocate_buffer_storage_aligned(PARROT_INTERP, - ARGOUT(Buffer *buffer), + ARGOUT(Parrot_Buffer *buffer), size_t size) __attribute__nonnull__(1) __attribute__nonnull__(2) @@ -210,7 +210,7 @@ void Parrot_gc_finalize(PARROT_INTERP) PARROT_EXPORT void Parrot_gc_free_bufferlike_header(PARROT_INTERP, - ARGMOD(Buffer *obj), + ARGMOD(Parrot_Buffer *obj), size_t size) __attribute__nonnull__(1) __attribute__nonnull__(2) @@ -286,7 +286,7 @@ size_t Parrot_gc_mem_alloc_since_last_collect(PARROT_INTERP) PARROT_EXPORT PARROT_CANNOT_RETURN_NULL PARROT_WARN_UNUSED_RESULT -Buffer * Parrot_gc_new_bufferlike_header(PARROT_INTERP, size_t size) +Parrot_Buffer * Parrot_gc_new_bufferlike_header(PARROT_INTERP, size_t size) __attribute__nonnull__(1); PARROT_EXPORT @@ -309,7 +309,7 @@ void Parrot_gc_pmc_needs_early_collection(PARROT_INTERP, ARGMOD(PMC *pmc)) PARROT_EXPORT void Parrot_gc_reallocate_buffer_storage(PARROT_INTERP, - ARGMOD(Buffer *buffer), + ARGMOD(Parrot_Buffer *buffer), size_t newsize) __attribute__nonnull__(1) __attribute__nonnull__(2) diff --git a/include/parrot/hash.h b/include/parrot/hash.h index 46bf289b65..fd29638796 100644 --- a/include/parrot/hash.h +++ b/include/parrot/hash.h @@ -72,7 +72,7 @@ struct _hash { /* Utility macros - use them, do not reinvent the wheel */ #define parrot_hash_iterate_linear(_hash, _code) \ -{ \ +do { \ HashBucket *_bucket = (_hash)->buckets; \ UINTVAL _found = 0; \ while (_found < (_hash)->entries){ \ @@ -82,10 +82,10 @@ struct _hash { } \ _bucket++; \ } \ -} +} while (0) #define parrot_hash_iterate_indexed(_hash, _code) \ -{ \ +do { \ if ((_hash)->entries) { \ UINTVAL _loc; \ for (_loc = 0; _loc <= (_hash)->mask; ++_loc) { \ @@ -96,16 +96,16 @@ struct _hash { } \ } \ } \ -} +} while (0) #define parrot_hash_iterate(_hash, _code) \ do { \ if ((_hash)->key_type == Hash_key_type_int \ || (_hash)->key_type == Hash_key_type_cstring \ || (_hash)->key_type == Hash_key_type_ptr) \ - parrot_hash_iterate_indexed((_hash), _code) \ + parrot_hash_iterate_indexed((_hash), _code); \ else \ - parrot_hash_iterate_linear((_hash), _code) \ + parrot_hash_iterate_linear((_hash), _code); \ } while (0) typedef void (*value_free)(ARGFREE(void *)); @@ -221,6 +221,15 @@ PARROT_PURE_FUNCTION INTVAL Parrot_hash_size(PARROT_INTERP, ARGIN(const Hash *hash)) __attribute__nonnull__(2); +PARROT_EXPORT +void Parrot_hash_update(PARROT_INTERP, + ARGMOD(Hash *hash), + ARGIN(Hash *other)) + __attribute__nonnull__(1) + __attribute__nonnull__(2) + __attribute__nonnull__(3) + FUNC_MODIFIES(*hash); + PARROT_HOT PARROT_WARN_UNUSED_RESULT PARROT_PURE_FUNCTION @@ -266,6 +275,14 @@ Hash * Parrot_hash_create_sized(PARROT_INTERP, UINTVAL size) __attribute__nonnull__(1); +void Parrot_hash_flatten_hash_into( + PARROT_INTERP, + ARGIN(PMC * const dest), + ARGIN(PMC * const src), + INTVAL overwrite) + __attribute__nonnull__(2) + __attribute__nonnull__(3); + void Parrot_hash_freeze(PARROT_INTERP, ARGIN(const Hash *hash), ARGMOD(PMC *info)) @@ -318,6 +335,12 @@ STRING* Parrot_hash_key_to_string(PARROT_INTERP, __attribute__nonnull__(1) __attribute__nonnull__(2); +PARROT_WARN_UNUSED_RESULT +PARROT_PURE_FUNCTION +size_t Parrot_hash_pointer( + ARGIN_NULLOK(const void * const p), + size_t hashval); + PARROT_CANNOT_RETURN_NULL PARROT_WARN_UNUSED_RESULT Hash * Parrot_hash_thaw(PARROT_INTERP, ARGMOD(PMC *info)) @@ -418,6 +441,10 @@ STRING* Parrot_hash_value_to_string(PARROT_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_update __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ + PARROT_ASSERT_ARG(interp) \ + , PARROT_ASSERT_ARG(hash) \ + , PARROT_ASSERT_ARG(other)) #define ASSERT_ARGS_Parrot_hash_buffer __attribute__unused__ int _ASSERT_ARGS_CHECK = (0) #define ASSERT_ARGS_Parrot_hash_chash_destroy __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ PARROT_ASSERT_ARG(interp) \ @@ -435,6 +462,9 @@ STRING* Parrot_hash_value_to_string(PARROT_INTERP, PARROT_ASSERT_ARG(interp)) #define ASSERT_ARGS_Parrot_hash_create_sized __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ PARROT_ASSERT_ARG(interp)) +#define ASSERT_ARGS_Parrot_hash_flatten_hash_into __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ + PARROT_ASSERT_ARG(dest) \ + , PARROT_ASSERT_ARG(src)) #define ASSERT_ARGS_Parrot_hash_freeze __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ PARROT_ASSERT_ARG(interp) \ , PARROT_ASSERT_ARG(hash) \ @@ -460,6 +490,7 @@ STRING* Parrot_hash_value_to_string(PARROT_INTERP, #define ASSERT_ARGS_Parrot_hash_key_to_string __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ PARROT_ASSERT_ARG(interp) \ , PARROT_ASSERT_ARG(hash)) +#define ASSERT_ARGS_Parrot_hash_pointer __attribute__unused__ int _ASSERT_ARGS_CHECK = (0) #define ASSERT_ARGS_Parrot_hash_thaw __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ PARROT_ASSERT_ARG(interp) \ , PARROT_ASSERT_ARG(info)) diff --git a/include/parrot/interpreter.h b/include/parrot/interpreter.h index 26af586aff..daff738b2f 100644 --- a/include/parrot/interpreter.h +++ b/include/parrot/interpreter.h @@ -1,5 +1,5 @@ /* interpreter.h - * Copyright (C) 2001-2010, Parrot Foundation. + * Copyright (C) 2001-2012, Parrot Foundation. * Overview: * The interpreter API handles running the operations */ @@ -54,13 +54,16 @@ typedef enum { /* &gen_from_enum(interpcores.pasm) */ typedef enum { - PARROT_SLOW_CORE, /* slow bounds/trace/profile core */ + PARROT_SLOW_CORE, /* slow bounds/trace core */ PARROT_FUNCTION_CORE = PARROT_SLOW_CORE, PARROT_FAST_CORE = 0x01, /* fast DO_OP core */ 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_PROFILING_CORE = 0x160 /* used by parrot debugger */ + PARROT_PROFILING_CORE = 0x160, /* used by parrot debugger */ + PARROT_SUBPROF_SUB_CORE = 0x200, /* sub profiler core, sub mode */ + PARROT_SUBPROF_HLL_CORE = 0x201, /* sub profiler core, hll mode */ + PARROT_SUBPROF_OPS_CORE = 0x202 /* sub profiler core, ops mode */ } Parrot_Run_core_t; /* &end_gen */ @@ -87,6 +90,11 @@ typedef enum { } Parrot_clone_flags; /* &end_gen */ +/* Codes used by long jumps to runloop */ +#define PARROT_JMP_EXCEPTION_HANDLED 1 +#define PARROT_JMP_EXCEPTION_FROM_C 2 +#define PARROT_JMP_EXCEPTION_FINALIZED 3 + struct parrot_interp_t; /* One of the most common shim arguments is the interpreter itself, so it @@ -134,7 +142,6 @@ typedef struct warnings_t { Warnings_classes classes; } *Warnings; -struct _Thread_data; /* in thread.h */ struct _Caches; /* caches .h */ /* Get Context from interpreter */ @@ -148,12 +155,6 @@ struct _Caches; /* caches .h */ */ #define CURRENT_CONTEXT(interp) ((interp)->ctx) - -typedef struct _context_mem { - void **free_list; /* array of free-lists, per size free slots */ - int n_free_slots; /* amount of allocated */ -} context_mem; - struct _handler_node_t; /* forward def - exit.h */ /* The actual interpreter structure */ @@ -192,7 +193,6 @@ struct parrot_interp_t { size_t resume_offset; PackFile_ByteCode *code; /* The code we are executing */ - PMC *current_pf; /* Current PF */ Hash *op_hash; /* mapping from op names to op_info_t */ @@ -223,9 +223,11 @@ struct parrot_interp_t { PMC *HLL_info; /* HLL names and types */ PMC *HLL_namespace; /* cache of HLL toplevel ns */ + PMC *HLL_entries; PMC *root_namespace; /* namespace hash */ PMC *scheduler; /* concurrency scheduler */ + PMC *cur_task; MMD_Cache *op_mmd_cache; /* MMD cache for builtins. */ @@ -234,7 +236,6 @@ struct parrot_interp_t { STRING **const_cstring_table; /* CONST_STRING(x) items */ Hash *const_cstring_hash; /* cache of const_string items */ - struct QUEUE* task_queue; /* per interpreter queue */ struct _handler_node_t *exit_handler_list;/* exit.c */ int sleeping; /* used during sleep in events */ @@ -244,7 +245,8 @@ struct parrot_interp_t { int current_runloop_level; /* for reentering run loop */ int current_runloop_id; - struct _Thread_data *thread_data; /* thread specific items */ + UINTVAL last_alarm; /* has an alarm triggered? */ + FLOATVAL quantum_done; /* expiration of current quantum */ UINTVAL recursion_limit; /* Sub call recursion limit */ @@ -316,197 +318,135 @@ typedef opcode_t *(*native_func_t)(PARROT_INTERP, typedef PMC *(*Parrot_compiler_func_t)(PARROT_INTERP, const char * program); -void -Parrot_clear_emergency_interp(void); - -/* HEADERIZER BEGIN: src/interp/inter_create.c */ +/* HEADERIZER BEGIN: src/interp/api.c */ /* Don't modify between HEADERIZER BEGIN / HEADERIZER END. Your changes will be lost. */ PARROT_EXPORT PARROT_CANNOT_RETURN_NULL PARROT_MALLOC -Parrot_Interp allocate_interpreter( +Parrot_Interp Parrot_interp_allocate_interpreter( ARGIN_NULLOK(Interp *parent), INTVAL flags); PARROT_EXPORT -PARROT_CANNOT_RETURN_NULL -Parrot_Interp initialize_interpreter(PARROT_INTERP, - ARGIN(Parrot_GC_Init_Args *args)) - __attribute__nonnull__(1) - __attribute__nonnull__(2); - -PARROT_EXPORT -PARROT_CANNOT_RETURN_NULL -PARROT_MALLOC -Parrot_Interp make_interpreter(ARGIN_NULLOK(Interp *parent), INTVAL flags); - -PARROT_EXPORT -void Parrot_destroy(PARROT_INTERP) +void Parrot_interp_clear_debug(PARROT_INTERP, UINTVAL flag) __attribute__nonnull__(1); PARROT_EXPORT -void Parrot_init_stacktop(PARROT_INTERP, ARGIN(void *stack_top)) - __attribute__nonnull__(1) - __attribute__nonnull__(2); - -PARROT_EXPORT -PARROT_CANNOT_RETURN_NULL -PARROT_MALLOC -Parrot_Interp Parrot_new(ARGIN_NULLOK(Parrot_Interp parent)); - -PARROT_CAN_RETURN_NULL -Interp* Parrot_get_emergency_interp(void); - -void Parrot_really_destroy(PARROT_INTERP, int exit_code, void *arg) +void Parrot_interp_clear_flag(PARROT_INTERP, INTVAL flag) __attribute__nonnull__(1); -#define ASSERT_ARGS_allocate_interpreter __attribute__unused__ int _ASSERT_ARGS_CHECK = (0) -#define ASSERT_ARGS_initialize_interpreter __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ - PARROT_ASSERT_ARG(interp) \ - , PARROT_ASSERT_ARG(args)) -#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_init_stacktop __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ - PARROT_ASSERT_ARG(interp) \ - , PARROT_ASSERT_ARG(stack_top)) -#define ASSERT_ARGS_Parrot_new __attribute__unused__ int _ASSERT_ARGS_CHECK = (0) -#define ASSERT_ARGS_Parrot_get_emergency_interp __attribute__unused__ int _ASSERT_ARGS_CHECK = (0) -#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 */ - -/* HEADERIZER BEGIN: src/interp/inter_cb.c */ -/* Don't modify between HEADERIZER BEGIN / HEADERIZER END. Your changes will be lost. */ - PARROT_EXPORT -void Parrot_callback_C( - ARGIN(char *external_data), - ARGMOD_NULLOK(PMC *user_data)) - __attribute__nonnull__(1) - FUNC_MODIFIES(*user_data); - -PARROT_EXPORT -void Parrot_callback_D( - ARGMOD(PMC *user_data), - ARGMOD_NULLOK(char *external_data)) - __attribute__nonnull__(1) - FUNC_MODIFIES(*user_data) - FUNC_MODIFIES(*external_data); +void Parrot_interp_clear_trace(PARROT_INTERP, UINTVAL flag) + __attribute__nonnull__(1); PARROT_EXPORT PARROT_CANNOT_RETURN_NULL -PARROT_WARN_UNUSED_RESULT -PMC* Parrot_make_cb(PARROT_INTERP, - ARGMOD(PMC* sub), - ARGIN(PMC* user_data), - ARGIN(STRING *cb_signature)) +PMC * Parrot_interp_compile_file(PARROT_INTERP, + ARGIN(PMC *compiler), + ARGIN(STRING *fullname)) __attribute__nonnull__(1) __attribute__nonnull__(2) - __attribute__nonnull__(3) - __attribute__nonnull__(4) - FUNC_MODIFIES(* sub); + __attribute__nonnull__(3); PARROT_EXPORT -void Parrot_run_callback(PARROT_INTERP, - ARGMOD(PMC* user_data), - ARGIN(char* external_data)) +PARROT_CAN_RETURN_NULL +PARROT_WARN_UNUSED_RESULT +Parrot_PMC Parrot_interp_compile_string(PARROT_INTERP, + ARGIN(PMC *compiler), + ARGIN(STRING *code)) __attribute__nonnull__(1) __attribute__nonnull__(2) - __attribute__nonnull__(3) - FUNC_MODIFIES(* user_data); - -#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(interp) \ - , 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 */ - -/* HEADERIZER BEGIN: src/interp/inter_misc.c */ -/* Don't modify between HEADERIZER BEGIN / HEADERIZER END. Your changes will be lost. */ + __attribute__nonnull__(3); PARROT_EXPORT -PARROT_WARN_UNUSED_RESULT -INTVAL interpinfo(PARROT_INTERP, INTVAL what) +void Parrot_interp_destroy(PARROT_INTERP) __attribute__nonnull__(1); PARROT_EXPORT PARROT_WARN_UNUSED_RESULT PARROT_CANNOT_RETURN_NULL -PMC* interpinfo_p(PARROT_INTERP, INTVAL what) - __attribute__nonnull__(1); +PMC * Parrot_interp_get_compiler(PARROT_INTERP, ARGIN(STRING *type)) + __attribute__nonnull__(1) + __attribute__nonnull__(2); PARROT_EXPORT -PARROT_WARN_UNUSED_RESULT PARROT_CANNOT_RETURN_NULL -STRING* interpinfo_s(PARROT_INTERP, INTVAL what) +Interp * Parrot_interp_get_from_pmc(ARGIN(PMC * interp_pmc)) __attribute__nonnull__(1); PARROT_EXPORT -void Parrot_clear_debug(PARROT_INTERP, UINTVAL flag) +PARROT_WARN_UNUSED_RESULT +INTVAL Parrot_interp_info(PARROT_INTERP, INTVAL what) __attribute__nonnull__(1); PARROT_EXPORT -void Parrot_clear_flag(PARROT_INTERP, INTVAL flag) +PARROT_WARN_UNUSED_RESULT +PARROT_CANNOT_RETURN_NULL +PMC* Parrot_interp_info_p(PARROT_INTERP, INTVAL what) __attribute__nonnull__(1); PARROT_EXPORT -void Parrot_clear_trace(PARROT_INTERP, UINTVAL flag) +PARROT_WARN_UNUSED_RESULT +PARROT_CANNOT_RETURN_NULL +STRING* Parrot_interp_info_s(PARROT_INTERP, INTVAL what) __attribute__nonnull__(1); PARROT_EXPORT -PARROT_CANNOT_RETURN_NULL -PMC * Parrot_compile_file(PARROT_INTERP, - ARGIN(STRING *fullname), - INTVAL is_pasm) +void Parrot_interp_init_stacktop(PARROT_INTERP, ARGIN(void *stack_top)) __attribute__nonnull__(1) __attribute__nonnull__(2); PARROT_EXPORT -PARROT_CAN_RETURN_NULL -PARROT_WARN_UNUSED_RESULT -Parrot_PMC Parrot_compile_string(PARROT_INTERP, - Parrot_String type, - ARGIN(const char *code), - ARGOUT(Parrot_String *error)) - __attribute__nonnull__(1) - __attribute__nonnull__(3) - __attribute__nonnull__(4) - FUNC_MODIFIES(*error); - -PARROT_EXPORT -PARROT_WARN_UNUSED_RESULT PARROT_CANNOT_RETURN_NULL -PMC * Parrot_get_compiler(PARROT_INTERP, ARGIN(STRING *type)) +Parrot_Interp Parrot_interp_initialize_interpreter(PARROT_INTERP, + ARGIN(Parrot_GC_Init_Args *args)) __attribute__nonnull__(1) __attribute__nonnull__(2); PARROT_EXPORT PARROT_CANNOT_RETURN_NULL -Interp * Parrot_int_get_interp_from_pmc(ARGIN(PMC * interp_pmc)) - __attribute__nonnull__(1); +PARROT_MALLOC +Parrot_Interp Parrot_interp_make_interpreter( + ARGIN_NULLOK(Interp *parent), + INTVAL flags); PARROT_EXPORT -void Parrot_mark_method_writes(PARROT_INTERP, +void Parrot_interp_mark_method_writes(PARROT_INTERP, int type, ARGIN(const char *name)) __attribute__nonnull__(1) __attribute__nonnull__(3); PARROT_EXPORT -void Parrot_set_compiler(PARROT_INTERP, +PARROT_CANNOT_RETURN_NULL +PARROT_MALLOC +Parrot_Interp Parrot_interp_new(ARGIN_NULLOK(Parrot_Interp parent)); + +PARROT_EXPORT +void Parrot_interp_register_native_pcc_method_in_ns(PARROT_INTERP, + const int type, + ARGIN(void *func), + ARGIN(STRING *name), + ARGIN(STRING *signature)) + __attribute__nonnull__(1) + __attribute__nonnull__(3) + __attribute__nonnull__(4) + __attribute__nonnull__(5); + +PARROT_EXPORT +void Parrot_interp_register_nci_method(PARROT_INTERP, + const int type, + ARGIN(void *func), + ARGIN(const char *name), + ARGIN(const char *proto)) + __attribute__nonnull__(1) + __attribute__nonnull__(3) + __attribute__nonnull__(4) + __attribute__nonnull__(5); + +PARROT_EXPORT +void Parrot_interp_set_compiler(PARROT_INTERP, ARGIN(STRING *type), ARGIN(PMC *compiler)) __attribute__nonnull__(1) @@ -514,132 +454,196 @@ void Parrot_set_compiler(PARROT_INTERP, __attribute__nonnull__(3); PARROT_EXPORT -void Parrot_set_debug(PARROT_INTERP, UINTVAL flag) +void Parrot_interp_set_debug(PARROT_INTERP, UINTVAL flag) __attribute__nonnull__(1); PARROT_EXPORT -void Parrot_set_executable_name(PARROT_INTERP, ARGIN(STRING * const name)) +void Parrot_interp_set_executable_name(PARROT_INTERP, + ARGIN(STRING * const name)) __attribute__nonnull__(1) __attribute__nonnull__(2); PARROT_EXPORT -void Parrot_set_flag(PARROT_INTERP, INTVAL flag) +void Parrot_interp_set_flag(PARROT_INTERP, INTVAL flag) __attribute__nonnull__(1); PARROT_EXPORT -void Parrot_set_run_core(PARROT_INTERP, Parrot_Run_core_t core) +void Parrot_interp_set_run_core(PARROT_INTERP, Parrot_Run_core_t core) __attribute__nonnull__(1); PARROT_EXPORT -void Parrot_set_trace(PARROT_INTERP, UINTVAL flag) +void Parrot_interp_set_trace(PARROT_INTERP, UINTVAL flag) __attribute__nonnull__(1); PARROT_EXPORT -void Parrot_setwarnings(PARROT_INTERP, Parrot_warnclass wc) +void Parrot_interp_set_warnings(PARROT_INTERP, Parrot_warnclass wc) __attribute__nonnull__(1); PARROT_EXPORT PARROT_PURE_FUNCTION -Parrot_UInt Parrot_test_debug(PARROT_INTERP, UINTVAL flag) +Parrot_UInt Parrot_interp_test_debug(PARROT_INTERP, UINTVAL flag) __attribute__nonnull__(1); PARROT_EXPORT PARROT_PURE_FUNCTION -Parrot_Int Parrot_test_flag(PARROT_INTERP, INTVAL flag) +Parrot_Int Parrot_interp_test_flag(PARROT_INTERP, INTVAL flag) __attribute__nonnull__(1); PARROT_EXPORT PARROT_PURE_FUNCTION -Parrot_UInt Parrot_test_trace(PARROT_INTERP, UINTVAL flag) +Parrot_UInt Parrot_interp_test_trace(PARROT_INTERP, UINTVAL flag) __attribute__nonnull__(1); -PARROT_EXPORT -void register_native_pcc_method_in_ns(PARROT_INTERP, - const int type, - ARGIN(void *func), - ARGIN(STRING *name), - ARGIN(STRING *signature)) - __attribute__nonnull__(1) - __attribute__nonnull__(3) - __attribute__nonnull__(4) - __attribute__nonnull__(5); +void Parrot_interp_clear_emergency_interpreter(void); +PARROT_CAN_RETURN_NULL +Interp* Parrot_interp_get_emergency_interpreter(void); -PARROT_EXPORT -void register_nci_method(PARROT_INTERP, - const int type, - ARGIN(void *func), - ARGIN(const char *name), - ARGIN(const char *proto)) - __attribute__nonnull__(1) - __attribute__nonnull__(3) - __attribute__nonnull__(4) - __attribute__nonnull__(5); +void Parrot_interp_really_destroy(PARROT_INTERP, int exit_code, void *arg) + __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_clear_debug __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ +#define ASSERT_ARGS_Parrot_interp_allocate_interpreter \ + __attribute__unused__ int _ASSERT_ARGS_CHECK = (0) +#define ASSERT_ARGS_Parrot_interp_clear_debug __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ PARROT_ASSERT_ARG(interp)) -#define ASSERT_ARGS_Parrot_clear_flag __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ +#define ASSERT_ARGS_Parrot_interp_clear_flag __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ PARROT_ASSERT_ARG(interp)) -#define ASSERT_ARGS_Parrot_clear_trace __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ +#define ASSERT_ARGS_Parrot_interp_clear_trace __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_Parrot_interp_compile_file __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ PARROT_ASSERT_ARG(interp) \ + , PARROT_ASSERT_ARG(compiler) \ , PARROT_ASSERT_ARG(fullname)) -#define ASSERT_ARGS_Parrot_compile_string __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ +#define ASSERT_ARGS_Parrot_interp_compile_string __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ PARROT_ASSERT_ARG(interp) \ - , PARROT_ASSERT_ARG(code) \ - , PARROT_ASSERT_ARG(error)) -#define ASSERT_ARGS_Parrot_get_compiler __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ + , PARROT_ASSERT_ARG(compiler) \ + , PARROT_ASSERT_ARG(code)) +#define ASSERT_ARGS_Parrot_interp_destroy __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ + PARROT_ASSERT_ARG(interp)) +#define ASSERT_ARGS_Parrot_interp_get_compiler __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ PARROT_ASSERT_ARG(interp) \ , PARROT_ASSERT_ARG(type)) -#define ASSERT_ARGS_Parrot_int_get_interp_from_pmc \ - __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ +#define ASSERT_ARGS_Parrot_interp_get_from_pmc __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ PARROT_ASSERT_ARG(interp_pmc)) -#define ASSERT_ARGS_Parrot_mark_method_writes __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ +#define ASSERT_ARGS_Parrot_interp_info __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ + PARROT_ASSERT_ARG(interp)) +#define ASSERT_ARGS_Parrot_interp_info_p __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ + PARROT_ASSERT_ARG(interp)) +#define ASSERT_ARGS_Parrot_interp_info_s __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ + PARROT_ASSERT_ARG(interp)) +#define ASSERT_ARGS_Parrot_interp_init_stacktop __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ + PARROT_ASSERT_ARG(interp) \ + , PARROT_ASSERT_ARG(stack_top)) +#define ASSERT_ARGS_Parrot_interp_initialize_interpreter \ + __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ + PARROT_ASSERT_ARG(interp) \ + , PARROT_ASSERT_ARG(args)) +#define ASSERT_ARGS_Parrot_interp_make_interpreter \ + __attribute__unused__ int _ASSERT_ARGS_CHECK = (0) +#define ASSERT_ARGS_Parrot_interp_mark_method_writes \ + __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ PARROT_ASSERT_ARG(interp) \ , PARROT_ASSERT_ARG(name)) -#define ASSERT_ARGS_Parrot_set_compiler __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ +#define ASSERT_ARGS_Parrot_interp_new __attribute__unused__ int _ASSERT_ARGS_CHECK = (0) +#define ASSERT_ARGS_Parrot_interp_register_native_pcc_method_in_ns \ + __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ + PARROT_ASSERT_ARG(interp) \ + , PARROT_ASSERT_ARG(func) \ + , PARROT_ASSERT_ARG(name) \ + , PARROT_ASSERT_ARG(signature)) +#define ASSERT_ARGS_Parrot_interp_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_Parrot_interp_set_compiler __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ PARROT_ASSERT_ARG(interp) \ , PARROT_ASSERT_ARG(type) \ , PARROT_ASSERT_ARG(compiler)) -#define ASSERT_ARGS_Parrot_set_debug __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ +#define ASSERT_ARGS_Parrot_interp_set_debug __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ PARROT_ASSERT_ARG(interp)) -#define ASSERT_ARGS_Parrot_set_executable_name __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ +#define ASSERT_ARGS_Parrot_interp_set_executable_name \ + __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ PARROT_ASSERT_ARG(interp) \ , PARROT_ASSERT_ARG(name)) -#define ASSERT_ARGS_Parrot_set_flag __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ +#define ASSERT_ARGS_Parrot_interp_set_flag __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ PARROT_ASSERT_ARG(interp)) -#define ASSERT_ARGS_Parrot_set_run_core __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ +#define ASSERT_ARGS_Parrot_interp_set_run_core __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ PARROT_ASSERT_ARG(interp)) -#define ASSERT_ARGS_Parrot_set_trace __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ +#define ASSERT_ARGS_Parrot_interp_set_trace __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ PARROT_ASSERT_ARG(interp)) -#define ASSERT_ARGS_Parrot_setwarnings __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ +#define ASSERT_ARGS_Parrot_interp_set_warnings __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ PARROT_ASSERT_ARG(interp)) -#define ASSERT_ARGS_Parrot_test_debug __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ +#define ASSERT_ARGS_Parrot_interp_test_debug __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ PARROT_ASSERT_ARG(interp)) -#define ASSERT_ARGS_Parrot_test_flag __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ +#define ASSERT_ARGS_Parrot_interp_test_flag __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ PARROT_ASSERT_ARG(interp)) -#define ASSERT_ARGS_Parrot_test_trace __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ +#define ASSERT_ARGS_Parrot_interp_test_trace __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ PARROT_ASSERT_ARG(interp)) -#define ASSERT_ARGS_register_native_pcc_method_in_ns \ - __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ +#define ASSERT_ARGS_Parrot_interp_clear_emergency_interpreter \ + __attribute__unused__ int _ASSERT_ARGS_CHECK = (0) +#define ASSERT_ARGS_Parrot_interp_get_emergency_interpreter \ + __attribute__unused__ int _ASSERT_ARGS_CHECK = (0) +#define ASSERT_ARGS_Parrot_interp_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/api.c */ + +/* HEADERIZER BEGIN: src/interp/inter_cb.c */ +/* Don't modify between HEADERIZER BEGIN / HEADERIZER END. Your changes will be lost. */ + +PARROT_EXPORT +void Parrot_callback_C( + ARGIN(char *external_data), + ARGMOD_NULLOK(PMC *user_data)) + __attribute__nonnull__(1) + FUNC_MODIFIES(*user_data); + +PARROT_EXPORT +void Parrot_callback_D( + ARGMOD(PMC *user_data), + ARGMOD_NULLOK(char *external_data)) + __attribute__nonnull__(1) + FUNC_MODIFIES(*user_data) + FUNC_MODIFIES(*external_data); + +PARROT_EXPORT +PARROT_CANNOT_RETURN_NULL +PARROT_WARN_UNUSED_RESULT +PMC* Parrot_make_cb(PARROT_INTERP, + ARGMOD(PMC* sub), + ARGIN(PMC* user_data), + ARGIN(STRING *cb_signature)) + __attribute__nonnull__(1) + __attribute__nonnull__(2) + __attribute__nonnull__(3) + __attribute__nonnull__(4) + FUNC_MODIFIES(* sub); + +PARROT_EXPORT +void Parrot_run_callback(PARROT_INTERP, + ARGMOD(PMC* user_data), + ARGIN(void* external_data)) + __attribute__nonnull__(1) + __attribute__nonnull__(2) + __attribute__nonnull__(3) + FUNC_MODIFIES(* user_data); + +#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(func) \ - , PARROT_ASSERT_ARG(name) \ - , PARROT_ASSERT_ARG(signature)) -#define ASSERT_ARGS_register_nci_method __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(func) \ - , PARROT_ASSERT_ARG(name) \ - , PARROT_ASSERT_ARG(proto)) + , 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_misc.c */ - +/* HEADERIZER END: src/interp/inter_cb.c */ /* parrotinterpreter.pmc */ /* XXX Would be nice if this could live in some headerized grouping */ diff --git a/include/parrot/io.h b/include/parrot/io.h index 74f7908960..bc4b19e376 100644 --- a/include/parrot/io.h +++ b/include/parrot/io.h @@ -176,6 +176,13 @@ PIOHANDLE Parrot_io_getfd(PARROT_INTERP, ARGIN(const PMC *pmc)) __attribute__nonnull__(1) __attribute__nonnull__(2); +PARROT_EXPORT +PARROT_WARN_UNUSED_RESULT +INTVAL Parrot_io_is_async(PARROT_INTERP, ARGMOD(PMC *pmc)) + __attribute__nonnull__(1) + __attribute__nonnull__(2) + FUNC_MODIFIES(*pmc); + PARROT_EXPORT PARROT_WARN_UNUSED_RESULT INTVAL Parrot_io_is_closed(PARROT_INTERP, ARGIN(PMC *pmc)) @@ -358,6 +365,9 @@ PIOOFF_T Parrot_io_make_offset_pmc(PARROT_INTERP, ARGMOD(PMC *pmc)) #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_async __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)) @@ -446,7 +456,7 @@ INTVAL Parrot_io_peek_buffer(PARROT_INTERP, ARGMOD(PMC *filehandle)) PARROT_WARN_UNUSED_RESULT size_t Parrot_io_read_buffer(PARROT_INTERP, ARGMOD(PMC *filehandle), - ARGMOD(char *dest), + ARGOUT(char *dest), size_t len) __attribute__nonnull__(1) __attribute__nonnull__(2) diff --git a/include/parrot/memory.h b/include/parrot/memory.h index c220b11d4e..3722c17a13 100644 --- a/include/parrot/memory.h +++ b/include/parrot/memory.h @@ -40,9 +40,9 @@ #define mem_internal_realloc_n_zeroed_typed(p, x, y, type) \ (type *)mem_sys_realloc_zeroed((p), (x) * sizeof (type), (y) * sizeof (type)) +#define mem_internal_realloc_n_typed(p, n, type) (p) = (type *)mem_sys_realloc((p), (n) * sizeof (type)) #define mem_internal_free(x) mem_sys_free(x) - #define mem_sys_memcopy memcpy #define mem_sys_memmove memmove diff --git a/include/parrot/misc.h b/include/parrot/misc.h index fa0390fc80..60b853dcab 100644 --- a/include/parrot/misc.h +++ b/include/parrot/misc.h @@ -129,6 +129,23 @@ void Parrot_util_quicksort(PARROT_INTERP, /* HEADERIZER BEGIN: src/misc.c */ /* Don't modify between HEADERIZER BEGIN / HEADERIZER END. Your changes will be lost. */ +PARROT_EXPORT +int Parrot_eprintf(NULLOK_INTERP, ARGIN(const char *s), ...) + __attribute__nonnull__(2); + +PARROT_EXPORT +int Parrot_fprintf(PARROT_INTERP, + ARGIN(Parrot_PMC pio), + ARGIN(const char *s), + ...) + __attribute__nonnull__(1) + __attribute__nonnull__(2) + __attribute__nonnull__(3); + +PARROT_EXPORT +int Parrot_printf(NULLOK_INTERP, ARGIN(const char *s), ...) + __attribute__nonnull__(2); + PARROT_EXPORT PARROT_WARN_UNUSED_RESULT PARROT_CANNOT_RETURN_NULL @@ -177,6 +194,15 @@ STRING * Parrot_sprintf_s(PARROT_INTERP, ARGIN(STRING *pat), ...) __attribute__nonnull__(1) __attribute__nonnull__(2); +PARROT_EXPORT +int Parrot_vfprintf(PARROT_INTERP, + ARGIN(Parrot_PMC pio), + ARGIN(const char *s), + va_list args) + __attribute__nonnull__(1) + __attribute__nonnull__(2) + __attribute__nonnull__(3); + PARROT_EXPORT void Parrot_vsnprintf(PARROT_INTERP, ARGMOD(char *targ), @@ -204,6 +230,14 @@ STRING * Parrot_vsprintf_s(PARROT_INTERP, ARGIN(STRING *pat), va_list args) __attribute__nonnull__(1) __attribute__nonnull__(2); +#define ASSERT_ARGS_Parrot_eprintf __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ + PARROT_ASSERT_ARG(s)) +#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_printf __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ + PARROT_ASSERT_ARG(s)) #define ASSERT_ARGS_Parrot_psprintf __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ PARROT_ASSERT_ARG(interp) \ , PARROT_ASSERT_ARG(pat) \ @@ -221,6 +255,10 @@ STRING * Parrot_vsprintf_s(PARROT_INTERP, ARGIN(STRING *pat), va_list args) #define ASSERT_ARGS_Parrot_sprintf_s __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ PARROT_ASSERT_ARG(interp) \ , PARROT_ASSERT_ARG(pat)) +#define ASSERT_ARGS_Parrot_vfprintf __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ + PARROT_ASSERT_ARG(interp) \ + , PARROT_ASSERT_ARG(pio) \ + , PARROT_ASSERT_ARG(s)) #define ASSERT_ARGS_Parrot_vsnprintf __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ PARROT_ASSERT_ARG(interp) \ , PARROT_ASSERT_ARG(targ) \ diff --git a/include/parrot/namespace.h b/include/parrot/namespace.h index b6398c82ef..ce835bc08f 100644 --- a/include/parrot/namespace.h +++ b/include/parrot/namespace.h @@ -83,6 +83,11 @@ PMC * Parrot_ns_get_namespace_keyed_str(PARROT_INTERP, __attribute__nonnull__(1) __attribute__nonnull__(2); +PARROT_EXPORT +PARROT_PURE_FUNCTION +Parrot_PMC Parrot_ns_get_root_namespace(PARROT_INTERP) + __attribute__nonnull__(1); + PARROT_EXPORT PARROT_WARN_UNUSED_RESULT PARROT_CANNOT_RETURN_NULL @@ -156,6 +161,8 @@ void Parrot_ns_store_sub(PARROT_INTERP, ARGIN(PMC *sub_pmc)) __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ PARROT_ASSERT_ARG(interp) \ , PARROT_ASSERT_ARG(base_ns)) +#define ASSERT_ARGS_Parrot_ns_get_root_namespace __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ + PARROT_ASSERT_ARG(interp)) #define ASSERT_ARGS_Parrot_ns_make_namespace_autobase \ __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ PARROT_ASSERT_ARG(interp) \ diff --git a/include/parrot/oo.h b/include/parrot/oo.h index 9e015f5ca6..13fdc96c6f 100644 --- a/include/parrot/oo.h +++ b/include/parrot/oo.h @@ -134,6 +134,12 @@ PARROT_WARN_UNUSED_RESULT PMC * Parrot_oo_get_class_str(PARROT_INTERP, ARGIN_NULLOK(STRING *name)) __attribute__nonnull__(1); +PARROT_EXPORT +PARROT_CANNOT_RETURN_NULL +PMC * Parrot_oo_new_class_pmc(PARROT_INTERP, ARGIN(PMC *classtype)) + __attribute__nonnull__(1) + __attribute__nonnull__(2); + void destroy_object_cache(PARROT_INTERP) __attribute__nonnull__(1); @@ -212,6 +218,9 @@ INTVAL Parrot_oo_register_type(PARROT_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_Parrot_oo_new_class_pmc __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ + PARROT_ASSERT_ARG(interp) \ + , PARROT_ASSERT_ARG(classtype)) #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 = (\ diff --git a/include/parrot/oplib/core_ops.h b/include/parrot/oplib/core_ops.h index df795d08a5..d4a9c766e4 100644 --- a/include/parrot/oplib/core_ops.h +++ b/include/parrot/oplib/core_ops.h @@ -19,7 +19,7 @@ #include "parrot/runcore_api.h" PARROT_EXPORT -op_lib_t *Parrot_DynOp_core_3_6_0(PARROT_INTERP, long init); +op_lib_t *Parrot_DynOp_core_4_3_0(PARROT_INTERP, long init); opcode_t * Parrot_end(opcode_t *, PARROT_INTERP); opcode_t * Parrot_noop(opcode_t *, PARROT_INTERP); @@ -85,6 +85,9 @@ op_lib_t *Parrot_DynOp_core_3_6_0(PARROT_INTERP, long init); opcode_t * Parrot_exit_ic(opcode_t *, PARROT_INTERP); opcode_t * Parrot_finalize_p(opcode_t *, PARROT_INTERP); opcode_t * Parrot_finalize_pc(opcode_t *, PARROT_INTERP); + opcode_t * Parrot_pop_upto_eh_p(opcode_t *, PARROT_INTERP); + opcode_t * Parrot_pop_upto_eh_pc(opcode_t *, PARROT_INTERP); + opcode_t * Parrot_peek_exception_p(opcode_t *, PARROT_INTERP); opcode_t * Parrot_debug_i(opcode_t *, PARROT_INTERP); opcode_t * Parrot_debug_ic(opcode_t *, PARROT_INTERP); opcode_t * Parrot_bounds_i(opcode_t *, PARROT_INTERP); @@ -109,6 +112,8 @@ op_lib_t *Parrot_DynOp_core_3_6_0(PARROT_INTERP, long init); opcode_t * Parrot_errorson_ic(opcode_t *, PARROT_INTERP); opcode_t * Parrot_errorsoff_i(opcode_t *, PARROT_INTERP); opcode_t * Parrot_errorsoff_ic(opcode_t *, PARROT_INTERP); + opcode_t * Parrot_set_runcore_s(opcode_t *, PARROT_INTERP); + opcode_t * Parrot_set_runcore_sc(opcode_t *, PARROT_INTERP); opcode_t * Parrot_runinterp_p_i(opcode_t *, PARROT_INTERP); opcode_t * Parrot_runinterp_p_ic(opcode_t *, PARROT_INTERP); opcode_t * Parrot_getinterp_p(opcode_t *, PARROT_INTERP); @@ -540,6 +545,8 @@ op_lib_t *Parrot_DynOp_core_3_6_0(PARROT_INTERP, long init); opcode_t * Parrot_sub_p_p_n(opcode_t *, PARROT_INTERP); opcode_t * Parrot_sub_p_p_nc(opcode_t *, PARROT_INTERP); opcode_t * Parrot_sqrt_n_n(opcode_t *, PARROT_INTERP); + opcode_t * Parrot_is_inf_or_nan_i_n(opcode_t *, PARROT_INTERP); + opcode_t * Parrot_is_inf_or_nan_i_nc(opcode_t *, PARROT_INTERP); opcode_t * Parrot_callmethodcc_p_s(opcode_t *, PARROT_INTERP); opcode_t * Parrot_callmethodcc_p_sc(opcode_t *, PARROT_INTERP); opcode_t * Parrot_callmethodcc_p_p(opcode_t *, PARROT_INTERP); @@ -682,6 +689,8 @@ op_lib_t *Parrot_DynOp_core_3_6_0(PARROT_INTERP, long init); opcode_t * Parrot_setprop_p_sc_p(opcode_t *, PARROT_INTERP); opcode_t * Parrot_getprop_p_s_p(opcode_t *, PARROT_INTERP); opcode_t * Parrot_getprop_p_sc_p(opcode_t *, PARROT_INTERP); + opcode_t * Parrot_getprop_p_p_s(opcode_t *, PARROT_INTERP); + opcode_t * Parrot_getprop_p_p_sc(opcode_t *, PARROT_INTERP); opcode_t * Parrot_delprop_p_s(opcode_t *, PARROT_INTERP); opcode_t * Parrot_delprop_p_sc(opcode_t *, PARROT_INTERP); opcode_t * Parrot_prophash_p_p(opcode_t *, PARROT_INTERP); @@ -886,8 +895,6 @@ op_lib_t *Parrot_DynOp_core_3_6_0(PARROT_INTERP, long init); opcode_t * Parrot_sprintf_s_sc_p(opcode_t *, PARROT_INTERP); opcode_t * Parrot_sprintf_p_p_p(opcode_t *, PARROT_INTERP); opcode_t * Parrot_new_s(opcode_t *, PARROT_INTERP); - opcode_t * Parrot_new_s_i(opcode_t *, PARROT_INTERP); - opcode_t * Parrot_new_s_ic(opcode_t *, PARROT_INTERP); opcode_t * Parrot_stringinfo_i_s_i(opcode_t *, PARROT_INTERP); opcode_t * Parrot_stringinfo_i_sc_i(opcode_t *, PARROT_INTERP); opcode_t * Parrot_stringinfo_i_s_ic(opcode_t *, PARROT_INTERP); @@ -1052,6 +1059,8 @@ op_lib_t *Parrot_DynOp_core_3_6_0(PARROT_INTERP, long init); opcode_t * Parrot_trap(opcode_t *, PARROT_INTERP); opcode_t * Parrot_set_label_p_ic(opcode_t *, PARROT_INTERP); opcode_t * Parrot_get_label_i_p(opcode_t *, PARROT_INTERP); + opcode_t * Parrot_get_id_i_p(opcode_t *, PARROT_INTERP); + opcode_t * Parrot_get_id_i_pc(opcode_t *, PARROT_INTERP); opcode_t * Parrot_fetch_p_p_p_p(opcode_t *, PARROT_INTERP); opcode_t * Parrot_fetch_p_pc_p_p(opcode_t *, PARROT_INTERP); opcode_t * Parrot_fetch_p_p_pc_p(opcode_t *, PARROT_INTERP); @@ -1112,6 +1121,19 @@ op_lib_t *Parrot_DynOp_core_3_6_0(PARROT_INTERP, long init); opcode_t * Parrot_root_new_p_pc_i(opcode_t *, PARROT_INTERP); opcode_t * Parrot_root_new_p_p_ic(opcode_t *, PARROT_INTERP); opcode_t * Parrot_root_new_p_pc_ic(opcode_t *, PARROT_INTERP); + opcode_t * Parrot_get_context_p(opcode_t *, PARROT_INTERP); + opcode_t * Parrot_new_call_context_p(opcode_t *, PARROT_INTERP); + opcode_t * Parrot_invokecc_p_p(opcode_t *, PARROT_INTERP); + opcode_t * Parrot_flatten_array_into_p_p_i(opcode_t *, PARROT_INTERP); + opcode_t * Parrot_flatten_array_into_p_p_ic(opcode_t *, PARROT_INTERP); + opcode_t * Parrot_flatten_hash_into_p_p_i(opcode_t *, PARROT_INTERP); + opcode_t * Parrot_flatten_hash_into_p_p_ic(opcode_t *, PARROT_INTERP); + opcode_t * Parrot_slurp_array_from_p_p_i(opcode_t *, PARROT_INTERP); + opcode_t * Parrot_slurp_array_from_p_p_ic(opcode_t *, PARROT_INTERP); + opcode_t * Parrot_receive_p(opcode_t *, PARROT_INTERP); + opcode_t * Parrot_wait_p(opcode_t *, PARROT_INTERP); + opcode_t * Parrot_wait_pc(opcode_t *, PARROT_INTERP); + opcode_t * Parrot_pass(opcode_t *, PARROT_INTERP); #endif /* PARROT_OPLIB_CORE_OPS_H_GUARD */ diff --git a/include/parrot/oplib/ops.h b/include/parrot/oplib/ops.h index a7fd8da85f..c63d0f2982 100644 --- a/include/parrot/oplib/ops.h +++ b/include/parrot/oplib/ops.h @@ -79,1033 +79,1055 @@ typedef enum { PARROT_OP_exit_ic, /* 61 */ PARROT_OP_finalize_p, /* 62 */ PARROT_OP_finalize_pc, /* 63 */ - PARROT_OP_debug_i, /* 64 */ - PARROT_OP_debug_ic, /* 65 */ - PARROT_OP_bounds_i, /* 66 */ - PARROT_OP_bounds_ic, /* 67 */ - PARROT_OP_profile_i, /* 68 */ - PARROT_OP_profile_ic, /* 69 */ - PARROT_OP_trace_i, /* 70 */ - PARROT_OP_trace_ic, /* 71 */ - PARROT_OP_gc_debug_i, /* 72 */ - PARROT_OP_gc_debug_ic, /* 73 */ - PARROT_OP_interpinfo_i_i, /* 74 */ - PARROT_OP_interpinfo_i_ic, /* 75 */ - PARROT_OP_interpinfo_p_i, /* 76 */ - PARROT_OP_interpinfo_p_ic, /* 77 */ - PARROT_OP_interpinfo_s_i, /* 78 */ - PARROT_OP_interpinfo_s_ic, /* 79 */ - PARROT_OP_warningson_i, /* 80 */ - PARROT_OP_warningson_ic, /* 81 */ - PARROT_OP_warningsoff_i, /* 82 */ - PARROT_OP_warningsoff_ic, /* 83 */ - PARROT_OP_errorson_i, /* 84 */ - PARROT_OP_errorson_ic, /* 85 */ - PARROT_OP_errorsoff_i, /* 86 */ - PARROT_OP_errorsoff_ic, /* 87 */ - PARROT_OP_runinterp_p_i, /* 88 */ - PARROT_OP_runinterp_p_ic, /* 89 */ - PARROT_OP_getinterp_p, /* 90 */ - PARROT_OP_sweep_ic, /* 91 */ - PARROT_OP_collect, /* 92 */ - PARROT_OP_sweepoff, /* 93 */ - PARROT_OP_sweepon, /* 94 */ - PARROT_OP_collectoff, /* 95 */ - PARROT_OP_collecton, /* 96 */ - PARROT_OP_needs_destroy_p, /* 97 */ - PARROT_OP_loadlib_p_s, /* 98 */ - PARROT_OP_loadlib_p_sc, /* 99 */ - PARROT_OP_loadlib_p_s_p, /* 100 */ - PARROT_OP_loadlib_p_sc_p, /* 101 */ - PARROT_OP_loadlib_p_s_pc, /* 102 */ - PARROT_OP_loadlib_p_sc_pc, /* 103 */ - PARROT_OP_dlfunc_p_p_s_s, /* 104 */ - PARROT_OP_dlfunc_p_p_sc_s, /* 105 */ - PARROT_OP_dlfunc_p_p_s_sc, /* 106 */ - PARROT_OP_dlfunc_p_p_sc_sc, /* 107 */ - PARROT_OP_dlfunc_p_p_s_p, /* 108 */ - PARROT_OP_dlfunc_p_p_sc_p, /* 109 */ - PARROT_OP_dlvar_p_p_s, /* 110 */ - PARROT_OP_dlvar_p_p_sc, /* 111 */ - PARROT_OP_compreg_s_p, /* 112 */ - PARROT_OP_compreg_sc_p, /* 113 */ - PARROT_OP_compreg_p_s, /* 114 */ - PARROT_OP_compreg_p_sc, /* 115 */ - PARROT_OP_new_callback_p_p_p_s, /* 116 */ - PARROT_OP_new_callback_p_p_p_sc, /* 117 */ - PARROT_OP_annotations_p, /* 118 */ - PARROT_OP_annotations_p_s, /* 119 */ - PARROT_OP_annotations_p_sc, /* 120 */ - PARROT_OP_band_i_i, /* 121 */ - PARROT_OP_band_i_ic, /* 122 */ - PARROT_OP_band_i_i_i, /* 123 */ - PARROT_OP_band_i_ic_i, /* 124 */ - PARROT_OP_band_i_i_ic, /* 125 */ - PARROT_OP_bor_i_i, /* 126 */ - PARROT_OP_bor_i_ic, /* 127 */ - PARROT_OP_bor_i_i_i, /* 128 */ - PARROT_OP_bor_i_ic_i, /* 129 */ - PARROT_OP_bor_i_i_ic, /* 130 */ - PARROT_OP_shl_i_i, /* 131 */ - PARROT_OP_shl_i_ic, /* 132 */ - PARROT_OP_shl_i_i_i, /* 133 */ - PARROT_OP_shl_i_ic_i, /* 134 */ - PARROT_OP_shl_i_i_ic, /* 135 */ - PARROT_OP_shr_i_i, /* 136 */ - PARROT_OP_shr_i_ic, /* 137 */ - PARROT_OP_shr_i_i_i, /* 138 */ - PARROT_OP_shr_i_ic_i, /* 139 */ - PARROT_OP_shr_i_i_ic, /* 140 */ - PARROT_OP_lsr_i_i, /* 141 */ - PARROT_OP_lsr_i_ic, /* 142 */ - PARROT_OP_lsr_i_i_i, /* 143 */ - PARROT_OP_lsr_i_ic_i, /* 144 */ - PARROT_OP_lsr_i_i_ic, /* 145 */ - PARROT_OP_bxor_i_i, /* 146 */ - PARROT_OP_bxor_i_ic, /* 147 */ - PARROT_OP_bxor_i_i_i, /* 148 */ - PARROT_OP_bxor_i_ic_i, /* 149 */ - PARROT_OP_bxor_i_i_ic, /* 150 */ - PARROT_OP_eq_i_i_ic, /* 151 */ - PARROT_OP_eq_ic_i_ic, /* 152 */ - PARROT_OP_eq_i_ic_ic, /* 153 */ - PARROT_OP_eq_n_n_ic, /* 154 */ - PARROT_OP_eq_nc_n_ic, /* 155 */ - PARROT_OP_eq_n_nc_ic, /* 156 */ - PARROT_OP_eq_s_s_ic, /* 157 */ - PARROT_OP_eq_sc_s_ic, /* 158 */ - PARROT_OP_eq_s_sc_ic, /* 159 */ - PARROT_OP_eq_p_p_ic, /* 160 */ - PARROT_OP_eq_p_i_ic, /* 161 */ - PARROT_OP_eq_p_ic_ic, /* 162 */ - PARROT_OP_eq_p_n_ic, /* 163 */ - PARROT_OP_eq_p_nc_ic, /* 164 */ - PARROT_OP_eq_p_s_ic, /* 165 */ - PARROT_OP_eq_p_sc_ic, /* 166 */ - PARROT_OP_eq_str_p_p_ic, /* 167 */ - PARROT_OP_eq_num_p_p_ic, /* 168 */ - PARROT_OP_eq_addr_s_s_ic, /* 169 */ - PARROT_OP_eq_addr_sc_s_ic, /* 170 */ - PARROT_OP_eq_addr_s_sc_ic, /* 171 */ - PARROT_OP_eq_addr_sc_sc_ic, /* 172 */ - PARROT_OP_eq_addr_p_p_ic, /* 173 */ - PARROT_OP_ne_i_i_ic, /* 174 */ - PARROT_OP_ne_ic_i_ic, /* 175 */ - PARROT_OP_ne_i_ic_ic, /* 176 */ - PARROT_OP_ne_n_n_ic, /* 177 */ - PARROT_OP_ne_nc_n_ic, /* 178 */ - PARROT_OP_ne_n_nc_ic, /* 179 */ - PARROT_OP_ne_s_s_ic, /* 180 */ - PARROT_OP_ne_sc_s_ic, /* 181 */ - PARROT_OP_ne_s_sc_ic, /* 182 */ - PARROT_OP_ne_p_p_ic, /* 183 */ - PARROT_OP_ne_p_i_ic, /* 184 */ - PARROT_OP_ne_p_ic_ic, /* 185 */ - PARROT_OP_ne_p_n_ic, /* 186 */ - PARROT_OP_ne_p_nc_ic, /* 187 */ - PARROT_OP_ne_p_s_ic, /* 188 */ - PARROT_OP_ne_p_sc_ic, /* 189 */ - PARROT_OP_ne_str_p_p_ic, /* 190 */ - PARROT_OP_ne_num_p_p_ic, /* 191 */ - PARROT_OP_ne_addr_s_s_ic, /* 192 */ - PARROT_OP_ne_addr_sc_s_ic, /* 193 */ - PARROT_OP_ne_addr_s_sc_ic, /* 194 */ - PARROT_OP_ne_addr_sc_sc_ic, /* 195 */ - PARROT_OP_ne_addr_p_p_ic, /* 196 */ - PARROT_OP_lt_i_i_ic, /* 197 */ - PARROT_OP_lt_ic_i_ic, /* 198 */ - PARROT_OP_lt_i_ic_ic, /* 199 */ - PARROT_OP_lt_n_n_ic, /* 200 */ - PARROT_OP_lt_nc_n_ic, /* 201 */ - PARROT_OP_lt_n_nc_ic, /* 202 */ - PARROT_OP_lt_s_s_ic, /* 203 */ - PARROT_OP_lt_sc_s_ic, /* 204 */ - PARROT_OP_lt_s_sc_ic, /* 205 */ - PARROT_OP_lt_p_p_ic, /* 206 */ - PARROT_OP_lt_p_i_ic, /* 207 */ - PARROT_OP_lt_p_ic_ic, /* 208 */ - PARROT_OP_lt_p_n_ic, /* 209 */ - PARROT_OP_lt_p_nc_ic, /* 210 */ - PARROT_OP_lt_p_s_ic, /* 211 */ - PARROT_OP_lt_p_sc_ic, /* 212 */ - PARROT_OP_lt_str_p_p_ic, /* 213 */ - PARROT_OP_lt_num_p_p_ic, /* 214 */ - PARROT_OP_le_i_i_ic, /* 215 */ - PARROT_OP_le_ic_i_ic, /* 216 */ - PARROT_OP_le_i_ic_ic, /* 217 */ - PARROT_OP_le_n_n_ic, /* 218 */ - PARROT_OP_le_nc_n_ic, /* 219 */ - PARROT_OP_le_n_nc_ic, /* 220 */ - PARROT_OP_le_s_s_ic, /* 221 */ - PARROT_OP_le_sc_s_ic, /* 222 */ - PARROT_OP_le_s_sc_ic, /* 223 */ - PARROT_OP_le_p_p_ic, /* 224 */ - PARROT_OP_le_p_i_ic, /* 225 */ - PARROT_OP_le_p_ic_ic, /* 226 */ - PARROT_OP_le_p_n_ic, /* 227 */ - PARROT_OP_le_p_nc_ic, /* 228 */ - PARROT_OP_le_p_s_ic, /* 229 */ - PARROT_OP_le_p_sc_ic, /* 230 */ - PARROT_OP_le_str_p_p_ic, /* 231 */ - PARROT_OP_le_num_p_p_ic, /* 232 */ - PARROT_OP_gt_p_p_ic, /* 233 */ - PARROT_OP_gt_p_i_ic, /* 234 */ - PARROT_OP_gt_p_ic_ic, /* 235 */ - PARROT_OP_gt_p_n_ic, /* 236 */ - PARROT_OP_gt_p_nc_ic, /* 237 */ - PARROT_OP_gt_p_s_ic, /* 238 */ - PARROT_OP_gt_p_sc_ic, /* 239 */ - PARROT_OP_gt_str_p_p_ic, /* 240 */ - PARROT_OP_gt_num_p_p_ic, /* 241 */ - PARROT_OP_ge_p_p_ic, /* 242 */ - PARROT_OP_ge_p_i_ic, /* 243 */ - PARROT_OP_ge_p_ic_ic, /* 244 */ - PARROT_OP_ge_p_n_ic, /* 245 */ - PARROT_OP_ge_p_nc_ic, /* 246 */ - PARROT_OP_ge_p_s_ic, /* 247 */ - PARROT_OP_ge_p_sc_ic, /* 248 */ - PARROT_OP_ge_str_p_p_ic, /* 249 */ - PARROT_OP_ge_num_p_p_ic, /* 250 */ - PARROT_OP_if_null_p_ic, /* 251 */ - PARROT_OP_if_null_s_ic, /* 252 */ - PARROT_OP_unless_null_p_ic, /* 253 */ - PARROT_OP_unless_null_s_ic, /* 254 */ - PARROT_OP_cmp_i_i_i, /* 255 */ - PARROT_OP_cmp_i_ic_i, /* 256 */ - PARROT_OP_cmp_i_i_ic, /* 257 */ - PARROT_OP_cmp_i_n_n, /* 258 */ - PARROT_OP_cmp_i_nc_n, /* 259 */ - PARROT_OP_cmp_i_n_nc, /* 260 */ - PARROT_OP_cmp_i_s_s, /* 261 */ - PARROT_OP_cmp_i_sc_s, /* 262 */ - PARROT_OP_cmp_i_s_sc, /* 263 */ - PARROT_OP_cmp_i_p_p, /* 264 */ - PARROT_OP_cmp_i_p_i, /* 265 */ - PARROT_OP_cmp_i_p_ic, /* 266 */ - PARROT_OP_cmp_i_p_n, /* 267 */ - PARROT_OP_cmp_i_p_nc, /* 268 */ - PARROT_OP_cmp_i_p_s, /* 269 */ - PARROT_OP_cmp_i_p_sc, /* 270 */ - PARROT_OP_cmp_str_i_p_p, /* 271 */ - PARROT_OP_cmp_num_i_p_p, /* 272 */ - PARROT_OP_cmp_pmc_p_p_p, /* 273 */ - PARROT_OP_issame_i_p_p, /* 274 */ - PARROT_OP_issame_i_s_s, /* 275 */ - PARROT_OP_issame_i_sc_s, /* 276 */ - PARROT_OP_issame_i_s_sc, /* 277 */ - PARROT_OP_issame_i_sc_sc, /* 278 */ - PARROT_OP_isntsame_i_p_p, /* 279 */ - PARROT_OP_isntsame_i_s_s, /* 280 */ - PARROT_OP_isntsame_i_sc_s, /* 281 */ - PARROT_OP_isntsame_i_s_sc, /* 282 */ - PARROT_OP_isntsame_i_sc_sc, /* 283 */ - PARROT_OP_istrue_i_p, /* 284 */ - PARROT_OP_isfalse_i_p, /* 285 */ - PARROT_OP_isnull_i_p, /* 286 */ - PARROT_OP_isnull_i_pc, /* 287 */ - PARROT_OP_isnull_i_s, /* 288 */ - PARROT_OP_isnull_i_sc, /* 289 */ - PARROT_OP_isgt_i_p_p, /* 290 */ - PARROT_OP_isge_i_p_p, /* 291 */ - PARROT_OP_isle_i_i_i, /* 292 */ - PARROT_OP_isle_i_ic_i, /* 293 */ - PARROT_OP_isle_i_i_ic, /* 294 */ - PARROT_OP_isle_i_n_n, /* 295 */ - PARROT_OP_isle_i_nc_n, /* 296 */ - PARROT_OP_isle_i_n_nc, /* 297 */ - PARROT_OP_isle_i_s_s, /* 298 */ - PARROT_OP_isle_i_sc_s, /* 299 */ - PARROT_OP_isle_i_s_sc, /* 300 */ - PARROT_OP_isle_i_p_p, /* 301 */ - PARROT_OP_islt_i_i_i, /* 302 */ - PARROT_OP_islt_i_ic_i, /* 303 */ - PARROT_OP_islt_i_i_ic, /* 304 */ - PARROT_OP_islt_i_n_n, /* 305 */ - PARROT_OP_islt_i_nc_n, /* 306 */ - PARROT_OP_islt_i_n_nc, /* 307 */ - PARROT_OP_islt_i_s_s, /* 308 */ - PARROT_OP_islt_i_sc_s, /* 309 */ - PARROT_OP_islt_i_s_sc, /* 310 */ - PARROT_OP_islt_i_p_p, /* 311 */ - PARROT_OP_iseq_i_i_i, /* 312 */ - PARROT_OP_iseq_i_ic_i, /* 313 */ - PARROT_OP_iseq_i_i_ic, /* 314 */ - PARROT_OP_iseq_i_n_n, /* 315 */ - PARROT_OP_iseq_i_nc_n, /* 316 */ - PARROT_OP_iseq_i_n_nc, /* 317 */ - PARROT_OP_iseq_i_s_s, /* 318 */ - PARROT_OP_iseq_i_sc_s, /* 319 */ - PARROT_OP_iseq_i_s_sc, /* 320 */ - PARROT_OP_iseq_i_p_p, /* 321 */ - PARROT_OP_isne_i_i_i, /* 322 */ - PARROT_OP_isne_i_ic_i, /* 323 */ - PARROT_OP_isne_i_i_ic, /* 324 */ - PARROT_OP_isne_i_n_n, /* 325 */ - PARROT_OP_isne_i_nc_n, /* 326 */ - PARROT_OP_isne_i_n_nc, /* 327 */ - PARROT_OP_isne_i_s_s, /* 328 */ - PARROT_OP_isne_i_sc_s, /* 329 */ - PARROT_OP_isne_i_s_sc, /* 330 */ - PARROT_OP_isne_i_p_p, /* 331 */ - PARROT_OP_and_i_i_i, /* 332 */ - PARROT_OP_and_i_ic_i, /* 333 */ - PARROT_OP_and_i_i_ic, /* 334 */ - PARROT_OP_and_p_p_p, /* 335 */ - PARROT_OP_not_i, /* 336 */ - PARROT_OP_not_i_i, /* 337 */ - PARROT_OP_not_p, /* 338 */ - PARROT_OP_not_p_p, /* 339 */ - PARROT_OP_or_i_i_i, /* 340 */ - PARROT_OP_or_i_ic_i, /* 341 */ - PARROT_OP_or_i_i_ic, /* 342 */ - PARROT_OP_or_p_p_p, /* 343 */ - PARROT_OP_xor_i_i_i, /* 344 */ - PARROT_OP_xor_i_ic_i, /* 345 */ - PARROT_OP_xor_i_i_ic, /* 346 */ - PARROT_OP_xor_p_p_p, /* 347 */ - PARROT_OP_print_i, /* 348 */ - PARROT_OP_print_ic, /* 349 */ - PARROT_OP_print_n, /* 350 */ - PARROT_OP_print_nc, /* 351 */ - PARROT_OP_print_s, /* 352 */ - PARROT_OP_print_sc, /* 353 */ - PARROT_OP_print_p, /* 354 */ - PARROT_OP_say_i, /* 355 */ - PARROT_OP_say_ic, /* 356 */ - PARROT_OP_say_n, /* 357 */ - PARROT_OP_say_nc, /* 358 */ - PARROT_OP_say_s, /* 359 */ - PARROT_OP_say_sc, /* 360 */ - PARROT_OP_say_p, /* 361 */ - PARROT_OP_print_p_i, /* 362 */ - PARROT_OP_print_p_ic, /* 363 */ - PARROT_OP_print_p_n, /* 364 */ - PARROT_OP_print_p_nc, /* 365 */ - PARROT_OP_print_p_s, /* 366 */ - PARROT_OP_print_p_sc, /* 367 */ - PARROT_OP_print_p_p, /* 368 */ - PARROT_OP_getstdin_p, /* 369 */ - PARROT_OP_getstdout_p, /* 370 */ - PARROT_OP_getstderr_p, /* 371 */ - PARROT_OP_abs_i, /* 372 */ - PARROT_OP_abs_n, /* 373 */ - PARROT_OP_abs_i_i, /* 374 */ - PARROT_OP_abs_n_n, /* 375 */ - PARROT_OP_abs_p, /* 376 */ - PARROT_OP_abs_p_p, /* 377 */ - PARROT_OP_add_i_i, /* 378 */ - PARROT_OP_add_i_ic, /* 379 */ - PARROT_OP_add_n_n, /* 380 */ - PARROT_OP_add_n_nc, /* 381 */ - PARROT_OP_add_p_p, /* 382 */ - PARROT_OP_add_p_i, /* 383 */ - PARROT_OP_add_p_ic, /* 384 */ - PARROT_OP_add_p_n, /* 385 */ - PARROT_OP_add_p_nc, /* 386 */ - PARROT_OP_add_i_i_i, /* 387 */ - PARROT_OP_add_i_ic_i, /* 388 */ - PARROT_OP_add_i_i_ic, /* 389 */ - PARROT_OP_add_n_n_n, /* 390 */ - PARROT_OP_add_n_nc_n, /* 391 */ - PARROT_OP_add_n_n_nc, /* 392 */ - PARROT_OP_add_p_p_p, /* 393 */ - PARROT_OP_add_p_p_i, /* 394 */ - PARROT_OP_add_p_p_ic, /* 395 */ - PARROT_OP_add_p_p_n, /* 396 */ - PARROT_OP_add_p_p_nc, /* 397 */ - PARROT_OP_dec_i, /* 398 */ - PARROT_OP_dec_n, /* 399 */ - PARROT_OP_dec_p, /* 400 */ - PARROT_OP_div_i_i, /* 401 */ - PARROT_OP_div_i_ic, /* 402 */ - PARROT_OP_div_n_n, /* 403 */ - PARROT_OP_div_n_nc, /* 404 */ - PARROT_OP_div_p_p, /* 405 */ - PARROT_OP_div_p_i, /* 406 */ - PARROT_OP_div_p_ic, /* 407 */ - PARROT_OP_div_p_n, /* 408 */ - PARROT_OP_div_p_nc, /* 409 */ - PARROT_OP_div_i_i_i, /* 410 */ - PARROT_OP_div_i_ic_i, /* 411 */ - PARROT_OP_div_i_i_ic, /* 412 */ - PARROT_OP_div_i_ic_ic, /* 413 */ - PARROT_OP_div_n_n_n, /* 414 */ - PARROT_OP_div_n_nc_n, /* 415 */ - PARROT_OP_div_n_n_nc, /* 416 */ - PARROT_OP_div_n_nc_nc, /* 417 */ - PARROT_OP_div_p_p_p, /* 418 */ - PARROT_OP_div_p_p_i, /* 419 */ - PARROT_OP_div_p_p_ic, /* 420 */ - PARROT_OP_div_p_p_n, /* 421 */ - PARROT_OP_div_p_p_nc, /* 422 */ - PARROT_OP_fdiv_i_i, /* 423 */ - PARROT_OP_fdiv_i_ic, /* 424 */ - PARROT_OP_fdiv_n_n, /* 425 */ - PARROT_OP_fdiv_n_nc, /* 426 */ - PARROT_OP_fdiv_p_p, /* 427 */ - PARROT_OP_fdiv_p_i, /* 428 */ - PARROT_OP_fdiv_p_ic, /* 429 */ - PARROT_OP_fdiv_p_n, /* 430 */ - PARROT_OP_fdiv_p_nc, /* 431 */ - PARROT_OP_fdiv_i_i_i, /* 432 */ - PARROT_OP_fdiv_i_ic_i, /* 433 */ - PARROT_OP_fdiv_i_i_ic, /* 434 */ - PARROT_OP_fdiv_n_n_n, /* 435 */ - PARROT_OP_fdiv_n_nc_n, /* 436 */ - PARROT_OP_fdiv_n_n_nc, /* 437 */ - PARROT_OP_fdiv_p_p_p, /* 438 */ - PARROT_OP_fdiv_p_p_i, /* 439 */ - PARROT_OP_fdiv_p_p_ic, /* 440 */ - PARROT_OP_fdiv_p_p_n, /* 441 */ - PARROT_OP_fdiv_p_p_nc, /* 442 */ - PARROT_OP_ceil_n, /* 443 */ - PARROT_OP_ceil_i_n, /* 444 */ - PARROT_OP_ceil_n_n, /* 445 */ - PARROT_OP_floor_n, /* 446 */ - PARROT_OP_floor_i_n, /* 447 */ - PARROT_OP_floor_n_n, /* 448 */ - PARROT_OP_inc_i, /* 449 */ - PARROT_OP_inc_n, /* 450 */ - PARROT_OP_inc_p, /* 451 */ - PARROT_OP_mod_i_i, /* 452 */ - PARROT_OP_mod_i_ic, /* 453 */ - PARROT_OP_mod_n_n, /* 454 */ - PARROT_OP_mod_n_nc, /* 455 */ - PARROT_OP_mod_p_p, /* 456 */ - PARROT_OP_mod_p_i, /* 457 */ - PARROT_OP_mod_p_ic, /* 458 */ - PARROT_OP_mod_p_n, /* 459 */ - PARROT_OP_mod_p_nc, /* 460 */ - PARROT_OP_mod_i_i_i, /* 461 */ - PARROT_OP_mod_i_ic_i, /* 462 */ - PARROT_OP_mod_i_i_ic, /* 463 */ - PARROT_OP_mod_n_n_n, /* 464 */ - PARROT_OP_mod_n_nc_n, /* 465 */ - PARROT_OP_mod_n_n_nc, /* 466 */ - PARROT_OP_mod_p_p_p, /* 467 */ - PARROT_OP_mod_p_p_i, /* 468 */ - PARROT_OP_mod_p_p_ic, /* 469 */ - PARROT_OP_mod_p_p_n, /* 470 */ - PARROT_OP_mod_p_p_nc, /* 471 */ - PARROT_OP_mul_i_i, /* 472 */ - PARROT_OP_mul_i_ic, /* 473 */ - PARROT_OP_mul_n_n, /* 474 */ - PARROT_OP_mul_n_nc, /* 475 */ - PARROT_OP_mul_p_p, /* 476 */ - PARROT_OP_mul_p_i, /* 477 */ - PARROT_OP_mul_p_ic, /* 478 */ - PARROT_OP_mul_p_n, /* 479 */ - PARROT_OP_mul_p_nc, /* 480 */ - PARROT_OP_mul_i_i_i, /* 481 */ - PARROT_OP_mul_i_ic_i, /* 482 */ - PARROT_OP_mul_i_i_ic, /* 483 */ - PARROT_OP_mul_n_n_n, /* 484 */ - PARROT_OP_mul_n_nc_n, /* 485 */ - PARROT_OP_mul_n_n_nc, /* 486 */ - PARROT_OP_mul_p_p_p, /* 487 */ - PARROT_OP_mul_p_p_i, /* 488 */ - PARROT_OP_mul_p_p_ic, /* 489 */ - PARROT_OP_mul_p_p_n, /* 490 */ - PARROT_OP_mul_p_p_nc, /* 491 */ - PARROT_OP_neg_i, /* 492 */ - PARROT_OP_neg_n, /* 493 */ - PARROT_OP_neg_p, /* 494 */ - PARROT_OP_neg_i_i, /* 495 */ - PARROT_OP_neg_n_n, /* 496 */ - PARROT_OP_neg_p_p, /* 497 */ - PARROT_OP_sub_i_i, /* 498 */ - PARROT_OP_sub_i_ic, /* 499 */ - PARROT_OP_sub_n_n, /* 500 */ - PARROT_OP_sub_n_nc, /* 501 */ - PARROT_OP_sub_p_p, /* 502 */ - PARROT_OP_sub_p_i, /* 503 */ - PARROT_OP_sub_p_ic, /* 504 */ - PARROT_OP_sub_p_n, /* 505 */ - PARROT_OP_sub_p_nc, /* 506 */ - PARROT_OP_sub_i_i_i, /* 507 */ - PARROT_OP_sub_i_ic_i, /* 508 */ - PARROT_OP_sub_i_i_ic, /* 509 */ - PARROT_OP_sub_n_n_n, /* 510 */ - PARROT_OP_sub_n_nc_n, /* 511 */ - PARROT_OP_sub_n_n_nc, /* 512 */ - PARROT_OP_sub_p_p_p, /* 513 */ - PARROT_OP_sub_p_p_i, /* 514 */ - PARROT_OP_sub_p_p_ic, /* 515 */ - PARROT_OP_sub_p_p_n, /* 516 */ - PARROT_OP_sub_p_p_nc, /* 517 */ - PARROT_OP_sqrt_n_n, /* 518 */ - PARROT_OP_callmethodcc_p_s, /* 519 */ - PARROT_OP_callmethodcc_p_sc, /* 520 */ - PARROT_OP_callmethodcc_p_p, /* 521 */ - PARROT_OP_callmethod_p_s_p, /* 522 */ - PARROT_OP_callmethod_p_sc_p, /* 523 */ - PARROT_OP_callmethod_p_p_p, /* 524 */ - PARROT_OP_tailcallmethod_p_s, /* 525 */ - PARROT_OP_tailcallmethod_p_sc, /* 526 */ - PARROT_OP_tailcallmethod_p_p, /* 527 */ - PARROT_OP_addmethod_p_s_p, /* 528 */ - PARROT_OP_addmethod_p_sc_p, /* 529 */ - PARROT_OP_can_i_p_s, /* 530 */ - PARROT_OP_can_i_p_sc, /* 531 */ - PARROT_OP_does_i_p_s, /* 532 */ - PARROT_OP_does_i_p_sc, /* 533 */ - PARROT_OP_does_i_p_p, /* 534 */ - PARROT_OP_does_i_p_pc, /* 535 */ - PARROT_OP_isa_i_p_s, /* 536 */ - PARROT_OP_isa_i_p_sc, /* 537 */ - PARROT_OP_isa_i_p_p, /* 538 */ - PARROT_OP_isa_i_p_pc, /* 539 */ - PARROT_OP_newclass_p_s, /* 540 */ - PARROT_OP_newclass_p_sc, /* 541 */ - PARROT_OP_newclass_p_p, /* 542 */ - PARROT_OP_newclass_p_pc, /* 543 */ - PARROT_OP_subclass_p_p, /* 544 */ - PARROT_OP_subclass_p_pc, /* 545 */ - PARROT_OP_subclass_p_p_s, /* 546 */ - PARROT_OP_subclass_p_pc_s, /* 547 */ - PARROT_OP_subclass_p_p_sc, /* 548 */ - PARROT_OP_subclass_p_pc_sc, /* 549 */ - PARROT_OP_subclass_p_p_p, /* 550 */ - PARROT_OP_subclass_p_pc_p, /* 551 */ - PARROT_OP_subclass_p_p_pc, /* 552 */ - PARROT_OP_subclass_p_pc_pc, /* 553 */ - PARROT_OP_subclass_p_s, /* 554 */ - PARROT_OP_subclass_p_sc, /* 555 */ - PARROT_OP_subclass_p_s_s, /* 556 */ - PARROT_OP_subclass_p_sc_s, /* 557 */ - PARROT_OP_subclass_p_s_sc, /* 558 */ - PARROT_OP_subclass_p_sc_sc, /* 559 */ - PARROT_OP_subclass_p_s_p, /* 560 */ - PARROT_OP_subclass_p_sc_p, /* 561 */ - PARROT_OP_subclass_p_s_pc, /* 562 */ - PARROT_OP_subclass_p_sc_pc, /* 563 */ - PARROT_OP_get_class_p_s, /* 564 */ - PARROT_OP_get_class_p_sc, /* 565 */ - PARROT_OP_get_class_p_p, /* 566 */ - PARROT_OP_get_class_p_pc, /* 567 */ - PARROT_OP_class_p_p, /* 568 */ - PARROT_OP_addparent_p_p, /* 569 */ - PARROT_OP_removeparent_p_p, /* 570 */ - PARROT_OP_addrole_p_p, /* 571 */ - PARROT_OP_addattribute_p_s, /* 572 */ - PARROT_OP_addattribute_p_sc, /* 573 */ - PARROT_OP_removeattribute_p_s, /* 574 */ - PARROT_OP_removeattribute_p_sc, /* 575 */ - PARROT_OP_getattribute_p_p_s, /* 576 */ - PARROT_OP_getattribute_p_p_sc, /* 577 */ - PARROT_OP_getattribute_p_p_p_s, /* 578 */ - PARROT_OP_getattribute_p_p_pc_s, /* 579 */ - PARROT_OP_getattribute_p_p_p_sc, /* 580 */ - PARROT_OP_getattribute_p_p_pc_sc, /* 581 */ - PARROT_OP_setattribute_p_s_p, /* 582 */ - PARROT_OP_setattribute_p_sc_p, /* 583 */ - PARROT_OP_setattribute_p_p_s_p, /* 584 */ - PARROT_OP_setattribute_p_pc_s_p, /* 585 */ - PARROT_OP_setattribute_p_p_sc_p, /* 586 */ - PARROT_OP_setattribute_p_pc_sc_p, /* 587 */ - PARROT_OP_inspect_p_p, /* 588 */ - PARROT_OP_inspect_p_pc, /* 589 */ - PARROT_OP_inspect_p_p_s, /* 590 */ - PARROT_OP_inspect_p_pc_s, /* 591 */ - PARROT_OP_inspect_p_p_sc, /* 592 */ - PARROT_OP_inspect_p_pc_sc, /* 593 */ - PARROT_OP_new_p_s, /* 594 */ - PARROT_OP_new_p_sc, /* 595 */ - PARROT_OP_new_p_s_p, /* 596 */ - PARROT_OP_new_p_sc_p, /* 597 */ - PARROT_OP_new_p_s_pc, /* 598 */ - PARROT_OP_new_p_sc_pc, /* 599 */ - PARROT_OP_new_p_p, /* 600 */ - PARROT_OP_new_p_pc, /* 601 */ - PARROT_OP_new_p_p_p, /* 602 */ - PARROT_OP_new_p_pc_p, /* 603 */ - PARROT_OP_new_p_p_pc, /* 604 */ - PARROT_OP_new_p_pc_pc, /* 605 */ - PARROT_OP_root_new_p_p, /* 606 */ - PARROT_OP_root_new_p_pc, /* 607 */ - PARROT_OP_root_new_p_p_p, /* 608 */ - PARROT_OP_root_new_p_pc_p, /* 609 */ - PARROT_OP_root_new_p_p_pc, /* 610 */ - PARROT_OP_root_new_p_pc_pc, /* 611 */ - PARROT_OP_typeof_s_p, /* 612 */ - PARROT_OP_typeof_p_p, /* 613 */ - PARROT_OP_get_repr_s_p, /* 614 */ - PARROT_OP_find_method_p_p_s, /* 615 */ - PARROT_OP_find_method_p_p_sc, /* 616 */ - PARROT_OP_defined_i_p, /* 617 */ - PARROT_OP_defined_i_p_ki, /* 618 */ - PARROT_OP_defined_i_p_kic, /* 619 */ - PARROT_OP_defined_i_p_k, /* 620 */ - PARROT_OP_defined_i_p_kc, /* 621 */ - PARROT_OP_exists_i_p_ki, /* 622 */ - PARROT_OP_exists_i_p_kic, /* 623 */ - PARROT_OP_exists_i_p_k, /* 624 */ - PARROT_OP_exists_i_p_kc, /* 625 */ - PARROT_OP_delete_p_k, /* 626 */ - PARROT_OP_delete_p_kc, /* 627 */ - PARROT_OP_delete_p_ki, /* 628 */ - PARROT_OP_delete_p_kic, /* 629 */ - PARROT_OP_elements_i_p, /* 630 */ - PARROT_OP_push_p_i, /* 631 */ - PARROT_OP_push_p_ic, /* 632 */ - PARROT_OP_push_p_n, /* 633 */ - PARROT_OP_push_p_nc, /* 634 */ - PARROT_OP_push_p_s, /* 635 */ - PARROT_OP_push_p_sc, /* 636 */ - PARROT_OP_push_p_p, /* 637 */ - PARROT_OP_pop_i_p, /* 638 */ - PARROT_OP_pop_n_p, /* 639 */ - PARROT_OP_pop_s_p, /* 640 */ - PARROT_OP_pop_p_p, /* 641 */ - PARROT_OP_unshift_p_i, /* 642 */ - PARROT_OP_unshift_p_ic, /* 643 */ - PARROT_OP_unshift_p_n, /* 644 */ - PARROT_OP_unshift_p_nc, /* 645 */ - PARROT_OP_unshift_p_s, /* 646 */ - PARROT_OP_unshift_p_sc, /* 647 */ - PARROT_OP_unshift_p_p, /* 648 */ - PARROT_OP_shift_i_p, /* 649 */ - PARROT_OP_shift_n_p, /* 650 */ - PARROT_OP_shift_s_p, /* 651 */ - PARROT_OP_shift_p_p, /* 652 */ - PARROT_OP_splice_p_p_i_i, /* 653 */ - PARROT_OP_splice_p_p_ic_i, /* 654 */ - PARROT_OP_splice_p_p_i_ic, /* 655 */ - PARROT_OP_splice_p_p_ic_ic, /* 656 */ - PARROT_OP_setprop_p_s_p, /* 657 */ - PARROT_OP_setprop_p_sc_p, /* 658 */ - PARROT_OP_getprop_p_s_p, /* 659 */ - PARROT_OP_getprop_p_sc_p, /* 660 */ - PARROT_OP_delprop_p_s, /* 661 */ - PARROT_OP_delprop_p_sc, /* 662 */ - PARROT_OP_prophash_p_p, /* 663 */ - PARROT_OP_freeze_s_p, /* 664 */ - PARROT_OP_thaw_p_s, /* 665 */ - PARROT_OP_thaw_p_sc, /* 666 */ - PARROT_OP_add_multi_s_s_p, /* 667 */ - PARROT_OP_add_multi_sc_s_p, /* 668 */ - PARROT_OP_add_multi_s_sc_p, /* 669 */ - PARROT_OP_add_multi_sc_sc_p, /* 670 */ - PARROT_OP_find_multi_p_s_s, /* 671 */ - PARROT_OP_find_multi_p_sc_s, /* 672 */ - PARROT_OP_find_multi_p_s_sc, /* 673 */ - PARROT_OP_find_multi_p_sc_sc, /* 674 */ - PARROT_OP_register_p, /* 675 */ - PARROT_OP_unregister_p, /* 676 */ - PARROT_OP_box_p_i, /* 677 */ - PARROT_OP_box_p_ic, /* 678 */ - PARROT_OP_box_p_n, /* 679 */ - PARROT_OP_box_p_nc, /* 680 */ - PARROT_OP_box_p_s, /* 681 */ - PARROT_OP_box_p_sc, /* 682 */ - PARROT_OP_iter_p_p, /* 683 */ - PARROT_OP_morph_p_p, /* 684 */ - PARROT_OP_morph_p_pc, /* 685 */ - PARROT_OP_clone_s_s, /* 686 */ - PARROT_OP_clone_s_sc, /* 687 */ - PARROT_OP_set_i_i, /* 688 */ - PARROT_OP_set_i_ic, /* 689 */ - PARROT_OP_set_i_n, /* 690 */ - PARROT_OP_set_i_nc, /* 691 */ - PARROT_OP_set_i_s, /* 692 */ - PARROT_OP_set_i_sc, /* 693 */ - PARROT_OP_set_n_n, /* 694 */ - PARROT_OP_set_n_nc, /* 695 */ - PARROT_OP_set_n_i, /* 696 */ - PARROT_OP_set_n_ic, /* 697 */ - PARROT_OP_set_n_s, /* 698 */ - PARROT_OP_set_n_sc, /* 699 */ - PARROT_OP_set_n_p, /* 700 */ - PARROT_OP_set_s_p, /* 701 */ - PARROT_OP_set_s_s, /* 702 */ - PARROT_OP_set_s_sc, /* 703 */ - PARROT_OP_set_s_i, /* 704 */ - PARROT_OP_set_s_ic, /* 705 */ - PARROT_OP_set_s_n, /* 706 */ - PARROT_OP_set_s_nc, /* 707 */ - PARROT_OP_set_p_pc, /* 708 */ - PARROT_OP_set_p_p, /* 709 */ - PARROT_OP_set_p_i, /* 710 */ - PARROT_OP_set_p_ic, /* 711 */ - PARROT_OP_set_p_n, /* 712 */ - PARROT_OP_set_p_nc, /* 713 */ - PARROT_OP_set_p_s, /* 714 */ - PARROT_OP_set_p_sc, /* 715 */ - PARROT_OP_set_i_p, /* 716 */ - PARROT_OP_assign_p_p, /* 717 */ - PARROT_OP_assign_p_i, /* 718 */ - PARROT_OP_assign_p_ic, /* 719 */ - PARROT_OP_assign_p_n, /* 720 */ - PARROT_OP_assign_p_nc, /* 721 */ - PARROT_OP_assign_p_s, /* 722 */ - PARROT_OP_assign_p_sc, /* 723 */ - PARROT_OP_assign_s_s, /* 724 */ - PARROT_OP_assign_s_sc, /* 725 */ - PARROT_OP_setref_p_p, /* 726 */ - PARROT_OP_deref_p_p, /* 727 */ - PARROT_OP_set_p_ki_i, /* 728 */ - PARROT_OP_set_p_kic_i, /* 729 */ - PARROT_OP_set_p_ki_ic, /* 730 */ - PARROT_OP_set_p_kic_ic, /* 731 */ - PARROT_OP_set_p_ki_n, /* 732 */ - PARROT_OP_set_p_kic_n, /* 733 */ - PARROT_OP_set_p_ki_nc, /* 734 */ - PARROT_OP_set_p_kic_nc, /* 735 */ - PARROT_OP_set_p_ki_s, /* 736 */ - PARROT_OP_set_p_kic_s, /* 737 */ - PARROT_OP_set_p_ki_sc, /* 738 */ - PARROT_OP_set_p_kic_sc, /* 739 */ - PARROT_OP_set_p_ki_p, /* 740 */ - PARROT_OP_set_p_kic_p, /* 741 */ - PARROT_OP_set_i_p_ki, /* 742 */ - PARROT_OP_set_i_p_kic, /* 743 */ - PARROT_OP_set_n_p_ki, /* 744 */ - PARROT_OP_set_n_p_kic, /* 745 */ - PARROT_OP_set_s_p_ki, /* 746 */ - PARROT_OP_set_s_p_kic, /* 747 */ - PARROT_OP_set_p_p_ki, /* 748 */ - PARROT_OP_set_p_p_kic, /* 749 */ - PARROT_OP_set_p_k_i, /* 750 */ - PARROT_OP_set_p_kc_i, /* 751 */ - PARROT_OP_set_p_k_ic, /* 752 */ - PARROT_OP_set_p_kc_ic, /* 753 */ - PARROT_OP_set_p_k_n, /* 754 */ - PARROT_OP_set_p_kc_n, /* 755 */ - PARROT_OP_set_p_k_nc, /* 756 */ - PARROT_OP_set_p_kc_nc, /* 757 */ - PARROT_OP_set_p_k_s, /* 758 */ - PARROT_OP_set_p_kc_s, /* 759 */ - PARROT_OP_set_p_k_sc, /* 760 */ - PARROT_OP_set_p_kc_sc, /* 761 */ - PARROT_OP_set_p_k_p, /* 762 */ - PARROT_OP_set_p_kc_p, /* 763 */ - PARROT_OP_set_i_p_k, /* 764 */ - PARROT_OP_set_i_p_kc, /* 765 */ - PARROT_OP_set_n_p_k, /* 766 */ - PARROT_OP_set_n_p_kc, /* 767 */ - PARROT_OP_set_s_p_k, /* 768 */ - PARROT_OP_set_s_p_kc, /* 769 */ - PARROT_OP_set_p_p_k, /* 770 */ - PARROT_OP_set_p_p_kc, /* 771 */ - PARROT_OP_clone_p_p, /* 772 */ - PARROT_OP_clone_p_p_p, /* 773 */ - PARROT_OP_clone_p_p_pc, /* 774 */ - PARROT_OP_copy_p_p, /* 775 */ - PARROT_OP_null_s, /* 776 */ - PARROT_OP_null_i, /* 777 */ - PARROT_OP_null_p, /* 778 */ - PARROT_OP_null_n, /* 779 */ - PARROT_OP_ord_i_s, /* 780 */ - PARROT_OP_ord_i_sc, /* 781 */ - PARROT_OP_ord_i_s_i, /* 782 */ - PARROT_OP_ord_i_sc_i, /* 783 */ - PARROT_OP_ord_i_s_ic, /* 784 */ - PARROT_OP_ord_i_sc_ic, /* 785 */ - PARROT_OP_chr_s_i, /* 786 */ - PARROT_OP_chr_s_ic, /* 787 */ - PARROT_OP_chopn_s_s_i, /* 788 */ - PARROT_OP_chopn_s_sc_i, /* 789 */ - PARROT_OP_chopn_s_s_ic, /* 790 */ - PARROT_OP_chopn_s_sc_ic, /* 791 */ - PARROT_OP_concat_p_p, /* 792 */ - PARROT_OP_concat_p_s, /* 793 */ - PARROT_OP_concat_p_sc, /* 794 */ - PARROT_OP_concat_s_s_s, /* 795 */ - PARROT_OP_concat_s_sc_s, /* 796 */ - PARROT_OP_concat_s_s_sc, /* 797 */ - PARROT_OP_concat_p_p_s, /* 798 */ - PARROT_OP_concat_p_p_sc, /* 799 */ - PARROT_OP_concat_p_p_p, /* 800 */ - PARROT_OP_repeat_s_s_i, /* 801 */ - PARROT_OP_repeat_s_sc_i, /* 802 */ - PARROT_OP_repeat_s_s_ic, /* 803 */ - PARROT_OP_repeat_s_sc_ic, /* 804 */ - PARROT_OP_repeat_p_p_i, /* 805 */ - PARROT_OP_repeat_p_p_ic, /* 806 */ - PARROT_OP_repeat_p_p_p, /* 807 */ - PARROT_OP_repeat_p_i, /* 808 */ - PARROT_OP_repeat_p_ic, /* 809 */ - PARROT_OP_repeat_p_p, /* 810 */ - PARROT_OP_length_i_s, /* 811 */ - PARROT_OP_length_i_sc, /* 812 */ - PARROT_OP_bytelength_i_s, /* 813 */ - PARROT_OP_bytelength_i_sc, /* 814 */ - PARROT_OP_pin_s, /* 815 */ - PARROT_OP_unpin_s, /* 816 */ - PARROT_OP_substr_s_s_i, /* 817 */ - PARROT_OP_substr_s_sc_i, /* 818 */ - PARROT_OP_substr_s_s_ic, /* 819 */ - PARROT_OP_substr_s_sc_ic, /* 820 */ - PARROT_OP_substr_s_s_i_i, /* 821 */ - PARROT_OP_substr_s_sc_i_i, /* 822 */ - PARROT_OP_substr_s_s_ic_i, /* 823 */ - PARROT_OP_substr_s_sc_ic_i, /* 824 */ - PARROT_OP_substr_s_s_i_ic, /* 825 */ - PARROT_OP_substr_s_sc_i_ic, /* 826 */ - PARROT_OP_substr_s_s_ic_ic, /* 827 */ - PARROT_OP_substr_s_sc_ic_ic, /* 828 */ - PARROT_OP_substr_s_p_i_i, /* 829 */ - PARROT_OP_substr_s_p_ic_i, /* 830 */ - PARROT_OP_substr_s_p_i_ic, /* 831 */ - PARROT_OP_substr_s_p_ic_ic, /* 832 */ - PARROT_OP_replace_s_s_i_i_s, /* 833 */ - PARROT_OP_replace_s_sc_i_i_s, /* 834 */ - PARROT_OP_replace_s_s_ic_i_s, /* 835 */ - PARROT_OP_replace_s_sc_ic_i_s, /* 836 */ - PARROT_OP_replace_s_s_i_ic_s, /* 837 */ - PARROT_OP_replace_s_sc_i_ic_s, /* 838 */ - PARROT_OP_replace_s_s_ic_ic_s, /* 839 */ - PARROT_OP_replace_s_sc_ic_ic_s, /* 840 */ - PARROT_OP_replace_s_s_i_i_sc, /* 841 */ - PARROT_OP_replace_s_sc_i_i_sc, /* 842 */ - PARROT_OP_replace_s_s_ic_i_sc, /* 843 */ - PARROT_OP_replace_s_sc_ic_i_sc, /* 844 */ - PARROT_OP_replace_s_s_i_ic_sc, /* 845 */ - PARROT_OP_replace_s_sc_i_ic_sc, /* 846 */ - PARROT_OP_replace_s_s_ic_ic_sc, /* 847 */ - PARROT_OP_replace_s_sc_ic_ic_sc, /* 848 */ - PARROT_OP_index_i_s_s, /* 849 */ - PARROT_OP_index_i_sc_s, /* 850 */ - PARROT_OP_index_i_s_sc, /* 851 */ - PARROT_OP_index_i_sc_sc, /* 852 */ - PARROT_OP_index_i_s_s_i, /* 853 */ - PARROT_OP_index_i_sc_s_i, /* 854 */ - PARROT_OP_index_i_s_sc_i, /* 855 */ - PARROT_OP_index_i_sc_sc_i, /* 856 */ - PARROT_OP_index_i_s_s_ic, /* 857 */ - PARROT_OP_index_i_sc_s_ic, /* 858 */ - PARROT_OP_index_i_s_sc_ic, /* 859 */ - PARROT_OP_index_i_sc_sc_ic, /* 860 */ - PARROT_OP_sprintf_s_s_p, /* 861 */ - PARROT_OP_sprintf_s_sc_p, /* 862 */ - PARROT_OP_sprintf_p_p_p, /* 863 */ - PARROT_OP_new_s, /* 864 */ - PARROT_OP_new_s_i, /* 865 */ - PARROT_OP_new_s_ic, /* 866 */ - PARROT_OP_stringinfo_i_s_i, /* 867 */ - PARROT_OP_stringinfo_i_sc_i, /* 868 */ - PARROT_OP_stringinfo_i_s_ic, /* 869 */ - PARROT_OP_stringinfo_i_sc_ic, /* 870 */ - PARROT_OP_upcase_s_s, /* 871 */ - PARROT_OP_upcase_s_sc, /* 872 */ - PARROT_OP_downcase_s_s, /* 873 */ - PARROT_OP_downcase_s_sc, /* 874 */ - PARROT_OP_titlecase_s_s, /* 875 */ - PARROT_OP_titlecase_s_sc, /* 876 */ - PARROT_OP_join_s_s_p, /* 877 */ - PARROT_OP_join_s_sc_p, /* 878 */ - PARROT_OP_split_p_s_s, /* 879 */ - PARROT_OP_split_p_sc_s, /* 880 */ - PARROT_OP_split_p_s_sc, /* 881 */ - PARROT_OP_split_p_sc_sc, /* 882 */ - PARROT_OP_encoding_i_s, /* 883 */ - PARROT_OP_encoding_i_sc, /* 884 */ - PARROT_OP_encodingname_s_i, /* 885 */ - PARROT_OP_encodingname_s_ic, /* 886 */ - PARROT_OP_find_encoding_i_s, /* 887 */ - PARROT_OP_find_encoding_i_sc, /* 888 */ - PARROT_OP_trans_encoding_s_s_i, /* 889 */ - PARROT_OP_trans_encoding_s_sc_i, /* 890 */ - PARROT_OP_trans_encoding_s_s_ic, /* 891 */ - PARROT_OP_trans_encoding_s_sc_ic, /* 892 */ - PARROT_OP_is_cclass_i_i_s_i, /* 893 */ - PARROT_OP_is_cclass_i_ic_s_i, /* 894 */ - PARROT_OP_is_cclass_i_i_sc_i, /* 895 */ - PARROT_OP_is_cclass_i_ic_sc_i, /* 896 */ - PARROT_OP_is_cclass_i_i_s_ic, /* 897 */ - PARROT_OP_is_cclass_i_ic_s_ic, /* 898 */ - PARROT_OP_is_cclass_i_i_sc_ic, /* 899 */ - PARROT_OP_is_cclass_i_ic_sc_ic, /* 900 */ - PARROT_OP_find_cclass_i_i_s_i_i, /* 901 */ - PARROT_OP_find_cclass_i_ic_s_i_i, /* 902 */ - PARROT_OP_find_cclass_i_i_sc_i_i, /* 903 */ - PARROT_OP_find_cclass_i_ic_sc_i_i, /* 904 */ - PARROT_OP_find_cclass_i_i_s_ic_i, /* 905 */ - PARROT_OP_find_cclass_i_ic_s_ic_i, /* 906 */ - PARROT_OP_find_cclass_i_i_sc_ic_i, /* 907 */ - PARROT_OP_find_cclass_i_ic_sc_ic_i, /* 908 */ - PARROT_OP_find_cclass_i_i_s_i_ic, /* 909 */ - PARROT_OP_find_cclass_i_ic_s_i_ic, /* 910 */ - PARROT_OP_find_cclass_i_i_sc_i_ic, /* 911 */ - PARROT_OP_find_cclass_i_ic_sc_i_ic, /* 912 */ - PARROT_OP_find_cclass_i_i_s_ic_ic, /* 913 */ - PARROT_OP_find_cclass_i_ic_s_ic_ic, /* 914 */ - PARROT_OP_find_cclass_i_i_sc_ic_ic, /* 915 */ - PARROT_OP_find_cclass_i_ic_sc_ic_ic, /* 916 */ - PARROT_OP_find_not_cclass_i_i_s_i_i, /* 917 */ - PARROT_OP_find_not_cclass_i_ic_s_i_i, /* 918 */ - PARROT_OP_find_not_cclass_i_i_sc_i_i, /* 919 */ - PARROT_OP_find_not_cclass_i_ic_sc_i_i, /* 920 */ - PARROT_OP_find_not_cclass_i_i_s_ic_i, /* 921 */ - PARROT_OP_find_not_cclass_i_ic_s_ic_i, /* 922 */ - PARROT_OP_find_not_cclass_i_i_sc_ic_i, /* 923 */ - PARROT_OP_find_not_cclass_i_ic_sc_ic_i, /* 924 */ - PARROT_OP_find_not_cclass_i_i_s_i_ic, /* 925 */ - PARROT_OP_find_not_cclass_i_ic_s_i_ic, /* 926 */ - PARROT_OP_find_not_cclass_i_i_sc_i_ic, /* 927 */ - PARROT_OP_find_not_cclass_i_ic_sc_i_ic, /* 928 */ - PARROT_OP_find_not_cclass_i_i_s_ic_ic, /* 929 */ - PARROT_OP_find_not_cclass_i_ic_s_ic_ic, /* 930 */ - PARROT_OP_find_not_cclass_i_i_sc_ic_ic, /* 931 */ - PARROT_OP_find_not_cclass_i_ic_sc_ic_ic, /* 932 */ - PARROT_OP_escape_s_s, /* 933 */ - PARROT_OP_compose_s_s, /* 934 */ - PARROT_OP_compose_s_sc, /* 935 */ - PARROT_OP_find_codepoint_i_s, /* 936 */ - PARROT_OP_find_codepoint_i_sc, /* 937 */ - PARROT_OP_spawnw_i_s, /* 938 */ - PARROT_OP_spawnw_i_sc, /* 939 */ - PARROT_OP_spawnw_i_p, /* 940 */ - PARROT_OP_err_i, /* 941 */ - PARROT_OP_err_s, /* 942 */ - PARROT_OP_err_s_i, /* 943 */ - PARROT_OP_err_s_ic, /* 944 */ - PARROT_OP_time_i, /* 945 */ - PARROT_OP_time_n, /* 946 */ - PARROT_OP_sleep_i, /* 947 */ - PARROT_OP_sleep_ic, /* 948 */ - PARROT_OP_sleep_n, /* 949 */ - PARROT_OP_sleep_nc, /* 950 */ - PARROT_OP_store_lex_s_p, /* 951 */ - PARROT_OP_store_lex_sc_p, /* 952 */ - PARROT_OP_store_lex_s_s, /* 953 */ - PARROT_OP_store_lex_sc_s, /* 954 */ - PARROT_OP_store_lex_s_sc, /* 955 */ - PARROT_OP_store_lex_sc_sc, /* 956 */ - PARROT_OP_store_lex_s_i, /* 957 */ - PARROT_OP_store_lex_sc_i, /* 958 */ - PARROT_OP_store_lex_s_ic, /* 959 */ - PARROT_OP_store_lex_sc_ic, /* 960 */ - PARROT_OP_store_lex_s_n, /* 961 */ - PARROT_OP_store_lex_sc_n, /* 962 */ - PARROT_OP_store_lex_s_nc, /* 963 */ - PARROT_OP_store_lex_sc_nc, /* 964 */ - PARROT_OP_store_dynamic_lex_s_p, /* 965 */ - PARROT_OP_store_dynamic_lex_sc_p, /* 966 */ - PARROT_OP_find_lex_p_s, /* 967 */ - PARROT_OP_find_lex_p_sc, /* 968 */ - PARROT_OP_find_lex_s_s, /* 969 */ - PARROT_OP_find_lex_s_sc, /* 970 */ - PARROT_OP_find_lex_i_s, /* 971 */ - PARROT_OP_find_lex_i_sc, /* 972 */ - PARROT_OP_find_lex_n_s, /* 973 */ - PARROT_OP_find_lex_n_sc, /* 974 */ - PARROT_OP_find_dynamic_lex_p_s, /* 975 */ - PARROT_OP_find_dynamic_lex_p_sc, /* 976 */ - PARROT_OP_find_caller_lex_p_s, /* 977 */ - PARROT_OP_find_caller_lex_p_sc, /* 978 */ - PARROT_OP_get_namespace_p, /* 979 */ - PARROT_OP_get_namespace_p_p, /* 980 */ - PARROT_OP_get_namespace_p_pc, /* 981 */ - PARROT_OP_get_hll_namespace_p, /* 982 */ - PARROT_OP_get_hll_namespace_p_p, /* 983 */ - PARROT_OP_get_hll_namespace_p_pc, /* 984 */ - PARROT_OP_get_root_namespace_p, /* 985 */ - PARROT_OP_get_root_namespace_p_p, /* 986 */ - PARROT_OP_get_root_namespace_p_pc, /* 987 */ - PARROT_OP_get_global_p_s, /* 988 */ - PARROT_OP_get_global_p_sc, /* 989 */ - PARROT_OP_get_global_p_p_s, /* 990 */ - PARROT_OP_get_global_p_pc_s, /* 991 */ - PARROT_OP_get_global_p_p_sc, /* 992 */ - PARROT_OP_get_global_p_pc_sc, /* 993 */ - PARROT_OP_get_hll_global_p_s, /* 994 */ - PARROT_OP_get_hll_global_p_sc, /* 995 */ - PARROT_OP_get_hll_global_p_p_s, /* 996 */ - PARROT_OP_get_hll_global_p_pc_s, /* 997 */ - PARROT_OP_get_hll_global_p_p_sc, /* 998 */ - PARROT_OP_get_hll_global_p_pc_sc, /* 999 */ - PARROT_OP_get_root_global_p_s, /* 1000 */ - PARROT_OP_get_root_global_p_sc, /* 1001 */ - PARROT_OP_get_root_global_p_p_s, /* 1002 */ - PARROT_OP_get_root_global_p_pc_s, /* 1003 */ - PARROT_OP_get_root_global_p_p_sc, /* 1004 */ - PARROT_OP_get_root_global_p_pc_sc, /* 1005 */ - PARROT_OP_set_global_s_p, /* 1006 */ - PARROT_OP_set_global_sc_p, /* 1007 */ - PARROT_OP_set_global_p_s_p, /* 1008 */ - PARROT_OP_set_global_pc_s_p, /* 1009 */ - PARROT_OP_set_global_p_sc_p, /* 1010 */ - PARROT_OP_set_global_pc_sc_p, /* 1011 */ - PARROT_OP_set_hll_global_s_p, /* 1012 */ - PARROT_OP_set_hll_global_sc_p, /* 1013 */ - PARROT_OP_set_hll_global_p_s_p, /* 1014 */ - PARROT_OP_set_hll_global_pc_s_p, /* 1015 */ - PARROT_OP_set_hll_global_p_sc_p, /* 1016 */ - PARROT_OP_set_hll_global_pc_sc_p, /* 1017 */ - PARROT_OP_set_root_global_s_p, /* 1018 */ - PARROT_OP_set_root_global_sc_p, /* 1019 */ - PARROT_OP_set_root_global_p_s_p, /* 1020 */ - PARROT_OP_set_root_global_pc_s_p, /* 1021 */ - PARROT_OP_set_root_global_p_sc_p, /* 1022 */ - PARROT_OP_set_root_global_pc_sc_p, /* 1023 */ - PARROT_OP_find_name_p_s, /* 1024 */ - PARROT_OP_find_name_p_sc, /* 1025 */ - PARROT_OP_find_sub_not_null_p_s, /* 1026 */ - PARROT_OP_find_sub_not_null_p_sc, /* 1027 */ - PARROT_OP_trap, /* 1028 */ - PARROT_OP_set_label_p_ic, /* 1029 */ - PARROT_OP_get_label_i_p, /* 1030 */ - PARROT_OP_fetch_p_p_p_p, /* 1031 */ - PARROT_OP_fetch_p_pc_p_p, /* 1032 */ - PARROT_OP_fetch_p_p_pc_p, /* 1033 */ - PARROT_OP_fetch_p_pc_pc_p, /* 1034 */ - PARROT_OP_fetch_p_p_p_pc, /* 1035 */ - PARROT_OP_fetch_p_pc_p_pc, /* 1036 */ - PARROT_OP_fetch_p_p_pc_pc, /* 1037 */ - PARROT_OP_fetch_p_pc_pc_pc, /* 1038 */ - PARROT_OP_fetch_p_p_i_p, /* 1039 */ - PARROT_OP_fetch_p_pc_i_p, /* 1040 */ - PARROT_OP_fetch_p_p_ic_p, /* 1041 */ - PARROT_OP_fetch_p_pc_ic_p, /* 1042 */ - PARROT_OP_fetch_p_p_i_pc, /* 1043 */ - PARROT_OP_fetch_p_pc_i_pc, /* 1044 */ - PARROT_OP_fetch_p_p_ic_pc, /* 1045 */ - PARROT_OP_fetch_p_pc_ic_pc, /* 1046 */ - PARROT_OP_fetch_p_p_s_p, /* 1047 */ - PARROT_OP_fetch_p_pc_s_p, /* 1048 */ - PARROT_OP_fetch_p_p_sc_p, /* 1049 */ - PARROT_OP_fetch_p_pc_sc_p, /* 1050 */ - PARROT_OP_fetch_p_p_s_pc, /* 1051 */ - PARROT_OP_fetch_p_pc_s_pc, /* 1052 */ - PARROT_OP_fetch_p_p_sc_pc, /* 1053 */ - PARROT_OP_fetch_p_pc_sc_pc, /* 1054 */ - PARROT_OP_vivify_p_p_p_p, /* 1055 */ - PARROT_OP_vivify_p_pc_p_p, /* 1056 */ - PARROT_OP_vivify_p_p_pc_p, /* 1057 */ - PARROT_OP_vivify_p_pc_pc_p, /* 1058 */ - PARROT_OP_vivify_p_p_p_pc, /* 1059 */ - PARROT_OP_vivify_p_pc_p_pc, /* 1060 */ - PARROT_OP_vivify_p_p_pc_pc, /* 1061 */ - PARROT_OP_vivify_p_pc_pc_pc, /* 1062 */ - PARROT_OP_vivify_p_p_i_p, /* 1063 */ - PARROT_OP_vivify_p_pc_i_p, /* 1064 */ - PARROT_OP_vivify_p_p_ic_p, /* 1065 */ - PARROT_OP_vivify_p_pc_ic_p, /* 1066 */ - PARROT_OP_vivify_p_p_i_pc, /* 1067 */ - PARROT_OP_vivify_p_pc_i_pc, /* 1068 */ - PARROT_OP_vivify_p_p_ic_pc, /* 1069 */ - PARROT_OP_vivify_p_pc_ic_pc, /* 1070 */ - PARROT_OP_vivify_p_p_s_p, /* 1071 */ - PARROT_OP_vivify_p_pc_s_p, /* 1072 */ - PARROT_OP_vivify_p_p_sc_p, /* 1073 */ - PARROT_OP_vivify_p_pc_sc_p, /* 1074 */ - PARROT_OP_vivify_p_p_s_pc, /* 1075 */ - PARROT_OP_vivify_p_pc_s_pc, /* 1076 */ - PARROT_OP_vivify_p_p_sc_pc, /* 1077 */ - PARROT_OP_vivify_p_pc_sc_pc, /* 1078 */ - PARROT_OP_new_p_s_i, /* 1079 */ - PARROT_OP_new_p_sc_i, /* 1080 */ - PARROT_OP_new_p_s_ic, /* 1081 */ - PARROT_OP_new_p_sc_ic, /* 1082 */ - PARROT_OP_new_p_p_i, /* 1083 */ - PARROT_OP_new_p_pc_i, /* 1084 */ - PARROT_OP_new_p_p_ic, /* 1085 */ - PARROT_OP_new_p_pc_ic, /* 1086 */ - PARROT_OP_root_new_p_p_i, /* 1087 */ - PARROT_OP_root_new_p_pc_i, /* 1088 */ - PARROT_OP_root_new_p_p_ic, /* 1089 */ - PARROT_OP_root_new_p_pc_ic /* 1090 */ + PARROT_OP_pop_upto_eh_p, /* 64 */ + PARROT_OP_pop_upto_eh_pc, /* 65 */ + PARROT_OP_peek_exception_p, /* 66 */ + PARROT_OP_debug_i, /* 67 */ + PARROT_OP_debug_ic, /* 68 */ + PARROT_OP_bounds_i, /* 69 */ + PARROT_OP_bounds_ic, /* 70 */ + PARROT_OP_profile_i, /* 71 */ + PARROT_OP_profile_ic, /* 72 */ + PARROT_OP_trace_i, /* 73 */ + PARROT_OP_trace_ic, /* 74 */ + PARROT_OP_gc_debug_i, /* 75 */ + PARROT_OP_gc_debug_ic, /* 76 */ + PARROT_OP_interpinfo_i_i, /* 77 */ + PARROT_OP_interpinfo_i_ic, /* 78 */ + PARROT_OP_interpinfo_p_i, /* 79 */ + PARROT_OP_interpinfo_p_ic, /* 80 */ + PARROT_OP_interpinfo_s_i, /* 81 */ + PARROT_OP_interpinfo_s_ic, /* 82 */ + PARROT_OP_warningson_i, /* 83 */ + PARROT_OP_warningson_ic, /* 84 */ + PARROT_OP_warningsoff_i, /* 85 */ + PARROT_OP_warningsoff_ic, /* 86 */ + PARROT_OP_errorson_i, /* 87 */ + PARROT_OP_errorson_ic, /* 88 */ + PARROT_OP_errorsoff_i, /* 89 */ + PARROT_OP_errorsoff_ic, /* 90 */ + PARROT_OP_set_runcore_s, /* 91 */ + PARROT_OP_set_runcore_sc, /* 92 */ + PARROT_OP_runinterp_p_i, /* 93 */ + PARROT_OP_runinterp_p_ic, /* 94 */ + PARROT_OP_getinterp_p, /* 95 */ + PARROT_OP_sweep_ic, /* 96 */ + PARROT_OP_collect, /* 97 */ + PARROT_OP_sweepoff, /* 98 */ + PARROT_OP_sweepon, /* 99 */ + PARROT_OP_collectoff, /* 100 */ + PARROT_OP_collecton, /* 101 */ + PARROT_OP_needs_destroy_p, /* 102 */ + PARROT_OP_loadlib_p_s, /* 103 */ + PARROT_OP_loadlib_p_sc, /* 104 */ + PARROT_OP_loadlib_p_s_p, /* 105 */ + PARROT_OP_loadlib_p_sc_p, /* 106 */ + PARROT_OP_loadlib_p_s_pc, /* 107 */ + PARROT_OP_loadlib_p_sc_pc, /* 108 */ + PARROT_OP_dlfunc_p_p_s_s, /* 109 */ + PARROT_OP_dlfunc_p_p_sc_s, /* 110 */ + PARROT_OP_dlfunc_p_p_s_sc, /* 111 */ + PARROT_OP_dlfunc_p_p_sc_sc, /* 112 */ + PARROT_OP_dlfunc_p_p_s_p, /* 113 */ + PARROT_OP_dlfunc_p_p_sc_p, /* 114 */ + PARROT_OP_dlvar_p_p_s, /* 115 */ + PARROT_OP_dlvar_p_p_sc, /* 116 */ + PARROT_OP_compreg_s_p, /* 117 */ + PARROT_OP_compreg_sc_p, /* 118 */ + PARROT_OP_compreg_p_s, /* 119 */ + PARROT_OP_compreg_p_sc, /* 120 */ + PARROT_OP_new_callback_p_p_p_s, /* 121 */ + PARROT_OP_new_callback_p_p_p_sc, /* 122 */ + PARROT_OP_annotations_p, /* 123 */ + PARROT_OP_annotations_p_s, /* 124 */ + PARROT_OP_annotations_p_sc, /* 125 */ + PARROT_OP_band_i_i, /* 126 */ + PARROT_OP_band_i_ic, /* 127 */ + PARROT_OP_band_i_i_i, /* 128 */ + PARROT_OP_band_i_ic_i, /* 129 */ + PARROT_OP_band_i_i_ic, /* 130 */ + PARROT_OP_bor_i_i, /* 131 */ + PARROT_OP_bor_i_ic, /* 132 */ + PARROT_OP_bor_i_i_i, /* 133 */ + PARROT_OP_bor_i_ic_i, /* 134 */ + PARROT_OP_bor_i_i_ic, /* 135 */ + PARROT_OP_shl_i_i, /* 136 */ + PARROT_OP_shl_i_ic, /* 137 */ + PARROT_OP_shl_i_i_i, /* 138 */ + PARROT_OP_shl_i_ic_i, /* 139 */ + PARROT_OP_shl_i_i_ic, /* 140 */ + PARROT_OP_shr_i_i, /* 141 */ + PARROT_OP_shr_i_ic, /* 142 */ + PARROT_OP_shr_i_i_i, /* 143 */ + PARROT_OP_shr_i_ic_i, /* 144 */ + PARROT_OP_shr_i_i_ic, /* 145 */ + PARROT_OP_lsr_i_i, /* 146 */ + PARROT_OP_lsr_i_ic, /* 147 */ + PARROT_OP_lsr_i_i_i, /* 148 */ + PARROT_OP_lsr_i_ic_i, /* 149 */ + PARROT_OP_lsr_i_i_ic, /* 150 */ + PARROT_OP_bxor_i_i, /* 151 */ + PARROT_OP_bxor_i_ic, /* 152 */ + PARROT_OP_bxor_i_i_i, /* 153 */ + PARROT_OP_bxor_i_ic_i, /* 154 */ + PARROT_OP_bxor_i_i_ic, /* 155 */ + PARROT_OP_eq_i_i_ic, /* 156 */ + PARROT_OP_eq_ic_i_ic, /* 157 */ + PARROT_OP_eq_i_ic_ic, /* 158 */ + PARROT_OP_eq_n_n_ic, /* 159 */ + PARROT_OP_eq_nc_n_ic, /* 160 */ + PARROT_OP_eq_n_nc_ic, /* 161 */ + PARROT_OP_eq_s_s_ic, /* 162 */ + PARROT_OP_eq_sc_s_ic, /* 163 */ + PARROT_OP_eq_s_sc_ic, /* 164 */ + PARROT_OP_eq_p_p_ic, /* 165 */ + PARROT_OP_eq_p_i_ic, /* 166 */ + PARROT_OP_eq_p_ic_ic, /* 167 */ + PARROT_OP_eq_p_n_ic, /* 168 */ + PARROT_OP_eq_p_nc_ic, /* 169 */ + PARROT_OP_eq_p_s_ic, /* 170 */ + PARROT_OP_eq_p_sc_ic, /* 171 */ + PARROT_OP_eq_str_p_p_ic, /* 172 */ + PARROT_OP_eq_num_p_p_ic, /* 173 */ + PARROT_OP_eq_addr_s_s_ic, /* 174 */ + PARROT_OP_eq_addr_sc_s_ic, /* 175 */ + PARROT_OP_eq_addr_s_sc_ic, /* 176 */ + PARROT_OP_eq_addr_sc_sc_ic, /* 177 */ + PARROT_OP_eq_addr_p_p_ic, /* 178 */ + PARROT_OP_ne_i_i_ic, /* 179 */ + PARROT_OP_ne_ic_i_ic, /* 180 */ + PARROT_OP_ne_i_ic_ic, /* 181 */ + PARROT_OP_ne_n_n_ic, /* 182 */ + PARROT_OP_ne_nc_n_ic, /* 183 */ + PARROT_OP_ne_n_nc_ic, /* 184 */ + PARROT_OP_ne_s_s_ic, /* 185 */ + PARROT_OP_ne_sc_s_ic, /* 186 */ + PARROT_OP_ne_s_sc_ic, /* 187 */ + PARROT_OP_ne_p_p_ic, /* 188 */ + PARROT_OP_ne_p_i_ic, /* 189 */ + PARROT_OP_ne_p_ic_ic, /* 190 */ + PARROT_OP_ne_p_n_ic, /* 191 */ + PARROT_OP_ne_p_nc_ic, /* 192 */ + PARROT_OP_ne_p_s_ic, /* 193 */ + PARROT_OP_ne_p_sc_ic, /* 194 */ + PARROT_OP_ne_str_p_p_ic, /* 195 */ + PARROT_OP_ne_num_p_p_ic, /* 196 */ + PARROT_OP_ne_addr_s_s_ic, /* 197 */ + PARROT_OP_ne_addr_sc_s_ic, /* 198 */ + PARROT_OP_ne_addr_s_sc_ic, /* 199 */ + PARROT_OP_ne_addr_sc_sc_ic, /* 200 */ + PARROT_OP_ne_addr_p_p_ic, /* 201 */ + PARROT_OP_lt_i_i_ic, /* 202 */ + PARROT_OP_lt_ic_i_ic, /* 203 */ + PARROT_OP_lt_i_ic_ic, /* 204 */ + PARROT_OP_lt_n_n_ic, /* 205 */ + PARROT_OP_lt_nc_n_ic, /* 206 */ + PARROT_OP_lt_n_nc_ic, /* 207 */ + PARROT_OP_lt_s_s_ic, /* 208 */ + PARROT_OP_lt_sc_s_ic, /* 209 */ + PARROT_OP_lt_s_sc_ic, /* 210 */ + PARROT_OP_lt_p_p_ic, /* 211 */ + PARROT_OP_lt_p_i_ic, /* 212 */ + PARROT_OP_lt_p_ic_ic, /* 213 */ + PARROT_OP_lt_p_n_ic, /* 214 */ + PARROT_OP_lt_p_nc_ic, /* 215 */ + PARROT_OP_lt_p_s_ic, /* 216 */ + PARROT_OP_lt_p_sc_ic, /* 217 */ + PARROT_OP_lt_str_p_p_ic, /* 218 */ + PARROT_OP_lt_num_p_p_ic, /* 219 */ + PARROT_OP_le_i_i_ic, /* 220 */ + PARROT_OP_le_ic_i_ic, /* 221 */ + PARROT_OP_le_i_ic_ic, /* 222 */ + PARROT_OP_le_n_n_ic, /* 223 */ + PARROT_OP_le_nc_n_ic, /* 224 */ + PARROT_OP_le_n_nc_ic, /* 225 */ + PARROT_OP_le_s_s_ic, /* 226 */ + PARROT_OP_le_sc_s_ic, /* 227 */ + PARROT_OP_le_s_sc_ic, /* 228 */ + PARROT_OP_le_p_p_ic, /* 229 */ + PARROT_OP_le_p_i_ic, /* 230 */ + PARROT_OP_le_p_ic_ic, /* 231 */ + PARROT_OP_le_p_n_ic, /* 232 */ + PARROT_OP_le_p_nc_ic, /* 233 */ + PARROT_OP_le_p_s_ic, /* 234 */ + PARROT_OP_le_p_sc_ic, /* 235 */ + PARROT_OP_le_str_p_p_ic, /* 236 */ + PARROT_OP_le_num_p_p_ic, /* 237 */ + PARROT_OP_gt_p_p_ic, /* 238 */ + PARROT_OP_gt_p_i_ic, /* 239 */ + PARROT_OP_gt_p_ic_ic, /* 240 */ + PARROT_OP_gt_p_n_ic, /* 241 */ + PARROT_OP_gt_p_nc_ic, /* 242 */ + PARROT_OP_gt_p_s_ic, /* 243 */ + PARROT_OP_gt_p_sc_ic, /* 244 */ + PARROT_OP_gt_str_p_p_ic, /* 245 */ + PARROT_OP_gt_num_p_p_ic, /* 246 */ + PARROT_OP_ge_p_p_ic, /* 247 */ + PARROT_OP_ge_p_i_ic, /* 248 */ + PARROT_OP_ge_p_ic_ic, /* 249 */ + PARROT_OP_ge_p_n_ic, /* 250 */ + PARROT_OP_ge_p_nc_ic, /* 251 */ + PARROT_OP_ge_p_s_ic, /* 252 */ + PARROT_OP_ge_p_sc_ic, /* 253 */ + PARROT_OP_ge_str_p_p_ic, /* 254 */ + PARROT_OP_ge_num_p_p_ic, /* 255 */ + PARROT_OP_if_null_p_ic, /* 256 */ + PARROT_OP_if_null_s_ic, /* 257 */ + PARROT_OP_unless_null_p_ic, /* 258 */ + PARROT_OP_unless_null_s_ic, /* 259 */ + PARROT_OP_cmp_i_i_i, /* 260 */ + PARROT_OP_cmp_i_ic_i, /* 261 */ + PARROT_OP_cmp_i_i_ic, /* 262 */ + PARROT_OP_cmp_i_n_n, /* 263 */ + PARROT_OP_cmp_i_nc_n, /* 264 */ + PARROT_OP_cmp_i_n_nc, /* 265 */ + PARROT_OP_cmp_i_s_s, /* 266 */ + PARROT_OP_cmp_i_sc_s, /* 267 */ + PARROT_OP_cmp_i_s_sc, /* 268 */ + PARROT_OP_cmp_i_p_p, /* 269 */ + PARROT_OP_cmp_i_p_i, /* 270 */ + PARROT_OP_cmp_i_p_ic, /* 271 */ + PARROT_OP_cmp_i_p_n, /* 272 */ + PARROT_OP_cmp_i_p_nc, /* 273 */ + PARROT_OP_cmp_i_p_s, /* 274 */ + PARROT_OP_cmp_i_p_sc, /* 275 */ + PARROT_OP_cmp_str_i_p_p, /* 276 */ + PARROT_OP_cmp_num_i_p_p, /* 277 */ + PARROT_OP_cmp_pmc_p_p_p, /* 278 */ + PARROT_OP_issame_i_p_p, /* 279 */ + PARROT_OP_issame_i_s_s, /* 280 */ + PARROT_OP_issame_i_sc_s, /* 281 */ + PARROT_OP_issame_i_s_sc, /* 282 */ + PARROT_OP_issame_i_sc_sc, /* 283 */ + PARROT_OP_isntsame_i_p_p, /* 284 */ + PARROT_OP_isntsame_i_s_s, /* 285 */ + PARROT_OP_isntsame_i_sc_s, /* 286 */ + PARROT_OP_isntsame_i_s_sc, /* 287 */ + PARROT_OP_isntsame_i_sc_sc, /* 288 */ + PARROT_OP_istrue_i_p, /* 289 */ + PARROT_OP_isfalse_i_p, /* 290 */ + PARROT_OP_isnull_i_p, /* 291 */ + PARROT_OP_isnull_i_pc, /* 292 */ + PARROT_OP_isnull_i_s, /* 293 */ + PARROT_OP_isnull_i_sc, /* 294 */ + PARROT_OP_isgt_i_p_p, /* 295 */ + PARROT_OP_isge_i_p_p, /* 296 */ + PARROT_OP_isle_i_i_i, /* 297 */ + PARROT_OP_isle_i_ic_i, /* 298 */ + PARROT_OP_isle_i_i_ic, /* 299 */ + PARROT_OP_isle_i_n_n, /* 300 */ + PARROT_OP_isle_i_nc_n, /* 301 */ + PARROT_OP_isle_i_n_nc, /* 302 */ + PARROT_OP_isle_i_s_s, /* 303 */ + PARROT_OP_isle_i_sc_s, /* 304 */ + PARROT_OP_isle_i_s_sc, /* 305 */ + PARROT_OP_isle_i_p_p, /* 306 */ + PARROT_OP_islt_i_i_i, /* 307 */ + PARROT_OP_islt_i_ic_i, /* 308 */ + PARROT_OP_islt_i_i_ic, /* 309 */ + PARROT_OP_islt_i_n_n, /* 310 */ + PARROT_OP_islt_i_nc_n, /* 311 */ + PARROT_OP_islt_i_n_nc, /* 312 */ + PARROT_OP_islt_i_s_s, /* 313 */ + PARROT_OP_islt_i_sc_s, /* 314 */ + PARROT_OP_islt_i_s_sc, /* 315 */ + PARROT_OP_islt_i_p_p, /* 316 */ + PARROT_OP_iseq_i_i_i, /* 317 */ + PARROT_OP_iseq_i_ic_i, /* 318 */ + PARROT_OP_iseq_i_i_ic, /* 319 */ + PARROT_OP_iseq_i_n_n, /* 320 */ + PARROT_OP_iseq_i_nc_n, /* 321 */ + PARROT_OP_iseq_i_n_nc, /* 322 */ + PARROT_OP_iseq_i_s_s, /* 323 */ + PARROT_OP_iseq_i_sc_s, /* 324 */ + PARROT_OP_iseq_i_s_sc, /* 325 */ + PARROT_OP_iseq_i_p_p, /* 326 */ + PARROT_OP_isne_i_i_i, /* 327 */ + PARROT_OP_isne_i_ic_i, /* 328 */ + PARROT_OP_isne_i_i_ic, /* 329 */ + PARROT_OP_isne_i_n_n, /* 330 */ + PARROT_OP_isne_i_nc_n, /* 331 */ + PARROT_OP_isne_i_n_nc, /* 332 */ + PARROT_OP_isne_i_s_s, /* 333 */ + PARROT_OP_isne_i_sc_s, /* 334 */ + PARROT_OP_isne_i_s_sc, /* 335 */ + PARROT_OP_isne_i_p_p, /* 336 */ + PARROT_OP_and_i_i_i, /* 337 */ + PARROT_OP_and_i_ic_i, /* 338 */ + PARROT_OP_and_i_i_ic, /* 339 */ + PARROT_OP_and_p_p_p, /* 340 */ + PARROT_OP_not_i, /* 341 */ + PARROT_OP_not_i_i, /* 342 */ + PARROT_OP_not_p, /* 343 */ + PARROT_OP_not_p_p, /* 344 */ + PARROT_OP_or_i_i_i, /* 345 */ + PARROT_OP_or_i_ic_i, /* 346 */ + PARROT_OP_or_i_i_ic, /* 347 */ + PARROT_OP_or_p_p_p, /* 348 */ + PARROT_OP_xor_i_i_i, /* 349 */ + PARROT_OP_xor_i_ic_i, /* 350 */ + PARROT_OP_xor_i_i_ic, /* 351 */ + PARROT_OP_xor_p_p_p, /* 352 */ + PARROT_OP_print_i, /* 353 */ + PARROT_OP_print_ic, /* 354 */ + PARROT_OP_print_n, /* 355 */ + PARROT_OP_print_nc, /* 356 */ + PARROT_OP_print_s, /* 357 */ + PARROT_OP_print_sc, /* 358 */ + PARROT_OP_print_p, /* 359 */ + PARROT_OP_say_i, /* 360 */ + PARROT_OP_say_ic, /* 361 */ + PARROT_OP_say_n, /* 362 */ + PARROT_OP_say_nc, /* 363 */ + PARROT_OP_say_s, /* 364 */ + PARROT_OP_say_sc, /* 365 */ + PARROT_OP_say_p, /* 366 */ + PARROT_OP_print_p_i, /* 367 */ + PARROT_OP_print_p_ic, /* 368 */ + PARROT_OP_print_p_n, /* 369 */ + PARROT_OP_print_p_nc, /* 370 */ + PARROT_OP_print_p_s, /* 371 */ + PARROT_OP_print_p_sc, /* 372 */ + PARROT_OP_print_p_p, /* 373 */ + PARROT_OP_getstdin_p, /* 374 */ + PARROT_OP_getstdout_p, /* 375 */ + PARROT_OP_getstderr_p, /* 376 */ + PARROT_OP_abs_i, /* 377 */ + PARROT_OP_abs_n, /* 378 */ + PARROT_OP_abs_i_i, /* 379 */ + PARROT_OP_abs_n_n, /* 380 */ + PARROT_OP_abs_p, /* 381 */ + PARROT_OP_abs_p_p, /* 382 */ + PARROT_OP_add_i_i, /* 383 */ + PARROT_OP_add_i_ic, /* 384 */ + PARROT_OP_add_n_n, /* 385 */ + PARROT_OP_add_n_nc, /* 386 */ + PARROT_OP_add_p_p, /* 387 */ + PARROT_OP_add_p_i, /* 388 */ + PARROT_OP_add_p_ic, /* 389 */ + PARROT_OP_add_p_n, /* 390 */ + PARROT_OP_add_p_nc, /* 391 */ + PARROT_OP_add_i_i_i, /* 392 */ + PARROT_OP_add_i_ic_i, /* 393 */ + PARROT_OP_add_i_i_ic, /* 394 */ + PARROT_OP_add_n_n_n, /* 395 */ + PARROT_OP_add_n_nc_n, /* 396 */ + PARROT_OP_add_n_n_nc, /* 397 */ + PARROT_OP_add_p_p_p, /* 398 */ + PARROT_OP_add_p_p_i, /* 399 */ + PARROT_OP_add_p_p_ic, /* 400 */ + PARROT_OP_add_p_p_n, /* 401 */ + PARROT_OP_add_p_p_nc, /* 402 */ + PARROT_OP_dec_i, /* 403 */ + PARROT_OP_dec_n, /* 404 */ + PARROT_OP_dec_p, /* 405 */ + PARROT_OP_div_i_i, /* 406 */ + PARROT_OP_div_i_ic, /* 407 */ + PARROT_OP_div_n_n, /* 408 */ + PARROT_OP_div_n_nc, /* 409 */ + PARROT_OP_div_p_p, /* 410 */ + PARROT_OP_div_p_i, /* 411 */ + PARROT_OP_div_p_ic, /* 412 */ + PARROT_OP_div_p_n, /* 413 */ + PARROT_OP_div_p_nc, /* 414 */ + PARROT_OP_div_i_i_i, /* 415 */ + PARROT_OP_div_i_ic_i, /* 416 */ + PARROT_OP_div_i_i_ic, /* 417 */ + PARROT_OP_div_i_ic_ic, /* 418 */ + PARROT_OP_div_n_n_n, /* 419 */ + PARROT_OP_div_n_nc_n, /* 420 */ + PARROT_OP_div_n_n_nc, /* 421 */ + PARROT_OP_div_n_nc_nc, /* 422 */ + PARROT_OP_div_p_p_p, /* 423 */ + PARROT_OP_div_p_p_i, /* 424 */ + PARROT_OP_div_p_p_ic, /* 425 */ + PARROT_OP_div_p_p_n, /* 426 */ + PARROT_OP_div_p_p_nc, /* 427 */ + PARROT_OP_fdiv_i_i, /* 428 */ + PARROT_OP_fdiv_i_ic, /* 429 */ + PARROT_OP_fdiv_n_n, /* 430 */ + PARROT_OP_fdiv_n_nc, /* 431 */ + PARROT_OP_fdiv_p_p, /* 432 */ + PARROT_OP_fdiv_p_i, /* 433 */ + PARROT_OP_fdiv_p_ic, /* 434 */ + PARROT_OP_fdiv_p_n, /* 435 */ + PARROT_OP_fdiv_p_nc, /* 436 */ + PARROT_OP_fdiv_i_i_i, /* 437 */ + PARROT_OP_fdiv_i_ic_i, /* 438 */ + PARROT_OP_fdiv_i_i_ic, /* 439 */ + PARROT_OP_fdiv_n_n_n, /* 440 */ + PARROT_OP_fdiv_n_nc_n, /* 441 */ + PARROT_OP_fdiv_n_n_nc, /* 442 */ + PARROT_OP_fdiv_p_p_p, /* 443 */ + PARROT_OP_fdiv_p_p_i, /* 444 */ + PARROT_OP_fdiv_p_p_ic, /* 445 */ + PARROT_OP_fdiv_p_p_n, /* 446 */ + PARROT_OP_fdiv_p_p_nc, /* 447 */ + PARROT_OP_ceil_n, /* 448 */ + PARROT_OP_ceil_i_n, /* 449 */ + PARROT_OP_ceil_n_n, /* 450 */ + PARROT_OP_floor_n, /* 451 */ + PARROT_OP_floor_i_n, /* 452 */ + PARROT_OP_floor_n_n, /* 453 */ + PARROT_OP_inc_i, /* 454 */ + PARROT_OP_inc_n, /* 455 */ + PARROT_OP_inc_p, /* 456 */ + PARROT_OP_mod_i_i, /* 457 */ + PARROT_OP_mod_i_ic, /* 458 */ + PARROT_OP_mod_n_n, /* 459 */ + PARROT_OP_mod_n_nc, /* 460 */ + PARROT_OP_mod_p_p, /* 461 */ + PARROT_OP_mod_p_i, /* 462 */ + PARROT_OP_mod_p_ic, /* 463 */ + PARROT_OP_mod_p_n, /* 464 */ + PARROT_OP_mod_p_nc, /* 465 */ + PARROT_OP_mod_i_i_i, /* 466 */ + PARROT_OP_mod_i_ic_i, /* 467 */ + PARROT_OP_mod_i_i_ic, /* 468 */ + PARROT_OP_mod_n_n_n, /* 469 */ + PARROT_OP_mod_n_nc_n, /* 470 */ + PARROT_OP_mod_n_n_nc, /* 471 */ + PARROT_OP_mod_p_p_p, /* 472 */ + PARROT_OP_mod_p_p_i, /* 473 */ + PARROT_OP_mod_p_p_ic, /* 474 */ + PARROT_OP_mod_p_p_n, /* 475 */ + PARROT_OP_mod_p_p_nc, /* 476 */ + PARROT_OP_mul_i_i, /* 477 */ + PARROT_OP_mul_i_ic, /* 478 */ + PARROT_OP_mul_n_n, /* 479 */ + PARROT_OP_mul_n_nc, /* 480 */ + PARROT_OP_mul_p_p, /* 481 */ + PARROT_OP_mul_p_i, /* 482 */ + PARROT_OP_mul_p_ic, /* 483 */ + PARROT_OP_mul_p_n, /* 484 */ + PARROT_OP_mul_p_nc, /* 485 */ + PARROT_OP_mul_i_i_i, /* 486 */ + PARROT_OP_mul_i_ic_i, /* 487 */ + PARROT_OP_mul_i_i_ic, /* 488 */ + PARROT_OP_mul_n_n_n, /* 489 */ + PARROT_OP_mul_n_nc_n, /* 490 */ + PARROT_OP_mul_n_n_nc, /* 491 */ + PARROT_OP_mul_p_p_p, /* 492 */ + PARROT_OP_mul_p_p_i, /* 493 */ + PARROT_OP_mul_p_p_ic, /* 494 */ + PARROT_OP_mul_p_p_n, /* 495 */ + PARROT_OP_mul_p_p_nc, /* 496 */ + PARROT_OP_neg_i, /* 497 */ + PARROT_OP_neg_n, /* 498 */ + PARROT_OP_neg_p, /* 499 */ + PARROT_OP_neg_i_i, /* 500 */ + PARROT_OP_neg_n_n, /* 501 */ + PARROT_OP_neg_p_p, /* 502 */ + PARROT_OP_sub_i_i, /* 503 */ + PARROT_OP_sub_i_ic, /* 504 */ + PARROT_OP_sub_n_n, /* 505 */ + PARROT_OP_sub_n_nc, /* 506 */ + PARROT_OP_sub_p_p, /* 507 */ + PARROT_OP_sub_p_i, /* 508 */ + PARROT_OP_sub_p_ic, /* 509 */ + PARROT_OP_sub_p_n, /* 510 */ + PARROT_OP_sub_p_nc, /* 511 */ + PARROT_OP_sub_i_i_i, /* 512 */ + PARROT_OP_sub_i_ic_i, /* 513 */ + PARROT_OP_sub_i_i_ic, /* 514 */ + PARROT_OP_sub_n_n_n, /* 515 */ + PARROT_OP_sub_n_nc_n, /* 516 */ + PARROT_OP_sub_n_n_nc, /* 517 */ + PARROT_OP_sub_p_p_p, /* 518 */ + PARROT_OP_sub_p_p_i, /* 519 */ + PARROT_OP_sub_p_p_ic, /* 520 */ + PARROT_OP_sub_p_p_n, /* 521 */ + PARROT_OP_sub_p_p_nc, /* 522 */ + PARROT_OP_sqrt_n_n, /* 523 */ + PARROT_OP_is_inf_or_nan_i_n, /* 524 */ + PARROT_OP_is_inf_or_nan_i_nc, /* 525 */ + PARROT_OP_callmethodcc_p_s, /* 526 */ + PARROT_OP_callmethodcc_p_sc, /* 527 */ + PARROT_OP_callmethodcc_p_p, /* 528 */ + PARROT_OP_callmethod_p_s_p, /* 529 */ + PARROT_OP_callmethod_p_sc_p, /* 530 */ + PARROT_OP_callmethod_p_p_p, /* 531 */ + PARROT_OP_tailcallmethod_p_s, /* 532 */ + PARROT_OP_tailcallmethod_p_sc, /* 533 */ + PARROT_OP_tailcallmethod_p_p, /* 534 */ + PARROT_OP_addmethod_p_s_p, /* 535 */ + PARROT_OP_addmethod_p_sc_p, /* 536 */ + PARROT_OP_can_i_p_s, /* 537 */ + PARROT_OP_can_i_p_sc, /* 538 */ + PARROT_OP_does_i_p_s, /* 539 */ + PARROT_OP_does_i_p_sc, /* 540 */ + PARROT_OP_does_i_p_p, /* 541 */ + PARROT_OP_does_i_p_pc, /* 542 */ + PARROT_OP_isa_i_p_s, /* 543 */ + PARROT_OP_isa_i_p_sc, /* 544 */ + PARROT_OP_isa_i_p_p, /* 545 */ + PARROT_OP_isa_i_p_pc, /* 546 */ + PARROT_OP_newclass_p_s, /* 547 */ + PARROT_OP_newclass_p_sc, /* 548 */ + PARROT_OP_newclass_p_p, /* 549 */ + PARROT_OP_newclass_p_pc, /* 550 */ + PARROT_OP_subclass_p_p, /* 551 */ + PARROT_OP_subclass_p_pc, /* 552 */ + PARROT_OP_subclass_p_p_s, /* 553 */ + PARROT_OP_subclass_p_pc_s, /* 554 */ + PARROT_OP_subclass_p_p_sc, /* 555 */ + PARROT_OP_subclass_p_pc_sc, /* 556 */ + PARROT_OP_subclass_p_p_p, /* 557 */ + PARROT_OP_subclass_p_pc_p, /* 558 */ + PARROT_OP_subclass_p_p_pc, /* 559 */ + PARROT_OP_subclass_p_pc_pc, /* 560 */ + PARROT_OP_subclass_p_s, /* 561 */ + PARROT_OP_subclass_p_sc, /* 562 */ + PARROT_OP_subclass_p_s_s, /* 563 */ + PARROT_OP_subclass_p_sc_s, /* 564 */ + PARROT_OP_subclass_p_s_sc, /* 565 */ + PARROT_OP_subclass_p_sc_sc, /* 566 */ + PARROT_OP_subclass_p_s_p, /* 567 */ + PARROT_OP_subclass_p_sc_p, /* 568 */ + PARROT_OP_subclass_p_s_pc, /* 569 */ + PARROT_OP_subclass_p_sc_pc, /* 570 */ + PARROT_OP_get_class_p_s, /* 571 */ + PARROT_OP_get_class_p_sc, /* 572 */ + PARROT_OP_get_class_p_p, /* 573 */ + PARROT_OP_get_class_p_pc, /* 574 */ + PARROT_OP_class_p_p, /* 575 */ + PARROT_OP_addparent_p_p, /* 576 */ + PARROT_OP_removeparent_p_p, /* 577 */ + PARROT_OP_addrole_p_p, /* 578 */ + PARROT_OP_addattribute_p_s, /* 579 */ + PARROT_OP_addattribute_p_sc, /* 580 */ + PARROT_OP_removeattribute_p_s, /* 581 */ + PARROT_OP_removeattribute_p_sc, /* 582 */ + PARROT_OP_getattribute_p_p_s, /* 583 */ + PARROT_OP_getattribute_p_p_sc, /* 584 */ + PARROT_OP_getattribute_p_p_p_s, /* 585 */ + PARROT_OP_getattribute_p_p_pc_s, /* 586 */ + PARROT_OP_getattribute_p_p_p_sc, /* 587 */ + PARROT_OP_getattribute_p_p_pc_sc, /* 588 */ + PARROT_OP_setattribute_p_s_p, /* 589 */ + PARROT_OP_setattribute_p_sc_p, /* 590 */ + PARROT_OP_setattribute_p_p_s_p, /* 591 */ + PARROT_OP_setattribute_p_pc_s_p, /* 592 */ + PARROT_OP_setattribute_p_p_sc_p, /* 593 */ + PARROT_OP_setattribute_p_pc_sc_p, /* 594 */ + PARROT_OP_inspect_p_p, /* 595 */ + PARROT_OP_inspect_p_pc, /* 596 */ + PARROT_OP_inspect_p_p_s, /* 597 */ + PARROT_OP_inspect_p_pc_s, /* 598 */ + PARROT_OP_inspect_p_p_sc, /* 599 */ + PARROT_OP_inspect_p_pc_sc, /* 600 */ + PARROT_OP_new_p_s, /* 601 */ + PARROT_OP_new_p_sc, /* 602 */ + PARROT_OP_new_p_s_p, /* 603 */ + PARROT_OP_new_p_sc_p, /* 604 */ + PARROT_OP_new_p_s_pc, /* 605 */ + PARROT_OP_new_p_sc_pc, /* 606 */ + PARROT_OP_new_p_p, /* 607 */ + PARROT_OP_new_p_pc, /* 608 */ + PARROT_OP_new_p_p_p, /* 609 */ + PARROT_OP_new_p_pc_p, /* 610 */ + PARROT_OP_new_p_p_pc, /* 611 */ + PARROT_OP_new_p_pc_pc, /* 612 */ + PARROT_OP_root_new_p_p, /* 613 */ + PARROT_OP_root_new_p_pc, /* 614 */ + PARROT_OP_root_new_p_p_p, /* 615 */ + PARROT_OP_root_new_p_pc_p, /* 616 */ + PARROT_OP_root_new_p_p_pc, /* 617 */ + PARROT_OP_root_new_p_pc_pc, /* 618 */ + PARROT_OP_typeof_s_p, /* 619 */ + PARROT_OP_typeof_p_p, /* 620 */ + PARROT_OP_get_repr_s_p, /* 621 */ + PARROT_OP_find_method_p_p_s, /* 622 */ + PARROT_OP_find_method_p_p_sc, /* 623 */ + PARROT_OP_defined_i_p, /* 624 */ + PARROT_OP_defined_i_p_ki, /* 625 */ + PARROT_OP_defined_i_p_kic, /* 626 */ + PARROT_OP_defined_i_p_k, /* 627 */ + PARROT_OP_defined_i_p_kc, /* 628 */ + PARROT_OP_exists_i_p_ki, /* 629 */ + PARROT_OP_exists_i_p_kic, /* 630 */ + PARROT_OP_exists_i_p_k, /* 631 */ + PARROT_OP_exists_i_p_kc, /* 632 */ + PARROT_OP_delete_p_k, /* 633 */ + PARROT_OP_delete_p_kc, /* 634 */ + PARROT_OP_delete_p_ki, /* 635 */ + PARROT_OP_delete_p_kic, /* 636 */ + PARROT_OP_elements_i_p, /* 637 */ + PARROT_OP_push_p_i, /* 638 */ + PARROT_OP_push_p_ic, /* 639 */ + PARROT_OP_push_p_n, /* 640 */ + PARROT_OP_push_p_nc, /* 641 */ + PARROT_OP_push_p_s, /* 642 */ + PARROT_OP_push_p_sc, /* 643 */ + PARROT_OP_push_p_p, /* 644 */ + PARROT_OP_pop_i_p, /* 645 */ + PARROT_OP_pop_n_p, /* 646 */ + PARROT_OP_pop_s_p, /* 647 */ + PARROT_OP_pop_p_p, /* 648 */ + PARROT_OP_unshift_p_i, /* 649 */ + PARROT_OP_unshift_p_ic, /* 650 */ + PARROT_OP_unshift_p_n, /* 651 */ + PARROT_OP_unshift_p_nc, /* 652 */ + PARROT_OP_unshift_p_s, /* 653 */ + PARROT_OP_unshift_p_sc, /* 654 */ + PARROT_OP_unshift_p_p, /* 655 */ + PARROT_OP_shift_i_p, /* 656 */ + PARROT_OP_shift_n_p, /* 657 */ + PARROT_OP_shift_s_p, /* 658 */ + PARROT_OP_shift_p_p, /* 659 */ + PARROT_OP_splice_p_p_i_i, /* 660 */ + PARROT_OP_splice_p_p_ic_i, /* 661 */ + PARROT_OP_splice_p_p_i_ic, /* 662 */ + PARROT_OP_splice_p_p_ic_ic, /* 663 */ + PARROT_OP_setprop_p_s_p, /* 664 */ + PARROT_OP_setprop_p_sc_p, /* 665 */ + PARROT_OP_getprop_p_s_p, /* 666 */ + PARROT_OP_getprop_p_sc_p, /* 667 */ + PARROT_OP_getprop_p_p_s, /* 668 */ + PARROT_OP_getprop_p_p_sc, /* 669 */ + PARROT_OP_delprop_p_s, /* 670 */ + PARROT_OP_delprop_p_sc, /* 671 */ + PARROT_OP_prophash_p_p, /* 672 */ + PARROT_OP_freeze_s_p, /* 673 */ + PARROT_OP_thaw_p_s, /* 674 */ + PARROT_OP_thaw_p_sc, /* 675 */ + PARROT_OP_add_multi_s_s_p, /* 676 */ + PARROT_OP_add_multi_sc_s_p, /* 677 */ + PARROT_OP_add_multi_s_sc_p, /* 678 */ + PARROT_OP_add_multi_sc_sc_p, /* 679 */ + PARROT_OP_find_multi_p_s_s, /* 680 */ + PARROT_OP_find_multi_p_sc_s, /* 681 */ + PARROT_OP_find_multi_p_s_sc, /* 682 */ + PARROT_OP_find_multi_p_sc_sc, /* 683 */ + PARROT_OP_register_p, /* 684 */ + PARROT_OP_unregister_p, /* 685 */ + PARROT_OP_box_p_i, /* 686 */ + PARROT_OP_box_p_ic, /* 687 */ + PARROT_OP_box_p_n, /* 688 */ + PARROT_OP_box_p_nc, /* 689 */ + PARROT_OP_box_p_s, /* 690 */ + PARROT_OP_box_p_sc, /* 691 */ + PARROT_OP_iter_p_p, /* 692 */ + PARROT_OP_morph_p_p, /* 693 */ + PARROT_OP_morph_p_pc, /* 694 */ + PARROT_OP_clone_s_s, /* 695 */ + PARROT_OP_clone_s_sc, /* 696 */ + PARROT_OP_set_i_i, /* 697 */ + PARROT_OP_set_i_ic, /* 698 */ + PARROT_OP_set_i_n, /* 699 */ + PARROT_OP_set_i_nc, /* 700 */ + PARROT_OP_set_i_s, /* 701 */ + PARROT_OP_set_i_sc, /* 702 */ + PARROT_OP_set_n_n, /* 703 */ + PARROT_OP_set_n_nc, /* 704 */ + PARROT_OP_set_n_i, /* 705 */ + PARROT_OP_set_n_ic, /* 706 */ + PARROT_OP_set_n_s, /* 707 */ + PARROT_OP_set_n_sc, /* 708 */ + PARROT_OP_set_n_p, /* 709 */ + PARROT_OP_set_s_p, /* 710 */ + PARROT_OP_set_s_s, /* 711 */ + PARROT_OP_set_s_sc, /* 712 */ + PARROT_OP_set_s_i, /* 713 */ + PARROT_OP_set_s_ic, /* 714 */ + PARROT_OP_set_s_n, /* 715 */ + PARROT_OP_set_s_nc, /* 716 */ + PARROT_OP_set_p_pc, /* 717 */ + PARROT_OP_set_p_p, /* 718 */ + PARROT_OP_set_p_i, /* 719 */ + PARROT_OP_set_p_ic, /* 720 */ + PARROT_OP_set_p_n, /* 721 */ + PARROT_OP_set_p_nc, /* 722 */ + PARROT_OP_set_p_s, /* 723 */ + PARROT_OP_set_p_sc, /* 724 */ + PARROT_OP_set_i_p, /* 725 */ + PARROT_OP_assign_p_p, /* 726 */ + PARROT_OP_assign_p_i, /* 727 */ + PARROT_OP_assign_p_ic, /* 728 */ + PARROT_OP_assign_p_n, /* 729 */ + PARROT_OP_assign_p_nc, /* 730 */ + PARROT_OP_assign_p_s, /* 731 */ + PARROT_OP_assign_p_sc, /* 732 */ + PARROT_OP_assign_s_s, /* 733 */ + PARROT_OP_assign_s_sc, /* 734 */ + PARROT_OP_setref_p_p, /* 735 */ + PARROT_OP_deref_p_p, /* 736 */ + PARROT_OP_set_p_ki_i, /* 737 */ + PARROT_OP_set_p_kic_i, /* 738 */ + PARROT_OP_set_p_ki_ic, /* 739 */ + PARROT_OP_set_p_kic_ic, /* 740 */ + PARROT_OP_set_p_ki_n, /* 741 */ + PARROT_OP_set_p_kic_n, /* 742 */ + PARROT_OP_set_p_ki_nc, /* 743 */ + PARROT_OP_set_p_kic_nc, /* 744 */ + PARROT_OP_set_p_ki_s, /* 745 */ + PARROT_OP_set_p_kic_s, /* 746 */ + PARROT_OP_set_p_ki_sc, /* 747 */ + PARROT_OP_set_p_kic_sc, /* 748 */ + PARROT_OP_set_p_ki_p, /* 749 */ + PARROT_OP_set_p_kic_p, /* 750 */ + PARROT_OP_set_i_p_ki, /* 751 */ + PARROT_OP_set_i_p_kic, /* 752 */ + PARROT_OP_set_n_p_ki, /* 753 */ + PARROT_OP_set_n_p_kic, /* 754 */ + PARROT_OP_set_s_p_ki, /* 755 */ + PARROT_OP_set_s_p_kic, /* 756 */ + PARROT_OP_set_p_p_ki, /* 757 */ + PARROT_OP_set_p_p_kic, /* 758 */ + PARROT_OP_set_p_k_i, /* 759 */ + PARROT_OP_set_p_kc_i, /* 760 */ + PARROT_OP_set_p_k_ic, /* 761 */ + PARROT_OP_set_p_kc_ic, /* 762 */ + PARROT_OP_set_p_k_n, /* 763 */ + PARROT_OP_set_p_kc_n, /* 764 */ + PARROT_OP_set_p_k_nc, /* 765 */ + PARROT_OP_set_p_kc_nc, /* 766 */ + PARROT_OP_set_p_k_s, /* 767 */ + PARROT_OP_set_p_kc_s, /* 768 */ + PARROT_OP_set_p_k_sc, /* 769 */ + PARROT_OP_set_p_kc_sc, /* 770 */ + PARROT_OP_set_p_k_p, /* 771 */ + PARROT_OP_set_p_kc_p, /* 772 */ + PARROT_OP_set_i_p_k, /* 773 */ + PARROT_OP_set_i_p_kc, /* 774 */ + PARROT_OP_set_n_p_k, /* 775 */ + PARROT_OP_set_n_p_kc, /* 776 */ + PARROT_OP_set_s_p_k, /* 777 */ + PARROT_OP_set_s_p_kc, /* 778 */ + PARROT_OP_set_p_p_k, /* 779 */ + PARROT_OP_set_p_p_kc, /* 780 */ + PARROT_OP_clone_p_p, /* 781 */ + PARROT_OP_clone_p_p_p, /* 782 */ + PARROT_OP_clone_p_p_pc, /* 783 */ + PARROT_OP_copy_p_p, /* 784 */ + PARROT_OP_null_s, /* 785 */ + PARROT_OP_null_i, /* 786 */ + PARROT_OP_null_p, /* 787 */ + PARROT_OP_null_n, /* 788 */ + PARROT_OP_ord_i_s, /* 789 */ + PARROT_OP_ord_i_sc, /* 790 */ + PARROT_OP_ord_i_s_i, /* 791 */ + PARROT_OP_ord_i_sc_i, /* 792 */ + PARROT_OP_ord_i_s_ic, /* 793 */ + PARROT_OP_ord_i_sc_ic, /* 794 */ + PARROT_OP_chr_s_i, /* 795 */ + PARROT_OP_chr_s_ic, /* 796 */ + PARROT_OP_chopn_s_s_i, /* 797 */ + PARROT_OP_chopn_s_sc_i, /* 798 */ + PARROT_OP_chopn_s_s_ic, /* 799 */ + PARROT_OP_chopn_s_sc_ic, /* 800 */ + PARROT_OP_concat_p_p, /* 801 */ + PARROT_OP_concat_p_s, /* 802 */ + PARROT_OP_concat_p_sc, /* 803 */ + PARROT_OP_concat_s_s_s, /* 804 */ + PARROT_OP_concat_s_sc_s, /* 805 */ + PARROT_OP_concat_s_s_sc, /* 806 */ + PARROT_OP_concat_p_p_s, /* 807 */ + PARROT_OP_concat_p_p_sc, /* 808 */ + PARROT_OP_concat_p_p_p, /* 809 */ + PARROT_OP_repeat_s_s_i, /* 810 */ + PARROT_OP_repeat_s_sc_i, /* 811 */ + PARROT_OP_repeat_s_s_ic, /* 812 */ + PARROT_OP_repeat_s_sc_ic, /* 813 */ + PARROT_OP_repeat_p_p_i, /* 814 */ + PARROT_OP_repeat_p_p_ic, /* 815 */ + PARROT_OP_repeat_p_p_p, /* 816 */ + PARROT_OP_repeat_p_i, /* 817 */ + PARROT_OP_repeat_p_ic, /* 818 */ + PARROT_OP_repeat_p_p, /* 819 */ + PARROT_OP_length_i_s, /* 820 */ + PARROT_OP_length_i_sc, /* 821 */ + PARROT_OP_bytelength_i_s, /* 822 */ + PARROT_OP_bytelength_i_sc, /* 823 */ + PARROT_OP_pin_s, /* 824 */ + PARROT_OP_unpin_s, /* 825 */ + PARROT_OP_substr_s_s_i, /* 826 */ + PARROT_OP_substr_s_sc_i, /* 827 */ + PARROT_OP_substr_s_s_ic, /* 828 */ + PARROT_OP_substr_s_sc_ic, /* 829 */ + PARROT_OP_substr_s_s_i_i, /* 830 */ + PARROT_OP_substr_s_sc_i_i, /* 831 */ + PARROT_OP_substr_s_s_ic_i, /* 832 */ + PARROT_OP_substr_s_sc_ic_i, /* 833 */ + PARROT_OP_substr_s_s_i_ic, /* 834 */ + PARROT_OP_substr_s_sc_i_ic, /* 835 */ + PARROT_OP_substr_s_s_ic_ic, /* 836 */ + PARROT_OP_substr_s_sc_ic_ic, /* 837 */ + PARROT_OP_substr_s_p_i_i, /* 838 */ + PARROT_OP_substr_s_p_ic_i, /* 839 */ + PARROT_OP_substr_s_p_i_ic, /* 840 */ + PARROT_OP_substr_s_p_ic_ic, /* 841 */ + PARROT_OP_replace_s_s_i_i_s, /* 842 */ + PARROT_OP_replace_s_sc_i_i_s, /* 843 */ + PARROT_OP_replace_s_s_ic_i_s, /* 844 */ + PARROT_OP_replace_s_sc_ic_i_s, /* 845 */ + PARROT_OP_replace_s_s_i_ic_s, /* 846 */ + PARROT_OP_replace_s_sc_i_ic_s, /* 847 */ + PARROT_OP_replace_s_s_ic_ic_s, /* 848 */ + PARROT_OP_replace_s_sc_ic_ic_s, /* 849 */ + PARROT_OP_replace_s_s_i_i_sc, /* 850 */ + PARROT_OP_replace_s_sc_i_i_sc, /* 851 */ + PARROT_OP_replace_s_s_ic_i_sc, /* 852 */ + PARROT_OP_replace_s_sc_ic_i_sc, /* 853 */ + PARROT_OP_replace_s_s_i_ic_sc, /* 854 */ + PARROT_OP_replace_s_sc_i_ic_sc, /* 855 */ + PARROT_OP_replace_s_s_ic_ic_sc, /* 856 */ + PARROT_OP_replace_s_sc_ic_ic_sc, /* 857 */ + PARROT_OP_index_i_s_s, /* 858 */ + PARROT_OP_index_i_sc_s, /* 859 */ + PARROT_OP_index_i_s_sc, /* 860 */ + PARROT_OP_index_i_sc_sc, /* 861 */ + PARROT_OP_index_i_s_s_i, /* 862 */ + PARROT_OP_index_i_sc_s_i, /* 863 */ + PARROT_OP_index_i_s_sc_i, /* 864 */ + PARROT_OP_index_i_sc_sc_i, /* 865 */ + PARROT_OP_index_i_s_s_ic, /* 866 */ + PARROT_OP_index_i_sc_s_ic, /* 867 */ + PARROT_OP_index_i_s_sc_ic, /* 868 */ + PARROT_OP_index_i_sc_sc_ic, /* 869 */ + PARROT_OP_sprintf_s_s_p, /* 870 */ + PARROT_OP_sprintf_s_sc_p, /* 871 */ + PARROT_OP_sprintf_p_p_p, /* 872 */ + PARROT_OP_new_s, /* 873 */ + PARROT_OP_stringinfo_i_s_i, /* 874 */ + PARROT_OP_stringinfo_i_sc_i, /* 875 */ + PARROT_OP_stringinfo_i_s_ic, /* 876 */ + PARROT_OP_stringinfo_i_sc_ic, /* 877 */ + PARROT_OP_upcase_s_s, /* 878 */ + PARROT_OP_upcase_s_sc, /* 879 */ + PARROT_OP_downcase_s_s, /* 880 */ + PARROT_OP_downcase_s_sc, /* 881 */ + PARROT_OP_titlecase_s_s, /* 882 */ + PARROT_OP_titlecase_s_sc, /* 883 */ + PARROT_OP_join_s_s_p, /* 884 */ + PARROT_OP_join_s_sc_p, /* 885 */ + PARROT_OP_split_p_s_s, /* 886 */ + PARROT_OP_split_p_sc_s, /* 887 */ + PARROT_OP_split_p_s_sc, /* 888 */ + PARROT_OP_split_p_sc_sc, /* 889 */ + PARROT_OP_encoding_i_s, /* 890 */ + PARROT_OP_encoding_i_sc, /* 891 */ + PARROT_OP_encodingname_s_i, /* 892 */ + PARROT_OP_encodingname_s_ic, /* 893 */ + PARROT_OP_find_encoding_i_s, /* 894 */ + PARROT_OP_find_encoding_i_sc, /* 895 */ + PARROT_OP_trans_encoding_s_s_i, /* 896 */ + PARROT_OP_trans_encoding_s_sc_i, /* 897 */ + PARROT_OP_trans_encoding_s_s_ic, /* 898 */ + PARROT_OP_trans_encoding_s_sc_ic, /* 899 */ + PARROT_OP_is_cclass_i_i_s_i, /* 900 */ + PARROT_OP_is_cclass_i_ic_s_i, /* 901 */ + PARROT_OP_is_cclass_i_i_sc_i, /* 902 */ + PARROT_OP_is_cclass_i_ic_sc_i, /* 903 */ + PARROT_OP_is_cclass_i_i_s_ic, /* 904 */ + PARROT_OP_is_cclass_i_ic_s_ic, /* 905 */ + PARROT_OP_is_cclass_i_i_sc_ic, /* 906 */ + PARROT_OP_is_cclass_i_ic_sc_ic, /* 907 */ + PARROT_OP_find_cclass_i_i_s_i_i, /* 908 */ + PARROT_OP_find_cclass_i_ic_s_i_i, /* 909 */ + PARROT_OP_find_cclass_i_i_sc_i_i, /* 910 */ + PARROT_OP_find_cclass_i_ic_sc_i_i, /* 911 */ + PARROT_OP_find_cclass_i_i_s_ic_i, /* 912 */ + PARROT_OP_find_cclass_i_ic_s_ic_i, /* 913 */ + PARROT_OP_find_cclass_i_i_sc_ic_i, /* 914 */ + PARROT_OP_find_cclass_i_ic_sc_ic_i, /* 915 */ + PARROT_OP_find_cclass_i_i_s_i_ic, /* 916 */ + PARROT_OP_find_cclass_i_ic_s_i_ic, /* 917 */ + PARROT_OP_find_cclass_i_i_sc_i_ic, /* 918 */ + PARROT_OP_find_cclass_i_ic_sc_i_ic, /* 919 */ + PARROT_OP_find_cclass_i_i_s_ic_ic, /* 920 */ + PARROT_OP_find_cclass_i_ic_s_ic_ic, /* 921 */ + PARROT_OP_find_cclass_i_i_sc_ic_ic, /* 922 */ + PARROT_OP_find_cclass_i_ic_sc_ic_ic, /* 923 */ + PARROT_OP_find_not_cclass_i_i_s_i_i, /* 924 */ + PARROT_OP_find_not_cclass_i_ic_s_i_i, /* 925 */ + PARROT_OP_find_not_cclass_i_i_sc_i_i, /* 926 */ + PARROT_OP_find_not_cclass_i_ic_sc_i_i, /* 927 */ + PARROT_OP_find_not_cclass_i_i_s_ic_i, /* 928 */ + PARROT_OP_find_not_cclass_i_ic_s_ic_i, /* 929 */ + PARROT_OP_find_not_cclass_i_i_sc_ic_i, /* 930 */ + PARROT_OP_find_not_cclass_i_ic_sc_ic_i, /* 931 */ + PARROT_OP_find_not_cclass_i_i_s_i_ic, /* 932 */ + PARROT_OP_find_not_cclass_i_ic_s_i_ic, /* 933 */ + PARROT_OP_find_not_cclass_i_i_sc_i_ic, /* 934 */ + PARROT_OP_find_not_cclass_i_ic_sc_i_ic, /* 935 */ + PARROT_OP_find_not_cclass_i_i_s_ic_ic, /* 936 */ + PARROT_OP_find_not_cclass_i_ic_s_ic_ic, /* 937 */ + PARROT_OP_find_not_cclass_i_i_sc_ic_ic, /* 938 */ + PARROT_OP_find_not_cclass_i_ic_sc_ic_ic, /* 939 */ + PARROT_OP_escape_s_s, /* 940 */ + PARROT_OP_compose_s_s, /* 941 */ + PARROT_OP_compose_s_sc, /* 942 */ + PARROT_OP_find_codepoint_i_s, /* 943 */ + PARROT_OP_find_codepoint_i_sc, /* 944 */ + PARROT_OP_spawnw_i_s, /* 945 */ + PARROT_OP_spawnw_i_sc, /* 946 */ + PARROT_OP_spawnw_i_p, /* 947 */ + PARROT_OP_err_i, /* 948 */ + PARROT_OP_err_s, /* 949 */ + PARROT_OP_err_s_i, /* 950 */ + PARROT_OP_err_s_ic, /* 951 */ + PARROT_OP_time_i, /* 952 */ + PARROT_OP_time_n, /* 953 */ + PARROT_OP_sleep_i, /* 954 */ + PARROT_OP_sleep_ic, /* 955 */ + PARROT_OP_sleep_n, /* 956 */ + PARROT_OP_sleep_nc, /* 957 */ + PARROT_OP_store_lex_s_p, /* 958 */ + PARROT_OP_store_lex_sc_p, /* 959 */ + PARROT_OP_store_lex_s_s, /* 960 */ + PARROT_OP_store_lex_sc_s, /* 961 */ + PARROT_OP_store_lex_s_sc, /* 962 */ + PARROT_OP_store_lex_sc_sc, /* 963 */ + PARROT_OP_store_lex_s_i, /* 964 */ + PARROT_OP_store_lex_sc_i, /* 965 */ + PARROT_OP_store_lex_s_ic, /* 966 */ + PARROT_OP_store_lex_sc_ic, /* 967 */ + PARROT_OP_store_lex_s_n, /* 968 */ + PARROT_OP_store_lex_sc_n, /* 969 */ + PARROT_OP_store_lex_s_nc, /* 970 */ + PARROT_OP_store_lex_sc_nc, /* 971 */ + PARROT_OP_store_dynamic_lex_s_p, /* 972 */ + PARROT_OP_store_dynamic_lex_sc_p, /* 973 */ + PARROT_OP_find_lex_p_s, /* 974 */ + PARROT_OP_find_lex_p_sc, /* 975 */ + PARROT_OP_find_lex_s_s, /* 976 */ + PARROT_OP_find_lex_s_sc, /* 977 */ + PARROT_OP_find_lex_i_s, /* 978 */ + PARROT_OP_find_lex_i_sc, /* 979 */ + PARROT_OP_find_lex_n_s, /* 980 */ + PARROT_OP_find_lex_n_sc, /* 981 */ + PARROT_OP_find_dynamic_lex_p_s, /* 982 */ + PARROT_OP_find_dynamic_lex_p_sc, /* 983 */ + PARROT_OP_find_caller_lex_p_s, /* 984 */ + PARROT_OP_find_caller_lex_p_sc, /* 985 */ + PARROT_OP_get_namespace_p, /* 986 */ + PARROT_OP_get_namespace_p_p, /* 987 */ + PARROT_OP_get_namespace_p_pc, /* 988 */ + PARROT_OP_get_hll_namespace_p, /* 989 */ + PARROT_OP_get_hll_namespace_p_p, /* 990 */ + PARROT_OP_get_hll_namespace_p_pc, /* 991 */ + PARROT_OP_get_root_namespace_p, /* 992 */ + PARROT_OP_get_root_namespace_p_p, /* 993 */ + PARROT_OP_get_root_namespace_p_pc, /* 994 */ + PARROT_OP_get_global_p_s, /* 995 */ + PARROT_OP_get_global_p_sc, /* 996 */ + PARROT_OP_get_global_p_p_s, /* 997 */ + PARROT_OP_get_global_p_pc_s, /* 998 */ + PARROT_OP_get_global_p_p_sc, /* 999 */ + PARROT_OP_get_global_p_pc_sc, /* 1000 */ + PARROT_OP_get_hll_global_p_s, /* 1001 */ + PARROT_OP_get_hll_global_p_sc, /* 1002 */ + PARROT_OP_get_hll_global_p_p_s, /* 1003 */ + PARROT_OP_get_hll_global_p_pc_s, /* 1004 */ + PARROT_OP_get_hll_global_p_p_sc, /* 1005 */ + PARROT_OP_get_hll_global_p_pc_sc, /* 1006 */ + PARROT_OP_get_root_global_p_s, /* 1007 */ + PARROT_OP_get_root_global_p_sc, /* 1008 */ + PARROT_OP_get_root_global_p_p_s, /* 1009 */ + PARROT_OP_get_root_global_p_pc_s, /* 1010 */ + PARROT_OP_get_root_global_p_p_sc, /* 1011 */ + PARROT_OP_get_root_global_p_pc_sc, /* 1012 */ + PARROT_OP_set_global_s_p, /* 1013 */ + PARROT_OP_set_global_sc_p, /* 1014 */ + PARROT_OP_set_global_p_s_p, /* 1015 */ + PARROT_OP_set_global_pc_s_p, /* 1016 */ + PARROT_OP_set_global_p_sc_p, /* 1017 */ + PARROT_OP_set_global_pc_sc_p, /* 1018 */ + PARROT_OP_set_hll_global_s_p, /* 1019 */ + PARROT_OP_set_hll_global_sc_p, /* 1020 */ + PARROT_OP_set_hll_global_p_s_p, /* 1021 */ + PARROT_OP_set_hll_global_pc_s_p, /* 1022 */ + PARROT_OP_set_hll_global_p_sc_p, /* 1023 */ + PARROT_OP_set_hll_global_pc_sc_p, /* 1024 */ + PARROT_OP_set_root_global_s_p, /* 1025 */ + PARROT_OP_set_root_global_sc_p, /* 1026 */ + PARROT_OP_set_root_global_p_s_p, /* 1027 */ + PARROT_OP_set_root_global_pc_s_p, /* 1028 */ + PARROT_OP_set_root_global_p_sc_p, /* 1029 */ + PARROT_OP_set_root_global_pc_sc_p, /* 1030 */ + PARROT_OP_find_name_p_s, /* 1031 */ + PARROT_OP_find_name_p_sc, /* 1032 */ + PARROT_OP_find_sub_not_null_p_s, /* 1033 */ + PARROT_OP_find_sub_not_null_p_sc, /* 1034 */ + PARROT_OP_trap, /* 1035 */ + PARROT_OP_set_label_p_ic, /* 1036 */ + PARROT_OP_get_label_i_p, /* 1037 */ + PARROT_OP_get_id_i_p, /* 1038 */ + PARROT_OP_get_id_i_pc, /* 1039 */ + PARROT_OP_fetch_p_p_p_p, /* 1040 */ + PARROT_OP_fetch_p_pc_p_p, /* 1041 */ + PARROT_OP_fetch_p_p_pc_p, /* 1042 */ + PARROT_OP_fetch_p_pc_pc_p, /* 1043 */ + PARROT_OP_fetch_p_p_p_pc, /* 1044 */ + PARROT_OP_fetch_p_pc_p_pc, /* 1045 */ + PARROT_OP_fetch_p_p_pc_pc, /* 1046 */ + PARROT_OP_fetch_p_pc_pc_pc, /* 1047 */ + PARROT_OP_fetch_p_p_i_p, /* 1048 */ + PARROT_OP_fetch_p_pc_i_p, /* 1049 */ + PARROT_OP_fetch_p_p_ic_p, /* 1050 */ + PARROT_OP_fetch_p_pc_ic_p, /* 1051 */ + PARROT_OP_fetch_p_p_i_pc, /* 1052 */ + PARROT_OP_fetch_p_pc_i_pc, /* 1053 */ + PARROT_OP_fetch_p_p_ic_pc, /* 1054 */ + PARROT_OP_fetch_p_pc_ic_pc, /* 1055 */ + PARROT_OP_fetch_p_p_s_p, /* 1056 */ + PARROT_OP_fetch_p_pc_s_p, /* 1057 */ + PARROT_OP_fetch_p_p_sc_p, /* 1058 */ + PARROT_OP_fetch_p_pc_sc_p, /* 1059 */ + PARROT_OP_fetch_p_p_s_pc, /* 1060 */ + PARROT_OP_fetch_p_pc_s_pc, /* 1061 */ + PARROT_OP_fetch_p_p_sc_pc, /* 1062 */ + PARROT_OP_fetch_p_pc_sc_pc, /* 1063 */ + PARROT_OP_vivify_p_p_p_p, /* 1064 */ + PARROT_OP_vivify_p_pc_p_p, /* 1065 */ + PARROT_OP_vivify_p_p_pc_p, /* 1066 */ + PARROT_OP_vivify_p_pc_pc_p, /* 1067 */ + PARROT_OP_vivify_p_p_p_pc, /* 1068 */ + PARROT_OP_vivify_p_pc_p_pc, /* 1069 */ + PARROT_OP_vivify_p_p_pc_pc, /* 1070 */ + PARROT_OP_vivify_p_pc_pc_pc, /* 1071 */ + PARROT_OP_vivify_p_p_i_p, /* 1072 */ + PARROT_OP_vivify_p_pc_i_p, /* 1073 */ + PARROT_OP_vivify_p_p_ic_p, /* 1074 */ + PARROT_OP_vivify_p_pc_ic_p, /* 1075 */ + PARROT_OP_vivify_p_p_i_pc, /* 1076 */ + PARROT_OP_vivify_p_pc_i_pc, /* 1077 */ + PARROT_OP_vivify_p_p_ic_pc, /* 1078 */ + PARROT_OP_vivify_p_pc_ic_pc, /* 1079 */ + PARROT_OP_vivify_p_p_s_p, /* 1080 */ + PARROT_OP_vivify_p_pc_s_p, /* 1081 */ + PARROT_OP_vivify_p_p_sc_p, /* 1082 */ + PARROT_OP_vivify_p_pc_sc_p, /* 1083 */ + PARROT_OP_vivify_p_p_s_pc, /* 1084 */ + PARROT_OP_vivify_p_pc_s_pc, /* 1085 */ + PARROT_OP_vivify_p_p_sc_pc, /* 1086 */ + PARROT_OP_vivify_p_pc_sc_pc, /* 1087 */ + PARROT_OP_new_p_s_i, /* 1088 */ + PARROT_OP_new_p_sc_i, /* 1089 */ + PARROT_OP_new_p_s_ic, /* 1090 */ + PARROT_OP_new_p_sc_ic, /* 1091 */ + PARROT_OP_new_p_p_i, /* 1092 */ + PARROT_OP_new_p_pc_i, /* 1093 */ + PARROT_OP_new_p_p_ic, /* 1094 */ + PARROT_OP_new_p_pc_ic, /* 1095 */ + PARROT_OP_root_new_p_p_i, /* 1096 */ + PARROT_OP_root_new_p_pc_i, /* 1097 */ + PARROT_OP_root_new_p_p_ic, /* 1098 */ + PARROT_OP_root_new_p_pc_ic, /* 1099 */ + PARROT_OP_get_context_p, /* 1100 */ + PARROT_OP_new_call_context_p, /* 1101 */ + PARROT_OP_invokecc_p_p, /* 1102 */ + PARROT_OP_flatten_array_into_p_p_i, /* 1103 */ + PARROT_OP_flatten_array_into_p_p_ic, /* 1104 */ + PARROT_OP_flatten_hash_into_p_p_i, /* 1105 */ + PARROT_OP_flatten_hash_into_p_p_ic, /* 1106 */ + PARROT_OP_slurp_array_from_p_p_i, /* 1107 */ + PARROT_OP_slurp_array_from_p_p_ic, /* 1108 */ + PARROT_OP_receive_p, /* 1109 */ + PARROT_OP_wait_p, /* 1110 */ + PARROT_OP_wait_pc, /* 1111 */ + PARROT_OP_pass /* 1112 */ } parrot_opcode_enums; diff --git a/include/parrot/opsenum.h b/include/parrot/opsenum.h index 30af5ed82d..2b5f92f8b5 100644 --- a/include/parrot/opsenum.h +++ b/include/parrot/opsenum.h @@ -78,1033 +78,1055 @@ enum OPS_ENUM { enum_ops_exit_ic = 61, enum_ops_finalize_p = 62, enum_ops_finalize_pc = 63, - enum_ops_debug_i = 64, - enum_ops_debug_ic = 65, - enum_ops_bounds_i = 66, - enum_ops_bounds_ic = 67, - enum_ops_profile_i = 68, - enum_ops_profile_ic = 69, - enum_ops_trace_i = 70, - enum_ops_trace_ic = 71, - enum_ops_gc_debug_i = 72, - enum_ops_gc_debug_ic = 73, - enum_ops_interpinfo_i_i = 74, - enum_ops_interpinfo_i_ic = 75, - enum_ops_interpinfo_p_i = 76, - enum_ops_interpinfo_p_ic = 77, - enum_ops_interpinfo_s_i = 78, - enum_ops_interpinfo_s_ic = 79, - enum_ops_warningson_i = 80, - enum_ops_warningson_ic = 81, - enum_ops_warningsoff_i = 82, - enum_ops_warningsoff_ic = 83, - enum_ops_errorson_i = 84, - enum_ops_errorson_ic = 85, - enum_ops_errorsoff_i = 86, - enum_ops_errorsoff_ic = 87, - enum_ops_runinterp_p_i = 88, - enum_ops_runinterp_p_ic = 89, - enum_ops_getinterp_p = 90, - enum_ops_sweep_ic = 91, - enum_ops_collect = 92, - enum_ops_sweepoff = 93, - enum_ops_sweepon = 94, - enum_ops_collectoff = 95, - enum_ops_collecton = 96, - enum_ops_needs_destroy_p = 97, - enum_ops_loadlib_p_s = 98, - enum_ops_loadlib_p_sc = 99, - enum_ops_loadlib_p_s_p = 100, - enum_ops_loadlib_p_sc_p = 101, - enum_ops_loadlib_p_s_pc = 102, - enum_ops_loadlib_p_sc_pc = 103, - enum_ops_dlfunc_p_p_s_s = 104, - enum_ops_dlfunc_p_p_sc_s = 105, - enum_ops_dlfunc_p_p_s_sc = 106, - enum_ops_dlfunc_p_p_sc_sc = 107, - enum_ops_dlfunc_p_p_s_p = 108, - enum_ops_dlfunc_p_p_sc_p = 109, - enum_ops_dlvar_p_p_s = 110, - enum_ops_dlvar_p_p_sc = 111, - enum_ops_compreg_s_p = 112, - enum_ops_compreg_sc_p = 113, - enum_ops_compreg_p_s = 114, - enum_ops_compreg_p_sc = 115, - enum_ops_new_callback_p_p_p_s = 116, - enum_ops_new_callback_p_p_p_sc = 117, - enum_ops_annotations_p = 118, - enum_ops_annotations_p_s = 119, - enum_ops_annotations_p_sc = 120, - enum_ops_band_i_i = 121, - enum_ops_band_i_ic = 122, - enum_ops_band_i_i_i = 123, - enum_ops_band_i_ic_i = 124, - enum_ops_band_i_i_ic = 125, - enum_ops_bor_i_i = 126, - enum_ops_bor_i_ic = 127, - enum_ops_bor_i_i_i = 128, - enum_ops_bor_i_ic_i = 129, - enum_ops_bor_i_i_ic = 130, - enum_ops_shl_i_i = 131, - enum_ops_shl_i_ic = 132, - enum_ops_shl_i_i_i = 133, - enum_ops_shl_i_ic_i = 134, - enum_ops_shl_i_i_ic = 135, - enum_ops_shr_i_i = 136, - enum_ops_shr_i_ic = 137, - enum_ops_shr_i_i_i = 138, - enum_ops_shr_i_ic_i = 139, - enum_ops_shr_i_i_ic = 140, - enum_ops_lsr_i_i = 141, - enum_ops_lsr_i_ic = 142, - enum_ops_lsr_i_i_i = 143, - enum_ops_lsr_i_ic_i = 144, - enum_ops_lsr_i_i_ic = 145, - enum_ops_bxor_i_i = 146, - enum_ops_bxor_i_ic = 147, - enum_ops_bxor_i_i_i = 148, - enum_ops_bxor_i_ic_i = 149, - enum_ops_bxor_i_i_ic = 150, - enum_ops_eq_i_i_ic = 151, - enum_ops_eq_ic_i_ic = 152, - enum_ops_eq_i_ic_ic = 153, - enum_ops_eq_n_n_ic = 154, - enum_ops_eq_nc_n_ic = 155, - enum_ops_eq_n_nc_ic = 156, - enum_ops_eq_s_s_ic = 157, - enum_ops_eq_sc_s_ic = 158, - enum_ops_eq_s_sc_ic = 159, - enum_ops_eq_p_p_ic = 160, - enum_ops_eq_p_i_ic = 161, - enum_ops_eq_p_ic_ic = 162, - enum_ops_eq_p_n_ic = 163, - enum_ops_eq_p_nc_ic = 164, - enum_ops_eq_p_s_ic = 165, - enum_ops_eq_p_sc_ic = 166, - enum_ops_eq_str_p_p_ic = 167, - enum_ops_eq_num_p_p_ic = 168, - enum_ops_eq_addr_s_s_ic = 169, - enum_ops_eq_addr_sc_s_ic = 170, - enum_ops_eq_addr_s_sc_ic = 171, - enum_ops_eq_addr_sc_sc_ic = 172, - enum_ops_eq_addr_p_p_ic = 173, - enum_ops_ne_i_i_ic = 174, - enum_ops_ne_ic_i_ic = 175, - enum_ops_ne_i_ic_ic = 176, - enum_ops_ne_n_n_ic = 177, - enum_ops_ne_nc_n_ic = 178, - enum_ops_ne_n_nc_ic = 179, - enum_ops_ne_s_s_ic = 180, - enum_ops_ne_sc_s_ic = 181, - enum_ops_ne_s_sc_ic = 182, - enum_ops_ne_p_p_ic = 183, - enum_ops_ne_p_i_ic = 184, - enum_ops_ne_p_ic_ic = 185, - enum_ops_ne_p_n_ic = 186, - enum_ops_ne_p_nc_ic = 187, - enum_ops_ne_p_s_ic = 188, - enum_ops_ne_p_sc_ic = 189, - enum_ops_ne_str_p_p_ic = 190, - enum_ops_ne_num_p_p_ic = 191, - enum_ops_ne_addr_s_s_ic = 192, - enum_ops_ne_addr_sc_s_ic = 193, - enum_ops_ne_addr_s_sc_ic = 194, - enum_ops_ne_addr_sc_sc_ic = 195, - enum_ops_ne_addr_p_p_ic = 196, - enum_ops_lt_i_i_ic = 197, - enum_ops_lt_ic_i_ic = 198, - enum_ops_lt_i_ic_ic = 199, - enum_ops_lt_n_n_ic = 200, - enum_ops_lt_nc_n_ic = 201, - enum_ops_lt_n_nc_ic = 202, - enum_ops_lt_s_s_ic = 203, - enum_ops_lt_sc_s_ic = 204, - enum_ops_lt_s_sc_ic = 205, - enum_ops_lt_p_p_ic = 206, - enum_ops_lt_p_i_ic = 207, - enum_ops_lt_p_ic_ic = 208, - enum_ops_lt_p_n_ic = 209, - enum_ops_lt_p_nc_ic = 210, - enum_ops_lt_p_s_ic = 211, - enum_ops_lt_p_sc_ic = 212, - enum_ops_lt_str_p_p_ic = 213, - enum_ops_lt_num_p_p_ic = 214, - enum_ops_le_i_i_ic = 215, - enum_ops_le_ic_i_ic = 216, - enum_ops_le_i_ic_ic = 217, - enum_ops_le_n_n_ic = 218, - enum_ops_le_nc_n_ic = 219, - enum_ops_le_n_nc_ic = 220, - enum_ops_le_s_s_ic = 221, - enum_ops_le_sc_s_ic = 222, - enum_ops_le_s_sc_ic = 223, - enum_ops_le_p_p_ic = 224, - enum_ops_le_p_i_ic = 225, - enum_ops_le_p_ic_ic = 226, - enum_ops_le_p_n_ic = 227, - enum_ops_le_p_nc_ic = 228, - enum_ops_le_p_s_ic = 229, - enum_ops_le_p_sc_ic = 230, - enum_ops_le_str_p_p_ic = 231, - enum_ops_le_num_p_p_ic = 232, - enum_ops_gt_p_p_ic = 233, - enum_ops_gt_p_i_ic = 234, - enum_ops_gt_p_ic_ic = 235, - enum_ops_gt_p_n_ic = 236, - enum_ops_gt_p_nc_ic = 237, - enum_ops_gt_p_s_ic = 238, - enum_ops_gt_p_sc_ic = 239, - enum_ops_gt_str_p_p_ic = 240, - enum_ops_gt_num_p_p_ic = 241, - enum_ops_ge_p_p_ic = 242, - enum_ops_ge_p_i_ic = 243, - enum_ops_ge_p_ic_ic = 244, - enum_ops_ge_p_n_ic = 245, - enum_ops_ge_p_nc_ic = 246, - enum_ops_ge_p_s_ic = 247, - enum_ops_ge_p_sc_ic = 248, - enum_ops_ge_str_p_p_ic = 249, - enum_ops_ge_num_p_p_ic = 250, - enum_ops_if_null_p_ic = 251, - enum_ops_if_null_s_ic = 252, - enum_ops_unless_null_p_ic = 253, - enum_ops_unless_null_s_ic = 254, - enum_ops_cmp_i_i_i = 255, - enum_ops_cmp_i_ic_i = 256, - enum_ops_cmp_i_i_ic = 257, - enum_ops_cmp_i_n_n = 258, - enum_ops_cmp_i_nc_n = 259, - enum_ops_cmp_i_n_nc = 260, - enum_ops_cmp_i_s_s = 261, - enum_ops_cmp_i_sc_s = 262, - enum_ops_cmp_i_s_sc = 263, - enum_ops_cmp_i_p_p = 264, - enum_ops_cmp_i_p_i = 265, - enum_ops_cmp_i_p_ic = 266, - enum_ops_cmp_i_p_n = 267, - enum_ops_cmp_i_p_nc = 268, - enum_ops_cmp_i_p_s = 269, - enum_ops_cmp_i_p_sc = 270, - enum_ops_cmp_str_i_p_p = 271, - enum_ops_cmp_num_i_p_p = 272, - enum_ops_cmp_pmc_p_p_p = 273, - enum_ops_issame_i_p_p = 274, - enum_ops_issame_i_s_s = 275, - enum_ops_issame_i_sc_s = 276, - enum_ops_issame_i_s_sc = 277, - enum_ops_issame_i_sc_sc = 278, - enum_ops_isntsame_i_p_p = 279, - enum_ops_isntsame_i_s_s = 280, - enum_ops_isntsame_i_sc_s = 281, - enum_ops_isntsame_i_s_sc = 282, - enum_ops_isntsame_i_sc_sc = 283, - enum_ops_istrue_i_p = 284, - enum_ops_isfalse_i_p = 285, - enum_ops_isnull_i_p = 286, - enum_ops_isnull_i_pc = 287, - enum_ops_isnull_i_s = 288, - enum_ops_isnull_i_sc = 289, - enum_ops_isgt_i_p_p = 290, - enum_ops_isge_i_p_p = 291, - enum_ops_isle_i_i_i = 292, - enum_ops_isle_i_ic_i = 293, - enum_ops_isle_i_i_ic = 294, - enum_ops_isle_i_n_n = 295, - enum_ops_isle_i_nc_n = 296, - enum_ops_isle_i_n_nc = 297, - enum_ops_isle_i_s_s = 298, - enum_ops_isle_i_sc_s = 299, - enum_ops_isle_i_s_sc = 300, - enum_ops_isle_i_p_p = 301, - enum_ops_islt_i_i_i = 302, - enum_ops_islt_i_ic_i = 303, - enum_ops_islt_i_i_ic = 304, - enum_ops_islt_i_n_n = 305, - enum_ops_islt_i_nc_n = 306, - enum_ops_islt_i_n_nc = 307, - enum_ops_islt_i_s_s = 308, - enum_ops_islt_i_sc_s = 309, - enum_ops_islt_i_s_sc = 310, - enum_ops_islt_i_p_p = 311, - enum_ops_iseq_i_i_i = 312, - enum_ops_iseq_i_ic_i = 313, - enum_ops_iseq_i_i_ic = 314, - enum_ops_iseq_i_n_n = 315, - enum_ops_iseq_i_nc_n = 316, - enum_ops_iseq_i_n_nc = 317, - enum_ops_iseq_i_s_s = 318, - enum_ops_iseq_i_sc_s = 319, - enum_ops_iseq_i_s_sc = 320, - enum_ops_iseq_i_p_p = 321, - enum_ops_isne_i_i_i = 322, - enum_ops_isne_i_ic_i = 323, - enum_ops_isne_i_i_ic = 324, - enum_ops_isne_i_n_n = 325, - enum_ops_isne_i_nc_n = 326, - enum_ops_isne_i_n_nc = 327, - enum_ops_isne_i_s_s = 328, - enum_ops_isne_i_sc_s = 329, - enum_ops_isne_i_s_sc = 330, - enum_ops_isne_i_p_p = 331, - enum_ops_and_i_i_i = 332, - enum_ops_and_i_ic_i = 333, - enum_ops_and_i_i_ic = 334, - enum_ops_and_p_p_p = 335, - enum_ops_not_i = 336, - enum_ops_not_i_i = 337, - enum_ops_not_p = 338, - enum_ops_not_p_p = 339, - enum_ops_or_i_i_i = 340, - enum_ops_or_i_ic_i = 341, - enum_ops_or_i_i_ic = 342, - enum_ops_or_p_p_p = 343, - enum_ops_xor_i_i_i = 344, - enum_ops_xor_i_ic_i = 345, - enum_ops_xor_i_i_ic = 346, - enum_ops_xor_p_p_p = 347, - enum_ops_print_i = 348, - enum_ops_print_ic = 349, - enum_ops_print_n = 350, - enum_ops_print_nc = 351, - enum_ops_print_s = 352, - enum_ops_print_sc = 353, - enum_ops_print_p = 354, - enum_ops_say_i = 355, - enum_ops_say_ic = 356, - enum_ops_say_n = 357, - enum_ops_say_nc = 358, - enum_ops_say_s = 359, - enum_ops_say_sc = 360, - enum_ops_say_p = 361, - enum_ops_print_p_i = 362, - enum_ops_print_p_ic = 363, - enum_ops_print_p_n = 364, - enum_ops_print_p_nc = 365, - enum_ops_print_p_s = 366, - enum_ops_print_p_sc = 367, - enum_ops_print_p_p = 368, - enum_ops_getstdin_p = 369, - enum_ops_getstdout_p = 370, - enum_ops_getstderr_p = 371, - enum_ops_abs_i = 372, - enum_ops_abs_n = 373, - enum_ops_abs_i_i = 374, - enum_ops_abs_n_n = 375, - enum_ops_abs_p = 376, - enum_ops_abs_p_p = 377, - enum_ops_add_i_i = 378, - enum_ops_add_i_ic = 379, - enum_ops_add_n_n = 380, - enum_ops_add_n_nc = 381, - enum_ops_add_p_p = 382, - enum_ops_add_p_i = 383, - enum_ops_add_p_ic = 384, - enum_ops_add_p_n = 385, - enum_ops_add_p_nc = 386, - enum_ops_add_i_i_i = 387, - enum_ops_add_i_ic_i = 388, - enum_ops_add_i_i_ic = 389, - enum_ops_add_n_n_n = 390, - enum_ops_add_n_nc_n = 391, - enum_ops_add_n_n_nc = 392, - enum_ops_add_p_p_p = 393, - enum_ops_add_p_p_i = 394, - enum_ops_add_p_p_ic = 395, - enum_ops_add_p_p_n = 396, - enum_ops_add_p_p_nc = 397, - enum_ops_dec_i = 398, - enum_ops_dec_n = 399, - enum_ops_dec_p = 400, - enum_ops_div_i_i = 401, - enum_ops_div_i_ic = 402, - enum_ops_div_n_n = 403, - enum_ops_div_n_nc = 404, - enum_ops_div_p_p = 405, - enum_ops_div_p_i = 406, - enum_ops_div_p_ic = 407, - enum_ops_div_p_n = 408, - enum_ops_div_p_nc = 409, - enum_ops_div_i_i_i = 410, - enum_ops_div_i_ic_i = 411, - enum_ops_div_i_i_ic = 412, - enum_ops_div_i_ic_ic = 413, - enum_ops_div_n_n_n = 414, - enum_ops_div_n_nc_n = 415, - enum_ops_div_n_n_nc = 416, - enum_ops_div_n_nc_nc = 417, - enum_ops_div_p_p_p = 418, - enum_ops_div_p_p_i = 419, - enum_ops_div_p_p_ic = 420, - enum_ops_div_p_p_n = 421, - enum_ops_div_p_p_nc = 422, - enum_ops_fdiv_i_i = 423, - enum_ops_fdiv_i_ic = 424, - enum_ops_fdiv_n_n = 425, - enum_ops_fdiv_n_nc = 426, - enum_ops_fdiv_p_p = 427, - enum_ops_fdiv_p_i = 428, - enum_ops_fdiv_p_ic = 429, - enum_ops_fdiv_p_n = 430, - enum_ops_fdiv_p_nc = 431, - enum_ops_fdiv_i_i_i = 432, - enum_ops_fdiv_i_ic_i = 433, - enum_ops_fdiv_i_i_ic = 434, - enum_ops_fdiv_n_n_n = 435, - enum_ops_fdiv_n_nc_n = 436, - enum_ops_fdiv_n_n_nc = 437, - enum_ops_fdiv_p_p_p = 438, - enum_ops_fdiv_p_p_i = 439, - enum_ops_fdiv_p_p_ic = 440, - enum_ops_fdiv_p_p_n = 441, - enum_ops_fdiv_p_p_nc = 442, - enum_ops_ceil_n = 443, - enum_ops_ceil_i_n = 444, - enum_ops_ceil_n_n = 445, - enum_ops_floor_n = 446, - enum_ops_floor_i_n = 447, - enum_ops_floor_n_n = 448, - enum_ops_inc_i = 449, - enum_ops_inc_n = 450, - enum_ops_inc_p = 451, - enum_ops_mod_i_i = 452, - enum_ops_mod_i_ic = 453, - enum_ops_mod_n_n = 454, - enum_ops_mod_n_nc = 455, - enum_ops_mod_p_p = 456, - enum_ops_mod_p_i = 457, - enum_ops_mod_p_ic = 458, - enum_ops_mod_p_n = 459, - enum_ops_mod_p_nc = 460, - enum_ops_mod_i_i_i = 461, - enum_ops_mod_i_ic_i = 462, - enum_ops_mod_i_i_ic = 463, - enum_ops_mod_n_n_n = 464, - enum_ops_mod_n_nc_n = 465, - enum_ops_mod_n_n_nc = 466, - enum_ops_mod_p_p_p = 467, - enum_ops_mod_p_p_i = 468, - enum_ops_mod_p_p_ic = 469, - enum_ops_mod_p_p_n = 470, - enum_ops_mod_p_p_nc = 471, - enum_ops_mul_i_i = 472, - enum_ops_mul_i_ic = 473, - enum_ops_mul_n_n = 474, - enum_ops_mul_n_nc = 475, - enum_ops_mul_p_p = 476, - enum_ops_mul_p_i = 477, - enum_ops_mul_p_ic = 478, - enum_ops_mul_p_n = 479, - enum_ops_mul_p_nc = 480, - enum_ops_mul_i_i_i = 481, - enum_ops_mul_i_ic_i = 482, - enum_ops_mul_i_i_ic = 483, - enum_ops_mul_n_n_n = 484, - enum_ops_mul_n_nc_n = 485, - enum_ops_mul_n_n_nc = 486, - enum_ops_mul_p_p_p = 487, - enum_ops_mul_p_p_i = 488, - enum_ops_mul_p_p_ic = 489, - enum_ops_mul_p_p_n = 490, - enum_ops_mul_p_p_nc = 491, - enum_ops_neg_i = 492, - enum_ops_neg_n = 493, - enum_ops_neg_p = 494, - enum_ops_neg_i_i = 495, - enum_ops_neg_n_n = 496, - enum_ops_neg_p_p = 497, - enum_ops_sub_i_i = 498, - enum_ops_sub_i_ic = 499, - enum_ops_sub_n_n = 500, - enum_ops_sub_n_nc = 501, - enum_ops_sub_p_p = 502, - enum_ops_sub_p_i = 503, - enum_ops_sub_p_ic = 504, - enum_ops_sub_p_n = 505, - enum_ops_sub_p_nc = 506, - enum_ops_sub_i_i_i = 507, - enum_ops_sub_i_ic_i = 508, - enum_ops_sub_i_i_ic = 509, - enum_ops_sub_n_n_n = 510, - enum_ops_sub_n_nc_n = 511, - enum_ops_sub_n_n_nc = 512, - enum_ops_sub_p_p_p = 513, - enum_ops_sub_p_p_i = 514, - enum_ops_sub_p_p_ic = 515, - enum_ops_sub_p_p_n = 516, - enum_ops_sub_p_p_nc = 517, - enum_ops_sqrt_n_n = 518, - enum_ops_callmethodcc_p_s = 519, - enum_ops_callmethodcc_p_sc = 520, - enum_ops_callmethodcc_p_p = 521, - enum_ops_callmethod_p_s_p = 522, - enum_ops_callmethod_p_sc_p = 523, - enum_ops_callmethod_p_p_p = 524, - enum_ops_tailcallmethod_p_s = 525, - enum_ops_tailcallmethod_p_sc = 526, - enum_ops_tailcallmethod_p_p = 527, - enum_ops_addmethod_p_s_p = 528, - enum_ops_addmethod_p_sc_p = 529, - enum_ops_can_i_p_s = 530, - enum_ops_can_i_p_sc = 531, - enum_ops_does_i_p_s = 532, - enum_ops_does_i_p_sc = 533, - enum_ops_does_i_p_p = 534, - enum_ops_does_i_p_pc = 535, - enum_ops_isa_i_p_s = 536, - enum_ops_isa_i_p_sc = 537, - enum_ops_isa_i_p_p = 538, - enum_ops_isa_i_p_pc = 539, - enum_ops_newclass_p_s = 540, - enum_ops_newclass_p_sc = 541, - enum_ops_newclass_p_p = 542, - enum_ops_newclass_p_pc = 543, - enum_ops_subclass_p_p = 544, - enum_ops_subclass_p_pc = 545, - enum_ops_subclass_p_p_s = 546, - enum_ops_subclass_p_pc_s = 547, - enum_ops_subclass_p_p_sc = 548, - enum_ops_subclass_p_pc_sc = 549, - enum_ops_subclass_p_p_p = 550, - enum_ops_subclass_p_pc_p = 551, - enum_ops_subclass_p_p_pc = 552, - enum_ops_subclass_p_pc_pc = 553, - enum_ops_subclass_p_s = 554, - enum_ops_subclass_p_sc = 555, - enum_ops_subclass_p_s_s = 556, - enum_ops_subclass_p_sc_s = 557, - enum_ops_subclass_p_s_sc = 558, - enum_ops_subclass_p_sc_sc = 559, - enum_ops_subclass_p_s_p = 560, - enum_ops_subclass_p_sc_p = 561, - enum_ops_subclass_p_s_pc = 562, - enum_ops_subclass_p_sc_pc = 563, - enum_ops_get_class_p_s = 564, - enum_ops_get_class_p_sc = 565, - enum_ops_get_class_p_p = 566, - enum_ops_get_class_p_pc = 567, - enum_ops_class_p_p = 568, - enum_ops_addparent_p_p = 569, - enum_ops_removeparent_p_p = 570, - enum_ops_addrole_p_p = 571, - enum_ops_addattribute_p_s = 572, - enum_ops_addattribute_p_sc = 573, - enum_ops_removeattribute_p_s = 574, - enum_ops_removeattribute_p_sc = 575, - enum_ops_getattribute_p_p_s = 576, - enum_ops_getattribute_p_p_sc = 577, - enum_ops_getattribute_p_p_p_s = 578, - enum_ops_getattribute_p_p_pc_s = 579, - enum_ops_getattribute_p_p_p_sc = 580, - enum_ops_getattribute_p_p_pc_sc = 581, - enum_ops_setattribute_p_s_p = 582, - enum_ops_setattribute_p_sc_p = 583, - enum_ops_setattribute_p_p_s_p = 584, - enum_ops_setattribute_p_pc_s_p = 585, - enum_ops_setattribute_p_p_sc_p = 586, - enum_ops_setattribute_p_pc_sc_p = 587, - enum_ops_inspect_p_p = 588, - enum_ops_inspect_p_pc = 589, - enum_ops_inspect_p_p_s = 590, - enum_ops_inspect_p_pc_s = 591, - enum_ops_inspect_p_p_sc = 592, - enum_ops_inspect_p_pc_sc = 593, - enum_ops_new_p_s = 594, - enum_ops_new_p_sc = 595, - enum_ops_new_p_s_p = 596, - enum_ops_new_p_sc_p = 597, - enum_ops_new_p_s_pc = 598, - enum_ops_new_p_sc_pc = 599, - enum_ops_new_p_p = 600, - enum_ops_new_p_pc = 601, - enum_ops_new_p_p_p = 602, - enum_ops_new_p_pc_p = 603, - enum_ops_new_p_p_pc = 604, - enum_ops_new_p_pc_pc = 605, - enum_ops_root_new_p_p = 606, - enum_ops_root_new_p_pc = 607, - enum_ops_root_new_p_p_p = 608, - enum_ops_root_new_p_pc_p = 609, - enum_ops_root_new_p_p_pc = 610, - enum_ops_root_new_p_pc_pc = 611, - enum_ops_typeof_s_p = 612, - enum_ops_typeof_p_p = 613, - enum_ops_get_repr_s_p = 614, - enum_ops_find_method_p_p_s = 615, - enum_ops_find_method_p_p_sc = 616, - enum_ops_defined_i_p = 617, - enum_ops_defined_i_p_ki = 618, - enum_ops_defined_i_p_kic = 619, - enum_ops_defined_i_p_k = 620, - enum_ops_defined_i_p_kc = 621, - enum_ops_exists_i_p_ki = 622, - enum_ops_exists_i_p_kic = 623, - enum_ops_exists_i_p_k = 624, - enum_ops_exists_i_p_kc = 625, - enum_ops_delete_p_k = 626, - enum_ops_delete_p_kc = 627, - enum_ops_delete_p_ki = 628, - enum_ops_delete_p_kic = 629, - enum_ops_elements_i_p = 630, - enum_ops_push_p_i = 631, - enum_ops_push_p_ic = 632, - enum_ops_push_p_n = 633, - enum_ops_push_p_nc = 634, - enum_ops_push_p_s = 635, - enum_ops_push_p_sc = 636, - enum_ops_push_p_p = 637, - enum_ops_pop_i_p = 638, - enum_ops_pop_n_p = 639, - enum_ops_pop_s_p = 640, - enum_ops_pop_p_p = 641, - enum_ops_unshift_p_i = 642, - enum_ops_unshift_p_ic = 643, - enum_ops_unshift_p_n = 644, - enum_ops_unshift_p_nc = 645, - enum_ops_unshift_p_s = 646, - enum_ops_unshift_p_sc = 647, - enum_ops_unshift_p_p = 648, - enum_ops_shift_i_p = 649, - enum_ops_shift_n_p = 650, - enum_ops_shift_s_p = 651, - enum_ops_shift_p_p = 652, - enum_ops_splice_p_p_i_i = 653, - enum_ops_splice_p_p_ic_i = 654, - enum_ops_splice_p_p_i_ic = 655, - enum_ops_splice_p_p_ic_ic = 656, - enum_ops_setprop_p_s_p = 657, - enum_ops_setprop_p_sc_p = 658, - enum_ops_getprop_p_s_p = 659, - enum_ops_getprop_p_sc_p = 660, - enum_ops_delprop_p_s = 661, - enum_ops_delprop_p_sc = 662, - enum_ops_prophash_p_p = 663, - enum_ops_freeze_s_p = 664, - enum_ops_thaw_p_s = 665, - enum_ops_thaw_p_sc = 666, - enum_ops_add_multi_s_s_p = 667, - enum_ops_add_multi_sc_s_p = 668, - enum_ops_add_multi_s_sc_p = 669, - enum_ops_add_multi_sc_sc_p = 670, - enum_ops_find_multi_p_s_s = 671, - enum_ops_find_multi_p_sc_s = 672, - enum_ops_find_multi_p_s_sc = 673, - enum_ops_find_multi_p_sc_sc = 674, - enum_ops_register_p = 675, - enum_ops_unregister_p = 676, - enum_ops_box_p_i = 677, - enum_ops_box_p_ic = 678, - enum_ops_box_p_n = 679, - enum_ops_box_p_nc = 680, - enum_ops_box_p_s = 681, - enum_ops_box_p_sc = 682, - enum_ops_iter_p_p = 683, - enum_ops_morph_p_p = 684, - enum_ops_morph_p_pc = 685, - enum_ops_clone_s_s = 686, - enum_ops_clone_s_sc = 687, - enum_ops_set_i_i = 688, - enum_ops_set_i_ic = 689, - enum_ops_set_i_n = 690, - enum_ops_set_i_nc = 691, - enum_ops_set_i_s = 692, - enum_ops_set_i_sc = 693, - enum_ops_set_n_n = 694, - enum_ops_set_n_nc = 695, - enum_ops_set_n_i = 696, - enum_ops_set_n_ic = 697, - enum_ops_set_n_s = 698, - enum_ops_set_n_sc = 699, - enum_ops_set_n_p = 700, - enum_ops_set_s_p = 701, - enum_ops_set_s_s = 702, - enum_ops_set_s_sc = 703, - enum_ops_set_s_i = 704, - enum_ops_set_s_ic = 705, - enum_ops_set_s_n = 706, - enum_ops_set_s_nc = 707, - enum_ops_set_p_pc = 708, - enum_ops_set_p_p = 709, - enum_ops_set_p_i = 710, - enum_ops_set_p_ic = 711, - enum_ops_set_p_n = 712, - enum_ops_set_p_nc = 713, - enum_ops_set_p_s = 714, - enum_ops_set_p_sc = 715, - enum_ops_set_i_p = 716, - enum_ops_assign_p_p = 717, - enum_ops_assign_p_i = 718, - enum_ops_assign_p_ic = 719, - enum_ops_assign_p_n = 720, - enum_ops_assign_p_nc = 721, - enum_ops_assign_p_s = 722, - enum_ops_assign_p_sc = 723, - enum_ops_assign_s_s = 724, - enum_ops_assign_s_sc = 725, - enum_ops_setref_p_p = 726, - enum_ops_deref_p_p = 727, - enum_ops_set_p_ki_i = 728, - enum_ops_set_p_kic_i = 729, - enum_ops_set_p_ki_ic = 730, - enum_ops_set_p_kic_ic = 731, - enum_ops_set_p_ki_n = 732, - enum_ops_set_p_kic_n = 733, - enum_ops_set_p_ki_nc = 734, - enum_ops_set_p_kic_nc = 735, - enum_ops_set_p_ki_s = 736, - enum_ops_set_p_kic_s = 737, - enum_ops_set_p_ki_sc = 738, - enum_ops_set_p_kic_sc = 739, - enum_ops_set_p_ki_p = 740, - enum_ops_set_p_kic_p = 741, - enum_ops_set_i_p_ki = 742, - enum_ops_set_i_p_kic = 743, - enum_ops_set_n_p_ki = 744, - enum_ops_set_n_p_kic = 745, - enum_ops_set_s_p_ki = 746, - enum_ops_set_s_p_kic = 747, - enum_ops_set_p_p_ki = 748, - enum_ops_set_p_p_kic = 749, - enum_ops_set_p_k_i = 750, - enum_ops_set_p_kc_i = 751, - enum_ops_set_p_k_ic = 752, - enum_ops_set_p_kc_ic = 753, - enum_ops_set_p_k_n = 754, - enum_ops_set_p_kc_n = 755, - enum_ops_set_p_k_nc = 756, - enum_ops_set_p_kc_nc = 757, - enum_ops_set_p_k_s = 758, - enum_ops_set_p_kc_s = 759, - enum_ops_set_p_k_sc = 760, - enum_ops_set_p_kc_sc = 761, - enum_ops_set_p_k_p = 762, - enum_ops_set_p_kc_p = 763, - enum_ops_set_i_p_k = 764, - enum_ops_set_i_p_kc = 765, - enum_ops_set_n_p_k = 766, - enum_ops_set_n_p_kc = 767, - enum_ops_set_s_p_k = 768, - enum_ops_set_s_p_kc = 769, - enum_ops_set_p_p_k = 770, - enum_ops_set_p_p_kc = 771, - enum_ops_clone_p_p = 772, - enum_ops_clone_p_p_p = 773, - enum_ops_clone_p_p_pc = 774, - enum_ops_copy_p_p = 775, - enum_ops_null_s = 776, - enum_ops_null_i = 777, - enum_ops_null_p = 778, - enum_ops_null_n = 779, - enum_ops_ord_i_s = 780, - enum_ops_ord_i_sc = 781, - enum_ops_ord_i_s_i = 782, - enum_ops_ord_i_sc_i = 783, - enum_ops_ord_i_s_ic = 784, - enum_ops_ord_i_sc_ic = 785, - enum_ops_chr_s_i = 786, - enum_ops_chr_s_ic = 787, - enum_ops_chopn_s_s_i = 788, - enum_ops_chopn_s_sc_i = 789, - enum_ops_chopn_s_s_ic = 790, - enum_ops_chopn_s_sc_ic = 791, - enum_ops_concat_p_p = 792, - enum_ops_concat_p_s = 793, - enum_ops_concat_p_sc = 794, - enum_ops_concat_s_s_s = 795, - enum_ops_concat_s_sc_s = 796, - enum_ops_concat_s_s_sc = 797, - enum_ops_concat_p_p_s = 798, - enum_ops_concat_p_p_sc = 799, - enum_ops_concat_p_p_p = 800, - enum_ops_repeat_s_s_i = 801, - enum_ops_repeat_s_sc_i = 802, - enum_ops_repeat_s_s_ic = 803, - enum_ops_repeat_s_sc_ic = 804, - enum_ops_repeat_p_p_i = 805, - enum_ops_repeat_p_p_ic = 806, - enum_ops_repeat_p_p_p = 807, - enum_ops_repeat_p_i = 808, - enum_ops_repeat_p_ic = 809, - enum_ops_repeat_p_p = 810, - enum_ops_length_i_s = 811, - enum_ops_length_i_sc = 812, - enum_ops_bytelength_i_s = 813, - enum_ops_bytelength_i_sc = 814, - enum_ops_pin_s = 815, - enum_ops_unpin_s = 816, - enum_ops_substr_s_s_i = 817, - enum_ops_substr_s_sc_i = 818, - enum_ops_substr_s_s_ic = 819, - enum_ops_substr_s_sc_ic = 820, - enum_ops_substr_s_s_i_i = 821, - enum_ops_substr_s_sc_i_i = 822, - enum_ops_substr_s_s_ic_i = 823, - enum_ops_substr_s_sc_ic_i = 824, - enum_ops_substr_s_s_i_ic = 825, - enum_ops_substr_s_sc_i_ic = 826, - enum_ops_substr_s_s_ic_ic = 827, - enum_ops_substr_s_sc_ic_ic = 828, - enum_ops_substr_s_p_i_i = 829, - enum_ops_substr_s_p_ic_i = 830, - enum_ops_substr_s_p_i_ic = 831, - enum_ops_substr_s_p_ic_ic = 832, - enum_ops_replace_s_s_i_i_s = 833, - enum_ops_replace_s_sc_i_i_s = 834, - enum_ops_replace_s_s_ic_i_s = 835, - enum_ops_replace_s_sc_ic_i_s = 836, - enum_ops_replace_s_s_i_ic_s = 837, - enum_ops_replace_s_sc_i_ic_s = 838, - enum_ops_replace_s_s_ic_ic_s = 839, - enum_ops_replace_s_sc_ic_ic_s = 840, - enum_ops_replace_s_s_i_i_sc = 841, - enum_ops_replace_s_sc_i_i_sc = 842, - enum_ops_replace_s_s_ic_i_sc = 843, - enum_ops_replace_s_sc_ic_i_sc = 844, - enum_ops_replace_s_s_i_ic_sc = 845, - enum_ops_replace_s_sc_i_ic_sc = 846, - enum_ops_replace_s_s_ic_ic_sc = 847, - enum_ops_replace_s_sc_ic_ic_sc = 848, - enum_ops_index_i_s_s = 849, - enum_ops_index_i_sc_s = 850, - enum_ops_index_i_s_sc = 851, - enum_ops_index_i_sc_sc = 852, - enum_ops_index_i_s_s_i = 853, - enum_ops_index_i_sc_s_i = 854, - enum_ops_index_i_s_sc_i = 855, - enum_ops_index_i_sc_sc_i = 856, - enum_ops_index_i_s_s_ic = 857, - enum_ops_index_i_sc_s_ic = 858, - enum_ops_index_i_s_sc_ic = 859, - enum_ops_index_i_sc_sc_ic = 860, - enum_ops_sprintf_s_s_p = 861, - enum_ops_sprintf_s_sc_p = 862, - enum_ops_sprintf_p_p_p = 863, - enum_ops_new_s = 864, - enum_ops_new_s_i = 865, - enum_ops_new_s_ic = 866, - enum_ops_stringinfo_i_s_i = 867, - enum_ops_stringinfo_i_sc_i = 868, - enum_ops_stringinfo_i_s_ic = 869, - enum_ops_stringinfo_i_sc_ic = 870, - enum_ops_upcase_s_s = 871, - enum_ops_upcase_s_sc = 872, - enum_ops_downcase_s_s = 873, - enum_ops_downcase_s_sc = 874, - enum_ops_titlecase_s_s = 875, - enum_ops_titlecase_s_sc = 876, - enum_ops_join_s_s_p = 877, - enum_ops_join_s_sc_p = 878, - enum_ops_split_p_s_s = 879, - enum_ops_split_p_sc_s = 880, - enum_ops_split_p_s_sc = 881, - enum_ops_split_p_sc_sc = 882, - enum_ops_encoding_i_s = 883, - enum_ops_encoding_i_sc = 884, - enum_ops_encodingname_s_i = 885, - enum_ops_encodingname_s_ic = 886, - enum_ops_find_encoding_i_s = 887, - enum_ops_find_encoding_i_sc = 888, - enum_ops_trans_encoding_s_s_i = 889, - enum_ops_trans_encoding_s_sc_i = 890, - enum_ops_trans_encoding_s_s_ic = 891, - enum_ops_trans_encoding_s_sc_ic = 892, - enum_ops_is_cclass_i_i_s_i = 893, - enum_ops_is_cclass_i_ic_s_i = 894, - enum_ops_is_cclass_i_i_sc_i = 895, - enum_ops_is_cclass_i_ic_sc_i = 896, - enum_ops_is_cclass_i_i_s_ic = 897, - enum_ops_is_cclass_i_ic_s_ic = 898, - enum_ops_is_cclass_i_i_sc_ic = 899, - enum_ops_is_cclass_i_ic_sc_ic = 900, - enum_ops_find_cclass_i_i_s_i_i = 901, - enum_ops_find_cclass_i_ic_s_i_i = 902, - enum_ops_find_cclass_i_i_sc_i_i = 903, - enum_ops_find_cclass_i_ic_sc_i_i = 904, - enum_ops_find_cclass_i_i_s_ic_i = 905, - enum_ops_find_cclass_i_ic_s_ic_i = 906, - enum_ops_find_cclass_i_i_sc_ic_i = 907, - enum_ops_find_cclass_i_ic_sc_ic_i = 908, - enum_ops_find_cclass_i_i_s_i_ic = 909, - enum_ops_find_cclass_i_ic_s_i_ic = 910, - enum_ops_find_cclass_i_i_sc_i_ic = 911, - enum_ops_find_cclass_i_ic_sc_i_ic = 912, - enum_ops_find_cclass_i_i_s_ic_ic = 913, - enum_ops_find_cclass_i_ic_s_ic_ic = 914, - enum_ops_find_cclass_i_i_sc_ic_ic = 915, - enum_ops_find_cclass_i_ic_sc_ic_ic = 916, - enum_ops_find_not_cclass_i_i_s_i_i = 917, - enum_ops_find_not_cclass_i_ic_s_i_i = 918, - enum_ops_find_not_cclass_i_i_sc_i_i = 919, - enum_ops_find_not_cclass_i_ic_sc_i_i = 920, - enum_ops_find_not_cclass_i_i_s_ic_i = 921, - enum_ops_find_not_cclass_i_ic_s_ic_i = 922, - enum_ops_find_not_cclass_i_i_sc_ic_i = 923, - enum_ops_find_not_cclass_i_ic_sc_ic_i = 924, - enum_ops_find_not_cclass_i_i_s_i_ic = 925, - enum_ops_find_not_cclass_i_ic_s_i_ic = 926, - enum_ops_find_not_cclass_i_i_sc_i_ic = 927, - enum_ops_find_not_cclass_i_ic_sc_i_ic = 928, - enum_ops_find_not_cclass_i_i_s_ic_ic = 929, - enum_ops_find_not_cclass_i_ic_s_ic_ic = 930, - enum_ops_find_not_cclass_i_i_sc_ic_ic = 931, - enum_ops_find_not_cclass_i_ic_sc_ic_ic = 932, - enum_ops_escape_s_s = 933, - enum_ops_compose_s_s = 934, - enum_ops_compose_s_sc = 935, - enum_ops_find_codepoint_i_s = 936, - enum_ops_find_codepoint_i_sc = 937, - enum_ops_spawnw_i_s = 938, - enum_ops_spawnw_i_sc = 939, - enum_ops_spawnw_i_p = 940, - enum_ops_err_i = 941, - enum_ops_err_s = 942, - enum_ops_err_s_i = 943, - enum_ops_err_s_ic = 944, - enum_ops_time_i = 945, - enum_ops_time_n = 946, - enum_ops_sleep_i = 947, - enum_ops_sleep_ic = 948, - enum_ops_sleep_n = 949, - enum_ops_sleep_nc = 950, - enum_ops_store_lex_s_p = 951, - enum_ops_store_lex_sc_p = 952, - enum_ops_store_lex_s_s = 953, - enum_ops_store_lex_sc_s = 954, - enum_ops_store_lex_s_sc = 955, - enum_ops_store_lex_sc_sc = 956, - enum_ops_store_lex_s_i = 957, - enum_ops_store_lex_sc_i = 958, - enum_ops_store_lex_s_ic = 959, - enum_ops_store_lex_sc_ic = 960, - enum_ops_store_lex_s_n = 961, - enum_ops_store_lex_sc_n = 962, - enum_ops_store_lex_s_nc = 963, - enum_ops_store_lex_sc_nc = 964, - enum_ops_store_dynamic_lex_s_p = 965, - enum_ops_store_dynamic_lex_sc_p = 966, - enum_ops_find_lex_p_s = 967, - enum_ops_find_lex_p_sc = 968, - enum_ops_find_lex_s_s = 969, - enum_ops_find_lex_s_sc = 970, - enum_ops_find_lex_i_s = 971, - enum_ops_find_lex_i_sc = 972, - enum_ops_find_lex_n_s = 973, - enum_ops_find_lex_n_sc = 974, - enum_ops_find_dynamic_lex_p_s = 975, - enum_ops_find_dynamic_lex_p_sc = 976, - enum_ops_find_caller_lex_p_s = 977, - enum_ops_find_caller_lex_p_sc = 978, - enum_ops_get_namespace_p = 979, - enum_ops_get_namespace_p_p = 980, - enum_ops_get_namespace_p_pc = 981, - enum_ops_get_hll_namespace_p = 982, - enum_ops_get_hll_namespace_p_p = 983, - enum_ops_get_hll_namespace_p_pc = 984, - enum_ops_get_root_namespace_p = 985, - enum_ops_get_root_namespace_p_p = 986, - enum_ops_get_root_namespace_p_pc = 987, - enum_ops_get_global_p_s = 988, - enum_ops_get_global_p_sc = 989, - enum_ops_get_global_p_p_s = 990, - enum_ops_get_global_p_pc_s = 991, - enum_ops_get_global_p_p_sc = 992, - enum_ops_get_global_p_pc_sc = 993, - enum_ops_get_hll_global_p_s = 994, - enum_ops_get_hll_global_p_sc = 995, - enum_ops_get_hll_global_p_p_s = 996, - enum_ops_get_hll_global_p_pc_s = 997, - enum_ops_get_hll_global_p_p_sc = 998, - enum_ops_get_hll_global_p_pc_sc = 999, - enum_ops_get_root_global_p_s = 1000, - enum_ops_get_root_global_p_sc = 1001, - enum_ops_get_root_global_p_p_s = 1002, - enum_ops_get_root_global_p_pc_s = 1003, - enum_ops_get_root_global_p_p_sc = 1004, - enum_ops_get_root_global_p_pc_sc = 1005, - enum_ops_set_global_s_p = 1006, - enum_ops_set_global_sc_p = 1007, - enum_ops_set_global_p_s_p = 1008, - enum_ops_set_global_pc_s_p = 1009, - enum_ops_set_global_p_sc_p = 1010, - enum_ops_set_global_pc_sc_p = 1011, - enum_ops_set_hll_global_s_p = 1012, - enum_ops_set_hll_global_sc_p = 1013, - enum_ops_set_hll_global_p_s_p = 1014, - enum_ops_set_hll_global_pc_s_p = 1015, - enum_ops_set_hll_global_p_sc_p = 1016, - enum_ops_set_hll_global_pc_sc_p = 1017, - enum_ops_set_root_global_s_p = 1018, - enum_ops_set_root_global_sc_p = 1019, - enum_ops_set_root_global_p_s_p = 1020, - enum_ops_set_root_global_pc_s_p = 1021, - enum_ops_set_root_global_p_sc_p = 1022, - enum_ops_set_root_global_pc_sc_p = 1023, - enum_ops_find_name_p_s = 1024, - enum_ops_find_name_p_sc = 1025, - enum_ops_find_sub_not_null_p_s = 1026, - enum_ops_find_sub_not_null_p_sc = 1027, - enum_ops_trap = 1028, - enum_ops_set_label_p_ic = 1029, - enum_ops_get_label_i_p = 1030, - enum_ops_fetch_p_p_p_p = 1031, - enum_ops_fetch_p_pc_p_p = 1032, - enum_ops_fetch_p_p_pc_p = 1033, - enum_ops_fetch_p_pc_pc_p = 1034, - enum_ops_fetch_p_p_p_pc = 1035, - enum_ops_fetch_p_pc_p_pc = 1036, - enum_ops_fetch_p_p_pc_pc = 1037, - enum_ops_fetch_p_pc_pc_pc = 1038, - enum_ops_fetch_p_p_i_p = 1039, - enum_ops_fetch_p_pc_i_p = 1040, - enum_ops_fetch_p_p_ic_p = 1041, - enum_ops_fetch_p_pc_ic_p = 1042, - enum_ops_fetch_p_p_i_pc = 1043, - enum_ops_fetch_p_pc_i_pc = 1044, - enum_ops_fetch_p_p_ic_pc = 1045, - enum_ops_fetch_p_pc_ic_pc = 1046, - enum_ops_fetch_p_p_s_p = 1047, - enum_ops_fetch_p_pc_s_p = 1048, - enum_ops_fetch_p_p_sc_p = 1049, - enum_ops_fetch_p_pc_sc_p = 1050, - enum_ops_fetch_p_p_s_pc = 1051, - enum_ops_fetch_p_pc_s_pc = 1052, - enum_ops_fetch_p_p_sc_pc = 1053, - enum_ops_fetch_p_pc_sc_pc = 1054, - enum_ops_vivify_p_p_p_p = 1055, - enum_ops_vivify_p_pc_p_p = 1056, - enum_ops_vivify_p_p_pc_p = 1057, - enum_ops_vivify_p_pc_pc_p = 1058, - enum_ops_vivify_p_p_p_pc = 1059, - enum_ops_vivify_p_pc_p_pc = 1060, - enum_ops_vivify_p_p_pc_pc = 1061, - enum_ops_vivify_p_pc_pc_pc = 1062, - enum_ops_vivify_p_p_i_p = 1063, - enum_ops_vivify_p_pc_i_p = 1064, - enum_ops_vivify_p_p_ic_p = 1065, - enum_ops_vivify_p_pc_ic_p = 1066, - enum_ops_vivify_p_p_i_pc = 1067, - enum_ops_vivify_p_pc_i_pc = 1068, - enum_ops_vivify_p_p_ic_pc = 1069, - enum_ops_vivify_p_pc_ic_pc = 1070, - enum_ops_vivify_p_p_s_p = 1071, - enum_ops_vivify_p_pc_s_p = 1072, - enum_ops_vivify_p_p_sc_p = 1073, - enum_ops_vivify_p_pc_sc_p = 1074, - enum_ops_vivify_p_p_s_pc = 1075, - enum_ops_vivify_p_pc_s_pc = 1076, - enum_ops_vivify_p_p_sc_pc = 1077, - enum_ops_vivify_p_pc_sc_pc = 1078, - enum_ops_new_p_s_i = 1079, - enum_ops_new_p_sc_i = 1080, - enum_ops_new_p_s_ic = 1081, - enum_ops_new_p_sc_ic = 1082, - enum_ops_new_p_p_i = 1083, - enum_ops_new_p_pc_i = 1084, - enum_ops_new_p_p_ic = 1085, - enum_ops_new_p_pc_ic = 1086, - enum_ops_root_new_p_p_i = 1087, - enum_ops_root_new_p_pc_i = 1088, - enum_ops_root_new_p_p_ic = 1089, - enum_ops_root_new_p_pc_ic = 1090, + enum_ops_pop_upto_eh_p = 64, + enum_ops_pop_upto_eh_pc = 65, + enum_ops_peek_exception_p = 66, + enum_ops_debug_i = 67, + enum_ops_debug_ic = 68, + enum_ops_bounds_i = 69, + enum_ops_bounds_ic = 70, + enum_ops_profile_i = 71, + enum_ops_profile_ic = 72, + enum_ops_trace_i = 73, + enum_ops_trace_ic = 74, + enum_ops_gc_debug_i = 75, + enum_ops_gc_debug_ic = 76, + enum_ops_interpinfo_i_i = 77, + enum_ops_interpinfo_i_ic = 78, + enum_ops_interpinfo_p_i = 79, + enum_ops_interpinfo_p_ic = 80, + enum_ops_interpinfo_s_i = 81, + enum_ops_interpinfo_s_ic = 82, + enum_ops_warningson_i = 83, + enum_ops_warningson_ic = 84, + enum_ops_warningsoff_i = 85, + enum_ops_warningsoff_ic = 86, + enum_ops_errorson_i = 87, + enum_ops_errorson_ic = 88, + enum_ops_errorsoff_i = 89, + enum_ops_errorsoff_ic = 90, + enum_ops_set_runcore_s = 91, + enum_ops_set_runcore_sc = 92, + enum_ops_runinterp_p_i = 93, + enum_ops_runinterp_p_ic = 94, + enum_ops_getinterp_p = 95, + enum_ops_sweep_ic = 96, + enum_ops_collect = 97, + enum_ops_sweepoff = 98, + enum_ops_sweepon = 99, + enum_ops_collectoff = 100, + enum_ops_collecton = 101, + enum_ops_needs_destroy_p = 102, + enum_ops_loadlib_p_s = 103, + enum_ops_loadlib_p_sc = 104, + enum_ops_loadlib_p_s_p = 105, + enum_ops_loadlib_p_sc_p = 106, + enum_ops_loadlib_p_s_pc = 107, + enum_ops_loadlib_p_sc_pc = 108, + enum_ops_dlfunc_p_p_s_s = 109, + enum_ops_dlfunc_p_p_sc_s = 110, + enum_ops_dlfunc_p_p_s_sc = 111, + enum_ops_dlfunc_p_p_sc_sc = 112, + enum_ops_dlfunc_p_p_s_p = 113, + enum_ops_dlfunc_p_p_sc_p = 114, + enum_ops_dlvar_p_p_s = 115, + enum_ops_dlvar_p_p_sc = 116, + enum_ops_compreg_s_p = 117, + enum_ops_compreg_sc_p = 118, + enum_ops_compreg_p_s = 119, + enum_ops_compreg_p_sc = 120, + enum_ops_new_callback_p_p_p_s = 121, + enum_ops_new_callback_p_p_p_sc = 122, + enum_ops_annotations_p = 123, + enum_ops_annotations_p_s = 124, + enum_ops_annotations_p_sc = 125, + enum_ops_band_i_i = 126, + enum_ops_band_i_ic = 127, + enum_ops_band_i_i_i = 128, + enum_ops_band_i_ic_i = 129, + enum_ops_band_i_i_ic = 130, + enum_ops_bor_i_i = 131, + enum_ops_bor_i_ic = 132, + enum_ops_bor_i_i_i = 133, + enum_ops_bor_i_ic_i = 134, + enum_ops_bor_i_i_ic = 135, + enum_ops_shl_i_i = 136, + enum_ops_shl_i_ic = 137, + enum_ops_shl_i_i_i = 138, + enum_ops_shl_i_ic_i = 139, + enum_ops_shl_i_i_ic = 140, + enum_ops_shr_i_i = 141, + enum_ops_shr_i_ic = 142, + enum_ops_shr_i_i_i = 143, + enum_ops_shr_i_ic_i = 144, + enum_ops_shr_i_i_ic = 145, + enum_ops_lsr_i_i = 146, + enum_ops_lsr_i_ic = 147, + enum_ops_lsr_i_i_i = 148, + enum_ops_lsr_i_ic_i = 149, + enum_ops_lsr_i_i_ic = 150, + enum_ops_bxor_i_i = 151, + enum_ops_bxor_i_ic = 152, + enum_ops_bxor_i_i_i = 153, + enum_ops_bxor_i_ic_i = 154, + enum_ops_bxor_i_i_ic = 155, + enum_ops_eq_i_i_ic = 156, + enum_ops_eq_ic_i_ic = 157, + enum_ops_eq_i_ic_ic = 158, + enum_ops_eq_n_n_ic = 159, + enum_ops_eq_nc_n_ic = 160, + enum_ops_eq_n_nc_ic = 161, + enum_ops_eq_s_s_ic = 162, + enum_ops_eq_sc_s_ic = 163, + enum_ops_eq_s_sc_ic = 164, + enum_ops_eq_p_p_ic = 165, + enum_ops_eq_p_i_ic = 166, + enum_ops_eq_p_ic_ic = 167, + enum_ops_eq_p_n_ic = 168, + enum_ops_eq_p_nc_ic = 169, + enum_ops_eq_p_s_ic = 170, + enum_ops_eq_p_sc_ic = 171, + enum_ops_eq_str_p_p_ic = 172, + enum_ops_eq_num_p_p_ic = 173, + enum_ops_eq_addr_s_s_ic = 174, + enum_ops_eq_addr_sc_s_ic = 175, + enum_ops_eq_addr_s_sc_ic = 176, + enum_ops_eq_addr_sc_sc_ic = 177, + enum_ops_eq_addr_p_p_ic = 178, + enum_ops_ne_i_i_ic = 179, + enum_ops_ne_ic_i_ic = 180, + enum_ops_ne_i_ic_ic = 181, + enum_ops_ne_n_n_ic = 182, + enum_ops_ne_nc_n_ic = 183, + enum_ops_ne_n_nc_ic = 184, + enum_ops_ne_s_s_ic = 185, + enum_ops_ne_sc_s_ic = 186, + enum_ops_ne_s_sc_ic = 187, + enum_ops_ne_p_p_ic = 188, + enum_ops_ne_p_i_ic = 189, + enum_ops_ne_p_ic_ic = 190, + enum_ops_ne_p_n_ic = 191, + enum_ops_ne_p_nc_ic = 192, + enum_ops_ne_p_s_ic = 193, + enum_ops_ne_p_sc_ic = 194, + enum_ops_ne_str_p_p_ic = 195, + enum_ops_ne_num_p_p_ic = 196, + enum_ops_ne_addr_s_s_ic = 197, + enum_ops_ne_addr_sc_s_ic = 198, + enum_ops_ne_addr_s_sc_ic = 199, + enum_ops_ne_addr_sc_sc_ic = 200, + enum_ops_ne_addr_p_p_ic = 201, + enum_ops_lt_i_i_ic = 202, + enum_ops_lt_ic_i_ic = 203, + enum_ops_lt_i_ic_ic = 204, + enum_ops_lt_n_n_ic = 205, + enum_ops_lt_nc_n_ic = 206, + enum_ops_lt_n_nc_ic = 207, + enum_ops_lt_s_s_ic = 208, + enum_ops_lt_sc_s_ic = 209, + enum_ops_lt_s_sc_ic = 210, + enum_ops_lt_p_p_ic = 211, + enum_ops_lt_p_i_ic = 212, + enum_ops_lt_p_ic_ic = 213, + enum_ops_lt_p_n_ic = 214, + enum_ops_lt_p_nc_ic = 215, + enum_ops_lt_p_s_ic = 216, + enum_ops_lt_p_sc_ic = 217, + enum_ops_lt_str_p_p_ic = 218, + enum_ops_lt_num_p_p_ic = 219, + enum_ops_le_i_i_ic = 220, + enum_ops_le_ic_i_ic = 221, + enum_ops_le_i_ic_ic = 222, + enum_ops_le_n_n_ic = 223, + enum_ops_le_nc_n_ic = 224, + enum_ops_le_n_nc_ic = 225, + enum_ops_le_s_s_ic = 226, + enum_ops_le_sc_s_ic = 227, + enum_ops_le_s_sc_ic = 228, + enum_ops_le_p_p_ic = 229, + enum_ops_le_p_i_ic = 230, + enum_ops_le_p_ic_ic = 231, + enum_ops_le_p_n_ic = 232, + enum_ops_le_p_nc_ic = 233, + enum_ops_le_p_s_ic = 234, + enum_ops_le_p_sc_ic = 235, + enum_ops_le_str_p_p_ic = 236, + enum_ops_le_num_p_p_ic = 237, + enum_ops_gt_p_p_ic = 238, + enum_ops_gt_p_i_ic = 239, + enum_ops_gt_p_ic_ic = 240, + enum_ops_gt_p_n_ic = 241, + enum_ops_gt_p_nc_ic = 242, + enum_ops_gt_p_s_ic = 243, + enum_ops_gt_p_sc_ic = 244, + enum_ops_gt_str_p_p_ic = 245, + enum_ops_gt_num_p_p_ic = 246, + enum_ops_ge_p_p_ic = 247, + enum_ops_ge_p_i_ic = 248, + enum_ops_ge_p_ic_ic = 249, + enum_ops_ge_p_n_ic = 250, + enum_ops_ge_p_nc_ic = 251, + enum_ops_ge_p_s_ic = 252, + enum_ops_ge_p_sc_ic = 253, + enum_ops_ge_str_p_p_ic = 254, + enum_ops_ge_num_p_p_ic = 255, + enum_ops_if_null_p_ic = 256, + enum_ops_if_null_s_ic = 257, + enum_ops_unless_null_p_ic = 258, + enum_ops_unless_null_s_ic = 259, + enum_ops_cmp_i_i_i = 260, + enum_ops_cmp_i_ic_i = 261, + enum_ops_cmp_i_i_ic = 262, + enum_ops_cmp_i_n_n = 263, + enum_ops_cmp_i_nc_n = 264, + enum_ops_cmp_i_n_nc = 265, + enum_ops_cmp_i_s_s = 266, + enum_ops_cmp_i_sc_s = 267, + enum_ops_cmp_i_s_sc = 268, + enum_ops_cmp_i_p_p = 269, + enum_ops_cmp_i_p_i = 270, + enum_ops_cmp_i_p_ic = 271, + enum_ops_cmp_i_p_n = 272, + enum_ops_cmp_i_p_nc = 273, + enum_ops_cmp_i_p_s = 274, + enum_ops_cmp_i_p_sc = 275, + enum_ops_cmp_str_i_p_p = 276, + enum_ops_cmp_num_i_p_p = 277, + enum_ops_cmp_pmc_p_p_p = 278, + enum_ops_issame_i_p_p = 279, + enum_ops_issame_i_s_s = 280, + enum_ops_issame_i_sc_s = 281, + enum_ops_issame_i_s_sc = 282, + enum_ops_issame_i_sc_sc = 283, + enum_ops_isntsame_i_p_p = 284, + enum_ops_isntsame_i_s_s = 285, + enum_ops_isntsame_i_sc_s = 286, + enum_ops_isntsame_i_s_sc = 287, + enum_ops_isntsame_i_sc_sc = 288, + enum_ops_istrue_i_p = 289, + enum_ops_isfalse_i_p = 290, + enum_ops_isnull_i_p = 291, + enum_ops_isnull_i_pc = 292, + enum_ops_isnull_i_s = 293, + enum_ops_isnull_i_sc = 294, + enum_ops_isgt_i_p_p = 295, + enum_ops_isge_i_p_p = 296, + enum_ops_isle_i_i_i = 297, + enum_ops_isle_i_ic_i = 298, + enum_ops_isle_i_i_ic = 299, + enum_ops_isle_i_n_n = 300, + enum_ops_isle_i_nc_n = 301, + enum_ops_isle_i_n_nc = 302, + enum_ops_isle_i_s_s = 303, + enum_ops_isle_i_sc_s = 304, + enum_ops_isle_i_s_sc = 305, + enum_ops_isle_i_p_p = 306, + enum_ops_islt_i_i_i = 307, + enum_ops_islt_i_ic_i = 308, + enum_ops_islt_i_i_ic = 309, + enum_ops_islt_i_n_n = 310, + enum_ops_islt_i_nc_n = 311, + enum_ops_islt_i_n_nc = 312, + enum_ops_islt_i_s_s = 313, + enum_ops_islt_i_sc_s = 314, + enum_ops_islt_i_s_sc = 315, + enum_ops_islt_i_p_p = 316, + enum_ops_iseq_i_i_i = 317, + enum_ops_iseq_i_ic_i = 318, + enum_ops_iseq_i_i_ic = 319, + enum_ops_iseq_i_n_n = 320, + enum_ops_iseq_i_nc_n = 321, + enum_ops_iseq_i_n_nc = 322, + enum_ops_iseq_i_s_s = 323, + enum_ops_iseq_i_sc_s = 324, + enum_ops_iseq_i_s_sc = 325, + enum_ops_iseq_i_p_p = 326, + enum_ops_isne_i_i_i = 327, + enum_ops_isne_i_ic_i = 328, + enum_ops_isne_i_i_ic = 329, + enum_ops_isne_i_n_n = 330, + enum_ops_isne_i_nc_n = 331, + enum_ops_isne_i_n_nc = 332, + enum_ops_isne_i_s_s = 333, + enum_ops_isne_i_sc_s = 334, + enum_ops_isne_i_s_sc = 335, + enum_ops_isne_i_p_p = 336, + enum_ops_and_i_i_i = 337, + enum_ops_and_i_ic_i = 338, + enum_ops_and_i_i_ic = 339, + enum_ops_and_p_p_p = 340, + enum_ops_not_i = 341, + enum_ops_not_i_i = 342, + enum_ops_not_p = 343, + enum_ops_not_p_p = 344, + enum_ops_or_i_i_i = 345, + enum_ops_or_i_ic_i = 346, + enum_ops_or_i_i_ic = 347, + enum_ops_or_p_p_p = 348, + enum_ops_xor_i_i_i = 349, + enum_ops_xor_i_ic_i = 350, + enum_ops_xor_i_i_ic = 351, + enum_ops_xor_p_p_p = 352, + enum_ops_print_i = 353, + enum_ops_print_ic = 354, + enum_ops_print_n = 355, + enum_ops_print_nc = 356, + enum_ops_print_s = 357, + enum_ops_print_sc = 358, + enum_ops_print_p = 359, + enum_ops_say_i = 360, + enum_ops_say_ic = 361, + enum_ops_say_n = 362, + enum_ops_say_nc = 363, + enum_ops_say_s = 364, + enum_ops_say_sc = 365, + enum_ops_say_p = 366, + enum_ops_print_p_i = 367, + enum_ops_print_p_ic = 368, + enum_ops_print_p_n = 369, + enum_ops_print_p_nc = 370, + enum_ops_print_p_s = 371, + enum_ops_print_p_sc = 372, + enum_ops_print_p_p = 373, + enum_ops_getstdin_p = 374, + enum_ops_getstdout_p = 375, + enum_ops_getstderr_p = 376, + enum_ops_abs_i = 377, + enum_ops_abs_n = 378, + enum_ops_abs_i_i = 379, + enum_ops_abs_n_n = 380, + enum_ops_abs_p = 381, + enum_ops_abs_p_p = 382, + enum_ops_add_i_i = 383, + enum_ops_add_i_ic = 384, + enum_ops_add_n_n = 385, + enum_ops_add_n_nc = 386, + enum_ops_add_p_p = 387, + enum_ops_add_p_i = 388, + enum_ops_add_p_ic = 389, + enum_ops_add_p_n = 390, + enum_ops_add_p_nc = 391, + enum_ops_add_i_i_i = 392, + enum_ops_add_i_ic_i = 393, + enum_ops_add_i_i_ic = 394, + enum_ops_add_n_n_n = 395, + enum_ops_add_n_nc_n = 396, + enum_ops_add_n_n_nc = 397, + enum_ops_add_p_p_p = 398, + enum_ops_add_p_p_i = 399, + enum_ops_add_p_p_ic = 400, + enum_ops_add_p_p_n = 401, + enum_ops_add_p_p_nc = 402, + enum_ops_dec_i = 403, + enum_ops_dec_n = 404, + enum_ops_dec_p = 405, + enum_ops_div_i_i = 406, + enum_ops_div_i_ic = 407, + enum_ops_div_n_n = 408, + enum_ops_div_n_nc = 409, + enum_ops_div_p_p = 410, + enum_ops_div_p_i = 411, + enum_ops_div_p_ic = 412, + enum_ops_div_p_n = 413, + enum_ops_div_p_nc = 414, + enum_ops_div_i_i_i = 415, + enum_ops_div_i_ic_i = 416, + enum_ops_div_i_i_ic = 417, + enum_ops_div_i_ic_ic = 418, + enum_ops_div_n_n_n = 419, + enum_ops_div_n_nc_n = 420, + enum_ops_div_n_n_nc = 421, + enum_ops_div_n_nc_nc = 422, + enum_ops_div_p_p_p = 423, + enum_ops_div_p_p_i = 424, + enum_ops_div_p_p_ic = 425, + enum_ops_div_p_p_n = 426, + enum_ops_div_p_p_nc = 427, + enum_ops_fdiv_i_i = 428, + enum_ops_fdiv_i_ic = 429, + enum_ops_fdiv_n_n = 430, + enum_ops_fdiv_n_nc = 431, + enum_ops_fdiv_p_p = 432, + enum_ops_fdiv_p_i = 433, + enum_ops_fdiv_p_ic = 434, + enum_ops_fdiv_p_n = 435, + enum_ops_fdiv_p_nc = 436, + enum_ops_fdiv_i_i_i = 437, + enum_ops_fdiv_i_ic_i = 438, + enum_ops_fdiv_i_i_ic = 439, + enum_ops_fdiv_n_n_n = 440, + enum_ops_fdiv_n_nc_n = 441, + enum_ops_fdiv_n_n_nc = 442, + enum_ops_fdiv_p_p_p = 443, + enum_ops_fdiv_p_p_i = 444, + enum_ops_fdiv_p_p_ic = 445, + enum_ops_fdiv_p_p_n = 446, + enum_ops_fdiv_p_p_nc = 447, + enum_ops_ceil_n = 448, + enum_ops_ceil_i_n = 449, + enum_ops_ceil_n_n = 450, + enum_ops_floor_n = 451, + enum_ops_floor_i_n = 452, + enum_ops_floor_n_n = 453, + enum_ops_inc_i = 454, + enum_ops_inc_n = 455, + enum_ops_inc_p = 456, + enum_ops_mod_i_i = 457, + enum_ops_mod_i_ic = 458, + enum_ops_mod_n_n = 459, + enum_ops_mod_n_nc = 460, + enum_ops_mod_p_p = 461, + enum_ops_mod_p_i = 462, + enum_ops_mod_p_ic = 463, + enum_ops_mod_p_n = 464, + enum_ops_mod_p_nc = 465, + enum_ops_mod_i_i_i = 466, + enum_ops_mod_i_ic_i = 467, + enum_ops_mod_i_i_ic = 468, + enum_ops_mod_n_n_n = 469, + enum_ops_mod_n_nc_n = 470, + enum_ops_mod_n_n_nc = 471, + enum_ops_mod_p_p_p = 472, + enum_ops_mod_p_p_i = 473, + enum_ops_mod_p_p_ic = 474, + enum_ops_mod_p_p_n = 475, + enum_ops_mod_p_p_nc = 476, + enum_ops_mul_i_i = 477, + enum_ops_mul_i_ic = 478, + enum_ops_mul_n_n = 479, + enum_ops_mul_n_nc = 480, + enum_ops_mul_p_p = 481, + enum_ops_mul_p_i = 482, + enum_ops_mul_p_ic = 483, + enum_ops_mul_p_n = 484, + enum_ops_mul_p_nc = 485, + enum_ops_mul_i_i_i = 486, + enum_ops_mul_i_ic_i = 487, + enum_ops_mul_i_i_ic = 488, + enum_ops_mul_n_n_n = 489, + enum_ops_mul_n_nc_n = 490, + enum_ops_mul_n_n_nc = 491, + enum_ops_mul_p_p_p = 492, + enum_ops_mul_p_p_i = 493, + enum_ops_mul_p_p_ic = 494, + enum_ops_mul_p_p_n = 495, + enum_ops_mul_p_p_nc = 496, + enum_ops_neg_i = 497, + enum_ops_neg_n = 498, + enum_ops_neg_p = 499, + enum_ops_neg_i_i = 500, + enum_ops_neg_n_n = 501, + enum_ops_neg_p_p = 502, + enum_ops_sub_i_i = 503, + enum_ops_sub_i_ic = 504, + enum_ops_sub_n_n = 505, + enum_ops_sub_n_nc = 506, + enum_ops_sub_p_p = 507, + enum_ops_sub_p_i = 508, + enum_ops_sub_p_ic = 509, + enum_ops_sub_p_n = 510, + enum_ops_sub_p_nc = 511, + enum_ops_sub_i_i_i = 512, + enum_ops_sub_i_ic_i = 513, + enum_ops_sub_i_i_ic = 514, + enum_ops_sub_n_n_n = 515, + enum_ops_sub_n_nc_n = 516, + enum_ops_sub_n_n_nc = 517, + enum_ops_sub_p_p_p = 518, + enum_ops_sub_p_p_i = 519, + enum_ops_sub_p_p_ic = 520, + enum_ops_sub_p_p_n = 521, + enum_ops_sub_p_p_nc = 522, + enum_ops_sqrt_n_n = 523, + enum_ops_is_inf_or_nan_i_n = 524, + enum_ops_is_inf_or_nan_i_nc = 525, + enum_ops_callmethodcc_p_s = 526, + enum_ops_callmethodcc_p_sc = 527, + enum_ops_callmethodcc_p_p = 528, + enum_ops_callmethod_p_s_p = 529, + enum_ops_callmethod_p_sc_p = 530, + enum_ops_callmethod_p_p_p = 531, + enum_ops_tailcallmethod_p_s = 532, + enum_ops_tailcallmethod_p_sc = 533, + enum_ops_tailcallmethod_p_p = 534, + enum_ops_addmethod_p_s_p = 535, + enum_ops_addmethod_p_sc_p = 536, + enum_ops_can_i_p_s = 537, + enum_ops_can_i_p_sc = 538, + enum_ops_does_i_p_s = 539, + enum_ops_does_i_p_sc = 540, + enum_ops_does_i_p_p = 541, + enum_ops_does_i_p_pc = 542, + enum_ops_isa_i_p_s = 543, + enum_ops_isa_i_p_sc = 544, + enum_ops_isa_i_p_p = 545, + enum_ops_isa_i_p_pc = 546, + enum_ops_newclass_p_s = 547, + enum_ops_newclass_p_sc = 548, + enum_ops_newclass_p_p = 549, + enum_ops_newclass_p_pc = 550, + enum_ops_subclass_p_p = 551, + enum_ops_subclass_p_pc = 552, + enum_ops_subclass_p_p_s = 553, + enum_ops_subclass_p_pc_s = 554, + enum_ops_subclass_p_p_sc = 555, + enum_ops_subclass_p_pc_sc = 556, + enum_ops_subclass_p_p_p = 557, + enum_ops_subclass_p_pc_p = 558, + enum_ops_subclass_p_p_pc = 559, + enum_ops_subclass_p_pc_pc = 560, + enum_ops_subclass_p_s = 561, + enum_ops_subclass_p_sc = 562, + enum_ops_subclass_p_s_s = 563, + enum_ops_subclass_p_sc_s = 564, + enum_ops_subclass_p_s_sc = 565, + enum_ops_subclass_p_sc_sc = 566, + enum_ops_subclass_p_s_p = 567, + enum_ops_subclass_p_sc_p = 568, + enum_ops_subclass_p_s_pc = 569, + enum_ops_subclass_p_sc_pc = 570, + enum_ops_get_class_p_s = 571, + enum_ops_get_class_p_sc = 572, + enum_ops_get_class_p_p = 573, + enum_ops_get_class_p_pc = 574, + enum_ops_class_p_p = 575, + enum_ops_addparent_p_p = 576, + enum_ops_removeparent_p_p = 577, + enum_ops_addrole_p_p = 578, + enum_ops_addattribute_p_s = 579, + enum_ops_addattribute_p_sc = 580, + enum_ops_removeattribute_p_s = 581, + enum_ops_removeattribute_p_sc = 582, + enum_ops_getattribute_p_p_s = 583, + enum_ops_getattribute_p_p_sc = 584, + enum_ops_getattribute_p_p_p_s = 585, + enum_ops_getattribute_p_p_pc_s = 586, + enum_ops_getattribute_p_p_p_sc = 587, + enum_ops_getattribute_p_p_pc_sc = 588, + enum_ops_setattribute_p_s_p = 589, + enum_ops_setattribute_p_sc_p = 590, + enum_ops_setattribute_p_p_s_p = 591, + enum_ops_setattribute_p_pc_s_p = 592, + enum_ops_setattribute_p_p_sc_p = 593, + enum_ops_setattribute_p_pc_sc_p = 594, + enum_ops_inspect_p_p = 595, + enum_ops_inspect_p_pc = 596, + enum_ops_inspect_p_p_s = 597, + enum_ops_inspect_p_pc_s = 598, + enum_ops_inspect_p_p_sc = 599, + enum_ops_inspect_p_pc_sc = 600, + enum_ops_new_p_s = 601, + enum_ops_new_p_sc = 602, + enum_ops_new_p_s_p = 603, + enum_ops_new_p_sc_p = 604, + enum_ops_new_p_s_pc = 605, + enum_ops_new_p_sc_pc = 606, + enum_ops_new_p_p = 607, + enum_ops_new_p_pc = 608, + enum_ops_new_p_p_p = 609, + enum_ops_new_p_pc_p = 610, + enum_ops_new_p_p_pc = 611, + enum_ops_new_p_pc_pc = 612, + enum_ops_root_new_p_p = 613, + enum_ops_root_new_p_pc = 614, + enum_ops_root_new_p_p_p = 615, + enum_ops_root_new_p_pc_p = 616, + enum_ops_root_new_p_p_pc = 617, + enum_ops_root_new_p_pc_pc = 618, + enum_ops_typeof_s_p = 619, + enum_ops_typeof_p_p = 620, + enum_ops_get_repr_s_p = 621, + enum_ops_find_method_p_p_s = 622, + enum_ops_find_method_p_p_sc = 623, + enum_ops_defined_i_p = 624, + enum_ops_defined_i_p_ki = 625, + enum_ops_defined_i_p_kic = 626, + enum_ops_defined_i_p_k = 627, + enum_ops_defined_i_p_kc = 628, + enum_ops_exists_i_p_ki = 629, + enum_ops_exists_i_p_kic = 630, + enum_ops_exists_i_p_k = 631, + enum_ops_exists_i_p_kc = 632, + enum_ops_delete_p_k = 633, + enum_ops_delete_p_kc = 634, + enum_ops_delete_p_ki = 635, + enum_ops_delete_p_kic = 636, + enum_ops_elements_i_p = 637, + enum_ops_push_p_i = 638, + enum_ops_push_p_ic = 639, + enum_ops_push_p_n = 640, + enum_ops_push_p_nc = 641, + enum_ops_push_p_s = 642, + enum_ops_push_p_sc = 643, + enum_ops_push_p_p = 644, + enum_ops_pop_i_p = 645, + enum_ops_pop_n_p = 646, + enum_ops_pop_s_p = 647, + enum_ops_pop_p_p = 648, + enum_ops_unshift_p_i = 649, + enum_ops_unshift_p_ic = 650, + enum_ops_unshift_p_n = 651, + enum_ops_unshift_p_nc = 652, + enum_ops_unshift_p_s = 653, + enum_ops_unshift_p_sc = 654, + enum_ops_unshift_p_p = 655, + enum_ops_shift_i_p = 656, + enum_ops_shift_n_p = 657, + enum_ops_shift_s_p = 658, + enum_ops_shift_p_p = 659, + enum_ops_splice_p_p_i_i = 660, + enum_ops_splice_p_p_ic_i = 661, + enum_ops_splice_p_p_i_ic = 662, + enum_ops_splice_p_p_ic_ic = 663, + enum_ops_setprop_p_s_p = 664, + enum_ops_setprop_p_sc_p = 665, + enum_ops_getprop_p_s_p = 666, + enum_ops_getprop_p_sc_p = 667, + enum_ops_getprop_p_p_s = 668, + enum_ops_getprop_p_p_sc = 669, + enum_ops_delprop_p_s = 670, + enum_ops_delprop_p_sc = 671, + enum_ops_prophash_p_p = 672, + enum_ops_freeze_s_p = 673, + enum_ops_thaw_p_s = 674, + enum_ops_thaw_p_sc = 675, + enum_ops_add_multi_s_s_p = 676, + enum_ops_add_multi_sc_s_p = 677, + enum_ops_add_multi_s_sc_p = 678, + enum_ops_add_multi_sc_sc_p = 679, + enum_ops_find_multi_p_s_s = 680, + enum_ops_find_multi_p_sc_s = 681, + enum_ops_find_multi_p_s_sc = 682, + enum_ops_find_multi_p_sc_sc = 683, + enum_ops_register_p = 684, + enum_ops_unregister_p = 685, + enum_ops_box_p_i = 686, + enum_ops_box_p_ic = 687, + enum_ops_box_p_n = 688, + enum_ops_box_p_nc = 689, + enum_ops_box_p_s = 690, + enum_ops_box_p_sc = 691, + enum_ops_iter_p_p = 692, + enum_ops_morph_p_p = 693, + enum_ops_morph_p_pc = 694, + enum_ops_clone_s_s = 695, + enum_ops_clone_s_sc = 696, + enum_ops_set_i_i = 697, + enum_ops_set_i_ic = 698, + enum_ops_set_i_n = 699, + enum_ops_set_i_nc = 700, + enum_ops_set_i_s = 701, + enum_ops_set_i_sc = 702, + enum_ops_set_n_n = 703, + enum_ops_set_n_nc = 704, + enum_ops_set_n_i = 705, + enum_ops_set_n_ic = 706, + enum_ops_set_n_s = 707, + enum_ops_set_n_sc = 708, + enum_ops_set_n_p = 709, + enum_ops_set_s_p = 710, + enum_ops_set_s_s = 711, + enum_ops_set_s_sc = 712, + enum_ops_set_s_i = 713, + enum_ops_set_s_ic = 714, + enum_ops_set_s_n = 715, + enum_ops_set_s_nc = 716, + enum_ops_set_p_pc = 717, + enum_ops_set_p_p = 718, + enum_ops_set_p_i = 719, + enum_ops_set_p_ic = 720, + enum_ops_set_p_n = 721, + enum_ops_set_p_nc = 722, + enum_ops_set_p_s = 723, + enum_ops_set_p_sc = 724, + enum_ops_set_i_p = 725, + enum_ops_assign_p_p = 726, + enum_ops_assign_p_i = 727, + enum_ops_assign_p_ic = 728, + enum_ops_assign_p_n = 729, + enum_ops_assign_p_nc = 730, + enum_ops_assign_p_s = 731, + enum_ops_assign_p_sc = 732, + enum_ops_assign_s_s = 733, + enum_ops_assign_s_sc = 734, + enum_ops_setref_p_p = 735, + enum_ops_deref_p_p = 736, + enum_ops_set_p_ki_i = 737, + enum_ops_set_p_kic_i = 738, + enum_ops_set_p_ki_ic = 739, + enum_ops_set_p_kic_ic = 740, + enum_ops_set_p_ki_n = 741, + enum_ops_set_p_kic_n = 742, + enum_ops_set_p_ki_nc = 743, + enum_ops_set_p_kic_nc = 744, + enum_ops_set_p_ki_s = 745, + enum_ops_set_p_kic_s = 746, + enum_ops_set_p_ki_sc = 747, + enum_ops_set_p_kic_sc = 748, + enum_ops_set_p_ki_p = 749, + enum_ops_set_p_kic_p = 750, + enum_ops_set_i_p_ki = 751, + enum_ops_set_i_p_kic = 752, + enum_ops_set_n_p_ki = 753, + enum_ops_set_n_p_kic = 754, + enum_ops_set_s_p_ki = 755, + enum_ops_set_s_p_kic = 756, + enum_ops_set_p_p_ki = 757, + enum_ops_set_p_p_kic = 758, + enum_ops_set_p_k_i = 759, + enum_ops_set_p_kc_i = 760, + enum_ops_set_p_k_ic = 761, + enum_ops_set_p_kc_ic = 762, + enum_ops_set_p_k_n = 763, + enum_ops_set_p_kc_n = 764, + enum_ops_set_p_k_nc = 765, + enum_ops_set_p_kc_nc = 766, + enum_ops_set_p_k_s = 767, + enum_ops_set_p_kc_s = 768, + enum_ops_set_p_k_sc = 769, + enum_ops_set_p_kc_sc = 770, + enum_ops_set_p_k_p = 771, + enum_ops_set_p_kc_p = 772, + enum_ops_set_i_p_k = 773, + enum_ops_set_i_p_kc = 774, + enum_ops_set_n_p_k = 775, + enum_ops_set_n_p_kc = 776, + enum_ops_set_s_p_k = 777, + enum_ops_set_s_p_kc = 778, + enum_ops_set_p_p_k = 779, + enum_ops_set_p_p_kc = 780, + enum_ops_clone_p_p = 781, + enum_ops_clone_p_p_p = 782, + enum_ops_clone_p_p_pc = 783, + enum_ops_copy_p_p = 784, + enum_ops_null_s = 785, + enum_ops_null_i = 786, + enum_ops_null_p = 787, + enum_ops_null_n = 788, + enum_ops_ord_i_s = 789, + enum_ops_ord_i_sc = 790, + enum_ops_ord_i_s_i = 791, + enum_ops_ord_i_sc_i = 792, + enum_ops_ord_i_s_ic = 793, + enum_ops_ord_i_sc_ic = 794, + enum_ops_chr_s_i = 795, + enum_ops_chr_s_ic = 796, + enum_ops_chopn_s_s_i = 797, + enum_ops_chopn_s_sc_i = 798, + enum_ops_chopn_s_s_ic = 799, + enum_ops_chopn_s_sc_ic = 800, + enum_ops_concat_p_p = 801, + enum_ops_concat_p_s = 802, + enum_ops_concat_p_sc = 803, + enum_ops_concat_s_s_s = 804, + enum_ops_concat_s_sc_s = 805, + enum_ops_concat_s_s_sc = 806, + enum_ops_concat_p_p_s = 807, + enum_ops_concat_p_p_sc = 808, + enum_ops_concat_p_p_p = 809, + enum_ops_repeat_s_s_i = 810, + enum_ops_repeat_s_sc_i = 811, + enum_ops_repeat_s_s_ic = 812, + enum_ops_repeat_s_sc_ic = 813, + enum_ops_repeat_p_p_i = 814, + enum_ops_repeat_p_p_ic = 815, + enum_ops_repeat_p_p_p = 816, + enum_ops_repeat_p_i = 817, + enum_ops_repeat_p_ic = 818, + enum_ops_repeat_p_p = 819, + enum_ops_length_i_s = 820, + enum_ops_length_i_sc = 821, + enum_ops_bytelength_i_s = 822, + enum_ops_bytelength_i_sc = 823, + enum_ops_pin_s = 824, + enum_ops_unpin_s = 825, + enum_ops_substr_s_s_i = 826, + enum_ops_substr_s_sc_i = 827, + enum_ops_substr_s_s_ic = 828, + enum_ops_substr_s_sc_ic = 829, + enum_ops_substr_s_s_i_i = 830, + enum_ops_substr_s_sc_i_i = 831, + enum_ops_substr_s_s_ic_i = 832, + enum_ops_substr_s_sc_ic_i = 833, + enum_ops_substr_s_s_i_ic = 834, + enum_ops_substr_s_sc_i_ic = 835, + enum_ops_substr_s_s_ic_ic = 836, + enum_ops_substr_s_sc_ic_ic = 837, + enum_ops_substr_s_p_i_i = 838, + enum_ops_substr_s_p_ic_i = 839, + enum_ops_substr_s_p_i_ic = 840, + enum_ops_substr_s_p_ic_ic = 841, + enum_ops_replace_s_s_i_i_s = 842, + enum_ops_replace_s_sc_i_i_s = 843, + enum_ops_replace_s_s_ic_i_s = 844, + enum_ops_replace_s_sc_ic_i_s = 845, + enum_ops_replace_s_s_i_ic_s = 846, + enum_ops_replace_s_sc_i_ic_s = 847, + enum_ops_replace_s_s_ic_ic_s = 848, + enum_ops_replace_s_sc_ic_ic_s = 849, + enum_ops_replace_s_s_i_i_sc = 850, + enum_ops_replace_s_sc_i_i_sc = 851, + enum_ops_replace_s_s_ic_i_sc = 852, + enum_ops_replace_s_sc_ic_i_sc = 853, + enum_ops_replace_s_s_i_ic_sc = 854, + enum_ops_replace_s_sc_i_ic_sc = 855, + enum_ops_replace_s_s_ic_ic_sc = 856, + enum_ops_replace_s_sc_ic_ic_sc = 857, + enum_ops_index_i_s_s = 858, + enum_ops_index_i_sc_s = 859, + enum_ops_index_i_s_sc = 860, + enum_ops_index_i_sc_sc = 861, + enum_ops_index_i_s_s_i = 862, + enum_ops_index_i_sc_s_i = 863, + enum_ops_index_i_s_sc_i = 864, + enum_ops_index_i_sc_sc_i = 865, + enum_ops_index_i_s_s_ic = 866, + enum_ops_index_i_sc_s_ic = 867, + enum_ops_index_i_s_sc_ic = 868, + enum_ops_index_i_sc_sc_ic = 869, + enum_ops_sprintf_s_s_p = 870, + enum_ops_sprintf_s_sc_p = 871, + enum_ops_sprintf_p_p_p = 872, + enum_ops_new_s = 873, + enum_ops_stringinfo_i_s_i = 874, + enum_ops_stringinfo_i_sc_i = 875, + enum_ops_stringinfo_i_s_ic = 876, + enum_ops_stringinfo_i_sc_ic = 877, + enum_ops_upcase_s_s = 878, + enum_ops_upcase_s_sc = 879, + enum_ops_downcase_s_s = 880, + enum_ops_downcase_s_sc = 881, + enum_ops_titlecase_s_s = 882, + enum_ops_titlecase_s_sc = 883, + enum_ops_join_s_s_p = 884, + enum_ops_join_s_sc_p = 885, + enum_ops_split_p_s_s = 886, + enum_ops_split_p_sc_s = 887, + enum_ops_split_p_s_sc = 888, + enum_ops_split_p_sc_sc = 889, + enum_ops_encoding_i_s = 890, + enum_ops_encoding_i_sc = 891, + enum_ops_encodingname_s_i = 892, + enum_ops_encodingname_s_ic = 893, + enum_ops_find_encoding_i_s = 894, + enum_ops_find_encoding_i_sc = 895, + enum_ops_trans_encoding_s_s_i = 896, + enum_ops_trans_encoding_s_sc_i = 897, + enum_ops_trans_encoding_s_s_ic = 898, + enum_ops_trans_encoding_s_sc_ic = 899, + enum_ops_is_cclass_i_i_s_i = 900, + enum_ops_is_cclass_i_ic_s_i = 901, + enum_ops_is_cclass_i_i_sc_i = 902, + enum_ops_is_cclass_i_ic_sc_i = 903, + enum_ops_is_cclass_i_i_s_ic = 904, + enum_ops_is_cclass_i_ic_s_ic = 905, + enum_ops_is_cclass_i_i_sc_ic = 906, + enum_ops_is_cclass_i_ic_sc_ic = 907, + enum_ops_find_cclass_i_i_s_i_i = 908, + enum_ops_find_cclass_i_ic_s_i_i = 909, + enum_ops_find_cclass_i_i_sc_i_i = 910, + enum_ops_find_cclass_i_ic_sc_i_i = 911, + enum_ops_find_cclass_i_i_s_ic_i = 912, + enum_ops_find_cclass_i_ic_s_ic_i = 913, + enum_ops_find_cclass_i_i_sc_ic_i = 914, + enum_ops_find_cclass_i_ic_sc_ic_i = 915, + enum_ops_find_cclass_i_i_s_i_ic = 916, + enum_ops_find_cclass_i_ic_s_i_ic = 917, + enum_ops_find_cclass_i_i_sc_i_ic = 918, + enum_ops_find_cclass_i_ic_sc_i_ic = 919, + enum_ops_find_cclass_i_i_s_ic_ic = 920, + enum_ops_find_cclass_i_ic_s_ic_ic = 921, + enum_ops_find_cclass_i_i_sc_ic_ic = 922, + enum_ops_find_cclass_i_ic_sc_ic_ic = 923, + enum_ops_find_not_cclass_i_i_s_i_i = 924, + enum_ops_find_not_cclass_i_ic_s_i_i = 925, + enum_ops_find_not_cclass_i_i_sc_i_i = 926, + enum_ops_find_not_cclass_i_ic_sc_i_i = 927, + enum_ops_find_not_cclass_i_i_s_ic_i = 928, + enum_ops_find_not_cclass_i_ic_s_ic_i = 929, + enum_ops_find_not_cclass_i_i_sc_ic_i = 930, + enum_ops_find_not_cclass_i_ic_sc_ic_i = 931, + enum_ops_find_not_cclass_i_i_s_i_ic = 932, + enum_ops_find_not_cclass_i_ic_s_i_ic = 933, + enum_ops_find_not_cclass_i_i_sc_i_ic = 934, + enum_ops_find_not_cclass_i_ic_sc_i_ic = 935, + enum_ops_find_not_cclass_i_i_s_ic_ic = 936, + enum_ops_find_not_cclass_i_ic_s_ic_ic = 937, + enum_ops_find_not_cclass_i_i_sc_ic_ic = 938, + enum_ops_find_not_cclass_i_ic_sc_ic_ic = 939, + enum_ops_escape_s_s = 940, + enum_ops_compose_s_s = 941, + enum_ops_compose_s_sc = 942, + enum_ops_find_codepoint_i_s = 943, + enum_ops_find_codepoint_i_sc = 944, + enum_ops_spawnw_i_s = 945, + enum_ops_spawnw_i_sc = 946, + enum_ops_spawnw_i_p = 947, + enum_ops_err_i = 948, + enum_ops_err_s = 949, + enum_ops_err_s_i = 950, + enum_ops_err_s_ic = 951, + enum_ops_time_i = 952, + enum_ops_time_n = 953, + enum_ops_sleep_i = 954, + enum_ops_sleep_ic = 955, + enum_ops_sleep_n = 956, + enum_ops_sleep_nc = 957, + enum_ops_store_lex_s_p = 958, + enum_ops_store_lex_sc_p = 959, + enum_ops_store_lex_s_s = 960, + enum_ops_store_lex_sc_s = 961, + enum_ops_store_lex_s_sc = 962, + enum_ops_store_lex_sc_sc = 963, + enum_ops_store_lex_s_i = 964, + enum_ops_store_lex_sc_i = 965, + enum_ops_store_lex_s_ic = 966, + enum_ops_store_lex_sc_ic = 967, + enum_ops_store_lex_s_n = 968, + enum_ops_store_lex_sc_n = 969, + enum_ops_store_lex_s_nc = 970, + enum_ops_store_lex_sc_nc = 971, + enum_ops_store_dynamic_lex_s_p = 972, + enum_ops_store_dynamic_lex_sc_p = 973, + enum_ops_find_lex_p_s = 974, + enum_ops_find_lex_p_sc = 975, + enum_ops_find_lex_s_s = 976, + enum_ops_find_lex_s_sc = 977, + enum_ops_find_lex_i_s = 978, + enum_ops_find_lex_i_sc = 979, + enum_ops_find_lex_n_s = 980, + enum_ops_find_lex_n_sc = 981, + enum_ops_find_dynamic_lex_p_s = 982, + enum_ops_find_dynamic_lex_p_sc = 983, + enum_ops_find_caller_lex_p_s = 984, + enum_ops_find_caller_lex_p_sc = 985, + enum_ops_get_namespace_p = 986, + enum_ops_get_namespace_p_p = 987, + enum_ops_get_namespace_p_pc = 988, + enum_ops_get_hll_namespace_p = 989, + enum_ops_get_hll_namespace_p_p = 990, + enum_ops_get_hll_namespace_p_pc = 991, + enum_ops_get_root_namespace_p = 992, + enum_ops_get_root_namespace_p_p = 993, + enum_ops_get_root_namespace_p_pc = 994, + enum_ops_get_global_p_s = 995, + enum_ops_get_global_p_sc = 996, + enum_ops_get_global_p_p_s = 997, + enum_ops_get_global_p_pc_s = 998, + enum_ops_get_global_p_p_sc = 999, + enum_ops_get_global_p_pc_sc = 1000, + enum_ops_get_hll_global_p_s = 1001, + enum_ops_get_hll_global_p_sc = 1002, + enum_ops_get_hll_global_p_p_s = 1003, + enum_ops_get_hll_global_p_pc_s = 1004, + enum_ops_get_hll_global_p_p_sc = 1005, + enum_ops_get_hll_global_p_pc_sc = 1006, + enum_ops_get_root_global_p_s = 1007, + enum_ops_get_root_global_p_sc = 1008, + enum_ops_get_root_global_p_p_s = 1009, + enum_ops_get_root_global_p_pc_s = 1010, + enum_ops_get_root_global_p_p_sc = 1011, + enum_ops_get_root_global_p_pc_sc = 1012, + enum_ops_set_global_s_p = 1013, + enum_ops_set_global_sc_p = 1014, + enum_ops_set_global_p_s_p = 1015, + enum_ops_set_global_pc_s_p = 1016, + enum_ops_set_global_p_sc_p = 1017, + enum_ops_set_global_pc_sc_p = 1018, + enum_ops_set_hll_global_s_p = 1019, + enum_ops_set_hll_global_sc_p = 1020, + enum_ops_set_hll_global_p_s_p = 1021, + enum_ops_set_hll_global_pc_s_p = 1022, + enum_ops_set_hll_global_p_sc_p = 1023, + enum_ops_set_hll_global_pc_sc_p = 1024, + enum_ops_set_root_global_s_p = 1025, + enum_ops_set_root_global_sc_p = 1026, + enum_ops_set_root_global_p_s_p = 1027, + enum_ops_set_root_global_pc_s_p = 1028, + enum_ops_set_root_global_p_sc_p = 1029, + enum_ops_set_root_global_pc_sc_p = 1030, + enum_ops_find_name_p_s = 1031, + enum_ops_find_name_p_sc = 1032, + enum_ops_find_sub_not_null_p_s = 1033, + enum_ops_find_sub_not_null_p_sc = 1034, + enum_ops_trap = 1035, + enum_ops_set_label_p_ic = 1036, + enum_ops_get_label_i_p = 1037, + enum_ops_get_id_i_p = 1038, + enum_ops_get_id_i_pc = 1039, + enum_ops_fetch_p_p_p_p = 1040, + enum_ops_fetch_p_pc_p_p = 1041, + enum_ops_fetch_p_p_pc_p = 1042, + enum_ops_fetch_p_pc_pc_p = 1043, + enum_ops_fetch_p_p_p_pc = 1044, + enum_ops_fetch_p_pc_p_pc = 1045, + enum_ops_fetch_p_p_pc_pc = 1046, + enum_ops_fetch_p_pc_pc_pc = 1047, + enum_ops_fetch_p_p_i_p = 1048, + enum_ops_fetch_p_pc_i_p = 1049, + enum_ops_fetch_p_p_ic_p = 1050, + enum_ops_fetch_p_pc_ic_p = 1051, + enum_ops_fetch_p_p_i_pc = 1052, + enum_ops_fetch_p_pc_i_pc = 1053, + enum_ops_fetch_p_p_ic_pc = 1054, + enum_ops_fetch_p_pc_ic_pc = 1055, + enum_ops_fetch_p_p_s_p = 1056, + enum_ops_fetch_p_pc_s_p = 1057, + enum_ops_fetch_p_p_sc_p = 1058, + enum_ops_fetch_p_pc_sc_p = 1059, + enum_ops_fetch_p_p_s_pc = 1060, + enum_ops_fetch_p_pc_s_pc = 1061, + enum_ops_fetch_p_p_sc_pc = 1062, + enum_ops_fetch_p_pc_sc_pc = 1063, + enum_ops_vivify_p_p_p_p = 1064, + enum_ops_vivify_p_pc_p_p = 1065, + enum_ops_vivify_p_p_pc_p = 1066, + enum_ops_vivify_p_pc_pc_p = 1067, + enum_ops_vivify_p_p_p_pc = 1068, + enum_ops_vivify_p_pc_p_pc = 1069, + enum_ops_vivify_p_p_pc_pc = 1070, + enum_ops_vivify_p_pc_pc_pc = 1071, + enum_ops_vivify_p_p_i_p = 1072, + enum_ops_vivify_p_pc_i_p = 1073, + enum_ops_vivify_p_p_ic_p = 1074, + enum_ops_vivify_p_pc_ic_p = 1075, + enum_ops_vivify_p_p_i_pc = 1076, + enum_ops_vivify_p_pc_i_pc = 1077, + enum_ops_vivify_p_p_ic_pc = 1078, + enum_ops_vivify_p_pc_ic_pc = 1079, + enum_ops_vivify_p_p_s_p = 1080, + enum_ops_vivify_p_pc_s_p = 1081, + enum_ops_vivify_p_p_sc_p = 1082, + enum_ops_vivify_p_pc_sc_p = 1083, + enum_ops_vivify_p_p_s_pc = 1084, + enum_ops_vivify_p_pc_s_pc = 1085, + enum_ops_vivify_p_p_sc_pc = 1086, + enum_ops_vivify_p_pc_sc_pc = 1087, + enum_ops_new_p_s_i = 1088, + enum_ops_new_p_sc_i = 1089, + enum_ops_new_p_s_ic = 1090, + enum_ops_new_p_sc_ic = 1091, + enum_ops_new_p_p_i = 1092, + enum_ops_new_p_pc_i = 1093, + enum_ops_new_p_p_ic = 1094, + enum_ops_new_p_pc_ic = 1095, + enum_ops_root_new_p_p_i = 1096, + enum_ops_root_new_p_pc_i = 1097, + enum_ops_root_new_p_p_ic = 1098, + enum_ops_root_new_p_pc_ic = 1099, + enum_ops_get_context_p = 1100, + enum_ops_new_call_context_p = 1101, + enum_ops_invokecc_p_p = 1102, + enum_ops_flatten_array_into_p_p_i = 1103, + enum_ops_flatten_array_into_p_p_ic = 1104, + enum_ops_flatten_hash_into_p_p_i = 1105, + enum_ops_flatten_hash_into_p_p_ic = 1106, + enum_ops_slurp_array_from_p_p_i = 1107, + enum_ops_slurp_array_from_p_p_ic = 1108, + enum_ops_receive_p = 1109, + enum_ops_wait_p = 1110, + enum_ops_wait_pc = 1111, + enum_ops_pass = 1112, }; diff --git a/include/parrot/packfile.h b/include/parrot/packfile.h index 0d0f033a59..23c9be290b 100644 --- a/include/parrot/packfile.h +++ b/include/parrot/packfile.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2001-2011, Parrot Foundation. + * Copyright (C) 2001-2012, Parrot Foundation. */ /* packfile.h @@ -168,6 +168,11 @@ typedef struct PackFile_Segment { typedef INTVAL (*PackFile_map_segments_func_t)(PARROT_INTERP, ARGMOD(PackFile_Segment *seg), ARGIN_NULLOK(void *user_data)); +typedef struct PackFile_ConstTagPair { + opcode_t tag_idx; + opcode_t const_idx; +} PackFile_ConstTagPair; + typedef struct PackFile_ConstTable { PackFile_Segment base; struct { @@ -182,9 +187,11 @@ typedef struct PackFile_ConstTable { opcode_t const_count; PMC **constants; } pmc; - PackFile_ByteCode *code; /* where this segment belongs to */ - Hash *string_hash; /* Hash for lookup of string indices */ - Hash *pmc_hash; /* Hash for lookup of pmc indices */ + PackFile_ByteCode *code; /* where this segment belongs to */ + Hash *string_hash; /* Hash for lookup of string indices */ + Hash *pmc_hash; /* Hash for lookup of pmc indices */ + PackFile_ConstTagPair *tag_map; /* n-m Mapping pmc constants to string tags */ + opcode_t ntags; /* Number of tags */ } PackFile_ConstTable; typedef struct PackFile_ByteCode_OpMappingEntry { @@ -280,6 +287,8 @@ typedef struct PackFile { PackFile_ByteCode *cur_cs; /* used during PF loading */ + PMC *view; /* cached PMC used to reference this packfile */ + INTVAL options; INTVAL need_wordsize; INTVAL need_endianize; @@ -299,21 +308,6 @@ typedef enum { } pbc_action_enum_t; -/* HEADERIZER BEGIN: src/packdump.c */ -/* Don't modify between HEADERIZER BEGIN / HEADERIZER END. Your changes will be lost. */ - -PARROT_EXPORT -void PackFile_ConstTable_dump(PARROT_INTERP, - ARGIN(const PackFile_ConstTable *self)) - __attribute__nonnull__(1) - __attribute__nonnull__(2); - -#define ASSERT_ARGS_PackFile_ConstTable_dump __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ - PARROT_ASSERT_ARG(interp) \ - , PARROT_ASSERT_ARG(self)) -/* Don't modify between HEADERIZER BEGIN / HEADERIZER END. Your changes will be lost. */ -/* HEADERIZER END: src/packdump.c */ - /* HEADERIZER BEGIN: src/packfile/pf_items.c */ /* Don't modify between HEADERIZER BEGIN / HEADERIZER END. Your changes will be lost. */ @@ -380,6 +374,7 @@ PARROT_CONST_FUNCTION size_t PF_size_number(void); PARROT_CONST_FUNCTION +PARROT_WARN_UNUSED_RESULT size_t PF_size_opcode(void); PARROT_PURE_FUNCTION @@ -563,14 +558,6 @@ PARROT_CANNOT_RETURN_NULL PackFile * PackFile_new(PARROT_INTERP, INTVAL is_mapped) __attribute__nonnull__(1); -PARROT_EXPORT -PARROT_CANNOT_RETURN_NULL -Parrot_PackFile PackFile_read_pbc(PARROT_INTERP, - ARGIN(STRING *fullname), - const int debug) - __attribute__nonnull__(1) - __attribute__nonnull__(2); - PARROT_EXPORT PARROT_WARN_UNUSED_RESULT opcode_t PackFile_unpack(PARROT_INTERP, @@ -601,10 +588,6 @@ STRING * Parrot_debug_pc_to_filename(PARROT_INTERP, __attribute__nonnull__(1) __attribute__nonnull__(2); -PARROT_EXPORT -void Parrot_destroy_constants(PARROT_INTERP) - __attribute__nonnull__(1); - PARROT_EXPORT void Parrot_load_bytecode(PARROT_INTERP, ARGIN_NULLOK(Parrot_String file_str)) @@ -659,7 +642,16 @@ void Parrot_pf_execute_bytecode_program(PARROT_INTERP, PARROT_EXPORT PARROT_CANNOT_RETURN_NULL -PMC * Parrot_pf_get_packfile_pmc(PARROT_INTERP, ARGIN(PackFile *pf)) +PMC * Parrot_pf_get_packfile_pmc(PARROT_INTERP, + ARGIN(PackFile *pf), + ARGIN(STRING *path)) + __attribute__nonnull__(1) + __attribute__nonnull__(2) + __attribute__nonnull__(3); + +PARROT_EXPORT +PARROT_CANNOT_RETURN_NULL +STRING * Parrot_pf_get_version_string(PARROT_INTERP, ARGIN(PMC * pbc)) __attribute__nonnull__(1) __attribute__nonnull__(2); @@ -700,9 +692,10 @@ STRING * Parrot_pf_serialize(PARROT_INTERP, ARGIN(PackFile * const pf)) __attribute__nonnull__(2); PARROT_EXPORT -INTVAL Parrot_pf_serialized_size(PARROT_INTERP, ARGIN(PackFile * pf)) +INTVAL Parrot_pf_serialized_size(PARROT_INTERP, ARGMOD(PackFile *pf)) __attribute__nonnull__(1) - __attribute__nonnull__(2); + __attribute__nonnull__(2) + FUNC_MODIFIES(*pf); PARROT_EXPORT void Parrot_pf_set_current_packfile(PARROT_INTERP, ARGIN(PMC *pbc)) @@ -711,7 +704,7 @@ void Parrot_pf_set_current_packfile(PARROT_INTERP, ARGIN(PMC *pbc)) PARROT_EXPORT PARROT_CANNOT_RETURN_NULL -PMC * Parrot_pf_subs_by_flag(PARROT_INTERP, +PMC * Parrot_pf_subs_by_tag(PARROT_INTERP, ARGIN(PMC * pfpmc), ARGIN(STRING * flag)) __attribute__nonnull__(1) @@ -735,16 +728,6 @@ PackFile_ByteCode * Parrot_switch_to_cs(PARROT_INTERP, __attribute__nonnull__(1) __attribute__nonnull__(2); -PARROT_EXPORT -PARROT_WARN_UNUSED_RESULT -PARROT_CANNOT_RETURN_NULL -PackFile_ByteCode * PF_create_default_segs(PARROT_INTERP, - ARGIN(STRING *file_name), - int add, - int set_def) - __attribute__nonnull__(1) - __attribute__nonnull__(2); - PARROT_CANNOT_RETURN_NULL PMC * PackFile_Annotations_lookup(PARROT_INTERP, ARGIN(PackFile_Annotations *self), @@ -772,6 +755,13 @@ void Parrot_pf_mark_packfile(PARROT_INTERP, ARGMOD_NULLOK(PackFile * pf)) __attribute__nonnull__(1) FUNC_MODIFIES(* pf); +void Parrot_pf_tag_constant(PARROT_INTERP, + ARGIN(PackFile_ConstTable *ct), + const int tag_idx, + const int const_idx) + __attribute__nonnull__(1) + __attribute__nonnull__(2); + #define ASSERT_ARGS_do_sub_pragmas __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ PARROT_ASSERT_ARG(interp) \ , PARROT_ASSERT_ARG(pfpmc)) @@ -796,9 +786,6 @@ void Parrot_pf_mark_packfile(PARROT_INTERP, ARGMOD_NULLOK(PackFile * pf)) , PARROT_ASSERT_ARG(dir)) #define ASSERT_ARGS_PackFile_new __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ PARROT_ASSERT_ARG(interp)) -#define ASSERT_ARGS_PackFile_read_pbc __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ - PARROT_ASSERT_ARG(interp) \ - , PARROT_ASSERT_ARG(fullname)) #define ASSERT_ARGS_PackFile_unpack __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ PARROT_ASSERT_ARG(interp) \ , PARROT_ASSERT_ARG(self) \ @@ -810,8 +797,6 @@ void Parrot_pf_mark_packfile(PARROT_INTERP, ARGMOD_NULLOK(PackFile * pf)) #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 = (\ @@ -837,7 +822,11 @@ void Parrot_pf_mark_packfile(PARROT_INTERP, ARGMOD_NULLOK(PackFile * pf)) , PARROT_ASSERT_ARG(args)) #define ASSERT_ARGS_Parrot_pf_get_packfile_pmc __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ PARROT_ASSERT_ARG(interp) \ - , PARROT_ASSERT_ARG(pf)) + , PARROT_ASSERT_ARG(pf) \ + , PARROT_ASSERT_ARG(path)) +#define ASSERT_ARGS_Parrot_pf_get_version_string __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ + PARROT_ASSERT_ARG(interp) \ + , PARROT_ASSERT_ARG(pbc)) #define ASSERT_ARGS_Parrot_pf_load_bytecode_search \ __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ PARROT_ASSERT_ARG(interp) \ @@ -864,7 +853,7 @@ void Parrot_pf_mark_packfile(PARROT_INTERP, ARGMOD_NULLOK(PackFile * pf)) __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ PARROT_ASSERT_ARG(interp) \ , PARROT_ASSERT_ARG(pbc)) -#define ASSERT_ARGS_Parrot_pf_subs_by_flag __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ +#define ASSERT_ARGS_Parrot_pf_subs_by_tag __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ PARROT_ASSERT_ARG(interp) \ , PARROT_ASSERT_ARG(pfpmc) \ , PARROT_ASSERT_ARG(flag)) @@ -875,9 +864,6 @@ void Parrot_pf_mark_packfile(PARROT_INTERP, ARGMOD_NULLOK(PackFile * pf)) #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_PF_create_default_segs __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ - PARROT_ASSERT_ARG(interp) \ - , PARROT_ASSERT_ARG(file_name)) #define ASSERT_ARGS_PackFile_Annotations_lookup __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ PARROT_ASSERT_ARG(interp) \ , PARROT_ASSERT_ARG(self)) @@ -893,6 +879,9 @@ void Parrot_pf_mark_packfile(PARROT_INTERP, ARGMOD_NULLOK(PackFile * pf)) , PARROT_ASSERT_ARG(pbc)) #define ASSERT_ARGS_Parrot_pf_mark_packfile __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ PARROT_ASSERT_ARG(interp)) +#define ASSERT_ARGS_Parrot_pf_tag_constant __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ + PARROT_ASSERT_ARG(interp) \ + , PARROT_ASSERT_ARG(ct)) /* Don't modify between HEADERIZER BEGIN / HEADERIZER END. Your changes will be lost. */ /* HEADERIZER END: src/packfile/api.c */ @@ -1035,7 +1024,8 @@ void PackFile_Segment_destroy(PARROT_INTERP, ARGMOD(PackFile_Segment *self)) FUNC_MODIFIES(*self); PARROT_EXPORT -void PackFile_Segment_dump(PARROT_INTERP, ARGIN(PackFile_Segment *self)) +void PackFile_Segment_dump(PARROT_INTERP, + ARGIN(const PackFile_Segment *self)) __attribute__nonnull__(1) __attribute__nonnull__(2); diff --git a/include/parrot/parrot.h b/include/parrot/parrot.h index 378a4b25bc..5129f9e02b 100644 --- a/include/parrot/parrot.h +++ b/include/parrot/parrot.h @@ -53,6 +53,11 @@ # include #endif /* PARROT_HAS_HEADER_UNISTD */ +#ifdef PARROT_HAS_HEADER_PROCESS +# include +# define getpid _getpid +#endif /* PARROT_HAS_HEADER_PROCESS */ + #ifdef PARROT_HAS_HEADER_SYSMMAN # include # ifndef MAP_FAILED @@ -257,7 +262,6 @@ typedef struct PackFile_ByteCode PackFile_ByteCode; #include "parrot/key.h" #include "parrot/exit.h" #include "parrot/nci.h" -#include "parrot/thread.h" #include "parrot/scheduler.h" #include "parrot/oo.h" #include "parrot/vtables.h" @@ -266,6 +270,7 @@ typedef struct PackFile_ByteCode PackFile_ByteCode; #include "parrot/namespace.h" #include "parrot/hll.h" #include "parrot/pbcversion.h" +#include "parrot/disassemble.h" #endif /* PARROT_PARROT_H_GUARD */ diff --git a/include/parrot/platform_interface.h b/include/parrot/platform_interface.h index 517f61203c..5cfa350b77 100644 --- a/include/parrot/platform_interface.h +++ b/include/parrot/platform_interface.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2003-2010, Parrot Foundation. + * Copyright (C) 2003-2011, Parrot Foundation. */ #ifndef PARROT_PLATFORM_INTERFACE_H_GUARD @@ -78,6 +78,7 @@ PIOHANDLE Parrot_io_open(PARROT_INTERP, ARGIN(STRING *path), INTVAL flags); PIOHANDLE Parrot_io_dup(PARROT_INTERP, PIOHANDLE handle); INTVAL Parrot_io_close(PARROT_INTERP, PIOHANDLE handle); INTVAL Parrot_io_is_tty(PARROT_INTERP, PIOHANDLE fd); +PARROT_CONST_FUNCTION INTVAL Parrot_io_getblksize(PIOHANDLE fd); INTVAL Parrot_io_flush(PARROT_INTERP, PIOHANDLE os_handle); size_t Parrot_io_read(PARROT_INTERP, PIOHANDLE os_handle, ARGOUT(char *buf), size_t len); @@ -88,6 +89,9 @@ PIOHANDLE Parrot_io_open_pipe(PARROT_INTERP, ARGIN(STRING *command), INTVAL flag ARGOUT(INTVAL *pid_out)); INTVAL Parrot_io_pipe(PARROT_INTERP, ARGMOD(PIOHANDLE *reader), ARGMOD(PIOHANDLE *writer)); +PARROT_EXPORT +INTVAL Parrot_io_async(PARROT_INTERP, ARGMOD(PMC *pmc), INTVAL async); + /* * Socket */ @@ -293,6 +297,7 @@ void Parrot_sleep(unsigned int seconds); PARROT_EXPORT void Parrot_usleep(unsigned int microseconds); +void Parrot_floatval_sleep(FLOATVAL time); PARROT_EXPORT INTVAL Parrot_intval_time(void); @@ -383,6 +388,7 @@ PARROT_EXPORT UHUGEINTVAL Parrot_hires_get_time(void); PARROT_EXPORT +PARROT_CONST_FUNCTION UINTVAL Parrot_hires_get_tick_duration(void); /* diff --git a/include/parrot/pmc.h b/include/parrot/pmc.h index 62aac33b7e..37c9bccfac 100644 --- a/include/parrot/pmc.h +++ b/include/parrot/pmc.h @@ -13,7 +13,6 @@ #include "parrot/core_pmcs.h" #include "parrot/pobj.h" -#include "parrot/thread.h" #define PARROT_MAX_CLASSES 100 @@ -50,6 +49,12 @@ PARROT_EXPORT void Parrot_pmc_create_mro(PARROT_INTERP, INTVAL type) __attribute__nonnull__(1); +PARROT_EXPORT +void Parrot_pmc_delprop(PARROT_INTERP, ARGIN(PMC *pmc), ARGIN(STRING *key)) + __attribute__nonnull__(1) + __attribute__nonnull__(2) + __attribute__nonnull__(3); + PARROT_EXPORT void Parrot_pmc_destroy(PARROT_INTERP, ARGMOD(PMC *pmc)) __attribute__nonnull__(1) @@ -76,6 +81,19 @@ PARROT_WARN_UNUSED_RESULT INTVAL Parrot_pmc_get_type_str(PARROT_INTERP, ARGIN_NULLOK(STRING *name)) __attribute__nonnull__(1); +PARROT_EXPORT +PARROT_CAN_RETURN_NULL +PMC * Parrot_pmc_getprop(PARROT_INTERP, ARGIN(PMC *pmc), ARGIN(STRING *key)) + __attribute__nonnull__(1) + __attribute__nonnull__(2) + __attribute__nonnull__(3); + +PARROT_EXPORT +PARROT_CAN_RETURN_NULL +PMC * Parrot_pmc_getprops(PARROT_INTERP, ARGIN(PMC *pmc)) + __attribute__nonnull__(1) + __attribute__nonnull__(2); + PARROT_EXPORT PARROT_PURE_FUNCTION PARROT_WARN_UNUSED_RESULT @@ -88,31 +106,6 @@ PARROT_WARN_UNUSED_RESULT PMC * Parrot_pmc_new(PARROT_INTERP, INTVAL base_type) __attribute__nonnull__(1); -PARROT_EXPORT -PARROT_CANNOT_RETURN_NULL -PMC * Parrot_pmc_new_constant(PARROT_INTERP, INTVAL base_type) - __attribute__nonnull__(1); - -PARROT_EXPORT -PARROT_CANNOT_RETURN_NULL -PMC * Parrot_pmc_new_constant_init(PARROT_INTERP, - INTVAL base_type, - ARGIN_NULLOK(PMC *init)) - __attribute__nonnull__(1); - -PARROT_EXPORT -PARROT_CANNOT_RETURN_NULL -PMC * Parrot_pmc_new_constant_init_int(PARROT_INTERP, - INTVAL base_type, - INTVAL init) - __attribute__nonnull__(1); - -PARROT_EXPORT -PARROT_CANNOT_RETURN_NULL -PARROT_WARN_UNUSED_RESULT -PMC * Parrot_pmc_new_constant_noinit(PARROT_INTERP, INTVAL base_type) - __attribute__nonnull__(1); - PARROT_EXPORT PARROT_CANNOT_RETURN_NULL PARROT_WARN_UNUSED_RESULT @@ -139,6 +132,11 @@ PARROT_CANNOT_RETURN_NULL PMC * Parrot_pmc_new_noinit(PARROT_INTERP, INTVAL base_type) __attribute__nonnull__(1); +PARROT_EXPORT +PARROT_PURE_FUNCTION +PARROT_CAN_RETURN_NULL +Parrot_PMC Parrot_pmc_null(void); + PARROT_EXPORT INTVAL Parrot_pmc_register_new_type(PARROT_INTERP, ARGIN(STRING *name)) __attribute__nonnull__(1) @@ -180,6 +178,16 @@ PMC * Parrot_pmc_reuse_init(PARROT_INTERP, __attribute__nonnull__(4) FUNC_MODIFIES(*pmc); +PARROT_EXPORT +void Parrot_pmc_setprop(PARROT_INTERP, + ARGIN(PMC *pmc), + ARGIN(STRING *key), + ARGIN(PMC *value)) + __attribute__nonnull__(1) + __attribute__nonnull__(2) + __attribute__nonnull__(3) + __attribute__nonnull__(4); + void Parrot_pmc_free_temporary(PARROT_INTERP, ARGMOD(PMC *pmc)) __attribute__nonnull__(1) __attribute__nonnull__(2) @@ -209,6 +217,10 @@ INTVAL Parrot_pmc_type_does(PARROT_INTERP, PARROT_ASSERT_ARG(interp)) #define ASSERT_ARGS_Parrot_pmc_create_mro __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ PARROT_ASSERT_ARG(interp)) +#define ASSERT_ARGS_Parrot_pmc_delprop __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ + PARROT_ASSERT_ARG(interp) \ + , PARROT_ASSERT_ARG(pmc) \ + , PARROT_ASSERT_ARG(key)) #define ASSERT_ARGS_Parrot_pmc_destroy __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ PARROT_ASSERT_ARG(interp) \ , PARROT_ASSERT_ARG(pmc)) @@ -223,19 +235,16 @@ INTVAL Parrot_pmc_type_does(PARROT_INTERP, , PARROT_ASSERT_ARG(name)) #define ASSERT_ARGS_Parrot_pmc_get_type_str __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ PARROT_ASSERT_ARG(interp)) +#define ASSERT_ARGS_Parrot_pmc_getprop __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ + PARROT_ASSERT_ARG(interp) \ + , PARROT_ASSERT_ARG(pmc) \ + , PARROT_ASSERT_ARG(key)) +#define ASSERT_ARGS_Parrot_pmc_getprops __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ + PARROT_ASSERT_ARG(interp) \ + , PARROT_ASSERT_ARG(pmc)) #define ASSERT_ARGS_Parrot_pmc_is_null __attribute__unused__ int _ASSERT_ARGS_CHECK = (0) #define ASSERT_ARGS_Parrot_pmc_new __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ PARROT_ASSERT_ARG(interp)) -#define ASSERT_ARGS_Parrot_pmc_new_constant __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ - PARROT_ASSERT_ARG(interp)) -#define ASSERT_ARGS_Parrot_pmc_new_constant_init __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ - PARROT_ASSERT_ARG(interp)) -#define ASSERT_ARGS_Parrot_pmc_new_constant_init_int \ - __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ - PARROT_ASSERT_ARG(interp)) -#define ASSERT_ARGS_Parrot_pmc_new_constant_noinit \ - __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ - PARROT_ASSERT_ARG(interp)) #define ASSERT_ARGS_Parrot_pmc_new_from_type __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ PARROT_ASSERT_ARG(interp) \ , PARROT_ASSERT_ARG(key)) @@ -246,6 +255,7 @@ INTVAL Parrot_pmc_type_does(PARROT_INTERP, PARROT_ASSERT_ARG(interp)) #define ASSERT_ARGS_Parrot_pmc_new_noinit __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_register_new_type __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ PARROT_ASSERT_ARG(interp) \ , PARROT_ASSERT_ARG(name)) @@ -260,6 +270,11 @@ INTVAL Parrot_pmc_type_does(PARROT_INTERP, PARROT_ASSERT_ARG(interp) \ , PARROT_ASSERT_ARG(pmc) \ , PARROT_ASSERT_ARG(init)) +#define ASSERT_ARGS_Parrot_pmc_setprop __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ + PARROT_ASSERT_ARG(interp) \ + , PARROT_ASSERT_ARG(pmc) \ + , PARROT_ASSERT_ARG(key) \ + , PARROT_ASSERT_ARG(value)) #define ASSERT_ARGS_Parrot_pmc_free_temporary __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ PARROT_ASSERT_ARG(interp) \ , PARROT_ASSERT_ARG(pmc)) @@ -274,24 +289,6 @@ INTVAL Parrot_pmc_type_does(PARROT_INTERP, /* Don't modify between HEADERIZER BEGIN / HEADERIZER END. Your changes will be lost. */ /* HEADERIZER END: src/pmc.c */ -/* Allows compatibility with old name (see r44190) */ -#define Parrot_create_mro Parrot_pmc_create_mro -#define PMC_is_null Parrot_pmc_is_null -#define constant_pmc_new Parrot_pmc_new_constant -#define constant_pmc_new_init Parrot_pmc_new_constant_init -#define gc_register_pmc Parrot_pmc_gc_register -#define gc_unregister_pmc Parrot_pmc_gc_unregister -#define pmc_new Parrot_pmc_new -#define pmc_new_init Parrot_pmc_new_init -#define pmc_new_noinit Parrot_pmc_new_noinit -#define pmc_register Parrot_pmc_register_new_type -#define pmc_reuse Parrot_pmc_reuse -#define pmc_reuse_by_class Parrot_pmc_reuse_by_class -#define pmc_reuse_init Parrot_pmc_reuse_init -#define pmc_reuse_no_init Parrot_pmc_reuse_noinit -#define pmc_type Parrot_pmc_get_type_str -#define pmc_type_p Parrot_pmc_get_type - #define PMC_IS_TYPE(p, t) ((p)->vtable->base_type == enum_class_ ## t) #define PMC_IS_TYPE_ENUM(p, e) ((p)->vtable->base_type == (e)) diff --git a/include/parrot/pobj.h b/include/parrot/pobj.h index eedfc2bbf2..b7b4839681 100644 --- a/include/parrot/pobj.h +++ b/include/parrot/pobj.h @@ -27,7 +27,7 @@ typedef struct buffer_t { void * _bufstart; /* Pointer to start of buffer data (not buffer prolog). */ size_t _buflen; /* Length of buffer data. */ -} Buffer; +} Parrot_Buffer; typedef enum Forward_flag { Buffer_moved_FLAG = 1 << 0, diff --git a/include/parrot/pointer_array.h b/include/parrot/pointer_array.h index 94fc8834c0..29d68ab81b 100644 --- a/include/parrot/pointer_array.h +++ b/include/parrot/pointer_array.h @@ -1,5 +1,5 @@ /* -Copyright (C) 2010-2011, Parrot Foundation. +Copyright (C) 2010-2012, Parrot Foundation. =head1 NAME @@ -19,6 +19,8 @@ Lower bit in cell masked to indicate pointer-to-free-cell. #ifndef PARROT_POINTER_ARRAY_H_GUARD #define PARROT_POINTER_ARRAY_H_GUARD +#include + /* Calculate size of chunk data "header" */ #define CHUNK_SIZE 4096 #define CELL_PER_CHUNK ((CHUNK_SIZE - 2 * sizeof(size_t)) / sizeof (void *)) @@ -65,43 +67,12 @@ Inline functions for faster access. */ -#define ASSERT_ARGS_allocate_more_chunks __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ - PARROT_ASSERT_ARG(interp) \ - , PARROT_ASSERT_ARG(self)) /* =over 4 -=item C - -allocate more chunks - -=cut - -*/ - -static -PARROT_INLINE -void -allocate_more_chunks(PARROT_INTERP, ARGIN(Parrot_Pointer_Array *self)) -{ - ASSERT_ARGS(allocate_more_chunks) - - self->current_chunk = self->total_chunks++; - mem_realloc_n_typed(self->chunks, - self->total_chunks, - Parrot_Pointer_Array_Chunk*); - self->chunks[self->current_chunk] = mem_allocate_typed(Parrot_Pointer_Array_Chunk); - self->chunks[self->current_chunk]->num_free = CELL_PER_CHUNK; - self->chunks[self->current_chunk]->next_free = 0; -} - -/* - -=item C +=item C Insert pointer into the array. @@ -112,36 +83,42 @@ Insert pointer into the array. static PARROT_INLINE void * -Parrot_pa_insert(PARROT_INTERP, ARGIN(Parrot_Pointer_Array *self), ARGIN(void *ptr)) +Parrot_pa_insert(ARGMOD(Parrot_Pointer_Array *self), ARGIN(void *ptr)) { - Parrot_Pointer_Array_Chunk *chunk; - void *ret; - - /* If there is no free chunks */ - if (self->current_chunk >= self->total_chunks) - allocate_more_chunks(interp, self); + void *ret; /* Reuse removed cell */ if (self->next_free) { /* FIXME. Cast to UINTVAL is wrong. */ /* We have to provide parrot version of uintptr_t due lack of it in C89 */ - /* See TT #1855 */ + /* See GH #378 */ void **next = (void**)((UINTVAL)*self->next_free & ~1); ret = self->next_free; *self->next_free = ptr; self->next_free = next; - return ret; } - - if (!self->chunks[self->current_chunk]->num_free) - allocate_more_chunks(interp, self); - - chunk = self->chunks[self->current_chunk]; - --chunk->num_free; - /* Invariant: all chunks after chunk->next_free are free */ - /* We handle previously freed chunks early */ - ret = &chunk->data[chunk->next_free]; - chunk->data[chunk->next_free++] = ptr; + else { + Parrot_Pointer_Array_Chunk *chunk; + + /* If there is no free chunks */ + if (self->current_chunk >= self->total_chunks + || !self->chunks[self->current_chunk]->num_free) { + self->current_chunk = self->total_chunks++; + mem_internal_realloc_n_typed(self->chunks, + self->total_chunks, + Parrot_Pointer_Array_Chunk*); + self->chunks[self->current_chunk] = mem_internal_allocate_typed(Parrot_Pointer_Array_Chunk); + self->chunks[self->current_chunk]->num_free = CELL_PER_CHUNK; + self->chunks[self->current_chunk]->next_free = 0; + } + + chunk = self->chunks[self->current_chunk]; + --chunk->num_free; + /* Invariant: all chunks after chunk->next_free are free */ + /* We handle previously freed chunks early */ + ret = &chunk->data[chunk->next_free]; + chunk->data[chunk->next_free++] = ptr; + } return ret; } @@ -177,13 +154,13 @@ void Parrot_pa_destroy(PARROT_INTERP, ARGFREE(Parrot_Pointer_Array *self)) __attribute__nonnull__(1); PARROT_EXPORT -int Parrot_pa_is_owned(PARROT_INTERP, - ARGIN(Parrot_Pointer_Array *self), - ARGIN(void *orig), - ARGIN_NULLOK(void *ref)) +PARROT_WARN_UNUSED_RESULT +int Parrot_pa_is_owned( + ARGIN(const Parrot_Pointer_Array *self), + ARGIN(const void *orig), + ARGIN_NULLOK(const void *ref)) __attribute__nonnull__(1) - __attribute__nonnull__(2) - __attribute__nonnull__(3); + __attribute__nonnull__(2); PARROT_EXPORT PARROT_MALLOC @@ -207,8 +184,7 @@ size_t Parrot_pa_count_used(PARROT_INTERP, #define ASSERT_ARGS_Parrot_pa_destroy __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ PARROT_ASSERT_ARG(interp)) #define ASSERT_ARGS_Parrot_pa_is_owned __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ - PARROT_ASSERT_ARG(interp) \ - , PARROT_ASSERT_ARG(self) \ + PARROT_ASSERT_ARG(self) \ , PARROT_ASSERT_ARG(orig)) #define ASSERT_ARGS_Parrot_pa_new __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ PARROT_ASSERT_ARG(interp)) diff --git a/include/parrot/runcore_api.h b/include/parrot/runcore_api.h index f4332939e2..fad7e946ea 100644 --- a/include/parrot/runcore_api.h +++ b/include/parrot/runcore_api.h @@ -52,17 +52,17 @@ typedef enum Parrot_runcore_flags { /* HEADERIZER BEGIN: src/runcore/main.c */ /* Don't modify between HEADERIZER BEGIN / HEADERIZER END. Your changes will be lost. */ -PARROT_EXPORT -void disable_event_checking(PARROT_INTERP) - __attribute__nonnull__(1); - PARROT_EXPORT void dynop_register(PARROT_INTERP, ARGIN(PMC *lib_pmc)) __attribute__nonnull__(1) __attribute__nonnull__(2); PARROT_EXPORT -void enable_event_checking(PARROT_INTERP) +void Parrot_runcore_disable_event_checking(PARROT_INTERP) + __attribute__nonnull__(1); + +PARROT_EXPORT +void Parrot_runcore_enable_event_checking(PARROT_INTERP) __attribute__nonnull__(1); PARROT_EXPORT @@ -92,12 +92,14 @@ void prepare_for_run(PARROT_INTERP) 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_dynop_register __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ PARROT_ASSERT_ARG(interp) \ , PARROT_ASSERT_ARG(lib_pmc)) -#define ASSERT_ARGS_enable_event_checking __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ +#define ASSERT_ARGS_Parrot_runcore_disable_event_checking \ + __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ + PARROT_ASSERT_ARG(interp)) +#define ASSERT_ARGS_Parrot_runcore_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) \ diff --git a/include/parrot/runcore_profiling.h b/include/parrot/runcore_profiling.h index 55ff4b1ccf..949a0a5a81 100644 --- a/include/parrot/runcore_profiling.h +++ b/include/parrot/runcore_profiling.h @@ -1,5 +1,5 @@ -/* runcore_api.h - * Copyright (C) 2001-2009, Parrot Foundation. +/* runcore_profiling.h + * Copyright (C) 2001-2012, Parrot Foundation. * Overview: * Functions and macros to dispatch opcodes. */ diff --git a/include/parrot/runcore_subprof.h b/include/parrot/runcore_subprof.h new file mode 100644 index 0000000000..d33a3586ba --- /dev/null +++ b/include/parrot/runcore_subprof.h @@ -0,0 +1,136 @@ +/* runcore_subprof.h + * Copyright (C) 2001-2012, Parrot Foundation. + * Overview: + * Functions and macros to dispatch opcodes. + */ + +#ifndef PARROT_RUNCORE_SUBPROF_H_GUARD +#define PARROT_RUNCORE_SUBPROF_H_GUARD + + +#include "pmc/pmc_sub.h" + +typedef struct subprofile subprofile; +typedef struct callinfo callinfo; +typedef struct lineinfo lineinfo; +typedef struct subprofiledata subprofiledata; +typedef struct subprof_runcore_t Parrot_subprof_runcore_t; + +struct callinfo { + /* which sub we called */ + subprofile *callee; + /* how often it was called */ + UINTVAL count; + /* how many ops where executed in it (including subcalls) */ + UINTVAL ops; + /* how many ticks where spent in it (including subcalls) */ + UHUGEINTVAL ticks; +}; + +struct lineinfo { + /* start op of this line */ + size_t op_offs; + /* calls made from this line */ + callinfo *calls; + /* number of ops executed in this line */ + UINTVAL ops; + /* number of CPU ticks spent in this line */ + UHUGEINTVAL ticks; +}; + +struct subprofile { + /* next subprofile according to recursion */ + subprofile *rnext; + /* recursion level of this subprofile */ + int rcnt; + + /* the Sub PMC being profiled by this subprofile* */ + PMC *subpmc; + /* the ATTRs of subpmc */ + Parrot_Sub_attributes *subattrs; + /* first op of segment */ + opcode_t *code_ops; + + INTVAL srcline; + char *srcfile; + + lineinfo *lines; + int nlines; + + /* call chain info */ + /* which sub called us */ + subprofile *caller; + /* where the call was done */ + callinfo *callerci; + /* the active Context for the Sub being profiled */ + PMC *ctx; + + /* ops/ticks we need to distribute to the caller */ + UINTVAL callerops; + UHUGEINTVAL callerticks; +}; + +#define SUBPROF_TYPE_SUB 1 +#define SUBPROF_TYPE_HLL 2 +#define SUBPROF_TYPE_OPS 3 + +struct subprofiledata { + /* the interpreter we're profiling */ + Interp *interp; + /* type of profile */ + int profile_type; + /* the collected data, maps subpmc -> subprofile */ + Hash *sphash; + /* all the pmcs we have to mark */ + PMC *markpmcs; + + /* the root call data */ + lineinfo rootline; + + /* maps to expanded debug data */ + Hash *seg2debug; + + /* the current context */ + PMC *cursubpmc; + PMC *curctx; + subprofile *cursp; + + /* ticks are added at the end of the op */ + UHUGEINTVAL *tickadd; + UHUGEINTVAL *tickadd2; + UHUGEINTVAL starttick; +}; + +struct subprof_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; + + subprofiledata *spdata; +}; + + + +/* HEADERIZER BEGIN: src/runcore/subprof.c */ +/* Don't modify between HEADERIZER BEGIN / HEADERIZER END. Your changes will be lost. */ + +void Parrot_runcore_subprof_init(PARROT_INTERP) + __attribute__nonnull__(1); + +#define ASSERT_ARGS_Parrot_runcore_subprof_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/subprof.c */ + +#endif /* PARROT_RUNCORE_SUBPROF_H_GUARD */ + +/* + * Local variables: + * c-file-style: "parrot" + * End: + * vim: expandtab shiftwidth=4 cinoptions='\:2=2' : + */ diff --git a/include/parrot/scheduler.h b/include/parrot/scheduler.h index 187e2c7854..779b6051b1 100644 --- a/include/parrot/scheduler.h +++ b/include/parrot/scheduler.h @@ -13,241 +13,166 @@ #include "parrot/parrot.h" +#define PARROT_TASK_SWITCH_QUANTUM 0.02 + /* HEADERIZER BEGIN: src/scheduler.c */ /* Don't modify between HEADERIZER BEGIN / HEADERIZER END. Your changes will be lost. */ PARROT_EXPORT -void Parrot_cx_add_handler(PARROT_INTERP, ARGIN(PMC *handler)) +void Parrot_cx_begin_execution(PARROT_INTERP, + ARGIN(PMC *main), + ARGIN(PMC *argv)) __attribute__nonnull__(1) - __attribute__nonnull__(2); - -PARROT_EXPORT -void Parrot_cx_add_handler_local(PARROT_INTERP, ARGIN(PMC *handler)) - __attribute__nonnull__(1) - __attribute__nonnull__(2); + __attribute__nonnull__(2) + __attribute__nonnull__(3); PARROT_EXPORT -void Parrot_cx_broadcast_message(PARROT_INTERP, - ARGIN(STRING *messagetype), - ARGIN_NULLOK(PMC *data)) +void Parrot_cx_check_alarms(PARROT_INTERP, ARGIN(PMC *scheduler)) __attribute__nonnull__(1) __attribute__nonnull__(2); +PARROT_CANNOT_RETURN_NULL PARROT_EXPORT -INTVAL Parrot_cx_count_handlers_local(PARROT_INTERP, - ARGIN(STRING *handler_type)) +opcode_t* Parrot_cx_run_scheduler(PARROT_INTERP, + ARGIN(PMC *scheduler), + ARGIN(opcode_t *next)) __attribute__nonnull__(1) - __attribute__nonnull__(2); + __attribute__nonnull__(2) + __attribute__nonnull__(3); PARROT_EXPORT -INTVAL Parrot_cx_count_handlers_typed(PARROT_INTERP, - ARGIN(STRING *handler_type)) +void Parrot_cx_schedule_immediate(PARROT_INTERP, ARGIN(PMC *task_or_sub)) __attribute__nonnull__(1) __attribute__nonnull__(2); PARROT_EXPORT -void Parrot_cx_delete_handler_local(PARROT_INTERP, - ARGIN_NULLOK(STRING *handler_type)) +PARROT_WARN_UNUSED_RESULT +PARROT_CAN_RETURN_NULL +opcode_t * Parrot_cx_schedule_sleep(PARROT_INTERP, + FLOATVAL time, + ARGIN_NULLOK(opcode_t *next)) __attribute__nonnull__(1); PARROT_EXPORT -void Parrot_cx_delete_handler_typed(PARROT_INTERP, - ARGIN(STRING *handler_type)) +void Parrot_cx_schedule_task(PARROT_INTERP, ARGIN(PMC *task_or_sub)) __attribute__nonnull__(1) __attribute__nonnull__(2); PARROT_EXPORT -PARROT_CAN_RETURN_NULL -PMC * Parrot_cx_delete_suspend_for_gc(PARROT_INTERP) - __attribute__nonnull__(1); - -PARROT_EXPORT -void Parrot_cx_delete_task(PARROT_INTERP, ARGIN(PMC *task)) +void Parrot_cx_send_message(PARROT_INTERP, + ARGIN(STRING *messagetype), + ARGIN(PMC *payload)) __attribute__nonnull__(1) - __attribute__nonnull__(2); + __attribute__nonnull__(2) + __attribute__nonnull__(3); PARROT_EXPORT -PARROT_CAN_RETURN_NULL -PMC * Parrot_cx_find_handler_for_task(PARROT_INTERP, ARGIN(PMC *task)) +PARROT_CANNOT_RETURN_NULL +PMC* Parrot_cx_stop_task(PARROT_INTERP, ARGIN(opcode_t *next)) __attribute__nonnull__(1) __attribute__nonnull__(2); -PARROT_EXPORT -PARROT_CAN_RETURN_NULL -PMC * Parrot_cx_find_handler_local(PARROT_INTERP, ARGIN(PMC *task)) +void Parrot_cx_check_quantum(PARROT_INTERP, ARGIN(PMC *scheduler)) __attribute__nonnull__(1) __attribute__nonnull__(2); -PARROT_EXPORT -void Parrot_cx_handle_tasks(PARROT_INTERP, ARGMOD(PMC *scheduler)) +PARROT_CANNOT_RETURN_NULL +opcode_t* Parrot_cx_check_scheduler(PARROT_INTERP, ARGIN(opcode_t *next)) __attribute__nonnull__(1) - __attribute__nonnull__(2) - FUNC_MODIFIES(*scheduler); - -PARROT_EXPORT -PARROT_CAN_RETURN_NULL -PMC * Parrot_cx_peek_task(PARROT_INTERP) - __attribute__nonnull__(1); - -PARROT_EXPORT -void Parrot_cx_request_suspend_for_gc(PARROT_INTERP) - __attribute__nonnull__(1); + __attribute__nonnull__(2); -PARROT_EXPORT -void Parrot_cx_runloop_end(PARROT_INTERP) +PARROT_CANNOT_RETURN_NULL +PARROT_PURE_FUNCTION +PMC* Parrot_cx_current_task(PARROT_INTERP) __attribute__nonnull__(1); -PARROT_EXPORT -void Parrot_cx_schedule_callback(PARROT_INTERP, - ARGIN(PMC *user_data), - ARGIN(char *ext_data)) - __attribute__nonnull__(1) - __attribute__nonnull__(2) - __attribute__nonnull__(3); - -PARROT_EXPORT -void Parrot_cx_schedule_repeat(PARROT_INTERP, ARGIN(PMC *task)) - __attribute__nonnull__(1) - __attribute__nonnull__(2); - -PARROT_EXPORT -PARROT_WARN_UNUSED_RESULT -PARROT_CAN_RETURN_NULL -opcode_t * Parrot_cx_schedule_sleep(PARROT_INTERP, - FLOATVAL time, - ARGIN_NULLOK(opcode_t *next)) +void Parrot_cx_init_scheduler(PARROT_INTERP) __attribute__nonnull__(1); -PARROT_EXPORT -void Parrot_cx_schedule_task(PARROT_INTERP, ARGIN(PMC *task)) +void Parrot_cx_next_task(PARROT_INTERP, ARGIN(PMC *scheduler)) __attribute__nonnull__(1) __attribute__nonnull__(2); -PARROT_EXPORT -void Parrot_cx_schedule_timer(PARROT_INTERP, - ARGIN_NULLOK(STRING *type), - FLOATVAL duration, - FLOATVAL interval, - INTVAL repeat, - ARGIN_NULLOK(PMC *sub)) +void Parrot_cx_outer_runloop(PARROT_INTERP) __attribute__nonnull__(1); -PARROT_EXPORT -void Parrot_cx_send_message(PARROT_INTERP, - ARGIN(STRING *messagetype), - ARGIN(PMC *payload)) +PARROT_CAN_RETURN_NULL +opcode_t* Parrot_cx_preempt_task(PARROT_INTERP, + ARGIN(PMC *scheduler), + ARGIN(opcode_t *next)) __attribute__nonnull__(1) __attribute__nonnull__(2) __attribute__nonnull__(3); -void Parrot_cx_check_tasks(PARROT_INTERP, ARGMOD(PMC *scheduler)) - __attribute__nonnull__(1) - __attribute__nonnull__(2) - FUNC_MODIFIES(*scheduler); - -void Parrot_cx_init_scheduler(PARROT_INTERP) +void Parrot_cx_runloop_end(PARROT_INTERP) __attribute__nonnull__(1); -void Parrot_cx_invoke_callback(PARROT_INTERP, ARGIN(PMC *callback)) +void Parrot_cx_runloop_wake(PARROT_INTERP, ARGIN(PMC *scheduler)) __attribute__nonnull__(1) __attribute__nonnull__(2); -void Parrot_cx_refresh_task_list(PARROT_INTERP, ARGMOD(PMC *scheduler)) - __attribute__nonnull__(1) - __attribute__nonnull__(2) - FUNC_MODIFIES(*scheduler); - -void Parrot_cx_runloop_wake(PARROT_INTERP, ARGMOD(PMC *scheduler)) - __attribute__nonnull__(1) - __attribute__nonnull__(2) - FUNC_MODIFIES(*scheduler); - -void Parrot_cx_timer_invoke(PARROT_INTERP, ARGIN(PMC *timer)) +void Parrot_cx_schedule_alarm(PARROT_INTERP, ARGIN(PMC *alarm)) __attribute__nonnull__(1) __attribute__nonnull__(2); -#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(interp) \ - , 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)) -#define ASSERT_ARGS_Parrot_cx_count_handlers_local \ - __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ - PARROT_ASSERT_ARG(interp) \ - , PARROT_ASSERT_ARG(handler_type)) -#define ASSERT_ARGS_Parrot_cx_count_handlers_typed \ - __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ - PARROT_ASSERT_ARG(interp) \ - , PARROT_ASSERT_ARG(handler_type)) -#define ASSERT_ARGS_Parrot_cx_delete_handler_local \ - __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ - PARROT_ASSERT_ARG(interp)) -#define ASSERT_ARGS_Parrot_cx_delete_handler_typed \ - __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ - PARROT_ASSERT_ARG(interp) \ - , 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 = (\ - PARROT_ASSERT_ARG(interp) \ - , PARROT_ASSERT_ARG(task)) -#define ASSERT_ARGS_Parrot_cx_find_handler_for_task \ - __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 = (\ +void Parrot_cx_set_scheduler_alarm(PARROT_INTERP) + __attribute__nonnull__(1); + +#define ASSERT_ARGS_Parrot_cx_begin_execution __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(main) \ + , PARROT_ASSERT_ARG(argv)) +#define ASSERT_ARGS_Parrot_cx_check_alarms __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 = (\ +#define ASSERT_ARGS_Parrot_cx_run_scheduler __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(scheduler) \ + , PARROT_ASSERT_ARG(next)) +#define ASSERT_ARGS_Parrot_cx_schedule_immediate __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ PARROT_ASSERT_ARG(interp) \ - , PARROT_ASSERT_ARG(task)) + , PARROT_ASSERT_ARG(task_or_sub)) #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)) + , PARROT_ASSERT_ARG(task_or_sub)) #define ASSERT_ARGS_Parrot_cx_send_message __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ PARROT_ASSERT_ARG(interp) \ , PARROT_ASSERT_ARG(messagetype) \ , PARROT_ASSERT_ARG(payload_unused)) -#define ASSERT_ARGS_Parrot_cx_check_tasks __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ +#define ASSERT_ARGS_Parrot_cx_stop_task __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ + PARROT_ASSERT_ARG(interp) \ + , PARROT_ASSERT_ARG(next)) +#define ASSERT_ARGS_Parrot_cx_check_quantum __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ PARROT_ASSERT_ARG(interp) \ , PARROT_ASSERT_ARG(scheduler)) +#define ASSERT_ARGS_Parrot_cx_check_scheduler __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ + PARROT_ASSERT_ARG(interp) \ + , PARROT_ASSERT_ARG(next)) +#define ASSERT_ARGS_Parrot_cx_current_task __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ + PARROT_ASSERT_ARG(interp)) #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 = (\ +#define ASSERT_ARGS_Parrot_cx_next_task __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ PARROT_ASSERT_ARG(interp) \ , PARROT_ASSERT_ARG(scheduler)) +#define ASSERT_ARGS_Parrot_cx_outer_runloop __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ + PARROT_ASSERT_ARG(interp)) +#define ASSERT_ARGS_Parrot_cx_preempt_task __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ + PARROT_ASSERT_ARG(interp) \ + , PARROT_ASSERT_ARG(scheduler) \ + , PARROT_ASSERT_ARG(next)) +#define ASSERT_ARGS_Parrot_cx_runloop_end __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ + PARROT_ASSERT_ARG(interp)) #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 = (\ +#define ASSERT_ARGS_Parrot_cx_schedule_alarm __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ PARROT_ASSERT_ARG(interp) \ - , PARROT_ASSERT_ARG(timer)) + , PARROT_ASSERT_ARG(alarm)) +#define ASSERT_ARGS_Parrot_cx_set_scheduler_alarm __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/scheduler.c */ @@ -261,10 +186,23 @@ typedef enum { PARROT_TIMER_INTERVAL, PARROT_TIMER_RUNNING, PARROT_TIMER_HANDLER, - PARROT_TIMER_MAX + PARROT_TIMER_MAX, + PARROT_ALARM_TIME, + PARROT_ALARM_TASK } parrot_timer_enum_t; /* &end_gen */ +/* Alarm PMC interface constants */ +/* &gen_from_enum(alarm.pasm) */ +/* TODO: Figure out how to actually gen alarm.pasm +typedef enum { + PARROT_ALARM_TIME, + PARROT_ALARM_SUB +} parrot_alarm_enum_t; +*/ +/* &end_gen */ + + #endif /* PARROT_SCHEDULER_H_GUARD */ diff --git a/include/parrot/scheduler_private.h b/include/parrot/scheduler_private.h index f3205e8dee..3245b34769 100644 --- a/include/parrot/scheduler_private.h +++ b/include/parrot/scheduler_private.h @@ -1,5 +1,5 @@ /* scheduler.h - * Copyright (C) 2007, Parrot Foundation. + * Copyright (C) 2007-2011, Parrot Foundation. * Overview: * Parrot concurrency scheduler private core structs and flags * Data Structure and Algorithms: @@ -15,7 +15,7 @@ /* Scheduler private flags */ typedef enum { - SCHEDULER_cache_valid_FLAG = PObj_private0_FLAG, + SCHEDULER_resched_requested_FLAG = PObj_private0_FLAG, SCHEDULER_wake_requested_FLAG = PObj_private1_FLAG, SCHEDULER_terminate_requested_FLAG = PObj_private2_FLAG, SCHEDULER_in_handler_FLAG = PObj_private3_FLAG @@ -26,12 +26,12 @@ typedef enum { #define SCHEDULER_flag_SET(flag, o) (SCHEDULER_get_FLAGS(o) |= SCHEDULER_ ## flag ## _FLAG) #define SCHEDULER_flag_CLEAR(flag, o) (SCHEDULER_get_FLAGS(o) &= ~(UINTVAL)(SCHEDULER_ ## flag ## _FLAG)) -/* Mark if the scheduler's cache is valid */ -#define SCHEDULER_cache_valid_TEST(o) SCHEDULER_flag_TEST(cache_valid, o) -#define SCHEDULER_cache_valid_SET(o) SCHEDULER_flag_SET(cache_valid, o) -#define SCHEDULER_cache_valid_CLEAR(o) SCHEDULER_flag_CLEAR(cache_valid, o) +/* Should the scheduler swap tasks at its next opportunity? */ +#define SCHEDULER_resched_requested_TEST(o) SCHEDULER_flag_TEST(resched_requested, o) +#define SCHEDULER_resched_requested_SET(o) SCHEDULER_flag_SET(resched_requested, o) +#define SCHEDULER_resched_requested_CLEAR(o) SCHEDULER_flag_CLEAR(resched_requested, o) -/* Mark if the scheduler received a wake signal */ +/* Should the scheduler wake up, check events, and stuff? */ #define SCHEDULER_wake_requested_TEST(o) SCHEDULER_flag_TEST(wake_requested, o) #define SCHEDULER_wake_requested_SET(o) SCHEDULER_flag_SET(wake_requested, o) #define SCHEDULER_wake_requested_CLEAR(o) SCHEDULER_flag_CLEAR(wake_requested, o) @@ -48,9 +48,12 @@ typedef enum { /* * Task private flags + * */ typedef enum { - TASK_terminate_runloop_FLAG = PObj_private0_FLAG + TASK_active_FLAG = PObj_private0_FLAG, + TASK_in_preempt_FLAG = PObj_private1_FLAG, + TASK_recv_block_FLAG = PObj_private2_FLAG } task_flags_enum; #define TASK_get_FLAGS(o) (PObj_get_FLAGS(o)) @@ -58,10 +61,22 @@ typedef enum { #define TASK_flag_SET(flag, o) (TASK_get_FLAGS(o) |= TASK_ ## flag ## _FLAG) #define TASK_flag_CLEAR(flag, o) (TASK_get_FLAGS(o) &= ~(UINTVAL)(TASK_ ## flag ## _FLAG)) -/* Mark a task to terminate the scheduler runloop */ -#define TASK_terminate_runloop_TEST(o) TASK_flag_TEST(terminate_runloop, o) -#define TASK_terminate_runloop_SET(o) TASK_flag_SET(terminate_runloop, o) -#define TASK_terminate_runloop_CLEAR(o) TASK_flag_CLEAR(terminate_runloop, o) +/* Flag is set if the task has been started and has not finished */ +#define TASK_active_TEST(o) TASK_flag_TEST(active, o) +#define TASK_active_SET(o) TASK_flag_SET(active, o) +#define TASK_active_CLEAR(o) TASK_flag_CLEAR(active, o) + +/* Flag is set iff the runloop is ending because the current task has + * been pre-empted but is not yet done running */ +#define TASK_in_preempt_TEST(o) TASK_flag_TEST(in_preempt, o) +#define TASK_in_preempt_SET(o) TASK_flag_SET(in_preempt, o) +#define TASK_in_preempt_CLEAR(o) TASK_flag_CLEAR(in_preempt, o) + +/* Flag is set if the task is blocked in a recv call. */ +#define TASK_recv_block_TEST(o) TASK_flag_TEST(recv_block, o) +#define TASK_recv_block_SET(o) TASK_flag_SET(recv_block, o) +#define TASK_recv_block_CLEAR(o) TASK_flag_CLEAR(recv_block, o) + #endif /* PARROT_SCHEDULER_PRIVATE_H_GUARD */ diff --git a/include/parrot/string_funcs.h b/include/parrot/string_funcs.h index dd5f67afd9..de5bd10d60 100644 --- a/include/parrot/string_funcs.h +++ b/include/parrot/string_funcs.h @@ -268,7 +268,7 @@ PARROT_WARN_UNUSED_RESULT PARROT_MALLOC PARROT_CANNOT_RETURN_NULL STRING * Parrot_str_new_from_buffer(PARROT_INTERP, - ARGMOD(Buffer *buffer), + ARGMOD(Parrot_Buffer *buffer), const UINTVAL len) __attribute__nonnull__(1) __attribute__nonnull__(2) @@ -489,6 +489,13 @@ STRING * Parrot_str_iter_substr(PARROT_INTERP, __attribute__nonnull__(2) __attribute__nonnull__(3); +PARROT_WARN_UNUSED_RESULT +PARROT_CANNOT_RETURN_NULL +STRING * Parrot_str_new_from_cstring(PARROT_INTERP, + ARGIN_NULLOK(const char *buffer), + ARGIN_NULLOK(STRING *encodingname)) + __attribute__nonnull__(1); + #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 = (\ @@ -652,6 +659,8 @@ STRING * Parrot_str_iter_substr(PARROT_INTERP, PARROT_ASSERT_ARG(interp) \ , PARROT_ASSERT_ARG(str) \ , PARROT_ASSERT_ARG(l)) +#define ASSERT_ARGS_Parrot_str_new_from_cstring __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/api.c */ diff --git a/include/parrot/sub.h b/include/parrot/sub.h index 5fc81d1cdb..479a973193 100644 --- a/include/parrot/sub.h +++ b/include/parrot/sub.h @@ -102,12 +102,6 @@ typedef enum { #define Sub_comp_INIT_SET(o) Sub_comp_flag_SET(PF_INIT, o) #define Sub_comp_INIT_CLEAR(o) Sub_comp_flag_CLEAR(PF_INIT, o) -/* - * a flag to signal a Sub that a new Continuation should be created - */ - -#define NEED_CONTINUATION ((PMC *)1) - /* * maximum sub recursion depth */ @@ -184,7 +178,9 @@ int Parrot_sub_context_get_info(PARROT_INTERP, PARROT_EXPORT PARROT_CAN_RETURN_NULL PARROT_WARN_UNUSED_RESULT -STRING* Parrot_sub_Context_infostr(PARROT_INTERP, ARGIN(PMC *ctx)) +STRING* Parrot_sub_Context_infostr(PARROT_INTERP, + ARGIN(PMC *ctx), + int is_top) __attribute__nonnull__(1) __attribute__nonnull__(2); @@ -239,7 +235,6 @@ INTVAL Parrot_sub_get_line_from_pc(PARROT_INTERP, ARGIN_NULLOK(opcode_t *pc)) __attribute__nonnull__(1); -void Parrot_sub_mark_context_start(void); #define ASSERT_ARGS_Parrot_get_sub_pmc_from_subclass \ __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ PARROT_ASSERT_ARG(interp) \ @@ -279,7 +274,6 @@ void Parrot_sub_mark_context_start(void); PARROT_ASSERT_ARG(interp)) #define ASSERT_ARGS_Parrot_sub_get_line_from_pc __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ PARROT_ASSERT_ARG(interp)) -#define ASSERT_ARGS_Parrot_sub_mark_context_start __attribute__unused__ int _ASSERT_ARGS_CHECK = (0) /* Don't modify between HEADERIZER BEGIN / HEADERIZER END. Your changes will be lost. */ /* HEADERIZER END: src/sub.c */ diff --git a/include/parrot/thr_none.h b/include/parrot/thr_none.h deleted file mode 100644 index 03aba8f905..0000000000 --- a/include/parrot/thr_none.h +++ /dev/null @@ -1,50 +0,0 @@ -/* Copyright (C) 2011, Parrot Foundation. - * Null thread interface definition shims. - */ - -#ifndef PARROT_THR_NULL_H_GUARD -#define PARROT_THR_NULL_H_GUARD - -#define LOCK(m) -#define UNLOCK(m) -#define COND_WAIT(c, m) -#define COND_TIMED_WAIT(c, m, t) -#define COND_SIGNAL(c) -#define COND_BROADCAST(c) - -#define MUTEX_INIT(m) -#define MUTEX_DESTROY(m) - -#define COND_INIT(c) -#define COND_DESTROY(c) - -#define THREAD_CREATE_DETACHED(t, func, arg) -#define THREAD_CREATE_JOINABLE(t, func, arg) - -#define JOIN(t, ret) -#define DETACH(t) - -#define CLEANUP_PUSH(f, a) -#define CLEANUP_POP(a) - -#define Parrot_mutex int -#define Parrot_cond int -#define Parrot_thread int - -typedef void (*Cleanup_Handler)(void *); - -#if ! PARROT_HAS_TIMESPEC -struct timespec { - time_t tv_sec; - long tv_nsec; -}; -#endif /* PARROT_HAS_TIMESPEC */ - -#endif /* PARROT_THR_NULL_H_GUARD */ - -/* - * Local variables: - * c-file-style: "parrot" - * End: - * vim: expandtab shiftwidth=4 cinoptions='\:2=2' : - */ diff --git a/include/parrot/thr_pthread.h b/include/parrot/thr_pthread.h deleted file mode 100644 index bec7693ce8..0000000000 --- a/include/parrot/thr_pthread.h +++ /dev/null @@ -1,76 +0,0 @@ -/* thr_pthread.h - * Copyright (C) 2001-2003, Parrot Foundation. - * Overview: - * POSIS pthread interface - * Data Structure and Algorithms: - * History: - * 2003.12.14 Initial rev by leo - * Moved common code from generic, darwin, openbsd - * to this file. - * Notes: - * References: - */ - -#ifndef PARROT_THR_PTHREAD_H_GUARD -#define PARROT_THR_PTHREAD_H_GUARD - -# include - -# define LOCK(m) pthread_mutex_lock((pthread_mutex_t*)&(m)) -# define UNLOCK(m) pthread_mutex_unlock((pthread_mutex_t*)&(m)) -# define COND_WAIT(c, m) pthread_cond_wait(&(c), &(m)) -# define COND_TIMED_WAIT(c, m, t) pthread_cond_timedwait(&(c), &(m), (t)) -# define COND_SIGNAL(c) pthread_cond_signal(&(c)) -# define COND_BROADCAST(c) pthread_cond_broadcast(&(c)) - -/* - * for now use a fast mutex w/o error checking and non recursive - */ -# define MUTEX_INIT(m) pthread_mutex_init(&(m), NULL) -# define MUTEX_DESTROY(m) pthread_mutex_destroy(&(m)) - -# define COND_INIT(c) pthread_cond_init(&(c), NULL); -# define COND_DESTROY(c) pthread_cond_destroy(&(c)) - -# define THREAD_CREATE_DETACHED(t, func, arg) \ - do { \ - pthread_attr_t attr; \ - int rc = pthread_attr_init(&attr); \ - PARROT_ASSERT(rc == 0); \ - rc = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED); \ - PARROT_ASSERT(rc == 0); \ - rc = pthread_create(&(t), &attr, (func), (arg)); \ - PARROT_ASSERT(rc == 0); \ - pthread_attr_destroy(&attr); \ - } while (0) - -# define THREAD_CREATE_JOINABLE(t, func, arg) \ - pthread_create(&(t), NULL, (func), (arg)) - -# define JOIN(t, ret) pthread_join((t), &(ret)) -# define DETACH(t) pthread_detach(t) - -# define CLEANUP_PUSH(f, a) pthread_cleanup_push((f), (a)) -# define CLEANUP_POP(a) pthread_cleanup_pop(a) - -#ifdef PARROT_HAS_HEADER_UNISTD -# include -# ifdef _POSIX_PRIORITY_SCHEDULING -# define YIELD sched_yield() -# endif -#endif /* PARROT_HAS_HEADER_UNISTD */ - -typedef pthread_mutex_t Parrot_mutex; -typedef pthread_cond_t Parrot_cond; -typedef pthread_t Parrot_thread; - -typedef void (*Cleanup_Handler)(void *); - -#endif /* PARROT_THR_PTHREAD_H_GUARD */ - -/* - * Local variables: - * c-file-style: "parrot" - * End: - * vim: expandtab shiftwidth=4 cinoptions='\:2=2' : - */ diff --git a/include/parrot/thr_windows.h b/include/parrot/thr_windows.h deleted file mode 100644 index e557197f2a..0000000000 --- a/include/parrot/thr_windows.h +++ /dev/null @@ -1,130 +0,0 @@ -/* thread.h - * Copyright (C) 2001-2003, Parrot Foundation. - * Overview: - * This is the api header for the windows thread primitives - * Data Structure and Algorithms: - * History: - * Notes: - * References: - */ - -#ifndef PARROT_THR_WINDOWS_H_GUARD -#define PARROT_THR_WINDOWS_H_GUARD - -# undef FASTCALL -# define WIN32_LEAN_AND_MEAN -# include -# include -# include -# undef CONST - -typedef CRITICAL_SECTION Parrot_mutex; -typedef struct Windows_cond - { - HANDLE m_hSema; - LONG m_lWaiters; - } Parrot_cond; -typedef HANDLE Parrot_thread; - -# define MUTEX_INIT(m) InitializeCriticalSection((PCRITICAL_SECTION)&(m)) -# define MUTEX_DESTROY(m) DeleteCriticalSection((PCRITICAL_SECTION)&(m)) - -# define COND_INIT(c) \ - do { \ - (c).m_hSema = CreateSemaphore(NULL, 0, LONG_MAX, NULL); \ - (c).m_lWaiters = 0; \ - } while (0) - -# define COND_DESTROY(c) CloseHandle((c).m_hSema) - -# define LOCK(m) EnterCriticalSection((PCRITICAL_SECTION)&(m)) -# define UNLOCK(m) LeaveCriticalSection((PCRITICAL_SECTION)&(m)) - -# define COND_WAIT(c, m) \ - do { \ - ++(c).m_lWaiters; \ - UNLOCK(m); \ - WaitForSingleObject((c).m_hSema, INFINITE); \ - LOCK(m); \ - --(c).m_lWaiters; \ - } while (0) - -# define COND_TIMED_WAIT(c, m, t) \ - do { \ - FLOATVAL now; \ - time_t sec; \ - LONG nsec; \ - DWORD diff; \ - now = Parrot_floatval_time(); \ - sec = (time_t)now; \ - nsec = (LONG)((now - sec)*1000.0f)*1000000L; \ - if ((t)->tv_sec > sec || ((t)->tv_sec == sec && (t)->tv_nsec > nsec)) \ - { \ - ++(c).m_lWaiters; \ - UNLOCK(m); \ - diff = (DWORD)(((t)->tv_sec - sec)*1000L + ((t)->tv_nsec - nsec)/1000000L); \ - WaitForSingleObject((c).m_hSema, diff); \ - LOCK(m); \ - --(c).m_lWaiters; \ - } \ - } while (0) - -# define COND_SIGNAL(c) \ - do { \ - if ((c).m_lWaiters > 0) \ - ReleaseSemaphore((c).m_hSema, 1, NULL); \ - } while (0) - -# define COND_BROADCAST(c) \ - do { \ - if ((c).m_lWaiters > 0) \ - ReleaseSemaphore((c).m_hSema, (c).m_lWaiters, NULL); \ - } while (0) - -# define JOIN(t, ret) \ - do { \ - WaitForSingleObject((t), INFINITE); \ - GetExitCodeThread((t), (LPDWORD)&(ret)); \ - CloseHandle(t); \ - } while (0) - -# define DETACH(t) CloseHandle(t) - -/* If the compiler CRT library has a good _beginthreadXX() routine, use it instead of - the Win32 API CreateThread(). _beginthreadXX guards call to the thread start routine - with SEH to implement runtime errors and signal support. Also it frees calloc-ed - per-thread data block at exit */ -#ifdef _MCS_VER1 -# define THREAD_CREATE_JOINABLE(t, func, arg) \ - do { \ - unsigned tid; \ - (t) = (HANDLE)_beginthreadex(NULL, 0, unsigned (__stdcall * (func)) (void*), \ - (void*)(arg), 0, &tid); \ - } while (0) -#else -# define THREAD_CREATE_JOINABLE(t, func, arg) \ - do { \ - DWORD tid; \ - (t) = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)(func), (PVOID)(arg), 0, &tid); \ - } while (0) -#endif - -# define THREAD_CREATE_DETACHED(t, func, arg) \ - do { \ - THREAD_CREATE_JOINABLE((t), (func), (arg)); \ - DETACH(t); \ - } while (0) - -# define CLEANUP_PUSH(f, a) -# define CLEANUP_POP(a) - -typedef void (*Cleanup_Handler)(void *); - -#endif /* PARROT_THR_WINDOWS_H_GUARD */ - -/* - * Local variables: - * c-file-style: "parrot" - * End: - * vim: expandtab shiftwidth=4 cinoptions='\:2=2' : - */ diff --git a/include/parrot/thread.h b/include/parrot/thread.h deleted file mode 100644 index a9bb035a73..0000000000 --- a/include/parrot/thread.h +++ /dev/null @@ -1,254 +0,0 @@ -/* thread.h - * Copyright (C) 2001-2007, Parrot Foundation. - * Overview: - * This is the api header for the thread primitives - * Data Structure and Algorithms: - * History: - * Notes: - * References: - */ - -#ifndef PARROT_THREAD_H_GUARD -#define PARROT_THREAD_H_GUARD - -#include "parrot/parrot.h" - -#ifdef PARROT_HAS_THREADS -# ifdef _WIN32 -# include "parrot/thr_windows.h" -# else -# include "parrot/thr_pthread.h" -# endif -#else -# include "parrot/thr_none.h" -#endif /* PARROT_HAS_THREADS */ - -#include "parrot/atomic.h" - -#ifndef YIELD -# define YIELD -#endif /* YIELD */ - -typedef enum { - THREAD_STATE_JOINABLE, /* default */ - THREAD_STATE_DETACHED = 0x01, /* i.e. non-joinable */ - THREAD_STATE_JOINED = 0x02, /* JOIN was issued */ - THREAD_STATE_FINISHED = 0x04, /* the thread function has ended */ - THREAD_STATE_NOT_STARTED = 0x08, /* the thread wasn't started */ - THREAD_STATE_SUSPENDED_GC = 0x10, /* suspended for GC on request */ - THREAD_STATE_GC_WAKEUP = 0x20, /* the thread is waiting on its condition - variable, and will do a GC run if - it is woken up and marked as suspended - for GC */ - THREAD_STATE_SUSPEND_GC_REQUESTED = 0x40 /* the thread's event queue - contains a suspend-for-GC event */ -} thread_state_enum; - - -/* - * per interpreter thread data structure - */ -typedef struct _Thread_data { - Parrot_thread thread; /* pthread_t or such */ - INTVAL state; - int wants_shared_gc; /* therad is trying to - do a shared GC run */ - UINTVAL tid; /* 0.. n-1 idx in interp array */ - - Parrot_Interp joiner; /* thread that is trying to join this */ - - /* for wr access to interpreter e.g. for GC - * if only used for GC the lock could be in the arena - * instead here, or in the interpreter, with negative size impact - * for the non-threaded case - */ - Parrot_mutex interp_lock; - - /* for waking up the interpreter from various sorts - * of sleeping - */ - Parrot_cond interp_cond; - - /* COW'd constant tables */ - Hash *const_tables; -} Thread_data; - -# define LOCK_INTERPRETER(interp) \ - if ((interp)->thread_data) \ - LOCK((interp)->thread_data->interp_lock) -# define UNLOCK_INTERPRETER(interp) \ - if ((interp)->thread_data) \ - UNLOCK((interp)->thread_data->interp_lock) - -# define INTERPRETER_LOCK_INIT(interp) \ - do { \ - MUTEX_INIT((interp)->thread_data->interp_lock); \ - COND_INIT((interp)->thread_data->interp_cond); \ - } while (0) -# define INTERPRETER_LOCK_DESTROY(interp) \ - do { \ - MUTEX_DESTROY((interp)->thread_data->interp_lock); \ - COND_DESTROY((interp)->thread_data->interp_cond); \ - } while (0) - - -/* - * this global mutex protects the list of interpreters - */ -VAR_SCOPE Parrot_mutex interpreter_array_mutex; -VAR_SCOPE Interp ** interpreter_array; -VAR_SCOPE size_t n_interpreters; - -typedef enum { - THREAD_GC_STAGE_NONE, - THREAD_GC_STAGE_MARK, - THREAD_GC_STAGE_SWEEP = THREAD_GC_STAGE_NONE -} thread_gc_stage_enum; - -typedef struct _Shared_gc_info { - thread_gc_stage_enum gc_stage; - Parrot_cond gc_cond; - int num_reached; - - Parrot_atomic_integer gc_block_level; -} Shared_gc_info; - -/* TODO use thread pools instead */ -VAR_SCOPE Shared_gc_info *shared_gc_info; - -/* HEADERIZER BEGIN: src/thread.c */ -/* Don't modify between HEADERIZER BEGIN / HEADERIZER END. Your changes will be lost. */ - -PARROT_EXPORT -void Parrot_shared_gc_block(PARROT_INTERP); - -PARROT_EXPORT -void Parrot_shared_gc_unblock(PARROT_INTERP); - -PARROT_EXPORT -PARROT_CANNOT_RETURN_NULL -PARROT_WARN_UNUSED_RESULT -PMC * pt_thread_create(PARROT_INTERP, INTVAL type, INTVAL clone_flags) - __attribute__nonnull__(1); - -void pt_add_to_interpreters(PARROT_INTERP, - ARGIN_NULLOK(Parrot_Interp new_interp)) - __attribute__nonnull__(1); - -void pt_clone_code(Parrot_Interp d, Parrot_Interp s); -void pt_clone_globals(Parrot_Interp d, Parrot_Interp s); -void pt_free_pool(PARROT_INTERP) - __attribute__nonnull__(1); - -void pt_gc_mark_root_finished(PARROT_INTERP); -void pt_gc_start_mark(PARROT_INTERP) - __attribute__nonnull__(1); - -void pt_gc_stop_mark(PARROT_INTERP) - __attribute__nonnull__(1); - -void pt_join_threads(PARROT_INTERP) - __attribute__nonnull__(1); - -PARROT_CAN_RETURN_NULL -PMC * pt_shared_fixup(PARROT_INTERP, ARGMOD(PMC *pmc)) - __attribute__nonnull__(1) - __attribute__nonnull__(2) - FUNC_MODIFIES(*pmc); - -void pt_suspend_self_for_gc(PARROT_INTERP) - __attribute__nonnull__(1); - -int pt_thread_create_run(PARROT_INTERP, - INTVAL type, - INTVAL clone_flags, - ARGIN(PMC *sub), - ARGIN_NULLOK(PMC *arg)) - __attribute__nonnull__(1) - __attribute__nonnull__(4); - -void pt_thread_detach(UINTVAL tid); -PARROT_CAN_RETURN_NULL -PMC* pt_thread_join(ARGIN(Parrot_Interp parent), UINTVAL tid) - __attribute__nonnull__(1); - -void pt_thread_kill(UINTVAL tid); -void pt_thread_prepare_for_run(Parrot_Interp d, Parrot_Interp s); -int pt_thread_run(PARROT_INTERP, - ARGMOD(PMC *thread_interp_pmc), - ARGIN(PMC *sub), - ARGIN_NULLOK(PMC *arg)) - __attribute__nonnull__(1) - __attribute__nonnull__(2) - __attribute__nonnull__(3) - FUNC_MODIFIES(*thread_interp_pmc); - -void pt_thread_wait_with(PARROT_INTERP, ARGMOD(Parrot_mutex *mutex)) - __attribute__nonnull__(1) - __attribute__nonnull__(2) - FUNC_MODIFIES(*mutex); - -void pt_thread_yield(void); -PARROT_CAN_RETURN_NULL -PMC * pt_transfer_sub( - ARGOUT(Parrot_Interp d), - ARGIN(Parrot_Interp s), - ARGIN(PMC *sub)) - __attribute__nonnull__(1) - __attribute__nonnull__(2) - __attribute__nonnull__(3) - FUNC_MODIFIES(d); - -#define ASSERT_ARGS_Parrot_shared_gc_block __attribute__unused__ int _ASSERT_ARGS_CHECK = (0) -#define ASSERT_ARGS_Parrot_shared_gc_unblock __attribute__unused__ int _ASSERT_ARGS_CHECK = (0) -#define ASSERT_ARGS_pt_thread_create __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 = (0) -#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_create_run __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ - PARROT_ASSERT_ARG(interp) \ - , PARROT_ASSERT_ARG(sub)) -#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(thread_interp_pmc) \ - , PARROT_ASSERT_ARG(sub)) -#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)) -/* Don't modify between HEADERIZER BEGIN / HEADERIZER END. Your changes will be lost. */ -/* HEADERIZER END: src/thread.c */ - -#endif /* PARROT_THREAD_H_GUARD */ - -/* - * Local variables: - * c-file-style: "parrot" - * End: - * vim: expandtab shiftwidth=4 cinoptions='\:2=2' : - */ diff --git a/lib/Parrot/Configure/Compiler.pm b/lib/Parrot/Configure/Compiler.pm index 11661e97f9..49f29a0166 100644 --- a/lib/Parrot/Configure/Compiler.pm +++ b/lib/Parrot/Configure/Compiler.pm @@ -1,4 +1,4 @@ -# Copyright (C) 2001-2011, Parrot Foundation. +# Copyright (C) 2001-2012, Parrot Foundation. =head1 NAME @@ -7,10 +7,10 @@ Parrot::Configure::Compiler - C-Related methods for configuration and more =head1 DESCRIPTION The Parrot::Configure::Compiler module provides methods inherited by -Parrot::Configure which prepare and/or run C programs during -compilation. Also other files like makefiles will be generated with methods -from this module by replacing entries like C<@key@> with C's value from -the configuration system's data. +Parrot::Configure which prepare and/or run C programs during compilation. +Other methods from this module will be used to generate makefiles and other +files. Template entries of the form C<@key@> will be replaced with C's +value from the configuration system's data. =head2 Methods @@ -255,19 +255,18 @@ replacement syntax assumes the source text is on a single line.) =item file_type -If set to a C, C or C value, C will be set -to corresponding value. -Moreover, when set to a C value, it will enable -C. +If set to a C, C or C value, C will be set to +corresponding value. Moreover, when set to a C value, it will +enable C. Its value will be detected automatically by target file name unless you set it to a special value C. =item conditioned_lines #IF #UNLESS #ELSIF #ELSE -If conditioned_lines is true, then lines beginning in #IF, #UNLESS, #ELSIF, and -#ELSE are evaluated conditionally, and the content after the C<:> is included -or excluded, dependending on the evaluation of the expression. +If conditioned_lines is true, then lines beginning in C<#IF>, C<#UNLESS>, +C<#ELSIF>, and C<#ELSE> are evaluated conditionally, and the content after the +C<:> is included or excluded, depending on the evaluation of the expression. Lines beginning with C<#IF(expr):> are skipped if the expr condition is false, otherwise the content after the C<:> is inserted. Lines beginning with @@ -275,17 +274,32 @@ C<#UNLESS(expr):> are skipped if the expr condition is true, otherwise the content after the C<:> is inserted. Lines beginning with C<#ELSIF(expr):> or C<#ELSE:> are evaluated if the preceding C<#IF(expr):> evaluated to false. -A condition expr may be: +A condition C may be: - * A single key, which is true if a config key is true, - * Equal to the platform name or the osname - case-sensitive, - * A C expression, which is true if the config key has the - expected value, or - * A logical combination of C<|>, C, C<&>, C, C, C. +=over 4 + +=item * + +A single key, which is true if a config key is true, + +=item * + +Equal to the platform name or the osname - case-sensitive, + +=item * + +A C expression, which is true if the config key has the expected +value, or + +=item * + +A logical combination of C<|>, C, C<&>, C, C, C. + +=back -A key must only consist of the characters A-Z a-z 0-9 _ -, and is checked +A key must only consist of the characters C, and is checked case-sensitively against the configuration key or the platform name. Truth is -defined as any value that is not 0, an empty string, or C. +defined as any value that is not C<0>, an empty string, or C. The value in C expressions may not contain spaces. Quotes in values are not supported. @@ -608,20 +622,20 @@ sub next_expr { my $s = $_[0]; return "" unless $s; # start of a subexpression? - if ($s =~ /^\((.+)\)\s*(.*)/o) { # longest match to matching closing paren + if ($s =~ /^\((.+)\)\s*(.*)/) { # longest match to matching closing paren $_[0] = $2 ? $2 : ""; # modify the 2nd arg return $1; } else { $s =~ s/^\s+//; # left-trim to make it more robust - if ($s =~ m/^([-\w=]+)\s*(.*)?/o) { # shortest match to next non-word char + if ($s =~ /^([-\w=]+)\s*(.*)?/) { # shortest match to next non-word char # start with word expr $_[0] = $2 ? $2 : ""; # modify the 2nd arg expr in the caller return $1; } else { # special case: start with non-word op (perl-syntax only) - $s =~ m/^([|&!])\s*(.*)?/o; # shortest match to next word char + $s =~ /^([|&!])\s*(.*)?/; # shortest match to next word char $_[0] = $2 ? $2 : ""; # modify the 2nd arg expr in the caller return $1; } diff --git a/lib/Parrot/Configure/Options/Conf/File.pm b/lib/Parrot/Configure/Options/Conf/File.pm index a54736198e..8e409b773d 100644 --- a/lib/Parrot/Configure/Options/Conf/File.pm +++ b/lib/Parrot/Configure/Options/Conf/File.pm @@ -90,7 +90,17 @@ sub _set_general { my ($data, $substitutions, $general, $optsref) = @_; my @general = split /\n/, $general; foreach my $g (@general) { - next unless $g =~ m/^([-\w]+)(?:=(\$?[^\s\$]+))?$/; + next unless ( $g =~ m/^ + ([-\w]+) + (?:=( + \S+ # Usual case: regular identifier; no spaces allowed in identifier + | + \$\S+ # Variable substitution; no spaces allowed in identifier + ) + )? + $/x ) + or + ( $g =~ m/^([-\w]+)="([^"]+)"$/ ); # Double-quoted string; spaces allowed my ($k, $v, $prov, $var); if ($2) { ($k, $prov) = ($1, $2); diff --git a/lib/Parrot/Distribution.pm b/lib/Parrot/Distribution.pm index 8b59421ff0..c60628d5b9 100644 --- a/lib/Parrot/Distribution.pm +++ b/lib/Parrot/Distribution.pm @@ -1,4 +1,4 @@ -# Copyright (C) 2004-2010, Parrot Foundation. +# Copyright (C) 2004-2012, Parrot Foundation. =head1 NAME @@ -73,7 +73,7 @@ Raises an exception if the distribution root is not found. while ( $self = $self->SUPER::new($path) ) { if ( $self->file_exists_with_name($file) - and $self->file_with_name($file)->read =~ m/^This is Parrot/os ) + and $self->file_with_name($file)->read =~ m/^This is Parrot/s ) { $dist = $self; last; @@ -211,7 +211,7 @@ BEGIN { perl => { file_exts => [ 'pl', 'pm', 't' ], shebang => qr/^#!\s*perl/, - shebang_ext => qr/.t$/, + shebang_ext => qr/\.t$/, }, python => { file_exts => ['py'] }, }, @@ -301,6 +301,20 @@ BEGIN { } } +=item C + +Returns all the files in the distro. + +=cut + +sub get_all_files { + my ($self) = @_; + + return sort + map { $self->file_with_name($_) } + $self->_dist_files; +} + =item C Returns the Make language source files within Parrot. @@ -645,7 +659,7 @@ sub perl_script_file_with_name { my $self = shift; my $name = shift || return; - $name .= '.pl' unless $name =~ /\.pl$/o; + $name .= '.pl' unless $name =~ /\.pl$/; foreach my $dir ( $self->perl_script_file_directories ) { return $dir->file_with_name($name) @@ -692,7 +706,7 @@ sub perl_module_file_with_name { my $self = shift; my $name = shift || return; - $name .= '.pm' unless $name =~ /\.pm$/o; + $name .= '.pm' unless $name =~ /\.pm$/; foreach my $dir ( $self->perl_module_file_directories ) { return $dir->file_with_name($name) diff --git a/lib/Parrot/Docs/File.pm b/lib/Parrot/Docs/File.pm index 9f1189e61c..9c76568e9c 100644 --- a/lib/Parrot/Docs/File.pm +++ b/lib/Parrot/Docs/File.pm @@ -1,4 +1,4 @@ -# Copyright (C) 2004-2009, Parrot Foundation. +# Copyright (C) 2004-2012, Parrot Foundation. =head1 NAME @@ -117,7 +117,6 @@ my %type_for_name = ( 'MAINTAINER' => 'Maintainer info', 'Makefile' => 'Makefile', 'MANIFEST' => 'Manifest file', - 'NEWS' => 'Project info', 'PBC_COMPAT' => 'Bytecode compatibility file', 'PLATFORMS' => 'Project info', 'README' => 'README file', @@ -288,16 +287,16 @@ If a file contains plain text rather than POD it may be directly linked to. sub is_docs_link { my $self = shift; - # TT #1241 - This needs more thought. I'm trying to work out which files + # GH #626 - 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. if ( $self->has_suffix ) { - return 0 if $self->suffix !~ m/[Tt][Xx][Tt]/o; + return 0 if $self->suffix !~ m/txt/i; } else { - return 1 if $self->name =~ m/^[[:upper:]]+$/o; + return 1 if $self->name =~ m/^[[:upper:]]+$/; } return $self->type =~ /Licence|info|docu|Text|TODO|status|MANIFEST|README/; @@ -328,14 +327,14 @@ sub title { $text = $1; # Tidy it up a bit. - $text =~ s/^\s+//o; - $text =~ s/\s+$//o; - $text =~ s/\s*-$//o; + $text =~ s/^\s+//; + $text =~ s/\s+$//; + $text =~ s/\s*-$//; # There was not text, just another POD command (=head2 probably). - return '' if $text =~ /^=\w/o; + return '' if $text =~ /^=\w/; - return $text unless $text =~ /-/o; + return $text unless $text =~ /-/; # There has to be some space each side of the dash. my ( $path, $desc ) = split /\s+--?\s+/, $text, 2; diff --git a/lib/Parrot/Docs/HTMLPage.pm b/lib/Parrot/Docs/HTMLPage.pm index 942e5843d8..1285d251b3 100644 --- a/lib/Parrot/Docs/HTMLPage.pm +++ b/lib/Parrot/Docs/HTMLPage.pm @@ -72,6 +72,25 @@ sub header { HEADER } +=item C + +Returns the html code, I links, passed to it. + +C<@html> is a simple array to hold the html links passed to this subroutine. + +=cut + +sub body { + my $self = shift; + + my $body; + foreach(@_) { + $body .= $_; + } + + return $body; +} + =item C Returns the page footer. diff --git a/lib/Parrot/Docs/POD2HTML.pm b/lib/Parrot/Docs/POD2HTML.pm index 303f2a82d2..434e0da2d0 100644 --- a/lib/Parrot/Docs/POD2HTML.pm +++ b/lib/Parrot/Docs/POD2HTML.pm @@ -205,7 +205,7 @@ sub process_code_start_token { my $text = $next->text; - if ( $text =~ /^Parrot::/o ) { + if ( $text =~ /^Parrot::/ ) { my $href = $self->href_for_perl_module($text); @@ -247,7 +247,7 @@ sub process_file_start_token { $dist->relative_path_is_file($text) # A little bit of a hack to avoid config template files. - and $text !~ /\.in$/o and $dist->file_with_relative_path($text)->contains_pod + and $text !~ /\.in$/ and $dist->file_with_relative_path($text)->contains_pod ) { my $path = $self->append_html_suffix($text); @@ -505,7 +505,7 @@ sub resolve_pod_page_link { my $to = shift; my $section = shift; - if ( $to =~ /^Parrot::/o ) { + if ( $to =~ /^Parrot::/ ) { my $href = $self->href_for_perl_module($to); # This gets corrupted somewhere down the line, with diff --git a/lib/Parrot/Docs/PodToHtml.pm b/lib/Parrot/Docs/PodToHtml.pm index 63e11776b1..1db67370dd 100644 --- a/lib/Parrot/Docs/PodToHtml.pm +++ b/lib/Parrot/Docs/PodToHtml.pm @@ -83,6 +83,19 @@ sub do_beginning { my $self = shift; my $title = esc($self->get_title()); + if (not $title) { + # Since we couldn't find a title, we'll fake one using the filename. + # Missing titles can occur if the underlying PullParser doesn't find + # a suitable candidate. This omission can occur if the =head1 is all + # caps, for example. + $title = esc($self->{source_filename}); + $title =~ s/^.+\///; + $title =~ s/\.\w+$//; + $title =~ s/[=-_ ]+/ /g; + $title = ucfirst $title; + # These regexes make a filename relatively pretty, for example: + # "docs/project/release_manager_guide.pod" -> "Release manager guide" + } # If the name of the document is IN the document title (a common pod # idiom), strip it out. We assume anything with a dot is the filename. diff --git a/lib/Parrot/Docs/Section/Info.pm b/lib/Parrot/Docs/Section/Info.pm index e885ea911e..e929d8d201 100644 --- a/lib/Parrot/Docs/Section/Info.pm +++ b/lib/Parrot/Docs/Section/Info.pm @@ -51,7 +51,6 @@ sub new { $self->new_item( 'Instructions for Parrot in a Win32 environment.', 'README_win32.pod' ), - $self->new_item( 'This file lists what\'s new in each version.', 'NEWS' ), $self->new_item( 'Where to find or put things that need doing in Parrot.', 'TODO' ), $self->new_item( 'This is a description of the steps someone should follow when they have to prepare a new version for release.', diff --git a/lib/Parrot/Harness/DefaultTests.pm b/lib/Parrot/Harness/DefaultTests.pm index cc5997fe5d..33b742497a 100644 --- a/lib/Parrot/Harness/DefaultTests.pm +++ b/lib/Parrot/Harness/DefaultTests.pm @@ -6,30 +6,23 @@ Parrot::Harness::DefaultTests - Tests run by default by F =head1 DESCRIPTION -Upon request, this package exports six arrays holding various sets of paths to +Upon request, this package exports four arrays holding glob patterns for directories holding test files: @runcore_tests @core_tests @library_tests @configure_tests - @developing_tests - -Each of these arrays holds a list of paths containing wildcards which are -expanded by the shell when provided to programs such as F. The -paths describe directories holding test files. -Example: +The package also exports one array holding a list of test files: - @core_tests = qw( - t/run/*.t - t/src/*.t - t/perl/*.t - ); + @developing_tests +The definition of these lists is found in +F. -In addition, Parrot::Harness::Default Tests exports B one -subroutine: C. In list context, C +In addition, Parrot::Harness::DefaultTests exports B one +subroutine: C. In list context, C returns a list of shell-expandable paths to the most common tests. In scalar context it returns a reference to that list. @@ -56,50 +49,31 @@ our @EXPORT_OK = qw( @configure_tests @developing_tests ); +use lib qw( ./lib ); +use Parrot::Harness::TestSets qw( + %test_groups + @major_test_group + @near_core_test_group +); # runcore tests are always run. -@runcore_tests = qw( - t/compilers/imcc/*/*.t - t/op/*.t - t/pmc/*.t - t/oo/*.t - t/pir/*.t - t/native_pbc/*.t -); +@runcore_tests = @{ $test_groups{runcore} }; # core tests are run unless --runcore-tests is present. Typically # this list and the list above are run in response to --core-tests -@core_tests = qw( - t/src/*.t - t/src/embed/*.t - t/run/*.t - t/perl/*.t -); - +foreach my $el (@near_core_test_group) { + push @core_tests, @{$el}; +} # library tests are run unless --runcore-tests or --core-tests is present. -@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/compilers/opsc/*.t - t/compilers/data_json/*.t - t/dynoplibs/*.t - t/dynpmc/*.t - t/library/*.t - t/ext/winxed/*.t - t/tools/*.t - t/profiling/*.t -); +foreach my $el (@major_test_group) { + push @library_tests, @{$el}; +} # configure tests are tests to be run at the beginning of 'make test'; -@configure_tests = qw( t/configure/*.t t/steps/*.t t/postconfigure/*.t ); +@configure_tests = @{ $test_groups{configure} }; -@developing_tests = ( - ( glob 't/codingstd/*.t' ), -); +@developing_tests = glob("@{ $test_groups{codingstd} }"); sub get_common_tests { my ($longopts) = @_; diff --git a/lib/Parrot/Harness/Options.pm b/lib/Parrot/Harness/Options.pm index 377c359d65..4789933bb4 100644 --- a/lib/Parrot/Harness/Options.pm +++ b/lib/Parrot/Harness/Options.pm @@ -26,32 +26,26 @@ our @EXPORT_OK = qw( sub handle_long_options { my @argv = @_; - my %longopts; - $longopts{gc_debug} = grep { $_ eq '--gc-debug' } @argv; - @argv = grep { $_ ne '--gc-debug' } @argv; - - $longopts{core_tests_only} = grep { $_ eq '--core-tests' } @argv; - @argv = grep { $_ ne '--core-tests' } @argv; - - $longopts{runcore_tests_only} = grep { $_ eq '--runcore-tests' } @argv; - @argv = grep { $_ ne '--runcore-tests' } @argv; - - $longopts{html} = grep { $_ eq '--html' } @argv; - @argv = grep { $_ ne '--html' } @argv; - - $longopts{code} = grep { $_ eq '--code-tests' } @argv; - @argv = grep { $_ ne '--code-tests' } @argv; - - $longopts{run_exec} = grep { $_ eq '--run-exec' } @argv; - @argv = grep { $_ ne '--run-exec' } @argv; - - $longopts{help} = grep { $_ eq '--help' } @argv; - @argv = grep { $_ ne '--help' } @argv; + my %cl_to_longopt = ( + 'gc-debug' => 'gc_debug', + 'core-tests' => 'core_tests_only', + 'runcore-tests' => 'runcore_tests_only', + 'html' => 'html', + 'code-tests' => 'code', + 'run-exec' => 'run_exec', + 'help' => 'help', + 'archive' => 'archive', + 'html' => 'html', + ); - $longopts{archive} = grep { $_ eq '--archive' } @argv; - @argv = grep { $_ ne '--archive' } @argv; + my %longopts; + foreach my $k (keys %cl_to_longopt) { + my $cl_opt = '--' . $k; + $longopts{$cl_to_longopt{$k}} = grep { $_ eq $cl_opt } @argv; + @argv = grep { $_ ne $cl_opt } @argv; + } - if( $longopts{archive} ) { + if ( $longopts{archive} ) { $longopts{send_to_smolder} = grep { $_ eq '--send-to-smolder' } @argv; @argv = grep { $_ ne '--send-to-smolder' } @argv; } diff --git a/lib/Parrot/Harness/Smoke.pm b/lib/Parrot/Harness/Smoke.pm index a7cf3a8751..55d918de7b 100644 --- a/lib/Parrot/Harness/Smoke.pm +++ b/lib/Parrot/Harness/Smoke.pm @@ -96,7 +96,7 @@ my %SMOLDER_CONFIG = ( username => 'parrot-autobot', password => 'qa_rocks', project_id => 1, - report_file => ['parrot_test_run.tar.gz'], + report_file => ['t/archive/parrot_test_run.tar.gz'], ); # language implementations must pass their respective project id diff --git a/lib/Parrot/Harness/TestSets.pm b/lib/Parrot/Harness/TestSets.pm new file mode 100644 index 0000000000..5efc221f5c --- /dev/null +++ b/lib/Parrot/Harness/TestSets.pm @@ -0,0 +1,150 @@ +package Parrot::Harness::TestSets; +# Copyright (C) 2011, Parrot Foundation. + +use strict; +use warnings; + +# BASIC GROUPS + +our %test_groups = ( + benchmark => [ qw( + t/benchmark/*.t + ) ], + buildtools => [ qw( + t/tools/pmc2cutils/*.t + t/pharness/*.t + ) ], + codingstd => [ qw( + t/codingstd/*.t + ) ], + compilers => [ qw( + t/compilers/pct/*.t + t/compilers/pge/*.t + t/compilers/pge/p5regex/*.t + t/compilers/pge/perl6regex/*.t + t/compilers/tge/*.t + t/compilers/opsc/*.t + t/compilers/data_json/*.t + ) ], + configure => [ qw( + t/configure/*.t + t/steps/*.t + t/postconfigure/*.t + ) ], + distro => [ qw( + t/distro/*.t + ) ], + dynoplibs => [ qw( + t/dynoplibs/*.t + ) ], + dynpmc => [ qw( + t/dynpmc/*.t + ) ], + examples => [ qw( + t/examples/*.t + ) ], + headerizer => [ qw( + t/tools/dev/headerizer/*.t + ) ], + library => [ qw( + t/library/*.t + ) ], + manifest => [ qw( + t/manifest/*.t + t/tools/install/*.t + ) ], + miscellaneous => [ qw( + t/ext/winxed/*.t + t/tools/*.t + t/profiling/*.t + ) ], + perl => [ qw( + t/perl/*.t + ) ], + run => [ qw( + t/run/*.t + ) ], + runcore => [ qw( + t/compilers/imcc/*/*.t + t/op/*.t + t/pmc/*.t + t/oo/*.t + t/pir/*.t + t/native_pbc/*.t + ) ], + src => [ qw( + t/src/*.t + t/src/embed/*.t + ) ], + testing_runcore => [ qw( + t/oo/*.t + ) ], +); + +# GROUPS OF BASIC GROUPS + +our @major_test_group = map { $test_groups{$_} } + ( qw| compilers dynoplibs dynpmc library miscellaneous | ); + +our @near_core_test_group = map { $test_groups{$_} } + ( qw| src run perl | ); + +# EXPORT FUNCTIONALITY + +use base qw( Exporter ); +our @EXPORT_OK = qw( + %test_groups + @major_test_group + @near_core_test_group +); + +1; + +=head1 NAME + +Parrot::Harness::TestSets - Various groups of tests + +=head1 DESCRIPTION + +This package attempts to consolidate all assignments to groups of files used +during testing. It exports, on demand only, various arrays used in +F, other harnesses and the libraries underlying those programs. + +=head1 EXPORTED IDENTIFIERS + +=head2 C<%test_groups> + +Keys are labels like C. Values are references to arrays of file +glop patterns. Example: + + buildtools => [ qw( + t/tools/pmc2cutils/*.t + t/pharness/*.t + ] ), + +=head2 C<@major_test_group> + +Array holding elements of the values of these C<%test_groups> elements: + + compilers dynoplibs dynpmc library miscellaneous + +=head2 C<@near_core_test_group> + +Array holding elements of the values of these C<%test_groups> elements: + + src run perl + +=head1 HOW TO ADD A GROUP + +If you need to add a basic group, make up a label for the group to serve as +its key in C<%test_groups>. For its value, compose an array of file glob +patterns needed, each beginning with C. + +=cut + +# Local Variables: +# mode: cperl +# cperl-indent-level: 4 +# fill-column: 100 +# End: +# vim: expandtab shiftwidth=4: diff --git a/lib/Parrot/Headerizer.pm b/lib/Parrot/Headerizer.pm index 76cbd6ab49..08689f4e0b 100644 --- a/lib/Parrot/Headerizer.pm +++ b/lib/Parrot/Headerizer.pm @@ -1,5 +1,4 @@ -# Copyright (C) 2004-2011, Parrot Foundation. -# +# Copyright (C) 2004-2012, Parrot Foundation. package Parrot::Headerizer; @@ -123,6 +122,8 @@ sub new { PARROT_COLD PARROT_API + + PARROT_NO_ADDRESS_SAFETY_ANALYSIS ) }; return bless $args, $class; diff --git a/lib/Parrot/IO/File.pm b/lib/Parrot/IO/File.pm index 6601a07e70..446233ee83 100644 --- a/lib/Parrot/IO/File.pm +++ b/lib/Parrot/IO/File.pm @@ -1,4 +1,4 @@ -# Copyright (C) 2004-2006, Parrot Foundation. +# Copyright (C) 2004-2012, Parrot Foundation. =head1 NAME @@ -189,7 +189,7 @@ Returns whether the file is "hidden", i.e. its name starts with a dot. sub is_hidden { my $self = shift; - return $self->name =~ /^\./o; + return $self->name =~ /^\./; } =item C @@ -215,9 +215,9 @@ sub is_generated { # lib/Parrot/Config.pm return 1 - if $self->suffix =~ /^(?:dump|html|flag|o)$/o + if $self->suffix =~ /^(?:dump|html|flag|o)$/ or $self->name =~ -/^(?:perl6-config|libparrot.def|CFLAGS|myconfig|(?:core_pmcs|exec_(?:cpu|dep)|fingerprint|jit_(?:cpu|emit)|nci|platform(?:_interface)?)\.[ch]|(?:charclass|feature)\.h)$/o +/^(?:perl6-config|libparrot.def|CFLAGS|myconfig|(?:core_pmcs|exec_(?:cpu|dep)|fingerprint|jit_(?:cpu|emit)|nci|platform(?:_interface)?)\.[ch]|(?:charclass|feature)\.h)$/ or $self->parent->name eq 'ops' and $self->suffix =~ /^(?:c|pod)$/; return 0; diff --git a/lib/Parrot/IO/Path.pm b/lib/Parrot/IO/Path.pm index c8d427a83d..51a45a244c 100644 --- a/lib/Parrot/IO/Path.pm +++ b/lib/Parrot/IO/Path.pm @@ -1,4 +1,4 @@ -# Copyright (C) 2004-2006, Parrot Foundation. +# Copyright (C) 2004-2012, Parrot Foundation. =head1 NAME @@ -140,7 +140,7 @@ sub name_without_suffix { my $self = shift; my $name = $self->name; - $name =~ s/\.[^\.]*$//o; + $name =~ s/\.[^\.]*$//; return $name; } diff --git a/lib/Parrot/Install.pm b/lib/Parrot/Install.pm index 931533e869..ee27d5a071 100644 --- a/lib/Parrot/Install.pm +++ b/lib/Parrot/Install.pm @@ -224,7 +224,7 @@ sub install_files { } else { next unless -e $src; - next if $^O eq 'cygwin' and -e "$src.exe"; # stat works, copy not + next if ($^O eq 'cygwin' || $^O eq 'msys') and -e "$src.exe"; # stat works, copy not if (-l $src) { # a link should be created # check if the system supports symbolic linking use Config; diff --git a/lib/Parrot/Manifest.pm b/lib/Parrot/Manifest.pm index df9183e062..40b4ab47e3 100644 --- a/lib/Parrot/Manifest.pm +++ b/lib/Parrot/Manifest.pm @@ -1,4 +1,4 @@ -# Copyright (C) 2007-2011, Parrot Foundation. +# Copyright (C) 2007-2012, Parrot Foundation. =head1 NAME @@ -31,6 +31,7 @@ use strict; use warnings; use Carp; use File::Basename; +use Parrot::BuildUtil; =head1 METHODS @@ -227,7 +228,6 @@ sub _get_special { DEPRECATED.yaml [devel]doc DONORS.pod [main]doc LICENSE [main]doc - NEWS [main]doc PBC_COMPAT [main]doc PLATFORMS [devel]doc README [devel]doc @@ -263,9 +263,9 @@ sub _get_current_files { while ( my $line = <$FILE> ) { chomp $line; - next if $line =~ /^\s*$/o; + next if $line =~ /^\s*$/; - next if $line =~ /^#/o; + next if $line =~ /^#/; my ($file) = split /\s+/, $line; $current_files{ $file }++; @@ -362,11 +362,10 @@ sub print_manifest_skip { sub _get_ignores { my $self = shift; - # HACK: Make this portable - my $gitignore = `cat .gitignore| grep -v '^#'`; + my $gitignore = Parrot::BuildUtil::slurp_file('.gitignore'); my %ignores; - my @ignore = sort grep { $_ } split( /\n/, $gitignore ); + my @ignore = sort grep { $_ !~ /^#/ } split( /\n/, $gitignore ); for my $ignore (@ignore) { my ($dirname, $basename) = (dirname($ignore), basename($ignore)); @@ -426,8 +425,8 @@ sub _get_current_skips { or die "Unable to open $self->{skip} for reading"; while ( my $line = <$SKIP> ) { chomp $line; - next if $line =~ /^\s*$/o; - next if $line =~ /^#/o; + next if $line =~ /^\s*$/; + next if $line =~ /^#/; $current_skips{$line}++; } close $SKIP or die "Unable to close $self->{skip} after reading"; @@ -442,8 +441,8 @@ sub _get_proposed_skips { my @proposed_lines = split /\n/, $print_str; my %proposed_skips = (); for my $line (@proposed_lines) { - next if $line =~ /^\s*$/o; - next if $line =~ /^#/o; + next if $line =~ /^\s*$/; + next if $line =~ /^#/; $proposed_skips{$line}++; } diff --git a/lib/Parrot/Pmc2c/PMC.pm b/lib/Parrot/Pmc2c/PMC.pm index 2c36fc65ee..d23a011890 100644 --- a/lib/Parrot/Pmc2c/PMC.pm +++ b/lib/Parrot/Pmc2c/PMC.pm @@ -1,4 +1,4 @@ -# Copyright (C) 2004-2011, Parrot Foundation. +# Copyright (C) 2004-2012, Parrot Foundation. =head1 NAME @@ -71,7 +71,7 @@ sub dump { # gen_parent_lookup_info( $self, $pmc2cMain, $pmcs ); # gen_parent_reverse_lookup_info( $self, $pmcs, $vtable_dump ); - Storable::store( $self, $self->filename('.dump') ); + Storable::nstore( $self, $self->filename('.dump') ); } # methods @@ -598,9 +598,9 @@ in the PMC's C header file. sub hdecls { my ($self) = @_; - my $hout; - my $name = $self->name; - my $lc_name = $self->name; + my $hout = ''; + my $name = $self->name; + my $lc_name = lc($name); # generate decls for all vtables in this PMC foreach my $vt_method_name ( @{ $self->vtable->names } ) { @@ -1103,23 +1103,23 @@ EOC vt->isa_hash = Parrot_${classname}_get_isa(interp, NULL); EOC - for my $k ( keys %extra_vt ) { + for my $k ( sort keys %extra_vt ) { my $k_flags = $self->$k->vtable_flags; + my $var = "vt_$k"; $cout .= <<"EOC"; { - VTABLE *vt_$k; - 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; - vt_${k}->whoami = vt->whoami; - vt_${k}->provides_str = vt->provides_str; - vt->${k}_variant_vtable = vt_${k}; - vt_${k}->${k}_variant_vtable = vt; - vt_${k}->isa_hash = vt->isa_hash; + VTABLE * const $var = Parrot_${classname}_${k}_get_vtable(interp); + ${var}->base_type = $enum_name; + ${var}->flags = $k_flags; + + ${var}->attribute_defs = attr_defs; + + ${var}->base_type = entry; + ${var}->whoami = vt->whoami; + ${var}->provides_str = vt->provides_str; + vt->${k}_variant_vtable = ${var}; + ${var}->${k}_variant_vtable = vt; + ${var}->isa_hash = vt->isa_hash; } EOC @@ -1177,14 +1177,14 @@ EOC { STRING * const method_name = CONST_STRING_GEN(interp, "$symbol_name"); STRING * const signature = CONST_STRING_GEN(interp, "$pcc_signature"); - register_native_pcc_method_in_ns(interp, entry, + Parrot_interp_register_native_pcc_method_in_ns(interp, entry, F2DPTR(Parrot_${classname}_${method_name}), method_name, signature); } EOC if ( $method->{attrs}{write} ) { $cout .= <<"EOC"; - Parrot_mark_method_writes(interp, entry, "$symbol_name"); + Parrot_interp_mark_method_writes(interp, entry, "$symbol_name"); EOC } } @@ -1344,9 +1344,7 @@ PMC* Parrot_${classname}_get_mro(PARROT_INTERP, ARGMOD(PMC* mro)) { mro = Parrot_pmc_new(interp, enum_class_ResizableStringArray); } $get_mro - VTABLE_unshift_string(interp, mro, - Parrot_str_new_init(interp, "$classname", @{[length($classname)]}, - Parrot_default_encoding_ptr, 0)); + VTABLE_unshift_string(interp, mro, CONST_STRING_GEN(interp, "$classname")); return mro; } diff --git a/lib/Parrot/Pmc2c/PMC/Object.pm b/lib/Parrot/Pmc2c/PMC/Object.pm index 7b8f84d1d7..13c7ff5291 100644 --- a/lib/Parrot/Pmc2c/PMC/Object.pm +++ b/lib/Parrot/Pmc2c/PMC/Object.pm @@ -67,7 +67,13 @@ EOC PMC * const meth = Parrot_oo_find_vtable_override_for_class(interp, cur_class, meth_name); if (!PMC_IS_NULL(meth)) { EOC + $method_body_text .= " $pcc_result_decl\n" if $pcc_result_decl ne ''; + + # Dereference any Key contents + $method_body_text .= " key = clone_key_arg(interp, key);\n" + if $vt_method_name =~ /_keyed$/; + $method_body_text .= <<"EOC"; Parrot_ext_call(interp, meth, "Pi$pcc_sig", _self$pcc_args); $pcc_return_stmt diff --git a/lib/Parrot/Pmc2c/PMC/RO.pm b/lib/Parrot/Pmc2c/PMC/RO.pm index 68d397b474..8b476df837 100644 --- a/lib/Parrot/Pmc2c/PMC/RO.pm +++ b/lib/Parrot/Pmc2c/PMC/RO.pm @@ -32,7 +32,7 @@ sub new { { # autogenerate for nonstandard types - # (TT #1240: is this appropriate or do we want them to each be + # (GH #619: is this appropriate or do we want them to each be # explicitly cleared to have RO ?) no strict 'refs'; if ( !@{ ref($self) . '::ISA' } ) { diff --git a/lib/Parrot/Pmc2c/PMC/default.pm b/lib/Parrot/Pmc2c/PMC/default.pm index 516bc08516..4fba4aee62 100644 --- a/lib/Parrot/Pmc2c/PMC/default.pm +++ b/lib/Parrot/Pmc2c/PMC/default.pm @@ -59,7 +59,7 @@ static PMC * Parrot_default_ro_find_method(PARROT_INTERP, ARGMOD(PMC *_self), ARGMOD(STRING *method_name)) { /* Use non-readonly find_method. Current vtable is ro variant. So ro_variant contains non-ro variant */ PMC *const method = _self->vtable->ro_variant_vtable->find_method(interp, _self, method_name); - if (!PMC_IS_NULL(VTABLE_getprop(interp, method, CONST_STRING_GEN(interp, "write")))) + if (!PMC_IS_NULL(Parrot_pmc_getprop(interp, method, CONST_STRING_GEN(interp, "write")))) return PMCNULL; else return method; diff --git a/lib/Parrot/Pmc2c/UtilFunctions.pm b/lib/Parrot/Pmc2c/UtilFunctions.pm index 1928b280cd..0e2eeda6cb 100644 --- a/lib/Parrot/Pmc2c/UtilFunctions.pm +++ b/lib/Parrot/Pmc2c/UtilFunctions.pm @@ -159,7 +159,7 @@ EOC int pass; /* create a library PMC */ - pmc = Parrot_pmc_new_constant(interp, enum_class_ParrotLibrary); + pmc = Parrot_pmc_new(interp, enum_class_ParrotLibrary); /* TODO: stuff some info into this PMC's props */ diff --git a/lib/Parrot/Pmc2c/VTable.pm b/lib/Parrot/Pmc2c/VTable.pm index b194aebb10..702cae5d41 100644 --- a/lib/Parrot/Pmc2c/VTable.pm +++ b/lib/Parrot/Pmc2c/VTable.pm @@ -53,7 +53,7 @@ sub dump { my $dump_filename = cwd() . q{/} . basename( Parrot::Pmc2c::UtilFunctions::filename( $self->filename, '.dump' ) ); - Storable::store( $self, $dump_filename ); + Storable::nstore( $self, $dump_filename ); return $dump_filename; } diff --git a/lib/Parrot/SearchOps.pm b/lib/Parrot/SearchOps.pm index 764253cad0..e40e504985 100644 --- a/lib/Parrot/SearchOps.pm +++ b/lib/Parrot/SearchOps.pm @@ -1,14 +1,17 @@ +# Copyright (C) 2008-2011, Parrot Foundation. + package Parrot::SearchOps; -# Copyright (C) 2008, Parrot Foundation. use strict; use warnings; +use lib qw(lib); use Exporter; use Text::Wrap; -use lib qw( ./lib ); -use Parrot::Configure::Utils qw( _slurp ); -our @ISA = qw( Exporter ); + +use Parrot::Configure::Utils qw(_slurp); + +our @ISA = qw(Exporter); our @EXPORT_OK = qw( search_all_ops_files help @@ -103,7 +106,7 @@ sub _handle_indices { sub usage { print < perl tools/dev/search-ops.pl load +> perl tools/dev/search_ops.pl load ---------------------------------------------------------------------- File: core.ops - Parrot Core Ops (2 matches) @@ -143,7 +146,7 @@ HELP =head1 NAME -Parrot::SearchOps - functions used in tools/dev/search-ops.pl +Parrot::SearchOps - functions used in tools/dev/search_ops.pl =head1 SYNOPSIS @@ -164,7 +167,7 @@ Parrot::SearchOps - functions used in tools/dev/search-ops.pl =head1 DESCRIPTION This package provides functionality for the Perl 5 program -F, designed to replace the Python program +F, designed to replace the Python program F. It exports two subroutines on demand. =head2 C @@ -183,12 +186,12 @@ C. =item * $wrap_width -In F, this is set to C<70> characters. Can be varied +In F, this is set to C<70> characters. Can be varied during testing or development. =item * $opsdir -In F, this is set to F. Can be varied +In F, this is set to F. Can be varied during testing or development. =back @@ -198,7 +201,7 @@ files. =head2 C -B Display usage statement for F. +B Display usage statement for F. B None. @@ -206,7 +209,7 @@ C Implicitly returns true upon success. =head2 C -B Display usage statement and more complete help message for F. +B Display usage statement and more complete help message for F. B None. diff --git a/lib/Parrot/Test/PIR_PGE.pm b/lib/Parrot/Test/PIR_PGE.pm deleted file mode 100644 index 52aaa22b4a..0000000000 --- a/lib/Parrot/Test/PIR_PGE.pm +++ /dev/null @@ -1,87 +0,0 @@ - -# Copyright (C) 2007-2008, Parrot Foundation. - -package Parrot::Test::PIR_PGE; - -use strict; -use warnings; - -use File::Basename; -use File::Spec (); - -=head1 NAME - -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 ... - -This module is named PIR_PGE, because PIR is a "reserved" name, -for internal use only. - -=cut - -sub new { - return bless {}; -} - -my %language_test_map = ( - output_is => 'is_eq', - output_like => 'like', - output_isnt => 'isnt_eq' -); - -foreach my $func ( keys %language_test_map ) { - no strict 'refs'; ## no critic - - *{"Parrot::Test::PIR_PGE::$func"} = sub { - my $self = shift; - my ( $code, $output, $desc ) = @_; - - my $count = $self->{builder}->current_test + 1; - - my $lang_f = File::Spec->rel2abs( Parrot::Test::per_test( '.pir', $count ) ); - Parrot::Test::write_code_to_file( $code, $lang_f ); - - my $args = $ENV{TEST_PROG_ARGS} || ''; - my $cmd = "$self->{parrot} $args languages/PIR/pir.pbc $lang_f"; - - my $out_f = File::Spec->rel2abs( Parrot::Test::per_test( '.out', $count ) ); - my $exit_code = Parrot::Test::run_command( - $cmd, - CD => $self->{relpath}, - STDOUT => $out_f, - STDERR => $out_f - ); - my $file = Parrot::Test::slurp_file($out_f); - my $builder_func = $language_test_map{$func}; - - my $pass; - { - no strict 'refs'; - - $pass = - $self->{builder}->$builder_func( Parrot::Test::slurp_file($out_f), $output, $desc ); - $self->{builder}->diag("'$cmd' failed with exit code $exit_code") - if $exit_code and not $pass; - } - - unless ( $ENV{POSTMORTEM} ) { - unlink $lang_f; - unlink $out_f; - } - - return $pass; - }; -} - -1; - -# Local Variables: -# mode: cperl -# cperl-indent-level: 4 -# fill-column: 100 -# End: -# vim: expandtab shiftwidth=4: diff --git a/lib/Parrot/Test/Pod.pm b/lib/Parrot/Test/Pod.pm index dcc67b67b5..02bd135d7f 100644 --- a/lib/Parrot/Test/Pod.pm +++ b/lib/Parrot/Test/Pod.pm @@ -62,15 +62,15 @@ our %second_analysis_subs = ( # skip file which includes malformed POD for # other testing purposes if ($full_file =~ m{ - t/tools/dev/searchops/samples\.pm + t/tools/dev/search_ops/samples\.pm | languages/pod/test\.pod | examples/config/file/configcompiler - | t/configure/testlib/verbosefoobar + | examples/config/file/configwithfatalstep + | examples/config/file/configverbose | t/configure/testlib/ddefectivefoobar | t/configure/testlib/adefectivefoobar | t/configure/testlib/cdefectivefoobar | t/configure/testlib/bdefectivefoobar - | examples/config/file/configwithfatalstep | compilers/opsc }x ) { diff --git a/lib/Parrot/Test/Util.pm b/lib/Parrot/Test/Util.pm index 0d3981070c..e376592a82 100644 --- a/lib/Parrot/Test/Util.pm +++ b/lib/Parrot/Test/Util.pm @@ -50,6 +50,13 @@ as (likely invalid) unicode escape codes. sub create_tempfile { my ($filehandle, $filename) = &tempfile; + # expand msys virtual paths + if($^O eq 'msys') { + my $tmpdir = `cd /tmp && pwd -W`; + chomp $tmpdir; + $filename =~ s/^\/tmp\//$tmpdir\//; + } + $filename =~ s/\\/\//g; return ($filehandle, $filename); diff --git a/lib/Pod/Simple.pm b/lib/Pod/Simple.pm index b30e926acc..fbe0305dce 100644 --- a/lib/Pod/Simple.pm +++ b/lib/Pod/Simple.pm @@ -5,7 +5,7 @@ use strict; use Carp (); BEGIN { *DEBUG = sub () {0} unless defined &DEBUG } use integer; -use Pod::Escapes 1.03 (); +use Pod::Escapes 1.04 (); use Pod::Simple::LinkSection (); use Pod::Simple::BlackBox (); #use utf8; @@ -18,7 +18,7 @@ use vars qw( ); @ISA = ('Pod::Simple::BlackBox'); -$VERSION = '3.07'; +$VERSION = '3.19'; @Known_formatting_codes = qw(I B C L E F S X Z); %Known_formatting_codes = map(($_=>1), @Known_formatting_codes); @@ -67,7 +67,7 @@ __PACKAGE__->_accessorize( 'hide_line_numbers', # For some dumping subclasses: whether to pointedly # suppress the start_line attribute - + 'line_count', # the current line number 'pod_para_count', # count of pod paragraphs seen so far @@ -80,13 +80,12 @@ __PACKAGE__->_accessorize( 'bare_output', # For some subclasses: whether to prepend # header-code and postpend footer-code - 'fullstop_space_harden', # Whether to turn ". " into ".[nbsp] "; - 'nix_X_codes', # whether to ignore X<...> codes 'merge_text', # whether to avoid breaking a single piece of # text up into several events 'preserve_whitespace', # whether to try to keep whitespace as-is + 'strip_verbatim_indent', # What indent to strip from verbatim 'content_seen', # whether we've seen any real Pod content 'errors_seen', # TODO: document. whether we've seen any errors (fatal or not) @@ -95,10 +94,14 @@ __PACKAGE__->_accessorize( 'code_handler', # coderef to call when a code (non-pod) line is seen 'cut_handler', # coderef to call when a =cut line is seen + 'pod_handler', # coderef to call when a =pod line is seen #Called like: # $code_handler->($line, $self->{'line_count'}, $self) if $code_handler; # $cut_handler->($line, $self->{'line_count'}, $self) if $cut_handler; - + # $pod_handler->($line, $self->{'line_count'}, $self) if $pod_handler; + + 'parse_empty_lists', # whether to acknowledge empty =over/=back blocks + ); #@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ @@ -357,7 +360,8 @@ sub parse_string_document { next unless defined $line_group and length $line_group; pos($line_group) = 0; while($line_group =~ - m/([^\n\r]*)((?:\r?\n)?)/g + m/([^\n\r]*)(\r?\n?)/g # supports \r, \n ,\r\n + #m/([^\n\r]*)((?:\r?\n)?)/g ) { #print(">> $1\n"), $self->parse_lines($1) @@ -398,7 +402,7 @@ sub parse_file { } else { { local *PODSOURCE; - open(PODSOURCE, "<", "$source") || Carp::croak("Can't open $source: $!"); + open(PODSOURCE, "<$source") || Carp::croak("Can't open $source: $!"); $self->{'source_filename'} = $source; $source = *PODSOURCE{IO}; } @@ -407,16 +411,30 @@ sub parse_file { # By here, $source is a FH. $self->{'source_fh'} = $source; - + my($i, @lines); until( $self->{'source_dead'} ) { splice @lines; + for($i = MANY_LINES; $i--;) { # read those many lines at a time local $/ = $NL; push @lines, scalar(<$source>); # readline last unless defined $lines[-1]; # but pass thru the undef, which will set source_dead to true } + + my $at_eof = ! $lines[-1]; # keep track of the undef + pop @lines if $at_eof; # silence warnings + + # be eol agnostic + s/\r\n?/\n/g for @lines; + + # make sure there are only one line elements for parse_lines + @lines = split(/(?<=\n)/, join('', @lines)); + + # push the undef back after popping it to set source_dead to true + push @lines, undef if $at_eof; + $self->parse_lines(@lines); } delete($self->{'source_fh'}); # so it can be GC'd @@ -452,7 +470,7 @@ sub parse_from_file { require Symbol; my $out_fh = Symbol::gensym(); DEBUG and print "Write-opening to $to\n"; - open($out_fh, ">", "$to") or Carp::croak "Can't write-open $to: $!"; + open($out_fh, ">$to") or Carp::croak "Can't write-open $to: $!"; binmode($out_fh) if $self->can('write_with_binmode') and $self->write_with_binmode; $self->output_fh($out_fh); @@ -475,7 +493,7 @@ sub whine { return $self->_complain_errata(@_); } -sub scream { # like whine, but not suppressable +sub scream { # like whine, but not suppressible #my($self,$line,$complaint) = @_; my $self = shift(@_); ++$self->{'errors_seen'}; @@ -983,7 +1001,7 @@ sub _treat_Ls { # Process our dear dear friends, the L<...> sequences # L or L # L or L or L # L - # Ltext|scheme:...> + # L my($self,@stack) = @_; diff --git a/lib/Pod/Simple.pod b/lib/Pod/Simple.pod new file mode 100644 index 0000000000..a8ad211d3b --- /dev/null +++ b/lib/Pod/Simple.pod @@ -0,0 +1,395 @@ + +=head1 NAME + +Pod::Simple - framework for parsing Pod + +=head1 SYNOPSIS + + TODO + +=head1 DESCRIPTION + +Pod::Simple is a Perl library for parsing text in the Pod ("plain old +documentation") markup language that is typically used for writing +documentation for Perl and for Perl modules. The Pod format is explained +L; the most common formatter is called C. + +Pod formatters can use Pod::Simple to parse Pod documents and render them into +plain text, HTML, or any number of other formats. Typically, such formatters +will be subclasses of Pod::Simple, and so they will inherit its methods, like +C. + +If you're reading this document just because you have a Pod-processing +subclass that you want to use, this document (plus the documentation for the +subclass) is probably all you need to read. + +If you're reading this document because you want to write a formatter +subclass, continue reading it and then read L, and +then possibly even read L (some of which is for parser-writers, +but much of which is notes to formatter-writers). + +=head1 MAIN METHODS + +=over + +=item C<< $parser = I->new(); >> + +This returns a new parser object, where I> is a subclass +of Pod::Simple. + +=item C<< $parser->output_fh( *OUT ); >> + +This sets the filehandle that C<$parser>'s output will be written to. +You can pass C<*STDOUT>, otherwise you should probably do something +like this: + + my $outfile = "output.txt"; + open TXTOUT, ">$outfile" or die "Can't write to $outfile: $!"; + $parser->output_fh(*TXTOUT); + +...before you call one of the C<< $parser->parse_I >> methods. + +=item C<< $parser->output_string( \$somestring ); >> + +This sets the string that C<$parser>'s output will be sent to, +instead of any filehandle. + + +=item C<< $parser->parse_file( I<$some_filename> ); >> + +=item C<< $parser->parse_file( *INPUT_FH ); >> + +This reads the Pod content of the file (or filehandle) that you specify, +and processes it with that C<$parser> object, according to however +C<$parser>'s class works, and according to whatever parser options you +have set up for this C<$parser> object. + +=item C<< $parser->parse_string_document( I<$all_content> ); >> + +This works just like C except that it reads the Pod +content not from a file, but from a string that you have already +in memory. + +=item C<< $parser->parse_lines( I<...@lines...>, undef ); >> + +This processes the lines in C<@lines> (where each list item must be a +defined value, and must contain exactly one line of content -- so no +items like C<"foo\nbar"> are allowed). The final C is used to +indicate the end of document being parsed. + +The other C> methods are meant to be called only once +per C<$parser> object; but C can be called as many times per +C<$parser> object as you want, as long as the last call (and only +the last call) ends with an C value. + + +=item C<< $parser->content_seen >> + +This returns true only if there has been any real content seen for this +document. Returns false in cases where the document contains content, +but does not make use of any Pod markup. + +=item C<< I->filter( I<$filename> ); >> + +=item C<< I->filter( I<*INPUT_FH> ); >> + +=item C<< I->filter( I<\$document_content> ); >> + +This is a shortcut method for creating a new parser object, setting the +output handle to STDOUT, and then processing the specified file (or +filehandle, or in-memory document). This is handy for one-liners like +this: + + perl -MPod::Simple::Text -e "Pod::Simple::Text->filter('thingy.pod')" + +=back + + + +=head1 SECONDARY METHODS + +Some of these methods might be of interest to general users, as +well as of interest to formatter-writers. + +Note that the general pattern here is that the accessor-methods +read the attribute's value with C<< $value = $parser->I >> +and set the attribute's value with +C<< $parser->I(I) >>. For each accessor, I typically +only mention one syntax or another, based on which I think you are actually +most likely to use. + + +=over + +=item C<< $parser->no_whining( I ) >> + +If you set this attribute to a true value, you will suppress the +parser's complaints about irregularities in the Pod coding. By default, +this attribute's value is false, meaning that irregularities will +be reported. + +Note that turning this attribute to true won't suppress one or two kinds +of complaints about rarely occurring unrecoverable errors. + + +=item C<< $parser->no_errata_section( I ) >> + +If you set this attribute to a true value, you will stop the parser from +generating a "POD ERRORS" section at the end of the document. By +default, this attribute's value is false, meaning that an errata section +will be generated, as necessary. + + +=item C<< $parser->complain_stderr( I ) >> + +If you set this attribute to a true value, it will send reports of +parsing errors to STDERR. By default, this attribute's value is false, +meaning that no output is sent to STDERR. + +Setting C also sets C. + + +=item C<< $parser->source_filename >> + +This returns the filename that this parser object was set to read from. + + +=item C<< $parser->doc_has_started >> + +This returns true if C<$parser> has read from a source, and has seen +Pod content in it. + + +=item C<< $parser->source_dead >> + +This returns true if C<$parser> has read from a source, and come to the +end of that source. + +=item C<< $parser->strip_verbatim_indent( I ) >> + +The perlpod spec for a Verbatim paragraph is "It should be reproduced +exactly...", which means that the whitespace you've used to indent your +verbatim blocks will be preserved in the output. This can be annoying for +outputs such as HTML, where that whitespace will remain in front of every +line. It's an unfortunate case where syntax is turned into semantics. + +If the POD your parsing adheres to a consistent indentation policy, you can +have such indentation stripped from the beginning of every line of your +verbatim blocks. This method tells Pod::Simple what to strip. For two-space +indents, you'd use: + + $parser->strip_verbatim_indent(' '); + +For tab indents, you'd use a tab character: + + $parser->strip_verbatim_indent("\t"); + +If the POD is inconsistent about the indentation of verbatim blocks, but you +have figured out a heuristic to determine how much a particular verbatim block +is indented, you can pass a code reference instead. The code reference will be +executed with one argument, an array reference of all the lines in the +verbatim block, and should return the value to be stripped from each line. For +example, if you decide that you're fine to use the first line of the verbatim +block to set the standard for indentation of the rest of the block, you can +look at the first line and return the appropriate value, like so: + + $new->strip_verbatim_indent(sub { + my $lines = shift; + (my $indent = $lines->[0]) =~ s/\S.*//; + return $indent; + }); + +If you'd rather treat each line individually, you can do that, too, by just +transforming them in-place in the code reference and returning C. Say +that you don't want I lines indented. You can do something like this: + + $new->strip_verbatim_indent(sub { + my $lines = shift; + sub { s/^\s+// for @{ $lines }, + return undef; + }); + +=back + +=head1 TERTIARY METHODS + +=over + +=item C<< $parser->abandon_output_fh() >>X + +Cancel output to the file handle. Any POD read by the C<$parser> is not +effected. + +=item C<< $parser->abandon_output_string() >>X + +Cancel output to the output string. Any POD read by the C<$parser> is not +effected. + +=item C<< $parser->accept_code( @codes ) >>X + +Alias for L<< accept_codes >>. + +=item C<< $parser->accept_codes( @codes ) >>X + +Allows C<$parser> to accept a list of L. This can be +used to implement user-defined codes. + +=item C<< $parser->accept_directive_as_data( @directives ) >>X + +Allows C<$parser> to accept a list of directives for data paragraphs. A +directive is the label of a L. A data paragraph is +one delimited by C<< =begin/=for/=end >> directives. This can be used to +implement user-defined directives. + +=item C<< $parser->accept_directive_as_processed( @directives ) >>X + +Allows C<$parser> to accept a list of directives for processed paragraphs. A +directive is the label of a L. A processed +paragraph is also known as L. This can be used to +implement user-defined directives. + +=item C<< $parser->accept_directive_as_verbatim( @directives ) >>X + +Allows C<$parser> to accept a list of directives for L. A directive is the label of a L. This +can be used to implement user-defined directives. + +=item C<< $parser->accept_target( @targets ) >>X + +Alias for L<< accept_targets >>. + +=item C<< $parser->accept_target_as_text( @targets ) >>X + +Alias for L<< accept_targets_as_text >>. + +=item C<< $parser->accept_targets( @targets ) >>X + +Accepts targets for C<< =begin/=for/=end >> sections of the POD. + +=item C<< $parser->accept_targets_as_text( @targets ) >>X + +Accepts targets for C<< =begin/=for/=end >> sections that should be parsed as +POD. For details, see L<< perlpodspec/About Data Paragraphs >>. + +=item C<< $parser->any_errata_seen() >>X + +Used to check if any errata was seen. + +I + + die "too many errors\n" if $parser->any_errata_seen(); + +=item C<< $parser->parse_from_file( $source, $to ) >>X + +Parses from C<$source> file to C<$to> file. Similar to L<< +Pod::Parser/parse_from_file >>. + +=item C<< $parser->scream( @error_messages ) >>X + +Log an error that can't be ignored. + +=item C<< $parser->unaccept_code( @codes ) >>X + +Alias for L<< unaccept_codes >>. + +=item C<< $parser->unaccept_codes( @codes ) >>X + +Removes C<< @codes >> as valid codes for the parse. + +=item C<< $parser->unaccept_directive( @directives ) >>X + +Alias for L<< unaccept_directives >>. + +=item C<< $parser->unaccept_directives( @directives ) >>X + +Removes C<< @directives >> as valid directives for the parse. + +=item C<< $parser->unaccept_target( @targets ) >>X + +Alias for L<< unaccept_targets >>. + +=item C<< $parser->unaccept_targets( @targets ) >>X + +Removes C<< @targets >> as valid targets for the parse. + +=item C<< $parser->version_report() >>X + +Returns a string describing the version. + +=item C<< $parser->whine( @error_messages ) >>X + +Log an error unless C<< $parser->no_whining( TRUE ); >>. + +=back + +=head1 CAVEATS + +This is just a beta release -- there are a good number of things still +left to do. Notably, support for EBCDIC platforms is still half-done, +an untested. + + +=head1 SEE ALSO + +L + +L + +L + +L + +L + +=head1 SUPPORT + +Questions or discussion about POD and Pod::Simple should be sent to the +pod-people@perl.org mail list. Send an empty email to +pod-people-subscribe@perl.org to subscribe. + +This module is managed in an open GitHub repository, +L. Feel free to fork and contribute, or +to clone L and send patches! + +Patches against Pod::Simple are welcome. Please send bug reports to +. + +=head1 COPYRIGHT AND DISCLAIMERS + +Copyright (c) 2002 Sean M. Burke. + +This library is free software; you can redistribute it and/or modify it +under the same terms as Perl itself. + +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. + +=head1 AUTHOR + +Pod::Simple was created by Sean M. Burke . +But don't bother him, he's retired. + +Pod::Simple is maintained by: + +=over + +=item * Allison Randal C + +=item * Hans Dieter Pearcey C + +=item * David E. Wheeler C + +=back + +Documentation has been contributed by: + +=over + +=item * Gabor Szabo C + +=item * Shawn H Corey C + +=back + +=cut diff --git a/lib/Pod/Simple/BlackBox.pm b/lib/Pod/Simple/BlackBox.pm index 4804973a2e..4b4b0866bc 100644 --- a/lib/Pod/Simple/BlackBox.pm +++ b/lib/Pod/Simple/BlackBox.pm @@ -22,6 +22,9 @@ package Pod::Simple::BlackBox; use integer; # vroom! use strict; use Carp (); +use vars qw($VERSION ); +$VERSION = '3.19'; +#use constant DEBUG => 7; BEGIN { require Pod::Simple; *DEBUG = \&Pod::Simple::DEBUG unless defined &DEBUG @@ -85,8 +88,8 @@ sub parse_lines { # Usage: $parser->parse_lines(@lines) DEBUG > 2 and print "First line: [$source_line]\n"; if( ($line = $source_line) =~ s/^\xEF\xBB\xBF//s ) { - DEBUG and print "UTF-8 BOM seen. Faking a '=encode utf8'.\n"; - $self->_handle_encoding_line( "=encode utf8" ); + DEBUG and print "UTF-8 BOM seen. Faking a '=encoding utf8'.\n"; + $self->_handle_encoding_line( "=encoding utf8" ); $line =~ tr/\n\r//d; } elsif( $line =~ s/^\xFE\xFF//s ) { @@ -516,7 +519,7 @@ sub _ponder_paragraph_buffer { # don't require any lookahead, but all others (bullets # and numbers) do. -# TODO: winge about many kinds of directives in non-resolving =for regions? +# TODO: whinge about many kinds of directives in non-resolving =for regions? # TODO: many? like what? =head1 etc? $para = shift @$paras; @@ -1089,7 +1092,18 @@ sub _ponder_pod { "=pod directives shouldn't be over one line long! Ignoring all " . (@$para - 2) . " lines of content" ) if @$para > 3; - # Content is always ignored. + + # Content ignored unless 'pod_handler' is set + if (my $pod_handler = $self->{'pod_handler'}) { + my ($line_num, $line) = map $_, $para->[1]{'start_line'}, $para->[2]; + $line = $line eq '' ? "=pod" : "=pod $line"; # imitate cut_handler output + $pod_handler->($line, $line_num, $self); + } + + # The surrounding methods set content_seen, so let us remain consistent. + # I do not know why it was not here before -- should it not be here? + # $self->{'content_seen'} ||= 1; + return; } @@ -1102,10 +1116,13 @@ sub _ponder_over { $list_type = $self->_get_initial_item_type($paras->[0]); } elsif($paras->[0][0] eq '=back') { - # Ignore empty lists. TODO: make this an option? - shift @$paras; - return 1; - + # Ignore empty lists by default + if ($self->{'parse_empty_lists'}) { + $list_type = 'empty'; + } else { + shift @$paras; + return 1; + } } elsif($paras->[0][0] eq '~end') { $self->whine( $para->[1]{'start_line'}, @@ -1369,8 +1386,19 @@ sub _ponder_Verbatim { DEBUG and print " giving verbatim treatment...\n"; $para->[1]{'xml:space'} = 'preserve'; + + my $indent = $self->strip_verbatim_indent; + if ($indent && ref $indent eq 'CODE') { + my @shifted = (shift @{$para}, shift @{$para}); + $indent = $indent->($para); + unshift @{$para}, @shifted; + } + for(my $i = 2; $i < @$para; $i++) { foreach my $line ($para->[$i]) { # just for aliasing + # Strip indentation. + $line =~ s/^\Q$indent// if $indent + && !($self->{accept_codes} && $self->{accept_codes}{VerbatimFormatted}); while( $line =~ # Sort of adapted from Text::Tabs -- yes, it's hardwired in that # tabs are at every EIGHTH column. For portability, it has to be @@ -1614,8 +1642,6 @@ sub _treelet_from_formatting_codes { my $treelet = ['~Top', {'start_line' => $start_line},]; unless ($preserve_space || $self->{'preserve_whitespace'}) { - $para =~ s/\. /\.\xA0 /g if $self->{'fullstop_space_harden'}; - $para =~ s/\s+/ /g; # collapse and trim all whitespace first. $para =~ s/ $//; $para =~ s/^ //; @@ -1733,7 +1759,7 @@ sub _treelet_from_formatting_codes { pop @lineage; } elsif(defined $5) { - DEBUG > 3 and print "Found apparent simple end-text code \"$4\"\n"; + DEBUG > 3 and print "Found apparent simple end-text code \"$5\"\n"; if(@stack and ! $stack[-1]) { # We're indeed expecting a simple end-code @@ -1801,7 +1827,6 @@ sub stringify_lol { # function: stringify_lol($lol) sub _stringify_lol { # the real recursor my($lol, $to) = @_; - use UNIVERSAL (); for(my $i = 2; $i < @$lol; ++$i) { if( ref($lol->[$i] || '') and UNIVERSAL::isa($lol->[$i], 'ARRAY') ) { _stringify_lol( $lol->[$i], $to); # recurse! @@ -1900,7 +1925,7 @@ sub pretty { # adopted from Class::Classless # A rather unsubtle method of blowing away all the state information # from a parser object so it can be reused. Provided as a utility for -# backward compatibilty in Pod::Man, etc. but not recommended for +# backward compatibility in Pod::Man, etc. but not recommended for # general use. sub reinit { diff --git a/lib/Pod/Simple/Checker.pm b/lib/Pod/Simple/Checker.pm index 0d01f50ec2..35910d6bc1 100644 --- a/lib/Pod/Simple/Checker.pm +++ b/lib/Pod/Simple/Checker.pm @@ -9,7 +9,7 @@ use Carp (); use Pod::Simple::Methody (); use Pod::Simple (); use vars qw( @ISA $VERSION ); -$VERSION = '2.02'; +$VERSION = '3.19'; @ISA = ('Pod::Simple::Methody'); BEGIN { *DEBUG = defined(&Pod::Simple::DEBUG) ? \&Pod::Simple::DEBUG @@ -152,9 +152,22 @@ This is a subclass of L and inherits all its methods. L, L, L +=head1 SUPPORT + +Questions or discussion about POD and Pod::Simple should be sent to the +pod-people@perl.org mail list. Send an empty email to +pod-people-subscribe@perl.org to subscribe. + +This module is managed in an open GitHub repository, +L. Feel free to fork and contribute, or +to clone L and send patches! + +Patches against Pod::Simple are welcome. Please send bug reports to +. + =head1 COPYRIGHT AND DISCLAIMERS -Copyright (c) 2002 Sean M. Burke. All rights reserved. +Copyright (c) 2002 Sean M. Burke. This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. @@ -165,7 +178,19 @@ merchantability or fitness for a particular purpose. =head1 AUTHOR -Sean M. Burke C +Pod::Simple was created by Sean M. Burke . +But don't bother him, he's retired. -=cut +Pod::Simple is maintained by: + +=over +=item * Allison Randal C + +=item * Hans Dieter Pearcey C + +=item * David E. Wheeler C + +=back + +=cut diff --git a/lib/Pod/Simple/Debug.pm b/lib/Pod/Simple/Debug.pm index b00e58daba..e5827ec0ad 100644 --- a/lib/Pod/Simple/Debug.pm +++ b/lib/Pod/Simple/Debug.pm @@ -2,6 +2,8 @@ require 5; package Pod::Simple::Debug; use strict; +use vars qw($VERSION ); +$VERSION = '3.19'; sub import { my($value,$variable); @@ -130,11 +132,24 @@ is basically equivalent to this: L The article "Constants in Perl", in I issue -21. See L +21. See L + +=head1 SUPPORT + +Questions or discussion about POD and Pod::Simple should be sent to the +pod-people@perl.org mail list. Send an empty email to +pod-people-subscribe@perl.org to subscribe. + +This module is managed in an open GitHub repository, +L. Feel free to fork and contribute, or +to clone L and send patches! + +Patches against Pod::Simple are welcome. Please send bug reports to +. =head1 COPYRIGHT AND DISCLAIMERS -Copyright (c) 2002 Sean M. Burke. All rights reserved. +Copyright (c) 2002 Sean M. Burke. This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. @@ -145,7 +160,19 @@ merchantability or fitness for a particular purpose. =head1 AUTHOR -Sean M. Burke C +Pod::Simple was created by Sean M. Burke . +But don't bother him, he's retired. -=cut +Pod::Simple is maintained by: + +=over +=item * Allison Randal C + +=item * Hans Dieter Pearcey C + +=item * David E. Wheeler C + +=back + +=cut diff --git a/lib/Pod/Simple/DumpAsText.pm b/lib/Pod/Simple/DumpAsText.pm index e678e42fa1..a4af8b25e2 100644 --- a/lib/Pod/Simple/DumpAsText.pm +++ b/lib/Pod/Simple/DumpAsText.pm @@ -1,7 +1,7 @@ require 5; package Pod::Simple::DumpAsText; -$VERSION = '2.02'; +$VERSION = '3.19'; use Pod::Simple (); BEGIN {@ISA = ('Pod::Simple')} @@ -111,9 +111,22 @@ L L +=head1 SUPPORT + +Questions or discussion about POD and Pod::Simple should be sent to the +pod-people@perl.org mail list. Send an empty email to +pod-people-subscribe@perl.org to subscribe. + +This module is managed in an open GitHub repository, +L. Feel free to fork and contribute, or +to clone L and send patches! + +Patches against Pod::Simple are welcome. Please send bug reports to +. + =head1 COPYRIGHT AND DISCLAIMERS -Copyright (c) 2002 Sean M. Burke. All rights reserved. +Copyright (c) 2002 Sean M. Burke. This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. @@ -124,7 +137,19 @@ merchantability or fitness for a particular purpose. =head1 AUTHOR -Sean M. Burke C +Pod::Simple was created by Sean M. Burke . +But don't bother him, he's retired. -=cut +Pod::Simple is maintained by: + +=over +=item * Allison Randal C + +=item * Hans Dieter Pearcey C + +=item * David E. Wheeler C + +=back + +=cut diff --git a/lib/Pod/Simple/DumpAsXML.pm b/lib/Pod/Simple/DumpAsXML.pm index fe0c1662e5..672fb4ceca 100644 --- a/lib/Pod/Simple/DumpAsXML.pm +++ b/lib/Pod/Simple/DumpAsXML.pm @@ -1,7 +1,7 @@ require 5; package Pod::Simple::DumpAsXML; -$VERSION = '2.02'; +$VERSION = '3.19'; use Pod::Simple (); BEGIN {@ISA = ('Pod::Simple')} @@ -114,7 +114,7 @@ L. L is rather like this class. Pod::Simple::XMLOutStream's output is space-padded in a way that's better for sending to an XML processor (that is, it has -no ignoreable whitespace). But +no ignorable whitespace). But Pod::Simple::DumpAsXML's output is much more human-readable, being (more-or-less) one token per line, with line-wrapping. @@ -126,10 +126,22 @@ L, L The older libraries L, L, L +=head1 SUPPORT + +Questions or discussion about POD and Pod::Simple should be sent to the +pod-people@perl.org mail list. Send an empty email to +pod-people-subscribe@perl.org to subscribe. + +This module is managed in an open GitHub repository, +L. Feel free to fork and contribute, or +to clone L and send patches! + +Patches against Pod::Simple are welcome. Please send bug reports to +. =head1 COPYRIGHT AND DISCLAIMERS -Copyright (c) 2002 Sean M. Burke. All rights reserved. +Copyright (c) 2002 Sean M. Burke. This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. @@ -140,7 +152,19 @@ merchantability or fitness for a particular purpose. =head1 AUTHOR -Sean M. Burke C +Pod::Simple was created by Sean M. Burke . +But don't bother him, he's retired. -=cut +Pod::Simple is maintained by: + +=over +=item * Allison Randal C + +=item * Hans Dieter Pearcey C + +=item * David E. Wheeler C + +=back + +=cut diff --git a/lib/Pod/Simple/HTML.pm b/lib/Pod/Simple/HTML.pm index a4dbbc17d0..8e9849a2db 100644 --- a/lib/Pod/Simple/HTML.pm +++ b/lib/Pod/Simple/HTML.pm @@ -5,14 +5,13 @@ use strict; use Pod::Simple::PullParser (); use vars qw( @ISA %Tagmap $Computerese $LamePad $Linearization_Limit $VERSION - $Perldoc_URL_Prefix $Perldoc_URL_Postfix + $Perldoc_URL_Prefix $Perldoc_URL_Postfix $Man_URL_Prefix $Man_URL_Postfix $Title_Prefix $Title_Postfix $HTML_EXTENSION %ToIndex $Doctype_decl $Content_decl ); @ISA = ('Pod::Simple::PullParser'); -$VERSION = '3.03'; +$VERSION = '3.19'; -use UNIVERSAL (); BEGIN { if(defined &DEBUG) { } # no-op elsif( defined &Pod::Simple::DEBUG ) { *DEBUG = \&Pod::Simple::DEBUG } @@ -37,6 +36,10 @@ $Perldoc_URL_Prefix = 'http://search.cpan.org/perldoc?' $Perldoc_URL_Postfix = '' unless defined $Perldoc_URL_Postfix; + +$Man_URL_Prefix = 'http://man.he.net/man'; +$Man_URL_Postfix = ''; + $Title_Prefix = '' unless defined $Title_Prefix; $Title_Postfix = '' unless defined $Title_Postfix; %ToIndex = map {; $_ => 1 } qw(head1 head2 head3 head4 ); # item-text @@ -52,6 +55,12 @@ __PACKAGE__->_accessorize( 'perldoc_url_postfix', # what to put after "Foo%3a%3aBar" in the URL. Normally "". + 'man_url_prefix', + # In turning L into http://whatever/man/1/crontab, what + # to put before the "1/crontab". + 'man_url_postfix', + # what to put after the "1/crontab" in the URL. Normally "". + 'batch_mode', # whether we're in batch mode 'batch_mode_current_level', # When in batch mode, how deep the current module is: 1 for "LWP", @@ -60,6 +69,8 @@ __PACKAGE__->_accessorize( 'title_prefix', 'title_postfix', # What to put before and after the title in the head. # Should already be &-escaped + + 'html_h_level', 'html_header_before_title', 'html_header_after_title', @@ -70,7 +81,7 @@ __PACKAGE__->_accessorize( # out of apparently longstanding habit) 'html_css', # URL of CSS file to point to - 'html_javascript', # URL of CSS file to point to + 'html_javascript', # URL of Javascript file to point to 'force_title', # should already be &-escaped 'default_title', # should already be &-escaped @@ -180,6 +191,8 @@ sub new { $new->perldoc_url_prefix( $Perldoc_URL_Prefix ); $new->perldoc_url_postfix( $Perldoc_URL_Postfix ); + $new->man_url_prefix( $Man_URL_Prefix ); + $new->man_url_postfix( $Man_URL_Postfix ); $new->title_prefix( $Title_Prefix ); $new->title_postfix( $Title_Postfix ); @@ -196,9 +209,25 @@ sub new { $new->html_footer( qq[\n\n\n\n] ); $new->{'Tagmap'} = {%Tagmap}; + return $new; } +sub __adjust_html_h_levels { + my ($self) = @_; + my $Tagmap = $self->{'Tagmap'}; + + my $add = $self->html_h_level; + return unless defined $add; + return if ($self->{'Adjusted_html_h_levels'}||0) == $add; + + $add -= 1; + for (1 .. 4) { + $Tagmap->{"head$_"} =~ s/$_/$_ + $add/e; + $Tagmap->{"/head$_"} =~ s/$_/$_ + $add/e; + } +} + sub batch_mode_page_object_init { my($self, $batchconvobj, $module, $infile, $outfile, $depth) = @_; DEBUG and print "Initting $self\n for $module\n", @@ -408,7 +437,7 @@ sub index_as_html { $indent = ' ' x $level; push @out, sprintf "%s
  • %s", - $indent, $level, $anchorname, esc($text) + $indent, $level, esc($anchorname), esc($text) ; } push @out, "\n"; @@ -421,6 +450,8 @@ sub _do_middle_main_loop { my $self = $_[0]; my $fh = $self->{'output_fh'}; my $tagmap = $self->{'Tagmap'}; + + $self->__adjust_html_h_levels; my($token, $type, $tagname, $linkto, $linktype); my @stack; @@ -457,7 +488,8 @@ sub _do_middle_main_loop { } my $name = $self->linearize_tokens(@to_unget); - + $name = $self->do_section($name, $token) if defined $name; + print $fh "text, "\n"; - printf $fh "\n" . $next->text . "\n"; + print $fh "\n" . $next->text . "\n"; next; } else { @@ -512,7 +544,7 @@ sub _do_middle_main_loop { $stack[-1] = $tagmap->{"/$tagname"}; if( $tagname eq 'item-text' and defined(my $next = $self->get_token) ) { $self->unget_token($next); - if( $next->type eq 'start' and $next->tagname !~ m/^item-/s ) { + if( $next->type eq 'start' ) { print $fh $tagmap->{"/item-text"},$tagmap->{"item-body"}; $stack[-1] = $tagmap->{"/item-body"}; } @@ -536,6 +568,11 @@ sub _do_middle_main_loop { ########################################################################### # +sub do_section { + my($self, $name, $token) = @_; + return $name; +} + sub do_link { my($self, $token) = @_; my $type = $token->attr('type'); @@ -554,9 +591,20 @@ sub do_link { sub do_url_link { return $_[1]->attr('to') } -sub do_man_link { return undef } - # But subclasses are welcome to override this if they have man - # pages somewhere URL-accessible. +sub do_man_link { + my ($self, $link) = @_; + my $to = $link->attr('to'); + my $frag = $link->attr('section'); + + return undef unless defined $to and length $to; # should never happen + + $frag = $self->section_escape($frag) + if defined $frag and length($frag .= ''); # (stringify) + + DEBUG and print "Resolving \"$to/$frag\"\n\n"; + + return $self->resolve_man_page_link($to, $frag); +} sub do_pod_link { @@ -637,6 +685,8 @@ sub section_escape { sub section_name_tidy { my($self, $section) = @_; + $section =~ s/^\s+//; + $section =~ s/\s+$//; $section =~ tr/ /_/; $section =~ tr/\x00-\x1F\x80-\x9F//d if 'A' eq chr(65); # drop crazy characters $section = $self->unicode_escape_url($section); @@ -646,6 +696,7 @@ sub section_name_tidy { sub section_url_escape { shift->general_url_escape(@_) } sub pagepath_url_escape { shift->general_url_escape(@_) } +sub manpage_url_escape { shift->general_url_escape(@_) } sub general_url_escape { my($self, $string) = @_; @@ -719,6 +770,18 @@ sub batch_mode_rectify_path { return; } +sub resolve_man_page_link { + my ($self, $to, $frag) = @_; + my ($page, $section) = $to =~ /^([^(]+)(?:[(](\d+)[)])?$/; + + return undef unless defined $page and length $page; + $section ||= 1; + + return $self->man_url_prefix . "$section/" + . $self->manpage_url_escape($page) + . $self->man_url_postfix; +} + #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ sub resolve_pod_link_by_table { @@ -836,43 +899,202 @@ TODO =head1 CALLING FROM PERL -TODO make a new object, set any options, and use parse_from_file +=head2 Minimal code + + use Pod::Simple::HTML; + my $p = Pod::Simple::HTML->new; + $p->output_string(\my $html); + $p->parse_file('path/to/Module/Name.pm'); + open my $out, '>', 'out.html' or die "Cannot open 'out.html': $!\n"; + print $out $html; + +=head2 More detailed example + + use Pod::Simple::HTML; + +Set the content type: + + $Pod::Simple::HTML::Content_decl = q{}; + + my $p = Pod::Simple::HTML->new; + +Include a single javascript source: + + $p->html_javascript('http://abc.com/a.js'); + +Or insert multiple javascript source in the header +(or for that matter include anything, thought this is not recommended) + + $p->html_javascript(' + + '); +Include a single css source in the header: + + $p->html_css('/style.css'); + +or insert multiple css sources: + + $p->html_css(' + + '); + +Tell the parser where should the output go. In this case it will be placed in the $html variable: + + my $html; + $p->output_string(\$html); + +Parse and process a file with pod in it: + + $p->parse_file('path/to/Module/Name.pm'); =head1 METHODS TODO all (most?) accessorized methods +The following variables need to be set B the call to the ->new constructor. + +Set the string that is included before the opening tag: + + $Pod::Simple::HTML::Doctype_decl = qq{\n}; + +Set the content-type in the HTML head: (defaults to ISO-8859-1) + + $Pod::Simple::HTML::Content_decl = q{}; + +Set the value that will be ebedded in the opening tags of F, C tags and verbatim text. +F maps to , C maps to , Verbatim text maps to
     (Computerese defaults to "")
    +
    +  $Pod::Simple::HTML::Computerese =  ' class="some_class_name';
    +
    +=head2 html_css
    +
    +=head2 html_javascript
    +
    +=head2 title_prefix
    +
    +=head2 title_postfix
    +
    +=head2 html_header_before_title
    +
    +This includes everything before the  opening tag including the Document type
    +and including the opening <title> tag. The following call will set it to be a simple HTML
    +file:
    +
    +  $p->html_header_before_title('<html><head><title>');
    +
    +=head2 html_h_level
    +
    +Normally =head1 will become <h1>, =head2 will become <h2> etc.
    +Using the html_h_level method will change these levels setting the h level
    +of =head1 tags:
    +
    +  $p->html_h_level(3);
    +
    +Will make sure that =head1 will become <h3> and =head2 will become <h4> etc...
    +
    +
    +=head2 index
    +
    +Set it to some true value if you want to have an index (in reality a table of contents)
    +to be added at the top of the generated HTML.
    +
    +  $p->index(1);
    +
    +=head2 html_header_after_title
    +
    +Includes the closing tag of  and through the rest of the head
    +till the opening of the body
    +
    +  $p->html_header_after_title('...');
    +
    +=head2 html_footer
    +
    +The very end of the document:
    +
    +  $p->html_footer( qq[\n\n\n\n] );
     
     =head1 SUBCLASSING
     
    -TODO
    +Can use any of the methods described above but for further customization
    +one needs to override some of the methods:
    +
    +  package My::Pod;
    +  use strict;
    +  use warnings;
    +
    +  use base 'Pod::Simple::HTML';
    +
    +  # needs to return a URL string such
    +  # http://some.other.com/page.html
    +  # #anchor_in_the_same_file
    +  # /internal/ref.html
    +  sub do_pod_link {
    +    # My::Pod object and Pod::Simple::PullParserStartToken object
    +    my ($self, $link) = @_;
    +
    +    say $link->tagname;          # will be L for links
    +    say $link->attr('to');       # 
    +    say $link->attr('type');     # will be 'pod' always
    +    say $link->attr('section');
    +
    +    # Links local to our web site
    +    if ($link->tagname eq 'L' and $link->attr('type') eq 'pod') {
    +      my $to = $link->attr('to');
    +      if ($to =~ /^Padre::/) {
    +          $to =~ s{::}{/}g;
    +          return "/docs/Padre/$to.html";
    +      }
    +    }
     
    - can just set any of:  html_css html_javascript title_prefix
    -  'html_header_before_title',
    -  'html_header_after_title',
    -  'html_footer',
    +    # all other links are generated by the parent class
    +    my $ret = $self->SUPER::do_pod_link($link);
    +    return $ret;
    +  }
     
    -maybe override do_pod_link
    +  1;
     
    -maybe override do_beginning do_end
    +Meanwhile in script.pl:
    +
    +  use My::Pod;
     
    +  my $p = My::Pod->new;
     
    +  my $html;
    +  $p->output_string(\$html);
    +  $p->parse_file('path/to/Module/Name.pm');
    +  open my $out, '>', 'out.html' or die;
    +  print $out $html;
    +
    +TODO
    +
    +maybe override do_beginning do_end
     
     =head1 SEE ALSO
     
     L, L
     
    -
     TODO: a corpus of sample Pod input and HTML output?  Or common
     idioms?
     
    +=head1 SUPPORT
    +
    +Questions or discussion about POD and Pod::Simple should be sent to the
    +pod-people@perl.org mail list. Send an empty email to
    +pod-people-subscribe@perl.org to subscribe.
     
    +This module is managed in an open GitHub repository,
    +L. Feel free to fork and contribute, or
    +to clone L and send patches!
    +
    +Patches against Pod::Simple are welcome. Please send bug reports to
    +.
     
     =head1 COPYRIGHT AND DISCLAIMERS
     
    -Copyright (c) 2002-2004 Sean M. Burke.  All rights reserved.
    +Copyright (c) 2002-2004 Sean M. Burke.
     
     This library is free software; you can redistribute it and/or modify it
     under the same terms as Perl itself.
    @@ -881,9 +1103,29 @@ 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.
     
    +=head1 ACKNOWLEDGEMENTS
    +
    +Thanks to L for permission to use its
    +L site for man page links.
    +
    +Thanks to L for permission to use the
    +site for Perl module links.
    +
     =head1 AUTHOR
     
    -Sean M. Burke C
    +Pod::Simple was created by Sean M. Burke .
    +But don't bother him, he's retired.
     
    -=cut
    +Pod::Simple is maintained by:
    +
    +=over
     
    +=item * Allison Randal C
    +
    +=item * Hans Dieter Pearcey C
    +
    +=item * David E. Wheeler C
    +
    +=back
    +
    +=cut
    diff --git a/lib/Pod/Simple/HTMLBatch.pm b/lib/Pod/Simple/HTMLBatch.pm
    index 9dbb540a3f..7e107eed47 100644
    --- a/lib/Pod/Simple/HTMLBatch.pm
    +++ b/lib/Pod/Simple/HTMLBatch.pm
    @@ -5,7 +5,7 @@ use strict;
     use vars qw( $VERSION $HTML_RENDER_CLASS $HTML_EXTENSION
      $CSS $JAVASCRIPT $SLEEPY $SEARCH_CLASS @ISA
     );
    -$VERSION = '3.02';
    +$VERSION = '3.19';
     @ISA = ();  # Yup, we're NOT a subclass of Pod::Simple::HTML!
     
     # TODO: nocontents stylesheets. Strike some of the color variations?
    @@ -13,8 +13,6 @@ $VERSION = '3.02';
     use Pod::Simple::HTML ();
     BEGIN {*esc = \&Pod::Simple::HTML::esc }
     use File::Spec ();
    -use UNIVERSAL ();
    -  # "Isn't the Universe an amazing place?  I wouldn't live anywhere else!"
     
     use Pod::Simple::Search;
     $SEARCH_CLASS ||= 'Pod::Simple::Search';
    @@ -37,6 +35,7 @@ $HTML_RENDER_CLASS ||= "Pod::Simple::HTML";
     Pod::Simple::_accessorize( __PACKAGE__,
      'verbose', # how verbose to be during batch conversion
      'html_render_class', # what class to use to render
    + 'search_class', # what to use to search for POD documents
      'contents_file', # If set, should be the name of a file (in current directory)
                       # to write the list of all modules to
      'index', # will set $htmlpage->index(...) to this (true or false)
    @@ -71,6 +70,7 @@ sub go {
     sub new {
       my $new = bless {}, ref($_[0]) || $_[0];
       $new->html_render_class($HTML_RENDER_CLASS);
    +  $new->search_class($SEARCH_CLASS);
       $new->verbose(1 + DEBUG);
       $new->_contents([]);
       
    @@ -246,9 +246,9 @@ sub _do_one_batch_conversion {
       }
     
       # Give each class a chance to init the converter:
    -  
       $page->batch_mode_page_object_init($self, $module, $infile, $outfile, $depth)
        if $page->can('batch_mode_page_object_init');
    +  # Init for the index (TOC), too.
       $self->batch_mode_page_object_init($page, $module, $infile, $outfile, $depth)
        if $self->can('batch_mode_page_object_init');
         
    @@ -532,7 +532,7 @@ sub modnames2paths { # return a hashref mapping modulenames => paths
     
       my $m2p;
       {
    -    my $search = $SEARCH_CLASS->new;
    +    my $search = $self->search_class->new;
         DEBUG and print "Searching via $search\n";
         $search->verbose(1) if DEBUG > 10;
         $search->progress( $self->progress->copy->goal(0) ) if $self->progress;
    @@ -567,7 +567,7 @@ sub _wopen {
       require Symbol;
       my $out_fh = Symbol::gensym();
       DEBUG > 5 and print "Write-opening to $outpath\n";
    -  return $out_fh if open($out_fh, ">", "$outpath");
    +  return $out_fh if open($out_fh, "> $outpath");
       require Carp;  
       Carp::croak("Can't write-open $outpath: $!");
     }
    @@ -681,20 +681,16 @@ sub _gen_css_wad {
        #  010=white_with_green_on_black
        #  011=white_with_blue_on_black
        #  100=white_with_red_on_black
    -  
    -   qw[
    -    110n=black_with_blue_on_white
    -    010n=black_with_magenta_on_white
    -    100n=black_with_cyan_on_white
    -
    -    101=white_with_purple_on_black
    -    001=white_with_navy_blue_on_black
    -
    -    010a=grey_with_green_on_black
    -    010b=white_with_green_on_grey
    -    101an=black_with_green_on_grey
    -    101bn=grey_with_green_on_white
    -  ]) {
    +    '110n=blkbluw',  # black_with_blue_on_white
    +    '010n=blkmagw',  # black_with_magenta_on_white
    +    '100n=blkcynw',  # black_with_cyan_on_white
    +    '101=whtprpk',   # white_with_purple_on_black
    +    '001=whtnavk',   # white_with_navy_blue_on_black
    +    '010a=grygrnk',  # grey_with_green_on_black
    +    '010b=whtgrng',  # white_with_green_on_grey
    +    '101an=blkgrng', # black_with_green_on_grey
    +    '101bn=grygrnw', # grey_with_green_on_white
    +  ) {
     
         my $outname = $variation;
         my($flipmode, @swap) = ( ($4 || ''), $1,$2,$3)
    @@ -724,11 +720,13 @@ sub _gen_css_wad {
       }
     
       # Now a few indexless variations:
    -  foreach my $variation (qw[
    -    black_with_blue_on_white  white_with_purple_on_black
    -    white_with_green_on_grey  grey_with_green_on_white
    -  ]) {
    -    my $outname = "indexless_$variation";
    +  foreach my $variation (
    +      'blkbluw', # black_with_blue_on_white
    +      'whtpurk', # white_with_purple_on_black
    +      'whtgrng', # white_with_green_on_grey
    +      'grygrnw', # grey_with_green_on_white
    +  ) {
    +    my $outname = $variation;
         my $this_css = join "\n",
           "/* This file is autogenerated.  Do not edit.  $outname */\n",
           "\@import url(\"./_$variation.css\");",
    @@ -1084,7 +1082,7 @@ Example:
       % mkdir out_html
       % perl -MPod::Simple::HTMLBatch -e Pod::Simple::HTMLBatch::go @INC out_html
           (to convert the pod from Perl's @INC
    -       files under the directory ../htmlversion)
    +       files under the directory ./out_html)
     
     (Note that the command line there contains a literal atsign-I-N-C.  This
     is handled as a special case by batch_convert, in order to save you having
    @@ -1097,7 +1095,7 @@ Example:
       % chmod og-rx ../seekrut
       % perl -MPod::Simple::HTMLBatch -e Pod::Simple::HTMLBatch::go . ../htmlversion
           (to convert the pod under the current dir into HTML
    -       files under the directory ../htmlversion)
    +       files under the directory ./seekrut)
     
     Example:
     
    @@ -1143,7 +1141,7 @@ directory:
     
     =item $batchconv->batch_convert( 'somedir:someother:also' , ...);
     
    -This specifies that you want the dirs "somedir", "somother", and "also"
    +This specifies that you want the dirs "somedir", "someother", and "also"
     scanned, just as if you'd passed the arrayref
     C<[qw( somedir someother also)]>.  Note that a ":"-separator is normal
     under Unix, but Under MSWin, you'll need C<'somedir;someother;also'>
    @@ -1228,7 +1226,7 @@ If you set this to a false value, no contents file will be written.
     This specifies what string should be put at the beginning of
     the contents page.
     The default is a string more or less like this:
    -  
    +
       
       Perl Documentation
       
    @@ -1275,6 +1273,14 @@ TODO
     =item $batchconv->html_render_class( I );
     
     This sets what class is used for rendering the files.
    +The default is "Pod::Simple::HTML".  If you set it to something else,
    +it should probably be a subclass of Pod::Simple::HTML, and you should
    +C or C that class so that's it's loaded before
    +Pod::Simple::HTMLBatch tries loading it.
    +
    +=item $batchconv->search_class( I );
    +
    +This sets what class is used for searching for the files.
     The default is "Pod::Simple::Search".  If you set it to something else,
     it should probably be a subclass of Pod::Simple::Search, and you should
     C or C that class so that's it's loaded before
    @@ -1300,6 +1306,8 @@ TODO
         $page->batch_mode_page_object_init($self, $module, $infile, $outfile, $depth)
       or maybe override
         $batchconv->batch_mode_page_object_init($page, $module, $infile, $outfile, $depth)
    +  subclass Pod::Simple::Search and set $batchconv->search_class to
    +    that classname
     
     
     
    @@ -1318,12 +1326,22 @@ you're looking for.
     
     L, L, L, L
     
    +=head1 SUPPORT
     
    +Questions or discussion about POD and Pod::Simple should be sent to the
    +pod-people@perl.org mail list. Send an empty email to
    +pod-people-subscribe@perl.org to subscribe.
     
    +This module is managed in an open GitHub repository,
    +L. Feel free to fork and contribute, or
    +to clone L and send patches!
    +
    +Patches against Pod::Simple are welcome. Please send bug reports to
    +.
     
     =head1 COPYRIGHT AND DISCLAIMERS
     
    -Copyright (c) 2004 Sean M. Burke.  All rights reserved.
    +Copyright (c) 2002 Sean M. Burke.
     
     This library is free software; you can redistribute it and/or modify it
     under the same terms as Perl itself.
    @@ -1334,9 +1352,19 @@ merchantability or fitness for a particular purpose.
     
     =head1 AUTHOR
     
    -Sean M. Burke C
    +Pod::Simple was created by Sean M. Burke .
    +But don't bother him, he's retired.
     
    -=cut
    +Pod::Simple is maintained by:
     
    +=over
     
    +=item * Allison Randal C
     
    +=item * Hans Dieter Pearcey C
    +
    +=item * David E. Wheeler C
    +
    +=back
    +
    +=cut
    diff --git a/lib/Pod/Simple/LinkSection.pm b/lib/Pod/Simple/LinkSection.pm
    index 14c3ba85d2..5959e2d4a7 100644
    --- a/lib/Pod/Simple/LinkSection.pm
    +++ b/lib/Pod/Simple/LinkSection.pm
    @@ -2,9 +2,13 @@
     require 5;
     package Pod::Simple::LinkSection;
       # Based somewhat dimly on Array::Autojoin
    +use vars qw($VERSION );
    +$VERSION = '3.19';
     
     use strict;
     use Pod::Simple::BlackBox;
    +use vars qw($VERSION );
    +$VERSION = '3.19';
     
     use overload( # So it'll stringify nice
       '""'   => \&Pod::Simple::BlackBox::stringify_lol,
    @@ -110,7 +114,7 @@ Output:
                               ], 'Pod::Simple::LinkSection' ),
                        'baz'
                      ], 'Pod::Simple::LinkSection' );
    -  
    +
     But stringify it and you get just the text content:
     
       % perl -MData::Dumper -e
    @@ -126,9 +130,22 @@ Output:
     
     L
     
    +=head1 SUPPORT
    +
    +Questions or discussion about POD and Pod::Simple should be sent to the
    +pod-people@perl.org mail list. Send an empty email to
    +pod-people-subscribe@perl.org to subscribe.
    +
    +This module is managed in an open GitHub repository,
    +L. Feel free to fork and contribute, or
    +to clone L and send patches!
    +
    +Patches against Pod::Simple are welcome. Please send bug reports to
    +.
    +
     =head1 COPYRIGHT AND DISCLAIMERS
     
    -Copyright (c) 2002 Sean M. Burke.  All rights reserved.
    +Copyright (c) 2004 Sean M. Burke.
     
     This library is free software; you can redistribute it and/or modify it
     under the same terms as Perl itself.
    @@ -139,7 +156,19 @@ merchantability or fitness for a particular purpose.
     
     =head1 AUTHOR
     
    -Sean M. Burke C
    +Pod::Simple was created by Sean M. Burke .
    +But don't bother him, he's retired.
     
    -=cut
    +Pod::Simple is maintained by:
     
    +=over
    +
    +=item * Allison Randal C
    +
    +=item * Hans Dieter Pearcey C
    +
    +=item * David E. Wheeler C
    +
    +=back
    +
    +=cut
    diff --git a/lib/Pod/Simple/Methody.pm b/lib/Pod/Simple/Methody.pm
    index 2ad607e61b..e1392005e3 100644
    --- a/lib/Pod/Simple/Methody.pm
    +++ b/lib/Pod/Simple/Methody.pm
    @@ -4,7 +4,7 @@ package Pod::Simple::Methody;
     use strict;
     use Pod::Simple ();
     use vars qw(@ISA $VERSION);
    -$VERSION = '2.02';
    +$VERSION = '3.19';
     @ISA = ('Pod::Simple');
     
     # Yes, we could use named variables, but I want this to be impose
    @@ -51,12 +51,12 @@ Pod::Simple::Methody -- turn Pod::Simple events into method calls
      use strict;
      package SomePodFormatter;
      use base qw(Pod::Simple::Methody);
    - 
    +
      sub handle_text {
        my($self, $text) = @_;
        ...
      }
    - 
    +
      sub start_head1 {
        my($self, $attrs) = @_;
        ...
    @@ -65,7 +65,7 @@ Pod::Simple::Methody -- turn Pod::Simple events into method calls
        my($self) = @_;
        ...
      }
    - 
    +
     ...and start_/end_ methods for whatever other events you want to catch.
     
     =head1 DESCRIPTION
    @@ -108,9 +108,22 @@ See the source for Pod::Simple::Text for an example of using this class.
     
     L, L
     
    +=head1 SUPPORT
    +
    +Questions or discussion about POD and Pod::Simple should be sent to the
    +pod-people@perl.org mail list. Send an empty email to
    +pod-people-subscribe@perl.org to subscribe.
    +
    +This module is managed in an open GitHub repository,
    +L. Feel free to fork and contribute, or
    +to clone L and send patches!
    +
    +Patches against Pod::Simple are welcome. Please send bug reports to
    +.
    +
     =head1 COPYRIGHT AND DISCLAIMERS
     
    -Copyright (c) 2002 Sean M. Burke.  All rights reserved.
    +Copyright (c) 2002 Sean M. Burke.
     
     This library is free software; you can redistribute it and/or modify it
     under the same terms as Perl itself.
    @@ -121,7 +134,19 @@ merchantability or fitness for a particular purpose.
     
     =head1 AUTHOR
     
    -Sean M. Burke C
    +Pod::Simple was created by Sean M. Burke .
    +But don't bother him, he's retired.
     
    -=cut
    +Pod::Simple is maintained by:
    +
    +=over
    +
    +=item * Allison Randal C
    +
    +=item * Hans Dieter Pearcey C
     
    +=item * David E. Wheeler C
    +
    +=back
    +
    +=cut
    diff --git a/lib/Pod/Simple/Progress.pm b/lib/Pod/Simple/Progress.pm
    index bc42a952dc..ce418823a5 100644
    --- a/lib/Pod/Simple/Progress.pm
    +++ b/lib/Pod/Simple/Progress.pm
    @@ -1,7 +1,7 @@
     
     require 5;
     package Pod::Simple::Progress;
    -$VERSION = "1.01";
    +$VERSION = '3.19';
     use strict;
     
     # Objects of this class are used for noting progress of an
    diff --git a/lib/Pod/Simple/PullParser.pm b/lib/Pod/Simple/PullParser.pm
    index c5bd1962a7..ba554ad89e 100644
    --- a/lib/Pod/Simple/PullParser.pm
    +++ b/lib/Pod/Simple/PullParser.pm
    @@ -1,7 +1,7 @@
     
     require 5;
     package Pod::Simple::PullParser;
    -$VERSION = '2.02';
    +$VERSION = '3.19';
     use Pod::Simple ();
     BEGIN {@ISA = ('Pod::Simple')}
     
    @@ -205,7 +205,6 @@ sub get_token {
       return shift @{$self->{'token_buffer'}}; # that's an undef if empty
     }
     
    -use UNIVERSAL ();
     sub unget_token {
       my $self = shift;
       DEBUG and print "Ungetting ", scalar(@_), " tokens: ",
    @@ -256,7 +255,7 @@ sub set_source {
         DEBUG and print "$self 's source is filename $_[0]\n";
         {
           local *PODSOURCE;
    -      open(PODSOURCE, "<", "$_[0]") || Carp::croak "Can't open $_[0]: $!";
    +      open(PODSOURCE, "<$_[0]") || Carp::croak "Can't open $_[0]: $!";
           $handle = *PODSOURCE{IO};
         }
         $self->{'source_filename'} = $_[0];
    @@ -319,6 +318,7 @@ sub _get_titled_section {
       my $desperate_for_title  = delete $options{'desperate'};
       my $accept_verbatim      = delete $options{'accept_verbatim'};
       my $max_content_length   = delete $options{'max_content_length'};
    +  my $nocase               = delete $options{'nocase'};
       $max_content_length = 120 unless defined $max_content_length;
     
       Carp::croak( "Unknown " . ((1 == keys %options) ? "option: " : "options: ")
    @@ -366,6 +366,7 @@ sub _get_titled_section {
             $head1_text_content .= $token->text;
           } elsif( $token->is_end and $token->tagname eq 'head1' ) {
             DEBUG and print "  Found end of head1.  Considering content...\n";
    +        $head1_text_content = uc $head1_text_content if $nocase;
             if($head1_text_content eq $titlename
               or $head1_text_content =~ m/\($titlename_re\)/s
               # We accept "=head1 Nomen Modularis (NAME)" for sake of i18n
    @@ -452,7 +453,7 @@ sub _get_titled_section {
       $self->unget_token(@to_unget);
       
       if(DEBUG) {
    -    if(defined $title) { print "  Returing title <$title>\n" }
    +    if(defined $title) { print "  Returning title <$title>\n" }
         else { print "Returning title <>\n" }
       }
       
    @@ -531,7 +532,7 @@ And elsewhere:
      package SomePodProcessor;
      use strict;
      use base qw(Pod::Simple::PullParser);
    - 
    +
      sub run {
        my $self = shift;
       Token:
    @@ -622,11 +623,19 @@ process the token-stream from the beginning.
     For example, suppose you have a document that starts out:
     
       =head1 NAME
    -  
    +
       Hoo::Boy::Wowza -- Stuff B yeah!
     
     $parser->get_title on that document will return "Hoo::Boy::Wowza --
    -Stuff wow yeah!".
    +Stuff wow yeah!". If the document starts with:
    +
    +  =head1 Name
    +
    +  Hoo::Boy::W00t -- Stuff B yeah!
    +
    +Then you'll need to pass the C option in order to recognize "Name":
    +
    +  $parser->get_title(nocase => 1);
     
     In cases where get_title can't find the title, it will return empty-string
     ("").
    @@ -639,7 +648,7 @@ the title seems to be of the form "SomeModuleName -- description".
     For example, suppose you have a document that starts out:
     
       =head1 NAME
    -  
    +
       Hoo::Boy::Wowza -- Stuff B yeah!
     
     then $parser->get_short_title on that document will return
    @@ -648,11 +657,19 @@ then $parser->get_short_title on that document will return
     But if the document starts out:
     
       =head1 NAME
    -  
    +
       Hooboy, stuff B yeah!
     
     then $parser->get_short_title on that document will return "Hooboy,
    -stuff wow yeah!".
    +stuff wow yeah!". If the document starts with:
    +
    +  =head1 Name
    +
    +  Hoo::Boy::W00t -- Stuff B yeah!
    +
    +Then you'll need to pass the C option in order to recognize "Name":
    +
    +  $parser->get_short_title(nocase => 1);
     
     If the title can't be found, then get_short_title returns empty-string
     ("").
    @@ -661,22 +678,30 @@ If the title can't be found, then get_short_title returns empty-string
     
     This works like get_title except that it returns the contents of the
     "=head1 AUTHOR\n\nParagraph...\n" section, assuming that that section
    -isn't terribly long.
    +isn't terribly long. To recognize a "=head1 Author\n\nParagraph\n"
    +section, pass the C otpion:
    +
    +  $parser->get_author(nocase => 1);
     
     (This method tolerates "AUTHORS" instead of "AUTHOR" too.)
     
     =item $description_name = $parser->get_description
     
     This works like get_title except that it returns the contents of the
    -"=head1 PARAGRAPH\n\nParagraph...\n" section, assuming that that section
    -isn't terribly long.
    +"=head1 DESCRIPTION\n\nParagraph...\n" section, assuming that that section
    +isn't terribly long. To recognize a "=head1 Description\n\nParagraph\n"
    +section, pass the C otpion:
    +
    +  $parser->get_description(nocase => 1);
     
     =item $version_block = $parser->get_version
     
     This works like get_title except that it returns the contents of
     the "=head1 VERSION\n\n[BIG BLOCK]\n" block.  Note that this does NOT
    -return the module's C<$VERSION>!!
    +return the module's C<$VERSION>!! To recognize a
    +"=head1 Version\n\n[BIG BLOCK]\n" section, pass the C otpion:
     
    +  $parser->get_version(nocase => 1);
     
     =back
     
    @@ -702,9 +727,22 @@ L.
     
     L, which inspired this.
     
    +=head1 SUPPORT
    +
    +Questions or discussion about POD and Pod::Simple should be sent to the
    +pod-people@perl.org mail list. Send an empty email to
    +pod-people-subscribe@perl.org to subscribe.
    +
    +This module is managed in an open GitHub repository,
    +L. Feel free to fork and contribute, or
    +to clone L and send patches!
    +
    +Patches against Pod::Simple are welcome. Please send bug reports to
    +.
    +
     =head1 COPYRIGHT AND DISCLAIMERS
     
    -Copyright (c) 2002 Sean M. Burke.  All rights reserved.
    +Copyright (c) 2002 Sean M. Burke.
     
     This library is free software; you can redistribute it and/or modify it
     under the same terms as Perl itself.
    @@ -715,11 +753,22 @@ merchantability or fitness for a particular purpose.
     
     =head1 AUTHOR
     
    -Sean M. Burke C
    +Pod::Simple was created by Sean M. Burke .
    +But don't bother him, he's retired.
     
    -=cut
    +Pod::Simple is maintained by:
     
    +=over
    +
    +=item * Allison Randal C
    +
    +=item * Hans Dieter Pearcey C
    +
    +=item * David E. Wheeler C
     
    +=back
    +
    +=cut
     
     JUNK:
     
    @@ -785,7 +834,7 @@ sub _old_get_title {  # some witchery in here
       $self->unget_token(@to_unget);
       
       if(DEBUG) {
    -    if(defined $title) { print "  Returing title <$title>\n" }
    +    if(defined $title) { print "  Returning title <$title>\n" }
         else { print "Returning title <>\n" }
       }
       
    diff --git a/lib/Pod/Simple/PullParserEndToken.pm b/lib/Pod/Simple/PullParserEndToken.pm
    index 7b219f8660..86b948b6b6 100644
    --- a/lib/Pod/Simple/PullParserEndToken.pm
    +++ b/lib/Pod/Simple/PullParserEndToken.pm
    @@ -2,8 +2,10 @@
     require 5;
     package Pod::Simple::PullParserEndToken;
     use Pod::Simple::PullParserToken ();
    -@ISA = ('Pod::Simple::PullParserToken');
     use strict;
    +use vars qw(@ISA $VERSION);
    +@ISA = ('Pod::Simple::PullParserToken');
    +$VERSION = '3.19';
     
     sub new {  # Class->new(tagname);
       my $class = shift;
    @@ -74,9 +76,22 @@ Pod::Simple::PullParserEndToken->new( I )
     
     L, L, L
     
    +=head1 SUPPORT
    +
    +Questions or discussion about POD and Pod::Simple should be sent to the
    +pod-people@perl.org mail list. Send an empty email to
    +pod-people-subscribe@perl.org to subscribe.
    +
    +This module is managed in an open GitHub repository,
    +L. Feel free to fork and contribute, or
    +to clone L and send patches!
    +
    +Patches against Pod::Simple are welcome. Please send bug reports to
    +.
    +
     =head1 COPYRIGHT AND DISCLAIMERS
     
    -Copyright (c) 2002 Sean M. Burke.  All rights reserved.
    +Copyright (c) 2002 Sean M. Burke.
     
     This library is free software; you can redistribute it and/or modify it
     under the same terms as Perl itself.
    @@ -87,7 +102,19 @@ merchantability or fitness for a particular purpose.
     
     =head1 AUTHOR
     
    -Sean M. Burke C
    +Pod::Simple was created by Sean M. Burke .
    +But don't bother him, he's retired.
     
    -=cut
    +Pod::Simple is maintained by:
     
    +=over
    +
    +=item * Allison Randal C
    +
    +=item * Hans Dieter Pearcey C
    +
    +=item * David E. Wheeler C
    +
    +=back
    +
    +=cut
    diff --git a/lib/Pod/Simple/PullParserStartToken.pm b/lib/Pod/Simple/PullParserStartToken.pm
    index 9ead50d96e..e7742b0f6f 100644
    --- a/lib/Pod/Simple/PullParserStartToken.pm
    +++ b/lib/Pod/Simple/PullParserStartToken.pm
    @@ -2,8 +2,10 @@
     require 5;
     package Pod::Simple::PullParserStartToken;
     use Pod::Simple::PullParserToken ();
    -@ISA = ('Pod::Simple::PullParserToken');
     use strict;
    +use vars qw(@ISA $VERSION);
    +@ISA = ('Pod::Simple::PullParserToken');
    +$VERSION = '3.19';
     
     sub new {  # Class->new(tagname, optional_attrhash);
       my $class = shift;
    @@ -111,9 +113,26 @@ Pod::Simple::PullParserStartToken->new( I, I )
     
     L, L, L
     
    +=head1 SEE ALSO
    +
    +L, L, L
    +
    +=head1 SUPPORT
    +
    +Questions or discussion about POD and Pod::Simple should be sent to the
    +pod-people@perl.org mail list. Send an empty email to
    +pod-people-subscribe@perl.org to subscribe.
    +
    +This module is managed in an open GitHub repository,
    +L. Feel free to fork and contribute, or
    +to clone L and send patches!
    +
    +Patches against Pod::Simple are welcome. Please send bug reports to
    +.
    +
     =head1 COPYRIGHT AND DISCLAIMERS
     
    -Copyright (c) 2002 Sean M. Burke.  All rights reserved.
    +Copyright (c) 2002 Sean M. Burke.
     
     This library is free software; you can redistribute it and/or modify it
     under the same terms as Perl itself.
    @@ -124,7 +143,19 @@ merchantability or fitness for a particular purpose.
     
     =head1 AUTHOR
     
    -Sean M. Burke C
    +Pod::Simple was created by Sean M. Burke .
    +But don't bother him, he's retired.
     
    -=cut
    +Pod::Simple is maintained by:
    +
    +=over
    +
    +=item * Allison Randal C
    +
    +=item * Hans Dieter Pearcey C
     
    +=item * David E. Wheeler C
    +
    +=back
    +
    +=cut
    diff --git a/lib/Pod/Simple/PullParserTextToken.pm b/lib/Pod/Simple/PullParserTextToken.pm
    index 2d1a1d7dc4..47f3b3de0c 100644
    --- a/lib/Pod/Simple/PullParserTextToken.pm
    +++ b/lib/Pod/Simple/PullParserTextToken.pm
    @@ -2,8 +2,10 @@
     require 5;
     package Pod::Simple::PullParserTextToken;
     use Pod::Simple::PullParserToken ();
    -@ISA = ('Pod::Simple::PullParserToken');
     use strict;
    +use vars qw(@ISA $VERSION);
    +@ISA = ('Pod::Simple::PullParserToken');
    +$VERSION = '3.19';
     
     sub new {  # Class->new(text);
       my $class = shift;
    @@ -59,14 +61,14 @@ as calling $token->text would do.
     Or, if you want to alter the value, you can even do things like this:
     
       for ( ${  $token->text_r  } ) {  # Aliases it with $_ !!
    -  
    +
         s/ The / the /g; # just for example
    -    
    +
         if( 'A' eq chr(65) ) {  # (if in an ASCII world)
           tr/\xA0/ /;
           tr/\xAD//d;
         }
    -    
    +
         ...or however you want to alter the value...
       }
     
    @@ -82,9 +84,22 @@ Pod::Simple::PullParserTextToken->new( I )
     
     L, L, L
     
    +=head1 SUPPORT
    +
    +Questions or discussion about POD and Pod::Simple should be sent to the
    +pod-people@perl.org mail list. Send an empty email to
    +pod-people-subscribe@perl.org to subscribe.
    +
    +This module is managed in an open GitHub repository,
    +L. Feel free to fork and contribute, or
    +to clone L and send patches!
    +
    +Patches against Pod::Simple are welcome. Please send bug reports to
    +.
    +
     =head1 COPYRIGHT AND DISCLAIMERS
     
    -Copyright (c) 2002 Sean M. Burke.  All rights reserved.
    +Copyright (c) 2002 Sean M. Burke.
     
     This library is free software; you can redistribute it and/or modify it
     under the same terms as Perl itself.
    @@ -95,7 +110,19 @@ merchantability or fitness for a particular purpose.
     
     =head1 AUTHOR
     
    -Sean M. Burke C
    +Pod::Simple was created by Sean M. Burke .
    +But don't bother him, he's retired.
     
    -=cut
    +Pod::Simple is maintained by:
    +
    +=over
    +
    +=item * Allison Randal C
    +
    +=item * Hans Dieter Pearcey C
     
    +=item * David E. Wheeler C
    +
    +=back
    +
    +=cut
    diff --git a/lib/Pod/Simple/PullParserToken.pm b/lib/Pod/Simple/PullParserToken.pm
    index 9ec3659f4e..0e6a8814f0 100644
    --- a/lib/Pod/Simple/PullParserToken.pm
    +++ b/lib/Pod/Simple/PullParserToken.pm
    @@ -3,7 +3,7 @@ require 5;
     package Pod::Simple::PullParserToken;
      # Base class for tokens gotten from Pod::Simple::PullParser's $parser->get_token
     @ISA = ();
    -$VERSION = '2.02';
    +$VERSION = '3.19';
     use strict;
     
     sub new {  # Class->new('type', stuff...);  ## Overridden in derived classes anyway
    @@ -56,10 +56,10 @@ Given a $parser that's an object of class Pod::Simple::PullParser
     
         } elsif($token->is_text) {
           ...access $token->text, $token->text_r, etc...
    -    
    +
         } elsif($token->is_end) {
           ...access $token->tagname...
    -    
    +
         }
       }
     
    @@ -119,9 +119,22 @@ L.
     
     L and L
     
    +=head1 SUPPORT
    +
    +Questions or discussion about POD and Pod::Simple should be sent to the
    +pod-people@perl.org mail list. Send an empty email to
    +pod-people-subscribe@perl.org to subscribe.
    +
    +This module is managed in an open GitHub repository,
    +L. Feel free to fork and contribute, or
    +to clone L and send patches!
    +
    +Patches against Pod::Simple are welcome. Please send bug reports to
    +.
    +
     =head1 COPYRIGHT AND DISCLAIMERS
     
    -Copyright (c) 2002 Sean M. Burke.  All rights reserved.
    +Copyright (c) 2002 Sean M. Burke.
     
     This library is free software; you can redistribute it and/or modify it
     under the same terms as Perl itself.
    @@ -132,7 +145,19 @@ merchantability or fitness for a particular purpose.
     
     =head1 AUTHOR
     
    -Sean M. Burke C
    +Pod::Simple was created by Sean M. Burke .
    +But don't bother him, he's retired.
     
    -=cut
    +Pod::Simple is maintained by:
     
    +=over
    +
    +=item * Allison Randal C
    +
    +=item * Hans Dieter Pearcey C
    +
    +=item * David E. Wheeler C
    +
    +=back
    +
    +=cut
    diff --git a/lib/Pod/Simple/RTF.pm b/lib/Pod/Simple/RTF.pm
    index de2a7b32d6..26843db410 100644
    --- a/lib/Pod/Simple/RTF.pm
    +++ b/lib/Pod/Simple/RTF.pm
    @@ -8,7 +8,7 @@ package Pod::Simple::RTF;
     
     use strict;
     use vars qw($VERSION @ISA %Escape $WRAP %Tagmap);
    -$VERSION = '2.02';
    +$VERSION = '3.19';
     use Pod::Simple::PullParser ();
     BEGIN {@ISA = ('Pod::Simple::PullParser')}
     
    @@ -655,9 +655,22 @@ even more, see the source and/or write to me.
     L, L, L, L,
     L
     
    +=head1 SUPPORT
    +
    +Questions or discussion about POD and Pod::Simple should be sent to the
    +pod-people@perl.org mail list. Send an empty email to
    +pod-people-subscribe@perl.org to subscribe.
    +
    +This module is managed in an open GitHub repository,
    +L. Feel free to fork and contribute, or
    +to clone L and send patches!
    +
    +Patches against Pod::Simple are welcome. Please send bug reports to
    +.
    +
     =head1 COPYRIGHT AND DISCLAIMERS
     
    -Copyright (c) 2002 Sean M. Burke.  All rights reserved.
    +Copyright (c) 2002 Sean M. Burke.
     
     This library is free software; you can redistribute it and/or modify it
     under the same terms as Perl itself.
    @@ -668,7 +681,19 @@ merchantability or fitness for a particular purpose.
     
     =head1 AUTHOR
     
    -Sean M. Burke C
    +Pod::Simple was created by Sean M. Burke .
    +But don't bother him, he's retired.
     
    -=cut
    +Pod::Simple is maintained by:
    +
    +=over
     
    +=item * Allison Randal C
    +
    +=item * Hans Dieter Pearcey C
    +
    +=item * David E. Wheeler C
    +
    +=back
    +
    +=cut
    diff --git a/lib/Pod/Simple/Search.pm b/lib/Pod/Simple/Search.pm
    index 7dd9911b17..656df9b08d 100644
    --- a/lib/Pod/Simple/Search.pm
    +++ b/lib/Pod/Simple/Search.pm
    @@ -4,7 +4,7 @@ package Pod::Simple::Search;
     use strict;
     
     use vars qw($VERSION $MAX_VERSION_WITHIN $SLEEPY);
    -$VERSION = 3.04;   ## Current version of this package
    +$VERSION = '3.19';   ## Current version of this package
     
     BEGIN { *DEBUG = sub () {0} unless defined &DEBUG; }   # set DEBUG level
     use Carp ();
    @@ -25,7 +25,7 @@ use Cwd qw( cwd );
     #==========================================================================
     __PACKAGE__->_accessorize(  # Make my dumb accessor methods
      'callback', 'progress', 'dir_prefix', 'inc', 'laborious', 'limit_glob',
    - 'limit_re', 'shadows', 'verbose', 'name2path', 'path2name', 
    + 'limit_re', 'shadows', 'verbose', 'name2path', 'path2name', 'recurse',
     );
     #==========================================================================
     
    @@ -39,6 +39,7 @@ sub new {
     sub init {
       my $self = shift;
       $self->inc(1);
    +  $self->recurse(1);
       $self->verbose(DEBUG);
       return $self;
     }
    @@ -127,9 +128,11 @@ sub _make_search_callback {
       my $self = $_[0];
     
       # Put the options in variables, for easy access
    -  my(  $laborious, $verbose, $shadows, $limit_re, $callback, $progress,$path2name,$name2path) =
    +  my( $laborious, $verbose, $shadows, $limit_re, $callback, $progress,
    +      $path2name, $name2path, $recurse) =
         map scalar($self->$_()),
    -     qw(laborious   verbose   shadows   limit_re   callback   progress  path2name  name2path);
    +     qw(laborious verbose shadows limit_re callback progress
    +        path2name name2path recurse);
     
       my($file, $shortname, $isdir, $modname_bits);
       return sub {
    @@ -137,6 +140,11 @@ sub _make_search_callback {
     
         if($isdir) { # this never gets called on the startdir itself, just subdirs
     
    +      unless( $recurse ) {
    +        $verbose and print "Not recursing into '$file' as per requested.\n";
    +        return 'PRUNE';
    +      }
    +
           if( $self->{'_dirs_visited'}{$file} ) {
             $verbose and print "Directory '$file' already seen, skipping.\n";
             return 'PRUNE';
    @@ -258,7 +266,7 @@ sub _path2modname {
       # filenames, so try to extract them from the "=head1 NAME" tag in the
       # file instead.
       if ($^O eq 'VMS' && ($name eq lc($name) || $name eq uc($name))) {
    -      open PODFILE, "<" ,"$file" or die "_path2modname: Can't open $file: $!";
    +      open PODFILE, "<$file" or die "_path2modname: Can't open $file: $!";
           my $in_pod = 0;
           my $in_name = 0;
           my $line;
    @@ -353,7 +361,7 @@ sub _recurse_dir {
         }
         pop @$modname_bits;
         return;
    -  };
    +  };;
     
       local $_;
       $recursor->($startdir, '');
    @@ -382,7 +390,7 @@ sub run {
         if($file =~ m/\.pod$/i) {
           # Don't bother looking for $VERSION in .pod files
           DEBUG and print "Not looking for \$VERSION in .pod $file\n";
    -    } elsif( !open(INPOD, "<", $file) ) {
    +    } elsif( !open(INPOD, $file) ) {
           DEBUG and print "Couldn't open $file: $!\n";
           close(INPOD);
         } else {
    @@ -401,7 +409,7 @@ sub run {
                 if m{^v?["']?([0-9_]+(\.[0-9_]+)*)["']?$}s
                  # like in $VERSION = "3.14159";
                  or m{\$Revision:\s*([0-9_]+(?:\.[0-9_]+)*)\s*\$}s
    -             # like in sprintf("%d.%02d", q$Revision$ =~ /(\d+)\.(\d+)/);
    +             # like in sprintf("%d.%02d", q$Revision: 4.13 $ =~ /(\d+)\.(\d+)/);
               ;
                
               # Like in sprintf("%d.%s", map {s/_//g; $_} q$Name: release-0_55-public $ =~ /-(\d+)_([\d_]+)/)
    @@ -597,7 +605,7 @@ sub contains_pod {
     
       # check for one line of POD
       $verbose > 1 and print " Scanning $file for pod...\n";
    -  unless( open(MAYBEPOD,"<", "$file") ) {
    +  unless( open(MAYBEPOD,"<$file") ) {
         print "Error: $file is unreadable: $!\n";
         return undef;
       }
    @@ -996,21 +1004,48 @@ with default attribute values is used.
     
     Returns true if the supplied filename (not POD module) contains some Pod
     documentation.
    +=head1 SUPPORT
    +
    +Questions or discussion about POD and Pod::Simple should be sent to the
    +pod-people@perl.org mail list. Send an empty email to
    +pod-people-subscribe@perl.org to subscribe.
    +
    +This module is managed in an open GitHub repository,
    +L. Feel free to fork and contribute, or
    +to clone L and send patches!
    +
    +Patches against Pod::Simple are welcome. Please send bug reports to
    +.
    +
    +=head1 COPYRIGHT AND DISCLAIMERS
    +
    +Copyright (c) 2002 Sean M. Burke.
     
    +This library is free software; you can redistribute it and/or modify it
    +under the same terms as Perl itself.
    +
    +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.
     
     =head1 AUTHOR
     
    -Sean M. Burke Esburke@cpan.orgE
    -borrowed code from
    -Marek Rouchal's Pod::Find, which in turn
    -heavily borrowed code from Nick Ing-Simmons' PodToHtml.
    +Pod::Simple was created by Sean M. Burke  with code borrowed
    +from Marek Rouchal's L, which in turn heavily borrowed code from
    +Nick Ing-Simmons' C.
    +
    +But don't bother him, he's retired.
     
    -Tim Jenness Et.jenness@jach.hawaii.eduE provided
    -C and C to Pod::Find.
    +Pod::Simple is maintained by:
     
    -=head1 SEE ALSO
    +=over
     
    -L, L
    +=item * Allison Randal C
     
    -=cut
    +=item * Hans Dieter Pearcey C
     
    +=item * David E. Wheeler C
    +
    +=back
    +
    +=cut
    diff --git a/lib/Pod/Simple/SimpleTree.pm b/lib/Pod/Simple/SimpleTree.pm
    index 64dd155104..8eb18accbb 100644
    --- a/lib/Pod/Simple/SimpleTree.pm
    +++ b/lib/Pod/Simple/SimpleTree.pm
    @@ -6,7 +6,7 @@ use strict;
     use Carp ();
     use Pod::Simple ();
     use vars qw( $ATTR_PAD @ISA $VERSION $SORT_ATTRS);
    -$VERSION = '2.02';
    +$VERSION = '3.19';
     BEGIN {
       @ISA = ('Pod::Simple');
       *DEBUG = \&Pod::Simple::DEBUG unless defined &DEBUG;
    @@ -67,15 +67,15 @@ Pod::Simple::SimpleTree -- parse Pod into a simple parse tree
     =head1 SYNOPSIS
     
       % cat ptest.pod
    -  
    +
       =head1 PIE
    -  
    +
       I like B!
    -  
    +
       % perl -MPod::Simple::SimpleTree -MData::Dumper -e \
          "print Dumper(Pod::Simple::SimpleTree->new->parse_file(shift)->root)" \
          ptest.pod
    -  
    +
       $VAR1 = [
                 'Document',
                 { 'start_line' => 1 },
    @@ -136,9 +136,22 @@ L
     
     L
     
    +=head1 SUPPORT
    +
    +Questions or discussion about POD and Pod::Simple should be sent to the
    +pod-people@perl.org mail list. Send an empty email to
    +pod-people-subscribe@perl.org to subscribe.
    +
    +This module is managed in an open GitHub repository,
    +L. Feel free to fork and contribute, or
    +to clone L and send patches!
    +
    +Patches against Pod::Simple are welcome. Please send bug reports to
    +.
    +
     =head1 COPYRIGHT AND DISCLAIMERS
     
    -Copyright (c) 2002 Sean M. Burke.  All rights reserved.
    +Copyright (c) 2002 Sean M. Burke.
     
     This library is free software; you can redistribute it and/or modify it
     under the same terms as Perl itself.
    @@ -149,7 +162,19 @@ merchantability or fitness for a particular purpose.
     
     =head1 AUTHOR
     
    -Sean M. Burke C
    +Pod::Simple was created by Sean M. Burke .
    +But don't bother him, he's retired.
     
    -=cut
    +Pod::Simple is maintained by:
    +
    +=over
    +
    +=item * Allison Randal C
    +
    +=item * Hans Dieter Pearcey C
     
    +=item * David E. Wheeler C
    +
    +=back
    +
    +=cut
    diff --git a/lib/Pod/Simple/Subclassing.pod b/lib/Pod/Simple/Subclassing.pod
    new file mode 100644
    index 0000000000..f4cbf8675c
    --- /dev/null
    +++ b/lib/Pod/Simple/Subclassing.pod
    @@ -0,0 +1,996 @@
    +
    +=head1 NAME
    +
    +Pod::Simple::Subclassing -- write a formatter as a Pod::Simple subclass
    +
    +=head1 SYNOPSIS
    +
    +  package Pod::SomeFormatter;
    +  use Pod::Simple;
    +  @ISA = qw(Pod::Simple);
    +  $VERSION = '1.01';
    +  use strict;
    +
    +  sub _handle_element_start {
    +    my($parser, $element_name, $attr_hash_r) = @_;
    +    ...
    +  }
    +
    +  sub _handle_element_end {
    +    my($parser, $element_name) = @_;
    +    ...
    +  }
    +
    +  sub _handle_text {
    +    my($parser, $text) = @_;
    +    ...
    +  }
    +  1;
    +
    +=head1 DESCRIPTION
    +
    +This document is about using Pod::Simple to write a Pod processor,
    +generally a Pod formatter. If you just want to know about using an
    +existing Pod formatter, instead see its documentation and see also the
    +docs in L.
    +
    +The zeroeth step in writing a Pod formatter is to make sure that there
    +isn't already a decent one in CPAN. See L, and
    +run a search on the name of the format you want to render to. Also
    +consider joining the Pod People list
    +L and asking whether
    +anyone has a formatter for that format -- maybe someone cobbled one
    +together but just hasn't released it.
    +
    +The first step in writing a Pod processor is to read L,
    +which contains notes information on writing a Pod parser (which has been
    +largely taken care of by Pod::Simple), but also a lot of requirements
    +and recommendations for writing a formatter.
    +
    +The second step is to actually learn the format you're planning to
    +format to -- or at least as much as you need to know to represent Pod,
    +which probably isn't much.
    +
    +The third step is to pick which of Pod::Simple's interfaces you want to
    +use -- the basic interface via Pod::Simple or L is
    +event-based, sort of like L's interface, or sort of like
    +L's "Handlers" interface), but L
    +provides a token-stream interface, sort of like L's
    +interface; L provides a simple tree interface,
    +rather like XML::Parser's "Tree" interface. Users familiar with
    +XML-handling will find one of these styles relatively familiar; but if
    +you would be even more at home with XML, there are classes that produce
    +an XML representation of the Pod stream, notably
    +L; you can feed the output of such a class to
    +whatever XML parsing system you are most at home with.
    +
    +The last step is to write your code based on how the events (or tokens,
    +or tree-nodes, or the XML, or however you're parsing) will map to
    +constructs in the output format. Also sure to consider how to escape
    +text nodes containing arbitrary text, and also what to do with text
    +nodes that represent preformatted text (from verbatim sections).
    +
    +
    +
    +=head1 Events
    +
    +TODO intro... mention that events are supplied for implicits, like for
    +missing >'s
    +
    +
    +In the following section, we use XML to represent the event structure
    +associated with a particular construct.  That is, TODO
    +
    +=over
    +
    +=item C<< $parser->_handle_element_start( I, I ) >>
    +
    +=item C<< $parser->_handle_element_end( I  ) >>
    +
    +=item C<< $parser->_handle_text(  I  ) >>
    +
    +=back
    +
    +TODO describe
    +
    +
    +=over
    +
    +=item events with an element_name of Document
    +
    +Parsing a document produces this event structure:
    +
    +  
    +    ...all events...
    +  
    +
    +The value of the I attribute will be the line number of the first
    +Pod directive in the document.
    +
    +If there is no Pod in the given document, then the 
    +event structure will be this:
    +
    +  
    +  
    +
    +In that case, the value of the I attribute will not be meaningful;
    +under current implementations, it will probably be the line number of the
    +last line in the file.
    +
    +=item events with an element_name of Para
    +
    +Parsing a plain (non-verbatim, non-directive, non-data) paragraph in
    +a Pod document produces this event structure:
    +
    +    
    +      ...all events in this paragraph...
    +    
    +
    +The value of the I attribute will be the line number of the start
    +of the paragraph.
    +
    +For example, parsing this paragraph of Pod:
    +
    +  The value of the I attribute will be the
    +  line number of the start of the paragraph.
    +
    +produces this event structure:
    +
    +    
    +      The value of the 
    +      
    +        start_line
    +      
    +       attribute will be the line number of the first Pod directive
    +      in the document.
    +    
    +
    +=item events with an element_name of B, C, F, or I.
    +
    +Parsing a BE...E formatting code (or of course any of its
    +semantically identical syntactic variants
    +SE ... EE>,
    +or SEEE ... EEEE>, etc.)
    +produces this event structure:
    +
    +      
    +        ...stuff...
    +      
    +
    +Currently, there are no attributes conveyed.
    +
    +Parsing C, F, or I codes produce the same structure, with only a
    +different element name.
    +
    +If your parser object has been set to accept other formatting codes,
    +then they will be presented like these B/C/F/I codes -- i.e., without
    +any attributes.
    +
    +=item events with an element_name of S
    +
    +Normally, parsing an SE...E sequence produces this event
    +structure, just as if it were a B/C/F/I code:
    +
    +      
    +        ...stuff...
    +      
    +
    +However, Pod::Simple (and presumably all derived parsers) offers the
    +C option which, if enabled, will suppress all S events, and
    +instead change all spaces in the content to non-breaking spaces. This is
    +intended for formatters that output to a format that has no code that
    +means the same as SE...E, but which has a code/character that
    +means non-breaking space.
    +
    +=item events with an element_name of X
    +
    +Normally, parsing an XE...E sequence produces this event
    +structure, just as if it were a B/C/F/I code:
    +
    +      
    +        ...stuff...
    +      
    +
    +However, Pod::Simple (and presumably all derived parsers) offers the
    +C option which, if enabled, will suppress all X events
    +and ignore their content.  For formatters/processors that don't use
    +X events, this is presumably quite useful.
    +
    +
    +=item events with an element_name of L
    +
    +Because the LE...E is the most complex construct in the
    +language, it should not surprise you that the events it generates are
    +the most complex in the language. Most of complexity is hidden away in
    +the attribute values, so for those of you writing a Pod formatter that
    +produces a non-hypertextual format, you can just ignore the attributes
    +and treat an L event structure like a formatting element that
    +(presumably) doesn't actually produce a change in formatting.  That is,
    +the content of the L event structure (as opposed to its
    +attributes) is always what text should be displayed.
    +
    +There are, at first glance, three kinds of L links: URL, man, and pod.
    +
    +When a LEIE code is parsed, it produces this event
    +structure:
    +
    +  
    +    that_url
    +  
    +
    +The C attribute is always specified for this type of
    +L code.
    +
    +For example, this Pod source:
    +
    +  L
    +
    +produces this event structure:
    +
    +  
    +    http://www.perl.com/CPAN/authors/
    +  
    +
    +When a LEIE code is parsed (and these are
    +fairly rare and not terribly useful), it produces this event structure:
    +
    +  
    +    manpage(section)
    +  
    +
    +The C attribute is always specified for this type of
    +L code.
    +
    +For example, this Pod source:
    +
    +  L
    +
    +produces this event structure:
    +
    +  
    +    crontab(5)
    +  
    +
    +In the rare cases where a man page link has a specified, that text appears
    +in a I
    attribute. For example, this Pod source: + + L + +will produce this event structure: + + + "ENVIRONMENT" in crontab(5) + + +In the rare case where the Pod document has code like +LEI|IE, then the I will appear +as the content of the element, the I text will appear +only as the value of the I attribute, and there will be no +C attribute (whose presence means that the Pod parser +had to infer what text should appear as the link text -- as opposed to +cases where that attribute is absent, which means that the Pod parser did +I have to infer the link text, because that L code explicitly specified +some link text.) + +For example, this Pod source: + + L + +will produce this event structure: + + + hell itself! + + +The last type of L structure is for links to/within Pod documents. It is +the most complex because it can have a I attribute, I a +I
    attribute, or both. The C attribute is always +specified for this type of L code. + +In the most common case, the simple case of a LEpodpageE code +produces this event structure: + + + podpage + + +For example, this Pod source: + + L + +produces this event structure: + + + Net::Ping + + +In cases where there is link-text explicitly specified, it +is to be found in the content of the element (and not the +attributes), just as with the LEI|IE +case discussed above. For example, this Pod source: + + L + +produces this event structure: + + + Perl Error Messages + + +In cases of links to a section in the current Pod document, +there is a I
    attribute instead of a I attribute. +For example, this Pod source: + + L + +produces this event structure: + + + "Member Data" + + +As another example, this Pod source: + + L + +produces this event structure: + + + the various attributes + + +In cases of links to a section in a different Pod document, +there are both a I
    attribute and a L attribute. +For example, this Pod source: + + L + +produces this event structure: + + + "Basic BLOCKs and Switch Statements" in perlsyn + + +As another example, this Pod source: + + L + +produces this event structure: + + + SWITCH statements + + +Incidentally, note that we do not distinguish between these syntaxes: + + L + L<"Member Data"> + L + L [deprecated syntax] + +That is, they all produce the same event structure, namely: + + + "Member Data" + + +=item events with an element_name of E or Z + +While there are Pod codes EE...E and ZEE, these +I produce any E or Z events -- that is, there are no such +events as E or Z. + +=item events with an element_name of Verbatim + +When a Pod verbatim paragraph (AKA "codeblock") is parsed, it +produces this event structure: + + + ...text... + + +The value of the I attribute will be the line number of the +first line of this verbatim block. The I attribute is always +present, and always has the value "preserve". + +The text content will have tabs already expanded. + + +=item events with an element_name of head1 .. head4 + +When a "=head1 ..." directive is parsed, it produces this event +structure: + + + ...stuff... + + +For example, a directive consisting of this: + + =head1 Options to C et al. + +will produce this event structure: + + + Options to + + new + + et al. + + +"=head2" thru "=head4" directives are the same, except for the element +names in the event structure. + +=item events with an element_name of over-bullet + +When an "=over ... Z<>=back" block is parsed where the items are +a bulleted list, it will produce this event structure: + + + + ...Stuff... + + ...more item-bullets... + + +The value of the I attribute is whatever value is after the +"=over" directive, as in "=over 8". If no such value is specified +in the directive, then the I attribute has the value "4". + +For example, this Pod source: + + =over + + =item * + + Stuff + + =item * + + Bar I! + + =back + +produces this event structure: + + + + Stuff + + + Bar baz! + + + +=item events with an element_name of over-number + +When an "=over ... Z<>=back" block is parsed where the items are +a numbered list, it will produce this event structure: + + + + ...Stuff... + + ...more item-number... + + +This is like the "over-bullet" event structure; but note that the contents +are "item-number" instead of "item-bullet", and note that they will have +a "number" attribute, which some formatters/processors may ignore +(since, for example, there's no need for it in HTML when producing +an "
    • ...
    • ...
    " structure), but which any processor may use. + +Note that the values for the I attributes of "item-number" +elements in a given "over-number" area I start at 1 and go up by +one each time. If the Pod source doesn't follow that order (even though +it really should should!), whatever numbers it has will be ignored (with +the correct values being put in the I attributes), and an error +message might be issued to the user. + +=item events with an element_name of over-text + +These events are somewhat unlike the other over-* +structures, as far as what their contents are. When +an "=over ... Z<>=back" block is parsed where the items are +a list of text "subheadings", it will produce this event structure: + + + + ...stuff... + + ...stuff (generally Para or Verbatim elements)... + + ...more item-text and/or stuff... + + +The I attribute is as with the other over-* events. + +For example, this Pod source: + + =over + + =item Foo + + Stuff + + =item Bar I! + + Quux + + =back + +produces this event structure: + + + + Foo + + + Stuff + + + Bar + + baz + + ! + + + Quux + + + + + +=item events with an element_name of over-block + +These events are somewhat unlike the other over-* +structures, as far as what their contents are. When +an "=over ... Z<>=back" block is parsed where there are no items, +it will produce this event structure: + + + ...stuff (generally Para or Verbatim elements)... + + +The I attribute is as with the other over-* events. + +For example, this Pod source: + + =over + + For cutting off our trade with all parts of the world + + For transporting us beyond seas to be tried for pretended offenses + + He is at this time transporting large armies of foreign mercenaries to + complete the works of death, desolation and tyranny, already begun with + circumstances of cruelty and perfidy scarcely paralleled in the most + barbarous ages, and totally unworthy the head of a civilized nation. + + =back + +will produce this event structure: + + + + For cutting off our trade with all parts of the world + + + For transporting us beyond seas to be tried for pretended offenses + + + He is at this time transporting large armies of [...more text...] + + + +=item events with an element_name of over-empty + +B is set to a +true value.> + +These events are somewhat unlike the other over-* +structures, as far as what their contents are. When +an "=over ... Z<>=back" block is parsed where there is no content, +it will produce this event structure: + + + + +The I attribute is as with the other over-* events. + +For example, this Pod source: + + =over + + =over + + =back + + =back + +will produce this event structure: + + + + + + +Note that the outer C<=over> is a block because it has no C<=item>s but still +has content: the inner C<=over>. The inner C<=over>, in turn, is completely +empty, and is treated as such. + +=item events with an element_name of item-bullet + +See L, above. + +=item events with an element_name of item-number + +See L, above. + +=item events with an element_name of item-text + +See L, above. + +=item events with an element_name of for + +TODO... + +=item events with an element_name of Data + +TODO... + +=back + + + +=head1 More Pod::Simple Methods + +Pod::Simple provides a lot of methods that aren't generally interesting +to the end user of an existing Pod formatter, but some of which you +might find useful in writing a Pod formatter. They are listed below. The +first several methods (the accept_* methods) are for declaring the +capabilities of your parser, notably what C<=for I> sections +it's interested in, what extra NE...E codes it accepts beyond +the ones described in the I. + +=over + +=item C<< $parser->accept_targets( I ) >> + +As the parser sees sections like: + + =for html + +or + + =begin html + + + + =end html + +...the parser will ignore these sections unless your subclass has +specified that it wants to see sections targetted to "html" (or whatever +the formatter name is). + +If you want to process all sections, even if they're not targetted for you, +call this before you start parsing: + + $parser->accept_targets('*'); + +=item C<< $parser->accept_targets_as_text( I ) >> + +This is like accept_targets, except that it specifies also that the +content of sections for this target should be treated as Pod text even +if the target name in "=for I" doesn't start with a ":". + +At time of writing, I don't think you'll need to use this. + + +=item C<< $parser->accept_codes( I, I... ) >> + +This tells the parser that you accept additional formatting codes, +beyond just the standard ones (I B C L F S X, plus the two weird ones +you don't actually see in the parse tree, Z and E). For example, to also +accept codes "N", "R", and "W": + + $parser->accept_codes( qw( N R W ) ); + +B + + +=item C<< $parser->accept_directive_as_data( I ) >> + +=item C<< $parser->accept_directive_as_verbatim( I ) >> + +=item C<< $parser->accept_directive_as_processed( I ) >> + +In the unlikely situation that you need to tell the parser that you will +accept additional directives ("=foo" things), you need to first set the +parser to treat its content as data (i.e., not really processed at +all), or as verbatim (mostly just expanding tabs), or as processed text +(parsing formatting codes like BE...E). + +For example, to accept a new directive "=method", you'd presumably +use: + + $parser->accept_directive_as_processed("method"); + +so that you could have Pod lines like: + + =method I<$whatever> thing B + +Making up your own directives breaks compatibility with other Pod +formatters, in a way that using "=for I ..." lines doesn't; +however, you may find this useful if you're making a Pod superset +format where you don't need to worry about compatibility. + + +=item C<< $parser->nbsp_for_S( I ); >> + +Setting this attribute to a true value (and by default it is false) will +turn "SE...E" sequences into sequences of words separated by +C<\xA0> (non-breaking space) characters. For example, it will take this: + + I like S, don't you? + +and treat it as if it were: + + I like DutchEappleEpie, don't you? + +This is handy for output formats that don't have anything quite like an +"SE...E" code, but which do have a code for non-breaking space. + +There is currently no method for going the other way; but I can +probably provide one upon request. + + +=item C<< $parser->version_report() >> + +This returns a string reporting the $VERSION value from your module (and +its classname) as well as the $VERSION value of Pod::Simple. Note that +L requires output formats (wherever possible) to note +this detail in a comment in the output format. For example, for +some kind of SGML output format: + + print OUT ""; + + +=item C<< $parser->pod_para_count() >> + +This returns the count of Pod paragraphs seen so far. + + +=item C<< $parser->line_count() >> + +This is the current line number being parsed. But you might find the +"line_number" event attribute more accurate, when it is present. + + +=item C<< $parser->nix_X_codes( I ) >> + +This attribute, when set to a true value (and it is false by default) +ignores any "XE...E" sequences in the document being parsed. +Many formats don't actually use the content of these codes, so have +no reason to process them. + + +=item C<< $parser->merge_text( I ) >> + +This attribute, when set to a true value (and it is false by default) +makes sure that only one event (or token, or node) will be created +for any single contiguous sequence of text. For example, consider +this somewhat contrived example: + + I just LOVE Z<>hotE<32>apple pie! + +When that is parsed and events are about to be called on it, it may +actually seem to be four different text events, one right after another: +one event for "I just LOVE ", one for "hot", one for " ", and one for +"apple pie!". But if you have merge_text on, then you're guaranteed +that it will be fired as one text event: "I just LOVE hot apple pie!". + + +=item C<< $parser->code_handler( I ) >> + +This specifies code that should be called when a code line is seen +(i.e., a line outside of the Pod). Normally this is undef, meaning +that no code should be called. If you provide a routine, it should +start out like this: + + sub get_code_line { # or whatever you'll call it + my($line, $line_number, $parser) = @_; + ... + } + +Note, however, that sometimes the Pod events aren't processed in exactly +the same order as the code lines are -- i.e., if you have a file with +Pod, then code, then more Pod, sometimes the code will be processed (via +whatever you have code_handler call) before the all of the preceding Pod +has been processed. + + +=item C<< $parser->cut_handler( I ) >> + +This is just like the code_handler attribute, except that it's for +"=cut" lines, not code lines. The same caveats apply. "=cut" lines are +unlikely to be interesting, but this is included for completeness. + + +=item C<< $parser->pod_handler( I ) >> + +This is just like the code_handler attribute, except that it's for +"=pod" lines, not code lines. The same caveats apply. "=pod" lines are +unlikely to be interesting, but this is included for completeness. + + +=item C<< $parser->whine( I, I ) >> + +This notes a problem in the Pod, which will be reported to in the "Pod +Errors" section of the document and/or send to STDERR, depending on the +values of the attributes C, C, and +C. + +=item C<< $parser->scream( I, I ) >> + +This notes an error like C does, except that it is not +suppressible with C. This should be used only for very +serious errors. + + +=item C<< $parser->source_dead(1) >> + +This aborts parsing of the current document, by switching on the flag +that indicates that EOF has been seen. In particularly drastic cases, +you might want to do this. It's rather nicer than just calling +C! + +=item C<< $parser->hide_line_numbers( I ) >> + +Some subclasses that indiscriminately dump event attributes (well, +except for ones beginning with "~") can use this object attribute for +refraining to dump the "start_line" attribute. + +=item C<< $parser->no_whining( I ) >> + +This attribute, if set to true, will suppress reports of non-fatal +error messages. The default value is false, meaning that complaints +I reported. How they get reported depends on the values of +the attributes C and C. + +=item C<< $parser->no_errata_section( I ) >> + +This attribute, if set to true, will suppress generation of an errata +section. The default value is false -- i.e., an errata section will be +generated. + +=item C<< $parser->complain_stderr( I ) >> + +This attribute, if set to true will send complaints to STDERR. The +default value is false -- i.e., complaints do not go to STDERR. + +=item C<< $parser->bare_output( I ) >> + +Some formatter subclasses use this as a flag for whether output should +have prologue and epilogue code omitted. For example, setting this to +true for an HTML formatter class should omit the +"......" prologue and the +"" epilogue. + +If you want to set this to true, you should probably also set +C or at least C to true. + +=item C<< $parser->preserve_whitespace( I ) >> + +If you set this attribute to a true value, the parser will try to +preserve whitespace in the output. This means that such formatting +conventions as two spaces after periods will be preserved by the parser. +This is primarily useful for output formats that treat whitespace as +significant (such as text or *roff, but not HTML). + +=item C<< $parser->parse_empty_lists( I ) >> + +If this attribute is set to true, the parser will not ignore empty +C<=over>/C<=back> blocks. The type of C<=over> will be I, documented +above, L. + +=back + +=head1 SEE ALSO + +L -- event-based Pod-parsing framework + +L -- like Pod::Simple, but each sort of event +calls its own method (like C) + +L -- a Pod-parsing framework like Pod::Simple, +but with a token-stream interface + +L -- a Pod-parsing framework like Pod::Simple, +but with a tree interface + +L -- a simple Pod::Simple subclass that reads +documents, and then makes a plaintext report of any errors found in the +document + +L -- for dumping Pod documents as tidily +indented XML, showing each event on its own line + +L -- dumps a Pod document as XML (without +introducing extra whitespace as Pod::Simple::DumpAsXML does). + +L -- for dumping Pod documents as tidily +indented text, showing each event on its own line + +L -- class for objects representing the values +of the TODO and TODO attributes of LE...E elements + +L -- the module the Pod::Simple uses for evaluating +EE...E content + +L -- a simple plaintext formatter for Pod + +L -- like Pod::Simple::Text, but +makes no effort for indent or wrap the text being formatted + +L -- a simple HTML formatter for Pod + +L + +L + +L + +=head1 SUPPORT + +Questions or discussion about POD and Pod::Simple should be sent to the +pod-people@perl.org mail list. Send an empty email to +pod-people-subscribe@perl.org to subscribe. + +This module is managed in an open GitHub repository, +L. Feel free to fork and contribute, or +to clone L and send patches! + +Patches against Pod::Simple are welcome. Please send bug reports to +. + +=head1 COPYRIGHT AND DISCLAIMERS + +Copyright (c) 2002 Sean M. Burke. + +This library is free software; you can redistribute it and/or modify it +under the same terms as Perl itself. + +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. + +=head1 AUTHOR + +Pod::Simple was created by Sean M. Burke . +But don't bother him, he's retired. + +Pod::Simple is maintained by: + +=over + +=item * Allison Randal C + +=item * Hans Dieter Pearcey C + +=item * David E. Wheeler C + +=back + +=for notes +Hm, my old podchecker version (1.2) says: + *** WARNING: node 'http://search.cpan.org/' contains non-escaped | or / at line 38 in file Subclassing.pod + *** WARNING: node 'http://lists.perl.org/showlist.cgi?name=pod-people' contains non-escaped | or / at line 41 in file Subclassing.pod +Yes, L<...> is hard. + + +=cut + + diff --git a/lib/Pod/Simple/Text.pm b/lib/Pod/Simple/Text.pm index df82c0784c..21c7a40cb7 100644 --- a/lib/Pod/Simple/Text.pm +++ b/lib/Pod/Simple/Text.pm @@ -6,7 +6,7 @@ use Carp (); use Pod::Simple::Methody (); use Pod::Simple (); use vars qw( @ISA $VERSION $FREAKYMODE); -$VERSION = '2.02'; +$VERSION = '3.19'; @ISA = ('Pod::Simple::Methody'); BEGIN { *DEBUG = defined(&Pod::Simple::DEBUG) ? \&Pod::Simple::DEBUG @@ -66,6 +66,14 @@ sub end_Para { $_[0]->emit_par( 0) } sub end_item_bullet { $_[0]->emit_par( 0) } sub end_item_number { $_[0]->emit_par( 0) } sub end_item_text { $_[0]->emit_par(-2) } +sub start_L { $_[0]{'Link'} = $_[1] if $_[1]->{type} eq 'url' } +sub end_L { + if (my $link = delete $_[0]{'Link'}) { + # Append the URL to the output unless it's already present. + $_[0]{'Thispara'} .= " <$link->{to}>" + unless $_[0]{'Thispara'} =~ /\b\E$link->{to}/; + } +} sub emit_par { my($self, $tweak_indent) = splice(@_,0,2); @@ -133,9 +141,22 @@ This is a subclass of L and inherits all its methods. L, L, L +=head1 SUPPORT + +Questions or discussion about POD and Pod::Simple should be sent to the +pod-people@perl.org mail list. Send an empty email to +pod-people-subscribe@perl.org to subscribe. + +This module is managed in an open GitHub repository, +L. Feel free to fork and contribute, or +to clone L and send patches! + +Patches against Pod::Simple are welcome. Please send bug reports to +. + =head1 COPYRIGHT AND DISCLAIMERS -Copyright (c) 2002 Sean M. Burke. All rights reserved. +Copyright (c) 2002 Sean M. Burke. This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. @@ -146,7 +167,19 @@ merchantability or fitness for a particular purpose. =head1 AUTHOR -Sean M. Burke C +Pod::Simple was created by Sean M. Burke . +But don't bother him, he's retired. -=cut +Pod::Simple is maintained by: +=over + +=item * Allison Randal C + +=item * Hans Dieter Pearcey C + +=item * David E. Wheeler C + +=back + +=cut diff --git a/lib/Pod/Simple/TextContent.pm b/lib/Pod/Simple/TextContent.pm index 3675b005ef..33be7b2258 100644 --- a/lib/Pod/Simple/TextContent.pm +++ b/lib/Pod/Simple/TextContent.pm @@ -6,7 +6,7 @@ use strict; use Carp (); use Pod::Simple (); use vars qw( @ISA $VERSION ); -$VERSION = '2.02'; +$VERSION = '3.19'; @ISA = ('Pod::Simple'); sub new { @@ -68,9 +68,22 @@ This is a subclass of L and inherits all its methods. L, L, L +=head1 SUPPORT + +Questions or discussion about POD and Pod::Simple should be sent to the +pod-people@perl.org mail list. Send an empty email to +pod-people-subscribe@perl.org to subscribe. + +This module is managed in an open GitHub repository, +L. Feel free to fork and contribute, or +to clone L and send patches! + +Patches against Pod::Simple are welcome. Please send bug reports to +. + =head1 COPYRIGHT AND DISCLAIMERS -Copyright (c) 2002 Sean M. Burke. All rights reserved. +Copyright (c) 2002 Sean M. Burke. This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. @@ -81,7 +94,19 @@ merchantability or fitness for a particular purpose. =head1 AUTHOR -Sean M. Burke C +Pod::Simple was created by Sean M. Burke . +But don't bother him, he's retired. -=cut +Pod::Simple is maintained by: + +=over +=item * Allison Randal C + +=item * Hans Dieter Pearcey C + +=item * David E. Wheeler C + +=back + +=cut diff --git a/lib/Pod/Simple/TiedOutFH.pm b/lib/Pod/Simple/TiedOutFH.pm index b031fe5869..95686116a6 100644 --- a/lib/Pod/Simple/TiedOutFH.pm +++ b/lib/Pod/Simple/TiedOutFH.pm @@ -3,6 +3,8 @@ use strict; package Pod::Simple::TiedOutFH; use Symbol ('gensym'); use Carp (); +use vars qw($VERSION ); +$VERSION = '3.19'; #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/lib/Pod/Simple/Transcode.pm b/lib/Pod/Simple/Transcode.pm index 434f963388..9ecf85aec8 100644 --- a/lib/Pod/Simple/Transcode.pm +++ b/lib/Pod/Simple/Transcode.pm @@ -1,6 +1,8 @@ require 5; package Pod::Simple::Transcode; +use vars qw($VERSION ); +$VERSION = '3.19'; BEGIN { if(defined &DEBUG) {;} # Okay diff --git a/lib/Pod/Simple/TranscodeDumb.pm b/lib/Pod/Simple/TranscodeDumb.pm index d5eb7e5fb8..4031ca3db2 100644 --- a/lib/Pod/Simple/TranscodeDumb.pm +++ b/lib/Pod/Simple/TranscodeDumb.pm @@ -5,7 +5,7 @@ require 5; package Pod::Simple::TranscodeDumb; use strict; use vars qw($VERSION %Supported); -$VERSION = '2.02'; +$VERSION = '3.19'; # This module basically pretends it knows how to transcode, except # only for null-transcodings! We use this when Encode isn't # available. diff --git a/lib/Pod/Simple/TranscodeSmart.pm b/lib/Pod/Simple/TranscodeSmart.pm index 3fc26a4a26..de193fa0c5 100644 --- a/lib/Pod/Simple/TranscodeSmart.pm +++ b/lib/Pod/Simple/TranscodeSmart.pm @@ -8,6 +8,8 @@ package Pod::Simple::TranscodeSmart; use strict; use Pod::Simple; require Encode; +use vars qw($VERSION ); +$VERSION = '3.19'; sub is_dumb {0} sub is_smart {1} diff --git a/lib/Pod/Simple/XHTML.pm b/lib/Pod/Simple/XHTML.pm index d130faaa96..c3229046d8 100644 --- a/lib/Pod/Simple/XHTML.pm +++ b/lib/Pod/Simple/XHTML.pm @@ -23,13 +23,29 @@ This is a subclass of L and inherits all its methods. The implementation is entirely different than L, but it largely preserves the same interface. +=head2 Minimal code + + use Pod::Simple::XHTML; + my $psx = Pod::Simple::XHTML->new; + $psx->output_string(\my $html); + $psx->parse_file('path/to/Module/Name.pm'); + open my $out, '>', 'out.html' or die "Cannot open 'out.html': $!\n"; + print $out $html; + +You can also control the character encoding and entities. For example, if +you're sure that the POD is properly encoded (using the C<=encoding> command), +you can prevent high-bit characters from being encoded as HTML entities and +declare the output character set as UTF-8 before parsing, like so: + + $psx->html_charset('UTF-8'); + $psx->html_encode_chars('&<>">'); + =cut package Pod::Simple::XHTML; use strict; use vars qw( $VERSION @ISA $HAS_HTML_ENTITIES ); -$VERSION = '3.04'; -use Carp (); +$VERSION = '3.19'; use Pod::Simple::Methody (); @ISA = ('Pod::Simple::Methody'); @@ -76,6 +92,16 @@ to put before the "Foo%3a%3aBar". The default value is What to put after "Foo%3a%3aBar" in the URL. This option is not set by default. +=head2 man_url_prefix + +In turning C<< L >> into http://whatever/man/1/crontab, what +to put before the "1/crontab". The default value is +"http://man.he.net/man". + +=head2 man_url_postfix + +What to put after "1/crontab" in the URL. This option is not set by default. + =head2 title_prefix, title_postfix What to put before and after the title in the head. The values should @@ -107,6 +133,12 @@ default value is just a content type header tag: Add additional meta tags here, or blocks of inline CSS or JavaScript (wrapped in the appropriate tags). +=head2 html_h_level + +This is the level of HTML "Hn" element to which a Pod "head1" corresponds. For +example, if C is set to 2, a head1 will produce an H2, a head2 +will produce an H3, and so on. + =head2 default_title Set a default title for the page if no title can be determined from the @@ -148,8 +180,10 @@ index for the sake of tradition). __PACKAGE__->_accessorize( 'perldoc_url_prefix', 'perldoc_url_postfix', + 'man_url_prefix', + 'man_url_postfix', 'title_prefix', 'title_postfix', - 'html_css', + 'html_css', 'html_javascript', 'html_doctype', 'html_header_tags', @@ -199,7 +233,7 @@ want to override this if you are adding a custom element type that does more than just display formatted text. Perhaps adding a way to generate HTML tables from an extended version of POD. -So, let's say you want add a custom element called 'foo'. In your +So, let's say you want to add a custom element called 'foo'. In your subclass's C method, after calling C you'd call: $new->accept_targets_as_text( 'foo' ); @@ -378,23 +412,57 @@ __END__ =head1 SEE ALSO -L, L +L, L, L + +=head1 SUPPORT + +Questions or discussion about POD and Pod::Simple should be sent to the +pod-people@perl.org mail list. Send an empty email to +pod-people-subscribe@perl.org to subscribe. -=head1 COPYRIGHT +This module is managed in an open GitHub repository, +L. Feel free to fork and contribute, or +to clone L and send patches! + +Patches against Pod::Simple are welcome. Please send bug reports to +. + +=head1 COPYRIGHT AND DISCLAIMERS Copyright (c) 2003-2005 Allison Randal. -This library is free software; you can redistribute it and/or modify -it under the same terms as Perl itself. The full text of the license -can be found in the LICENSE file included with this module. +This library is free software; you can redistribute it and/or modify it +under the same terms as Perl itself. -This library is distributed in the hope that it will be useful, but +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. +=head1 ACKNOWLEDGEMENTS + +Thanks to L for permission to use its +L site for man page links. + +Thanks to L for permission to use the +site for Perl module links. + =head1 AUTHOR -Allison Randal +Pod::Simpele::XHTML was created by Allison Randal . -=cut +Pod::Simple was created by Sean M. Burke . +But don't bother him, he's retired. + +Pod::Simple is maintained by: +=over + +=item * Allison Randal C + +=item * Hans Dieter Pearcey C + +=item * David E. Wheeler C + +=back + +=cut diff --git a/lib/Pod/Simple/XMLOutStream.pm b/lib/Pod/Simple/XMLOutStream.pm index 1e7ec15d9a..61473e317e 100644 --- a/lib/Pod/Simple/XMLOutStream.pm +++ b/lib/Pod/Simple/XMLOutStream.pm @@ -5,7 +5,7 @@ use strict; use Carp (); use Pod::Simple (); use vars qw( $ATTR_PAD @ISA $VERSION $SORT_ATTRS); -$VERSION = '2.02'; +$VERSION = '3.19'; BEGIN { @ISA = ('Pod::Simple'); *DEBUG = \&Pod::Simple::DEBUG unless defined &DEBUG; @@ -137,10 +137,26 @@ options in this module (and the dozen modules it depends on) are undocumented; but one of those undocumented bits might be just what you're looking for. +=head1 SEE ALSO + +L, L, L + +=head1 SUPPORT + +Questions or discussion about POD and Pod::Simple should be sent to the +pod-people@perl.org mail list. Send an empty email to +pod-people-subscribe@perl.org to subscribe. + +This module is managed in an open GitHub repository, +L. Feel free to fork and contribute, or +to clone L and send patches! + +Patches against Pod::Simple are welcome. Please send bug reports to +. =head1 COPYRIGHT AND DISCLAIMERS -Copyright (c) 2002-4 Sean M. Burke. All rights reserved. +Copyright (c) 2002-2004 Sean M. Burke. This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. @@ -151,7 +167,19 @@ merchantability or fitness for a particular purpose. =head1 AUTHOR -Sean M. Burke C +Pod::Simple was created by Sean M. Burke . +But don't bother him, he's retired. -=cut +Pod::Simple is maintained by: +=over + +=item * Allison Randal C + +=item * Hans Dieter Pearcey C + +=item * David E. Wheeler C + +=back + +=cut diff --git a/parrotbug b/parrotbug index e26f026991..abd3df84de 100755 --- a/parrotbug +++ b/parrotbug @@ -584,9 +584,8 @@ sub save_report { print < of the invocant. .sub 'HOW' :method :nsentry $P0 = typeof self - $P1 = getprop 'metaclass', $P0 + $P1 = getprop $P0, 'metaclass' .return ($P1) .end @@ -128,7 +128,7 @@ Return the memory address for the invocant. =cut .sub 'WHERE' :method :nsentry - $I0 = get_addr self + $I0 = get_id self .return ($I0) .end @@ -141,7 +141,7 @@ Return the package for the object. .sub 'WHO' :method :nsentry $P0 = typeof self - $P0 = getprop 'metaclass', $P0 + $P0 = getprop $P0, 'metaclass' $P0 = getattribute $P0, 'parrotclass' $P0 = $P0.'get_namespace'() .return ($P0) diff --git a/runtime/parrot/library/ProfTest/PIRProfile.nqp b/runtime/parrot/library/ProfTest/PIRProfile.nqp index 1b4cb143d3..96f65339c5 100644 --- a/runtime/parrot/library/ProfTest/PIRProfile.nqp +++ b/runtime/parrot/library/ProfTest/PIRProfile.nqp @@ -68,7 +68,7 @@ method build_pir_profile() { my $fh := pir::new__p_sc('FileHandle'); $fh.open($tmp_pir, "w"); - $fh.puts(self); + $fh.print(self); $fh.close(); my $parrot_exe := %config ~ %config ~ %config; diff --git a/runtime/parrot/library/SDL/Surface.pir b/runtime/parrot/library/SDL/Surface.pir index 0f6989e4e3..d9c43f5d9a 100644 --- a/runtime/parrot/library/SDL/Surface.pir +++ b/runtime/parrot/library/SDL/Surface.pir @@ -139,7 +139,7 @@ you have little reason to use it directly. .local pmc pixels_entry pixels_entry = layout[ 'pixels' ] - pixels_struct = getprop '_struct', pixels_entry + pixels_struct = getprop pixels_entry, '_struct' pixels_layout = new 'OrderedHash' if bpp == 8 goto eight_bits diff --git a/runtime/parrot/library/Stream/Writer.pir b/runtime/parrot/library/Stream/Writer.pir index ea33b6f61b..864a281960 100644 --- a/runtime/parrot/library/Stream/Writer.pir +++ b/runtime/parrot/library/Stream/Writer.pir @@ -59,7 +59,7 @@ END: interpinfo mysub, .INTERPINFO_CURRENT_SUB #interpinfo myself, .INTERPINFO_CURRENT_OBJECT - getprop source, "CALL", mysub + getprop source, mysub, "CALL" source() # close the source @@ -68,7 +68,6 @@ END: # mark it as closed .local pmc status - interpinfo self, .INTERPINFO_CURRENT_OBJECT getattribute status, self, 'status' status = 0 .end diff --git a/runtime/parrot/library/Test/Builder.pir b/runtime/parrot/library/Test/Builder.pir index c66f769edb..92c899a81c 100644 --- a/runtime/parrot/library/Test/Builder.pir +++ b/runtime/parrot/library/Test/Builder.pir @@ -296,7 +296,7 @@ declared a plan or if you pass an invalid argument. .local int num_tests num_tests = tests - unless num_tests goto write_header + unless num_tests goto bail_out testplan.'set_tests'( num_tests ) @@ -309,6 +309,13 @@ declared a plan or if you pass an invalid argument. output.'write'( header ) .return() + + bail_out: + .local pmc plan_exception + plan_exception = new 'Exception' + plan_exception = 'You said to run 0 tests' + throw plan_exception + .end =item done_testing diff --git a/runtime/parrot/library/Test/Builder/Output.pir b/runtime/parrot/library/Test/Builder/Output.pir index 19c2eacafa..97b4dd788e 100644 --- a/runtime/parrot/library/Test/Builder/Output.pir +++ b/runtime/parrot/library/Test/Builder/Output.pir @@ -108,7 +108,7 @@ unescaped newlines. .local pmc output output = self.'output'() - output.'puts'( message ) + output.'print'( message ) .end .sub escape_newlines :method @@ -192,7 +192,7 @@ unescaped newlines. WRITE_MESSAGE: .local pmc diag_output diag_output = self.'diag_output'() - .tailcall diag_output.'puts'( message ) + .tailcall diag_output.'print'( message ) .end =back diff --git a/runtime/parrot/library/Test/More.pir b/runtime/parrot/library/Test/More.pir index c1b3e8f5c5..932c35178d 100644 --- a/runtime/parrot/library/Test/More.pir +++ b/runtime/parrot/library/Test/More.pir @@ -686,11 +686,11 @@ This handles comparisons of array-like and hash-like structures. goto report_result compare_array: - ( result, diagnosis ) = compare_array( left, right, position ) + result = compare_array( left, right, position ) goto report_result compare_hash: - (result, diagnosis ) = compare_hash( left, right, position ) + result = compare_hash( left, right, position ) goto report_result report_result: diff --git a/runtime/parrot/library/distutils.pir b/runtime/parrot/library/distutils.pir index 0aef0d969a..73fe7cd1d4 100644 --- a/runtime/parrot/library/distutils.pir +++ b/runtime/parrot/library/distutils.pir @@ -61,7 +61,7 @@ Update from the repository. Output a skeleton for Plumage -=item sdist, sdist_gztar, sdist_zip, sdist_rpm, manifest +=item sdist, sdist_gztar, sdist_rpm, manifest Create a source distribution or a source RPM package @@ -271,8 +271,6 @@ L register_step_after('clean', _clean_man_pod) .const 'Sub' _clean_gztar = '_clean_gztar' register_step_after('clean', _clean_gztar) - .const 'Sub' _clean_zip = '_clean_zip' - register_step_after('clean', _clean_zip) .const 'Sub' _clean_smoke = '_clean_smoke' register_step_after('clean', _clean_smoke) @@ -304,8 +302,6 @@ L register_step('sdist', _sdist) .const 'Sub' _sdist_gztar = '_sdist_gztar' register_step('sdist_gztar', _sdist_gztar) - .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' @@ -336,7 +332,6 @@ L .const 'Sub' _no_zlib = '_no_zlib' register_step('smoke', _no_zlib) register_step('sdist_gztar', _no_zlib) - register_step('sdist_zip', _no_zlib) register_step('bdist_rpm', _no_zlib) L2: .end @@ -1828,11 +1823,11 @@ the value is the POD pathname, for example 'src/prog.pir' unless $P0 goto L2 bin = shift $P0 pbc = hash[bin] - $S1 = _mk_path_exe(pbc, exe) + $S1 = concat bin, exe unlink($S1, 1 :named('verbose')) - $S1 = _mk_path_exe(pbc, '.c') + $S1 = concat bin, '.c' unlink($S1, 1 :named('verbose')) - $S1 = _mk_path_exe(pbc, obj) + $S1 = concat bin, obj unlink($S1, 1 :named('verbose')) goto L1 L2: @@ -2190,7 +2185,7 @@ the default value is "t/*.t" .sub 'sort_strings' .param pmc array # currently, FixedStringArray hasn't the method sort. - # see TT #1356 + # see GH #384 $I0 = elements array $P0 = new 'FixedPMCArray' set $P0, $I0 @@ -2457,6 +2452,11 @@ the default value is man .local int has_zlib $P0 = get_config() has_zlib = $P0['has_zlib'] + $S0 = $P0['osname'] + unless $S0 == 'MSWin32' goto L8 + has_zlib = 0 + L8: + $P0 = get_install_gzfiles(kv :flat :named) $P1 = iter $P0 L5: @@ -3123,7 +3123,7 @@ the default value is setup.pir inc $I0 $P0 = new 'FixedPMCArray' # currently, FixedStringArray hasn't the method sort. - # see TT #1356 + # see GH #384 set $P0, $I0 $I0 = 0 $P0[$I0] = 'MANIFEST' @@ -3217,17 +3217,10 @@ the default value is setup.pir =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 @@ -3293,49 +3286,6 @@ On Windows calls sdist_zip, otherwise sdist_gztar .return ($S0) .end -=head3 Step sdist_zip - -=cut - -.sub '_sdist_zip' :anon - .param pmc kv :slurpy :named - run_step('manifest', kv :flat :named) - - load_bytecode 'Archive/Zip.pbc' - $S0 = slurp('MANIFEST') - $P0 = split "\n", $S0 - $S0 = pop $P0 - .local string archive_file - archive_file = get_tarname('.zip', kv :flat :named) - $I0 = newer(archive_file, $P0) - if $I0 goto L1 - .local pmc archive - archive = new ['Archive';'Zip'] - .local string dirname - $S0 = get_tarname('', kv :flat :named) - dirname = $S0 . '/' - $P1 = iter $P0 - L2: - unless $P1 goto L3 - $S0 = shift $P1 - $S1 = dirname . $S0 - archive.'addFile'($S0, $S1) - goto L2 - L3: - archive.'writeToFileNamed'(archive_file) - print "creat " - say archive_file - 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 @@ -3968,7 +3918,7 @@ TEMPLATE .param pmc kv :slurpy :named $P0 = new 'ResizablePMCArray' # currently, ResizableStringArray hasn't the method sort. - # see TT #1356 + # see GH #384 $P1 = get_install_files(kv :flat :named) $P2 = iter $P1 L1: diff --git a/runtime/parrot/library/osutils.pir b/runtime/parrot/library/osutils.pir index 9677ce387d..a588eddae4 100644 --- a/runtime/parrot/library/osutils.pir +++ b/runtime/parrot/library/osutils.pir @@ -377,7 +377,7 @@ called as C. $P0.'open'(dst, 'w') pop_eh - $P0.'puts'($S0) + $P0.'print'($S0) $P0.'close'() .return () @@ -489,7 +489,7 @@ will not affect the file that it points to. new $P0, 'OS' push_eh _handler - $P0.'rm'(filename) + $P0.'unlink'(filename) pop_eh L1: .return () @@ -576,12 +576,12 @@ be verbose. If given, the string I> will be displayed. rmtree($S1) goto L3 L5: - $P0.'rm'($S1) + $P0.'unlink'($S1) goto L3 L4: push_eh _handler $S1 = path - $P0.'rm'($S1) + $P0.'rmdir'($S1) pop_eh L1: .return () @@ -944,7 +944,7 @@ be verbose. If given, the string I> will be displayed. $P0.'open'(filename, 'w') pop_eh - $P0.'puts'(content) + $P0.'print'(content) $P0.'close'() .return () @@ -993,7 +993,7 @@ be verbose. If given, the string I> will be displayed. $P0.'open'(filename, 'a') pop_eh - $P0.'puts'(content) + $P0.'print'(content) $P0.'close'() .return () @@ -1174,7 +1174,7 @@ For more information, see the C man page. $S1 = filename . '.gz' gh.'open'($S1, 'wb') - gh.'puts'($S0) + gh.'print'($S0) gh.'close'() unlink(filename) diff --git a/runtime/parrot/library/parrotlib.pir b/runtime/parrot/library/parrotlib.pir index 325e0b925d..b693eef87e 100644 --- a/runtime/parrot/library/parrotlib.pir +++ b/runtime/parrot/library/parrotlib.pir @@ -196,7 +196,7 @@ END: .include "interpinfo.pasm" interpinfo $P1, .INTERPINFO_CURRENT_SUB - getprop $P0, "path", $P1 + getprop $P0, $P1, "path" path = $P0 $S0 = concat path, name diff --git a/runtime/parrot/library/postgres.pir b/runtime/parrot/library/postgres.pir index 58b9afba61..be3cf483d9 100644 --- a/runtime/parrot/library/postgres.pir +++ b/runtime/parrot/library/postgres.pir @@ -54,8 +54,9 @@ $P0 = fn(args :flat) $P1 = null - $P1 = dlfunc $P1, "Parrot_str_new", "Spi" - $S0 = $P1($P0, 0) + $P1 = dlfunc $P1, "Parrot_str_new", "Sppi" + $P2 = getinterp + $S0 = $P1($P2, $P0, 0) .return ($S0) .end diff --git a/runtime/parrot/library/random_lib.pir b/runtime/parrot/library/random_lib.pir deleted file mode 100644 index f96fb57887..0000000000 --- a/runtime/parrot/library/random_lib.pir +++ /dev/null @@ -1,37 +0,0 @@ -# Copyright (C) 2005-2009, Parrot Foundation. -# used by examples/shootout/random.pir and others -# by Joshua Isom - -.const int IM = 139968 -.const int IA = 3877 -.const int IC = 29573 - -.sub init :load :anon - .local pmc last - last = new 'Integer' - last = 42 - global "_last_seed" = last -.end - -.sub gen_random - .param num max - .local pmc last - last = global "_last_seed" - $I0 = last - $I0 *= IA - $I0 += IC - $I0 %= IM - last = $I0 - $N0 = $I0 - $N1 = IM - $N0 *= max - $N0 /= $N1 - .return($N0) -.end - - -# Local Variables: -# mode: pir -# fill-column: 100 -# End: -# vim: expandtab shiftwidth=4 ft=pir: diff --git a/src/alarm.c b/src/alarm.c new file mode 100644 index 0000000000..81b18b4be5 --- /dev/null +++ b/src/alarm.c @@ -0,0 +1,264 @@ +/* +Copyright (C) 2010-2012, Parrot Foundation. + +=head1 NAME + +src/alarm.c - Implements a mechanism for alarms, setting a flag after a delay. + +=cut + +*/ + +#include "parrot/parrot.h" +#include "parrot/alarm.h" + +/* Some per-process state */ +static volatile UINTVAL alarm_serial = 0; +static volatile FLOATVAL alarm_set_to = 0.0; + +/* This file relies on POSIX. Probably need two other versions of it: + * one for Windows and one for platforms with no signals or threads. */ + +#ifdef _WIN32 +# include +#else +# include +# include +# ifdef PARROT_HAS_HEADER_PTHREAD +# include +# endif +#endif +#include + +/* HEADERIZER HFILE: include/parrot/alarm.h */ + +/* HEADERIZER BEGIN: static */ +/* Don't modify between HEADERIZER BEGIN / HEADERIZER END. Your changes will be lost. */ + +static void posix_alarm_set(FLOATVAL wait); +#define ASSERT_ARGS_posix_alarm_set __attribute__unused__ int _ASSERT_ARGS_CHECK = (0) +/* Don't modify between HEADERIZER BEGIN / HEADERIZER END. Your changes will be lost. */ +/* HEADERIZER END: static */ + + +/* + +=over 4 + +=item C + +Initialize the alarm queue. This function should only be called from the initial +pthread. Any other pthreads should make sure to mask out SIGALRM. + +=cut + +*/ + +void +Parrot_alarm_init(void) +{ + ASSERT_ARGS(Parrot_alarm_init) +#ifdef _WIN32 + /* TODO: Implement on Windows */ +#else + struct sigaction sa; + memset(&sa, 0, sizeof (struct sigaction)); + sa.sa_handler = Parrot_alarm_callback; + sa.sa_flags = SA_RESTART; + + if (sigaction(SIGALRM, &sa, 0) == -1) { + perror("sigaction failed in Parrot_timers_init"); + exit(EXIT_FAILURE); + } + + Parrot_alarm_unmask(NULL); +#endif +} + +/* + +=item C + +A helper function to set an alarm. + +=cut + +*/ + +static void +posix_alarm_set(FLOATVAL wait) +{ + ASSERT_ARGS(posix_alarm_set) +#ifdef _WIN32 + /* TODO: Implement on Windows */ +#else + const int MIL = 1000000; + struct itimerval itmr; + int sec, usec; + + sec = (int) wait; + usec = (int) ((wait - sec) * MIL); + + itmr.it_value.tv_sec = sec; + itmr.it_value.tv_usec = usec; + itmr.it_interval.tv_sec = 0; + itmr.it_interval.tv_usec = 0; + + if (setitimer(ITIMER_REAL, &itmr, 0) == -1) { + if (errno == EINVAL) { + Parrot_alarm_callback(SIGALRM); + } + else { + perror("setitimer failed in set_posix_alarm"); + exit(EXIT_FAILURE); + } + } +#endif +} + +/* + +=item C + +=item C + +These block or unblock the signal for alarms. Any thread with signals +unblocked should avoid waiting on a lock or condition variable. + +=cut + +*/ + +void +Parrot_alarm_mask(SHIM_INTERP) +{ + ASSERT_ARGS(Parrot_alarm_mask) +#ifdef _WIN32 + /* TODO: Implement on Windows */ +#else + sigset_t mask; + sigemptyset(&mask); + sigaddset(&mask, SIGALRM); + pthread_sigmask(SIG_BLOCK, &mask, 0); +#endif +} + +void +Parrot_alarm_unmask(SHIM_INTERP) +{ + ASSERT_ARGS(Parrot_alarm_unmask) +#ifdef _WIN32 + /* TODO: Implement on Windows */ +#else + sigset_t mask; + sigemptyset(&mask); + sigaddset(&mask, SIGALRM); + pthread_sigmask(SIG_UNBLOCK, &mask, 0); +#endif +} + +/* + +=item C + +Callback for SIGALRM. When this is called, a timer should be ready to fire. + +=cut + +*/ + +void +Parrot_alarm_callback(SHIM(int sig_number)) +{ + ASSERT_ARGS(Parrot_alarm_callback) + + /* Not atomic; only one thread ever writes this value */ + alarm_serial += 1; +} + +/* + +=item C + +Has any alarm triggered since we last checked? + +Possible design improvement: Alert only the thread that +set the alarm. + +=cut + +*/ + +PARROT_EXPORT +int +Parrot_alarm_check(ARGMOD(UINTVAL* last_serial)) +{ + ASSERT_ARGS(Parrot_alarm_check) + + if (*last_serial == alarm_serial) { + return 0; + } + else { + *last_serial = alarm_serial; + return 1; + } +} + +/* + +=item C + +Sets an alarm to trigger at time 'when'. + +=cut + +*/ + +PARROT_EXPORT +void +Parrot_alarm_set(FLOATVAL when) +{ + ASSERT_ARGS(Parrot_alarm_set) +#ifdef _WIN32 + /* TODO: Implement on Windows */ +#else + FLOATVAL now = Parrot_floatval_time(); + + /* Better late than early */ + when += 0.0001; + + if (alarm_set_to > now && alarm_set_to < when) + return; + + alarm_set_to = when; + posix_alarm_set(when - now); +#endif +} + +/* + +=item C + +Trigger an alarm wakeup. + +=cut + +*/ + +void +Parrot_alarm_now(void) +{ + ASSERT_ARGS(Parrot_alarm_now) +#ifdef _WIN32 + /* TODO: Implement on Windows */ +#else + kill(getpid(), SIGALRM); +#endif +} + +/* + * Local variables: + * c-file-style: "parrot" + * End: + * vim: expandtab shiftwidth=4 cinoptions='\:2=2' : + */ diff --git a/src/atomic/gcc_x86.c b/src/atomic/gcc_x86.c deleted file mode 100644 index 7da14c39bb..0000000000 --- a/src/atomic/gcc_x86.c +++ /dev/null @@ -1,111 +0,0 @@ -/* atomic/gcc_x86.c - * Copyright (C) 2006-2010, Parrot Foundation. - */ - -#include "parrot/parrot.h" -#include "parrot/atomic/gcc_x86.h" - -/* HEADERIZER HFILE: include/parrot/atomic/gcc_x86.h */ - -/* - -=head1 NAME - -src/atomic/gcc_x86.c - -=head1 DESCRIPTION - -An implementation of atomic operations on x86 platforms with GCC-style inline -assembly suppport. - -=head2 Functions - -=over 4 - -=cut - -*/ - -/* - * if both I386 and X86_64 cmpxchg are defined, we are on x86_64 - - * reuse existing code - */ -/* - -=item C - -The CMPXCHG assembly instruction is a single cycle x86 instruction -that compares C and C<*ptr>. If they are equal, sets -C<*ptr> to C. Otherwise sets C to C<*ptr>. - -=cut - -*/ - - -PARROT_EXPORT -PARROT_CANNOT_RETURN_NULL -void * -parrot_i386_cmpxchg(ARGMOD(void *volatile *ptr), ARGIN_NULLOK(void *expect), - ARGIN_NULLOK(void *update)) -{ - ASSERT_ARGS(parrot_i386_cmpxchg) -#if defined(PARROT_HAS_X86_64_GCC_CMPXCHG) - __asm__ __volatile__("lock\n" - "cmpxchgq %1,%2":"=a"(expect):"q"(update), "m"(*ptr), - "0"(expect) - :"memory"); -#else - __asm__ __volatile__("lock\n" - "cmpxchgl %1,%2":"=a"(expect):"q"(update), "m"(*ptr), - "0"(expect) - :"memory"); -#endif - return expect; -} - -/* - -=item C - -C is an x86 instruction that performs the following operation: -Temporary = C; -C = C + C; -C = C; - -=cut - -*/ - - -PARROT_EXPORT -long -parrot_i386_xadd(ARGIN(volatile long *l), long amount) -{ - ASSERT_ARGS(parrot_i386_xadd) - long result = amount; -#if defined(PARROT_HAS_X86_64_GCC_CMPXCHG) - __asm__ __volatile__("lock\n" "xaddq %0, %1" : "=r"(result), "=m"(*l) : - "0"(result), "m"(*l)); -#else - __asm__ __volatile__("lock\n" "xaddl %0, %1" : "=r"(result), "=m"(*l) : - "0"(result), "m"(*l)); -#endif - return result + amount; -} - -/* - -=back - -=cut - -*/ - -/* - * Local variables: - * c-file-style: "parrot" - * End: - * vim: expandtab shiftwidth=4 cinoptions='\:2=2' : - */ diff --git a/src/atomic/sparc_v9.s b/src/atomic/sparc_v9.s deleted file mode 100644 index 8b6a8e599e..0000000000 --- a/src/atomic/sparc_v9.s +++ /dev/null @@ -1,24 +0,0 @@ -! sparc-v9.s -! Copyright 2006 Parrot Foundation - -! Contains atomic-ops support routines for Sparc chips supporting a compare-and-swap instruction. - - .section ".text" - .align 4 - -! successp [%r8] = parrot_sparc_cas32(address [%r8], old [%r9], new [%r10]) -parrot_sparc_cas32: - cas [%r8],%r9,%r10 - or %g0, 1, %r8 - cmp %r9, %r10 - retl ! return from leaf - movne %icc, %g0, %r8 ! delay slot - .global parrot_sparc_cas32 - -parrot_sparc_cas64: - casx [%r8],%r9,%r10 - or %g0, 1, %r8 - cmp %r9, %r10 - retl ! return from leaf - movne %icc, %g0, %r8 ! delay slot - .global parrot_sparc_cas64 diff --git a/src/call/args.c b/src/call/args.c index ede4cd2fbe..cafe1f3b62 100644 --- a/src/call/args.c +++ b/src/call/args.c @@ -23,6 +23,7 @@ passing to and from subroutines following the Parrot Calling Conventions. #include "args.str" #include "pmc/pmc_key.h" #include "pmc/pmc_fixedintegerarray.h" +#include "pmc/pmc_callcontext.h" /* HEADERIZER HFILE: include/parrot/call.h */ @@ -63,12 +64,6 @@ static void assign_default_param_value(PARROT_INTERP, __attribute__nonnull__(4) __attribute__nonnull__(5); -PARROT_CAN_RETURN_NULL -PARROT_WARN_UNUSED_RESULT -static PMC* clone_key_arg(PARROT_INTERP, ARGIN(PMC *key)) - __attribute__nonnull__(1) - __attribute__nonnull__(2); - static void dissect_aggregate_arg(PARROT_INTERP, ARGMOD(PMC *call_object), ARGIN(PMC *aggregate)) @@ -248,9 +243,6 @@ static STRING** string_param_from_op(PARROT_INTERP, PARROT_ASSERT_ARG(interp) \ , PARROT_ASSERT_ARG(arg_info) \ , PARROT_ASSERT_ARG(accessor)) -#define ASSERT_ARGS_clone_key_arg __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ - PARROT_ASSERT_ARG(interp) \ - , PARROT_ASSERT_ARG(key)) #define ASSERT_ARGS_dissect_aggregate_arg __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ PARROT_ASSERT_ARG(interp) \ , PARROT_ASSERT_ARG(call_object) \ @@ -414,11 +406,7 @@ Parrot_pcc_build_sig_object_from_op(PARROT_INTERP, ARGIN_NULLOK(PMC *signature), dissect_aggregate_arg(interp, call_object, pmc_value); } else { - VTABLE_push_pmc(interp, call_object, PMC_IS_NULL(pmc_value) - ? PMCNULL - : clone_key_arg(interp, pmc_value)); - if (arg_flags & PARROT_ARG_INVOCANT) - Parrot_pcc_set_object(interp, call_object, pmc_value); + VTABLE_push_pmc(interp, call_object, pmc_value); } break; @@ -597,7 +585,7 @@ set_call_from_varargs(PARROT_INTERP, INTVAL i = 0; parse_signature_string(interp, sig, &arg_flags); - VTABLE_set_attr_str(interp, signature, CONST_STRING(interp, "arg_flags"), arg_flags); + SETATTR_CallContext_arg_flags(interp, signature, arg_flags); /* Process the varargs list */ for (; sig[i] != '\0'; ++i) { @@ -621,13 +609,10 @@ set_call_from_varargs(PARROT_INTERP, else { VTABLE_push_pmc(interp, signature, pmc_arg); ++i; /* skip 'i' */ - Parrot_pcc_set_object(interp, signature, pmc_arg); } } else - VTABLE_push_pmc(interp, signature, PMC_IS_NULL(pmc_arg) - ? PMCNULL - : clone_key_arg(interp, pmc_arg)); + VTABLE_push_pmc(interp, signature, pmc_arg); break; } case 'S': @@ -743,7 +728,7 @@ Parrot_pcc_build_sig_object_from_varargs(PARROT_INTERP, ARGIN_NULLOK(PMC *obj), return call_object; parse_signature_string(interp, sig, &arg_flags); - VTABLE_set_attr_str(interp, call_object, CONST_STRING(interp, "arg_flags"), arg_flags); + SETATTR_CallContext_arg_flags(interp, call_object, arg_flags); /* Process the varargs list */ for (i = 0; sig[i] != '\0'; ++i) { @@ -773,9 +758,7 @@ Parrot_pcc_build_sig_object_from_varargs(PARROT_INTERP, ARGIN_NULLOK(PMC *obj), ++i; /* skip 'f' */ } else { - VTABLE_push_pmc(interp, call_object, PMC_IS_NULL(pmc_arg) - ? PMCNULL - : clone_key_arg(interp, pmc_arg)); + VTABLE_push_pmc(interp, call_object, pmc_arg); if (type_lookahead == 'i') { if (i != 0) Parrot_ex_throw_from_c_args(interp, NULL, @@ -839,14 +822,21 @@ fill_params(PARROT_INTERP, ARGMOD_NULLOK(PMC *call_object), GETATTR_FixedIntegerArray_size(interp, raw_sig, param_count); - /* A null call object is fine if there are no arguments and no returns. */ + /* Get number of positional args */ if (PMC_IS_NULL(call_object)) { - if (param_count > 0 && err_check) + /* A null call object is fine if there are no arguments and no returns. */ + if (param_count == 0) + return; + if (err_check) { Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_INVALID_OPERATION, "too few arguments: 0 passed, %d expected", param_count); - - return; + } + positional_args = 0; + call_object = NULL; /* so we don't need to use PMC_IS_NULL below */ + } + else { + GETATTR_CallContext_num_positionals(interp, call_object, positional_args); } GETATTR_FixedIntegerArray_int_array(interp, raw_sig, raw_params); @@ -860,14 +850,13 @@ fill_params(PARROT_INTERP, ARGMOD_NULLOK(PMC *call_object), else { const INTVAL second_flag = raw_params[param_count - 1]; if (second_flag & PARROT_ARG_CALL_SIG) { - *accessor->pmc(interp, arg_info, param_count - 1) = call_object; + *accessor->pmc(interp, arg_info, param_count - 1) = call_object ? call_object : PMCNULL; if (param_count == 1) return; } } /* First iterate over positional args and positional parameters. */ - GETATTR_CallContext_num_positionals(interp, call_object, positional_args); while (param_index < param_count) { INTVAL param_flags = raw_params[param_index]; @@ -886,7 +875,7 @@ fill_params(PARROT_INTERP, ARGMOD_NULLOK(PMC *call_object), INTVAL num_positionals = positional_args - arg_index; if (num_positionals < 0) num_positionals = 0; - if (named_count > 0){ + if (named_count > 0) { if (named_used_list != NULL) Parrot_hash_destroy(interp, named_used_list); Parrot_ex_throw_from_c_args(interp, NULL, @@ -914,7 +903,7 @@ fill_params(PARROT_INTERP, ARGMOD_NULLOK(PMC *call_object), /* Fill a named parameter with a positional argument. */ if (param_flags & PARROT_ARG_NAME) { STRING *param_name; - if (!(param_flags & PARROT_ARG_STRING)){ + if (!(param_flags & PARROT_ARG_STRING)) { if (named_used_list != NULL) Parrot_hash_destroy(interp, named_used_list); Parrot_ex_throw_from_c_args(interp, NULL, @@ -939,7 +928,7 @@ fill_params(PARROT_INTERP, ARGMOD_NULLOK(PMC *call_object), Parrot_hash_put(interp, named_used_list, param_name, (void *)1); } - else if (named_count > 0){ + else if (named_count > 0) { if (named_used_list != NULL) Parrot_hash_destroy(interp, named_used_list); Parrot_ex_throw_from_c_args(interp, NULL, @@ -1016,7 +1005,7 @@ fill_params(PARROT_INTERP, ARGMOD_NULLOK(PMC *call_object), if (param_flags & PARROT_ARG_NAME) break; - if (err_check){ + if (err_check) { if (named_used_list != NULL) Parrot_hash_destroy(interp, named_used_list); Parrot_ex_throw_from_c_args(interp, NULL, @@ -1025,6 +1014,8 @@ fill_params(PARROT_INTERP, ARGMOD_NULLOK(PMC *call_object), "%d passed, %d (or more) expected", positional_args, param_index + 1); } + assign_default_param_value(interp, param_index, param_flags, + arg_info, accessor); } /* Go on to next argument and parameter. */ @@ -1049,7 +1040,7 @@ fill_params(PARROT_INTERP, ARGMOD_NULLOK(PMC *call_object), INTVAL param_flags = raw_params[param_index]; /* All remaining parameters must be named. */ - if (!(param_flags & PARROT_ARG_NAME)){ + if (!(param_flags & PARROT_ARG_NAME)) { if (named_used_list != NULL) Parrot_hash_destroy(interp, named_used_list); Parrot_ex_throw_from_c_args(interp, NULL, @@ -1061,9 +1052,10 @@ fill_params(PARROT_INTERP, ARGMOD_NULLOK(PMC *call_object), if (param_flags & PARROT_ARG_SLURPY_ARRAY) { PMC * const collect_named = Parrot_pmc_new(interp, Parrot_hll_get_ctx_HLL_type(interp, enum_class_Hash)); - Hash *h; + Hash *h = NULL; /* Early exit to avoid vtable call */ - GETATTR_CallContext_hash(interp, call_object, h); + if (call_object) + GETATTR_CallContext_hash(interp, call_object, h); if (h && h->entries) { /* Named argument iteration. */ @@ -1092,7 +1084,7 @@ fill_params(PARROT_INTERP, ARGMOD_NULLOK(PMC *call_object), } /* Store the name. */ - if (!(param_flags & PARROT_ARG_STRING)){ + if (!(param_flags & PARROT_ARG_STRING)) { if (named_used_list != NULL) Parrot_hash_destroy(interp, named_used_list); Parrot_ex_throw_from_c_args(interp, NULL, @@ -1111,7 +1103,7 @@ fill_params(PARROT_INTERP, ARGMOD_NULLOK(PMC *call_object), param_flags = raw_params[param_index]; - if (VTABLE_exists_keyed_str(interp, call_object, param_name)) { + if (call_object && VTABLE_exists_keyed_str(interp, call_object, param_name)) { /* Mark the name as used, cannot be filled again. */ if (named_used_list==NULL) /* Only created if needed. */ @@ -1178,7 +1170,7 @@ fill_params(PARROT_INTERP, ARGMOD_NULLOK(PMC *call_object), /* We don't have an argument for the parameter, and it's not * optional, so it's an error. */ else { - if (err_check){ + if (err_check) { if (named_used_list != NULL) Parrot_hash_destroy(interp, named_used_list); Parrot_ex_throw_from_c_args(interp, NULL, @@ -1195,10 +1187,11 @@ fill_params(PARROT_INTERP, ARGMOD_NULLOK(PMC *call_object), /* Double check that all named arguments were assigned to parameters. */ if (err_check) { - Hash *h; + Hash *h = NULL; /* Early exit to avoid vtable call */ - GETATTR_CallContext_hash(interp, call_object, h); - if (!h || !h->entries){ + if (call_object) + GETATTR_CallContext_hash(interp, call_object, h); + if (!h || !h->entries) { if (named_used_list != NULL) Parrot_hash_destroy(interp, named_used_list); return; @@ -1281,7 +1274,7 @@ assign_default_param_value(PARROT_INTERP, INTVAL param_index, INTVAL param_flags *accessor->numval(interp, arg_info, param_index) = 0.0; break; case PARROT_ARG_STRING: - *accessor->string(interp, arg_info, param_index) = NULL; + *accessor->string(interp, arg_info, param_index) = STRINGNULL; break; case PARROT_ARG_PMC: *accessor->pmc(interp, arg_info, param_index) = PMCNULL; @@ -1852,42 +1845,6 @@ pmc_constant_from_varargs(SHIM_INTERP, ARGIN(SHIM(void *data)), SHIM(INTVAL inde /* -=item C - -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 -PARROT_WARN_UNUSED_RESULT -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; !PMC_IS_NULL(t); t=Parrot_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; -} - -/* - =back =head1 SEE ALSO diff --git a/src/call/context.c b/src/call/context.c index 1e7d820353..fb40f1ed51 100644 --- a/src/call/context.c +++ b/src/call/context.c @@ -17,6 +17,7 @@ Parrot_Context functions. #include "parrot/call.h" #include "pmc/pmc_sub.h" #include "pmc/pmc_callcontext.h" +#include "pmc/pmc_continuation.h" /* @@ -85,7 +86,8 @@ static void clear_regs(PARROT_INTERP, ARGMOD(Parrot_Context *ctx)) __attribute__nonnull__(2) FUNC_MODIFIES(*ctx); -static void init_context(ARGMOD(PMC *pmcctx), ARGIN_NULLOK(PMC *pmcold)) +PARROT_CANNOT_RETURN_NULL +static PMC* init_context(ARGMOD(PMC *pmcctx), ARGIN_NULLOK(PMC *pmcold)) __attribute__nonnull__(1) FUNC_MODIFIES(*pmcctx); @@ -210,55 +212,19 @@ create_initial_context(PARROT_INTERP) UNUSED(ignored); } -/* - -=item C - -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) - UINTVAL i; - const UINTVAL s_regs = ctx->n_regs_used[REGNO_STR]; - const UINTVAL p_regs = ctx->n_regs_used[REGNO_PMC]; - - /* NULL out registers - P/S have to be NULL for GC */ - for (i = 0; i < s_regs; ++i) - ctx->bp_ps.regs_s[i] = STRINGNULL; - - for (i = 0; i < p_regs; ++i) - ctx->bp_ps.regs_p[-1L - i] = PMCNULL; - - 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 +=item C -Initializes a freshly allocated or recycled context. +Initializes a freshly allocated or recycled context and returns the new one. =cut */ -static void +PARROT_CANNOT_RETURN_NULL +static PMC* init_context(ARGMOD(PMC *pmcctx), ARGIN_NULLOK(PMC *pmcold)) { ASSERT_ARGS(init_context) @@ -273,12 +239,11 @@ init_context(ARGMOD(PMC *pmcctx), ARGIN_NULLOK(PMC *pmcold)) * check ctx->current_sub. If it's not null return from here */ if (!PMC_IS_NULL(ctx->current_sub)) - return; + return pmcctx; ctx->lex_pad = PMCNULL; ctx->outer_ctx = NULL; ctx->current_cont = NULL; - ctx->current_object = NULL; ctx->handlers = PMCNULL; ctx->caller_ctx = NULL; ctx->current_sig = PMCNULL; @@ -310,6 +275,8 @@ init_context(ARGMOD(PMC *pmcctx), ARGIN_NULLOK(PMC *pmcold)) ctx->recursion_depth = old->recursion_depth; ctx->caller_ctx = pmcold; } + + return pmcctx; } @@ -436,16 +403,18 @@ allocate_registers(PARROT_INTERP, ARGIN(PMC *pmcctx), ARGIN(const UINTVAL *numbe 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]; + if (!reg_alloc) { + ctx->registers = NULL; + return; + } + /* don't allocate any storage if there are no registers */ + ctx->registers = (Parrot_Context *)Parrot_gc_allocate_fixed_size_storage(interp, reg_alloc); + /* ctx.bp points to I0, which has Nx on the left */ ctx->bp.regs_i = (INTVAL *)((char *)ctx->registers + size_n); @@ -456,6 +425,44 @@ allocate_registers(PARROT_INTERP, ARGIN(PMC *pmcctx), ARGIN(const UINTVAL *numbe } +/* + +=item C + +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) + UINTVAL i; + const UINTVAL s_regs = ctx->n_regs_used[REGNO_STR]; + const UINTVAL p_regs = ctx->n_regs_used[REGNO_PMC]; + + /* NULL out registers - P/S have to be NULL for GC */ + for (i = 0; i < s_regs; ++i) + ctx->bp_ps.regs_s[i] = STRINGNULL; + + for (i = 0; i < p_regs; ++i) + ctx->bp_ps.regs_p[-1L - i] = PMCNULL; + + 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 - -Set number of used registers of particular type. - -=cut - -*/ -PARROT_EXPORT -void -Parrot_pcc_set_regs_used(SHIM_INTERP, ARGIN(PMC *ctx), int type, INTVAL num) -{ - ASSERT_ARGS(Parrot_pcc_set_regs_used) - CONTEXT_STRUCT(ctx)->n_regs_used[type] = num; -} - -/* - =item C Get pointer to FLOANFAL and INTVAL registers. @@ -840,6 +823,41 @@ Parrot_pcc_set_context_func(PARROT_INTERP, ARGIN(PMC *ctx)) /* +=item C + +Try to reuse old Continuation for subsequent calls from same CallContext. + +=cut + +*/ + +PARROT_EXPORT +void +Parrot_pcc_reuse_continuation(PARROT_INTERP, ARGIN(PMC *call_context), ARGIN_NULLOK(opcode_t *next)) +{ + ASSERT_ARGS(Parrot_pcc_reuse_continuation) + Parrot_CallContext_attributes * const c = CONTEXT_STRUCT(call_context); + INTVAL reuse = 0; + + if (!PMC_IS_NULL(c->continuation)) { + PMC * const cont = c->continuation; + INTVAL invoked; + GETATTR_Continuation_invoked(interp, cont, invoked); + /* Reuse if invoked. And not tailcalled? */ + reuse = invoked && !(PObj_get_FLAGS(cont) |= SUB_FLAG_TAILCALL); + } + + if (!reuse) { + c->continuation = Parrot_pmc_new(interp, enum_class_Continuation); + } + + VTABLE_set_pointer(interp, c->continuation, next); + interp->current_cont = c->continuation; +} + +/* + =item C Helper function to set breakpoint to. diff --git a/src/call/context_accessors.c b/src/call/context_accessors.c index 1b9c21214c..765c90d2d4 100644 --- a/src/call/context_accessors.c +++ b/src/call/context_accessors.c @@ -133,6 +133,27 @@ Parrot_pcc_get_recursion_depth_func(SHIM_INTERP, ARGIN(const PMC *ctx)) /* +=item C + +Set recursion depth of the current context to new_depth. + +=cut + +*/ + +PARROT_EXPORT +UINTVAL +Parrot_pcc_set_recursion_depth_func(SHIM_INTERP, ARGIN(const PMC *ctx), + const int new_depth) +{ + ASSERT_ARGS(Parrot_pcc_set_recursion_depth_func) + PARROT_ASSERT(ctx->vtable->base_type == enum_class_CallContext); + return CONTEXT_STRUCT(ctx)->recursion_depth = new_depth; +} + +/* + =item C Increase recursion depth. Returns previous recursion_depth value. @@ -147,7 +168,7 @@ Parrot_pcc_inc_recursion_depth_func(SHIM_INTERP, ARGIN(PMC *ctx)) { ASSERT_ARGS(Parrot_pcc_inc_recursion_depth_func) PARROT_ASSERT(ctx->vtable->base_type == enum_class_CallContext); - return CONTEXT_STRUCT(ctx)->recursion_depth++; + return ++CONTEXT_STRUCT(ctx)->recursion_depth; } /* @@ -166,7 +187,7 @@ Parrot_pcc_dec_recursion_depth_func(SHIM_INTERP, ARGIN(PMC *ctx)) { ASSERT_ARGS(Parrot_pcc_dec_recursion_depth_func) PARROT_ASSERT(ctx->vtable->base_type == enum_class_CallContext); - return CONTEXT_STRUCT(ctx)->recursion_depth--; + return --CONTEXT_STRUCT(ctx)->recursion_depth; } /* @@ -440,38 +461,6 @@ Parrot_pcc_set_signature_func(PARROT_INTERP, ARGIN(PMC *ctx), ARGIN_NULLOK(PMC * CONTEXT_STRUCT(ctx)->current_sig = sig_object; } -/* - -=item C - -=item C - -Get object of Context (in method call). - -=cut - -*/ - -PARROT_EXPORT -PARROT_PURE_FUNCTION -PARROT_CAN_RETURN_NULL -PMC* -Parrot_pcc_get_object_func(SHIM_INTERP, ARGIN(const PMC *ctx)) -{ - ASSERT_ARGS(Parrot_pcc_get_object_func) - PARROT_ASSERT(ctx->vtable->base_type == enum_class_CallContext); - return CONTEXT_STRUCT(ctx)->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_ASSERT(ctx->vtable->base_type == enum_class_CallContext); - PARROT_GC_WRITE_BARRIER(interp, ctx); - CONTEXT_STRUCT(ctx)->current_object = object; -} /* diff --git a/src/call/ops.c b/src/call/ops.c index 11f2536411..c7b9d6ad8f 100644 --- a/src/call/ops.c +++ b/src/call/ops.c @@ -1,5 +1,5 @@ /* -Copyright (C) 2001-2010, Parrot Foundation. +Copyright (C) 2001-2012, Parrot Foundation. =head1 NAME @@ -91,7 +91,7 @@ runops(PARROT_INTERP, size_t offs) reenter: interp->current_runloop->handler_start = NULL; switch (setjmp(interp->current_runloop->resume)) { - case 1: + case PARROT_JMP_EXCEPTION_HANDLED: /* an exception was handled */ if (STACKED_EXCEPTIONS) free_runloop_jump_point(interp); @@ -104,7 +104,7 @@ runops(PARROT_INTERP, size_t offs) interp->current_runloop_id, interp->current_runloop_level); #endif return; - case 2: + case PARROT_JMP_EXCEPTION_FROM_C: /* Reenter the runloop from a exception thrown from C * with a pir handler */ free_runloops_until(interp, our_runloop_id); @@ -112,7 +112,7 @@ runops(PARROT_INTERP, size_t offs) offset = interp->current_runloop->handler_start - interp->code->base.data; /* Prevent incorrect reuse */ goto reenter; - case 3: + case PARROT_JMP_EXCEPTION_FINALIZED: /* Reenter the runloop when finished the handling of a * exception */ free_runloops_until(interp, our_runloop_id); @@ -136,6 +136,25 @@ runops(PARROT_INTERP, size_t offs) #endif } +/* + +=item C + +Reset runloop_id_counter to 0. +For use in outer_runloop + +=cut + +*/ + +void +reset_runloop_id_counter(PARROT_INTERP) +{ + ASSERT_ARGS(reset_runloop_id_counter) + UNUSED(interp); + runloop_id_counter = 0; +} + /* diff --git a/src/call/pcc.c b/src/call/pcc.c index 401b833617..22689f68d4 100644 --- a/src/call/pcc.c +++ b/src/call/pcc.c @@ -269,6 +269,7 @@ do_run_ops(PARROT_INTERP, ARGIN(PMC *sub_obj)) case enum_class_Sub: case enum_class_MultiSub: case enum_class_Eval: + case enum_class_Continuation: return 1; case enum_class_Object: break; @@ -316,14 +317,14 @@ Parrot_pcc_invoke_from_sig_object(PARROT_INTERP, ARGIN(PMC *sub_obj), ASSERT_ARGS(Parrot_pcc_invoke_from_sig_object) opcode_t *dest; - const 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 = pmc_new(interp, enum_class_Continuation); + PMC * const ret_cont = Parrot_pmc_new(interp, enum_class_Continuation); + if (PMC_IS_NULL(call_object)) + call_object = Parrot_pmc_new(interp, enum_class_CallContext); - Parrot_pcc_set_signature(interp, ctx, call_object); - Parrot_pcc_set_continuation(interp, ctx, ret_cont); - interp->current_cont = NEED_CONTINUATION; - PARROT_CONTINUATION(ret_cont)->from_ctx = ctx; + Parrot_pcc_set_signature(interp, CURRENT_CONTEXT(interp), call_object); + PARROT_CONTINUATION(ret_cont)->from_ctx = call_object; + Parrot_pcc_set_continuation(interp, call_object, ret_cont); + interp->current_cont = ret_cont; /* Invoke the function */ dest = VTABLE_invoke(interp, sub_obj, NULL); @@ -337,9 +338,6 @@ Parrot_pcc_invoke_from_sig_object(PARROT_INTERP, ARGIN(PMC *sub_obj), runops(interp, offset); Interp_core_SET(interp, old_core); } - Parrot_pop_context(interp); - Parrot_pcc_set_signature(interp, CURRENT_CONTEXT(interp), - Parrot_pcc_get_signature(interp, ctx)); } /* diff --git a/src/debug.c b/src/debug.c index 7402c0ff58..e16b680f01 100644 --- a/src/debug.c +++ b/src/debug.c @@ -21,8 +21,6 @@ the Parrot debugger, and the C ops. #include #include #include "parrot/parrot.h" -#include "parrot/extend.h" -#include "parrot/embed.h" #include "parrot/oplib.h" #include "parrot/debugger.h" #include "parrot/oplib/ops.h" @@ -32,6 +30,7 @@ the Parrot debugger, and the C ops. #include "debug.str" #include "pmc/pmc_continuation.h" #include "pmc/pmc_callcontext.h" +#include "pmc/pmc_sub.h" #include "parrot/oplib/core_ops.h" /* Hand switched debugger tracing @@ -229,12 +228,9 @@ static int nomoreargs(ARGIN(PDB_t *pdb), ARGIN(const char *cmd)) PARROT_WARN_UNUSED_RESULT PARROT_CANNOT_RETURN_NULL static STRING * PDB_get_continuation_backtrace(PARROT_INTERP, - ARGMOD_NULLOK(PMC * sub), - ARGMOD(PMC * ctx)) + ARGIN(PMC *ctx)) __attribute__nonnull__(1) - __attribute__nonnull__(3) - FUNC_MODIFIES(* sub) - FUNC_MODIFIES(* ctx); + __attribute__nonnull__(2); PARROT_WARN_UNUSED_RESULT PARROT_CANNOT_RETURN_NULL @@ -1110,7 +1106,7 @@ Parrot_debugger_init(PARROT_INTERP) if (! interp->pdb) { PDB_t *pdb = mem_gc_allocate_zeroed_typed(interp, PDB_t); - Parrot_Interp debugger = Parrot_new(interp); + Parrot_Interp debugger = Parrot_interp_new(interp); interp->pdb = pdb; debugger->pdb = pdb; pdb->debugee = interp; @@ -1756,7 +1752,7 @@ PDB_cond(PARROT_INTERP, ARGIN(const char *command)) condition->type |= PDB_cond_const; } else if (condition->type & PDB_cond_pmc) { - /* TT #1259: Need to figure out what to do in this case. + /* GH #671: 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_gc_free(interp, condition); @@ -2508,7 +2504,7 @@ PDB_escape(PARROT_INTERP, ARGIN(const char *string), UINTVAL length) default: /* Hide non-ascii chars that may come from utf8 or latin-1 * strings in constant strings. - * Workaround for TT #1557 + * Workaround for GH #326 */ if ((unsigned char)*string > 127) *(fill++) = '?'; @@ -3377,7 +3373,7 @@ PDB_list(PARROT_INTERP, ARGIN(const char *command)) } start_line = get_ulong(&command, 1); - pdb->file->list_line = (unsigned long) start_line; + pdb->file->list_line = start_line; line_count = get_ulong(&command, 20); @@ -3492,29 +3488,29 @@ PDB_info(PARROT_INTERP) Parrot_Interp itp = interp->pdb ? interp->pdb->debugee : interp; Parrot_io_eprintf(itdeb, "Total memory allocated: %ld\n", - interpinfo(itp, TOTAL_MEM_ALLOC)); + Parrot_interp_info(itp, TOTAL_MEM_ALLOC)); Parrot_io_eprintf(itdeb, "GC mark runs: %ld\n", - interpinfo(itp, GC_MARK_RUNS)); + Parrot_interp_info(itp, GC_MARK_RUNS)); Parrot_io_eprintf(itdeb, "Lazy gc mark runs: %ld\n", - interpinfo(itp, GC_LAZY_MARK_RUNS)); + Parrot_interp_info(itp, GC_LAZY_MARK_RUNS)); Parrot_io_eprintf(itdeb, "GC collect runs: %ld\n", - interpinfo(itp, GC_COLLECT_RUNS)); + Parrot_interp_info(itp, GC_COLLECT_RUNS)); Parrot_io_eprintf(itdeb, "Collect memory: %ld\n", - interpinfo(itp, TOTAL_COPIED)); + Parrot_interp_info(itp, TOTAL_COPIED)); Parrot_io_eprintf(itdeb, "Active PMCs: %ld\n", - interpinfo(itp, ACTIVE_PMCS)); + Parrot_interp_info(itp, ACTIVE_PMCS)); Parrot_io_eprintf(itdeb, "Timely GC PMCs: %ld\n", - interpinfo(itp, IMPATIENT_PMCS)); + Parrot_interp_info(itp, IMPATIENT_PMCS)); Parrot_io_eprintf(itdeb, "Total PMCs: %ld\n", - interpinfo(itp, TOTAL_PMCS)); + Parrot_interp_info(itp, TOTAL_PMCS)); Parrot_io_eprintf(itdeb, "Active buffers: %ld\n", - interpinfo(itp, ACTIVE_BUFFERS)); + Parrot_interp_info(itp, ACTIVE_BUFFERS)); Parrot_io_eprintf(itdeb, "Total buffers: %ld\n", - interpinfo(itp, TOTAL_BUFFERS)); + Parrot_interp_info(itp, TOTAL_BUFFERS)); Parrot_io_eprintf(itdeb, "Header allocations since last collect: %ld\n", - interpinfo(itp, HEADER_ALLOCS_SINCE_COLLECT)); + Parrot_interp_info(itp, HEADER_ALLOCS_SINCE_COLLECT)); Parrot_io_eprintf(itdeb, "Memory allocations since last collect: %ld\n", - interpinfo(itp, MEM_ALLOCS_SINCE_COLLECT)); + Parrot_interp_info(itp, MEM_ALLOCS_SINCE_COLLECT)); } /* @@ -3583,9 +3579,7 @@ Parrot_dbg_get_exception_backtrace(PARROT_INTERP, ARGMOD(PMC * exception)) if (PMC_IS_NULL(ctx)) return STRINGNULL; else { - const Parrot_CallContext_attributes * const cattrs = PARROT_CALLCONTEXT(ctx); - PMC * const sub = cattrs->current_sub; - STRING * const bt = PDB_get_continuation_backtrace(interp, sub, ctx); + STRING * const bt = PDB_get_continuation_backtrace(interp, ctx); return bt; } } @@ -3636,19 +3630,15 @@ PDB_backtrace(PARROT_INTERP) { ASSERT_ARGS(PDB_backtrace) /* information about the current sub */ - PMC * const sub = interpinfo_p(interp, CURRENT_SUB); - PMC * const ctx = CURRENT_CONTEXT(interp); - STRING * const bt = PDB_get_continuation_backtrace(interp, sub, ctx); + STRING * const bt = PDB_get_continuation_backtrace(interp, CURRENT_CONTEXT(interp)); Parrot_io_eprintf(interp, "%Ss", bt); } /* -=item C +=item C -Returns an string with the backtrace of interpreter's call chain for the given sub including -context information. +Returns an string with the backtrace of interpreter's call chain for the given context information. =cut @@ -3657,77 +3647,29 @@ context information. PARROT_WARN_UNUSED_RESULT PARROT_CANNOT_RETURN_NULL static STRING * -PDB_get_continuation_backtrace(PARROT_INTERP, ARGMOD_NULLOK(PMC * sub), ARGMOD(PMC * ctx)) +PDB_get_continuation_backtrace(PARROT_INTERP, ARGIN(PMC *ctx)) { ASSERT_ARGS(PDB_get_continuation_backtrace) - STRING *str; - PMC *old = PMCNULL; - PMC *output = Parrot_pmc_new(interp, enum_class_StringBuilder); - int rec_level = 0; - int limit_count = 0; - - if (!PMC_IS_NULL(sub)) { - str = Parrot_sub_Context_infostr(interp, ctx); - if (str) { - VTABLE_push_string(interp, output, str); - if (interp->code->annotations) { - PMC *annot = PackFile_Annotations_lookup(interp, interp->code->annotations, - 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")); - PMC *pline = VTABLE_get_pmc_keyed_str(interp, annot, - Parrot_str_new_constant(interp, "line")); - if ((!PMC_IS_NULL(pfile)) && (!PMC_IS_NULL(pline))) { - STRING * const file = VTABLE_get_string(interp, pfile); - INTVAL line = VTABLE_get_integer(interp, pline); - STRING * const fmt = - Parrot_sprintf_c(interp, " (%Ss:%li)", file, (long)line); - VTABLE_push_string(interp, output, fmt); - } - } - } - VTABLE_push_string(interp, output, CONST_STRING(interp, "\n")); - } - } + PMC * const output = Parrot_pmc_new(interp, enum_class_StringBuilder); + UINTVAL rec_level = 0; + UINTVAL loop_count = 0; + PMC *prev_ctx = PMCNULL; + int is_top = 1; /* backtrace: follow the continuation chain */ - while (1) { - Parrot_Continuation_attributes *sub_cont; - - /* Limit the levels dumped, no segfault on infinite recursion */ - if (++limit_count > RECURSION_LIMIT) + while (ctx && (loop_count < RECURSION_LIMIT)) { + STRING * const info_str = Parrot_sub_Context_infostr(interp, ctx, is_top); + if (!info_str) break; - sub = Parrot_pcc_get_continuation(interp, ctx); - - if (PMC_IS_NULL(sub)) - break; - - - sub_cont = PARROT_CONTINUATION(sub); - - if (!sub_cont) - break; - - - str = Parrot_sub_Context_infostr(interp, Parrot_pcc_get_caller_ctx(interp, ctx)); - - - if (!str) - break; - - /* recursion detection */ - if (ctx == sub_cont->to_ctx) { + if (ctx == prev_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 (!PMC_IS_NULL(prev_ctx) + && Parrot_pcc_get_pc(interp, ctx) == Parrot_pcc_get_pc(interp, prev_ctx) + && Parrot_pcc_get_sub(interp, ctx) == Parrot_pcc_get_sub(interp, prev_ctx)) { + ++rec_level; } else if (rec_level != 0) { STRING * const fmt = @@ -3738,21 +3680,22 @@ PDB_get_continuation_backtrace(PARROT_INTERP, ARGMOD_NULLOK(PMC * sub), ARGMOD(P /* print the context description */ if (rec_level == 0) { - PackFile_ByteCode *seg = sub_cont->seg; - VTABLE_push_string(interp, output, str); + const PMC * const sub = Parrot_pcc_get_sub(interp, ctx); + const PackFile_ByteCode * const seg = PARROT_SUB(sub)->seg; + VTABLE_push_string(interp, output, info_str); if (seg->annotations) { - PMC *annot = PackFile_Annotations_lookup(interp, seg->annotations, - Parrot_pcc_get_pc(interp, sub_cont->to_ctx) - seg->base.data, + PMC * const annot = PackFile_Annotations_lookup(interp, seg->annotations, + Parrot_pcc_get_pc(interp, ctx) - seg->base.data, NULL); if (!PMC_IS_NULL(annot)) { - PMC *pfile = VTABLE_get_pmc_keyed_str(interp, annot, + PMC * const pfile = VTABLE_get_pmc_keyed_str(interp, annot, Parrot_str_new_constant(interp, "file")); - PMC *pline = VTABLE_get_pmc_keyed_str(interp, annot, + PMC * const pline = VTABLE_get_pmc_keyed_str(interp, annot, Parrot_str_new_constant(interp, "line")); if ((!PMC_IS_NULL(pfile)) && (!PMC_IS_NULL(pline))) { - STRING *file = VTABLE_get_string(interp, pfile); - INTVAL line = VTABLE_get_integer(interp, pline); + STRING * const file = VTABLE_get_string(interp, pfile); + const INTVAL line = VTABLE_get_integer(interp, pline); STRING * const fmt = Parrot_sprintf_c(interp, " (%Ss:%li)", file, (long)line); VTABLE_push_string(interp, output, fmt); @@ -3761,13 +3704,10 @@ PDB_get_continuation_backtrace(PARROT_INTERP, ARGMOD_NULLOK(PMC * sub), ARGMOD(P } VTABLE_push_string(interp, output, CONST_STRING(interp, "\n")); } - - /* get the next Continuation */ - ctx = Parrot_pcc_get_caller_ctx(interp, ctx); - old = sub; - - if (!ctx) - break; + ++loop_count; + is_top = 0; + prev_ctx = ctx; + ctx = Parrot_pcc_get_caller_ctx(interp, ctx); } if (rec_level != 0) { @@ -3821,7 +3761,7 @@ GDB_print_reg(PARROT_INTERP, int t, int n) that we have string registers when we actually don't */ string = (char *) SREG(n); - if (string == '\0') + if (string == NULL) return Parrot_str_new(interp, "", 0); else return SREG(n); diff --git a/src/disassemble.c b/src/disassemble.c new file mode 100644 index 0000000000..64fad67049 --- /dev/null +++ b/src/disassemble.c @@ -0,0 +1,243 @@ +/* +Copyright (C) 2001-2010, Parrot Foundation. + +=head1 NAME + +src/disassemble.c - The Parrot Disassembler + +=head1 DESCRIPTION + +This file implements some logic for the parrot disassembler, and related +routines. + +=head2 Functions + +=over 4 + +=cut + +*/ + +#include "parrot/parrot.h" +#include "parrot/disassemble.h" +#include "parrot/oplib/ops.h" +#include "pmc/pmc_sub.h" +#include "parrot/oplib/core_ops.h" + +/* HEADERIZER HFILE: include/parrot/disassemble.h */ + +/* HEADERIZER BEGIN: static */ +/* Don't modify between HEADERIZER BEGIN / HEADERIZER END. Your changes will be lost. */ + +static void print_constant_table(PARROT_INTERP, ARGIN(PMC *output)) + __attribute__nonnull__(1) + __attribute__nonnull__(2); + +#define ASSERT_ARGS_print_constant_table __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ + PARROT_ASSERT_ARG(interp) \ + , PARROT_ASSERT_ARG(output)) +/* Don't modify between HEADERIZER BEGIN / HEADERIZER END. Your changes will be lost. */ +/* HEADERIZER END: static */ + + +/* + +=item C + +Prints the contents of the constants table. + +=cut + +*/ +static void +print_constant_table(PARROT_INTERP, ARGIN(PMC *output)) +{ + ASSERT_ARGS(print_constant_table) + const PackFile_ConstTable *ct = interp->code->const_table; + INTVAL i; + + /* TODO: would be nice to print the name of the file as well */ + Parrot_io_fprintf(interp, output, "=head1 Constant-table\n\n"); + + for (i = 0; i < ct->num.const_count; i++) + Parrot_io_fprintf(interp, output, "NUM_CONST(%d): %f\n", i, ct->num.constants[i]); + + for (i = 0; i < ct->str.const_count; i++) + Parrot_io_fprintf(interp, output, "STR_CONST(%d): %S\n", i, ct->str.constants[i]); + + for (i = 0; i < ct->pmc.const_count; i++) { + PMC * const c = ct->pmc.constants[i]; + Parrot_io_fprintf(interp, output, "PMC_CONST(%d): ", i); + + switch (c->vtable->base_type) { + /* each PBC file has a ParrotInterpreter, but it can't + * stringify by itself */ + case enum_class_ParrotInterpreter: + Parrot_io_fprintf(interp, output, "'ParrotInterpreter'"); + break; + + /* FixedIntegerArrays used for signatures, handy to print */ + case enum_class_FixedIntegerArray: + { + const INTVAL n = VTABLE_elements(interp, c); + INTVAL j; + Parrot_io_fprintf(interp, output, "["); + + for (j = 0; j < n; ++j) { + const INTVAL val = VTABLE_get_integer_keyed_int(interp, c, j); + Parrot_io_fprintf(interp, output, "%d", val); + if (j < n - 1) + Parrot_io_fprintf(interp, output, ","); + } + Parrot_io_fprintf(interp, output, "]"); + break; + } + case enum_class_NameSpace: + case enum_class_String: + case enum_class_Key: + case enum_class_ResizableStringArray: + { + STRING * const s = VTABLE_get_string(interp, c); + if (s) + Parrot_io_fprintf(interp, output, "%Ss", s); + break; + } + case enum_class_Sub: + Parrot_io_fprintf(interp, output, "%S", VTABLE_get_string(interp, c)); + break; + default: + Parrot_io_fprintf(interp, output, "(PMC constant)"); + break; + } + + Parrot_io_fprintf(interp, output, "\n"); + } + + Parrot_io_fprintf(interp, output, "\n=cut\n\n"); +} + + + +/* + +=item C + +Disassembles and prints out the interpreter's bytecode. + +This is used by the Parrot disassembler. + +TODO: Move this to a dedicated file, or some place more related to disassembly. + +=cut + +*/ + +PARROT_EXPORT +void +Parrot_disassemble(PARROT_INTERP, + ARGIN_NULLOK(const char *outfile), Parrot_disassemble_options options) +{ + ASSERT_ARGS(Parrot_disassemble) + PDB_line_t *line; + PDB_t * const pdb = mem_gc_allocate_zeroed_typed(interp, PDB_t); + int num_mappings = 0; + int curr_mapping = 0; + int op_code_seq_num = 0; + int debugs; + PMC *output; + + if (outfile != NULL) { + output = Parrot_io_open_handle(interp, PMCNULL, + Parrot_str_new(interp, outfile, 0), + Parrot_str_new_constant(interp, "tw")); + } + else + output = Parrot_io_stdhandle(interp, PIO_STDOUT_FILENO, PMCNULL); + + interp->pdb = pdb; + pdb->cur_opcode = interp->code->base.data; + + PDB_disassemble(interp, NULL); + + line = pdb->file->line; + debugs = (interp->code->debugs != NULL); + + print_constant_table(interp, output); + if (options & enum_DIS_HEADER) + return; + + if (!(options & enum_DIS_BARE)) + Parrot_io_fprintf(interp, output, "# %12s-%12s", "Seq_Op_Num", "Relative-PC"); + + if (debugs) { + if (!(options & enum_DIS_BARE)) + Parrot_io_fprintf(interp, output, " %6s:\n", "SrcLn#"); + num_mappings = interp->code->debugs->num_mappings; + } + else { + Parrot_io_fprintf(interp, output, "\n"); + } + + while (line->next) { + const char *c; + + /* Parrot_io_fprintf(interp, output, "%i < %i %i == %i \n", curr_mapping, + * num_mappings, op_code_seq_num, + * interp->code->debugs->mappings[curr_mapping].offset); */ + + if (debugs && curr_mapping < num_mappings) { + if (op_code_seq_num == interp->code->debugs->mappings[curr_mapping].offset) { + const int filename_const_offset = + interp->code->debugs->mappings[curr_mapping].filename; + Parrot_io_fprintf(interp, output, "# Current Source Filename '%Ss'\n", + interp->code->const_table->str.constants[filename_const_offset]); + ++curr_mapping; + } + } + + if (!(options & enum_DIS_BARE)) + Parrot_io_fprintf(interp, output, "%012i-%012i", + op_code_seq_num, line->opcode - interp->code->base.data); + + if (debugs && !(options & enum_DIS_BARE)) + Parrot_io_fprintf(interp, output, " %06i: ", + interp->code->debugs->base.data[op_code_seq_num]); + + /* If it has a label print it */ + if (line->label) + Parrot_io_fprintf(interp, output, "L%li:\t", line->label->number); + else + Parrot_io_fprintf(interp, output, "\t"); + + c = pdb->file->source + line->source_offset; + + while (c && *c != '\n') + Parrot_io_fprintf(interp, output, "%c", *(c++)); + + Parrot_io_fprintf(interp, output, "\n"); + line = line->next; + ++op_code_seq_num; + } + if (outfile != NULL) + Parrot_io_close_handle(interp, output); + + return; +} + + +/* + +=back + + +=cut + +*/ + +/* + * Local variables: + * c-file-style: "parrot" + * End: + * vim: expandtab shiftwidth=4 cinoptions='\:2=2' : + */ diff --git a/src/dynext.c b/src/dynext.c index d843b9e681..0ae5447003 100644 --- a/src/dynext.c +++ b/src/dynext.c @@ -150,10 +150,10 @@ set_cstring_prop(PARROT_INTERP, ARGMOD(PMC *lib_pmc), ARGIN(const char *what), { ASSERT_ARGS(set_cstring_prop) STRING * const key = Parrot_str_new_constant(interp, what); - PMC * const prop = Parrot_pmc_new_constant(interp, enum_class_String); + PMC * const prop = Parrot_pmc_new(interp, enum_class_String); VTABLE_set_string_native(interp, prop, name); - VTABLE_setprop(interp, lib_pmc, key, prop); + Parrot_pmc_setprop(interp, lib_pmc, key, prop); } @@ -336,19 +336,27 @@ get_path(PARROT_INTERP, ARGIN_NULLOK(STRING *lib), Parrot_dlopen_flags flags, * [shouldn't this happen in Parrot_locate_runtime_file instead?] */ #ifdef WIN32 - if (STRING_length(lib) >= 3 && memcmp(lib->strstart, "lib", 3) == 0) { - *handle = Parrot_dlopen((char *)lib->strstart + 3, 0); + if (STRING_length(lib) >= 3 + && STRING_ord(interp, lib, 0) == 'l' + && STRING_ord(interp, lib, 1) == 'i' + && STRING_ord(interp, lib, 2) == 'b') { + path = STRING_substr(interp, lib, 3, STRING_length(lib) - 3); + + *handle = dlopen_string(interp, flags, path); if (*handle) - return STRING_substr(interp, lib, 3, lib->strlen - 3); + return path; } #endif /* And on cygwin replace a leading "lib" by "cyg". */ #ifdef __CYGWIN__ - if (STRING_length(lib) >= 3 && memcmp(lib->strstart, "lib", 3) == 0) { + if (STRING_length(lib) >= 3 + && STRING_ord(interp, lib, 0) == 'l' + && STRING_ord(interp, lib, 1) == 'i' + && STRING_ord(interp, lib, 2) == 'b') { path = Parrot_str_concat(interp, CONST_STRING(interp, "cyg"), - STRING_substr(interp, lib, 3, lib->strlen - 3)); + STRING_substr(interp, lib, 3, STRING_length(lib) - 3)); *handle = dlopen_string(interp, flags, path); @@ -404,7 +412,7 @@ Parrot_dyn_init_lib(PARROT_INTERP, /* seems to be a native/NCI lib */ if (!load_func || !lib_pmc) - lib_pmc = Parrot_pmc_new_constant(interp, enum_class_ParrotLibrary); + lib_pmc = Parrot_pmc_new(interp, enum_class_ParrotLibrary); /* Call init, if it exists */ if (init_func) @@ -563,12 +571,12 @@ Parrot_dyn_clone_lib_into(ARGMOD(Interp *d), ARGMOD(Interp *s), ARGIN(PMC *lib_p STRING * const ops = CONST_STRING(s, "Ops"); STRING * const wo_ext = clone_string_into(d, s, - VTABLE_getprop(s, lib_pmc, filename)); + Parrot_pmc_getprop(s, lib_pmc, filename)); STRING * const lib_name = clone_string_into(d, s, - VTABLE_getprop(s, lib_pmc, libname)); + Parrot_pmc_getprop(s, lib_pmc, libname)); void * const handle = VTABLE_get_pointer(s, lib_pmc); STRING * const type = - VTABLE_get_string(s, VTABLE_getprop(s, lib_pmc, type_str)); + VTABLE_get_string(s, Parrot_pmc_getprop(s, lib_pmc, type_str)); if (STRING_equal(s, type, ops)) { /* we can't clone oplibs in the normal way, since they're actually @@ -577,13 +585,12 @@ Parrot_dyn_clone_lib_into(ARGMOD(Interp *d), ARGMOD(Interp *s), ARGIN(PMC *lib_p * Anyways, if we hope to share bytecode at runtime, we need to have * them have identical opcodes anyways. */ - PMC * const new_lib_pmc = Parrot_pmc_new_constant(d, - enum_class_ParrotLibrary); + PMC * const new_lib_pmc = Parrot_pmc_new(d, enum_class_ParrotLibrary); PMC_data(new_lib_pmc) = handle; - VTABLE_setprop(d, new_lib_pmc, CONST_STRING(s, "_filename"), Parrot_pmc_box_string(d, wo_ext)); - VTABLE_setprop(d, new_lib_pmc, CONST_STRING(s, "_lib_name"), Parrot_pmc_box_string(d, lib_name)); - VTABLE_setprop(d, new_lib_pmc, CONST_STRING(s, "_type"), Parrot_pmc_box_string(d, ops)); + Parrot_pmc_setprop(d, new_lib_pmc, CONST_STRING(s, "_filename"), Parrot_pmc_box_string(d, wo_ext)); + Parrot_pmc_setprop(d, new_lib_pmc, CONST_STRING(s, "_lib_name"), Parrot_pmc_box_string(d, lib_name)); + Parrot_pmc_setprop(d, new_lib_pmc, CONST_STRING(s, "_type"), Parrot_pmc_box_string(d, ops)); /* fixup d->all_op_libs, if necessary */ if (d->n_libs != s->n_libs) { diff --git a/src/dynoplibs/Rules.in b/src/dynoplibs/Rules.in index 8d9ea73677..75552d475b 100644 --- a/src/dynoplibs/Rules.in +++ b/src/dynoplibs/Rules.in @@ -10,7 +10,9 @@ DYNOP_O_DEPS = \ ######################### $(DYNEXT_DIR)/obscure_ops$(LOAD_EXT): src/dynoplibs/obscure_ops$(O) $(LIBPARROT) - $(LD) @ld_out@$@ src/dynoplibs/obscure_ops$(O) $(LINKARGS) + $(LD) @ld_out@$@ \ +#IF(cygwin and optimize): -s \ + src/dynoplibs/obscure_ops$(O) $(LINKARGS) #IF(win32): if exist $@.manifest mt.exe -nologo -manifest $@.manifest -outputresource:$@;2 #IF(cygwin or hpux): $(CHMOD) 0775 $@ @@ -25,7 +27,9 @@ src/dynoplibs/obscure_ops.c: src/dynoplibs/obscure.ops $(OPS2C) ######################### $(DYNEXT_DIR)/math_ops$(LOAD_EXT): src/dynoplibs/math_ops$(O) $(LIBPARROT) - $(LD) @ld_out@$@ src/dynoplibs/math_ops$(O) $(LINKARGS) + $(LD) @ld_out@$@ \ +#IF(cygwin and optimize): -s \ + src/dynoplibs/math_ops$(O) $(LINKARGS) #IF(win32): if exist $@.manifest mt.exe -nologo -manifest $@.manifest -outputresource:$@;2 #IF(cygwin or hpux): $(CHMOD) 0775 $@ @@ -40,7 +44,9 @@ src/dynoplibs/math_ops.h: src/dynoplibs/math_ops.c ######################### $(DYNEXT_DIR)/trans_ops$(LOAD_EXT): src/dynoplibs/trans_ops$(O) $(LIBPARROT) - $(LD) @ld_out@$@ src/dynoplibs/trans_ops$(O) $(LINKARGS) + $(LD) @ld_out@$@ \ +#IF(cygwin and optimize): -s \ + src/dynoplibs/trans_ops$(O) $(LINKARGS) #IF(win32): if exist $@.manifest mt.exe -nologo -manifest $@.manifest -outputresource:$@;2 #IF(cygwin or hpux): $(CHMOD) 0775 $@ @@ -55,7 +61,9 @@ src/dynoplibs/trans_ops.c: src/dynoplibs/trans.ops $(OPS2C) ######################### $(DYNEXT_DIR)/bit_ops$(LOAD_EXT): src/dynoplibs/bit_ops$(O) $(LIBPARROT) - $(LD) @ld_out@$@ src/dynoplibs/bit_ops$(O) $(LINKARGS) + $(LD) @ld_out@$@ \ +#IF(cygwin and optimize): -s \ + src/dynoplibs/bit_ops$(O) $(LINKARGS) #IF(win32): if exist $@.manifest mt.exe -nologo -manifest $@.manifest -outputresource:$@;2 #IF(cygwin or hpux): $(CHMOD) 0775 $@ @@ -70,7 +78,9 @@ src/dynoplibs/bit_ops.c: src/dynoplibs/bit.ops $(OPS2C) ######################### $(DYNEXT_DIR)/debug_ops$(LOAD_EXT): src/dynoplibs/debug_ops$(O) $(LIBPARROT) - $(LD) @ld_out@$@ src/dynoplibs/debug_ops$(O) $(LINKARGS) + $(LD) @ld_out@$@ \ +#IF(cygwin and optimize): -s \ + src/dynoplibs/debug_ops$(O) $(LINKARGS) #IF(win32): if exist $@.manifest mt.exe -nologo -manifest $@.manifest -outputresource:$@;2 #IF(cygwin or hpux): $(CHMOD) 0775 $@ @@ -85,7 +95,9 @@ src/dynoplibs/debug_ops.c: src/dynoplibs/debug.ops $(OPS2C) ######################### $(DYNEXT_DIR)/sys_ops$(LOAD_EXT): src/dynoplibs/sys_ops$(O) $(LIBPARROT) - $(LD) @ld_out@$@ src/dynoplibs/sys_ops$(O) $(LINKARGS) + $(LD) @ld_out@$@ \ +#IF(cygwin and optimize): -s \ + src/dynoplibs/sys_ops$(O) $(LINKARGS) #IF(win32): if exist $@.manifest mt.exe -nologo -manifest $@.manifest -outputresource:$@;2 #IF(cygwin or hpux): $(CHMOD) 0775 $@ @@ -100,7 +112,9 @@ src/dynoplibs/sys_ops.c: src/dynoplibs/sys.ops $(OPS2C) ######################### $(DYNEXT_DIR)/io_ops$(LOAD_EXT): src/dynoplibs/io_ops$(O) $(LIBPARROT) - $(LD) @ld_out@$@ src/dynoplibs/io_ops$(O) $(LINKARGS) + $(LD) @ld_out@$@ \ +#IF(cygwin and optimize): -s \ + src/dynoplibs/io_ops$(O) $(LINKARGS) #IF(win32): if exist $@.manifest mt.exe -nologo -manifest $@.manifest -outputresource:$@;2 #IF(cygwin or hpux): $(CHMOD) 0775 $@ diff --git a/src/dynoplibs/bit.ops b/src/dynoplibs/bit.ops index 09186fdb6c..d555b023e4 100644 --- a/src/dynoplibs/bit.ops +++ b/src/dynoplibs/bit.ops @@ -402,7 +402,7 @@ inline op lsr(invar PMC, invar PMC, invar PMC) :base_core { =item B(out INT, in INT, in INT, inconst INT) Rotate $2 left or right by $3 and place result in $1. -$4 is the the size of the word to rotate, max 32 on a 32-bit CPU and 64 +$4 is the size of the word to rotate, max 32 on a 32-bit CPU and 64 on a 64-bit CPU. If the rotate count is negative a rotate right by abs($3) is performed. diff --git a/src/dynoplibs/math.ops b/src/dynoplibs/math.ops index 14f39a4ebb..df24da21bf 100644 --- a/src/dynoplibs/math.ops +++ b/src/dynoplibs/math.ops @@ -208,7 +208,7 @@ inline op rand(out INT) { =item B(out NUM, in NUM) -Set $1 to a random floating point number between 0 and and $2, inclusive. +Set $1 to a random floating point number between 0 and $2, inclusive. =cut @@ -218,7 +218,7 @@ inline op rand(out NUM, in NUM) { =item B(out INT, in INT) -Set $1 to a integer between 0 and and $2, inclusive. +Set $1 to a integer between 0 and $2, inclusive. =cut @@ -228,7 +228,7 @@ inline op rand(out INT, in INT) { =item B(out NUM, in NUM, in NUM) -Set $1 to a random floating point number between $2 and and $3, inclusive. +Set $1 to a random floating point number between $2 and $3, inclusive. =cut @@ -258,7 +258,7 @@ inline op srand(in INT) { =item B(out INT, in INT, in INT) -Set $1 to a integer between $2 and and $3, inclusive. +Set $1 to a integer between $2 and $3, inclusive. =cut diff --git a/src/dynpmc/Defines.in b/src/dynpmc/Defines.in index 0bce80ead1..19086e6d20 100644 --- a/src/dynpmc/Defines.in +++ b/src/dynpmc/Defines.in @@ -1,87 +1,81 @@ # Copyright (C) 2010, Parrot Foundation. -DYNPMC_TARGETS = \ +# The Select dynpmc is extravagantly broken on win32. Help wanted. +DYNPMC_TARGETS = \ #IF(has_zlib): $(DYNEXT_DIR)/gziphandle$(LOAD_EXT) \ - $(DYNEXT_DIR)/dynlexpad$(LOAD_EXT) \ - $(DYNEXT_DIR)/file$(LOAD_EXT) \ - $(DYNEXT_DIR)/foo_group$(LOAD_EXT) \ - $(DYNEXT_DIR)/os$(LOAD_EXT) \ - $(DYNEXT_DIR)/pccmethod_test$(LOAD_EXT) \ - $(DYNEXT_DIR)/rotest$(LOAD_EXT) \ - $(DYNEXT_DIR)/rational$(LOAD_EXT) \ +#UNLESS(win32 or msys): $(DYNEXT_DIR)/select$(LOAD_EXT) \ + $(DYNEXT_DIR)/dynlexpad$(LOAD_EXT) \ + $(DYNEXT_DIR)/file$(LOAD_EXT) \ + $(DYNEXT_DIR)/foo_group$(LOAD_EXT) \ + $(DYNEXT_DIR)/os$(LOAD_EXT) \ + $(DYNEXT_DIR)/pccmethod_test$(LOAD_EXT) \ + $(DYNEXT_DIR)/rotest$(LOAD_EXT) \ + $(DYNEXT_DIR)/rational$(LOAD_EXT) \ $(DYNEXT_DIR)/subproxy$(LOAD_EXT) -DYNPMC_FOO = \ - src/dynpmc/foo.pmc \ +DYNPMC_FOO = \ + src/dynpmc/foo.pmc \ src/dynpmc/foo2.pmc -DYNPMC_FOO_OBJS = \ - src/dynpmc/foo$(O) \ +DYNPMC_FOO_OBJS = \ + src/dynpmc/foo$(O) \ src/dynpmc/foo2$(O) -DYNPMC_H_FILES_MIN = \ - include/parrot/atomic.h \ - include/parrot/atomic/fallback.h \ - include/parrot/atomic/gcc_pcc.h \ - include/parrot/atomic/gcc_x86.h \ - include/parrot/atomic/sparc.h \ - include/parrot/caches.h \ - include/parrot/call.h \ - include/parrot/cclass.h \ - include/parrot/compiler.h \ - include/parrot/config.h \ - include/parrot/context.h \ - include/parrot/core_pmcs.h \ - include/parrot/core_types.h \ - include/parrot/datatypes.h \ - include/parrot/debugger.h \ - include/parrot/dynext.h \ - include/parrot/encoding.h \ - include/parrot/enums.h \ - include/parrot/exceptions.h \ - include/parrot/exit.h \ - include/parrot/extend.h \ - include/parrot/extend_vtable.h \ - include/parrot/feature.h \ - include/parrot/gc_api.h \ - include/parrot/global_setup.h \ - include/parrot/has_header.h \ - include/parrot/hash.h \ - include/parrot/hll.h \ - include/parrot/interpreter.h \ - include/parrot/io.h \ - include/parrot/key.h \ - include/parrot/library.h \ - include/parrot/memory.h \ - include/parrot/misc.h \ - include/parrot/multidispatch.h \ - include/parrot/namespace.h \ - include/parrot/nci.h \ - include/parrot/oo.h \ - include/parrot/op.h \ - include/parrot/oplib.h \ - include/parrot/packfile.h \ - include/parrot/parrot.h \ - include/parrot/pbcversion.h \ +DYNPMC_H_FILES_MIN = \ + include/parrot/caches.h \ + include/parrot/call.h \ + include/parrot/cclass.h \ + include/parrot/compiler.h \ + include/parrot/config.h \ + include/parrot/context.h \ + include/parrot/core_pmcs.h \ + include/parrot/core_types.h \ + include/parrot/datatypes.h \ + include/parrot/debugger.h \ + include/parrot/dynext.h \ + include/parrot/encoding.h \ + include/parrot/enums.h \ + include/parrot/exceptions.h \ + include/parrot/exit.h \ + include/parrot/extend.h \ + include/parrot/extend_vtable.h \ + include/parrot/feature.h \ + include/parrot/gc_api.h \ + include/parrot/global_setup.h \ + include/parrot/has_header.h \ + include/parrot/hash.h \ + include/parrot/hll.h \ + include/parrot/interpreter.h \ + include/parrot/io.h \ + include/parrot/key.h \ + include/parrot/library.h \ + include/parrot/memory.h \ + include/parrot/misc.h \ + include/parrot/multidispatch.h \ + include/parrot/namespace.h \ + include/parrot/nci.h \ + include/parrot/oo.h \ + include/parrot/op.h \ + include/parrot/oplib.h \ + include/parrot/packfile.h \ + include/parrot/parrot.h \ + include/parrot/pbcversion.h \ include/parrot/platform_interface.h \ - include/parrot/pmc.h \ - include/parrot/pmc_freeze.h \ - include/parrot/pobj.h \ - include/parrot/scheduler.h \ - include/parrot/settings.h \ - include/parrot/string.h \ - include/parrot/string_funcs.h \ - include/parrot/sub.h \ - include/parrot/thread.h \ - include/parrot/thr_pthread.h \ - include/parrot/thr_windows.h \ - include/parrot/vtable.h \ - include/parrot/vtables.h \ - include/parrot/warnings.h \ + include/parrot/pmc.h \ + include/parrot/pmc_freeze.h \ + include/parrot/pobj.h \ + include/parrot/scheduler.h \ + include/parrot/settings.h \ + include/parrot/string.h \ + include/parrot/string_funcs.h \ + include/parrot/sub.h \ + include/parrot/vtable.h \ + include/parrot/vtables.h \ + include/parrot/warnings.h \ include/pmc/pmc_callcontext.h -DYNPMC_H_FILES = \ - $(DYNPMC_H_FILES_MIN) \ +DYNPMC_H_FILES = \ + $(DYNPMC_H_FILES_MIN) \ include/pmc/pmc_continuation.h \ include/pmc/pmc_default.h @@ -89,18 +83,18 @@ DYNPMC_H_FILES = \ #ELSIF(win32):LIB_ZLIB = zlib.lib #ELSE:LIB_ZLIB = -lz -DYNPMC_CLEANUPS = \ - $(DYNPMC_TARGETS) \ - $(DYNPMC_FOO_OBJS) \ - src/dynpmc/*.dump \ - src/dynpmc/pmc_*.h \ - src/dynpmc/*_group.h \ - src/dynpmc/*.c \ -#IF(o): src/dynpmc/*$(O) \ -#IF(win32): src/dynpmc/*.lib" \ -#IF(win32): src/dynpmc/*.pdb" \ -#IF(win32): src/dynpmc/*.ilk" \ -#IF(win32): src/dynpmc/*.exp" \ -#IF(win32): src/dynpmc/*.def" \ -#IF(win32): src/dynpmc/*.manifest" \ +DYNPMC_CLEANUPS = \ + $(DYNPMC_TARGETS) \ + $(DYNPMC_FOO_OBJS) \ + src/dynpmc/*.dump \ + src/dynpmc/pmc_*.h \ + src/dynpmc/*_group.h \ + src/dynpmc/*.c \ +#IF(o): src/dynpmc/*$(O) \ +#IF(win32): src/dynpmc/*.lib" \ +#IF(win32): src/dynpmc/*.pdb" \ +#IF(win32): src/dynpmc/*.ilk" \ +#IF(win32): src/dynpmc/*.exp" \ +#IF(win32): src/dynpmc/*.def" \ +#IF(win32): src/dynpmc/*.manifest" \ #IF(load_ext): src/dynpmc/*@load_ext@ diff --git a/src/dynpmc/README.pod b/src/dynpmc/README.pod index 1c04887e58..15d9b628b8 100644 --- a/src/dynpmc/README.pod +++ b/src/dynpmc/README.pod @@ -57,9 +57,10 @@ and then in your .pir or .pasm file: =item 2 -Edit C<../../config/gen/makefiles/dynpmc.in> and append your PMC(s) to -the build target. The dynpmc.in file is processed by Configure.pl to -create the real makefiles. So, invoke the configure script, then make: +Edit C and C, appending your PMC(s) +to the build target. These files are processed by Configure.pl to create the +real makefile fragments. +Next invoke the configure script, then make: $ perl Configure.pl $ make diff --git a/src/dynpmc/Rules.in b/src/dynpmc/Rules.in index d82545fb59..275f08e48c 100644 --- a/src/dynpmc/Rules.in +++ b/src/dynpmc/Rules.in @@ -1,7 +1,9 @@ # Copyright (C) 2010, Parrot Foundation. $(DYNEXT_DIR)/dynlexpad$(LOAD_EXT): src/dynpmc/dynlexpad$(O) - $(LD) @ld_out@$(DYNEXT_DIR)/dynlexpad$(LOAD_EXT) src/dynpmc/dynlexpad$(O) $(LINKARGS) + $(LD) @ld_out@$(DYNEXT_DIR)/dynlexpad$(LOAD_EXT) \ +#IF(cygwin and optimize): -s \ + src/dynpmc/dynlexpad$(O) $(LINKARGS) #IF(win32): if exist $@.manifest mt.exe -nologo -manifest $@.manifest -outputresource:$@;2 #IF(cygwin or hpux): $(CHMOD) 0775 $@ @@ -21,7 +23,9 @@ src/dynpmc/dynlexpad.dump: src/dynpmc/dynlexpad.pmc vtable.dump $(CLASS_O_FILES) $(DYNEXT_DIR)/file$(LOAD_EXT): src/dynpmc/file$(O) - $(LD) @ld_out@$(DYNEXT_DIR)/file$(LOAD_EXT) src/dynpmc/file$(O) $(LINKARGS) + $(LD) @ld_out@$(DYNEXT_DIR)/file$(LOAD_EXT) \ +#IF(cygwin and optimize): -s \ + src/dynpmc/file$(O) $(LINKARGS) #IF(win32): if exist $@.manifest mt.exe -nologo -manifest $@.manifest -outputresource:$@;2 #IF(cygwin or hpux): $(CHMOD) 0775 $@ @@ -42,7 +46,9 @@ src/dynpmc/file.dump: src/dynpmc/file.pmc vtable.dump $(CLASS_O_FILES) $(DYNEXT_DIR)/foo_group$(LOAD_EXT): $(DYNPMC_FOO_OBJS) src/dynpmc/foo_group$(O) - $(LD) @ld_out@$(DYNEXT_DIR)/foo_group$(LOAD_EXT) src/dynpmc/foo_group$(O) $(DYNPMC_FOO_OBJS) $(LINKARGS) + $(LD) @ld_out@$(DYNEXT_DIR)/foo_group$(LOAD_EXT) \ +#IF(cygwin and optimize): -s \ + src/dynpmc/foo_group$(O) $(DYNPMC_FOO_OBJS) $(LINKARGS) #IF(win32): if exist $@.manifest mt.exe -nologo -manifest $@.manifest -outputresource:$@;2 #IF(cygwin or hpux): $(CHMOD) 0775 $@ @@ -91,7 +97,9 @@ src/dynpmc/foo2.dump: src/dynpmc/foo2.pmc src/dynpmc/foo.dump vtable.dump $(CLAS $(DYNEXT_DIR)/gziphandle$(LOAD_EXT): src/dynpmc/gziphandle$(O) - $(LD) @ld_out@$(DYNEXT_DIR)/gziphandle$(LOAD_EXT) src/dynpmc/gziphandle$(O) $(LINKARGS) $(LIB_ZLIB) + $(LD) @ld_out@$(DYNEXT_DIR)/gziphandle$(LOAD_EXT) \ +#IF(cygwin and optimize): -s \ + src/dynpmc/gziphandle$(O) $(LINKARGS) $(LIB_ZLIB) #IF(win32): if exist $@.manifest mt.exe -nologo -manifest $@.manifest -outputresource:$@;2 #IF(cygwin or hpux): $(CHMOD) 0775 $@ @@ -113,7 +121,9 @@ src/dynpmc/gziphandle.dump: src/dynpmc/gziphandle.pmc vtable.dump $(CLASS_O_FILE $(DYNEXT_DIR)/os$(LOAD_EXT): src/dynpmc/os$(O) - $(LD) @ld_out@$(DYNEXT_DIR)/os$(LOAD_EXT) src/dynpmc/os$(O) $(LINKARGS) + $(LD) @ld_out@$(DYNEXT_DIR)/os$(LOAD_EXT) \ +#IF(cygwin and optimize): -s \ + src/dynpmc/os$(O) $(LINKARGS) #IF(win32): if exist $@.manifest mt.exe -nologo -manifest $@.manifest -outputresource:$@;2 #IF(cygwin or hpux): $(CHMOD) 0775 $@ @@ -134,7 +144,9 @@ src/dynpmc/os.dump: src/dynpmc/os.pmc vtable.dump $(CLASS_O_FILES) $(DYNEXT_DIR)/pccmethod_test$(LOAD_EXT): src/dynpmc/pccmethod_test$(O) - $(LD) @ld_out@$(DYNEXT_DIR)/pccmethod_test$(LOAD_EXT) src/dynpmc/pccmethod_test$(O) $(LINKARGS) + $(LD) @ld_out@$(DYNEXT_DIR)/pccmethod_test$(LOAD_EXT) \ +#IF(cygwin and optimize): -s \ + src/dynpmc/pccmethod_test$(O) $(LINKARGS) #IF(win32): if exist $@.manifest mt.exe -nologo -manifest $@.manifest -outputresource:$@;2 src/dynpmc/pmc_pccmethod_test.h : src/dynpmc/pccmethod_test.c @@ -154,7 +166,9 @@ src/dynpmc/pccmethod_test.dump: src/dynpmc/pccmethod_test.pmc vtable.dump $(CLAS $(DYNEXT_DIR)/rotest$(LOAD_EXT): src/dynpmc/rotest$(O) - $(LD) @ld_out@$(DYNEXT_DIR)/rotest$(LOAD_EXT) src/dynpmc/rotest$(O) $(LINKARGS) + $(LD) @ld_out@$(DYNEXT_DIR)/rotest$(LOAD_EXT) \ +#IF(cygwin and optimize): -s \ + src/dynpmc/rotest$(O) $(LINKARGS) #IF(win32): if exist $@.manifest mt.exe -nologo -manifest $@.manifest -outputresource:$@;2 #IF(cygwin or hpux): $(CHMOD) 0775 $@ @@ -177,7 +191,9 @@ src/dynpmc/rotest.dump: src/dynpmc/rotest.pmc vtable.dump $(CLASS_O_FILES) $(DYNEXT_DIR)/rational$(LOAD_EXT): src/dynpmc/rational$(O) - $(LD) @ld_out@$(DYNEXT_DIR)/rational$(LOAD_EXT) src/dynpmc/rational$(O) $(LINKARGS) + $(LD) @ld_out@$(DYNEXT_DIR)/rational$(LOAD_EXT) \ +#IF(cygwin and optimize): -s \ + src/dynpmc/rational$(O) $(LINKARGS) #IF(win32): if exist $@.manifest mt.exe -nologo -manifest $@.manifest -outputresource:$@;2 #IF(cygwin or hpux): $(CHMOD) 0775 $@ @@ -198,7 +214,9 @@ src/dynpmc/rational.dump: src/dynpmc/rational.pmc vtable.dump $(CLASS_O_FILES) $(DYNEXT_DIR)/subproxy$(LOAD_EXT): src/dynpmc/subproxy$(O) - $(LD) @ld_out@$(DYNEXT_DIR)/subproxy$(LOAD_EXT) src/dynpmc/subproxy$(O) $(LINKARGS) + $(LD) @ld_out@$(DYNEXT_DIR)/subproxy$(LOAD_EXT) \ +#IF(cygwin and optimize): -s \ + src/dynpmc/subproxy$(O) $(LINKARGS) #IF(win32): if exist $@.manifest mt.exe -nologo -manifest $@.manifest -outputresource:$@;2 #IF(cygwin or hpux): $(CHMOD) 0775 $@ @@ -215,3 +233,25 @@ src/dynpmc/subproxy.c: src/dynpmc/subproxy.dump src/dynpmc/subproxy.dump: src/dynpmc/subproxy.pmc vtable.dump $(CLASS_O_FILES) $(PMC2CD) src/dynpmc/subproxy.pmc + + +$(DYNEXT_DIR)/select$(LOAD_EXT): src/dynpmc/select$(O) + $(LD) @ld_out@$(DYNEXT_DIR)/select$(LOAD_EXT) \ +#IF(cygwin and optimize): -s \ + src/dynpmc/select$(O) $(LINKARGS) +#IF(win32): if exist $@.manifest mt.exe -nologo -manifest $@.manifest -outputresource:$@;2 +#IF(cygwin or hpux): $(CHMOD) 0775 $@ + +src/dynpmc/pmc_select.h : src/dynpmc/select.c + +src/dynpmc/select$(O): \ + src/dynpmc/select.c \ + $(DYNPMC_H_FILES) \ + src/dynpmc/pmc_select.h \ + include/pmc/pmc_sub.h + +src/dynpmc/select.c: src/dynpmc/select.dump + $(PMC2CC) src/dynpmc/select.pmc + +src/dynpmc/select.dump: src/dynpmc/select.pmc vtable.dump $(CLASS_O_FILES) + $(PMC2CD) src/dynpmc/select.pmc diff --git a/src/dynpmc/dynlexpad.pmc b/src/dynpmc/dynlexpad.pmc index 1fe9815fb7..cf8b1d78aa 100644 --- a/src/dynpmc/dynlexpad.pmc +++ b/src/dynpmc/dynlexpad.pmc @@ -23,6 +23,7 @@ pmclass DynLexPad dynpmc provides lexpad auto_attrs { ATTR PMC *init; /* the PMC used to initialize this DynLexPad */ VTABLE void init() { + UNUSED(SELF); Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_INVALID_OPERATION, "don't create me like this"); } @@ -82,6 +83,7 @@ Return the raw Hash pointer, for use in iterators */ VTABLE void *get_pointer() { + UNUSED(INTERP); return PARROT_DYNLEXPAD(SELF)->hash; } diff --git a/src/dynpmc/gziphandle.pmc b/src/dynpmc/gziphandle.pmc index 1e2b98eb9e..c1090e8111 100644 --- a/src/dynpmc/gziphandle.pmc +++ b/src/dynpmc/gziphandle.pmc @@ -204,7 +204,7 @@ Read the given number of bytes from the gziphandle and return them in a string. int result; gzFile file; STRING *str = STRINGNULL; - char * const buf = mem_allocate_n_zeroed_typed(length, char); + char * const buf = mem_internal_allocate_n_zeroed_typed(length, char); GET_ATTR_file(INTERP, SELF, file); result = gzread(file, buf, length); if (result > 0) { @@ -251,7 +251,7 @@ Returns a string with the zlib version. srcLen = Parrot_str_byte_length(INTERP, str); dstLen = 12 + srcLen + srcLen / 1000; - buf = mem_allocate_n_zeroed_typed(dstLen, char); + buf = mem_internal_allocate_n_zeroed_typed(dstLen, char); if (!buf) { Parrot_str_free_cstring(src); @@ -303,7 +303,7 @@ Returns a string with the zlib version. srcLen = Parrot_str_byte_length(INTERP, str); dstLen = 2 * srcLen; REDO: - buf = mem_allocate_n_zeroed_typed(dstLen, char); + buf = mem_internal_allocate_n_zeroed_typed(dstLen, char); if (!buf) { Parrot_str_free_cstring(src); diff --git a/src/dynpmc/os.pmc b/src/dynpmc/os.pmc index 0ee651ef61..fb0c0c5500 100644 --- a/src/dynpmc/os.pmc +++ b/src/dynpmc/os.pmc @@ -10,6 +10,23 @@ src/pmc/os.pmc - Files and Directories PMC C is a PMC type which provides access to the filesystem files and directories. +=head2 Usage + +From PIR code: + + loadlib "os" + $P0 = new 'OS' + +From NQP: + + pir::loadlib__s("os"); + my $os := pir::new__ps("OS"); + +From Winxed: + + loadlib("os"); + var os = new 'OS'; + =head2 Methods =over 4 @@ -104,6 +121,35 @@ Changes the current working directory to the one specified by C. /* +=item C + +Removes file C from the file system. + +=cut + +*/ + + METHOD unlink(STRING *file) { + Parrot_file_unlink(INTERP, file); + } + +/* + +=item C + +Removes directory C from the file system, if it is empty. + +=cut + +*/ + + METHOD rmdir(STRING *path) { + Parrot_file_rmdir(INTERP, path); + } + +/* +/* + =item C Calls C to remove the file or empty directory specified by diff --git a/src/dynpmc/rational.pmc b/src/dynpmc/rational.pmc index fccf3cc6e2..4204e7303f 100644 --- a/src/dynpmc/rational.pmc +++ b/src/dynpmc/rational.pmc @@ -1,5 +1,5 @@ /* -Copyright (C) 2008-2011, Parrot Foundation. +Copyright (C) 2008-2012, Parrot Foundation. =pod @@ -52,9 +52,12 @@ Returns a string representation of a Rational-PMC to a certain base. =cut */ + +PARROT_WARN_UNUSED_RESULT +PARROT_CANNOT_RETURN_NULL static STRING *rat_get_string_to_base(PARROT_INTERP, PMC *self, int base) { #ifdef PARROT_HAS_GMP - char * const cstr = mpq_get_str(NULL, (int) base, RT(self)); + char * const cstr = mpq_get_str(NULL, base, RT(self)); STRING * const pstr = Parrot_str_new(interp, cstr, 0); Parrot_str_free_cstring(cstr); return pstr; @@ -75,8 +78,9 @@ Adds an integer "value" to a Rational-PMC inplace. static void rat_add_integer(PARROT_INTERP, PMC *self, int value) { #ifdef PARROT_HAS_GMP mpq_t t; + mpq_init(t); - mpq_set_si(t, (int) value, 1); + mpq_set_si(t, value, 1); mpq_add(RT(self), RT(self), t); mpq_clear(t); #else @@ -99,7 +103,7 @@ static void rat_add_float(PARROT_INTERP, PMC *self, double value) { mpq_t t; mpq_init(t); - mpq_set_d(t, (double) value); + mpq_set_d(t, value); mpq_add(RT(self), RT(self), t); mpq_clear(t); #else @@ -285,6 +289,7 @@ Returns the version of GNU Multiple Precision library. Returns 0.0.0, if GMP is */ VTABLE void set_integer_native(INTVAL value) { #ifdef PARROT_HAS_GMP + UNUSED(INTERP) mpq_set_si(RT(SELF), (signed int) value, 1); mpq_canonicalize(RT(SELF)); #else @@ -301,6 +306,7 @@ Returns the version of GNU Multiple Precision library. Returns 0.0.0, if GMP is */ VTABLE void set_number_native(FLOATVAL value) { #ifdef PARROT_HAS_GMP + UNUSED(INTERP) mpq_set_d(RT(SELF), (double) value); mpq_canonicalize(RT(SELF)); #else @@ -382,6 +388,7 @@ Returns the version of GNU Multiple Precision library. Returns 0.0.0, if GMP is VTABLE FLOATVAL get_number() { #ifdef PARROT_HAS_GMP const double d = mpq_get_d(RT(SELF)); + UNUSED(INTERP) return (FLOATVAL) d; #else RAISE_EXCEPTION @@ -397,6 +404,7 @@ Returns the version of GNU Multiple Precision library. Returns 0.0.0, if GMP is */ VTABLE INTVAL get_bool() { #ifdef PARROT_HAS_GMP + UNUSED(INTERP) if (mpq_cmp_si(RT(SELF), 0, 1) == 0) return 0; else @@ -444,6 +452,7 @@ Returns the version of GNU Multiple Precision library. Returns 0.0.0, if GMP is */ VTABLE void increment() { #ifdef PARROT_HAS_GMP + UNUSED(INTERP) mpz_add(mpq_numref(RT(SELF)), mpq_numref(RT(SELF)), mpq_denref(RT(SELF))); mpq_canonicalize(RT(SELF)); #else @@ -460,6 +469,7 @@ Returns the version of GNU Multiple Precision library. Returns 0.0.0, if GMP is */ VTABLE void decrement() { #ifdef PARROT_HAS_GMP + UNUSED(INTERP) mpz_sub(mpq_numref(RT(SELF)), mpq_numref(RT(SELF)), mpq_denref(RT(SELF))); mpq_canonicalize(RT(SELF)); #else @@ -521,6 +531,7 @@ Adds Integer-, Float- or Rational-PMCs to SELF and stores them in dest. MULTI void i_add(Rational value) { #ifdef PARROT_HAS_GMP + UNUSED(INTERP) mpq_add(RT(SELF), RT(SELF), RT(value)); #else RAISE_EXCEPTION @@ -851,6 +862,7 @@ Adds Integer-, Float- or Rational-PMCs to SELF and stores them in dest. MULTI void i_divide(Rational value) { #ifdef PARROT_HAS_GMP + UNUSED(INTERP) mpq_div(RT(SELF), RT(SELF), RT(value)); #else RAISE_EXCEPTION @@ -937,6 +949,7 @@ Adds Integer-, Float- or Rational-PMCs to SELF and stores them in dest. */ VTABLE void i_neg() { #ifdef PARROT_HAS_GMP + UNUSED(INTERP) mpq_neg(RT(SELF), RT(SELF)); #else RAISE_EXCEPTION @@ -970,6 +983,7 @@ Adds Integer-, Float- or Rational-PMCs to SELF and stores them in dest. */ VTABLE void i_absolute() { #ifdef PARROT_HAS_GMP + UNUSED(INTERP) mpq_abs(RT(SELF), RT(SELF)); #else RAISE_EXCEPTION @@ -1002,6 +1016,7 @@ Adds Integer-, Float- or Rational-PMCs to SELF and stores them in dest. MULTI INTVAL cmp(Rational value) { #ifdef PARROT_HAS_GMP + UNUSED(INTERP) return (INTVAL) mpq_cmp(RT(SELF), RT(value)); #else RAISE_EXCEPTION @@ -1022,7 +1037,7 @@ Adds Integer-, Float- or Rational-PMCs to SELF and stores them in dest. */ MULTI INTVAL is_equal(Integer value) { #ifdef PARROT_HAS_GMP - INTVAL eq = 0; + INTVAL eq; mpq_t t; mpq_init(t); mpq_set_ui(t, VTABLE_get_integer(INTERP, value), 1); @@ -1045,6 +1060,7 @@ Adds Integer-, Float- or Rational-PMCs to SELF and stores them in dest. MULTI INTVAL is_equal(Rational value) { #ifdef PARROT_HAS_GMP + UNUSED(INTERP) return (INTVAL) mpq_equal(RT(SELF), RT(value)); #else RAISE_EXCEPTION diff --git a/src/dynpmc/select.pmc b/src/dynpmc/select.pmc new file mode 100644 index 0000000000..f9c1f9667b --- /dev/null +++ b/src/dynpmc/select.pmc @@ -0,0 +1,394 @@ +/* +Copyright (C) 2011, Parrot Foundation. + +=head1 NAME + +src/pmc/select.pmc - IO Select PMC + +=head1 DESCRIPTION + +This is the base-class for non-blocking IO using select + +=head2 Functions + +=over 4 + +=cut + +*/ + +#include "parrot/parrot.h" +#include "../src/io/io_private.h" +#include "pmc/pmc_filehandle.h" +#include +#include +#include +#include + +#define SELECT_READ 1 +#define SELECT_WRITE 2 +#define SELECT_ERROR 4 + +/* HEADERIZER HFILE: none */ +/* HEADERIZER BEGIN: static */ +/* HEADERIZER END: static */ + +/* + +=item C + +Returns the maximum of all the c89 standard integer file descriptors held by +the Hash PMC + +=back + +=head2 Vtable Functions + +=over 4 + +=cut + +*/ + static INTVAL find_max_fd(PARROT_INTERP, ARGIN(PMC *fd_map)) { + PMC * const iter = VTABLE_get_iter(interp, fd_map); + const INTVAL n = VTABLE_elements(interp, fd_map); + INTVAL maxid = -1; + INTVAL j; + + for (j = 0; j < n; ++j) { + const INTVAL id = VTABLE_shift_integer(interp, iter); + if (maxid < id) + maxid = id; + } + return maxid; + } + + +pmclass Select auto_attrs dynpmc { + + ATTR PMC *fd_map; /* map a fd to its PMC */ + ATTR fd_set rb_array; /* read bit array */ + ATTR fd_set wb_array; /* write bit array */ + ATTR fd_set eb_array; /* error bit array */ + ATTR INTVAL max_fd; + +/* + +=item C + +Initializes the PMC. + +=cut + +*/ + + VTABLE void init() { + PMC * const fd_map = Parrot_pmc_new(interp, enum_class_Hash); + VTABLE_set_integer_native(INTERP, fd_map, Hash_key_type_int); + SET_ATTR_fd_map(INTERP, SELF, fd_map); + SET_ATTR_max_fd(INTERP, SELF, -1); + + FD_ZERO(&(PARROT_SELECT(SELF)->rb_array)); + FD_ZERO(&(PARROT_SELECT(SELF)->wb_array)); + FD_ZERO(&(PARROT_SELECT(SELF)->eb_array)); + + PObj_custom_mark_SET(SELF); + } + +/* + +=item C + +Mark fd_map hash as live. + +=cut + +*/ + VTABLE void mark() { + PMC *fd_map; + GET_ATTR_fd_map(INTERP, SELF, fd_map); + Parrot_gc_mark_PMC_alive(interp, fd_map); + } + +/* + +=back + +=head2 Methods + +=over 4 + +=item C + +Returns the maximum of all the c89 standard integer file descriptors held by +the Select PMC + +=cut + +*/ + + METHOD max_fd() { + INTVAL v; + GET_ATTR_max_fd(INTERP, SELF, v); + RETURN(INTVAL v); + } + +/* + +=item C + +Returns the Hash PMC that holds the mapping from file descriptor to the opaque +PMC associated with the file descriptor when it was added to the Select PMC. + +Used mainly for testing purposes. + +=cut + +*/ + + METHOD fd_map() { + PMC *fd_map; + GET_ATTR_fd_map(INTERP, SELF, fd_map); + RETURN(PMC *fd_map); + } + + +/* + +=item C + +Adds filehandle PMC to the Select PMC for monitoring based on the +read_write_error_flags + +read_write_error_flag = READ (0x1) | WRITE (0x2) | ERROR (0x4) + +An array of data PMCs are returned by the can_read, can_read, has_exception, +and select methods when the filehandles meet one of read_write_error_flag +conditions. + +=cut + +*/ + METHOD update(PMC *handle, PMC* data, INTVAL rwe) { + PMC *fd_map; + INTVAL maxid, fdkey; + + GETATTR_FileHandle_os_handle(INTERP, handle, fdkey); + GET_ATTR_fd_map(INTERP, SELF, fd_map); + GET_ATTR_max_fd(INTERP, SELF, maxid); + VTABLE_set_pmc_keyed_int(interp, fd_map, fdkey, data); + if (rwe & SELECT_READ) { FD_SET(fdkey, &PARROT_SELECT(SELF)->rb_array); } + if (rwe & SELECT_WRITE) { FD_SET(fdkey, &PARROT_SELECT(SELF)->wb_array); } + if (rwe & SELECT_ERROR) { FD_SET(fdkey, &PARROT_SELECT(SELF)->eb_array); } + if (maxid < fdkey) + maxid = fdkey; + SET_ATTR_max_fd(INTERP, SELF, maxid); + } + +/* + +=item C + +Removes filehandle from the Select PMC. + +=cut + +*/ + METHOD remove(PMC *handle) { + PMC *fd_map; + INTVAL fd, maxid; + + GETATTR_FileHandle_os_handle(INTERP, handle, fd); + GET_ATTR_fd_map(INTERP, SELF, fd_map); + GET_ATTR_max_fd(INTERP, SELF, maxid); + VTABLE_delete_keyed_int(interp, fd_map, fd); + FD_CLR(fd, &PARROT_SELECT(SELF)->rb_array); + FD_CLR(fd, &PARROT_SELECT(SELF)->wb_array); + FD_CLR(fd, &PARROT_SELECT(SELF)->eb_array); + if (fd == maxid) { + maxid = find_max_fd(interp, fd_map); + SET_ATTR_max_fd(INTERP, SELF, maxid); + } + } + +/* + +=item C + +Returns the associated data for the file descriptors in the Select PMC, which +are ready to be read from. + +Waits for a maximum of timeout seconds for a file descriptor to be ready to +read before returning. + +=cut + +*/ + + METHOD can_read(FLOATVAL timeout) { + fd_set rdset; + struct timeval timeouts; + PMC *results; + PMC *fd_map; + INTVAL maxid, i; + + const INTVAL sec = timeout / 1000000; + const INTVAL usec = timeout - sec; + + GET_ATTR_fd_map(INTERP, SELF, fd_map); + GET_ATTR_max_fd(INTERP, SELF, maxid); + timeouts.tv_sec = sec; + timeouts.tv_usec = usec; + results = Parrot_pmc_new(interp, enum_class_ResizablePMCArray); + memcpy(&rdset, &PARROT_SELECT(SELF)->rb_array, sizeof (fd_set)); + + select(maxid + 1, &rdset, NULL, NULL, &timeouts); + for (i=0; i <= maxid; i++) { + if (FD_ISSET(i, &rdset)) { + VTABLE_push_pmc(interp, results, VTABLE_get_pmc_keyed_int(interp, fd_map, i)); + } + } + RETURN(PMC *results); + } + +/* + +=item C + +Returns the associated data for the file descriptors in the Select PMC, which +are ready to be written to. + +Waits for a maximum of timeout seconds for a file descriptor to be ready to +write to before returning. + +=cut + +*/ + + METHOD can_write(FLOATVAL timeout) { + fd_set wbset; + struct timeval timeouts; + PMC *results, *fd_map; + INTVAL maxid, i; + + const INTVAL sec = timeout / 1000000; + const INTVAL usec = timeout - sec; + + GET_ATTR_fd_map(INTERP, SELF, fd_map); + GET_ATTR_max_fd(INTERP, SELF, maxid); + timeouts.tv_sec = sec; + timeouts.tv_usec = usec; + results = Parrot_pmc_new(interp, enum_class_ResizablePMCArray); + memcpy(&wbset, &PARROT_SELECT(SELF)->wb_array, sizeof (fd_set)); + + select(maxid + 1, NULL, &wbset, NULL, &timeouts); + for (i=0; i<=maxid; i++) { + if (FD_ISSET(i, &wbset)) { + VTABLE_push_pmc(interp, results, VTABLE_get_pmc_keyed_int(interp, fd_map, i)); + } + } + RETURN(PMC *results); + } + +/* + +=item C + +Returns the associated data for the file descriptors in the Select PMC, which +are in an exception state. + +Waits for a maximum of timeout seconds for a file descriptor to be in an +exception state before returning. + +=cut + +*/ + + METHOD has_exception(FLOATVAL timeout) { + fd_set ebset; + struct timeval timeouts; + PMC *results, *fd_map; + INTVAL maxid, i; + + const INTVAL sec = timeout / 1000000; + const INTVAL usec = timeout - sec; + + GET_ATTR_fd_map(INTERP, SELF, fd_map); + GET_ATTR_max_fd(INTERP, SELF, maxid); + timeouts.tv_sec = sec; + timeouts.tv_usec = usec; + results = Parrot_pmc_new(interp, enum_class_ResizablePMCArray); + memcpy(&ebset, &PARROT_SELECT(SELF)->eb_array, sizeof (fd_set)); + + select(maxid + 1, NULL, NULL, &ebset, &timeouts); + for (i=0; i<=maxid; i++) { + if (FD_ISSET(i, &ebset)) { + VTABLE_push_pmc(interp, results, VTABLE_get_pmc_keyed_int(interp, fd_map, i)); + } + } + RETURN(PMC *results); + } + +/* + +=item C + +Returns the associated data for the file descriptors in the Select PMC, which +are ready to be read, written, or have an exception to be handled. + +Waits for a maximum of timeout seconds for a file descriptor to be ready to be +handled. + +=back + +=cut + +*/ + + METHOD select(FLOATVAL timeout) { + fd_set rdset, wrset, erset; + struct timeval timeouts; + + PMC *results, *rresults, *wresults, *eresults, *fd_map; + INTVAL maxid, i; + + const INTVAL sec = timeout / 1000000; + const INTVAL usec = timeout - sec; + + GET_ATTR_fd_map(INTERP, SELF, fd_map); + GET_ATTR_max_fd(INTERP, SELF, maxid); + timeouts.tv_sec = sec; + timeouts.tv_usec = usec; + results = Parrot_pmc_new(interp, enum_class_ResizablePMCArray); + rresults = Parrot_pmc_new(interp, enum_class_ResizablePMCArray); + wresults = Parrot_pmc_new(interp, enum_class_ResizablePMCArray); + eresults = Parrot_pmc_new(interp, enum_class_ResizablePMCArray); + memcpy(&rdset, &PARROT_SELECT(SELF)->rb_array, sizeof (fd_set)); + memcpy(&wrset, &PARROT_SELECT(SELF)->wb_array, sizeof (fd_set)); + memcpy(&erset, &PARROT_SELECT(SELF)->eb_array, sizeof (fd_set)); + + select(maxid + 1, &rdset, &wrset, &erset, &timeouts); + for (i=0; i<=maxid; i++) { + if (FD_ISSET(i, &rdset)) { + VTABLE_push_pmc(interp, rresults, VTABLE_get_pmc_keyed_int(interp, fd_map, i)); + } + if (FD_ISSET(i, &wrset)) { + VTABLE_push_pmc(interp, wresults, VTABLE_get_pmc_keyed_int(interp, fd_map, i)); + } + if (FD_ISSET(i, &erset)) { + VTABLE_push_pmc(interp, eresults, VTABLE_get_pmc_keyed_int(interp, fd_map, i)); + } + } + VTABLE_push_pmc(interp, results, rresults); + VTABLE_push_pmc(interp, results, wresults); + VTABLE_push_pmc(interp, results, eresults); + RETURN(PMC *results); + } +} + +/* + * Local variables: + * c-file-style: "parrot" + * End: + * vim: expandtab shiftwidth=4 cinoptions='\:2=2' : + */ diff --git a/src/dynpmc/subproxy.pmc b/src/dynpmc/subproxy.pmc index c0b8ed30e1..93bb3ce0de 100644 --- a/src/dynpmc/subproxy.pmc +++ b/src/dynpmc/subproxy.pmc @@ -1,5 +1,5 @@ /* -Copyright (C) 2003-2011, Parrot Foundation. +Copyright (C) 2003-2012, Parrot Foundation. */ /* @@ -21,6 +21,7 @@ pmclass SubProxy dynpmc extends Sub auto_attrs { } VTABLE void set_pmc(PMC *key) { + UNUSED(INTERP) PMC_data(SELF) = key; } diff --git a/src/embed.c b/src/embed.c deleted file mode 100644 index 203d7e0815..0000000000 --- a/src/embed.c +++ /dev/null @@ -1,541 +0,0 @@ -/* -Copyright (C) 2001-2010, Parrot Foundation. - -=head1 NAME - -src/embed.c - The Parrot embedding interface - -=head1 DESCRIPTION - -This file implements the old Parrot embedding interface. Its days are -numbered. You probably want src/embed/api.c - -=head2 Functions - -=over 4 - -=cut - -*/ - -#include "parrot/parrot.h" -#include "parrot/embed.h" -#include "parrot/extend.h" -#include "parrot/oplib/ops.h" -#include "pmc/pmc_sub.h" -#include "pmc/pmc_callcontext.h" -#include "parrot/runcore_api.h" -#include "parrot/oplib/core_ops.h" -#include "imcc/embed.h" - -#include "embed.str" - -/* HEADERIZER HFILE: include/parrot/embed.h */ - -/* HEADERIZER BEGIN: static */ -/* Don't modify between HEADERIZER BEGIN / HEADERIZER END. Your changes will be lost. */ - -static void print_constant_table(PARROT_INTERP, ARGIN(PMC *output)) - __attribute__nonnull__(1) - __attribute__nonnull__(2); - -static void print_debug(PARROT_INTERP, int status, ARGIN(void *p)) - __attribute__nonnull__(1) - __attribute__nonnull__(3); - -#define ASSERT_ARGS_print_constant_table __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ - PARROT_ASSERT_ARG(interp) \ - , PARROT_ASSERT_ARG(output)) -#define ASSERT_ARGS_print_debug __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ - PARROT_ASSERT_ARG(interp) \ - , PARROT_ASSERT_ARG(p_unused)) -/* Don't modify between HEADERIZER BEGIN / HEADERIZER END. Your changes will be lost. */ -/* HEADERIZER END: static */ - -/* - -=item C - -Read in a bytecode, unpack it into a C structure, and do fixups. - -DEPRECATED: Use Parrot_pf_read_pbc_file instead. - -=cut - -*/ - -PARROT_EXPORT -PARROT_CAN_RETURN_NULL -Parrot_PackFile -Parrot_pbc_read(PARROT_INTERP, ARGIN_NULLOK(const char *fullname), const int debug) -{ - ASSERT_ARGS(Parrot_pbc_read) - STRING * const str = Parrot_str_new(interp, fullname, 0); - PackFile * const pf = Parrot_pf_read_pbc_file(interp, str); - PMC * const pfpmc = Parrot_pf_get_packfile_pmc(interp, pf); - UNUSED(debug); - return (Parrot_PackFile)pfpmc; -} - -/* - -=item C - -Loads the C returned by C. - -DEPRECATED: Use Parrot_pf_set_current_packfile instead. - -=cut - -*/ - -PARROT_EXPORT -void -Parrot_pbc_load(PARROT_INTERP, ARGIN(Parrot_PackFile pf)) -{ - ASSERT_ARGS(Parrot_pbc_load) - Parrot_pf_set_current_packfile(interp, pf); -} - -/* - -=item C - -Fixups after pbc loading - -DEPRECATED: Don't use this. Use Parrot_pf_prepare_packfile_load instead. - -=cut - -*/ - -PARROT_EXPORT -void -Parrot_pbc_fixup_loaded(PARROT_INTERP) -{ - ASSERT_ARGS(Parrot_pbc_fixup_loaded) - PackFile_fixup_subs(interp, PBC_LOADED, NULL); -} - - -/* - -=item C - -Prints GC info. - -=cut - -*/ - -static void -print_debug(PARROT_INTERP, SHIM(int status), ARGIN(SHIM(void *p))) -{ - ASSERT_ARGS(print_debug) - if (Interp_debug_TEST(interp, PARROT_MEM_STAT_DEBUG_FLAG)) { - /* Give souls brave enough to activate debugging an earful about GC. */ - - Parrot_io_eprintf(interp, "*** Parrot VM: Dumping GC info ***\n"); - PDB_info(interp); - } -} - - -/* - -=item C - -Search the fixup table for a PMC matching the argument. On a match, -set up the appropriate context. - -If no match, set up a dummy PMC entry. In either case, return a -pointer to the PMC. - -DEPRECATED: use Parrot_pf_get_packfile_main_sub instead - -=cut - -*/ - -PARROT_CANNOT_RETURN_NULL -PMC* -set_current_sub(PARROT_INTERP) -{ - ASSERT_ARGS(set_current_sub) - PMC *new_sub_pmc; - - PackFile_ByteCode * const cur_cs = interp->code; - PackFile_ConstTable * const ct = cur_cs->const_table; - STRING * const SUB = CONST_STRING(interp, "Sub"); - - opcode_t i; - - /* - * Walk the fixup table. The first Sub-like entry should be our - * entry point with the address at our resume_offset. - */ - - for (i = 0; i < ct->pmc.const_count; i++) { - PMC * const sub_pmc = ct->pmc.constants[i]; - if (VTABLE_isa(interp, sub_pmc, 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) { - Parrot_pcc_set_sub(interp, CURRENT_CONTEXT(interp), sub_pmc); - Parrot_pcc_set_HLL(interp, CURRENT_CONTEXT(interp), sub->HLL_id); - return sub_pmc; - } - - break; - } - } - } - - /* If we didn't find anything, put a dummy PMC into current_sub. - The default values set by SUb.init are appropriate for the - dummy, don't need additional settings. */ - new_sub_pmc = Parrot_pmc_new(interp, enum_class_Sub); - Parrot_pcc_set_sub(interp, CURRENT_CONTEXT(interp), new_sub_pmc); - - return new_sub_pmc; -} - - -/* - -=item C - -Sets up C and runs the ops. - -DEPRECATED: Use Parrot_pf_execute_bytecode_program instead - -=cut - -*/ - -PARROT_EXPORT -void -Parrot_runcode(PARROT_INTERP, int argc, ARGIN(const char **argv)) -{ - ASSERT_ARGS(Parrot_runcode) - PMC *userargv, *main_sub; - - /* Debugging mode nonsense. */ - if (Interp_debug_TEST(interp, PARROT_START_DEBUG_FLAG)) { - if (Interp_flags_TEST(interp, PARROT_BOUNDS_FLAG)) { - Parrot_io_eprintf(interp, - "*** Parrot VM: Bounds checking enabled. ***\n"); - } - - if (Interp_trace_TEST(interp, PARROT_TRACE_OPS_FLAG)) - Parrot_io_eprintf(interp, "*** Parrot VM: Tracing enabled. ***\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 = Parrot_pmc_box_c_string_array(interp, argc, argv); - - /* - * If any profile information was gathered, print it out - * before exiting, then print debug infos if turned on. - */ - Parrot_x_on_exit(interp, print_debug, NULL); - - /* Let's kick the tires and light the fires--call interpreter.c:runops. */ - 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); - - Parrot_pcc_set_sub(interp, CURRENT_CONTEXT(interp), NULL); - Parrot_pcc_set_constants(interp, interp->ctx, interp->code->const_table); - - Parrot_ext_call(interp, main_sub, "P->", userargv); -} - - -/* - -=item C - -Runs the interpreter's bytecode in debugging mode. - -DEPRECATED: Do not use. - -=cut - -*/ - -PARROT_EXPORT -PARROT_CAN_RETURN_NULL -Parrot_Opcode * -Parrot_debug(PARROT_INTERP, ARGIN(Parrot_Interp debugger), ARGIN(Parrot_Opcode *pc)) -{ - ASSERT_ARGS(Parrot_debug) - PDB_t * const pdb = debugger->pdb; - - pdb->cur_opcode = pc; - - PDB_init(debugger, NULL); - - /* disassemble needs this for now */ - /* - interp = pdb->debugee; - interp->pdb = pdb; - */ - debugger->lo_var_ptr = interp->lo_var_ptr; - - PDB_disassemble(interp, NULL); - - while (!(pdb->state & PDB_EXIT)) { - const char *command; - - PDB_get_command(debugger); - command = pdb->cur_command; - PDB_run_command(debugger, command); - } - - return NULL; -} - - -/* - -=item C - -Prints the contents of the constants table. - -=cut - -*/ -static void -print_constant_table(PARROT_INTERP, ARGIN(PMC *output)) -{ - ASSERT_ARGS(print_constant_table) - const PackFile_ConstTable *ct = interp->code->const_table; - INTVAL i; - - /* TODO: would be nice to print the name of the file as well */ - Parrot_io_fprintf(interp, output, "=head1 Constant-table\n\n"); - - for (i = 0; i < ct->num.const_count; i++) - Parrot_io_fprintf(interp, output, "NUM_CONST(%d): %f\n", i, ct->num.constants[i]); - - for (i = 0; i < ct->str.const_count; i++) - Parrot_io_fprintf(interp, output, "STR_CONST(%d): %S\n", i, ct->str.constants[i]); - - for (i = 0; i < ct->pmc.const_count; i++) { - PMC * const c = ct->pmc.constants[i]; - Parrot_io_fprintf(interp, output, "PMC_CONST(%d): ", i); - - switch (c->vtable->base_type) { - /* each PBC file has a ParrotInterpreter, but it can't - * stringify by itself */ - case enum_class_ParrotInterpreter: - Parrot_io_fprintf(interp, output, "'ParrotInterpreter'"); - break; - - /* FixedIntegerArrays used for signatures, handy to print */ - case enum_class_FixedIntegerArray: - { - const INTVAL n = VTABLE_elements(interp, c); - INTVAL j; - Parrot_io_fprintf(interp, output, "["); - - for (j = 0; j < n; ++j) { - const INTVAL val = VTABLE_get_integer_keyed_int(interp, c, j); - Parrot_io_fprintf(interp, output, "%d", val); - if (j < n - 1) - Parrot_io_fprintf(interp, output, ","); - } - Parrot_io_fprintf(interp, output, "]"); - break; - } - case enum_class_NameSpace: - case enum_class_String: - case enum_class_Key: - case enum_class_ResizableStringArray: - { - STRING * const s = VTABLE_get_string(interp, c); - if (s) - Parrot_io_fprintf(interp, output, "%Ss", s); - break; - } - case enum_class_Sub: - Parrot_io_fprintf(interp, output, "%S", VTABLE_get_string(interp, c)); - break; - default: - Parrot_io_fprintf(interp, output, "(PMC constant)"); - break; - } - - Parrot_io_fprintf(interp, output, "\n"); - } - - Parrot_io_fprintf(interp, output, "\n=cut\n\n"); -} - - -/* - -=item C - -Disassembles and prints out the interpreter's bytecode. - -This is used by the Parrot disassembler. - -TODO: Move this to a dedicated file, or some place more related to disassembly. - -=cut - -*/ - -PARROT_EXPORT -void -Parrot_disassemble(PARROT_INTERP, - ARGIN_NULLOK(const char *outfile), Parrot_disassemble_options options) -{ - ASSERT_ARGS(Parrot_disassemble) - PDB_line_t *line; - PDB_t * const pdb = mem_gc_allocate_zeroed_typed(interp, PDB_t); - int num_mappings = 0; - int curr_mapping = 0; - int op_code_seq_num = 0; - int debugs; - PMC *output; - - if (outfile != NULL) { - output = Parrot_io_open_handle(interp, PMCNULL, - Parrot_str_new(interp, outfile, 0), - Parrot_str_new_constant(interp, "tw")); - } - else - output = Parrot_io_stdhandle(interp, PIO_STDOUT_FILENO, PMCNULL); - - interp->pdb = pdb; - pdb->cur_opcode = interp->code->base.data; - - PDB_disassemble(interp, NULL); - - line = pdb->file->line; - debugs = (interp->code->debugs != NULL); - - print_constant_table(interp, output); - if (options & enum_DIS_HEADER) - return; - - if (!(options & enum_DIS_BARE)) - Parrot_io_fprintf(interp, output, "# %12s-%12s", "Seq_Op_Num", "Relative-PC"); - - if (debugs) { - if (!(options & enum_DIS_BARE)) - Parrot_io_fprintf(interp, output, " %6s:\n", "SrcLn#"); - num_mappings = interp->code->debugs->num_mappings; - } - else { - Parrot_io_fprintf(interp, output, "\n"); - } - - while (line->next) { - const char *c; - - /* Parrot_io_fprintf(interp, output, "%i < %i %i == %i \n", curr_mapping, - * num_mappings, op_code_seq_num, - * interp->code->debugs->mappings[curr_mapping].offset); */ - - if (debugs && curr_mapping < num_mappings) { - if (op_code_seq_num == interp->code->debugs->mappings[curr_mapping].offset) { - const int filename_const_offset = - interp->code->debugs->mappings[curr_mapping].filename; - Parrot_io_fprintf(interp, output, "# Current Source Filename '%Ss'\n", - interp->code->const_table->str.constants[filename_const_offset]); - ++curr_mapping; - } - } - - if (!(options & enum_DIS_BARE)) - Parrot_io_fprintf(interp, output, "%012i-%012i", - op_code_seq_num, line->opcode - interp->code->base.data); - - if (debugs && !(options & enum_DIS_BARE)) - Parrot_io_fprintf(interp, output, " %06i: ", - interp->code->debugs->base.data[op_code_seq_num]); - - /* If it has a label print it */ - if (line->label) - Parrot_io_fprintf(interp, output, "L%li:\t", line->label->number); - else - Parrot_io_fprintf(interp, output, "\t"); - - c = pdb->file->source + line->source_offset; - - while (c && *c != '\n') - Parrot_io_fprintf(interp, output, "%c", *(c++)); - - Parrot_io_fprintf(interp, output, "\n"); - line = line->next; - ++op_code_seq_num; - } - if (outfile != NULL) - Parrot_io_close_handle(interp, output); - - return; -} - -/* - -=item C - -Legacy function for setting the configuration hash as an array of bytes for -the old API. New programs should not use this. They should use the new API and -C - -DEPRECATED: Use Parrot_set_config_hash_pmc instead. - -=cut - -*/ - -PARROT_EXPORT -void -Parrot_set_configuration_hash_legacy(PARROT_INTERP, const int length, - ARGIN(const unsigned char *bytes)) -{ - ASSERT_ARGS(Parrot_set_configuration_hash_legacy) - STRING * const fpmc_str = Parrot_str_new_init(interp, (const char *)bytes, - length, Parrot_binary_encoding_ptr, PObj_external_FLAG); - PMC * const pmc = Parrot_thaw(interp, fpmc_str); - Parrot_set_config_hash_pmc(interp, pmc); - Parrot_lib_update_paths_from_config_hash(interp); -} - -/* - -=back - -=head1 SEE ALSO - -F and F. - -=cut - -*/ - -/* - * Local variables: - * c-file-style: "parrot" - * End: - * vim: expandtab shiftwidth=4 cinoptions='\:2=2' : - */ diff --git a/src/embed/api.c b/src/embed/api.c index 873bbc5af6..8ef6276015 100644 --- a/src/embed/api.c +++ b/src/embed/api.c @@ -1,5 +1,5 @@ /* -Copyright (C) 2010-2011, Parrot Foundation. +Copyright (C) 2010-2012, Parrot Foundation. =head1 NAME @@ -19,7 +19,6 @@ This file implements functions of the Parrot embedding interface. #include "parrot/parrot.h" #include "parrot/runcore_api.h" -#include "parrot/embed.h" #include "parrot/api.h" #include "embed_private.h" @@ -29,8 +28,7 @@ This file implements functions of the Parrot embedding interface. /* =item C +*is_error, Parrot_PMC *exception, Parrot_Int *exit_code, Parrot_String *errmsg)> Gets the results of the last API function call and stores the results in C, C, C and C. This function returns @@ -53,8 +51,8 @@ C contains an string with the last error message. PARROT_API Parrot_Int Parrot_api_get_result(Parrot_PMC interp_pmc, ARGOUT(Parrot_Int *is_error), - ARGOUT(Parrot_PMC * exception), ARGOUT(Parrot_Int *exit_code), - ARGOUT(Parrot_String * errmsg)) + ARGOUT(Parrot_PMC *exception), ARGOUT(Parrot_Int *exit_code), + ARGOUT(Parrot_String *errmsg)) { ASSERT_ARGS(Parrot_api_get_result) EMBED_API_CALLIN(interp_pmc, interp) @@ -66,7 +64,7 @@ Parrot_api_get_result(Parrot_PMC interp_pmc, ARGOUT(Parrot_Int *is_error), } else { STRING * const severity_str = Parrot_str_new(interp, "severity", 0); - INTVAL severity = VTABLE_get_integer_keyed_str(interp, *exception, severity_str); + const INTVAL severity = VTABLE_get_integer_keyed_str(interp, *exception, severity_str); *is_error = (severity != EXCEPT_exit); *errmsg = VTABLE_get_string(interp, *exception); } @@ -78,7 +76,7 @@ Parrot_api_get_result(Parrot_PMC interp_pmc, ARGOUT(Parrot_Int *is_error), /* =item C +Parrot_PMC exception, Parrot_String *bt)> Gets the backtrace of the interpreter's call chain for the given exception C and stores the results in string C. This function returns a @@ -91,7 +89,7 @@ true value if this call is successful and false value otherwise. PARROT_API Parrot_Int Parrot_api_get_exception_backtrace(Parrot_PMC interp_pmc, - Parrot_PMC exception, ARGOUT(Parrot_String * bt)) + Parrot_PMC exception, ARGOUT(Parrot_String *bt)) { ASSERT_ARGS(Parrot_api_get_exception_backtrace) EMBED_API_CALLIN(interp_pmc, interp) @@ -128,7 +126,7 @@ Parrot_api_make_interpreter(Parrot_PMC parent, Parrot_Int flags, Parrot_GC_Init_Args gc_args; const Parrot_Interp parent_raw = PMC_IS_NULL(parent) ? NULL : GET_RAW_INTERP(parent); Parrot_jump_buff env; - interp_raw = allocate_interpreter(parent_raw, flags); + interp_raw = Parrot_interp_allocate_interpreter(parent_raw, flags); if (setjmp(env)) { interp_raw->api_jmp_buf = NULL; *interp = NULL; @@ -151,7 +149,7 @@ Parrot_api_make_interpreter(Parrot_PMC parent, Parrot_Int flags, memset(&gc_args, 0, sizeof (Parrot_GC_Init_Args)); gc_args.stacktop = &alt_stacktop; } - initialize_interpreter(interp_raw, &gc_args); + Parrot_interp_initialize_interpreter(interp_raw, &gc_args); *interp = VTABLE_get_pmc_keyed_int( interp_raw, interp_raw->iglobals, (Parrot_Int)IGLOBALS_INTERPRETER); } @@ -188,6 +186,12 @@ Parrot_api_set_runcore(Parrot_PMC interp_pmc, ARGIN(const char * corename), Parrot_runcore_switch(interp, Parrot_str_new_constant(interp, "slow")); else if (STREQ(corename, "fast") || STREQ(corename, "jit") || STREQ(corename, "function")) Parrot_runcore_switch(interp, Parrot_str_new_constant(interp, "fast")); + else if (STREQ(corename, "subprof_sub")) + Parrot_runcore_switch(interp, Parrot_str_new_constant(interp, "subprof_sub")); + else if (STREQ(corename, "subprof_hll") || STREQ(corename, "subprof")) + Parrot_runcore_switch(interp, Parrot_str_new_constant(interp, "subprof_hll")); + else if (STREQ(corename, "subprof_ops")) + Parrot_runcore_switch(interp, Parrot_str_new_constant(interp, "subprof_ops")); else if (STREQ(corename, "exec")) Parrot_runcore_switch(interp, Parrot_str_new_constant(interp, "exec")); else if (STREQ(corename, "trace")) @@ -260,7 +264,7 @@ Parrot_api_flag(Parrot_PMC interp_pmc, Parrot_Int flags, Parrot_Int set) /* =item C +char *name)> Sets the executable name for the C interpreter. This function returns a true value if this call is successful and false value otherwise. @@ -271,7 +275,7 @@ a true value if this call is successful and false value otherwise. PARROT_API Parrot_Int -Parrot_api_set_executable_name(Parrot_PMC interp_pmc, ARGIN(const char * name)) +Parrot_api_set_executable_name(Parrot_PMC interp_pmc, ARGIN(const char *name)) { ASSERT_ARGS(Parrot_api_set_executable_name) EMBED_API_CALLIN(interp_pmc, interp) @@ -312,7 +316,7 @@ Parrot_api_destroy_interpreter(Parrot_PMC interp_pmc) if (_oldtop == NULL) interp->lo_var_ptr = &_oldtop; interp->api_jmp_buf = &env; - Parrot_destroy(interp); + Parrot_interp_destroy(interp); Parrot_x_exit(interp, 0); /* Never reached, x_exit calls longjmp */ return 1; @@ -551,7 +555,7 @@ Parrot_api_get_compiler(Parrot_PMC interp_pmc, ARGIN(Parrot_String type), { ASSERT_ARGS(Parrot_api_get_compiler) EMBED_API_CALLIN(interp_pmc, interp) - *compiler = Parrot_get_compiler(interp, type); + *compiler = Parrot_interp_get_compiler(interp, type); EMBED_API_CALLOUT(interp_pmc, interp); } @@ -574,7 +578,7 @@ Parrot_api_set_compiler(Parrot_PMC interp_pmc, ARGIN(Parrot_String type), { ASSERT_ARGS(Parrot_api_set_compiler) EMBED_API_CALLIN(interp_pmc, interp) - Parrot_set_compiler(interp, type, compiler); + Parrot_interp_set_compiler(interp, type, compiler); EMBED_API_CALLOUT(interp_pmc, interp) } diff --git a/src/embed/bytecode.c b/src/embed/bytecode.c index ebce7b8b52..20c2466105 100644 --- a/src/embed/bytecode.c +++ b/src/embed/bytecode.c @@ -20,7 +20,6 @@ with Parrot bytecode. #include "parrot/parrot.h" #include "parrot/runcore_api.h" -#include "parrot/embed.h" #include "parrot/api.h" #include "embed_private.h" @@ -49,7 +48,7 @@ Parrot_api_load_bytecode_file(Parrot_PMC interp_pmc, ASSERT_ARGS(Parrot_api_load_bytecode_file) EMBED_API_CALLIN(interp_pmc, interp) PackFile * const pf = Parrot_pf_read_pbc_file(interp, filename); - *pbc = Parrot_pf_get_packfile_pmc(interp, pf); + *pbc = Parrot_pf_get_packfile_pmc(interp, pf, filename); EMBED_API_CALLOUT(interp_pmc, interp) } @@ -83,7 +82,7 @@ Parrot_api_load_bytecode_bytes(Parrot_PMC interp_pmc, Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_MALFORMED_PACKFILE, "Could not unpack packfile"); } - *pbcpmc = Parrot_pf_get_packfile_pmc(interp, pf); + *pbcpmc = Parrot_pf_get_packfile_pmc(interp, pf, STRINGNULL); Parrot_unblock_GC_mark(interp); EMBED_API_CALLOUT(interp_pmc, interp); } @@ -135,9 +134,9 @@ Parrot_api_ready_bytecode(Parrot_PMC interp_pmc, Parrot_PMC pbc, /* =item C +pbc, Parrot_PMC args)> -Runs the bytecode C passing optional C parameters. This function +Runs the bytecode C passing optional C parameters. This function returns a true value if this call is successful and false value otherwise. =cut @@ -147,11 +146,11 @@ returns a true value if this call is successful and false value otherwise. PARROT_API Parrot_Int Parrot_api_run_bytecode(Parrot_PMC interp_pmc, Parrot_PMC pbc, - Parrot_PMC mainargs) + Parrot_PMC args) { ASSERT_ARGS(Parrot_api_run_bytecode) EMBED_API_CALLIN(interp_pmc, interp) - Parrot_PMC args = mainargs ? mainargs : PMCNULL; + Parrot_PMC _args = args ? args : PMCNULL; /* Print out information if we are debugging */ if (Interp_debug_TEST(interp, PARROT_START_DEBUG_FLAG)) { @@ -159,7 +158,7 @@ Parrot_api_run_bytecode(Parrot_PMC interp_pmc, Parrot_PMC pbc, interp->run_core->name); } - Parrot_pf_execute_bytecode_program(interp, pbc, args); + Parrot_pf_execute_bytecode_program(interp, pbc, _args); EMBED_API_CALLOUT(interp_pmc, interp) } @@ -188,7 +187,6 @@ Parrot_api_disassemble_bytecode(Parrot_PMC interp_pmc, Parrot_PMC pbc, "Could not get packfile."); if (pf->cur_cs) Parrot_pf_set_current_packfile(interp, pbc); - /* TODO: Break up the dependency with embed.c */ Parrot_disassemble(interp, outfile, (Parrot_disassemble_options)opts); EMBED_API_CALLOUT(interp_pmc, interp); } diff --git a/src/embed/pmc.c b/src/embed/pmc.c index ba260b16bc..eecfa5c190 100644 --- a/src/embed/pmc.c +++ b/src/embed/pmc.c @@ -433,7 +433,7 @@ Parrot_api_pmc_box_string(ARGIN(Parrot_PMC interp_pmc), ARGIN(Parrot_String str) =item C -Wraps the integer C into a PMC and stores the results in C. This +Wraps the integer C into a PMC and stores the results in C. This function returns a true value if this call is successful and false value otherwise. @@ -448,12 +448,33 @@ Parrot_api_pmc_box_integer(Parrot_PMC interp_pmc, Parrot_Int value, { ASSERT_ARGS(Parrot_api_pmc_box_integer) EMBED_API_CALLIN(interp_pmc, interp) - *int_pmc = Parrot_pmc_new(interp, enum_class_Integer); - VTABLE_set_integer_native(interp, *int_pmc, value); + *int_pmc = Parrot_pmc_box_integer(interp, value); EMBED_API_CALLOUT(interp_pmc, interp) } -/* TODO: Box float */ +/* + +=item C + +Wraps the float C into a PMC and stores the results in C. This +function returns a true value if this call is successful and false value +otherwise. + +=cut + +*/ + +PARROT_API +Parrot_Int +Parrot_api_pmc_box_float(Parrot_PMC interp_pmc, Parrot_Float value, + ARGOUT(Parrot_PMC * float_pmc)) +{ + ASSERT_ARGS(Parrot_api_pmc_box_float) + EMBED_API_CALLIN(interp_pmc, interp) + *float_pmc = Parrot_pmc_box_number(interp, value); + EMBED_API_CALLOUT(interp_pmc, interp) +} /* diff --git a/src/embed/strings.c b/src/embed/strings.c index 4d5a2c4b91..972cc2a806 100644 --- a/src/embed/strings.c +++ b/src/embed/strings.c @@ -94,15 +94,11 @@ Parrot_api_string_export_wchar(ARGIN(Parrot_PMC interp_pmc), ARGIN(Parrot_String ASSERT_ARGS(Parrot_api_string_export_wchar) EMBED_API_CALLIN(interp_pmc, interp) - char *cstr; - size_t len; - wchar_t *wstrout; - if (!STRING_IS_NULL(string)) { - cstr = Parrot_str_to_cstring(interp, string); - len = strlen(cstr); + char * const cstr = Parrot_str_to_cstring(interp, string); + const size_t len = strlen(cstr); + wchar_t * const wstrout = (wchar_t *) malloc(sizeof (wchar_t) * (len + 1)); - wstrout = (wchar_t *) malloc(sizeof (wchar_t) * len + 1); mbstowcs(wstrout, cstr, len); wstrout[len] = L'\0'; @@ -205,12 +201,9 @@ Parrot_api_string_import_wchar(ARGIN(Parrot_PMC interp_pmc), ARGIN(wchar_t * str ASSERT_ARGS(Parrot_api_string_import_wchar) EMBED_API_CALLIN(interp_pmc, interp) - char *cstr; - size_t len; - - len = wcslen(str); + const size_t len = wcslen(str); + char * const cstr = (char *) malloc(sizeof (char) * (len + 1)); - cstr = (char *) malloc(sizeof (char) * len + 1); wcstombs(cstr, str, len); cstr[len] = '\0'; diff --git a/src/events.c b/src/events.c new file mode 100644 index 0000000000..daea04cde5 --- /dev/null +++ b/src/events.c @@ -0,0 +1,411 @@ +/* +Copyright (C) 2007-2010, Parrot Foundation. +$Id$ + +=head1 NAME + +src/events.c - Routines supporting the event handling mechanism. + +=head1 DESCRIPTION + +Users can register event handlers. When events occur, they are dispatched +to the appropriate handler asynchronously. + +=over 4 + +=cut + +*/ + +#include "parrot/parrot.h" +#include "parrot/runcore_api.h" +#include "parrot/events.h" + +#include "events.str" +#include "pmc/pmc_arrayiterator.h" +#include "pmc/pmc_exception.h" + + +/* HEADERIZER HFILE: include/parrot/events.h */ + +#define CX_DEBUG 0 + +/* + +=item C + +Add a handler to the current context's list of handlers. + +=cut + +*/ + +PARROT_EXPORT +void +Parrot_cx_add_handler_local(PARROT_INTERP, ARGIN(PMC *handler)) +{ + ASSERT_ARGS(Parrot_cx_add_handler_local) + if (PMC_IS_NULL(Parrot_pcc_get_handlers(interp, interp->ctx))) + Parrot_pcc_set_handlers(interp, interp->ctx, + Parrot_pmc_new(interp, enum_class_ResizablePMCArray)); + + VTABLE_unshift_pmc(interp, Parrot_pcc_get_handlers(interp, interp->ctx), handler); + +} + +/* + +=item C + +Remove the top task handler from the context's list of handlers. + +=cut + +*/ + +PARROT_EXPORT +void +Parrot_cx_delete_handler_local(PARROT_INTERP) +{ + ASSERT_ARGS(Parrot_cx_delete_handler_local) + 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, + "No handler to delete."); + + /* test elements so that we get a nice error message */ + if (!VTABLE_elements(interp, handlers)) + Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_INVALID_OPERATION, + "No handler to delete."); + + VTABLE_shift_pmc(interp, handlers); +} + + +/* + +=item C + +Remove handlers until the specified handler is reached. The handler itself +is not removed. If the handler is not found, all handlers will be removed +and an exception is thrown. + +=cut + +*/ + +PARROT_EXPORT +void +Parrot_cx_delete_upto_handler_local(PARROT_INTERP, ARGIN(PMC *handler)) +{ + ASSERT_ARGS(Parrot_cx_delete_upto_handler_local) + PMC *handlers = Parrot_pcc_get_handlers(interp, interp->ctx); + if (!PMC_IS_NULL(handlers)) { + while (VTABLE_elements(interp, handlers)) { + PMC * const cand = VTABLE_get_pmc_keyed_int(interp, handlers, 0); + if (cand == handler) + return; + VTABLE_shift_pmc(interp, handlers); + } + } + Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_INVALID_OPERATION, + "Specified handler is not in the handler list."); +} + + +/* + +=item C + +Count the number of active handlers from the context's list of handlers. + +=cut + +*/ + +PARROT_EXPORT +INTVAL +Parrot_cx_count_handlers_local(PARROT_INTERP) +{ + ASSERT_ARGS(Parrot_cx_count_handlers_local) + PMC * const handlers = Parrot_pcc_get_handlers(interp, interp->ctx); + + if (PMC_IS_NULL(handlers)) + return 0; + + return VTABLE_elements(interp, handlers); +} + + +/* + +=item C + +Add a task handler to scheduler's list of handlers. + +=cut + +*/ + +PARROT_EXPORT +void +Parrot_cx_add_handler(PARROT_INTERP, ARGIN(PMC *handler)) +{ + ASSERT_ARGS(Parrot_cx_add_handler) + STRING * const add_handler = CONST_STRING(interp, "add_handler"); + if (!interp->scheduler) + Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_INVALID_OPERATION, + "Scheduler was not initialized for this interpreter.\n"); + + Parrot_pcc_invoke_method_from_c_args(interp, interp->scheduler, add_handler, "P->", handler); +} + +/* + +=item C + +Remove the top task handler of a particular type from the scheduler's list of +handlers. + +=cut + +*/ + +PARROT_EXPORT +void +Parrot_cx_delete_handler_typed(PARROT_INTERP, ARGIN(STRING *handler_type)) +{ + ASSERT_ARGS(Parrot_cx_delete_handler_typed) + if (!interp->scheduler) + Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_INVALID_OPERATION, + "Scheduler was not initialized for this interpreter.\n"); + + Parrot_pcc_invoke_method_from_c_args(interp, interp->scheduler, CONST_STRING(interp, "delete_handler"), "S->", handler_type); +} + +/* + +=item C + +Count the number of active handlers of a particular type (event, exception) in +the concurrency scheduler. + +=cut + +*/ + +PARROT_EXPORT +INTVAL +Parrot_cx_count_handlers_typed(PARROT_INTERP, ARGIN(STRING *handler_type)) +{ + ASSERT_ARGS(Parrot_cx_count_handlers_typed) + INTVAL count = 0; + + if (!interp->scheduler) + Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_INVALID_OPERATION, + "Scheduler was not initialized for this interpreter.\n"); + + Parrot_pcc_invoke_method_from_c_args(interp, interp->scheduler, CONST_STRING(interp, "count_handlers"), "S->I", handler_type, &count); + + return count; +} + + +/* + +=back + +=head2 Task Interface Functions + +Functions that are used to interface with a specific task in the concurrency scheduler. + +=over 4 + +=item C + +Retrieve a handler appropriate to a given task. If the scheduler has no +appropriate handler, returns PMCNULL. + +=cut + +*/ + +PARROT_EXPORT +PARROT_CAN_RETURN_NULL +PMC * +Parrot_cx_find_handler_for_task(PARROT_INTERP, ARGIN(PMC *task)) +{ + ASSERT_ARGS(Parrot_cx_find_handler_for_task) + PMC *handler = PMCNULL; +#if CX_DEBUG + fprintf(stderr, "searching for handler\n"); +#endif + + if (!interp->scheduler) + Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_INVALID_OPERATION, + "Scheduler was not initialized for this interpreter.\n"); + + 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"); +#endif + + return handler; +} + +/* + +=item C + +Retrieve a handler appropriate to a given task from the local context. If the +context has no appropriate handler, returns PMCNULL. + +=cut + +*/ + + +PARROT_EXPORT +PARROT_CAN_RETURN_NULL +PMC * +Parrot_cx_find_handler_local(PARROT_INTERP, ARGIN(PMC *task)) +{ + ASSERT_ARGS(Parrot_cx_find_handler_local) + + /* + * Quick&dirty way to avoid infinite recursion + * when an exception is thrown while looking + * for a handler + */ + static int already_doing = 0; + static PMC * keep_context = NULL; + + PMC *context; + STRING * const handled_str = CONST_STRING(interp, "handled"); + STRING * const handler_str = CONST_STRING(interp, "handler"); + STRING * const handlers_left_str = CONST_STRING(interp, "handlers_left"); + STRING * const exception_str = CONST_STRING(interp, "Exception"); + const Parrot_Int is_exception = (task->vtable->base_type == enum_class_Exception) + || VTABLE_does(interp, task, exception_str); + PMC *handlers; + INTVAL pos, elements; + + if (already_doing) { + Parrot_io_eprintf(interp, + "** Exception caught while looking for a handler, trying next **\n"); + if (! keep_context) + return NULL; + /* + * Note that we are now trying to handle the new exception, + * not the initial task argument (exception or whatever). + */ + context = Parrot_pcc_get_caller_ctx(interp, keep_context); + keep_context = NULL; + if (context) { + handlers = Parrot_pcc_get_handlers(interp, context); + elements = !PMC_IS_NULL(handlers) ? VTABLE_elements(interp, handlers) : 0; + pos = 0; + } + } + else { + INTVAL handled = 0; + ++already_doing; + + /* Exceptions store the handler iterator for rethrow, other kinds of + * tasks don't (though they could). */ + if (is_exception) { + if (task->vtable->base_type == enum_class_Exception) + GETATTR_Exception_handled(interp, task, handled); + else + handled = VTABLE_get_integer_keyed_str(interp, task, handled_str); + } + if (handled == -1) { + context = (PMC *)VTABLE_get_pointer(interp, task); + handlers = Parrot_pcc_get_handlers(interp, context); + elements = !PMC_IS_NULL(handlers) ? VTABLE_elements(interp, handlers) : 0; + if (task->vtable->base_type == enum_class_Exception) + GETATTR_Exception_handlers_left(interp, task, pos); + else + pos = VTABLE_get_integer_keyed_str(interp, task, handlers_left_str); + pos = elements - pos; + if (pos < 0) + pos = 0; + if (pos > elements) + pos = elements; + } + else { + context = CURRENT_CONTEXT(interp); + handlers = Parrot_pcc_get_handlers(interp, context); + elements = !PMC_IS_NULL(handlers) ? VTABLE_elements(interp, handlers) : 0; + pos = 0; + } + } + + while (context) { + keep_context = context; + /* Loop from newest handler to oldest handler. */ + for (; pos < elements; pos++) { + PMC * const handler = VTABLE_get_pmc_keyed_int(interp, handlers, pos); + + if (!PMC_IS_NULL(handler)) { + INTVAL valid_handler = 0; + Parrot_pcc_invoke_method_from_c_args(interp, handler, CONST_STRING(interp, "can_handle"), + "P->I", task, &valid_handler); + + if (valid_handler) { + if (is_exception) { + /* Store iterator and context for a later rethrow. */ + VTABLE_set_pointer(interp, task, context); + if (task->vtable->base_type == enum_class_Exception) { + SETATTR_Exception_handlers_left(interp, task, elements - pos - 1); + SETATTR_Exception_handler(interp, task, handler); + } + else { + VTABLE_set_integer_keyed_str(interp, task, handlers_left_str, + elements - pos - 1); + VTABLE_set_attr_str(interp, task, handler_str, handler); + } + } + --already_doing; + keep_context = NULL; + return handler; + } + } + } + + /* Continue the search in the next context up the chain. */ + context = Parrot_pcc_get_caller_ctx(interp, context); + if (context) { + handlers = Parrot_pcc_get_handlers(interp, context); + elements = !PMC_IS_NULL(handlers) ? VTABLE_elements(interp, handlers) : 0; + pos = 0; + } + else + elements = pos = 0; + } + + /* Reached the end of the context chain without finding a handler. */ + + --already_doing; + return PMCNULL; +} + +/* + +=back + +=cut + +*/ + + +/* + * Local variables: + * c-file-style: "parrot" + * End: + * vim: expandtab shiftwidth=4 cinoptions='\:2=2' : + */ diff --git a/src/exceptions.c b/src/exceptions.c index 31981a8ea9..2e5dd08723 100644 --- a/src/exceptions.c +++ b/src/exceptions.c @@ -1,5 +1,5 @@ /* -Copyright (C) 2001-2010, Parrot Foundation. +Copyright (C) 2001-2012, Parrot Foundation. =head1 NAME @@ -7,7 +7,7 @@ src/exceptions.c - Exceptions =head1 DESCRIPTION -Define the the core subsystem for exceptions. +Define the core subsystem for exceptions. =head2 Exception Functions @@ -20,6 +20,9 @@ Define the the core subsystem for exceptions. #include "parrot/parrot.h" #include "exceptions.str" #include "pmc/pmc_continuation.h" +#include "pmc/pmc_exception.h" +#include "parrot/exceptions.h" +#include "parrot/events.h" /* HEADERIZER HFILE: include/parrot/exceptions.h */ @@ -146,20 +149,8 @@ die_from_exception(PARROT_INTERP, ARGIN(PMC *exception)) STRING * const newmessage = CONST_STRING(interp, "No exception handler and no message\n"); VTABLE_set_string_native(interp, exception, newmessage); } - } - /* - * returning NULL from here returns resume address NULL to the - * runloop, which will terminate the thread function finally - * - * TT #1287 this check should better be in Parrot_x_exit - */ - - /* no exception handler, but this is not the main thread */ - if (interp->thread_data && interp->thread_data->tid) - pt_thread_detach(interp->thread_data->tid); - Parrot_x_jump_out(interp, 1); } @@ -246,7 +237,7 @@ Parrot_ex_throw_from_op(PARROT_INTERP, ARGIN(PMC *exception), ARGIN_NULLOK(void /* it's a C exception handler */ Parrot_runloop * const jump_point = (Parrot_runloop *)address; jump_point->exception = exception; - longjmp(jump_point->resume, 1); + longjmp(jump_point->resume, PARROT_JMP_EXCEPTION_HANDLED); } /* return the address of the handler */ @@ -370,7 +361,7 @@ Parrot_ex_throw_from_c(PARROT_INTERP, ARGIN(PMC *exception)) Parrot_runloop * const jump_point = (Parrot_runloop *)VTABLE_get_pointer(interp, handler); jump_point->exception = exception; - longjmp(jump_point->resume, 1); + longjmp(jump_point->resume, PARROT_JMP_EXCEPTION_HANDLED); } else { /* Run the handler. */ @@ -379,7 +370,7 @@ Parrot_ex_throw_from_c(PARROT_INTERP, ARGIN(PMC *exception)) setup_exception_args(interp, "P", exception); PARROT_ASSERT(return_point->handler_start == NULL); return_point->handler_start = address; - longjmp(return_point->resume, 2); + longjmp(return_point->resume, PARROT_JMP_EXCEPTION_FROM_C); } } @@ -501,8 +492,6 @@ Parrot_ex_rethrow_from_c(PARROT_INTERP, ARGIN(PMC *exception)) Mark an exception as unhandled, as part of rethrowing it. -=back - =cut */ @@ -517,6 +506,40 @@ Parrot_ex_mark_unhandled(PARROT_INTERP, ARGIN(PMC *exception)) /* +=item C + +Get the current exception handler from expmc. +If expmc is an exception handler, return itself. +If it's an exception, return its active handler. + +=back + +=cut + +*/ + +PARROT_EXPORT +PARROT_WARN_UNUSED_RESULT +PARROT_CAN_RETURN_NULL +PMC * +Parrot_ex_get_current_handler(PARROT_INTERP, ARGIN_NULLOK(PMC *expmc)) +{ + ASSERT_ARGS(Parrot_ex_get_current_handler) + PMC *eh = PMCNULL; + if (!PMC_IS_NULL(expmc)) { + /* If isa ExceptionHandler, use it. If isa Exception, get its active handler */ + if (expmc->vtable->base_type == enum_class_Exception) + GETATTR_Exception_handler(interp, expmc, eh); + else if (VTABLE_isa(interp, expmc, CONST_STRING(interp, "ExceptionHandler"))) + eh = expmc; + else if (VTABLE_isa(interp, expmc, CONST_STRING(interp, "Exception"))) + eh = VTABLE_get_attr_str(interp, expmc, CONST_STRING(interp, "handler")); + } + return eh; +} + +/* + =head2 Error Functions =over 4 @@ -585,7 +608,7 @@ Parrot_print_backtrace(void) # ifndef PARROT_HAS_DLINFO # define BACKTRACE_VERBOSE # endif - Interp *emergency_interp = Parrot_get_emergency_interp(); + Interp *emergency_interp = Parrot_interp_get_emergency_interpreter(); /* stolen from http://www.delorie.com/gnu/docs/glibc/libc_665.html */ void *array[BACKTRACE_DEPTH]; int i; @@ -626,7 +649,7 @@ Parrot_print_backtrace(void) # endif fprintf(stderr, "Attempting to get PIR backtrace. No guarantees. Here goes...\n"); if (emergency_interp) { - Parrot_clear_emergency_interp(); + Parrot_interp_clear_emergency_interpreter(); PDB_backtrace(emergency_interp); } # undef BACKTRACE_DEPTH diff --git a/src/exit.c b/src/exit.c index d8a08fb630..04ea3204d0 100644 --- a/src/exit.c +++ b/src/exit.c @@ -104,7 +104,9 @@ Parrot_x_exit(PARROT_INTERP, int status) * and: interp->exit_handler_list is gone, after the last exit handler * (Parrot_really_destroy) has run */ - handler_node_t *node = interp->exit_handler_list; + handler_node_t *node; + + node = interp->exit_handler_list; Parrot_block_GC_mark(interp); Parrot_block_GC_sweep(interp); diff --git a/src/extend.c b/src/extend.c index 9c0c288788..e37b683504 100644 --- a/src/extend.c +++ b/src/extend.c @@ -67,142 +67,26 @@ GC and stackwalking, and the presence of an exception-handling infrastructure. #include "parrot/parrot.h" #include "parrot/extend.h" +#include "parrot/events.h" #include "pmc/pmc_sub.h" #include "pmc/pmc_callcontext.h" -/* HEADERIZER HFILE: include/parrot/extend.h */ - -/* - -=item C - -Writes a C string format with a varargs list to a PIO. - -=item C - -Writes a C string format with varargs to a PIO. - -=item C - -Writes a C string format with varargs to C. - -=item C - -Writes a C string format with varargs to C. - -=cut - -*/ - -PARROT_EXPORT -int -Parrot_vfprintf(PARROT_INTERP, ARGIN(Parrot_PMC pio), - ARGIN(const char *s), va_list args) -{ - ASSERT_ARGS(Parrot_vfprintf) - STRING * str; - INTVAL retval; - - str = Parrot_vsprintf_c(interp, s, args); - retval = Parrot_io_putps(interp, pio, str); - - return retval; -} - -PARROT_EXPORT -int -Parrot_fprintf(PARROT_INTERP, ARGIN(Parrot_PMC pio), - ARGIN(const char *s), ...) -{ - ASSERT_ARGS(Parrot_fprintf) - va_list args; - INTVAL retval; - - va_start(args, s); - retval = Parrot_vfprintf(interp, pio, s, args); - va_end(args); - - return retval; -} - -PARROT_EXPORT -int -Parrot_printf(NULLOK_INTERP, ARGIN(const char *s), ...) -{ - ASSERT_ARGS(Parrot_printf) - va_list args; - INTVAL retval; - va_start(args, s); - - if (interp) - retval = Parrot_vfprintf(interp, Parrot_io_STDOUT(interp), s, args); - else - retval = vfprintf(stdout, s, args); - va_end(args); - - return retval; -} +/* HEADERIZER HFILE: none */ +/* HEADERIZER BEGIN: static */ +/* Don't modify between HEADERIZER BEGIN / HEADERIZER END. Your changes will be lost. */ -PARROT_EXPORT -int -Parrot_eprintf(NULLOK_INTERP, ARGIN(const char *s), ...) -{ - ASSERT_ARGS(Parrot_eprintf) - va_list args; - INTVAL retval; - - va_start(args, s); - - if (interp) - retval = Parrot_vfprintf(interp, Parrot_io_STDERR(interp), s, args); - else - retval = vfprintf(stderr, s, args); - - va_end(args); - - return retval; -} - -/* - -=item C - -Return the root namespace - -=cut - -*/ - -PARROT_EXPORT -PARROT_PURE_FUNCTION -Parrot_PMC -Parrot_get_root_namespace(PARROT_INTERP) -{ - ASSERT_ARGS(Parrot_get_root_namespace) - - return interp->root_namespace; -} - -/* +static void restore_context(PARROT_INTERP, + ARGIN(Parrot_Context * const initialctx)) + __attribute__nonnull__(1) + __attribute__nonnull__(2); -=item C - -Create and return a new PMC. - -=cut - -*/ +#define ASSERT_ARGS_restore_context __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ + PARROT_ASSERT_ARG(interp) \ + , PARROT_ASSERT_ARG(initialctx)) +/* Don't modify between HEADERIZER BEGIN / HEADERIZER END. Your changes will be lost. */ +/* HEADERIZER END: static */ -PARROT_EXPORT -Parrot_PMC -Parrot_PMC_new(PARROT_INTERP, Parrot_Int type) -{ - ASSERT_ARGS(Parrot_PMC_new) - Parrot_PMC newpmc = Parrot_pmc_new_noinit(interp, type); - VTABLE_init(interp, newpmc); - return newpmc; -} +/* HEADERIZER HFILE: include/parrot/extend.h */ /* @@ -225,26 +109,6 @@ Parrot_PMC_typenum(PARROT_INTERP, ARGIN_NULLOK(const char *_class)) /* -=item C - -Returns the special C PMC. - -=cut - -*/ - -PARROT_EXPORT -PARROT_PURE_FUNCTION -PARROT_CAN_RETURN_NULL -Parrot_PMC -Parrot_PMC_null(void) -{ - ASSERT_ARGS(Parrot_PMC_null) - return PMCNULL; -} - -/* - =item C Deallocate a C string that the interpreter has handed to you. @@ -318,6 +182,35 @@ Parrot_ext_call(PARROT_INTERP, ARGIN(Parrot_PMC sub_pmc), /* +=item C + +Helper function to restore the caller context in Parrot_ext_try. + +=cut + +*/ + +static void +restore_context(PARROT_INTERP, ARGIN(Parrot_Context * const initialctx)) +{ + ASSERT_ARGS(restore_context) + Parrot_Context *curctx = CONTEXT(interp); + if (curctx != initialctx) { + Parrot_warn((interp), PARROT_WARNINGS_NONE_FLAG, + "popping context in Parrot_ext_try"); + do { + Parrot_pop_context(interp); + curctx = CONTEXT(interp); + if (curctx == NULL) + do_panic((interp), "cannot restore context", + __FILE__, __LINE__); + } while (curctx != initialctx); + } +} + +/* + =item C @@ -328,46 +221,29 @@ If the function throws, the provided handler function is invoked */ -#define POP_CONTEXT(interp, curctx, intialctx) \ - Parrot_warn((interp), PARROT_WARNINGS_NONE_FLAG, \ - "popping context in Parrot_ext_try"); \ - do { \ - if ((curctx) == NULL) \ - do_panic((interp), "cannot restore context", \ - __FILE__, __LINE__); \ - } while (((curctx) = CONTEXT(interp)) != initialctx); \ - - PARROT_EXPORT void Parrot_ext_try(PARROT_INTERP, - ARGIN_NULLOK(void (*cfunction)(Parrot_Interp, void *)), - ARGIN_NULLOK(void (*chandler)(Parrot_Interp, PMC *, void *)), - ARGIN_NULLOK(void *data)) + ARGIN_NULLOK(void (*cfunction)(Parrot_Interp, ARGIN_NULLOK(void *))), + ARGIN_NULLOK(void (*chandler)(Parrot_Interp, ARGIN_NULLOK(PMC *), ARGIN_NULLOK(void *))), + ARGIN_NULLOK(void *data)) { ASSERT_ARGS(Parrot_ext_try) if (cfunction) { Parrot_runloop jmp; - Parrot_Context *initialctx, *curctx; - initialctx = CONTEXT(interp); + Parrot_Context * const initialctx = CONTEXT(interp); switch (setjmp(jmp.resume)) { case 0: /* try */ Parrot_ex_add_c_handler(interp, &jmp); (*cfunction)(interp, data); - curctx = CONTEXT(interp); - if (curctx != initialctx) { - POP_CONTEXT(interp, curctx, initialctx); - } - Parrot_cx_delete_handler_local(interp, STRINGNULL); + restore_context(interp, initialctx); + Parrot_cx_delete_handler_local(interp); break; default: /* catch */ { PMC *exception = jmp.exception; - curctx = CONTEXT(interp); - if (curctx != initialctx) { - POP_CONTEXT(interp, curctx, initialctx); - } - Parrot_cx_delete_handler_local(interp, STRINGNULL); + restore_context(interp, initialctx); + Parrot_cx_delete_handler_local(interp); if (chandler) (*chandler)(interp, exception, data); } @@ -377,364 +253,6 @@ Parrot_ext_try(PARROT_INTERP, /* -=item C - -Return the value of an integer register. - -DEPRECATED: Do not use. See TT #2133 - -=cut - -*/ - -PARROT_EXPORT -PARROT_PURE_FUNCTION -Parrot_Int -Parrot_get_intreg(PARROT_INTERP, Parrot_Int regnum) -{ - ASSERT_ARGS(Parrot_get_intreg) - return REG_INT(interp, regnum); -} - -/* - -=item C - -Return the value of a numeric register. - -DEPRECATED: Do not use. See TT #2133 - -=cut - -*/ - -PARROT_EXPORT -PARROT_PURE_FUNCTION -Parrot_Float -Parrot_get_numreg(PARROT_INTERP, Parrot_Int regnum) -{ - ASSERT_ARGS(Parrot_get_numreg) - - return REG_NUM(interp, regnum); -} - -/* - -=item C - -Return the value of a string register. - -DEPRECATED: Do not use. See TT #2133 - -=cut - -*/ - -PARROT_EXPORT -PARROT_PURE_FUNCTION -Parrot_String -Parrot_get_strreg(PARROT_INTERP, Parrot_Int regnum) -{ - ASSERT_ARGS(Parrot_get_strreg) - return REG_STR(interp, regnum); -} - -/* - -=item C - -Return the value of a PMC register. - -DEPRECATED: Do not use. See TT #2133 - -=cut - -*/ - -PARROT_EXPORT -PARROT_PURE_FUNCTION -Parrot_PMC -Parrot_get_pmcreg(PARROT_INTERP, Parrot_Int regnum) -{ - ASSERT_ARGS(Parrot_get_pmcreg) - return REG_PMC(interp, regnum); -} - -/* - -=item C - -Set the value of an I register. - -DEPRECATED: Do not use. See TT #2133 - -=cut - -*/ - -PARROT_EXPORT -void -Parrot_set_intreg(PARROT_INTERP, Parrot_Int regnum, - Parrot_Int value) -{ - ASSERT_ARGS(Parrot_set_intreg) - REG_INT(interp, regnum) = value; -} - -/* - -=item C - -Set the value of an N register. - -DEPRECATED: Do not use. See TT #2133 - -=cut - -*/ - -PARROT_EXPORT -void -Parrot_set_numreg(PARROT_INTERP, Parrot_Int regnum, - Parrot_Float value) -{ - ASSERT_ARGS(Parrot_set_numreg) - REG_NUM(interp, regnum) = value; -} - -/* - -=item C - -Set the value of an S register. - -DEPRECATED: Do not use. See TT #2133 - -=cut - -*/ - -PARROT_EXPORT -void -Parrot_set_strreg(PARROT_INTERP, Parrot_Int regnum, - Parrot_String value) -{ - ASSERT_ARGS(Parrot_set_strreg) - - REG_STR(interp, regnum) = value; - PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp)); -} - -/* - -=item C - -Set the value of a P register. - -DEPRECATED: Do not use. See TT #2133 - -=cut - -*/ - -PARROT_EXPORT -void -Parrot_set_pmcreg(PARROT_INTERP, Parrot_Int regnum, - Parrot_PMC value) -{ - ASSERT_ARGS(Parrot_set_pmcreg) - - REG_PMC(interp, regnum) = value; - PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp)); -} - -/*=for api extend Parrot_new_string - * - */ -/* - -=item C - -Create a new Parrot string from a passed-in buffer. Pass in a 0 for -flags for right now. - -A copy of the buffer is made. - -DEPRECATED: Use Parrot_str_new or Parrot_str_new_init instead. See TT #2133 - -=cut - -*/ - -PARROT_EXPORT -PARROT_WARN_UNUSED_RESULT -PARROT_CANNOT_RETURN_NULL -Parrot_String -Parrot_new_string(PARROT_INTERP, ARGIN_NULLOK(const char *buffer), - Parrot_UInt length, ARGIN_NULLOK(const char * const encoding_name), - Parrot_UInt flags) -{ - ASSERT_ARGS(Parrot_new_string) - Parrot_String retval; - const STR_VTABLE *encoding; - - if (encoding_name) { - encoding = Parrot_find_encoding(interp, encoding_name); - if (!encoding) - Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_UNIMPLEMENTED, - "Can't make '%s' encoding strings", encoding_name); - } - else - encoding = Parrot_default_encoding_ptr; - - retval = Parrot_str_new_init(interp, buffer, length, encoding, flags); - - return retval; -} - -/* - -=item C - -Add a reference of the PMC to the interpreter's GC registry. This prevents PMCs -only known to extension from getting destroyed during GC runs. - -DEPRECATED: Use Parrot_pmc_gc_register instead - -=cut - -*/ - -PARROT_EXPORT -void -Parrot_register_pmc(PARROT_INTERP, Parrot_PMC pmc) -{ - ASSERT_ARGS(Parrot_register_pmc) - Parrot_pmc_gc_register(interp, pmc); -} - -/* - -=item C - -Remove a reference of the PMC from the interpreter's GC registry. If the -reference count reaches zero, the PMC will be destroyed during the next GC run. - -DEPRECATED: Use Parrot_pmc_gc_unregister instead - -=cut - -*/ - -PARROT_EXPORT -void -Parrot_unregister_pmc(PARROT_INTERP, Parrot_PMC pmc) -{ - ASSERT_ARGS(Parrot_unregister_pmc) - Parrot_pmc_gc_unregister(interp, pmc); -} - -/* - -=item C - -Add a reference of the string to the interpreter's GC registry. This prevents -strings only known to extension from getting destroyed during GC runs. - -DEPRECATED: Use Parrot_str_gc_register instead - -=cut - -*/ - -PARROT_EXPORT -void -Parrot_register_string(PARROT_INTERP, Parrot_String s) -{ - ASSERT_ARGS(Parrot_register_string) - Parrot_str_gc_register(interp, s); -} - -/* - -=item C - -Remove a reference of the string from the interpreter's GC registry. If the -reference count reaches zero, the string will be destroyed during the next GC -run. - -DEPRECATED: Use Parrot_str_gc_unregister instead - -=cut - -*/ - -PARROT_EXPORT -void -Parrot_unregister_string(PARROT_INTERP, Parrot_String s) -{ - ASSERT_ARGS(Parrot_unregister_string) - Parrot_str_gc_unregister(interp, s); -} - -/* - -=item C - -Returns a PMC sub wrapper for a c function. - -TODO: Clean this up, move it some place more appropriate - -=cut - -*/ - -PARROT_EXPORT -Parrot_PMC -Parrot_sub_new_from_c_func(PARROT_INTERP, - ARGIN(void (*func)(void)), ARGIN(const char * signature)) -{ - ASSERT_ARGS(Parrot_sub_new_from_c_func) - - Parrot_String sig; - Parrot_PMC sub; - - sig = Parrot_new_string(interp, signature, strlen(signature), - (char *) NULL, 0); - - sub = Parrot_pmc_new(interp, enum_class_NCI); - VTABLE_set_pointer_keyed_str(interp, sub, sig, F2DPTR(func)); - return sub; -} - -/* - -=item C - -Create a class with the type given - -TODO: Clean this up, move this to src/oo.c - -=cut - -*/ - -PARROT_EXPORT -Parrot_PMC -Parrot_PMC_newclass(PARROT_INTERP, Parrot_PMC classtype) -{ - ASSERT_ARGS(Parrot_PMC_newclass) - return Parrot_pmc_new_init(interp, enum_class_Class, classtype); -} - -/* - =back =head1 SEE ALSO diff --git a/src/gc/alloc_resources.c b/src/gc/alloc_resources.c index 18cb2cecb4..4d04c35506 100644 --- a/src/gc/alloc_resources.c +++ b/src/gc/alloc_resources.c @@ -41,7 +41,8 @@ typedef struct string_callback_data { PARROT_CANNOT_RETURN_NULL PARROT_WARN_UNUSED_RESULT -static const char * buffer_location(PARROT_INTERP, ARGIN(const Buffer *b)) +static const char * buffer_location(PARROT_INTERP, + ARGIN(const Parrot_Buffer *b)) __attribute__nonnull__(1) __attribute__nonnull__(2); @@ -54,7 +55,7 @@ static void check_memory_system(ARGIN(const Memory_Pools *mem_pools)) static void check_var_size_obj_pool(ARGIN(const Variable_Size_Pool *pool)) __attribute__nonnull__(1); -static void debug_print_buf(PARROT_INTERP, ARGIN(const Buffer *b)) +static void debug_print_buf(PARROT_INTERP, ARGIN(const Parrot_Buffer *b)) __attribute__nonnull__(1) __attribute__nonnull__(2); @@ -131,7 +132,8 @@ static int sweep_cb_pmc(PARROT_INTERP, /* -=item C +=item C Returns a constant string representing the location of the given Buffer C in one of the PMC registers. If the PMC is not located @@ -146,7 +148,7 @@ string C<"???">. PARROT_CANNOT_RETURN_NULL PARROT_WARN_UNUSED_RESULT static const char * -buffer_location(PARROT_INTERP, ARGIN(const Buffer *b)) +buffer_location(PARROT_INTERP, ARGIN(const Parrot_Buffer *b)) { ASSERT_ARGS(buffer_location) Parrot_Context * const ctx = CONTEXT(interp); @@ -166,7 +168,7 @@ buffer_location(PARROT_INTERP, ARGIN(const Buffer *b)) /* -=item C +=item C Prints a debug statement with information about the given PObj C. @@ -175,7 +177,7 @@ Prints a debug statement with information about the given PObj C. */ static void -debug_print_buf(PARROT_INTERP, ARGIN(const Buffer *b)) +debug_print_buf(PARROT_INTERP, ARGIN(const Parrot_Buffer *b)) { ASSERT_ARGS(debug_print_buf) fprintf(stderr, "found %p, len %d, flags 0x%08x at %s\n", @@ -309,8 +311,8 @@ check_fixed_size_obj_pool(ARGIN(const Fixed_Size_Pool *pool)) /* 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; + /* next item on free list should also be flagged as free item */ + pobj_walker = pobj_walker->next_ptr; PARROT_ASSERT(PObj_on_free_list_TEST((PObj*)pobj_walker)); } } @@ -334,7 +336,7 @@ check_fixed_size_obj_pool(ARGIN(const Fixed_Size_Pool *pool)) 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; + pobj_walker = pobj_walker->next_ptr; PARROT_ASSERT(--count); } @@ -385,7 +387,7 @@ check_var_size_obj_pool(ARGIN(const Variable_Size_Pool *pool)) /* -=item C +=item C Checks wether the buffer is within the bounds of the memory pool @@ -394,7 +396,7 @@ Checks wether the buffer is within the bounds of the memory pool */ void -check_buffer_ptr(ARGMOD(Buffer * pobj), ARGMOD(Variable_Size_Pool * pool)) +check_buffer_ptr(ARGMOD(Parrot_Buffer * pobj), ARGMOD(Variable_Size_Pool * pool)) { ASSERT_ARGS(check_buffer_ptr) Memory_Block * cur_block = pool->top_block; diff --git a/src/gc/api.c b/src/gc/api.c index 410363d26e..ac760281de 100644 --- a/src/gc/api.c +++ b/src/gc/api.c @@ -394,7 +394,8 @@ Parrot_gc_free_string_header(PARROT_INTERP, ARGMOD(STRING *s)) /* -=item C +=item C 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 @@ -408,7 +409,7 @@ to create ListChunk objects in src/list.c. PARROT_EXPORT PARROT_CANNOT_RETURN_NULL PARROT_WARN_UNUSED_RESULT -Buffer * +Parrot_Buffer * Parrot_gc_new_bufferlike_header(PARROT_INTERP, size_t size) { ASSERT_ARGS(Parrot_gc_new_bufferlike_header) @@ -417,8 +418,8 @@ Parrot_gc_new_bufferlike_header(PARROT_INTERP, size_t size) /* -=item C +=item C Free a bufferlike header that is not being used, so that Parrot can recycle it and use it again. @@ -429,7 +430,7 @@ it and use it again. PARROT_EXPORT void -Parrot_gc_free_bufferlike_header(PARROT_INTERP, ARGMOD(Buffer *obj), +Parrot_gc_free_bufferlike_header(PARROT_INTERP, ARGMOD(Parrot_Buffer *obj), size_t size) { ASSERT_ARGS(Parrot_gc_free_bufferlike_header) @@ -438,10 +439,10 @@ Parrot_gc_free_bufferlike_header(PARROT_INTERP, ARGMOD(Buffer *obj), /* -=item C +=item C -Allocates a chunk of memory of at least size C for the given Buffer. +Allocates a chunk of memory of at least size C for the given Parrot_Buffer. buffer is guaranteed to be properly aligned for things like C, so the size may be rounded up or down to guarantee that this alignment holds. @@ -452,7 +453,7 @@ so the size may be rounded up or down to guarantee that this alignment holds. PARROT_EXPORT void Parrot_gc_allocate_buffer_storage_aligned(PARROT_INTERP, - ARGOUT(Buffer *buffer), size_t size) + ARGOUT(Parrot_Buffer *buffer), size_t size) { ASSERT_ARGS(Parrot_gc_allocate_buffer_storage_aligned) interp->gc_sys->allocate_buffer_storage(interp, buffer, size); @@ -460,10 +461,10 @@ Parrot_gc_allocate_buffer_storage_aligned(PARROT_INTERP, /* -=item C +=item C -Reallocate the Buffer's buffer memory to the given size. The +Reallocate the Parrot_Buffer's buffer memory to the given size. The allocated buffer will not shrink. If the buffer was allocated with L the new buffer will also be aligned. As with all reallocation, the new buffer might have moved and the additional @@ -475,7 +476,7 @@ memory is not cleared. PARROT_EXPORT void -Parrot_gc_reallocate_buffer_storage(PARROT_INTERP, ARGMOD(Buffer *buffer), +Parrot_gc_reallocate_buffer_storage(PARROT_INTERP, ARGMOD(Parrot_Buffer *buffer), size_t newsize) { ASSERT_ARGS(Parrot_gc_reallocate_buffer_storage) @@ -551,7 +552,7 @@ Parrot_gc_allocate_pmc_attributes(PARROT_INTERP, ARGMOD(PMC *pmc)) =item C -Deallocates an attibutes structure from a PMC if it has the auto_attrs +Deallocates an attributes structure from a PMC if it has the auto_attrs flag set. =cut diff --git a/src/gc/fixed_allocator.c b/src/gc/fixed_allocator.c index 8a255fff2a..1c28cb9a36 100644 --- a/src/gc/fixed_allocator.c +++ b/src/gc/fixed_allocator.c @@ -62,19 +62,17 @@ static void pool_free(PARROT_INTERP, PARROT_WARN_UNUSED_RESULT PARROT_PURE_FUNCTION static int pool_is_maybe_owned( - ARGMOD(Pool_Allocator *pool), - ARGIN(void *ptr)) + ARGIN(const Pool_Allocator *pool), + ARGIN(const void *ptr)) __attribute__nonnull__(1) - __attribute__nonnull__(2) - FUNC_MODIFIES(*pool); + __attribute__nonnull__(2); PARROT_WARN_UNUSED_RESULT static int pool_is_owned( - ARGMOD(Pool_Allocator *pool), + ARGIN(const Pool_Allocator *pool), ARGIN(const void *ptr)) __attribute__nonnull__(1) - __attribute__nonnull__(2) - FUNC_MODIFIES(*pool); + __attribute__nonnull__(2); #define ASSERT_ARGS_allocate_new_pool_arena __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ PARROT_ASSERT_ARG(interp) \ @@ -304,15 +302,16 @@ Parrot_gc_pool_new(SHIM_INTERP, size_t object_size) Pool_Allocator * const newpool = mem_internal_allocate_typed(Pool_Allocator); newpool->object_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; + newpool->free_list = NULL; newpool->lo_arena_ptr = (void *)((size_t)-1); newpool->hi_arena_ptr = NULL; newpool->newfree = NULL; newpool->newlast = NULL; + newpool->num_arenas = 0; + newpool->arena_bounds = (void **)mem_sys_allocate(NEXT_ARENA_BOUNDS_SIZE(0)); return newpool; } @@ -331,6 +330,8 @@ Parrot_gc_pool_destroy(SHIM_INTERP, ARGMOD(Pool_Allocator *pool)) arena = next; } + mem_sys_free(pool->arena_bounds); + mem_internal_free(pool); } @@ -377,14 +378,8 @@ size_t Parrot_gc_pool_allocated_size(SHIM_INTERP, ARGIN(const Pool_Allocator *pool)) { ASSERT_ARGS(Parrot_gc_pool_allocated_size) - const Pool_Allocator_Arena *arena = pool->top_arena; - int count = 0; - while (arena) { - count++; - arena = arena->next; - } - return count * arena_size(pool); + return pool->num_arenas * arena_size(pool); } PARROT_CAN_RETURN_NULL @@ -417,9 +412,10 @@ Parrot_gc_pool_high_ptr(SHIM_INTERP, ARGIN(Pool_Allocator *pool)) =item C -=item C +=item C -=item C +=item C Static implementation of public methods. @@ -448,7 +444,7 @@ pool_allocate(PARROT_INTERP, ARGMOD(Pool_Allocator *pool)) if (pool->free_list) return get_free_list_item(pool); - if (!pool->newfree) + if (pool->newfree >= pool->newlast) allocate_new_pool_arena(interp, pool); return get_newfree_list_item(pool); @@ -464,9 +460,6 @@ get_newfree_list_item(ARGMOD(Pool_Allocator *pool)) pool->newfree = (Pool_Allocator_Free_List *) ((char *)(pool->newfree) + pool->object_size); - if (pool->newfree >= pool->newlast) - pool->newfree = NULL; - --pool->num_free_objects; return item; } @@ -490,7 +483,7 @@ pool_free(SHIM_INTERP, ARGMOD(Pool_Allocator *pool), ARGMOD(void *data)) PARROT_WARN_UNUSED_RESULT PARROT_PURE_FUNCTION static int -pool_is_maybe_owned(ARGMOD(Pool_Allocator *pool), ARGIN(void *ptr)) +pool_is_maybe_owned(ARGIN(const Pool_Allocator *pool), ARGIN(const void *ptr)) { ASSERT_ARGS(pool_is_maybe_owned) @@ -503,28 +496,24 @@ pool_is_maybe_owned(ARGMOD(Pool_Allocator *pool), ARGIN(void *ptr)) PARROT_WARN_UNUSED_RESULT static int -pool_is_owned(ARGMOD(Pool_Allocator *pool), ARGIN(const void *ptr)) +pool_is_owned(ARGIN(const Pool_Allocator *pool), ARGIN(const void *ptr)) { ASSERT_ARGS(pool_is_owned) - if (ptr >= pool->lo_arena_ptr && ptr <= pool->hi_arena_ptr) { - const Pool_Allocator_Arena *arena = pool->top_arena; - - /* We can cache these values. All arenas are same size */ - const ptrdiff_t a_size = arena_size(pool); - - while (arena) { - const Pool_Allocator_Arena * const arena_item = arena + 1; - const ptrdiff_t ptr_diff = (const char *) ptr - (const char *) arena_item; + if (ptr >= pool->lo_arena_ptr && ptr < pool->hi_arena_ptr) { + int p; - if (ptr_diff >= 0 && ptr_diff < a_size - && ptr_diff % pool->object_size == 0) + for (p = 0; p < pool->num_arenas; p++) { + const size_t idx = 2 * p; + void * const low = pool->arena_bounds[idx]; + void * const high = pool->arena_bounds[idx + 1]; + if (ptr >= low && ptr < high) { + const ptrdiff_t ptrdiff = (const char *)ptr - (const char *)low; + if (ptrdiff % pool->object_size == 0) return 1; - - arena = arena->next; + } } } - return 0; } @@ -543,7 +532,7 @@ static void allocate_new_pool_arena(PARROT_INTERP, ARGMOD(Pool_Allocator *pool)) { ASSERT_ARGS(allocate_new_pool_arena) - Pool_Allocator_Free_List *next; + Pool_Allocator_Free_List *next, *last; Pool_Allocator_Arena *new_arena; const size_t num_items = pool->objects_per_alloc; @@ -559,22 +548,30 @@ allocate_new_pool_arena(PARROT_INTERP, ARGMOD(Pool_Allocator *pool)) interp->gc_sys->stats.memory_allocated += total_size; - new_arena->prev = NULL; new_arena->next = pool->top_arena; pool->top_arena = new_arena; next = (Pool_Allocator_Free_List *)(new_arena + 1); - + last = (Pool_Allocator_Free_List *)((char *)next + item_space); pool->newfree = next; - pool->newlast = (Pool_Allocator_Free_List *)((char *)next + item_space); + pool->newlast = last; pool->num_free_objects += num_items; - pool->total_objects += num_items; - if (pool->lo_arena_ptr > (void *)new_arena) - pool->lo_arena_ptr = new_arena; + if (pool->lo_arena_ptr > (void *)next) + pool->lo_arena_ptr = next; - if ((char *)pool->hi_arena_ptr < (char *)new_arena + total_size) - pool->hi_arena_ptr = (char *)new_arena + total_size; + if (pool->hi_arena_ptr < (void *)last) + pool->hi_arena_ptr = last; + + if (pool->num_arenas % ARENA_BOUNDS_PADDING == 0) + pool->arena_bounds = (void **)mem_sys_realloc(pool->arena_bounds, + NEXT_ARENA_BOUNDS_SIZE(pool->num_arenas)); + { + const size_t ptr_idx = pool->num_arenas * 2; + pool->arena_bounds[ptr_idx] = next; + pool->arena_bounds[ptr_idx + 1] = last; + } + ++pool->num_arenas; } /* @@ -612,6 +609,7 @@ arena_size(ARGIN(const Pool_Allocator *self)) =cut + */ /* diff --git a/src/gc/fixed_allocator.h b/src/gc/fixed_allocator.h index a2fa03d539..2a7e2b3c6d 100644 --- a/src/gc/fixed_allocator.h +++ b/src/gc/fixed_allocator.h @@ -23,28 +23,36 @@ src/gc/fixed_allocator.h - implementation of allocator for small-size objects. increase *_HEADERS_PER_ALLOC and GC_FIXED_SIZE_POOL_SIZE to be large enough to satisfy most startup costs. */ +#define ARENA_BOUNDS_PADDING 128 +#define NEXT_ARENA_BOUNDS_SIZE(n) (2 * ((n) + ARENA_BOUNDS_PADDING) * sizeof (void*)) + typedef struct Pool_Allocator_Free_List { struct Pool_Allocator_Free_List * next; + char *dummy; /* fix alignment on ia64, mipsel and sparc, similar to gh issue #603 */ } Pool_Allocator_Free_List; typedef struct Pool_Allocator_Arena { struct Pool_Allocator_Arena * next; - struct Pool_Allocator_Arena * prev; + char *dummy; /* fix alignment on ia64, mipsel and sparc, similar to gh issue #603 */ } Pool_Allocator_Arena; typedef struct Pool_Allocator { size_t object_size; - size_t total_objects; size_t objects_per_alloc; size_t num_free_objects; - Pool_Allocator_Free_List * free_list; + Pool_Allocator_Arena * top_arena; + Pool_Allocator_Free_List * free_list; Pool_Allocator_Free_List * newfree; Pool_Allocator_Free_List * newlast; /* Pointers of arena bounds. Used in .is_owned check */ void *lo_arena_ptr; void *hi_arena_ptr; + + int num_arenas; /* number of arenas, for keeping track of the + size of arena_bounds */ + void **arena_bounds; /* Array of low/high pairs for each arena. */ } Pool_Allocator; typedef struct Fixed_Allocator diff --git a/src/gc/gc_gms.c b/src/gc/gc_gms.c index 31245f47a5..76b1ed2afc 100644 --- a/src/gc/gc_gms.c +++ b/src/gc/gc_gms.c @@ -1,5 +1,5 @@ /* -Copyright (C) 2001-2011, Parrot Foundation. +Copyright (C) 2001-2012, Parrot Foundation. =head1 NAME @@ -210,11 +210,12 @@ static void failed_allocation(unsigned int line, size_t size); PARROT_MALLOC PARROT_CAN_RETURN_NULL -static Buffer* gc_gms_allocate_buffer_header(PARROT_INTERP, size_t size) +static Parrot_Buffer* gc_gms_allocate_buffer_header(PARROT_INTERP, + size_t size) __attribute__nonnull__(1); static void gc_gms_allocate_buffer_storage(PARROT_INTERP, - ARGIN(Buffer *str), + ARGIN(Parrot_Buffer *str), size_t size) __attribute__nonnull__(1) __attribute__nonnull__(2); @@ -288,7 +289,7 @@ static void gc_gms_finalize(PARROT_INTERP) __attribute__nonnull__(1); static void gc_gms_free_buffer_header(PARROT_INTERP, - ARGFREE(Buffer *s), + ARGFREE(Parrot_Buffer *s), size_t size) __attribute__nonnull__(1); @@ -390,7 +391,7 @@ static void gc_gms_process_work_list(PARROT_INTERP, __attribute__nonnull__(3); static void gc_gms_reallocate_buffer_storage(PARROT_INTERP, - ARGIN(Buffer *str), + ARGIN(Parrot_Buffer *str), size_t size) __attribute__nonnull__(1) __attribute__nonnull__(2); @@ -721,7 +722,7 @@ Parrot_gc_gms_init(PARROT_INTERP, ARGIN(Parrot_GC_Init_Args *args)) else { size_t i; - self = mem_allocate_zeroed_typed(MarkSweep_GC); + self = mem_internal_allocate_zeroed_typed(MarkSweep_GC); self->pmc_allocator = Parrot_gc_pool_new(interp, sizeof (pmc_alloc_struct)); @@ -936,7 +937,7 @@ gc_gms_cleanup_dirty_list(PARROT_INTERP, PObj_live_CLEAR(pmc); PObj_GC_on_dirty_list_CLEAR(pmc); Parrot_pa_remove(interp, dirty_list, item->ptr); - item->ptr = Parrot_pa_insert(interp, self->objects[gen], item); + item->ptr = Parrot_pa_insert(self->objects[gen], item); gc_gms_seal_object(interp, pmc); } else { @@ -981,7 +982,7 @@ gc_gms_process_dirty_list(PARROT_INTERP, ASSERT_ARGS(gc_gms_process_dirty_list) POINTER_ARRAY_ITER(dirty_list, - PMC *pmc = &((pmc_alloc_struct *)ptr)->pmc; + PMC * const pmc = &((pmc_alloc_struct *)ptr)->pmc; if (PObj_custom_mark_TEST(pmc)) VTABLE_mark(interp, pmc); @@ -1008,7 +1009,7 @@ gc_gms_process_work_list(PARROT_INTERP, ASSERT_ARGS(gc_gms_process_work_list) POINTER_ARRAY_ITER(work_list, - PMC *pmc = &((pmc_alloc_struct *)ptr)->pmc; + PMC * const pmc = &((pmc_alloc_struct *)ptr)->pmc; if (PObj_custom_mark_TEST(pmc)) VTABLE_mark(interp, pmc); @@ -1020,14 +1021,14 @@ gc_gms_process_work_list(PARROT_INTERP, /* Move processed objects back to own generation */ POINTER_ARRAY_ITER(work_list, - pmc_alloc_struct *item = (pmc_alloc_struct *)ptr; - PMC *pmc = &(item->pmc); - size_t gen = POBJ2GEN(pmc); + pmc_alloc_struct * const item = (pmc_alloc_struct *)ptr; + PMC * const pmc = &(item->pmc); + const size_t gen = POBJ2GEN(pmc); PARROT_ASSERT(!PObj_GC_on_dirty_list_TEST(pmc)); Parrot_pa_remove(interp, work_list, item->ptr); - item->ptr = Parrot_pa_insert(interp, self->objects[gen], item);); + item->ptr = Parrot_pa_insert(self->objects[gen], item);); } @@ -1052,11 +1053,11 @@ gc_gms_sweep_pools(PARROT_INTERP, ARGMOD(MarkSweep_GC *self)) for (i = self->gen_to_collect; i >= 0; i--) { /* Don't move to generation beyond last */ - int move_to_old = (i + 1) != MAX_GENERATIONS; + const int move_to_old = (i + 1) != MAX_GENERATIONS; POINTER_ARRAY_ITER(self->objects[i], - pmc_alloc_struct *item = (pmc_alloc_struct *)ptr; - PMC *pmc = &(item->pmc); + pmc_alloc_struct * const item = (pmc_alloc_struct *)ptr; + PMC * const pmc = &(item->pmc); PARROT_ASSERT(PObj_constant_TEST(pmc) || (int)POBJ2GEN(pmc) == i); @@ -1070,17 +1071,17 @@ gc_gms_sweep_pools(PARROT_INTERP, ARGMOD(MarkSweep_GC *self)) Parrot_pa_remove(interp, self->objects[i], item->ptr); /* If this was freshly allocated object in C stack - move it to dirty list */ if (PObj_GC_soil_root_TEST(pmc)) { - item->ptr = Parrot_pa_insert(interp, self->dirty_list, item); + item->ptr = Parrot_pa_insert(self->dirty_list, item); PObj_GC_soil_root_CLEAR(pmc); PObj_GC_on_dirty_list_SET(pmc); } else { - item->ptr = Parrot_pa_insert(interp, self->objects[i + 1], item); + item->ptr = Parrot_pa_insert(self->objects[i + 1], item); gc_gms_seal_object(interp, pmc); } } } - else if (!PObj_constant_TEST(pmc)) { + else { Parrot_pa_remove(interp, self->objects[i], item->ptr); interp->gc_sys->stats.memory_used -= sizeof (PMC); @@ -1100,8 +1101,8 @@ gc_gms_sweep_pools(PARROT_INTERP, ARGMOD(MarkSweep_GC *self)) }); POINTER_ARRAY_ITER(self->strings[i], - string_alloc_struct *item = (string_alloc_struct *)ptr; - STRING *str = &(item->str); + string_alloc_struct * const item = (string_alloc_struct *)ptr; + STRING * const str = &(item->str); PARROT_ASSERT(!PObj_on_free_list_TEST(str)); @@ -1110,15 +1111,16 @@ gc_gms_sweep_pools(PARROT_INTERP, ARGMOD(MarkSweep_GC *self)) PObj_live_CLEAR(str); if (move_to_old) { Parrot_pa_remove(interp, self->strings[i], item->ptr); - item->ptr = Parrot_pa_insert(interp, self->strings[i + 1], item); + item->ptr = Parrot_pa_insert(self->strings[i + 1], item); SET_GEN_FLAGS(str, i + 1); } } - else if (!PObj_constant_TEST(str)) { + else { Parrot_pa_remove(interp, self->strings[i], item->ptr); if (Buffer_bufstart(str) && !PObj_external_TEST(str)) - Parrot_gc_str_free_buffer_storage(interp, &self->string_gc, (Buffer*)str); + Parrot_gc_str_free_buffer_storage( + interp, &self->string_gc, (Parrot_Buffer*)str); interp->gc_sys->stats.memory_used -= sizeof (STRING); @@ -1153,7 +1155,7 @@ gc_gms_mark_pmc_header(PARROT_INTERP, ARGMOD(PMC *pmc)) || !"Resurrecting of dead objects is not supported"); /* Object was already marked as grey. Or live. Or dead. Skip it */ - if (PObj_live_TEST(pmc) || PObj_constant_TEST(pmc)) + if (PObj_live_TEST(pmc)) return; /* If object too old - skip it */ @@ -1168,7 +1170,7 @@ gc_gms_mark_pmc_header(PARROT_INTERP, ARGMOD(PMC *pmc)) PObj_live_SET(pmc); Parrot_pa_remove(interp, self->objects[gen], item->ptr); - item->ptr = Parrot_pa_insert(interp, self->work_list, item); + item->ptr = Parrot_pa_insert(self->work_list, item); } /* @@ -1229,11 +1231,11 @@ size_t size)> =item C -=item C +=item C -=item C +=item C =item C @@ -1269,12 +1271,14 @@ gc_gms_free_pmc_attributes(PARROT_INTERP, ARGMOD(PMC *pmc)) { ASSERT_ARGS(gc_gms_free_pmc_attributes) if (PMC_data(pmc)) { - MarkSweep_GC * const self = (MarkSweep_GC *)interp->gc_sys->gc_private; - Parrot_gc_fixed_allocator_free(interp, self->fixed_size_allocator, - PMC_data(pmc), pmc->vtable->attr_size); + GC_Subsystem * const gc_sys = interp->gc_sys; + MarkSweep_GC * const self = (MarkSweep_GC *)gc_sys->gc_private; + const UINTVAL size = pmc->vtable->attr_size; + + Parrot_gc_fixed_allocator_free(interp, self->fixed_size_allocator, PMC_data(pmc), size); - interp->gc_sys->stats.memory_used -= pmc->vtable->attr_size; - interp->gc_sys->stats.mem_used_last_collect -= pmc->vtable->attr_size; + gc_sys->stats.memory_used -= size; + gc_sys->stats.mem_used_last_collect -= size; } } @@ -1296,7 +1300,7 @@ gc_gms_free_fixed_size_storage(PARROT_INTERP, size_t size, ARGMOD(void *data)) { ASSERT_ARGS(gc_gms_free_fixed_size_storage) if (data) { - MarkSweep_GC * const self = (MarkSweep_GC *)interp->gc_sys->gc_private; + const MarkSweep_GC * const self = (MarkSweep_GC *)interp->gc_sys->gc_private; interp->gc_sys->stats.memory_used -= size; interp->gc_sys->stats.mem_used_last_collect -= size; @@ -1325,7 +1329,8 @@ gc_gms_get_gc_info(PARROT_INTERP, Interpinfo_enum which) return self->num_early_gc_PMCs; if (which == TOTAL_PMCS) { /* It's higher than actual number of allocated PMCs */ - size_t ret = 0, i; + size_t ret = 0; + size_t i; for (i = 0; i < MAX_GENERATIONS; i++) { ret += Parrot_pa_count_allocated(interp, self->objects[i]); } @@ -1333,7 +1338,8 @@ gc_gms_get_gc_info(PARROT_INTERP, Interpinfo_enum which) } if (which == ACTIVE_PMCS) { /* It's higher than actual number of allocated PMCs */ - size_t ret = 0, i; + size_t ret = 0; + size_t i; for (i = 0; i < MAX_GENERATIONS; i++) { ret += Parrot_pa_count_used(interp, self->objects[i]); } @@ -1411,7 +1417,7 @@ gc_gms_allocate_pmc_header(PARROT_INTERP, UINTVAL flags) interp->gc_sys->stats.mem_used_last_collect += sizeof (PMC); item = (pmc_alloc_struct *)Parrot_gc_pool_allocate(interp, pool); - item->ptr = Parrot_pa_insert(interp, self->objects[0], item); + item->ptr = Parrot_pa_insert(self->objects[0], item); return &(item->pmc); } @@ -1423,7 +1429,7 @@ gc_gms_free_pmc_header(PARROT_INTERP, ARGFREE(PMC *pmc)) MarkSweep_GC * const self = (MarkSweep_GC *)interp->gc_sys->gc_private; if (pmc) { - size_t gen = POBJ2GEN(pmc); + const size_t gen = POBJ2GEN(pmc); /* We should never free objects from dirty list directly! */ PARROT_ASSERT(!PObj_GC_on_dirty_list_TEST(pmc)); @@ -1482,7 +1488,7 @@ gc_gms_is_pmc_ptr(PARROT_INTERP, ARGIN_NULLOK(void *ptr)) return 0; /* Pool.is_owned isn't precise enough (yet) */ - if (Parrot_pa_is_owned(interp, self->objects[POBJ2GEN(obj)], item, item->ptr)) { + if (Parrot_pa_is_owned(self->objects[POBJ2GEN(obj)], item, item->ptr)) { if (POBJ2GEN(obj) == 0) PObj_GC_soil_root_SET(obj); return 1; @@ -1497,11 +1503,11 @@ gc_gms_is_pmc_ptr(PARROT_INTERP, ARGIN_NULLOK(void *ptr)) =item C -=item C +=item C -=item C +=item C Allocate/free string/buffer headers. @@ -1527,7 +1533,7 @@ gc_gms_allocate_string_header(PARROT_INTERP, SHIM(UINTVAL flags)) interp->gc_sys->stats.mem_used_last_collect += sizeof (STRING); item = (string_alloc_struct *)Parrot_gc_pool_allocate(interp, pool); - item->ptr = Parrot_pa_insert(interp, self->strings[0], item); + item->ptr = Parrot_pa_insert(self->strings[0], item); ret = &(item->str); memset(ret, 0, sizeof (STRING)); @@ -1547,7 +1553,7 @@ gc_gms_free_string_header(PARROT_INTERP, ARGFREE(STRING *s)) if (Buffer_bufstart(s) && !PObj_external_TEST(s)) Parrot_gc_str_free_buffer_storage(interp, - &self->string_gc, (Buffer *)s); + &self->string_gc, (Parrot_Buffer *)s); PObj_on_free_list_SET(s); @@ -1561,15 +1567,15 @@ gc_gms_free_string_header(PARROT_INTERP, ARGFREE(STRING *s)) PARROT_MALLOC PARROT_CAN_RETURN_NULL -static Buffer* +static Parrot_Buffer* gc_gms_allocate_buffer_header(PARROT_INTERP, SHIM(size_t size)) { ASSERT_ARGS(gc_gms_allocate_buffer_header) - return (Buffer*)gc_gms_allocate_string_header(interp, 0); + return (Parrot_Buffer*)gc_gms_allocate_string_header(interp, 0); } static void -gc_gms_free_buffer_header(PARROT_INTERP, ARGFREE(Buffer *s), SHIM(size_t size)) +gc_gms_free_buffer_header(PARROT_INTERP, ARGFREE(Parrot_Buffer *s), SHIM(size_t size)) { ASSERT_ARGS(gc_gms_free_buffer_header) gc_gms_free_string_header(interp, (STRING*)s); @@ -1608,7 +1614,7 @@ gc_gms_is_string_ptr(PARROT_INTERP, ARGIN_NULLOK(void *ptr)) if (POBJ2GEN(&item->str) > self->gen_to_collect) return 0; - if (Parrot_pa_is_owned(interp, self->strings[POBJ2GEN(obj)], item, item->ptr)) + if (Parrot_pa_is_owned(self->strings[POBJ2GEN(obj)], item, item->ptr)) return 1; return 0; @@ -1622,10 +1628,10 @@ size)> =item C -=item C -=item C Functions for allocating strings/buffers storage. @@ -1654,7 +1660,7 @@ gc_gms_reallocate_string_storage(PARROT_INTERP, ARGIN(STRING *str), size_t size) } static void -gc_gms_allocate_buffer_storage(PARROT_INTERP, ARGIN(Buffer *str), size_t size) +gc_gms_allocate_buffer_storage(PARROT_INTERP, ARGIN(Parrot_Buffer *str), size_t size) { ASSERT_ARGS(gc_gms_allocate_buffer_storage) MarkSweep_GC * const self = (MarkSweep_GC *)interp->gc_sys->gc_private; @@ -1664,7 +1670,7 @@ gc_gms_allocate_buffer_storage(PARROT_INTERP, ARGIN(Buffer *str), size_t size) } static void -gc_gms_reallocate_buffer_storage(PARROT_INTERP, ARGIN(Buffer *str), size_t size) +gc_gms_reallocate_buffer_storage(PARROT_INTERP, ARGIN(Parrot_Buffer *str), size_t size) { ASSERT_ARGS(gc_gms_reallocate_buffer_storage) MarkSweep_GC * const self = (MarkSweep_GC *)interp->gc_sys->gc_private; @@ -1695,7 +1701,7 @@ gc_gms_iterate_live_strings(PARROT_INTERP, for (i = 0; i < MAX_GENERATIONS; i++) { POINTER_ARRAY_ITER(self->strings[i], STRING *s = &((string_alloc_struct *)ptr)->str; - callback(interp, (Buffer *)s, data);); + callback(interp, (Parrot_Buffer *)s, data);); } } @@ -1738,7 +1744,6 @@ gc_gms_block_GC_mark(PARROT_INTERP) ASSERT_ARGS(gc_gms_block_GC_mark) MarkSweep_GC * const self = (MarkSweep_GC *)interp->gc_sys->gc_private; ++self->gc_mark_block_level; - Parrot_shared_gc_block(interp); } static void @@ -1746,10 +1751,8 @@ gc_gms_unblock_GC_mark(PARROT_INTERP) { ASSERT_ARGS(gc_gms_unblock_GC_mark) MarkSweep_GC * const self = (MarkSweep_GC *)interp->gc_sys->gc_private; - if (self->gc_mark_block_level) { + if (self->gc_mark_block_level) --self->gc_mark_block_level; - Parrot_shared_gc_unblock(interp); - } } static void @@ -1851,7 +1854,7 @@ static void * gc_gms_allocate_memory_chunk_zeroed(SHIM_INTERP, size_t size) { ASSERT_ARGS(gc_gms_allocate_memory_chunk_zeroed) - void * const ptr = calloc(1, (size_t)size); + void * const ptr = calloc(1, size); #ifdef DETAIL_MEMORY_DEBUG fprintf(stderr, "Allocated %i at %p\n", size, ptr); #endif @@ -1936,7 +1939,7 @@ gc_gms_write_barrier(PARROT_INTERP, ARGMOD(PMC *pmc)) return; Parrot_pa_remove(interp, self->objects[gen], item->ptr); - item->ptr = Parrot_pa_insert(interp, self->dirty_list, item); + item->ptr = Parrot_pa_insert(self->dirty_list, item); pmc->flags |= PObj_GC_on_dirty_list_FLAG; @@ -2275,7 +2278,7 @@ gc_gms_validate_objects(PARROT_INTERP) =item C -Calculate youngest genereation of PMC children. Used to remove items from +Calculate youngest generation of PMC children. Used to remove items from dirty_list. =cut diff --git a/src/gc/gc_inf.c b/src/gc/gc_inf.c index 2a4a2bf7a8..d93e7ee85e 100644 --- a/src/gc/gc_inf.c +++ b/src/gc/gc_inf.c @@ -42,14 +42,15 @@ PARROT_DOES_NOT_RETURN static void failed_allocation(unsigned int line, unsigned long size); static void gc_inf_allocate_buffer_storage(PARROT_INTERP, - ARGMOD(Buffer *buffer), + ARGMOD(Parrot_Buffer *buffer), size_t size) __attribute__nonnull__(2) FUNC_MODIFIES(*buffer); PARROT_MALLOC PARROT_CAN_RETURN_NULL -static Buffer* gc_inf_allocate_bufferlike_header(PARROT_INTERP, size_t size); +static Parrot_Buffer* gc_inf_allocate_bufferlike_header(PARROT_INTERP, + size_t size); PARROT_CAN_RETURN_NULL static void* gc_inf_allocate_fixed_size_storage(PARROT_INTERP, size_t size); @@ -85,7 +86,7 @@ static void gc_inf_allocate_string_storage(PARROT_INTERP, static void gc_inf_compact_memory_pool(PARROT_INTERP); static void gc_inf_free_bufferlike_header(PARROT_INTERP, - ARGFREE(Buffer *b), + ARGFREE(Parrot_Buffer *b), size_t size); static void gc_inf_free_fixed_size_storage(PARROT_INTERP, @@ -104,7 +105,7 @@ static size_t gc_inf_get_gc_info(PARROT_INTERP, Interpinfo_enum what); static void gc_inf_mark_and_sweep(PARROT_INTERP, UINTVAL flags); static void gc_inf_reallocate_buffer_storage(PARROT_INTERP, - ARGMOD(Buffer *buffer), + ARGMOD(Parrot_Buffer *buffer), size_t size) __attribute__nonnull__(2) FUNC_MODIFIES(*buffer); @@ -227,12 +228,12 @@ flags)> =item C -=item C - -=item C +=item C + =item C =item C @@ -243,11 +244,11 @@ size_t size)> =item C -=item C -=item C +=item C =item C @@ -295,15 +296,15 @@ gc_inf_free_string_header(SHIM_INTERP, ARGFREE(STRING *s)) PARROT_MALLOC PARROT_CAN_RETURN_NULL -static Buffer* +static Parrot_Buffer* gc_inf_allocate_bufferlike_header(SHIM_INTERP, SHIM(size_t size)) { ASSERT_ARGS(gc_inf_allocate_bufferlike_header) - return (Buffer*)calloc(sizeof (Buffer), 1); + return (Parrot_Buffer*)calloc(sizeof (Parrot_Buffer), 1); } static void -gc_inf_free_bufferlike_header(SHIM_INTERP, ARGFREE(Buffer *b), SHIM(size_t size)) +gc_inf_free_bufferlike_header(SHIM_INTERP, ARGFREE(Parrot_Buffer *b), SHIM(size_t size)) { ASSERT_ARGS(gc_inf_free_bufferlike_header) if (b) @@ -359,7 +360,7 @@ gc_inf_reallocate_string_storage(SHIM_INTERP, ARGMOD(STRING *str), size_t size) static void -gc_inf_allocate_buffer_storage(SHIM_INTERP, ARGMOD(Buffer *buffer), size_t size) +gc_inf_allocate_buffer_storage(SHIM_INTERP, ARGMOD(Parrot_Buffer *buffer), size_t size) { ASSERT_ARGS(gc_inf_allocate_buffer_storage) char *mem; @@ -377,7 +378,7 @@ gc_inf_allocate_buffer_storage(SHIM_INTERP, ARGMOD(Buffer *buffer), size_t size) } static void -gc_inf_reallocate_buffer_storage(SHIM_INTERP, ARGMOD(Buffer *buffer), size_t size) +gc_inf_reallocate_buffer_storage(SHIM_INTERP, ARGMOD(Parrot_Buffer *buffer), size_t size) { ASSERT_ARGS(gc_inf_reallocate_buffer_storage) char * const mem = (char *)mem_internal_realloc(Buffer_bufstart(buffer), size); diff --git a/src/gc/gc_ms.c b/src/gc/gc_ms.c index d821323e45..5f99a4030a 100644 --- a/src/gc/gc_ms.c +++ b/src/gc/gc_ms.c @@ -59,7 +59,8 @@ static void gc_ms_alloc_objects(PARROT_INTERP, PARROT_CANNOT_RETURN_NULL PARROT_WARN_UNUSED_RESULT -static Buffer * gc_ms_allocate_bufferlike_header(PARROT_INTERP, size_t size) +static Parrot_Buffer * gc_ms_allocate_bufferlike_header(PARROT_INTERP, + size_t size) __attribute__nonnull__(1); PARROT_MALLOC @@ -115,7 +116,7 @@ static void gc_ms_free_attributes_from_pool( FUNC_MODIFIES(*data); static void gc_ms_free_bufferlike_header(PARROT_INTERP, - ARGMOD(Buffer *obj), + ARGMOD(Parrot_Buffer *obj), size_t size) __attribute__nonnull__(1) __attribute__nonnull__(2) @@ -607,7 +608,6 @@ gc_ms_mark_and_sweep(PARROT_INTERP, UINTVAL flags) mem_pools->lazy_gc = flags & GC_lazy_FLAG; /* tell the threading system that we're doing GC mark */ - pt_gc_start_mark(interp); Parrot_gc_run_init(interp, mem_pools); /* Now go trace the PMCs. returning true means we did a complete trace. @@ -633,8 +633,6 @@ gc_ms_mark_and_sweep(PARROT_INTERP, UINTVAL flags) /* compact STRING pools to collect free headers and allocated buffers */ Parrot_gc_compact_memory_pool(interp); - pt_gc_stop_mark(interp); - /* Note it */ ++interp->gc_sys->stats.gc_mark_runs; @@ -672,11 +670,11 @@ size)> =item C -=item C +=item C -=item C +=item C Functions for allocating strings/buffers storage. @@ -700,7 +698,7 @@ gc_ms_reallocate_string_storage(PARROT_INTERP, ARGIN(STRING *str), size_t size) } void -gc_ms_allocate_buffer_storage(PARROT_INTERP, ARGIN(Buffer *str), size_t size) +gc_ms_allocate_buffer_storage(PARROT_INTERP, ARGIN(Parrot_Buffer *str), size_t size) { ASSERT_ARGS(gc_ms_allocate_buffer_storage) Memory_Pools * const mem_pools = (Memory_Pools *)interp->gc_sys->gc_private; @@ -708,7 +706,7 @@ gc_ms_allocate_buffer_storage(PARROT_INTERP, ARGIN(Buffer *str), size_t size) } void -gc_ms_reallocate_buffer_storage(PARROT_INTERP, ARGIN(Buffer *str), size_t size) +gc_ms_reallocate_buffer_storage(PARROT_INTERP, ARGIN(Parrot_Buffer *str), size_t size) { ASSERT_ARGS(gc_ms_reallocate_buffer_storage) Memory_Pools * const mem_pools = (Memory_Pools *)interp->gc_sys->gc_private; @@ -770,6 +768,7 @@ gc_ms_finalize_memory_pools(PARROT_INTERP, ARGIN(Memory_Pools * const mem_pools) /* 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_PMC_alive(interp, interp->scheduler); VTABLE_mark(interp, interp->scheduler); @@ -981,8 +980,8 @@ gc_ms_mark_str_header(SHIM_INTERP, ARGMOD_NULLOK(STRING *obj)) /* -=item C +=item C 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 @@ -995,7 +994,7 @@ to create ListChunk objects in src/list.c. PARROT_CANNOT_RETURN_NULL PARROT_WARN_UNUSED_RESULT -static Buffer * +static Parrot_Buffer * gc_ms_allocate_bufferlike_header(PARROT_INTERP, size_t size) { ASSERT_ARGS(gc_ms_allocate_bufferlike_header) @@ -1003,13 +1002,13 @@ gc_ms_allocate_bufferlike_header(PARROT_INTERP, size_t size) Memory_Pools * const mem_pools = (Memory_Pools *)interp->gc_sys->gc_private; Fixed_Size_Pool * const pool = get_bufferlike_pool(interp, mem_pools, size); - return (Buffer *)pool->get_free_object(interp, mem_pools, pool); + return (Parrot_Buffer *)pool->get_free_object(interp, mem_pools, pool); } /* -=item C +=item C Free a bufferlike header that is not being used, so that Parrot can recycle it and use it again. @@ -1019,7 +1018,7 @@ it and use it again. */ static void -gc_ms_free_bufferlike_header(PARROT_INTERP, ARGMOD(Buffer *obj), +gc_ms_free_bufferlike_header(PARROT_INTERP, ARGMOD(Parrot_Buffer *obj), size_t size) { ASSERT_ARGS(gc_ms_free_bufferlike_header) @@ -1257,7 +1256,7 @@ contained_in_attr_pool(ARGIN(const PMC_Attribute_Pool *pool), ARGIN(const void * =item C -Deallocates an attibutes structure from a PMC if it has the auto_attrs +Deallocates an attributes structure from a PMC if it has the auto_attrs flag set. */ @@ -1416,7 +1415,7 @@ static void * gc_ms_allocate_memory_chunk_zeroed(SHIM_INTERP, size_t size) { ASSERT_ARGS(gc_ms_allocate_memory_chunk_zeroed) - void * const ptr = calloc(1, (size_t)size); + void * const ptr = calloc(1, size); #ifdef DETAIL_MEMORY_DEBUG fprintf(stderr, "Allocated %i at %p\n", size, ptr); #endif @@ -1472,7 +1471,6 @@ gc_ms_trace_active_PMCs(PARROT_INTERP, Parrot_gc_trace_type trace) if (!Parrot_gc_trace_root(interp, mem_pools, trace)) return 0; - pt_gc_mark_root_finished(interp); mem_pools->gc_trace_ptr = NULL; return 1; @@ -1739,7 +1737,6 @@ gc_ms_block_GC_mark(PARROT_INTERP) ASSERT_ARGS(gc_ms_block_GC_mark) Memory_Pools * const mem_pools = (Memory_Pools *)interp->gc_sys->gc_private; ++mem_pools->gc_mark_block_level; - Parrot_shared_gc_block(interp); } static void @@ -1747,10 +1744,8 @@ gc_ms_unblock_GC_mark(PARROT_INTERP) { ASSERT_ARGS(gc_ms_unblock_GC_mark) Memory_Pools * const mem_pools = (Memory_Pools *)interp->gc_sys->gc_private; - if (mem_pools->gc_mark_block_level) { + if (mem_pools->gc_mark_block_level) --mem_pools->gc_mark_block_level; - Parrot_shared_gc_unblock(interp); - } } static void @@ -1934,7 +1929,7 @@ gc_ms_iterate_live_strings(PARROT_INTERP, Memory_Pools * const mem_pools = (Memory_Pools *)interp->gc_sys->gc_private; INTVAL j; - /* Run through all the Buffer header pools and invoke callback */ + /* Run through all the Parrot_Buffer header pools and invoke callback */ for (j = (INTVAL)mem_pools->num_sized - 1; j >= 0; --j) { Fixed_Size_Pool * const header_pool = mem_pools->sized_header_pools[j]; Fixed_Size_Arena * cur_buffer_arena; @@ -1948,7 +1943,7 @@ gc_ms_iterate_live_strings(PARROT_INTERP, for (cur_buffer_arena = header_pool->last_Arena; cur_buffer_arena; cur_buffer_arena = cur_buffer_arena->prev) { - Buffer *b = (Buffer *) cur_buffer_arena->start_objects; + Parrot_Buffer *b = (Parrot_Buffer *) cur_buffer_arena->start_objects; UINTVAL i; const size_t objects_end = cur_buffer_arena->used; @@ -1958,7 +1953,7 @@ gc_ms_iterate_live_strings(PARROT_INTERP, if (5 * (old_block->free + old_block->freed) >= old_block->size) callback(interp, b, data); } - b = (Buffer *)((char *)b + object_size); + b = (Parrot_Buffer *)((char *)b + object_size); } } } diff --git a/src/gc/gc_ms2.c b/src/gc/gc_ms2.c index 18366e48e8..03f1c5c33c 100644 --- a/src/gc/gc_ms2.c +++ b/src/gc/gc_ms2.c @@ -1,5 +1,5 @@ /* -Copyright (C) 2001-2011, Parrot Foundation. +Copyright (C) 2001-2012, Parrot Foundation. =head1 NAME @@ -79,11 +79,12 @@ static void failed_allocation(unsigned int line, unsigned long size); PARROT_MALLOC PARROT_CAN_RETURN_NULL -static Buffer* gc_ms2_allocate_buffer_header(PARROT_INTERP, size_t size) +static Parrot_Buffer* gc_ms2_allocate_buffer_header(PARROT_INTERP, + size_t size) __attribute__nonnull__(1); static void gc_ms2_allocate_buffer_storage(PARROT_INTERP, - ARGMOD(Buffer *str), + ARGMOD(Parrot_Buffer *str), size_t size) __attribute__nonnull__(1) __attribute__nonnull__(2) @@ -146,7 +147,7 @@ static void gc_ms2_finalize(PARROT_INTERP) __attribute__nonnull__(1); static void gc_ms2_free_buffer_header(PARROT_INTERP, - ARGFREE(Buffer *s), + ARGFREE(Parrot_Buffer *s), size_t size) __attribute__nonnull__(1); @@ -218,7 +219,7 @@ static void gc_ms2_pmc_needs_early_collection(PARROT_INTERP, PMC *pmc) __attribute__nonnull__(1); static void gc_ms2_reallocate_buffer_storage(PARROT_INTERP, - ARGMOD(Buffer *str), + ARGMOD(Parrot_Buffer *str), size_t size) __attribute__nonnull__(1) __attribute__nonnull__(2) @@ -433,11 +434,11 @@ size_t size)> =item C -=item C +=item C -=item C +=item C =item C @@ -631,7 +632,7 @@ Parrot_gc_ms2_init(PARROT_INTERP, ARGIN(Parrot_GC_Init_Args *args)) self = (MarkSweep_GC*)interp->parent_interpreter->gc_sys->gc_private; } else { - self = mem_allocate_zeroed_typed(MarkSweep_GC); + self = mem_internal_allocate_zeroed_typed(MarkSweep_GC); self->pmc_allocator = Parrot_gc_pool_new(interp, sizeof (pmc_alloc_struct)); @@ -705,7 +706,7 @@ gc_ms2_allocate_pmc_header(PARROT_INTERP, UINTVAL flags) interp->gc_sys->stats.memory_used += sizeof (PMC); ptr = (pmc_alloc_struct *)Parrot_gc_pool_allocate(interp, pool); - ptr->ptr = Parrot_pa_insert(interp, self->objects, ptr); + ptr->ptr = Parrot_pa_insert(self->objects, ptr); return &ptr->pmc; } @@ -759,7 +760,7 @@ gc_ms2_mark_pmc_header(PARROT_INTERP, ARGMOD(PMC *pmc)) if (!PObj_constant_TEST(pmc)) { Parrot_pa_remove(interp, self->objects, item->ptr); - item->ptr = Parrot_pa_insert(interp, self->new_objects, item); + item->ptr = Parrot_pa_insert(self->new_objects, item); } } @@ -789,11 +790,11 @@ gc_ms2_is_pmc_ptr(PARROT_INTERP, ARGIN_NULLOK(void *ptr)) =item C -=item C +=item C -=item C +=item C Allocate/free string/buffer headers. @@ -814,7 +815,7 @@ gc_ms2_allocate_string_header(PARROT_INTERP, UINTVAL flags) interp->gc_sys->stats.memory_used += sizeof (STRING); ptr = (string_alloc_struct *)Parrot_gc_pool_allocate(interp, pool); - ptr->ptr = Parrot_pa_insert(interp, self->strings, ptr); + ptr->ptr = Parrot_pa_insert(self->strings, ptr); ret = &ptr->str; memset(ret, 0, sizeof (STRING)); @@ -834,7 +835,7 @@ gc_ms2_free_string_header(PARROT_INTERP, ARGFREE(STRING *s)) if (Buffer_bufstart(s) && !PObj_external_TEST(s)) Parrot_gc_str_free_buffer_storage(interp, - &self->string_gc, (Buffer *)s); + &self->string_gc, (Parrot_Buffer *)s); PObj_on_free_list_SET(s); @@ -848,16 +849,16 @@ gc_ms2_free_string_header(PARROT_INTERP, ARGFREE(STRING *s)) PARROT_MALLOC PARROT_CAN_RETURN_NULL -static Buffer* +static Parrot_Buffer* gc_ms2_allocate_buffer_header(PARROT_INTERP, SHIM(size_t size)) { ASSERT_ARGS(gc_ms2_allocate_buffer_header) - return (Buffer *)gc_ms2_allocate_string_header(interp, 0); + return (Parrot_Buffer *)gc_ms2_allocate_string_header(interp, 0); } static void -gc_ms2_free_buffer_header(PARROT_INTERP, ARGFREE(Buffer *s), SHIM(size_t size)) +gc_ms2_free_buffer_header(PARROT_INTERP, ARGFREE(Parrot_Buffer *s), SHIM(size_t size)) { ASSERT_ARGS(gc_ms2_free_buffer_header) gc_ms2_free_string_header(interp, (STRING*)s); @@ -891,10 +892,10 @@ size)> =item C -=item C -=item C Functions for allocating strings/buffers storage. @@ -922,7 +923,7 @@ gc_ms2_reallocate_string_storage(PARROT_INTERP, ARGMOD(STRING *str), size_t size static void -gc_ms2_allocate_buffer_storage(PARROT_INTERP, ARGMOD(Buffer *str), size_t size) +gc_ms2_allocate_buffer_storage(PARROT_INTERP, ARGMOD(Parrot_Buffer *str), size_t size) { ASSERT_ARGS(gc_ms2_allocate_buffer_storage) MarkSweep_GC * const self = (MarkSweep_GC *)interp->gc_sys->gc_private; @@ -931,7 +932,7 @@ gc_ms2_allocate_buffer_storage(PARROT_INTERP, ARGMOD(Buffer *str), size_t size) static void -gc_ms2_reallocate_buffer_storage(PARROT_INTERP, ARGMOD(Buffer *str), size_t size) +gc_ms2_reallocate_buffer_storage(PARROT_INTERP, ARGMOD(Parrot_Buffer *str), size_t size) { ASSERT_ARGS(gc_ms2_reallocate_buffer_storage) MarkSweep_GC * const self = (MarkSweep_GC *)interp->gc_sys->gc_private; @@ -981,7 +982,7 @@ gc_ms2_iterate_live_strings(PARROT_INTERP, POINTER_ARRAY_ITER(self->strings, STRING * const s = &((string_alloc_struct *)ptr)->str; - callback(interp, (Buffer *)s, data);); + callback(interp, (Parrot_Buffer *)s, data);); } @@ -1228,7 +1229,7 @@ gc_ms2_sweep_string_pool(PARROT_INTERP, else if (!PObj_constant_TEST(obj)) { Parrot_pa_remove(interp, list, STR2PAC(obj)->ptr); if (Buffer_bufstart(obj) && !PObj_external_TEST(obj)) - Parrot_gc_str_free_buffer_storage(interp, &self->string_gc, (Buffer*)obj); + Parrot_gc_str_free_buffer_storage(interp, &self->string_gc, (Parrot_Buffer*)obj); interp->gc_sys->stats.memory_used -= sizeof (STRING); @@ -1271,7 +1272,7 @@ gc_ms2_is_ptr_owned(PARROT_INTERP, return 0; /* Pool.is_owned isn't precise enough (yet) */ - return Parrot_pa_is_owned(interp, list, item, item->ptr); + return Parrot_pa_is_owned(list, item, item->ptr); } @@ -1311,7 +1312,6 @@ gc_ms2_block_GC_mark(PARROT_INTERP) ASSERT_ARGS(gc_ms2_block_GC_mark) MarkSweep_GC * const self = (MarkSweep_GC *)interp->gc_sys->gc_private; ++self->gc_mark_block_level; - Parrot_shared_gc_block(interp); } @@ -1320,10 +1320,8 @@ gc_ms2_unblock_GC_mark(PARROT_INTERP) { ASSERT_ARGS(gc_ms2_unblock_GC_mark) MarkSweep_GC * const self = (MarkSweep_GC *)interp->gc_sys->gc_private; - if (self->gc_mark_block_level) { + if (self->gc_mark_block_level) --self->gc_mark_block_level; - Parrot_shared_gc_unblock(interp); - } } diff --git a/src/gc/gc_private.h b/src/gc/gc_private.h index 9dd9a8b19c..f302809395 100644 --- a/src/gc/gc_private.h +++ b/src/gc/gc_private.h @@ -1,5 +1,5 @@ /* -Copyright (C) 2001-2010, Parrot Foundation. +Copyright (C) 2001-2011, Parrot Foundation. =head1 NAME @@ -44,18 +44,18 @@ extern void *flush_reg_store(void); /* 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 GC_SIZE_THRESHOLD 1024 * 1024 +#define POOL_MAX_BYTES (65536 * 128) +#define GC_SIZE_THRESHOLD (1024 * 1024) #define GC_DEFAULT_DYNAMIC_THRESHOLD 75 -#define GC_DEFAULT_MIN_THRESHOLD 4 * 1024 * 1024 +#define GC_DEFAULT_MIN_THRESHOLD (4 * 1024 * 1024) /* promills of system memory */ #define GC_DEFAULT_NURSERY_SIZE 2 -#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 PMC_HEADERS_PER_ALLOC (4096 * 10 / sizeof (PMC)) +#define BUFFER_HEADERS_PER_ALLOC (4096 / sizeof (Parrot_Buffer)) +#define STRING_HEADERS_PER_ALLOC (4096 * 20 / sizeof (STRING)) -#define CONSTANT_PMC_HEADERS_PER_ALLOC 4096 / sizeof (PMC) +#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 @@ -123,8 +123,8 @@ typedef struct GC_Statistics { } GC_Statistics; -/* Callback for live string. Use Buffer for now... */ -typedef void (*string_iterator_callback)(PARROT_INTERP, Buffer *str, void *data); +/* Callback for live string. Use Parrot_Buffer for now... */ +typedef void (*string_iterator_callback)(PARROT_INTERP, Parrot_Buffer *str, void *data); typedef struct GC_Subsystem { /* Which GC subsystem are we using? See PARROT_GC_DEFAULT_TYPE in @@ -149,8 +149,8 @@ typedef struct GC_Subsystem { STRING* (*allocate_string_header)(PARROT_INTERP, UINTVAL flags); void (*free_string_header)(PARROT_INTERP, ARGFREE(STRING *)); - Buffer* (*allocate_bufferlike_header)(PARROT_INTERP, size_t size); - void (*free_bufferlike_header)(PARROT_INTERP, ARGFREE(Buffer *), size_t size); + Parrot_Buffer* (*allocate_bufferlike_header)(PARROT_INTERP, size_t size); + void (*free_bufferlike_header)(PARROT_INTERP, ARGFREE(Parrot_Buffer *), size_t size); int (*is_pmc_ptr)(PARROT_INTERP, ARGIN_NULLOK(void *)); int (*is_string_ptr)(PARROT_INTERP, ARGIN_NULLOK(void *)); @@ -163,8 +163,8 @@ typedef struct GC_Subsystem { void (*allocate_string_storage)(PARROT_INTERP, ARGMOD(STRING *str), size_t size); void (*reallocate_string_storage)(PARROT_INTERP, ARGMOD(STRING *str), size_t size); - void (*allocate_buffer_storage)(PARROT_INTERP, ARGMOD(Buffer *buffer), size_t nsize); - void (*reallocate_buffer_storage)(PARROT_INTERP, ARGMOD(Buffer *buffer), size_t newsize); + void (*allocate_buffer_storage)(PARROT_INTERP, ARGMOD(Parrot_Buffer *buffer), size_t nsize); + void (*reallocate_buffer_storage)(PARROT_INTERP, ARGMOD(Parrot_Buffer *buffer), size_t newsize); void* (*allocate_fixed_size_storage)(PARROT_INTERP, size_t size); void (*free_fixed_size_storage)(PARROT_INTERP, size_t size, ARGFREE(void *)); @@ -478,7 +478,7 @@ int Parrot_gc_trace_root(PARROT_INTERP, /* Don't modify between HEADERIZER BEGIN / HEADERIZER END. Your changes will be lost. */ void check_buffer_ptr( - ARGMOD(Buffer * pobj), + ARGMOD(Parrot_Buffer * pobj), ARGMOD(Variable_Size_Pool * pool)) __attribute__nonnull__(1) __attribute__nonnull__(2) @@ -531,7 +531,7 @@ void Parrot_gc_merge_memory_pools( /* Don't modify between HEADERIZER BEGIN / HEADERIZER END. Your changes will be lost. */ void gc_ms_allocate_buffer_storage(PARROT_INTERP, - ARGIN(Buffer *str), + ARGIN(Parrot_Buffer *str), size_t size) __attribute__nonnull__(1) __attribute__nonnull__(2); @@ -570,7 +570,7 @@ void gc_ms_pmc_needs_early_collection(PARROT_INTERP, ARGMOD(PMC *pmc)) FUNC_MODIFIES(*pmc); void gc_ms_reallocate_buffer_storage(PARROT_INTERP, - ARGIN(Buffer *str), + ARGIN(Parrot_Buffer *str), size_t size) __attribute__nonnull__(1) __attribute__nonnull__(2); @@ -696,7 +696,7 @@ int pobj2gen(ARGIN(PObj *pmc)) void Parrot_gc_str_allocate_buffer_storage(PARROT_INTERP, ARGIN(String_GC *gc), - ARGOUT(Buffer *buffer), + ARGOUT(Parrot_Buffer *buffer), size_t size) __attribute__nonnull__(1) __attribute__nonnull__(2) @@ -722,7 +722,7 @@ void Parrot_gc_str_finalize(PARROT_INTERP, ARGMOD(String_GC *gc)) void Parrot_gc_str_free_buffer_storage(PARROT_INTERP, ARGIN(String_GC *gc), - ARGMOD(Buffer *b)) + ARGMOD(Parrot_Buffer *b)) __attribute__nonnull__(2) __attribute__nonnull__(3) FUNC_MODIFIES(*b); @@ -734,7 +734,7 @@ void Parrot_gc_str_initialize(PARROT_INTERP, ARGMOD(String_GC *gc)) void Parrot_gc_str_reallocate_buffer_storage(PARROT_INTERP, ARGIN(String_GC *gc), - ARGMOD(Buffer *buffer), + ARGMOD(Parrot_Buffer *buffer), size_t newsize) __attribute__nonnull__(1) __attribute__nonnull__(2) diff --git a/src/gc/malloc.c b/src/gc/malloc.c index 2fd8edc7e4..3d87b617b8 100644 --- a/src/gc/malloc.c +++ b/src/gc/malloc.c @@ -145,7 +145,7 @@ you would be far better off obtaining ptmalloc, which is derived from a version of this malloc, and is well-tuned for concurrent programs. (See http://www.malloc.de) Note that - even when USE_MALLOC_LOCK is defined, you can can guarantee + even when USE_MALLOC_LOCK is defined, you can guarantee full thread-safety only if no threads acquire memory through direct calls to MORECORE or other system-level allocators. @@ -376,7 +376,7 @@ extern "C" { #endif /* - The unsigned integer type used to hold addresses when they are are + The unsigned integer type used to hold addresses when they are manipulated as integers. Except that it is not defined on all systems, intptr_t would suffice. */ @@ -833,7 +833,7 @@ extern Void_t* sbrk(); The main declaration needed is the mallinfo struct that is returned (by-copy) by mallinfo(). The SVID/XPG malloinfo struct contains a bunch of fields that are not even meaningful in this version of - malloc. These fields are are instead filled by mallinfo() with + malloc. These fields are instead filled by mallinfo() with other numbers that might be of interest. HAVE_USR_INCLUDE_MALLOC_H should be set if you have a @@ -2273,7 +2273,7 @@ static int largebin_index(unsigned int sz) { To help compensate for the large number of bins, a one-level index structure is used for bin-by-bin searching. `binmap' is a bitvector recording whether bins are definitely empty so they can - be skipped over during during traversals. The bits are NOT always + be skipped over during traversals. The bits are NOT always cleared as soon as bins are empty, but instead only when they are noticed to be empty during traversal in malloc. */ @@ -2719,7 +2719,7 @@ static void do_check_malloced_chunk(p, s) mchunkptr p; INTERNAL_SIZE_T s; always true of any allocated chunk; i.e., that each allocated chunk borders either a previously allocated and still in-use chunk, or the base of its memory arena. This is ensured - by making all allocations from the the `lowest' part of any found + by making all allocations from the `lowest' part of any found chunk. This does not necessarily hold however for chunks recycled via fastbins. */ diff --git a/src/gc/mark_sweep.c b/src/gc/mark_sweep.c index 59b1bd9f15..bf20c5b600 100644 --- a/src/gc/mark_sweep.c +++ b/src/gc/mark_sweep.c @@ -33,7 +33,7 @@ throughout the rest of Parrot. static void free_buffer(PARROT_INTERP, ARGMOD(Memory_Pools *mem_pools), Fixed_Size_Pool *pool, - ARGMOD(Buffer *b)) + ARGMOD(Parrot_Buffer *b)) __attribute__nonnull__(1) __attribute__nonnull__(2) __attribute__nonnull__(4) @@ -50,6 +50,9 @@ static void free_pmc_in_pool(PARROT_INTERP, FUNC_MODIFIES(*mem_pools) FUNC_MODIFIES(*p); +static void mark_code_segment(PARROT_INTERP) + __attribute__nonnull__(1); + static void mark_interp(PARROT_INTERP) __attribute__nonnull__(1); @@ -87,6 +90,8 @@ static Fixed_Size_Pool * new_string_pool(PARROT_INTERP, PARROT_ASSERT_ARG(interp) \ , PARROT_ASSERT_ARG(mem_pools) \ , PARROT_ASSERT_ARG(p)) +#define ASSERT_ARGS_mark_code_segment __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ + PARROT_ASSERT_ARG(interp)) #define ASSERT_ARGS_mark_interp __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ PARROT_ASSERT_ARG(interp)) #define ASSERT_ARGS_new_bufferlike_pool __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ @@ -164,7 +169,6 @@ Parrot_gc_trace_root(PARROT_INTERP, ASSERT_ARGS(Parrot_gc_trace_root) /* note: adding locals here did cause increased GC runs */ - Parrot_sub_mark_context_start(); if (trace == GC_TRACE_SYSTEM_ONLY) { trace_system_areas(interp, mem_pools); @@ -209,16 +213,14 @@ static void mark_interp(PARROT_INTERP) { ASSERT_ARGS(mark_interp) - PObj *obj; /* mark the list of 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_PMC_alive(interp, (PMC *)obj); + Parrot_gc_mark_PMC_alive(interp, interp->current_cont); /* mark the current context. */ + Parrot_gc_mark_PMC_alive(interp, interp->cur_task); Parrot_gc_mark_PMC_alive(interp, CURRENT_CONTEXT(interp)); /* mark the vtables: the data, Class PMCs, etc. */ @@ -227,12 +229,9 @@ mark_interp(PARROT_INTERP) /* mark the root_namespace */ Parrot_gc_mark_PMC_alive(interp, interp->root_namespace); - /* mark the concurrency scheduler */ + /* mark the concurrency scheduler and tasks */ Parrot_gc_mark_PMC_alive(interp, interp->scheduler); - /* s. packfile.c */ - Parrot_gc_mark_PMC_alive(interp, interp->current_pf); - /* mark caches and freelists */ mark_object_cache(interp); @@ -242,6 +241,7 @@ mark_interp(PARROT_INTERP) /* Now mark the HLL stuff */ Parrot_gc_mark_PMC_alive(interp, interp->HLL_info); Parrot_gc_mark_PMC_alive(interp, interp->HLL_namespace); + Parrot_gc_mark_PMC_alive(interp, interp->HLL_entries); /* Mark the registry */ PARROT_ASSERT(interp->gc_registry); @@ -259,8 +259,39 @@ mark_interp(PARROT_INTERP) if (interp->parent_interpreter) mark_interp(interp->parent_interpreter); + + mark_code_segment(interp); } +/* + +=item C + +Mark constants inside code segment. + +=cut + +*/ + +static void +mark_code_segment(PARROT_INTERP) +{ + ASSERT_ARGS(mark_code_segment) + int i; + PackFile_ByteCode *bc = Parrot_pf_get_current_code_segment(interp); + + if (bc != NULL) { + PackFile_ConstTable *ct = bc->const_table; + + for (i = 0; i < ct->pmc.const_count; i++) { + Parrot_gc_mark_PMC_alive(interp, ct->pmc.constants[i]); + } + + for (i = 0; i < ct->str.const_count; i++) { + Parrot_gc_mark_STRING_alive(interp, ct->str.constants[i]); + } + } +} /* @@ -307,26 +338,11 @@ Parrot_gc_sweep_pool(PARROT_INTERP, else if (!PObj_on_free_list_TEST(b)) { /* it must be dead */ - - if (PObj_is_shared_TEST(b)) { - /* only mess with shared objects if we - * (and thus everyone) is suspended for - * a GC run. - * XXX wrong thing to do with "other" GCs - */ - if (!(interp->thread_data - && (interp->thread_data->state & THREAD_STATE_SUSPENDED_GC))) { - ++total_used; - goto next; - } - } - if (gc_object) gc_object(interp, mem_pools, pool, b); add_free_object(interp, mem_pools, pool, b); } -next: b = (PObj *)((char *)b + object_size); } } @@ -417,12 +433,12 @@ Parrot_gc_clear_live_bits(SHIM_INTERP, ARGIN(const Fixed_Size_Pool *pool)) const UINTVAL object_size = pool->object_size; for (arena = pool->last_Arena; arena; arena = arena->prev) { - Buffer *b = (Buffer *)arena->start_objects; + Parrot_Buffer *b = (Parrot_Buffer *)arena->start_objects; UINTVAL i; for (i = 0; i < arena->used; ++i) { PObj_live_CLEAR(b); - b = (Buffer *)((char *)b + object_size); + b = (Parrot_Buffer *)((char *)b + object_size); } } } @@ -445,11 +461,10 @@ Parrot_add_to_free_list(SHIM_INTERP, ARGMOD(Fixed_Size_Arena *arena)) { ASSERT_ARGS(Parrot_add_to_free_list) - void *object; const UINTVAL num_objects = pool->objects_per_alloc; + void * const object = arena->start_objects; pool->total_objects += num_objects; - object = (void *)arena->start_objects; /* Don't move anything onto the free list. Set the pointers and do it lazily when we allocate. */ { @@ -661,7 +676,7 @@ new_string_pool(PARROT_INTERP, ARGMOD(Memory_Pools *mem_pools), INTVAL constant) /* =item C +Fixed_Size_Pool *pool, Parrot_Buffer *b)> Frees a buffer, returning it to the memory pool for Parrot to possibly reuse later. @@ -672,7 +687,7 @@ reuse later. static void free_buffer(PARROT_INTERP, ARGMOD(Memory_Pools *mem_pools), - SHIM(Fixed_Size_Pool *pool), ARGMOD(Buffer *b)) + SHIM(Fixed_Size_Pool *pool), ARGMOD(Parrot_Buffer *b)) { ASSERT_ARGS(free_buffer) diff --git a/src/gc/string_gc.c b/src/gc/string_gc.c index 0be0fd528d..07c1b6404d 100644 --- a/src/gc/string_gc.c +++ b/src/gc/string_gc.c @@ -38,7 +38,9 @@ typedef void (*compact_f) (Interp *, GC_Statistics *stats, Variable_Size_Pool *) PARROT_CANNOT_RETURN_NULL PARROT_WARN_UNUSED_RESULT -static char * aligned_mem(ARGIN(const Buffer *buffer), ARGIN(char *mem)) +static char * aligned_mem( + ARGIN(const Parrot_Buffer *buffer), + ARGIN(char *mem)) __attribute__nonnull__(1) __attribute__nonnull__(2); @@ -55,7 +57,8 @@ static void alloc_new_block( PARROT_CANNOT_RETURN_NULL PARROT_WARN_UNUSED_RESULT -static const char * buffer_location(PARROT_INTERP, ARGIN(const Buffer *b)) +static const char * buffer_location(PARROT_INTERP, + ARGIN(const Parrot_Buffer *b)) __attribute__nonnull__(1) __attribute__nonnull__(2); @@ -68,7 +71,7 @@ static void compact_pool(PARROT_INTERP, FUNC_MODIFIES(*stats) FUNC_MODIFIES(*pool); -static void debug_print_buf(PARROT_INTERP, ARGIN(const Buffer *b)) +static void debug_print_buf(PARROT_INTERP, ARGIN(const Parrot_Buffer *b)) __attribute__nonnull__(1) __attribute__nonnull__(2); @@ -101,7 +104,7 @@ static void * mem_allocate(PARROT_INTERP, FUNC_MODIFIES(*pool); static void move_buffer_callback(PARROT_INTERP, - ARGIN(Buffer *b), + ARGIN(Parrot_Buffer *b), ARGIN(void *data)) __attribute__nonnull__(1) __attribute__nonnull__(2) @@ -109,7 +112,7 @@ static void move_buffer_callback(PARROT_INTERP, static void move_one_buffer(PARROT_INTERP, ARGIN(Memory_Block *pool), - ARGMOD(Buffer *old_buf)) + ARGMOD(Parrot_Buffer *old_buf)) __attribute__nonnull__(1) __attribute__nonnull__(2) __attribute__nonnull__(3) @@ -218,9 +221,9 @@ Parrot_gc_str_finalize(SHIM_INTERP, ARGMOD(String_GC *gc)) /* =item C +Parrot_Buffer *buffer, size_t size)> -Allocates a chunk of memory of at least size C for the given Buffer. +Allocates a chunk of memory of at least size C for the given Parrot_Buffer. buffer is guaranteed to be properly aligned for things like C, so the size may be rounded up or down to guarantee that this alignment holds. @@ -231,7 +234,7 @@ so the size may be rounded up or down to guarantee that this alignment holds. void Parrot_gc_str_allocate_buffer_storage(PARROT_INTERP, ARGIN(String_GC *gc), - ARGOUT(Buffer *buffer), + ARGOUT(Parrot_Buffer *buffer), size_t size) { ASSERT_ARGS(Parrot_gc_str_allocate_buffer_storage) @@ -252,9 +255,9 @@ Parrot_gc_str_allocate_buffer_storage(PARROT_INTERP, /* =item C +*gc, Parrot_Buffer *buffer, size_t newsize)> -Reallocate the Buffer's buffer memory to the given size. The +Reallocate the Parrot_Buffer's buffer memory to the given size. The allocated buffer will not shrink. If the buffer was allocated with L the new buffer will also be aligned. As with all reallocation, the new buffer might have moved and the additional @@ -267,7 +270,7 @@ memory is not cleared. void Parrot_gc_str_reallocate_buffer_storage(PARROT_INTERP, ARGIN(String_GC *gc), - ARGMOD(Buffer *buffer), + ARGMOD(Parrot_Buffer *buffer), size_t newsize) { ASSERT_ARGS(Parrot_gc_str_reallocate_buffer_storage) @@ -445,7 +448,7 @@ Parrot_gc_str_compact_pool(PARROT_INTERP, ARGIN(String_GC *gc)) /* =item C +Parrot_Buffer *b)> Frees a buffer, returning it to the memory pool for Parrot to possibly reuse later. @@ -457,7 +460,7 @@ reuse later. void Parrot_gc_str_free_buffer_storage(SHIM_INTERP, ARGIN(String_GC *gc), - ARGMOD(Buffer *b)) + ARGMOD(Parrot_Buffer *b)) { ASSERT_ARGS(Parrot_gc_str_free_buffer_storage) Variable_Size_Pool * const mem_pool = gc->memory_pool; @@ -654,9 +657,9 @@ mem_allocate(PARROT_INTERP, /* -=item C +=item C -Returns a pointer to the aligned allocated storage for Buffer C, +Returns a pointer to the aligned allocated storage for Parrot_Buffer C, which might not be the same as the pointer to C because of memory alignment. @@ -667,21 +670,23 @@ memory alignment. PARROT_CANNOT_RETURN_NULL PARROT_WARN_UNUSED_RESULT static char * -aligned_mem(ARGIN(SHIM(const Buffer *buffer)), ARGIN(char *mem)) +aligned_mem(ARGIN(SHIM(const Parrot_Buffer *buffer)), ARGIN(char *mem)) { ASSERT_ARGS(aligned_mem) mem += sizeof (void *); - mem = (char *)(((unsigned long)(mem + WORD_ALIGN_1)) & WORD_ALIGN_MASK); + /* FIXME: issue #378 */ + mem = (char *)(((UINTVAL)(mem + WORD_ALIGN_1)) & WORD_ALIGN_MASK); return mem; } /* -=item C +=item C Returns a constant string representing the location of the given -Buffer C in one of the PMC registers. If the PMC is not located +Parrot_Buffer C in one of the PMC registers. If the PMC is not located in one of the PMC registers of the current context, returns the string C<"???">. @@ -693,7 +698,7 @@ string C<"???">. PARROT_CANNOT_RETURN_NULL PARROT_WARN_UNUSED_RESULT static const char * -buffer_location(PARROT_INTERP, ARGIN(const Buffer *b)) +buffer_location(PARROT_INTERP, ARGIN(const Parrot_Buffer *b)) { ASSERT_ARGS(buffer_location) Parrot_Context * const ctx = CONTEXT(interp); @@ -713,7 +718,7 @@ buffer_location(PARROT_INTERP, ARGIN(const Buffer *b)) /* -=item C +=item C Prints a debug statement with information about the given PObj C. =cut @@ -721,7 +726,7 @@ Prints a debug statement with information about the given PObj C. */ static void -debug_print_buf(PARROT_INTERP, ARGIN(const Buffer *b)) +debug_print_buf(PARROT_INTERP, ARGIN(const Parrot_Buffer *b)) { ASSERT_ARGS(debug_print_buf) fprintf(stderr, "found %p, len %d, flags 0x%08x at %s\n", @@ -778,7 +783,7 @@ compact_pool(PARROT_INTERP, alloc_new_block(stats, total_size, pool, "inside compact"); new_block = pool->top_block; - /* Run through all the Buffer header pools and copy */ + /* Run through all the Parrot_Buffer header pools and copy */ interp->gc_sys->iterate_live_strings(interp, move_buffer_callback, new_block); new_size = new_block->top - new_block->start; @@ -797,14 +802,15 @@ compact_pool(PARROT_INTERP, } /* -=item C +=item C Callback for live STRING/Buffer for compating. =cut */ static void -move_buffer_callback(PARROT_INTERP, ARGIN(Buffer *b), ARGIN(void *data)) +move_buffer_callback(PARROT_INTERP, ARGIN(Parrot_Buffer *b), ARGIN(void *data)) { ASSERT_ARGS(move_buffer_callback) Memory_Block * const new_block = (Memory_Block *)data; @@ -890,8 +896,8 @@ pad_pool_size(ARGIN(const Variable_Size_Pool *pool)) /* -=item C +=item C The compact_pool operation collects disjointed blocks of memory allocated on a given pool's free list into one large block of memory. Once the new larger @@ -904,7 +910,7 @@ memory block to the new memory block and marks that it has been moved. static void move_one_buffer(PARROT_INTERP, ARGIN(Memory_Block *pool), - ARGMOD(Buffer *old_buf)) + ARGMOD(Parrot_Buffer *old_buf)) { ASSERT_ARGS(move_one_buffer) @@ -932,7 +938,7 @@ move_one_buffer(PARROT_INTERP, ARGIN(Memory_Block *pool), if (flags && (*flags & Buffer_shared_FLAG) && (*flags & Buffer_moved_FLAG)) { /* Find out who else references our data */ - Buffer * const hdr = *((Buffer **)Buffer_bufstart(old_buf)); + Parrot_Buffer * const hdr = *((Parrot_Buffer **)Buffer_bufstart(old_buf)); PARROT_ASSERT(PObj_is_COWable_TEST(old_buf)); @@ -954,7 +960,7 @@ move_one_buffer(PARROT_INTERP, ARGIN(Memory_Block *pool), PARROT_ASSERT(PObj_is_COWable_TEST(old_buf)); /* Let the old buffer know how to find us */ - *((Buffer **)Buffer_bufstart(old_buf)) = old_buf; + *((Parrot_Buffer **)Buffer_bufstart(old_buf)) = old_buf; /* Finally, let the tail know that we've moved, so * that any other references can know to look for diff --git a/src/gc/system.c b/src/gc/system.c index 4e6b8babfe..8e1a0f404d 100644 --- a/src/gc/system.c +++ b/src/gc/system.c @@ -57,6 +57,7 @@ static size_t get_min_pmc_address(PARROT_INTERP, ARGIN_NULLOK(const Memory_Pools *mem_pools)) __attribute__nonnull__(1); +PARROT_NO_ADDRESS_SAFETY_ANALYSIS static void trace_mem_block(PARROT_INTERP, ARGIN_NULLOK(const Memory_Pools *mem_pools), size_t lo_var_ptr, @@ -110,7 +111,7 @@ trace_system_areas(PARROT_INTERP, ARGIN_NULLOK(const Memory_Pools *mem_pools)) register windows. Store the code in a union with a double to ensure proper memory alignment. */ /* TT #271: This needs to be fixed in a variety of ways */ -/* Using inline assember if available instead of the hand-coded version. */ +/* Using inline assembler if available instead of the hand-coded version. */ # if defined(__GNUC__) && (defined(__sparcv9) || defined(__sparcv9__) || defined(__arch64__)) asm("flushw"); # else @@ -435,6 +436,7 @@ areas. */ +PARROT_NO_ADDRESS_SAFETY_ANALYSIS static void trace_mem_block(PARROT_INTERP, ARGIN_NULLOK(const Memory_Pools *mem_pools), diff --git a/src/global_setup.c b/src/global_setup.c index ca5f479422..6369d3e6b8 100644 --- a/src/global_setup.c +++ b/src/global_setup.c @@ -24,6 +24,7 @@ I #include "parrot/parrot.h" #include "parrot/oplib/core_ops.h" #include "global_setup.str" +#include "parrot/api.h" /* These functions are defined in the auto-generated file core_pmcs.c */ /* XXX Get it into some public place */ @@ -179,6 +180,9 @@ init_world(PARROT_INTERP) ASSERT_ARGS(init_world) PMC *iglobals, *self, *pmc; + /* Check assumptions about our config */ + PARROT_STATIC_ASSERT(sizeof (INTVAL) == sizeof (opcode_t)); + Parrot_platform_init_code(); /* Call base vtable class constructor methods */ @@ -214,10 +218,10 @@ init_world(PARROT_INTERP) pmc = Parrot_pmc_new(interp, enum_class_Hash); VTABLE_set_pointer(interp, pmc, Parrot_hash_create(interp, enum_type_PMC, Hash_key_type_PMC)); VTABLE_set_pmc_keyed_int(interp, iglobals, IGLOBALS_NCI_FUNCS, pmc); -#if PARROT_HAS_CORE_NCI_THUNKS +#ifdef PARROT_HAS_CORE_NCI_THUNKS Parrot_nci_load_core_thunks(interp); #endif -#if PARROT_HAS_EXTRA_NCI_THUNKS +#ifdef PARROT_HAS_EXTRA_NCI_THUNKS Parrot_nci_load_extra_thunks(interp); #endif #ifdef PARROT_HAS_LIBFFI @@ -248,7 +252,7 @@ Parrot_gbl_setup_2(PARROT_INTERP) interp->op_hash = interp->parent_interpreter->op_hash; } else { - op_lib_t *core_ops = PARROT_CORE_OPLIB_INIT(interp, 1); + op_lib_t * const core_ops = PARROT_CORE_OPLIB_INIT(interp, 1); interp->op_hash = Parrot_hash_create_sized(interp, enum_type_ptr, Hash_key_type_cstring, core_ops->op_count); parrot_hash_oplib(interp, core_ops); diff --git a/src/hash.c b/src/hash.c index 5ab48173cc..bfb50d4c99 100644 --- a/src/hash.c +++ b/src/hash.c @@ -59,22 +59,6 @@ static int hash_compare(PARROT_INTERP, __attribute__nonnull__(1) __attribute__nonnull__(2); -PARROT_WARN_UNUSED_RESULT -PARROT_PURE_FUNCTION -PARROT_INLINE -static int hash_compare_cstring(PARROT_INTERP, - ARGIN(const char *a), - ARGIN(const char *b)) - __attribute__nonnull__(2) - __attribute__nonnull__(3); - -PARROT_WARN_UNUSED_RESULT -PARROT_PURE_FUNCTION -PARROT_INLINE -static int hash_compare_int(PARROT_INTERP, - ARGIN_NULLOK(const void *a), - ARGIN_NULLOK(const void *b)); - PARROT_WARN_UNUSED_RESULT PARROT_PURE_FUNCTION PARROT_INLINE @@ -83,13 +67,6 @@ static int hash_compare_pmc(PARROT_INTERP, ARGIN(PMC *a), ARGIN(PMC *b)) __attribute__nonnull__(2) __attribute__nonnull__(3); -PARROT_WARN_UNUSED_RESULT -PARROT_PURE_FUNCTION -PARROT_INLINE -static int hash_compare_pointer(PARROT_INTERP, - ARGIN_NULLOK(const void *a), - ARGIN_NULLOK(const void *b)); - PARROT_WARN_UNUSED_RESULT PARROT_PURE_FUNCTION PARROT_INLINE @@ -165,15 +142,10 @@ static void parrot_mark_hash_values(PARROT_INTERP, ARGIN(Hash *hash)) #define ASSERT_ARGS_hash_compare __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ PARROT_ASSERT_ARG(interp) \ , PARROT_ASSERT_ARG(hash)) -#define ASSERT_ARGS_hash_compare_cstring __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ - PARROT_ASSERT_ARG(a) \ - , PARROT_ASSERT_ARG(b)) -#define ASSERT_ARGS_hash_compare_int __attribute__unused__ int _ASSERT_ARGS_CHECK = (0) #define ASSERT_ARGS_hash_compare_pmc __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ PARROT_ASSERT_ARG(interp) \ , PARROT_ASSERT_ARG(a) \ , PARROT_ASSERT_ARG(b)) -#define ASSERT_ARGS_hash_compare_pointer __attribute__unused__ int _ASSERT_ARGS_CHECK = (0) #define ASSERT_ARGS_hash_compare_string __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ PARROT_ASSERT_ARG(interp) \ , PARROT_ASSERT_ARG(search_key) \ @@ -233,6 +205,41 @@ Parrot_hash_buffer(ARGIN_NULLOK(const unsigned char *buf), size_t len, size_t ha /* +=item C + +A (weak) perfect hash over pointers. + +=cut + +*/ + +PARROT_WARN_UNUSED_RESULT +PARROT_PURE_FUNCTION +size_t +Parrot_hash_pointer(ARGIN_NULLOK(const void * const p), size_t hashval) +{ + ASSERT_ARGS(Parrot_hash_pointer) + const size_t x = (size_t)p; + hashval ^= x; + + { + unsigned char *c = (unsigned char *)&hashval; + unsigned int i; + for (i = 0; i < sizeof hashval; i++) { + /* swap bitsex of every byte */ + unsigned char tmp = 0; + unsigned int j; + for (j = 0; j < CHAR_BIT; j++) + tmp |= (0x1 & c[i] >> j) << (CHAR_BIT - j - 1); + c[i] = tmp; + } + } + + return hashval; +} + +/* + =item C @@ -300,28 +307,6 @@ hash_compare_string_enc(ARGIN(const void *search_key), ARGIN(const void *bucket_ } -/* - -=item C - -Compares the two pointers, returning 0 if they are identical - -=cut - -*/ - -PARROT_WARN_UNUSED_RESULT -PARROT_PURE_FUNCTION -PARROT_INLINE -static int -hash_compare_pointer(SHIM_INTERP, ARGIN_NULLOK(const void *a), ARGIN_NULLOK(const void *b)) -{ - ASSERT_ARGS(hash_compare_pointer) - return a != b; -} - - /* =item C - -Compares two C strings for equality, returning -1, 0, and 1 if the first string -is less than, equal to, or greater than the second, respectively. - -=cut - -*/ - -PARROT_WARN_UNUSED_RESULT -PARROT_PURE_FUNCTION -PARROT_INLINE -static int -hash_compare_cstring(SHIM_INTERP, ARGIN(const char *a), ARGIN(const char *b)) -{ - ASSERT_ARGS(hash_compare_cstring) - return strcmp(a, b); -} - - /* =item C @@ -408,28 +370,6 @@ hash_compare_pmc(PARROT_INTERP, ARGIN(PMC *a), ARGIN(PMC *b)) return !VTABLE_is_equal(interp, a, b); } -/* - -=item C - -Compares two integers for equality, returning -1, 0, and 1 if the first is less -than, equal to, or greater than the second, respectively. Uses void pointers -to store the integers, sadly. - -=cut - -*/ - -PARROT_WARN_UNUSED_RESULT -PARROT_PURE_FUNCTION -PARROT_INLINE -static int -hash_compare_int(SHIM_INTERP, ARGIN_NULLOK(const void *a), ARGIN_NULLOK(const void *b)) -{ - ASSERT_ARGS(hash_compare_int) - return a != b; -} /* @@ -937,9 +877,9 @@ expand_hash(PARROT_INTERP, ARGMOD(Hash *hash)) new_index = (HashBucket **)(new_buckets + N_BUCKETS(new_size)); /* copy buckets and index */ - mem_sys_memcopy(new_buckets, hash->buckets, + memcpy(new_buckets, hash->buckets, N_BUCKETS(old_size) * sizeof (HashBucket)); - mem_sys_memcopy(new_index, hash->index, old_size * sizeof (HashBucket *)); + memcpy(new_index, hash->index, old_size * sizeof (HashBucket *)); /* free */ if (old_size > SPLIT_POINT) @@ -1405,8 +1345,10 @@ parrot_hash_get_bucket_string(PARROT_INTERP, ARGIN(const Hash *hash), if ((STRING_byte_length(s) == STRING_byte_length(s2)) && (memcmp(s->strstart, s2->strstart, STRING_byte_length(s)) == 0)) break; - } else if (STRING_equal(interp, s, s2)) - break; + } + else if (STRING_equal(interp, s, s2)) { + break; + } } bucket = bucket->next; } @@ -1544,6 +1486,82 @@ Parrot_hash_delete(PARROT_INTERP, ARGMOD(Hash *hash), ARGIN_NULLOK(void *key)) } +/* + +=item C + +Copies all entries from the other hash into the hash, overwriting +entries with the same key. + +=cut + +*/ + +PARROT_EXPORT +void +Parrot_hash_update(PARROT_INTERP, ARGMOD(Hash *hash), ARGIN(Hash *other)) +{ + ASSERT_ARGS(Parrot_hash_update) + if (other->entries <= 0) + return; + if (hash->key_type == other->key_type && hash->entry_type == other->entry_type) { + if (hash->entries <= 0) { + /* presize hash */ + if (hash->buckets) { + if (hash->mask + 1 > SPLIT_POINT) + Parrot_gc_free_memory_chunk(interp, hash->buckets); + else + Parrot_gc_free_fixed_size_storage(interp, + HASH_ALLOC_SIZE(hash->mask + 1), hash->buckets); + } + allocate_buckets(interp, hash, other->mask); + } + parrot_hash_iterate(other, Parrot_hash_put(interp, hash, _bucket->key, _bucket->value);); + } + else { + parrot_hash_iterate(other, + void *key = _bucket->key; + void *value = _bucket->value; + if (hash->key_type != other->key_type) { + switch (hash->key_type) { + case Hash_key_type_int: + key = (void *)Parrot_hash_key_to_int(interp, other, key); + break; + case Hash_key_type_STRING: + case Hash_key_type_STRING_enc: + key = (void *)Parrot_hash_key_to_string(interp, other, key); + break; + case Hash_key_type_PMC: + case Hash_key_type_PMC_ptr: + key = (void *)Parrot_hash_key_to_pmc(interp, other, key); + break; + default: + Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_INVALID_OPERATION, + "unimplemented key type %i", (int)hash->key_type); + break; + } + } + if (hash->entry_type != other->entry_type) { + switch (hash->entry_type) { + case enum_hash_int: + value = (void *)Parrot_hash_value_to_int(interp, other, value); + break; + case enum_hash_string: + value = (void *)Parrot_hash_value_to_string(interp, other, value); + break; + case enum_hash_pmc: + value = (void *)Parrot_hash_value_to_pmc(interp, other, value); + break; + default: + Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_INVALID_OPERATION, + "unimplemented value type %i", (int)hash->entry_type); + break; + } + } + Parrot_hash_put(interp, hash, key, value);); + } +} + /* =item C @@ -1612,7 +1630,7 @@ Parrot_hash_clone_prunable(PARROT_INTERP, ARGIN(const Hash *hash), case enum_type_undef: case enum_type_ptr: case enum_type_INTVAL: - valtmp = (void *)_bucket->value; + valtmp = _bucket->value; break; default: @@ -2203,6 +2221,35 @@ Parrot_hash_value_to_number(PARROT_INTERP, ARGIN(const Hash *hash), ARGIN_NULLOK /* +=item C + +*/ + +void +Parrot_hash_flatten_hash_into( + PARROT_INTERP, ARGIN(PMC * const dest), ARGIN(PMC * const src), INTVAL overwrite) +{ + ASSERT_ARGS(Parrot_hash_flatten_hash_into) + const Hash * const src_hash = (Hash *)VTABLE_get_pointer(interp, src); + if (overwrite) { + parrot_hash_iterate(src_hash, + VTABLE_set_pmc_keyed_str(interp, dest, + (STRING *)_bucket->key, + Parrot_hash_value_to_pmc(interp, src_hash, _bucket->value));); + } + else { + parrot_hash_iterate(src_hash, + STRING * const key = (STRING *)_bucket->key; + if (!VTABLE_exists_keyed_str(interp, dest, key)) { + PMC * const value = Parrot_hash_value_to_pmc(interp, src_hash, _bucket->value); + VTABLE_set_pmc_keyed_str(interp, dest, key, value); + }); + } +} + +/* + =back =head1 SEE ALSO diff --git a/src/hll.c b/src/hll.c index aeccf2a64e..295827ea31 100644 --- a/src/hll.c +++ b/src/hll.c @@ -80,7 +80,7 @@ new_hll_entry(PARROT_INTERP, ARGIN(STRING *entry_name)) PMC *entry_id; - PMC * const entry = Parrot_pmc_new_constant_init_int(interp, + PMC * const entry = Parrot_pmc_new_init_int(interp, enum_class_FixedPMCArray, e_HLL_MAX); if (entry_name && !STRING_IS_EMPTY(entry_name)) { @@ -89,9 +89,11 @@ new_hll_entry(PARROT_INTERP, ARGIN(STRING *entry_name)) else VTABLE_push_pmc(interp, hll_info, entry); - entry_id = Parrot_pmc_new_constant_init_int(interp, enum_class_Integer, id); + entry_id = Parrot_pmc_new_init_int(interp, enum_class_Integer, id); VTABLE_set_pmc_keyed_int(interp, entry, e_HLL_id, entry_id); + VTABLE_push_pmc(interp, interp->HLL_entries, entry); + return entry; } @@ -114,7 +116,9 @@ Parrot_hll_init_HLL(PARROT_INTERP) interp->HLL_info = Parrot_pmc_new(interp, enum_class_OrderedHash); interp->HLL_namespace = - Parrot_pmc_new_constant(interp, enum_class_ResizablePMCArray); + Parrot_pmc_new(interp, enum_class_ResizablePMCArray); + interp->HLL_entries = + Parrot_pmc_new(interp, enum_class_ResizablePMCArray); Parrot_hll_register_HLL(interp, CONST_STRING(interp, "parrot")); } @@ -157,12 +161,12 @@ Parrot_hll_register_HLL(PARROT_INTERP, ARGIN(STRING *hll_name)) entry = new_hll_entry(interp, hll_name); /* register HLL name */ - name = Parrot_pmc_new_constant(interp, enum_class_String); + name = Parrot_pmc_new(interp, enum_class_String); VTABLE_set_string_native(interp, name, hll_name); VTABLE_set_pmc_keyed_int(interp, entry, e_HLL_name, name); - /* create HLL namespace using the *constant* name */ + /* create HLL namespace */ hll_name = Parrot_str_downcase(interp, VTABLE_get_string(interp, name)); /* HLL type mappings aren't yet created, we can't create @@ -297,7 +301,7 @@ Parrot_hll_register_HLL_type(PARROT_INTERP, INTVAL hll_id, type_array = VTABLE_get_pmc_keyed_int(interp, entry, e_HLL_typemap); if (PMC_IS_NULL(type_array)) { int i; - type_array = Parrot_pmc_new_constant(interp, enum_class_FixedIntegerArray); + type_array = Parrot_pmc_new(interp, enum_class_FixedIntegerArray); VTABLE_set_integer_native(interp, type_array, PARROT_MAX_CLASSES); for (i = 0; i < PARROT_MAX_CLASSES; ++i) VTABLE_set_integer_keyed_int(interp, type_array, i, i); diff --git a/src/interp/api.c b/src/interp/api.c new file mode 100644 index 0000000000..5b0de18b00 --- /dev/null +++ b/src/interp/api.c @@ -0,0 +1,1269 @@ +/* +Copyright (C) 2001-2010, Parrot Foundation. + +=head1 NAME + +src/interp/api.c - Parrot Interpreter API + +=head1 DESCRIPTION + +Functions related to managing the Parrot interpreter + +=head2 Functions + +=over 4 + +=cut + +*/ + + +#include "parrot/parrot.h" +#include "parrot/runcore_api.h" +#include "parrot/oplib/core_ops.h" +#include "pmc/pmc_callcontext.h" +#include "../gc/gc_private.h" +#include "api.str" +#include "pmc/pmc_parrotinterpreter.h" +#include "parrot/has_header.h" +#include "imcc/embed.h" + +static Interp* emergency_interp = NULL; + +/* HEADERIZER HFILE: include/parrot/interpreter.h */ + +/* HEADERIZER BEGIN: static */ +/* Don't modify between HEADERIZER BEGIN / HEADERIZER END. Your changes will be lost. */ + +PARROT_WARN_UNUSED_RESULT +static int Parrot_interp_is_env_var_set(PARROT_INTERP, ARGIN(STRING* var)) + __attribute__nonnull__(1) + __attribute__nonnull__(2); + +#define ASSERT_ARGS_Parrot_interp_is_env_var_set __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ + PARROT_ASSERT_ARG(interp) \ + , PARROT_ASSERT_ARG(var)) +/* Don't modify between HEADERIZER BEGIN / HEADERIZER END. Your changes will be lost. */ +/* HEADERIZER END: static */ + +#define ATEXIT_DESTROY + +/* + +=item C + +Checks whether the specified environment variable is set. + +=cut + +*/ + +PARROT_WARN_UNUSED_RESULT +static int +Parrot_interp_is_env_var_set(PARROT_INTERP, ARGIN(STRING* var)) +{ + ASSERT_ARGS(Parrot_interp_is_env_var_set) + int retval; + STRING * const value = Parrot_getenv(interp, var); + if (STRING_IS_NULL(value)) + retval = 0; + else if (STRING_IS_EMPTY(value)) + retval = 0; + else + retval = !STRING_equal(interp, value, CONST_STRING(interp, "0")); + return retval; +} + +/* + +=item C + +Returns a new Parrot interpreter. + +The first created interpreter (C is C) is the last one +to get destroyed. + +=cut + +*/ + +PARROT_EXPORT +PARROT_CANNOT_RETURN_NULL +PARROT_MALLOC +Parrot_Interp +Parrot_interp_new(ARGIN_NULLOK(Parrot_Interp parent)) +{ + ASSERT_ARGS(Parrot_interp_new) + /* api.c:Parrot_interp_make_interpreter builds a new Parrot_Interp. */ + return Parrot_interp_make_interpreter(parent, PARROT_NO_FLAGS); +} + +/* + +=item C + +Initializes the new interpreter when it hasn't been initialized before. + +Additionally sets the stack top, so that Parrot objects created +in inner stack frames will be visible during GC stack walking code. +B should be the address of an automatic variable in the caller's +stack frame. All unanchored Parrot objects (PMCs) must live in inner stack +frames so that they are not destroyed during GC runs. + +Use this function when you call into Parrot before entering a run loop. + +=cut + +*/ + +PARROT_EXPORT +void +Parrot_interp_init_stacktop(PARROT_INTERP, ARGIN(void *stack_top)) +{ + ASSERT_ARGS(Parrot_interp_init_stacktop) + interp->lo_var_ptr = stack_top; + Parrot_gbl_init_world_once(interp); +} + +/* + +=item C + +Create the Parrot interpreter. Allocate memory and clear the registers. + +=cut + +*/ + +PARROT_EXPORT +PARROT_CANNOT_RETURN_NULL +PARROT_MALLOC +Parrot_Interp +Parrot_interp_make_interpreter(ARGIN_NULLOK(Interp *parent), INTVAL flags) +{ + ASSERT_ARGS(Parrot_interp_make_interpreter) + int stacktop; + Parrot_GC_Init_Args args; + Interp * const interp = Parrot_interp_allocate_interpreter(parent, flags); + memset(&args, 0, sizeof (args)); + args.stacktop = &stacktop; + Parrot_interp_initialize_interpreter(interp, &args); + return interp; +} + +/* + +=item C + +Allocate new interpreter from system memory. Everything is preallocated but not +initialized. Used in next cycle: + + allocate_interpreter + parseflags + Parrot_interp_initialize_interpreter + +for overriding subsystems (e.g. GC) which require early initialization. + +=cut + +*/ + +PARROT_EXPORT +PARROT_CANNOT_RETURN_NULL +PARROT_MALLOC +Parrot_Interp +Parrot_interp_allocate_interpreter(ARGIN_NULLOK(Interp *parent), INTVAL flags) +{ + ASSERT_ARGS(Parrot_interp_allocate_interpreter) + Interp *interp; + + /* Get an empty interpreter from system memory */ + interp = mem_internal_allocate_zeroed_typed(Interp); + + /* the last interpreter (w/o) parent has to cleanup globals + * so remember parent if any */ + if (parent) + interp->parent_interpreter = parent; + else { + interp->parent_interpreter = NULL; + if (!emergency_interp) + emergency_interp = interp; + + PMCNULL = NULL; + } + + /* Must initialize flags before Parrot_gc_initialize() is called + * so the GC_DEBUG stuff is available. */ + interp->flags = flags; + + interp->ctx = NULL; + interp->resume_flag = RESUME_INITIAL; + + interp->recursion_limit = RECURSION_LIMIT; + + /* PANIC will fail until this is done */ + interp->piodata = NULL; + + /* create exceptions list */ + interp->current_runloop_id = 0; + interp->current_runloop_level = 0; + + interp->gc_sys = mem_internal_allocate_zeroed_typed(GC_Subsystem); + + /* Done. Return and be done with it */ + return interp; +} + +/* + +=item C + +Initialize previously allocated interpreter. + +=cut + +*/ + +PARROT_EXPORT +PARROT_CANNOT_RETURN_NULL +Parrot_Interp +Parrot_interp_initialize_interpreter(PARROT_INTERP, ARGIN(Parrot_GC_Init_Args *args)) +{ + ASSERT_ARGS(Parrot_interp_initialize_interpreter) + + /* Set up the memory allocation system */ + Parrot_gc_initialize(interp, args); + Parrot_block_GC_mark(interp); + Parrot_block_GC_sweep(interp); + + interp->ctx = PMCNULL; + interp->resume_flag = RESUME_INITIAL; + + interp->recursion_limit = RECURSION_LIMIT; + + /* PANIC will fail until this is done */ + interp->piodata = NULL; + Parrot_io_init(interp); + + /* use the system time as the prng seed */ + Parrot_util_srand(Parrot_get_entropy(interp)); + + /* + * Set up the string subsystem + * This also generates the constant string tables + */ + Parrot_str_init(interp); + + /* create caches structure */ + init_object_cache(interp); + + /* initialize classes - this needs mmd func table */ + interp->HLL_info = NULL; + + Parrot_vtbl_initialize_core_vtables(interp); + + /* create the root set registry */ + interp->gc_registry = Parrot_pmc_new(interp, enum_class_AddrRegistry); + + /* Set up MMD; MMD cache for builtins. */ + interp->op_mmd_cache = Parrot_mmd_cache_create(interp); + Parrot_pmc_gc_register(interp, interp->op_mmd_cache); + + Parrot_gbl_init_world_once(interp); + + /* context data */ + if (Parrot_interp_is_env_var_set(interp, CONST_STRING(interp, "PARROT_GC_DEBUG"))) { +#if ! DISABLE_GC_DEBUG + Interp_flags_SET(interp, PARROT_GC_DEBUG_FLAG); +#else + fprintf(stderr, "PARROT_GC_DEBUG is set but the binary was compiled " + "with DISABLE_GC_DEBUG.\n"); +#endif + } + + /* Initialize interpreter's flags */ + PARROT_WARNINGS_off(interp, PARROT_WARNINGS_ALL_FLAG); + + /* same with errors */ + PARROT_ERRORS_off(interp, PARROT_ERRORS_ALL_FLAG); + + /* param count mismatch is an error by default */ + PARROT_ERRORS_on(interp, PARROT_ERRORS_PARAM_COUNT_FLAG); + + create_initial_context(interp); + + /* clear context introspection vars */ + Parrot_pcc_set_sub(interp, CURRENT_CONTEXT(interp), NULL); + Parrot_pcc_set_continuation(interp, CURRENT_CONTEXT(interp), NULL); /* TODO Use PMCNULL */ + + /* initialize built-in runcores */ + Parrot_runcore_init(interp); + + /* Load the core op func and info tables */ + interp->all_op_libs = NULL; + interp->evc_func_table = NULL; + interp->evc_func_table_size = 0; + interp->code = NULL; + + /* create exceptions list */ + interp->current_runloop_id = 0; + interp->current_runloop_level = 0; + + /* setup stdio PMCs */ + Parrot_io_init(interp); + + /* Done. Return and be done with it */ + + /* Okay, we've finished doing anything that might trigger GC. + * Actually, we could enable GC earlier, but here all setup is + * done + */ + Parrot_unblock_GC_mark(interp); + Parrot_unblock_GC_sweep(interp); + + /* all sys running, init the event and signal stuff + * the first or "master" interpreter is handling events and signals + */ + + Parrot_cx_init_scheduler(interp); + +#ifdef ATEXIT_DESTROY + /* + * if this is not a threaded interpreter, push the interpreter + * destruction. + * Threaded interpreters are destructed when the thread ends + */ + if (!Interp_flags_TEST(interp, PARROT_IS_THREAD)) + Parrot_x_on_exit(interp, Parrot_interp_really_destroy, NULL); +#endif + + return interp; +} + +/* + +=item C + +Does nothing if C is defined. Otherwise calls +C with exit code 0. + +This function is not currently used. + +=cut + +*/ + +PARROT_EXPORT +void +Parrot_interp_destroy(PARROT_INTERP) +{ + ASSERT_ARGS(Parrot_interp_destroy) +#ifdef ATEXIT_DESTROY + UNUSED(interp); +#else + Parrot_interp_really_destroy(interp, 0); +#endif +} + +/* + +=item C + +Waits for any threads to complete, then frees all allocated memory, and +closes any open file handles, etc. + +=cut + +*/ + +void +Parrot_interp_really_destroy(PARROT_INTERP, int exit_code, SHIM(void *arg)) +{ + ASSERT_ARGS(Parrot_interp_really_destroy) + + /* wait for threads to complete if needed; terminate the event loop */ + if (!interp->parent_interpreter) { + Parrot_cx_runloop_end(interp); + + /* Don't bother trying to provide a pir backtrace on assertion failures + * during global destruction. It only works in movies. */ + Parrot_interp_clear_emergency_interpreter(); + } + + /* if something needs destruction (e.g. closing PIOs) + * we must destroy it now: + * + * Be sure that an async collector hasn't live bits set now, so + * trigger a finish run + * + * Need to turn off GC blocking, else things stay alive and IO + * handles aren't closed + */ + Parrot_gc_completely_unblock(interp); + + /* Set non buffered mode in standard out and err handles, flushing + * the buffers and avoiding pending output gets confused or lost in + * case of errors during destruction. + */ + Parrot_io_setbuf(interp, + Parrot_io_stdhandle(interp, PIO_STDOUT_FILENO, NULL), PIOCTL_NONBUF); + Parrot_io_setbuf(interp, + Parrot_io_stdhandle(interp, PIO_STDERR_FILENO, NULL), PIOCTL_NONBUF); + + if (Interp_trace_TEST(interp, ~0)) { + Parrot_io_eprintf(interp, "FileHandle objects (like stdout and stderr)" + "are about to be closed, so clearing trace flags.\n"); + Interp_trace_CLEAR(interp, ~0); + } + + /* + * that doesn't get rid of constant PMCs like these in vtable->data + * so if such a PMC needs destroying, we get a memory leak, like for + * the SharedRef PMC + * TODO sweep constants too or special treatment - depends on how + * many constant PMCs we'll create + */ + + /* 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 + */ + /* if (!interp->parent_interpreter) { + PIO_internal_shutdown(interp); + Parrot_kill_event_loop(interp); + } + */ + + /* we destroy all child interpreters and the last one too, + * if the --leak-test commandline was given */ + if (! (interp->parent_interpreter + || Interp_flags_TEST(interp, PARROT_DESTROY_FLAG))) + return; + + if (interp->parent_interpreter) + Parrot_gc_destroy_child_interp(interp->parent_interpreter, interp); + + Parrot_gc_mark_and_sweep(interp, GC_finish_FLAG); + + destroy_runloop_jump_points(interp); + + /* cache structure */ + destroy_object_cache(interp); + + if (interp->evc_func_table) { + mem_gc_free(interp, interp->evc_func_table); + interp->evc_func_table = NULL; + interp->evc_func_table_size = 0; + } + + /* strings, encodings - only once */ + Parrot_str_finish(interp); + + PARROT_CORE_OPLIB_INIT(interp, 0); + + if (!interp->parent_interpreter) { + /* get rid of ops */ + if (interp->op_hash) + Parrot_hash_destroy(interp, interp->op_hash); + + /* free vtables */ + Parrot_vtbl_free_vtables(interp); + + /* Finalize GC */ + Parrot_gc_finalize(interp); + + mem_internal_free(interp); + } + + else { + Parrot_vtbl_free_vtables(interp); + + /* Finalize GC */ + Parrot_gc_finalize(interp); + mem_internal_free(interp); + } +} + + +/* + +=item C + +Provide access to a (possibly) valid interp pointer. This is intended B +for use cases when an interp is not available otherwise, which shouldn't be +often. There are no guarantees about what this function returns. If you +have access to a valid interp, use that instead. Don't use this for anything +other than error handling. + +=cut + +*/ + +PARROT_CAN_RETURN_NULL +Interp* +Parrot_interp_get_emergency_interpreter(void) +{ + ASSERT_ARGS(Parrot_interp_get_emergency_interpreter) + return emergency_interp; +} + +/* + +=item C + +Null the C static variable. This is only useful when +purposefully invalidating C. This is not a general-purpose +function. Don't use it for anything other than error handling. + +=cut + +*/ + +void +Parrot_interp_clear_emergency_interpreter(void) +{ + ASSERT_ARGS(Parrot_interp_clear_emergency_interpreter) + emergency_interp = NULL; +} + + + +/* + +=item C + +Create an entry in the C for the given NCI method of PMC +class C. + +=cut + +*/ + +PARROT_EXPORT +void +Parrot_interp_register_nci_method(PARROT_INTERP, const int type, ARGIN(void *func), + ARGIN(const char *name), ARGIN(const char *proto)) +{ + ASSERT_ARGS(Parrot_interp_register_nci_method) + PMC * const method = Parrot_pmc_new(interp, enum_class_NCI); + STRING * const method_name = Parrot_str_new_init(interp, name, strlen(name), + Parrot_default_encoding_ptr, PObj_constant_FLAG|PObj_external_FLAG); + + /* create call func */ + VTABLE_set_pointer_keyed_str(interp, method, + Parrot_str_new_init(interp, proto, strlen(proto), + Parrot_default_encoding_ptr, PObj_constant_FLAG|PObj_external_FLAG), + func); + + /* insert it into namespace */ + VTABLE_set_pmc_keyed_str(interp, interp->vtables[type]->_namespace, + method_name, method); +} + +/* + +=item C + +Create an entry in the C for the given raw NCI method +of PMC class C. + +=cut + +*/ + +PARROT_EXPORT +void +Parrot_interp_register_native_pcc_method_in_ns(PARROT_INTERP, const int type, ARGIN(void *func), + ARGIN(STRING *name), ARGIN(STRING *signature)) +{ + ASSERT_ARGS(Parrot_interp_register_native_pcc_method_in_ns) + PMC * method = Parrot_pmc_new(interp, enum_class_NativePCCMethod); + + /* setup call func */ + VTABLE_set_pointer_keyed_str(interp, method, signature, func); + + /* insert it into namespace */ + VTABLE_set_pmc_keyed_str(interp, interp->vtables[type]->_namespace, + name, method); +} + +/* + +=item C + +Mark the method C on PMC type C as one that modifies the PMC. + +=cut + +*/ + +PARROT_EXPORT +void +Parrot_interp_mark_method_writes(PARROT_INTERP, int type, ARGIN(const char *name)) +{ + ASSERT_ARGS(Parrot_interp_mark_method_writes) + STRING * const str_name = Parrot_str_new_constant(interp, name); + PMC * const pmc_true = Parrot_pmc_new_init_int(interp, enum_class_Integer, 1); + PMC * const method = VTABLE_get_pmc_keyed_str(interp, + interp->vtables[type]->_namespace, str_name); + Parrot_pmc_setprop(interp, method, CONST_STRING(interp, "write"), pmc_true); +} + +/* + +=item C + +Get a compiler PMC. + +=cut + +*/ + +PARROT_EXPORT +PARROT_WARN_UNUSED_RESULT +PARROT_CANNOT_RETURN_NULL +PMC * +Parrot_interp_get_compiler(PARROT_INTERP, ARGIN(STRING *type)) +{ + ASSERT_ARGS(Parrot_interp_get_compiler) + PMC * const hash = VTABLE_get_pmc_keyed_int(interp, interp->iglobals, IGLOBALS_COMPREG_HASH); + + /* No compiler has been registered yet */ + if (PMC_IS_NULL(hash)) + return PMCNULL; + + /* Fetch the compiler */ + return VTABLE_get_pmc_keyed_str(interp, hash, type); +} + +/* + +=item C + +Register a parser/compiler PMC. + +=cut + +*/ + +PARROT_EXPORT +void +Parrot_interp_set_compiler(PARROT_INTERP, ARGIN(STRING *type), ARGIN(PMC *compiler)) +{ + ASSERT_ARGS(Parrot_interp_set_compiler) + PMC * const iglobals = interp->iglobals; + PMC * hash = VTABLE_get_pmc_keyed_int(interp, interp->iglobals, IGLOBALS_COMPREG_HASH); + + if (PMC_IS_NULL(hash)) { + hash = Parrot_pmc_new_noinit(interp, enum_class_Hash); + VTABLE_init(interp, hash); + VTABLE_set_pmc_keyed_int(interp, iglobals, + (INTVAL)IGLOBALS_COMPREG_HASH, hash); + } + + VTABLE_set_pmc_keyed_str(interp, hash, type, compiler); +} + +/* + +=item C + +Compile code file. Take a reference to a compiler PMC. Currently only PIR and +PASM compilers (IMCC-based) are supported + +TODO: This should probably be deleted entirely, and higher-level compilation +abstractions used instead. + +=cut + +*/ + +PARROT_EXPORT +PARROT_CANNOT_RETURN_NULL +PMC * +Parrot_interp_compile_file(PARROT_INTERP, ARGIN(PMC *compiler), ARGIN(STRING *fullname)) +{ + ASSERT_ARGS(Parrot_interp_compile_file) + PMC * result = NULL; + UINTVAL regs_used[4] = {3, 3, 3, 3}; + PMC * const newcontext = Parrot_push_context(interp, regs_used); + imc_info_t * const imcc = (imc_info_t *) VTABLE_get_pointer(interp, compiler); + const INTVAL is_pasm = VTABLE_get_integer(interp, compiler); + + Parrot_block_GC_mark(interp); + Parrot_pcc_set_HLL(interp, newcontext, 0); + Parrot_pcc_set_sub(interp, newcontext, 0); + + imcc_reset(imcc); + result = imcc_compile_file(imcc, fullname, is_pasm); + if (PMC_IS_NULL(result)) { + STRING * const msg = imcc_last_error_message(imcc); + INTVAL code = imcc_last_error_code(imcc); + Parrot_ex_throw_from_c_args(interp, NULL, code, "%Ss", msg); + } + + Parrot_pop_context(interp); + Parrot_unblock_GC_mark(interp); + + return result; +} + +/* + +=item C + +Compiles a code string. + +=cut + +*/ + +PARROT_EXPORT +PARROT_CAN_RETURN_NULL +PARROT_WARN_UNUSED_RESULT +Parrot_PMC +Parrot_interp_compile_string(PARROT_INTERP, ARGIN(PMC *compiler), ARGIN(STRING *code)) +{ + ASSERT_ARGS(Parrot_interp_compile_string) + + PMC *result; + imc_info_t * const imcc = (imc_info_t*) VTABLE_get_pointer(interp, compiler); + const INTVAL is_pasm = VTABLE_get_integer(interp, compiler); + + Parrot_block_GC_mark(interp); + result = imcc_compile_string(imcc, code, is_pasm); + if (PMC_IS_NULL(result)) { + STRING * const msg = imcc_last_error_message(imcc); + const INTVAL error_code = imcc_last_error_code(imcc); + + Parrot_unblock_GC_mark(interp); + Parrot_ex_throw_from_c_args(interp, NULL, error_code, "%Ss", msg); + } + Parrot_unblock_GC_mark(interp); + return result; +} + +/* + +=item C + +C specifies the type of information you want about the interpreter. + +=cut + +*/ + +PARROT_EXPORT +PARROT_WARN_UNUSED_RESULT +INTVAL +Parrot_interp_info(PARROT_INTERP, INTVAL what) +{ + ASSERT_ARGS(Parrot_interp_info) + INTVAL ret; + + switch (what) { + case TOTAL_MEM_ALLOC: + ret = Parrot_gc_total_memory_allocated(interp); + break; + case TOTAL_MEM_USED: + ret = Parrot_gc_total_memory_used(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: + ret = interp->run_core->id; + break; + default: /* or a warning only? */ + ret = -1; + Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_UNIMPLEMENTED, + "illegal argument in Parrot_interp_info"); + } + return ret; +} + +/* + +=item C + +C specifies the type of information you want about the +interpreter. + +=cut + +*/ + +PARROT_EXPORT +PARROT_WARN_UNUSED_RESULT +PARROT_CANNOT_RETURN_NULL +PMC* +Parrot_interp_info_p(PARROT_INTERP, INTVAL what) +{ + ASSERT_ARGS(Parrot_interp_info_p) + + PMC *result; + switch (what) { + case CURRENT_CTX: + result = CURRENT_CONTEXT(interp); + break; + case CURRENT_SUB: + result = Parrot_pcc_get_sub(interp, CURRENT_CONTEXT(interp)); + break; + case CURRENT_CONT: + result = Parrot_pcc_get_continuation(interp, CURRENT_CONTEXT(interp)); + break; + case CURRENT_LEXPAD: + result = Parrot_pcc_get_lex_pad(interp, CURRENT_CONTEXT(interp)); + break; + case CURRENT_TASK: + result = Parrot_cx_current_task(interp); + break; + default: /* or a warning only? */ + Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_UNIMPLEMENTED, + "illegal argument in Parrot_interp_info"); + } + + /* Don't send NULL values to P registers */ + return result ? result : PMCNULL; +} + +/* + +=item C + +Takes an interpreter name and an information type as arguments. +Returns corresponding information strings about the interpreter: +the full pathname, executable name, or the file stem, +(or throws an error exception, if the type is not recognized). +Valid types are EXECUTABLE_FULLNAME, EXECUTABLE_BASENAME, +and RUNTIME_PREFIX. + +=cut + +*/ + +PARROT_EXPORT +PARROT_WARN_UNUSED_RESULT +PARROT_CANNOT_RETURN_NULL +STRING* +Parrot_interp_info_s(PARROT_INTERP, INTVAL what) +{ + ASSERT_ARGS(Parrot_interp_info_s) + switch (what) { + case EXECUTABLE_FULLNAME: { + PMC * const exe_name = VTABLE_get_pmc_keyed_int(interp, interp->iglobals, + IGLOBALS_EXECUTABLE); + if (PMC_IS_NULL(exe_name)) + return CONST_STRING(interp, ""); + return VTABLE_get_string(interp, exe_name); + } + case EXECUTABLE_BASENAME: { + PMC * const exe_name = VTABLE_get_pmc_keyed_int(interp, + interp->iglobals, IGLOBALS_EXECUTABLE); + + if (PMC_IS_NULL(exe_name)) + return CONST_STRING(interp, ""); + + else { + /* Need to strip back to what follows the final / or \. */ + STRING * const fullname = VTABLE_get_string(interp, exe_name); + const int len = STRING_length(fullname); + int pos; + + for (pos = len - 1; pos > 0; --pos) { + const INTVAL c = STRING_ord(interp, fullname, pos); + + if (c == '/' || c == '\\') { + ++pos; + break; + } + } + + return Parrot_str_substr(interp, fullname, pos, len - pos); + } + } + case RUNTIME_PREFIX: + return Parrot_get_runtime_path(interp); + case GC_SYS_NAME: { + STRING * const name = Parrot_gc_sys_name(interp); + Parrot_warn_experimental(interp, "GC_SYS_NAME option is experimental"); + return name; + } + case CURRENT_RUNCORE: + return interp->run_core->name; + default: + Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_UNIMPLEMENTED, + "illegal argument in Parrot_interp_info"); + } +} + +/* + +=item C + +C is a ParrotInterpreter PMC. Extract the raw C from it +without needing an existing C reference. + +Do not use with any other type of PMC. + +=cut + +*/ + +PARROT_EXPORT +PARROT_CANNOT_RETURN_NULL +Interp * +Parrot_interp_get_from_pmc(ARGIN(PMC * interp_pmc)) +{ + ASSERT_ARGS(Parrot_interp_get_from_pmc) + PARROT_ASSERT(interp_pmc->vtable->base_type == enum_class_ParrotInterpreter); + return ((Parrot_ParrotInterpreter_attributes*)interp_pmc->data)->interp; +} + +/* + +=item C + +Sets on any of the following flags, specified by C, in the interpreter: + +Flag Effect +C enable bounds checking +C enable profiling, + +=cut + +*/ + +PARROT_EXPORT +void +Parrot_interp_set_flag(PARROT_INTERP, INTVAL flag) +{ + ASSERT_ARGS(Parrot_interp_set_flag) + /* These two macros (from interpreter.h) do exactly what they look like. */ + + Interp_flags_SET(interp, flag); + switch (flag) { + case PARROT_BOUNDS_FLAG: + case PARROT_PROFILE_FLAG: + Parrot_runcore_switch(interp, Parrot_str_new_constant(interp, "slow")); + break; + default: + break; + } +} + + +/* + +=item C + +Set a debug flag: C. + +=cut + +*/ + +PARROT_EXPORT +void +Parrot_interp_set_debug(PARROT_INTERP, UINTVAL flag) +{ + ASSERT_ARGS(Parrot_interp_set_debug) + interp->debug_flags |= flag; +} + + +/* + +=item C + +Sets the name of the executable launching Parrot (see C and the +C binary). + +=cut + +*/ + +PARROT_EXPORT +void +Parrot_interp_set_executable_name(PARROT_INTERP, ARGIN(STRING * const name)) +{ + ASSERT_ARGS(Parrot_interp_set_executable_name) + PMC * const name_pmc = Parrot_pmc_new(interp, enum_class_String); + VTABLE_set_string_native(interp, name_pmc, name); + VTABLE_set_pmc_keyed_int(interp, interp->iglobals, IGLOBALS_EXECUTABLE, + name_pmc); +} + + +/* + +=item C + +Set a trace flag: C + +=cut + +*/ + +PARROT_EXPORT +void +Parrot_interp_set_trace(PARROT_INTERP, UINTVAL flag) +{ + ASSERT_ARGS(Parrot_interp_set_trace) + Parrot_pcc_trace_flags_on(interp, interp->ctx, flag); + Parrot_runcore_switch(interp, Parrot_str_new_constant(interp, "slow")); +} + + +/* + +=item C + +Clears a flag in the interpreter. + +=cut + +*/ + +PARROT_EXPORT +void +Parrot_interp_clear_flag(PARROT_INTERP, INTVAL flag) +{ + ASSERT_ARGS(Parrot_interp_clear_flag) + Interp_flags_CLEAR(interp, flag); +} + + +/* + +=item C + +Clears a flag in the interpreter. + +=cut + +*/ + +PARROT_EXPORT +void +Parrot_interp_clear_debug(PARROT_INTERP, UINTVAL flag) +{ + ASSERT_ARGS(Parrot_interp_clear_debug) + interp->debug_flags &= ~flag; +} + + +/* + +=item C + +Clears a flag in the interpreter. + +=cut + +*/ + +PARROT_EXPORT +void +Parrot_interp_clear_trace(PARROT_INTERP, UINTVAL flag) +{ + ASSERT_ARGS(Parrot_interp_clear_trace) + Parrot_pcc_trace_flags_off(interp, interp->ctx, flag); +} + + +/* + +=item C + +Test the interpreter flags specified in C. + +=cut + +*/ + +PARROT_EXPORT +PARROT_PURE_FUNCTION +Parrot_Int +Parrot_interp_test_flag(PARROT_INTERP, INTVAL flag) +{ + ASSERT_ARGS(Parrot_interp_test_flag) + return Interp_flags_TEST(interp, flag); +} + + +/* + +=item C + +Test the interpreter flags specified in C. + +=cut + +*/ + +PARROT_EXPORT +PARROT_PURE_FUNCTION +Parrot_UInt +Parrot_interp_test_debug(PARROT_INTERP, UINTVAL flag) +{ + ASSERT_ARGS(Parrot_interp_test_debug) + return interp->debug_flags & flag; +} + + +/* + +=item C + +Test the interpreter flags specified in C. + +=cut + +*/ + +PARROT_EXPORT +PARROT_PURE_FUNCTION +Parrot_UInt +Parrot_interp_test_trace(PARROT_INTERP, UINTVAL flag) +{ + ASSERT_ARGS(Parrot_interp_test_trace) + return Parrot_pcc_trace_flags_test(interp, interp->ctx, flag); +} + + +/* + +=item C + +Sets the specified run core. + +=cut + +*/ + +PARROT_EXPORT +void +Parrot_interp_set_run_core(PARROT_INTERP, Parrot_Run_core_t core) +{ + ASSERT_ARGS(Parrot_interp_set_run_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_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; + case PARROT_SUBPROF_SUB_CORE: + Parrot_runcore_switch(interp, Parrot_str_new_constant(interp, "subprof_sub")); + break; + case PARROT_SUBPROF_HLL_CORE: + Parrot_runcore_switch(interp, Parrot_str_new_constant(interp, "subprof_hll")); + break; + case PARROT_SUBPROF_OPS_CORE: + Parrot_runcore_switch(interp, Parrot_str_new_constant(interp, "subprof_ops")); + break; + default: + Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_UNIMPLEMENTED, + "Invalid runcore requested\n"); + } +} + + +/* + +=item C + +Activates the given warnings. + +=cut + +*/ + +PARROT_EXPORT +void +Parrot_interp_set_warnings(PARROT_INTERP, Parrot_warnclass wc) +{ + ASSERT_ARGS(Parrot_interp_set_warnings) + /* Activates the given warnings. (Macro from warnings.h.) */ + PARROT_WARNINGS_on(interp, wc); +} + +/* + +=back + +=head1 SEE ALSO + +L + +=cut + +*/ + +/* + * Local variables: + * c-file-style: "parrot" + * End: + * vim: expandtab shiftwidth=4 cinoptions='\:2=2' : + */ diff --git a/src/interp/inter_cb.c b/src/interp/inter_cb.c index adf4748f67..38627979d9 100644 --- a/src/interp/inter_cb.c +++ b/src/interp/inter_cb.c @@ -26,8 +26,10 @@ the C-library. #include "parrot/parrot.h" #include "parrot/extend.h" #include "pmc/pmc_parrotinterpreter.h" +#include "pmc/pmc_callback.h" #include "inter_cb.str" +static Interp * default_interp = NULL; /* HEADERIZER HFILE: include/parrot/interpreter.h */ @@ -79,6 +81,7 @@ Parrot_make_cb(PARROT_INTERP, ARGMOD(PMC* sub), ARGIN(PMC* user_data), PMC *cb, *cb_sig; int type = 0; STRING *sc; + /* * we stuff all the information into the user_data PMC and pass that * on to the external sub @@ -86,11 +89,14 @@ Parrot_make_cb(PARROT_INTERP, ARGMOD(PMC* sub), ARGIN(PMC* user_data), PMC * const interp_pmc = VTABLE_get_pmc_keyed_int(interp, interp->iglobals, (INTVAL) IGLOBALS_INTERPRETER); + if (default_interp == NULL) + default_interp = interp; + /* be sure __LINE__ is consistent */ sc = CONST_STRING(interp, "_interpreter"); - VTABLE_setprop(interp, user_data, sc, interp_pmc); + Parrot_pmc_setprop(interp, user_data, sc, interp_pmc); sc = CONST_STRING(interp, "_sub"); - VTABLE_setprop(interp, user_data, sc, sub); + Parrot_pmc_setprop(interp, user_data, sc, sub); /* only ASCII signatures are supported */ if (STRING_length(cb_signature) == 3) { /* Callback return type ignored */ @@ -111,7 +117,7 @@ Parrot_make_cb(PARROT_INTERP, ARGMOD(PMC* sub), ARGIN(PMC* user_data), cb_sig = Parrot_pmc_new(interp, enum_class_String); VTABLE_set_string_native(interp, cb_sig, cb_signature); sc = CONST_STRING(interp, "_signature"); - VTABLE_setprop(interp, user_data, sc, cb_sig); + Parrot_pmc_setprop(interp, user_data, sc, cb_sig); /* * We are going to be passing the user_data PMC to external code, but * it may go out of scope until the callback is called -- we don't know @@ -156,7 +162,7 @@ static void verify_CD(ARGIN(char *external_data), ARGMOD_NULLOK(PMC *user_data)) { ASSERT_ARGS(verify_CD) - PARROT_INTERP = NULL; + PARROT_INTERP = default_interp; PMC *interp_pmc; STRING *sc; @@ -175,14 +181,9 @@ verify_CD(ARGIN(char *external_data), ARGMOD_NULLOK(PMC *user_data)) PANIC(interp, "user_data doesn't look like a pointer"); /* Fetch original interpreter from prop */ - LOCK(interpreter_array_mutex); - - interp = interpreter_array[0]; sc = CONST_STRING(interp, "_interpreter"); - interp_pmc = VTABLE_getprop(interp, user_data, sc); + interp_pmc = Parrot_pmc_getprop(interp, user_data, sc); GETATTR_ParrotInterpreter_interp(interp, interp_pmc, interp); - - UNLOCK(interpreter_array_mutex); if (!interp) PANIC(interp, "interpreter not found for callback"); @@ -229,12 +230,12 @@ callback_CD(PARROT_INTERP, ARGIN(char *external_data), ARGMOD(PMC *user_data)) * 3) check interpreter ... */ sc = CONST_STRING(interp, "_interpreter"); - passed_interp = VTABLE_getprop(interp, user_data, sc); + passed_interp = Parrot_pmc_getprop(interp, user_data, sc); if (VTABLE_get_pointer(interp, passed_interp) != interp) PANIC(interp, "callback gone to wrong interpreter"); sc = CONST_STRING(interp, "_synchronous"); - passed_synchronous = VTABLE_getprop(interp, user_data, sc); + passed_synchronous = Parrot_pmc_getprop(interp, user_data, sc); if (!PMC_IS_NULL(passed_synchronous) && VTABLE_get_bool(interp, passed_synchronous)) synchronous = 1; @@ -261,13 +262,18 @@ callback_CD(PARROT_INTERP, ARGIN(char *external_data), ARGMOD(PMC *user_data)) * then wait for the CB_EVENT_xx to finish and return the * result */ - Parrot_cx_schedule_callback(interp, user_data, external_data); + PMC * const callback = Parrot_pmc_new(interp, enum_class_Callback); + Parrot_Callback_attributes * const cb_data = PARROT_CALLBACK(callback); + cb_data->user_data = user_data; + cb_data->external_data = (PMC*) external_data; + + Parrot_cx_schedule_immediate(interp, callback); } } /* -=item C Run a callback function. The PMC* user_data holds all @@ -280,7 +286,7 @@ necessary items in its properties. PARROT_EXPORT void Parrot_run_callback(PARROT_INTERP, - ARGMOD(PMC* user_data), ARGIN(char* external_data)) + ARGMOD(PMC* user_data), ARGIN(void* external_data)) { ASSERT_ARGS(Parrot_run_callback) PMC *signature; @@ -294,9 +300,9 @@ Parrot_run_callback(PARROT_INTERP, STRING *sc; sc = CONST_STRING(interp, "_sub"); - sub = VTABLE_getprop(interp, user_data, sc); + sub = Parrot_pmc_getprop(interp, user_data, sc); sc = CONST_STRING(interp, "_signature"); - signature = VTABLE_getprop(interp, user_data, sc); + signature = Parrot_pmc_getprop(interp, user_data, sc); sig_str = VTABLE_get_string(interp, signature); pasm_sig[0] = 'P'; @@ -308,16 +314,20 @@ Parrot_run_callback(PARROT_INTERP, pasm_sig[1] = 'v'; break; case 'l': - i_param = (INTVAL)(long) external_data; + /* FIXME: issue #742 */ + i_param = (INTVAL)(long)(INTVAL) external_data; goto case_I; case 'i': - i_param = (INTVAL)(int)(long) external_data; + /* FIXME: issue #742 */ + i_param = (INTVAL)(int)(INTVAL) external_data; goto case_I; case 's': - i_param = (INTVAL)(short)(long) external_data; + /* FIXME: issue #742 */ + i_param = (INTVAL)(short)(INTVAL) external_data; goto case_I; case 'c': - i_param = (INTVAL)(char)(long)external_data; + /* FIXME: issue #742 */ + i_param = (INTVAL)(char)(INTVAL) external_data; case_I: pasm_sig[1] = 'I'; param = (void*) i_param; @@ -331,7 +341,7 @@ Parrot_run_callback(PARROT_INTERP, break; case 't': pasm_sig[1] = 'S'; - param = Parrot_str_new(interp, external_data, 0); + param = Parrot_str_new(interp, (const char*)external_data, 0); break; default: Parrot_ex_throw_from_c_args(interp, NULL, 1, diff --git a/src/interp/inter_create.c b/src/interp/inter_create.c deleted file mode 100644 index 9a4250f1ac..0000000000 --- a/src/interp/inter_create.c +++ /dev/null @@ -1,598 +0,0 @@ -/* -Copyright (C) 2001-2010, Parrot Foundation. - -=head1 NAME - -src/interp/inter_create.c - Parrot Interpreter Creation and Destruction - -=head1 DESCRIPTION - -Create or destroy a Parrot interpreter - -=head2 Functions - -=over 4 - -=cut - -*/ - - -#include "parrot/parrot.h" -#include "parrot/runcore_api.h" -#include "parrot/oplib/core_ops.h" -#include "pmc/pmc_callcontext.h" -#include "../gc/gc_private.h" -#include "inter_create.str" - -static Interp* emergency_interp; - -/* HEADERIZER HFILE: include/parrot/interpreter.h */ - -/* HEADERIZER BEGIN: static */ -/* Don't modify between HEADERIZER BEGIN / HEADERIZER END. Your changes will be lost. */ - -PARROT_WARN_UNUSED_RESULT -static int is_env_var_set(PARROT_INTERP, ARGIN(STRING* var)) - __attribute__nonnull__(1) - __attribute__nonnull__(2); - -#define ASSERT_ARGS_is_env_var_set __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ - PARROT_ASSERT_ARG(interp) \ - , PARROT_ASSERT_ARG(var)) -/* Don't modify between HEADERIZER BEGIN / HEADERIZER END. Your changes will be lost. */ -/* HEADERIZER END: static */ - -#define ATEXIT_DESTROY - -/* - -=item C - -Checks whether the specified environment variable is set. - -=cut - -*/ - -PARROT_WARN_UNUSED_RESULT -static int -is_env_var_set(PARROT_INTERP, ARGIN(STRING* var)) -{ - ASSERT_ARGS(is_env_var_set) - int retval; - STRING * const value = Parrot_getenv(interp, var); - if (STRING_IS_NULL(value)) - retval = 0; - else if (STRING_IS_EMPTY(value)) - retval = 0; - else - retval = !STRING_equal(interp, value, CONST_STRING(interp, "0")); - return retval; -} - -/* - -=item C - -Returns a new Parrot interpreter. - -The first created interpreter (C is C) is the last one -to get destroyed. - -=cut - -*/ - -PARROT_EXPORT -PARROT_CANNOT_RETURN_NULL -PARROT_MALLOC -Parrot_Interp -Parrot_new(ARGIN_NULLOK(Parrot_Interp parent)) -{ - ASSERT_ARGS(Parrot_new) - /* inter_create.c:make_interpreter builds a new Parrot_Interp. */ - return make_interpreter(parent, PARROT_NO_FLAGS); -} - -/* - -=item C - -Initializes the new interpreter when it hasn't been initialized before. - -Additionally sets the stack top, so that Parrot objects created -in inner stack frames will be visible during GC stack walking code. -B should be the address of an automatic variable in the caller's -stack frame. All unanchored Parrot objects (PMCs) must live in inner stack -frames so that they are not destroyed during GC runs. - -Use this function when you call into Parrot before entering a run loop. - -=cut - -*/ - -PARROT_EXPORT -void -Parrot_init_stacktop(PARROT_INTERP, ARGIN(void *stack_top)) -{ - ASSERT_ARGS(Parrot_init_stacktop) - interp->lo_var_ptr = stack_top; - Parrot_gbl_init_world_once(interp); -} - -/* - -=item C - -Create the Parrot interpreter. Allocate memory and clear the registers. - -=cut - -*/ - -PARROT_EXPORT -PARROT_CANNOT_RETURN_NULL -PARROT_MALLOC -Parrot_Interp -make_interpreter(ARGIN_NULLOK(Interp *parent), INTVAL flags) -{ - ASSERT_ARGS(make_interpreter) - int stacktop; - Parrot_GC_Init_Args args; - Interp * const interp = allocate_interpreter(parent, flags); - memset(&args, 0, sizeof (args)); - args.stacktop = &stacktop; - initialize_interpreter(interp, &args); - return interp; -} - -/* - -=item C - -Allocate new interpreter from system memory. Everything is preallocated but not -initialized. Used in next cycle: - - allocate_interpreter - parseflags - initialize_interpreter - -for overriding subsystems (e.g. GC) which require early initialization. - -=cut - -*/ - -PARROT_EXPORT -PARROT_CANNOT_RETURN_NULL -PARROT_MALLOC -Parrot_Interp -allocate_interpreter(ARGIN_NULLOK(Interp *parent), INTVAL flags) -{ - ASSERT_ARGS(allocate_interpreter) - Interp *interp; - - /* Get an empty interpreter from system memory */ - interp = mem_internal_allocate_zeroed_typed(Interp); - - interp->lo_var_ptr = NULL; - - /* the last interpreter (w/o) parent has to cleanup globals - * so remember parent if any */ - if (parent) - interp->parent_interpreter = parent; - else { - interp->parent_interpreter = NULL; - emergency_interp = interp; - - PMCNULL = NULL; - - /* - * we need a global mutex to protect the interpreter array - */ - MUTEX_INIT(interpreter_array_mutex); - } - - /* Must initialize flags before Parrot_gc_initialize() is called - * so the GC_DEBUG stuff is available. */ - interp->flags = flags; - - interp->ctx = NULL; - interp->resume_flag = RESUME_INITIAL; - - interp->recursion_limit = RECURSION_LIMIT; - - /* PANIC will fail until this is done */ - interp->piodata = NULL; - - /* create exceptions list */ - interp->current_runloop_id = 0; - interp->current_runloop_level = 0; - - interp->gc_sys = mem_internal_allocate_zeroed_typed(GC_Subsystem); - - /* Done. Return and be done with it */ - return interp; -} - -/* - -=item C - -Initialize previously allocated interpreter. - -=cut - -*/ - -PARROT_EXPORT -PARROT_CANNOT_RETURN_NULL -Parrot_Interp -initialize_interpreter(PARROT_INTERP, ARGIN(Parrot_GC_Init_Args *args)) -{ - ASSERT_ARGS(initialize_interpreter) - - /* Set up the memory allocation system */ - Parrot_gc_initialize(interp, args); - Parrot_block_GC_mark(interp); - Parrot_block_GC_sweep(interp); - - interp->ctx = PMCNULL; - interp->resume_flag = RESUME_INITIAL; - - interp->recursion_limit = RECURSION_LIMIT; - - /* PANIC will fail until this is done */ - interp->piodata = NULL; - Parrot_io_init(interp); - - /* use the system time as the prng seed */ - Parrot_util_srand(Parrot_get_entropy(interp)); - - /* - * Set up the string subsystem - * This also generates the constant string tables - */ - Parrot_str_init(interp); - - /* create caches structure */ - init_object_cache(interp); - - /* initialize classes - this needs mmd func table */ - interp->HLL_info = NULL; - - Parrot_vtbl_initialize_core_vtables(interp); - - /* create the root set registry */ - interp->gc_registry = Parrot_pmc_new(interp, enum_class_AddrRegistry); - - /* Set up MMD; MMD cache for builtins. */ - interp->op_mmd_cache = Parrot_mmd_cache_create(interp); - Parrot_pmc_gc_register(interp, interp->op_mmd_cache); - - Parrot_gbl_init_world_once(interp); - - /* context data */ - 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 - fprintf(stderr, "PARROT_GC_DEBUG is set but the binary was compiled " - "with DISABLE_GC_DEBUG.\n"); -#endif - } - - /* Initialize interpreter's flags */ - PARROT_WARNINGS_off(interp, PARROT_WARNINGS_ALL_FLAG); - - /* same with errors */ - PARROT_ERRORS_off(interp, PARROT_ERRORS_ALL_FLAG); - - /* param count mismatch is an error by default */ - PARROT_ERRORS_on(interp, PARROT_ERRORS_PARAM_COUNT_FLAG); - - create_initial_context(interp); - - /* clear context introspection vars */ - 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->all_op_libs = NULL; - interp->evc_func_table = NULL; - interp->evc_func_table_size = 0; - interp->current_pf = PMCNULL; - interp->code = NULL; - - /* create exceptions list */ - interp->current_runloop_id = 0; - interp->current_runloop_level = 0; - - /* setup stdio PMCs */ - Parrot_io_init(interp); - - /* Done. Return and be done with it */ - - /* Okay, we've finished doing anything that might trigger GC. - * Actually, we could enable GC earlier, but here all setup is - * done - */ - Parrot_unblock_GC_mark(interp); - Parrot_unblock_GC_sweep(interp); - - /* all sys running, init the event and signal stuff - * the first or "master" interpreter is handling events and signals - */ - interp->task_queue = NULL; - interp->thread_data = NULL; - - Parrot_cx_init_scheduler(interp); - -#ifdef ATEXIT_DESTROY - /* - * if this is not a threaded interpreter, push the interpreter - * destruction. - * Threaded interpreters are destructed when the thread ends - */ - if (!Interp_flags_TEST(interp, PARROT_IS_THREAD)) - Parrot_x_on_exit(interp, Parrot_really_destroy, NULL); -#endif - - return interp; -} - - -/* - -=item C - -Does nothing if C is defined. Otherwise calls -C with exit code 0. - -This function is not currently used. - -=cut - -*/ - -PARROT_EXPORT -void -Parrot_destroy(PARROT_INTERP) -{ - ASSERT_ARGS(Parrot_destroy) -#ifdef ATEXIT_DESTROY - UNUSED(interp); -#else - Parrot_really_destroy(interp, 0); -#endif -} - -/* - -=item C - -Waits for any threads to complete, then frees all allocated memory, and -closes any open file handles, etc. - -Note that C is ignored. - -=cut - -*/ - -void -Parrot_really_destroy(PARROT_INTERP, SHIM(int exit_code), SHIM(void *arg)) -{ - ASSERT_ARGS(Parrot_really_destroy) - /* wait for threads to complete if needed; terminate the event loop */ - if (!interp->parent_interpreter) { - Parrot_cx_runloop_end(interp); - pt_join_threads(interp); - - /* Don't bother trying to provide a pir backtrace on assertion failures - * during global destruction. It only works in movies. */ - Parrot_clear_emergency_interp(); - } - - /* if something needs destruction (e.g. closing PIOs) - * we must destroy it now: - * - * Be sure that an async collector hasn't live bits set now, so - * trigger a finish run - * - * Need to turn off GC blocking, else things stay alive and IO - * handles aren't closed - */ - Parrot_gc_completely_unblock(interp); - - /* Set non buffered mode in standard out and err handles, flushing - * the buffers and avoiding pending output gets confused or lost in - * case of errors during destruction. - */ - Parrot_io_setbuf(interp, - Parrot_io_stdhandle(interp, PIO_STDOUT_FILENO, NULL), PIOCTL_NONBUF); - Parrot_io_setbuf(interp, - Parrot_io_stdhandle(interp, PIO_STDERR_FILENO, NULL), PIOCTL_NONBUF); - - if (Interp_trace_TEST(interp, ~0)) { - Parrot_io_eprintf(interp, "FileHandle objects (like stdout and stderr)" - "are about to be closed, so clearing trace flags.\n"); - Interp_trace_CLEAR(interp, ~0); - } - - /* Destroys all PMCs, even constants and the FileHandle objects for - * std{in, out, err}, so don't be verbose about GC'ing. */ - if (interp->thread_data) - interp->thread_data->state |= THREAD_STATE_SUSPENDED_GC; - - /* - * that doesn't get rid of constant PMCs like these in vtable->data - * so if such a PMC needs destroying, we get a memory leak, like for - * the SharedRef PMC - * TODO sweep constants too or special treatment - depends on how - * many constant PMCs we'll create - */ - - /* 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 - */ - /* if (!interp->parent_interpreter) { - PIO_internal_shutdown(interp); - Parrot_kill_event_loop(interp); - } - */ - - /* we destroy all child interpreters and the last one too, - * if the --leak-test commandline was given */ - if (! (interp->parent_interpreter - || Interp_flags_TEST(interp, PARROT_DESTROY_FLAG))) - return; - - if (interp->parent_interpreter - && interp->thread_data - && (interp->thread_data->state & THREAD_STATE_JOINED)) { - Parrot_gc_destroy_child_interp(interp->parent_interpreter, interp); - } - - Parrot_gc_mark_and_sweep(interp, GC_finish_FLAG); - - /* copies of constant tables */ - Parrot_destroy_constants(interp); - - destroy_runloop_jump_points(interp); - - /* XXX Fix abstraction leak. packfile */ - if (!PMC_IS_NULL(interp->current_pf)) - PackFile_destroy(interp, (PackFile*) VTABLE_get_pointer(interp, interp->current_pf)); - - /* cache structure */ - destroy_object_cache(interp); - - if (interp->evc_func_table) { - mem_gc_free(interp, interp->evc_func_table); - interp->evc_func_table = NULL; - interp->evc_func_table_size = 0; - } - - /* strings, encodings - only once */ - Parrot_str_finish(interp); - - PARROT_CORE_OPLIB_INIT(interp, 0); - - if (!interp->parent_interpreter) { - if (interp->thread_data) - mem_internal_free(interp->thread_data); - - /* get rid of ops */ - if (interp->op_hash) - Parrot_hash_destroy(interp, interp->op_hash); - - /* free vtables */ - Parrot_vtbl_free_vtables(interp); - - /* Finalize GC */ - Parrot_gc_finalize(interp); - - MUTEX_DESTROY(interpreter_array_mutex); - mem_internal_free(interp); - - /* finally free other globals */ - mem_internal_free(interpreter_array); - interpreter_array = NULL; - } - - else { - /* don't free a thread interpreter, if it isn't joined yet */ - if (!interp->thread_data - || (interp->thread_data - && (interp->thread_data->state & THREAD_STATE_JOINED))) { - if (interp->thread_data) { - mem_internal_free(interp->thread_data); - interp->thread_data = NULL; - } - - Parrot_vtbl_free_vtables(interp); - - /* Finalyze GC */ - Parrot_gc_finalize(interp); - - mem_internal_free(interp); - } - } -} - - -/* - -=item C - -Provide access to a (possibly) valid interp pointer. This is intended B -for use cases when an interp is not available otherwise, which shouldn't be -often. There are no guarantees about what what this function returns. If you -have access to a valid interp, use that instead. Don't use this for anything -other than error handling. - -=cut - -*/ - -PARROT_CAN_RETURN_NULL -Interp* -Parrot_get_emergency_interp(void) { - ASSERT_ARGS(Parrot_get_emergency_interp) - - return emergency_interp; -} - - -/* - -=item C - -Null the C static variable. This is only useful when -purposefully invalidating C. This is not a general-purpose -function. Don't use it for anything other than error handling. - -=cut - -*/ - -void -Parrot_clear_emergency_interp(void) { - emergency_interp = NULL; -} - - -/* - -=back - -=head1 SEE ALSO - -L, L. - -=cut - -*/ - -/* - * Local variables: - * c-file-style: "parrot" - * End: - * vim: expandtab shiftwidth=4 cinoptions='\:2=2' : - */ diff --git a/src/interp/inter_misc.c b/src/interp/inter_misc.c deleted file mode 100644 index 41925687a1..0000000000 --- a/src/interp/inter_misc.c +++ /dev/null @@ -1,757 +0,0 @@ -/* -Copyright (C) 2001-2009, Parrot Foundation. - -=head1 NAME - -src/interp/inter_misc.c - Parrot Interpreter miscellaneous functions - -=head1 DESCRIPTION - -NCI function setup, compiler registration, C, and C opcodes. - -=head2 Functions - -=over 4 - -=cut - -*/ - - -#include "parrot/parrot.h" -#include "inter_misc.str" -#include "parrot/runcore_api.h" -#include "pmc/pmc_callcontext.h" -#include "pmc/pmc_parrotinterpreter.h" -#include "parrot/has_header.h" -#include "imcc/embed.h" - -/* HEADERIZER HFILE: include/parrot/interpreter.h */ - -/* - -=item C - -Create an entry in the C for the given NCI method of PMC -class C. - -=cut - -*/ - -PARROT_EXPORT -void -register_nci_method(PARROT_INTERP, const int type, ARGIN(void *func), - ARGIN(const char *name), ARGIN(const char *proto)) -{ - ASSERT_ARGS(register_nci_method) - PMC * const method = Parrot_pmc_new(interp, enum_class_NCI); - STRING * const method_name = Parrot_str_new_init(interp, name, strlen(name), - Parrot_default_encoding_ptr, PObj_constant_FLAG|PObj_external_FLAG); - - /* create call func */ - VTABLE_set_pointer_keyed_str(interp, method, - Parrot_str_new_init(interp, proto, strlen(proto), - Parrot_default_encoding_ptr, PObj_constant_FLAG|PObj_external_FLAG), - func); - - /* insert it into namespace */ - VTABLE_set_pmc_keyed_str(interp, interp->vtables[type]->_namespace, - method_name, method); -} - -/* - -=item C - -Create an entry in the C for the given raw NCI method -of PMC class C. - -=cut - -*/ - -PARROT_EXPORT -void -register_native_pcc_method_in_ns(PARROT_INTERP, const int type, ARGIN(void *func), - ARGIN(STRING *name), ARGIN(STRING *signature)) -{ - ASSERT_ARGS(register_native_pcc_method_in_ns) - PMC * method = Parrot_pmc_new(interp, enum_class_NativePCCMethod); - - /* setup call func */ - VTABLE_set_pointer_keyed_str(interp, method, signature, func); - - /* insert it into namespace */ - VTABLE_set_pmc_keyed_str(interp, interp->vtables[type]->_namespace, - name, method); -} - -/* - -=item C - -Mark the method C on PMC type C as one that modifies the PMC. - -=cut - -*/ - -PARROT_EXPORT -void -Parrot_mark_method_writes(PARROT_INTERP, int type, ARGIN(const char *name)) -{ - ASSERT_ARGS(Parrot_mark_method_writes) - STRING *const str_name = Parrot_str_new_constant(interp, name); - PMC *const pmc_true = Parrot_pmc_new_init_int(interp, enum_class_Integer, 1); - PMC *const method = VTABLE_get_pmc_keyed_str( - interp, interp->vtables[type]->_namespace, str_name); - VTABLE_setprop(interp, method, CONST_STRING(interp, "write"), pmc_true); -} - -/* - -=item C - -Get a compiler PMC. - -=cut - -*/ - -PARROT_EXPORT -PARROT_WARN_UNUSED_RESULT -PARROT_CANNOT_RETURN_NULL -PMC * -Parrot_get_compiler(PARROT_INTERP, ARGIN(STRING *type)) -{ - ASSERT_ARGS(Parrot_get_compiler) - PMC * const hash = VTABLE_get_pmc_keyed_int(interp, interp->iglobals, IGLOBALS_COMPREG_HASH); - - if (PMC_IS_NULL(hash)) { - /* No compiler has been registered yet */ - return PMCNULL; - } - - /* Fetch the compiler */ - return VTABLE_get_pmc_keyed_str(interp, hash, type); -} - -/* - -=item C - -Register a parser/compiler PMC. - -=cut - -*/ - -PARROT_EXPORT -void -Parrot_set_compiler(PARROT_INTERP, ARGIN(STRING *type), ARGIN(PMC *compiler)) -{ - ASSERT_ARGS(Parrot_set_compiler) - PMC * const iglobals = interp->iglobals; - PMC * hash = VTABLE_get_pmc_keyed_int(interp, interp->iglobals, - IGLOBALS_COMPREG_HASH); - - if (PMC_IS_NULL(hash)) { - hash = Parrot_pmc_new_noinit(interp, enum_class_Hash); - VTABLE_init(interp, hash); - VTABLE_set_pmc_keyed_int(interp, iglobals, - (INTVAL)IGLOBALS_COMPREG_HASH, hash); - } - - VTABLE_set_pmc_keyed_str(interp, hash, type, compiler); -} - -/* - -=item C - -Compile code file. - -TODO: This should take a PMC* option for the compiler to use. Do not assume -we have PIR/PASM compilers installed, and do not assume that the user is -going to want to use either of these. TT #2135. - -=cut - -*/ - -PARROT_EXPORT -PARROT_CANNOT_RETURN_NULL -PMC * -Parrot_compile_file(PARROT_INTERP, ARGIN(STRING *fullname), INTVAL is_pasm) -{ - ASSERT_ARGS(Parrot_compile_file) - PMC *result = NULL; - UINTVAL regs_used[4] = {3, 3, 3, 3}; - PMC * const newcontext = Parrot_push_context(interp, regs_used); - STRING * const compiler_s = is_pasm ? CONST_STRING(interp, "PASM") : CONST_STRING(interp, "PIR"); - PMC * compiler = Parrot_get_compiler(interp, compiler_s); - imc_info_t *imcc = (imc_info_t *) VTABLE_get_pointer(interp, compiler); - - Parrot_block_GC_mark(interp); - Parrot_pcc_set_HLL(interp, newcontext, 0); - Parrot_pcc_set_sub(interp, newcontext, 0); - - - imcc_reset(imcc); - result = imcc_compile_file(imcc, fullname, is_pasm); - if (PMC_IS_NULL(result)) { - STRING * const msg = imcc_last_error_message(imcc); - INTVAL code = imcc_last_error_code(imcc); - Parrot_ex_throw_from_c_args(interp, NULL, code, "%Ss", msg); - } - - Parrot_pop_context(interp); - Parrot_unblock_GC_mark(interp); - - return result; -} - -/* - -=item C - -Compiles a code string. - -DEPRECATED: Use Parrot_compile_file (or whatever replaces it, TT #2135). - -=cut - -*/ - -PARROT_EXPORT -PARROT_CAN_RETURN_NULL -PARROT_WARN_UNUSED_RESULT -Parrot_PMC -Parrot_compile_string(PARROT_INTERP, Parrot_String type, ARGIN(const char *code), - ARGOUT(Parrot_String *error)) -{ - ASSERT_ARGS(Parrot_compile_string) - PMC * const compiler = Parrot_get_compiler(interp, type); - - /* XXX error is not being set */ - if (PMC_IS_NULL(compiler)) { - Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_UNEXPECTED_NULL, - "Could not find compiler %Ss", type); - } - else { - PMC *result; - STRING * const code_s = Parrot_str_new(interp, code, 0); - imc_info_t * imcc = (imc_info_t*) VTABLE_get_pointer(interp, compiler); - const INTVAL is_pasm = VTABLE_get_integer(interp, compiler); - - Parrot_block_GC_mark(interp); - result = imcc_compile_string(imcc, code_s, is_pasm); - if (PMC_IS_NULL(result)) { - STRING * const msg = imcc_last_error_message(imcc); - const INTVAL code = imcc_last_error_code(imcc); - - Parrot_unblock_GC_mark(interp); - Parrot_ex_throw_from_c_args(interp, NULL, code, "%Ss", msg); - } - Parrot_unblock_GC_mark(interp); - return result; - } -} - -/* - -=item C - -C specifies the type of information you want about the interpreter. - -=cut - -*/ - -PARROT_EXPORT -PARROT_WARN_UNUSED_RESULT -INTVAL -interpinfo(PARROT_INTERP, INTVAL what) -{ - ASSERT_ARGS(interpinfo) - INTVAL ret; - - switch (what) { - case TOTAL_MEM_ALLOC: - ret = Parrot_gc_total_memory_allocated(interp); - break; - case TOTAL_MEM_USED: - ret = Parrot_gc_total_memory_used(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: - ret = interp->run_core->id; - break; - default: /* or a warning only? */ - ret = -1; - Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_UNIMPLEMENTED, - "illegal argument in interpinfo"); - } - return ret; -} - -/* - -=item C - -C specifies the type of information you want about the -interpreter. - -=cut - -*/ - -PARROT_EXPORT -PARROT_WARN_UNUSED_RESULT -PARROT_CANNOT_RETURN_NULL -PMC* -interpinfo_p(PARROT_INTERP, INTVAL what) -{ - ASSERT_ARGS(interpinfo_p) - - PMC *result; - switch (what) { - case CURRENT_CTX: - result = CURRENT_CONTEXT(interp); - break; - case CURRENT_SUB: - result = Parrot_pcc_get_sub(interp, CURRENT_CONTEXT(interp)); - break; - case CURRENT_CONT: - result = Parrot_pcc_get_continuation(interp, CURRENT_CONTEXT(interp)); - break; - case CURRENT_OBJECT: - result = Parrot_pcc_get_object(interp, CURRENT_CONTEXT(interp)); - break; - case CURRENT_LEXPAD: - result = Parrot_pcc_get_lex_pad(interp, CURRENT_CONTEXT(interp)); - break; - default: /* or a warning only? */ - Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_UNIMPLEMENTED, - "illegal argument in interpinfo"); - } - - /* Don't send NULL values to P registers */ - return result ? result : PMCNULL; -} - -/* - -=item C - -Takes an interpreter name and an information type as arguments. -Returns corresponding information strings about the interpreter: -the full pathname, executable name, or the file stem, -(or throws an error exception, if the type is not recognized). -Valid types are EXECUTABLE_FULLNAME, EXECUTABLE_BASENAME, -and RUNTIME_PREFIX. - -=cut - -*/ - -PARROT_EXPORT -PARROT_WARN_UNUSED_RESULT -PARROT_CANNOT_RETURN_NULL -STRING* -interpinfo_s(PARROT_INTERP, INTVAL what) -{ - ASSERT_ARGS(interpinfo_s) - switch (what) { - case EXECUTABLE_FULLNAME: { - PMC * const exe_name = VTABLE_get_pmc_keyed_int(interp, interp->iglobals, - IGLOBALS_EXECUTABLE); - if (PMC_IS_NULL(exe_name)) - return CONST_STRING(interp, ""); - return VTABLE_get_string(interp, exe_name); - } - case EXECUTABLE_BASENAME: { - PMC * const exe_name = VTABLE_get_pmc_keyed_int(interp, - interp->iglobals, IGLOBALS_EXECUTABLE); - - if (PMC_IS_NULL(exe_name)) - return CONST_STRING(interp, ""); - - else { - /* Need to strip back to what follows the final / or \. */ - STRING * const fullname = VTABLE_get_string(interp, exe_name); - const int len = STRING_length(fullname); - int pos; - - for (pos = len - 1; pos > 0; --pos) { - const INTVAL c = STRING_ord(interp, fullname, pos); - - if (c == '/' || c == '\\') { - ++pos; - break; - } - } - - return Parrot_str_substr(interp, fullname, pos, len - pos); - } - } - case RUNTIME_PREFIX: - return Parrot_get_runtime_path(interp); - case GC_SYS_NAME: { - STRING * name = Parrot_gc_sys_name(interp); - Parrot_warn_experimental(interp, "GC_SYS_NAME option is experimental"); - return name; - } - default: - Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_UNIMPLEMENTED, - "illegal argument in interpinfo"); - } -} - -/* - -=item C - -C is a ParrotInterpreter PMC. Extract the raw C from it -without needing an existing C reference. - -Do not use with any other type of PMC. - -=cut - -*/ - -PARROT_EXPORT -PARROT_CANNOT_RETURN_NULL -Interp * -Parrot_int_get_interp_from_pmc(ARGIN(PMC * interp_pmc)) -{ - ASSERT_ARGS(Parrot_int_get_interp_from_pmc) - PARROT_ASSERT(interp_pmc->vtable->base_type == enum_class_ParrotInterpreter); - return ((Parrot_ParrotInterpreter_attributes*)interp_pmc->data)->interp; -} - -/* - -=item C - -Sets on any of the following flags, specified by C, in the interpreter: - -Flag Effect -C enable bounds checking -C enable profiling, - -=cut - -*/ - -PARROT_EXPORT -void -Parrot_set_flag(PARROT_INTERP, INTVAL flag) -{ - ASSERT_ARGS(Parrot_set_flag) - /* These two macros (from interpreter.h) do exactly what they look like. */ - - Interp_flags_SET(interp, flag); - switch (flag) { - case PARROT_BOUNDS_FLAG: - case PARROT_PROFILE_FLAG: - Parrot_runcore_switch(interp, Parrot_str_new_constant(interp, "slow")); - break; - default: - break; - } -} - - -/* - -=item C - -Set a debug flag: C. - -=cut - -*/ - -PARROT_EXPORT -void -Parrot_set_debug(PARROT_INTERP, UINTVAL flag) -{ - ASSERT_ARGS(Parrot_set_debug) - interp->debug_flags |= flag; -} - - -/* - -=item C - -Sets the name of the executable launching Parrot (see C and the -C binary). - -=cut - -*/ - -PARROT_EXPORT -void -Parrot_set_executable_name(PARROT_INTERP, ARGIN(STRING * const name)) -{ - ASSERT_ARGS(Parrot_set_executable_name) - PMC * const name_pmc = Parrot_pmc_new(interp, enum_class_String); - VTABLE_set_string_native(interp, name_pmc, name); - VTABLE_set_pmc_keyed_int(interp, interp->iglobals, IGLOBALS_EXECUTABLE, - name_pmc); -} - - -/* - -=item C - -Set a trace flag: C - -=cut - -*/ - -PARROT_EXPORT -void -Parrot_set_trace(PARROT_INTERP, UINTVAL flag) -{ - ASSERT_ARGS(Parrot_set_trace) - Parrot_pcc_trace_flags_on(interp, interp->ctx, flag); - Parrot_runcore_switch(interp, Parrot_str_new_constant(interp, "slow")); -} - - -/* - -=item C - -Clears a flag in the interpreter. - -=cut - -*/ - -PARROT_EXPORT -void -Parrot_clear_flag(PARROT_INTERP, INTVAL flag) -{ - ASSERT_ARGS(Parrot_clear_flag) - Interp_flags_CLEAR(interp, flag); -} - - -/* - -=item C - -Clears a flag in the interpreter. - -=cut - -*/ - -PARROT_EXPORT -void -Parrot_clear_debug(PARROT_INTERP, UINTVAL flag) -{ - ASSERT_ARGS(Parrot_clear_debug) - interp->debug_flags &= ~flag; -} - - -/* - -=item C - -Clears a flag in the interpreter. - -=cut - -*/ - -PARROT_EXPORT -void -Parrot_clear_trace(PARROT_INTERP, UINTVAL flag) -{ - ASSERT_ARGS(Parrot_clear_trace) - Parrot_pcc_trace_flags_off(interp, interp->ctx, flag); -} - - -/* - -=item C - -Test the interpreter flags specified in C. - -=cut - -*/ - -PARROT_EXPORT -PARROT_PURE_FUNCTION -Parrot_Int -Parrot_test_flag(PARROT_INTERP, INTVAL flag) -{ - ASSERT_ARGS(Parrot_test_flag) - return Interp_flags_TEST(interp, flag); -} - - -/* - -=item C - -Test the interpreter flags specified in C. - -=cut - -*/ - -PARROT_EXPORT -PARROT_PURE_FUNCTION -Parrot_UInt -Parrot_test_debug(PARROT_INTERP, UINTVAL flag) -{ - ASSERT_ARGS(Parrot_test_debug) - return interp->debug_flags & flag; -} - - -/* - -=item C - -Test the interpreter flags specified in C. - -=cut - -*/ - -PARROT_EXPORT -PARROT_PURE_FUNCTION -Parrot_UInt -Parrot_test_trace(PARROT_INTERP, UINTVAL flag) -{ - ASSERT_ARGS(Parrot_test_trace) - return Parrot_pcc_trace_flags_test(interp, interp->ctx, flag); -} - - -/* - -=item C - -Sets the specified run core. - -=cut - -*/ - -PARROT_EXPORT -void -Parrot_set_run_core(PARROT_INTERP, Parrot_Run_core_t core) -{ - ASSERT_ARGS(Parrot_set_run_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_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"); - } -} - - -/* - -=item C - -Activates the given warnings. - -=cut - -*/ - -PARROT_EXPORT -void -Parrot_setwarnings(PARROT_INTERP, Parrot_warnclass wc) -{ - ASSERT_ARGS(Parrot_setwarnings) - /* Activates the given warnings. (Macro from warnings.h.) */ - PARROT_WARNINGS_on(interp, wc); -} - -/* - -=back - -=cut - -*/ - -/* - * Local variables: - * c-file-style: "parrot" - * End: - * vim: expandtab shiftwidth=4 cinoptions='\:2=2' : - */ diff --git a/src/io/api.c b/src/io/api.c index 074a447912..d6ac643f71 100644 --- a/src/io/api.c +++ b/src/io/api.c @@ -1047,6 +1047,28 @@ Parrot_io_is_tty_handle(PARROT_INTERP, ARGIN(PMC *pmc)) /* +=item C + +Returns a boolean value indicating whether C<*pmc> is a non-blocking + +=cut + +*/ + +PARROT_EXPORT +PARROT_WARN_UNUSED_RESULT +INTVAL +Parrot_io_is_async(PARROT_INTERP, ARGMOD(PMC *pmc)) +{ + ASSERT_ARGS(Parrot_io_is_async) + if (Parrot_io_is_closed(interp, pmc)) + return 0; + + return (Parrot_io_get_flags(interp, pmc) & PIO_F_ASYNC) ? 1 : 0; +} + +/* + =back =head2 C Functions diff --git a/src/io/buffer.c b/src/io/buffer.c index 751612bc36..fe2a58bfc9 100644 --- a/src/io/buffer.c +++ b/src/io/buffer.c @@ -188,7 +188,7 @@ Parrot_io_flush_buffer(PARROT_INTERP, ARGMOD(PMC *filehandle)) */ if (buffer_flags & PIO_BF_WRITEBUF) { /* Flush to next layer */ - size_t to_write = buffer_next - buffer_start; + const size_t to_write = buffer_next - buffer_start; size_t wrote; PIOHANDLE os_handle; @@ -231,8 +231,8 @@ size_t Parrot_io_fill_readbuf(PARROT_INTERP, ARGMOD(PMC *filehandle)) { ASSERT_ARGS(Parrot_io_fill_readbuf) - unsigned char *buf = Parrot_io_get_buffer_start(interp, filehandle); - size_t size = Parrot_io_get_buffer_size(interp, filehandle); + unsigned char * const buf = Parrot_io_get_buffer_start(interp, filehandle); + const size_t size = Parrot_io_get_buffer_size(interp, filehandle); size_t got; PIOHANDLE os_handle; @@ -269,8 +269,7 @@ The buffer layer's C function. PARROT_WARN_UNUSED_RESULT size_t -Parrot_io_read_buffer(PARROT_INTERP, ARGMOD(PMC *filehandle), - ARGMOD(char *dest), size_t len) +Parrot_io_read_buffer(PARROT_INTERP, ARGMOD(PMC *filehandle), ARGOUT(char *dest), size_t len) { ASSERT_ARGS(Parrot_io_read_buffer) unsigned char *buffer_next, *buffer_end; @@ -764,8 +763,8 @@ Parrot_io_seek_buffer(PARROT_INTERP, ARGMOD(PMC *filehandle), PIOOFF_T offset, INTVAL whence) { ASSERT_ARGS(Parrot_io_seek_buffer) - INTVAL buffer_flags = Parrot_io_get_buffer_flags(interp, filehandle); - PIOOFF_T file_pos = Parrot_io_get_file_position(interp, filehandle); + const INTVAL buffer_flags = Parrot_io_get_buffer_flags(interp, filehandle); + const PIOOFF_T file_pos = Parrot_io_get_file_position(interp, filehandle); PIOHANDLE os_handle; if (whence == SEEK_CUR) { diff --git a/src/io/io_private.h b/src/io/io_private.h index 3b333fabc8..8d334bf4bd 100644 --- a/src/io/io_private.h +++ b/src/io/io_private.h @@ -25,7 +25,6 @@ Some ideas from AT&T SFIO. #define PARROT_IO_PRIVATE_H_GUARD #define PARROT_IN_IO 1 -#define PARROT_ASYNC_DEVEL 0 #include diff --git a/src/key.c b/src/key.c index 753eb9f07b..3973569231 100644 --- a/src/key.c +++ b/src/key.c @@ -373,7 +373,7 @@ Parrot_key_next(PARROT_INTERP, ARGIN(PMC *key)) { ASSERT_ARGS(Parrot_key_next) - if (VTABLE_isa(interp, key, CONST_STRING(interp, "Key"))) { + if (key->vtable->base_type == enum_class_Key || VTABLE_isa(interp, key, CONST_STRING(interp, "Key"))) { PMC *next_key; GETATTR_Key_next_key(interp, key, next_key); return next_key; @@ -445,11 +445,9 @@ Parrot_key_mark(PARROT_INTERP, ARGIN(PMC *key)) Parrot_gc_mark_STRING_alive(interp, str_key); } - /* Mark next key */ - if ((flags == KEY_string_FLAG) || (flags == KEY_pmc_FLAG)) { - GETATTR_Key_next_key(interp, key, next_key); - Parrot_gc_mark_PMC_alive(interp, next_key); - } + /* Mark next key or PMC portion of the key */ + GETATTR_Key_next_key(interp, key, next_key); + Parrot_gc_mark_PMC_alive(interp, next_key); } diff --git a/src/misc.c b/src/misc.c index d5713a943e..ec4a993702 100644 --- a/src/misc.c +++ b/src/misc.c @@ -271,6 +271,97 @@ Parrot_secret_snprintf(ARGOUT(char *buffer), SHIM(size_t len), ARGIN(const char return retval; } +/* + +=item C + +Writes a C string format with a varargs list to a PIO. + +=item C + +Writes a C string format with varargs to a PIO. + +=item C + +Writes a C string format with varargs to C + +=item C + +Writes a C string format with varargs to C. + +=cut + +*/ + +PARROT_EXPORT +int +Parrot_vfprintf(PARROT_INTERP, ARGIN(Parrot_PMC pio), + ARGIN(const char *s), va_list args) +{ + ASSERT_ARGS(Parrot_vfprintf) + STRING * str; + INTVAL retval; + + str = Parrot_vsprintf_c(interp, s, args); + retval = Parrot_io_putps(interp, pio, str); + + return retval; +} + +PARROT_EXPORT +int +Parrot_fprintf(PARROT_INTERP, ARGIN(Parrot_PMC pio), + ARGIN(const char *s), ...) +{ + ASSERT_ARGS(Parrot_fprintf) + va_list args; + INTVAL retval; + + va_start(args, s); + retval = Parrot_vfprintf(interp, pio, s, args); + va_end(args); + + return retval; +} + +PARROT_EXPORT +int +Parrot_printf(NULLOK_INTERP, ARGIN(const char *s), ...) +{ + ASSERT_ARGS(Parrot_printf) + va_list args; + INTVAL retval; + va_start(args, s); + + if (interp) + retval = Parrot_vfprintf(interp, Parrot_io_STDOUT(interp), s, args); + else + retval = vfprintf(stdout, s, args); + va_end(args); + + return retval; +} + +PARROT_EXPORT +int +Parrot_eprintf(NULLOK_INTERP, ARGIN(const char *s), ...) +{ + ASSERT_ARGS(Parrot_eprintf) + va_list args; + INTVAL retval; + + va_start(args, s); + + if (interp) + retval = Parrot_vfprintf(interp, Parrot_io_STDERR(interp), s, args); + else + retval = vfprintf(stderr, s, args); + + va_end(args); + + return retval; +} /* diff --git a/src/multidispatch.c b/src/multidispatch.c index 662fb95d06..0f0928b723 100644 --- a/src/multidispatch.c +++ b/src/multidispatch.c @@ -388,7 +388,7 @@ mmd_build_type_tuple_from_type_list(PARROT_INTERP, ARGIN(PMC *type_list)) { ASSERT_ARGS(mmd_build_type_tuple_from_type_list) INTVAL param_count = VTABLE_elements(interp, type_list); - PMC *multi_sig = Parrot_pmc_new_constant_init_int(interp, + PMC *multi_sig = Parrot_pmc_new_init_int(interp, enum_class_FixedIntegerArray, param_count); INTVAL i; @@ -899,7 +899,7 @@ mmd_add_multi_global(PARROT_INTERP, ARGIN(STRING *sub_name), ARGIN(PMC *sub_obj) PMC *multi_sub = Parrot_ns_get_global(interp, ns, sub_name); if (PMC_IS_NULL(multi_sub)) { - multi_sub = Parrot_pmc_new_constant(interp, enum_class_MultiSub); + multi_sub = Parrot_pmc_new(interp, enum_class_MultiSub); Parrot_ns_set_global(interp, ns, sub_name, multi_sub); } @@ -1010,7 +1010,7 @@ Parrot_mmd_add_multi_from_c_args(PARROT_INTERP, STRING *ns_name = VTABLE_get_string_keyed_int(interp, type_list, 0); /* Create an NCI sub for the C function */ - PMC *sub_obj = Parrot_pmc_new_constant(interp, enum_class_NCI); + PMC *sub_obj = Parrot_pmc_new(interp, enum_class_NCI); PMC *multi_sig = mmd_build_type_tuple_from_long_sig(interp, long_sig_str); diff --git a/src/namespace.c b/src/namespace.c index a007984c98..3a5e925d3a 100644 --- a/src/namespace.c +++ b/src/namespace.c @@ -668,7 +668,7 @@ Parrot_ns_find_global_from_op(PARROT_INTERP, ARGIN(PMC *ns), =item C -TT #1223 - THIS IS BROKEN - it doesn't walk up the scopes yet +GH #563 - THIS IS BROKEN - it doesn't walk up the scopes yet Find the given C in lexicals, then the current namespace, then the HLL root namespace, and finally Parrot builtins. If the name isn't found @@ -692,7 +692,7 @@ Parrot_ns_find_named_item(PARROT_INTERP, ARGIN(STRING *name), ARGIN(SHIM(void *n if (!PMC_IS_NULL(lex_pad)) { g = VTABLE_get_pmc_keyed_str(interp, lex_pad, name); - /* TT #1223 - walk up the scopes! duh!! */ + /* GH #563 - walk up the scopes! duh!! */ if (!PMC_IS_NULL(g)) return g; } @@ -764,6 +764,26 @@ Parrot_ns_store_sub(PARROT_INTERP, ARGIN(PMC *sub_pmc)) /* +=item C + +Return the root namespace + +=cut + +*/ + +PARROT_EXPORT +PARROT_PURE_FUNCTION +Parrot_PMC +Parrot_ns_get_root_namespace(PARROT_INTERP) +{ + ASSERT_ARGS(Parrot_ns_get_root_namespace) + + return interp->root_namespace; +} + +/* + =back =head1 SEE ALSO diff --git a/src/nci/libffi.c b/src/nci/libffi.c index f93e25c1f9..5573bb78bf 100644 --- a/src/nci/libffi.c +++ b/src/nci/libffi.c @@ -36,6 +36,14 @@ This file implements a native call frame (thunk) factory using libffi. # define ffi_type_parrot_numval ffi_type_double #elif(NUMVAL_SIZE == 12) # define ffi_type_parrot_numval ffi_type_longdouble +#elif(NUMVAL_SIZE == 16) +# if PARROT_HAS_LONGLONG +# if (LONGLONG_SIZE == 8) +# define ffi_type_parrot_numval ffi_type_sint64 +# else +# error "unhandled long long size" +# endif +# endif #else # error "unhandled NUMVAL_SIZE value" #endif @@ -652,7 +660,7 @@ call_ffi_thunk(PARROT_INTERP, ARGMOD(PMC *nci_pmc), ARGMOD(PMC *self)) call_arg[1] = &call_object; call_arg[2] = &pcc_ret_sig; - /* populate return slot (non-existant if void) */ + /* populate return slot (non-existent if void) */ if (enum_type_void != (arg_t = (PARROT_DATA_TYPE)VTABLE_get_integer_keyed_int(interp, nci->signature, 0))) { prep_pcc_ret_arg(interp, arg_t, &pcc_retv[i], &call_arg[i + 3], return_data); diff --git a/src/nci_test.c b/src/nci_test.c index 2862b0c5c5..63dbbb1b8f 100644 --- a/src/nci_test.c +++ b/src/nci_test.c @@ -1065,12 +1065,6 @@ nci_cstring_cstring(const char * src) return buffer; } -/* - -=cut - -*/ - #ifdef TEST char l2 = 4; diff --git a/src/oo.c b/src/oo.c index 0247e3b1db..eb52c812b8 100644 --- a/src/oo.c +++ b/src/oo.c @@ -442,6 +442,25 @@ Parrot_oo_get_class_str(PARROT_INTERP, ARGIN_NULLOK(STRING *name)) } } +/* + +=item C + +Create a class with the type given + +=cut + +*/ + +PARROT_EXPORT +PARROT_CANNOT_RETURN_NULL +PMC * +Parrot_oo_new_class_pmc(PARROT_INTERP, ARGIN(PMC *classtype)) +{ + ASSERT_ARGS(Parrot_oo_new_class_pmc) + return Parrot_pmc_new_init(interp, enum_class_Class, classtype); +} + /* @@ -699,22 +718,15 @@ Parrot_oo_register_type(PARROT_INTERP, ARGIN(PMC *name), ARGIN(PMC *_namespace)) Parrot_str_escape(interp, classname)); } - /* Type doesn't exist, so go ahead and register it. Lock interpreter so - * pt_shared_fixup() can safely do a type lookup. */ - LOCK_INTERPRETER(interp); - { - type = Parrot_pmc_get_new_vtable_index(interp); - } - { - if (!typeid_exists) { - /* set entry in name->type hash */ - PMC * const classname_hash = interp->class_hash; - PMC * const item = Parrot_pmc_new_init_int(interp, - enum_class_Integer, type); - VTABLE_set_pmc_keyed(interp, classname_hash, name, item); - } + /* Type doesn't exist, so go ahead and register it. */ + type = Parrot_pmc_get_new_vtable_index(interp); + if (!typeid_exists) { + /* set entry in name->type hash */ + PMC * const classname_hash = interp->class_hash; + PMC * const item = Parrot_pmc_new_init_int(interp, + enum_class_Integer, type); + VTABLE_set_pmc_keyed(interp, classname_hash, name, item); } - UNLOCK_INTERPRETER(interp); return type; } @@ -1221,7 +1233,7 @@ Used by the Class and Object PMCs internally to compose a role into either of them. The C parameter is the role that we are composing into the class or role. C is the hash of method names to invokable PMCs that contains the methods the class or role has. C is the list of roles -the the class or method does. +the class or method does. The C parameter is only dealt with by its external interface. Whether this routine is usable by any other object system implemented in Parrot very diff --git a/src/ops/core.ops b/src/ops/core.ops index 27f8d13d08..0ed3bcbb3a 100644 --- a/src/ops/core.ops +++ b/src/ops/core.ops @@ -5,12 +5,15 @@ BEGIN_OPS_PREAMBLE #include "parrot/dynext.h" -#include "parrot/embed.h" #include "parrot/runcore_api.h" +#include "parrot/events.h" +#include "pmc/pmc_exception.h" +#include "pmc/pmc_exceptionhandler.h" #include "pmc/pmc_continuation.h" #include "pmc/pmc_fixedintegerarray.h" #include "pmc/pmc_parrotlibrary.h" + END_OPS_PREAMBLE =head1 NAME @@ -93,19 +96,25 @@ actions on it. =cut inline op noop() :base_core { + UNUSED(interp); + UNUSED(CUR_OPCODE); } inline op check_events() :base_core :flow { - opcode_t * const next = expr NEXT(); - Parrot_cx_check_tasks(interp, interp->scheduler); + opcode_t *next = expr NEXT(); + next = Parrot_cx_check_scheduler(interp, next); goto ADDRESS(next); /* force this being a branch op */ } inline op check_events__() :internal :flow { opcode_t * const _this = CUR_OPCODE; + opcode_t * const handler = Parrot_ex_throw_from_op_args(interp, _this, + EXCEPTION_INVALID_OPERATION, + "check_events__ opcode doesn't do anything useful."); + goto ADDRESS(handler); /* Restore op_func_table. */ - disable_event_checking(interp); - Parrot_cx_handle_tasks(interp, interp->scheduler); + Parrot_runcore_disable_event_checking(interp); + /* Parrot_cx_handle_tasks(interp, interp->scheduler); */ goto ADDRESS(_this); /* force this being a branch op */ } @@ -151,6 +160,8 @@ Branch forward or backward by the amount in $1. =cut inline op branch(in LABEL) :base_loop :flow { + if(Parrot_cx_check_scheduler(interp, cur_opcode + $1) == 0) + goto ADDRESS(0); goto OFFSET($1); } @@ -368,9 +379,7 @@ inline op invokecc(invar PMC) :flow { Parrot_pcc_set_pc(interp, CURRENT_CONTEXT(interp), dest); - if (!PMC_IS_NULL(signature)) - Parrot_pcc_set_object(interp, signature, NULL); - interp->current_cont = NEED_CONTINUATION; + Parrot_pcc_reuse_continuation(interp, CURRENT_CONTEXT(interp), dest); dest = VTABLE_invoke(interp, p, dest); goto ADDRESS(dest); @@ -384,8 +393,6 @@ inline op invoke(invar PMC, invar PMC) :flow { Parrot_pcc_set_pc(interp, CURRENT_CONTEXT(interp), dest); - if (!PMC_IS_NULL(signature)) - Parrot_pcc_set_object(interp, signature, NULL); interp->current_cont = $2; dest = VTABLE_invoke(interp, p, dest); @@ -704,6 +711,24 @@ Finalize exception handling, freeing any information needed to resume the handled exception, like inner runloops. $1 is the Exception handled or the ExceptionHandler that is handling it. +=item B(in PMC) + +Pops all exception handlers upto the one indicated by $1. Like with the +finalize op, $1 can either be the handled Exception or the ExceptionHandler +handling it. Also, you should not resume Exceptions after pop_upto_eh +or finalize has been called. This limitation may be fixed in a future +version of parrot. Also note that the specified exception handler +is not popped. + +=item B(out PMC) + +Returns the caught exception without clearing the call object. This is +currently needed because HLL authors use get_params to fetch the exception, +but get_params clears the call object. So we can't use get_params in PCT +to get the exception object without disturbing the HLL code. +This op will be removed again when PCT offers another mechansim to get +the exception and the HLLs switched to it. + =cut inline op push_eh(inconst LABEL) { @@ -717,15 +742,14 @@ inline op push_eh(invar PMC) { } inline op pop_eh() { - Parrot_cx_delete_handler_local(interp, - Parrot_str_new_constant(interp, "exception")); + Parrot_cx_delete_handler_local(interp); } inline op throw(invar PMC) :flow { PMC * except = $1; opcode_t *dest; opcode_t * const ret = expr NEXT(); - PMC * const resume = pmc_new(interp, enum_class_Continuation); + PMC * const resume = Parrot_pmc_new(interp, enum_class_Continuation); STRING * const exception_str = Parrot_str_new_constant(interp, "Exception"); VTABLE_set_pointer(interp, resume, ret); @@ -772,16 +796,15 @@ inline op rethrow(invar PMC) :flow { } inline op count_eh(out INT) { - $1 = Parrot_cx_count_handlers_local(interp, - Parrot_str_new_constant(interp, "exception")); + $1 = Parrot_cx_count_handlers_local(interp); } inline op die(in STR) :flow { opcode_t *dest; opcode_t * const ret = expr NEXT(); - PMC * const resume = pmc_new(interp, enum_class_Continuation); + PMC * const resume = Parrot_pmc_new(interp, enum_class_Continuation); PMC * const exception = Parrot_ex_build_exception(interp, EXCEPT_error, - CONTROL_ERROR, $1); + EXCEPTION_DIE, $1); VTABLE_set_pointer(interp, resume, ret); @@ -794,10 +817,10 @@ inline op die(in STR) :flow { inline op die(in PMC) :flow { opcode_t *dest; opcode_t * const ret = expr NEXT(); - PMC * const resume = pmc_new(interp, enum_class_Continuation); + PMC * const resume = Parrot_pmc_new(interp, enum_class_Continuation); STRING * const msg = PMC_IS_NULL($1) ? NULL : VTABLE_get_string(interp, $1); PMC * const exception = - Parrot_ex_build_exception(interp, EXCEPT_error, CONTROL_ERROR, msg); + Parrot_ex_build_exception(interp, EXCEPT_error, EXCEPTION_DIE, msg); VTABLE_set_pointer(interp, resume, ret); @@ -811,10 +834,16 @@ inline op die(in INT, in INT) :flow { if ($1 == EXCEPT_doomed) _exit($2); else { + opcode_t *dest; opcode_t * const ret = expr NEXT(); + PMC * const resume = Parrot_pmc_new(interp, enum_class_Continuation); PMC * const exception = Parrot_ex_build_exception(interp, $1, $2, NULL); - opcode_t * const dest = Parrot_ex_throw_from_op(interp, exception, ret); + VTABLE_set_pointer(interp, resume, ret); + + VTABLE_set_attr_str(interp, exception, + Parrot_str_new_constant(interp, "resume"), resume); + dest = Parrot_ex_throw_from_op(interp, exception, ret); goto ADDRESS(dest); } } @@ -822,7 +851,7 @@ inline op die(in INT, in INT) :flow { inline op exit(in INT) :flow { opcode_t *dest; opcode_t * const ret = expr NEXT(); - PMC * const resume = pmc_new(interp, enum_class_Continuation); + PMC * const resume = Parrot_pmc_new(interp, enum_class_Continuation); PMC * const exception = Parrot_ex_build_exception(interp, EXCEPT_exit, CONTROL_EXIT, NULL); @@ -839,31 +868,22 @@ inline op exit(in INT) :flow { op finalize(in PMC) { /* Go to the next op after loop unrolling */ opcode_t * const dest = expr NEXT(); - PMC *eh = PMCNULL; - if (!PMC_IS_NULL($1)) { - /* If isa ExceptionHandler, use it. If isa Exception, get its active handler */ - if (VTABLE_isa(interp, $1, Parrot_str_new_constant(interp, "ExceptionHandler"))) - eh = $1; - else if (VTABLE_isa(interp, $1, Parrot_str_new_constant(interp, "Exception"))) { - PMC * const iter = VTABLE_get_attr_str(interp, - $1, Parrot_str_new_constant(interp, "handler_iter")); - if (!PMC_IS_NULL(iter)) - eh = VTABLE_get_pmc_keyed_int(interp, iter, -1); - } - } + PMC *eh = Parrot_ex_get_current_handler(interp, $1); if (!PMC_IS_NULL(eh)) { /* Get the runloop_id from the continuation and jump to it. */ Parrot_runloop *rl = interp->current_runloop; INTVAL rid; - Parrot_pcc_invoke_method_from_c_args(interp, - eh, Parrot_str_new_constant(interp, "rid"), - "->I", &rid); + if (eh->vtable->base_type == enum_class_ExceptionHandler) + GETATTR_ExceptionHandler_runloop_id(interp, eh, rid); + else + Parrot_pcc_invoke_method_from_c_args(interp, + eh, Parrot_str_new_constant(interp, "rid"), "->I", &rid); while (rl && rl->id != rid) rl = rl->prev; if (rl) { if (rl != interp->current_runloop) { rl->handler_start = dest; - longjmp(rl->resume, 3); + longjmp(rl->resume, PARROT_JMP_EXCEPTION_FINALIZED); } } else @@ -872,6 +892,17 @@ op finalize(in PMC) { } } +op pop_upto_eh(in PMC) { + PMC *eh = Parrot_ex_get_current_handler(interp, $1); + if (!PMC_IS_NULL(eh)) + Parrot_cx_delete_upto_handler_local(interp, eh); +} + +op peek_exception(out PMC) { + PMC * const ctx = CURRENT_CONTEXT(interp); + PMC * const call_object = Parrot_pcc_get_signature(interp, ctx); + $1 = VTABLE_get_pmc_keyed_int(interp, call_object, 0); +} =back @@ -912,7 +943,7 @@ If $1 is zero, turn off byte code bounds checking. Otherwise turn it on. =cut inline op bounds(in INT) :flow { - if ($1 != 0) { Parrot_set_flag(interp, PARROT_BOUNDS_FLAG); } + if ($1 != 0) { Parrot_interp_set_flag(interp, PARROT_BOUNDS_FLAG); } else { Interp_flags_CLEAR(interp, PARROT_BOUNDS_FLAG); } restart NEXT(); } @@ -927,7 +958,7 @@ If $1 is zero, turn off profiling. Otherwise turn it on. =cut inline op profile(in INT) :flow { - if ($1 != 0) { Parrot_set_flag(interp, PARROT_PROFILE_FLAG); } + if ($1 != 0) { Parrot_interp_set_flag(interp, PARROT_PROFILE_FLAG); } else { Interp_flags_CLEAR(interp, PARROT_PROFILE_FLAG); } restart NEXT(); } @@ -942,8 +973,8 @@ If $1 is zero, turn off tracing. Otherwise turn trace flag $1 on. =cut inline op trace(in INT) :flow { - if ($1 != 0) { Parrot_set_trace(interp, $1); } - else { Parrot_clear_trace(interp, PARROT_ALL_TRACE_FLAGS); } + if ($1 != 0) { Parrot_interp_set_trace(interp, $1); } + else { Parrot_interp_clear_trace(interp, PARROT_ALL_TRACE_FLAGS); } restart NEXT(); } @@ -966,7 +997,7 @@ inline op gc_debug(in INT) { Fetch some piece of information about the interpreter and put it in $1. Possible values for $2 are defined in F. -The valid constants for each return value are (excluding the the .INTERPINFO_ +The valid constants for each return value are (excluding the .INTERPINFO_ prefix): =over 4 @@ -984,22 +1015,22 @@ CURRENT_SUB, CURRENT_CONT, CURRENT_OBJECT, CURRENT_LEXPAD =item B(out STR, in INT) -EXECUTABLE_FULLNAME, EXECUTABLE_BASENAME, RUNTIME_PREFIX +EXECUTABLE_FULLNAME, EXECUTABLE_BASENAME, RUNTIME_PREFIX, CURRENT_RUNCORE =back =cut op interpinfo(out INT, in INT) { - $1 = interpinfo(interp, $2); + $1 = Parrot_interp_info(interp, $2); } op interpinfo(out PMC, in INT) { - $1 = interpinfo_p(interp, $2); + $1 = Parrot_interp_info_p(interp, $2); } op interpinfo(out STR, in INT) { - STRING * const s = interpinfo_s(interp, $2); + STRING * const s = Parrot_interp_info_s(interp, $2); $1 = s; } @@ -1079,6 +1110,19 @@ inline op errorsoff(in INT) { PARROT_ERRORS_off(interp, $1); } +=item B(in STR) + +Switch the current runcore to the one with the specified name. +Needs to be an op, as we need to restart the runops() call. +You can get the name of the current runcore with the interpinfo op. + +=cut + +inline op set_runcore(in STR) { + Parrot_runcore_switch(interp, $1); + restart NEXT(); +} + ######################################## =item B(invar PMC, in LABEL) @@ -1440,7 +1484,7 @@ inline op annotations(out PMC, in STR) { =head1 COPYRIGHT -Copyright (C) 2001-2011, Parrot Foundation. +Copyright (C) 2001-2012, Parrot Foundation. =head1 LICENSE @@ -1455,5 +1499,3 @@ as the Parrot interpreter itself. * End: * vim: expandtab shiftwidth=4 cinoptions='\:2=2' : */ - - diff --git a/src/ops/core_ops.c b/src/ops/core_ops.c index c750bdf344..4f3e66c689 100644 --- a/src/ops/core_ops.c +++ b/src/ops/core_ops.c @@ -37,13 +37,16 @@ extern op_lib_t core_op_lib; #include "parrot/dynext.h" -#include "parrot/embed.h" #include "parrot/runcore_api.h" +#include "parrot/events.h" +#include "pmc/pmc_exception.h" +#include "pmc/pmc_exceptionhandler.h" #include "pmc/pmc_continuation.h" #include "pmc/pmc_fixedintegerarray.h" #include "pmc/pmc_parrotlibrary.h" + /* 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 @@ -69,13 +72,18 @@ extern op_lib_t core_op_lib; -INTVAL core_numops = 1092; +#include "parrot/scheduler_private.h" +#include "pmc/pmc_task.h" + + + +INTVAL core_numops = 1114; /* ** Op Function Table: */ -static op_func_t core_op_func_table[1092] = { +static op_func_t core_op_func_table[1114] = { Parrot_end, /* 0 */ Parrot_noop, /* 1 */ Parrot_check_events, /* 2 */ @@ -140,1033 +148,1055 @@ static op_func_t core_op_func_table[1092] = { Parrot_exit_ic, /* 61 */ Parrot_finalize_p, /* 62 */ Parrot_finalize_pc, /* 63 */ - Parrot_debug_i, /* 64 */ - Parrot_debug_ic, /* 65 */ - Parrot_bounds_i, /* 66 */ - Parrot_bounds_ic, /* 67 */ - Parrot_profile_i, /* 68 */ - Parrot_profile_ic, /* 69 */ - Parrot_trace_i, /* 70 */ - Parrot_trace_ic, /* 71 */ - Parrot_gc_debug_i, /* 72 */ - Parrot_gc_debug_ic, /* 73 */ - Parrot_interpinfo_i_i, /* 74 */ - Parrot_interpinfo_i_ic, /* 75 */ - Parrot_interpinfo_p_i, /* 76 */ - Parrot_interpinfo_p_ic, /* 77 */ - Parrot_interpinfo_s_i, /* 78 */ - Parrot_interpinfo_s_ic, /* 79 */ - Parrot_warningson_i, /* 80 */ - Parrot_warningson_ic, /* 81 */ - Parrot_warningsoff_i, /* 82 */ - Parrot_warningsoff_ic, /* 83 */ - Parrot_errorson_i, /* 84 */ - Parrot_errorson_ic, /* 85 */ - Parrot_errorsoff_i, /* 86 */ - Parrot_errorsoff_ic, /* 87 */ - Parrot_runinterp_p_i, /* 88 */ - Parrot_runinterp_p_ic, /* 89 */ - Parrot_getinterp_p, /* 90 */ - Parrot_sweep_ic, /* 91 */ - Parrot_collect, /* 92 */ - Parrot_sweepoff, /* 93 */ - Parrot_sweepon, /* 94 */ - Parrot_collectoff, /* 95 */ - Parrot_collecton, /* 96 */ - Parrot_needs_destroy_p, /* 97 */ - Parrot_loadlib_p_s, /* 98 */ - Parrot_loadlib_p_sc, /* 99 */ - Parrot_loadlib_p_s_p, /* 100 */ - Parrot_loadlib_p_sc_p, /* 101 */ - Parrot_loadlib_p_s_pc, /* 102 */ - Parrot_loadlib_p_sc_pc, /* 103 */ - Parrot_dlfunc_p_p_s_s, /* 104 */ - Parrot_dlfunc_p_p_sc_s, /* 105 */ - Parrot_dlfunc_p_p_s_sc, /* 106 */ - Parrot_dlfunc_p_p_sc_sc, /* 107 */ - Parrot_dlfunc_p_p_s_p, /* 108 */ - Parrot_dlfunc_p_p_sc_p, /* 109 */ - Parrot_dlvar_p_p_s, /* 110 */ - Parrot_dlvar_p_p_sc, /* 111 */ - Parrot_compreg_s_p, /* 112 */ - Parrot_compreg_sc_p, /* 113 */ - Parrot_compreg_p_s, /* 114 */ - Parrot_compreg_p_sc, /* 115 */ - Parrot_new_callback_p_p_p_s, /* 116 */ - Parrot_new_callback_p_p_p_sc, /* 117 */ - Parrot_annotations_p, /* 118 */ - Parrot_annotations_p_s, /* 119 */ - Parrot_annotations_p_sc, /* 120 */ - Parrot_band_i_i, /* 121 */ - Parrot_band_i_ic, /* 122 */ - Parrot_band_i_i_i, /* 123 */ - Parrot_band_i_ic_i, /* 124 */ - Parrot_band_i_i_ic, /* 125 */ - Parrot_bor_i_i, /* 126 */ - Parrot_bor_i_ic, /* 127 */ - Parrot_bor_i_i_i, /* 128 */ - Parrot_bor_i_ic_i, /* 129 */ - Parrot_bor_i_i_ic, /* 130 */ - Parrot_shl_i_i, /* 131 */ - Parrot_shl_i_ic, /* 132 */ - Parrot_shl_i_i_i, /* 133 */ - Parrot_shl_i_ic_i, /* 134 */ - Parrot_shl_i_i_ic, /* 135 */ - Parrot_shr_i_i, /* 136 */ - Parrot_shr_i_ic, /* 137 */ - Parrot_shr_i_i_i, /* 138 */ - Parrot_shr_i_ic_i, /* 139 */ - Parrot_shr_i_i_ic, /* 140 */ - Parrot_lsr_i_i, /* 141 */ - Parrot_lsr_i_ic, /* 142 */ - Parrot_lsr_i_i_i, /* 143 */ - Parrot_lsr_i_ic_i, /* 144 */ - Parrot_lsr_i_i_ic, /* 145 */ - Parrot_bxor_i_i, /* 146 */ - Parrot_bxor_i_ic, /* 147 */ - Parrot_bxor_i_i_i, /* 148 */ - Parrot_bxor_i_ic_i, /* 149 */ - Parrot_bxor_i_i_ic, /* 150 */ - Parrot_eq_i_i_ic, /* 151 */ - Parrot_eq_ic_i_ic, /* 152 */ - Parrot_eq_i_ic_ic, /* 153 */ - Parrot_eq_n_n_ic, /* 154 */ - Parrot_eq_nc_n_ic, /* 155 */ - Parrot_eq_n_nc_ic, /* 156 */ - Parrot_eq_s_s_ic, /* 157 */ - Parrot_eq_sc_s_ic, /* 158 */ - Parrot_eq_s_sc_ic, /* 159 */ - Parrot_eq_p_p_ic, /* 160 */ - Parrot_eq_p_i_ic, /* 161 */ - Parrot_eq_p_ic_ic, /* 162 */ - Parrot_eq_p_n_ic, /* 163 */ - Parrot_eq_p_nc_ic, /* 164 */ - Parrot_eq_p_s_ic, /* 165 */ - Parrot_eq_p_sc_ic, /* 166 */ - Parrot_eq_str_p_p_ic, /* 167 */ - Parrot_eq_num_p_p_ic, /* 168 */ - Parrot_eq_addr_s_s_ic, /* 169 */ - Parrot_eq_addr_sc_s_ic, /* 170 */ - Parrot_eq_addr_s_sc_ic, /* 171 */ - Parrot_eq_addr_sc_sc_ic, /* 172 */ - Parrot_eq_addr_p_p_ic, /* 173 */ - Parrot_ne_i_i_ic, /* 174 */ - Parrot_ne_ic_i_ic, /* 175 */ - Parrot_ne_i_ic_ic, /* 176 */ - Parrot_ne_n_n_ic, /* 177 */ - Parrot_ne_nc_n_ic, /* 178 */ - Parrot_ne_n_nc_ic, /* 179 */ - Parrot_ne_s_s_ic, /* 180 */ - Parrot_ne_sc_s_ic, /* 181 */ - Parrot_ne_s_sc_ic, /* 182 */ - Parrot_ne_p_p_ic, /* 183 */ - Parrot_ne_p_i_ic, /* 184 */ - Parrot_ne_p_ic_ic, /* 185 */ - Parrot_ne_p_n_ic, /* 186 */ - Parrot_ne_p_nc_ic, /* 187 */ - Parrot_ne_p_s_ic, /* 188 */ - Parrot_ne_p_sc_ic, /* 189 */ - Parrot_ne_str_p_p_ic, /* 190 */ - Parrot_ne_num_p_p_ic, /* 191 */ - Parrot_ne_addr_s_s_ic, /* 192 */ - Parrot_ne_addr_sc_s_ic, /* 193 */ - Parrot_ne_addr_s_sc_ic, /* 194 */ - Parrot_ne_addr_sc_sc_ic, /* 195 */ - Parrot_ne_addr_p_p_ic, /* 196 */ - Parrot_lt_i_i_ic, /* 197 */ - Parrot_lt_ic_i_ic, /* 198 */ - Parrot_lt_i_ic_ic, /* 199 */ - Parrot_lt_n_n_ic, /* 200 */ - Parrot_lt_nc_n_ic, /* 201 */ - Parrot_lt_n_nc_ic, /* 202 */ - Parrot_lt_s_s_ic, /* 203 */ - Parrot_lt_sc_s_ic, /* 204 */ - Parrot_lt_s_sc_ic, /* 205 */ - Parrot_lt_p_p_ic, /* 206 */ - Parrot_lt_p_i_ic, /* 207 */ - Parrot_lt_p_ic_ic, /* 208 */ - Parrot_lt_p_n_ic, /* 209 */ - Parrot_lt_p_nc_ic, /* 210 */ - Parrot_lt_p_s_ic, /* 211 */ - Parrot_lt_p_sc_ic, /* 212 */ - Parrot_lt_str_p_p_ic, /* 213 */ - Parrot_lt_num_p_p_ic, /* 214 */ - Parrot_le_i_i_ic, /* 215 */ - Parrot_le_ic_i_ic, /* 216 */ - Parrot_le_i_ic_ic, /* 217 */ - Parrot_le_n_n_ic, /* 218 */ - Parrot_le_nc_n_ic, /* 219 */ - Parrot_le_n_nc_ic, /* 220 */ - Parrot_le_s_s_ic, /* 221 */ - Parrot_le_sc_s_ic, /* 222 */ - Parrot_le_s_sc_ic, /* 223 */ - Parrot_le_p_p_ic, /* 224 */ - Parrot_le_p_i_ic, /* 225 */ - Parrot_le_p_ic_ic, /* 226 */ - Parrot_le_p_n_ic, /* 227 */ - Parrot_le_p_nc_ic, /* 228 */ - Parrot_le_p_s_ic, /* 229 */ - Parrot_le_p_sc_ic, /* 230 */ - Parrot_le_str_p_p_ic, /* 231 */ - Parrot_le_num_p_p_ic, /* 232 */ - Parrot_gt_p_p_ic, /* 233 */ - Parrot_gt_p_i_ic, /* 234 */ - Parrot_gt_p_ic_ic, /* 235 */ - Parrot_gt_p_n_ic, /* 236 */ - Parrot_gt_p_nc_ic, /* 237 */ - Parrot_gt_p_s_ic, /* 238 */ - Parrot_gt_p_sc_ic, /* 239 */ - Parrot_gt_str_p_p_ic, /* 240 */ - Parrot_gt_num_p_p_ic, /* 241 */ - Parrot_ge_p_p_ic, /* 242 */ - Parrot_ge_p_i_ic, /* 243 */ - Parrot_ge_p_ic_ic, /* 244 */ - Parrot_ge_p_n_ic, /* 245 */ - Parrot_ge_p_nc_ic, /* 246 */ - Parrot_ge_p_s_ic, /* 247 */ - Parrot_ge_p_sc_ic, /* 248 */ - Parrot_ge_str_p_p_ic, /* 249 */ - Parrot_ge_num_p_p_ic, /* 250 */ - Parrot_if_null_p_ic, /* 251 */ - Parrot_if_null_s_ic, /* 252 */ - Parrot_unless_null_p_ic, /* 253 */ - Parrot_unless_null_s_ic, /* 254 */ - Parrot_cmp_i_i_i, /* 255 */ - Parrot_cmp_i_ic_i, /* 256 */ - Parrot_cmp_i_i_ic, /* 257 */ - Parrot_cmp_i_n_n, /* 258 */ - Parrot_cmp_i_nc_n, /* 259 */ - Parrot_cmp_i_n_nc, /* 260 */ - Parrot_cmp_i_s_s, /* 261 */ - Parrot_cmp_i_sc_s, /* 262 */ - Parrot_cmp_i_s_sc, /* 263 */ - Parrot_cmp_i_p_p, /* 264 */ - Parrot_cmp_i_p_i, /* 265 */ - Parrot_cmp_i_p_ic, /* 266 */ - Parrot_cmp_i_p_n, /* 267 */ - Parrot_cmp_i_p_nc, /* 268 */ - Parrot_cmp_i_p_s, /* 269 */ - Parrot_cmp_i_p_sc, /* 270 */ - Parrot_cmp_str_i_p_p, /* 271 */ - Parrot_cmp_num_i_p_p, /* 272 */ - Parrot_cmp_pmc_p_p_p, /* 273 */ - Parrot_issame_i_p_p, /* 274 */ - Parrot_issame_i_s_s, /* 275 */ - Parrot_issame_i_sc_s, /* 276 */ - Parrot_issame_i_s_sc, /* 277 */ - Parrot_issame_i_sc_sc, /* 278 */ - Parrot_isntsame_i_p_p, /* 279 */ - Parrot_isntsame_i_s_s, /* 280 */ - Parrot_isntsame_i_sc_s, /* 281 */ - Parrot_isntsame_i_s_sc, /* 282 */ - Parrot_isntsame_i_sc_sc, /* 283 */ - Parrot_istrue_i_p, /* 284 */ - Parrot_isfalse_i_p, /* 285 */ - Parrot_isnull_i_p, /* 286 */ - Parrot_isnull_i_pc, /* 287 */ - Parrot_isnull_i_s, /* 288 */ - Parrot_isnull_i_sc, /* 289 */ - Parrot_isgt_i_p_p, /* 290 */ - Parrot_isge_i_p_p, /* 291 */ - Parrot_isle_i_i_i, /* 292 */ - Parrot_isle_i_ic_i, /* 293 */ - Parrot_isle_i_i_ic, /* 294 */ - Parrot_isle_i_n_n, /* 295 */ - Parrot_isle_i_nc_n, /* 296 */ - Parrot_isle_i_n_nc, /* 297 */ - Parrot_isle_i_s_s, /* 298 */ - Parrot_isle_i_sc_s, /* 299 */ - Parrot_isle_i_s_sc, /* 300 */ - Parrot_isle_i_p_p, /* 301 */ - Parrot_islt_i_i_i, /* 302 */ - Parrot_islt_i_ic_i, /* 303 */ - Parrot_islt_i_i_ic, /* 304 */ - Parrot_islt_i_n_n, /* 305 */ - Parrot_islt_i_nc_n, /* 306 */ - Parrot_islt_i_n_nc, /* 307 */ - Parrot_islt_i_s_s, /* 308 */ - Parrot_islt_i_sc_s, /* 309 */ - Parrot_islt_i_s_sc, /* 310 */ - Parrot_islt_i_p_p, /* 311 */ - Parrot_iseq_i_i_i, /* 312 */ - Parrot_iseq_i_ic_i, /* 313 */ - Parrot_iseq_i_i_ic, /* 314 */ - Parrot_iseq_i_n_n, /* 315 */ - Parrot_iseq_i_nc_n, /* 316 */ - Parrot_iseq_i_n_nc, /* 317 */ - Parrot_iseq_i_s_s, /* 318 */ - Parrot_iseq_i_sc_s, /* 319 */ - Parrot_iseq_i_s_sc, /* 320 */ - Parrot_iseq_i_p_p, /* 321 */ - Parrot_isne_i_i_i, /* 322 */ - Parrot_isne_i_ic_i, /* 323 */ - Parrot_isne_i_i_ic, /* 324 */ - Parrot_isne_i_n_n, /* 325 */ - Parrot_isne_i_nc_n, /* 326 */ - Parrot_isne_i_n_nc, /* 327 */ - Parrot_isne_i_s_s, /* 328 */ - Parrot_isne_i_sc_s, /* 329 */ - Parrot_isne_i_s_sc, /* 330 */ - Parrot_isne_i_p_p, /* 331 */ - Parrot_and_i_i_i, /* 332 */ - Parrot_and_i_ic_i, /* 333 */ - Parrot_and_i_i_ic, /* 334 */ - Parrot_and_p_p_p, /* 335 */ - Parrot_not_i, /* 336 */ - Parrot_not_i_i, /* 337 */ - Parrot_not_p, /* 338 */ - Parrot_not_p_p, /* 339 */ - Parrot_or_i_i_i, /* 340 */ - Parrot_or_i_ic_i, /* 341 */ - Parrot_or_i_i_ic, /* 342 */ - Parrot_or_p_p_p, /* 343 */ - Parrot_xor_i_i_i, /* 344 */ - Parrot_xor_i_ic_i, /* 345 */ - Parrot_xor_i_i_ic, /* 346 */ - Parrot_xor_p_p_p, /* 347 */ - Parrot_print_i, /* 348 */ - Parrot_print_ic, /* 349 */ - Parrot_print_n, /* 350 */ - Parrot_print_nc, /* 351 */ - Parrot_print_s, /* 352 */ - Parrot_print_sc, /* 353 */ - Parrot_print_p, /* 354 */ - Parrot_say_i, /* 355 */ - Parrot_say_ic, /* 356 */ - Parrot_say_n, /* 357 */ - Parrot_say_nc, /* 358 */ - Parrot_say_s, /* 359 */ - Parrot_say_sc, /* 360 */ - Parrot_say_p, /* 361 */ - Parrot_print_p_i, /* 362 */ - Parrot_print_p_ic, /* 363 */ - Parrot_print_p_n, /* 364 */ - Parrot_print_p_nc, /* 365 */ - Parrot_print_p_s, /* 366 */ - Parrot_print_p_sc, /* 367 */ - Parrot_print_p_p, /* 368 */ - Parrot_getstdin_p, /* 369 */ - Parrot_getstdout_p, /* 370 */ - Parrot_getstderr_p, /* 371 */ - Parrot_abs_i, /* 372 */ - Parrot_abs_n, /* 373 */ - Parrot_abs_i_i, /* 374 */ - Parrot_abs_n_n, /* 375 */ - Parrot_abs_p, /* 376 */ - Parrot_abs_p_p, /* 377 */ - Parrot_add_i_i, /* 378 */ - Parrot_add_i_ic, /* 379 */ - Parrot_add_n_n, /* 380 */ - Parrot_add_n_nc, /* 381 */ - Parrot_add_p_p, /* 382 */ - Parrot_add_p_i, /* 383 */ - Parrot_add_p_ic, /* 384 */ - Parrot_add_p_n, /* 385 */ - Parrot_add_p_nc, /* 386 */ - Parrot_add_i_i_i, /* 387 */ - Parrot_add_i_ic_i, /* 388 */ - Parrot_add_i_i_ic, /* 389 */ - Parrot_add_n_n_n, /* 390 */ - Parrot_add_n_nc_n, /* 391 */ - Parrot_add_n_n_nc, /* 392 */ - Parrot_add_p_p_p, /* 393 */ - Parrot_add_p_p_i, /* 394 */ - Parrot_add_p_p_ic, /* 395 */ - Parrot_add_p_p_n, /* 396 */ - Parrot_add_p_p_nc, /* 397 */ - Parrot_dec_i, /* 398 */ - Parrot_dec_n, /* 399 */ - Parrot_dec_p, /* 400 */ - Parrot_div_i_i, /* 401 */ - Parrot_div_i_ic, /* 402 */ - Parrot_div_n_n, /* 403 */ - Parrot_div_n_nc, /* 404 */ - Parrot_div_p_p, /* 405 */ - Parrot_div_p_i, /* 406 */ - Parrot_div_p_ic, /* 407 */ - Parrot_div_p_n, /* 408 */ - Parrot_div_p_nc, /* 409 */ - Parrot_div_i_i_i, /* 410 */ - Parrot_div_i_ic_i, /* 411 */ - Parrot_div_i_i_ic, /* 412 */ - Parrot_div_i_ic_ic, /* 413 */ - Parrot_div_n_n_n, /* 414 */ - Parrot_div_n_nc_n, /* 415 */ - Parrot_div_n_n_nc, /* 416 */ - Parrot_div_n_nc_nc, /* 417 */ - Parrot_div_p_p_p, /* 418 */ - Parrot_div_p_p_i, /* 419 */ - Parrot_div_p_p_ic, /* 420 */ - Parrot_div_p_p_n, /* 421 */ - Parrot_div_p_p_nc, /* 422 */ - Parrot_fdiv_i_i, /* 423 */ - Parrot_fdiv_i_ic, /* 424 */ - Parrot_fdiv_n_n, /* 425 */ - Parrot_fdiv_n_nc, /* 426 */ - Parrot_fdiv_p_p, /* 427 */ - Parrot_fdiv_p_i, /* 428 */ - Parrot_fdiv_p_ic, /* 429 */ - Parrot_fdiv_p_n, /* 430 */ - Parrot_fdiv_p_nc, /* 431 */ - Parrot_fdiv_i_i_i, /* 432 */ - Parrot_fdiv_i_ic_i, /* 433 */ - Parrot_fdiv_i_i_ic, /* 434 */ - Parrot_fdiv_n_n_n, /* 435 */ - Parrot_fdiv_n_nc_n, /* 436 */ - Parrot_fdiv_n_n_nc, /* 437 */ - Parrot_fdiv_p_p_p, /* 438 */ - Parrot_fdiv_p_p_i, /* 439 */ - Parrot_fdiv_p_p_ic, /* 440 */ - Parrot_fdiv_p_p_n, /* 441 */ - Parrot_fdiv_p_p_nc, /* 442 */ - Parrot_ceil_n, /* 443 */ - Parrot_ceil_i_n, /* 444 */ - Parrot_ceil_n_n, /* 445 */ - Parrot_floor_n, /* 446 */ - Parrot_floor_i_n, /* 447 */ - Parrot_floor_n_n, /* 448 */ - Parrot_inc_i, /* 449 */ - Parrot_inc_n, /* 450 */ - Parrot_inc_p, /* 451 */ - Parrot_mod_i_i, /* 452 */ - Parrot_mod_i_ic, /* 453 */ - Parrot_mod_n_n, /* 454 */ - Parrot_mod_n_nc, /* 455 */ - Parrot_mod_p_p, /* 456 */ - Parrot_mod_p_i, /* 457 */ - Parrot_mod_p_ic, /* 458 */ - Parrot_mod_p_n, /* 459 */ - Parrot_mod_p_nc, /* 460 */ - Parrot_mod_i_i_i, /* 461 */ - Parrot_mod_i_ic_i, /* 462 */ - Parrot_mod_i_i_ic, /* 463 */ - Parrot_mod_n_n_n, /* 464 */ - Parrot_mod_n_nc_n, /* 465 */ - Parrot_mod_n_n_nc, /* 466 */ - Parrot_mod_p_p_p, /* 467 */ - Parrot_mod_p_p_i, /* 468 */ - Parrot_mod_p_p_ic, /* 469 */ - Parrot_mod_p_p_n, /* 470 */ - Parrot_mod_p_p_nc, /* 471 */ - Parrot_mul_i_i, /* 472 */ - Parrot_mul_i_ic, /* 473 */ - Parrot_mul_n_n, /* 474 */ - Parrot_mul_n_nc, /* 475 */ - Parrot_mul_p_p, /* 476 */ - Parrot_mul_p_i, /* 477 */ - Parrot_mul_p_ic, /* 478 */ - Parrot_mul_p_n, /* 479 */ - Parrot_mul_p_nc, /* 480 */ - Parrot_mul_i_i_i, /* 481 */ - Parrot_mul_i_ic_i, /* 482 */ - Parrot_mul_i_i_ic, /* 483 */ - Parrot_mul_n_n_n, /* 484 */ - Parrot_mul_n_nc_n, /* 485 */ - Parrot_mul_n_n_nc, /* 486 */ - Parrot_mul_p_p_p, /* 487 */ - Parrot_mul_p_p_i, /* 488 */ - Parrot_mul_p_p_ic, /* 489 */ - Parrot_mul_p_p_n, /* 490 */ - Parrot_mul_p_p_nc, /* 491 */ - Parrot_neg_i, /* 492 */ - Parrot_neg_n, /* 493 */ - Parrot_neg_p, /* 494 */ - Parrot_neg_i_i, /* 495 */ - Parrot_neg_n_n, /* 496 */ - Parrot_neg_p_p, /* 497 */ - Parrot_sub_i_i, /* 498 */ - Parrot_sub_i_ic, /* 499 */ - Parrot_sub_n_n, /* 500 */ - Parrot_sub_n_nc, /* 501 */ - Parrot_sub_p_p, /* 502 */ - Parrot_sub_p_i, /* 503 */ - Parrot_sub_p_ic, /* 504 */ - Parrot_sub_p_n, /* 505 */ - Parrot_sub_p_nc, /* 506 */ - Parrot_sub_i_i_i, /* 507 */ - Parrot_sub_i_ic_i, /* 508 */ - Parrot_sub_i_i_ic, /* 509 */ - Parrot_sub_n_n_n, /* 510 */ - Parrot_sub_n_nc_n, /* 511 */ - Parrot_sub_n_n_nc, /* 512 */ - Parrot_sub_p_p_p, /* 513 */ - Parrot_sub_p_p_i, /* 514 */ - Parrot_sub_p_p_ic, /* 515 */ - Parrot_sub_p_p_n, /* 516 */ - Parrot_sub_p_p_nc, /* 517 */ - Parrot_sqrt_n_n, /* 518 */ - Parrot_callmethodcc_p_s, /* 519 */ - Parrot_callmethodcc_p_sc, /* 520 */ - Parrot_callmethodcc_p_p, /* 521 */ - Parrot_callmethod_p_s_p, /* 522 */ - Parrot_callmethod_p_sc_p, /* 523 */ - Parrot_callmethod_p_p_p, /* 524 */ - Parrot_tailcallmethod_p_s, /* 525 */ - Parrot_tailcallmethod_p_sc, /* 526 */ - Parrot_tailcallmethod_p_p, /* 527 */ - Parrot_addmethod_p_s_p, /* 528 */ - Parrot_addmethod_p_sc_p, /* 529 */ - Parrot_can_i_p_s, /* 530 */ - Parrot_can_i_p_sc, /* 531 */ - Parrot_does_i_p_s, /* 532 */ - Parrot_does_i_p_sc, /* 533 */ - Parrot_does_i_p_p, /* 534 */ - Parrot_does_i_p_pc, /* 535 */ - Parrot_isa_i_p_s, /* 536 */ - Parrot_isa_i_p_sc, /* 537 */ - Parrot_isa_i_p_p, /* 538 */ - Parrot_isa_i_p_pc, /* 539 */ - Parrot_newclass_p_s, /* 540 */ - Parrot_newclass_p_sc, /* 541 */ - Parrot_newclass_p_p, /* 542 */ - Parrot_newclass_p_pc, /* 543 */ - Parrot_subclass_p_p, /* 544 */ - Parrot_subclass_p_pc, /* 545 */ - Parrot_subclass_p_p_s, /* 546 */ - Parrot_subclass_p_pc_s, /* 547 */ - Parrot_subclass_p_p_sc, /* 548 */ - Parrot_subclass_p_pc_sc, /* 549 */ - Parrot_subclass_p_p_p, /* 550 */ - Parrot_subclass_p_pc_p, /* 551 */ - Parrot_subclass_p_p_pc, /* 552 */ - Parrot_subclass_p_pc_pc, /* 553 */ - Parrot_subclass_p_s, /* 554 */ - Parrot_subclass_p_sc, /* 555 */ - Parrot_subclass_p_s_s, /* 556 */ - Parrot_subclass_p_sc_s, /* 557 */ - Parrot_subclass_p_s_sc, /* 558 */ - Parrot_subclass_p_sc_sc, /* 559 */ - Parrot_subclass_p_s_p, /* 560 */ - Parrot_subclass_p_sc_p, /* 561 */ - Parrot_subclass_p_s_pc, /* 562 */ - Parrot_subclass_p_sc_pc, /* 563 */ - Parrot_get_class_p_s, /* 564 */ - Parrot_get_class_p_sc, /* 565 */ - Parrot_get_class_p_p, /* 566 */ - Parrot_get_class_p_pc, /* 567 */ - Parrot_class_p_p, /* 568 */ - Parrot_addparent_p_p, /* 569 */ - Parrot_removeparent_p_p, /* 570 */ - Parrot_addrole_p_p, /* 571 */ - Parrot_addattribute_p_s, /* 572 */ - Parrot_addattribute_p_sc, /* 573 */ - Parrot_removeattribute_p_s, /* 574 */ - Parrot_removeattribute_p_sc, /* 575 */ - Parrot_getattribute_p_p_s, /* 576 */ - Parrot_getattribute_p_p_sc, /* 577 */ - Parrot_getattribute_p_p_p_s, /* 578 */ - Parrot_getattribute_p_p_pc_s, /* 579 */ - Parrot_getattribute_p_p_p_sc, /* 580 */ - Parrot_getattribute_p_p_pc_sc, /* 581 */ - Parrot_setattribute_p_s_p, /* 582 */ - Parrot_setattribute_p_sc_p, /* 583 */ - Parrot_setattribute_p_p_s_p, /* 584 */ - Parrot_setattribute_p_pc_s_p, /* 585 */ - Parrot_setattribute_p_p_sc_p, /* 586 */ - Parrot_setattribute_p_pc_sc_p, /* 587 */ - Parrot_inspect_p_p, /* 588 */ - Parrot_inspect_p_pc, /* 589 */ - Parrot_inspect_p_p_s, /* 590 */ - Parrot_inspect_p_pc_s, /* 591 */ - Parrot_inspect_p_p_sc, /* 592 */ - Parrot_inspect_p_pc_sc, /* 593 */ - Parrot_new_p_s, /* 594 */ - Parrot_new_p_sc, /* 595 */ - Parrot_new_p_s_p, /* 596 */ - Parrot_new_p_sc_p, /* 597 */ - Parrot_new_p_s_pc, /* 598 */ - Parrot_new_p_sc_pc, /* 599 */ - Parrot_new_p_p, /* 600 */ - Parrot_new_p_pc, /* 601 */ - Parrot_new_p_p_p, /* 602 */ - Parrot_new_p_pc_p, /* 603 */ - Parrot_new_p_p_pc, /* 604 */ - Parrot_new_p_pc_pc, /* 605 */ - Parrot_root_new_p_p, /* 606 */ - Parrot_root_new_p_pc, /* 607 */ - Parrot_root_new_p_p_p, /* 608 */ - Parrot_root_new_p_pc_p, /* 609 */ - Parrot_root_new_p_p_pc, /* 610 */ - Parrot_root_new_p_pc_pc, /* 611 */ - Parrot_typeof_s_p, /* 612 */ - Parrot_typeof_p_p, /* 613 */ - Parrot_get_repr_s_p, /* 614 */ - Parrot_find_method_p_p_s, /* 615 */ - Parrot_find_method_p_p_sc, /* 616 */ - Parrot_defined_i_p, /* 617 */ - Parrot_defined_i_p_ki, /* 618 */ - Parrot_defined_i_p_kic, /* 619 */ - Parrot_defined_i_p_k, /* 620 */ - Parrot_defined_i_p_kc, /* 621 */ - Parrot_exists_i_p_ki, /* 622 */ - Parrot_exists_i_p_kic, /* 623 */ - Parrot_exists_i_p_k, /* 624 */ - Parrot_exists_i_p_kc, /* 625 */ - Parrot_delete_p_k, /* 626 */ - Parrot_delete_p_kc, /* 627 */ - Parrot_delete_p_ki, /* 628 */ - Parrot_delete_p_kic, /* 629 */ - Parrot_elements_i_p, /* 630 */ - Parrot_push_p_i, /* 631 */ - Parrot_push_p_ic, /* 632 */ - Parrot_push_p_n, /* 633 */ - Parrot_push_p_nc, /* 634 */ - Parrot_push_p_s, /* 635 */ - Parrot_push_p_sc, /* 636 */ - Parrot_push_p_p, /* 637 */ - Parrot_pop_i_p, /* 638 */ - Parrot_pop_n_p, /* 639 */ - Parrot_pop_s_p, /* 640 */ - Parrot_pop_p_p, /* 641 */ - Parrot_unshift_p_i, /* 642 */ - Parrot_unshift_p_ic, /* 643 */ - Parrot_unshift_p_n, /* 644 */ - Parrot_unshift_p_nc, /* 645 */ - Parrot_unshift_p_s, /* 646 */ - Parrot_unshift_p_sc, /* 647 */ - Parrot_unshift_p_p, /* 648 */ - Parrot_shift_i_p, /* 649 */ - Parrot_shift_n_p, /* 650 */ - Parrot_shift_s_p, /* 651 */ - Parrot_shift_p_p, /* 652 */ - Parrot_splice_p_p_i_i, /* 653 */ - Parrot_splice_p_p_ic_i, /* 654 */ - Parrot_splice_p_p_i_ic, /* 655 */ - Parrot_splice_p_p_ic_ic, /* 656 */ - Parrot_setprop_p_s_p, /* 657 */ - Parrot_setprop_p_sc_p, /* 658 */ - Parrot_getprop_p_s_p, /* 659 */ - Parrot_getprop_p_sc_p, /* 660 */ - Parrot_delprop_p_s, /* 661 */ - Parrot_delprop_p_sc, /* 662 */ - Parrot_prophash_p_p, /* 663 */ - Parrot_freeze_s_p, /* 664 */ - Parrot_thaw_p_s, /* 665 */ - Parrot_thaw_p_sc, /* 666 */ - Parrot_add_multi_s_s_p, /* 667 */ - Parrot_add_multi_sc_s_p, /* 668 */ - Parrot_add_multi_s_sc_p, /* 669 */ - Parrot_add_multi_sc_sc_p, /* 670 */ - Parrot_find_multi_p_s_s, /* 671 */ - Parrot_find_multi_p_sc_s, /* 672 */ - Parrot_find_multi_p_s_sc, /* 673 */ - Parrot_find_multi_p_sc_sc, /* 674 */ - Parrot_register_p, /* 675 */ - Parrot_unregister_p, /* 676 */ - Parrot_box_p_i, /* 677 */ - Parrot_box_p_ic, /* 678 */ - Parrot_box_p_n, /* 679 */ - Parrot_box_p_nc, /* 680 */ - Parrot_box_p_s, /* 681 */ - Parrot_box_p_sc, /* 682 */ - Parrot_iter_p_p, /* 683 */ - Parrot_morph_p_p, /* 684 */ - Parrot_morph_p_pc, /* 685 */ - Parrot_clone_s_s, /* 686 */ - Parrot_clone_s_sc, /* 687 */ - Parrot_set_i_i, /* 688 */ - Parrot_set_i_ic, /* 689 */ - Parrot_set_i_n, /* 690 */ - Parrot_set_i_nc, /* 691 */ - Parrot_set_i_s, /* 692 */ - Parrot_set_i_sc, /* 693 */ - Parrot_set_n_n, /* 694 */ - Parrot_set_n_nc, /* 695 */ - Parrot_set_n_i, /* 696 */ - Parrot_set_n_ic, /* 697 */ - Parrot_set_n_s, /* 698 */ - Parrot_set_n_sc, /* 699 */ - Parrot_set_n_p, /* 700 */ - Parrot_set_s_p, /* 701 */ - Parrot_set_s_s, /* 702 */ - Parrot_set_s_sc, /* 703 */ - Parrot_set_s_i, /* 704 */ - Parrot_set_s_ic, /* 705 */ - Parrot_set_s_n, /* 706 */ - Parrot_set_s_nc, /* 707 */ - Parrot_set_p_pc, /* 708 */ - Parrot_set_p_p, /* 709 */ - Parrot_set_p_i, /* 710 */ - Parrot_set_p_ic, /* 711 */ - Parrot_set_p_n, /* 712 */ - Parrot_set_p_nc, /* 713 */ - Parrot_set_p_s, /* 714 */ - Parrot_set_p_sc, /* 715 */ - Parrot_set_i_p, /* 716 */ - Parrot_assign_p_p, /* 717 */ - Parrot_assign_p_i, /* 718 */ - Parrot_assign_p_ic, /* 719 */ - Parrot_assign_p_n, /* 720 */ - Parrot_assign_p_nc, /* 721 */ - Parrot_assign_p_s, /* 722 */ - Parrot_assign_p_sc, /* 723 */ - Parrot_assign_s_s, /* 724 */ - Parrot_assign_s_sc, /* 725 */ - Parrot_setref_p_p, /* 726 */ - Parrot_deref_p_p, /* 727 */ - Parrot_set_p_ki_i, /* 728 */ - Parrot_set_p_kic_i, /* 729 */ - Parrot_set_p_ki_ic, /* 730 */ - Parrot_set_p_kic_ic, /* 731 */ - Parrot_set_p_ki_n, /* 732 */ - Parrot_set_p_kic_n, /* 733 */ - Parrot_set_p_ki_nc, /* 734 */ - Parrot_set_p_kic_nc, /* 735 */ - Parrot_set_p_ki_s, /* 736 */ - Parrot_set_p_kic_s, /* 737 */ - Parrot_set_p_ki_sc, /* 738 */ - Parrot_set_p_kic_sc, /* 739 */ - Parrot_set_p_ki_p, /* 740 */ - Parrot_set_p_kic_p, /* 741 */ - Parrot_set_i_p_ki, /* 742 */ - Parrot_set_i_p_kic, /* 743 */ - Parrot_set_n_p_ki, /* 744 */ - Parrot_set_n_p_kic, /* 745 */ - Parrot_set_s_p_ki, /* 746 */ - Parrot_set_s_p_kic, /* 747 */ - Parrot_set_p_p_ki, /* 748 */ - Parrot_set_p_p_kic, /* 749 */ - Parrot_set_p_k_i, /* 750 */ - Parrot_set_p_kc_i, /* 751 */ - Parrot_set_p_k_ic, /* 752 */ - Parrot_set_p_kc_ic, /* 753 */ - Parrot_set_p_k_n, /* 754 */ - Parrot_set_p_kc_n, /* 755 */ - Parrot_set_p_k_nc, /* 756 */ - Parrot_set_p_kc_nc, /* 757 */ - Parrot_set_p_k_s, /* 758 */ - Parrot_set_p_kc_s, /* 759 */ - Parrot_set_p_k_sc, /* 760 */ - Parrot_set_p_kc_sc, /* 761 */ - Parrot_set_p_k_p, /* 762 */ - Parrot_set_p_kc_p, /* 763 */ - Parrot_set_i_p_k, /* 764 */ - Parrot_set_i_p_kc, /* 765 */ - Parrot_set_n_p_k, /* 766 */ - Parrot_set_n_p_kc, /* 767 */ - Parrot_set_s_p_k, /* 768 */ - Parrot_set_s_p_kc, /* 769 */ - Parrot_set_p_p_k, /* 770 */ - Parrot_set_p_p_kc, /* 771 */ - Parrot_clone_p_p, /* 772 */ - Parrot_clone_p_p_p, /* 773 */ - Parrot_clone_p_p_pc, /* 774 */ - Parrot_copy_p_p, /* 775 */ - Parrot_null_s, /* 776 */ - Parrot_null_i, /* 777 */ - Parrot_null_p, /* 778 */ - Parrot_null_n, /* 779 */ - Parrot_ord_i_s, /* 780 */ - Parrot_ord_i_sc, /* 781 */ - Parrot_ord_i_s_i, /* 782 */ - Parrot_ord_i_sc_i, /* 783 */ - Parrot_ord_i_s_ic, /* 784 */ - Parrot_ord_i_sc_ic, /* 785 */ - Parrot_chr_s_i, /* 786 */ - Parrot_chr_s_ic, /* 787 */ - Parrot_chopn_s_s_i, /* 788 */ - Parrot_chopn_s_sc_i, /* 789 */ - Parrot_chopn_s_s_ic, /* 790 */ - Parrot_chopn_s_sc_ic, /* 791 */ - Parrot_concat_p_p, /* 792 */ - Parrot_concat_p_s, /* 793 */ - Parrot_concat_p_sc, /* 794 */ - Parrot_concat_s_s_s, /* 795 */ - Parrot_concat_s_sc_s, /* 796 */ - Parrot_concat_s_s_sc, /* 797 */ - Parrot_concat_p_p_s, /* 798 */ - Parrot_concat_p_p_sc, /* 799 */ - Parrot_concat_p_p_p, /* 800 */ - Parrot_repeat_s_s_i, /* 801 */ - Parrot_repeat_s_sc_i, /* 802 */ - Parrot_repeat_s_s_ic, /* 803 */ - Parrot_repeat_s_sc_ic, /* 804 */ - Parrot_repeat_p_p_i, /* 805 */ - Parrot_repeat_p_p_ic, /* 806 */ - Parrot_repeat_p_p_p, /* 807 */ - Parrot_repeat_p_i, /* 808 */ - Parrot_repeat_p_ic, /* 809 */ - Parrot_repeat_p_p, /* 810 */ - Parrot_length_i_s, /* 811 */ - Parrot_length_i_sc, /* 812 */ - Parrot_bytelength_i_s, /* 813 */ - Parrot_bytelength_i_sc, /* 814 */ - Parrot_pin_s, /* 815 */ - Parrot_unpin_s, /* 816 */ - Parrot_substr_s_s_i, /* 817 */ - Parrot_substr_s_sc_i, /* 818 */ - Parrot_substr_s_s_ic, /* 819 */ - Parrot_substr_s_sc_ic, /* 820 */ - Parrot_substr_s_s_i_i, /* 821 */ - Parrot_substr_s_sc_i_i, /* 822 */ - Parrot_substr_s_s_ic_i, /* 823 */ - Parrot_substr_s_sc_ic_i, /* 824 */ - Parrot_substr_s_s_i_ic, /* 825 */ - Parrot_substr_s_sc_i_ic, /* 826 */ - Parrot_substr_s_s_ic_ic, /* 827 */ - Parrot_substr_s_sc_ic_ic, /* 828 */ - Parrot_substr_s_p_i_i, /* 829 */ - Parrot_substr_s_p_ic_i, /* 830 */ - Parrot_substr_s_p_i_ic, /* 831 */ - Parrot_substr_s_p_ic_ic, /* 832 */ - Parrot_replace_s_s_i_i_s, /* 833 */ - Parrot_replace_s_sc_i_i_s, /* 834 */ - Parrot_replace_s_s_ic_i_s, /* 835 */ - Parrot_replace_s_sc_ic_i_s, /* 836 */ - Parrot_replace_s_s_i_ic_s, /* 837 */ - Parrot_replace_s_sc_i_ic_s, /* 838 */ - Parrot_replace_s_s_ic_ic_s, /* 839 */ - Parrot_replace_s_sc_ic_ic_s, /* 840 */ - Parrot_replace_s_s_i_i_sc, /* 841 */ - Parrot_replace_s_sc_i_i_sc, /* 842 */ - Parrot_replace_s_s_ic_i_sc, /* 843 */ - Parrot_replace_s_sc_ic_i_sc, /* 844 */ - Parrot_replace_s_s_i_ic_sc, /* 845 */ - Parrot_replace_s_sc_i_ic_sc, /* 846 */ - Parrot_replace_s_s_ic_ic_sc, /* 847 */ - Parrot_replace_s_sc_ic_ic_sc, /* 848 */ - Parrot_index_i_s_s, /* 849 */ - Parrot_index_i_sc_s, /* 850 */ - Parrot_index_i_s_sc, /* 851 */ - Parrot_index_i_sc_sc, /* 852 */ - Parrot_index_i_s_s_i, /* 853 */ - Parrot_index_i_sc_s_i, /* 854 */ - Parrot_index_i_s_sc_i, /* 855 */ - Parrot_index_i_sc_sc_i, /* 856 */ - Parrot_index_i_s_s_ic, /* 857 */ - Parrot_index_i_sc_s_ic, /* 858 */ - Parrot_index_i_s_sc_ic, /* 859 */ - Parrot_index_i_sc_sc_ic, /* 860 */ - Parrot_sprintf_s_s_p, /* 861 */ - Parrot_sprintf_s_sc_p, /* 862 */ - Parrot_sprintf_p_p_p, /* 863 */ - Parrot_new_s, /* 864 */ - Parrot_new_s_i, /* 865 */ - Parrot_new_s_ic, /* 866 */ - Parrot_stringinfo_i_s_i, /* 867 */ - Parrot_stringinfo_i_sc_i, /* 868 */ - Parrot_stringinfo_i_s_ic, /* 869 */ - Parrot_stringinfo_i_sc_ic, /* 870 */ - Parrot_upcase_s_s, /* 871 */ - Parrot_upcase_s_sc, /* 872 */ - Parrot_downcase_s_s, /* 873 */ - Parrot_downcase_s_sc, /* 874 */ - Parrot_titlecase_s_s, /* 875 */ - Parrot_titlecase_s_sc, /* 876 */ - Parrot_join_s_s_p, /* 877 */ - Parrot_join_s_sc_p, /* 878 */ - Parrot_split_p_s_s, /* 879 */ - Parrot_split_p_sc_s, /* 880 */ - Parrot_split_p_s_sc, /* 881 */ - Parrot_split_p_sc_sc, /* 882 */ - Parrot_encoding_i_s, /* 883 */ - Parrot_encoding_i_sc, /* 884 */ - Parrot_encodingname_s_i, /* 885 */ - Parrot_encodingname_s_ic, /* 886 */ - Parrot_find_encoding_i_s, /* 887 */ - Parrot_find_encoding_i_sc, /* 888 */ - Parrot_trans_encoding_s_s_i, /* 889 */ - Parrot_trans_encoding_s_sc_i, /* 890 */ - Parrot_trans_encoding_s_s_ic, /* 891 */ - Parrot_trans_encoding_s_sc_ic, /* 892 */ - Parrot_is_cclass_i_i_s_i, /* 893 */ - Parrot_is_cclass_i_ic_s_i, /* 894 */ - Parrot_is_cclass_i_i_sc_i, /* 895 */ - Parrot_is_cclass_i_ic_sc_i, /* 896 */ - Parrot_is_cclass_i_i_s_ic, /* 897 */ - Parrot_is_cclass_i_ic_s_ic, /* 898 */ - Parrot_is_cclass_i_i_sc_ic, /* 899 */ - Parrot_is_cclass_i_ic_sc_ic, /* 900 */ - Parrot_find_cclass_i_i_s_i_i, /* 901 */ - Parrot_find_cclass_i_ic_s_i_i, /* 902 */ - Parrot_find_cclass_i_i_sc_i_i, /* 903 */ - Parrot_find_cclass_i_ic_sc_i_i, /* 904 */ - Parrot_find_cclass_i_i_s_ic_i, /* 905 */ - Parrot_find_cclass_i_ic_s_ic_i, /* 906 */ - Parrot_find_cclass_i_i_sc_ic_i, /* 907 */ - Parrot_find_cclass_i_ic_sc_ic_i, /* 908 */ - Parrot_find_cclass_i_i_s_i_ic, /* 909 */ - Parrot_find_cclass_i_ic_s_i_ic, /* 910 */ - Parrot_find_cclass_i_i_sc_i_ic, /* 911 */ - Parrot_find_cclass_i_ic_sc_i_ic, /* 912 */ - Parrot_find_cclass_i_i_s_ic_ic, /* 913 */ - Parrot_find_cclass_i_ic_s_ic_ic, /* 914 */ - Parrot_find_cclass_i_i_sc_ic_ic, /* 915 */ - Parrot_find_cclass_i_ic_sc_ic_ic, /* 916 */ - Parrot_find_not_cclass_i_i_s_i_i, /* 917 */ - Parrot_find_not_cclass_i_ic_s_i_i, /* 918 */ - Parrot_find_not_cclass_i_i_sc_i_i, /* 919 */ - Parrot_find_not_cclass_i_ic_sc_i_i, /* 920 */ - Parrot_find_not_cclass_i_i_s_ic_i, /* 921 */ - Parrot_find_not_cclass_i_ic_s_ic_i, /* 922 */ - Parrot_find_not_cclass_i_i_sc_ic_i, /* 923 */ - Parrot_find_not_cclass_i_ic_sc_ic_i, /* 924 */ - Parrot_find_not_cclass_i_i_s_i_ic, /* 925 */ - Parrot_find_not_cclass_i_ic_s_i_ic, /* 926 */ - Parrot_find_not_cclass_i_i_sc_i_ic, /* 927 */ - Parrot_find_not_cclass_i_ic_sc_i_ic, /* 928 */ - Parrot_find_not_cclass_i_i_s_ic_ic, /* 929 */ - Parrot_find_not_cclass_i_ic_s_ic_ic, /* 930 */ - Parrot_find_not_cclass_i_i_sc_ic_ic, /* 931 */ - Parrot_find_not_cclass_i_ic_sc_ic_ic, /* 932 */ - Parrot_escape_s_s, /* 933 */ - Parrot_compose_s_s, /* 934 */ - Parrot_compose_s_sc, /* 935 */ - Parrot_find_codepoint_i_s, /* 936 */ - Parrot_find_codepoint_i_sc, /* 937 */ - Parrot_spawnw_i_s, /* 938 */ - Parrot_spawnw_i_sc, /* 939 */ - Parrot_spawnw_i_p, /* 940 */ - Parrot_err_i, /* 941 */ - Parrot_err_s, /* 942 */ - Parrot_err_s_i, /* 943 */ - Parrot_err_s_ic, /* 944 */ - Parrot_time_i, /* 945 */ - Parrot_time_n, /* 946 */ - Parrot_sleep_i, /* 947 */ - Parrot_sleep_ic, /* 948 */ - Parrot_sleep_n, /* 949 */ - Parrot_sleep_nc, /* 950 */ - Parrot_store_lex_s_p, /* 951 */ - Parrot_store_lex_sc_p, /* 952 */ - Parrot_store_lex_s_s, /* 953 */ - Parrot_store_lex_sc_s, /* 954 */ - Parrot_store_lex_s_sc, /* 955 */ - Parrot_store_lex_sc_sc, /* 956 */ - Parrot_store_lex_s_i, /* 957 */ - Parrot_store_lex_sc_i, /* 958 */ - Parrot_store_lex_s_ic, /* 959 */ - Parrot_store_lex_sc_ic, /* 960 */ - Parrot_store_lex_s_n, /* 961 */ - Parrot_store_lex_sc_n, /* 962 */ - Parrot_store_lex_s_nc, /* 963 */ - Parrot_store_lex_sc_nc, /* 964 */ - Parrot_store_dynamic_lex_s_p, /* 965 */ - Parrot_store_dynamic_lex_sc_p, /* 966 */ - Parrot_find_lex_p_s, /* 967 */ - Parrot_find_lex_p_sc, /* 968 */ - Parrot_find_lex_s_s, /* 969 */ - Parrot_find_lex_s_sc, /* 970 */ - Parrot_find_lex_i_s, /* 971 */ - Parrot_find_lex_i_sc, /* 972 */ - Parrot_find_lex_n_s, /* 973 */ - Parrot_find_lex_n_sc, /* 974 */ - Parrot_find_dynamic_lex_p_s, /* 975 */ - Parrot_find_dynamic_lex_p_sc, /* 976 */ - Parrot_find_caller_lex_p_s, /* 977 */ - Parrot_find_caller_lex_p_sc, /* 978 */ - Parrot_get_namespace_p, /* 979 */ - Parrot_get_namespace_p_p, /* 980 */ - Parrot_get_namespace_p_pc, /* 981 */ - Parrot_get_hll_namespace_p, /* 982 */ - Parrot_get_hll_namespace_p_p, /* 983 */ - Parrot_get_hll_namespace_p_pc, /* 984 */ - Parrot_get_root_namespace_p, /* 985 */ - Parrot_get_root_namespace_p_p, /* 986 */ - Parrot_get_root_namespace_p_pc, /* 987 */ - Parrot_get_global_p_s, /* 988 */ - Parrot_get_global_p_sc, /* 989 */ - Parrot_get_global_p_p_s, /* 990 */ - Parrot_get_global_p_pc_s, /* 991 */ - Parrot_get_global_p_p_sc, /* 992 */ - Parrot_get_global_p_pc_sc, /* 993 */ - Parrot_get_hll_global_p_s, /* 994 */ - Parrot_get_hll_global_p_sc, /* 995 */ - Parrot_get_hll_global_p_p_s, /* 996 */ - Parrot_get_hll_global_p_pc_s, /* 997 */ - Parrot_get_hll_global_p_p_sc, /* 998 */ - Parrot_get_hll_global_p_pc_sc, /* 999 */ - Parrot_get_root_global_p_s, /* 1000 */ - Parrot_get_root_global_p_sc, /* 1001 */ - Parrot_get_root_global_p_p_s, /* 1002 */ - Parrot_get_root_global_p_pc_s, /* 1003 */ - Parrot_get_root_global_p_p_sc, /* 1004 */ - Parrot_get_root_global_p_pc_sc, /* 1005 */ - Parrot_set_global_s_p, /* 1006 */ - Parrot_set_global_sc_p, /* 1007 */ - Parrot_set_global_p_s_p, /* 1008 */ - Parrot_set_global_pc_s_p, /* 1009 */ - Parrot_set_global_p_sc_p, /* 1010 */ - Parrot_set_global_pc_sc_p, /* 1011 */ - Parrot_set_hll_global_s_p, /* 1012 */ - Parrot_set_hll_global_sc_p, /* 1013 */ - Parrot_set_hll_global_p_s_p, /* 1014 */ - Parrot_set_hll_global_pc_s_p, /* 1015 */ - Parrot_set_hll_global_p_sc_p, /* 1016 */ - Parrot_set_hll_global_pc_sc_p, /* 1017 */ - Parrot_set_root_global_s_p, /* 1018 */ - Parrot_set_root_global_sc_p, /* 1019 */ - Parrot_set_root_global_p_s_p, /* 1020 */ - Parrot_set_root_global_pc_s_p, /* 1021 */ - Parrot_set_root_global_p_sc_p, /* 1022 */ - Parrot_set_root_global_pc_sc_p, /* 1023 */ - Parrot_find_name_p_s, /* 1024 */ - Parrot_find_name_p_sc, /* 1025 */ - Parrot_find_sub_not_null_p_s, /* 1026 */ - Parrot_find_sub_not_null_p_sc, /* 1027 */ - Parrot_trap, /* 1028 */ - Parrot_set_label_p_ic, /* 1029 */ - Parrot_get_label_i_p, /* 1030 */ - Parrot_fetch_p_p_p_p, /* 1031 */ - Parrot_fetch_p_pc_p_p, /* 1032 */ - Parrot_fetch_p_p_pc_p, /* 1033 */ - Parrot_fetch_p_pc_pc_p, /* 1034 */ - Parrot_fetch_p_p_p_pc, /* 1035 */ - Parrot_fetch_p_pc_p_pc, /* 1036 */ - Parrot_fetch_p_p_pc_pc, /* 1037 */ - Parrot_fetch_p_pc_pc_pc, /* 1038 */ - Parrot_fetch_p_p_i_p, /* 1039 */ - Parrot_fetch_p_pc_i_p, /* 1040 */ - Parrot_fetch_p_p_ic_p, /* 1041 */ - Parrot_fetch_p_pc_ic_p, /* 1042 */ - Parrot_fetch_p_p_i_pc, /* 1043 */ - Parrot_fetch_p_pc_i_pc, /* 1044 */ - Parrot_fetch_p_p_ic_pc, /* 1045 */ - Parrot_fetch_p_pc_ic_pc, /* 1046 */ - Parrot_fetch_p_p_s_p, /* 1047 */ - Parrot_fetch_p_pc_s_p, /* 1048 */ - Parrot_fetch_p_p_sc_p, /* 1049 */ - Parrot_fetch_p_pc_sc_p, /* 1050 */ - Parrot_fetch_p_p_s_pc, /* 1051 */ - Parrot_fetch_p_pc_s_pc, /* 1052 */ - Parrot_fetch_p_p_sc_pc, /* 1053 */ - Parrot_fetch_p_pc_sc_pc, /* 1054 */ - Parrot_vivify_p_p_p_p, /* 1055 */ - Parrot_vivify_p_pc_p_p, /* 1056 */ - Parrot_vivify_p_p_pc_p, /* 1057 */ - Parrot_vivify_p_pc_pc_p, /* 1058 */ - Parrot_vivify_p_p_p_pc, /* 1059 */ - Parrot_vivify_p_pc_p_pc, /* 1060 */ - Parrot_vivify_p_p_pc_pc, /* 1061 */ - Parrot_vivify_p_pc_pc_pc, /* 1062 */ - Parrot_vivify_p_p_i_p, /* 1063 */ - Parrot_vivify_p_pc_i_p, /* 1064 */ - Parrot_vivify_p_p_ic_p, /* 1065 */ - Parrot_vivify_p_pc_ic_p, /* 1066 */ - Parrot_vivify_p_p_i_pc, /* 1067 */ - Parrot_vivify_p_pc_i_pc, /* 1068 */ - Parrot_vivify_p_p_ic_pc, /* 1069 */ - Parrot_vivify_p_pc_ic_pc, /* 1070 */ - Parrot_vivify_p_p_s_p, /* 1071 */ - Parrot_vivify_p_pc_s_p, /* 1072 */ - Parrot_vivify_p_p_sc_p, /* 1073 */ - Parrot_vivify_p_pc_sc_p, /* 1074 */ - Parrot_vivify_p_p_s_pc, /* 1075 */ - Parrot_vivify_p_pc_s_pc, /* 1076 */ - Parrot_vivify_p_p_sc_pc, /* 1077 */ - Parrot_vivify_p_pc_sc_pc, /* 1078 */ - Parrot_new_p_s_i, /* 1079 */ - Parrot_new_p_sc_i, /* 1080 */ - Parrot_new_p_s_ic, /* 1081 */ - Parrot_new_p_sc_ic, /* 1082 */ - Parrot_new_p_p_i, /* 1083 */ - Parrot_new_p_pc_i, /* 1084 */ - Parrot_new_p_p_ic, /* 1085 */ - Parrot_new_p_pc_ic, /* 1086 */ - Parrot_root_new_p_p_i, /* 1087 */ - Parrot_root_new_p_pc_i, /* 1088 */ - Parrot_root_new_p_p_ic, /* 1089 */ - Parrot_root_new_p_pc_ic, /* 1090 */ + Parrot_pop_upto_eh_p, /* 64 */ + Parrot_pop_upto_eh_pc, /* 65 */ + Parrot_peek_exception_p, /* 66 */ + Parrot_debug_i, /* 67 */ + Parrot_debug_ic, /* 68 */ + Parrot_bounds_i, /* 69 */ + Parrot_bounds_ic, /* 70 */ + Parrot_profile_i, /* 71 */ + Parrot_profile_ic, /* 72 */ + Parrot_trace_i, /* 73 */ + Parrot_trace_ic, /* 74 */ + Parrot_gc_debug_i, /* 75 */ + Parrot_gc_debug_ic, /* 76 */ + Parrot_interpinfo_i_i, /* 77 */ + Parrot_interpinfo_i_ic, /* 78 */ + Parrot_interpinfo_p_i, /* 79 */ + Parrot_interpinfo_p_ic, /* 80 */ + Parrot_interpinfo_s_i, /* 81 */ + Parrot_interpinfo_s_ic, /* 82 */ + Parrot_warningson_i, /* 83 */ + Parrot_warningson_ic, /* 84 */ + Parrot_warningsoff_i, /* 85 */ + Parrot_warningsoff_ic, /* 86 */ + Parrot_errorson_i, /* 87 */ + Parrot_errorson_ic, /* 88 */ + Parrot_errorsoff_i, /* 89 */ + Parrot_errorsoff_ic, /* 90 */ + Parrot_set_runcore_s, /* 91 */ + Parrot_set_runcore_sc, /* 92 */ + Parrot_runinterp_p_i, /* 93 */ + Parrot_runinterp_p_ic, /* 94 */ + Parrot_getinterp_p, /* 95 */ + Parrot_sweep_ic, /* 96 */ + Parrot_collect, /* 97 */ + Parrot_sweepoff, /* 98 */ + Parrot_sweepon, /* 99 */ + Parrot_collectoff, /* 100 */ + Parrot_collecton, /* 101 */ + Parrot_needs_destroy_p, /* 102 */ + Parrot_loadlib_p_s, /* 103 */ + Parrot_loadlib_p_sc, /* 104 */ + Parrot_loadlib_p_s_p, /* 105 */ + Parrot_loadlib_p_sc_p, /* 106 */ + Parrot_loadlib_p_s_pc, /* 107 */ + Parrot_loadlib_p_sc_pc, /* 108 */ + Parrot_dlfunc_p_p_s_s, /* 109 */ + Parrot_dlfunc_p_p_sc_s, /* 110 */ + Parrot_dlfunc_p_p_s_sc, /* 111 */ + Parrot_dlfunc_p_p_sc_sc, /* 112 */ + Parrot_dlfunc_p_p_s_p, /* 113 */ + Parrot_dlfunc_p_p_sc_p, /* 114 */ + Parrot_dlvar_p_p_s, /* 115 */ + Parrot_dlvar_p_p_sc, /* 116 */ + Parrot_compreg_s_p, /* 117 */ + Parrot_compreg_sc_p, /* 118 */ + Parrot_compreg_p_s, /* 119 */ + Parrot_compreg_p_sc, /* 120 */ + Parrot_new_callback_p_p_p_s, /* 121 */ + Parrot_new_callback_p_p_p_sc, /* 122 */ + Parrot_annotations_p, /* 123 */ + Parrot_annotations_p_s, /* 124 */ + Parrot_annotations_p_sc, /* 125 */ + Parrot_band_i_i, /* 126 */ + Parrot_band_i_ic, /* 127 */ + Parrot_band_i_i_i, /* 128 */ + Parrot_band_i_ic_i, /* 129 */ + Parrot_band_i_i_ic, /* 130 */ + Parrot_bor_i_i, /* 131 */ + Parrot_bor_i_ic, /* 132 */ + Parrot_bor_i_i_i, /* 133 */ + Parrot_bor_i_ic_i, /* 134 */ + Parrot_bor_i_i_ic, /* 135 */ + Parrot_shl_i_i, /* 136 */ + Parrot_shl_i_ic, /* 137 */ + Parrot_shl_i_i_i, /* 138 */ + Parrot_shl_i_ic_i, /* 139 */ + Parrot_shl_i_i_ic, /* 140 */ + Parrot_shr_i_i, /* 141 */ + Parrot_shr_i_ic, /* 142 */ + Parrot_shr_i_i_i, /* 143 */ + Parrot_shr_i_ic_i, /* 144 */ + Parrot_shr_i_i_ic, /* 145 */ + Parrot_lsr_i_i, /* 146 */ + Parrot_lsr_i_ic, /* 147 */ + Parrot_lsr_i_i_i, /* 148 */ + Parrot_lsr_i_ic_i, /* 149 */ + Parrot_lsr_i_i_ic, /* 150 */ + Parrot_bxor_i_i, /* 151 */ + Parrot_bxor_i_ic, /* 152 */ + Parrot_bxor_i_i_i, /* 153 */ + Parrot_bxor_i_ic_i, /* 154 */ + Parrot_bxor_i_i_ic, /* 155 */ + Parrot_eq_i_i_ic, /* 156 */ + Parrot_eq_ic_i_ic, /* 157 */ + Parrot_eq_i_ic_ic, /* 158 */ + Parrot_eq_n_n_ic, /* 159 */ + Parrot_eq_nc_n_ic, /* 160 */ + Parrot_eq_n_nc_ic, /* 161 */ + Parrot_eq_s_s_ic, /* 162 */ + Parrot_eq_sc_s_ic, /* 163 */ + Parrot_eq_s_sc_ic, /* 164 */ + Parrot_eq_p_p_ic, /* 165 */ + Parrot_eq_p_i_ic, /* 166 */ + Parrot_eq_p_ic_ic, /* 167 */ + Parrot_eq_p_n_ic, /* 168 */ + Parrot_eq_p_nc_ic, /* 169 */ + Parrot_eq_p_s_ic, /* 170 */ + Parrot_eq_p_sc_ic, /* 171 */ + Parrot_eq_str_p_p_ic, /* 172 */ + Parrot_eq_num_p_p_ic, /* 173 */ + Parrot_eq_addr_s_s_ic, /* 174 */ + Parrot_eq_addr_sc_s_ic, /* 175 */ + Parrot_eq_addr_s_sc_ic, /* 176 */ + Parrot_eq_addr_sc_sc_ic, /* 177 */ + Parrot_eq_addr_p_p_ic, /* 178 */ + Parrot_ne_i_i_ic, /* 179 */ + Parrot_ne_ic_i_ic, /* 180 */ + Parrot_ne_i_ic_ic, /* 181 */ + Parrot_ne_n_n_ic, /* 182 */ + Parrot_ne_nc_n_ic, /* 183 */ + Parrot_ne_n_nc_ic, /* 184 */ + Parrot_ne_s_s_ic, /* 185 */ + Parrot_ne_sc_s_ic, /* 186 */ + Parrot_ne_s_sc_ic, /* 187 */ + Parrot_ne_p_p_ic, /* 188 */ + Parrot_ne_p_i_ic, /* 189 */ + Parrot_ne_p_ic_ic, /* 190 */ + Parrot_ne_p_n_ic, /* 191 */ + Parrot_ne_p_nc_ic, /* 192 */ + Parrot_ne_p_s_ic, /* 193 */ + Parrot_ne_p_sc_ic, /* 194 */ + Parrot_ne_str_p_p_ic, /* 195 */ + Parrot_ne_num_p_p_ic, /* 196 */ + Parrot_ne_addr_s_s_ic, /* 197 */ + Parrot_ne_addr_sc_s_ic, /* 198 */ + Parrot_ne_addr_s_sc_ic, /* 199 */ + Parrot_ne_addr_sc_sc_ic, /* 200 */ + Parrot_ne_addr_p_p_ic, /* 201 */ + Parrot_lt_i_i_ic, /* 202 */ + Parrot_lt_ic_i_ic, /* 203 */ + Parrot_lt_i_ic_ic, /* 204 */ + Parrot_lt_n_n_ic, /* 205 */ + Parrot_lt_nc_n_ic, /* 206 */ + Parrot_lt_n_nc_ic, /* 207 */ + Parrot_lt_s_s_ic, /* 208 */ + Parrot_lt_sc_s_ic, /* 209 */ + Parrot_lt_s_sc_ic, /* 210 */ + Parrot_lt_p_p_ic, /* 211 */ + Parrot_lt_p_i_ic, /* 212 */ + Parrot_lt_p_ic_ic, /* 213 */ + Parrot_lt_p_n_ic, /* 214 */ + Parrot_lt_p_nc_ic, /* 215 */ + Parrot_lt_p_s_ic, /* 216 */ + Parrot_lt_p_sc_ic, /* 217 */ + Parrot_lt_str_p_p_ic, /* 218 */ + Parrot_lt_num_p_p_ic, /* 219 */ + Parrot_le_i_i_ic, /* 220 */ + Parrot_le_ic_i_ic, /* 221 */ + Parrot_le_i_ic_ic, /* 222 */ + Parrot_le_n_n_ic, /* 223 */ + Parrot_le_nc_n_ic, /* 224 */ + Parrot_le_n_nc_ic, /* 225 */ + Parrot_le_s_s_ic, /* 226 */ + Parrot_le_sc_s_ic, /* 227 */ + Parrot_le_s_sc_ic, /* 228 */ + Parrot_le_p_p_ic, /* 229 */ + Parrot_le_p_i_ic, /* 230 */ + Parrot_le_p_ic_ic, /* 231 */ + Parrot_le_p_n_ic, /* 232 */ + Parrot_le_p_nc_ic, /* 233 */ + Parrot_le_p_s_ic, /* 234 */ + Parrot_le_p_sc_ic, /* 235 */ + Parrot_le_str_p_p_ic, /* 236 */ + Parrot_le_num_p_p_ic, /* 237 */ + Parrot_gt_p_p_ic, /* 238 */ + Parrot_gt_p_i_ic, /* 239 */ + Parrot_gt_p_ic_ic, /* 240 */ + Parrot_gt_p_n_ic, /* 241 */ + Parrot_gt_p_nc_ic, /* 242 */ + Parrot_gt_p_s_ic, /* 243 */ + Parrot_gt_p_sc_ic, /* 244 */ + Parrot_gt_str_p_p_ic, /* 245 */ + Parrot_gt_num_p_p_ic, /* 246 */ + Parrot_ge_p_p_ic, /* 247 */ + Parrot_ge_p_i_ic, /* 248 */ + Parrot_ge_p_ic_ic, /* 249 */ + Parrot_ge_p_n_ic, /* 250 */ + Parrot_ge_p_nc_ic, /* 251 */ + Parrot_ge_p_s_ic, /* 252 */ + Parrot_ge_p_sc_ic, /* 253 */ + Parrot_ge_str_p_p_ic, /* 254 */ + Parrot_ge_num_p_p_ic, /* 255 */ + Parrot_if_null_p_ic, /* 256 */ + Parrot_if_null_s_ic, /* 257 */ + Parrot_unless_null_p_ic, /* 258 */ + Parrot_unless_null_s_ic, /* 259 */ + Parrot_cmp_i_i_i, /* 260 */ + Parrot_cmp_i_ic_i, /* 261 */ + Parrot_cmp_i_i_ic, /* 262 */ + Parrot_cmp_i_n_n, /* 263 */ + Parrot_cmp_i_nc_n, /* 264 */ + Parrot_cmp_i_n_nc, /* 265 */ + Parrot_cmp_i_s_s, /* 266 */ + Parrot_cmp_i_sc_s, /* 267 */ + Parrot_cmp_i_s_sc, /* 268 */ + Parrot_cmp_i_p_p, /* 269 */ + Parrot_cmp_i_p_i, /* 270 */ + Parrot_cmp_i_p_ic, /* 271 */ + Parrot_cmp_i_p_n, /* 272 */ + Parrot_cmp_i_p_nc, /* 273 */ + Parrot_cmp_i_p_s, /* 274 */ + Parrot_cmp_i_p_sc, /* 275 */ + Parrot_cmp_str_i_p_p, /* 276 */ + Parrot_cmp_num_i_p_p, /* 277 */ + Parrot_cmp_pmc_p_p_p, /* 278 */ + Parrot_issame_i_p_p, /* 279 */ + Parrot_issame_i_s_s, /* 280 */ + Parrot_issame_i_sc_s, /* 281 */ + Parrot_issame_i_s_sc, /* 282 */ + Parrot_issame_i_sc_sc, /* 283 */ + Parrot_isntsame_i_p_p, /* 284 */ + Parrot_isntsame_i_s_s, /* 285 */ + Parrot_isntsame_i_sc_s, /* 286 */ + Parrot_isntsame_i_s_sc, /* 287 */ + Parrot_isntsame_i_sc_sc, /* 288 */ + Parrot_istrue_i_p, /* 289 */ + Parrot_isfalse_i_p, /* 290 */ + Parrot_isnull_i_p, /* 291 */ + Parrot_isnull_i_pc, /* 292 */ + Parrot_isnull_i_s, /* 293 */ + Parrot_isnull_i_sc, /* 294 */ + Parrot_isgt_i_p_p, /* 295 */ + Parrot_isge_i_p_p, /* 296 */ + Parrot_isle_i_i_i, /* 297 */ + Parrot_isle_i_ic_i, /* 298 */ + Parrot_isle_i_i_ic, /* 299 */ + Parrot_isle_i_n_n, /* 300 */ + Parrot_isle_i_nc_n, /* 301 */ + Parrot_isle_i_n_nc, /* 302 */ + Parrot_isle_i_s_s, /* 303 */ + Parrot_isle_i_sc_s, /* 304 */ + Parrot_isle_i_s_sc, /* 305 */ + Parrot_isle_i_p_p, /* 306 */ + Parrot_islt_i_i_i, /* 307 */ + Parrot_islt_i_ic_i, /* 308 */ + Parrot_islt_i_i_ic, /* 309 */ + Parrot_islt_i_n_n, /* 310 */ + Parrot_islt_i_nc_n, /* 311 */ + Parrot_islt_i_n_nc, /* 312 */ + Parrot_islt_i_s_s, /* 313 */ + Parrot_islt_i_sc_s, /* 314 */ + Parrot_islt_i_s_sc, /* 315 */ + Parrot_islt_i_p_p, /* 316 */ + Parrot_iseq_i_i_i, /* 317 */ + Parrot_iseq_i_ic_i, /* 318 */ + Parrot_iseq_i_i_ic, /* 319 */ + Parrot_iseq_i_n_n, /* 320 */ + Parrot_iseq_i_nc_n, /* 321 */ + Parrot_iseq_i_n_nc, /* 322 */ + Parrot_iseq_i_s_s, /* 323 */ + Parrot_iseq_i_sc_s, /* 324 */ + Parrot_iseq_i_s_sc, /* 325 */ + Parrot_iseq_i_p_p, /* 326 */ + Parrot_isne_i_i_i, /* 327 */ + Parrot_isne_i_ic_i, /* 328 */ + Parrot_isne_i_i_ic, /* 329 */ + Parrot_isne_i_n_n, /* 330 */ + Parrot_isne_i_nc_n, /* 331 */ + Parrot_isne_i_n_nc, /* 332 */ + Parrot_isne_i_s_s, /* 333 */ + Parrot_isne_i_sc_s, /* 334 */ + Parrot_isne_i_s_sc, /* 335 */ + Parrot_isne_i_p_p, /* 336 */ + Parrot_and_i_i_i, /* 337 */ + Parrot_and_i_ic_i, /* 338 */ + Parrot_and_i_i_ic, /* 339 */ + Parrot_and_p_p_p, /* 340 */ + Parrot_not_i, /* 341 */ + Parrot_not_i_i, /* 342 */ + Parrot_not_p, /* 343 */ + Parrot_not_p_p, /* 344 */ + Parrot_or_i_i_i, /* 345 */ + Parrot_or_i_ic_i, /* 346 */ + Parrot_or_i_i_ic, /* 347 */ + Parrot_or_p_p_p, /* 348 */ + Parrot_xor_i_i_i, /* 349 */ + Parrot_xor_i_ic_i, /* 350 */ + Parrot_xor_i_i_ic, /* 351 */ + Parrot_xor_p_p_p, /* 352 */ + Parrot_print_i, /* 353 */ + Parrot_print_ic, /* 354 */ + Parrot_print_n, /* 355 */ + Parrot_print_nc, /* 356 */ + Parrot_print_s, /* 357 */ + Parrot_print_sc, /* 358 */ + Parrot_print_p, /* 359 */ + Parrot_say_i, /* 360 */ + Parrot_say_ic, /* 361 */ + Parrot_say_n, /* 362 */ + Parrot_say_nc, /* 363 */ + Parrot_say_s, /* 364 */ + Parrot_say_sc, /* 365 */ + Parrot_say_p, /* 366 */ + Parrot_print_p_i, /* 367 */ + Parrot_print_p_ic, /* 368 */ + Parrot_print_p_n, /* 369 */ + Parrot_print_p_nc, /* 370 */ + Parrot_print_p_s, /* 371 */ + Parrot_print_p_sc, /* 372 */ + Parrot_print_p_p, /* 373 */ + Parrot_getstdin_p, /* 374 */ + Parrot_getstdout_p, /* 375 */ + Parrot_getstderr_p, /* 376 */ + Parrot_abs_i, /* 377 */ + Parrot_abs_n, /* 378 */ + Parrot_abs_i_i, /* 379 */ + Parrot_abs_n_n, /* 380 */ + Parrot_abs_p, /* 381 */ + Parrot_abs_p_p, /* 382 */ + Parrot_add_i_i, /* 383 */ + Parrot_add_i_ic, /* 384 */ + Parrot_add_n_n, /* 385 */ + Parrot_add_n_nc, /* 386 */ + Parrot_add_p_p, /* 387 */ + Parrot_add_p_i, /* 388 */ + Parrot_add_p_ic, /* 389 */ + Parrot_add_p_n, /* 390 */ + Parrot_add_p_nc, /* 391 */ + Parrot_add_i_i_i, /* 392 */ + Parrot_add_i_ic_i, /* 393 */ + Parrot_add_i_i_ic, /* 394 */ + Parrot_add_n_n_n, /* 395 */ + Parrot_add_n_nc_n, /* 396 */ + Parrot_add_n_n_nc, /* 397 */ + Parrot_add_p_p_p, /* 398 */ + Parrot_add_p_p_i, /* 399 */ + Parrot_add_p_p_ic, /* 400 */ + Parrot_add_p_p_n, /* 401 */ + Parrot_add_p_p_nc, /* 402 */ + Parrot_dec_i, /* 403 */ + Parrot_dec_n, /* 404 */ + Parrot_dec_p, /* 405 */ + Parrot_div_i_i, /* 406 */ + Parrot_div_i_ic, /* 407 */ + Parrot_div_n_n, /* 408 */ + Parrot_div_n_nc, /* 409 */ + Parrot_div_p_p, /* 410 */ + Parrot_div_p_i, /* 411 */ + Parrot_div_p_ic, /* 412 */ + Parrot_div_p_n, /* 413 */ + Parrot_div_p_nc, /* 414 */ + Parrot_div_i_i_i, /* 415 */ + Parrot_div_i_ic_i, /* 416 */ + Parrot_div_i_i_ic, /* 417 */ + Parrot_div_i_ic_ic, /* 418 */ + Parrot_div_n_n_n, /* 419 */ + Parrot_div_n_nc_n, /* 420 */ + Parrot_div_n_n_nc, /* 421 */ + Parrot_div_n_nc_nc, /* 422 */ + Parrot_div_p_p_p, /* 423 */ + Parrot_div_p_p_i, /* 424 */ + Parrot_div_p_p_ic, /* 425 */ + Parrot_div_p_p_n, /* 426 */ + Parrot_div_p_p_nc, /* 427 */ + Parrot_fdiv_i_i, /* 428 */ + Parrot_fdiv_i_ic, /* 429 */ + Parrot_fdiv_n_n, /* 430 */ + Parrot_fdiv_n_nc, /* 431 */ + Parrot_fdiv_p_p, /* 432 */ + Parrot_fdiv_p_i, /* 433 */ + Parrot_fdiv_p_ic, /* 434 */ + Parrot_fdiv_p_n, /* 435 */ + Parrot_fdiv_p_nc, /* 436 */ + Parrot_fdiv_i_i_i, /* 437 */ + Parrot_fdiv_i_ic_i, /* 438 */ + Parrot_fdiv_i_i_ic, /* 439 */ + Parrot_fdiv_n_n_n, /* 440 */ + Parrot_fdiv_n_nc_n, /* 441 */ + Parrot_fdiv_n_n_nc, /* 442 */ + Parrot_fdiv_p_p_p, /* 443 */ + Parrot_fdiv_p_p_i, /* 444 */ + Parrot_fdiv_p_p_ic, /* 445 */ + Parrot_fdiv_p_p_n, /* 446 */ + Parrot_fdiv_p_p_nc, /* 447 */ + Parrot_ceil_n, /* 448 */ + Parrot_ceil_i_n, /* 449 */ + Parrot_ceil_n_n, /* 450 */ + Parrot_floor_n, /* 451 */ + Parrot_floor_i_n, /* 452 */ + Parrot_floor_n_n, /* 453 */ + Parrot_inc_i, /* 454 */ + Parrot_inc_n, /* 455 */ + Parrot_inc_p, /* 456 */ + Parrot_mod_i_i, /* 457 */ + Parrot_mod_i_ic, /* 458 */ + Parrot_mod_n_n, /* 459 */ + Parrot_mod_n_nc, /* 460 */ + Parrot_mod_p_p, /* 461 */ + Parrot_mod_p_i, /* 462 */ + Parrot_mod_p_ic, /* 463 */ + Parrot_mod_p_n, /* 464 */ + Parrot_mod_p_nc, /* 465 */ + Parrot_mod_i_i_i, /* 466 */ + Parrot_mod_i_ic_i, /* 467 */ + Parrot_mod_i_i_ic, /* 468 */ + Parrot_mod_n_n_n, /* 469 */ + Parrot_mod_n_nc_n, /* 470 */ + Parrot_mod_n_n_nc, /* 471 */ + Parrot_mod_p_p_p, /* 472 */ + Parrot_mod_p_p_i, /* 473 */ + Parrot_mod_p_p_ic, /* 474 */ + Parrot_mod_p_p_n, /* 475 */ + Parrot_mod_p_p_nc, /* 476 */ + Parrot_mul_i_i, /* 477 */ + Parrot_mul_i_ic, /* 478 */ + Parrot_mul_n_n, /* 479 */ + Parrot_mul_n_nc, /* 480 */ + Parrot_mul_p_p, /* 481 */ + Parrot_mul_p_i, /* 482 */ + Parrot_mul_p_ic, /* 483 */ + Parrot_mul_p_n, /* 484 */ + Parrot_mul_p_nc, /* 485 */ + Parrot_mul_i_i_i, /* 486 */ + Parrot_mul_i_ic_i, /* 487 */ + Parrot_mul_i_i_ic, /* 488 */ + Parrot_mul_n_n_n, /* 489 */ + Parrot_mul_n_nc_n, /* 490 */ + Parrot_mul_n_n_nc, /* 491 */ + Parrot_mul_p_p_p, /* 492 */ + Parrot_mul_p_p_i, /* 493 */ + Parrot_mul_p_p_ic, /* 494 */ + Parrot_mul_p_p_n, /* 495 */ + Parrot_mul_p_p_nc, /* 496 */ + Parrot_neg_i, /* 497 */ + Parrot_neg_n, /* 498 */ + Parrot_neg_p, /* 499 */ + Parrot_neg_i_i, /* 500 */ + Parrot_neg_n_n, /* 501 */ + Parrot_neg_p_p, /* 502 */ + Parrot_sub_i_i, /* 503 */ + Parrot_sub_i_ic, /* 504 */ + Parrot_sub_n_n, /* 505 */ + Parrot_sub_n_nc, /* 506 */ + Parrot_sub_p_p, /* 507 */ + Parrot_sub_p_i, /* 508 */ + Parrot_sub_p_ic, /* 509 */ + Parrot_sub_p_n, /* 510 */ + Parrot_sub_p_nc, /* 511 */ + Parrot_sub_i_i_i, /* 512 */ + Parrot_sub_i_ic_i, /* 513 */ + Parrot_sub_i_i_ic, /* 514 */ + Parrot_sub_n_n_n, /* 515 */ + Parrot_sub_n_nc_n, /* 516 */ + Parrot_sub_n_n_nc, /* 517 */ + Parrot_sub_p_p_p, /* 518 */ + Parrot_sub_p_p_i, /* 519 */ + Parrot_sub_p_p_ic, /* 520 */ + Parrot_sub_p_p_n, /* 521 */ + Parrot_sub_p_p_nc, /* 522 */ + Parrot_sqrt_n_n, /* 523 */ + Parrot_is_inf_or_nan_i_n, /* 524 */ + Parrot_is_inf_or_nan_i_nc, /* 525 */ + Parrot_callmethodcc_p_s, /* 526 */ + Parrot_callmethodcc_p_sc, /* 527 */ + Parrot_callmethodcc_p_p, /* 528 */ + Parrot_callmethod_p_s_p, /* 529 */ + Parrot_callmethod_p_sc_p, /* 530 */ + Parrot_callmethod_p_p_p, /* 531 */ + Parrot_tailcallmethod_p_s, /* 532 */ + Parrot_tailcallmethod_p_sc, /* 533 */ + Parrot_tailcallmethod_p_p, /* 534 */ + Parrot_addmethod_p_s_p, /* 535 */ + Parrot_addmethod_p_sc_p, /* 536 */ + Parrot_can_i_p_s, /* 537 */ + Parrot_can_i_p_sc, /* 538 */ + Parrot_does_i_p_s, /* 539 */ + Parrot_does_i_p_sc, /* 540 */ + Parrot_does_i_p_p, /* 541 */ + Parrot_does_i_p_pc, /* 542 */ + Parrot_isa_i_p_s, /* 543 */ + Parrot_isa_i_p_sc, /* 544 */ + Parrot_isa_i_p_p, /* 545 */ + Parrot_isa_i_p_pc, /* 546 */ + Parrot_newclass_p_s, /* 547 */ + Parrot_newclass_p_sc, /* 548 */ + Parrot_newclass_p_p, /* 549 */ + Parrot_newclass_p_pc, /* 550 */ + Parrot_subclass_p_p, /* 551 */ + Parrot_subclass_p_pc, /* 552 */ + Parrot_subclass_p_p_s, /* 553 */ + Parrot_subclass_p_pc_s, /* 554 */ + Parrot_subclass_p_p_sc, /* 555 */ + Parrot_subclass_p_pc_sc, /* 556 */ + Parrot_subclass_p_p_p, /* 557 */ + Parrot_subclass_p_pc_p, /* 558 */ + Parrot_subclass_p_p_pc, /* 559 */ + Parrot_subclass_p_pc_pc, /* 560 */ + Parrot_subclass_p_s, /* 561 */ + Parrot_subclass_p_sc, /* 562 */ + Parrot_subclass_p_s_s, /* 563 */ + Parrot_subclass_p_sc_s, /* 564 */ + Parrot_subclass_p_s_sc, /* 565 */ + Parrot_subclass_p_sc_sc, /* 566 */ + Parrot_subclass_p_s_p, /* 567 */ + Parrot_subclass_p_sc_p, /* 568 */ + Parrot_subclass_p_s_pc, /* 569 */ + Parrot_subclass_p_sc_pc, /* 570 */ + Parrot_get_class_p_s, /* 571 */ + Parrot_get_class_p_sc, /* 572 */ + Parrot_get_class_p_p, /* 573 */ + Parrot_get_class_p_pc, /* 574 */ + Parrot_class_p_p, /* 575 */ + Parrot_addparent_p_p, /* 576 */ + Parrot_removeparent_p_p, /* 577 */ + Parrot_addrole_p_p, /* 578 */ + Parrot_addattribute_p_s, /* 579 */ + Parrot_addattribute_p_sc, /* 580 */ + Parrot_removeattribute_p_s, /* 581 */ + Parrot_removeattribute_p_sc, /* 582 */ + Parrot_getattribute_p_p_s, /* 583 */ + Parrot_getattribute_p_p_sc, /* 584 */ + Parrot_getattribute_p_p_p_s, /* 585 */ + Parrot_getattribute_p_p_pc_s, /* 586 */ + Parrot_getattribute_p_p_p_sc, /* 587 */ + Parrot_getattribute_p_p_pc_sc, /* 588 */ + Parrot_setattribute_p_s_p, /* 589 */ + Parrot_setattribute_p_sc_p, /* 590 */ + Parrot_setattribute_p_p_s_p, /* 591 */ + Parrot_setattribute_p_pc_s_p, /* 592 */ + Parrot_setattribute_p_p_sc_p, /* 593 */ + Parrot_setattribute_p_pc_sc_p, /* 594 */ + Parrot_inspect_p_p, /* 595 */ + Parrot_inspect_p_pc, /* 596 */ + Parrot_inspect_p_p_s, /* 597 */ + Parrot_inspect_p_pc_s, /* 598 */ + Parrot_inspect_p_p_sc, /* 599 */ + Parrot_inspect_p_pc_sc, /* 600 */ + Parrot_new_p_s, /* 601 */ + Parrot_new_p_sc, /* 602 */ + Parrot_new_p_s_p, /* 603 */ + Parrot_new_p_sc_p, /* 604 */ + Parrot_new_p_s_pc, /* 605 */ + Parrot_new_p_sc_pc, /* 606 */ + Parrot_new_p_p, /* 607 */ + Parrot_new_p_pc, /* 608 */ + Parrot_new_p_p_p, /* 609 */ + Parrot_new_p_pc_p, /* 610 */ + Parrot_new_p_p_pc, /* 611 */ + Parrot_new_p_pc_pc, /* 612 */ + Parrot_root_new_p_p, /* 613 */ + Parrot_root_new_p_pc, /* 614 */ + Parrot_root_new_p_p_p, /* 615 */ + Parrot_root_new_p_pc_p, /* 616 */ + Parrot_root_new_p_p_pc, /* 617 */ + Parrot_root_new_p_pc_pc, /* 618 */ + Parrot_typeof_s_p, /* 619 */ + Parrot_typeof_p_p, /* 620 */ + Parrot_get_repr_s_p, /* 621 */ + Parrot_find_method_p_p_s, /* 622 */ + Parrot_find_method_p_p_sc, /* 623 */ + Parrot_defined_i_p, /* 624 */ + Parrot_defined_i_p_ki, /* 625 */ + Parrot_defined_i_p_kic, /* 626 */ + Parrot_defined_i_p_k, /* 627 */ + Parrot_defined_i_p_kc, /* 628 */ + Parrot_exists_i_p_ki, /* 629 */ + Parrot_exists_i_p_kic, /* 630 */ + Parrot_exists_i_p_k, /* 631 */ + Parrot_exists_i_p_kc, /* 632 */ + Parrot_delete_p_k, /* 633 */ + Parrot_delete_p_kc, /* 634 */ + Parrot_delete_p_ki, /* 635 */ + Parrot_delete_p_kic, /* 636 */ + Parrot_elements_i_p, /* 637 */ + Parrot_push_p_i, /* 638 */ + Parrot_push_p_ic, /* 639 */ + Parrot_push_p_n, /* 640 */ + Parrot_push_p_nc, /* 641 */ + Parrot_push_p_s, /* 642 */ + Parrot_push_p_sc, /* 643 */ + Parrot_push_p_p, /* 644 */ + Parrot_pop_i_p, /* 645 */ + Parrot_pop_n_p, /* 646 */ + Parrot_pop_s_p, /* 647 */ + Parrot_pop_p_p, /* 648 */ + Parrot_unshift_p_i, /* 649 */ + Parrot_unshift_p_ic, /* 650 */ + Parrot_unshift_p_n, /* 651 */ + Parrot_unshift_p_nc, /* 652 */ + Parrot_unshift_p_s, /* 653 */ + Parrot_unshift_p_sc, /* 654 */ + Parrot_unshift_p_p, /* 655 */ + Parrot_shift_i_p, /* 656 */ + Parrot_shift_n_p, /* 657 */ + Parrot_shift_s_p, /* 658 */ + Parrot_shift_p_p, /* 659 */ + Parrot_splice_p_p_i_i, /* 660 */ + Parrot_splice_p_p_ic_i, /* 661 */ + Parrot_splice_p_p_i_ic, /* 662 */ + Parrot_splice_p_p_ic_ic, /* 663 */ + Parrot_setprop_p_s_p, /* 664 */ + Parrot_setprop_p_sc_p, /* 665 */ + Parrot_getprop_p_s_p, /* 666 */ + Parrot_getprop_p_sc_p, /* 667 */ + Parrot_getprop_p_p_s, /* 668 */ + Parrot_getprop_p_p_sc, /* 669 */ + Parrot_delprop_p_s, /* 670 */ + Parrot_delprop_p_sc, /* 671 */ + Parrot_prophash_p_p, /* 672 */ + Parrot_freeze_s_p, /* 673 */ + Parrot_thaw_p_s, /* 674 */ + Parrot_thaw_p_sc, /* 675 */ + Parrot_add_multi_s_s_p, /* 676 */ + Parrot_add_multi_sc_s_p, /* 677 */ + Parrot_add_multi_s_sc_p, /* 678 */ + Parrot_add_multi_sc_sc_p, /* 679 */ + Parrot_find_multi_p_s_s, /* 680 */ + Parrot_find_multi_p_sc_s, /* 681 */ + Parrot_find_multi_p_s_sc, /* 682 */ + Parrot_find_multi_p_sc_sc, /* 683 */ + Parrot_register_p, /* 684 */ + Parrot_unregister_p, /* 685 */ + Parrot_box_p_i, /* 686 */ + Parrot_box_p_ic, /* 687 */ + Parrot_box_p_n, /* 688 */ + Parrot_box_p_nc, /* 689 */ + Parrot_box_p_s, /* 690 */ + Parrot_box_p_sc, /* 691 */ + Parrot_iter_p_p, /* 692 */ + Parrot_morph_p_p, /* 693 */ + Parrot_morph_p_pc, /* 694 */ + Parrot_clone_s_s, /* 695 */ + Parrot_clone_s_sc, /* 696 */ + Parrot_set_i_i, /* 697 */ + Parrot_set_i_ic, /* 698 */ + Parrot_set_i_n, /* 699 */ + Parrot_set_i_nc, /* 700 */ + Parrot_set_i_s, /* 701 */ + Parrot_set_i_sc, /* 702 */ + Parrot_set_n_n, /* 703 */ + Parrot_set_n_nc, /* 704 */ + Parrot_set_n_i, /* 705 */ + Parrot_set_n_ic, /* 706 */ + Parrot_set_n_s, /* 707 */ + Parrot_set_n_sc, /* 708 */ + Parrot_set_n_p, /* 709 */ + Parrot_set_s_p, /* 710 */ + Parrot_set_s_s, /* 711 */ + Parrot_set_s_sc, /* 712 */ + Parrot_set_s_i, /* 713 */ + Parrot_set_s_ic, /* 714 */ + Parrot_set_s_n, /* 715 */ + Parrot_set_s_nc, /* 716 */ + Parrot_set_p_pc, /* 717 */ + Parrot_set_p_p, /* 718 */ + Parrot_set_p_i, /* 719 */ + Parrot_set_p_ic, /* 720 */ + Parrot_set_p_n, /* 721 */ + Parrot_set_p_nc, /* 722 */ + Parrot_set_p_s, /* 723 */ + Parrot_set_p_sc, /* 724 */ + Parrot_set_i_p, /* 725 */ + Parrot_assign_p_p, /* 726 */ + Parrot_assign_p_i, /* 727 */ + Parrot_assign_p_ic, /* 728 */ + Parrot_assign_p_n, /* 729 */ + Parrot_assign_p_nc, /* 730 */ + Parrot_assign_p_s, /* 731 */ + Parrot_assign_p_sc, /* 732 */ + Parrot_assign_s_s, /* 733 */ + Parrot_assign_s_sc, /* 734 */ + Parrot_setref_p_p, /* 735 */ + Parrot_deref_p_p, /* 736 */ + Parrot_set_p_ki_i, /* 737 */ + Parrot_set_p_kic_i, /* 738 */ + Parrot_set_p_ki_ic, /* 739 */ + Parrot_set_p_kic_ic, /* 740 */ + Parrot_set_p_ki_n, /* 741 */ + Parrot_set_p_kic_n, /* 742 */ + Parrot_set_p_ki_nc, /* 743 */ + Parrot_set_p_kic_nc, /* 744 */ + Parrot_set_p_ki_s, /* 745 */ + Parrot_set_p_kic_s, /* 746 */ + Parrot_set_p_ki_sc, /* 747 */ + Parrot_set_p_kic_sc, /* 748 */ + Parrot_set_p_ki_p, /* 749 */ + Parrot_set_p_kic_p, /* 750 */ + Parrot_set_i_p_ki, /* 751 */ + Parrot_set_i_p_kic, /* 752 */ + Parrot_set_n_p_ki, /* 753 */ + Parrot_set_n_p_kic, /* 754 */ + Parrot_set_s_p_ki, /* 755 */ + Parrot_set_s_p_kic, /* 756 */ + Parrot_set_p_p_ki, /* 757 */ + Parrot_set_p_p_kic, /* 758 */ + Parrot_set_p_k_i, /* 759 */ + Parrot_set_p_kc_i, /* 760 */ + Parrot_set_p_k_ic, /* 761 */ + Parrot_set_p_kc_ic, /* 762 */ + Parrot_set_p_k_n, /* 763 */ + Parrot_set_p_kc_n, /* 764 */ + Parrot_set_p_k_nc, /* 765 */ + Parrot_set_p_kc_nc, /* 766 */ + Parrot_set_p_k_s, /* 767 */ + Parrot_set_p_kc_s, /* 768 */ + Parrot_set_p_k_sc, /* 769 */ + Parrot_set_p_kc_sc, /* 770 */ + Parrot_set_p_k_p, /* 771 */ + Parrot_set_p_kc_p, /* 772 */ + Parrot_set_i_p_k, /* 773 */ + Parrot_set_i_p_kc, /* 774 */ + Parrot_set_n_p_k, /* 775 */ + Parrot_set_n_p_kc, /* 776 */ + Parrot_set_s_p_k, /* 777 */ + Parrot_set_s_p_kc, /* 778 */ + Parrot_set_p_p_k, /* 779 */ + Parrot_set_p_p_kc, /* 780 */ + Parrot_clone_p_p, /* 781 */ + Parrot_clone_p_p_p, /* 782 */ + Parrot_clone_p_p_pc, /* 783 */ + Parrot_copy_p_p, /* 784 */ + Parrot_null_s, /* 785 */ + Parrot_null_i, /* 786 */ + Parrot_null_p, /* 787 */ + Parrot_null_n, /* 788 */ + Parrot_ord_i_s, /* 789 */ + Parrot_ord_i_sc, /* 790 */ + Parrot_ord_i_s_i, /* 791 */ + Parrot_ord_i_sc_i, /* 792 */ + Parrot_ord_i_s_ic, /* 793 */ + Parrot_ord_i_sc_ic, /* 794 */ + Parrot_chr_s_i, /* 795 */ + Parrot_chr_s_ic, /* 796 */ + Parrot_chopn_s_s_i, /* 797 */ + Parrot_chopn_s_sc_i, /* 798 */ + Parrot_chopn_s_s_ic, /* 799 */ + Parrot_chopn_s_sc_ic, /* 800 */ + Parrot_concat_p_p, /* 801 */ + Parrot_concat_p_s, /* 802 */ + Parrot_concat_p_sc, /* 803 */ + Parrot_concat_s_s_s, /* 804 */ + Parrot_concat_s_sc_s, /* 805 */ + Parrot_concat_s_s_sc, /* 806 */ + Parrot_concat_p_p_s, /* 807 */ + Parrot_concat_p_p_sc, /* 808 */ + Parrot_concat_p_p_p, /* 809 */ + Parrot_repeat_s_s_i, /* 810 */ + Parrot_repeat_s_sc_i, /* 811 */ + Parrot_repeat_s_s_ic, /* 812 */ + Parrot_repeat_s_sc_ic, /* 813 */ + Parrot_repeat_p_p_i, /* 814 */ + Parrot_repeat_p_p_ic, /* 815 */ + Parrot_repeat_p_p_p, /* 816 */ + Parrot_repeat_p_i, /* 817 */ + Parrot_repeat_p_ic, /* 818 */ + Parrot_repeat_p_p, /* 819 */ + Parrot_length_i_s, /* 820 */ + Parrot_length_i_sc, /* 821 */ + Parrot_bytelength_i_s, /* 822 */ + Parrot_bytelength_i_sc, /* 823 */ + Parrot_pin_s, /* 824 */ + Parrot_unpin_s, /* 825 */ + Parrot_substr_s_s_i, /* 826 */ + Parrot_substr_s_sc_i, /* 827 */ + Parrot_substr_s_s_ic, /* 828 */ + Parrot_substr_s_sc_ic, /* 829 */ + Parrot_substr_s_s_i_i, /* 830 */ + Parrot_substr_s_sc_i_i, /* 831 */ + Parrot_substr_s_s_ic_i, /* 832 */ + Parrot_substr_s_sc_ic_i, /* 833 */ + Parrot_substr_s_s_i_ic, /* 834 */ + Parrot_substr_s_sc_i_ic, /* 835 */ + Parrot_substr_s_s_ic_ic, /* 836 */ + Parrot_substr_s_sc_ic_ic, /* 837 */ + Parrot_substr_s_p_i_i, /* 838 */ + Parrot_substr_s_p_ic_i, /* 839 */ + Parrot_substr_s_p_i_ic, /* 840 */ + Parrot_substr_s_p_ic_ic, /* 841 */ + Parrot_replace_s_s_i_i_s, /* 842 */ + Parrot_replace_s_sc_i_i_s, /* 843 */ + Parrot_replace_s_s_ic_i_s, /* 844 */ + Parrot_replace_s_sc_ic_i_s, /* 845 */ + Parrot_replace_s_s_i_ic_s, /* 846 */ + Parrot_replace_s_sc_i_ic_s, /* 847 */ + Parrot_replace_s_s_ic_ic_s, /* 848 */ + Parrot_replace_s_sc_ic_ic_s, /* 849 */ + Parrot_replace_s_s_i_i_sc, /* 850 */ + Parrot_replace_s_sc_i_i_sc, /* 851 */ + Parrot_replace_s_s_ic_i_sc, /* 852 */ + Parrot_replace_s_sc_ic_i_sc, /* 853 */ + Parrot_replace_s_s_i_ic_sc, /* 854 */ + Parrot_replace_s_sc_i_ic_sc, /* 855 */ + Parrot_replace_s_s_ic_ic_sc, /* 856 */ + Parrot_replace_s_sc_ic_ic_sc, /* 857 */ + Parrot_index_i_s_s, /* 858 */ + Parrot_index_i_sc_s, /* 859 */ + Parrot_index_i_s_sc, /* 860 */ + Parrot_index_i_sc_sc, /* 861 */ + Parrot_index_i_s_s_i, /* 862 */ + Parrot_index_i_sc_s_i, /* 863 */ + Parrot_index_i_s_sc_i, /* 864 */ + Parrot_index_i_sc_sc_i, /* 865 */ + Parrot_index_i_s_s_ic, /* 866 */ + Parrot_index_i_sc_s_ic, /* 867 */ + Parrot_index_i_s_sc_ic, /* 868 */ + Parrot_index_i_sc_sc_ic, /* 869 */ + Parrot_sprintf_s_s_p, /* 870 */ + Parrot_sprintf_s_sc_p, /* 871 */ + Parrot_sprintf_p_p_p, /* 872 */ + Parrot_new_s, /* 873 */ + Parrot_stringinfo_i_s_i, /* 874 */ + Parrot_stringinfo_i_sc_i, /* 875 */ + Parrot_stringinfo_i_s_ic, /* 876 */ + Parrot_stringinfo_i_sc_ic, /* 877 */ + Parrot_upcase_s_s, /* 878 */ + Parrot_upcase_s_sc, /* 879 */ + Parrot_downcase_s_s, /* 880 */ + Parrot_downcase_s_sc, /* 881 */ + Parrot_titlecase_s_s, /* 882 */ + Parrot_titlecase_s_sc, /* 883 */ + Parrot_join_s_s_p, /* 884 */ + Parrot_join_s_sc_p, /* 885 */ + Parrot_split_p_s_s, /* 886 */ + Parrot_split_p_sc_s, /* 887 */ + Parrot_split_p_s_sc, /* 888 */ + Parrot_split_p_sc_sc, /* 889 */ + Parrot_encoding_i_s, /* 890 */ + Parrot_encoding_i_sc, /* 891 */ + Parrot_encodingname_s_i, /* 892 */ + Parrot_encodingname_s_ic, /* 893 */ + Parrot_find_encoding_i_s, /* 894 */ + Parrot_find_encoding_i_sc, /* 895 */ + Parrot_trans_encoding_s_s_i, /* 896 */ + Parrot_trans_encoding_s_sc_i, /* 897 */ + Parrot_trans_encoding_s_s_ic, /* 898 */ + Parrot_trans_encoding_s_sc_ic, /* 899 */ + Parrot_is_cclass_i_i_s_i, /* 900 */ + Parrot_is_cclass_i_ic_s_i, /* 901 */ + Parrot_is_cclass_i_i_sc_i, /* 902 */ + Parrot_is_cclass_i_ic_sc_i, /* 903 */ + Parrot_is_cclass_i_i_s_ic, /* 904 */ + Parrot_is_cclass_i_ic_s_ic, /* 905 */ + Parrot_is_cclass_i_i_sc_ic, /* 906 */ + Parrot_is_cclass_i_ic_sc_ic, /* 907 */ + Parrot_find_cclass_i_i_s_i_i, /* 908 */ + Parrot_find_cclass_i_ic_s_i_i, /* 909 */ + Parrot_find_cclass_i_i_sc_i_i, /* 910 */ + Parrot_find_cclass_i_ic_sc_i_i, /* 911 */ + Parrot_find_cclass_i_i_s_ic_i, /* 912 */ + Parrot_find_cclass_i_ic_s_ic_i, /* 913 */ + Parrot_find_cclass_i_i_sc_ic_i, /* 914 */ + Parrot_find_cclass_i_ic_sc_ic_i, /* 915 */ + Parrot_find_cclass_i_i_s_i_ic, /* 916 */ + Parrot_find_cclass_i_ic_s_i_ic, /* 917 */ + Parrot_find_cclass_i_i_sc_i_ic, /* 918 */ + Parrot_find_cclass_i_ic_sc_i_ic, /* 919 */ + Parrot_find_cclass_i_i_s_ic_ic, /* 920 */ + Parrot_find_cclass_i_ic_s_ic_ic, /* 921 */ + Parrot_find_cclass_i_i_sc_ic_ic, /* 922 */ + Parrot_find_cclass_i_ic_sc_ic_ic, /* 923 */ + Parrot_find_not_cclass_i_i_s_i_i, /* 924 */ + Parrot_find_not_cclass_i_ic_s_i_i, /* 925 */ + Parrot_find_not_cclass_i_i_sc_i_i, /* 926 */ + Parrot_find_not_cclass_i_ic_sc_i_i, /* 927 */ + Parrot_find_not_cclass_i_i_s_ic_i, /* 928 */ + Parrot_find_not_cclass_i_ic_s_ic_i, /* 929 */ + Parrot_find_not_cclass_i_i_sc_ic_i, /* 930 */ + Parrot_find_not_cclass_i_ic_sc_ic_i, /* 931 */ + Parrot_find_not_cclass_i_i_s_i_ic, /* 932 */ + Parrot_find_not_cclass_i_ic_s_i_ic, /* 933 */ + Parrot_find_not_cclass_i_i_sc_i_ic, /* 934 */ + Parrot_find_not_cclass_i_ic_sc_i_ic, /* 935 */ + Parrot_find_not_cclass_i_i_s_ic_ic, /* 936 */ + Parrot_find_not_cclass_i_ic_s_ic_ic, /* 937 */ + Parrot_find_not_cclass_i_i_sc_ic_ic, /* 938 */ + Parrot_find_not_cclass_i_ic_sc_ic_ic, /* 939 */ + Parrot_escape_s_s, /* 940 */ + Parrot_compose_s_s, /* 941 */ + Parrot_compose_s_sc, /* 942 */ + Parrot_find_codepoint_i_s, /* 943 */ + Parrot_find_codepoint_i_sc, /* 944 */ + Parrot_spawnw_i_s, /* 945 */ + Parrot_spawnw_i_sc, /* 946 */ + Parrot_spawnw_i_p, /* 947 */ + Parrot_err_i, /* 948 */ + Parrot_err_s, /* 949 */ + Parrot_err_s_i, /* 950 */ + Parrot_err_s_ic, /* 951 */ + Parrot_time_i, /* 952 */ + Parrot_time_n, /* 953 */ + Parrot_sleep_i, /* 954 */ + Parrot_sleep_ic, /* 955 */ + Parrot_sleep_n, /* 956 */ + Parrot_sleep_nc, /* 957 */ + Parrot_store_lex_s_p, /* 958 */ + Parrot_store_lex_sc_p, /* 959 */ + Parrot_store_lex_s_s, /* 960 */ + Parrot_store_lex_sc_s, /* 961 */ + Parrot_store_lex_s_sc, /* 962 */ + Parrot_store_lex_sc_sc, /* 963 */ + Parrot_store_lex_s_i, /* 964 */ + Parrot_store_lex_sc_i, /* 965 */ + Parrot_store_lex_s_ic, /* 966 */ + Parrot_store_lex_sc_ic, /* 967 */ + Parrot_store_lex_s_n, /* 968 */ + Parrot_store_lex_sc_n, /* 969 */ + Parrot_store_lex_s_nc, /* 970 */ + Parrot_store_lex_sc_nc, /* 971 */ + Parrot_store_dynamic_lex_s_p, /* 972 */ + Parrot_store_dynamic_lex_sc_p, /* 973 */ + Parrot_find_lex_p_s, /* 974 */ + Parrot_find_lex_p_sc, /* 975 */ + Parrot_find_lex_s_s, /* 976 */ + Parrot_find_lex_s_sc, /* 977 */ + Parrot_find_lex_i_s, /* 978 */ + Parrot_find_lex_i_sc, /* 979 */ + Parrot_find_lex_n_s, /* 980 */ + Parrot_find_lex_n_sc, /* 981 */ + Parrot_find_dynamic_lex_p_s, /* 982 */ + Parrot_find_dynamic_lex_p_sc, /* 983 */ + Parrot_find_caller_lex_p_s, /* 984 */ + Parrot_find_caller_lex_p_sc, /* 985 */ + Parrot_get_namespace_p, /* 986 */ + Parrot_get_namespace_p_p, /* 987 */ + Parrot_get_namespace_p_pc, /* 988 */ + Parrot_get_hll_namespace_p, /* 989 */ + Parrot_get_hll_namespace_p_p, /* 990 */ + Parrot_get_hll_namespace_p_pc, /* 991 */ + Parrot_get_root_namespace_p, /* 992 */ + Parrot_get_root_namespace_p_p, /* 993 */ + Parrot_get_root_namespace_p_pc, /* 994 */ + Parrot_get_global_p_s, /* 995 */ + Parrot_get_global_p_sc, /* 996 */ + Parrot_get_global_p_p_s, /* 997 */ + Parrot_get_global_p_pc_s, /* 998 */ + Parrot_get_global_p_p_sc, /* 999 */ + Parrot_get_global_p_pc_sc, /* 1000 */ + Parrot_get_hll_global_p_s, /* 1001 */ + Parrot_get_hll_global_p_sc, /* 1002 */ + Parrot_get_hll_global_p_p_s, /* 1003 */ + Parrot_get_hll_global_p_pc_s, /* 1004 */ + Parrot_get_hll_global_p_p_sc, /* 1005 */ + Parrot_get_hll_global_p_pc_sc, /* 1006 */ + Parrot_get_root_global_p_s, /* 1007 */ + Parrot_get_root_global_p_sc, /* 1008 */ + Parrot_get_root_global_p_p_s, /* 1009 */ + Parrot_get_root_global_p_pc_s, /* 1010 */ + Parrot_get_root_global_p_p_sc, /* 1011 */ + Parrot_get_root_global_p_pc_sc, /* 1012 */ + Parrot_set_global_s_p, /* 1013 */ + Parrot_set_global_sc_p, /* 1014 */ + Parrot_set_global_p_s_p, /* 1015 */ + Parrot_set_global_pc_s_p, /* 1016 */ + Parrot_set_global_p_sc_p, /* 1017 */ + Parrot_set_global_pc_sc_p, /* 1018 */ + Parrot_set_hll_global_s_p, /* 1019 */ + Parrot_set_hll_global_sc_p, /* 1020 */ + Parrot_set_hll_global_p_s_p, /* 1021 */ + Parrot_set_hll_global_pc_s_p, /* 1022 */ + Parrot_set_hll_global_p_sc_p, /* 1023 */ + Parrot_set_hll_global_pc_sc_p, /* 1024 */ + Parrot_set_root_global_s_p, /* 1025 */ + Parrot_set_root_global_sc_p, /* 1026 */ + Parrot_set_root_global_p_s_p, /* 1027 */ + Parrot_set_root_global_pc_s_p, /* 1028 */ + Parrot_set_root_global_p_sc_p, /* 1029 */ + Parrot_set_root_global_pc_sc_p, /* 1030 */ + Parrot_find_name_p_s, /* 1031 */ + Parrot_find_name_p_sc, /* 1032 */ + Parrot_find_sub_not_null_p_s, /* 1033 */ + Parrot_find_sub_not_null_p_sc, /* 1034 */ + Parrot_trap, /* 1035 */ + Parrot_set_label_p_ic, /* 1036 */ + Parrot_get_label_i_p, /* 1037 */ + Parrot_get_id_i_p, /* 1038 */ + Parrot_get_id_i_pc, /* 1039 */ + Parrot_fetch_p_p_p_p, /* 1040 */ + Parrot_fetch_p_pc_p_p, /* 1041 */ + Parrot_fetch_p_p_pc_p, /* 1042 */ + Parrot_fetch_p_pc_pc_p, /* 1043 */ + Parrot_fetch_p_p_p_pc, /* 1044 */ + Parrot_fetch_p_pc_p_pc, /* 1045 */ + Parrot_fetch_p_p_pc_pc, /* 1046 */ + Parrot_fetch_p_pc_pc_pc, /* 1047 */ + Parrot_fetch_p_p_i_p, /* 1048 */ + Parrot_fetch_p_pc_i_p, /* 1049 */ + Parrot_fetch_p_p_ic_p, /* 1050 */ + Parrot_fetch_p_pc_ic_p, /* 1051 */ + Parrot_fetch_p_p_i_pc, /* 1052 */ + Parrot_fetch_p_pc_i_pc, /* 1053 */ + Parrot_fetch_p_p_ic_pc, /* 1054 */ + Parrot_fetch_p_pc_ic_pc, /* 1055 */ + Parrot_fetch_p_p_s_p, /* 1056 */ + Parrot_fetch_p_pc_s_p, /* 1057 */ + Parrot_fetch_p_p_sc_p, /* 1058 */ + Parrot_fetch_p_pc_sc_p, /* 1059 */ + Parrot_fetch_p_p_s_pc, /* 1060 */ + Parrot_fetch_p_pc_s_pc, /* 1061 */ + Parrot_fetch_p_p_sc_pc, /* 1062 */ + Parrot_fetch_p_pc_sc_pc, /* 1063 */ + Parrot_vivify_p_p_p_p, /* 1064 */ + Parrot_vivify_p_pc_p_p, /* 1065 */ + Parrot_vivify_p_p_pc_p, /* 1066 */ + Parrot_vivify_p_pc_pc_p, /* 1067 */ + Parrot_vivify_p_p_p_pc, /* 1068 */ + Parrot_vivify_p_pc_p_pc, /* 1069 */ + Parrot_vivify_p_p_pc_pc, /* 1070 */ + Parrot_vivify_p_pc_pc_pc, /* 1071 */ + Parrot_vivify_p_p_i_p, /* 1072 */ + Parrot_vivify_p_pc_i_p, /* 1073 */ + Parrot_vivify_p_p_ic_p, /* 1074 */ + Parrot_vivify_p_pc_ic_p, /* 1075 */ + Parrot_vivify_p_p_i_pc, /* 1076 */ + Parrot_vivify_p_pc_i_pc, /* 1077 */ + Parrot_vivify_p_p_ic_pc, /* 1078 */ + Parrot_vivify_p_pc_ic_pc, /* 1079 */ + Parrot_vivify_p_p_s_p, /* 1080 */ + Parrot_vivify_p_pc_s_p, /* 1081 */ + Parrot_vivify_p_p_sc_p, /* 1082 */ + Parrot_vivify_p_pc_sc_p, /* 1083 */ + Parrot_vivify_p_p_s_pc, /* 1084 */ + Parrot_vivify_p_pc_s_pc, /* 1085 */ + Parrot_vivify_p_p_sc_pc, /* 1086 */ + Parrot_vivify_p_pc_sc_pc, /* 1087 */ + Parrot_new_p_s_i, /* 1088 */ + Parrot_new_p_sc_i, /* 1089 */ + Parrot_new_p_s_ic, /* 1090 */ + Parrot_new_p_sc_ic, /* 1091 */ + Parrot_new_p_p_i, /* 1092 */ + Parrot_new_p_pc_i, /* 1093 */ + Parrot_new_p_p_ic, /* 1094 */ + Parrot_new_p_pc_ic, /* 1095 */ + Parrot_root_new_p_p_i, /* 1096 */ + Parrot_root_new_p_pc_i, /* 1097 */ + Parrot_root_new_p_p_ic, /* 1098 */ + Parrot_root_new_p_pc_ic, /* 1099 */ + Parrot_get_context_p, /* 1100 */ + Parrot_new_call_context_p, /* 1101 */ + Parrot_invokecc_p_p, /* 1102 */ + Parrot_flatten_array_into_p_p_i, /* 1103 */ + Parrot_flatten_array_into_p_p_ic, /* 1104 */ + Parrot_flatten_hash_into_p_p_i, /* 1105 */ + Parrot_flatten_hash_into_p_p_ic, /* 1106 */ + Parrot_slurp_array_from_p_p_i, /* 1107 */ + Parrot_slurp_array_from_p_p_ic, /* 1108 */ + Parrot_receive_p, /* 1109 */ + Parrot_wait_p, /* 1110 */ + Parrot_wait_pc, /* 1111 */ + Parrot_pass, /* 1112 */ NULL /* NULL function pointer */ }; @@ -1177,7 +1207,7 @@ static op_func_t core_op_func_table[1092] = { ** Op Info Table: */ -static op_info_t core_op_info_table[1092] = { +static op_info_t core_op_info_table[1114] = { { /* 0 */ "end", "end", @@ -1883,6 +1913,39 @@ static op_info_t core_op_info_table[1092] = { &core_op_lib }, { /* 64 */ + "pop_upto_eh", + "pop_upto_eh_p", + "Parrot_pop_upto_eh_p", + 0, + 2, + { PARROT_ARG_P }, + { PARROT_ARGDIR_IN }, + { 0 }, + &core_op_lib + }, + { /* 65 */ + "pop_upto_eh", + "pop_upto_eh_pc", + "Parrot_pop_upto_eh_pc", + 0, + 2, + { PARROT_ARG_PC }, + { PARROT_ARGDIR_IN }, + { 0 }, + &core_op_lib + }, + { /* 66 */ + "peek_exception", + "peek_exception_p", + "Parrot_peek_exception_p", + 0, + 2, + { PARROT_ARG_P }, + { PARROT_ARGDIR_OUT }, + { 0 }, + &core_op_lib + }, + { /* 67 */ "debug", "debug_i", "Parrot_debug_i", @@ -1893,7 +1956,7 @@ static op_info_t core_op_info_table[1092] = { { 0 }, &core_op_lib }, - { /* 65 */ + { /* 68 */ "debug", "debug_ic", "Parrot_debug_ic", @@ -1904,7 +1967,7 @@ static op_info_t core_op_info_table[1092] = { { 0 }, &core_op_lib }, - { /* 66 */ + { /* 69 */ "bounds", "bounds_i", "Parrot_bounds_i", @@ -1915,7 +1978,7 @@ static op_info_t core_op_info_table[1092] = { { 0 }, &core_op_lib }, - { /* 67 */ + { /* 70 */ "bounds", "bounds_ic", "Parrot_bounds_ic", @@ -1926,7 +1989,7 @@ static op_info_t core_op_info_table[1092] = { { 0 }, &core_op_lib }, - { /* 68 */ + { /* 71 */ "profile", "profile_i", "Parrot_profile_i", @@ -1937,7 +2000,7 @@ static op_info_t core_op_info_table[1092] = { { 0 }, &core_op_lib }, - { /* 69 */ + { /* 72 */ "profile", "profile_ic", "Parrot_profile_ic", @@ -1948,7 +2011,7 @@ static op_info_t core_op_info_table[1092] = { { 0 }, &core_op_lib }, - { /* 70 */ + { /* 73 */ "trace", "trace_i", "Parrot_trace_i", @@ -1959,7 +2022,7 @@ static op_info_t core_op_info_table[1092] = { { 0 }, &core_op_lib }, - { /* 71 */ + { /* 74 */ "trace", "trace_ic", "Parrot_trace_ic", @@ -1970,7 +2033,7 @@ static op_info_t core_op_info_table[1092] = { { 0 }, &core_op_lib }, - { /* 72 */ + { /* 75 */ "gc_debug", "gc_debug_i", "Parrot_gc_debug_i", @@ -1981,7 +2044,7 @@ static op_info_t core_op_info_table[1092] = { { 0 }, &core_op_lib }, - { /* 73 */ + { /* 76 */ "gc_debug", "gc_debug_ic", "Parrot_gc_debug_ic", @@ -1992,7 +2055,7 @@ static op_info_t core_op_info_table[1092] = { { 0 }, &core_op_lib }, - { /* 74 */ + { /* 77 */ "interpinfo", "interpinfo_i_i", "Parrot_interpinfo_i_i", @@ -2003,7 +2066,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 75 */ + { /* 78 */ "interpinfo", "interpinfo_i_ic", "Parrot_interpinfo_i_ic", @@ -2014,7 +2077,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 76 */ + { /* 79 */ "interpinfo", "interpinfo_p_i", "Parrot_interpinfo_p_i", @@ -2025,7 +2088,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 77 */ + { /* 80 */ "interpinfo", "interpinfo_p_ic", "Parrot_interpinfo_p_ic", @@ -2036,7 +2099,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 78 */ + { /* 81 */ "interpinfo", "interpinfo_s_i", "Parrot_interpinfo_s_i", @@ -2047,7 +2110,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 79 */ + { /* 82 */ "interpinfo", "interpinfo_s_ic", "Parrot_interpinfo_s_ic", @@ -2058,7 +2121,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 80 */ + { /* 83 */ "warningson", "warningson_i", "Parrot_warningson_i", @@ -2069,7 +2132,7 @@ static op_info_t core_op_info_table[1092] = { { 0 }, &core_op_lib }, - { /* 81 */ + { /* 84 */ "warningson", "warningson_ic", "Parrot_warningson_ic", @@ -2080,7 +2143,7 @@ static op_info_t core_op_info_table[1092] = { { 0 }, &core_op_lib }, - { /* 82 */ + { /* 85 */ "warningsoff", "warningsoff_i", "Parrot_warningsoff_i", @@ -2091,7 +2154,7 @@ static op_info_t core_op_info_table[1092] = { { 0 }, &core_op_lib }, - { /* 83 */ + { /* 86 */ "warningsoff", "warningsoff_ic", "Parrot_warningsoff_ic", @@ -2102,7 +2165,7 @@ static op_info_t core_op_info_table[1092] = { { 0 }, &core_op_lib }, - { /* 84 */ + { /* 87 */ "errorson", "errorson_i", "Parrot_errorson_i", @@ -2113,7 +2176,7 @@ static op_info_t core_op_info_table[1092] = { { 0 }, &core_op_lib }, - { /* 85 */ + { /* 88 */ "errorson", "errorson_ic", "Parrot_errorson_ic", @@ -2124,7 +2187,7 @@ static op_info_t core_op_info_table[1092] = { { 0 }, &core_op_lib }, - { /* 86 */ + { /* 89 */ "errorsoff", "errorsoff_i", "Parrot_errorsoff_i", @@ -2135,7 +2198,7 @@ static op_info_t core_op_info_table[1092] = { { 0 }, &core_op_lib }, - { /* 87 */ + { /* 90 */ "errorsoff", "errorsoff_ic", "Parrot_errorsoff_ic", @@ -2146,7 +2209,29 @@ static op_info_t core_op_info_table[1092] = { { 0 }, &core_op_lib }, - { /* 88 */ + { /* 91 */ + "set_runcore", + "set_runcore_s", + "Parrot_set_runcore_s", + 0, + 2, + { PARROT_ARG_S }, + { PARROT_ARGDIR_IN }, + { 0 }, + &core_op_lib + }, + { /* 92 */ + "set_runcore", + "set_runcore_sc", + "Parrot_set_runcore_sc", + 0, + 2, + { PARROT_ARG_SC }, + { PARROT_ARGDIR_IN }, + { 0 }, + &core_op_lib + }, + { /* 93 */ "runinterp", "runinterp_p_i", "Parrot_runinterp_p_i", @@ -2157,7 +2242,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 1 }, &core_op_lib }, - { /* 89 */ + { /* 94 */ "runinterp", "runinterp_p_ic", "Parrot_runinterp_p_ic", @@ -2168,7 +2253,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 1 }, &core_op_lib }, - { /* 90 */ + { /* 95 */ "getinterp", "getinterp_p", "Parrot_getinterp_p", @@ -2179,7 +2264,7 @@ static op_info_t core_op_info_table[1092] = { { 0 }, &core_op_lib }, - { /* 91 */ + { /* 96 */ "sweep", "sweep_ic", "Parrot_sweep_ic", @@ -2190,7 +2275,7 @@ static op_info_t core_op_info_table[1092] = { { 0 }, &core_op_lib }, - { /* 92 */ + { /* 97 */ "collect", "collect", "Parrot_collect", @@ -2201,7 +2286,7 @@ static op_info_t core_op_info_table[1092] = { { 0 }, &core_op_lib }, - { /* 93 */ + { /* 98 */ "sweepoff", "sweepoff", "Parrot_sweepoff", @@ -2212,7 +2297,7 @@ static op_info_t core_op_info_table[1092] = { { 0 }, &core_op_lib }, - { /* 94 */ + { /* 99 */ "sweepon", "sweepon", "Parrot_sweepon", @@ -2223,7 +2308,7 @@ static op_info_t core_op_info_table[1092] = { { 0 }, &core_op_lib }, - { /* 95 */ + { /* 100 */ "collectoff", "collectoff", "Parrot_collectoff", @@ -2234,7 +2319,7 @@ static op_info_t core_op_info_table[1092] = { { 0 }, &core_op_lib }, - { /* 96 */ + { /* 101 */ "collecton", "collecton", "Parrot_collecton", @@ -2245,7 +2330,7 @@ static op_info_t core_op_info_table[1092] = { { 0 }, &core_op_lib }, - { /* 97 */ + { /* 102 */ "needs_destroy", "needs_destroy_p", "Parrot_needs_destroy_p", @@ -2256,7 +2341,7 @@ static op_info_t core_op_info_table[1092] = { { 0 }, &core_op_lib }, - { /* 98 */ + { /* 103 */ "loadlib", "loadlib_p_s", "Parrot_loadlib_p_s", @@ -2267,7 +2352,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 99 */ + { /* 104 */ "loadlib", "loadlib_p_sc", "Parrot_loadlib_p_sc", @@ -2278,7 +2363,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 100 */ + { /* 105 */ "loadlib", "loadlib_p_s_p", "Parrot_loadlib_p_s_p", @@ -2289,7 +2374,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 101 */ + { /* 106 */ "loadlib", "loadlib_p_sc_p", "Parrot_loadlib_p_sc_p", @@ -2300,7 +2385,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 102 */ + { /* 107 */ "loadlib", "loadlib_p_s_pc", "Parrot_loadlib_p_s_pc", @@ -2311,7 +2396,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 103 */ + { /* 108 */ "loadlib", "loadlib_p_sc_pc", "Parrot_loadlib_p_sc_pc", @@ -2322,7 +2407,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 104 */ + { /* 109 */ "dlfunc", "dlfunc_p_p_s_s", "Parrot_dlfunc_p_p_s_s", @@ -2333,7 +2418,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0, 0 }, &core_op_lib }, - { /* 105 */ + { /* 110 */ "dlfunc", "dlfunc_p_p_sc_s", "Parrot_dlfunc_p_p_sc_s", @@ -2344,7 +2429,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0, 0 }, &core_op_lib }, - { /* 106 */ + { /* 111 */ "dlfunc", "dlfunc_p_p_s_sc", "Parrot_dlfunc_p_p_s_sc", @@ -2355,7 +2440,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0, 0 }, &core_op_lib }, - { /* 107 */ + { /* 112 */ "dlfunc", "dlfunc_p_p_sc_sc", "Parrot_dlfunc_p_p_sc_sc", @@ -2366,7 +2451,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0, 0 }, &core_op_lib }, - { /* 108 */ + { /* 113 */ "dlfunc", "dlfunc_p_p_s_p", "Parrot_dlfunc_p_p_s_p", @@ -2377,7 +2462,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0, 0 }, &core_op_lib }, - { /* 109 */ + { /* 114 */ "dlfunc", "dlfunc_p_p_sc_p", "Parrot_dlfunc_p_p_sc_p", @@ -2388,7 +2473,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0, 0 }, &core_op_lib }, - { /* 110 */ + { /* 115 */ "dlvar", "dlvar_p_p_s", "Parrot_dlvar_p_p_s", @@ -2399,7 +2484,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 111 */ + { /* 116 */ "dlvar", "dlvar_p_p_sc", "Parrot_dlvar_p_p_sc", @@ -2410,7 +2495,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 112 */ + { /* 117 */ "compreg", "compreg_s_p", "Parrot_compreg_s_p", @@ -2421,7 +2506,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 113 */ + { /* 118 */ "compreg", "compreg_sc_p", "Parrot_compreg_sc_p", @@ -2432,7 +2517,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 114 */ + { /* 119 */ "compreg", "compreg_p_s", "Parrot_compreg_p_s", @@ -2443,7 +2528,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 115 */ + { /* 120 */ "compreg", "compreg_p_sc", "Parrot_compreg_p_sc", @@ -2454,7 +2539,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 116 */ + { /* 121 */ "new_callback", "new_callback_p_p_p_s", "Parrot_new_callback_p_p_p_s", @@ -2465,7 +2550,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0, 0 }, &core_op_lib }, - { /* 117 */ + { /* 122 */ "new_callback", "new_callback_p_p_p_sc", "Parrot_new_callback_p_p_p_sc", @@ -2476,7 +2561,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0, 0 }, &core_op_lib }, - { /* 118 */ + { /* 123 */ "annotations", "annotations_p", "Parrot_annotations_p", @@ -2487,7 +2572,7 @@ static op_info_t core_op_info_table[1092] = { { 0 }, &core_op_lib }, - { /* 119 */ + { /* 124 */ "annotations", "annotations_p_s", "Parrot_annotations_p_s", @@ -2498,7 +2583,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 120 */ + { /* 125 */ "annotations", "annotations_p_sc", "Parrot_annotations_p_sc", @@ -2509,7 +2594,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 121 */ + { /* 126 */ "band", "band_i_i", "Parrot_band_i_i", @@ -2520,7 +2605,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 122 */ + { /* 127 */ "band", "band_i_ic", "Parrot_band_i_ic", @@ -2531,7 +2616,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 123 */ + { /* 128 */ "band", "band_i_i_i", "Parrot_band_i_i_i", @@ -2542,7 +2627,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 124 */ + { /* 129 */ "band", "band_i_ic_i", "Parrot_band_i_ic_i", @@ -2553,7 +2638,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 125 */ + { /* 130 */ "band", "band_i_i_ic", "Parrot_band_i_i_ic", @@ -2564,7 +2649,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 126 */ + { /* 131 */ "bor", "bor_i_i", "Parrot_bor_i_i", @@ -2575,7 +2660,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 127 */ + { /* 132 */ "bor", "bor_i_ic", "Parrot_bor_i_ic", @@ -2586,7 +2671,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 128 */ + { /* 133 */ "bor", "bor_i_i_i", "Parrot_bor_i_i_i", @@ -2597,7 +2682,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 129 */ + { /* 134 */ "bor", "bor_i_ic_i", "Parrot_bor_i_ic_i", @@ -2608,7 +2693,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 130 */ + { /* 135 */ "bor", "bor_i_i_ic", "Parrot_bor_i_i_ic", @@ -2619,7 +2704,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 131 */ + { /* 136 */ "shl", "shl_i_i", "Parrot_shl_i_i", @@ -2630,7 +2715,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 132 */ + { /* 137 */ "shl", "shl_i_ic", "Parrot_shl_i_ic", @@ -2641,7 +2726,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 133 */ + { /* 138 */ "shl", "shl_i_i_i", "Parrot_shl_i_i_i", @@ -2652,7 +2737,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 134 */ + { /* 139 */ "shl", "shl_i_ic_i", "Parrot_shl_i_ic_i", @@ -2663,7 +2748,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 135 */ + { /* 140 */ "shl", "shl_i_i_ic", "Parrot_shl_i_i_ic", @@ -2674,7 +2759,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 136 */ + { /* 141 */ "shr", "shr_i_i", "Parrot_shr_i_i", @@ -2685,7 +2770,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 137 */ + { /* 142 */ "shr", "shr_i_ic", "Parrot_shr_i_ic", @@ -2696,7 +2781,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 138 */ + { /* 143 */ "shr", "shr_i_i_i", "Parrot_shr_i_i_i", @@ -2707,7 +2792,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 139 */ + { /* 144 */ "shr", "shr_i_ic_i", "Parrot_shr_i_ic_i", @@ -2718,7 +2803,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 140 */ + { /* 145 */ "shr", "shr_i_i_ic", "Parrot_shr_i_i_ic", @@ -2729,7 +2814,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 141 */ + { /* 146 */ "lsr", "lsr_i_i", "Parrot_lsr_i_i", @@ -2740,7 +2825,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 142 */ + { /* 147 */ "lsr", "lsr_i_ic", "Parrot_lsr_i_ic", @@ -2751,7 +2836,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 143 */ + { /* 148 */ "lsr", "lsr_i_i_i", "Parrot_lsr_i_i_i", @@ -2762,7 +2847,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 144 */ + { /* 149 */ "lsr", "lsr_i_ic_i", "Parrot_lsr_i_ic_i", @@ -2773,7 +2858,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 145 */ + { /* 150 */ "lsr", "lsr_i_i_ic", "Parrot_lsr_i_i_ic", @@ -2784,7 +2869,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 146 */ + { /* 151 */ "bxor", "bxor_i_i", "Parrot_bxor_i_i", @@ -2795,7 +2880,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 147 */ + { /* 152 */ "bxor", "bxor_i_ic", "Parrot_bxor_i_ic", @@ -2806,7 +2891,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 148 */ + { /* 153 */ "bxor", "bxor_i_i_i", "Parrot_bxor_i_i_i", @@ -2817,7 +2902,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 149 */ + { /* 154 */ "bxor", "bxor_i_ic_i", "Parrot_bxor_i_ic_i", @@ -2828,7 +2913,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 150 */ + { /* 155 */ "bxor", "bxor_i_i_ic", "Parrot_bxor_i_i_ic", @@ -2839,7 +2924,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 151 */ + { /* 156 */ "eq", "eq_i_i_ic", "Parrot_eq_i_i_ic", @@ -2850,7 +2935,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 1 }, &core_op_lib }, - { /* 152 */ + { /* 157 */ "eq", "eq_ic_i_ic", "Parrot_eq_ic_i_ic", @@ -2861,7 +2946,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 1 }, &core_op_lib }, - { /* 153 */ + { /* 158 */ "eq", "eq_i_ic_ic", "Parrot_eq_i_ic_ic", @@ -2872,7 +2957,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 1 }, &core_op_lib }, - { /* 154 */ + { /* 159 */ "eq", "eq_n_n_ic", "Parrot_eq_n_n_ic", @@ -2883,7 +2968,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 1 }, &core_op_lib }, - { /* 155 */ + { /* 160 */ "eq", "eq_nc_n_ic", "Parrot_eq_nc_n_ic", @@ -2894,7 +2979,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 1 }, &core_op_lib }, - { /* 156 */ + { /* 161 */ "eq", "eq_n_nc_ic", "Parrot_eq_n_nc_ic", @@ -2905,7 +2990,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 1 }, &core_op_lib }, - { /* 157 */ + { /* 162 */ "eq", "eq_s_s_ic", "Parrot_eq_s_s_ic", @@ -2916,7 +3001,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 1 }, &core_op_lib }, - { /* 158 */ + { /* 163 */ "eq", "eq_sc_s_ic", "Parrot_eq_sc_s_ic", @@ -2927,7 +3012,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 1 }, &core_op_lib }, - { /* 159 */ + { /* 164 */ "eq", "eq_s_sc_ic", "Parrot_eq_s_sc_ic", @@ -2938,7 +3023,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 1 }, &core_op_lib }, - { /* 160 */ + { /* 165 */ "eq", "eq_p_p_ic", "Parrot_eq_p_p_ic", @@ -2949,7 +3034,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 1 }, &core_op_lib }, - { /* 161 */ + { /* 166 */ "eq", "eq_p_i_ic", "Parrot_eq_p_i_ic", @@ -2960,7 +3045,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 1 }, &core_op_lib }, - { /* 162 */ + { /* 167 */ "eq", "eq_p_ic_ic", "Parrot_eq_p_ic_ic", @@ -2971,7 +3056,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 1 }, &core_op_lib }, - { /* 163 */ + { /* 168 */ "eq", "eq_p_n_ic", "Parrot_eq_p_n_ic", @@ -2982,7 +3067,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 1 }, &core_op_lib }, - { /* 164 */ + { /* 169 */ "eq", "eq_p_nc_ic", "Parrot_eq_p_nc_ic", @@ -2993,7 +3078,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 1 }, &core_op_lib }, - { /* 165 */ + { /* 170 */ "eq", "eq_p_s_ic", "Parrot_eq_p_s_ic", @@ -3004,7 +3089,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 1 }, &core_op_lib }, - { /* 166 */ + { /* 171 */ "eq", "eq_p_sc_ic", "Parrot_eq_p_sc_ic", @@ -3015,7 +3100,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 1 }, &core_op_lib }, - { /* 167 */ + { /* 172 */ "eq_str", "eq_str_p_p_ic", "Parrot_eq_str_p_p_ic", @@ -3026,7 +3111,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 1 }, &core_op_lib }, - { /* 168 */ + { /* 173 */ "eq_num", "eq_num_p_p_ic", "Parrot_eq_num_p_p_ic", @@ -3037,7 +3122,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 1 }, &core_op_lib }, - { /* 169 */ + { /* 174 */ "eq_addr", "eq_addr_s_s_ic", "Parrot_eq_addr_s_s_ic", @@ -3048,7 +3133,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 1 }, &core_op_lib }, - { /* 170 */ + { /* 175 */ "eq_addr", "eq_addr_sc_s_ic", "Parrot_eq_addr_sc_s_ic", @@ -3059,7 +3144,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 1 }, &core_op_lib }, - { /* 171 */ + { /* 176 */ "eq_addr", "eq_addr_s_sc_ic", "Parrot_eq_addr_s_sc_ic", @@ -3070,7 +3155,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 1 }, &core_op_lib }, - { /* 172 */ + { /* 177 */ "eq_addr", "eq_addr_sc_sc_ic", "Parrot_eq_addr_sc_sc_ic", @@ -3081,7 +3166,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 1 }, &core_op_lib }, - { /* 173 */ + { /* 178 */ "eq_addr", "eq_addr_p_p_ic", "Parrot_eq_addr_p_p_ic", @@ -3092,7 +3177,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 1 }, &core_op_lib }, - { /* 174 */ + { /* 179 */ "ne", "ne_i_i_ic", "Parrot_ne_i_i_ic", @@ -3103,7 +3188,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 1 }, &core_op_lib }, - { /* 175 */ + { /* 180 */ "ne", "ne_ic_i_ic", "Parrot_ne_ic_i_ic", @@ -3114,7 +3199,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 1 }, &core_op_lib }, - { /* 176 */ + { /* 181 */ "ne", "ne_i_ic_ic", "Parrot_ne_i_ic_ic", @@ -3125,7 +3210,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 1 }, &core_op_lib }, - { /* 177 */ + { /* 182 */ "ne", "ne_n_n_ic", "Parrot_ne_n_n_ic", @@ -3136,7 +3221,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 1 }, &core_op_lib }, - { /* 178 */ + { /* 183 */ "ne", "ne_nc_n_ic", "Parrot_ne_nc_n_ic", @@ -3147,7 +3232,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 1 }, &core_op_lib }, - { /* 179 */ + { /* 184 */ "ne", "ne_n_nc_ic", "Parrot_ne_n_nc_ic", @@ -3158,7 +3243,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 1 }, &core_op_lib }, - { /* 180 */ + { /* 185 */ "ne", "ne_s_s_ic", "Parrot_ne_s_s_ic", @@ -3169,7 +3254,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 1 }, &core_op_lib }, - { /* 181 */ + { /* 186 */ "ne", "ne_sc_s_ic", "Parrot_ne_sc_s_ic", @@ -3180,7 +3265,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 1 }, &core_op_lib }, - { /* 182 */ + { /* 187 */ "ne", "ne_s_sc_ic", "Parrot_ne_s_sc_ic", @@ -3191,7 +3276,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 1 }, &core_op_lib }, - { /* 183 */ + { /* 188 */ "ne", "ne_p_p_ic", "Parrot_ne_p_p_ic", @@ -3202,7 +3287,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 1 }, &core_op_lib }, - { /* 184 */ + { /* 189 */ "ne", "ne_p_i_ic", "Parrot_ne_p_i_ic", @@ -3213,7 +3298,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 1 }, &core_op_lib }, - { /* 185 */ + { /* 190 */ "ne", "ne_p_ic_ic", "Parrot_ne_p_ic_ic", @@ -3224,7 +3309,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 1 }, &core_op_lib }, - { /* 186 */ + { /* 191 */ "ne", "ne_p_n_ic", "Parrot_ne_p_n_ic", @@ -3235,7 +3320,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 1 }, &core_op_lib }, - { /* 187 */ + { /* 192 */ "ne", "ne_p_nc_ic", "Parrot_ne_p_nc_ic", @@ -3246,7 +3331,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 1 }, &core_op_lib }, - { /* 188 */ + { /* 193 */ "ne", "ne_p_s_ic", "Parrot_ne_p_s_ic", @@ -3257,7 +3342,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 1 }, &core_op_lib }, - { /* 189 */ + { /* 194 */ "ne", "ne_p_sc_ic", "Parrot_ne_p_sc_ic", @@ -3268,7 +3353,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 1 }, &core_op_lib }, - { /* 190 */ + { /* 195 */ "ne_str", "ne_str_p_p_ic", "Parrot_ne_str_p_p_ic", @@ -3279,7 +3364,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 1 }, &core_op_lib }, - { /* 191 */ + { /* 196 */ "ne_num", "ne_num_p_p_ic", "Parrot_ne_num_p_p_ic", @@ -3290,7 +3375,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 1 }, &core_op_lib }, - { /* 192 */ + { /* 197 */ "ne_addr", "ne_addr_s_s_ic", "Parrot_ne_addr_s_s_ic", @@ -3301,7 +3386,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 1 }, &core_op_lib }, - { /* 193 */ + { /* 198 */ "ne_addr", "ne_addr_sc_s_ic", "Parrot_ne_addr_sc_s_ic", @@ -3312,7 +3397,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 1 }, &core_op_lib }, - { /* 194 */ + { /* 199 */ "ne_addr", "ne_addr_s_sc_ic", "Parrot_ne_addr_s_sc_ic", @@ -3323,7 +3408,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 1 }, &core_op_lib }, - { /* 195 */ + { /* 200 */ "ne_addr", "ne_addr_sc_sc_ic", "Parrot_ne_addr_sc_sc_ic", @@ -3334,7 +3419,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 1 }, &core_op_lib }, - { /* 196 */ + { /* 201 */ "ne_addr", "ne_addr_p_p_ic", "Parrot_ne_addr_p_p_ic", @@ -3345,7 +3430,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 1 }, &core_op_lib }, - { /* 197 */ + { /* 202 */ "lt", "lt_i_i_ic", "Parrot_lt_i_i_ic", @@ -3356,7 +3441,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 1 }, &core_op_lib }, - { /* 198 */ + { /* 203 */ "lt", "lt_ic_i_ic", "Parrot_lt_ic_i_ic", @@ -3367,7 +3452,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 1 }, &core_op_lib }, - { /* 199 */ + { /* 204 */ "lt", "lt_i_ic_ic", "Parrot_lt_i_ic_ic", @@ -3378,7 +3463,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 1 }, &core_op_lib }, - { /* 200 */ + { /* 205 */ "lt", "lt_n_n_ic", "Parrot_lt_n_n_ic", @@ -3389,7 +3474,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 1 }, &core_op_lib }, - { /* 201 */ + { /* 206 */ "lt", "lt_nc_n_ic", "Parrot_lt_nc_n_ic", @@ -3400,7 +3485,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 1 }, &core_op_lib }, - { /* 202 */ + { /* 207 */ "lt", "lt_n_nc_ic", "Parrot_lt_n_nc_ic", @@ -3411,7 +3496,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 1 }, &core_op_lib }, - { /* 203 */ + { /* 208 */ "lt", "lt_s_s_ic", "Parrot_lt_s_s_ic", @@ -3422,7 +3507,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 1 }, &core_op_lib }, - { /* 204 */ + { /* 209 */ "lt", "lt_sc_s_ic", "Parrot_lt_sc_s_ic", @@ -3433,7 +3518,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 1 }, &core_op_lib }, - { /* 205 */ + { /* 210 */ "lt", "lt_s_sc_ic", "Parrot_lt_s_sc_ic", @@ -3444,7 +3529,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 1 }, &core_op_lib }, - { /* 206 */ + { /* 211 */ "lt", "lt_p_p_ic", "Parrot_lt_p_p_ic", @@ -3455,7 +3540,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 1 }, &core_op_lib }, - { /* 207 */ + { /* 212 */ "lt", "lt_p_i_ic", "Parrot_lt_p_i_ic", @@ -3466,7 +3551,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 1 }, &core_op_lib }, - { /* 208 */ + { /* 213 */ "lt", "lt_p_ic_ic", "Parrot_lt_p_ic_ic", @@ -3477,7 +3562,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 1 }, &core_op_lib }, - { /* 209 */ + { /* 214 */ "lt", "lt_p_n_ic", "Parrot_lt_p_n_ic", @@ -3488,7 +3573,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 1 }, &core_op_lib }, - { /* 210 */ + { /* 215 */ "lt", "lt_p_nc_ic", "Parrot_lt_p_nc_ic", @@ -3499,7 +3584,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 1 }, &core_op_lib }, - { /* 211 */ + { /* 216 */ "lt", "lt_p_s_ic", "Parrot_lt_p_s_ic", @@ -3510,7 +3595,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 1 }, &core_op_lib }, - { /* 212 */ + { /* 217 */ "lt", "lt_p_sc_ic", "Parrot_lt_p_sc_ic", @@ -3521,7 +3606,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 1 }, &core_op_lib }, - { /* 213 */ + { /* 218 */ "lt_str", "lt_str_p_p_ic", "Parrot_lt_str_p_p_ic", @@ -3532,7 +3617,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 1 }, &core_op_lib }, - { /* 214 */ + { /* 219 */ "lt_num", "lt_num_p_p_ic", "Parrot_lt_num_p_p_ic", @@ -3543,7 +3628,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 1 }, &core_op_lib }, - { /* 215 */ + { /* 220 */ "le", "le_i_i_ic", "Parrot_le_i_i_ic", @@ -3554,7 +3639,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 1 }, &core_op_lib }, - { /* 216 */ + { /* 221 */ "le", "le_ic_i_ic", "Parrot_le_ic_i_ic", @@ -3565,7 +3650,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 1 }, &core_op_lib }, - { /* 217 */ + { /* 222 */ "le", "le_i_ic_ic", "Parrot_le_i_ic_ic", @@ -3576,7 +3661,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 1 }, &core_op_lib }, - { /* 218 */ + { /* 223 */ "le", "le_n_n_ic", "Parrot_le_n_n_ic", @@ -3587,7 +3672,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 1 }, &core_op_lib }, - { /* 219 */ + { /* 224 */ "le", "le_nc_n_ic", "Parrot_le_nc_n_ic", @@ -3598,7 +3683,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 1 }, &core_op_lib }, - { /* 220 */ + { /* 225 */ "le", "le_n_nc_ic", "Parrot_le_n_nc_ic", @@ -3609,7 +3694,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 1 }, &core_op_lib }, - { /* 221 */ + { /* 226 */ "le", "le_s_s_ic", "Parrot_le_s_s_ic", @@ -3620,7 +3705,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 1 }, &core_op_lib }, - { /* 222 */ + { /* 227 */ "le", "le_sc_s_ic", "Parrot_le_sc_s_ic", @@ -3631,7 +3716,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 1 }, &core_op_lib }, - { /* 223 */ + { /* 228 */ "le", "le_s_sc_ic", "Parrot_le_s_sc_ic", @@ -3642,7 +3727,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 1 }, &core_op_lib }, - { /* 224 */ + { /* 229 */ "le", "le_p_p_ic", "Parrot_le_p_p_ic", @@ -3653,7 +3738,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 1 }, &core_op_lib }, - { /* 225 */ + { /* 230 */ "le", "le_p_i_ic", "Parrot_le_p_i_ic", @@ -3664,7 +3749,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 1 }, &core_op_lib }, - { /* 226 */ + { /* 231 */ "le", "le_p_ic_ic", "Parrot_le_p_ic_ic", @@ -3675,7 +3760,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 1 }, &core_op_lib }, - { /* 227 */ + { /* 232 */ "le", "le_p_n_ic", "Parrot_le_p_n_ic", @@ -3686,7 +3771,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 1 }, &core_op_lib }, - { /* 228 */ + { /* 233 */ "le", "le_p_nc_ic", "Parrot_le_p_nc_ic", @@ -3697,7 +3782,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 1 }, &core_op_lib }, - { /* 229 */ + { /* 234 */ "le", "le_p_s_ic", "Parrot_le_p_s_ic", @@ -3708,7 +3793,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 1 }, &core_op_lib }, - { /* 230 */ + { /* 235 */ "le", "le_p_sc_ic", "Parrot_le_p_sc_ic", @@ -3719,7 +3804,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 1 }, &core_op_lib }, - { /* 231 */ + { /* 236 */ "le_str", "le_str_p_p_ic", "Parrot_le_str_p_p_ic", @@ -3730,7 +3815,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 1 }, &core_op_lib }, - { /* 232 */ + { /* 237 */ "le_num", "le_num_p_p_ic", "Parrot_le_num_p_p_ic", @@ -3741,7 +3826,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 1 }, &core_op_lib }, - { /* 233 */ + { /* 238 */ "gt", "gt_p_p_ic", "Parrot_gt_p_p_ic", @@ -3752,7 +3837,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 1 }, &core_op_lib }, - { /* 234 */ + { /* 239 */ "gt", "gt_p_i_ic", "Parrot_gt_p_i_ic", @@ -3763,7 +3848,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 1 }, &core_op_lib }, - { /* 235 */ + { /* 240 */ "gt", "gt_p_ic_ic", "Parrot_gt_p_ic_ic", @@ -3774,7 +3859,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 1 }, &core_op_lib }, - { /* 236 */ + { /* 241 */ "gt", "gt_p_n_ic", "Parrot_gt_p_n_ic", @@ -3785,7 +3870,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 1 }, &core_op_lib }, - { /* 237 */ + { /* 242 */ "gt", "gt_p_nc_ic", "Parrot_gt_p_nc_ic", @@ -3796,7 +3881,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 1 }, &core_op_lib }, - { /* 238 */ + { /* 243 */ "gt", "gt_p_s_ic", "Parrot_gt_p_s_ic", @@ -3807,7 +3892,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 1 }, &core_op_lib }, - { /* 239 */ + { /* 244 */ "gt", "gt_p_sc_ic", "Parrot_gt_p_sc_ic", @@ -3818,7 +3903,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 1 }, &core_op_lib }, - { /* 240 */ + { /* 245 */ "gt_str", "gt_str_p_p_ic", "Parrot_gt_str_p_p_ic", @@ -3829,7 +3914,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 1 }, &core_op_lib }, - { /* 241 */ + { /* 246 */ "gt_num", "gt_num_p_p_ic", "Parrot_gt_num_p_p_ic", @@ -3840,7 +3925,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 1 }, &core_op_lib }, - { /* 242 */ + { /* 247 */ "ge", "ge_p_p_ic", "Parrot_ge_p_p_ic", @@ -3851,7 +3936,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 1 }, &core_op_lib }, - { /* 243 */ + { /* 248 */ "ge", "ge_p_i_ic", "Parrot_ge_p_i_ic", @@ -3862,7 +3947,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 1 }, &core_op_lib }, - { /* 244 */ + { /* 249 */ "ge", "ge_p_ic_ic", "Parrot_ge_p_ic_ic", @@ -3873,7 +3958,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 1 }, &core_op_lib }, - { /* 245 */ + { /* 250 */ "ge", "ge_p_n_ic", "Parrot_ge_p_n_ic", @@ -3884,7 +3969,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 1 }, &core_op_lib }, - { /* 246 */ + { /* 251 */ "ge", "ge_p_nc_ic", "Parrot_ge_p_nc_ic", @@ -3895,7 +3980,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 1 }, &core_op_lib }, - { /* 247 */ + { /* 252 */ "ge", "ge_p_s_ic", "Parrot_ge_p_s_ic", @@ -3906,7 +3991,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 1 }, &core_op_lib }, - { /* 248 */ + { /* 253 */ "ge", "ge_p_sc_ic", "Parrot_ge_p_sc_ic", @@ -3917,7 +4002,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 1 }, &core_op_lib }, - { /* 249 */ + { /* 254 */ "ge_str", "ge_str_p_p_ic", "Parrot_ge_str_p_p_ic", @@ -3928,7 +4013,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 1 }, &core_op_lib }, - { /* 250 */ + { /* 255 */ "ge_num", "ge_num_p_p_ic", "Parrot_ge_num_p_p_ic", @@ -3939,7 +4024,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 1 }, &core_op_lib }, - { /* 251 */ + { /* 256 */ "if_null", "if_null_p_ic", "Parrot_if_null_p_ic", @@ -3950,7 +4035,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 1 }, &core_op_lib }, - { /* 252 */ + { /* 257 */ "if_null", "if_null_s_ic", "Parrot_if_null_s_ic", @@ -3961,7 +4046,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 1 }, &core_op_lib }, - { /* 253 */ + { /* 258 */ "unless_null", "unless_null_p_ic", "Parrot_unless_null_p_ic", @@ -3972,7 +4057,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 1 }, &core_op_lib }, - { /* 254 */ + { /* 259 */ "unless_null", "unless_null_s_ic", "Parrot_unless_null_s_ic", @@ -3983,7 +4068,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 1 }, &core_op_lib }, - { /* 255 */ + { /* 260 */ "cmp", "cmp_i_i_i", "Parrot_cmp_i_i_i", @@ -3994,7 +4079,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 256 */ + { /* 261 */ "cmp", "cmp_i_ic_i", "Parrot_cmp_i_ic_i", @@ -4005,7 +4090,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 257 */ + { /* 262 */ "cmp", "cmp_i_i_ic", "Parrot_cmp_i_i_ic", @@ -4016,7 +4101,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 258 */ + { /* 263 */ "cmp", "cmp_i_n_n", "Parrot_cmp_i_n_n", @@ -4027,7 +4112,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 259 */ + { /* 264 */ "cmp", "cmp_i_nc_n", "Parrot_cmp_i_nc_n", @@ -4038,7 +4123,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 260 */ + { /* 265 */ "cmp", "cmp_i_n_nc", "Parrot_cmp_i_n_nc", @@ -4049,7 +4134,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 261 */ + { /* 266 */ "cmp", "cmp_i_s_s", "Parrot_cmp_i_s_s", @@ -4060,7 +4145,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 262 */ + { /* 267 */ "cmp", "cmp_i_sc_s", "Parrot_cmp_i_sc_s", @@ -4071,7 +4156,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 263 */ + { /* 268 */ "cmp", "cmp_i_s_sc", "Parrot_cmp_i_s_sc", @@ -4082,7 +4167,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 264 */ + { /* 269 */ "cmp", "cmp_i_p_p", "Parrot_cmp_i_p_p", @@ -4093,7 +4178,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 265 */ + { /* 270 */ "cmp", "cmp_i_p_i", "Parrot_cmp_i_p_i", @@ -4104,7 +4189,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 266 */ + { /* 271 */ "cmp", "cmp_i_p_ic", "Parrot_cmp_i_p_ic", @@ -4115,7 +4200,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 267 */ + { /* 272 */ "cmp", "cmp_i_p_n", "Parrot_cmp_i_p_n", @@ -4126,7 +4211,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 268 */ + { /* 273 */ "cmp", "cmp_i_p_nc", "Parrot_cmp_i_p_nc", @@ -4137,7 +4222,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 269 */ + { /* 274 */ "cmp", "cmp_i_p_s", "Parrot_cmp_i_p_s", @@ -4148,7 +4233,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 270 */ + { /* 275 */ "cmp", "cmp_i_p_sc", "Parrot_cmp_i_p_sc", @@ -4159,7 +4244,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 271 */ + { /* 276 */ "cmp_str", "cmp_str_i_p_p", "Parrot_cmp_str_i_p_p", @@ -4170,7 +4255,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 272 */ + { /* 277 */ "cmp_num", "cmp_num_i_p_p", "Parrot_cmp_num_i_p_p", @@ -4181,7 +4266,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 273 */ + { /* 278 */ "cmp_pmc", "cmp_pmc_p_p_p", "Parrot_cmp_pmc_p_p_p", @@ -4192,7 +4277,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 274 */ + { /* 279 */ "issame", "issame_i_p_p", "Parrot_issame_i_p_p", @@ -4203,7 +4288,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 275 */ + { /* 280 */ "issame", "issame_i_s_s", "Parrot_issame_i_s_s", @@ -4214,7 +4299,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 276 */ + { /* 281 */ "issame", "issame_i_sc_s", "Parrot_issame_i_sc_s", @@ -4225,7 +4310,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 277 */ + { /* 282 */ "issame", "issame_i_s_sc", "Parrot_issame_i_s_sc", @@ -4236,7 +4321,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 278 */ + { /* 283 */ "issame", "issame_i_sc_sc", "Parrot_issame_i_sc_sc", @@ -4247,7 +4332,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 279 */ + { /* 284 */ "isntsame", "isntsame_i_p_p", "Parrot_isntsame_i_p_p", @@ -4258,7 +4343,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 280 */ + { /* 285 */ "isntsame", "isntsame_i_s_s", "Parrot_isntsame_i_s_s", @@ -4269,7 +4354,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 281 */ + { /* 286 */ "isntsame", "isntsame_i_sc_s", "Parrot_isntsame_i_sc_s", @@ -4280,7 +4365,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 282 */ + { /* 287 */ "isntsame", "isntsame_i_s_sc", "Parrot_isntsame_i_s_sc", @@ -4291,7 +4376,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 283 */ + { /* 288 */ "isntsame", "isntsame_i_sc_sc", "Parrot_isntsame_i_sc_sc", @@ -4302,7 +4387,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 284 */ + { /* 289 */ "istrue", "istrue_i_p", "Parrot_istrue_i_p", @@ -4313,7 +4398,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 285 */ + { /* 290 */ "isfalse", "isfalse_i_p", "Parrot_isfalse_i_p", @@ -4324,7 +4409,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 286 */ + { /* 291 */ "isnull", "isnull_i_p", "Parrot_isnull_i_p", @@ -4335,7 +4420,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 287 */ + { /* 292 */ "isnull", "isnull_i_pc", "Parrot_isnull_i_pc", @@ -4346,7 +4431,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 288 */ + { /* 293 */ "isnull", "isnull_i_s", "Parrot_isnull_i_s", @@ -4357,7 +4442,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 289 */ + { /* 294 */ "isnull", "isnull_i_sc", "Parrot_isnull_i_sc", @@ -4368,7 +4453,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 290 */ + { /* 295 */ "isgt", "isgt_i_p_p", "Parrot_isgt_i_p_p", @@ -4379,7 +4464,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 291 */ + { /* 296 */ "isge", "isge_i_p_p", "Parrot_isge_i_p_p", @@ -4390,7 +4475,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 292 */ + { /* 297 */ "isle", "isle_i_i_i", "Parrot_isle_i_i_i", @@ -4401,7 +4486,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 293 */ + { /* 298 */ "isle", "isle_i_ic_i", "Parrot_isle_i_ic_i", @@ -4412,7 +4497,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 294 */ + { /* 299 */ "isle", "isle_i_i_ic", "Parrot_isle_i_i_ic", @@ -4423,7 +4508,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 295 */ + { /* 300 */ "isle", "isle_i_n_n", "Parrot_isle_i_n_n", @@ -4434,7 +4519,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 296 */ + { /* 301 */ "isle", "isle_i_nc_n", "Parrot_isle_i_nc_n", @@ -4445,7 +4530,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 297 */ + { /* 302 */ "isle", "isle_i_n_nc", "Parrot_isle_i_n_nc", @@ -4456,7 +4541,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 298 */ + { /* 303 */ "isle", "isle_i_s_s", "Parrot_isle_i_s_s", @@ -4467,7 +4552,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 299 */ + { /* 304 */ "isle", "isle_i_sc_s", "Parrot_isle_i_sc_s", @@ -4478,7 +4563,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 300 */ + { /* 305 */ "isle", "isle_i_s_sc", "Parrot_isle_i_s_sc", @@ -4489,7 +4574,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 301 */ + { /* 306 */ "isle", "isle_i_p_p", "Parrot_isle_i_p_p", @@ -4500,7 +4585,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 302 */ + { /* 307 */ "islt", "islt_i_i_i", "Parrot_islt_i_i_i", @@ -4511,7 +4596,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 303 */ + { /* 308 */ "islt", "islt_i_ic_i", "Parrot_islt_i_ic_i", @@ -4522,7 +4607,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 304 */ + { /* 309 */ "islt", "islt_i_i_ic", "Parrot_islt_i_i_ic", @@ -4533,7 +4618,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 305 */ + { /* 310 */ "islt", "islt_i_n_n", "Parrot_islt_i_n_n", @@ -4544,7 +4629,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 306 */ + { /* 311 */ "islt", "islt_i_nc_n", "Parrot_islt_i_nc_n", @@ -4555,7 +4640,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 307 */ + { /* 312 */ "islt", "islt_i_n_nc", "Parrot_islt_i_n_nc", @@ -4566,7 +4651,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 308 */ + { /* 313 */ "islt", "islt_i_s_s", "Parrot_islt_i_s_s", @@ -4577,7 +4662,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 309 */ + { /* 314 */ "islt", "islt_i_sc_s", "Parrot_islt_i_sc_s", @@ -4588,7 +4673,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 310 */ + { /* 315 */ "islt", "islt_i_s_sc", "Parrot_islt_i_s_sc", @@ -4599,7 +4684,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 311 */ + { /* 316 */ "islt", "islt_i_p_p", "Parrot_islt_i_p_p", @@ -4610,7 +4695,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 312 */ + { /* 317 */ "iseq", "iseq_i_i_i", "Parrot_iseq_i_i_i", @@ -4621,7 +4706,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 313 */ + { /* 318 */ "iseq", "iseq_i_ic_i", "Parrot_iseq_i_ic_i", @@ -4632,7 +4717,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 314 */ + { /* 319 */ "iseq", "iseq_i_i_ic", "Parrot_iseq_i_i_ic", @@ -4643,7 +4728,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 315 */ + { /* 320 */ "iseq", "iseq_i_n_n", "Parrot_iseq_i_n_n", @@ -4654,7 +4739,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 316 */ + { /* 321 */ "iseq", "iseq_i_nc_n", "Parrot_iseq_i_nc_n", @@ -4665,7 +4750,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 317 */ + { /* 322 */ "iseq", "iseq_i_n_nc", "Parrot_iseq_i_n_nc", @@ -4676,7 +4761,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 318 */ + { /* 323 */ "iseq", "iseq_i_s_s", "Parrot_iseq_i_s_s", @@ -4687,7 +4772,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 319 */ + { /* 324 */ "iseq", "iseq_i_sc_s", "Parrot_iseq_i_sc_s", @@ -4698,7 +4783,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 320 */ + { /* 325 */ "iseq", "iseq_i_s_sc", "Parrot_iseq_i_s_sc", @@ -4709,7 +4794,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 321 */ + { /* 326 */ "iseq", "iseq_i_p_p", "Parrot_iseq_i_p_p", @@ -4720,7 +4805,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 322 */ + { /* 327 */ "isne", "isne_i_i_i", "Parrot_isne_i_i_i", @@ -4731,7 +4816,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 323 */ + { /* 328 */ "isne", "isne_i_ic_i", "Parrot_isne_i_ic_i", @@ -4742,7 +4827,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 324 */ + { /* 329 */ "isne", "isne_i_i_ic", "Parrot_isne_i_i_ic", @@ -4753,7 +4838,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 325 */ + { /* 330 */ "isne", "isne_i_n_n", "Parrot_isne_i_n_n", @@ -4764,7 +4849,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 326 */ + { /* 331 */ "isne", "isne_i_nc_n", "Parrot_isne_i_nc_n", @@ -4775,7 +4860,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 327 */ + { /* 332 */ "isne", "isne_i_n_nc", "Parrot_isne_i_n_nc", @@ -4786,7 +4871,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 328 */ + { /* 333 */ "isne", "isne_i_s_s", "Parrot_isne_i_s_s", @@ -4797,7 +4882,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 329 */ + { /* 334 */ "isne", "isne_i_sc_s", "Parrot_isne_i_sc_s", @@ -4808,7 +4893,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 330 */ + { /* 335 */ "isne", "isne_i_s_sc", "Parrot_isne_i_s_sc", @@ -4819,7 +4904,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 331 */ + { /* 336 */ "isne", "isne_i_p_p", "Parrot_isne_i_p_p", @@ -4830,7 +4915,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 332 */ + { /* 337 */ "and", "and_i_i_i", "Parrot_and_i_i_i", @@ -4841,7 +4926,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 333 */ + { /* 338 */ "and", "and_i_ic_i", "Parrot_and_i_ic_i", @@ -4852,7 +4937,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 334 */ + { /* 339 */ "and", "and_i_i_ic", "Parrot_and_i_i_ic", @@ -4863,7 +4948,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 335 */ + { /* 340 */ "and", "and_p_p_p", "Parrot_and_p_p_p", @@ -4874,7 +4959,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 336 */ + { /* 341 */ "not", "not_i", "Parrot_not_i", @@ -4885,7 +4970,7 @@ static op_info_t core_op_info_table[1092] = { { 0 }, &core_op_lib }, - { /* 337 */ + { /* 342 */ "not", "not_i_i", "Parrot_not_i_i", @@ -4896,7 +4981,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 338 */ + { /* 343 */ "not", "not_p", "Parrot_not_p", @@ -4907,7 +4992,7 @@ static op_info_t core_op_info_table[1092] = { { 0 }, &core_op_lib }, - { /* 339 */ + { /* 344 */ "not", "not_p_p", "Parrot_not_p_p", @@ -4918,7 +5003,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 340 */ + { /* 345 */ "or", "or_i_i_i", "Parrot_or_i_i_i", @@ -4929,7 +5014,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 341 */ + { /* 346 */ "or", "or_i_ic_i", "Parrot_or_i_ic_i", @@ -4940,7 +5025,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 342 */ + { /* 347 */ "or", "or_i_i_ic", "Parrot_or_i_i_ic", @@ -4951,7 +5036,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 343 */ + { /* 348 */ "or", "or_p_p_p", "Parrot_or_p_p_p", @@ -4962,7 +5047,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 344 */ + { /* 349 */ "xor", "xor_i_i_i", "Parrot_xor_i_i_i", @@ -4973,7 +5058,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 345 */ + { /* 350 */ "xor", "xor_i_ic_i", "Parrot_xor_i_ic_i", @@ -4984,7 +5069,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 346 */ + { /* 351 */ "xor", "xor_i_i_ic", "Parrot_xor_i_i_ic", @@ -4995,7 +5080,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 347 */ + { /* 352 */ "xor", "xor_p_p_p", "Parrot_xor_p_p_p", @@ -5006,7 +5091,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 348 */ + { /* 353 */ "print", "print_i", "Parrot_print_i", @@ -5017,7 +5102,7 @@ static op_info_t core_op_info_table[1092] = { { 0 }, &core_op_lib }, - { /* 349 */ + { /* 354 */ "print", "print_ic", "Parrot_print_ic", @@ -5028,7 +5113,7 @@ static op_info_t core_op_info_table[1092] = { { 0 }, &core_op_lib }, - { /* 350 */ + { /* 355 */ "print", "print_n", "Parrot_print_n", @@ -5039,7 +5124,7 @@ static op_info_t core_op_info_table[1092] = { { 0 }, &core_op_lib }, - { /* 351 */ + { /* 356 */ "print", "print_nc", "Parrot_print_nc", @@ -5050,7 +5135,7 @@ static op_info_t core_op_info_table[1092] = { { 0 }, &core_op_lib }, - { /* 352 */ + { /* 357 */ "print", "print_s", "Parrot_print_s", @@ -5061,7 +5146,7 @@ static op_info_t core_op_info_table[1092] = { { 0 }, &core_op_lib }, - { /* 353 */ + { /* 358 */ "print", "print_sc", "Parrot_print_sc", @@ -5072,7 +5157,7 @@ static op_info_t core_op_info_table[1092] = { { 0 }, &core_op_lib }, - { /* 354 */ + { /* 359 */ "print", "print_p", "Parrot_print_p", @@ -5083,7 +5168,7 @@ static op_info_t core_op_info_table[1092] = { { 0 }, &core_op_lib }, - { /* 355 */ + { /* 360 */ "say", "say_i", "Parrot_say_i", @@ -5094,7 +5179,7 @@ static op_info_t core_op_info_table[1092] = { { 0 }, &core_op_lib }, - { /* 356 */ + { /* 361 */ "say", "say_ic", "Parrot_say_ic", @@ -5105,7 +5190,7 @@ static op_info_t core_op_info_table[1092] = { { 0 }, &core_op_lib }, - { /* 357 */ + { /* 362 */ "say", "say_n", "Parrot_say_n", @@ -5116,7 +5201,7 @@ static op_info_t core_op_info_table[1092] = { { 0 }, &core_op_lib }, - { /* 358 */ + { /* 363 */ "say", "say_nc", "Parrot_say_nc", @@ -5127,7 +5212,7 @@ static op_info_t core_op_info_table[1092] = { { 0 }, &core_op_lib }, - { /* 359 */ + { /* 364 */ "say", "say_s", "Parrot_say_s", @@ -5138,7 +5223,7 @@ static op_info_t core_op_info_table[1092] = { { 0 }, &core_op_lib }, - { /* 360 */ + { /* 365 */ "say", "say_sc", "Parrot_say_sc", @@ -5149,7 +5234,7 @@ static op_info_t core_op_info_table[1092] = { { 0 }, &core_op_lib }, - { /* 361 */ + { /* 366 */ "say", "say_p", "Parrot_say_p", @@ -5160,7 +5245,7 @@ static op_info_t core_op_info_table[1092] = { { 0 }, &core_op_lib }, - { /* 362 */ + { /* 367 */ "print", "print_p_i", "Parrot_print_p_i", @@ -5171,7 +5256,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 363 */ + { /* 368 */ "print", "print_p_ic", "Parrot_print_p_ic", @@ -5182,7 +5267,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 364 */ + { /* 369 */ "print", "print_p_n", "Parrot_print_p_n", @@ -5193,7 +5278,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 365 */ + { /* 370 */ "print", "print_p_nc", "Parrot_print_p_nc", @@ -5204,7 +5289,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 366 */ + { /* 371 */ "print", "print_p_s", "Parrot_print_p_s", @@ -5215,7 +5300,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 367 */ + { /* 372 */ "print", "print_p_sc", "Parrot_print_p_sc", @@ -5226,7 +5311,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 368 */ + { /* 373 */ "print", "print_p_p", "Parrot_print_p_p", @@ -5237,7 +5322,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 369 */ + { /* 374 */ "getstdin", "getstdin_p", "Parrot_getstdin_p", @@ -5248,7 +5333,7 @@ static op_info_t core_op_info_table[1092] = { { 0 }, &core_op_lib }, - { /* 370 */ + { /* 375 */ "getstdout", "getstdout_p", "Parrot_getstdout_p", @@ -5259,7 +5344,7 @@ static op_info_t core_op_info_table[1092] = { { 0 }, &core_op_lib }, - { /* 371 */ + { /* 376 */ "getstderr", "getstderr_p", "Parrot_getstderr_p", @@ -5270,7 +5355,7 @@ static op_info_t core_op_info_table[1092] = { { 0 }, &core_op_lib }, - { /* 372 */ + { /* 377 */ "abs", "abs_i", "Parrot_abs_i", @@ -5281,7 +5366,7 @@ static op_info_t core_op_info_table[1092] = { { 0 }, &core_op_lib }, - { /* 373 */ + { /* 378 */ "abs", "abs_n", "Parrot_abs_n", @@ -5292,7 +5377,7 @@ static op_info_t core_op_info_table[1092] = { { 0 }, &core_op_lib }, - { /* 374 */ + { /* 379 */ "abs", "abs_i_i", "Parrot_abs_i_i", @@ -5303,7 +5388,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 375 */ + { /* 380 */ "abs", "abs_n_n", "Parrot_abs_n_n", @@ -5314,7 +5399,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 376 */ + { /* 381 */ "abs", "abs_p", "Parrot_abs_p", @@ -5325,7 +5410,7 @@ static op_info_t core_op_info_table[1092] = { { 0 }, &core_op_lib }, - { /* 377 */ + { /* 382 */ "abs", "abs_p_p", "Parrot_abs_p_p", @@ -5336,7 +5421,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 378 */ + { /* 383 */ "add", "add_i_i", "Parrot_add_i_i", @@ -5347,7 +5432,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 379 */ + { /* 384 */ "add", "add_i_ic", "Parrot_add_i_ic", @@ -5358,7 +5443,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 380 */ + { /* 385 */ "add", "add_n_n", "Parrot_add_n_n", @@ -5369,7 +5454,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 381 */ + { /* 386 */ "add", "add_n_nc", "Parrot_add_n_nc", @@ -5380,7 +5465,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 382 */ + { /* 387 */ "add", "add_p_p", "Parrot_add_p_p", @@ -5391,7 +5476,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 383 */ + { /* 388 */ "add", "add_p_i", "Parrot_add_p_i", @@ -5402,7 +5487,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 384 */ + { /* 389 */ "add", "add_p_ic", "Parrot_add_p_ic", @@ -5413,7 +5498,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 385 */ + { /* 390 */ "add", "add_p_n", "Parrot_add_p_n", @@ -5424,7 +5509,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 386 */ + { /* 391 */ "add", "add_p_nc", "Parrot_add_p_nc", @@ -5435,7 +5520,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 387 */ + { /* 392 */ "add", "add_i_i_i", "Parrot_add_i_i_i", @@ -5446,7 +5531,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 388 */ + { /* 393 */ "add", "add_i_ic_i", "Parrot_add_i_ic_i", @@ -5457,7 +5542,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 389 */ + { /* 394 */ "add", "add_i_i_ic", "Parrot_add_i_i_ic", @@ -5468,7 +5553,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 390 */ + { /* 395 */ "add", "add_n_n_n", "Parrot_add_n_n_n", @@ -5479,7 +5564,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 391 */ + { /* 396 */ "add", "add_n_nc_n", "Parrot_add_n_nc_n", @@ -5490,7 +5575,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 392 */ + { /* 397 */ "add", "add_n_n_nc", "Parrot_add_n_n_nc", @@ -5501,7 +5586,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 393 */ + { /* 398 */ "add", "add_p_p_p", "Parrot_add_p_p_p", @@ -5512,7 +5597,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 394 */ + { /* 399 */ "add", "add_p_p_i", "Parrot_add_p_p_i", @@ -5523,7 +5608,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 395 */ + { /* 400 */ "add", "add_p_p_ic", "Parrot_add_p_p_ic", @@ -5534,7 +5619,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 396 */ + { /* 401 */ "add", "add_p_p_n", "Parrot_add_p_p_n", @@ -5545,7 +5630,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 397 */ + { /* 402 */ "add", "add_p_p_nc", "Parrot_add_p_p_nc", @@ -5556,7 +5641,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 398 */ + { /* 403 */ "dec", "dec_i", "Parrot_dec_i", @@ -5567,7 +5652,7 @@ static op_info_t core_op_info_table[1092] = { { 0 }, &core_op_lib }, - { /* 399 */ + { /* 404 */ "dec", "dec_n", "Parrot_dec_n", @@ -5578,7 +5663,7 @@ static op_info_t core_op_info_table[1092] = { { 0 }, &core_op_lib }, - { /* 400 */ + { /* 405 */ "dec", "dec_p", "Parrot_dec_p", @@ -5589,7 +5674,7 @@ static op_info_t core_op_info_table[1092] = { { 0 }, &core_op_lib }, - { /* 401 */ + { /* 406 */ "div", "div_i_i", "Parrot_div_i_i", @@ -5600,7 +5685,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 402 */ + { /* 407 */ "div", "div_i_ic", "Parrot_div_i_ic", @@ -5611,7 +5696,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 403 */ + { /* 408 */ "div", "div_n_n", "Parrot_div_n_n", @@ -5622,7 +5707,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 404 */ + { /* 409 */ "div", "div_n_nc", "Parrot_div_n_nc", @@ -5633,7 +5718,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 405 */ + { /* 410 */ "div", "div_p_p", "Parrot_div_p_p", @@ -5644,7 +5729,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 406 */ + { /* 411 */ "div", "div_p_i", "Parrot_div_p_i", @@ -5655,7 +5740,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 407 */ + { /* 412 */ "div", "div_p_ic", "Parrot_div_p_ic", @@ -5666,7 +5751,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 408 */ + { /* 413 */ "div", "div_p_n", "Parrot_div_p_n", @@ -5677,7 +5762,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 409 */ + { /* 414 */ "div", "div_p_nc", "Parrot_div_p_nc", @@ -5688,7 +5773,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 410 */ + { /* 415 */ "div", "div_i_i_i", "Parrot_div_i_i_i", @@ -5699,7 +5784,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 411 */ + { /* 416 */ "div", "div_i_ic_i", "Parrot_div_i_ic_i", @@ -5710,7 +5795,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 412 */ + { /* 417 */ "div", "div_i_i_ic", "Parrot_div_i_i_ic", @@ -5721,7 +5806,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 413 */ + { /* 418 */ "div", "div_i_ic_ic", "Parrot_div_i_ic_ic", @@ -5732,7 +5817,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 414 */ + { /* 419 */ "div", "div_n_n_n", "Parrot_div_n_n_n", @@ -5743,7 +5828,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 415 */ + { /* 420 */ "div", "div_n_nc_n", "Parrot_div_n_nc_n", @@ -5754,7 +5839,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 416 */ + { /* 421 */ "div", "div_n_n_nc", "Parrot_div_n_n_nc", @@ -5765,7 +5850,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 417 */ + { /* 422 */ "div", "div_n_nc_nc", "Parrot_div_n_nc_nc", @@ -5776,7 +5861,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 418 */ + { /* 423 */ "div", "div_p_p_p", "Parrot_div_p_p_p", @@ -5787,7 +5872,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 419 */ + { /* 424 */ "div", "div_p_p_i", "Parrot_div_p_p_i", @@ -5798,7 +5883,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 420 */ + { /* 425 */ "div", "div_p_p_ic", "Parrot_div_p_p_ic", @@ -5809,7 +5894,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 421 */ + { /* 426 */ "div", "div_p_p_n", "Parrot_div_p_p_n", @@ -5820,7 +5905,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 422 */ + { /* 427 */ "div", "div_p_p_nc", "Parrot_div_p_p_nc", @@ -5831,7 +5916,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 423 */ + { /* 428 */ "fdiv", "fdiv_i_i", "Parrot_fdiv_i_i", @@ -5842,7 +5927,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 424 */ + { /* 429 */ "fdiv", "fdiv_i_ic", "Parrot_fdiv_i_ic", @@ -5853,7 +5938,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 425 */ + { /* 430 */ "fdiv", "fdiv_n_n", "Parrot_fdiv_n_n", @@ -5864,7 +5949,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 426 */ + { /* 431 */ "fdiv", "fdiv_n_nc", "Parrot_fdiv_n_nc", @@ -5875,7 +5960,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 427 */ + { /* 432 */ "fdiv", "fdiv_p_p", "Parrot_fdiv_p_p", @@ -5886,7 +5971,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 428 */ + { /* 433 */ "fdiv", "fdiv_p_i", "Parrot_fdiv_p_i", @@ -5897,7 +5982,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 429 */ + { /* 434 */ "fdiv", "fdiv_p_ic", "Parrot_fdiv_p_ic", @@ -5908,7 +5993,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 430 */ + { /* 435 */ "fdiv", "fdiv_p_n", "Parrot_fdiv_p_n", @@ -5919,7 +6004,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 431 */ + { /* 436 */ "fdiv", "fdiv_p_nc", "Parrot_fdiv_p_nc", @@ -5930,7 +6015,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 432 */ + { /* 437 */ "fdiv", "fdiv_i_i_i", "Parrot_fdiv_i_i_i", @@ -5941,7 +6026,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 433 */ + { /* 438 */ "fdiv", "fdiv_i_ic_i", "Parrot_fdiv_i_ic_i", @@ -5952,7 +6037,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 434 */ + { /* 439 */ "fdiv", "fdiv_i_i_ic", "Parrot_fdiv_i_i_ic", @@ -5963,7 +6048,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 435 */ + { /* 440 */ "fdiv", "fdiv_n_n_n", "Parrot_fdiv_n_n_n", @@ -5974,7 +6059,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 436 */ + { /* 441 */ "fdiv", "fdiv_n_nc_n", "Parrot_fdiv_n_nc_n", @@ -5985,7 +6070,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 437 */ + { /* 442 */ "fdiv", "fdiv_n_n_nc", "Parrot_fdiv_n_n_nc", @@ -5996,7 +6081,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 438 */ + { /* 443 */ "fdiv", "fdiv_p_p_p", "Parrot_fdiv_p_p_p", @@ -6007,7 +6092,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 439 */ + { /* 444 */ "fdiv", "fdiv_p_p_i", "Parrot_fdiv_p_p_i", @@ -6018,7 +6103,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 440 */ + { /* 445 */ "fdiv", "fdiv_p_p_ic", "Parrot_fdiv_p_p_ic", @@ -6029,7 +6114,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 441 */ + { /* 446 */ "fdiv", "fdiv_p_p_n", "Parrot_fdiv_p_p_n", @@ -6040,7 +6125,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 442 */ + { /* 447 */ "fdiv", "fdiv_p_p_nc", "Parrot_fdiv_p_p_nc", @@ -6051,7 +6136,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 443 */ + { /* 448 */ "ceil", "ceil_n", "Parrot_ceil_n", @@ -6062,7 +6147,7 @@ static op_info_t core_op_info_table[1092] = { { 0 }, &core_op_lib }, - { /* 444 */ + { /* 449 */ "ceil", "ceil_i_n", "Parrot_ceil_i_n", @@ -6073,7 +6158,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 445 */ + { /* 450 */ "ceil", "ceil_n_n", "Parrot_ceil_n_n", @@ -6084,7 +6169,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 446 */ + { /* 451 */ "floor", "floor_n", "Parrot_floor_n", @@ -6095,7 +6180,7 @@ static op_info_t core_op_info_table[1092] = { { 0 }, &core_op_lib }, - { /* 447 */ + { /* 452 */ "floor", "floor_i_n", "Parrot_floor_i_n", @@ -6106,7 +6191,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 448 */ + { /* 453 */ "floor", "floor_n_n", "Parrot_floor_n_n", @@ -6117,7 +6202,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 449 */ + { /* 454 */ "inc", "inc_i", "Parrot_inc_i", @@ -6128,7 +6213,7 @@ static op_info_t core_op_info_table[1092] = { { 0 }, &core_op_lib }, - { /* 450 */ + { /* 455 */ "inc", "inc_n", "Parrot_inc_n", @@ -6139,7 +6224,7 @@ static op_info_t core_op_info_table[1092] = { { 0 }, &core_op_lib }, - { /* 451 */ + { /* 456 */ "inc", "inc_p", "Parrot_inc_p", @@ -6150,7 +6235,7 @@ static op_info_t core_op_info_table[1092] = { { 0 }, &core_op_lib }, - { /* 452 */ + { /* 457 */ "mod", "mod_i_i", "Parrot_mod_i_i", @@ -6161,7 +6246,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 453 */ + { /* 458 */ "mod", "mod_i_ic", "Parrot_mod_i_ic", @@ -6172,7 +6257,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 454 */ + { /* 459 */ "mod", "mod_n_n", "Parrot_mod_n_n", @@ -6183,7 +6268,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 455 */ + { /* 460 */ "mod", "mod_n_nc", "Parrot_mod_n_nc", @@ -6194,7 +6279,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 456 */ + { /* 461 */ "mod", "mod_p_p", "Parrot_mod_p_p", @@ -6205,7 +6290,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 457 */ + { /* 462 */ "mod", "mod_p_i", "Parrot_mod_p_i", @@ -6216,7 +6301,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 458 */ + { /* 463 */ "mod", "mod_p_ic", "Parrot_mod_p_ic", @@ -6227,7 +6312,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 459 */ + { /* 464 */ "mod", "mod_p_n", "Parrot_mod_p_n", @@ -6238,7 +6323,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 460 */ + { /* 465 */ "mod", "mod_p_nc", "Parrot_mod_p_nc", @@ -6249,7 +6334,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 461 */ + { /* 466 */ "mod", "mod_i_i_i", "Parrot_mod_i_i_i", @@ -6260,7 +6345,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 462 */ + { /* 467 */ "mod", "mod_i_ic_i", "Parrot_mod_i_ic_i", @@ -6271,7 +6356,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 463 */ + { /* 468 */ "mod", "mod_i_i_ic", "Parrot_mod_i_i_ic", @@ -6282,7 +6367,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 464 */ + { /* 469 */ "mod", "mod_n_n_n", "Parrot_mod_n_n_n", @@ -6293,7 +6378,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 465 */ + { /* 470 */ "mod", "mod_n_nc_n", "Parrot_mod_n_nc_n", @@ -6304,7 +6389,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 466 */ + { /* 471 */ "mod", "mod_n_n_nc", "Parrot_mod_n_n_nc", @@ -6315,7 +6400,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 467 */ + { /* 472 */ "mod", "mod_p_p_p", "Parrot_mod_p_p_p", @@ -6326,7 +6411,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 468 */ + { /* 473 */ "mod", "mod_p_p_i", "Parrot_mod_p_p_i", @@ -6337,7 +6422,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 469 */ + { /* 474 */ "mod", "mod_p_p_ic", "Parrot_mod_p_p_ic", @@ -6348,7 +6433,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 470 */ + { /* 475 */ "mod", "mod_p_p_n", "Parrot_mod_p_p_n", @@ -6359,7 +6444,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 471 */ + { /* 476 */ "mod", "mod_p_p_nc", "Parrot_mod_p_p_nc", @@ -6370,7 +6455,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 472 */ + { /* 477 */ "mul", "mul_i_i", "Parrot_mul_i_i", @@ -6381,7 +6466,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 473 */ + { /* 478 */ "mul", "mul_i_ic", "Parrot_mul_i_ic", @@ -6392,7 +6477,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 474 */ + { /* 479 */ "mul", "mul_n_n", "Parrot_mul_n_n", @@ -6403,7 +6488,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 475 */ + { /* 480 */ "mul", "mul_n_nc", "Parrot_mul_n_nc", @@ -6414,7 +6499,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 476 */ + { /* 481 */ "mul", "mul_p_p", "Parrot_mul_p_p", @@ -6425,7 +6510,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 477 */ + { /* 482 */ "mul", "mul_p_i", "Parrot_mul_p_i", @@ -6436,7 +6521,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 478 */ + { /* 483 */ "mul", "mul_p_ic", "Parrot_mul_p_ic", @@ -6447,7 +6532,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 479 */ + { /* 484 */ "mul", "mul_p_n", "Parrot_mul_p_n", @@ -6458,7 +6543,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 480 */ + { /* 485 */ "mul", "mul_p_nc", "Parrot_mul_p_nc", @@ -6469,7 +6554,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 481 */ + { /* 486 */ "mul", "mul_i_i_i", "Parrot_mul_i_i_i", @@ -6480,7 +6565,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 482 */ + { /* 487 */ "mul", "mul_i_ic_i", "Parrot_mul_i_ic_i", @@ -6491,7 +6576,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 483 */ + { /* 488 */ "mul", "mul_i_i_ic", "Parrot_mul_i_i_ic", @@ -6502,7 +6587,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 484 */ + { /* 489 */ "mul", "mul_n_n_n", "Parrot_mul_n_n_n", @@ -6513,7 +6598,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 485 */ + { /* 490 */ "mul", "mul_n_nc_n", "Parrot_mul_n_nc_n", @@ -6524,7 +6609,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 486 */ + { /* 491 */ "mul", "mul_n_n_nc", "Parrot_mul_n_n_nc", @@ -6535,7 +6620,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 487 */ + { /* 492 */ "mul", "mul_p_p_p", "Parrot_mul_p_p_p", @@ -6546,7 +6631,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 488 */ + { /* 493 */ "mul", "mul_p_p_i", "Parrot_mul_p_p_i", @@ -6557,7 +6642,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 489 */ + { /* 494 */ "mul", "mul_p_p_ic", "Parrot_mul_p_p_ic", @@ -6568,7 +6653,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 490 */ + { /* 495 */ "mul", "mul_p_p_n", "Parrot_mul_p_p_n", @@ -6579,7 +6664,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 491 */ + { /* 496 */ "mul", "mul_p_p_nc", "Parrot_mul_p_p_nc", @@ -6590,7 +6675,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 492 */ + { /* 497 */ "neg", "neg_i", "Parrot_neg_i", @@ -6601,7 +6686,7 @@ static op_info_t core_op_info_table[1092] = { { 0 }, &core_op_lib }, - { /* 493 */ + { /* 498 */ "neg", "neg_n", "Parrot_neg_n", @@ -6612,7 +6697,7 @@ static op_info_t core_op_info_table[1092] = { { 0 }, &core_op_lib }, - { /* 494 */ + { /* 499 */ "neg", "neg_p", "Parrot_neg_p", @@ -6623,7 +6708,7 @@ static op_info_t core_op_info_table[1092] = { { 0 }, &core_op_lib }, - { /* 495 */ + { /* 500 */ "neg", "neg_i_i", "Parrot_neg_i_i", @@ -6634,7 +6719,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 496 */ + { /* 501 */ "neg", "neg_n_n", "Parrot_neg_n_n", @@ -6645,7 +6730,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 497 */ + { /* 502 */ "neg", "neg_p_p", "Parrot_neg_p_p", @@ -6656,7 +6741,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 498 */ + { /* 503 */ "sub", "sub_i_i", "Parrot_sub_i_i", @@ -6667,7 +6752,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 499 */ + { /* 504 */ "sub", "sub_i_ic", "Parrot_sub_i_ic", @@ -6678,7 +6763,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 500 */ + { /* 505 */ "sub", "sub_n_n", "Parrot_sub_n_n", @@ -6689,7 +6774,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 501 */ + { /* 506 */ "sub", "sub_n_nc", "Parrot_sub_n_nc", @@ -6700,7 +6785,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 502 */ + { /* 507 */ "sub", "sub_p_p", "Parrot_sub_p_p", @@ -6711,7 +6796,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 503 */ + { /* 508 */ "sub", "sub_p_i", "Parrot_sub_p_i", @@ -6722,7 +6807,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 504 */ + { /* 509 */ "sub", "sub_p_ic", "Parrot_sub_p_ic", @@ -6733,7 +6818,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 505 */ + { /* 510 */ "sub", "sub_p_n", "Parrot_sub_p_n", @@ -6744,7 +6829,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 506 */ + { /* 511 */ "sub", "sub_p_nc", "Parrot_sub_p_nc", @@ -6755,7 +6840,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 507 */ + { /* 512 */ "sub", "sub_i_i_i", "Parrot_sub_i_i_i", @@ -6766,7 +6851,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 508 */ + { /* 513 */ "sub", "sub_i_ic_i", "Parrot_sub_i_ic_i", @@ -6777,7 +6862,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 509 */ + { /* 514 */ "sub", "sub_i_i_ic", "Parrot_sub_i_i_ic", @@ -6788,7 +6873,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 510 */ + { /* 515 */ "sub", "sub_n_n_n", "Parrot_sub_n_n_n", @@ -6799,7 +6884,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 511 */ + { /* 516 */ "sub", "sub_n_nc_n", "Parrot_sub_n_nc_n", @@ -6810,7 +6895,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 512 */ + { /* 517 */ "sub", "sub_n_n_nc", "Parrot_sub_n_n_nc", @@ -6821,7 +6906,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 513 */ + { /* 518 */ "sub", "sub_p_p_p", "Parrot_sub_p_p_p", @@ -6832,7 +6917,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 514 */ + { /* 519 */ "sub", "sub_p_p_i", "Parrot_sub_p_p_i", @@ -6843,7 +6928,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 515 */ + { /* 520 */ "sub", "sub_p_p_ic", "Parrot_sub_p_p_ic", @@ -6854,7 +6939,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 516 */ + { /* 521 */ "sub", "sub_p_p_n", "Parrot_sub_p_p_n", @@ -6865,7 +6950,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 517 */ + { /* 522 */ "sub", "sub_p_p_nc", "Parrot_sub_p_p_nc", @@ -6876,7 +6961,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 518 */ + { /* 523 */ "sqrt", "sqrt_n_n", "Parrot_sqrt_n_n", @@ -6887,7 +6972,29 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 519 */ + { /* 524 */ + "is_inf_or_nan", + "is_inf_or_nan_i_n", + "Parrot_is_inf_or_nan_i_n", + 0, + 3, + { PARROT_ARG_I, PARROT_ARG_N }, + { PARROT_ARGDIR_OUT, PARROT_ARGDIR_IN }, + { 0, 0 }, + &core_op_lib + }, + { /* 525 */ + "is_inf_or_nan", + "is_inf_or_nan_i_nc", + "Parrot_is_inf_or_nan_i_nc", + 0, + 3, + { PARROT_ARG_I, PARROT_ARG_NC }, + { PARROT_ARGDIR_OUT, PARROT_ARGDIR_IN }, + { 0, 0 }, + &core_op_lib + }, + { /* 526 */ "callmethodcc", "callmethodcc_p_s", "Parrot_callmethodcc_p_s", @@ -6898,7 +7005,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 520 */ + { /* 527 */ "callmethodcc", "callmethodcc_p_sc", "Parrot_callmethodcc_p_sc", @@ -6909,7 +7016,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 521 */ + { /* 528 */ "callmethodcc", "callmethodcc_p_p", "Parrot_callmethodcc_p_p", @@ -6920,7 +7027,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 522 */ + { /* 529 */ "callmethod", "callmethod_p_s_p", "Parrot_callmethod_p_s_p", @@ -6931,7 +7038,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 523 */ + { /* 530 */ "callmethod", "callmethod_p_sc_p", "Parrot_callmethod_p_sc_p", @@ -6942,7 +7049,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 524 */ + { /* 531 */ "callmethod", "callmethod_p_p_p", "Parrot_callmethod_p_p_p", @@ -6953,7 +7060,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 525 */ + { /* 532 */ "tailcallmethod", "tailcallmethod_p_s", "Parrot_tailcallmethod_p_s", @@ -6964,7 +7071,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 526 */ + { /* 533 */ "tailcallmethod", "tailcallmethod_p_sc", "Parrot_tailcallmethod_p_sc", @@ -6975,7 +7082,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 527 */ + { /* 534 */ "tailcallmethod", "tailcallmethod_p_p", "Parrot_tailcallmethod_p_p", @@ -6986,7 +7093,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 528 */ + { /* 535 */ "addmethod", "addmethod_p_s_p", "Parrot_addmethod_p_s_p", @@ -6997,7 +7104,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 529 */ + { /* 536 */ "addmethod", "addmethod_p_sc_p", "Parrot_addmethod_p_sc_p", @@ -7008,7 +7115,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 530 */ + { /* 537 */ "can", "can_i_p_s", "Parrot_can_i_p_s", @@ -7019,7 +7126,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 531 */ + { /* 538 */ "can", "can_i_p_sc", "Parrot_can_i_p_sc", @@ -7030,7 +7137,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 532 */ + { /* 539 */ "does", "does_i_p_s", "Parrot_does_i_p_s", @@ -7041,7 +7148,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 533 */ + { /* 540 */ "does", "does_i_p_sc", "Parrot_does_i_p_sc", @@ -7052,7 +7159,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 534 */ + { /* 541 */ "does", "does_i_p_p", "Parrot_does_i_p_p", @@ -7063,7 +7170,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 535 */ + { /* 542 */ "does", "does_i_p_pc", "Parrot_does_i_p_pc", @@ -7074,7 +7181,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 536 */ + { /* 543 */ "isa", "isa_i_p_s", "Parrot_isa_i_p_s", @@ -7085,7 +7192,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 537 */ + { /* 544 */ "isa", "isa_i_p_sc", "Parrot_isa_i_p_sc", @@ -7096,7 +7203,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 538 */ + { /* 545 */ "isa", "isa_i_p_p", "Parrot_isa_i_p_p", @@ -7107,7 +7214,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 539 */ + { /* 546 */ "isa", "isa_i_p_pc", "Parrot_isa_i_p_pc", @@ -7118,7 +7225,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 540 */ + { /* 547 */ "newclass", "newclass_p_s", "Parrot_newclass_p_s", @@ -7129,7 +7236,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 541 */ + { /* 548 */ "newclass", "newclass_p_sc", "Parrot_newclass_p_sc", @@ -7140,7 +7247,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 542 */ + { /* 549 */ "newclass", "newclass_p_p", "Parrot_newclass_p_p", @@ -7151,7 +7258,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 543 */ + { /* 550 */ "newclass", "newclass_p_pc", "Parrot_newclass_p_pc", @@ -7162,7 +7269,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 544 */ + { /* 551 */ "subclass", "subclass_p_p", "Parrot_subclass_p_p", @@ -7173,7 +7280,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 545 */ + { /* 552 */ "subclass", "subclass_p_pc", "Parrot_subclass_p_pc", @@ -7184,7 +7291,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 546 */ + { /* 553 */ "subclass", "subclass_p_p_s", "Parrot_subclass_p_p_s", @@ -7195,7 +7302,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 547 */ + { /* 554 */ "subclass", "subclass_p_pc_s", "Parrot_subclass_p_pc_s", @@ -7206,7 +7313,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 548 */ + { /* 555 */ "subclass", "subclass_p_p_sc", "Parrot_subclass_p_p_sc", @@ -7217,7 +7324,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 549 */ + { /* 556 */ "subclass", "subclass_p_pc_sc", "Parrot_subclass_p_pc_sc", @@ -7228,7 +7335,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 550 */ + { /* 557 */ "subclass", "subclass_p_p_p", "Parrot_subclass_p_p_p", @@ -7239,7 +7346,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 551 */ + { /* 558 */ "subclass", "subclass_p_pc_p", "Parrot_subclass_p_pc_p", @@ -7250,7 +7357,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 552 */ + { /* 559 */ "subclass", "subclass_p_p_pc", "Parrot_subclass_p_p_pc", @@ -7261,7 +7368,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 553 */ + { /* 560 */ "subclass", "subclass_p_pc_pc", "Parrot_subclass_p_pc_pc", @@ -7272,7 +7379,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 554 */ + { /* 561 */ "subclass", "subclass_p_s", "Parrot_subclass_p_s", @@ -7283,7 +7390,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 555 */ + { /* 562 */ "subclass", "subclass_p_sc", "Parrot_subclass_p_sc", @@ -7294,7 +7401,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 556 */ + { /* 563 */ "subclass", "subclass_p_s_s", "Parrot_subclass_p_s_s", @@ -7305,7 +7412,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 557 */ + { /* 564 */ "subclass", "subclass_p_sc_s", "Parrot_subclass_p_sc_s", @@ -7316,7 +7423,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 558 */ + { /* 565 */ "subclass", "subclass_p_s_sc", "Parrot_subclass_p_s_sc", @@ -7327,7 +7434,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 559 */ + { /* 566 */ "subclass", "subclass_p_sc_sc", "Parrot_subclass_p_sc_sc", @@ -7338,7 +7445,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 560 */ + { /* 567 */ "subclass", "subclass_p_s_p", "Parrot_subclass_p_s_p", @@ -7349,7 +7456,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 561 */ + { /* 568 */ "subclass", "subclass_p_sc_p", "Parrot_subclass_p_sc_p", @@ -7360,7 +7467,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 562 */ + { /* 569 */ "subclass", "subclass_p_s_pc", "Parrot_subclass_p_s_pc", @@ -7371,7 +7478,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 563 */ + { /* 570 */ "subclass", "subclass_p_sc_pc", "Parrot_subclass_p_sc_pc", @@ -7382,7 +7489,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 564 */ + { /* 571 */ "get_class", "get_class_p_s", "Parrot_get_class_p_s", @@ -7393,7 +7500,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 565 */ + { /* 572 */ "get_class", "get_class_p_sc", "Parrot_get_class_p_sc", @@ -7404,7 +7511,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 566 */ + { /* 573 */ "get_class", "get_class_p_p", "Parrot_get_class_p_p", @@ -7415,7 +7522,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 567 */ + { /* 574 */ "get_class", "get_class_p_pc", "Parrot_get_class_p_pc", @@ -7426,7 +7533,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 568 */ + { /* 575 */ "class", "class_p_p", "Parrot_class_p_p", @@ -7437,7 +7544,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 569 */ + { /* 576 */ "addparent", "addparent_p_p", "Parrot_addparent_p_p", @@ -7448,7 +7555,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 570 */ + { /* 577 */ "removeparent", "removeparent_p_p", "Parrot_removeparent_p_p", @@ -7459,7 +7566,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 571 */ + { /* 578 */ "addrole", "addrole_p_p", "Parrot_addrole_p_p", @@ -7470,7 +7577,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 572 */ + { /* 579 */ "addattribute", "addattribute_p_s", "Parrot_addattribute_p_s", @@ -7481,7 +7588,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 573 */ + { /* 580 */ "addattribute", "addattribute_p_sc", "Parrot_addattribute_p_sc", @@ -7492,7 +7599,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 574 */ + { /* 581 */ "removeattribute", "removeattribute_p_s", "Parrot_removeattribute_p_s", @@ -7503,7 +7610,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 575 */ + { /* 582 */ "removeattribute", "removeattribute_p_sc", "Parrot_removeattribute_p_sc", @@ -7514,7 +7621,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 576 */ + { /* 583 */ "getattribute", "getattribute_p_p_s", "Parrot_getattribute_p_p_s", @@ -7525,7 +7632,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 577 */ + { /* 584 */ "getattribute", "getattribute_p_p_sc", "Parrot_getattribute_p_p_sc", @@ -7536,7 +7643,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 578 */ + { /* 585 */ "getattribute", "getattribute_p_p_p_s", "Parrot_getattribute_p_p_p_s", @@ -7547,7 +7654,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0, 0 }, &core_op_lib }, - { /* 579 */ + { /* 586 */ "getattribute", "getattribute_p_p_pc_s", "Parrot_getattribute_p_p_pc_s", @@ -7558,7 +7665,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0, 0 }, &core_op_lib }, - { /* 580 */ + { /* 587 */ "getattribute", "getattribute_p_p_p_sc", "Parrot_getattribute_p_p_p_sc", @@ -7569,7 +7676,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0, 0 }, &core_op_lib }, - { /* 581 */ + { /* 588 */ "getattribute", "getattribute_p_p_pc_sc", "Parrot_getattribute_p_p_pc_sc", @@ -7580,7 +7687,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0, 0 }, &core_op_lib }, - { /* 582 */ + { /* 589 */ "setattribute", "setattribute_p_s_p", "Parrot_setattribute_p_s_p", @@ -7591,7 +7698,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 583 */ + { /* 590 */ "setattribute", "setattribute_p_sc_p", "Parrot_setattribute_p_sc_p", @@ -7602,7 +7709,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 584 */ + { /* 591 */ "setattribute", "setattribute_p_p_s_p", "Parrot_setattribute_p_p_s_p", @@ -7613,7 +7720,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0, 0 }, &core_op_lib }, - { /* 585 */ + { /* 592 */ "setattribute", "setattribute_p_pc_s_p", "Parrot_setattribute_p_pc_s_p", @@ -7624,7 +7731,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0, 0 }, &core_op_lib }, - { /* 586 */ + { /* 593 */ "setattribute", "setattribute_p_p_sc_p", "Parrot_setattribute_p_p_sc_p", @@ -7635,7 +7742,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0, 0 }, &core_op_lib }, - { /* 587 */ + { /* 594 */ "setattribute", "setattribute_p_pc_sc_p", "Parrot_setattribute_p_pc_sc_p", @@ -7646,7 +7753,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0, 0 }, &core_op_lib }, - { /* 588 */ + { /* 595 */ "inspect", "inspect_p_p", "Parrot_inspect_p_p", @@ -7657,7 +7764,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 589 */ + { /* 596 */ "inspect", "inspect_p_pc", "Parrot_inspect_p_pc", @@ -7668,7 +7775,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 590 */ + { /* 597 */ "inspect", "inspect_p_p_s", "Parrot_inspect_p_p_s", @@ -7679,7 +7786,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 591 */ + { /* 598 */ "inspect", "inspect_p_pc_s", "Parrot_inspect_p_pc_s", @@ -7690,7 +7797,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 592 */ + { /* 599 */ "inspect", "inspect_p_p_sc", "Parrot_inspect_p_p_sc", @@ -7701,7 +7808,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 593 */ + { /* 600 */ "inspect", "inspect_p_pc_sc", "Parrot_inspect_p_pc_sc", @@ -7712,7 +7819,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 594 */ + { /* 601 */ "new", "new_p_s", "Parrot_new_p_s", @@ -7723,7 +7830,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 595 */ + { /* 602 */ "new", "new_p_sc", "Parrot_new_p_sc", @@ -7734,7 +7841,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 596 */ + { /* 603 */ "new", "new_p_s_p", "Parrot_new_p_s_p", @@ -7745,7 +7852,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 597 */ + { /* 604 */ "new", "new_p_sc_p", "Parrot_new_p_sc_p", @@ -7756,7 +7863,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 598 */ + { /* 605 */ "new", "new_p_s_pc", "Parrot_new_p_s_pc", @@ -7767,7 +7874,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 599 */ + { /* 606 */ "new", "new_p_sc_pc", "Parrot_new_p_sc_pc", @@ -7778,7 +7885,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 600 */ + { /* 607 */ "new", "new_p_p", "Parrot_new_p_p", @@ -7789,7 +7896,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 601 */ + { /* 608 */ "new", "new_p_pc", "Parrot_new_p_pc", @@ -7800,7 +7907,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 602 */ + { /* 609 */ "new", "new_p_p_p", "Parrot_new_p_p_p", @@ -7811,7 +7918,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 603 */ + { /* 610 */ "new", "new_p_pc_p", "Parrot_new_p_pc_p", @@ -7822,7 +7929,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 604 */ + { /* 611 */ "new", "new_p_p_pc", "Parrot_new_p_p_pc", @@ -7833,7 +7940,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 605 */ + { /* 612 */ "new", "new_p_pc_pc", "Parrot_new_p_pc_pc", @@ -7844,7 +7951,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 606 */ + { /* 613 */ "root_new", "root_new_p_p", "Parrot_root_new_p_p", @@ -7855,7 +7962,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 607 */ + { /* 614 */ "root_new", "root_new_p_pc", "Parrot_root_new_p_pc", @@ -7866,7 +7973,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 608 */ + { /* 615 */ "root_new", "root_new_p_p_p", "Parrot_root_new_p_p_p", @@ -7877,7 +7984,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 609 */ + { /* 616 */ "root_new", "root_new_p_pc_p", "Parrot_root_new_p_pc_p", @@ -7888,7 +7995,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 610 */ + { /* 617 */ "root_new", "root_new_p_p_pc", "Parrot_root_new_p_p_pc", @@ -7899,7 +8006,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 611 */ + { /* 618 */ "root_new", "root_new_p_pc_pc", "Parrot_root_new_p_pc_pc", @@ -7910,7 +8017,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 612 */ + { /* 619 */ "typeof", "typeof_s_p", "Parrot_typeof_s_p", @@ -7921,7 +8028,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 613 */ + { /* 620 */ "typeof", "typeof_p_p", "Parrot_typeof_p_p", @@ -7932,7 +8039,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 614 */ + { /* 621 */ "get_repr", "get_repr_s_p", "Parrot_get_repr_s_p", @@ -7943,7 +8050,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 615 */ + { /* 622 */ "find_method", "find_method_p_p_s", "Parrot_find_method_p_p_s", @@ -7954,7 +8061,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 616 */ + { /* 623 */ "find_method", "find_method_p_p_sc", "Parrot_find_method_p_p_sc", @@ -7965,7 +8072,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 617 */ + { /* 624 */ "defined", "defined_i_p", "Parrot_defined_i_p", @@ -7976,7 +8083,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 618 */ + { /* 625 */ "defined", "defined_i_p_ki", "Parrot_defined_i_p_ki", @@ -7987,7 +8094,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 619 */ + { /* 626 */ "defined", "defined_i_p_kic", "Parrot_defined_i_p_kic", @@ -7998,7 +8105,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 620 */ + { /* 627 */ "defined", "defined_i_p_k", "Parrot_defined_i_p_k", @@ -8009,7 +8116,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 621 */ + { /* 628 */ "defined", "defined_i_p_kc", "Parrot_defined_i_p_kc", @@ -8020,7 +8127,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 622 */ + { /* 629 */ "exists", "exists_i_p_ki", "Parrot_exists_i_p_ki", @@ -8031,7 +8138,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 623 */ + { /* 630 */ "exists", "exists_i_p_kic", "Parrot_exists_i_p_kic", @@ -8042,7 +8149,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 624 */ + { /* 631 */ "exists", "exists_i_p_k", "Parrot_exists_i_p_k", @@ -8053,7 +8160,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 625 */ + { /* 632 */ "exists", "exists_i_p_kc", "Parrot_exists_i_p_kc", @@ -8064,7 +8171,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 626 */ + { /* 633 */ "delete", "delete_p_k", "Parrot_delete_p_k", @@ -8075,7 +8182,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 627 */ + { /* 634 */ "delete", "delete_p_kc", "Parrot_delete_p_kc", @@ -8086,7 +8193,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 628 */ + { /* 635 */ "delete", "delete_p_ki", "Parrot_delete_p_ki", @@ -8097,7 +8204,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 629 */ + { /* 636 */ "delete", "delete_p_kic", "Parrot_delete_p_kic", @@ -8108,7 +8215,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 630 */ + { /* 637 */ "elements", "elements_i_p", "Parrot_elements_i_p", @@ -8119,7 +8226,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 631 */ + { /* 638 */ "push", "push_p_i", "Parrot_push_p_i", @@ -8130,7 +8237,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 632 */ + { /* 639 */ "push", "push_p_ic", "Parrot_push_p_ic", @@ -8141,7 +8248,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 633 */ + { /* 640 */ "push", "push_p_n", "Parrot_push_p_n", @@ -8152,7 +8259,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 634 */ + { /* 641 */ "push", "push_p_nc", "Parrot_push_p_nc", @@ -8163,7 +8270,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 635 */ + { /* 642 */ "push", "push_p_s", "Parrot_push_p_s", @@ -8174,7 +8281,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 636 */ + { /* 643 */ "push", "push_p_sc", "Parrot_push_p_sc", @@ -8185,7 +8292,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 637 */ + { /* 644 */ "push", "push_p_p", "Parrot_push_p_p", @@ -8196,7 +8303,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 638 */ + { /* 645 */ "pop", "pop_i_p", "Parrot_pop_i_p", @@ -8207,7 +8314,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 639 */ + { /* 646 */ "pop", "pop_n_p", "Parrot_pop_n_p", @@ -8218,7 +8325,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 640 */ + { /* 647 */ "pop", "pop_s_p", "Parrot_pop_s_p", @@ -8229,7 +8336,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 641 */ + { /* 648 */ "pop", "pop_p_p", "Parrot_pop_p_p", @@ -8240,7 +8347,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 642 */ + { /* 649 */ "unshift", "unshift_p_i", "Parrot_unshift_p_i", @@ -8251,7 +8358,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 643 */ + { /* 650 */ "unshift", "unshift_p_ic", "Parrot_unshift_p_ic", @@ -8262,7 +8369,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 644 */ + { /* 651 */ "unshift", "unshift_p_n", "Parrot_unshift_p_n", @@ -8273,7 +8380,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 645 */ + { /* 652 */ "unshift", "unshift_p_nc", "Parrot_unshift_p_nc", @@ -8284,7 +8391,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 646 */ + { /* 653 */ "unshift", "unshift_p_s", "Parrot_unshift_p_s", @@ -8295,7 +8402,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 647 */ + { /* 654 */ "unshift", "unshift_p_sc", "Parrot_unshift_p_sc", @@ -8306,7 +8413,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 648 */ + { /* 655 */ "unshift", "unshift_p_p", "Parrot_unshift_p_p", @@ -8317,7 +8424,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 649 */ + { /* 656 */ "shift", "shift_i_p", "Parrot_shift_i_p", @@ -8328,7 +8435,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 650 */ + { /* 657 */ "shift", "shift_n_p", "Parrot_shift_n_p", @@ -8339,7 +8446,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 651 */ + { /* 658 */ "shift", "shift_s_p", "Parrot_shift_s_p", @@ -8350,7 +8457,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 652 */ + { /* 659 */ "shift", "shift_p_p", "Parrot_shift_p_p", @@ -8361,7 +8468,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 653 */ + { /* 660 */ "splice", "splice_p_p_i_i", "Parrot_splice_p_p_i_i", @@ -8372,7 +8479,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0, 0 }, &core_op_lib }, - { /* 654 */ + { /* 661 */ "splice", "splice_p_p_ic_i", "Parrot_splice_p_p_ic_i", @@ -8383,7 +8490,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0, 0 }, &core_op_lib }, - { /* 655 */ + { /* 662 */ "splice", "splice_p_p_i_ic", "Parrot_splice_p_p_i_ic", @@ -8394,7 +8501,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0, 0 }, &core_op_lib }, - { /* 656 */ + { /* 663 */ "splice", "splice_p_p_ic_ic", "Parrot_splice_p_p_ic_ic", @@ -8405,7 +8512,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0, 0 }, &core_op_lib }, - { /* 657 */ + { /* 664 */ "setprop", "setprop_p_s_p", "Parrot_setprop_p_s_p", @@ -8416,7 +8523,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 658 */ + { /* 665 */ "setprop", "setprop_p_sc_p", "Parrot_setprop_p_sc_p", @@ -8427,7 +8534,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 659 */ + { /* 666 */ "getprop", "getprop_p_s_p", "Parrot_getprop_p_s_p", @@ -8438,7 +8545,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 660 */ + { /* 667 */ "getprop", "getprop_p_sc_p", "Parrot_getprop_p_sc_p", @@ -8449,7 +8556,29 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 661 */ + { /* 668 */ + "getprop", + "getprop_p_p_s", + "Parrot_getprop_p_p_s", + 0, + 4, + { PARROT_ARG_P, PARROT_ARG_P, PARROT_ARG_S }, + { PARROT_ARGDIR_OUT, PARROT_ARGDIR_IN, PARROT_ARGDIR_IN }, + { 0, 0, 0 }, + &core_op_lib + }, + { /* 669 */ + "getprop", + "getprop_p_p_sc", + "Parrot_getprop_p_p_sc", + 0, + 4, + { PARROT_ARG_P, PARROT_ARG_P, PARROT_ARG_SC }, + { PARROT_ARGDIR_OUT, PARROT_ARGDIR_IN, PARROT_ARGDIR_IN }, + { 0, 0, 0 }, + &core_op_lib + }, + { /* 670 */ "delprop", "delprop_p_s", "Parrot_delprop_p_s", @@ -8460,7 +8589,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 662 */ + { /* 671 */ "delprop", "delprop_p_sc", "Parrot_delprop_p_sc", @@ -8471,7 +8600,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 663 */ + { /* 672 */ "prophash", "prophash_p_p", "Parrot_prophash_p_p", @@ -8482,7 +8611,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 664 */ + { /* 673 */ "freeze", "freeze_s_p", "Parrot_freeze_s_p", @@ -8493,7 +8622,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 665 */ + { /* 674 */ "thaw", "thaw_p_s", "Parrot_thaw_p_s", @@ -8504,7 +8633,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 666 */ + { /* 675 */ "thaw", "thaw_p_sc", "Parrot_thaw_p_sc", @@ -8515,7 +8644,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 667 */ + { /* 676 */ "add_multi", "add_multi_s_s_p", "Parrot_add_multi_s_s_p", @@ -8526,7 +8655,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 668 */ + { /* 677 */ "add_multi", "add_multi_sc_s_p", "Parrot_add_multi_sc_s_p", @@ -8537,7 +8666,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 669 */ + { /* 678 */ "add_multi", "add_multi_s_sc_p", "Parrot_add_multi_s_sc_p", @@ -8548,7 +8677,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 670 */ + { /* 679 */ "add_multi", "add_multi_sc_sc_p", "Parrot_add_multi_sc_sc_p", @@ -8559,7 +8688,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 671 */ + { /* 680 */ "find_multi", "find_multi_p_s_s", "Parrot_find_multi_p_s_s", @@ -8570,7 +8699,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 672 */ + { /* 681 */ "find_multi", "find_multi_p_sc_s", "Parrot_find_multi_p_sc_s", @@ -8581,7 +8710,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 673 */ + { /* 682 */ "find_multi", "find_multi_p_s_sc", "Parrot_find_multi_p_s_sc", @@ -8592,7 +8721,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 674 */ + { /* 683 */ "find_multi", "find_multi_p_sc_sc", "Parrot_find_multi_p_sc_sc", @@ -8603,7 +8732,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 675 */ + { /* 684 */ "register", "register_p", "Parrot_register_p", @@ -8614,7 +8743,7 @@ static op_info_t core_op_info_table[1092] = { { 0 }, &core_op_lib }, - { /* 676 */ + { /* 685 */ "unregister", "unregister_p", "Parrot_unregister_p", @@ -8625,7 +8754,7 @@ static op_info_t core_op_info_table[1092] = { { 0 }, &core_op_lib }, - { /* 677 */ + { /* 686 */ "box", "box_p_i", "Parrot_box_p_i", @@ -8636,7 +8765,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 678 */ + { /* 687 */ "box", "box_p_ic", "Parrot_box_p_ic", @@ -8647,7 +8776,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 679 */ + { /* 688 */ "box", "box_p_n", "Parrot_box_p_n", @@ -8658,7 +8787,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 680 */ + { /* 689 */ "box", "box_p_nc", "Parrot_box_p_nc", @@ -8669,7 +8798,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 681 */ + { /* 690 */ "box", "box_p_s", "Parrot_box_p_s", @@ -8680,7 +8809,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 682 */ + { /* 691 */ "box", "box_p_sc", "Parrot_box_p_sc", @@ -8691,7 +8820,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 683 */ + { /* 692 */ "iter", "iter_p_p", "Parrot_iter_p_p", @@ -8702,7 +8831,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 684 */ + { /* 693 */ "morph", "morph_p_p", "Parrot_morph_p_p", @@ -8713,7 +8842,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 685 */ + { /* 694 */ "morph", "morph_p_pc", "Parrot_morph_p_pc", @@ -8724,7 +8853,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 686 */ + { /* 695 */ "clone", "clone_s_s", "Parrot_clone_s_s", @@ -8735,7 +8864,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 687 */ + { /* 696 */ "clone", "clone_s_sc", "Parrot_clone_s_sc", @@ -8746,7 +8875,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 688 */ + { /* 697 */ "set", "set_i_i", "Parrot_set_i_i", @@ -8757,7 +8886,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 689 */ + { /* 698 */ "set", "set_i_ic", "Parrot_set_i_ic", @@ -8768,7 +8897,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 690 */ + { /* 699 */ "set", "set_i_n", "Parrot_set_i_n", @@ -8779,7 +8908,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 691 */ + { /* 700 */ "set", "set_i_nc", "Parrot_set_i_nc", @@ -8790,7 +8919,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 692 */ + { /* 701 */ "set", "set_i_s", "Parrot_set_i_s", @@ -8801,7 +8930,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 693 */ + { /* 702 */ "set", "set_i_sc", "Parrot_set_i_sc", @@ -8812,7 +8941,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 694 */ + { /* 703 */ "set", "set_n_n", "Parrot_set_n_n", @@ -8823,7 +8952,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 695 */ + { /* 704 */ "set", "set_n_nc", "Parrot_set_n_nc", @@ -8834,7 +8963,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 696 */ + { /* 705 */ "set", "set_n_i", "Parrot_set_n_i", @@ -8845,7 +8974,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 697 */ + { /* 706 */ "set", "set_n_ic", "Parrot_set_n_ic", @@ -8856,7 +8985,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 698 */ + { /* 707 */ "set", "set_n_s", "Parrot_set_n_s", @@ -8867,7 +8996,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 699 */ + { /* 708 */ "set", "set_n_sc", "Parrot_set_n_sc", @@ -8878,7 +9007,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 700 */ + { /* 709 */ "set", "set_n_p", "Parrot_set_n_p", @@ -8889,7 +9018,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 701 */ + { /* 710 */ "set", "set_s_p", "Parrot_set_s_p", @@ -8900,7 +9029,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 702 */ + { /* 711 */ "set", "set_s_s", "Parrot_set_s_s", @@ -8911,7 +9040,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 703 */ + { /* 712 */ "set", "set_s_sc", "Parrot_set_s_sc", @@ -8922,7 +9051,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 704 */ + { /* 713 */ "set", "set_s_i", "Parrot_set_s_i", @@ -8933,7 +9062,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 705 */ + { /* 714 */ "set", "set_s_ic", "Parrot_set_s_ic", @@ -8944,7 +9073,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 706 */ + { /* 715 */ "set", "set_s_n", "Parrot_set_s_n", @@ -8955,7 +9084,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 707 */ + { /* 716 */ "set", "set_s_nc", "Parrot_set_s_nc", @@ -8966,7 +9095,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 708 */ + { /* 717 */ "set", "set_p_pc", "Parrot_set_p_pc", @@ -8977,7 +9106,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 709 */ + { /* 718 */ "set", "set_p_p", "Parrot_set_p_p", @@ -8988,7 +9117,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 710 */ + { /* 719 */ "set", "set_p_i", "Parrot_set_p_i", @@ -8999,7 +9128,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 711 */ + { /* 720 */ "set", "set_p_ic", "Parrot_set_p_ic", @@ -9010,7 +9139,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 712 */ + { /* 721 */ "set", "set_p_n", "Parrot_set_p_n", @@ -9021,7 +9150,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 713 */ + { /* 722 */ "set", "set_p_nc", "Parrot_set_p_nc", @@ -9032,7 +9161,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 714 */ + { /* 723 */ "set", "set_p_s", "Parrot_set_p_s", @@ -9043,7 +9172,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 715 */ + { /* 724 */ "set", "set_p_sc", "Parrot_set_p_sc", @@ -9054,7 +9183,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 716 */ + { /* 725 */ "set", "set_i_p", "Parrot_set_i_p", @@ -9065,7 +9194,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 717 */ + { /* 726 */ "assign", "assign_p_p", "Parrot_assign_p_p", @@ -9076,7 +9205,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 718 */ + { /* 727 */ "assign", "assign_p_i", "Parrot_assign_p_i", @@ -9087,7 +9216,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 719 */ + { /* 728 */ "assign", "assign_p_ic", "Parrot_assign_p_ic", @@ -9098,7 +9227,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 720 */ + { /* 729 */ "assign", "assign_p_n", "Parrot_assign_p_n", @@ -9109,7 +9238,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 721 */ + { /* 730 */ "assign", "assign_p_nc", "Parrot_assign_p_nc", @@ -9120,7 +9249,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 722 */ + { /* 731 */ "assign", "assign_p_s", "Parrot_assign_p_s", @@ -9131,7 +9260,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 723 */ + { /* 732 */ "assign", "assign_p_sc", "Parrot_assign_p_sc", @@ -9142,7 +9271,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 724 */ + { /* 733 */ "assign", "assign_s_s", "Parrot_assign_s_s", @@ -9153,7 +9282,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 725 */ + { /* 734 */ "assign", "assign_s_sc", "Parrot_assign_s_sc", @@ -9164,7 +9293,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 726 */ + { /* 735 */ "setref", "setref_p_p", "Parrot_setref_p_p", @@ -9175,7 +9304,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 727 */ + { /* 736 */ "deref", "deref_p_p", "Parrot_deref_p_p", @@ -9186,7 +9315,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 728 */ + { /* 737 */ "set", "set_p_ki_i", "Parrot_set_p_ki_i", @@ -9197,7 +9326,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 729 */ + { /* 738 */ "set", "set_p_kic_i", "Parrot_set_p_kic_i", @@ -9208,7 +9337,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 730 */ + { /* 739 */ "set", "set_p_ki_ic", "Parrot_set_p_ki_ic", @@ -9219,7 +9348,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 731 */ + { /* 740 */ "set", "set_p_kic_ic", "Parrot_set_p_kic_ic", @@ -9230,7 +9359,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 732 */ + { /* 741 */ "set", "set_p_ki_n", "Parrot_set_p_ki_n", @@ -9241,7 +9370,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 733 */ + { /* 742 */ "set", "set_p_kic_n", "Parrot_set_p_kic_n", @@ -9252,7 +9381,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 734 */ + { /* 743 */ "set", "set_p_ki_nc", "Parrot_set_p_ki_nc", @@ -9263,7 +9392,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 735 */ + { /* 744 */ "set", "set_p_kic_nc", "Parrot_set_p_kic_nc", @@ -9274,7 +9403,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 736 */ + { /* 745 */ "set", "set_p_ki_s", "Parrot_set_p_ki_s", @@ -9285,7 +9414,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 737 */ + { /* 746 */ "set", "set_p_kic_s", "Parrot_set_p_kic_s", @@ -9296,7 +9425,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 738 */ + { /* 747 */ "set", "set_p_ki_sc", "Parrot_set_p_ki_sc", @@ -9307,7 +9436,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 739 */ + { /* 748 */ "set", "set_p_kic_sc", "Parrot_set_p_kic_sc", @@ -9318,7 +9447,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 740 */ + { /* 749 */ "set", "set_p_ki_p", "Parrot_set_p_ki_p", @@ -9329,7 +9458,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 741 */ + { /* 750 */ "set", "set_p_kic_p", "Parrot_set_p_kic_p", @@ -9340,7 +9469,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 742 */ + { /* 751 */ "set", "set_i_p_ki", "Parrot_set_i_p_ki", @@ -9351,7 +9480,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 743 */ + { /* 752 */ "set", "set_i_p_kic", "Parrot_set_i_p_kic", @@ -9362,7 +9491,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 744 */ + { /* 753 */ "set", "set_n_p_ki", "Parrot_set_n_p_ki", @@ -9373,7 +9502,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 745 */ + { /* 754 */ "set", "set_n_p_kic", "Parrot_set_n_p_kic", @@ -9384,7 +9513,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 746 */ + { /* 755 */ "set", "set_s_p_ki", "Parrot_set_s_p_ki", @@ -9395,7 +9524,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 747 */ + { /* 756 */ "set", "set_s_p_kic", "Parrot_set_s_p_kic", @@ -9406,7 +9535,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 748 */ + { /* 757 */ "set", "set_p_p_ki", "Parrot_set_p_p_ki", @@ -9417,7 +9546,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 749 */ + { /* 758 */ "set", "set_p_p_kic", "Parrot_set_p_p_kic", @@ -9428,7 +9557,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 750 */ + { /* 759 */ "set", "set_p_k_i", "Parrot_set_p_k_i", @@ -9439,7 +9568,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 751 */ + { /* 760 */ "set", "set_p_kc_i", "Parrot_set_p_kc_i", @@ -9450,7 +9579,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 752 */ + { /* 761 */ "set", "set_p_k_ic", "Parrot_set_p_k_ic", @@ -9461,7 +9590,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 753 */ + { /* 762 */ "set", "set_p_kc_ic", "Parrot_set_p_kc_ic", @@ -9472,7 +9601,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 754 */ + { /* 763 */ "set", "set_p_k_n", "Parrot_set_p_k_n", @@ -9483,7 +9612,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 755 */ + { /* 764 */ "set", "set_p_kc_n", "Parrot_set_p_kc_n", @@ -9494,7 +9623,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 756 */ + { /* 765 */ "set", "set_p_k_nc", "Parrot_set_p_k_nc", @@ -9505,7 +9634,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 757 */ + { /* 766 */ "set", "set_p_kc_nc", "Parrot_set_p_kc_nc", @@ -9516,7 +9645,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 758 */ + { /* 767 */ "set", "set_p_k_s", "Parrot_set_p_k_s", @@ -9527,7 +9656,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 759 */ + { /* 768 */ "set", "set_p_kc_s", "Parrot_set_p_kc_s", @@ -9538,7 +9667,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 760 */ + { /* 769 */ "set", "set_p_k_sc", "Parrot_set_p_k_sc", @@ -9549,7 +9678,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 761 */ + { /* 770 */ "set", "set_p_kc_sc", "Parrot_set_p_kc_sc", @@ -9560,7 +9689,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 762 */ + { /* 771 */ "set", "set_p_k_p", "Parrot_set_p_k_p", @@ -9571,7 +9700,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 763 */ + { /* 772 */ "set", "set_p_kc_p", "Parrot_set_p_kc_p", @@ -9582,7 +9711,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 764 */ + { /* 773 */ "set", "set_i_p_k", "Parrot_set_i_p_k", @@ -9593,7 +9722,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 765 */ + { /* 774 */ "set", "set_i_p_kc", "Parrot_set_i_p_kc", @@ -9604,7 +9733,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 766 */ + { /* 775 */ "set", "set_n_p_k", "Parrot_set_n_p_k", @@ -9615,7 +9744,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 767 */ + { /* 776 */ "set", "set_n_p_kc", "Parrot_set_n_p_kc", @@ -9626,7 +9755,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 768 */ + { /* 777 */ "set", "set_s_p_k", "Parrot_set_s_p_k", @@ -9637,7 +9766,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 769 */ + { /* 778 */ "set", "set_s_p_kc", "Parrot_set_s_p_kc", @@ -9648,7 +9777,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 770 */ + { /* 779 */ "set", "set_p_p_k", "Parrot_set_p_p_k", @@ -9659,7 +9788,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 771 */ + { /* 780 */ "set", "set_p_p_kc", "Parrot_set_p_p_kc", @@ -9670,7 +9799,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 772 */ + { /* 781 */ "clone", "clone_p_p", "Parrot_clone_p_p", @@ -9681,7 +9810,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 773 */ + { /* 782 */ "clone", "clone_p_p_p", "Parrot_clone_p_p_p", @@ -9692,7 +9821,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 774 */ + { /* 783 */ "clone", "clone_p_p_pc", "Parrot_clone_p_p_pc", @@ -9703,7 +9832,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 775 */ + { /* 784 */ "copy", "copy_p_p", "Parrot_copy_p_p", @@ -9714,7 +9843,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 776 */ + { /* 785 */ "null", "null_s", "Parrot_null_s", @@ -9725,7 +9854,7 @@ static op_info_t core_op_info_table[1092] = { { 0 }, &core_op_lib }, - { /* 777 */ + { /* 786 */ "null", "null_i", "Parrot_null_i", @@ -9736,7 +9865,7 @@ static op_info_t core_op_info_table[1092] = { { 0 }, &core_op_lib }, - { /* 778 */ + { /* 787 */ "null", "null_p", "Parrot_null_p", @@ -9747,7 +9876,7 @@ static op_info_t core_op_info_table[1092] = { { 0 }, &core_op_lib }, - { /* 779 */ + { /* 788 */ "null", "null_n", "Parrot_null_n", @@ -9758,7 +9887,7 @@ static op_info_t core_op_info_table[1092] = { { 0 }, &core_op_lib }, - { /* 780 */ + { /* 789 */ "ord", "ord_i_s", "Parrot_ord_i_s", @@ -9769,7 +9898,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 781 */ + { /* 790 */ "ord", "ord_i_sc", "Parrot_ord_i_sc", @@ -9780,7 +9909,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 782 */ + { /* 791 */ "ord", "ord_i_s_i", "Parrot_ord_i_s_i", @@ -9791,7 +9920,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 783 */ + { /* 792 */ "ord", "ord_i_sc_i", "Parrot_ord_i_sc_i", @@ -9802,7 +9931,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 784 */ + { /* 793 */ "ord", "ord_i_s_ic", "Parrot_ord_i_s_ic", @@ -9813,7 +9942,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 785 */ + { /* 794 */ "ord", "ord_i_sc_ic", "Parrot_ord_i_sc_ic", @@ -9824,7 +9953,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 786 */ + { /* 795 */ "chr", "chr_s_i", "Parrot_chr_s_i", @@ -9835,7 +9964,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 787 */ + { /* 796 */ "chr", "chr_s_ic", "Parrot_chr_s_ic", @@ -9846,7 +9975,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 788 */ + { /* 797 */ "chopn", "chopn_s_s_i", "Parrot_chopn_s_s_i", @@ -9857,7 +9986,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 789 */ + { /* 798 */ "chopn", "chopn_s_sc_i", "Parrot_chopn_s_sc_i", @@ -9868,7 +9997,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 790 */ + { /* 799 */ "chopn", "chopn_s_s_ic", "Parrot_chopn_s_s_ic", @@ -9879,7 +10008,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 791 */ + { /* 800 */ "chopn", "chopn_s_sc_ic", "Parrot_chopn_s_sc_ic", @@ -9890,7 +10019,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 792 */ + { /* 801 */ "concat", "concat_p_p", "Parrot_concat_p_p", @@ -9901,7 +10030,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 793 */ + { /* 802 */ "concat", "concat_p_s", "Parrot_concat_p_s", @@ -9912,7 +10041,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 794 */ + { /* 803 */ "concat", "concat_p_sc", "Parrot_concat_p_sc", @@ -9923,7 +10052,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 795 */ + { /* 804 */ "concat", "concat_s_s_s", "Parrot_concat_s_s_s", @@ -9934,7 +10063,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 796 */ + { /* 805 */ "concat", "concat_s_sc_s", "Parrot_concat_s_sc_s", @@ -9945,7 +10074,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 797 */ + { /* 806 */ "concat", "concat_s_s_sc", "Parrot_concat_s_s_sc", @@ -9956,7 +10085,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 798 */ + { /* 807 */ "concat", "concat_p_p_s", "Parrot_concat_p_p_s", @@ -9967,7 +10096,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 799 */ + { /* 808 */ "concat", "concat_p_p_sc", "Parrot_concat_p_p_sc", @@ -9978,7 +10107,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 800 */ + { /* 809 */ "concat", "concat_p_p_p", "Parrot_concat_p_p_p", @@ -9989,7 +10118,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 801 */ + { /* 810 */ "repeat", "repeat_s_s_i", "Parrot_repeat_s_s_i", @@ -10000,7 +10129,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 802 */ + { /* 811 */ "repeat", "repeat_s_sc_i", "Parrot_repeat_s_sc_i", @@ -10011,7 +10140,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 803 */ + { /* 812 */ "repeat", "repeat_s_s_ic", "Parrot_repeat_s_s_ic", @@ -10022,7 +10151,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 804 */ + { /* 813 */ "repeat", "repeat_s_sc_ic", "Parrot_repeat_s_sc_ic", @@ -10033,7 +10162,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 805 */ + { /* 814 */ "repeat", "repeat_p_p_i", "Parrot_repeat_p_p_i", @@ -10044,7 +10173,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 806 */ + { /* 815 */ "repeat", "repeat_p_p_ic", "Parrot_repeat_p_p_ic", @@ -10055,7 +10184,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 807 */ + { /* 816 */ "repeat", "repeat_p_p_p", "Parrot_repeat_p_p_p", @@ -10066,7 +10195,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 808 */ + { /* 817 */ "repeat", "repeat_p_i", "Parrot_repeat_p_i", @@ -10077,7 +10206,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 809 */ + { /* 818 */ "repeat", "repeat_p_ic", "Parrot_repeat_p_ic", @@ -10088,7 +10217,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 810 */ + { /* 819 */ "repeat", "repeat_p_p", "Parrot_repeat_p_p", @@ -10099,7 +10228,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 811 */ + { /* 820 */ "length", "length_i_s", "Parrot_length_i_s", @@ -10110,7 +10239,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 812 */ + { /* 821 */ "length", "length_i_sc", "Parrot_length_i_sc", @@ -10121,7 +10250,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 813 */ + { /* 822 */ "bytelength", "bytelength_i_s", "Parrot_bytelength_i_s", @@ -10132,7 +10261,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 814 */ + { /* 823 */ "bytelength", "bytelength_i_sc", "Parrot_bytelength_i_sc", @@ -10143,7 +10272,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 815 */ + { /* 824 */ "pin", "pin_s", "Parrot_pin_s", @@ -10154,7 +10283,7 @@ static op_info_t core_op_info_table[1092] = { { 0 }, &core_op_lib }, - { /* 816 */ + { /* 825 */ "unpin", "unpin_s", "Parrot_unpin_s", @@ -10165,7 +10294,7 @@ static op_info_t core_op_info_table[1092] = { { 0 }, &core_op_lib }, - { /* 817 */ + { /* 826 */ "substr", "substr_s_s_i", "Parrot_substr_s_s_i", @@ -10176,7 +10305,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 818 */ + { /* 827 */ "substr", "substr_s_sc_i", "Parrot_substr_s_sc_i", @@ -10187,7 +10316,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 819 */ + { /* 828 */ "substr", "substr_s_s_ic", "Parrot_substr_s_s_ic", @@ -10198,7 +10327,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 820 */ + { /* 829 */ "substr", "substr_s_sc_ic", "Parrot_substr_s_sc_ic", @@ -10209,7 +10338,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 821 */ + { /* 830 */ "substr", "substr_s_s_i_i", "Parrot_substr_s_s_i_i", @@ -10220,7 +10349,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0, 0 }, &core_op_lib }, - { /* 822 */ + { /* 831 */ "substr", "substr_s_sc_i_i", "Parrot_substr_s_sc_i_i", @@ -10231,7 +10360,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0, 0 }, &core_op_lib }, - { /* 823 */ + { /* 832 */ "substr", "substr_s_s_ic_i", "Parrot_substr_s_s_ic_i", @@ -10242,7 +10371,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0, 0 }, &core_op_lib }, - { /* 824 */ + { /* 833 */ "substr", "substr_s_sc_ic_i", "Parrot_substr_s_sc_ic_i", @@ -10253,7 +10382,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0, 0 }, &core_op_lib }, - { /* 825 */ + { /* 834 */ "substr", "substr_s_s_i_ic", "Parrot_substr_s_s_i_ic", @@ -10264,7 +10393,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0, 0 }, &core_op_lib }, - { /* 826 */ + { /* 835 */ "substr", "substr_s_sc_i_ic", "Parrot_substr_s_sc_i_ic", @@ -10275,7 +10404,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0, 0 }, &core_op_lib }, - { /* 827 */ + { /* 836 */ "substr", "substr_s_s_ic_ic", "Parrot_substr_s_s_ic_ic", @@ -10286,7 +10415,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0, 0 }, &core_op_lib }, - { /* 828 */ + { /* 837 */ "substr", "substr_s_sc_ic_ic", "Parrot_substr_s_sc_ic_ic", @@ -10297,7 +10426,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0, 0 }, &core_op_lib }, - { /* 829 */ + { /* 838 */ "substr", "substr_s_p_i_i", "Parrot_substr_s_p_i_i", @@ -10308,7 +10437,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0, 0 }, &core_op_lib }, - { /* 830 */ + { /* 839 */ "substr", "substr_s_p_ic_i", "Parrot_substr_s_p_ic_i", @@ -10319,7 +10448,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0, 0 }, &core_op_lib }, - { /* 831 */ + { /* 840 */ "substr", "substr_s_p_i_ic", "Parrot_substr_s_p_i_ic", @@ -10330,7 +10459,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0, 0 }, &core_op_lib }, - { /* 832 */ + { /* 841 */ "substr", "substr_s_p_ic_ic", "Parrot_substr_s_p_ic_ic", @@ -10341,7 +10470,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0, 0 }, &core_op_lib }, - { /* 833 */ + { /* 842 */ "replace", "replace_s_s_i_i_s", "Parrot_replace_s_s_i_i_s", @@ -10352,7 +10481,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0, 0, 0 }, &core_op_lib }, - { /* 834 */ + { /* 843 */ "replace", "replace_s_sc_i_i_s", "Parrot_replace_s_sc_i_i_s", @@ -10363,7 +10492,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0, 0, 0 }, &core_op_lib }, - { /* 835 */ + { /* 844 */ "replace", "replace_s_s_ic_i_s", "Parrot_replace_s_s_ic_i_s", @@ -10374,7 +10503,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0, 0, 0 }, &core_op_lib }, - { /* 836 */ + { /* 845 */ "replace", "replace_s_sc_ic_i_s", "Parrot_replace_s_sc_ic_i_s", @@ -10385,7 +10514,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0, 0, 0 }, &core_op_lib }, - { /* 837 */ + { /* 846 */ "replace", "replace_s_s_i_ic_s", "Parrot_replace_s_s_i_ic_s", @@ -10396,7 +10525,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0, 0, 0 }, &core_op_lib }, - { /* 838 */ + { /* 847 */ "replace", "replace_s_sc_i_ic_s", "Parrot_replace_s_sc_i_ic_s", @@ -10407,7 +10536,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0, 0, 0 }, &core_op_lib }, - { /* 839 */ + { /* 848 */ "replace", "replace_s_s_ic_ic_s", "Parrot_replace_s_s_ic_ic_s", @@ -10418,7 +10547,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0, 0, 0 }, &core_op_lib }, - { /* 840 */ + { /* 849 */ "replace", "replace_s_sc_ic_ic_s", "Parrot_replace_s_sc_ic_ic_s", @@ -10429,7 +10558,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0, 0, 0 }, &core_op_lib }, - { /* 841 */ + { /* 850 */ "replace", "replace_s_s_i_i_sc", "Parrot_replace_s_s_i_i_sc", @@ -10440,7 +10569,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0, 0, 0 }, &core_op_lib }, - { /* 842 */ + { /* 851 */ "replace", "replace_s_sc_i_i_sc", "Parrot_replace_s_sc_i_i_sc", @@ -10451,7 +10580,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0, 0, 0 }, &core_op_lib }, - { /* 843 */ + { /* 852 */ "replace", "replace_s_s_ic_i_sc", "Parrot_replace_s_s_ic_i_sc", @@ -10462,7 +10591,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0, 0, 0 }, &core_op_lib }, - { /* 844 */ + { /* 853 */ "replace", "replace_s_sc_ic_i_sc", "Parrot_replace_s_sc_ic_i_sc", @@ -10473,7 +10602,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0, 0, 0 }, &core_op_lib }, - { /* 845 */ + { /* 854 */ "replace", "replace_s_s_i_ic_sc", "Parrot_replace_s_s_i_ic_sc", @@ -10484,7 +10613,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0, 0, 0 }, &core_op_lib }, - { /* 846 */ + { /* 855 */ "replace", "replace_s_sc_i_ic_sc", "Parrot_replace_s_sc_i_ic_sc", @@ -10495,7 +10624,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0, 0, 0 }, &core_op_lib }, - { /* 847 */ + { /* 856 */ "replace", "replace_s_s_ic_ic_sc", "Parrot_replace_s_s_ic_ic_sc", @@ -10506,7 +10635,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0, 0, 0 }, &core_op_lib }, - { /* 848 */ + { /* 857 */ "replace", "replace_s_sc_ic_ic_sc", "Parrot_replace_s_sc_ic_ic_sc", @@ -10517,7 +10646,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0, 0, 0 }, &core_op_lib }, - { /* 849 */ + { /* 858 */ "index", "index_i_s_s", "Parrot_index_i_s_s", @@ -10528,7 +10657,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 850 */ + { /* 859 */ "index", "index_i_sc_s", "Parrot_index_i_sc_s", @@ -10539,7 +10668,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 851 */ + { /* 860 */ "index", "index_i_s_sc", "Parrot_index_i_s_sc", @@ -10550,7 +10679,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 852 */ + { /* 861 */ "index", "index_i_sc_sc", "Parrot_index_i_sc_sc", @@ -10561,7 +10690,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 853 */ + { /* 862 */ "index", "index_i_s_s_i", "Parrot_index_i_s_s_i", @@ -10572,7 +10701,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0, 0 }, &core_op_lib }, - { /* 854 */ + { /* 863 */ "index", "index_i_sc_s_i", "Parrot_index_i_sc_s_i", @@ -10583,7 +10712,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0, 0 }, &core_op_lib }, - { /* 855 */ + { /* 864 */ "index", "index_i_s_sc_i", "Parrot_index_i_s_sc_i", @@ -10594,7 +10723,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0, 0 }, &core_op_lib }, - { /* 856 */ + { /* 865 */ "index", "index_i_sc_sc_i", "Parrot_index_i_sc_sc_i", @@ -10605,7 +10734,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0, 0 }, &core_op_lib }, - { /* 857 */ + { /* 866 */ "index", "index_i_s_s_ic", "Parrot_index_i_s_s_ic", @@ -10616,7 +10745,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0, 0 }, &core_op_lib }, - { /* 858 */ + { /* 867 */ "index", "index_i_sc_s_ic", "Parrot_index_i_sc_s_ic", @@ -10627,7 +10756,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0, 0 }, &core_op_lib }, - { /* 859 */ + { /* 868 */ "index", "index_i_s_sc_ic", "Parrot_index_i_s_sc_ic", @@ -10638,7 +10767,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0, 0 }, &core_op_lib }, - { /* 860 */ + { /* 869 */ "index", "index_i_sc_sc_ic", "Parrot_index_i_sc_sc_ic", @@ -10649,7 +10778,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0, 0 }, &core_op_lib }, - { /* 861 */ + { /* 870 */ "sprintf", "sprintf_s_s_p", "Parrot_sprintf_s_s_p", @@ -10660,7 +10789,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 862 */ + { /* 871 */ "sprintf", "sprintf_s_sc_p", "Parrot_sprintf_s_sc_p", @@ -10671,7 +10800,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 863 */ + { /* 872 */ "sprintf", "sprintf_p_p_p", "Parrot_sprintf_p_p_p", @@ -10682,7 +10811,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 864 */ + { /* 873 */ "new", "new_s", "Parrot_new_s", @@ -10693,29 +10822,7 @@ static op_info_t core_op_info_table[1092] = { { 0 }, &core_op_lib }, - { /* 865 */ - "new", - "new_s_i", - "Parrot_new_s_i", - 0, - 3, - { PARROT_ARG_S, PARROT_ARG_I }, - { PARROT_ARGDIR_OUT, PARROT_ARGDIR_IN }, - { 0, 0 }, - &core_op_lib - }, - { /* 866 */ - "new", - "new_s_ic", - "Parrot_new_s_ic", - 0, - 3, - { PARROT_ARG_S, PARROT_ARG_IC }, - { PARROT_ARGDIR_OUT, PARROT_ARGDIR_IN }, - { 0, 0 }, - &core_op_lib - }, - { /* 867 */ + { /* 874 */ "stringinfo", "stringinfo_i_s_i", "Parrot_stringinfo_i_s_i", @@ -10726,7 +10833,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 868 */ + { /* 875 */ "stringinfo", "stringinfo_i_sc_i", "Parrot_stringinfo_i_sc_i", @@ -10737,7 +10844,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 869 */ + { /* 876 */ "stringinfo", "stringinfo_i_s_ic", "Parrot_stringinfo_i_s_ic", @@ -10748,7 +10855,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 870 */ + { /* 877 */ "stringinfo", "stringinfo_i_sc_ic", "Parrot_stringinfo_i_sc_ic", @@ -10759,7 +10866,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 871 */ + { /* 878 */ "upcase", "upcase_s_s", "Parrot_upcase_s_s", @@ -10770,7 +10877,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 872 */ + { /* 879 */ "upcase", "upcase_s_sc", "Parrot_upcase_s_sc", @@ -10781,7 +10888,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 873 */ + { /* 880 */ "downcase", "downcase_s_s", "Parrot_downcase_s_s", @@ -10792,7 +10899,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 874 */ + { /* 881 */ "downcase", "downcase_s_sc", "Parrot_downcase_s_sc", @@ -10803,7 +10910,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 875 */ + { /* 882 */ "titlecase", "titlecase_s_s", "Parrot_titlecase_s_s", @@ -10814,7 +10921,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 876 */ + { /* 883 */ "titlecase", "titlecase_s_sc", "Parrot_titlecase_s_sc", @@ -10825,7 +10932,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 877 */ + { /* 884 */ "join", "join_s_s_p", "Parrot_join_s_s_p", @@ -10836,7 +10943,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 878 */ + { /* 885 */ "join", "join_s_sc_p", "Parrot_join_s_sc_p", @@ -10847,7 +10954,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 879 */ + { /* 886 */ "split", "split_p_s_s", "Parrot_split_p_s_s", @@ -10858,7 +10965,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 880 */ + { /* 887 */ "split", "split_p_sc_s", "Parrot_split_p_sc_s", @@ -10869,7 +10976,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 881 */ + { /* 888 */ "split", "split_p_s_sc", "Parrot_split_p_s_sc", @@ -10880,7 +10987,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 882 */ + { /* 889 */ "split", "split_p_sc_sc", "Parrot_split_p_sc_sc", @@ -10891,7 +10998,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 883 */ + { /* 890 */ "encoding", "encoding_i_s", "Parrot_encoding_i_s", @@ -10902,7 +11009,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 884 */ + { /* 891 */ "encoding", "encoding_i_sc", "Parrot_encoding_i_sc", @@ -10913,7 +11020,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 885 */ + { /* 892 */ "encodingname", "encodingname_s_i", "Parrot_encodingname_s_i", @@ -10924,7 +11031,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 886 */ + { /* 893 */ "encodingname", "encodingname_s_ic", "Parrot_encodingname_s_ic", @@ -10935,7 +11042,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 887 */ + { /* 894 */ "find_encoding", "find_encoding_i_s", "Parrot_find_encoding_i_s", @@ -10946,7 +11053,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 888 */ + { /* 895 */ "find_encoding", "find_encoding_i_sc", "Parrot_find_encoding_i_sc", @@ -10957,7 +11064,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 889 */ + { /* 896 */ "trans_encoding", "trans_encoding_s_s_i", "Parrot_trans_encoding_s_s_i", @@ -10968,7 +11075,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 890 */ + { /* 897 */ "trans_encoding", "trans_encoding_s_sc_i", "Parrot_trans_encoding_s_sc_i", @@ -10979,7 +11086,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 891 */ + { /* 898 */ "trans_encoding", "trans_encoding_s_s_ic", "Parrot_trans_encoding_s_s_ic", @@ -10990,7 +11097,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 892 */ + { /* 899 */ "trans_encoding", "trans_encoding_s_sc_ic", "Parrot_trans_encoding_s_sc_ic", @@ -11001,7 +11108,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 893 */ + { /* 900 */ "is_cclass", "is_cclass_i_i_s_i", "Parrot_is_cclass_i_i_s_i", @@ -11012,7 +11119,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0, 0 }, &core_op_lib }, - { /* 894 */ + { /* 901 */ "is_cclass", "is_cclass_i_ic_s_i", "Parrot_is_cclass_i_ic_s_i", @@ -11023,7 +11130,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0, 0 }, &core_op_lib }, - { /* 895 */ + { /* 902 */ "is_cclass", "is_cclass_i_i_sc_i", "Parrot_is_cclass_i_i_sc_i", @@ -11034,7 +11141,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0, 0 }, &core_op_lib }, - { /* 896 */ + { /* 903 */ "is_cclass", "is_cclass_i_ic_sc_i", "Parrot_is_cclass_i_ic_sc_i", @@ -11045,7 +11152,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0, 0 }, &core_op_lib }, - { /* 897 */ + { /* 904 */ "is_cclass", "is_cclass_i_i_s_ic", "Parrot_is_cclass_i_i_s_ic", @@ -11056,7 +11163,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0, 0 }, &core_op_lib }, - { /* 898 */ + { /* 905 */ "is_cclass", "is_cclass_i_ic_s_ic", "Parrot_is_cclass_i_ic_s_ic", @@ -11067,7 +11174,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0, 0 }, &core_op_lib }, - { /* 899 */ + { /* 906 */ "is_cclass", "is_cclass_i_i_sc_ic", "Parrot_is_cclass_i_i_sc_ic", @@ -11078,7 +11185,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0, 0 }, &core_op_lib }, - { /* 900 */ + { /* 907 */ "is_cclass", "is_cclass_i_ic_sc_ic", "Parrot_is_cclass_i_ic_sc_ic", @@ -11089,7 +11196,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0, 0 }, &core_op_lib }, - { /* 901 */ + { /* 908 */ "find_cclass", "find_cclass_i_i_s_i_i", "Parrot_find_cclass_i_i_s_i_i", @@ -11100,7 +11207,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0, 0, 0 }, &core_op_lib }, - { /* 902 */ + { /* 909 */ "find_cclass", "find_cclass_i_ic_s_i_i", "Parrot_find_cclass_i_ic_s_i_i", @@ -11111,7 +11218,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0, 0, 0 }, &core_op_lib }, - { /* 903 */ + { /* 910 */ "find_cclass", "find_cclass_i_i_sc_i_i", "Parrot_find_cclass_i_i_sc_i_i", @@ -11122,7 +11229,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0, 0, 0 }, &core_op_lib }, - { /* 904 */ + { /* 911 */ "find_cclass", "find_cclass_i_ic_sc_i_i", "Parrot_find_cclass_i_ic_sc_i_i", @@ -11133,7 +11240,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0, 0, 0 }, &core_op_lib }, - { /* 905 */ + { /* 912 */ "find_cclass", "find_cclass_i_i_s_ic_i", "Parrot_find_cclass_i_i_s_ic_i", @@ -11144,7 +11251,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0, 0, 0 }, &core_op_lib }, - { /* 906 */ + { /* 913 */ "find_cclass", "find_cclass_i_ic_s_ic_i", "Parrot_find_cclass_i_ic_s_ic_i", @@ -11155,7 +11262,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0, 0, 0 }, &core_op_lib }, - { /* 907 */ + { /* 914 */ "find_cclass", "find_cclass_i_i_sc_ic_i", "Parrot_find_cclass_i_i_sc_ic_i", @@ -11166,7 +11273,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0, 0, 0 }, &core_op_lib }, - { /* 908 */ + { /* 915 */ "find_cclass", "find_cclass_i_ic_sc_ic_i", "Parrot_find_cclass_i_ic_sc_ic_i", @@ -11177,7 +11284,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0, 0, 0 }, &core_op_lib }, - { /* 909 */ + { /* 916 */ "find_cclass", "find_cclass_i_i_s_i_ic", "Parrot_find_cclass_i_i_s_i_ic", @@ -11188,7 +11295,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0, 0, 0 }, &core_op_lib }, - { /* 910 */ + { /* 917 */ "find_cclass", "find_cclass_i_ic_s_i_ic", "Parrot_find_cclass_i_ic_s_i_ic", @@ -11199,7 +11306,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0, 0, 0 }, &core_op_lib }, - { /* 911 */ + { /* 918 */ "find_cclass", "find_cclass_i_i_sc_i_ic", "Parrot_find_cclass_i_i_sc_i_ic", @@ -11210,7 +11317,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0, 0, 0 }, &core_op_lib }, - { /* 912 */ + { /* 919 */ "find_cclass", "find_cclass_i_ic_sc_i_ic", "Parrot_find_cclass_i_ic_sc_i_ic", @@ -11221,7 +11328,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0, 0, 0 }, &core_op_lib }, - { /* 913 */ + { /* 920 */ "find_cclass", "find_cclass_i_i_s_ic_ic", "Parrot_find_cclass_i_i_s_ic_ic", @@ -11232,7 +11339,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0, 0, 0 }, &core_op_lib }, - { /* 914 */ + { /* 921 */ "find_cclass", "find_cclass_i_ic_s_ic_ic", "Parrot_find_cclass_i_ic_s_ic_ic", @@ -11243,7 +11350,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0, 0, 0 }, &core_op_lib }, - { /* 915 */ + { /* 922 */ "find_cclass", "find_cclass_i_i_sc_ic_ic", "Parrot_find_cclass_i_i_sc_ic_ic", @@ -11254,7 +11361,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0, 0, 0 }, &core_op_lib }, - { /* 916 */ + { /* 923 */ "find_cclass", "find_cclass_i_ic_sc_ic_ic", "Parrot_find_cclass_i_ic_sc_ic_ic", @@ -11265,7 +11372,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0, 0, 0 }, &core_op_lib }, - { /* 917 */ + { /* 924 */ "find_not_cclass", "find_not_cclass_i_i_s_i_i", "Parrot_find_not_cclass_i_i_s_i_i", @@ -11276,7 +11383,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0, 0, 0 }, &core_op_lib }, - { /* 918 */ + { /* 925 */ "find_not_cclass", "find_not_cclass_i_ic_s_i_i", "Parrot_find_not_cclass_i_ic_s_i_i", @@ -11287,7 +11394,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0, 0, 0 }, &core_op_lib }, - { /* 919 */ + { /* 926 */ "find_not_cclass", "find_not_cclass_i_i_sc_i_i", "Parrot_find_not_cclass_i_i_sc_i_i", @@ -11298,7 +11405,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0, 0, 0 }, &core_op_lib }, - { /* 920 */ + { /* 927 */ "find_not_cclass", "find_not_cclass_i_ic_sc_i_i", "Parrot_find_not_cclass_i_ic_sc_i_i", @@ -11309,7 +11416,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0, 0, 0 }, &core_op_lib }, - { /* 921 */ + { /* 928 */ "find_not_cclass", "find_not_cclass_i_i_s_ic_i", "Parrot_find_not_cclass_i_i_s_ic_i", @@ -11320,7 +11427,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0, 0, 0 }, &core_op_lib }, - { /* 922 */ + { /* 929 */ "find_not_cclass", "find_not_cclass_i_ic_s_ic_i", "Parrot_find_not_cclass_i_ic_s_ic_i", @@ -11331,7 +11438,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0, 0, 0 }, &core_op_lib }, - { /* 923 */ + { /* 930 */ "find_not_cclass", "find_not_cclass_i_i_sc_ic_i", "Parrot_find_not_cclass_i_i_sc_ic_i", @@ -11342,7 +11449,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0, 0, 0 }, &core_op_lib }, - { /* 924 */ + { /* 931 */ "find_not_cclass", "find_not_cclass_i_ic_sc_ic_i", "Parrot_find_not_cclass_i_ic_sc_ic_i", @@ -11353,7 +11460,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0, 0, 0 }, &core_op_lib }, - { /* 925 */ + { /* 932 */ "find_not_cclass", "find_not_cclass_i_i_s_i_ic", "Parrot_find_not_cclass_i_i_s_i_ic", @@ -11364,7 +11471,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0, 0, 0 }, &core_op_lib }, - { /* 926 */ + { /* 933 */ "find_not_cclass", "find_not_cclass_i_ic_s_i_ic", "Parrot_find_not_cclass_i_ic_s_i_ic", @@ -11375,7 +11482,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0, 0, 0 }, &core_op_lib }, - { /* 927 */ + { /* 934 */ "find_not_cclass", "find_not_cclass_i_i_sc_i_ic", "Parrot_find_not_cclass_i_i_sc_i_ic", @@ -11386,7 +11493,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0, 0, 0 }, &core_op_lib }, - { /* 928 */ + { /* 935 */ "find_not_cclass", "find_not_cclass_i_ic_sc_i_ic", "Parrot_find_not_cclass_i_ic_sc_i_ic", @@ -11397,7 +11504,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0, 0, 0 }, &core_op_lib }, - { /* 929 */ + { /* 936 */ "find_not_cclass", "find_not_cclass_i_i_s_ic_ic", "Parrot_find_not_cclass_i_i_s_ic_ic", @@ -11408,7 +11515,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0, 0, 0 }, &core_op_lib }, - { /* 930 */ + { /* 937 */ "find_not_cclass", "find_not_cclass_i_ic_s_ic_ic", "Parrot_find_not_cclass_i_ic_s_ic_ic", @@ -11419,7 +11526,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0, 0, 0 }, &core_op_lib }, - { /* 931 */ + { /* 938 */ "find_not_cclass", "find_not_cclass_i_i_sc_ic_ic", "Parrot_find_not_cclass_i_i_sc_ic_ic", @@ -11430,7 +11537,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0, 0, 0 }, &core_op_lib }, - { /* 932 */ + { /* 939 */ "find_not_cclass", "find_not_cclass_i_ic_sc_ic_ic", "Parrot_find_not_cclass_i_ic_sc_ic_ic", @@ -11441,7 +11548,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0, 0, 0 }, &core_op_lib }, - { /* 933 */ + { /* 940 */ "escape", "escape_s_s", "Parrot_escape_s_s", @@ -11452,7 +11559,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 934 */ + { /* 941 */ "compose", "compose_s_s", "Parrot_compose_s_s", @@ -11463,7 +11570,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 935 */ + { /* 942 */ "compose", "compose_s_sc", "Parrot_compose_s_sc", @@ -11474,7 +11581,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 936 */ + { /* 943 */ "find_codepoint", "find_codepoint_i_s", "Parrot_find_codepoint_i_s", @@ -11485,7 +11592,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 937 */ + { /* 944 */ "find_codepoint", "find_codepoint_i_sc", "Parrot_find_codepoint_i_sc", @@ -11496,7 +11603,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 938 */ + { /* 945 */ "spawnw", "spawnw_i_s", "Parrot_spawnw_i_s", @@ -11507,7 +11614,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 939 */ + { /* 946 */ "spawnw", "spawnw_i_sc", "Parrot_spawnw_i_sc", @@ -11518,7 +11625,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 940 */ + { /* 947 */ "spawnw", "spawnw_i_p", "Parrot_spawnw_i_p", @@ -11529,7 +11636,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 941 */ + { /* 948 */ "err", "err_i", "Parrot_err_i", @@ -11540,7 +11647,7 @@ static op_info_t core_op_info_table[1092] = { { 0 }, &core_op_lib }, - { /* 942 */ + { /* 949 */ "err", "err_s", "Parrot_err_s", @@ -11551,7 +11658,7 @@ static op_info_t core_op_info_table[1092] = { { 0 }, &core_op_lib }, - { /* 943 */ + { /* 950 */ "err", "err_s_i", "Parrot_err_s_i", @@ -11562,7 +11669,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 944 */ + { /* 951 */ "err", "err_s_ic", "Parrot_err_s_ic", @@ -11573,7 +11680,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 945 */ + { /* 952 */ "time", "time_i", "Parrot_time_i", @@ -11584,7 +11691,7 @@ static op_info_t core_op_info_table[1092] = { { 0 }, &core_op_lib }, - { /* 946 */ + { /* 953 */ "time", "time_n", "Parrot_time_n", @@ -11595,7 +11702,7 @@ static op_info_t core_op_info_table[1092] = { { 0 }, &core_op_lib }, - { /* 947 */ + { /* 954 */ "sleep", "sleep_i", "Parrot_sleep_i", @@ -11606,7 +11713,7 @@ static op_info_t core_op_info_table[1092] = { { 0 }, &core_op_lib }, - { /* 948 */ + { /* 955 */ "sleep", "sleep_ic", "Parrot_sleep_ic", @@ -11617,7 +11724,7 @@ static op_info_t core_op_info_table[1092] = { { 0 }, &core_op_lib }, - { /* 949 */ + { /* 956 */ "sleep", "sleep_n", "Parrot_sleep_n", @@ -11628,7 +11735,7 @@ static op_info_t core_op_info_table[1092] = { { 0 }, &core_op_lib }, - { /* 950 */ + { /* 957 */ "sleep", "sleep_nc", "Parrot_sleep_nc", @@ -11639,7 +11746,7 @@ static op_info_t core_op_info_table[1092] = { { 0 }, &core_op_lib }, - { /* 951 */ + { /* 958 */ "store_lex", "store_lex_s_p", "Parrot_store_lex_s_p", @@ -11650,7 +11757,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 952 */ + { /* 959 */ "store_lex", "store_lex_sc_p", "Parrot_store_lex_sc_p", @@ -11661,7 +11768,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 953 */ + { /* 960 */ "store_lex", "store_lex_s_s", "Parrot_store_lex_s_s", @@ -11672,7 +11779,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 954 */ + { /* 961 */ "store_lex", "store_lex_sc_s", "Parrot_store_lex_sc_s", @@ -11683,7 +11790,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 955 */ + { /* 962 */ "store_lex", "store_lex_s_sc", "Parrot_store_lex_s_sc", @@ -11694,7 +11801,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 956 */ + { /* 963 */ "store_lex", "store_lex_sc_sc", "Parrot_store_lex_sc_sc", @@ -11705,7 +11812,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 957 */ + { /* 964 */ "store_lex", "store_lex_s_i", "Parrot_store_lex_s_i", @@ -11716,7 +11823,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 958 */ + { /* 965 */ "store_lex", "store_lex_sc_i", "Parrot_store_lex_sc_i", @@ -11727,7 +11834,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 959 */ + { /* 966 */ "store_lex", "store_lex_s_ic", "Parrot_store_lex_s_ic", @@ -11738,7 +11845,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 960 */ + { /* 967 */ "store_lex", "store_lex_sc_ic", "Parrot_store_lex_sc_ic", @@ -11749,7 +11856,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 961 */ + { /* 968 */ "store_lex", "store_lex_s_n", "Parrot_store_lex_s_n", @@ -11760,7 +11867,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 962 */ + { /* 969 */ "store_lex", "store_lex_sc_n", "Parrot_store_lex_sc_n", @@ -11771,7 +11878,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 963 */ + { /* 970 */ "store_lex", "store_lex_s_nc", "Parrot_store_lex_s_nc", @@ -11782,7 +11889,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 964 */ + { /* 971 */ "store_lex", "store_lex_sc_nc", "Parrot_store_lex_sc_nc", @@ -11793,7 +11900,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 965 */ + { /* 972 */ "store_dynamic_lex", "store_dynamic_lex_s_p", "Parrot_store_dynamic_lex_s_p", @@ -11804,7 +11911,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 966 */ + { /* 973 */ "store_dynamic_lex", "store_dynamic_lex_sc_p", "Parrot_store_dynamic_lex_sc_p", @@ -11815,7 +11922,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 967 */ + { /* 974 */ "find_lex", "find_lex_p_s", "Parrot_find_lex_p_s", @@ -11826,7 +11933,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 968 */ + { /* 975 */ "find_lex", "find_lex_p_sc", "Parrot_find_lex_p_sc", @@ -11837,7 +11944,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 969 */ + { /* 976 */ "find_lex", "find_lex_s_s", "Parrot_find_lex_s_s", @@ -11848,7 +11955,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 970 */ + { /* 977 */ "find_lex", "find_lex_s_sc", "Parrot_find_lex_s_sc", @@ -11859,7 +11966,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 971 */ + { /* 978 */ "find_lex", "find_lex_i_s", "Parrot_find_lex_i_s", @@ -11870,7 +11977,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 972 */ + { /* 979 */ "find_lex", "find_lex_i_sc", "Parrot_find_lex_i_sc", @@ -11881,7 +11988,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 973 */ + { /* 980 */ "find_lex", "find_lex_n_s", "Parrot_find_lex_n_s", @@ -11892,7 +11999,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 974 */ + { /* 981 */ "find_lex", "find_lex_n_sc", "Parrot_find_lex_n_sc", @@ -11903,7 +12010,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 975 */ + { /* 982 */ "find_dynamic_lex", "find_dynamic_lex_p_s", "Parrot_find_dynamic_lex_p_s", @@ -11914,7 +12021,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 976 */ + { /* 983 */ "find_dynamic_lex", "find_dynamic_lex_p_sc", "Parrot_find_dynamic_lex_p_sc", @@ -11925,7 +12032,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 977 */ + { /* 984 */ "find_caller_lex", "find_caller_lex_p_s", "Parrot_find_caller_lex_p_s", @@ -11936,7 +12043,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 978 */ + { /* 985 */ "find_caller_lex", "find_caller_lex_p_sc", "Parrot_find_caller_lex_p_sc", @@ -11947,7 +12054,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 979 */ + { /* 986 */ "get_namespace", "get_namespace_p", "Parrot_get_namespace_p", @@ -11958,7 +12065,7 @@ static op_info_t core_op_info_table[1092] = { { 0 }, &core_op_lib }, - { /* 980 */ + { /* 987 */ "get_namespace", "get_namespace_p_p", "Parrot_get_namespace_p_p", @@ -11969,7 +12076,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 981 */ + { /* 988 */ "get_namespace", "get_namespace_p_pc", "Parrot_get_namespace_p_pc", @@ -11980,7 +12087,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 982 */ + { /* 989 */ "get_hll_namespace", "get_hll_namespace_p", "Parrot_get_hll_namespace_p", @@ -11991,7 +12098,7 @@ static op_info_t core_op_info_table[1092] = { { 0 }, &core_op_lib }, - { /* 983 */ + { /* 990 */ "get_hll_namespace", "get_hll_namespace_p_p", "Parrot_get_hll_namespace_p_p", @@ -12002,7 +12109,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 984 */ + { /* 991 */ "get_hll_namespace", "get_hll_namespace_p_pc", "Parrot_get_hll_namespace_p_pc", @@ -12013,7 +12120,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 985 */ + { /* 992 */ "get_root_namespace", "get_root_namespace_p", "Parrot_get_root_namespace_p", @@ -12024,7 +12131,7 @@ static op_info_t core_op_info_table[1092] = { { 0 }, &core_op_lib }, - { /* 986 */ + { /* 993 */ "get_root_namespace", "get_root_namespace_p_p", "Parrot_get_root_namespace_p_p", @@ -12035,7 +12142,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 987 */ + { /* 994 */ "get_root_namespace", "get_root_namespace_p_pc", "Parrot_get_root_namespace_p_pc", @@ -12046,7 +12153,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 988 */ + { /* 995 */ "get_global", "get_global_p_s", "Parrot_get_global_p_s", @@ -12057,7 +12164,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 989 */ + { /* 996 */ "get_global", "get_global_p_sc", "Parrot_get_global_p_sc", @@ -12068,7 +12175,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 990 */ + { /* 997 */ "get_global", "get_global_p_p_s", "Parrot_get_global_p_p_s", @@ -12079,7 +12186,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 991 */ + { /* 998 */ "get_global", "get_global_p_pc_s", "Parrot_get_global_p_pc_s", @@ -12090,7 +12197,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 992 */ + { /* 999 */ "get_global", "get_global_p_p_sc", "Parrot_get_global_p_p_sc", @@ -12101,7 +12208,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 993 */ + { /* 1000 */ "get_global", "get_global_p_pc_sc", "Parrot_get_global_p_pc_sc", @@ -12112,7 +12219,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 994 */ + { /* 1001 */ "get_hll_global", "get_hll_global_p_s", "Parrot_get_hll_global_p_s", @@ -12123,7 +12230,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 995 */ + { /* 1002 */ "get_hll_global", "get_hll_global_p_sc", "Parrot_get_hll_global_p_sc", @@ -12134,7 +12241,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 996 */ + { /* 1003 */ "get_hll_global", "get_hll_global_p_p_s", "Parrot_get_hll_global_p_p_s", @@ -12145,7 +12252,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 997 */ + { /* 1004 */ "get_hll_global", "get_hll_global_p_pc_s", "Parrot_get_hll_global_p_pc_s", @@ -12156,7 +12263,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 998 */ + { /* 1005 */ "get_hll_global", "get_hll_global_p_p_sc", "Parrot_get_hll_global_p_p_sc", @@ -12167,7 +12274,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 999 */ + { /* 1006 */ "get_hll_global", "get_hll_global_p_pc_sc", "Parrot_get_hll_global_p_pc_sc", @@ -12178,7 +12285,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 1000 */ + { /* 1007 */ "get_root_global", "get_root_global_p_s", "Parrot_get_root_global_p_s", @@ -12189,7 +12296,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 1001 */ + { /* 1008 */ "get_root_global", "get_root_global_p_sc", "Parrot_get_root_global_p_sc", @@ -12200,7 +12307,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 1002 */ + { /* 1009 */ "get_root_global", "get_root_global_p_p_s", "Parrot_get_root_global_p_p_s", @@ -12211,7 +12318,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 1003 */ + { /* 1010 */ "get_root_global", "get_root_global_p_pc_s", "Parrot_get_root_global_p_pc_s", @@ -12222,7 +12329,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 1004 */ + { /* 1011 */ "get_root_global", "get_root_global_p_p_sc", "Parrot_get_root_global_p_p_sc", @@ -12233,7 +12340,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 1005 */ + { /* 1012 */ "get_root_global", "get_root_global_p_pc_sc", "Parrot_get_root_global_p_pc_sc", @@ -12244,7 +12351,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 1006 */ + { /* 1013 */ "set_global", "set_global_s_p", "Parrot_set_global_s_p", @@ -12255,7 +12362,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 1007 */ + { /* 1014 */ "set_global", "set_global_sc_p", "Parrot_set_global_sc_p", @@ -12266,7 +12373,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 1008 */ + { /* 1015 */ "set_global", "set_global_p_s_p", "Parrot_set_global_p_s_p", @@ -12277,7 +12384,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 1009 */ + { /* 1016 */ "set_global", "set_global_pc_s_p", "Parrot_set_global_pc_s_p", @@ -12288,7 +12395,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 1010 */ + { /* 1017 */ "set_global", "set_global_p_sc_p", "Parrot_set_global_p_sc_p", @@ -12299,7 +12406,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 1011 */ + { /* 1018 */ "set_global", "set_global_pc_sc_p", "Parrot_set_global_pc_sc_p", @@ -12310,7 +12417,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 1012 */ + { /* 1019 */ "set_hll_global", "set_hll_global_s_p", "Parrot_set_hll_global_s_p", @@ -12321,7 +12428,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 1013 */ + { /* 1020 */ "set_hll_global", "set_hll_global_sc_p", "Parrot_set_hll_global_sc_p", @@ -12332,7 +12439,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 1014 */ + { /* 1021 */ "set_hll_global", "set_hll_global_p_s_p", "Parrot_set_hll_global_p_s_p", @@ -12343,7 +12450,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 1015 */ + { /* 1022 */ "set_hll_global", "set_hll_global_pc_s_p", "Parrot_set_hll_global_pc_s_p", @@ -12354,7 +12461,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 1016 */ + { /* 1023 */ "set_hll_global", "set_hll_global_p_sc_p", "Parrot_set_hll_global_p_sc_p", @@ -12365,7 +12472,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 1017 */ + { /* 1024 */ "set_hll_global", "set_hll_global_pc_sc_p", "Parrot_set_hll_global_pc_sc_p", @@ -12376,7 +12483,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 1018 */ + { /* 1025 */ "set_root_global", "set_root_global_s_p", "Parrot_set_root_global_s_p", @@ -12387,7 +12494,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 1019 */ + { /* 1026 */ "set_root_global", "set_root_global_sc_p", "Parrot_set_root_global_sc_p", @@ -12398,7 +12505,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 1020 */ + { /* 1027 */ "set_root_global", "set_root_global_p_s_p", "Parrot_set_root_global_p_s_p", @@ -12409,7 +12516,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 1021 */ + { /* 1028 */ "set_root_global", "set_root_global_pc_s_p", "Parrot_set_root_global_pc_s_p", @@ -12420,7 +12527,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 1022 */ + { /* 1029 */ "set_root_global", "set_root_global_p_sc_p", "Parrot_set_root_global_p_sc_p", @@ -12431,7 +12538,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 1023 */ + { /* 1030 */ "set_root_global", "set_root_global_pc_sc_p", "Parrot_set_root_global_pc_sc_p", @@ -12442,7 +12549,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 1024 */ + { /* 1031 */ "find_name", "find_name_p_s", "Parrot_find_name_p_s", @@ -12453,7 +12560,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 1025 */ + { /* 1032 */ "find_name", "find_name_p_sc", "Parrot_find_name_p_sc", @@ -12464,7 +12571,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 1026 */ + { /* 1033 */ "find_sub_not_null", "find_sub_not_null_p_s", "Parrot_find_sub_not_null_p_s", @@ -12475,7 +12582,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 1027 */ + { /* 1034 */ "find_sub_not_null", "find_sub_not_null_p_sc", "Parrot_find_sub_not_null_p_sc", @@ -12486,7 +12593,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 1028 */ + { /* 1035 */ "trap", "trap", "Parrot_trap", @@ -12497,7 +12604,7 @@ static op_info_t core_op_info_table[1092] = { { 0 }, &core_op_lib }, - { /* 1029 */ + { /* 1036 */ "set_label", "set_label_p_ic", "Parrot_set_label_p_ic", @@ -12508,7 +12615,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 1 }, &core_op_lib }, - { /* 1030 */ + { /* 1037 */ "get_label", "get_label_i_p", "Parrot_get_label_i_p", @@ -12519,7 +12626,29 @@ static op_info_t core_op_info_table[1092] = { { 0, 0 }, &core_op_lib }, - { /* 1031 */ + { /* 1038 */ + "get_id", + "get_id_i_p", + "Parrot_get_id_i_p", + 0, + 3, + { PARROT_ARG_I, PARROT_ARG_P }, + { PARROT_ARGDIR_OUT, PARROT_ARGDIR_IN }, + { 0, 0 }, + &core_op_lib + }, + { /* 1039 */ + "get_id", + "get_id_i_pc", + "Parrot_get_id_i_pc", + 0, + 3, + { PARROT_ARG_I, PARROT_ARG_PC }, + { PARROT_ARGDIR_OUT, PARROT_ARGDIR_IN }, + { 0, 0 }, + &core_op_lib + }, + { /* 1040 */ "fetch", "fetch_p_p_p_p", "Parrot_fetch_p_p_p_p", @@ -12530,7 +12659,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0, 0 }, &core_op_lib }, - { /* 1032 */ + { /* 1041 */ "fetch", "fetch_p_pc_p_p", "Parrot_fetch_p_pc_p_p", @@ -12541,7 +12670,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0, 0 }, &core_op_lib }, - { /* 1033 */ + { /* 1042 */ "fetch", "fetch_p_p_pc_p", "Parrot_fetch_p_p_pc_p", @@ -12552,7 +12681,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0, 0 }, &core_op_lib }, - { /* 1034 */ + { /* 1043 */ "fetch", "fetch_p_pc_pc_p", "Parrot_fetch_p_pc_pc_p", @@ -12563,7 +12692,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0, 0 }, &core_op_lib }, - { /* 1035 */ + { /* 1044 */ "fetch", "fetch_p_p_p_pc", "Parrot_fetch_p_p_p_pc", @@ -12574,7 +12703,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0, 0 }, &core_op_lib }, - { /* 1036 */ + { /* 1045 */ "fetch", "fetch_p_pc_p_pc", "Parrot_fetch_p_pc_p_pc", @@ -12585,7 +12714,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0, 0 }, &core_op_lib }, - { /* 1037 */ + { /* 1046 */ "fetch", "fetch_p_p_pc_pc", "Parrot_fetch_p_p_pc_pc", @@ -12596,7 +12725,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0, 0 }, &core_op_lib }, - { /* 1038 */ + { /* 1047 */ "fetch", "fetch_p_pc_pc_pc", "Parrot_fetch_p_pc_pc_pc", @@ -12607,7 +12736,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0, 0 }, &core_op_lib }, - { /* 1039 */ + { /* 1048 */ "fetch", "fetch_p_p_i_p", "Parrot_fetch_p_p_i_p", @@ -12618,7 +12747,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0, 0 }, &core_op_lib }, - { /* 1040 */ + { /* 1049 */ "fetch", "fetch_p_pc_i_p", "Parrot_fetch_p_pc_i_p", @@ -12629,7 +12758,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0, 0 }, &core_op_lib }, - { /* 1041 */ + { /* 1050 */ "fetch", "fetch_p_p_ic_p", "Parrot_fetch_p_p_ic_p", @@ -12640,7 +12769,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0, 0 }, &core_op_lib }, - { /* 1042 */ + { /* 1051 */ "fetch", "fetch_p_pc_ic_p", "Parrot_fetch_p_pc_ic_p", @@ -12651,7 +12780,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0, 0 }, &core_op_lib }, - { /* 1043 */ + { /* 1052 */ "fetch", "fetch_p_p_i_pc", "Parrot_fetch_p_p_i_pc", @@ -12662,7 +12791,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0, 0 }, &core_op_lib }, - { /* 1044 */ + { /* 1053 */ "fetch", "fetch_p_pc_i_pc", "Parrot_fetch_p_pc_i_pc", @@ -12673,7 +12802,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0, 0 }, &core_op_lib }, - { /* 1045 */ + { /* 1054 */ "fetch", "fetch_p_p_ic_pc", "Parrot_fetch_p_p_ic_pc", @@ -12684,7 +12813,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0, 0 }, &core_op_lib }, - { /* 1046 */ + { /* 1055 */ "fetch", "fetch_p_pc_ic_pc", "Parrot_fetch_p_pc_ic_pc", @@ -12695,7 +12824,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0, 0 }, &core_op_lib }, - { /* 1047 */ + { /* 1056 */ "fetch", "fetch_p_p_s_p", "Parrot_fetch_p_p_s_p", @@ -12706,7 +12835,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0, 0 }, &core_op_lib }, - { /* 1048 */ + { /* 1057 */ "fetch", "fetch_p_pc_s_p", "Parrot_fetch_p_pc_s_p", @@ -12717,7 +12846,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0, 0 }, &core_op_lib }, - { /* 1049 */ + { /* 1058 */ "fetch", "fetch_p_p_sc_p", "Parrot_fetch_p_p_sc_p", @@ -12728,7 +12857,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0, 0 }, &core_op_lib }, - { /* 1050 */ + { /* 1059 */ "fetch", "fetch_p_pc_sc_p", "Parrot_fetch_p_pc_sc_p", @@ -12739,7 +12868,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0, 0 }, &core_op_lib }, - { /* 1051 */ + { /* 1060 */ "fetch", "fetch_p_p_s_pc", "Parrot_fetch_p_p_s_pc", @@ -12750,7 +12879,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0, 0 }, &core_op_lib }, - { /* 1052 */ + { /* 1061 */ "fetch", "fetch_p_pc_s_pc", "Parrot_fetch_p_pc_s_pc", @@ -12761,7 +12890,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0, 0 }, &core_op_lib }, - { /* 1053 */ + { /* 1062 */ "fetch", "fetch_p_p_sc_pc", "Parrot_fetch_p_p_sc_pc", @@ -12772,7 +12901,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0, 0 }, &core_op_lib }, - { /* 1054 */ + { /* 1063 */ "fetch", "fetch_p_pc_sc_pc", "Parrot_fetch_p_pc_sc_pc", @@ -12783,7 +12912,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0, 0 }, &core_op_lib }, - { /* 1055 */ + { /* 1064 */ "vivify", "vivify_p_p_p_p", "Parrot_vivify_p_p_p_p", @@ -12794,7 +12923,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0, 0 }, &core_op_lib }, - { /* 1056 */ + { /* 1065 */ "vivify", "vivify_p_pc_p_p", "Parrot_vivify_p_pc_p_p", @@ -12805,7 +12934,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0, 0 }, &core_op_lib }, - { /* 1057 */ + { /* 1066 */ "vivify", "vivify_p_p_pc_p", "Parrot_vivify_p_p_pc_p", @@ -12816,7 +12945,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0, 0 }, &core_op_lib }, - { /* 1058 */ + { /* 1067 */ "vivify", "vivify_p_pc_pc_p", "Parrot_vivify_p_pc_pc_p", @@ -12827,7 +12956,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0, 0 }, &core_op_lib }, - { /* 1059 */ + { /* 1068 */ "vivify", "vivify_p_p_p_pc", "Parrot_vivify_p_p_p_pc", @@ -12838,7 +12967,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0, 0 }, &core_op_lib }, - { /* 1060 */ + { /* 1069 */ "vivify", "vivify_p_pc_p_pc", "Parrot_vivify_p_pc_p_pc", @@ -12849,7 +12978,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0, 0 }, &core_op_lib }, - { /* 1061 */ + { /* 1070 */ "vivify", "vivify_p_p_pc_pc", "Parrot_vivify_p_p_pc_pc", @@ -12860,7 +12989,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0, 0 }, &core_op_lib }, - { /* 1062 */ + { /* 1071 */ "vivify", "vivify_p_pc_pc_pc", "Parrot_vivify_p_pc_pc_pc", @@ -12871,7 +13000,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0, 0 }, &core_op_lib }, - { /* 1063 */ + { /* 1072 */ "vivify", "vivify_p_p_i_p", "Parrot_vivify_p_p_i_p", @@ -12882,7 +13011,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0, 0 }, &core_op_lib }, - { /* 1064 */ + { /* 1073 */ "vivify", "vivify_p_pc_i_p", "Parrot_vivify_p_pc_i_p", @@ -12893,7 +13022,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0, 0 }, &core_op_lib }, - { /* 1065 */ + { /* 1074 */ "vivify", "vivify_p_p_ic_p", "Parrot_vivify_p_p_ic_p", @@ -12904,7 +13033,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0, 0 }, &core_op_lib }, - { /* 1066 */ + { /* 1075 */ "vivify", "vivify_p_pc_ic_p", "Parrot_vivify_p_pc_ic_p", @@ -12915,7 +13044,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0, 0 }, &core_op_lib }, - { /* 1067 */ + { /* 1076 */ "vivify", "vivify_p_p_i_pc", "Parrot_vivify_p_p_i_pc", @@ -12926,7 +13055,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0, 0 }, &core_op_lib }, - { /* 1068 */ + { /* 1077 */ "vivify", "vivify_p_pc_i_pc", "Parrot_vivify_p_pc_i_pc", @@ -12937,7 +13066,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0, 0 }, &core_op_lib }, - { /* 1069 */ + { /* 1078 */ "vivify", "vivify_p_p_ic_pc", "Parrot_vivify_p_p_ic_pc", @@ -12948,7 +13077,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0, 0 }, &core_op_lib }, - { /* 1070 */ + { /* 1079 */ "vivify", "vivify_p_pc_ic_pc", "Parrot_vivify_p_pc_ic_pc", @@ -12959,7 +13088,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0, 0 }, &core_op_lib }, - { /* 1071 */ + { /* 1080 */ "vivify", "vivify_p_p_s_p", "Parrot_vivify_p_p_s_p", @@ -12970,7 +13099,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0, 0 }, &core_op_lib }, - { /* 1072 */ + { /* 1081 */ "vivify", "vivify_p_pc_s_p", "Parrot_vivify_p_pc_s_p", @@ -12981,7 +13110,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0, 0 }, &core_op_lib }, - { /* 1073 */ + { /* 1082 */ "vivify", "vivify_p_p_sc_p", "Parrot_vivify_p_p_sc_p", @@ -12992,7 +13121,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0, 0 }, &core_op_lib }, - { /* 1074 */ + { /* 1083 */ "vivify", "vivify_p_pc_sc_p", "Parrot_vivify_p_pc_sc_p", @@ -13003,7 +13132,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0, 0 }, &core_op_lib }, - { /* 1075 */ + { /* 1084 */ "vivify", "vivify_p_p_s_pc", "Parrot_vivify_p_p_s_pc", @@ -13014,7 +13143,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0, 0 }, &core_op_lib }, - { /* 1076 */ + { /* 1085 */ "vivify", "vivify_p_pc_s_pc", "Parrot_vivify_p_pc_s_pc", @@ -13025,7 +13154,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0, 0 }, &core_op_lib }, - { /* 1077 */ + { /* 1086 */ "vivify", "vivify_p_p_sc_pc", "Parrot_vivify_p_p_sc_pc", @@ -13036,7 +13165,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0, 0 }, &core_op_lib }, - { /* 1078 */ + { /* 1087 */ "vivify", "vivify_p_pc_sc_pc", "Parrot_vivify_p_pc_sc_pc", @@ -13047,7 +13176,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0, 0 }, &core_op_lib }, - { /* 1079 */ + { /* 1088 */ "new", "new_p_s_i", "Parrot_new_p_s_i", @@ -13058,7 +13187,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 1080 */ + { /* 1089 */ "new", "new_p_sc_i", "Parrot_new_p_sc_i", @@ -13069,7 +13198,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 1081 */ + { /* 1090 */ "new", "new_p_s_ic", "Parrot_new_p_s_ic", @@ -13080,7 +13209,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 1082 */ + { /* 1091 */ "new", "new_p_sc_ic", "Parrot_new_p_sc_ic", @@ -13091,7 +13220,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 1083 */ + { /* 1092 */ "new", "new_p_p_i", "Parrot_new_p_p_i", @@ -13102,7 +13231,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 1084 */ + { /* 1093 */ "new", "new_p_pc_i", "Parrot_new_p_pc_i", @@ -13113,7 +13242,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 1085 */ + { /* 1094 */ "new", "new_p_p_ic", "Parrot_new_p_p_ic", @@ -13124,7 +13253,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 1086 */ + { /* 1095 */ "new", "new_p_pc_ic", "Parrot_new_p_pc_ic", @@ -13135,7 +13264,7 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 1087 */ + { /* 1096 */ "root_new", "root_new_p_p_i", "Parrot_root_new_p_p_i", @@ -13146,21 +13275,131 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 1088 */ - "root_new", - "root_new_p_pc_i", - "Parrot_root_new_p_pc_i", + { /* 1097 */ + "root_new", + "root_new_p_pc_i", + "Parrot_root_new_p_pc_i", + 0, + 4, + { PARROT_ARG_P, PARROT_ARG_PC, PARROT_ARG_I }, + { PARROT_ARGDIR_OUT, PARROT_ARGDIR_IN, PARROT_ARGDIR_IN }, + { 0, 0, 0 }, + &core_op_lib + }, + { /* 1098 */ + "root_new", + "root_new_p_p_ic", + "Parrot_root_new_p_p_ic", + 0, + 4, + { PARROT_ARG_P, PARROT_ARG_P, PARROT_ARG_IC }, + { PARROT_ARGDIR_OUT, PARROT_ARGDIR_IN, PARROT_ARGDIR_IN }, + { 0, 0, 0 }, + &core_op_lib + }, + { /* 1099 */ + "root_new", + "root_new_p_pc_ic", + "Parrot_root_new_p_pc_ic", + 0, + 4, + { PARROT_ARG_P, PARROT_ARG_PC, PARROT_ARG_IC }, + { PARROT_ARGDIR_OUT, PARROT_ARGDIR_IN, PARROT_ARGDIR_IN }, + { 0, 0, 0 }, + &core_op_lib + }, + { /* 1100 */ + "get_context", + "get_context_p", + "Parrot_get_context_p", + 0, + 2, + { PARROT_ARG_P }, + { PARROT_ARGDIR_OUT }, + { 0 }, + &core_op_lib + }, + { /* 1101 */ + "new_call_context", + "new_call_context_p", + "Parrot_new_call_context_p", + 0, + 2, + { PARROT_ARG_P }, + { PARROT_ARGDIR_OUT }, + { 0 }, + &core_op_lib + }, + { /* 1102 */ + "invokecc", + "invokecc_p_p", + "Parrot_invokecc_p_p", + 0, + 3, + { PARROT_ARG_P, PARROT_ARG_P }, + { PARROT_ARGDIR_IN, PARROT_ARGDIR_IN }, + { 0, 0 }, + &core_op_lib + }, + { /* 1103 */ + "flatten_array_into", + "flatten_array_into_p_p_i", + "Parrot_flatten_array_into_p_p_i", + 0, + 4, + { PARROT_ARG_P, PARROT_ARG_P, PARROT_ARG_I }, + { PARROT_ARGDIR_IN, PARROT_ARGDIR_IN, PARROT_ARGDIR_IN }, + { 0, 0, 0 }, + &core_op_lib + }, + { /* 1104 */ + "flatten_array_into", + "flatten_array_into_p_p_ic", + "Parrot_flatten_array_into_p_p_ic", + 0, + 4, + { PARROT_ARG_P, PARROT_ARG_P, PARROT_ARG_IC }, + { PARROT_ARGDIR_IN, PARROT_ARGDIR_IN, PARROT_ARGDIR_IN }, + { 0, 0, 0 }, + &core_op_lib + }, + { /* 1105 */ + "flatten_hash_into", + "flatten_hash_into_p_p_i", + "Parrot_flatten_hash_into_p_p_i", + 0, + 4, + { PARROT_ARG_P, PARROT_ARG_P, PARROT_ARG_I }, + { PARROT_ARGDIR_IN, PARROT_ARGDIR_IN, PARROT_ARGDIR_IN }, + { 0, 0, 0 }, + &core_op_lib + }, + { /* 1106 */ + "flatten_hash_into", + "flatten_hash_into_p_p_ic", + "Parrot_flatten_hash_into_p_p_ic", + 0, + 4, + { PARROT_ARG_P, PARROT_ARG_P, PARROT_ARG_IC }, + { PARROT_ARGDIR_IN, PARROT_ARGDIR_IN, PARROT_ARGDIR_IN }, + { 0, 0, 0 }, + &core_op_lib + }, + { /* 1107 */ + "slurp_array_from", + "slurp_array_from_p_p_i", + "Parrot_slurp_array_from_p_p_i", 0, 4, - { PARROT_ARG_P, PARROT_ARG_PC, PARROT_ARG_I }, + { PARROT_ARG_P, PARROT_ARG_P, PARROT_ARG_I }, { PARROT_ARGDIR_OUT, PARROT_ARGDIR_IN, PARROT_ARGDIR_IN }, { 0, 0, 0 }, &core_op_lib }, - { /* 1089 */ - "root_new", - "root_new_p_p_ic", - "Parrot_root_new_p_p_ic", + { /* 1108 */ + "slurp_array_from", + "slurp_array_from_p_p_ic", + "Parrot_slurp_array_from_p_p_ic", 0, 4, { PARROT_ARG_P, PARROT_ARG_P, PARROT_ARG_IC }, @@ -13168,15 +13407,48 @@ static op_info_t core_op_info_table[1092] = { { 0, 0, 0 }, &core_op_lib }, - { /* 1090 */ - "root_new", - "root_new_p_pc_ic", - "Parrot_root_new_p_pc_ic", + { /* 1109 */ + "receive", + "receive_p", + "Parrot_receive_p", 0, - 4, - { PARROT_ARG_P, PARROT_ARG_PC, PARROT_ARG_IC }, - { PARROT_ARGDIR_OUT, PARROT_ARGDIR_IN, PARROT_ARGDIR_IN }, - { 0, 0, 0 }, + 2, + { PARROT_ARG_P }, + { PARROT_ARGDIR_OUT }, + { 0 }, + &core_op_lib + }, + { /* 1110 */ + "wait", + "wait_p", + "Parrot_wait_p", + 0, + 2, + { PARROT_ARG_P }, + { PARROT_ARGDIR_IN }, + { 0 }, + &core_op_lib + }, + { /* 1111 */ + "wait", + "wait_pc", + "Parrot_wait_pc", + 0, + 2, + { PARROT_ARG_PC }, + { PARROT_ARGDIR_IN }, + { 0 }, + &core_op_lib + }, + { /* 1112 */ + "pass", + "pass", + "Parrot_pass", + 0, + 1, + { (arg_type_t) 0 }, + { (arg_dir_t) 0 }, + { 0 }, &core_op_lib }, @@ -13194,72 +13466,83 @@ Parrot_end(opcode_t *cur_opcode, PARROT_INTERP) { opcode_t * Parrot_noop(opcode_t *cur_opcode, PARROT_INTERP) { - return (opcode_t *)cur_opcode + 1; + UNUSED(interp); + UNUSED(CUR_OPCODE); + return cur_opcode + 1; } opcode_t * Parrot_check_events(opcode_t *cur_opcode, PARROT_INTERP) { - opcode_t * const next = cur_opcode + 1; + opcode_t * next = cur_opcode + 1; - Parrot_cx_check_tasks(interp, interp->scheduler); + next = Parrot_cx_check_scheduler(interp, next); return (opcode_t *)next; } opcode_t * Parrot_check_events__(opcode_t *cur_opcode, PARROT_INTERP) { opcode_t * const _this = CUR_OPCODE; + opcode_t * const handler = Parrot_ex_throw_from_op_args(interp, _this, EXCEPTION_INVALID_OPERATION, "check_events__ opcode doesn't do anything useful."); - disable_event_checking(interp); - Parrot_cx_handle_tasks(interp, interp->scheduler); + return (opcode_t *)handler; + Parrot_runcore_disable_event_checking(interp); return (opcode_t *)_this; } opcode_t * Parrot_load_bytecode_s(opcode_t *cur_opcode, PARROT_INTERP) { Parrot_load_bytecode(interp, SREG(1)); - return (opcode_t *)cur_opcode + 2; + return cur_opcode + 2; } opcode_t * Parrot_load_bytecode_sc(opcode_t *cur_opcode, PARROT_INTERP) { Parrot_load_bytecode(interp, SCONST(1)); - return (opcode_t *)cur_opcode + 2; + return cur_opcode + 2; } opcode_t * Parrot_load_bytecode_p_s(opcode_t *cur_opcode, PARROT_INTERP) { PREG(1) = Parrot_pf_load_bytecode_search(interp, SREG(2)); PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp)); - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * Parrot_load_bytecode_p_sc(opcode_t *cur_opcode, PARROT_INTERP) { PREG(1) = Parrot_pf_load_bytecode_search(interp, SCONST(2)); PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp)); - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * Parrot_load_language_s(opcode_t *cur_opcode, PARROT_INTERP) { Parrot_load_language(interp, SREG(1)); - return (opcode_t *)cur_opcode + 2; + return cur_opcode + 2; } opcode_t * Parrot_load_language_sc(opcode_t *cur_opcode, PARROT_INTERP) { Parrot_load_language(interp, SCONST(1)); - return (opcode_t *)cur_opcode + 2; + return cur_opcode + 2; } opcode_t * Parrot_branch_i(opcode_t *cur_opcode, PARROT_INTERP) { - return (opcode_t *)cur_opcode + IREG(1); + if ((Parrot_cx_check_scheduler(interp, (cur_opcode + IREG(1))) == 0)) { + return (opcode_t *)0; + } + + return cur_opcode + IREG(1); } opcode_t * Parrot_branch_ic(opcode_t *cur_opcode, PARROT_INTERP) { - return (opcode_t *)cur_opcode + ICONST(1); + if ((Parrot_cx_check_scheduler(interp, (cur_opcode + ICONST(1))) == 0)) { + return (opcode_t *)0; + } + + return cur_opcode + ICONST(1); } opcode_t * @@ -13275,7 +13558,7 @@ Parrot_local_branch_p_i(opcode_t *cur_opcode, PARROT_INTERP) { (return_addr) = PTR2INTVAL(dest); VTABLE_push_integer(interp, PREG(1), (return_addr)); - return (opcode_t *)cur_opcode + IREG(2); + return cur_opcode + IREG(2); } opcode_t * @@ -13291,7 +13574,7 @@ Parrot_local_branch_p_ic(opcode_t *cur_opcode, PARROT_INTERP) { (return_addr) = PTR2INTVAL(dest); VTABLE_push_integer(interp, PREG(1), (return_addr)); - return (opcode_t *)cur_opcode + ICONST(2); + return cur_opcode + ICONST(2); } opcode_t * @@ -13334,73 +13617,73 @@ Parrot_jump_ic(opcode_t *cur_opcode, PARROT_INTERP) { opcode_t * Parrot_if_i_ic(opcode_t *cur_opcode, PARROT_INTERP) { if ((IREG(1) != 0)) { - return (opcode_t *)cur_opcode + ICONST(2); + return cur_opcode + ICONST(2); } - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * Parrot_if_n_ic(opcode_t *cur_opcode, PARROT_INTERP) { if ((!FLOAT_IS_ZERO(NREG(1)))) { - return (opcode_t *)cur_opcode + ICONST(2); + return cur_opcode + ICONST(2); } - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * Parrot_if_s_ic(opcode_t *cur_opcode, PARROT_INTERP) { if (Parrot_str_boolean(interp, SREG(1))) { - return (opcode_t *)cur_opcode + ICONST(2); + return cur_opcode + ICONST(2); } - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * Parrot_if_p_ic(opcode_t *cur_opcode, PARROT_INTERP) { if (VTABLE_get_bool(interp, PREG(1))) { - return (opcode_t *)cur_opcode + ICONST(2); + return cur_opcode + ICONST(2); } - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * Parrot_unless_i_ic(opcode_t *cur_opcode, PARROT_INTERP) { if ((IREG(1) == 0)) { - return (opcode_t *)cur_opcode + ICONST(2); + return cur_opcode + ICONST(2); } - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * Parrot_unless_n_ic(opcode_t *cur_opcode, PARROT_INTERP) { if (FLOAT_IS_ZERO(NREG(1))) { - return (opcode_t *)cur_opcode + ICONST(2); + return cur_opcode + ICONST(2); } - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * Parrot_unless_s_ic(opcode_t *cur_opcode, PARROT_INTERP) { if ((!Parrot_str_boolean(interp, SREG(1)))) { - return (opcode_t *)cur_opcode + ICONST(2); + return cur_opcode + ICONST(2); } - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * Parrot_unless_p_ic(opcode_t *cur_opcode, PARROT_INTERP) { if ((!VTABLE_get_bool(interp, PREG(1)))) { - return (opcode_t *)cur_opcode + ICONST(2); + return cur_opcode + ICONST(2); } - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * @@ -13410,11 +13693,8 @@ Parrot_invokecc_p(opcode_t *cur_opcode, PARROT_INTERP) { PMC * const signature = Parrot_pcc_get_signature(interp, CURRENT_CONTEXT(interp)); Parrot_pcc_set_pc(interp, CURRENT_CONTEXT(interp), dest); - if ((!PMC_IS_NULL(signature))) { - Parrot_pcc_set_object(interp, signature, NULL); - } - interp->current_cont = NEED_CONTINUATION; + Parrot_pcc_reuse_continuation(interp, CURRENT_CONTEXT(interp), dest); dest = VTABLE_invoke(interp, p, dest); return (opcode_t *)dest; } @@ -13426,9 +13706,6 @@ Parrot_invoke_p_p(opcode_t *cur_opcode, PARROT_INTERP) { PMC * const signature = Parrot_pcc_get_signature(interp, CURRENT_CONTEXT(interp)); Parrot_pcc_set_pc(interp, CURRENT_CONTEXT(interp), dest); - if ((!PMC_IS_NULL(signature))) { - Parrot_pcc_set_object(interp, signature, NULL); - } interp->current_cont = PREG(2); dest = VTABLE_invoke(interp, p, dest); @@ -13472,14 +13749,14 @@ Parrot_returncc(opcode_t *cur_opcode, PARROT_INTERP) { opcode_t * Parrot_capture_lex_p(opcode_t *cur_opcode, PARROT_INTERP) { Parrot_sub_capture_lex(interp, PREG(1)); - return (opcode_t *)cur_opcode + 2; + return cur_opcode + 2; } opcode_t * Parrot_newclosure_p_p(opcode_t *cur_opcode, PARROT_INTERP) { PREG(1) = Parrot_sub_new_closure(interp, PREG(2)); PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp)); - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * @@ -13491,7 +13768,7 @@ Parrot_set_args_pc(opcode_t *cur_opcode, PARROT_INTERP) { GETATTR_FixedIntegerArray_size(interp, signature, argc); Parrot_pcc_set_signature(interp, CURRENT_CONTEXT(interp), call_sig); - return (opcode_t *)cur_opcode + (argc + 2); + return cur_opcode + (argc + 2); } opcode_t * @@ -13512,7 +13789,7 @@ Parrot_get_params_pc(opcode_t *cur_opcode, PARROT_INTERP) { } GETATTR_FixedIntegerArray_size(interp, signature, argc); - return (opcode_t *)cur_opcode + (argc + 2); + return cur_opcode + (argc + 2); } opcode_t * @@ -13524,7 +13801,7 @@ Parrot_set_returns_pc(opcode_t *cur_opcode, PARROT_INTERP) { Parrot_pcc_set_signature(interp, CURRENT_CONTEXT(interp), call_sig); GETATTR_FixedIntegerArray_size(interp, signature, argc); - return (opcode_t *)cur_opcode + (argc + 2); + return cur_opcode + (argc + 2); } opcode_t * @@ -13538,7 +13815,7 @@ Parrot_get_results_pc(opcode_t *cur_opcode, PARROT_INTERP) { Parrot_pcc_fill_params_from_op(interp, call_object, signature, raw_params, PARROT_ERRORS_RESULT_COUNT_FLAG); GETATTR_FixedIntegerArray_size(interp, signature, argc); Parrot_pcc_set_signature(interp, CURRENT_CONTEXT(interp), PMCNULL); - return (opcode_t *)cur_opcode + (argc + 2); + return cur_opcode + (argc + 2); } opcode_t * @@ -13546,7 +13823,7 @@ Parrot_set_result_info_p(opcode_t *cur_opcode, PARROT_INTERP) { PMC * const ctx = CURRENT_CONTEXT(interp); VTABLE_set_attr_str(interp, ctx, Parrot_str_new_constant(interp, "return_flags"), PREG(1)); - return (opcode_t *)cur_opcode + 2; + return cur_opcode + 2; } opcode_t * @@ -13554,7 +13831,7 @@ Parrot_set_result_info_pc(opcode_t *cur_opcode, PARROT_INTERP) { PMC * const ctx = CURRENT_CONTEXT(interp); VTABLE_set_attr_str(interp, ctx, Parrot_str_new_constant(interp, "return_flags"), PCONST(1)); - return (opcode_t *)cur_opcode + 2; + return cur_opcode + 2; } opcode_t * @@ -13570,25 +13847,25 @@ Parrot_result_info_p(opcode_t *cur_opcode, PARROT_INTERP) { } PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp)); - return (opcode_t *)cur_opcode + 2; + return cur_opcode + 2; } opcode_t * Parrot_set_addr_i_ic(opcode_t *cur_opcode, PARROT_INTERP) { IREG(1) = PTR2INTVAL((CUR_OPCODE + ICONST(2))); - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * Parrot_set_addr_p_ic(opcode_t *cur_opcode, PARROT_INTERP) { VTABLE_set_pointer(interp, PREG(1), ((CUR_OPCODE + ICONST(2)))); - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * Parrot_set_addr_p_i(opcode_t *cur_opcode, PARROT_INTERP) { VTABLE_set_pointer(interp, PREG(1), (void*)IREG(2)); - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * @@ -13596,19 +13873,19 @@ Parrot_get_addr_i_p(opcode_t *cur_opcode, PARROT_INTERP) { void * const ptr = VTABLE_get_pointer(interp, PREG(2)); IREG(1) = (INTVAL)ptr; - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * Parrot_schedule_p(opcode_t *cur_opcode, PARROT_INTERP) { Parrot_cx_schedule_task(interp, PREG(1)); - return (opcode_t *)cur_opcode + 2; + return cur_opcode + 2; } opcode_t * Parrot_addhandler_p(opcode_t *cur_opcode, PARROT_INTERP) { Parrot_cx_add_handler(interp, PREG(1)); - return (opcode_t *)cur_opcode + 2; + return cur_opcode + 2; } opcode_t * @@ -13617,19 +13894,19 @@ Parrot_push_eh_ic(opcode_t *cur_opcode, PARROT_INTERP) { VTABLE_set_pointer(interp, eh, (CUR_OPCODE + ICONST(1))); Parrot_cx_add_handler_local(interp, eh); - return (opcode_t *)cur_opcode + 2; + return cur_opcode + 2; } opcode_t * Parrot_push_eh_p(opcode_t *cur_opcode, PARROT_INTERP) { Parrot_cx_add_handler_local(interp, PREG(1)); - return (opcode_t *)cur_opcode + 2; + return cur_opcode + 2; } opcode_t * Parrot_pop_eh(opcode_t *cur_opcode, PARROT_INTERP) { - Parrot_cx_delete_handler_local(interp, Parrot_str_new_constant(interp, "exception")); - return (opcode_t *)cur_opcode + 1; + Parrot_cx_delete_handler_local(interp); + return cur_opcode + 1; } opcode_t * @@ -13637,7 +13914,7 @@ Parrot_throw_p(opcode_t *cur_opcode, PARROT_INTERP) { PMC * except = PREG(1); opcode_t * dest; opcode_t * const ret = cur_opcode + 2; - PMC * const resume = pmc_new(interp, enum_class_Continuation); + PMC * const resume = Parrot_pmc_new(interp, enum_class_Continuation); STRING * const exception_str = Parrot_str_new_constant(interp, "Exception"); VTABLE_set_pointer(interp, resume, ret); @@ -13684,16 +13961,16 @@ Parrot_rethrow_p(opcode_t *cur_opcode, PARROT_INTERP) { opcode_t * Parrot_count_eh_i(opcode_t *cur_opcode, PARROT_INTERP) { - IREG(1) = Parrot_cx_count_handlers_local(interp, Parrot_str_new_constant(interp, "exception")); - return (opcode_t *)cur_opcode + 2; + IREG(1) = Parrot_cx_count_handlers_local(interp); + return cur_opcode + 2; } opcode_t * Parrot_die_s(opcode_t *cur_opcode, PARROT_INTERP) { opcode_t * dest; opcode_t * const ret = cur_opcode + 2; - PMC * const resume = pmc_new(interp, enum_class_Continuation); - PMC * const exception = Parrot_ex_build_exception(interp, EXCEPT_error, CONTROL_ERROR, SREG(1)); + PMC * const resume = Parrot_pmc_new(interp, enum_class_Continuation); + PMC * const exception = Parrot_ex_build_exception(interp, EXCEPT_error, EXCEPTION_DIE, SREG(1)); VTABLE_set_pointer(interp, resume, ret); VTABLE_set_attr_str(interp, exception, Parrot_str_new_constant(interp, "resume"), resume); @@ -13705,8 +13982,8 @@ opcode_t * Parrot_die_sc(opcode_t *cur_opcode, PARROT_INTERP) { opcode_t * dest; opcode_t * const ret = cur_opcode + 2; - PMC * const resume = pmc_new(interp, enum_class_Continuation); - PMC * const exception = Parrot_ex_build_exception(interp, EXCEPT_error, CONTROL_ERROR, SCONST(1)); + PMC * const resume = Parrot_pmc_new(interp, enum_class_Continuation); + PMC * const exception = Parrot_ex_build_exception(interp, EXCEPT_error, EXCEPTION_DIE, SCONST(1)); VTABLE_set_pointer(interp, resume, ret); VTABLE_set_attr_str(interp, exception, Parrot_str_new_constant(interp, "resume"), resume); @@ -13718,9 +13995,9 @@ opcode_t * Parrot_die_p(opcode_t *cur_opcode, PARROT_INTERP) { opcode_t * dest; opcode_t * const ret = cur_opcode + 2; - PMC * const resume = pmc_new(interp, enum_class_Continuation); + PMC * const resume = Parrot_pmc_new(interp, enum_class_Continuation); STRING * const msg = PMC_IS_NULL(PREG(1)) ? NULL : VTABLE_get_string(interp, PREG(1)); - PMC * const exception = Parrot_ex_build_exception(interp, EXCEPT_error, CONTROL_ERROR, msg); + PMC * const exception = Parrot_ex_build_exception(interp, EXCEPT_error, EXCEPTION_DIE, msg); VTABLE_set_pointer(interp, resume, ret); VTABLE_set_attr_str(interp, exception, Parrot_str_new_constant(interp, "resume"), resume); @@ -13732,9 +14009,9 @@ opcode_t * Parrot_die_pc(opcode_t *cur_opcode, PARROT_INTERP) { opcode_t * dest; opcode_t * const ret = cur_opcode + 2; - PMC * const resume = pmc_new(interp, enum_class_Continuation); + PMC * const resume = Parrot_pmc_new(interp, enum_class_Continuation); STRING * const msg = PMC_IS_NULL(PCONST(1)) ? NULL : VTABLE_get_string(interp, PCONST(1)); - PMC * const exception = Parrot_ex_build_exception(interp, EXCEPT_error, CONTROL_ERROR, msg); + PMC * const exception = Parrot_ex_build_exception(interp, EXCEPT_error, EXCEPTION_DIE, msg); VTABLE_set_pointer(interp, resume, ret); VTABLE_set_attr_str(interp, exception, Parrot_str_new_constant(interp, "resume"), resume); @@ -13748,10 +14025,14 @@ Parrot_die_i_i(opcode_t *cur_opcode, PARROT_INTERP) { _exit(IREG(2)); } else { + opcode_t * dest; opcode_t * const ret = cur_opcode + 3; + PMC * const resume = Parrot_pmc_new(interp, enum_class_Continuation); PMC * const exception = Parrot_ex_build_exception(interp, IREG(1), IREG(2), NULL); - opcode_t * const dest = Parrot_ex_throw_from_op(interp, exception, ret); + VTABLE_set_pointer(interp, resume, ret); + VTABLE_set_attr_str(interp, exception, Parrot_str_new_constant(interp, "resume"), resume); + dest = Parrot_ex_throw_from_op(interp, exception, ret); return (opcode_t *)dest; } @@ -13763,10 +14044,14 @@ Parrot_die_ic_i(opcode_t *cur_opcode, PARROT_INTERP) { _exit(IREG(2)); } else { + opcode_t * dest; opcode_t * const ret = cur_opcode + 3; + PMC * const resume = Parrot_pmc_new(interp, enum_class_Continuation); PMC * const exception = Parrot_ex_build_exception(interp, ICONST(1), IREG(2), NULL); - opcode_t * const dest = Parrot_ex_throw_from_op(interp, exception, ret); + VTABLE_set_pointer(interp, resume, ret); + VTABLE_set_attr_str(interp, exception, Parrot_str_new_constant(interp, "resume"), resume); + dest = Parrot_ex_throw_from_op(interp, exception, ret); return (opcode_t *)dest; } @@ -13778,10 +14063,14 @@ Parrot_die_i_ic(opcode_t *cur_opcode, PARROT_INTERP) { _exit(ICONST(2)); } else { + opcode_t * dest; opcode_t * const ret = cur_opcode + 3; + PMC * const resume = Parrot_pmc_new(interp, enum_class_Continuation); PMC * const exception = Parrot_ex_build_exception(interp, IREG(1), ICONST(2), NULL); - opcode_t * const dest = Parrot_ex_throw_from_op(interp, exception, ret); + VTABLE_set_pointer(interp, resume, ret); + VTABLE_set_attr_str(interp, exception, Parrot_str_new_constant(interp, "resume"), resume); + dest = Parrot_ex_throw_from_op(interp, exception, ret); return (opcode_t *)dest; } @@ -13793,10 +14082,14 @@ Parrot_die_ic_ic(opcode_t *cur_opcode, PARROT_INTERP) { _exit(ICONST(2)); } else { + opcode_t * dest; opcode_t * const ret = cur_opcode + 3; + PMC * const resume = Parrot_pmc_new(interp, enum_class_Continuation); PMC * const exception = Parrot_ex_build_exception(interp, ICONST(1), ICONST(2), NULL); - opcode_t * const dest = Parrot_ex_throw_from_op(interp, exception, ret); + VTABLE_set_pointer(interp, resume, ret); + VTABLE_set_attr_str(interp, exception, Parrot_str_new_constant(interp, "resume"), resume); + dest = Parrot_ex_throw_from_op(interp, exception, ret); return (opcode_t *)dest; } @@ -13806,7 +14099,7 @@ opcode_t * Parrot_exit_i(opcode_t *cur_opcode, PARROT_INTERP) { opcode_t * dest; opcode_t * const ret = cur_opcode + 2; - PMC * const resume = pmc_new(interp, enum_class_Continuation); + PMC * const resume = Parrot_pmc_new(interp, enum_class_Continuation); PMC * const exception = Parrot_ex_build_exception(interp, EXCEPT_exit, CONTROL_EXIT, NULL); VTABLE_set_pointer(interp, resume, ret); @@ -13820,7 +14113,7 @@ opcode_t * Parrot_exit_ic(opcode_t *cur_opcode, PARROT_INTERP) { opcode_t * dest; opcode_t * const ret = cur_opcode + 2; - PMC * const resume = pmc_new(interp, enum_class_Continuation); + PMC * const resume = Parrot_pmc_new(interp, enum_class_Continuation); PMC * const exception = Parrot_ex_build_exception(interp, EXCEPT_exit, CONTROL_EXIT, NULL); VTABLE_set_pointer(interp, resume, ret); @@ -13833,31 +14126,19 @@ Parrot_exit_ic(opcode_t *cur_opcode, PARROT_INTERP) { opcode_t * Parrot_finalize_p(opcode_t *cur_opcode, PARROT_INTERP) { opcode_t * const dest = cur_opcode + 2; - PMC * eh = PMCNULL; - - if ((!PMC_IS_NULL(PREG(1)))) { - if (VTABLE_isa(interp, PREG(1), Parrot_str_new_constant(interp, "ExceptionHandler"))) { - eh = PREG(1); - } - else { - if (VTABLE_isa(interp, PREG(1), Parrot_str_new_constant(interp, "Exception"))) { - PMC * const iter = VTABLE_get_attr_str(interp, PREG(1), Parrot_str_new_constant(interp, "handler_iter")); - - if ((!PMC_IS_NULL(iter))) { - eh = VTABLE_get_pmc_keyed_int(interp, iter, (-1)); - } - - } - - } - - } + PMC * eh = Parrot_ex_get_current_handler(interp, PREG(1)); if ((!PMC_IS_NULL(eh))) { Parrot_runloop * rl = interp->current_runloop; INTVAL rid; - Parrot_pcc_invoke_method_from_c_args(interp, eh, Parrot_str_new_constant(interp, "rid"), "->I", (&rid)); + if ((eh->vtable->base_type == enum_class_ExceptionHandler)) { + GETATTR_ExceptionHandler_runloop_id(interp, eh, rid); + } + else { + Parrot_pcc_invoke_method_from_c_args(interp, eh, Parrot_str_new_constant(interp, "rid"), "->I", (&rid)); + } + while ((rl && (rl->id != rid))) { rl = rl->prev; } @@ -13865,7 +14146,7 @@ Parrot_finalize_p(opcode_t *cur_opcode, PARROT_INTERP) { if (rl) { if ((rl != interp->current_runloop)) { rl->handler_start = dest; - longjmp(rl->resume, 3); + longjmp(rl->resume, PARROT_JMP_EXCEPTION_FINALIZED); } } @@ -13875,37 +14156,25 @@ Parrot_finalize_p(opcode_t *cur_opcode, PARROT_INTERP) { } - return (opcode_t *)cur_opcode + 2; + return cur_opcode + 2; } opcode_t * Parrot_finalize_pc(opcode_t *cur_opcode, PARROT_INTERP) { opcode_t * const dest = cur_opcode + 2; - PMC * eh = PMCNULL; - - if ((!PMC_IS_NULL(PCONST(1)))) { - if (VTABLE_isa(interp, PCONST(1), Parrot_str_new_constant(interp, "ExceptionHandler"))) { - eh = PCONST(1); - } - else { - if (VTABLE_isa(interp, PCONST(1), Parrot_str_new_constant(interp, "Exception"))) { - PMC * const iter = VTABLE_get_attr_str(interp, PCONST(1), Parrot_str_new_constant(interp, "handler_iter")); - - if ((!PMC_IS_NULL(iter))) { - eh = VTABLE_get_pmc_keyed_int(interp, iter, (-1)); - } - - } - - } - - } + PMC * eh = Parrot_ex_get_current_handler(interp, PCONST(1)); if ((!PMC_IS_NULL(eh))) { Parrot_runloop * rl = interp->current_runloop; INTVAL rid; - Parrot_pcc_invoke_method_from_c_args(interp, eh, Parrot_str_new_constant(interp, "rid"), "->I", (&rid)); + if ((eh->vtable->base_type == enum_class_ExceptionHandler)) { + GETATTR_ExceptionHandler_runloop_id(interp, eh, rid); + } + else { + Parrot_pcc_invoke_method_from_c_args(interp, eh, Parrot_str_new_constant(interp, "rid"), "->I", (&rid)); + } + while ((rl && (rl->id != rid))) { rl = rl->prev; } @@ -13913,7 +14182,7 @@ Parrot_finalize_pc(opcode_t *cur_opcode, PARROT_INTERP) { if (rl) { if ((rl != interp->current_runloop)) { rl->handler_start = dest; - longjmp(rl->resume, 3); + longjmp(rl->resume, PARROT_JMP_EXCEPTION_FINALIZED); } } @@ -13923,7 +14192,39 @@ Parrot_finalize_pc(opcode_t *cur_opcode, PARROT_INTERP) { } - return (opcode_t *)cur_opcode + 2; + return cur_opcode + 2; +} + +opcode_t * +Parrot_pop_upto_eh_p(opcode_t *cur_opcode, PARROT_INTERP) { + PMC * eh = Parrot_ex_get_current_handler(interp, PREG(1)); + + if ((!PMC_IS_NULL(eh))) { + Parrot_cx_delete_upto_handler_local(interp, eh); + } + + return cur_opcode + 2; +} + +opcode_t * +Parrot_pop_upto_eh_pc(opcode_t *cur_opcode, PARROT_INTERP) { + PMC * eh = Parrot_ex_get_current_handler(interp, PCONST(1)); + + if ((!PMC_IS_NULL(eh))) { + Parrot_cx_delete_upto_handler_local(interp, eh); + } + + return cur_opcode + 2; +} + +opcode_t * +Parrot_peek_exception_p(opcode_t *cur_opcode, PARROT_INTERP) { + PMC * const ctx = CURRENT_CONTEXT(interp); + PMC * const call_object = Parrot_pcc_get_signature(interp, ctx); + + PREG(1) = VTABLE_get_pmc_keyed_int(interp, call_object, 0); + PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp)); + return cur_opcode + 2; } opcode_t * @@ -13957,7 +14258,7 @@ Parrot_debug_ic(opcode_t *cur_opcode, PARROT_INTERP) { opcode_t * Parrot_bounds_i(opcode_t *cur_opcode, PARROT_INTERP) { if ((IREG(1) != 0)) { - Parrot_set_flag(interp, PARROT_BOUNDS_FLAG); + Parrot_interp_set_flag(interp, PARROT_BOUNDS_FLAG); } else { Interp_flags_CLEAR(interp, PARROT_BOUNDS_FLAG); @@ -13971,7 +14272,7 @@ Parrot_bounds_i(opcode_t *cur_opcode, PARROT_INTERP) { opcode_t * Parrot_bounds_ic(opcode_t *cur_opcode, PARROT_INTERP) { if ((ICONST(1) != 0)) { - Parrot_set_flag(interp, PARROT_BOUNDS_FLAG); + Parrot_interp_set_flag(interp, PARROT_BOUNDS_FLAG); } else { Interp_flags_CLEAR(interp, PARROT_BOUNDS_FLAG); @@ -13985,7 +14286,7 @@ Parrot_bounds_ic(opcode_t *cur_opcode, PARROT_INTERP) { opcode_t * Parrot_profile_i(opcode_t *cur_opcode, PARROT_INTERP) { if ((IREG(1) != 0)) { - Parrot_set_flag(interp, PARROT_PROFILE_FLAG); + Parrot_interp_set_flag(interp, PARROT_PROFILE_FLAG); } else { Interp_flags_CLEAR(interp, PARROT_PROFILE_FLAG); @@ -13999,7 +14300,7 @@ Parrot_profile_i(opcode_t *cur_opcode, PARROT_INTERP) { opcode_t * Parrot_profile_ic(opcode_t *cur_opcode, PARROT_INTERP) { if ((ICONST(1) != 0)) { - Parrot_set_flag(interp, PARROT_PROFILE_FLAG); + Parrot_interp_set_flag(interp, PARROT_PROFILE_FLAG); } else { Interp_flags_CLEAR(interp, PARROT_PROFILE_FLAG); @@ -14013,10 +14314,10 @@ Parrot_profile_ic(opcode_t *cur_opcode, PARROT_INTERP) { opcode_t * Parrot_trace_i(opcode_t *cur_opcode, PARROT_INTERP) { if ((IREG(1) != 0)) { - Parrot_set_trace(interp, IREG(1)); + Parrot_interp_set_trace(interp, IREG(1)); } else { - Parrot_clear_trace(interp, PARROT_ALL_TRACE_FLAGS); + Parrot_interp_clear_trace(interp, PARROT_ALL_TRACE_FLAGS); } interp->resume_offset = REL_PC + 2; interp->resume_flag = 1;; @@ -14027,10 +14328,10 @@ Parrot_trace_i(opcode_t *cur_opcode, PARROT_INTERP) { opcode_t * Parrot_trace_ic(opcode_t *cur_opcode, PARROT_INTERP) { if ((ICONST(1) != 0)) { - Parrot_set_trace(interp, ICONST(1)); + Parrot_interp_set_trace(interp, ICONST(1)); } else { - Parrot_clear_trace(interp, PARROT_ALL_TRACE_FLAGS); + Parrot_interp_clear_trace(interp, PARROT_ALL_TRACE_FLAGS); } interp->resume_offset = REL_PC + 2; interp->resume_flag = 1;; @@ -14047,7 +14348,7 @@ Parrot_gc_debug_i(opcode_t *cur_opcode, PARROT_INTERP) { Interp_flags_CLEAR(interp, PARROT_GC_DEBUG_FLAG); } - return (opcode_t *)cur_opcode + 2; + return cur_opcode + 2; } opcode_t * @@ -14059,99 +14360,117 @@ Parrot_gc_debug_ic(opcode_t *cur_opcode, PARROT_INTERP) { Interp_flags_CLEAR(interp, PARROT_GC_DEBUG_FLAG); } - return (opcode_t *)cur_opcode + 2; + return cur_opcode + 2; } opcode_t * Parrot_interpinfo_i_i(opcode_t *cur_opcode, PARROT_INTERP) { - IREG(1) = interpinfo(interp, IREG(2)); - return (opcode_t *)cur_opcode + 3; + IREG(1) = Parrot_interp_info(interp, IREG(2)); + return cur_opcode + 3; } opcode_t * Parrot_interpinfo_i_ic(opcode_t *cur_opcode, PARROT_INTERP) { - IREG(1) = interpinfo(interp, ICONST(2)); - return (opcode_t *)cur_opcode + 3; + IREG(1) = Parrot_interp_info(interp, ICONST(2)); + return cur_opcode + 3; } opcode_t * Parrot_interpinfo_p_i(opcode_t *cur_opcode, PARROT_INTERP) { - PREG(1) = interpinfo_p(interp, IREG(2)); + PREG(1) = Parrot_interp_info_p(interp, IREG(2)); PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp)); - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * Parrot_interpinfo_p_ic(opcode_t *cur_opcode, PARROT_INTERP) { - PREG(1) = interpinfo_p(interp, ICONST(2)); + PREG(1) = Parrot_interp_info_p(interp, ICONST(2)); PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp)); - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * Parrot_interpinfo_s_i(opcode_t *cur_opcode, PARROT_INTERP) { - STRING * const s = interpinfo_s(interp, IREG(2)); + STRING * const s = Parrot_interp_info_s(interp, IREG(2)); SREG(1) = s; PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp)); - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * Parrot_interpinfo_s_ic(opcode_t *cur_opcode, PARROT_INTERP) { - STRING * const s = interpinfo_s(interp, ICONST(2)); + STRING * const s = Parrot_interp_info_s(interp, ICONST(2)); SREG(1) = s; PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp)); - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * Parrot_warningson_i(opcode_t *cur_opcode, PARROT_INTERP) { PARROT_WARNINGS_on(interp, IREG(1)); - return (opcode_t *)cur_opcode + 2; + return cur_opcode + 2; } opcode_t * Parrot_warningson_ic(opcode_t *cur_opcode, PARROT_INTERP) { PARROT_WARNINGS_on(interp, ICONST(1)); - return (opcode_t *)cur_opcode + 2; + return cur_opcode + 2; } opcode_t * Parrot_warningsoff_i(opcode_t *cur_opcode, PARROT_INTERP) { PARROT_WARNINGS_off(interp, IREG(1)); - return (opcode_t *)cur_opcode + 2; + return cur_opcode + 2; } opcode_t * Parrot_warningsoff_ic(opcode_t *cur_opcode, PARROT_INTERP) { PARROT_WARNINGS_off(interp, ICONST(1)); - return (opcode_t *)cur_opcode + 2; + return cur_opcode + 2; } opcode_t * Parrot_errorson_i(opcode_t *cur_opcode, PARROT_INTERP) { PARROT_ERRORS_on(interp, IREG(1)); - return (opcode_t *)cur_opcode + 2; + return cur_opcode + 2; } opcode_t * Parrot_errorson_ic(opcode_t *cur_opcode, PARROT_INTERP) { PARROT_ERRORS_on(interp, ICONST(1)); - return (opcode_t *)cur_opcode + 2; + return cur_opcode + 2; } opcode_t * Parrot_errorsoff_i(opcode_t *cur_opcode, PARROT_INTERP) { PARROT_ERRORS_off(interp, IREG(1)); - return (opcode_t *)cur_opcode + 2; + return cur_opcode + 2; } opcode_t * Parrot_errorsoff_ic(opcode_t *cur_opcode, PARROT_INTERP) { PARROT_ERRORS_off(interp, ICONST(1)); - return (opcode_t *)cur_opcode + 2; + return cur_opcode + 2; +} + +opcode_t * +Parrot_set_runcore_s(opcode_t *cur_opcode, PARROT_INTERP) { + Parrot_runcore_switch(interp, SREG(1)); + interp->resume_offset = REL_PC + 2; interp->resume_flag = 1;; + return (opcode_t *)0; +; + return cur_opcode + 2; +} + +opcode_t * +Parrot_set_runcore_sc(opcode_t *cur_opcode, PARROT_INTERP) { + Parrot_runcore_switch(interp, SCONST(1)); + interp->resume_offset = REL_PC + 2; interp->resume_flag = 1;; + return (opcode_t *)0; +; + return cur_opcode + 2; } opcode_t * @@ -14161,7 +14480,7 @@ Parrot_runinterp_p_i(opcode_t *cur_opcode, PARROT_INTERP) { Interp_flags_SET(new_interp, PARROT_EXTERN_CODE_FLAG); Parrot_switch_to_cs(new_interp, interp->code, 1); runops(new_interp, (REL_PC + IREG(2))); - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * @@ -14171,14 +14490,14 @@ Parrot_runinterp_p_ic(opcode_t *cur_opcode, PARROT_INTERP) { Interp_flags_SET(new_interp, PARROT_EXTERN_CODE_FLAG); Parrot_switch_to_cs(new_interp, interp->code, 1); runops(new_interp, (REL_PC + ICONST(2))); - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * Parrot_getinterp_p(opcode_t *cur_opcode, PARROT_INTERP) { PREG(1) = VTABLE_get_pmc_keyed_int(interp, interp->iglobals, IGLOBALS_INTERPRETER); PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp)); - return (opcode_t *)cur_opcode + 2; + return cur_opcode + 2; } opcode_t * @@ -14193,85 +14512,85 @@ Parrot_sweep_ic(opcode_t *cur_opcode, PARROT_INTERP) { } - return (opcode_t *)cur_opcode + 2; + return cur_opcode + 2; } opcode_t * Parrot_collect(opcode_t *cur_opcode, PARROT_INTERP) { Parrot_gc_compact_memory_pool(interp); - return (opcode_t *)cur_opcode + 1; + return cur_opcode + 1; } opcode_t * Parrot_sweepoff(opcode_t *cur_opcode, PARROT_INTERP) { Parrot_block_GC_mark(interp); - return (opcode_t *)cur_opcode + 1; + return cur_opcode + 1; } opcode_t * Parrot_sweepon(opcode_t *cur_opcode, PARROT_INTERP) { Parrot_unblock_GC_mark(interp); - return (opcode_t *)cur_opcode + 1; + return cur_opcode + 1; } opcode_t * Parrot_collectoff(opcode_t *cur_opcode, PARROT_INTERP) { Parrot_block_GC_sweep(interp); - return (opcode_t *)cur_opcode + 1; + return cur_opcode + 1; } opcode_t * Parrot_collecton(opcode_t *cur_opcode, PARROT_INTERP) { Parrot_unblock_GC_sweep(interp); - return (opcode_t *)cur_opcode + 1; + return cur_opcode + 1; } opcode_t * Parrot_needs_destroy_p(opcode_t *cur_opcode, PARROT_INTERP) { Parrot_gc_pmc_needs_early_collection(interp, PREG(1)); - return (opcode_t *)cur_opcode + 2; + return cur_opcode + 2; } opcode_t * Parrot_loadlib_p_s(opcode_t *cur_opcode, PARROT_INTERP) { PREG(1) = Parrot_dyn_load_lib(interp, SREG(2), NULL); PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp)); - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * Parrot_loadlib_p_sc(opcode_t *cur_opcode, PARROT_INTERP) { PREG(1) = Parrot_dyn_load_lib(interp, SCONST(2), NULL); PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp)); - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * Parrot_loadlib_p_s_p(opcode_t *cur_opcode, PARROT_INTERP) { PREG(1) = Parrot_dyn_load_lib(interp, SREG(2), PREG(3)); PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp)); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_loadlib_p_sc_p(opcode_t *cur_opcode, PARROT_INTERP) { PREG(1) = Parrot_dyn_load_lib(interp, SCONST(2), PREG(3)); PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp)); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_loadlib_p_s_pc(opcode_t *cur_opcode, PARROT_INTERP) { PREG(1) = Parrot_dyn_load_lib(interp, SREG(2), PCONST(3)); PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp)); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_loadlib_p_sc_pc(opcode_t *cur_opcode, PARROT_INTERP) { PREG(1) = Parrot_dyn_load_lib(interp, SCONST(2), PCONST(3)); PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp)); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * @@ -14298,7 +14617,7 @@ Parrot_dlfunc_p_p_s_s(opcode_t *cur_opcode, PARROT_INTERP) { } PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp)); - return (opcode_t *)cur_opcode + 5; + return cur_opcode + 5; } opcode_t * @@ -14325,7 +14644,7 @@ Parrot_dlfunc_p_p_sc_s(opcode_t *cur_opcode, PARROT_INTERP) { } PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp)); - return (opcode_t *)cur_opcode + 5; + return cur_opcode + 5; } opcode_t * @@ -14352,7 +14671,7 @@ Parrot_dlfunc_p_p_s_sc(opcode_t *cur_opcode, PARROT_INTERP) { } PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp)); - return (opcode_t *)cur_opcode + 5; + return cur_opcode + 5; } opcode_t * @@ -14379,7 +14698,7 @@ Parrot_dlfunc_p_p_sc_sc(opcode_t *cur_opcode, PARROT_INTERP) { } PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp)); - return (opcode_t *)cur_opcode + 5; + return cur_opcode + 5; } opcode_t * @@ -14406,7 +14725,7 @@ Parrot_dlfunc_p_p_s_p(opcode_t *cur_opcode, PARROT_INTERP) { } PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp)); - return (opcode_t *)cur_opcode + 5; + return cur_opcode + 5; } opcode_t * @@ -14433,7 +14752,7 @@ Parrot_dlfunc_p_p_sc_p(opcode_t *cur_opcode, PARROT_INTERP) { } PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp)); - return (opcode_t *)cur_opcode + 5; + return cur_opcode + 5; } opcode_t * @@ -14458,7 +14777,7 @@ Parrot_dlvar_p_p_s(opcode_t *cur_opcode, PARROT_INTERP) { } PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp)); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * @@ -14483,7 +14802,7 @@ Parrot_dlvar_p_p_sc(opcode_t *cur_opcode, PARROT_INTERP) { } PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp)); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * @@ -14491,7 +14810,7 @@ Parrot_compreg_s_p(opcode_t *cur_opcode, PARROT_INTERP) { PMC * const compreg_hash = VTABLE_get_pmc_keyed_int(interp, interp->iglobals, IGLOBALS_COMPREG_HASH); VTABLE_set_pmc_keyed_str(interp, compreg_hash, SREG(1), PREG(2)); - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * @@ -14499,7 +14818,7 @@ Parrot_compreg_sc_p(opcode_t *cur_opcode, PARROT_INTERP) { PMC * const compreg_hash = VTABLE_get_pmc_keyed_int(interp, interp->iglobals, IGLOBALS_COMPREG_HASH); VTABLE_set_pmc_keyed_str(interp, compreg_hash, SCONST(1), PREG(2)); - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * @@ -14508,7 +14827,7 @@ Parrot_compreg_p_s(opcode_t *cur_opcode, PARROT_INTERP) { PREG(1) = VTABLE_get_pmc_keyed_str(interp, compreg_hash, SREG(2)); PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp)); - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * @@ -14517,21 +14836,21 @@ Parrot_compreg_p_sc(opcode_t *cur_opcode, PARROT_INTERP) { PREG(1) = VTABLE_get_pmc_keyed_str(interp, compreg_hash, SCONST(2)); PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp)); - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * Parrot_new_callback_p_p_p_s(opcode_t *cur_opcode, PARROT_INTERP) { PREG(1) = Parrot_make_cb(interp, PREG(2), PREG(3), SREG(4)); PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp)); - return (opcode_t *)cur_opcode + 5; + return cur_opcode + 5; } opcode_t * Parrot_new_callback_p_p_p_sc(opcode_t *cur_opcode, PARROT_INTERP) { PREG(1) = Parrot_make_cb(interp, PREG(2), PREG(3), SCONST(4)); PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp)); - return (opcode_t *)cur_opcode + 5; + return cur_opcode + 5; } opcode_t * @@ -14546,7 +14865,7 @@ Parrot_annotations_p(opcode_t *cur_opcode, PARROT_INTERP) { } PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp)); - return (opcode_t *)cur_opcode + 2; + return cur_opcode + 2; } opcode_t * @@ -14561,7 +14880,7 @@ Parrot_annotations_p_s(opcode_t *cur_opcode, PARROT_INTERP) { } PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp)); - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * @@ -14576,97 +14895,97 @@ Parrot_annotations_p_sc(opcode_t *cur_opcode, PARROT_INTERP) { } PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp)); - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * Parrot_band_i_i(opcode_t *cur_opcode, PARROT_INTERP) { (IREG(1) &= IREG(2)); - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * Parrot_band_i_ic(opcode_t *cur_opcode, PARROT_INTERP) { (IREG(1) &= ICONST(2)); - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * Parrot_band_i_i_i(opcode_t *cur_opcode, PARROT_INTERP) { IREG(1) = (IREG(2) & IREG(3)); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_band_i_ic_i(opcode_t *cur_opcode, PARROT_INTERP) { IREG(1) = (ICONST(2) & IREG(3)); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_band_i_i_ic(opcode_t *cur_opcode, PARROT_INTERP) { IREG(1) = (IREG(2) & ICONST(3)); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_bor_i_i(opcode_t *cur_opcode, PARROT_INTERP) { (IREG(1) |= IREG(2)); - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * Parrot_bor_i_ic(opcode_t *cur_opcode, PARROT_INTERP) { (IREG(1) |= ICONST(2)); - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * Parrot_bor_i_i_i(opcode_t *cur_opcode, PARROT_INTERP) { IREG(1) = (IREG(2) | IREG(3)); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_bor_i_ic_i(opcode_t *cur_opcode, PARROT_INTERP) { IREG(1) = (ICONST(2) | IREG(3)); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_bor_i_i_ic(opcode_t *cur_opcode, PARROT_INTERP) { IREG(1) = (IREG(2) | ICONST(3)); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_shl_i_i(opcode_t *cur_opcode, PARROT_INTERP) { IREG(1) = bit_shift_left(IREG(1), IREG(2)); - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * Parrot_shl_i_ic(opcode_t *cur_opcode, PARROT_INTERP) { IREG(1) = bit_shift_left(IREG(1), ICONST(2)); - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * Parrot_shl_i_i_i(opcode_t *cur_opcode, PARROT_INTERP) { IREG(1) = bit_shift_left(IREG(2), IREG(3)); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_shl_i_ic_i(opcode_t *cur_opcode, PARROT_INTERP) { IREG(1) = bit_shift_left(ICONST(2), IREG(3)); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_shl_i_i_ic(opcode_t *cur_opcode, PARROT_INTERP) { IREG(1) = bit_shift_left(IREG(2), ICONST(3)); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * @@ -14674,7 +14993,7 @@ Parrot_shr_i_i(opcode_t *cur_opcode, PARROT_INTERP) { const INTVAL signed_shift = (-IREG(2)); IREG(1) = bit_shift_left(IREG(1), signed_shift); - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * @@ -14682,7 +15001,7 @@ Parrot_shr_i_ic(opcode_t *cur_opcode, PARROT_INTERP) { const INTVAL signed_shift = (-ICONST(2)); IREG(1) = bit_shift_left(IREG(1), signed_shift); - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * @@ -14690,7 +15009,7 @@ Parrot_shr_i_i_i(opcode_t *cur_opcode, PARROT_INTERP) { const INTVAL signed_shift = (-IREG(3)); IREG(1) = bit_shift_left(IREG(2), signed_shift); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * @@ -14698,7 +15017,7 @@ Parrot_shr_i_ic_i(opcode_t *cur_opcode, PARROT_INTERP) { const INTVAL signed_shift = (-IREG(3)); IREG(1) = bit_shift_left(ICONST(2), signed_shift); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * @@ -14706,7 +15025,7 @@ Parrot_shr_i_i_ic(opcode_t *cur_opcode, PARROT_INTERP) { const INTVAL signed_shift = (-ICONST(3)); IREG(1) = bit_shift_left(IREG(2), signed_shift); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * @@ -14715,7 +15034,7 @@ Parrot_lsr_i_i(opcode_t *cur_opcode, PARROT_INTERP) { const UINTVAL b = (a >> IREG(2)); IREG(1) = (INTVAL)b; - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * @@ -14724,145 +15043,145 @@ Parrot_lsr_i_ic(opcode_t *cur_opcode, PARROT_INTERP) { const UINTVAL b = (a >> ICONST(2)); IREG(1) = (INTVAL)b; - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * Parrot_lsr_i_i_i(opcode_t *cur_opcode, PARROT_INTERP) { IREG(1) = (INTVAL)(((UINTVAL)IREG(2) >> IREG(3))); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_lsr_i_ic_i(opcode_t *cur_opcode, PARROT_INTERP) { IREG(1) = (INTVAL)(((UINTVAL)ICONST(2) >> IREG(3))); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_lsr_i_i_ic(opcode_t *cur_opcode, PARROT_INTERP) { IREG(1) = (INTVAL)(((UINTVAL)IREG(2) >> ICONST(3))); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_bxor_i_i(opcode_t *cur_opcode, PARROT_INTERP) { (IREG(1) ^= IREG(2)); - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * Parrot_bxor_i_ic(opcode_t *cur_opcode, PARROT_INTERP) { (IREG(1) ^= ICONST(2)); - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * Parrot_bxor_i_i_i(opcode_t *cur_opcode, PARROT_INTERP) { IREG(1) = (IREG(2) ^ IREG(3)); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_bxor_i_ic_i(opcode_t *cur_opcode, PARROT_INTERP) { IREG(1) = (ICONST(2) ^ IREG(3)); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_bxor_i_i_ic(opcode_t *cur_opcode, PARROT_INTERP) { IREG(1) = (IREG(2) ^ ICONST(3)); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_eq_i_i_ic(opcode_t *cur_opcode, PARROT_INTERP) { if ((IREG(1) == IREG(2))) { - return (opcode_t *)cur_opcode + ICONST(3); + return cur_opcode + ICONST(3); } - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_eq_ic_i_ic(opcode_t *cur_opcode, PARROT_INTERP) { if ((ICONST(1) == IREG(2))) { - return (opcode_t *)cur_opcode + ICONST(3); + return cur_opcode + ICONST(3); } - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_eq_i_ic_ic(opcode_t *cur_opcode, PARROT_INTERP) { if ((IREG(1) == ICONST(2))) { - return (opcode_t *)cur_opcode + ICONST(3); + return cur_opcode + ICONST(3); } - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_eq_n_n_ic(opcode_t *cur_opcode, PARROT_INTERP) { if ((NREG(1) == NREG(2))) { - return (opcode_t *)cur_opcode + ICONST(3); + return cur_opcode + ICONST(3); } - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_eq_nc_n_ic(opcode_t *cur_opcode, PARROT_INTERP) { if ((NCONST(1) == NREG(2))) { - return (opcode_t *)cur_opcode + ICONST(3); + return cur_opcode + ICONST(3); } - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_eq_n_nc_ic(opcode_t *cur_opcode, PARROT_INTERP) { if ((NREG(1) == NCONST(2))) { - return (opcode_t *)cur_opcode + ICONST(3); + return cur_opcode + ICONST(3); } - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_eq_s_s_ic(opcode_t *cur_opcode, PARROT_INTERP) { if (STRING_equal(interp, SREG(1), SREG(2))) { - return (opcode_t *)cur_opcode + ICONST(3); + return cur_opcode + ICONST(3); } - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_eq_sc_s_ic(opcode_t *cur_opcode, PARROT_INTERP) { if (STRING_equal(interp, SCONST(1), SREG(2))) { - return (opcode_t *)cur_opcode + ICONST(3); + return cur_opcode + ICONST(3); } - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_eq_s_sc_ic(opcode_t *cur_opcode, PARROT_INTERP) { if (STRING_equal(interp, SREG(1), SCONST(2))) { - return (opcode_t *)cur_opcode + ICONST(3); + return cur_opcode + ICONST(3); } - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_eq_p_p_ic(opcode_t *cur_opcode, PARROT_INTERP) { if (VTABLE_is_equal(interp, PREG(1), PREG(2))) { - return (opcode_t *)cur_opcode + ICONST(3); + return cur_opcode + ICONST(3); } - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * @@ -14872,11 +15191,11 @@ Parrot_eq_p_i_ic(opcode_t *cur_opcode, PARROT_INTERP) { VTABLE_set_integer_native(interp, temp, IREG(2)); if (VTABLE_is_equal(interp, PREG(1), temp)) { Parrot_pmc_free_temporary(interp, temp); - return (opcode_t *)cur_opcode + ICONST(3); + return cur_opcode + ICONST(3); } Parrot_pmc_free_temporary(interp, temp); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * @@ -14886,200 +15205,200 @@ Parrot_eq_p_ic_ic(opcode_t *cur_opcode, PARROT_INTERP) { VTABLE_set_integer_native(interp, temp, ICONST(2)); if (VTABLE_is_equal(interp, PREG(1), temp)) { Parrot_pmc_free_temporary(interp, temp); - return (opcode_t *)cur_opcode + ICONST(3); + return cur_opcode + ICONST(3); } Parrot_pmc_free_temporary(interp, temp); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_eq_p_n_ic(opcode_t *cur_opcode, PARROT_INTERP) { if ((VTABLE_get_number(interp, PREG(1)) == NREG(2))) { - return (opcode_t *)cur_opcode + ICONST(3); + return cur_opcode + ICONST(3); } - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_eq_p_nc_ic(opcode_t *cur_opcode, PARROT_INTERP) { if ((VTABLE_get_number(interp, PREG(1)) == NCONST(2))) { - return (opcode_t *)cur_opcode + ICONST(3); + return cur_opcode + ICONST(3); } - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_eq_p_s_ic(opcode_t *cur_opcode, PARROT_INTERP) { if (STRING_equal(interp, VTABLE_get_string(interp, PREG(1)), SREG(2))) { - return (opcode_t *)cur_opcode + ICONST(3); + return cur_opcode + ICONST(3); } - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_eq_p_sc_ic(opcode_t *cur_opcode, PARROT_INTERP) { if (STRING_equal(interp, VTABLE_get_string(interp, PREG(1)), SCONST(2))) { - return (opcode_t *)cur_opcode + ICONST(3); + return cur_opcode + ICONST(3); } - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_eq_str_p_p_ic(opcode_t *cur_opcode, PARROT_INTERP) { if (VTABLE_is_equal_string(interp, PREG(1), PREG(2))) { - return (opcode_t *)cur_opcode + ICONST(3); + return cur_opcode + ICONST(3); } - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_eq_num_p_p_ic(opcode_t *cur_opcode, PARROT_INTERP) { if (VTABLE_is_equal_num(interp, PREG(1), PREG(2))) { - return (opcode_t *)cur_opcode + ICONST(3); + return cur_opcode + ICONST(3); } - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_eq_addr_s_s_ic(opcode_t *cur_opcode, PARROT_INTERP) { if ((SREG(1) == SREG(2))) { - return (opcode_t *)cur_opcode + ICONST(3); + return cur_opcode + ICONST(3); } - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_eq_addr_sc_s_ic(opcode_t *cur_opcode, PARROT_INTERP) { if ((SCONST(1) == SREG(2))) { - return (opcode_t *)cur_opcode + ICONST(3); + return cur_opcode + ICONST(3); } - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_eq_addr_s_sc_ic(opcode_t *cur_opcode, PARROT_INTERP) { if ((SREG(1) == SCONST(2))) { - return (opcode_t *)cur_opcode + ICONST(3); + return cur_opcode + ICONST(3); } - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_eq_addr_sc_sc_ic(opcode_t *cur_opcode, PARROT_INTERP) { if ((SCONST(1) == SCONST(2))) { - return (opcode_t *)cur_opcode + ICONST(3); + return cur_opcode + ICONST(3); } - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_eq_addr_p_p_ic(opcode_t *cur_opcode, PARROT_INTERP) { if ((PREG(1) == PREG(2))) { - return (opcode_t *)cur_opcode + ICONST(3); + return cur_opcode + ICONST(3); } - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_ne_i_i_ic(opcode_t *cur_opcode, PARROT_INTERP) { if ((IREG(1) != IREG(2))) { - return (opcode_t *)cur_opcode + ICONST(3); + return cur_opcode + ICONST(3); } - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_ne_ic_i_ic(opcode_t *cur_opcode, PARROT_INTERP) { if ((ICONST(1) != IREG(2))) { - return (opcode_t *)cur_opcode + ICONST(3); + return cur_opcode + ICONST(3); } - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_ne_i_ic_ic(opcode_t *cur_opcode, PARROT_INTERP) { if ((IREG(1) != ICONST(2))) { - return (opcode_t *)cur_opcode + ICONST(3); + return cur_opcode + ICONST(3); } - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_ne_n_n_ic(opcode_t *cur_opcode, PARROT_INTERP) { if ((NREG(1) != NREG(2))) { - return (opcode_t *)cur_opcode + ICONST(3); + return cur_opcode + ICONST(3); } - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_ne_nc_n_ic(opcode_t *cur_opcode, PARROT_INTERP) { if ((NCONST(1) != NREG(2))) { - return (opcode_t *)cur_opcode + ICONST(3); + return cur_opcode + ICONST(3); } - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_ne_n_nc_ic(opcode_t *cur_opcode, PARROT_INTERP) { if ((NREG(1) != NCONST(2))) { - return (opcode_t *)cur_opcode + ICONST(3); + return cur_opcode + ICONST(3); } - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_ne_s_s_ic(opcode_t *cur_opcode, PARROT_INTERP) { if ((!STRING_equal(interp, SREG(1), SREG(2)))) { - return (opcode_t *)cur_opcode + ICONST(3); + return cur_opcode + ICONST(3); } - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_ne_sc_s_ic(opcode_t *cur_opcode, PARROT_INTERP) { if ((!STRING_equal(interp, SCONST(1), SREG(2)))) { - return (opcode_t *)cur_opcode + ICONST(3); + return cur_opcode + ICONST(3); } - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_ne_s_sc_ic(opcode_t *cur_opcode, PARROT_INTERP) { if ((!STRING_equal(interp, SREG(1), SCONST(2)))) { - return (opcode_t *)cur_opcode + ICONST(3); + return cur_opcode + ICONST(3); } - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_ne_p_p_ic(opcode_t *cur_opcode, PARROT_INTERP) { if ((!VTABLE_is_equal(interp, PREG(1), PREG(2)))) { - return (opcode_t *)cur_opcode + ICONST(3); + return cur_opcode + ICONST(3); } - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * @@ -15089,11 +15408,11 @@ Parrot_ne_p_i_ic(opcode_t *cur_opcode, PARROT_INTERP) { VTABLE_set_integer_native(interp, temp, IREG(2)); if ((!VTABLE_is_equal(interp, PREG(1), temp))) { Parrot_pmc_free_temporary(interp, temp); - return (opcode_t *)cur_opcode + ICONST(3); + return cur_opcode + ICONST(3); } Parrot_pmc_free_temporary(interp, temp); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * @@ -15103,200 +15422,200 @@ Parrot_ne_p_ic_ic(opcode_t *cur_opcode, PARROT_INTERP) { VTABLE_set_integer_native(interp, temp, ICONST(2)); if ((!VTABLE_is_equal(interp, PREG(1), temp))) { Parrot_pmc_free_temporary(interp, temp); - return (opcode_t *)cur_opcode + ICONST(3); + return cur_opcode + ICONST(3); } Parrot_pmc_free_temporary(interp, temp); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_ne_p_n_ic(opcode_t *cur_opcode, PARROT_INTERP) { if ((VTABLE_get_number(interp, PREG(1)) != NREG(2))) { - return (opcode_t *)cur_opcode + ICONST(3); + return cur_opcode + ICONST(3); } - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_ne_p_nc_ic(opcode_t *cur_opcode, PARROT_INTERP) { if ((VTABLE_get_number(interp, PREG(1)) != NCONST(2))) { - return (opcode_t *)cur_opcode + ICONST(3); + return cur_opcode + ICONST(3); } - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_ne_p_s_ic(opcode_t *cur_opcode, PARROT_INTERP) { if ((!STRING_equal(interp, VTABLE_get_string(interp, PREG(1)), SREG(2)))) { - return (opcode_t *)cur_opcode + ICONST(3); + return cur_opcode + ICONST(3); } - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_ne_p_sc_ic(opcode_t *cur_opcode, PARROT_INTERP) { if ((!STRING_equal(interp, VTABLE_get_string(interp, PREG(1)), SCONST(2)))) { - return (opcode_t *)cur_opcode + ICONST(3); + return cur_opcode + ICONST(3); } - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_ne_str_p_p_ic(opcode_t *cur_opcode, PARROT_INTERP) { if ((VTABLE_cmp_string(interp, PREG(1), PREG(2)) != 0)) { - return (opcode_t *)cur_opcode + ICONST(3); + return cur_opcode + ICONST(3); } - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_ne_num_p_p_ic(opcode_t *cur_opcode, PARROT_INTERP) { if ((VTABLE_cmp_num(interp, PREG(1), PREG(2)) != 0)) { - return (opcode_t *)cur_opcode + ICONST(3); + return cur_opcode + ICONST(3); } - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_ne_addr_s_s_ic(opcode_t *cur_opcode, PARROT_INTERP) { if ((SREG(1) != SREG(2))) { - return (opcode_t *)cur_opcode + ICONST(3); + return cur_opcode + ICONST(3); } - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_ne_addr_sc_s_ic(opcode_t *cur_opcode, PARROT_INTERP) { if ((SCONST(1) != SREG(2))) { - return (opcode_t *)cur_opcode + ICONST(3); + return cur_opcode + ICONST(3); } - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_ne_addr_s_sc_ic(opcode_t *cur_opcode, PARROT_INTERP) { if ((SREG(1) != SCONST(2))) { - return (opcode_t *)cur_opcode + ICONST(3); + return cur_opcode + ICONST(3); } - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_ne_addr_sc_sc_ic(opcode_t *cur_opcode, PARROT_INTERP) { if ((SCONST(1) != SCONST(2))) { - return (opcode_t *)cur_opcode + ICONST(3); + return cur_opcode + ICONST(3); } - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_ne_addr_p_p_ic(opcode_t *cur_opcode, PARROT_INTERP) { if ((PREG(1) != PREG(2))) { - return (opcode_t *)cur_opcode + ICONST(3); + return cur_opcode + ICONST(3); } - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_lt_i_i_ic(opcode_t *cur_opcode, PARROT_INTERP) { if ((IREG(1) < IREG(2))) { - return (opcode_t *)cur_opcode + ICONST(3); + return cur_opcode + ICONST(3); } - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_lt_ic_i_ic(opcode_t *cur_opcode, PARROT_INTERP) { if ((ICONST(1) < IREG(2))) { - return (opcode_t *)cur_opcode + ICONST(3); + return cur_opcode + ICONST(3); } - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_lt_i_ic_ic(opcode_t *cur_opcode, PARROT_INTERP) { if ((IREG(1) < ICONST(2))) { - return (opcode_t *)cur_opcode + ICONST(3); + return cur_opcode + ICONST(3); } - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_lt_n_n_ic(opcode_t *cur_opcode, PARROT_INTERP) { if ((NREG(1) < NREG(2))) { - return (opcode_t *)cur_opcode + ICONST(3); + return cur_opcode + ICONST(3); } - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_lt_nc_n_ic(opcode_t *cur_opcode, PARROT_INTERP) { if ((NCONST(1) < NREG(2))) { - return (opcode_t *)cur_opcode + ICONST(3); + return cur_opcode + ICONST(3); } - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_lt_n_nc_ic(opcode_t *cur_opcode, PARROT_INTERP) { if ((NREG(1) < NCONST(2))) { - return (opcode_t *)cur_opcode + ICONST(3); + return cur_opcode + ICONST(3); } - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_lt_s_s_ic(opcode_t *cur_opcode, PARROT_INTERP) { if ((STRING_compare(interp, SREG(1), SREG(2)) < 0)) { - return (opcode_t *)cur_opcode + ICONST(3); + return cur_opcode + ICONST(3); } - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_lt_sc_s_ic(opcode_t *cur_opcode, PARROT_INTERP) { if ((STRING_compare(interp, SCONST(1), SREG(2)) < 0)) { - return (opcode_t *)cur_opcode + ICONST(3); + return cur_opcode + ICONST(3); } - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_lt_s_sc_ic(opcode_t *cur_opcode, PARROT_INTERP) { if ((STRING_compare(interp, SREG(1), SCONST(2)) < 0)) { - return (opcode_t *)cur_opcode + ICONST(3); + return cur_opcode + ICONST(3); } - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_lt_p_p_ic(opcode_t *cur_opcode, PARROT_INTERP) { if ((VTABLE_cmp(interp, PREG(1), PREG(2)) < 0)) { - return (opcode_t *)cur_opcode + ICONST(3); + return cur_opcode + ICONST(3); } - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * @@ -15306,11 +15625,11 @@ Parrot_lt_p_i_ic(opcode_t *cur_opcode, PARROT_INTERP) { VTABLE_set_integer_native(interp, temp, IREG(2)); if ((VTABLE_cmp(interp, PREG(1), temp) < 0)) { Parrot_pmc_free_temporary(interp, temp); - return (opcode_t *)cur_opcode + ICONST(3); + return cur_opcode + ICONST(3); } Parrot_pmc_free_temporary(interp, temp); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * @@ -15320,155 +15639,155 @@ Parrot_lt_p_ic_ic(opcode_t *cur_opcode, PARROT_INTERP) { VTABLE_set_integer_native(interp, temp, ICONST(2)); if ((VTABLE_cmp(interp, PREG(1), temp) < 0)) { Parrot_pmc_free_temporary(interp, temp); - return (opcode_t *)cur_opcode + ICONST(3); + return cur_opcode + ICONST(3); } Parrot_pmc_free_temporary(interp, temp); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_lt_p_n_ic(opcode_t *cur_opcode, PARROT_INTERP) { if ((VTABLE_get_number(interp, PREG(1)) < NREG(2))) { - return (opcode_t *)cur_opcode + ICONST(3); + return cur_opcode + ICONST(3); } - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_lt_p_nc_ic(opcode_t *cur_opcode, PARROT_INTERP) { if ((VTABLE_get_number(interp, PREG(1)) < NCONST(2))) { - return (opcode_t *)cur_opcode + ICONST(3); + return cur_opcode + ICONST(3); } - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_lt_p_s_ic(opcode_t *cur_opcode, PARROT_INTERP) { if ((STRING_compare(interp, VTABLE_get_string(interp, PREG(1)), SREG(2)) < 0)) { - return (opcode_t *)cur_opcode + ICONST(3); + return cur_opcode + ICONST(3); } - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_lt_p_sc_ic(opcode_t *cur_opcode, PARROT_INTERP) { if ((STRING_compare(interp, VTABLE_get_string(interp, PREG(1)), SCONST(2)) < 0)) { - return (opcode_t *)cur_opcode + ICONST(3); + return cur_opcode + ICONST(3); } - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_lt_str_p_p_ic(opcode_t *cur_opcode, PARROT_INTERP) { if ((VTABLE_cmp_string(interp, PREG(1), PREG(2)) < 0)) { - return (opcode_t *)cur_opcode + ICONST(3); + return cur_opcode + ICONST(3); } - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_lt_num_p_p_ic(opcode_t *cur_opcode, PARROT_INTERP) { if ((VTABLE_cmp_num(interp, PREG(1), PREG(2)) < 0)) { - return (opcode_t *)cur_opcode + ICONST(3); + return cur_opcode + ICONST(3); } - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_le_i_i_ic(opcode_t *cur_opcode, PARROT_INTERP) { if ((IREG(1) <= IREG(2))) { - return (opcode_t *)cur_opcode + ICONST(3); + return cur_opcode + ICONST(3); } - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_le_ic_i_ic(opcode_t *cur_opcode, PARROT_INTERP) { if ((ICONST(1) <= IREG(2))) { - return (opcode_t *)cur_opcode + ICONST(3); + return cur_opcode + ICONST(3); } - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_le_i_ic_ic(opcode_t *cur_opcode, PARROT_INTERP) { if ((IREG(1) <= ICONST(2))) { - return (opcode_t *)cur_opcode + ICONST(3); + return cur_opcode + ICONST(3); } - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_le_n_n_ic(opcode_t *cur_opcode, PARROT_INTERP) { if ((NREG(1) <= NREG(2))) { - return (opcode_t *)cur_opcode + ICONST(3); + return cur_opcode + ICONST(3); } - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_le_nc_n_ic(opcode_t *cur_opcode, PARROT_INTERP) { if ((NCONST(1) <= NREG(2))) { - return (opcode_t *)cur_opcode + ICONST(3); + return cur_opcode + ICONST(3); } - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_le_n_nc_ic(opcode_t *cur_opcode, PARROT_INTERP) { if ((NREG(1) <= NCONST(2))) { - return (opcode_t *)cur_opcode + ICONST(3); + return cur_opcode + ICONST(3); } - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_le_s_s_ic(opcode_t *cur_opcode, PARROT_INTERP) { if ((STRING_compare(interp, SREG(1), SREG(2)) <= 0)) { - return (opcode_t *)cur_opcode + ICONST(3); + return cur_opcode + ICONST(3); } - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_le_sc_s_ic(opcode_t *cur_opcode, PARROT_INTERP) { if ((STRING_compare(interp, SCONST(1), SREG(2)) <= 0)) { - return (opcode_t *)cur_opcode + ICONST(3); + return cur_opcode + ICONST(3); } - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_le_s_sc_ic(opcode_t *cur_opcode, PARROT_INTERP) { if ((STRING_compare(interp, SREG(1), SCONST(2)) <= 0)) { - return (opcode_t *)cur_opcode + ICONST(3); + return cur_opcode + ICONST(3); } - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_le_p_p_ic(opcode_t *cur_opcode, PARROT_INTERP) { if ((VTABLE_cmp(interp, PREG(1), PREG(2)) <= 0)) { - return (opcode_t *)cur_opcode + ICONST(3); + return cur_opcode + ICONST(3); } - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * @@ -15478,11 +15797,11 @@ Parrot_le_p_i_ic(opcode_t *cur_opcode, PARROT_INTERP) { VTABLE_set_integer_native(interp, temp, IREG(2)); if ((VTABLE_cmp(interp, PREG(1), temp) <= 0)) { Parrot_pmc_free_temporary(interp, temp); - return (opcode_t *)cur_opcode + ICONST(3); + return cur_opcode + ICONST(3); } Parrot_pmc_free_temporary(interp, temp); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * @@ -15492,74 +15811,74 @@ Parrot_le_p_ic_ic(opcode_t *cur_opcode, PARROT_INTERP) { VTABLE_set_integer_native(interp, temp, ICONST(2)); if ((VTABLE_cmp(interp, PREG(1), temp) <= 0)) { Parrot_pmc_free_temporary(interp, temp); - return (opcode_t *)cur_opcode + ICONST(3); + return cur_opcode + ICONST(3); } Parrot_pmc_free_temporary(interp, temp); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_le_p_n_ic(opcode_t *cur_opcode, PARROT_INTERP) { if ((VTABLE_get_number(interp, PREG(1)) <= NREG(2))) { - return (opcode_t *)cur_opcode + ICONST(3); + return cur_opcode + ICONST(3); } - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_le_p_nc_ic(opcode_t *cur_opcode, PARROT_INTERP) { if ((VTABLE_get_number(interp, PREG(1)) <= NCONST(2))) { - return (opcode_t *)cur_opcode + ICONST(3); + return cur_opcode + ICONST(3); } - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_le_p_s_ic(opcode_t *cur_opcode, PARROT_INTERP) { if ((STRING_compare(interp, VTABLE_get_string(interp, PREG(1)), SREG(2)) <= 0)) { - return (opcode_t *)cur_opcode + ICONST(3); + return cur_opcode + ICONST(3); } - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_le_p_sc_ic(opcode_t *cur_opcode, PARROT_INTERP) { if ((STRING_compare(interp, VTABLE_get_string(interp, PREG(1)), SCONST(2)) <= 0)) { - return (opcode_t *)cur_opcode + ICONST(3); + return cur_opcode + ICONST(3); } - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_le_str_p_p_ic(opcode_t *cur_opcode, PARROT_INTERP) { if ((VTABLE_cmp_string(interp, PREG(1), PREG(2)) <= 0)) { - return (opcode_t *)cur_opcode + ICONST(3); + return cur_opcode + ICONST(3); } - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_le_num_p_p_ic(opcode_t *cur_opcode, PARROT_INTERP) { if ((VTABLE_cmp_num(interp, PREG(1), PREG(2)) <= 0)) { - return (opcode_t *)cur_opcode + ICONST(3); + return cur_opcode + ICONST(3); } - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_gt_p_p_ic(opcode_t *cur_opcode, PARROT_INTERP) { if ((VTABLE_cmp(interp, PREG(1), PREG(2)) > 0)) { - return (opcode_t *)cur_opcode + ICONST(3); + return cur_opcode + ICONST(3); } - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * @@ -15569,11 +15888,11 @@ Parrot_gt_p_i_ic(opcode_t *cur_opcode, PARROT_INTERP) { VTABLE_set_integer_native(interp, temp, IREG(2)); if ((VTABLE_cmp(interp, PREG(1), temp) > 0)) { Parrot_pmc_free_temporary(interp, temp); - return (opcode_t *)cur_opcode + ICONST(3); + return cur_opcode + ICONST(3); } Parrot_pmc_free_temporary(interp, temp); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * @@ -15583,74 +15902,74 @@ Parrot_gt_p_ic_ic(opcode_t *cur_opcode, PARROT_INTERP) { VTABLE_set_integer_native(interp, temp, ICONST(2)); if ((VTABLE_cmp(interp, PREG(1), temp) > 0)) { Parrot_pmc_free_temporary(interp, temp); - return (opcode_t *)cur_opcode + ICONST(3); + return cur_opcode + ICONST(3); } Parrot_pmc_free_temporary(interp, temp); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_gt_p_n_ic(opcode_t *cur_opcode, PARROT_INTERP) { if ((VTABLE_get_number(interp, PREG(1)) > NREG(2))) { - return (opcode_t *)cur_opcode + ICONST(3); + return cur_opcode + ICONST(3); } - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_gt_p_nc_ic(opcode_t *cur_opcode, PARROT_INTERP) { if ((VTABLE_get_number(interp, PREG(1)) > NCONST(2))) { - return (opcode_t *)cur_opcode + ICONST(3); + return cur_opcode + ICONST(3); } - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_gt_p_s_ic(opcode_t *cur_opcode, PARROT_INTERP) { if ((STRING_compare(interp, VTABLE_get_string(interp, PREG(1)), SREG(2)) > 0)) { - return (opcode_t *)cur_opcode + ICONST(3); + return cur_opcode + ICONST(3); } - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_gt_p_sc_ic(opcode_t *cur_opcode, PARROT_INTERP) { if ((STRING_compare(interp, VTABLE_get_string(interp, PREG(1)), SCONST(2)) > 0)) { - return (opcode_t *)cur_opcode + ICONST(3); + return cur_opcode + ICONST(3); } - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_gt_str_p_p_ic(opcode_t *cur_opcode, PARROT_INTERP) { if ((VTABLE_cmp_string(interp, PREG(1), PREG(2)) > 0)) { - return (opcode_t *)cur_opcode + ICONST(3); + return cur_opcode + ICONST(3); } - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_gt_num_p_p_ic(opcode_t *cur_opcode, PARROT_INTERP) { if ((VTABLE_cmp_num(interp, PREG(1), PREG(2)) > 0)) { - return (opcode_t *)cur_opcode + ICONST(3); + return cur_opcode + ICONST(3); } - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_ge_p_p_ic(opcode_t *cur_opcode, PARROT_INTERP) { if ((VTABLE_cmp(interp, PREG(1), PREG(2)) >= 0)) { - return (opcode_t *)cur_opcode + ICONST(3); + return cur_opcode + ICONST(3); } - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * @@ -15660,11 +15979,11 @@ Parrot_ge_p_i_ic(opcode_t *cur_opcode, PARROT_INTERP) { VTABLE_set_integer_native(interp, temp, IREG(2)); if ((VTABLE_cmp(interp, PREG(1), temp) >= 0)) { Parrot_pmc_free_temporary(interp, temp); - return (opcode_t *)cur_opcode + ICONST(3); + return cur_opcode + ICONST(3); } Parrot_pmc_free_temporary(interp, temp); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * @@ -15674,161 +15993,161 @@ Parrot_ge_p_ic_ic(opcode_t *cur_opcode, PARROT_INTERP) { VTABLE_set_integer_native(interp, temp, ICONST(2)); if ((VTABLE_cmp(interp, PREG(1), temp) >= 0)) { Parrot_pmc_free_temporary(interp, temp); - return (opcode_t *)cur_opcode + ICONST(3); + return cur_opcode + ICONST(3); } Parrot_pmc_free_temporary(interp, temp); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_ge_p_n_ic(opcode_t *cur_opcode, PARROT_INTERP) { if ((VTABLE_get_number(interp, PREG(1)) >= NREG(2))) { - return (opcode_t *)cur_opcode + ICONST(3); + return cur_opcode + ICONST(3); } - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_ge_p_nc_ic(opcode_t *cur_opcode, PARROT_INTERP) { if ((VTABLE_get_number(interp, PREG(1)) >= NCONST(2))) { - return (opcode_t *)cur_opcode + ICONST(3); + return cur_opcode + ICONST(3); } - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_ge_p_s_ic(opcode_t *cur_opcode, PARROT_INTERP) { if ((STRING_compare(interp, VTABLE_get_string(interp, PREG(1)), SREG(2)) >= 0)) { - return (opcode_t *)cur_opcode + ICONST(3); + return cur_opcode + ICONST(3); } - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_ge_p_sc_ic(opcode_t *cur_opcode, PARROT_INTERP) { if ((STRING_compare(interp, VTABLE_get_string(interp, PREG(1)), SCONST(2)) >= 0)) { - return (opcode_t *)cur_opcode + ICONST(3); + return cur_opcode + ICONST(3); } - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_ge_str_p_p_ic(opcode_t *cur_opcode, PARROT_INTERP) { if ((VTABLE_cmp_string(interp, PREG(1), PREG(2)) >= 0)) { - return (opcode_t *)cur_opcode + ICONST(3); + return cur_opcode + ICONST(3); } - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_ge_num_p_p_ic(opcode_t *cur_opcode, PARROT_INTERP) { if ((VTABLE_cmp_num(interp, PREG(1), PREG(2)) >= 0)) { - return (opcode_t *)cur_opcode + ICONST(3); + return cur_opcode + ICONST(3); } - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_if_null_p_ic(opcode_t *cur_opcode, PARROT_INTERP) { if (PMC_IS_NULL(PREG(1))) { - return (opcode_t *)cur_opcode + ICONST(2); + return cur_opcode + ICONST(2); } - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * Parrot_if_null_s_ic(opcode_t *cur_opcode, PARROT_INTERP) { if (STRING_IS_NULL(SREG(1))) { - return (opcode_t *)cur_opcode + ICONST(2); + return cur_opcode + ICONST(2); } - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * Parrot_unless_null_p_ic(opcode_t *cur_opcode, PARROT_INTERP) { if ((!PMC_IS_NULL(PREG(1)))) { - return (opcode_t *)cur_opcode + ICONST(2); + return cur_opcode + ICONST(2); } - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * Parrot_unless_null_s_ic(opcode_t *cur_opcode, PARROT_INTERP) { if ((!STRING_IS_NULL(SREG(1)))) { - return (opcode_t *)cur_opcode + ICONST(2); + return cur_opcode + ICONST(2); } - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * Parrot_cmp_i_i_i(opcode_t *cur_opcode, PARROT_INTERP) { IREG(1) = (IREG(2) < IREG(3)) ? (-1) : (IREG(2) > IREG(3)) ? (+1) : 0; - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_cmp_i_ic_i(opcode_t *cur_opcode, PARROT_INTERP) { IREG(1) = (ICONST(2) < IREG(3)) ? (-1) : (ICONST(2) > IREG(3)) ? (+1) : 0; - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_cmp_i_i_ic(opcode_t *cur_opcode, PARROT_INTERP) { IREG(1) = (IREG(2) < ICONST(3)) ? (-1) : (IREG(2) > ICONST(3)) ? (+1) : 0; - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_cmp_i_n_n(opcode_t *cur_opcode, PARROT_INTERP) { IREG(1) = (NREG(2) < NREG(3)) ? (-1) : (NREG(2) > NREG(3)) ? (+1) : 0; - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_cmp_i_nc_n(opcode_t *cur_opcode, PARROT_INTERP) { IREG(1) = (NCONST(2) < NREG(3)) ? (-1) : (NCONST(2) > NREG(3)) ? (+1) : 0; - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_cmp_i_n_nc(opcode_t *cur_opcode, PARROT_INTERP) { IREG(1) = (NREG(2) < NCONST(3)) ? (-1) : (NREG(2) > NCONST(3)) ? (+1) : 0; - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_cmp_i_s_s(opcode_t *cur_opcode, PARROT_INTERP) { IREG(1) = STRING_compare(interp, SREG(2), SREG(3)); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_cmp_i_sc_s(opcode_t *cur_opcode, PARROT_INTERP) { IREG(1) = STRING_compare(interp, SCONST(2), SREG(3)); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_cmp_i_s_sc(opcode_t *cur_opcode, PARROT_INTERP) { IREG(1) = STRING_compare(interp, SREG(2), SCONST(3)); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_cmp_i_p_p(opcode_t *cur_opcode, PARROT_INTERP) { IREG(1) = VTABLE_cmp(interp, PREG(2), PREG(3)); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * @@ -15836,7 +16155,7 @@ Parrot_cmp_i_p_i(opcode_t *cur_opcode, PARROT_INTERP) { const INTVAL l = VTABLE_get_integer(interp, PREG(2)); IREG(1) = (l < IREG(3)) ? (-1) : (l > IREG(3)) ? (+1) : 0; - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * @@ -15844,7 +16163,7 @@ Parrot_cmp_i_p_ic(opcode_t *cur_opcode, PARROT_INTERP) { const INTVAL l = VTABLE_get_integer(interp, PREG(2)); IREG(1) = (l < ICONST(3)) ? (-1) : (l > ICONST(3)) ? (+1) : 0; - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * @@ -15852,7 +16171,7 @@ Parrot_cmp_i_p_n(opcode_t *cur_opcode, PARROT_INTERP) { const FLOATVAL l = VTABLE_get_number(interp, PREG(2)); IREG(1) = (l < NREG(3)) ? (-1) : (l > NREG(3)) ? (+1) : 0; - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * @@ -15860,7 +16179,7 @@ Parrot_cmp_i_p_nc(opcode_t *cur_opcode, PARROT_INTERP) { const FLOATVAL l = VTABLE_get_number(interp, PREG(2)); IREG(1) = (l < NCONST(3)) ? (-1) : (l > NCONST(3)) ? (+1) : 0; - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * @@ -15868,7 +16187,7 @@ Parrot_cmp_i_p_s(opcode_t *cur_opcode, PARROT_INTERP) { STRING * const l = VTABLE_get_string(interp, PREG(2)); IREG(1) = STRING_compare(interp, l, SREG(3)); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * @@ -15876,26 +16195,26 @@ Parrot_cmp_i_p_sc(opcode_t *cur_opcode, PARROT_INTERP) { STRING * const l = VTABLE_get_string(interp, PREG(2)); IREG(1) = STRING_compare(interp, l, SCONST(3)); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_cmp_str_i_p_p(opcode_t *cur_opcode, PARROT_INTERP) { IREG(1) = VTABLE_cmp_string(interp, PREG(2), PREG(3)); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_cmp_num_i_p_p(opcode_t *cur_opcode, PARROT_INTERP) { IREG(1) = VTABLE_cmp_num(interp, PREG(2), PREG(3)); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_cmp_pmc_p_p_p(opcode_t *cur_opcode, PARROT_INTERP) { PREG(1) = VTABLE_cmp_pmc(interp, PREG(2), PREG(3)); PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp)); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * @@ -15907,31 +16226,31 @@ Parrot_issame_i_p_p(opcode_t *cur_opcode, PARROT_INTERP) { IREG(1) = VTABLE_is_same(interp, PREG(2), PREG(3)); } - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_issame_i_s_s(opcode_t *cur_opcode, PARROT_INTERP) { IREG(1) = (SREG(2) == SREG(3)); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_issame_i_sc_s(opcode_t *cur_opcode, PARROT_INTERP) { IREG(1) = (SCONST(2) == SREG(3)); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_issame_i_s_sc(opcode_t *cur_opcode, PARROT_INTERP) { IREG(1) = (SREG(2) == SCONST(3)); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_issame_i_sc_sc(opcode_t *cur_opcode, PARROT_INTERP) { IREG(1) = (SCONST(2) == SCONST(3)); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * @@ -15943,253 +16262,253 @@ Parrot_isntsame_i_p_p(opcode_t *cur_opcode, PARROT_INTERP) { IREG(1) = (!VTABLE_is_same(interp, PREG(2), PREG(3))); } - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_isntsame_i_s_s(opcode_t *cur_opcode, PARROT_INTERP) { IREG(1) = (SREG(2) != SREG(3)); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_isntsame_i_sc_s(opcode_t *cur_opcode, PARROT_INTERP) { IREG(1) = (SCONST(2) != SREG(3)); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_isntsame_i_s_sc(opcode_t *cur_opcode, PARROT_INTERP) { IREG(1) = (SREG(2) != SCONST(3)); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_isntsame_i_sc_sc(opcode_t *cur_opcode, PARROT_INTERP) { IREG(1) = (SCONST(2) != SCONST(3)); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_istrue_i_p(opcode_t *cur_opcode, PARROT_INTERP) { IREG(1) = VTABLE_get_bool(interp, PREG(2)); - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * Parrot_isfalse_i_p(opcode_t *cur_opcode, PARROT_INTERP) { IREG(1) = (!VTABLE_get_bool(interp, PREG(2))); - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * Parrot_isnull_i_p(opcode_t *cur_opcode, PARROT_INTERP) { IREG(1) = PMC_IS_NULL(PREG(2)); - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * Parrot_isnull_i_pc(opcode_t *cur_opcode, PARROT_INTERP) { IREG(1) = PMC_IS_NULL(PCONST(2)); - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * Parrot_isnull_i_s(opcode_t *cur_opcode, PARROT_INTERP) { IREG(1) = STRING_IS_NULL(SREG(2)); - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * Parrot_isnull_i_sc(opcode_t *cur_opcode, PARROT_INTERP) { IREG(1) = STRING_IS_NULL(SCONST(2)); - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * Parrot_isgt_i_p_p(opcode_t *cur_opcode, PARROT_INTERP) { IREG(1) = ((VTABLE_cmp(interp, PREG(2), PREG(3)) > 0)); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_isge_i_p_p(opcode_t *cur_opcode, PARROT_INTERP) { IREG(1) = ((VTABLE_cmp(interp, PREG(2), PREG(3)) >= 0)); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_isle_i_i_i(opcode_t *cur_opcode, PARROT_INTERP) { IREG(1) = (IREG(2) <= IREG(3)); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_isle_i_ic_i(opcode_t *cur_opcode, PARROT_INTERP) { IREG(1) = (ICONST(2) <= IREG(3)); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_isle_i_i_ic(opcode_t *cur_opcode, PARROT_INTERP) { IREG(1) = (IREG(2) <= ICONST(3)); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_isle_i_n_n(opcode_t *cur_opcode, PARROT_INTERP) { IREG(1) = (NREG(2) <= NREG(3)); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_isle_i_nc_n(opcode_t *cur_opcode, PARROT_INTERP) { IREG(1) = (NCONST(2) <= NREG(3)); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_isle_i_n_nc(opcode_t *cur_opcode, PARROT_INTERP) { IREG(1) = (NREG(2) <= NCONST(3)); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_isle_i_s_s(opcode_t *cur_opcode, PARROT_INTERP) { IREG(1) = (STRING_compare(interp, SREG(2), SREG(3)) <= 0); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_isle_i_sc_s(opcode_t *cur_opcode, PARROT_INTERP) { IREG(1) = (STRING_compare(interp, SCONST(2), SREG(3)) <= 0); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_isle_i_s_sc(opcode_t *cur_opcode, PARROT_INTERP) { IREG(1) = (STRING_compare(interp, SREG(2), SCONST(3)) <= 0); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_isle_i_p_p(opcode_t *cur_opcode, PARROT_INTERP) { IREG(1) = ((VTABLE_cmp(interp, PREG(2), PREG(3)) <= 0)); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_islt_i_i_i(opcode_t *cur_opcode, PARROT_INTERP) { IREG(1) = ((IREG(2) < IREG(3))) ? 1 : 0; - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_islt_i_ic_i(opcode_t *cur_opcode, PARROT_INTERP) { IREG(1) = ((ICONST(2) < IREG(3))) ? 1 : 0; - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_islt_i_i_ic(opcode_t *cur_opcode, PARROT_INTERP) { IREG(1) = ((IREG(2) < ICONST(3))) ? 1 : 0; - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_islt_i_n_n(opcode_t *cur_opcode, PARROT_INTERP) { IREG(1) = (NREG(2) < NREG(3)); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_islt_i_nc_n(opcode_t *cur_opcode, PARROT_INTERP) { IREG(1) = (NCONST(2) < NREG(3)); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_islt_i_n_nc(opcode_t *cur_opcode, PARROT_INTERP) { IREG(1) = (NREG(2) < NCONST(3)); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_islt_i_s_s(opcode_t *cur_opcode, PARROT_INTERP) { IREG(1) = (STRING_compare(interp, SREG(2), SREG(3)) < 0); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_islt_i_sc_s(opcode_t *cur_opcode, PARROT_INTERP) { IREG(1) = (STRING_compare(interp, SCONST(2), SREG(3)) < 0); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_islt_i_s_sc(opcode_t *cur_opcode, PARROT_INTERP) { IREG(1) = (STRING_compare(interp, SREG(2), SCONST(3)) < 0); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_islt_i_p_p(opcode_t *cur_opcode, PARROT_INTERP) { IREG(1) = ((VTABLE_cmp(interp, PREG(2), PREG(3)) < 0)); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_iseq_i_i_i(opcode_t *cur_opcode, PARROT_INTERP) { IREG(1) = ((IREG(2) == IREG(3))) ? 1 : 0; - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_iseq_i_ic_i(opcode_t *cur_opcode, PARROT_INTERP) { IREG(1) = ((ICONST(2) == IREG(3))) ? 1 : 0; - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_iseq_i_i_ic(opcode_t *cur_opcode, PARROT_INTERP) { IREG(1) = ((IREG(2) == ICONST(3))) ? 1 : 0; - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_iseq_i_n_n(opcode_t *cur_opcode, PARROT_INTERP) { IREG(1) = (NREG(2) == NREG(3)); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_iseq_i_nc_n(opcode_t *cur_opcode, PARROT_INTERP) { IREG(1) = (NCONST(2) == NREG(3)); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_iseq_i_n_nc(opcode_t *cur_opcode, PARROT_INTERP) { IREG(1) = (NREG(2) == NCONST(3)); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_iseq_i_s_s(opcode_t *cur_opcode, PARROT_INTERP) { IREG(1) = STRING_equal(interp, SREG(2), SREG(3)); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_iseq_i_sc_s(opcode_t *cur_opcode, PARROT_INTERP) { IREG(1) = STRING_equal(interp, SCONST(2), SREG(3)); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_iseq_i_s_sc(opcode_t *cur_opcode, PARROT_INTERP) { IREG(1) = STRING_equal(interp, SREG(2), SCONST(3)); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * @@ -16201,61 +16520,61 @@ Parrot_iseq_i_p_p(opcode_t *cur_opcode, PARROT_INTERP) { IREG(1) = VTABLE_is_equal(interp, PREG(2), PREG(3)); } - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_isne_i_i_i(opcode_t *cur_opcode, PARROT_INTERP) { IREG(1) = ((IREG(2) == IREG(3))) ? 0 : 1; - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_isne_i_ic_i(opcode_t *cur_opcode, PARROT_INTERP) { IREG(1) = ((ICONST(2) == IREG(3))) ? 0 : 1; - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_isne_i_i_ic(opcode_t *cur_opcode, PARROT_INTERP) { IREG(1) = ((IREG(2) == ICONST(3))) ? 0 : 1; - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_isne_i_n_n(opcode_t *cur_opcode, PARROT_INTERP) { IREG(1) = (NREG(2) != NREG(3)); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_isne_i_nc_n(opcode_t *cur_opcode, PARROT_INTERP) { IREG(1) = (NCONST(2) != NREG(3)); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_isne_i_n_nc(opcode_t *cur_opcode, PARROT_INTERP) { IREG(1) = (NREG(2) != NCONST(3)); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_isne_i_s_s(opcode_t *cur_opcode, PARROT_INTERP) { IREG(1) = (!STRING_equal(interp, SREG(2), SREG(3))); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_isne_i_sc_s(opcode_t *cur_opcode, PARROT_INTERP) { IREG(1) = (!STRING_equal(interp, SCONST(2), SREG(3))); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_isne_i_s_sc(opcode_t *cur_opcode, PARROT_INTERP) { IREG(1) = (!STRING_equal(interp, SREG(2), SCONST(3))); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * @@ -16267,49 +16586,49 @@ Parrot_isne_i_p_p(opcode_t *cur_opcode, PARROT_INTERP) { IREG(1) = (!VTABLE_is_equal(interp, PREG(2), PREG(3))); } - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_and_i_i_i(opcode_t *cur_opcode, PARROT_INTERP) { IREG(1) = IREG(2) ? IREG(3) : IREG(2); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_and_i_ic_i(opcode_t *cur_opcode, PARROT_INTERP) { IREG(1) = ICONST(2) ? IREG(3) : ICONST(2); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_and_i_i_ic(opcode_t *cur_opcode, PARROT_INTERP) { IREG(1) = IREG(2) ? ICONST(3) : IREG(2); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_and_p_p_p(opcode_t *cur_opcode, PARROT_INTERP) { PREG(1) = VTABLE_get_bool(interp, PREG(2)) ? PREG(3) : PREG(2); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_not_i(opcode_t *cur_opcode, PARROT_INTERP) { IREG(1) = (!IREG(1)); - return (opcode_t *)cur_opcode + 2; + return cur_opcode + 2; } opcode_t * Parrot_not_i_i(opcode_t *cur_opcode, PARROT_INTERP) { IREG(1) = (!IREG(2)); - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * Parrot_not_p(opcode_t *cur_opcode, PARROT_INTERP) { VTABLE_set_bool(interp, PREG(1), (!VTABLE_get_bool(interp, PREG(1)))); - return (opcode_t *)cur_opcode + 2; + return cur_opcode + 2; } opcode_t * @@ -16322,49 +16641,49 @@ Parrot_not_p_p(opcode_t *cur_opcode, PARROT_INTERP) { VTABLE_set_bool(interp, PREG(1), a); PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp)); - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * Parrot_or_i_i_i(opcode_t *cur_opcode, PARROT_INTERP) { IREG(1) = IREG(2) ? IREG(2) : IREG(3); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_or_i_ic_i(opcode_t *cur_opcode, PARROT_INTERP) { IREG(1) = ICONST(2) ? ICONST(2) : IREG(3); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_or_i_i_ic(opcode_t *cur_opcode, PARROT_INTERP) { IREG(1) = IREG(2) ? IREG(2) : ICONST(3); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_or_p_p_p(opcode_t *cur_opcode, PARROT_INTERP) { PREG(1) = VTABLE_get_bool(interp, PREG(2)) ? PREG(2) : PREG(3); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_xor_i_i_i(opcode_t *cur_opcode, PARROT_INTERP) { IREG(1) = ((IREG(2) && (!IREG(3)))) ? IREG(2) : ((IREG(3) && (!IREG(2)))) ? IREG(3) : 0; - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_xor_i_ic_i(opcode_t *cur_opcode, PARROT_INTERP) { IREG(1) = ((ICONST(2) && (!IREG(3)))) ? ICONST(2) : ((IREG(3) && (!ICONST(2)))) ? IREG(3) : 0; - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_xor_i_i_ic(opcode_t *cur_opcode, PARROT_INTERP) { IREG(1) = ((IREG(2) && (!ICONST(3)))) ? IREG(2) : ((ICONST(3) && (!IREG(2)))) ? ICONST(3) : 0; - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * @@ -16386,19 +16705,19 @@ Parrot_xor_p_p_p(opcode_t *cur_opcode, PARROT_INTERP) { } - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_print_i(opcode_t *cur_opcode, PARROT_INTERP) { Parrot_io_printf(interp, INTVAL_FMT, (INTVAL)IREG(1)); - return (opcode_t *)cur_opcode + 2; + return cur_opcode + 2; } opcode_t * Parrot_print_ic(opcode_t *cur_opcode, PARROT_INTERP) { Parrot_io_printf(interp, INTVAL_FMT, (INTVAL)ICONST(1)); - return (opcode_t *)cur_opcode + 2; + return cur_opcode + 2; } opcode_t * @@ -16416,7 +16735,7 @@ Parrot_print_n(opcode_t *cur_opcode, PARROT_INTERP) { #endif ; - return (opcode_t *)cur_opcode + 2; + return cur_opcode + 2; } opcode_t * @@ -16434,7 +16753,7 @@ Parrot_print_nc(opcode_t *cur_opcode, PARROT_INTERP) { #endif ; - return (opcode_t *)cur_opcode + 2; + return cur_opcode + 2; } opcode_t * @@ -16445,7 +16764,7 @@ Parrot_print_s(opcode_t *cur_opcode, PARROT_INTERP) { Parrot_io_putps(interp, _PIO_STDOUT(interp), s); } - return (opcode_t *)cur_opcode + 2; + return cur_opcode + 2; } opcode_t * @@ -16456,7 +16775,7 @@ Parrot_print_sc(opcode_t *cur_opcode, PARROT_INTERP) { Parrot_io_putps(interp, _PIO_STDOUT(interp), s); } - return (opcode_t *)cur_opcode + 2; + return cur_opcode + 2; } opcode_t * @@ -16468,19 +16787,19 @@ Parrot_print_p(opcode_t *cur_opcode, PARROT_INTERP) { Parrot_io_putps(interp, _PIO_STDOUT(interp), s); } - return (opcode_t *)cur_opcode + 2; + return cur_opcode + 2; } opcode_t * Parrot_say_i(opcode_t *cur_opcode, PARROT_INTERP) { Parrot_io_printf(interp, INTVAL_FMT "\n", (INTVAL)IREG(1)); - return (opcode_t *)cur_opcode + 2; + return cur_opcode + 2; } opcode_t * Parrot_say_ic(opcode_t *cur_opcode, PARROT_INTERP) { Parrot_io_printf(interp, INTVAL_FMT "\n", (INTVAL)ICONST(1)); - return (opcode_t *)cur_opcode + 2; + return cur_opcode + 2; } opcode_t * @@ -16498,7 +16817,7 @@ Parrot_say_n(opcode_t *cur_opcode, PARROT_INTERP) { #endif ; - return (opcode_t *)cur_opcode + 2; + return cur_opcode + 2; } opcode_t * @@ -16516,7 +16835,7 @@ Parrot_say_nc(opcode_t *cur_opcode, PARROT_INTERP) { #endif ; - return (opcode_t *)cur_opcode + 2; + return cur_opcode + 2; } opcode_t * @@ -16528,7 +16847,7 @@ Parrot_say_s(opcode_t *cur_opcode, PARROT_INTERP) { } Parrot_io_putps(interp, _PIO_STDOUT(interp), Parrot_str_new_constant(interp, "\n")); - return (opcode_t *)cur_opcode + 2; + return cur_opcode + 2; } opcode_t * @@ -16540,7 +16859,7 @@ Parrot_say_sc(opcode_t *cur_opcode, PARROT_INTERP) { } Parrot_io_putps(interp, _PIO_STDOUT(interp), Parrot_str_new_constant(interp, "\n")); - return (opcode_t *)cur_opcode + 2; + return cur_opcode + 2; } opcode_t * @@ -16562,7 +16881,7 @@ Parrot_say_p(opcode_t *cur_opcode, PARROT_INTERP) { Parrot_io_putps(interp, _PIO_STDOUT(interp), Parrot_str_new_constant(interp, "\n")); } - return (opcode_t *)cur_opcode + 2; + return cur_opcode + 2; } opcode_t * @@ -16573,7 +16892,7 @@ Parrot_print_p_i(opcode_t *cur_opcode, PARROT_INTERP) { Parrot_io_putps(interp, PREG(1), s); } - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * @@ -16584,7 +16903,7 @@ Parrot_print_p_ic(opcode_t *cur_opcode, PARROT_INTERP) { Parrot_io_putps(interp, PREG(1), s); } - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * @@ -16595,7 +16914,7 @@ Parrot_print_p_n(opcode_t *cur_opcode, PARROT_INTERP) { Parrot_io_putps(interp, PREG(1), s); } - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * @@ -16606,7 +16925,7 @@ Parrot_print_p_nc(opcode_t *cur_opcode, PARROT_INTERP) { Parrot_io_putps(interp, PREG(1), s); } - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * @@ -16615,7 +16934,7 @@ Parrot_print_p_s(opcode_t *cur_opcode, PARROT_INTERP) { Parrot_io_putps(interp, PREG(1), SREG(2)); } - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * @@ -16624,7 +16943,7 @@ Parrot_print_p_sc(opcode_t *cur_opcode, PARROT_INTERP) { Parrot_io_putps(interp, PREG(1), SCONST(2)); } - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * @@ -16635,203 +16954,203 @@ Parrot_print_p_p(opcode_t *cur_opcode, PARROT_INTERP) { Parrot_io_putps(interp, PREG(1), s); } - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * Parrot_getstdin_p(opcode_t *cur_opcode, PARROT_INTERP) { PREG(1) = _PIO_STDIN(interp); PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp)); - return (opcode_t *)cur_opcode + 2; + return cur_opcode + 2; } opcode_t * Parrot_getstdout_p(opcode_t *cur_opcode, PARROT_INTERP) { PREG(1) = _PIO_STDOUT(interp); PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp)); - return (opcode_t *)cur_opcode + 2; + return cur_opcode + 2; } opcode_t * Parrot_getstderr_p(opcode_t *cur_opcode, PARROT_INTERP) { PREG(1) = _PIO_STDERR(interp); PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp)); - return (opcode_t *)cur_opcode + 2; + return cur_opcode + 2; } opcode_t * Parrot_abs_i(opcode_t *cur_opcode, PARROT_INTERP) { IREG(1) = abs(IREG(1)); - return (opcode_t *)cur_opcode + 2; + return cur_opcode + 2; } opcode_t * Parrot_abs_n(opcode_t *cur_opcode, PARROT_INTERP) { NREG(1) = fabs(NREG(1)); - return (opcode_t *)cur_opcode + 2; + return cur_opcode + 2; } opcode_t * Parrot_abs_i_i(opcode_t *cur_opcode, PARROT_INTERP) { IREG(1) = abs(IREG(2)); - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * Parrot_abs_n_n(opcode_t *cur_opcode, PARROT_INTERP) { NREG(1) = fabs(NREG(2)); - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * Parrot_abs_p(opcode_t *cur_opcode, PARROT_INTERP) { VTABLE_i_absolute(interp, PREG(1)); - return (opcode_t *)cur_opcode + 2; + return cur_opcode + 2; } opcode_t * Parrot_abs_p_p(opcode_t *cur_opcode, PARROT_INTERP) { PREG(1) = VTABLE_absolute(interp, PREG(2), PREG(1)); PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp)); - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * Parrot_add_i_i(opcode_t *cur_opcode, PARROT_INTERP) { (IREG(1) += IREG(2)); - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * Parrot_add_i_ic(opcode_t *cur_opcode, PARROT_INTERP) { (IREG(1) += ICONST(2)); - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * Parrot_add_n_n(opcode_t *cur_opcode, PARROT_INTERP) { (NREG(1) += NREG(2)); - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * Parrot_add_n_nc(opcode_t *cur_opcode, PARROT_INTERP) { (NREG(1) += NCONST(2)); - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * Parrot_add_p_p(opcode_t *cur_opcode, PARROT_INTERP) { VTABLE_i_add(interp, PREG(1), PREG(2)); - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * Parrot_add_p_i(opcode_t *cur_opcode, PARROT_INTERP) { VTABLE_i_add_int(interp, PREG(1), IREG(2)); - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * Parrot_add_p_ic(opcode_t *cur_opcode, PARROT_INTERP) { VTABLE_i_add_int(interp, PREG(1), ICONST(2)); - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * Parrot_add_p_n(opcode_t *cur_opcode, PARROT_INTERP) { VTABLE_i_add_float(interp, PREG(1), NREG(2)); - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * Parrot_add_p_nc(opcode_t *cur_opcode, PARROT_INTERP) { VTABLE_i_add_float(interp, PREG(1), NCONST(2)); - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * Parrot_add_i_i_i(opcode_t *cur_opcode, PARROT_INTERP) { IREG(1) = (IREG(2) + IREG(3)); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_add_i_ic_i(opcode_t *cur_opcode, PARROT_INTERP) { IREG(1) = (ICONST(2) + IREG(3)); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_add_i_i_ic(opcode_t *cur_opcode, PARROT_INTERP) { IREG(1) = (IREG(2) + ICONST(3)); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_add_n_n_n(opcode_t *cur_opcode, PARROT_INTERP) { NREG(1) = (NREG(2) + NREG(3)); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_add_n_nc_n(opcode_t *cur_opcode, PARROT_INTERP) { NREG(1) = (NCONST(2) + NREG(3)); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_add_n_n_nc(opcode_t *cur_opcode, PARROT_INTERP) { NREG(1) = (NREG(2) + NCONST(3)); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_add_p_p_p(opcode_t *cur_opcode, PARROT_INTERP) { PREG(1) = VTABLE_add(interp, PREG(2), PREG(3), PREG(1)); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_add_p_p_i(opcode_t *cur_opcode, PARROT_INTERP) { PREG(1) = VTABLE_add_int(interp, PREG(2), IREG(3), PREG(1)); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_add_p_p_ic(opcode_t *cur_opcode, PARROT_INTERP) { PREG(1) = VTABLE_add_int(interp, PREG(2), ICONST(3), PREG(1)); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_add_p_p_n(opcode_t *cur_opcode, PARROT_INTERP) { PREG(1) = VTABLE_add_float(interp, PREG(2), NREG(3), PREG(1)); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_add_p_p_nc(opcode_t *cur_opcode, PARROT_INTERP) { PREG(1) = VTABLE_add_float(interp, PREG(2), NCONST(3), PREG(1)); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_dec_i(opcode_t *cur_opcode, PARROT_INTERP) { (IREG(1)--); - return (opcode_t *)cur_opcode + 2; + return cur_opcode + 2; } opcode_t * Parrot_dec_n(opcode_t *cur_opcode, PARROT_INTERP) { (NREG(1)--); - return (opcode_t *)cur_opcode + 2; + return cur_opcode + 2; } opcode_t * Parrot_dec_p(opcode_t *cur_opcode, PARROT_INTERP) { VTABLE_decrement(interp, PREG(1)); - return (opcode_t *)cur_opcode + 2; + return cur_opcode + 2; } opcode_t * @@ -16845,7 +17164,7 @@ Parrot_div_i_i(opcode_t *cur_opcode, PARROT_INTERP) { } (IREG(1) /= den); - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * @@ -16859,7 +17178,7 @@ Parrot_div_i_ic(opcode_t *cur_opcode, PARROT_INTERP) { } (IREG(1) /= den); - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * @@ -16873,7 +17192,7 @@ Parrot_div_n_n(opcode_t *cur_opcode, PARROT_INTERP) { } (NREG(1) /= den); - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * @@ -16887,37 +17206,37 @@ Parrot_div_n_nc(opcode_t *cur_opcode, PARROT_INTERP) { } (NREG(1) /= den); - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * Parrot_div_p_p(opcode_t *cur_opcode, PARROT_INTERP) { VTABLE_i_divide(interp, PREG(1), PREG(2)); - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * Parrot_div_p_i(opcode_t *cur_opcode, PARROT_INTERP) { VTABLE_i_divide_int(interp, PREG(1), IREG(2)); - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * Parrot_div_p_ic(opcode_t *cur_opcode, PARROT_INTERP) { VTABLE_i_divide_int(interp, PREG(1), ICONST(2)); - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * Parrot_div_p_n(opcode_t *cur_opcode, PARROT_INTERP) { VTABLE_i_divide_float(interp, PREG(1), NREG(2)); - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * Parrot_div_p_nc(opcode_t *cur_opcode, PARROT_INTERP) { VTABLE_i_divide_float(interp, PREG(1), NCONST(2)); - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * @@ -16931,7 +17250,7 @@ Parrot_div_i_i_i(opcode_t *cur_opcode, PARROT_INTERP) { } IREG(1) = (IREG(2) / den); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * @@ -16945,7 +17264,7 @@ Parrot_div_i_ic_i(opcode_t *cur_opcode, PARROT_INTERP) { } IREG(1) = (ICONST(2) / den); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * @@ -16959,7 +17278,7 @@ Parrot_div_i_i_ic(opcode_t *cur_opcode, PARROT_INTERP) { } IREG(1) = (IREG(2) / den); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * @@ -16973,7 +17292,7 @@ Parrot_div_i_ic_ic(opcode_t *cur_opcode, PARROT_INTERP) { } IREG(1) = (ICONST(2) / den); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * @@ -16987,7 +17306,7 @@ Parrot_div_n_n_n(opcode_t *cur_opcode, PARROT_INTERP) { } NREG(1) = (NREG(2) / den); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * @@ -17001,7 +17320,7 @@ Parrot_div_n_nc_n(opcode_t *cur_opcode, PARROT_INTERP) { } NREG(1) = (NCONST(2) / den); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * @@ -17015,7 +17334,7 @@ Parrot_div_n_n_nc(opcode_t *cur_opcode, PARROT_INTERP) { } NREG(1) = (NREG(2) / den); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * @@ -17029,37 +17348,37 @@ Parrot_div_n_nc_nc(opcode_t *cur_opcode, PARROT_INTERP) { } NREG(1) = (NCONST(2) / den); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_div_p_p_p(opcode_t *cur_opcode, PARROT_INTERP) { PREG(1) = VTABLE_divide(interp, PREG(2), PREG(3), PREG(1)); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_div_p_p_i(opcode_t *cur_opcode, PARROT_INTERP) { PREG(1) = VTABLE_divide_int(interp, PREG(2), IREG(3), PREG(1)); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_div_p_p_ic(opcode_t *cur_opcode, PARROT_INTERP) { PREG(1) = VTABLE_divide_int(interp, PREG(2), ICONST(3), PREG(1)); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_div_p_p_n(opcode_t *cur_opcode, PARROT_INTERP) { PREG(1) = VTABLE_divide_float(interp, PREG(2), NREG(3), PREG(1)); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_div_p_p_nc(opcode_t *cur_opcode, PARROT_INTERP) { PREG(1) = VTABLE_divide_float(interp, PREG(2), NCONST(3), PREG(1)); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * @@ -17075,7 +17394,7 @@ Parrot_fdiv_i_i(opcode_t *cur_opcode, PARROT_INTERP) { f = floor((((FLOATVAL)IREG(1)) / den)); IREG(1) = (INTVAL)f; - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * @@ -17091,7 +17410,7 @@ Parrot_fdiv_i_ic(opcode_t *cur_opcode, PARROT_INTERP) { f = floor((((FLOATVAL)IREG(1)) / den)); IREG(1) = (INTVAL)f; - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * @@ -17105,7 +17424,7 @@ Parrot_fdiv_n_n(opcode_t *cur_opcode, PARROT_INTERP) { } NREG(1) = floor((NREG(1) / den)); - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * @@ -17119,37 +17438,37 @@ Parrot_fdiv_n_nc(opcode_t *cur_opcode, PARROT_INTERP) { } NREG(1) = floor((NREG(1) / den)); - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * Parrot_fdiv_p_p(opcode_t *cur_opcode, PARROT_INTERP) { VTABLE_i_floor_divide(interp, PREG(1), PREG(2)); - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * Parrot_fdiv_p_i(opcode_t *cur_opcode, PARROT_INTERP) { VTABLE_i_floor_divide_int(interp, PREG(1), IREG(2)); - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * Parrot_fdiv_p_ic(opcode_t *cur_opcode, PARROT_INTERP) { VTABLE_i_floor_divide_int(interp, PREG(1), ICONST(2)); - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * Parrot_fdiv_p_n(opcode_t *cur_opcode, PARROT_INTERP) { VTABLE_i_floor_divide_float(interp, PREG(1), NREG(2)); - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * Parrot_fdiv_p_nc(opcode_t *cur_opcode, PARROT_INTERP) { VTABLE_i_floor_divide_float(interp, PREG(1), NCONST(2)); - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * @@ -17165,7 +17484,7 @@ Parrot_fdiv_i_i_i(opcode_t *cur_opcode, PARROT_INTERP) { f = floor(((FLOATVAL)IREG(2) / den)); IREG(1) = (INTVAL)f; - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * @@ -17181,7 +17500,7 @@ Parrot_fdiv_i_ic_i(opcode_t *cur_opcode, PARROT_INTERP) { f = floor(((FLOATVAL)ICONST(2) / den)); IREG(1) = (INTVAL)f; - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * @@ -17197,7 +17516,7 @@ Parrot_fdiv_i_i_ic(opcode_t *cur_opcode, PARROT_INTERP) { f = floor(((FLOATVAL)IREG(2) / den)); IREG(1) = (INTVAL)f; - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * @@ -17211,7 +17530,7 @@ Parrot_fdiv_n_n_n(opcode_t *cur_opcode, PARROT_INTERP) { } NREG(1) = floor((NREG(2) / den)); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * @@ -17225,7 +17544,7 @@ Parrot_fdiv_n_nc_n(opcode_t *cur_opcode, PARROT_INTERP) { } NREG(1) = floor((NCONST(2) / den)); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * @@ -17239,43 +17558,43 @@ Parrot_fdiv_n_n_nc(opcode_t *cur_opcode, PARROT_INTERP) { } NREG(1) = floor((NREG(2) / den)); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_fdiv_p_p_p(opcode_t *cur_opcode, PARROT_INTERP) { PREG(1) = VTABLE_floor_divide(interp, PREG(2), PREG(3), PREG(1)); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_fdiv_p_p_i(opcode_t *cur_opcode, PARROT_INTERP) { PREG(1) = VTABLE_floor_divide_int(interp, PREG(2), IREG(3), PREG(1)); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_fdiv_p_p_ic(opcode_t *cur_opcode, PARROT_INTERP) { PREG(1) = VTABLE_floor_divide_int(interp, PREG(2), ICONST(3), PREG(1)); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_fdiv_p_p_n(opcode_t *cur_opcode, PARROT_INTERP) { PREG(1) = VTABLE_floor_divide_float(interp, PREG(2), NREG(3), PREG(1)); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_fdiv_p_p_nc(opcode_t *cur_opcode, PARROT_INTERP) { PREG(1) = VTABLE_floor_divide_float(interp, PREG(2), NCONST(3), PREG(1)); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_ceil_n(opcode_t *cur_opcode, PARROT_INTERP) { NREG(1) = ceil(NREG(1)); - return (opcode_t *)cur_opcode + 2; + return cur_opcode + 2; } opcode_t * @@ -17283,19 +17602,19 @@ Parrot_ceil_i_n(opcode_t *cur_opcode, PARROT_INTERP) { const FLOATVAL f = ceil(NREG(2)); IREG(1) = (INTVAL)f; - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * Parrot_ceil_n_n(opcode_t *cur_opcode, PARROT_INTERP) { NREG(1) = ceil(NREG(2)); - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * Parrot_floor_n(opcode_t *cur_opcode, PARROT_INTERP) { NREG(1) = floor(NREG(1)); - return (opcode_t *)cur_opcode + 2; + return cur_opcode + 2; } opcode_t * @@ -17303,434 +17622,446 @@ Parrot_floor_i_n(opcode_t *cur_opcode, PARROT_INTERP) { const FLOATVAL f = floor(NREG(2)); IREG(1) = (INTVAL)f; - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * Parrot_floor_n_n(opcode_t *cur_opcode, PARROT_INTERP) { NREG(1) = floor(NREG(2)); - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * Parrot_inc_i(opcode_t *cur_opcode, PARROT_INTERP) { (IREG(1)++); - return (opcode_t *)cur_opcode + 2; + return cur_opcode + 2; } opcode_t * Parrot_inc_n(opcode_t *cur_opcode, PARROT_INTERP) { (NREG(1)++); - return (opcode_t *)cur_opcode + 2; + return cur_opcode + 2; } opcode_t * Parrot_inc_p(opcode_t *cur_opcode, PARROT_INTERP) { VTABLE_increment(interp, PREG(1)); - return (opcode_t *)cur_opcode + 2; + return cur_opcode + 2; } opcode_t * Parrot_mod_i_i(opcode_t *cur_opcode, PARROT_INTERP) { IREG(1) = Parrot_util_intval_mod(IREG(1), IREG(2)); - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * Parrot_mod_i_ic(opcode_t *cur_opcode, PARROT_INTERP) { IREG(1) = Parrot_util_intval_mod(IREG(1), ICONST(2)); - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * Parrot_mod_n_n(opcode_t *cur_opcode, PARROT_INTERP) { NREG(1) = Parrot_util_floatval_mod(NREG(1), NREG(2)); - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * Parrot_mod_n_nc(opcode_t *cur_opcode, PARROT_INTERP) { NREG(1) = Parrot_util_floatval_mod(NREG(1), NCONST(2)); - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * Parrot_mod_p_p(opcode_t *cur_opcode, PARROT_INTERP) { VTABLE_i_modulus(interp, PREG(1), PREG(2)); - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * Parrot_mod_p_i(opcode_t *cur_opcode, PARROT_INTERP) { VTABLE_i_modulus_int(interp, PREG(1), IREG(2)); - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * Parrot_mod_p_ic(opcode_t *cur_opcode, PARROT_INTERP) { VTABLE_i_modulus_int(interp, PREG(1), ICONST(2)); - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * Parrot_mod_p_n(opcode_t *cur_opcode, PARROT_INTERP) { VTABLE_i_modulus_float(interp, PREG(1), NREG(2)); - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * Parrot_mod_p_nc(opcode_t *cur_opcode, PARROT_INTERP) { VTABLE_i_modulus_float(interp, PREG(1), NCONST(2)); - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * Parrot_mod_i_i_i(opcode_t *cur_opcode, PARROT_INTERP) { IREG(1) = Parrot_util_intval_mod(IREG(2), IREG(3)); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_mod_i_ic_i(opcode_t *cur_opcode, PARROT_INTERP) { IREG(1) = Parrot_util_intval_mod(ICONST(2), IREG(3)); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_mod_i_i_ic(opcode_t *cur_opcode, PARROT_INTERP) { IREG(1) = Parrot_util_intval_mod(IREG(2), ICONST(3)); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_mod_n_n_n(opcode_t *cur_opcode, PARROT_INTERP) { NREG(1) = Parrot_util_floatval_mod(NREG(2), NREG(3)); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_mod_n_nc_n(opcode_t *cur_opcode, PARROT_INTERP) { NREG(1) = Parrot_util_floatval_mod(NCONST(2), NREG(3)); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_mod_n_n_nc(opcode_t *cur_opcode, PARROT_INTERP) { NREG(1) = Parrot_util_floatval_mod(NREG(2), NCONST(3)); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_mod_p_p_p(opcode_t *cur_opcode, PARROT_INTERP) { PREG(1) = VTABLE_modulus(interp, PREG(2), PREG(3), PREG(1)); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_mod_p_p_i(opcode_t *cur_opcode, PARROT_INTERP) { PREG(1) = VTABLE_modulus_int(interp, PREG(2), IREG(3), PREG(1)); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_mod_p_p_ic(opcode_t *cur_opcode, PARROT_INTERP) { PREG(1) = VTABLE_modulus_int(interp, PREG(2), ICONST(3), PREG(1)); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_mod_p_p_n(opcode_t *cur_opcode, PARROT_INTERP) { PREG(1) = VTABLE_modulus_float(interp, PREG(2), NREG(3), PREG(1)); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_mod_p_p_nc(opcode_t *cur_opcode, PARROT_INTERP) { PREG(1) = VTABLE_modulus_float(interp, PREG(2), NCONST(3), PREG(1)); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_mul_i_i(opcode_t *cur_opcode, PARROT_INTERP) { (IREG(1) *= IREG(2)); - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * Parrot_mul_i_ic(opcode_t *cur_opcode, PARROT_INTERP) { (IREG(1) *= ICONST(2)); - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * Parrot_mul_n_n(opcode_t *cur_opcode, PARROT_INTERP) { (NREG(1) *= NREG(2)); - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * Parrot_mul_n_nc(opcode_t *cur_opcode, PARROT_INTERP) { (NREG(1) *= NCONST(2)); - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * Parrot_mul_p_p(opcode_t *cur_opcode, PARROT_INTERP) { VTABLE_i_multiply(interp, PREG(1), PREG(2)); - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * Parrot_mul_p_i(opcode_t *cur_opcode, PARROT_INTERP) { VTABLE_i_multiply_int(interp, PREG(1), IREG(2)); - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * Parrot_mul_p_ic(opcode_t *cur_opcode, PARROT_INTERP) { VTABLE_i_multiply_int(interp, PREG(1), ICONST(2)); - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * Parrot_mul_p_n(opcode_t *cur_opcode, PARROT_INTERP) { VTABLE_i_multiply_float(interp, PREG(1), NREG(2)); - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * Parrot_mul_p_nc(opcode_t *cur_opcode, PARROT_INTERP) { VTABLE_i_multiply_float(interp, PREG(1), NCONST(2)); - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * Parrot_mul_i_i_i(opcode_t *cur_opcode, PARROT_INTERP) { IREG(1) = (IREG(2) * IREG(3)); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_mul_i_ic_i(opcode_t *cur_opcode, PARROT_INTERP) { IREG(1) = (ICONST(2) * IREG(3)); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_mul_i_i_ic(opcode_t *cur_opcode, PARROT_INTERP) { IREG(1) = (IREG(2) * ICONST(3)); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_mul_n_n_n(opcode_t *cur_opcode, PARROT_INTERP) { NREG(1) = (NREG(2) * NREG(3)); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_mul_n_nc_n(opcode_t *cur_opcode, PARROT_INTERP) { NREG(1) = (NCONST(2) * NREG(3)); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_mul_n_n_nc(opcode_t *cur_opcode, PARROT_INTERP) { NREG(1) = (NREG(2) * NCONST(3)); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_mul_p_p_p(opcode_t *cur_opcode, PARROT_INTERP) { PREG(1) = VTABLE_multiply(interp, PREG(2), PREG(3), PREG(1)); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_mul_p_p_i(opcode_t *cur_opcode, PARROT_INTERP) { PREG(1) = VTABLE_multiply_int(interp, PREG(2), IREG(3), PREG(1)); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_mul_p_p_ic(opcode_t *cur_opcode, PARROT_INTERP) { PREG(1) = VTABLE_multiply_int(interp, PREG(2), ICONST(3), PREG(1)); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_mul_p_p_n(opcode_t *cur_opcode, PARROT_INTERP) { PREG(1) = VTABLE_multiply_float(interp, PREG(2), NREG(3), PREG(1)); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_mul_p_p_nc(opcode_t *cur_opcode, PARROT_INTERP) { PREG(1) = VTABLE_multiply_float(interp, PREG(2), NCONST(3), PREG(1)); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_neg_i(opcode_t *cur_opcode, PARROT_INTERP) { IREG(1) = (-IREG(1)); - return (opcode_t *)cur_opcode + 2; + return cur_opcode + 2; } opcode_t * Parrot_neg_n(opcode_t *cur_opcode, PARROT_INTERP) { NREG(1) = (-NREG(1)); - return (opcode_t *)cur_opcode + 2; + return cur_opcode + 2; } opcode_t * Parrot_neg_p(opcode_t *cur_opcode, PARROT_INTERP) { VTABLE_i_neg(interp, PREG(1)); - return (opcode_t *)cur_opcode + 2; + return cur_opcode + 2; } opcode_t * Parrot_neg_i_i(opcode_t *cur_opcode, PARROT_INTERP) { IREG(1) = (-IREG(2)); - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * Parrot_neg_n_n(opcode_t *cur_opcode, PARROT_INTERP) { NREG(1) = (-NREG(2)); - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * Parrot_neg_p_p(opcode_t *cur_opcode, PARROT_INTERP) { PREG(1) = VTABLE_neg(interp, PREG(2), PREG(1)); PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp)); - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * Parrot_sub_i_i(opcode_t *cur_opcode, PARROT_INTERP) { (IREG(1) -= IREG(2)); - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * Parrot_sub_i_ic(opcode_t *cur_opcode, PARROT_INTERP) { (IREG(1) -= ICONST(2)); - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * Parrot_sub_n_n(opcode_t *cur_opcode, PARROT_INTERP) { (NREG(1) -= NREG(2)); - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * Parrot_sub_n_nc(opcode_t *cur_opcode, PARROT_INTERP) { (NREG(1) -= NCONST(2)); - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * Parrot_sub_p_p(opcode_t *cur_opcode, PARROT_INTERP) { VTABLE_i_subtract(interp, PREG(1), PREG(2)); - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * Parrot_sub_p_i(opcode_t *cur_opcode, PARROT_INTERP) { VTABLE_i_subtract_int(interp, PREG(1), IREG(2)); - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * Parrot_sub_p_ic(opcode_t *cur_opcode, PARROT_INTERP) { VTABLE_i_subtract_int(interp, PREG(1), ICONST(2)); - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * Parrot_sub_p_n(opcode_t *cur_opcode, PARROT_INTERP) { VTABLE_i_subtract_float(interp, PREG(1), NREG(2)); - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * Parrot_sub_p_nc(opcode_t *cur_opcode, PARROT_INTERP) { VTABLE_i_subtract_float(interp, PREG(1), NCONST(2)); - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * Parrot_sub_i_i_i(opcode_t *cur_opcode, PARROT_INTERP) { IREG(1) = (IREG(2) - IREG(3)); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_sub_i_ic_i(opcode_t *cur_opcode, PARROT_INTERP) { IREG(1) = (ICONST(2) - IREG(3)); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_sub_i_i_ic(opcode_t *cur_opcode, PARROT_INTERP) { IREG(1) = (IREG(2) - ICONST(3)); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_sub_n_n_n(opcode_t *cur_opcode, PARROT_INTERP) { NREG(1) = (NREG(2) - NREG(3)); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_sub_n_nc_n(opcode_t *cur_opcode, PARROT_INTERP) { NREG(1) = (NCONST(2) - NREG(3)); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_sub_n_n_nc(opcode_t *cur_opcode, PARROT_INTERP) { NREG(1) = (NREG(2) - NCONST(3)); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_sub_p_p_p(opcode_t *cur_opcode, PARROT_INTERP) { PREG(1) = VTABLE_subtract(interp, PREG(2), PREG(3), PREG(1)); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_sub_p_p_i(opcode_t *cur_opcode, PARROT_INTERP) { PREG(1) = VTABLE_subtract_int(interp, PREG(2), IREG(3), PREG(1)); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_sub_p_p_ic(opcode_t *cur_opcode, PARROT_INTERP) { PREG(1) = VTABLE_subtract_int(interp, PREG(2), ICONST(3), PREG(1)); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_sub_p_p_n(opcode_t *cur_opcode, PARROT_INTERP) { PREG(1) = VTABLE_subtract_float(interp, PREG(2), NREG(3), PREG(1)); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_sub_p_p_nc(opcode_t *cur_opcode, PARROT_INTERP) { PREG(1) = VTABLE_subtract_float(interp, PREG(2), NCONST(3), PREG(1)); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_sqrt_n_n(opcode_t *cur_opcode, PARROT_INTERP) { NREG(1) = sqrt((FLOATVAL)NREG(2)); - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; +} + +opcode_t * +Parrot_is_inf_or_nan_i_n(opcode_t *cur_opcode, PARROT_INTERP) { + IREG(1) = PARROT_FLOATVAL_IS_INF_OR_NAN(NREG(2)); + return cur_opcode + 3; +} + +opcode_t * +Parrot_is_inf_or_nan_i_nc(opcode_t *cur_opcode, PARROT_INTERP) { + IREG(1) = PARROT_FLOATVAL_IS_INF_OR_NAN(NCONST(2)); + return cur_opcode + 3; } opcode_t * @@ -17745,11 +18076,8 @@ Parrot_callmethodcc_p_s(opcode_t *cur_opcode, PARROT_INTERP) { if ((!PMC_IS_NULL(method_pmc))) { PMC * const signature = Parrot_pcc_get_signature(interp, CURRENT_CONTEXT(interp)); - if ((!PMC_IS_NULL(signature))) { - Parrot_pcc_set_object(interp, signature, object); - } - interp->current_cont = NEED_CONTINUATION; + Parrot_pcc_reuse_continuation(interp, CURRENT_CONTEXT(interp), next); dest = VTABLE_invoke(interp, method_pmc, next); } else { @@ -17779,11 +18107,7 @@ Parrot_callmethodcc_p_sc(opcode_t *cur_opcode, PARROT_INTERP) { if ((!PMC_IS_NULL(method_pmc))) { PMC * const signature = Parrot_pcc_get_signature(interp, CURRENT_CONTEXT(interp)); - if ((!PMC_IS_NULL(signature))) { - Parrot_pcc_set_object(interp, signature, object); - } - - interp->current_cont = NEED_CONTINUATION; + Parrot_pcc_reuse_continuation(interp, CURRENT_CONTEXT(interp), next); dest = VTABLE_invoke(interp, method_pmc, next); } else { @@ -17808,11 +18132,8 @@ Parrot_callmethodcc_p_p(opcode_t *cur_opcode, PARROT_INTERP) { PMC * signature = Parrot_pcc_get_signature(interp, CURRENT_CONTEXT(interp)); Parrot_pcc_set_pc(interp, CURRENT_CONTEXT(interp), next); - if ((!PMC_IS_NULL(signature))) { - Parrot_pcc_set_object(interp, signature, PREG(1)); - } - interp->current_cont = NEED_CONTINUATION; + Parrot_pcc_reuse_continuation(interp, CURRENT_CONTEXT(interp), next); dest = VTABLE_invoke(interp, PREG(2), next); return (opcode_t *)dest; } @@ -17831,9 +18152,6 @@ Parrot_callmethod_p_s_p(opcode_t *cur_opcode, PARROT_INTERP) { 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 { - if ((!PMC_IS_NULL(signature))) { - Parrot_pcc_set_object(interp, signature, object); - } interp->current_cont = PREG(3); dest = (opcode_t *)VTABLE_invoke(interp, method_pmc, next); @@ -17856,9 +18174,6 @@ Parrot_callmethod_p_sc_p(opcode_t *cur_opcode, PARROT_INTERP) { 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 { - if ((!PMC_IS_NULL(signature))) { - Parrot_pcc_set_object(interp, signature, object); - } interp->current_cont = PREG(3); dest = (opcode_t *)VTABLE_invoke(interp, method_pmc, next); @@ -17876,9 +18191,6 @@ Parrot_callmethod_p_p_p(opcode_t *cur_opcode, PARROT_INTERP) { PMC * signature = Parrot_pcc_get_signature(interp, CURRENT_CONTEXT(interp)); Parrot_pcc_set_pc(interp, CURRENT_CONTEXT(interp), next); - if ((!PMC_IS_NULL(signature))) { - Parrot_pcc_set_object(interp, signature, object); - } interp->current_cont = PREG(3); dest = (opcode_t *)VTABLE_invoke(interp, method_pmc, next); @@ -17900,9 +18212,6 @@ Parrot_tailcallmethod_p_s(opcode_t *cur_opcode, PARROT_INTERP) { else { interp->current_cont = Parrot_pcc_get_continuation(interp, CURRENT_CONTEXT(interp)); (PObj_get_FLAGS(interp->current_cont) |= SUB_FLAG_TAILCALL); - if ((!PMC_IS_NULL(signature))) { - Parrot_pcc_set_object(interp, signature, object); - } dest = (opcode_t *)VTABLE_invoke(interp, method_pmc, next); } @@ -17925,9 +18234,6 @@ Parrot_tailcallmethod_p_sc(opcode_t *cur_opcode, PARROT_INTERP) { else { interp->current_cont = Parrot_pcc_get_continuation(interp, CURRENT_CONTEXT(interp)); (PObj_get_FLAGS(interp->current_cont) |= SUB_FLAG_TAILCALL); - if ((!PMC_IS_NULL(signature))) { - Parrot_pcc_set_object(interp, signature, object); - } dest = (opcode_t *)VTABLE_invoke(interp, method_pmc, next); } @@ -17945,9 +18251,6 @@ Parrot_tailcallmethod_p_p(opcode_t *cur_opcode, PARROT_INTERP) { interp->current_cont = Parrot_pcc_get_continuation(interp, CURRENT_CONTEXT(interp)); (PObj_get_FLAGS(interp->current_cont) |= SUB_FLAG_TAILCALL); - if ((!PMC_IS_NULL(signature))) { - Parrot_pcc_set_object(interp, signature, object); - } dest = (opcode_t *)VTABLE_invoke(interp, method_pmc, next); return (opcode_t *)dest; @@ -17956,73 +18259,73 @@ Parrot_tailcallmethod_p_p(opcode_t *cur_opcode, PARROT_INTERP) { opcode_t * Parrot_addmethod_p_s_p(opcode_t *cur_opcode, PARROT_INTERP) { VTABLE_add_method(interp, PREG(1), SREG(2), PREG(3)); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_addmethod_p_sc_p(opcode_t *cur_opcode, PARROT_INTERP) { VTABLE_add_method(interp, PREG(1), SCONST(2), PREG(3)); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_can_i_p_s(opcode_t *cur_opcode, PARROT_INTERP) { IREG(1) = VTABLE_can(interp, PREG(2), SREG(3)); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_can_i_p_sc(opcode_t *cur_opcode, PARROT_INTERP) { IREG(1) = VTABLE_can(interp, PREG(2), SCONST(3)); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_does_i_p_s(opcode_t *cur_opcode, PARROT_INTERP) { IREG(1) = SREG(3) ? VTABLE_does(interp, PREG(2), SREG(3)) : 0; - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_does_i_p_sc(opcode_t *cur_opcode, PARROT_INTERP) { IREG(1) = SCONST(3) ? VTABLE_does(interp, PREG(2), SCONST(3)) : 0; - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_does_i_p_p(opcode_t *cur_opcode, PARROT_INTERP) { IREG(1) = PREG(3) ? VTABLE_does_pmc(interp, PREG(2), PREG(3)) : 0; - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_does_i_p_pc(opcode_t *cur_opcode, PARROT_INTERP) { IREG(1) = PCONST(3) ? VTABLE_does_pmc(interp, PREG(2), PCONST(3)) : 0; - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_isa_i_p_s(opcode_t *cur_opcode, PARROT_INTERP) { IREG(1) = SREG(3) ? VTABLE_isa(interp, PREG(2), SREG(3)) : 0; - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_isa_i_p_sc(opcode_t *cur_opcode, PARROT_INTERP) { IREG(1) = SCONST(3) ? VTABLE_isa(interp, PREG(2), SCONST(3)) : 0; - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_isa_i_p_p(opcode_t *cur_opcode, PARROT_INTERP) { IREG(1) = PREG(3) ? VTABLE_isa_pmc(interp, PREG(2), PREG(3)) : 0; - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_isa_i_p_pc(opcode_t *cur_opcode, PARROT_INTERP) { IREG(1) = PCONST(3) ? VTABLE_isa_pmc(interp, PREG(2), PCONST(3)) : 0; - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * @@ -18032,7 +18335,7 @@ Parrot_newclass_p_s(opcode_t *cur_opcode, PARROT_INTERP) { VTABLE_set_string_native(interp, name, SREG(2)); PREG(1) = Parrot_pmc_new_init(interp, enum_class_Class, name); PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp)); - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * @@ -18042,21 +18345,21 @@ Parrot_newclass_p_sc(opcode_t *cur_opcode, PARROT_INTERP) { VTABLE_set_string_native(interp, name, SCONST(2)); PREG(1) = Parrot_pmc_new_init(interp, enum_class_Class, name); PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp)); - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * Parrot_newclass_p_p(opcode_t *cur_opcode, PARROT_INTERP) { PREG(1) = Parrot_pmc_new_init(interp, enum_class_Class, PREG(2)); PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp)); - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * Parrot_newclass_p_pc(opcode_t *cur_opcode, PARROT_INTERP) { PREG(1) = Parrot_pmc_new_init(interp, enum_class_Class, PCONST(2)); PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp)); - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * @@ -18483,197 +18786,197 @@ opcode_t * Parrot_get_class_p_s(opcode_t *cur_opcode, PARROT_INTERP) { PREG(1) = Parrot_oo_get_class_str(interp, SREG(2)); PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp)); - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * Parrot_get_class_p_sc(opcode_t *cur_opcode, PARROT_INTERP) { PREG(1) = Parrot_oo_get_class_str(interp, SCONST(2)); PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp)); - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * Parrot_get_class_p_p(opcode_t *cur_opcode, PARROT_INTERP) { PREG(1) = Parrot_oo_get_class(interp, PREG(2)); PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp)); - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * Parrot_get_class_p_pc(opcode_t *cur_opcode, PARROT_INTERP) { PREG(1) = Parrot_oo_get_class(interp, PCONST(2)); PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp)); - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * Parrot_class_p_p(opcode_t *cur_opcode, PARROT_INTERP) { PREG(1) = VTABLE_get_class(interp, PREG(2)); PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp)); - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * Parrot_addparent_p_p(opcode_t *cur_opcode, PARROT_INTERP) { VTABLE_add_parent(interp, PREG(1), PREG(2)); - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * Parrot_removeparent_p_p(opcode_t *cur_opcode, PARROT_INTERP) { VTABLE_remove_parent(interp, PREG(1), PREG(2)); - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * Parrot_addrole_p_p(opcode_t *cur_opcode, PARROT_INTERP) { VTABLE_add_role(interp, PREG(1), PREG(2)); - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * Parrot_addattribute_p_s(opcode_t *cur_opcode, PARROT_INTERP) { VTABLE_add_attribute(interp, PREG(1), SREG(2), PMCNULL); - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * Parrot_addattribute_p_sc(opcode_t *cur_opcode, PARROT_INTERP) { VTABLE_add_attribute(interp, PREG(1), SCONST(2), PMCNULL); - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * Parrot_removeattribute_p_s(opcode_t *cur_opcode, PARROT_INTERP) { VTABLE_remove_attribute(interp, PREG(1), SREG(2)); - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * Parrot_removeattribute_p_sc(opcode_t *cur_opcode, PARROT_INTERP) { VTABLE_remove_attribute(interp, PREG(1), SCONST(2)); - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * Parrot_getattribute_p_p_s(opcode_t *cur_opcode, PARROT_INTERP) { PREG(1) = VTABLE_get_attr_str(interp, PREG(2), SREG(3)); PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp)); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_getattribute_p_p_sc(opcode_t *cur_opcode, PARROT_INTERP) { PREG(1) = VTABLE_get_attr_str(interp, PREG(2), SCONST(3)); PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp)); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_getattribute_p_p_p_s(opcode_t *cur_opcode, PARROT_INTERP) { PREG(1) = VTABLE_get_attr_keyed(interp, PREG(2), PREG(3), SREG(4)); PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp)); - return (opcode_t *)cur_opcode + 5; + return cur_opcode + 5; } opcode_t * Parrot_getattribute_p_p_pc_s(opcode_t *cur_opcode, PARROT_INTERP) { PREG(1) = VTABLE_get_attr_keyed(interp, PREG(2), PCONST(3), SREG(4)); PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp)); - return (opcode_t *)cur_opcode + 5; + return cur_opcode + 5; } opcode_t * Parrot_getattribute_p_p_p_sc(opcode_t *cur_opcode, PARROT_INTERP) { PREG(1) = VTABLE_get_attr_keyed(interp, PREG(2), PREG(3), SCONST(4)); PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp)); - return (opcode_t *)cur_opcode + 5; + return cur_opcode + 5; } opcode_t * Parrot_getattribute_p_p_pc_sc(opcode_t *cur_opcode, PARROT_INTERP) { PREG(1) = VTABLE_get_attr_keyed(interp, PREG(2), PCONST(3), SCONST(4)); PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp)); - return (opcode_t *)cur_opcode + 5; + return cur_opcode + 5; } opcode_t * Parrot_setattribute_p_s_p(opcode_t *cur_opcode, PARROT_INTERP) { VTABLE_set_attr_str(interp, PREG(1), SREG(2), PREG(3)); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_setattribute_p_sc_p(opcode_t *cur_opcode, PARROT_INTERP) { VTABLE_set_attr_str(interp, PREG(1), SCONST(2), PREG(3)); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_setattribute_p_p_s_p(opcode_t *cur_opcode, PARROT_INTERP) { VTABLE_set_attr_keyed(interp, PREG(1), PREG(2), SREG(3), PREG(4)); - return (opcode_t *)cur_opcode + 5; + return cur_opcode + 5; } opcode_t * Parrot_setattribute_p_pc_s_p(opcode_t *cur_opcode, PARROT_INTERP) { VTABLE_set_attr_keyed(interp, PREG(1), PCONST(2), SREG(3), PREG(4)); - return (opcode_t *)cur_opcode + 5; + return cur_opcode + 5; } opcode_t * Parrot_setattribute_p_p_sc_p(opcode_t *cur_opcode, PARROT_INTERP) { VTABLE_set_attr_keyed(interp, PREG(1), PREG(2), SCONST(3), PREG(4)); - return (opcode_t *)cur_opcode + 5; + return cur_opcode + 5; } opcode_t * Parrot_setattribute_p_pc_sc_p(opcode_t *cur_opcode, PARROT_INTERP) { VTABLE_set_attr_keyed(interp, PREG(1), PCONST(2), SCONST(3), PREG(4)); - return (opcode_t *)cur_opcode + 5; + return cur_opcode + 5; } opcode_t * Parrot_inspect_p_p(opcode_t *cur_opcode, PARROT_INTERP) { PREG(1) = VTABLE_inspect(interp, PREG(2)); PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp)); - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * Parrot_inspect_p_pc(opcode_t *cur_opcode, PARROT_INTERP) { PREG(1) = VTABLE_inspect(interp, PCONST(2)); PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp)); - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * Parrot_inspect_p_p_s(opcode_t *cur_opcode, PARROT_INTERP) { PREG(1) = VTABLE_inspect_str(interp, PREG(2), SREG(3)); PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp)); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_inspect_p_pc_s(opcode_t *cur_opcode, PARROT_INTERP) { PREG(1) = VTABLE_inspect_str(interp, PCONST(2), SREG(3)); PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp)); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_inspect_p_p_sc(opcode_t *cur_opcode, PARROT_INTERP) { PREG(1) = VTABLE_inspect_str(interp, PREG(2), SCONST(3)); PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp)); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_inspect_p_pc_sc(opcode_t *cur_opcode, PARROT_INTERP) { PREG(1) = VTABLE_inspect_str(interp, PCONST(2), SCONST(3)); PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp)); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * @@ -18698,7 +19001,7 @@ Parrot_new_p_s(opcode_t *cur_opcode, PARROT_INTERP) { } PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp)); - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * @@ -18723,7 +19026,7 @@ Parrot_new_p_sc(opcode_t *cur_opcode, PARROT_INTERP) { } PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp)); - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * @@ -18748,7 +19051,7 @@ Parrot_new_p_s_p(opcode_t *cur_opcode, PARROT_INTERP) { } PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp)); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * @@ -18773,7 +19076,7 @@ Parrot_new_p_sc_p(opcode_t *cur_opcode, PARROT_INTERP) { } PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp)); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * @@ -18798,7 +19101,7 @@ Parrot_new_p_s_pc(opcode_t *cur_opcode, PARROT_INTERP) { } PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp)); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * @@ -18823,7 +19126,7 @@ Parrot_new_p_sc_pc(opcode_t *cur_opcode, PARROT_INTERP) { } PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp)); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * @@ -18848,7 +19151,7 @@ Parrot_new_p_p(opcode_t *cur_opcode, PARROT_INTERP) { } PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp)); - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * @@ -18873,7 +19176,7 @@ Parrot_new_p_pc(opcode_t *cur_opcode, PARROT_INTERP) { } PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp)); - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * @@ -18898,7 +19201,7 @@ Parrot_new_p_p_p(opcode_t *cur_opcode, PARROT_INTERP) { } PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp)); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * @@ -18923,7 +19226,7 @@ Parrot_new_p_pc_p(opcode_t *cur_opcode, PARROT_INTERP) { } PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp)); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * @@ -18948,7 +19251,7 @@ Parrot_new_p_p_pc(opcode_t *cur_opcode, PARROT_INTERP) { } PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp)); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * @@ -18973,7 +19276,7 @@ Parrot_new_p_pc_pc(opcode_t *cur_opcode, PARROT_INTERP) { } PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp)); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * @@ -18998,7 +19301,7 @@ Parrot_root_new_p_p(opcode_t *cur_opcode, PARROT_INTERP) { } PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp)); - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * @@ -19023,7 +19326,7 @@ Parrot_root_new_p_pc(opcode_t *cur_opcode, PARROT_INTERP) { } PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp)); - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * @@ -19048,7 +19351,7 @@ Parrot_root_new_p_p_p(opcode_t *cur_opcode, PARROT_INTERP) { } PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp)); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * @@ -19073,7 +19376,7 @@ Parrot_root_new_p_pc_p(opcode_t *cur_opcode, PARROT_INTERP) { } PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp)); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * @@ -19098,7 +19401,7 @@ Parrot_root_new_p_p_pc(opcode_t *cur_opcode, PARROT_INTERP) { } PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp)); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * @@ -19123,28 +19426,28 @@ Parrot_root_new_p_pc_pc(opcode_t *cur_opcode, PARROT_INTERP) { } PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp)); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_typeof_s_p(opcode_t *cur_opcode, PARROT_INTERP) { SREG(1) = VTABLE_name(interp, PREG(2)); PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp)); - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * Parrot_typeof_p_p(opcode_t *cur_opcode, PARROT_INTERP) { PREG(1) = VTABLE_get_class(interp, PREG(2)); PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp)); - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * Parrot_get_repr_s_p(opcode_t *cur_opcode, PARROT_INTERP) { SREG(1) = VTABLE_get_repr(interp, PREG(2)); PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp)); - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * @@ -19188,995 +19491,1011 @@ Parrot_find_method_p_p_sc(opcode_t *cur_opcode, PARROT_INTERP) { opcode_t * Parrot_defined_i_p(opcode_t *cur_opcode, PARROT_INTERP) { IREG(1) = PMC_IS_NULL(PREG(2)) ? 0 : VTABLE_defined(interp, PREG(2)); - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * Parrot_defined_i_p_ki(opcode_t *cur_opcode, PARROT_INTERP) { IREG(1) = PMC_IS_NULL(PREG(2)) ? 0 : VTABLE_defined_keyed_int(interp, PREG(2), IREG(3)); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_defined_i_p_kic(opcode_t *cur_opcode, PARROT_INTERP) { IREG(1) = PMC_IS_NULL(PREG(2)) ? 0 : VTABLE_defined_keyed_int(interp, PREG(2), ICONST(3)); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_defined_i_p_k(opcode_t *cur_opcode, PARROT_INTERP) { IREG(1) = PMC_IS_NULL(PREG(2)) ? 0 : VTABLE_defined_keyed(interp, PREG(2), PREG(3)); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_defined_i_p_kc(opcode_t *cur_opcode, PARROT_INTERP) { IREG(1) = PMC_IS_NULL(PREG(2)) ? 0 : VTABLE_defined_keyed(interp, PREG(2), PCONST(3)); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_exists_i_p_ki(opcode_t *cur_opcode, PARROT_INTERP) { IREG(1) = PMC_IS_NULL(PREG(2)) ? 0 : VTABLE_exists_keyed_int(interp, PREG(2), IREG(3)); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_exists_i_p_kic(opcode_t *cur_opcode, PARROT_INTERP) { IREG(1) = PMC_IS_NULL(PREG(2)) ? 0 : VTABLE_exists_keyed_int(interp, PREG(2), ICONST(3)); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_exists_i_p_k(opcode_t *cur_opcode, PARROT_INTERP) { IREG(1) = PMC_IS_NULL(PREG(2)) ? 0 : VTABLE_exists_keyed(interp, PREG(2), PREG(3)); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_exists_i_p_kc(opcode_t *cur_opcode, PARROT_INTERP) { IREG(1) = PMC_IS_NULL(PREG(2)) ? 0 : VTABLE_exists_keyed(interp, PREG(2), PCONST(3)); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_delete_p_k(opcode_t *cur_opcode, PARROT_INTERP) { VTABLE_delete_keyed(interp, PREG(1), PREG(2)); - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * Parrot_delete_p_kc(opcode_t *cur_opcode, PARROT_INTERP) { VTABLE_delete_keyed(interp, PREG(1), PCONST(2)); - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * Parrot_delete_p_ki(opcode_t *cur_opcode, PARROT_INTERP) { VTABLE_delete_keyed_int(interp, PREG(1), IREG(2)); - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * Parrot_delete_p_kic(opcode_t *cur_opcode, PARROT_INTERP) { VTABLE_delete_keyed_int(interp, PREG(1), ICONST(2)); - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * Parrot_elements_i_p(opcode_t *cur_opcode, PARROT_INTERP) { IREG(1) = VTABLE_elements(interp, PREG(2)); - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * Parrot_push_p_i(opcode_t *cur_opcode, PARROT_INTERP) { VTABLE_push_integer(interp, PREG(1), IREG(2)); - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * Parrot_push_p_ic(opcode_t *cur_opcode, PARROT_INTERP) { VTABLE_push_integer(interp, PREG(1), ICONST(2)); - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * Parrot_push_p_n(opcode_t *cur_opcode, PARROT_INTERP) { VTABLE_push_float(interp, PREG(1), NREG(2)); - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * Parrot_push_p_nc(opcode_t *cur_opcode, PARROT_INTERP) { VTABLE_push_float(interp, PREG(1), NCONST(2)); - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * Parrot_push_p_s(opcode_t *cur_opcode, PARROT_INTERP) { VTABLE_push_string(interp, PREG(1), SREG(2)); - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * Parrot_push_p_sc(opcode_t *cur_opcode, PARROT_INTERP) { VTABLE_push_string(interp, PREG(1), SCONST(2)); - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * Parrot_push_p_p(opcode_t *cur_opcode, PARROT_INTERP) { VTABLE_push_pmc(interp, PREG(1), PREG(2)); - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * Parrot_pop_i_p(opcode_t *cur_opcode, PARROT_INTERP) { IREG(1) = VTABLE_pop_integer(interp, PREG(2)); - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * Parrot_pop_n_p(opcode_t *cur_opcode, PARROT_INTERP) { NREG(1) = VTABLE_pop_float(interp, PREG(2)); - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * Parrot_pop_s_p(opcode_t *cur_opcode, PARROT_INTERP) { SREG(1) = VTABLE_pop_string(interp, PREG(2)); PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp)); - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * Parrot_pop_p_p(opcode_t *cur_opcode, PARROT_INTERP) { PREG(1) = VTABLE_pop_pmc(interp, PREG(2)); PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp)); - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * Parrot_unshift_p_i(opcode_t *cur_opcode, PARROT_INTERP) { VTABLE_unshift_integer(interp, PREG(1), IREG(2)); - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * Parrot_unshift_p_ic(opcode_t *cur_opcode, PARROT_INTERP) { VTABLE_unshift_integer(interp, PREG(1), ICONST(2)); - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * Parrot_unshift_p_n(opcode_t *cur_opcode, PARROT_INTERP) { VTABLE_unshift_float(interp, PREG(1), NREG(2)); - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * Parrot_unshift_p_nc(opcode_t *cur_opcode, PARROT_INTERP) { VTABLE_unshift_float(interp, PREG(1), NCONST(2)); - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * Parrot_unshift_p_s(opcode_t *cur_opcode, PARROT_INTERP) { VTABLE_unshift_string(interp, PREG(1), SREG(2)); - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * Parrot_unshift_p_sc(opcode_t *cur_opcode, PARROT_INTERP) { VTABLE_unshift_string(interp, PREG(1), SCONST(2)); - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * Parrot_unshift_p_p(opcode_t *cur_opcode, PARROT_INTERP) { VTABLE_unshift_pmc(interp, PREG(1), PREG(2)); - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * Parrot_shift_i_p(opcode_t *cur_opcode, PARROT_INTERP) { IREG(1) = VTABLE_shift_integer(interp, PREG(2)); - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * Parrot_shift_n_p(opcode_t *cur_opcode, PARROT_INTERP) { NREG(1) = VTABLE_shift_float(interp, PREG(2)); - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * Parrot_shift_s_p(opcode_t *cur_opcode, PARROT_INTERP) { SREG(1) = VTABLE_shift_string(interp, PREG(2)); PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp)); - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * Parrot_shift_p_p(opcode_t *cur_opcode, PARROT_INTERP) { PREG(1) = VTABLE_shift_pmc(interp, PREG(2)); PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp)); - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * Parrot_splice_p_p_i_i(opcode_t *cur_opcode, PARROT_INTERP) { VTABLE_splice(interp, PREG(1), PREG(2), IREG(3), IREG(4)); - return (opcode_t *)cur_opcode + 5; + return cur_opcode + 5; } opcode_t * Parrot_splice_p_p_ic_i(opcode_t *cur_opcode, PARROT_INTERP) { VTABLE_splice(interp, PREG(1), PREG(2), ICONST(3), IREG(4)); - return (opcode_t *)cur_opcode + 5; + return cur_opcode + 5; } opcode_t * Parrot_splice_p_p_i_ic(opcode_t *cur_opcode, PARROT_INTERP) { VTABLE_splice(interp, PREG(1), PREG(2), IREG(3), ICONST(4)); - return (opcode_t *)cur_opcode + 5; + return cur_opcode + 5; } opcode_t * Parrot_splice_p_p_ic_ic(opcode_t *cur_opcode, PARROT_INTERP) { VTABLE_splice(interp, PREG(1), PREG(2), ICONST(3), ICONST(4)); - return (opcode_t *)cur_opcode + 5; + return cur_opcode + 5; } opcode_t * Parrot_setprop_p_s_p(opcode_t *cur_opcode, PARROT_INTERP) { - VTABLE_setprop(interp, PREG(1), SREG(2), PREG(3)); - return (opcode_t *)cur_opcode + 4; + Parrot_pmc_setprop(interp, PREG(1), SREG(2), PREG(3)); + return cur_opcode + 4; } opcode_t * Parrot_setprop_p_sc_p(opcode_t *cur_opcode, PARROT_INTERP) { - VTABLE_setprop(interp, PREG(1), SCONST(2), PREG(3)); - return (opcode_t *)cur_opcode + 4; + Parrot_pmc_setprop(interp, PREG(1), SCONST(2), PREG(3)); + return cur_opcode + 4; } opcode_t * Parrot_getprop_p_s_p(opcode_t *cur_opcode, PARROT_INTERP) { - PREG(1) = VTABLE_getprop(interp, PREG(3), SREG(2)); + Parrot_warn_deprecated(interp, "getprop_p_s_p is deprecated. Use getprop_p_p_s instead"); + PREG(1) = Parrot_pmc_getprop(interp, PREG(3), SREG(2)); PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp)); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_getprop_p_sc_p(opcode_t *cur_opcode, PARROT_INTERP) { - PREG(1) = VTABLE_getprop(interp, PREG(3), SCONST(2)); + Parrot_warn_deprecated(interp, "getprop_p_s_p is deprecated. Use getprop_p_p_s instead"); + PREG(1) = Parrot_pmc_getprop(interp, PREG(3), SCONST(2)); + PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp)); + return cur_opcode + 4; +} + +opcode_t * +Parrot_getprop_p_p_s(opcode_t *cur_opcode, PARROT_INTERP) { + PREG(1) = Parrot_pmc_getprop(interp, PREG(2), SREG(3)); PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp)); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; +} + +opcode_t * +Parrot_getprop_p_p_sc(opcode_t *cur_opcode, PARROT_INTERP) { + PREG(1) = Parrot_pmc_getprop(interp, PREG(2), SCONST(3)); + PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp)); + return cur_opcode + 4; } opcode_t * Parrot_delprop_p_s(opcode_t *cur_opcode, PARROT_INTERP) { - VTABLE_delprop(interp, PREG(1), SREG(2)); - return (opcode_t *)cur_opcode + 3; + Parrot_pmc_delprop(interp, PREG(1), SREG(2)); + return cur_opcode + 3; } opcode_t * Parrot_delprop_p_sc(opcode_t *cur_opcode, PARROT_INTERP) { - VTABLE_delprop(interp, PREG(1), SCONST(2)); - return (opcode_t *)cur_opcode + 3; + Parrot_pmc_delprop(interp, PREG(1), SCONST(2)); + return cur_opcode + 3; } opcode_t * Parrot_prophash_p_p(opcode_t *cur_opcode, PARROT_INTERP) { - PREG(1) = VTABLE_getprops(interp, PREG(2)); + PREG(1) = Parrot_pmc_getprops(interp, PREG(2)); PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp)); - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * Parrot_freeze_s_p(opcode_t *cur_opcode, PARROT_INTERP) { SREG(1) = Parrot_freeze(interp, PREG(2)); PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp)); - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * Parrot_thaw_p_s(opcode_t *cur_opcode, PARROT_INTERP) { PREG(1) = Parrot_thaw(interp, SREG(2)); PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp)); - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * Parrot_thaw_p_sc(opcode_t *cur_opcode, PARROT_INTERP) { PREG(1) = Parrot_thaw(interp, SCONST(2)); PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp)); - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * Parrot_add_multi_s_s_p(opcode_t *cur_opcode, PARROT_INTERP) { Parrot_mmd_add_multi_from_long_sig(interp, SREG(1), SREG(2), PREG(3)); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_add_multi_sc_s_p(opcode_t *cur_opcode, PARROT_INTERP) { Parrot_mmd_add_multi_from_long_sig(interp, SCONST(1), SREG(2), PREG(3)); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_add_multi_s_sc_p(opcode_t *cur_opcode, PARROT_INTERP) { Parrot_mmd_add_multi_from_long_sig(interp, SREG(1), SCONST(2), PREG(3)); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_add_multi_sc_sc_p(opcode_t *cur_opcode, PARROT_INTERP) { Parrot_mmd_add_multi_from_long_sig(interp, SCONST(1), SCONST(2), PREG(3)); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_find_multi_p_s_s(opcode_t *cur_opcode, PARROT_INTERP) { PREG(1) = Parrot_mmd_find_multi_from_long_sig(interp, SREG(2), SREG(3)); PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp)); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_find_multi_p_sc_s(opcode_t *cur_opcode, PARROT_INTERP) { PREG(1) = Parrot_mmd_find_multi_from_long_sig(interp, SCONST(2), SREG(3)); PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp)); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_find_multi_p_s_sc(opcode_t *cur_opcode, PARROT_INTERP) { PREG(1) = Parrot_mmd_find_multi_from_long_sig(interp, SREG(2), SCONST(3)); PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp)); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_find_multi_p_sc_sc(opcode_t *cur_opcode, PARROT_INTERP) { PREG(1) = Parrot_mmd_find_multi_from_long_sig(interp, SCONST(2), SCONST(3)); PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp)); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_register_p(opcode_t *cur_opcode, PARROT_INTERP) { Parrot_pmc_gc_register(interp, PREG(1)); - return (opcode_t *)cur_opcode + 2; + return cur_opcode + 2; } opcode_t * Parrot_unregister_p(opcode_t *cur_opcode, PARROT_INTERP) { Parrot_pmc_gc_unregister(interp, PREG(1)); - return (opcode_t *)cur_opcode + 2; + return cur_opcode + 2; } opcode_t * Parrot_box_p_i(opcode_t *cur_opcode, PARROT_INTERP) { PREG(1) = Parrot_pmc_box_integer(interp, IREG(2)); PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp)); - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * Parrot_box_p_ic(opcode_t *cur_opcode, PARROT_INTERP) { PREG(1) = Parrot_pmc_box_integer(interp, ICONST(2)); PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp)); - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * Parrot_box_p_n(opcode_t *cur_opcode, PARROT_INTERP) { PREG(1) = Parrot_pmc_box_number(interp, NREG(2)); PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp)); - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * Parrot_box_p_nc(opcode_t *cur_opcode, PARROT_INTERP) { PREG(1) = Parrot_pmc_box_number(interp, NCONST(2)); PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp)); - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * Parrot_box_p_s(opcode_t *cur_opcode, PARROT_INTERP) { PREG(1) = Parrot_pmc_box_string(interp, SREG(2)); PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp)); - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * Parrot_box_p_sc(opcode_t *cur_opcode, PARROT_INTERP) { PREG(1) = Parrot_pmc_box_string(interp, SCONST(2)); PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp)); - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * Parrot_iter_p_p(opcode_t *cur_opcode, PARROT_INTERP) { PREG(1) = VTABLE_get_iter(interp, PREG(2)); PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp)); - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * Parrot_morph_p_p(opcode_t *cur_opcode, PARROT_INTERP) { VTABLE_morph(interp, PREG(1), PREG(2)); - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * Parrot_morph_p_pc(opcode_t *cur_opcode, PARROT_INTERP) { VTABLE_morph(interp, PREG(1), PCONST(2)); - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * Parrot_clone_s_s(opcode_t *cur_opcode, PARROT_INTERP) { SREG(1) = STRING_IS_NULL(SREG(2)) ? Parrot_str_new(interp, NULL, 0) : SREG(2); PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp)); - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * Parrot_clone_s_sc(opcode_t *cur_opcode, PARROT_INTERP) { SREG(1) = STRING_IS_NULL(SCONST(2)) ? Parrot_str_new(interp, NULL, 0) : SCONST(2); PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp)); - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * Parrot_set_i_i(opcode_t *cur_opcode, PARROT_INTERP) { IREG(1) = IREG(2); - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * Parrot_set_i_ic(opcode_t *cur_opcode, PARROT_INTERP) { IREG(1) = ICONST(2); - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * Parrot_set_i_n(opcode_t *cur_opcode, PARROT_INTERP) { IREG(1) = (INTVAL)NREG(2); - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * Parrot_set_i_nc(opcode_t *cur_opcode, PARROT_INTERP) { IREG(1) = (INTVAL)NCONST(2); - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * Parrot_set_i_s(opcode_t *cur_opcode, PARROT_INTERP) { IREG(1) = Parrot_str_to_int(interp, SREG(2)); - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * Parrot_set_i_sc(opcode_t *cur_opcode, PARROT_INTERP) { IREG(1) = Parrot_str_to_int(interp, SCONST(2)); - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * Parrot_set_n_n(opcode_t *cur_opcode, PARROT_INTERP) { NREG(1) = NREG(2); - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * Parrot_set_n_nc(opcode_t *cur_opcode, PARROT_INTERP) { NREG(1) = NCONST(2); - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * Parrot_set_n_i(opcode_t *cur_opcode, PARROT_INTERP) { NREG(1) = (FLOATVAL)IREG(2); - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * Parrot_set_n_ic(opcode_t *cur_opcode, PARROT_INTERP) { NREG(1) = (FLOATVAL)ICONST(2); - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * Parrot_set_n_s(opcode_t *cur_opcode, PARROT_INTERP) { NREG(1) = Parrot_str_to_num(interp, SREG(2)); - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * Parrot_set_n_sc(opcode_t *cur_opcode, PARROT_INTERP) { NREG(1) = Parrot_str_to_num(interp, SCONST(2)); - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * Parrot_set_n_p(opcode_t *cur_opcode, PARROT_INTERP) { NREG(1) = VTABLE_get_number(interp, PREG(2)); - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * Parrot_set_s_p(opcode_t *cur_opcode, PARROT_INTERP) { SREG(1) = VTABLE_get_string(interp, PREG(2)); PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp)); - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * Parrot_set_s_s(opcode_t *cur_opcode, PARROT_INTERP) { SREG(1) = SREG(2); PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp)); - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * Parrot_set_s_sc(opcode_t *cur_opcode, PARROT_INTERP) { SREG(1) = SCONST(2); PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp)); - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * Parrot_set_s_i(opcode_t *cur_opcode, PARROT_INTERP) { SREG(1) = Parrot_str_from_int(interp, IREG(2)); PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp)); - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * Parrot_set_s_ic(opcode_t *cur_opcode, PARROT_INTERP) { SREG(1) = Parrot_str_from_int(interp, ICONST(2)); PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp)); - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * Parrot_set_s_n(opcode_t *cur_opcode, PARROT_INTERP) { SREG(1) = Parrot_str_from_num(interp, NREG(2)); PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp)); - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * Parrot_set_s_nc(opcode_t *cur_opcode, PARROT_INTERP) { SREG(1) = Parrot_str_from_num(interp, NCONST(2)); PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp)); - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * Parrot_set_p_pc(opcode_t *cur_opcode, PARROT_INTERP) { PREG(1) = PCONST(2); PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp)); - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * Parrot_set_p_p(opcode_t *cur_opcode, PARROT_INTERP) { PREG(1) = PREG(2); PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp)); - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * Parrot_set_p_i(opcode_t *cur_opcode, PARROT_INTERP) { VTABLE_set_integer_native(interp, PREG(1), IREG(2)); - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * Parrot_set_p_ic(opcode_t *cur_opcode, PARROT_INTERP) { VTABLE_set_integer_native(interp, PREG(1), ICONST(2)); - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * Parrot_set_p_n(opcode_t *cur_opcode, PARROT_INTERP) { VTABLE_set_number_native(interp, PREG(1), NREG(2)); - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * Parrot_set_p_nc(opcode_t *cur_opcode, PARROT_INTERP) { VTABLE_set_number_native(interp, PREG(1), NCONST(2)); - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * Parrot_set_p_s(opcode_t *cur_opcode, PARROT_INTERP) { VTABLE_set_string_native(interp, PREG(1), SREG(2)); - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * Parrot_set_p_sc(opcode_t *cur_opcode, PARROT_INTERP) { VTABLE_set_string_native(interp, PREG(1), SCONST(2)); - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * Parrot_set_i_p(opcode_t *cur_opcode, PARROT_INTERP) { IREG(1) = VTABLE_get_integer(interp, PREG(2)); - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * Parrot_assign_p_p(opcode_t *cur_opcode, PARROT_INTERP) { VTABLE_assign_pmc(interp, PREG(1), PREG(2)); - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * Parrot_assign_p_i(opcode_t *cur_opcode, PARROT_INTERP) { VTABLE_set_integer_native(interp, PREG(1), IREG(2)); - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * Parrot_assign_p_ic(opcode_t *cur_opcode, PARROT_INTERP) { VTABLE_set_integer_native(interp, PREG(1), ICONST(2)); - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * Parrot_assign_p_n(opcode_t *cur_opcode, PARROT_INTERP) { VTABLE_set_number_native(interp, PREG(1), NREG(2)); - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * Parrot_assign_p_nc(opcode_t *cur_opcode, PARROT_INTERP) { VTABLE_set_number_native(interp, PREG(1), NCONST(2)); - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * Parrot_assign_p_s(opcode_t *cur_opcode, PARROT_INTERP) { VTABLE_assign_string_native(interp, PREG(1), SREG(2)); - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * Parrot_assign_p_sc(opcode_t *cur_opcode, PARROT_INTERP) { VTABLE_assign_string_native(interp, PREG(1), SCONST(2)); - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * Parrot_assign_s_s(opcode_t *cur_opcode, PARROT_INTERP) { SREG(1) = SREG(2); PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp)); - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * Parrot_assign_s_sc(opcode_t *cur_opcode, PARROT_INTERP) { SREG(1) = SCONST(2); PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp)); - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * Parrot_setref_p_p(opcode_t *cur_opcode, PARROT_INTERP) { VTABLE_set_pmc(interp, PREG(1), PREG(2)); - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * Parrot_deref_p_p(opcode_t *cur_opcode, PARROT_INTERP) { PREG(1) = VTABLE_get_pmc(interp, PREG(2)); PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp)); - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * Parrot_set_p_ki_i(opcode_t *cur_opcode, PARROT_INTERP) { VTABLE_set_integer_keyed_int(interp, PREG(1), IREG(2), IREG(3)); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_set_p_kic_i(opcode_t *cur_opcode, PARROT_INTERP) { VTABLE_set_integer_keyed_int(interp, PREG(1), ICONST(2), IREG(3)); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_set_p_ki_ic(opcode_t *cur_opcode, PARROT_INTERP) { VTABLE_set_integer_keyed_int(interp, PREG(1), IREG(2), ICONST(3)); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_set_p_kic_ic(opcode_t *cur_opcode, PARROT_INTERP) { VTABLE_set_integer_keyed_int(interp, PREG(1), ICONST(2), ICONST(3)); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_set_p_ki_n(opcode_t *cur_opcode, PARROT_INTERP) { VTABLE_set_number_keyed_int(interp, PREG(1), IREG(2), NREG(3)); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_set_p_kic_n(opcode_t *cur_opcode, PARROT_INTERP) { VTABLE_set_number_keyed_int(interp, PREG(1), ICONST(2), NREG(3)); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_set_p_ki_nc(opcode_t *cur_opcode, PARROT_INTERP) { VTABLE_set_number_keyed_int(interp, PREG(1), IREG(2), NCONST(3)); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_set_p_kic_nc(opcode_t *cur_opcode, PARROT_INTERP) { VTABLE_set_number_keyed_int(interp, PREG(1), ICONST(2), NCONST(3)); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_set_p_ki_s(opcode_t *cur_opcode, PARROT_INTERP) { VTABLE_set_string_keyed_int(interp, PREG(1), IREG(2), SREG(3)); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_set_p_kic_s(opcode_t *cur_opcode, PARROT_INTERP) { VTABLE_set_string_keyed_int(interp, PREG(1), ICONST(2), SREG(3)); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_set_p_ki_sc(opcode_t *cur_opcode, PARROT_INTERP) { VTABLE_set_string_keyed_int(interp, PREG(1), IREG(2), SCONST(3)); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_set_p_kic_sc(opcode_t *cur_opcode, PARROT_INTERP) { VTABLE_set_string_keyed_int(interp, PREG(1), ICONST(2), SCONST(3)); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_set_p_ki_p(opcode_t *cur_opcode, PARROT_INTERP) { VTABLE_set_pmc_keyed_int(interp, PREG(1), IREG(2), PREG(3)); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_set_p_kic_p(opcode_t *cur_opcode, PARROT_INTERP) { VTABLE_set_pmc_keyed_int(interp, PREG(1), ICONST(2), PREG(3)); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_set_i_p_ki(opcode_t *cur_opcode, PARROT_INTERP) { IREG(1) = VTABLE_get_integer_keyed_int(interp, PREG(2), IREG(3)); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_set_i_p_kic(opcode_t *cur_opcode, PARROT_INTERP) { IREG(1) = VTABLE_get_integer_keyed_int(interp, PREG(2), ICONST(3)); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_set_n_p_ki(opcode_t *cur_opcode, PARROT_INTERP) { NREG(1) = VTABLE_get_number_keyed_int(interp, PREG(2), IREG(3)); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_set_n_p_kic(opcode_t *cur_opcode, PARROT_INTERP) { NREG(1) = VTABLE_get_number_keyed_int(interp, PREG(2), ICONST(3)); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_set_s_p_ki(opcode_t *cur_opcode, PARROT_INTERP) { SREG(1) = VTABLE_get_string_keyed_int(interp, PREG(2), IREG(3)); PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp)); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_set_s_p_kic(opcode_t *cur_opcode, PARROT_INTERP) { SREG(1) = VTABLE_get_string_keyed_int(interp, PREG(2), ICONST(3)); PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp)); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_set_p_p_ki(opcode_t *cur_opcode, PARROT_INTERP) { PREG(1) = VTABLE_get_pmc_keyed_int(interp, PREG(2), IREG(3)); PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp)); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_set_p_p_kic(opcode_t *cur_opcode, PARROT_INTERP) { PREG(1) = VTABLE_get_pmc_keyed_int(interp, PREG(2), ICONST(3)); PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp)); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_set_p_k_i(opcode_t *cur_opcode, PARROT_INTERP) { VTABLE_set_integer_keyed(interp, PREG(1), PREG(2), IREG(3)); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_set_p_kc_i(opcode_t *cur_opcode, PARROT_INTERP) { VTABLE_set_integer_keyed(interp, PREG(1), PCONST(2), IREG(3)); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_set_p_k_ic(opcode_t *cur_opcode, PARROT_INTERP) { VTABLE_set_integer_keyed(interp, PREG(1), PREG(2), ICONST(3)); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_set_p_kc_ic(opcode_t *cur_opcode, PARROT_INTERP) { VTABLE_set_integer_keyed(interp, PREG(1), PCONST(2), ICONST(3)); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_set_p_k_n(opcode_t *cur_opcode, PARROT_INTERP) { VTABLE_set_number_keyed(interp, PREG(1), PREG(2), NREG(3)); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_set_p_kc_n(opcode_t *cur_opcode, PARROT_INTERP) { VTABLE_set_number_keyed(interp, PREG(1), PCONST(2), NREG(3)); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_set_p_k_nc(opcode_t *cur_opcode, PARROT_INTERP) { VTABLE_set_number_keyed(interp, PREG(1), PREG(2), NCONST(3)); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_set_p_kc_nc(opcode_t *cur_opcode, PARROT_INTERP) { VTABLE_set_number_keyed(interp, PREG(1), PCONST(2), NCONST(3)); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_set_p_k_s(opcode_t *cur_opcode, PARROT_INTERP) { VTABLE_set_string_keyed(interp, PREG(1), PREG(2), SREG(3)); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_set_p_kc_s(opcode_t *cur_opcode, PARROT_INTERP) { VTABLE_set_string_keyed(interp, PREG(1), PCONST(2), SREG(3)); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_set_p_k_sc(opcode_t *cur_opcode, PARROT_INTERP) { VTABLE_set_string_keyed(interp, PREG(1), PREG(2), SCONST(3)); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_set_p_kc_sc(opcode_t *cur_opcode, PARROT_INTERP) { VTABLE_set_string_keyed(interp, PREG(1), PCONST(2), SCONST(3)); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_set_p_k_p(opcode_t *cur_opcode, PARROT_INTERP) { VTABLE_set_pmc_keyed(interp, PREG(1), PREG(2), PREG(3)); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_set_p_kc_p(opcode_t *cur_opcode, PARROT_INTERP) { VTABLE_set_pmc_keyed(interp, PREG(1), PCONST(2), PREG(3)); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_set_i_p_k(opcode_t *cur_opcode, PARROT_INTERP) { IREG(1) = VTABLE_get_integer_keyed(interp, PREG(2), PREG(3)); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_set_i_p_kc(opcode_t *cur_opcode, PARROT_INTERP) { IREG(1) = VTABLE_get_integer_keyed(interp, PREG(2), PCONST(3)); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_set_n_p_k(opcode_t *cur_opcode, PARROT_INTERP) { NREG(1) = VTABLE_get_number_keyed(interp, PREG(2), PREG(3)); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_set_n_p_kc(opcode_t *cur_opcode, PARROT_INTERP) { NREG(1) = VTABLE_get_number_keyed(interp, PREG(2), PCONST(3)); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_set_s_p_k(opcode_t *cur_opcode, PARROT_INTERP) { SREG(1) = VTABLE_get_string_keyed(interp, PREG(2), PREG(3)); PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp)); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_set_s_p_kc(opcode_t *cur_opcode, PARROT_INTERP) { SREG(1) = VTABLE_get_string_keyed(interp, PREG(2), PCONST(3)); PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp)); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_set_p_p_k(opcode_t *cur_opcode, PARROT_INTERP) { PREG(1) = VTABLE_get_pmc_keyed(interp, PREG(2), PREG(3)); PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp)); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_set_p_p_kc(opcode_t *cur_opcode, PARROT_INTERP) { PREG(1) = VTABLE_get_pmc_keyed(interp, PREG(2), PCONST(3)); PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp)); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_clone_p_p(opcode_t *cur_opcode, PARROT_INTERP) { PREG(1) = VTABLE_clone(interp, PREG(2)); PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp)); - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * Parrot_clone_p_p_p(opcode_t *cur_opcode, PARROT_INTERP) { PREG(1) = VTABLE_clone_pmc(interp, PREG(2), PREG(3)); PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp)); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_clone_p_p_pc(opcode_t *cur_opcode, PARROT_INTERP) { PREG(1) = VTABLE_clone_pmc(interp, PREG(2), PCONST(3)); PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp)); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * @@ -20190,7 +20509,7 @@ Parrot_copy_p_p(opcode_t *cur_opcode, PARROT_INTERP) { } else { PMC * const clone = VTABLE_clone(interp, PREG(2)); - PMC * const meta = VTABLE_getprops(interp, PREG(1)); + PMC * const meta = Parrot_pmc_getprops(interp, PREG(1)); const Parrot_UInt gc_flags = (PREG(1)->flags & PObj_GC_all_FLAGS); Parrot_pmc_destroy(interp, PREG(1)); @@ -20207,7 +20526,7 @@ Parrot_copy_p_p(opcode_t *cur_opcode, PARROT_INTERP) { STRING * const key = VTABLE_shift_string(interp, iter); PMC * const value = VTABLE_get_pmc_keyed_str(interp, meta, key); - VTABLE_setprop(interp, PREG(1), key, value); + Parrot_pmc_setprop(interp, PREG(1), key, value); } } @@ -20215,69 +20534,69 @@ Parrot_copy_p_p(opcode_t *cur_opcode, PARROT_INTERP) { } PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp)); - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * Parrot_null_s(opcode_t *cur_opcode, PARROT_INTERP) { SREG(1) = STRINGNULL; PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp)); - return (opcode_t *)cur_opcode + 2; + return cur_opcode + 2; } opcode_t * Parrot_null_i(opcode_t *cur_opcode, PARROT_INTERP) { IREG(1) = 0; - return (opcode_t *)cur_opcode + 2; + return cur_opcode + 2; } opcode_t * Parrot_null_p(opcode_t *cur_opcode, PARROT_INTERP) { PREG(1) = PMCNULL; PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp)); - return (opcode_t *)cur_opcode + 2; + return cur_opcode + 2; } opcode_t * Parrot_null_n(opcode_t *cur_opcode, PARROT_INTERP) { NREG(1) = 0; - return (opcode_t *)cur_opcode + 2; + return cur_opcode + 2; } opcode_t * Parrot_ord_i_s(opcode_t *cur_opcode, PARROT_INTERP) { IREG(1) = STRING_ord(interp, SREG(2), 0); - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * Parrot_ord_i_sc(opcode_t *cur_opcode, PARROT_INTERP) { IREG(1) = STRING_ord(interp, SCONST(2), 0); - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * Parrot_ord_i_s_i(opcode_t *cur_opcode, PARROT_INTERP) { IREG(1) = STRING_ord(interp, SREG(2), IREG(3)); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_ord_i_sc_i(opcode_t *cur_opcode, PARROT_INTERP) { IREG(1) = STRING_ord(interp, SCONST(2), IREG(3)); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_ord_i_s_ic(opcode_t *cur_opcode, PARROT_INTERP) { IREG(1) = STRING_ord(interp, SREG(2), ICONST(3)); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_ord_i_sc_ic(opcode_t *cur_opcode, PARROT_INTERP) { IREG(1) = STRING_ord(interp, SCONST(2), ICONST(3)); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * @@ -20286,7 +20605,7 @@ Parrot_chr_s_i(opcode_t *cur_opcode, PARROT_INTERP) { SREG(1) = s; PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp)); - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * @@ -20295,92 +20614,92 @@ Parrot_chr_s_ic(opcode_t *cur_opcode, PARROT_INTERP) { SREG(1) = s; PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp)); - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * Parrot_chopn_s_s_i(opcode_t *cur_opcode, PARROT_INTERP) { SREG(1) = Parrot_str_chopn(interp, SREG(2), IREG(3)); PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp)); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_chopn_s_sc_i(opcode_t *cur_opcode, PARROT_INTERP) { SREG(1) = Parrot_str_chopn(interp, SCONST(2), IREG(3)); PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp)); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_chopn_s_s_ic(opcode_t *cur_opcode, PARROT_INTERP) { SREG(1) = Parrot_str_chopn(interp, SREG(2), ICONST(3)); PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp)); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_chopn_s_sc_ic(opcode_t *cur_opcode, PARROT_INTERP) { SREG(1) = Parrot_str_chopn(interp, SCONST(2), ICONST(3)); PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp)); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_concat_p_p(opcode_t *cur_opcode, PARROT_INTERP) { VTABLE_i_concatenate(interp, PREG(1), PREG(2)); - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * Parrot_concat_p_s(opcode_t *cur_opcode, PARROT_INTERP) { VTABLE_i_concatenate_str(interp, PREG(1), SREG(2)); - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * Parrot_concat_p_sc(opcode_t *cur_opcode, PARROT_INTERP) { VTABLE_i_concatenate_str(interp, PREG(1), SCONST(2)); - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * Parrot_concat_s_s_s(opcode_t *cur_opcode, PARROT_INTERP) { SREG(1) = Parrot_str_concat(interp, SREG(2), SREG(3)); PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp)); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_concat_s_sc_s(opcode_t *cur_opcode, PARROT_INTERP) { SREG(1) = Parrot_str_concat(interp, SCONST(2), SREG(3)); PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp)); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_concat_s_s_sc(opcode_t *cur_opcode, PARROT_INTERP) { SREG(1) = Parrot_str_concat(interp, SREG(2), SCONST(3)); PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp)); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_concat_p_p_s(opcode_t *cur_opcode, PARROT_INTERP) { PREG(1) = VTABLE_concatenate_str(interp, PREG(2), SREG(3), PREG(1)); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_concat_p_p_sc(opcode_t *cur_opcode, PARROT_INTERP) { PREG(1) = VTABLE_concatenate_str(interp, PREG(2), SCONST(3), PREG(1)); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_concat_p_p_p(opcode_t *cur_opcode, PARROT_INTERP) { PREG(1) = VTABLE_concatenate(interp, PREG(2), PREG(3), PREG(1)); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * @@ -20394,7 +20713,7 @@ Parrot_repeat_s_s_i(opcode_t *cur_opcode, PARROT_INTERP) { SREG(1) = Parrot_str_repeat(interp, SREG(2), (UINTVAL)IREG(3)); PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp)); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * @@ -20408,7 +20727,7 @@ Parrot_repeat_s_sc_i(opcode_t *cur_opcode, PARROT_INTERP) { SREG(1) = Parrot_str_repeat(interp, SCONST(2), (UINTVAL)IREG(3)); PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp)); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * @@ -20422,7 +20741,7 @@ Parrot_repeat_s_s_ic(opcode_t *cur_opcode, PARROT_INTERP) { SREG(1) = Parrot_str_repeat(interp, SREG(2), (UINTVAL)ICONST(3)); PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp)); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * @@ -20436,7 +20755,7 @@ Parrot_repeat_s_sc_ic(opcode_t *cur_opcode, PARROT_INTERP) { SREG(1) = Parrot_str_repeat(interp, SCONST(2), (UINTVAL)ICONST(3)); PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp)); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * @@ -20448,7 +20767,7 @@ Parrot_repeat_p_p_i(opcode_t *cur_opcode, PARROT_INTERP) { } PREG(1) = VTABLE_repeat_int(interp, PREG(2), IREG(3), PREG(1)); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * @@ -20460,7 +20779,7 @@ Parrot_repeat_p_p_ic(opcode_t *cur_opcode, PARROT_INTERP) { } PREG(1) = VTABLE_repeat_int(interp, PREG(2), ICONST(3), PREG(1)); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * @@ -20472,63 +20791,63 @@ Parrot_repeat_p_p_p(opcode_t *cur_opcode, PARROT_INTERP) { } PREG(1) = VTABLE_repeat(interp, PREG(2), PREG(3), PREG(1)); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_repeat_p_i(opcode_t *cur_opcode, PARROT_INTERP) { VTABLE_i_repeat_int(interp, PREG(1), IREG(2)); - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * Parrot_repeat_p_ic(opcode_t *cur_opcode, PARROT_INTERP) { VTABLE_i_repeat_int(interp, PREG(1), ICONST(2)); - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * Parrot_repeat_p_p(opcode_t *cur_opcode, PARROT_INTERP) { VTABLE_i_repeat(interp, PREG(1), PREG(2)); - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * Parrot_length_i_s(opcode_t *cur_opcode, PARROT_INTERP) { IREG(1) = Parrot_str_length(interp, SREG(2)); - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * Parrot_length_i_sc(opcode_t *cur_opcode, PARROT_INTERP) { IREG(1) = Parrot_str_length(interp, SCONST(2)); - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * Parrot_bytelength_i_s(opcode_t *cur_opcode, PARROT_INTERP) { IREG(1) = Parrot_str_byte_length(interp, SREG(2)); - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * Parrot_bytelength_i_sc(opcode_t *cur_opcode, PARROT_INTERP) { IREG(1) = Parrot_str_byte_length(interp, SCONST(2)); - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * Parrot_pin_s(opcode_t *cur_opcode, PARROT_INTERP) { Parrot_str_pin(interp, SREG(1)); PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp)); - return (opcode_t *)cur_opcode + 2; + return cur_opcode + 2; } opcode_t * Parrot_unpin_s(opcode_t *cur_opcode, PARROT_INTERP) { Parrot_str_unpin(interp, SREG(1)); PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp)); - return (opcode_t *)cur_opcode + 2; + return cur_opcode + 2; } opcode_t * @@ -20537,7 +20856,7 @@ Parrot_substr_s_s_i(opcode_t *cur_opcode, PARROT_INTERP) { SREG(1) = STRING_substr(interp, SREG(2), IREG(3), len); PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp)); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * @@ -20546,7 +20865,7 @@ Parrot_substr_s_sc_i(opcode_t *cur_opcode, PARROT_INTERP) { SREG(1) = STRING_substr(interp, SCONST(2), IREG(3), len); PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp)); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * @@ -20555,7 +20874,7 @@ Parrot_substr_s_s_ic(opcode_t *cur_opcode, PARROT_INTERP) { SREG(1) = STRING_substr(interp, SREG(2), ICONST(3), len); PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp)); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * @@ -20564,317 +20883,303 @@ Parrot_substr_s_sc_ic(opcode_t *cur_opcode, PARROT_INTERP) { SREG(1) = STRING_substr(interp, SCONST(2), ICONST(3), len); PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp)); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_substr_s_s_i_i(opcode_t *cur_opcode, PARROT_INTERP) { SREG(1) = STRING_substr(interp, SREG(2), IREG(3), IREG(4)); PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp)); - return (opcode_t *)cur_opcode + 5; + return cur_opcode + 5; } opcode_t * Parrot_substr_s_sc_i_i(opcode_t *cur_opcode, PARROT_INTERP) { SREG(1) = STRING_substr(interp, SCONST(2), IREG(3), IREG(4)); PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp)); - return (opcode_t *)cur_opcode + 5; + return cur_opcode + 5; } opcode_t * Parrot_substr_s_s_ic_i(opcode_t *cur_opcode, PARROT_INTERP) { SREG(1) = STRING_substr(interp, SREG(2), ICONST(3), IREG(4)); PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp)); - return (opcode_t *)cur_opcode + 5; + return cur_opcode + 5; } opcode_t * Parrot_substr_s_sc_ic_i(opcode_t *cur_opcode, PARROT_INTERP) { SREG(1) = STRING_substr(interp, SCONST(2), ICONST(3), IREG(4)); PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp)); - return (opcode_t *)cur_opcode + 5; + return cur_opcode + 5; } opcode_t * Parrot_substr_s_s_i_ic(opcode_t *cur_opcode, PARROT_INTERP) { SREG(1) = STRING_substr(interp, SREG(2), IREG(3), ICONST(4)); PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp)); - return (opcode_t *)cur_opcode + 5; + return cur_opcode + 5; } opcode_t * Parrot_substr_s_sc_i_ic(opcode_t *cur_opcode, PARROT_INTERP) { SREG(1) = STRING_substr(interp, SCONST(2), IREG(3), ICONST(4)); PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp)); - return (opcode_t *)cur_opcode + 5; + return cur_opcode + 5; } opcode_t * Parrot_substr_s_s_ic_ic(opcode_t *cur_opcode, PARROT_INTERP) { SREG(1) = STRING_substr(interp, SREG(2), ICONST(3), ICONST(4)); PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp)); - return (opcode_t *)cur_opcode + 5; + return cur_opcode + 5; } opcode_t * Parrot_substr_s_sc_ic_ic(opcode_t *cur_opcode, PARROT_INTERP) { SREG(1) = STRING_substr(interp, SCONST(2), ICONST(3), ICONST(4)); PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp)); - return (opcode_t *)cur_opcode + 5; + return cur_opcode + 5; } opcode_t * Parrot_substr_s_p_i_i(opcode_t *cur_opcode, PARROT_INTERP) { SREG(1) = VTABLE_substr(interp, PREG(2), IREG(3), IREG(4)); PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp)); - return (opcode_t *)cur_opcode + 5; + return cur_opcode + 5; } opcode_t * Parrot_substr_s_p_ic_i(opcode_t *cur_opcode, PARROT_INTERP) { SREG(1) = VTABLE_substr(interp, PREG(2), ICONST(3), IREG(4)); PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp)); - return (opcode_t *)cur_opcode + 5; + return cur_opcode + 5; } opcode_t * Parrot_substr_s_p_i_ic(opcode_t *cur_opcode, PARROT_INTERP) { SREG(1) = VTABLE_substr(interp, PREG(2), IREG(3), ICONST(4)); PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp)); - return (opcode_t *)cur_opcode + 5; + return cur_opcode + 5; } opcode_t * Parrot_substr_s_p_ic_ic(opcode_t *cur_opcode, PARROT_INTERP) { SREG(1) = VTABLE_substr(interp, PREG(2), ICONST(3), ICONST(4)); PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp)); - return (opcode_t *)cur_opcode + 5; + return cur_opcode + 5; } opcode_t * Parrot_replace_s_s_i_i_s(opcode_t *cur_opcode, PARROT_INTERP) { SREG(1) = Parrot_str_replace(interp, SREG(2), IREG(3), IREG(4), SREG(5)); PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp)); - return (opcode_t *)cur_opcode + 6; + return cur_opcode + 6; } opcode_t * Parrot_replace_s_sc_i_i_s(opcode_t *cur_opcode, PARROT_INTERP) { SREG(1) = Parrot_str_replace(interp, SCONST(2), IREG(3), IREG(4), SREG(5)); PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp)); - return (opcode_t *)cur_opcode + 6; + return cur_opcode + 6; } opcode_t * Parrot_replace_s_s_ic_i_s(opcode_t *cur_opcode, PARROT_INTERP) { SREG(1) = Parrot_str_replace(interp, SREG(2), ICONST(3), IREG(4), SREG(5)); PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp)); - return (opcode_t *)cur_opcode + 6; + return cur_opcode + 6; } opcode_t * Parrot_replace_s_sc_ic_i_s(opcode_t *cur_opcode, PARROT_INTERP) { SREG(1) = Parrot_str_replace(interp, SCONST(2), ICONST(3), IREG(4), SREG(5)); PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp)); - return (opcode_t *)cur_opcode + 6; + return cur_opcode + 6; } opcode_t * Parrot_replace_s_s_i_ic_s(opcode_t *cur_opcode, PARROT_INTERP) { SREG(1) = Parrot_str_replace(interp, SREG(2), IREG(3), ICONST(4), SREG(5)); PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp)); - return (opcode_t *)cur_opcode + 6; + return cur_opcode + 6; } opcode_t * Parrot_replace_s_sc_i_ic_s(opcode_t *cur_opcode, PARROT_INTERP) { SREG(1) = Parrot_str_replace(interp, SCONST(2), IREG(3), ICONST(4), SREG(5)); PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp)); - return (opcode_t *)cur_opcode + 6; + return cur_opcode + 6; } opcode_t * Parrot_replace_s_s_ic_ic_s(opcode_t *cur_opcode, PARROT_INTERP) { SREG(1) = Parrot_str_replace(interp, SREG(2), ICONST(3), ICONST(4), SREG(5)); PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp)); - return (opcode_t *)cur_opcode + 6; + return cur_opcode + 6; } opcode_t * Parrot_replace_s_sc_ic_ic_s(opcode_t *cur_opcode, PARROT_INTERP) { SREG(1) = Parrot_str_replace(interp, SCONST(2), ICONST(3), ICONST(4), SREG(5)); PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp)); - return (opcode_t *)cur_opcode + 6; + return cur_opcode + 6; } opcode_t * Parrot_replace_s_s_i_i_sc(opcode_t *cur_opcode, PARROT_INTERP) { SREG(1) = Parrot_str_replace(interp, SREG(2), IREG(3), IREG(4), SCONST(5)); PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp)); - return (opcode_t *)cur_opcode + 6; + return cur_opcode + 6; } opcode_t * Parrot_replace_s_sc_i_i_sc(opcode_t *cur_opcode, PARROT_INTERP) { SREG(1) = Parrot_str_replace(interp, SCONST(2), IREG(3), IREG(4), SCONST(5)); PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp)); - return (opcode_t *)cur_opcode + 6; + return cur_opcode + 6; } opcode_t * Parrot_replace_s_s_ic_i_sc(opcode_t *cur_opcode, PARROT_INTERP) { SREG(1) = Parrot_str_replace(interp, SREG(2), ICONST(3), IREG(4), SCONST(5)); PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp)); - return (opcode_t *)cur_opcode + 6; + return cur_opcode + 6; } opcode_t * Parrot_replace_s_sc_ic_i_sc(opcode_t *cur_opcode, PARROT_INTERP) { SREG(1) = Parrot_str_replace(interp, SCONST(2), ICONST(3), IREG(4), SCONST(5)); PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp)); - return (opcode_t *)cur_opcode + 6; + return cur_opcode + 6; } opcode_t * Parrot_replace_s_s_i_ic_sc(opcode_t *cur_opcode, PARROT_INTERP) { SREG(1) = Parrot_str_replace(interp, SREG(2), IREG(3), ICONST(4), SCONST(5)); PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp)); - return (opcode_t *)cur_opcode + 6; + return cur_opcode + 6; } opcode_t * Parrot_replace_s_sc_i_ic_sc(opcode_t *cur_opcode, PARROT_INTERP) { SREG(1) = Parrot_str_replace(interp, SCONST(2), IREG(3), ICONST(4), SCONST(5)); PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp)); - return (opcode_t *)cur_opcode + 6; + return cur_opcode + 6; } opcode_t * Parrot_replace_s_s_ic_ic_sc(opcode_t *cur_opcode, PARROT_INTERP) { SREG(1) = Parrot_str_replace(interp, SREG(2), ICONST(3), ICONST(4), SCONST(5)); PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp)); - return (opcode_t *)cur_opcode + 6; + return cur_opcode + 6; } opcode_t * Parrot_replace_s_sc_ic_ic_sc(opcode_t *cur_opcode, PARROT_INTERP) { SREG(1) = Parrot_str_replace(interp, SCONST(2), ICONST(3), ICONST(4), SCONST(5)); PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp)); - return (opcode_t *)cur_opcode + 6; + return cur_opcode + 6; } opcode_t * Parrot_index_i_s_s(opcode_t *cur_opcode, PARROT_INTERP) { IREG(1) = ((SREG(2) && SREG(3))) ? STRING_index(interp, SREG(2), SREG(3), 0) : (-1); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_index_i_sc_s(opcode_t *cur_opcode, PARROT_INTERP) { IREG(1) = ((SCONST(2) && SREG(3))) ? STRING_index(interp, SCONST(2), SREG(3), 0) : (-1); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_index_i_s_sc(opcode_t *cur_opcode, PARROT_INTERP) { IREG(1) = ((SREG(2) && SCONST(3))) ? STRING_index(interp, SREG(2), SCONST(3), 0) : (-1); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_index_i_sc_sc(opcode_t *cur_opcode, PARROT_INTERP) { IREG(1) = ((SCONST(2) && SCONST(3))) ? STRING_index(interp, SCONST(2), SCONST(3), 0) : (-1); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_index_i_s_s_i(opcode_t *cur_opcode, PARROT_INTERP) { IREG(1) = ((SREG(2) && SREG(3))) ? STRING_index(interp, SREG(2), SREG(3), IREG(4)) : (-1); - return (opcode_t *)cur_opcode + 5; + return cur_opcode + 5; } opcode_t * Parrot_index_i_sc_s_i(opcode_t *cur_opcode, PARROT_INTERP) { IREG(1) = ((SCONST(2) && SREG(3))) ? STRING_index(interp, SCONST(2), SREG(3), IREG(4)) : (-1); - return (opcode_t *)cur_opcode + 5; + return cur_opcode + 5; } opcode_t * Parrot_index_i_s_sc_i(opcode_t *cur_opcode, PARROT_INTERP) { IREG(1) = ((SREG(2) && SCONST(3))) ? STRING_index(interp, SREG(2), SCONST(3), IREG(4)) : (-1); - return (opcode_t *)cur_opcode + 5; + return cur_opcode + 5; } opcode_t * Parrot_index_i_sc_sc_i(opcode_t *cur_opcode, PARROT_INTERP) { IREG(1) = ((SCONST(2) && SCONST(3))) ? STRING_index(interp, SCONST(2), SCONST(3), IREG(4)) : (-1); - return (opcode_t *)cur_opcode + 5; + return cur_opcode + 5; } opcode_t * Parrot_index_i_s_s_ic(opcode_t *cur_opcode, PARROT_INTERP) { IREG(1) = ((SREG(2) && SREG(3))) ? STRING_index(interp, SREG(2), SREG(3), ICONST(4)) : (-1); - return (opcode_t *)cur_opcode + 5; + return cur_opcode + 5; } opcode_t * Parrot_index_i_sc_s_ic(opcode_t *cur_opcode, PARROT_INTERP) { IREG(1) = ((SCONST(2) && SREG(3))) ? STRING_index(interp, SCONST(2), SREG(3), ICONST(4)) : (-1); - return (opcode_t *)cur_opcode + 5; + return cur_opcode + 5; } opcode_t * Parrot_index_i_s_sc_ic(opcode_t *cur_opcode, PARROT_INTERP) { IREG(1) = ((SREG(2) && SCONST(3))) ? STRING_index(interp, SREG(2), SCONST(3), ICONST(4)) : (-1); - return (opcode_t *)cur_opcode + 5; + return cur_opcode + 5; } opcode_t * Parrot_index_i_sc_sc_ic(opcode_t *cur_opcode, PARROT_INTERP) { IREG(1) = ((SCONST(2) && SCONST(3))) ? STRING_index(interp, SCONST(2), SCONST(3), ICONST(4)) : (-1); - return (opcode_t *)cur_opcode + 5; + return cur_opcode + 5; } opcode_t * Parrot_sprintf_s_s_p(opcode_t *cur_opcode, PARROT_INTERP) { SREG(1) = Parrot_psprintf(interp, SREG(2), PREG(3)); PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp)); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_sprintf_s_sc_p(opcode_t *cur_opcode, PARROT_INTERP) { SREG(1) = Parrot_psprintf(interp, SCONST(2), PREG(3)); PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp)); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_sprintf_p_p_p(opcode_t *cur_opcode, PARROT_INTERP) { VTABLE_set_string_native(interp, PREG(1), Parrot_psprintf(interp, VTABLE_get_string(interp, PREG(2)), PREG(3))); PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp)); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_new_s(opcode_t *cur_opcode, PARROT_INTERP) { SREG(1) = Parrot_str_new_noinit(interp, 0); PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp)); - return (opcode_t *)cur_opcode + 2; -} - -opcode_t * -Parrot_new_s_i(opcode_t *cur_opcode, PARROT_INTERP) { - SREG(1) = Parrot_str_new_noinit(interp, IREG(2)); - PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp)); - return (opcode_t *)cur_opcode + 3; -} - -opcode_t * -Parrot_new_s_ic(opcode_t *cur_opcode, PARROT_INTERP) { - SREG(1) = Parrot_str_new_noinit(interp, ICONST(2)); - PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp)); - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 2; } opcode_t * @@ -20913,7 +21218,7 @@ Parrot_stringinfo_i_s_i(opcode_t *cur_opcode, PARROT_INTERP) { } - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * @@ -20952,7 +21257,7 @@ Parrot_stringinfo_i_sc_i(opcode_t *cur_opcode, PARROT_INTERP) { } - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * @@ -20991,7 +21296,7 @@ Parrot_stringinfo_i_s_ic(opcode_t *cur_opcode, PARROT_INTERP) { } - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * @@ -21030,117 +21335,117 @@ Parrot_stringinfo_i_sc_ic(opcode_t *cur_opcode, PARROT_INTERP) { } - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_upcase_s_s(opcode_t *cur_opcode, PARROT_INTERP) { SREG(1) = Parrot_str_upcase(interp, SREG(2)); PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp)); - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * Parrot_upcase_s_sc(opcode_t *cur_opcode, PARROT_INTERP) { SREG(1) = Parrot_str_upcase(interp, SCONST(2)); PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp)); - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * Parrot_downcase_s_s(opcode_t *cur_opcode, PARROT_INTERP) { SREG(1) = Parrot_str_downcase(interp, SREG(2)); PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp)); - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * Parrot_downcase_s_sc(opcode_t *cur_opcode, PARROT_INTERP) { SREG(1) = Parrot_str_downcase(interp, SCONST(2)); PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp)); - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * Parrot_titlecase_s_s(opcode_t *cur_opcode, PARROT_INTERP) { SREG(1) = Parrot_str_titlecase(interp, SREG(2)); PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp)); - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * Parrot_titlecase_s_sc(opcode_t *cur_opcode, PARROT_INTERP) { SREG(1) = Parrot_str_titlecase(interp, SCONST(2)); PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp)); - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * Parrot_join_s_s_p(opcode_t *cur_opcode, PARROT_INTERP) { SREG(1) = Parrot_str_join(interp, SREG(2), PREG(3)); PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp)); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_join_s_sc_p(opcode_t *cur_opcode, PARROT_INTERP) { SREG(1) = Parrot_str_join(interp, SCONST(2), PREG(3)); PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp)); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_split_p_s_s(opcode_t *cur_opcode, PARROT_INTERP) { PREG(1) = Parrot_str_split(interp, SREG(2), SREG(3)); PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp)); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_split_p_sc_s(opcode_t *cur_opcode, PARROT_INTERP) { PREG(1) = Parrot_str_split(interp, SCONST(2), SREG(3)); PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp)); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_split_p_s_sc(opcode_t *cur_opcode, PARROT_INTERP) { PREG(1) = Parrot_str_split(interp, SREG(2), SCONST(3)); PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp)); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_split_p_sc_sc(opcode_t *cur_opcode, PARROT_INTERP) { PREG(1) = Parrot_str_split(interp, SCONST(2), SCONST(3)); PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp)); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_encoding_i_s(opcode_t *cur_opcode, PARROT_INTERP) { IREG(1) = Parrot_encoding_number_of_str(interp, SREG(2)); - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * Parrot_encoding_i_sc(opcode_t *cur_opcode, PARROT_INTERP) { IREG(1) = Parrot_encoding_number_of_str(interp, SCONST(2)); - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * Parrot_encodingname_s_i(opcode_t *cur_opcode, PARROT_INTERP) { SREG(1) = Parrot_encoding_name(interp, IREG(2)); PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp)); - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * Parrot_encodingname_s_ic(opcode_t *cur_opcode, PARROT_INTERP) { SREG(1) = Parrot_encoding_name(interp, ICONST(2)); PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp)); - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * @@ -21154,7 +21459,7 @@ Parrot_find_encoding_i_s(opcode_t *cur_opcode, PARROT_INTERP) { } IREG(1) = n; - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * @@ -21168,296 +21473,296 @@ Parrot_find_encoding_i_sc(opcode_t *cur_opcode, PARROT_INTERP) { } IREG(1) = n; - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * Parrot_trans_encoding_s_s_i(opcode_t *cur_opcode, PARROT_INTERP) { SREG(1) = Parrot_str_change_encoding(interp, SREG(2), IREG(3)); PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp)); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_trans_encoding_s_sc_i(opcode_t *cur_opcode, PARROT_INTERP) { SREG(1) = Parrot_str_change_encoding(interp, SCONST(2), IREG(3)); PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp)); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_trans_encoding_s_s_ic(opcode_t *cur_opcode, PARROT_INTERP) { SREG(1) = Parrot_str_change_encoding(interp, SREG(2), ICONST(3)); PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp)); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_trans_encoding_s_sc_ic(opcode_t *cur_opcode, PARROT_INTERP) { SREG(1) = Parrot_str_change_encoding(interp, SCONST(2), ICONST(3)); PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp)); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * Parrot_is_cclass_i_i_s_i(opcode_t *cur_opcode, PARROT_INTERP) { IREG(1) = Parrot_str_is_cclass(interp, IREG(2), SREG(3), IREG(4)); - return (opcode_t *)cur_opcode + 5; + return cur_opcode + 5; } opcode_t * Parrot_is_cclass_i_ic_s_i(opcode_t *cur_opcode, PARROT_INTERP) { IREG(1) = Parrot_str_is_cclass(interp, ICONST(2), SREG(3), IREG(4)); - return (opcode_t *)cur_opcode + 5; + return cur_opcode + 5; } opcode_t * Parrot_is_cclass_i_i_sc_i(opcode_t *cur_opcode, PARROT_INTERP) { IREG(1) = Parrot_str_is_cclass(interp, IREG(2), SCONST(3), IREG(4)); - return (opcode_t *)cur_opcode + 5; + return cur_opcode + 5; } opcode_t * Parrot_is_cclass_i_ic_sc_i(opcode_t *cur_opcode, PARROT_INTERP) { IREG(1) = Parrot_str_is_cclass(interp, ICONST(2), SCONST(3), IREG(4)); - return (opcode_t *)cur_opcode + 5; + return cur_opcode + 5; } opcode_t * Parrot_is_cclass_i_i_s_ic(opcode_t *cur_opcode, PARROT_INTERP) { IREG(1) = Parrot_str_is_cclass(interp, IREG(2), SREG(3), ICONST(4)); - return (opcode_t *)cur_opcode + 5; + return cur_opcode + 5; } opcode_t * Parrot_is_cclass_i_ic_s_ic(opcode_t *cur_opcode, PARROT_INTERP) { IREG(1) = Parrot_str_is_cclass(interp, ICONST(2), SREG(3), ICONST(4)); - return (opcode_t *)cur_opcode + 5; + return cur_opcode + 5; } opcode_t * Parrot_is_cclass_i_i_sc_ic(opcode_t *cur_opcode, PARROT_INTERP) { IREG(1) = Parrot_str_is_cclass(interp, IREG(2), SCONST(3), ICONST(4)); - return (opcode_t *)cur_opcode + 5; + return cur_opcode + 5; } opcode_t * Parrot_is_cclass_i_ic_sc_ic(opcode_t *cur_opcode, PARROT_INTERP) { IREG(1) = Parrot_str_is_cclass(interp, ICONST(2), SCONST(3), ICONST(4)); - return (opcode_t *)cur_opcode + 5; + return cur_opcode + 5; } opcode_t * Parrot_find_cclass_i_i_s_i_i(opcode_t *cur_opcode, PARROT_INTERP) { IREG(1) = Parrot_str_find_cclass(interp, IREG(2), SREG(3), IREG(4), IREG(5)); - return (opcode_t *)cur_opcode + 6; + return cur_opcode + 6; } opcode_t * Parrot_find_cclass_i_ic_s_i_i(opcode_t *cur_opcode, PARROT_INTERP) { IREG(1) = Parrot_str_find_cclass(interp, ICONST(2), SREG(3), IREG(4), IREG(5)); - return (opcode_t *)cur_opcode + 6; + return cur_opcode + 6; } opcode_t * Parrot_find_cclass_i_i_sc_i_i(opcode_t *cur_opcode, PARROT_INTERP) { IREG(1) = Parrot_str_find_cclass(interp, IREG(2), SCONST(3), IREG(4), IREG(5)); - return (opcode_t *)cur_opcode + 6; + return cur_opcode + 6; } opcode_t * Parrot_find_cclass_i_ic_sc_i_i(opcode_t *cur_opcode, PARROT_INTERP) { IREG(1) = Parrot_str_find_cclass(interp, ICONST(2), SCONST(3), IREG(4), IREG(5)); - return (opcode_t *)cur_opcode + 6; + return cur_opcode + 6; } opcode_t * Parrot_find_cclass_i_i_s_ic_i(opcode_t *cur_opcode, PARROT_INTERP) { IREG(1) = Parrot_str_find_cclass(interp, IREG(2), SREG(3), ICONST(4), IREG(5)); - return (opcode_t *)cur_opcode + 6; + return cur_opcode + 6; } opcode_t * Parrot_find_cclass_i_ic_s_ic_i(opcode_t *cur_opcode, PARROT_INTERP) { IREG(1) = Parrot_str_find_cclass(interp, ICONST(2), SREG(3), ICONST(4), IREG(5)); - return (opcode_t *)cur_opcode + 6; + return cur_opcode + 6; } opcode_t * Parrot_find_cclass_i_i_sc_ic_i(opcode_t *cur_opcode, PARROT_INTERP) { IREG(1) = Parrot_str_find_cclass(interp, IREG(2), SCONST(3), ICONST(4), IREG(5)); - return (opcode_t *)cur_opcode + 6; + return cur_opcode + 6; } opcode_t * Parrot_find_cclass_i_ic_sc_ic_i(opcode_t *cur_opcode, PARROT_INTERP) { IREG(1) = Parrot_str_find_cclass(interp, ICONST(2), SCONST(3), ICONST(4), IREG(5)); - return (opcode_t *)cur_opcode + 6; + return cur_opcode + 6; } opcode_t * Parrot_find_cclass_i_i_s_i_ic(opcode_t *cur_opcode, PARROT_INTERP) { IREG(1) = Parrot_str_find_cclass(interp, IREG(2), SREG(3), IREG(4), ICONST(5)); - return (opcode_t *)cur_opcode + 6; + return cur_opcode + 6; } opcode_t * Parrot_find_cclass_i_ic_s_i_ic(opcode_t *cur_opcode, PARROT_INTERP) { IREG(1) = Parrot_str_find_cclass(interp, ICONST(2), SREG(3), IREG(4), ICONST(5)); - return (opcode_t *)cur_opcode + 6; + return cur_opcode + 6; } opcode_t * Parrot_find_cclass_i_i_sc_i_ic(opcode_t *cur_opcode, PARROT_INTERP) { IREG(1) = Parrot_str_find_cclass(interp, IREG(2), SCONST(3), IREG(4), ICONST(5)); - return (opcode_t *)cur_opcode + 6; + return cur_opcode + 6; } opcode_t * Parrot_find_cclass_i_ic_sc_i_ic(opcode_t *cur_opcode, PARROT_INTERP) { IREG(1) = Parrot_str_find_cclass(interp, ICONST(2), SCONST(3), IREG(4), ICONST(5)); - return (opcode_t *)cur_opcode + 6; + return cur_opcode + 6; } opcode_t * Parrot_find_cclass_i_i_s_ic_ic(opcode_t *cur_opcode, PARROT_INTERP) { IREG(1) = Parrot_str_find_cclass(interp, IREG(2), SREG(3), ICONST(4), ICONST(5)); - return (opcode_t *)cur_opcode + 6; + return cur_opcode + 6; } opcode_t * Parrot_find_cclass_i_ic_s_ic_ic(opcode_t *cur_opcode, PARROT_INTERP) { IREG(1) = Parrot_str_find_cclass(interp, ICONST(2), SREG(3), ICONST(4), ICONST(5)); - return (opcode_t *)cur_opcode + 6; + return cur_opcode + 6; } opcode_t * Parrot_find_cclass_i_i_sc_ic_ic(opcode_t *cur_opcode, PARROT_INTERP) { IREG(1) = Parrot_str_find_cclass(interp, IREG(2), SCONST(3), ICONST(4), ICONST(5)); - return (opcode_t *)cur_opcode + 6; + return cur_opcode + 6; } opcode_t * Parrot_find_cclass_i_ic_sc_ic_ic(opcode_t *cur_opcode, PARROT_INTERP) { IREG(1) = Parrot_str_find_cclass(interp, ICONST(2), SCONST(3), ICONST(4), ICONST(5)); - return (opcode_t *)cur_opcode + 6; + return cur_opcode + 6; } opcode_t * Parrot_find_not_cclass_i_i_s_i_i(opcode_t *cur_opcode, PARROT_INTERP) { IREG(1) = Parrot_str_find_not_cclass(interp, IREG(2), SREG(3), IREG(4), IREG(5)); - return (opcode_t *)cur_opcode + 6; + return cur_opcode + 6; } opcode_t * Parrot_find_not_cclass_i_ic_s_i_i(opcode_t *cur_opcode, PARROT_INTERP) { IREG(1) = Parrot_str_find_not_cclass(interp, ICONST(2), SREG(3), IREG(4), IREG(5)); - return (opcode_t *)cur_opcode + 6; + return cur_opcode + 6; } opcode_t * Parrot_find_not_cclass_i_i_sc_i_i(opcode_t *cur_opcode, PARROT_INTERP) { IREG(1) = Parrot_str_find_not_cclass(interp, IREG(2), SCONST(3), IREG(4), IREG(5)); - return (opcode_t *)cur_opcode + 6; + return cur_opcode + 6; } opcode_t * Parrot_find_not_cclass_i_ic_sc_i_i(opcode_t *cur_opcode, PARROT_INTERP) { IREG(1) = Parrot_str_find_not_cclass(interp, ICONST(2), SCONST(3), IREG(4), IREG(5)); - return (opcode_t *)cur_opcode + 6; + return cur_opcode + 6; } opcode_t * Parrot_find_not_cclass_i_i_s_ic_i(opcode_t *cur_opcode, PARROT_INTERP) { IREG(1) = Parrot_str_find_not_cclass(interp, IREG(2), SREG(3), ICONST(4), IREG(5)); - return (opcode_t *)cur_opcode + 6; + return cur_opcode + 6; } opcode_t * Parrot_find_not_cclass_i_ic_s_ic_i(opcode_t *cur_opcode, PARROT_INTERP) { IREG(1) = Parrot_str_find_not_cclass(interp, ICONST(2), SREG(3), ICONST(4), IREG(5)); - return (opcode_t *)cur_opcode + 6; + return cur_opcode + 6; } opcode_t * Parrot_find_not_cclass_i_i_sc_ic_i(opcode_t *cur_opcode, PARROT_INTERP) { IREG(1) = Parrot_str_find_not_cclass(interp, IREG(2), SCONST(3), ICONST(4), IREG(5)); - return (opcode_t *)cur_opcode + 6; + return cur_opcode + 6; } opcode_t * Parrot_find_not_cclass_i_ic_sc_ic_i(opcode_t *cur_opcode, PARROT_INTERP) { IREG(1) = Parrot_str_find_not_cclass(interp, ICONST(2), SCONST(3), ICONST(4), IREG(5)); - return (opcode_t *)cur_opcode + 6; + return cur_opcode + 6; } opcode_t * Parrot_find_not_cclass_i_i_s_i_ic(opcode_t *cur_opcode, PARROT_INTERP) { IREG(1) = Parrot_str_find_not_cclass(interp, IREG(2), SREG(3), IREG(4), ICONST(5)); - return (opcode_t *)cur_opcode + 6; + return cur_opcode + 6; } opcode_t * Parrot_find_not_cclass_i_ic_s_i_ic(opcode_t *cur_opcode, PARROT_INTERP) { IREG(1) = Parrot_str_find_not_cclass(interp, ICONST(2), SREG(3), IREG(4), ICONST(5)); - return (opcode_t *)cur_opcode + 6; + return cur_opcode + 6; } opcode_t * Parrot_find_not_cclass_i_i_sc_i_ic(opcode_t *cur_opcode, PARROT_INTERP) { IREG(1) = Parrot_str_find_not_cclass(interp, IREG(2), SCONST(3), IREG(4), ICONST(5)); - return (opcode_t *)cur_opcode + 6; + return cur_opcode + 6; } opcode_t * Parrot_find_not_cclass_i_ic_sc_i_ic(opcode_t *cur_opcode, PARROT_INTERP) { IREG(1) = Parrot_str_find_not_cclass(interp, ICONST(2), SCONST(3), IREG(4), ICONST(5)); - return (opcode_t *)cur_opcode + 6; + return cur_opcode + 6; } opcode_t * Parrot_find_not_cclass_i_i_s_ic_ic(opcode_t *cur_opcode, PARROT_INTERP) { IREG(1) = Parrot_str_find_not_cclass(interp, IREG(2), SREG(3), ICONST(4), ICONST(5)); - return (opcode_t *)cur_opcode + 6; + return cur_opcode + 6; } opcode_t * Parrot_find_not_cclass_i_ic_s_ic_ic(opcode_t *cur_opcode, PARROT_INTERP) { IREG(1) = Parrot_str_find_not_cclass(interp, ICONST(2), SREG(3), ICONST(4), ICONST(5)); - return (opcode_t *)cur_opcode + 6; + return cur_opcode + 6; } opcode_t * Parrot_find_not_cclass_i_i_sc_ic_ic(opcode_t *cur_opcode, PARROT_INTERP) { IREG(1) = Parrot_str_find_not_cclass(interp, IREG(2), SCONST(3), ICONST(4), ICONST(5)); - return (opcode_t *)cur_opcode + 6; + return cur_opcode + 6; } opcode_t * Parrot_find_not_cclass_i_ic_sc_ic_ic(opcode_t *cur_opcode, PARROT_INTERP) { IREG(1) = Parrot_str_find_not_cclass(interp, ICONST(2), SCONST(3), ICONST(4), ICONST(5)); - return (opcode_t *)cur_opcode + 6; + return cur_opcode + 6; } opcode_t * Parrot_escape_s_s(opcode_t *cur_opcode, PARROT_INTERP) { SREG(1) = Parrot_str_escape(interp, SREG(2)); PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp)); - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * Parrot_compose_s_s(opcode_t *cur_opcode, PARROT_INTERP) { SREG(1) = Parrot_str_compose(interp, SREG(2)); PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp)); - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * Parrot_compose_s_sc(opcode_t *cur_opcode, PARROT_INTERP) { SREG(1) = Parrot_str_compose(interp, SCONST(2)); PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp)); - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * @@ -21475,7 +21780,7 @@ Parrot_find_codepoint_i_s(opcode_t *cur_opcode, PARROT_INTERP) { #endif ; - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * @@ -21493,31 +21798,31 @@ Parrot_find_codepoint_i_sc(opcode_t *cur_opcode, PARROT_INTERP) { #endif ; - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * Parrot_spawnw_i_s(opcode_t *cur_opcode, PARROT_INTERP) { IREG(1) = Parrot_Run_OS_Command(interp, SREG(2)); - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * Parrot_spawnw_i_sc(opcode_t *cur_opcode, PARROT_INTERP) { IREG(1) = Parrot_Run_OS_Command(interp, SCONST(2)); - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * Parrot_spawnw_i_p(opcode_t *cur_opcode, PARROT_INTERP) { IREG(1) = Parrot_Run_OS_Command_Argv(interp, PREG(2)); - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * Parrot_err_i(opcode_t *cur_opcode, PARROT_INTERP) { IREG(1) = errno; - return (opcode_t *)cur_opcode + 2; + return cur_opcode + 2; } opcode_t * @@ -21526,7 +21831,7 @@ Parrot_err_s(opcode_t *cur_opcode, PARROT_INTERP) { SREG(1) = Parrot_str_new_init(interp, tmp, strlen(tmp), Parrot_ascii_encoding_ptr, 0); PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp)); - return (opcode_t *)cur_opcode + 2; + return cur_opcode + 2; } opcode_t * @@ -21535,7 +21840,7 @@ Parrot_err_s_i(opcode_t *cur_opcode, PARROT_INTERP) { SREG(1) = Parrot_str_new_init(interp, tmp, strlen(tmp), Parrot_ascii_encoding_ptr, 0); PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp)); - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * @@ -21544,19 +21849,19 @@ Parrot_err_s_ic(opcode_t *cur_opcode, PARROT_INTERP) { SREG(1) = Parrot_str_new_init(interp, tmp, strlen(tmp), Parrot_ascii_encoding_ptr, 0); PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp)); - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * Parrot_time_i(opcode_t *cur_opcode, PARROT_INTERP) { IREG(1) = Parrot_intval_time(); - return (opcode_t *)cur_opcode + 2; + return cur_opcode + 2; } opcode_t * Parrot_time_n(opcode_t *cur_opcode, PARROT_INTERP) { NREG(1) = Parrot_floatval_time(); - return (opcode_t *)cur_opcode + 2; + return cur_opcode + 2; } opcode_t * @@ -21628,7 +21933,7 @@ Parrot_store_lex_s_p(opcode_t *cur_opcode, PARROT_INTERP) { } VTABLE_set_pmc_keyed_str(interp, lex_pad, lex_name, PREG(2)); - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * @@ -21644,7 +21949,7 @@ Parrot_store_lex_sc_p(opcode_t *cur_opcode, PARROT_INTERP) { } VTABLE_set_pmc_keyed_str(interp, lex_pad, lex_name, PREG(2)); - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * @@ -21660,7 +21965,7 @@ Parrot_store_lex_s_s(opcode_t *cur_opcode, PARROT_INTERP) { } VTABLE_set_string_keyed_str(interp, lex_pad, lex_name, SREG(2)); - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * @@ -21676,7 +21981,7 @@ Parrot_store_lex_sc_s(opcode_t *cur_opcode, PARROT_INTERP) { } VTABLE_set_string_keyed_str(interp, lex_pad, lex_name, SREG(2)); - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * @@ -21692,7 +21997,7 @@ Parrot_store_lex_s_sc(opcode_t *cur_opcode, PARROT_INTERP) { } VTABLE_set_string_keyed_str(interp, lex_pad, lex_name, SCONST(2)); - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * @@ -21708,7 +22013,7 @@ Parrot_store_lex_sc_sc(opcode_t *cur_opcode, PARROT_INTERP) { } VTABLE_set_string_keyed_str(interp, lex_pad, lex_name, SCONST(2)); - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * @@ -21724,7 +22029,7 @@ Parrot_store_lex_s_i(opcode_t *cur_opcode, PARROT_INTERP) { } VTABLE_set_integer_keyed_str(interp, lex_pad, lex_name, IREG(2)); - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * @@ -21740,7 +22045,7 @@ Parrot_store_lex_sc_i(opcode_t *cur_opcode, PARROT_INTERP) { } VTABLE_set_integer_keyed_str(interp, lex_pad, lex_name, IREG(2)); - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * @@ -21756,7 +22061,7 @@ Parrot_store_lex_s_ic(opcode_t *cur_opcode, PARROT_INTERP) { } VTABLE_set_integer_keyed_str(interp, lex_pad, lex_name, ICONST(2)); - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * @@ -21772,7 +22077,7 @@ Parrot_store_lex_sc_ic(opcode_t *cur_opcode, PARROT_INTERP) { } VTABLE_set_integer_keyed_str(interp, lex_pad, lex_name, ICONST(2)); - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * @@ -21788,7 +22093,7 @@ Parrot_store_lex_s_n(opcode_t *cur_opcode, PARROT_INTERP) { } VTABLE_set_number_keyed_str(interp, lex_pad, lex_name, NREG(2)); - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * @@ -21804,7 +22109,7 @@ Parrot_store_lex_sc_n(opcode_t *cur_opcode, PARROT_INTERP) { } VTABLE_set_number_keyed_str(interp, lex_pad, lex_name, NREG(2)); - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * @@ -21820,7 +22125,7 @@ Parrot_store_lex_s_nc(opcode_t *cur_opcode, PARROT_INTERP) { } VTABLE_set_number_keyed_str(interp, lex_pad, lex_name, NCONST(2)); - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * @@ -21836,7 +22141,7 @@ Parrot_store_lex_sc_nc(opcode_t *cur_opcode, PARROT_INTERP) { } VTABLE_set_number_keyed_str(interp, lex_pad, lex_name, NCONST(2)); - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * @@ -21852,7 +22157,7 @@ Parrot_store_dynamic_lex_s_p(opcode_t *cur_opcode, PARROT_INTERP) { } VTABLE_set_pmc_keyed_str(interp, lex_pad, lex_name, PREG(2)); - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * @@ -21868,7 +22173,7 @@ Parrot_store_dynamic_lex_sc_p(opcode_t *cur_opcode, PARROT_INTERP) { } VTABLE_set_pmc_keyed_str(interp, lex_pad, lex_name, PREG(2)); - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * @@ -21880,7 +22185,7 @@ Parrot_find_lex_p_s(opcode_t *cur_opcode, PARROT_INTERP) { PREG(1) = result; PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp)); - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * @@ -21892,7 +22197,7 @@ Parrot_find_lex_p_sc(opcode_t *cur_opcode, PARROT_INTERP) { PREG(1) = result; PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp)); - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * @@ -21904,7 +22209,7 @@ Parrot_find_lex_s_s(opcode_t *cur_opcode, PARROT_INTERP) { SREG(1) = result; PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp)); - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * @@ -21916,7 +22221,7 @@ Parrot_find_lex_s_sc(opcode_t *cur_opcode, PARROT_INTERP) { SREG(1) = result; PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp)); - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * @@ -21927,7 +22232,7 @@ Parrot_find_lex_i_s(opcode_t *cur_opcode, PARROT_INTERP) { INTVAL result = PMC_IS_NULL(lex_pad) ? 0 : VTABLE_get_integer_keyed_str(interp, lex_pad, lex_name); IREG(1) = result; - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * @@ -21938,7 +22243,7 @@ Parrot_find_lex_i_sc(opcode_t *cur_opcode, PARROT_INTERP) { INTVAL result = PMC_IS_NULL(lex_pad) ? 0 : VTABLE_get_integer_keyed_str(interp, lex_pad, lex_name); IREG(1) = result; - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * @@ -21949,7 +22254,7 @@ Parrot_find_lex_n_s(opcode_t *cur_opcode, PARROT_INTERP) { FLOATVAL result = PMC_IS_NULL(lex_pad) ? 0.0 : VTABLE_get_number_keyed_str(interp, lex_pad, lex_name); NREG(1) = result; - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * @@ -21960,7 +22265,7 @@ Parrot_find_lex_n_sc(opcode_t *cur_opcode, PARROT_INTERP) { FLOATVAL result = PMC_IS_NULL(lex_pad) ? 0.0 : VTABLE_get_number_keyed_str(interp, lex_pad, lex_name); NREG(1) = result; - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * @@ -21972,7 +22277,7 @@ Parrot_find_dynamic_lex_p_s(opcode_t *cur_opcode, PARROT_INTERP) { PREG(1) = result; PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp)); - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * @@ -21984,7 +22289,7 @@ Parrot_find_dynamic_lex_p_sc(opcode_t *cur_opcode, PARROT_INTERP) { PREG(1) = result; PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp)); - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * @@ -22008,7 +22313,7 @@ Parrot_find_caller_lex_p_s(opcode_t *cur_opcode, PARROT_INTERP) { PREG(1) = result; PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp)); - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * @@ -22032,7 +22337,7 @@ Parrot_find_caller_lex_p_sc(opcode_t *cur_opcode, PARROT_INTERP) { PREG(1) = result; PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp)); - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * @@ -22041,7 +22346,7 @@ Parrot_get_namespace_p(opcode_t *cur_opcode, PARROT_INTERP) { PREG(1) = cur_ns; PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp)); - return (opcode_t *)cur_opcode + 2; + return cur_opcode + 2; } opcode_t * @@ -22051,7 +22356,7 @@ Parrot_get_namespace_p_p(opcode_t *cur_opcode, PARROT_INTERP) { PREG(1) = PMC_IS_NULL(ns) ? PMCNULL : ns; PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp)); - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * @@ -22061,7 +22366,7 @@ Parrot_get_namespace_p_pc(opcode_t *cur_opcode, PARROT_INTERP) { PREG(1) = PMC_IS_NULL(ns) ? PMCNULL : ns; PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp)); - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * @@ -22070,7 +22375,7 @@ Parrot_get_hll_namespace_p(opcode_t *cur_opcode, PARROT_INTERP) { PREG(1) = hll_ns; PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp)); - return (opcode_t *)cur_opcode + 2; + return cur_opcode + 2; } opcode_t * @@ -22087,7 +22392,7 @@ Parrot_get_hll_namespace_p_p(opcode_t *cur_opcode, PARROT_INTERP) { } PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp)); - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * @@ -22104,7 +22409,7 @@ Parrot_get_hll_namespace_p_pc(opcode_t *cur_opcode, PARROT_INTERP) { } PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp)); - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * @@ -22113,7 +22418,7 @@ Parrot_get_root_namespace_p(opcode_t *cur_opcode, PARROT_INTERP) { PREG(1) = root_ns; PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp)); - return (opcode_t *)cur_opcode + 2; + return cur_opcode + 2; } opcode_t * @@ -22130,7 +22435,7 @@ Parrot_get_root_namespace_p_p(opcode_t *cur_opcode, PARROT_INTERP) { } PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp)); - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * @@ -22147,7 +22452,7 @@ Parrot_get_root_namespace_p_pc(opcode_t *cur_opcode, PARROT_INTERP) { } PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp)); - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * @@ -22156,7 +22461,7 @@ Parrot_get_global_p_s(opcode_t *cur_opcode, PARROT_INTERP) { PREG(1) = Parrot_ns_find_global_from_op(interp, cur_ns, SREG(2), cur_opcode + 3); PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp)); - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * @@ -22165,7 +22470,7 @@ Parrot_get_global_p_sc(opcode_t *cur_opcode, PARROT_INTERP) { PREG(1) = Parrot_ns_find_global_from_op(interp, cur_ns, SCONST(2), cur_opcode + 3); PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp)); - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * @@ -22188,7 +22493,7 @@ Parrot_get_global_p_p_s(opcode_t *cur_opcode, PARROT_INTERP) { } PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp)); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * @@ -22211,7 +22516,7 @@ Parrot_get_global_p_pc_s(opcode_t *cur_opcode, PARROT_INTERP) { } PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp)); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * @@ -22234,7 +22539,7 @@ Parrot_get_global_p_p_sc(opcode_t *cur_opcode, PARROT_INTERP) { } PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp)); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * @@ -22257,7 +22562,7 @@ Parrot_get_global_p_pc_sc(opcode_t *cur_opcode, PARROT_INTERP) { } PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp)); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * @@ -22266,7 +22571,7 @@ Parrot_get_hll_global_p_s(opcode_t *cur_opcode, PARROT_INTERP) { PREG(1) = Parrot_ns_find_global_from_op(interp, hll_ns, SREG(2), cur_opcode + 3); PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp)); - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * @@ -22275,7 +22580,7 @@ Parrot_get_hll_global_p_sc(opcode_t *cur_opcode, PARROT_INTERP) { PREG(1) = Parrot_ns_find_global_from_op(interp, hll_ns, SCONST(2), cur_opcode + 3); PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp)); - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * @@ -22298,7 +22603,7 @@ Parrot_get_hll_global_p_p_s(opcode_t *cur_opcode, PARROT_INTERP) { } PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp)); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * @@ -22321,7 +22626,7 @@ Parrot_get_hll_global_p_pc_s(opcode_t *cur_opcode, PARROT_INTERP) { } PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp)); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * @@ -22344,7 +22649,7 @@ Parrot_get_hll_global_p_p_sc(opcode_t *cur_opcode, PARROT_INTERP) { } PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp)); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * @@ -22367,7 +22672,7 @@ Parrot_get_hll_global_p_pc_sc(opcode_t *cur_opcode, PARROT_INTERP) { } PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp)); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * @@ -22376,7 +22681,7 @@ Parrot_get_root_global_p_s(opcode_t *cur_opcode, PARROT_INTERP) { PREG(1) = Parrot_ns_find_global_from_op(interp, root_ns, SREG(2), cur_opcode + 3); PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp)); - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * @@ -22385,7 +22690,7 @@ Parrot_get_root_global_p_sc(opcode_t *cur_opcode, PARROT_INTERP) { PREG(1) = Parrot_ns_find_global_from_op(interp, root_ns, SCONST(2), cur_opcode + 3); PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp)); - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * @@ -22408,7 +22713,7 @@ Parrot_get_root_global_p_p_s(opcode_t *cur_opcode, PARROT_INTERP) { } PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp)); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * @@ -22431,7 +22736,7 @@ Parrot_get_root_global_p_pc_s(opcode_t *cur_opcode, PARROT_INTERP) { } PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp)); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * @@ -22454,7 +22759,7 @@ Parrot_get_root_global_p_p_sc(opcode_t *cur_opcode, PARROT_INTERP) { } PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp)); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * @@ -22477,7 +22782,7 @@ Parrot_get_root_global_p_pc_sc(opcode_t *cur_opcode, PARROT_INTERP) { } PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp)); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * @@ -22485,7 +22790,7 @@ Parrot_set_global_s_p(opcode_t *cur_opcode, PARROT_INTERP) { PMC * const cur_ns = Parrot_pcc_get_namespace(interp, CURRENT_CONTEXT(interp)); Parrot_ns_set_global(interp, cur_ns, SREG(1), PREG(2)); - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * @@ -22493,7 +22798,7 @@ Parrot_set_global_sc_p(opcode_t *cur_opcode, PARROT_INTERP) { PMC * const cur_ns = Parrot_pcc_get_namespace(interp, CURRENT_CONTEXT(interp)); Parrot_ns_set_global(interp, cur_ns, SCONST(1), PREG(2)); - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * @@ -22502,7 +22807,7 @@ Parrot_set_global_p_s_p(opcode_t *cur_opcode, PARROT_INTERP) { PMC * const ns = Parrot_ns_make_namespace_keyed(interp, cur_ns, PREG(1)); Parrot_ns_set_global(interp, ns, SREG(2), PREG(3)); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * @@ -22511,7 +22816,7 @@ Parrot_set_global_pc_s_p(opcode_t *cur_opcode, PARROT_INTERP) { PMC * const ns = Parrot_ns_make_namespace_keyed(interp, cur_ns, PCONST(1)); Parrot_ns_set_global(interp, ns, SREG(2), PREG(3)); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * @@ -22520,7 +22825,7 @@ Parrot_set_global_p_sc_p(opcode_t *cur_opcode, PARROT_INTERP) { PMC * const ns = Parrot_ns_make_namespace_keyed(interp, cur_ns, PREG(1)); Parrot_ns_set_global(interp, ns, SCONST(2), PREG(3)); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * @@ -22529,7 +22834,7 @@ Parrot_set_global_pc_sc_p(opcode_t *cur_opcode, PARROT_INTERP) { PMC * const ns = Parrot_ns_make_namespace_keyed(interp, cur_ns, PCONST(1)); Parrot_ns_set_global(interp, ns, SCONST(2), PREG(3)); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * @@ -22537,7 +22842,7 @@ Parrot_set_hll_global_s_p(opcode_t *cur_opcode, PARROT_INTERP) { PMC * const hll_ns = Parrot_hll_get_ctx_HLL_namespace(interp); Parrot_ns_set_global(interp, hll_ns, SREG(1), PREG(2)); - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * @@ -22545,7 +22850,7 @@ Parrot_set_hll_global_sc_p(opcode_t *cur_opcode, PARROT_INTERP) { PMC * const hll_ns = Parrot_hll_get_ctx_HLL_namespace(interp); Parrot_ns_set_global(interp, hll_ns, SCONST(1), PREG(2)); - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * @@ -22554,7 +22859,7 @@ Parrot_set_hll_global_p_s_p(opcode_t *cur_opcode, PARROT_INTERP) { PMC * const ns = Parrot_ns_make_namespace_keyed(interp, hll_ns, PREG(1)); Parrot_ns_set_global(interp, ns, SREG(2), PREG(3)); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * @@ -22563,7 +22868,7 @@ Parrot_set_hll_global_pc_s_p(opcode_t *cur_opcode, PARROT_INTERP) { PMC * const ns = Parrot_ns_make_namespace_keyed(interp, hll_ns, PCONST(1)); Parrot_ns_set_global(interp, ns, SREG(2), PREG(3)); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * @@ -22572,7 +22877,7 @@ Parrot_set_hll_global_p_sc_p(opcode_t *cur_opcode, PARROT_INTERP) { PMC * const ns = Parrot_ns_make_namespace_keyed(interp, hll_ns, PREG(1)); Parrot_ns_set_global(interp, ns, SCONST(2), PREG(3)); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * @@ -22581,7 +22886,7 @@ Parrot_set_hll_global_pc_sc_p(opcode_t *cur_opcode, PARROT_INTERP) { PMC * const ns = Parrot_ns_make_namespace_keyed(interp, hll_ns, PCONST(1)); Parrot_ns_set_global(interp, ns, SCONST(2), PREG(3)); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * @@ -22589,7 +22894,7 @@ Parrot_set_root_global_s_p(opcode_t *cur_opcode, PARROT_INTERP) { PMC * const root_ns = interp->root_namespace; Parrot_ns_set_global(interp, root_ns, SREG(1), PREG(2)); - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * @@ -22597,7 +22902,7 @@ Parrot_set_root_global_sc_p(opcode_t *cur_opcode, PARROT_INTERP) { PMC * const root_ns = interp->root_namespace; Parrot_ns_set_global(interp, root_ns, SCONST(1), PREG(2)); - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * @@ -22606,7 +22911,7 @@ Parrot_set_root_global_p_s_p(opcode_t *cur_opcode, PARROT_INTERP) { PMC * const ns = Parrot_ns_make_namespace_keyed(interp, root_ns, PREG(1)); Parrot_ns_set_global(interp, ns, SREG(2), PREG(3)); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * @@ -22615,7 +22920,7 @@ Parrot_set_root_global_pc_s_p(opcode_t *cur_opcode, PARROT_INTERP) { PMC * const ns = Parrot_ns_make_namespace_keyed(interp, root_ns, PCONST(1)); Parrot_ns_set_global(interp, ns, SREG(2), PREG(3)); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * @@ -22624,7 +22929,7 @@ Parrot_set_root_global_p_sc_p(opcode_t *cur_opcode, PARROT_INTERP) { PMC * const ns = Parrot_ns_make_namespace_keyed(interp, root_ns, PREG(1)); Parrot_ns_set_global(interp, ns, SCONST(2), PREG(3)); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * @@ -22633,7 +22938,7 @@ Parrot_set_root_global_pc_sc_p(opcode_t *cur_opcode, PARROT_INTERP) { PMC * const ns = Parrot_ns_make_namespace_keyed(interp, root_ns, PCONST(1)); Parrot_ns_set_global(interp, ns, SCONST(2), PREG(3)); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * @@ -22647,7 +22952,7 @@ Parrot_find_name_p_s(opcode_t *cur_opcode, PARROT_INTERP) { PREG(1) = Parrot_ns_find_named_item(interp, SREG(2), cur_opcode + 3); PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp)); - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * @@ -22661,7 +22966,7 @@ Parrot_find_name_p_sc(opcode_t *cur_opcode, PARROT_INTERP) { PREG(1) = Parrot_ns_find_named_item(interp, SCONST(2), cur_opcode + 3); PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp)); - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * @@ -22683,7 +22988,7 @@ Parrot_find_sub_not_null_p_s(opcode_t *cur_opcode, PARROT_INTERP) { PREG(1) = sub; PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp)); - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * @@ -22705,11 +23010,12 @@ Parrot_find_sub_not_null_p_sc(opcode_t *cur_opcode, PARROT_INTERP) { PREG(1) = sub; PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp)); - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * Parrot_trap(opcode_t *cur_opcode, PARROT_INTERP) { + UNUSED(interp); #if defined(__GNUC__) && defined(i386) __asm__("int3"); @@ -22720,13 +23026,13 @@ Parrot_trap(opcode_t *cur_opcode, PARROT_INTERP) { #endif ; - return (opcode_t *)cur_opcode + 1; + return cur_opcode + 1; } opcode_t * Parrot_set_label_p_ic(opcode_t *cur_opcode, PARROT_INTERP) { VTABLE_set_pointer(interp, PREG(1), ((CUR_OPCODE + ICONST(2)))); - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; } opcode_t * @@ -22734,7 +23040,19 @@ Parrot_get_label_i_p(opcode_t *cur_opcode, PARROT_INTERP) { void * const ptr = VTABLE_get_pointer(interp, PREG(2)); IREG(1) = PTR2INTVAL(ptr); - return (opcode_t *)cur_opcode + 3; + return cur_opcode + 3; +} + +opcode_t * +Parrot_get_id_i_p(opcode_t *cur_opcode, PARROT_INTERP) { + IREG(1) = Parrot_hash_pointer((void *)PREG(2), interp->hash_seed); + return cur_opcode + 3; +} + +opcode_t * +Parrot_get_id_i_pc(opcode_t *cur_opcode, PARROT_INTERP) { + IREG(1) = Parrot_hash_pointer((void *)PCONST(2), interp->hash_seed); + return cur_opcode + 3; } opcode_t * @@ -22745,7 +23063,7 @@ Parrot_fetch_p_p_p_p(opcode_t *cur_opcode, PARROT_INTERP) { } PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp)); - return (opcode_t *)cur_opcode + 5; + return cur_opcode + 5; } opcode_t * @@ -22756,7 +23074,7 @@ Parrot_fetch_p_pc_p_p(opcode_t *cur_opcode, PARROT_INTERP) { } PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp)); - return (opcode_t *)cur_opcode + 5; + return cur_opcode + 5; } opcode_t * @@ -22767,7 +23085,7 @@ Parrot_fetch_p_p_pc_p(opcode_t *cur_opcode, PARROT_INTERP) { } PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp)); - return (opcode_t *)cur_opcode + 5; + return cur_opcode + 5; } opcode_t * @@ -22778,7 +23096,7 @@ Parrot_fetch_p_pc_pc_p(opcode_t *cur_opcode, PARROT_INTERP) { } PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp)); - return (opcode_t *)cur_opcode + 5; + return cur_opcode + 5; } opcode_t * @@ -22789,7 +23107,7 @@ Parrot_fetch_p_p_p_pc(opcode_t *cur_opcode, PARROT_INTERP) { } PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp)); - return (opcode_t *)cur_opcode + 5; + return cur_opcode + 5; } opcode_t * @@ -22800,7 +23118,7 @@ Parrot_fetch_p_pc_p_pc(opcode_t *cur_opcode, PARROT_INTERP) { } PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp)); - return (opcode_t *)cur_opcode + 5; + return cur_opcode + 5; } opcode_t * @@ -22811,7 +23129,7 @@ Parrot_fetch_p_p_pc_pc(opcode_t *cur_opcode, PARROT_INTERP) { } PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp)); - return (opcode_t *)cur_opcode + 5; + return cur_opcode + 5; } opcode_t * @@ -22822,7 +23140,7 @@ Parrot_fetch_p_pc_pc_pc(opcode_t *cur_opcode, PARROT_INTERP) { } PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp)); - return (opcode_t *)cur_opcode + 5; + return cur_opcode + 5; } opcode_t * @@ -22833,7 +23151,7 @@ Parrot_fetch_p_p_i_p(opcode_t *cur_opcode, PARROT_INTERP) { } PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp)); - return (opcode_t *)cur_opcode + 5; + return cur_opcode + 5; } opcode_t * @@ -22844,7 +23162,7 @@ Parrot_fetch_p_pc_i_p(opcode_t *cur_opcode, PARROT_INTERP) { } PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp)); - return (opcode_t *)cur_opcode + 5; + return cur_opcode + 5; } opcode_t * @@ -22855,7 +23173,7 @@ Parrot_fetch_p_p_ic_p(opcode_t *cur_opcode, PARROT_INTERP) { } PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp)); - return (opcode_t *)cur_opcode + 5; + return cur_opcode + 5; } opcode_t * @@ -22866,7 +23184,7 @@ Parrot_fetch_p_pc_ic_p(opcode_t *cur_opcode, PARROT_INTERP) { } PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp)); - return (opcode_t *)cur_opcode + 5; + return cur_opcode + 5; } opcode_t * @@ -22877,7 +23195,7 @@ Parrot_fetch_p_p_i_pc(opcode_t *cur_opcode, PARROT_INTERP) { } PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp)); - return (opcode_t *)cur_opcode + 5; + return cur_opcode + 5; } opcode_t * @@ -22888,7 +23206,7 @@ Parrot_fetch_p_pc_i_pc(opcode_t *cur_opcode, PARROT_INTERP) { } PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp)); - return (opcode_t *)cur_opcode + 5; + return cur_opcode + 5; } opcode_t * @@ -22899,7 +23217,7 @@ Parrot_fetch_p_p_ic_pc(opcode_t *cur_opcode, PARROT_INTERP) { } PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp)); - return (opcode_t *)cur_opcode + 5; + return cur_opcode + 5; } opcode_t * @@ -22910,7 +23228,7 @@ Parrot_fetch_p_pc_ic_pc(opcode_t *cur_opcode, PARROT_INTERP) { } PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp)); - return (opcode_t *)cur_opcode + 5; + return cur_opcode + 5; } opcode_t * @@ -22921,7 +23239,7 @@ Parrot_fetch_p_p_s_p(opcode_t *cur_opcode, PARROT_INTERP) { } PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp)); - return (opcode_t *)cur_opcode + 5; + return cur_opcode + 5; } opcode_t * @@ -22932,7 +23250,7 @@ Parrot_fetch_p_pc_s_p(opcode_t *cur_opcode, PARROT_INTERP) { } PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp)); - return (opcode_t *)cur_opcode + 5; + return cur_opcode + 5; } opcode_t * @@ -22943,7 +23261,7 @@ Parrot_fetch_p_p_sc_p(opcode_t *cur_opcode, PARROT_INTERP) { } PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp)); - return (opcode_t *)cur_opcode + 5; + return cur_opcode + 5; } opcode_t * @@ -22954,7 +23272,7 @@ Parrot_fetch_p_pc_sc_p(opcode_t *cur_opcode, PARROT_INTERP) { } PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp)); - return (opcode_t *)cur_opcode + 5; + return cur_opcode + 5; } opcode_t * @@ -22965,7 +23283,7 @@ Parrot_fetch_p_p_s_pc(opcode_t *cur_opcode, PARROT_INTERP) { } PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp)); - return (opcode_t *)cur_opcode + 5; + return cur_opcode + 5; } opcode_t * @@ -22976,7 +23294,7 @@ Parrot_fetch_p_pc_s_pc(opcode_t *cur_opcode, PARROT_INTERP) { } PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp)); - return (opcode_t *)cur_opcode + 5; + return cur_opcode + 5; } opcode_t * @@ -22987,7 +23305,7 @@ Parrot_fetch_p_p_sc_pc(opcode_t *cur_opcode, PARROT_INTERP) { } PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp)); - return (opcode_t *)cur_opcode + 5; + return cur_opcode + 5; } opcode_t * @@ -22998,7 +23316,7 @@ Parrot_fetch_p_pc_sc_pc(opcode_t *cur_opcode, PARROT_INTERP) { } PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp)); - return (opcode_t *)cur_opcode + 5; + return cur_opcode + 5; } opcode_t * @@ -23010,7 +23328,7 @@ Parrot_vivify_p_p_p_p(opcode_t *cur_opcode, PARROT_INTERP) { } PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp)); - return (opcode_t *)cur_opcode + 5; + return cur_opcode + 5; } opcode_t * @@ -23022,7 +23340,7 @@ Parrot_vivify_p_pc_p_p(opcode_t *cur_opcode, PARROT_INTERP) { } PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp)); - return (opcode_t *)cur_opcode + 5; + return cur_opcode + 5; } opcode_t * @@ -23034,7 +23352,7 @@ Parrot_vivify_p_p_pc_p(opcode_t *cur_opcode, PARROT_INTERP) { } PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp)); - return (opcode_t *)cur_opcode + 5; + return cur_opcode + 5; } opcode_t * @@ -23046,7 +23364,7 @@ Parrot_vivify_p_pc_pc_p(opcode_t *cur_opcode, PARROT_INTERP) { } PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp)); - return (opcode_t *)cur_opcode + 5; + return cur_opcode + 5; } opcode_t * @@ -23058,7 +23376,7 @@ Parrot_vivify_p_p_p_pc(opcode_t *cur_opcode, PARROT_INTERP) { } PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp)); - return (opcode_t *)cur_opcode + 5; + return cur_opcode + 5; } opcode_t * @@ -23070,7 +23388,7 @@ Parrot_vivify_p_pc_p_pc(opcode_t *cur_opcode, PARROT_INTERP) { } PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp)); - return (opcode_t *)cur_opcode + 5; + return cur_opcode + 5; } opcode_t * @@ -23082,7 +23400,7 @@ Parrot_vivify_p_p_pc_pc(opcode_t *cur_opcode, PARROT_INTERP) { } PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp)); - return (opcode_t *)cur_opcode + 5; + return cur_opcode + 5; } opcode_t * @@ -23094,7 +23412,7 @@ Parrot_vivify_p_pc_pc_pc(opcode_t *cur_opcode, PARROT_INTERP) { } PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp)); - return (opcode_t *)cur_opcode + 5; + return cur_opcode + 5; } opcode_t * @@ -23106,7 +23424,7 @@ Parrot_vivify_p_p_i_p(opcode_t *cur_opcode, PARROT_INTERP) { } PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp)); - return (opcode_t *)cur_opcode + 5; + return cur_opcode + 5; } opcode_t * @@ -23118,7 +23436,7 @@ Parrot_vivify_p_pc_i_p(opcode_t *cur_opcode, PARROT_INTERP) { } PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp)); - return (opcode_t *)cur_opcode + 5; + return cur_opcode + 5; } opcode_t * @@ -23130,7 +23448,7 @@ Parrot_vivify_p_p_ic_p(opcode_t *cur_opcode, PARROT_INTERP) { } PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp)); - return (opcode_t *)cur_opcode + 5; + return cur_opcode + 5; } opcode_t * @@ -23142,7 +23460,7 @@ Parrot_vivify_p_pc_ic_p(opcode_t *cur_opcode, PARROT_INTERP) { } PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp)); - return (opcode_t *)cur_opcode + 5; + return cur_opcode + 5; } opcode_t * @@ -23154,7 +23472,7 @@ Parrot_vivify_p_p_i_pc(opcode_t *cur_opcode, PARROT_INTERP) { } PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp)); - return (opcode_t *)cur_opcode + 5; + return cur_opcode + 5; } opcode_t * @@ -23166,7 +23484,7 @@ Parrot_vivify_p_pc_i_pc(opcode_t *cur_opcode, PARROT_INTERP) { } PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp)); - return (opcode_t *)cur_opcode + 5; + return cur_opcode + 5; } opcode_t * @@ -23178,7 +23496,7 @@ Parrot_vivify_p_p_ic_pc(opcode_t *cur_opcode, PARROT_INTERP) { } PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp)); - return (opcode_t *)cur_opcode + 5; + return cur_opcode + 5; } opcode_t * @@ -23190,7 +23508,7 @@ Parrot_vivify_p_pc_ic_pc(opcode_t *cur_opcode, PARROT_INTERP) { } PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp)); - return (opcode_t *)cur_opcode + 5; + return cur_opcode + 5; } opcode_t * @@ -23202,7 +23520,7 @@ Parrot_vivify_p_p_s_p(opcode_t *cur_opcode, PARROT_INTERP) { } PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp)); - return (opcode_t *)cur_opcode + 5; + return cur_opcode + 5; } opcode_t * @@ -23214,7 +23532,7 @@ Parrot_vivify_p_pc_s_p(opcode_t *cur_opcode, PARROT_INTERP) { } PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp)); - return (opcode_t *)cur_opcode + 5; + return cur_opcode + 5; } opcode_t * @@ -23226,7 +23544,7 @@ Parrot_vivify_p_p_sc_p(opcode_t *cur_opcode, PARROT_INTERP) { } PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp)); - return (opcode_t *)cur_opcode + 5; + return cur_opcode + 5; } opcode_t * @@ -23238,7 +23556,7 @@ Parrot_vivify_p_pc_sc_p(opcode_t *cur_opcode, PARROT_INTERP) { } PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp)); - return (opcode_t *)cur_opcode + 5; + return cur_opcode + 5; } opcode_t * @@ -23250,7 +23568,7 @@ Parrot_vivify_p_p_s_pc(opcode_t *cur_opcode, PARROT_INTERP) { } PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp)); - return (opcode_t *)cur_opcode + 5; + return cur_opcode + 5; } opcode_t * @@ -23262,7 +23580,7 @@ Parrot_vivify_p_pc_s_pc(opcode_t *cur_opcode, PARROT_INTERP) { } PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp)); - return (opcode_t *)cur_opcode + 5; + return cur_opcode + 5; } opcode_t * @@ -23274,7 +23592,7 @@ Parrot_vivify_p_p_sc_pc(opcode_t *cur_opcode, PARROT_INTERP) { } PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp)); - return (opcode_t *)cur_opcode + 5; + return cur_opcode + 5; } opcode_t * @@ -23286,7 +23604,7 @@ Parrot_vivify_p_pc_sc_pc(opcode_t *cur_opcode, PARROT_INTERP) { } PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp)); - return (opcode_t *)cur_opcode + 5; + return cur_opcode + 5; } opcode_t * @@ -23314,7 +23632,7 @@ Parrot_new_p_s_i(opcode_t *cur_opcode, PARROT_INTERP) { } PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp)); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * @@ -23342,7 +23660,7 @@ Parrot_new_p_sc_i(opcode_t *cur_opcode, PARROT_INTERP) { } PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp)); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * @@ -23370,7 +23688,7 @@ Parrot_new_p_s_ic(opcode_t *cur_opcode, PARROT_INTERP) { } PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp)); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * @@ -23398,7 +23716,7 @@ Parrot_new_p_sc_ic(opcode_t *cur_opcode, PARROT_INTERP) { } PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp)); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * @@ -23431,7 +23749,7 @@ Parrot_new_p_p_i(opcode_t *cur_opcode, PARROT_INTERP) { } PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp)); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * @@ -23464,7 +23782,7 @@ Parrot_new_p_pc_i(opcode_t *cur_opcode, PARROT_INTERP) { } PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp)); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * @@ -23497,7 +23815,7 @@ Parrot_new_p_p_ic(opcode_t *cur_opcode, PARROT_INTERP) { } PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp)); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * @@ -23530,7 +23848,7 @@ Parrot_new_p_pc_ic(opcode_t *cur_opcode, PARROT_INTERP) { } PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp)); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * @@ -23565,7 +23883,7 @@ Parrot_root_new_p_p_i(opcode_t *cur_opcode, PARROT_INTERP) { } PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp)); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * @@ -23600,7 +23918,7 @@ Parrot_root_new_p_pc_i(opcode_t *cur_opcode, PARROT_INTERP) { } PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp)); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * @@ -23635,7 +23953,7 @@ Parrot_root_new_p_p_ic(opcode_t *cur_opcode, PARROT_INTERP) { } PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp)); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; } opcode_t * @@ -23670,7 +23988,219 @@ Parrot_root_new_p_pc_ic(opcode_t *cur_opcode, PARROT_INTERP) { } PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp)); - return (opcode_t *)cur_opcode + 4; + return cur_opcode + 4; +} + +opcode_t * +Parrot_get_context_p(opcode_t *cur_opcode, PARROT_INTERP) { + PREG(1) = CURRENT_CONTEXT(interp); + PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp)); + return cur_opcode + 2; +} + +opcode_t * +Parrot_new_call_context_p(opcode_t *cur_opcode, PARROT_INTERP) { + PREG(1) = Parrot_pmc_new(interp, enum_class_CallContext); + PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp)); + return cur_opcode + 2; +} + +opcode_t * +Parrot_invokecc_p_p(opcode_t *cur_opcode, PARROT_INTERP) { + PMC * const p = PREG(1); + opcode_t * dest = cur_opcode + 3; + PMC * const signature = PREG(2); + + Parrot_pcc_set_pc(interp, CURRENT_CONTEXT(interp), dest); + + Parrot_pcc_reuse_continuation(interp, CURRENT_CONTEXT(interp), dest); + dest = VTABLE_invoke(interp, p, dest); + return (opcode_t *)dest; +} + +opcode_t * +Parrot_flatten_array_into_p_p_i(opcode_t *cur_opcode, PARROT_INTERP) { + PMC * const dest = PREG(1); + PMC * const src = PREG(2); + const INTVAL overwrite = IREG(3); + INTVAL i; + INTVAL start_idx = overwrite ? 0 : VTABLE_elements(interp, dest); + INTVAL src_elems = VTABLE_elements(interp, src); + + for (i = 0; (i < src_elems); (i++)) { + PMC * const val = VTABLE_get_pmc_keyed_int(interp, dest, i); + + VTABLE_set_pmc_keyed_int(interp, dest, (i + start_idx), val); + } + + return cur_opcode + 4; +} + +opcode_t * +Parrot_flatten_array_into_p_p_ic(opcode_t *cur_opcode, PARROT_INTERP) { + PMC * const dest = PREG(1); + PMC * const src = PREG(2); + const INTVAL overwrite = ICONST(3); + INTVAL i; + INTVAL start_idx = overwrite ? 0 : VTABLE_elements(interp, dest); + INTVAL src_elems = VTABLE_elements(interp, src); + + for (i = 0; (i < src_elems); (i++)) { + PMC * const val = VTABLE_get_pmc_keyed_int(interp, dest, i); + + VTABLE_set_pmc_keyed_int(interp, dest, (i + start_idx), val); + } + + return cur_opcode + 4; +} + +opcode_t * +Parrot_flatten_hash_into_p_p_i(opcode_t *cur_opcode, PARROT_INTERP) { + PMC * const dest = PREG(1); + PMC * const src = PREG(2); + const INTVAL overwrite = IREG(3); + + Parrot_hash_flatten_hash_into(interp, dest, src, overwrite); + return cur_opcode + 4; +} + +opcode_t * +Parrot_flatten_hash_into_p_p_ic(opcode_t *cur_opcode, PARROT_INTERP) { + PMC * const dest = PREG(1); + PMC * const src = PREG(2); + const INTVAL overwrite = ICONST(3); + + Parrot_hash_flatten_hash_into(interp, dest, src, overwrite); + return cur_opcode + 4; +} + +opcode_t * +Parrot_slurp_array_from_p_p_i(opcode_t *cur_opcode, PARROT_INTERP) { + PMC * const dest = Parrot_pmc_new(interp, enum_class_ResizablePMCArray); + PMC * const src = PREG(2); + const INTVAL src_elems = VTABLE_elements(interp, src); + INTVAL i; + + for (i = IREG(3); (i < src_elems); (i++)) { + PMC * const value = VTABLE_get_pmc_keyed_int(interp, src, i); + + VTABLE_push_pmc(interp, src, value); + } + + PREG(1) = dest; + PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp)); + return cur_opcode + 4; +} + +opcode_t * +Parrot_slurp_array_from_p_p_ic(opcode_t *cur_opcode, PARROT_INTERP) { + PMC * const dest = Parrot_pmc_new(interp, enum_class_ResizablePMCArray); + PMC * const src = PREG(2); + const INTVAL src_elems = VTABLE_elements(interp, src); + INTVAL i; + + for (i = ICONST(3); (i < src_elems); (i++)) { + PMC * const value = VTABLE_get_pmc_keyed_int(interp, src, i); + + VTABLE_push_pmc(interp, src, value); + } + + PREG(1) = dest; + PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp)); + return cur_opcode + 4; +} + +opcode_t * +Parrot_receive_p(opcode_t *cur_opcode, PARROT_INTERP) { + opcode_t *const dest = cur_opcode + 2; + PMC * cur_task = Parrot_cx_current_task(interp); + Parrot_Task_attributes * tdata = PARROT_TASK(cur_task); + int msg_count; + + if (PMC_IS_NULL(tdata->mailbox)) { + tdata->mailbox = Parrot_pmc_new(interp, enum_class_PMCList); + PARROT_GC_WRITE_BARRIER(interp, cur_task); + msg_count = 0; + } + else { + msg_count = VTABLE_elements(interp, tdata->mailbox); + } + + if ((msg_count > 0)) { + PREG(1) = VTABLE_shift_pmc(interp, tdata->mailbox); + { + PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp)); + return (opcode_t *)dest; + } + + } + else { + TASK_recv_block_SET(cur_task); + (void)Parrot_cx_stop_task(interp, cur_opcode); + { + PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp)); + return (opcode_t *)0; + } + + } + + PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp)); + return cur_opcode + 2; +} + +opcode_t * +Parrot_wait_p(opcode_t *cur_opcode, PARROT_INTERP) { + opcode_t *const next = cur_opcode + 2; + PMC * task = PREG(1); + PMC * cur_task; + Parrot_Task_attributes * tdata; + + if ((!VTABLE_isa(interp, task, Parrot_str_new_constant(interp, "Task")))) { + Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_INVALID_OPERATION, "Argument to wait op must be a Task.\n"); + } + + cur_task = Parrot_cx_stop_task(interp, next); + tdata = PARROT_TASK(task); + if (PMC_IS_NULL(tdata->waiters)) { + tdata->waiters = Parrot_pmc_new(interp, enum_class_ResizablePMCArray); + PARROT_GC_WRITE_BARRIER(interp, task); + } + + VTABLE_push_pmc(interp, tdata->waiters, cur_task); + return (opcode_t *)0; + return cur_opcode + 2; +} + +opcode_t * +Parrot_wait_pc(opcode_t *cur_opcode, PARROT_INTERP) { + opcode_t *const next = cur_opcode + 2; + PMC * task = PCONST(1); + PMC * cur_task; + Parrot_Task_attributes * tdata; + + if ((!VTABLE_isa(interp, task, Parrot_str_new_constant(interp, "Task")))) { + Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_INVALID_OPERATION, "Argument to wait op must be a Task.\n"); + } + + cur_task = Parrot_cx_stop_task(interp, next); + tdata = PARROT_TASK(task); + if (PMC_IS_NULL(tdata->waiters)) { + tdata->waiters = Parrot_pmc_new(interp, enum_class_ResizablePMCArray); + PARROT_GC_WRITE_BARRIER(interp, task); + } + + VTABLE_push_pmc(interp, tdata->waiters, cur_task); + return (opcode_t *)0; + return cur_opcode + 2; +} + +opcode_t * +Parrot_pass(opcode_t *cur_opcode, PARROT_INTERP) { + opcode_t *const next = cur_opcode + 1; + opcode_t *const addr = Parrot_cx_preempt_task(interp, interp->scheduler, next); + + return (opcode_t *)addr; + return cur_opcode + 1; } @@ -23684,10 +24214,10 @@ op_lib_t core_op_lib = { "", /* suffix */ PARROT_FUNCTION_CORE, /* core_type = PARROT_XX_CORE */ 0, /* flags */ - 3, /* major_version */ - 6, /* minor_version */ + 4, /* major_version */ + 3, /* minor_version */ 0, /* patch_version */ - 1091, /* op_count */ + 1113, /* op_count */ core_op_info_table, /* op_info_table */ core_op_func_table, /* op_func_table */ get_op /* op_code() */ @@ -23783,14 +24313,15 @@ static int get_op(PARROT_INTERP, ARGIN(const char *name), int full) static void hop_init(PARROT_INTERP) { op_info_t * const info = core_op_lib.op_info_table; + opcode_t i; /* allocate the storage all in one chunk * yes, this is profligate, but we can tighten it later */ - HOP * const hop_buckets = - mem_gc_allocate_n_zeroed_typed(interp, core_op_lib.op_count * 2, HOP ); - HOP *hops = hop_buckets; + HOP *hops; + + hop_buckets = mem_gc_allocate_n_zeroed_typed(interp, core_op_lib.op_count * 2, HOP ); + hops = hop_buckets; - opcode_t i; /* store full names */ for (i = 0; i < core_op_lib.op_count; i++) { @@ -23813,7 +24344,7 @@ static void hop_deinit(PARROT_INTERP) hop_buckets = NULL; }PARROT_EXPORT op_lib_t * -Parrot_DynOp_core_3_6_0(PARROT_INTERP, long init) { +Parrot_DynOp_core_4_3_0(PARROT_INTERP, long init) { /* initialize and return op_lib ptr */ if (init == 1) { @@ -23842,7 +24373,7 @@ Parrot_lib_core_ops_load(PARROT_INTERP) { PMC *const lib = Parrot_pmc_new(interp, enum_class_ParrotLibrary); - ((Parrot_ParrotLibrary_attributes*)PMC_data(lib))->oplib_init = (void *) Parrot_DynOp_core_3_6_0; + ((Parrot_ParrotLibrary_attributes*)PMC_data(lib))->oplib_init = (void *) Parrot_DynOp_core_4_3_0; dynop_register(interp, lib); return lib; } diff --git a/src/ops/experimental.ops b/src/ops/experimental.ops index 7841d069f5..5eab220f18 100644 --- a/src/ops/experimental.ops +++ b/src/ops/experimental.ops @@ -2,6 +2,12 @@ ** experimental.ops */ +BEGIN_OPS_PREAMBLE + +#include "parrot/scheduler_private.h" +#include "pmc/pmc_task.h" + +END_OPS_PREAMBLE =head1 NAME experimental.ops - Experimental Opcodes @@ -15,8 +21,8 @@ This file contains experimental opcodes. These opcodes should be considered implicitly deprecated - that is, they may be removed in any release. -If you rely on any of these opcodes, please open a -Trac ticket at L. +If you rely on any of these opcodes, please open an issue at +L When making changes to any ops file, run C to regenerate all generated ops files. @@ -42,6 +48,7 @@ For other architectures, this is a C. =cut op trap() :deprecated { + UNUSED(interp); #if defined(__GNUC__) && defined(i386) __asm__("int3"); /* opcode 0xcc */ #endif @@ -71,6 +78,23 @@ inline op get_label(out INT, invar PMC) { $1 = PTR2INTVAL(ptr); } +=item B(out INT, in PMC) + +Gets a unique(*) ID for a PMC. + +This may or may not be based on the pointer of the PMC, but almost certainly is +not the raw pointer value. + +(*) Uniqueness of these IDs is only guarranteed within code to which this PMC is +currently visible (ie: not across processes, or share-nothing threads, and not +beyond the lifetime of the PMC). + +=cut + +inline op get_id(out INT, in PMC) { + $1 = Parrot_hash_pointer((void *)$2, interp->hash_seed); +} + =item B(out PMC, in PMC, in PMC, in PMC) Fetches a value from $2, keyed by $3 into $1. If the resulting PMC is PMCNULL, @@ -245,6 +269,155 @@ op root_new(out PMC, in PMC, in INT) { } } +=item B(out PMC) + +=cut + +op get_context(out PMC) { + $1 = CURRENT_CONTEXT(interp); +} + +=item B(out PMC) + +=cut + +op new_call_context(out PMC) { + $1 = Parrot_pmc_new(interp, enum_class_CallContext); +} + +=item B(invar PMC, invar PMC) + +=cut + +inline op invokecc(invar PMC, invar PMC) :flow { + PMC * const p = $1; + opcode_t *dest = expr NEXT(); + PMC * const signature = $2; + + Parrot_pcc_set_pc(interp, CURRENT_CONTEXT(interp), dest); + + Parrot_pcc_reuse_continuation(interp, CURRENT_CONTEXT(interp), dest); + dest = VTABLE_invoke(interp, p, dest); + + goto ADDRESS(dest); +} + +=item B(invar PMC, invar PMC, in INT) + +=cut + +op flatten_array_into(invar PMC, invar PMC, in INT) { + PMC * const dest = $1; + PMC * const src = $2; + const INTVAL overwrite = $3; + INTVAL i; + INTVAL start_idx = overwrite ? 0 : VTABLE_elements(interp, dest); + INTVAL src_elems = VTABLE_elements(interp, src); + for (i = 0; i < src_elems; i++) { + PMC * const val = VTABLE_get_pmc_keyed_int(interp, dest, i); + VTABLE_set_pmc_keyed_int(interp, dest, i + start_idx, val); + } +} + +=item B(invar PMC, invar PMC, in INT) + +=cut + +op flatten_hash_into(invar PMC, invar PMC, in INT) { + PMC * const dest = $1; + PMC * const src = $2; + const INTVAL overwrite = $3; + Parrot_hash_flatten_hash_into(interp, dest, src, overwrite); +} + +=item B(out PMC, invar PMC, in INT) + +=cut + +op slurp_array_from(out PMC, invar PMC, in INT) { + PMC * const dest = Parrot_pmc_new(interp, enum_class_ResizablePMCArray); + PMC * const src = $2; + const INTVAL src_elems = VTABLE_elements(interp, src); + INTVAL i; + for (i = $3; i < src_elems; i++) { + PMC * const value = VTABLE_get_pmc_keyed_int(interp, src, i); + VTABLE_push_pmc(interp, src, value); + } + $1 = dest; +} + +=item B(out PMC) + +Receive a message sent to the current task. + +If there is no waiting message, block and wait. + +=cut + +op receive(out PMC) { + opcode_t *const dest = expr NEXT(); + PMC *cur_task = Parrot_cx_current_task(interp); + Parrot_Task_attributes *tdata = PARROT_TASK(cur_task); + int msg_count; + if (PMC_IS_NULL(tdata->mailbox)) { + tdata->mailbox = Parrot_pmc_new(interp, enum_class_PMCList); + PARROT_GC_WRITE_BARRIER(interp, cur_task); + msg_count = 0; + } + else + msg_count = VTABLE_elements(interp, tdata->mailbox); + + if (msg_count > 0) { + $1 = VTABLE_shift_pmc(interp, tdata->mailbox); + goto ADDRESS(dest); + } + else { + TASK_recv_block_SET(cur_task); + (void) Parrot_cx_stop_task(interp, cur_opcode); + goto ADDRESS(0); + } +} + +=item B(in PMC) + +Block and wait for a task to complete. + +=cut + +op wait(in PMC) { + opcode_t *const next = expr NEXT(); + PMC *task = $1; + PMC *cur_task; + Parrot_Task_attributes *tdata; + + if (!VTABLE_isa(interp, task, Parrot_str_new_constant(interp, "Task"))) + Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_INVALID_OPERATION, + "Argument to wait op must be a Task.\n"); + + cur_task = Parrot_cx_stop_task(interp, next); + tdata = PARROT_TASK(task); + if (PMC_IS_NULL(tdata->waiters)) { + tdata->waiters = Parrot_pmc_new(interp, enum_class_ResizablePMCArray); + PARROT_GC_WRITE_BARRIER(interp, task); + } + VTABLE_push_pmc(interp, tdata->waiters, cur_task); + + goto ADDRESS(0); +} + +=item B() + +Pass the rest of the current quantum and schedule the next +task in the task queue. + +=cut + +op pass() { + opcode_t *const next = expr NEXT(); + opcode_t *const addr = Parrot_cx_preempt_task(interp, interp->scheduler, next); + goto ADDRESS(addr); +} + =back =head1 COPYRIGHT diff --git a/src/ops/io.ops b/src/ops/io.ops index 2fcb7d9014..34f20fb973 100644 --- a/src/ops/io.ops +++ b/src/ops/io.ops @@ -53,7 +53,7 @@ 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 */ + /* Workaround for older msvcrt and openbsd. GH #366 */ if (Parrot_is_nzero($1)) { Parrot_io_printf(interp, "-0"); } @@ -96,7 +96,7 @@ inline op say(in NUM) :base_io { #ifdef PARROT_HAS_NEGATIVE_ZERO Parrot_io_printf(interp, FLOATVAL_FMT "\n", $1); #else - /* Workaround for older msvcrt and openbsd. TT #313 */ + /* Workaround for older msvcrt and openbsd. GH #366 */ if (Parrot_is_nzero($1)) { Parrot_io_printf(interp, "-0\n"); } diff --git a/src/ops/math.ops b/src/ops/math.ops index 959b3064f8..9abc10d0eb 100644 --- a/src/ops/math.ops +++ b/src/ops/math.ops @@ -722,6 +722,16 @@ inline op sqrt(out NUM, in NUM) :base_core { $1 = sqrt((FLOATVAL)$2); } +=item B(out INT, in NUM) + +Set $1 to 1 if $2 is Inf, -Inf or NaN, and 0 otherwise + +=cut + +inline op is_inf_or_nan(out INT, in NUM) :base_core { + $1 = PARROT_FLOATVAL_IS_INF_OR_NAN($2) +} + =back =cut diff --git a/src/ops/object.ops b/src/ops/object.ops index 2ed1f473f4..32fa05047a 100644 --- a/src/ops/object.ops +++ b/src/ops/object.ops @@ -60,10 +60,7 @@ op callmethodcc(invar PMC, in STR) :object_base :flow { if (!PMC_IS_NULL(method_pmc)) { PMC * const signature = Parrot_pcc_get_signature(interp, CURRENT_CONTEXT(interp)); - if (!PMC_IS_NULL(signature)) - Parrot_pcc_set_object(interp, signature, object); - - interp->current_cont = NEED_CONTINUATION; + Parrot_pcc_reuse_continuation(interp, CURRENT_CONTEXT(interp), next); dest = VTABLE_invoke(interp, method_pmc, next); } else { @@ -92,9 +89,7 @@ op callmethodcc(invar PMC, invar PMC) :object_base :flow { Parrot_pcc_set_pc(interp, CURRENT_CONTEXT(interp), next); - if (!PMC_IS_NULL(signature)) - Parrot_pcc_set_object(interp, signature, $1); - interp->current_cont = NEED_CONTINUATION; + Parrot_pcc_reuse_continuation(interp, CURRENT_CONTEXT(interp), next); dest = VTABLE_invoke(interp, $2, next); goto ADDRESS(dest); @@ -118,8 +113,6 @@ op callmethod(invar PMC, in STR, invar PMC) :object_base :flow { VTABLE_get_string(interp, VTABLE_get_class(interp, object))); } else { - if (!PMC_IS_NULL(signature)) - Parrot_pcc_set_object(interp, signature, object); interp->current_cont = $3; dest = (opcode_t *)VTABLE_invoke(interp, method_pmc, next); } @@ -137,8 +130,6 @@ op callmethod(invar PMC, invar PMC, invar PMC) :object_base :flow { Parrot_pcc_set_pc(interp, CURRENT_CONTEXT(interp), next); - if (!PMC_IS_NULL(signature)) - Parrot_pcc_set_object(interp, signature, object); interp->current_cont = $3; dest = (opcode_t *)VTABLE_invoke(interp, method_pmc, next); goto ADDRESS(dest); @@ -162,8 +153,6 @@ op tailcallmethod(invar PMC, in STR) :object_base :flow { else { interp->current_cont = Parrot_pcc_get_continuation(interp, CURRENT_CONTEXT(interp)); PObj_get_FLAGS(interp->current_cont) |= SUB_FLAG_TAILCALL; - if (!PMC_IS_NULL(signature)) - Parrot_pcc_set_object(interp, signature, object); dest = (opcode_t *)VTABLE_invoke(interp, method_pmc, next); } goto ADDRESS(dest); @@ -181,8 +170,6 @@ op tailcallmethod(invar PMC, invar PMC) :object_base :flow { interp->current_cont = Parrot_pcc_get_continuation(interp, CURRENT_CONTEXT(interp)); PObj_get_FLAGS(interp->current_cont) |= SUB_FLAG_TAILCALL; - if (!PMC_IS_NULL(signature)) - Parrot_pcc_set_object(interp, signature, object); dest = (opcode_t *)VTABLE_invoke(interp, method_pmc, next); goto ADDRESS(dest); } diff --git a/src/ops/pmc.ops b/src/ops/pmc.ops index b366adb441..66521e8257 100644 --- a/src/ops/pmc.ops +++ b/src/ops/pmc.ops @@ -484,7 +484,7 @@ Set property $2 to value $3 for PMC $1. =cut op setprop(invar PMC, in STR, invar PMC) { - VTABLE_setprop(interp, $1, $2, $3); + Parrot_pmc_setprop(interp, $1, $2, $3); } ######################################## @@ -493,10 +493,21 @@ op setprop(invar PMC, in STR, invar PMC) { Get property $2 of PMC $3 and put it in $1. +Deprecated. + +=item B(out PMC, invar PMC, in STR) + +Get property $3 of PMC $2 and put it in $1. + =cut -op getprop(out PMC, in STR, invar PMC) { - $1 = VTABLE_getprop(interp, $3, $2); +op getprop(out PMC, in STR, invar PMC) :deprecated { + Parrot_warn_deprecated(interp, "getprop_p_s_p is deprecated. Use getprop_p_p_s instead"); + $1 = Parrot_pmc_getprop(interp, $3, $2); +} + +op getprop(out PMC, invar PMC, in STR) { + $1 = Parrot_pmc_getprop(interp, $2, $3); } ######################################## @@ -508,7 +519,7 @@ Delete property $2 from PMC $1. =cut op delprop(invar PMC, in STR) { - VTABLE_delprop(interp, $1, $2); + Parrot_pmc_delprop(interp, $1, $2); } ######################################## @@ -521,7 +532,7 @@ hash doesn't exist, the C PMC is returned. =cut op prophash(out PMC, invar PMC) { - $1 = VTABLE_getprops(interp, $2); + $1 = Parrot_pmc_getprops(interp, $2); } =back diff --git a/src/ops/set.ops b/src/ops/set.ops index 43e0742df8..83f879cded 100644 --- a/src/ops/set.ops +++ b/src/ops/set.ops @@ -402,7 +402,7 @@ inline op copy(inout PMC, invar PMC) :base_mem { else { PMC * const clone = VTABLE_clone(interp, $2); /* Preserve the metadata on the destination. */ - PMC * const meta = VTABLE_getprops(interp, $1); + PMC * const meta = Parrot_pmc_getprops(interp, $1); /* We have to preserve GC flags of original PMC */ const Parrot_UInt gc_flags = $1->flags & PObj_GC_all_FLAGS; @@ -428,7 +428,7 @@ inline op copy(inout PMC, invar PMC) :base_mem { 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, $1, key, value); + Parrot_pmc_setprop(interp, $1, key, value); } } } diff --git a/src/ops/string.ops b/src/ops/string.ops index 4e6ce44874..1cf6e4d279 100644 --- a/src/ops/string.ops +++ b/src/ops/string.ops @@ -320,11 +320,7 @@ inline op sprintf(out PMC, invar PMC, invar PMC) :base_core { =item B(out STR) -=item B(out STR, in INT) - -Allocate a new empty string of length $2 (optional). - -XXX: Do these ops make sense with immutable strings? +Allocate a new empty string. =cut @@ -332,10 +328,6 @@ inline op new(out STR) :base_mem { $1 = Parrot_str_new_noinit(interp, 0); } -inline op new(out STR, in INT) :base_mem { - $1 = Parrot_str_new_noinit(interp, $2); -} - =item B(out INT, in STR, in INT) diff --git a/src/ops/sys.ops b/src/ops/sys.ops index a47e3d292d..7cdacfd531 100644 --- a/src/ops/sys.ops +++ b/src/ops/sys.ops @@ -31,12 +31,13 @@ Spawn a subprocess whose program name and arguments are contained in the array $2 and wait for it to finish. The return status, which is very system-dependent, goes in $1. -TT #847: C should itself handle splitting up command-line arguments, +GH #362: C 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. +See https://github.com/parrot/parrot/issues/362 +(formerly https://trac.parrot.org/parrot/ticket/847). -TT #848: C should return something less system-dependent, and more -object-like. See https://trac.parrot.org/parrot/ticket/848. +GH #369: C should return something less system-dependent, and more +object-like. See https://github.com/parrot/parrot/issues/369. =cut diff --git a/src/packfile/api.c b/src/packfile/api.c index 29411102f8..6f4b3ae83b 100644 --- a/src/packfile/api.c +++ b/src/packfile/api.c @@ -36,10 +36,6 @@ format of bytecode. /* HEADERIZER BEGIN: static */ /* Don't modify between HEADERIZER BEGIN / HEADERIZER END. Your changes will be lost. */ -static void clone_constant(PARROT_INTERP, ARGIN(PMC **c)) - __attribute__nonnull__(1) - __attribute__nonnull__(2); - static void compile_file(PARROT_INTERP, ARGIN(STRING *path), INTVAL is_pasm) __attribute__nonnull__(1) __attribute__nonnull__(2); @@ -74,13 +70,6 @@ static INTVAL find_const_iter(PARROT_INTERP, __attribute__nonnull__(2) FUNC_MODIFIES(*seg); -PARROT_WARN_UNUSED_RESULT -PARROT_CANNOT_RETURN_NULL -static PackFile_ConstTable * find_constants(PARROT_INTERP, - ARGIN(PackFile_ConstTable *ct)) - __attribute__nonnull__(1) - __attribute__nonnull__(2); - PARROT_PURE_FUNCTION PARROT_WARN_UNUSED_RESULT static INTVAL find_pf_ann_idx( @@ -104,13 +93,6 @@ static void mark_1_ct_seg(PARROT_INTERP, ARGMOD(PackFile_ConstTable *ct)) __attribute__nonnull__(2) FUNC_MODIFIES(*ct); -PARROT_WARN_UNUSED_RESULT -PARROT_CAN_RETURN_NULL -static PackFile * PackFile_append_pmc(PARROT_INTERP, - ARGIN(PMC * const pf_pmc)) - __attribute__nonnull__(1) - __attribute__nonnull__(2); - static void PackFile_Header_read_uuid(PARROT_INTERP, ARGMOD(PackFile_Header *self), ARGIN(const opcode_t *packed), @@ -169,15 +151,16 @@ static PackFile* read_pbc_file_packfile_handle(PARROT_INTERP, __attribute__nonnull__(1) __attribute__nonnull__(2); +PARROT_CANNOT_RETURN_NULL +static PMC* set_current_sub(PARROT_INTERP) + __attribute__nonnull__(1); + static int sub_pragma(PARROT_INTERP, pbc_action_enum_t action, ARGIN(const PMC *sub_pmc)) __attribute__nonnull__(1) __attribute__nonnull__(3); -#define ASSERT_ARGS_clone_constant __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ - PARROT_ASSERT_ARG(interp) \ - , PARROT_ASSERT_ARG(c)) #define ASSERT_ARGS_compile_file __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ PARROT_ASSERT_ARG(interp) \ , PARROT_ASSERT_ARG(path)) @@ -192,9 +175,6 @@ static int sub_pragma(PARROT_INTERP, #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(interp) \ - , PARROT_ASSERT_ARG(ct)) #define ASSERT_ARGS_find_pf_ann_idx __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ PARROT_ASSERT_ARG(pfa) \ , PARROT_ASSERT_ARG(key)) @@ -207,9 +187,6 @@ static int sub_pragma(PARROT_INTERP, #define ASSERT_ARGS_mark_1_ct_seg __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ PARROT_ASSERT_ARG(interp) \ , PARROT_ASSERT_ARG(ct)) -#define ASSERT_ARGS_PackFile_append_pmc __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ - PARROT_ASSERT_ARG(interp) \ - , PARROT_ASSERT_ARG(pf_pmc)) #define ASSERT_ARGS_PackFile_Header_read_uuid __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ PARROT_ASSERT_ARG(interp) \ , PARROT_ASSERT_ARG(self) \ @@ -235,6 +212,8 @@ static int sub_pragma(PARROT_INTERP, #define ASSERT_ARGS_read_pbc_file_packfile_handle __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ PARROT_ASSERT_ARG(interp) \ , PARROT_ASSERT_ARG(fullname)) +#define ASSERT_ARGS_set_current_sub __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ + PARROT_ASSERT_ARG(interp)) #define ASSERT_ARGS_sub_pragma __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ PARROT_ASSERT_ARG(interp) \ , PARROT_ASSERT_ARG(sub_pmc)) @@ -295,7 +274,7 @@ PackFile_destroy(PARROT_INTERP, ARGMOD(PackFile *pf)) /* -=item C +=item C Returns the size, in bytes, that a packfile will be if serialized @@ -313,7 +292,7 @@ Deserialize a packfile which is stored in a STRING buffer PARROT_EXPORT INTVAL -Parrot_pf_serialized_size(PARROT_INTERP, ARGIN(PackFile * pf)) +Parrot_pf_serialized_size(PARROT_INTERP, ARGMOD(PackFile *pf)) { ASSERT_ARGS(Parrot_pf_serialized_size) return PackFile_pack_size(interp, pf); @@ -360,11 +339,65 @@ Parrot_pf_deserialize(PARROT_INTERP, ARGIN(STRING *str)) /* -=item C +=item C -Get an array of Subs in the packfile by named flag. +Tag a constant PMC with a constant STRING + +=cut + +*/ + +void +Parrot_pf_tag_constant(PARROT_INTERP, ARGIN(PackFile_ConstTable *ct), + const int tag_idx, const int const_idx) +{ + ASSERT_ARGS(Parrot_pf_tag_constant) + int lo, hi, cur; + const STRING *tag = ct->str.constants[tag_idx]; + + /* allocate space */ + if (ct->tag_map == NULL) { + ct->tag_map = mem_gc_allocate_n_zeroed_typed(interp, 1, PackFile_ConstTagPair); + ct->ntags = 1; + } + else { + ct->tag_map = mem_gc_realloc_n_typed_zeroed(interp, ct->tag_map, ct->ntags + 1, ct->ntags, + PackFile_ConstTagPair); + ct->ntags++; + } -Currently accepted values are "load" and "init". + /* find the slot to insert into */ + lo = 0; + cur = 0; + hi = ct->ntags - 1; + while (lo < hi) { + cur = (lo + hi)/2; + + switch (STRING_compare(interp, tag, ct->str.constants[ct->tag_map[cur].tag_idx])) { + case -1: + lo = ++cur; + break; + case 0: + lo = hi = cur; + break; + case 1: + hi = cur; + break; + } + } + + memmove(&ct->tag_map[cur + 1], &ct->tag_map[cur], + ((ct->ntags - 1) - cur) * sizeof (PackFile_ConstTagPair)); + ct->tag_map[cur].tag_idx = tag_idx; + ct->tag_map[cur].const_idx = const_idx; +} + +/* + +=item C + +Get an array of Subs in the packfile by named flag. =cut @@ -373,11 +406,12 @@ Currently accepted values are "load" and "init". PARROT_EXPORT PARROT_CANNOT_RETURN_NULL PMC * -Parrot_pf_subs_by_flag(PARROT_INTERP, ARGIN(PMC * pfpmc), ARGIN(STRING * flag)) +Parrot_pf_subs_by_tag(PARROT_INTERP, ARGIN(PMC * pfpmc), ARGIN(STRING * flag)) { - ASSERT_ARGS(Parrot_pf_subs_by_flag) + ASSERT_ARGS(Parrot_pf_subs_by_tag) PackFile * const pf = (PackFile*)VTABLE_get_pointer(interp, pfpmc); int mode = 0; + PMC * const subs = Parrot_pmc_new(interp, enum_class_ResizablePMCArray); if (!pf || !pf->cur_cs || !pf->cur_cs->const_table) Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_UNEXPECTED_NULL, "NULL or invalid packfile"); @@ -386,12 +420,66 @@ Parrot_pf_subs_by_flag(PARROT_INTERP, ARGIN(PMC * pfpmc), ARGIN(STRING * flag)) mode = 1; else if (STRING_equal(interp, flag, CONST_STRING(interp, "init"))) mode = 2; - else - Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_INVALID_OPERATION, - "%S is not a valid packfile trigger", flag); - { - PMC * const subs = Parrot_pmc_new(interp, enum_class_ResizablePMCArray); + PackFile_ConstTable * const ct = pf->cur_cs->const_table; + opcode_t flag_idx = -1; + + int bottom_lo, bottom_hi, top_lo, top_hi, cur; + int i; + + bottom_lo = top_lo = cur = 0; + bottom_hi = top_hi = ct->ntags; + + /* find the first match (if any) */ + while (flag_idx < 0) { + if (bottom_lo == top_hi) { + /* tag not present */ + goto done_find_bounds; + } + + cur = (bottom_lo + top_hi)/2; + + switch (STRING_compare(interp, flag, ct->str.constants[ct->tag_map[cur].tag_idx])) { + case -1: + bottom_lo = cur + 1; + break; + case 0: + flag_idx = ct->tag_map[cur].tag_idx; + bottom_hi = cur; + top_lo = cur + 1; + break; + case 1: + top_hi = cur; + break; + } + } + + /* find the bottom of the map's range with this tag */ + while (bottom_lo < bottom_hi) { + cur = (bottom_lo + bottom_hi)/2; + if (ct->tag_map[cur].tag_idx == flag_idx) + bottom_hi = cur; + else + bottom_lo = cur + 1; + } + + /* find the top */ + while (top_lo < top_hi) { + cur = (top_lo + top_hi)/2; + if (ct->tag_map[cur].tag_idx == flag_idx) + top_lo = cur + 1; + else + top_hi = cur; + } + + done_find_bounds: + for (i = bottom_lo; i < top_hi; i++) + VTABLE_push_pmc(interp, subs, ct->pmc.constants[ct->tag_map[i].const_idx]); + } + + /* Backwards compatibility. :load is equivalent to "load" tag. :init is + equivalent to "init" tag */ + if (mode == 1 || mode == 2) { PackFile_ByteCode * const self = pf->cur_cs; PackFile_ConstTable * const ct = self->const_table; STRING * const SUB = CONST_STRING(interp, "Sub"); @@ -412,8 +500,8 @@ Parrot_pf_subs_by_flag(PARROT_INTERP, ARGIN(PMC * pfpmc), ARGIN(STRING * flag)) else if (mode == 2 && Sub_comp_INIT_TEST(sub)) VTABLE_push_pmc(interp, subs, sub_pmc); } - return subs; } + return subs; } /* @@ -701,6 +789,8 @@ packfile_main(ARGIN(PackFile_ByteCode *bc)) { ASSERT_ARGS(packfile_main) const PackFile_ConstTable * const ct = bc->const_table; + if (!ct || !ct->pmc.constants || bc->main_sub < 0) + return PMCNULL; return ct->pmc.constants[bc->main_sub]; } @@ -722,7 +812,7 @@ Also store the C in the sub structure, so that the eval PMC is kept alive by living subs. This function and the entire underlying mechanism should be deprecated and -removed. See TT #2144 for details. +removed. See GH #428 for details. =cut @@ -747,7 +837,6 @@ do_sub_pragmas(PARROT_INTERP, ARGIN(PMC *pfpmc), Parrot_Sub_attributes *sub; PMC_get_sub(interp, sub_pmc, sub); - sub->eval_pmc = eval_pmc; if (action == 0) continue; @@ -1266,6 +1355,8 @@ Parrot_pf_new(PARROT_INTERP, INTVAL is_mapped) pf->fetch_iv = (packfile_fetch_iv_t)NULL; pf->fetch_nv = (packfile_fetch_nv_t)NULL; + pf->view = NULL; + return pf; } @@ -1281,7 +1372,8 @@ PackFile_new(PARROT_INTERP, INTVAL is_mapped) /* -=item C +=item C Get a new PMC to hold the PackFile* structure. The exact type of PMC returned is not important, and consuming code should not rely on any particular type @@ -1297,11 +1389,14 @@ being returned. The only guarantees which are made by this interface are that: PARROT_EXPORT PARROT_CANNOT_RETURN_NULL PMC * -Parrot_pf_get_packfile_pmc(PARROT_INTERP, ARGIN(PackFile *pf)) +Parrot_pf_get_packfile_pmc(PARROT_INTERP, ARGIN(PackFile *pf), ARGIN(STRING *path)) { ASSERT_ARGS(Parrot_pf_get_packfile_pmc) PMC *ptr; + if (pf->view) + return pf->view; + /* We have to block GC here. */ /* XXX We should never-ever have raw PackFile* laying around */ /* XXX But it require a lot of effort to cleanup codebase */ @@ -1309,6 +1404,8 @@ Parrot_pf_get_packfile_pmc(PARROT_INTERP, ARGIN(PackFile *pf)) ptr = Parrot_pmc_new(interp, enum_class_PackfileView); VTABLE_set_pointer(interp, ptr, pf); + pf->view = ptr; + VTABLE_set_string_native(interp, ptr, path); Parrot_unblock_GC_mark(interp); @@ -1335,7 +1432,10 @@ PMC * Parrot_pf_get_current_packfile(PARROT_INTERP) { ASSERT_ARGS(Parrot_pf_get_current_packfile) - return interp->current_pf; + if (interp->code) + return Parrot_pf_get_packfile_pmc(interp, interp->code->base.pf, STRINGNULL); + else + return PMCNULL; } /* @@ -1377,44 +1477,13 @@ Parrot_pf_set_current_packfile(PARROT_INTERP, ARGIN(PMC *pbc)) "Cannot set null packfile"); else { PackFile * const pf = (PackFile *)VTABLE_get_pointer(interp, pbc); - interp->current_pf = pbc; - interp->code = pf->cur_cs; + Parrot_switch_to_cs(interp, pf->cur_cs, 1); PARROT_GC_WRITE_BARRIER(interp, pbc); } } /* -=item C - -Creates the bytecode and constant segments for C. If C -is true, the current packfile becomes the owner of these segments by adding the -segments to the directory. - -Deprecated: Use Parrot_pf_create_default_segments and -Parrot_pf_set_current_packfile instead. TT #2140 - -=cut - -*/ - -PARROT_EXPORT -PARROT_WARN_UNUSED_RESULT -PARROT_CANNOT_RETURN_NULL -PackFile_ByteCode * -PF_create_default_segs(PARROT_INTERP, ARGIN(STRING *file_name), int add, int set_def) -{ - ASSERT_ARGS(PF_create_default_segs) - PackFile_ByteCode * const bc = Parrot_pf_create_default_segments(interp, - interp->current_pf, file_name, add); - if (set_def) - interp->code = bc; - return bc; -} - -/* - =item C @@ -1486,12 +1555,13 @@ Parrot_new_debug_seg(PARROT_INTERP, ARGMOD(PackFile_ByteCode *cs), size_t size) else { STRING * name; const int add = (interp->code && interp->code->base.dir); + PMC *current_pfpmc = Parrot_pf_get_current_packfile(interp); PackFile_Directory * const dir = add ? interp->code->base.dir : cs->base.dir ? cs->base.dir - : &((PackFile*)VTABLE_get_pointer(interp, interp->current_pf))->directory; - PARROT_GC_WRITE_BARRIER(interp, interp->current_pf); + : &((PackFile*)VTABLE_get_pointer(interp, current_pfpmc))->directory; + PARROT_GC_WRITE_BARRIER(interp, current_pfpmc); name = Parrot_sprintf_c(interp, "%Ss_DB", cs->base.name); debug = (PackFile_Debug *)PackFile_Segment_new_seg(interp, dir, @@ -1667,172 +1737,29 @@ Parrot_switch_to_cs(PARROT_INTERP, ARGIN(PackFile_ByteCode *new_cs), int really) Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_NO_PREV_CS, "No code segment to switch to\n"); - /* compiling source code uses this function too, - * which gives misleading trace messages */ - if (really && Interp_trace_TEST(interp, PARROT_TRACE_SUB_CALL_FLAG)) { - Interp * const tracer = interp->pdb && interp->pdb->debugger - ? interp->pdb->debugger - : interp; - Parrot_io_eprintf(tracer, "*** switching to %s\n", new_cs->base.name); - } - - interp->code = new_cs; - - Parrot_pcc_set_constants(interp, CURRENT_CONTEXT(interp), really - ? find_constants(interp, new_cs->const_table) - : new_cs->const_table); + interp->code = new_cs; + Parrot_pcc_set_constants(interp, CURRENT_CONTEXT(interp), + new_cs->const_table); + + if (really) { + /* compiling source code uses this function too, + * which gives misleading trace messages */ + if (Interp_trace_TEST(interp, PARROT_TRACE_SUB_CALL_FLAG)) { + Interp * const tracer = interp->pdb && interp->pdb->debugger + ? interp->pdb->debugger + : interp; + Parrot_io_eprintf(tracer, "*** switching to %s\n", + new_cs->base.name); + } - if (really) prepare_for_run(interp); - - return cur_cs; -} - - -/* - -=item C - -Clones a constant (at least, if it's a Sub PMC), returning the clone. - -=cut - -*/ - -static void -clone_constant(PARROT_INTERP, ARGIN(PMC **c)) -{ - ASSERT_ARGS(clone_constant) - STRING * const _sub = CONST_STRING(interp, "Sub"); - - if (VTABLE_isa(interp, *c, _sub)) { - Parrot_Sub_attributes *old_sub, *new_sub; - - PMC * const old_sub_pmc = *c; - PMC * const new_sub_pmc = Parrot_thaw_constants(interp, Parrot_freeze(interp, old_sub_pmc)); - - PMC_get_sub(interp, new_sub_pmc, new_sub); - PMC_get_sub(interp, old_sub_pmc, old_sub); - new_sub->seg = old_sub->seg; - - /* Vtable overrides and methods were already cloned, so don't reclone them. */ - if (new_sub->vtable_index == -1 - && !(old_sub->comp_flags & SUB_COMP_FLAG_METHOD)) - Parrot_ns_store_sub(interp, new_sub_pmc); - - *c = new_sub_pmc; + return cur_cs; } -} - - -/* - -=item C - -Finds the constant table associated with a thread. For now, we need to copy -constant tables because some entries aren't really constant; e.g. subroutines -need to refer to namespace pointers. - -=cut - -*/ - -PARROT_WARN_UNUSED_RESULT -PARROT_CANNOT_RETURN_NULL -static PackFile_ConstTable * -find_constants(PARROT_INTERP, ARGIN(PackFile_ConstTable *ct)) -{ - ASSERT_ARGS(find_constants) - if (!n_interpreters - || !interp->thread_data - || interp->thread_data->tid == 0) - return ct; - else { - Hash *tables; - PackFile_ConstTable *new_ct; - - PARROT_ASSERT(interp->thread_data); - - if (!interp->thread_data->const_tables) { - interp->thread_data->const_tables = Parrot_hash_new_pointer_hash(interp); - } - - tables = interp->thread_data->const_tables; - new_ct = (PackFile_ConstTable *)Parrot_hash_get(interp, tables, ct); - - if (!new_ct) { - /* need to construct it */ - int i; - - new_ct = mem_gc_allocate_zeroed_typed(interp, PackFile_ConstTable); - - new_ct->num.const_count = ct->num.const_count; - new_ct->num.constants = mem_gc_allocate_n_zeroed_typed(interp, - ct->num.const_count, FLOATVAL); - memcpy(new_ct->num.constants, ct->num.constants, - ct->num.const_count * sizeof (FLOATVAL)); - - new_ct->str.const_count = ct->str.const_count; - new_ct->str.constants = mem_gc_allocate_n_zeroed_typed(interp, - ct->str.const_count, STRING *); - memcpy(new_ct->str.constants, ct->str.constants, - ct->str.const_count * sizeof (STRING *)); - - new_ct->pmc.const_count = ct->pmc.const_count; - new_ct->pmc.constants = mem_gc_allocate_n_zeroed_typed(interp, - ct->pmc.const_count, PMC *); - memcpy(new_ct->pmc.constants, ct->pmc.constants, - ct->pmc.const_count * sizeof (PMC *)); - for (i = 0; i < new_ct->pmc.const_count; ++i) - clone_constant(interp, &new_ct->pmc.constants[i]); - - Parrot_hash_put(interp, tables, ct, new_ct); - } - - return new_ct; - } + return cur_cs; } -/* - -=item C - -Destroys the constants for an interpreter. - -Deprecated: This function should either be renamed to Parrot_pf_*, or should -not be exposed through this API. TT #2140 - -=cut - -*/ - -PARROT_EXPORT -void -Parrot_destroy_constants(PARROT_INTERP) -{ - ASSERT_ARGS(Parrot_destroy_constants) - Hash *hash; - - return; - - if (!interp->thread_data) - return; - - hash = interp->thread_data->const_tables; - - if (!hash) - return; - - parrot_hash_iterate(hash, - PackFile_ConstTable * const ct = (PackFile_ConstTable *)_bucket->value; - PackFile_ConstTable_clear(interp, ct); - mem_gc_free(interp, ct);); - Parrot_hash_destroy(interp, hash); -} - /* =item Cbase.data = (opcode_t *)mem_sys_realloc(self->base.data, (self->base.size + 2) * sizeof (opcode_t)); - mem_sys_memmove(&self->base.data[idx + 2], &self->base.data[idx], + memmove(&self->base.data[idx + 2], &self->base.data[idx], (self->base.size - idx) * sizeof (opcode_t)); self->base.size += 2; for (i = key_id + 1; i < self->num_keys; i++) @@ -2084,21 +2011,28 @@ compile_file(PARROT_INTERP, ARGIN(STRING *path), INTVAL is_pasm) { ASSERT_ARGS(compile_file) PackFile_ByteCode * const cur_code = interp->code; - PMC * const pf_pmc = Parrot_compile_file(interp, path, is_pasm); - PMC * const pbc_cache = VTABLE_get_pmc_keyed_int(interp, - interp->iglobals, IGLOBALS_LOADED_PBCS); - PackFile * const pf = (PackFile*) VTABLE_get_pointer(interp, pf_pmc); - PackFile_ByteCode * const cs = pf->cur_cs; + PMC * compiler; + if (is_pasm) + compiler = Parrot_interp_get_compiler(interp, CONST_STRING(interp, "PASM")); + else + compiler = Parrot_interp_get_compiler(interp, CONST_STRING(interp, "PIR")); + { + PMC * const pf_pmc = Parrot_interp_compile_file(interp, compiler, path); + PMC * const pbc_cache = VTABLE_get_pmc_keyed_int(interp, + interp->iglobals, IGLOBALS_LOADED_PBCS); + PackFile * const pf = (PackFile*) VTABLE_get_pointer(interp, pf_pmc); + PackFile_ByteCode * const cs = pf->cur_cs; - if (cs) { - interp->code = cur_code; - VTABLE_set_pmc_keyed_str(interp, pbc_cache, path, pf_pmc); - do_sub_pragmas(interp, pf_pmc, PBC_LOADED, NULL); - } - else { - interp->code = cur_code; - Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_LIBRARY_ERROR, - "compiler returned NULL ByteCode '%Ss'", path); + if (cs) { + interp->code = cur_code; + VTABLE_set_pmc_keyed_str(interp, pbc_cache, path, pf_pmc); + do_sub_pragmas(interp, pf_pmc, PBC_LOADED, NULL); + } + else { + interp->code = cur_code; + Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_LIBRARY_ERROR, + "compiler returned NULL ByteCode '%Ss'", path); + } } } @@ -2118,7 +2052,8 @@ load_file(PARROT_INTERP, ARGIN(STRING *path)) { ASSERT_ARGS(load_file) - PMC * const pf_pmc = PackFile_read_pbc(interp, path, 0); + PackFile * const pf = Parrot_pf_read_pbc_file(interp, path); + PMC * const pf_pmc = Parrot_pf_get_packfile_pmc(interp, pf, path); if (!pf_pmc) Parrot_ex_throw_from_c_args(interp, NULL, 1, @@ -2224,47 +2159,6 @@ Parrot_load_language(PARROT_INTERP, ARGIN_NULLOK(STRING *lang_name)) /* -=item C - -Reads and appends a PBC to the current directory. Fixes up sub addresses in -newly loaded bytecode and runs C<:load> subs. - -=cut - -*/ - - -PARROT_WARN_UNUSED_RESULT -PARROT_CAN_RETURN_NULL -static PackFile * -PackFile_append_pmc(PARROT_INTERP, ARGIN(PMC * const pf_pmc)) -{ - ASSERT_ARGS(PackFile_append_pmc) - PackFile * const pf = (PackFile *) VTABLE_get_pointer(interp, pf_pmc); - PARROT_ASSERT(!PMC_IS_NULL(interp->current_pf)); - - if (pf) { - PackFile *current_pf = (PackFile *)VTABLE_get_pointer(interp, interp->current_pf); - if (!interp->code) { - STRING * const name = CONST_STRING(interp, "dummy"); - interp->code = Parrot_pf_create_default_segments(interp, - interp->current_pf, name, 1); - PARROT_ASSERT(interp->code); - } - - PackFile_add_segment(interp, ¤t_pf->directory, - &pf->directory.base); - PARROT_GC_WRITE_BARRIER(interp, interp->current_pf); - - do_sub_pragmas(interp, pf_pmc, PBC_LOADED, NULL); - } - - return pf; -} - -/* - =item C Load a bytecode, PIR, or PASM file into the interpreter. @@ -2367,8 +2261,7 @@ Parrot_pf_load_bytecode_search(PARROT_INTERP, ARGIN(STRING *file)) return VTABLE_get_pmc_keyed_str(interp, pbc_cache, path); else { PackFile * const pf = Parrot_pf_read_pbc_file(interp, path); - PMC * const pfview = Parrot_pf_get_packfile_pmc(interp, pf); - VTABLE_set_string_native(interp, pfview, path); + PMC * const pfview = Parrot_pf_get_packfile_pmc(interp, pf, path); VTABLE_set_pmc_keyed_str(interp, pbc_cache, path, pfview); return pfview; } @@ -2397,34 +2290,7 @@ void PackFile_fixup_subs(PARROT_INTERP, pbc_action_enum_t what, ARGIN_NULLOK(PMC *eval)) { ASSERT_ARGS(PackFile_fixup_subs) - do_sub_pragmas(interp, interp->current_pf, what, eval); -} - - -/* - -=item C - -Read in a bytecode, unpack it into a C structure, and do fixups. - -Deprecated: Do not use this function. Use Parrot_pf_read_pbc_file instead. -See TT #2140 for details. - -=cut - -*/ - -PARROT_EXPORT -PARROT_CANNOT_RETURN_NULL -Parrot_PackFile -PackFile_read_pbc(PARROT_INTERP, ARGIN(STRING *fullname), const int debug) -{ - ASSERT_ARGS(PackFile_read_pbc) - PackFile * const pf = Parrot_pf_read_pbc_file(interp, fullname); - PMC * const pfpmc = Parrot_pf_get_packfile_pmc(interp, pf); - UNUSED(debug); - return (Parrot_PackFile)pfpmc; + do_sub_pragmas(interp, Parrot_pf_get_current_packfile(interp), what, eval); } /* @@ -2636,7 +2502,7 @@ read_pbc_file_bytes_handle(PARROT_INTERP, PIOHANDLE io, INTVAL program_size) "Could not reallocate buffer while reading packfile from PIO.\n"); } - cursor = (char *)(program_code + program_size); + cursor = program_code + program_size; } return program_code; @@ -2707,6 +2573,70 @@ read_pbc_file_packfile(PARROT_INTERP, ARGIN(STRING * const fullname), return pf; } +/* + +=item C + +Search the fixup table for a PMC matching the argument. On a match, +set up the appropriate context. + +If no match, set up a dummy PMC entry. In either case, return a +pointer to the PMC. + +DEPRECATED: use Parrot_pf_get_packfile_main_sub instead + +=cut + +*/ + +PARROT_CANNOT_RETURN_NULL +static PMC* +set_current_sub(PARROT_INTERP) +{ + ASSERT_ARGS(set_current_sub) + PMC *new_sub_pmc; + + PackFile_ByteCode * const cur_cs = interp->code; + PackFile_ConstTable * const ct = cur_cs->const_table; + STRING * const SUB = CONST_STRING(interp, "Sub"); + + opcode_t i; + + /* + * Walk the fixup table. The first Sub-like entry should be our + * entry point with the address at our resume_offset. + */ + + for (i = 0; i < ct->pmc.const_count; i++) { + PMC * const sub_pmc = ct->pmc.constants[i]; + if (VTABLE_isa(interp, sub_pmc, 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) { + Parrot_pcc_set_sub(interp, CURRENT_CONTEXT(interp), sub_pmc); + Parrot_pcc_set_HLL(interp, CURRENT_CONTEXT(interp), sub->HLL_id); + return sub_pmc; + } + + break; + } + } + } + + /* If we didn't find anything, put a dummy PMC into current_sub. + The default values set by SUb.init are appropriate for the + dummy, don't need additional settings. */ + new_sub_pmc = Parrot_pmc_new(interp, enum_class_Sub); + Parrot_pcc_set_sub(interp, CURRENT_CONTEXT(interp), new_sub_pmc); + + return new_sub_pmc; +} + + /* =item Ciglobals, IGLOBALS_ARGV_LIST, args); - Parrot_pcc_invoke_sub_from_c_args(interp, main_sub, "P->", args); + Parrot_cx_begin_execution(interp, main_sub, args); if (!PMC_IS_NULL(current_pf)) Parrot_pf_set_current_packfile(interp, current_pf); @@ -2751,6 +2682,27 @@ Parrot_pf_execute_bytecode_program(PARROT_INTERP, ARGMOD(PMC *pbc), ARGMOD(PMC * /* +=item C + +Get a Major.Minor.Patch version number for the given packfile + +=cut + +*/ + +PARROT_EXPORT +PARROT_CANNOT_RETURN_NULL +STRING * +Parrot_pf_get_version_string(PARROT_INTERP, ARGIN(PMC * pbc)) +{ + ASSERT_ARGS(Parrot_pf_get_version_string) + PackFile * const pf = (PackFile *) VTABLE_get_pointer(interp, pbc); + return Parrot_sprintf_c(interp, "%d.%d.%d", + pf->header->major, pf->header->minor, pf->header->patch); +} + +/* + =item C diff --git a/src/packfile/byteorder.h b/src/packfile/byteorder.h deleted file mode 100644 index 172dcf0516..0000000000 --- a/src/packfile/byteorder.h +++ /dev/null @@ -1,571 +0,0 @@ -/* -Copyright (C) 2001-2009, Parrot Foundation. - -=head1 NAME - -src/byteorder.c - Byteordering functions - -=head1 DESCRIPTION - -These are assigned to a vtable when the PBC file is loaded. - -If the vtable function for conversion from the native byteorder is called, -it is a I and will work, but the caller should know if the -byteorder in the PBC file is native and skip the conversion and just map -it in. - -=head2 Byte order handlers - -Configure will have checked for supported word sizes. - -=over 4 - -=cut - -*/ - -#ifndef PARROT_BYTEORDER_H_GUARD -#define PARROT_BYTEORDER_H_GUARD - -#include "parrot/parrot.h" - -/* HEADERIZER HFILE: none */ - -/* - -=item C - -This function converts a 4 or 8 byte C into little endian -format. If the native format is already little endian, then no -conversion is done. - -=cut - -*/ - -PARROT_INLINE -PARROT_WARN_UNUSED_RESULT -PARROT_CONST_FUNCTION -static INTVAL -fetch_iv_le(INTVAL w) -{ -#if !PARROT_BIGENDIAN - return w; -#else -# if INTVAL_SIZE == 4 - return (w << 24) | ((w & 0xff00) << 8) | ((w & 0xff0000) >> 8) | (w >> 24); -# else -# if INTVAL_SIZE == 8 - INTVAL r; - - r = w << 56; - r |= (w & 0xff00) << 40; - r |= (w & 0xff0000) << 24; - r |= (w & 0xff000000) << 8; - r |= (w & 0xff00000000) >> 8; - r |= (w & 0xff0000000000) >> 24; - r |= (w & 0xff000000000000) >> 40; - r |= (w & 0xff00000000000000) >> 56; - return r; -# else - exit_fatal(1, "Unsupported INTVAL_SIZE=%d\n", - INTVAL_SIZE); -# endif -# endif -#endif -} - -/* - -=item C - -This function converts a 4 or 8 byte C into big endian format. -If the native format is already big endian, then no conversion is done. - -=cut - -*/ - -PARROT_INLINE -PARROT_WARN_UNUSED_RESULT -PARROT_CONST_FUNCTION -static INTVAL -fetch_iv_be(INTVAL w) -{ -#if PARROT_BIGENDIAN - return w; -#else -# if INTVAL_SIZE == 4 - return (w << 24) | ((w & 0xff00) << 8) | ((w & 0xff0000) >> 8) | (w >> 24); -# else -# if INTVAL_SIZE == 8 - INTVAL r; - r = w << 56; - r |= (w & 0xff00) << 40; - r |= (w & 0xff0000) << 24; - r |= (w & 0xff000000) << 8; - r |= (w & 0xff00000000) >> 8; - r |= (w & 0xff0000000000) >> 24; - r |= (w & 0xff000000000000) >> 40; - r |= (w & 0xff00000000000000) >> 56; - return r; -# else - exit_fatal(1, "Unsupported INTVAL_SIZE=%d\n", - INTVAL_SIZE); -# endif -# endif -#endif -} - -/* - -=item C - -Same as C for opcode_t - -=cut - -*/ - -PARROT_INLINE -PARROT_WARN_UNUSED_RESULT -PARROT_CONST_FUNCTION -static opcode_t -fetch_op_be(opcode_t w) -{ -#if PARROT_BIGENDIAN - return w; -#else -# if OPCODE_T_SIZE == 4 - return (w << 24) | ((w & 0x0000ff00) << 8) | ((w & 0x00ff0000) >> 8) | - ((w & 0xff000000) >> 24); -# else - opcode_t r; - - r = w << 56; - r |= (w & 0xff00) << 40; - r |= (w & 0xff0000) << 24; - r |= (w & 0xff000000) << 8; - r |= (w & 0xff00000000) >> 8; - r |= (w & 0xff0000000000) >> 24; - r |= (w & 0xff000000000000) >> 40; - r |= (w & 0xff00000000000000) >> 56; - return r; -# endif -#endif -} - -/* - -=item C - -Same as C for opcode_t - -=cut - -*/ - -PARROT_INLINE -PARROT_WARN_UNUSED_RESULT -PARROT_CONST_FUNCTION -static opcode_t -fetch_op_le(opcode_t w) -{ -#if !PARROT_BIGENDIAN - return w; -#else -# if OPCODE_T_SIZE == 4 - return (w << 24) | ((w & 0x0000ff00) << 8) | ((w & 0x00ff0000) >> 8) | - ((w & 0xff000000) >> 24); -# else - opcode_t r; - - r = w << 56; - r |= (w & 0xff00) << 40; - r |= (w & 0xff0000) << 24; - r |= (w & 0xff000000) << 8; - r |= (w & 0xff00000000) >> 8; - r |= (w & 0xff0000000000) >> 24; - r |= (w & 0xff000000000000) >> 40; - r |= (w & 0xff00000000000000) >> 56; - return r; -# endif -#endif -} - -/* - -=pod - -Unrolled routines for swapping various sizes from 32-128 bits. These -should only be used if alignment is unknown or we are pulling something -out of a padded buffer. - -=cut - -*/ - -/* - -=item C - -Converts a 4-byte big-endian buffer C into a little-endian C. - -=cut - -*/ - -PARROT_INLINE -static void -fetch_buf_be_4(ARGOUT(unsigned char *rb), ARGIN(const unsigned char *b)) -{ -#if PARROT_BIGENDIAN - memcpy(rb, b, 4); -#else - rb[0] = b[3]; - rb[1] = b[2]; - rb[2] = b[1]; - rb[3] = b[0]; -#endif -} - -/* - -=item C - -Converts a 4-byte little-endian buffer C into a big-endian buffer C. - -=cut - -*/ - -PARROT_INLINE -static void -fetch_buf_le_4(ARGOUT(unsigned char *rb), ARGIN(const unsigned char *b)) -{ -#if !PARROT_BIGENDIAN - memcpy(rb, b, 4); -#else - rb[0] = b[3]; - rb[1] = b[2]; - rb[2] = b[1]; - rb[3] = b[0]; -#endif -} - -/* - -=item C - -Converts an 8-byte big-endian buffer C into a little-endian buffer C - -=cut - -*/ - -PARROT_INLINE -static void -fetch_buf_be_8(ARGOUT(unsigned char *rb), ARGIN(const unsigned char *b)) -{ -#if PARROT_BIGENDIAN - memcpy(rb, b, 8); -#else - rb[0] = b[7]; - rb[1] = b[6]; - rb[2] = b[5]; - rb[3] = b[4]; - rb[4] = b[3]; - rb[5] = b[2]; - rb[6] = b[1]; - rb[7] = b[0]; -#endif -} - -/* - -=item C - -Converts an 8-byte little-endian buffer C into a big-endian buffer C. - -=cut - -*/ - -PARROT_INLINE -static void -fetch_buf_le_8(ARGOUT(unsigned char *rb), ARGIN(const unsigned char *b)) -{ -#if !PARROT_BIGENDIAN - memcpy(rb, b, 8); -#else - rb[0] = b[7]; - rb[1] = b[6]; - rb[2] = b[5]; - rb[3] = b[4]; - rb[4] = b[3]; - rb[5] = b[2]; - rb[6] = b[1]; - rb[7] = b[0]; -#endif -} - -/* - -=item C - -Converts a 12-byte little-endian buffer C into a big-endian buffer C. - -=cut - -*/ - -PARROT_INLINE -static void -fetch_buf_le_12(ARGOUT(unsigned char *rb), ARGIN(const unsigned char *b)) -{ -#if !PARROT_BIGENDIAN - memcpy(rb, b, 12); -#else - rb[0] = b[11]; - rb[1] = b[10]; - rb[2] = b[9]; - rb[3] = b[8]; - rb[4] = b[7]; - rb[5] = b[6]; - rb[6] = b[5]; - rb[7] = b[4]; - rb[8] = b[3]; - rb[9] = b[2]; - rb[10] = b[1]; - rb[11] = b[0]; -#endif -} - -/* - -=item C - -Converts a 12-byte big-endian buffer C into a little-endian buffer C. - -=cut - -*/ - -PARROT_INLINE -static void -fetch_buf_be_12(ARGOUT(unsigned char *rb), ARGIN(const unsigned char *b)) -{ -#if PARROT_BIGENDIAN - memcpy(rb, b, 12); -#else - rb[0] = b[11]; - rb[1] = b[10]; - rb[2] = b[9]; - rb[3] = b[8]; - rb[4] = b[7]; - rb[5] = b[6]; - rb[6] = b[5]; - rb[7] = b[4]; - rb[8] = b[3]; - rb[9] = b[2]; - rb[10] = b[1]; - rb[11] = b[0]; -#endif -} - -/* - -=item C - -Converts a 16-byte little-endian buffer C into a big-endian buffer C. - -=cut - -*/ - -PARROT_INLINE -static void -fetch_buf_le_16(ARGOUT(unsigned char *rb), ARGIN(const unsigned char *b)) -{ -#if !PARROT_BIGENDIAN - memcpy(rb, b, 16); -#else - rb[0] = b[15]; - rb[1] = b[14]; - rb[2] = b[13]; - rb[3] = b[12]; - rb[4] = b[11]; - rb[5] = b[10]; - rb[6] = b[9]; - rb[7] = b[8]; - rb[8] = b[7]; - rb[9] = b[6]; - rb[10] = b[5]; - rb[11] = b[4]; - rb[12] = b[3]; - rb[13] = b[2]; - rb[14] = b[1]; - rb[15] = b[0]; -#endif -} - -/* - -=item C - -Converts a 16-byte big-endian buffer C into a little-endian buffer C. - -=cut - -*/ - -PARROT_INLINE -static void -fetch_buf_be_16(ARGOUT(unsigned char *rb), ARGIN(const unsigned char *b)) -{ -#if PARROT_BIGENDIAN - memcpy(rb, b, 16); -#else - rb[0] = b[15]; - rb[1] = b[14]; - rb[2] = b[13]; - rb[3] = b[12]; - rb[4] = b[11]; - rb[5] = b[10]; - rb[6] = b[9]; - rb[7] = b[8]; - rb[8] = b[7]; - rb[9] = b[6]; - rb[10] = b[5]; - rb[11] = b[4]; - rb[12] = b[3]; - rb[13] = b[2]; - rb[14] = b[1]; - rb[15] = b[0]; -#endif -} - -/* - -=item C - -Converts a 32-byte little-endian buffer C into a big-endian buffer C. - -=cut - -*/ - -PARROT_INLINE -static void -fetch_buf_le_32(ARGOUT(unsigned char *rb), ARGIN(const unsigned char *b)) -{ -#if !PARROT_BIGENDIAN - memcpy(rb, b, 32); -#else - rb[0] = b[31]; - rb[1] = b[30]; - rb[2] = b[29]; - rb[3] = b[28]; - rb[4] = b[27]; - rb[5] = b[26]; - rb[6] = b[25]; - rb[7] = b[24]; - rb[8] = b[23]; - rb[9] = b[22]; - rb[10] = b[21]; - rb[11] = b[20]; - rb[12] = b[19]; - rb[13] = b[18]; - rb[14] = b[17]; - rb[15] = b[16]; - rb[16] = b[15]; - rb[17] = b[14]; - rb[18] = b[13]; - rb[19] = b[12]; - rb[20] = b[11]; - rb[21] = b[10]; - rb[22] = b[9]; - rb[23] = b[8]; - rb[24] = b[7]; - rb[25] = b[6]; - rb[26] = b[5]; - rb[27] = b[4]; - rb[28] = b[3]; - rb[29] = b[2]; - rb[30] = b[1]; - rb[31] = b[0]; -#endif -} - -/* - -=item C - -Converts a 32-byte big-endian buffer C into a little-endian buffer C. - -=cut - -*/ - -PARROT_INLINE -static void -fetch_buf_be_32(ARGOUT(unsigned char *rb), ARGIN(const unsigned char *b)) -{ -#if PARROT_BIGENDIAN - memcpy(rb, b, 32); -#else - rb[0] = b[31]; - rb[1] = b[30]; - rb[2] = b[29]; - rb[3] = b[28]; - rb[4] = b[27]; - rb[5] = b[26]; - rb[6] = b[25]; - rb[7] = b[24]; - rb[8] = b[23]; - rb[9] = b[22]; - rb[10] = b[21]; - rb[11] = b[20]; - rb[12] = b[19]; - rb[13] = b[18]; - rb[14] = b[17]; - rb[15] = b[16]; - rb[16] = b[15]; - rb[17] = b[14]; - rb[18] = b[13]; - rb[19] = b[12]; - rb[20] = b[11]; - rb[21] = b[10]; - rb[22] = b[9]; - rb[23] = b[8]; - rb[24] = b[7]; - rb[25] = b[6]; - rb[26] = b[5]; - rb[27] = b[4]; - rb[28] = b[3]; - rb[29] = b[2]; - rb[30] = b[1]; - rb[31] = b[0]; -#endif -} - -#endif /* PARROT_BYTEORDER_H_GUARD */ - -/* - -=back - -=head1 HISTORY - -Initial version by Melvin on 2002/05/01 - -=cut - -*/ - -/* - * Local variables: - * c-file-style: "parrot" - * End: - * vim: expandtab shiftwidth=4 cinoptions='\:2=2' : - */ diff --git a/src/packfile/output.c b/src/packfile/output.c index b02d520925..a01c6153f5 100644 --- a/src/packfile/output.c +++ b/src/packfile/output.c @@ -24,7 +24,7 @@ This file implements various functions for creating and writing packfiles. #include "pf_private.h" #include "pmc/pmc_key.h" -/* HEADERIZER HFILE: src/packfile/pf_private.h */ +/* HEADERIZER HFILE: include/parrot/packfile.h */ /* HEADERIZER BEGIN: static */ /* Don't modify between HEADERIZER BEGIN / HEADERIZER END. Your changes will be lost. */ @@ -64,7 +64,7 @@ PackFile_pack_size(PARROT_INTERP, ARGMOD(PackFile *self)) { ASSERT_ARGS(PackFile_pack_size) size_t size; - size_t header_size = 0; + size_t header_size; PackFile_Directory * const dir = &self->directory; header_size = PACKFILE_HEADER_BYTES; @@ -118,12 +118,12 @@ PackFile_pack(PARROT_INTERP, ARGMOD(PackFile *self), ARGOUT(opcode_t *cursor)) self->src = cursor; /* Pack the fixed part of the header */ - mem_sys_memcopy(cursor, self->header, PACKFILE_HEADER_BYTES); + memcpy(cursor, self->header, PACKFILE_HEADER_BYTES); byte_cursor += PACKFILE_HEADER_BYTES; /* Pack the UUID. */ if (self->header->uuid_size > 0) - mem_sys_memcopy(byte_cursor, self->header->uuid_data, + memcpy(byte_cursor, self->header->uuid_data, self->header->uuid_size); /* Padding. */ @@ -225,6 +225,7 @@ PackFile_ConstTable_pack_size(PARROT_INTERP, ARGMOD(PackFile_Segment *seg)) } Parrot_hash_destroy(interp, self->pmc_hash); self->pmc_hash = NULL; + size += 1 + (self->ntags * 2); return size; } @@ -277,6 +278,12 @@ PackFile_ConstTable_pack(PARROT_INTERP, Parrot_hash_destroy(interp, self->pmc_hash); self->pmc_hash = NULL; + *cursor++ = self->ntags; + for (i = 0; i < self->ntags; i++) { + *cursor++ = self->tag_map[i].tag_idx; + *cursor++ = self->tag_map[i].const_idx; + } + return cursor; } diff --git a/src/packfile/pf_items.c b/src/packfile/pf_items.c index 672547dade..469e38a12f 100644 --- a/src/packfile/pf_items.c +++ b/src/packfile/pf_items.c @@ -1,5 +1,5 @@ /* -Copyright (C) 2001-2010, Parrot Foundation. +Copyright (C) 2001-2012, Parrot Foundation. =head1 NAME @@ -32,7 +32,6 @@ for "little endian". */ #include "parrot/parrot.h" -#include "byteorder.h" #include "pf_items.str" /* HEADERIZER HFILE: include/parrot/packfile.h */ @@ -138,6 +137,101 @@ static void cvt_num8_num16_le( __attribute__nonnull__(2) FUNC_MODIFIES(*dest); +PARROT_INLINE +static void fetch_buf_be_12( + ARGOUT(unsigned char *rb), + ARGIN(const unsigned char *b)) + __attribute__nonnull__(1) + __attribute__nonnull__(2) + FUNC_MODIFIES(*rb); + +PARROT_INLINE +static void fetch_buf_be_16( + ARGOUT(unsigned char *rb), + ARGIN(const unsigned char *b)) + __attribute__nonnull__(1) + __attribute__nonnull__(2) + FUNC_MODIFIES(*rb); + +PARROT_INLINE +static void fetch_buf_be_32( + ARGOUT(unsigned char *rb), + ARGIN(const unsigned char *b)) + __attribute__nonnull__(1) + __attribute__nonnull__(2) + FUNC_MODIFIES(*rb); + +PARROT_INLINE +static void fetch_buf_be_4( + ARGOUT(unsigned char *rb), + ARGIN(const unsigned char *b)) + __attribute__nonnull__(1) + __attribute__nonnull__(2) + FUNC_MODIFIES(*rb); + +PARROT_INLINE +static void fetch_buf_be_8( + ARGOUT(unsigned char *rb), + ARGIN(const unsigned char *b)) + __attribute__nonnull__(1) + __attribute__nonnull__(2) + FUNC_MODIFIES(*rb); + +PARROT_INLINE +static void fetch_buf_le_12( + ARGOUT(unsigned char *rb), + ARGIN(const unsigned char *b)) + __attribute__nonnull__(1) + __attribute__nonnull__(2) + FUNC_MODIFIES(*rb); + +PARROT_INLINE +static void fetch_buf_le_16( + ARGOUT(unsigned char *rb), + ARGIN(const unsigned char *b)) + __attribute__nonnull__(1) + __attribute__nonnull__(2) + FUNC_MODIFIES(*rb); + +PARROT_INLINE +static void fetch_buf_le_32( + ARGOUT(unsigned char *rb), + ARGIN(const unsigned char *b)) + __attribute__nonnull__(1) + __attribute__nonnull__(2) + FUNC_MODIFIES(*rb); + +PARROT_INLINE +static void fetch_buf_le_4( + ARGOUT(unsigned char *rb), + ARGIN(const unsigned char *b)) + __attribute__nonnull__(1) + __attribute__nonnull__(2) + FUNC_MODIFIES(*rb); + +PARROT_INLINE +static void fetch_buf_le_8( + ARGOUT(unsigned char *rb), + ARGIN(const unsigned char *b)) + __attribute__nonnull__(1) + __attribute__nonnull__(2) + FUNC_MODIFIES(*rb); + +PARROT_INLINE +PARROT_WARN_UNUSED_RESULT +PARROT_CONST_FUNCTION +static INTVAL fetch_iv_be(INTVAL w); + +PARROT_INLINE +PARROT_WARN_UNUSED_RESULT +PARROT_CONST_FUNCTION +static INTVAL fetch_iv_le(INTVAL w); + +PARROT_INLINE +PARROT_WARN_UNUSED_RESULT +PARROT_CONST_FUNCTION +static opcode_t fetch_op_be(opcode_t w); + PARROT_WARN_UNUSED_RESULT static opcode_t fetch_op_be_4(ARGIN(const unsigned char *b)) __attribute__nonnull__(1); @@ -146,6 +240,11 @@ PARROT_WARN_UNUSED_RESULT static opcode_t fetch_op_be_8(ARGIN(const unsigned char *b)) __attribute__nonnull__(1); +PARROT_INLINE +PARROT_WARN_UNUSED_RESULT +PARROT_CONST_FUNCTION +static opcode_t fetch_op_le(opcode_t w); + PARROT_WARN_UNUSED_RESULT static opcode_t fetch_op_le_4(ARGIN(const unsigned char *b)) __attribute__nonnull__(1); @@ -196,10 +295,44 @@ static opcode_t fetch_op_le_8(ARGIN(const unsigned char *b)) #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_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(rb) \ + , 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(rb) \ + , 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(rb) \ + , 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(rb) \ + , 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(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_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 __attribute__unused__ int _ASSERT_ARGS_CHECK = (0) #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 = (\ @@ -988,6 +1121,7 @@ is 1 I. */ PARROT_CONST_FUNCTION +PARROT_WARN_UNUSED_RESULT size_t PF_size_opcode(void) { @@ -1022,7 +1156,7 @@ PF_fetch_integer(ARGIN(PackFile *pf), ARGIN(const opcode_t **stream)) /* XXX assume sizeof (opcode_t) == sizeof (INTVAL) on the * machine producing this PBC. * - * TODO TT #364 on Sparc 64bit: On pbc wordsize=4 but native ptrsize=8 and + * TODO GH #415 on Sparc 64bit: On pbc wordsize=4 but native ptrsize=8 and * ptr_alignment=8 the advance by 4 will signal BUS (invalid address alignment) * in PF_fetch_integer and elsewhere. */ @@ -1143,7 +1277,7 @@ PF_store_number(ARGOUT(opcode_t *cursor), ARGIN(const FLOATVAL *val)) ASSERT_ARGS(PF_store_number) opcode_t padded_size = (sizeof (FLOATVAL) + sizeof (opcode_t) - 1) / sizeof (opcode_t); - mem_sys_memcopy(cursor, val, sizeof (FLOATVAL)); + memcpy(cursor, val, sizeof (FLOATVAL)); cursor += padded_size; return cursor; } @@ -1230,7 +1364,7 @@ PF_store_buf(ARGOUT(opcode_t *cursor), ARGIN(const STRING *s)) if (s->strstart) { char *charcursor = (char *) cursor; - mem_sys_memcopy(charcursor, s->strstart, s->bufused); + memcpy(charcursor, s->strstart, s->bufused); charcursor += s->bufused; /* Pad up to wordsize boundary. */ @@ -1376,7 +1510,7 @@ PF_store_string(ARGOUT(opcode_t *cursor), ARGIN(const STRING *s)) charcursor = (char *)cursor; if (s->strstart) { - mem_sys_memcopy(charcursor, s->strstart, s->bufused); + memcpy(charcursor, s->strstart, s->bufused); charcursor += s->bufused; /* Pad up to sizeof (opcode_t) boundary. */ while ((unsigned long) (charcursor - (char *) cursor) % sizeof (opcode_t)) { @@ -1714,19 +1848,542 @@ PackFile_assign_transforms(ARGMOD(PackFile *pf)) #endif } + /* -=back +=item C + +This function converts a 4 or 8 byte C into little endian +format. If the native format is already little endian, then no +conversion is done. + +=cut + +*/ + +PARROT_INLINE +PARROT_WARN_UNUSED_RESULT +PARROT_CONST_FUNCTION +static INTVAL +fetch_iv_le(INTVAL w) +{ + ASSERT_ARGS(fetch_iv_le) +#if !PARROT_BIGENDIAN + return w; +#else +# if INTVAL_SIZE == 4 + return (w << 24) | ((w & 0xff00) << 8) | ((w & 0xff0000) >> 8) | (w >> 24); +# else +# if INTVAL_SIZE == 8 + INTVAL r; + + r = w << 56; + r |= (w & 0xff00) << 40; + r |= (w & 0xff0000) << 24; + r |= (w & 0xff000000) << 8; + r |= (w & 0xff00000000) >> 8; + r |= (w & 0xff0000000000) >> 24; + r |= (w & 0xff000000000000) >> 40; + r |= (w & 0xff00000000000000) >> 56; + return r; +# else + exit_fatal(1, "Unsupported INTVAL_SIZE=%d\n", + INTVAL_SIZE); +# endif +# endif +#endif +} + +/* + +=item C + +This function converts a 4 or 8 byte C into big endian format. +If the native format is already big endian, then no conversion is done. + +=cut + +*/ + +PARROT_INLINE +PARROT_WARN_UNUSED_RESULT +PARROT_CONST_FUNCTION +static INTVAL +fetch_iv_be(INTVAL w) +{ + ASSERT_ARGS(fetch_iv_be) +#if PARROT_BIGENDIAN + return w; +#else +# if INTVAL_SIZE == 4 + return (w << 24) | ((w & 0xff00) << 8) | ((w & 0xff0000) >> 8) | (w >> 24); +# else +# if INTVAL_SIZE == 8 + INTVAL r; + r = w << 56; + r |= (w & 0xff00) << 40; + r |= (w & 0xff0000) << 24; + r |= (w & 0xff000000) << 8; + r |= (w & 0xff00000000) >> 8; + r |= (w & 0xff0000000000) >> 24; + r |= (w & 0xff000000000000) >> 40; + r |= (w & 0xff00000000000000) >> 56; + return r; +# else + exit_fatal(1, "Unsupported INTVAL_SIZE=%d\n", INTVAL_SIZE); +# endif +# endif +#endif +} -=head1 HISTORY +/* + +=item C -Initial review by leo 2003.11.21 +Same as C for opcode_t -Most routines moved from F. +=cut + +*/ + +PARROT_INLINE +PARROT_WARN_UNUSED_RESULT +PARROT_CONST_FUNCTION +static opcode_t +fetch_op_be(opcode_t w) +{ + ASSERT_ARGS(fetch_op_be) +#if PARROT_BIGENDIAN + return w; +#else +# if OPCODE_T_SIZE == 4 + return (w << 24) | ((w & 0x0000ff00) << 8) | ((w & 0x00ff0000) >> 8) | + ((w & 0xff000000) >> 24); +# else + opcode_t r; + + r = w << 56; + r |= (w & 0xff00) << 40; + r |= (w & 0xff0000) << 24; + r |= (w & 0xff000000) << 8; + r |= (w & 0xff00000000) >> 8; + r |= (w & 0xff0000000000) >> 24; + r |= (w & 0xff000000000000) >> 40; + r |= (w & 0xff00000000000000) >> 56; + return r; +# endif +#endif +} + +/* + +=item C + +Same as C for opcode_t + +=cut + +*/ + +PARROT_INLINE +PARROT_WARN_UNUSED_RESULT +PARROT_CONST_FUNCTION +static opcode_t +fetch_op_le(opcode_t w) +{ + ASSERT_ARGS(fetch_op_le) +#if !PARROT_BIGENDIAN + return w; +#else +# if OPCODE_T_SIZE == 4 + return (w << 24) | ((w & 0x0000ff00) << 8) | ((w & 0x00ff0000) >> 8) | + ((w & 0xff000000) >> 24); +# else + opcode_t r; + + r = w << 56; + r |= (w & 0xff00) << 40; + r |= (w & 0xff0000) << 24; + r |= (w & 0xff000000) << 8; + r |= (w & 0xff00000000) >> 8; + r |= (w & 0xff0000000000) >> 24; + r |= (w & 0xff000000000000) >> 40; + r |= (w & 0xff00000000000000) >> 56; + return r; +# endif +#endif +} + +/* + +=pod + +Unrolled routines for swapping various sizes from 32-128 bits. These +should only be used if alignment is unknown or we are pulling something +out of a padded buffer. + +=cut + +*/ + +/* + +=item C + +Converts a 4-byte big-endian buffer C into a little-endian C. + +=cut + +*/ + +PARROT_INLINE +static void +fetch_buf_be_4(ARGOUT(unsigned char *rb), ARGIN(const unsigned char *b)) +{ + ASSERT_ARGS(fetch_buf_be_4) +#if PARROT_BIGENDIAN + memcpy(rb, b, 4); +#else + rb[0] = b[3]; + rb[1] = b[2]; + rb[2] = b[1]; + rb[3] = b[0]; +#endif +} + +/* -Renamed PackFile_* to PF_* +=item C -Added 16 byte types. +Converts a 4-byte little-endian buffer C into a big-endian buffer C. + +=cut + +*/ + +PARROT_INLINE +static void +fetch_buf_le_4(ARGOUT(unsigned char *rb), ARGIN(const unsigned char *b)) +{ + ASSERT_ARGS(fetch_buf_le_4) +#if !PARROT_BIGENDIAN + memcpy(rb, b, 4); +#else + rb[0] = b[3]; + rb[1] = b[2]; + rb[2] = b[1]; + rb[3] = b[0]; +#endif +} + +/* + +=item C + +Converts an 8-byte big-endian buffer C into a little-endian buffer C + +=cut + +*/ + +PARROT_INLINE +static void +fetch_buf_be_8(ARGOUT(unsigned char *rb), ARGIN(const unsigned char *b)) +{ + ASSERT_ARGS(fetch_buf_be_8) +#if PARROT_BIGENDIAN + memcpy(rb, b, 8); +#else + rb[0] = b[7]; + rb[1] = b[6]; + rb[2] = b[5]; + rb[3] = b[4]; + rb[4] = b[3]; + rb[5] = b[2]; + rb[6] = b[1]; + rb[7] = b[0]; +#endif +} + +/* + +=item C + +Converts an 8-byte little-endian buffer C into a big-endian buffer C. + +=cut + +*/ + +PARROT_INLINE +static void +fetch_buf_le_8(ARGOUT(unsigned char *rb), ARGIN(const unsigned char *b)) +{ + ASSERT_ARGS(fetch_buf_le_8) +#if !PARROT_BIGENDIAN + memcpy(rb, b, 8); +#else + rb[0] = b[7]; + rb[1] = b[6]; + rb[2] = b[5]; + rb[3] = b[4]; + rb[4] = b[3]; + rb[5] = b[2]; + rb[6] = b[1]; + rb[7] = b[0]; +#endif +} + +/* + +=item C + +Converts a 12-byte little-endian buffer C into a big-endian buffer C. + +=cut + +*/ + +PARROT_INLINE +static void +fetch_buf_le_12(ARGOUT(unsigned char *rb), ARGIN(const unsigned char *b)) +{ + ASSERT_ARGS(fetch_buf_le_12) +#if !PARROT_BIGENDIAN + memcpy(rb, b, 12); +#else + rb[0] = b[11]; + rb[1] = b[10]; + rb[2] = b[9]; + rb[3] = b[8]; + rb[4] = b[7]; + rb[5] = b[6]; + rb[6] = b[5]; + rb[7] = b[4]; + rb[8] = b[3]; + rb[9] = b[2]; + rb[10] = b[1]; + rb[11] = b[0]; +#endif +} + +/* + +=item C + +Converts a 12-byte big-endian buffer C into a little-endian buffer C. + +=cut + +*/ + +PARROT_INLINE +static void +fetch_buf_be_12(ARGOUT(unsigned char *rb), ARGIN(const unsigned char *b)) +{ + ASSERT_ARGS(fetch_buf_be_12) +#if PARROT_BIGENDIAN + memcpy(rb, b, 12); +#else + rb[0] = b[11]; + rb[1] = b[10]; + rb[2] = b[9]; + rb[3] = b[8]; + rb[4] = b[7]; + rb[5] = b[6]; + rb[6] = b[5]; + rb[7] = b[4]; + rb[8] = b[3]; + rb[9] = b[2]; + rb[10] = b[1]; + rb[11] = b[0]; +#endif +} + +/* + +=item C + +Converts a 16-byte little-endian buffer C into a big-endian buffer C. + +=cut + +*/ + +PARROT_INLINE +static void +fetch_buf_le_16(ARGOUT(unsigned char *rb), ARGIN(const unsigned char *b)) +{ + ASSERT_ARGS(fetch_buf_le_16) +#if !PARROT_BIGENDIAN + memcpy(rb, b, 16); +#else + rb[0] = b[15]; + rb[1] = b[14]; + rb[2] = b[13]; + rb[3] = b[12]; + rb[4] = b[11]; + rb[5] = b[10]; + rb[6] = b[9]; + rb[7] = b[8]; + rb[8] = b[7]; + rb[9] = b[6]; + rb[10] = b[5]; + rb[11] = b[4]; + rb[12] = b[3]; + rb[13] = b[2]; + rb[14] = b[1]; + rb[15] = b[0]; +#endif +} + +/* + +=item C + +Converts a 16-byte big-endian buffer C into a little-endian buffer C. + +=cut + +*/ + +PARROT_INLINE +static void +fetch_buf_be_16(ARGOUT(unsigned char *rb), ARGIN(const unsigned char *b)) +{ + ASSERT_ARGS(fetch_buf_be_16) +#if PARROT_BIGENDIAN + memcpy(rb, b, 16); +#else + rb[0] = b[15]; + rb[1] = b[14]; + rb[2] = b[13]; + rb[3] = b[12]; + rb[4] = b[11]; + rb[5] = b[10]; + rb[6] = b[9]; + rb[7] = b[8]; + rb[8] = b[7]; + rb[9] = b[6]; + rb[10] = b[5]; + rb[11] = b[4]; + rb[12] = b[3]; + rb[13] = b[2]; + rb[14] = b[1]; + rb[15] = b[0]; +#endif +} + +/* + +=item C + +Converts a 32-byte little-endian buffer C into a big-endian buffer C. + +=cut + +*/ + +PARROT_INLINE +static void +fetch_buf_le_32(ARGOUT(unsigned char *rb), ARGIN(const unsigned char *b)) +{ + ASSERT_ARGS(fetch_buf_le_32) +#if !PARROT_BIGENDIAN + memcpy(rb, b, 32); +#else + rb[0] = b[31]; + rb[1] = b[30]; + rb[2] = b[29]; + rb[3] = b[28]; + rb[4] = b[27]; + rb[5] = b[26]; + rb[6] = b[25]; + rb[7] = b[24]; + rb[8] = b[23]; + rb[9] = b[22]; + rb[10] = b[21]; + rb[11] = b[20]; + rb[12] = b[19]; + rb[13] = b[18]; + rb[14] = b[17]; + rb[15] = b[16]; + rb[16] = b[15]; + rb[17] = b[14]; + rb[18] = b[13]; + rb[19] = b[12]; + rb[20] = b[11]; + rb[21] = b[10]; + rb[22] = b[9]; + rb[23] = b[8]; + rb[24] = b[7]; + rb[25] = b[6]; + rb[26] = b[5]; + rb[27] = b[4]; + rb[28] = b[3]; + rb[29] = b[2]; + rb[30] = b[1]; + rb[31] = b[0]; +#endif +} + +/* + +=item C + +Converts a 32-byte big-endian buffer C into a little-endian buffer C. + +=cut + +*/ + +PARROT_INLINE +static void +fetch_buf_be_32(ARGOUT(unsigned char *rb), ARGIN(const unsigned char *b)) +{ + ASSERT_ARGS(fetch_buf_be_32) +#if PARROT_BIGENDIAN + memcpy(rb, b, 32); +#else + rb[0] = b[31]; + rb[1] = b[30]; + rb[2] = b[29]; + rb[3] = b[28]; + rb[4] = b[27]; + rb[5] = b[26]; + rb[6] = b[25]; + rb[7] = b[24]; + rb[8] = b[23]; + rb[9] = b[22]; + rb[10] = b[21]; + rb[11] = b[20]; + rb[12] = b[19]; + rb[13] = b[18]; + rb[14] = b[17]; + rb[15] = b[16]; + rb[16] = b[15]; + rb[17] = b[14]; + rb[18] = b[13]; + rb[19] = b[12]; + rb[20] = b[11]; + rb[21] = b[10]; + rb[22] = b[9]; + rb[23] = b[8]; + rb[24] = b[7]; + rb[25] = b[6]; + rb[26] = b[5]; + rb[27] = b[4]; + rb[28] = b[3]; + rb[29] = b[2]; + rb[30] = b[1]; + rb[31] = b[0]; +#endif +} + + +/* + +=back =head1 TODO @@ -1742,7 +2399,6 @@ C<()>> - return the needed size in C units. */ - /* * Local variables: * c-file-style: "parrot" diff --git a/src/packfile/pf_private.h b/src/packfile/pf_private.h index b6ef0b303d..dc7bf74e6d 100644 --- a/src/packfile/pf_private.h +++ b/src/packfile/pf_private.h @@ -1,5 +1,5 @@ /* -Copyright (C) 2011, Parrot Foundation. +Copyright (C) 2011-2012, Parrot Foundation. This program is free software. It is subject to the same license as Parrot itself. */ @@ -9,7 +9,6 @@ Parrot itself. #include "parrot/parrot.h" #include "parrot/packfile.h" -#include "parrot/embed.h" #include "parrot/extend.h" #include "parrot/dynext.h" #include "parrot/runcore_api.h" @@ -41,105 +40,6 @@ Parrot itself. /* pad to 16 in bytes */ #define PAD_16_B(size) ((size) % 16 ? 16 - (size) % 16 : 0) -/* HEADERIZER BEGIN: src/packfile/output.c */ -/* Don't modify between HEADERIZER BEGIN / HEADERIZER END. Your changes will be lost. */ - -PARROT_EXPORT -PARROT_WARN_UNUSED_RESULT -PARROT_CANNOT_RETURN_NULL -opcode_t * PackFile_ConstTable_pack(PARROT_INTERP, - ARGMOD(PackFile_Segment *seg), - ARGOUT(opcode_t *cursor)) - __attribute__nonnull__(1) - __attribute__nonnull__(2) - __attribute__nonnull__(3) - FUNC_MODIFIES(*seg) - FUNC_MODIFIES(*cursor); - -PARROT_EXPORT -size_t PackFile_ConstTable_pack_size(PARROT_INTERP, - ARGMOD(PackFile_Segment *seg)) - __attribute__nonnull__(1) - __attribute__nonnull__(2) - FUNC_MODIFIES(*seg); - -PARROT_EXPORT -int PackFile_ConstTable_rlookup_num(PARROT_INTERP, - ARGIN(const PackFile_ConstTable *ct), - FLOATVAL n) - __attribute__nonnull__(2); - -PARROT_EXPORT -int PackFile_ConstTable_rlookup_pmc(PARROT_INTERP, - ARGIN(PackFile_ConstTable *ct), - ARGIN(PMC *v), - ARGOUT(INTVAL *constno), - ARGOUT(INTVAL *idx)) - __attribute__nonnull__(1) - __attribute__nonnull__(2) - __attribute__nonnull__(3) - __attribute__nonnull__(4) - __attribute__nonnull__(5) - FUNC_MODIFIES(*constno) - FUNC_MODIFIES(*idx); - -PARROT_EXPORT -int PackFile_ConstTable_rlookup_str(PARROT_INTERP, - ARGIN(const PackFile_ConstTable *ct), - ARGIN(STRING *s)) - __attribute__nonnull__(1) - __attribute__nonnull__(2) - __attribute__nonnull__(3); - -PARROT_EXPORT -void PackFile_pack(PARROT_INTERP, - ARGMOD(PackFile *self), - ARGOUT(opcode_t *cursor)) - __attribute__nonnull__(1) - __attribute__nonnull__(2) - __attribute__nonnull__(3) - FUNC_MODIFIES(*self) - FUNC_MODIFIES(*cursor); - -PARROT_EXPORT -opcode_t PackFile_pack_size(PARROT_INTERP, ARGMOD(PackFile *self)) - __attribute__nonnull__(1) - __attribute__nonnull__(2) - FUNC_MODIFIES(*self); - -#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(interp) \ - , PARROT_ASSERT_ARG(seg)) -#define ASSERT_ARGS_PackFile_ConstTable_rlookup_num \ - __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ - PARROT_ASSERT_ARG(ct)) -#define ASSERT_ARGS_PackFile_ConstTable_rlookup_pmc \ - __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ - PARROT_ASSERT_ARG(interp) \ - , PARROT_ASSERT_ARG(ct) \ - , PARROT_ASSERT_ARG(v) \ - , PARROT_ASSERT_ARG(constno) \ - , PARROT_ASSERT_ARG(idx)) -#define ASSERT_ARGS_PackFile_ConstTable_rlookup_str \ - __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ - PARROT_ASSERT_ARG(interp) \ - , PARROT_ASSERT_ARG(ct) \ - , PARROT_ASSERT_ARG(s)) -#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(interp) \ - , PARROT_ASSERT_ARG(self)) -/* Don't modify between HEADERIZER BEGIN / HEADERIZER END. Your changes will be lost. */ -/* HEADERIZER END: src/packfile/output.c */ - - #endif /* PARROT_PR_PRIVATE_H_GUARD */ /* diff --git a/src/packfile/segments.c b/src/packfile/segments.c index 3c88eac58c..ec82519f7f 100644 --- a/src/packfile/segments.c +++ b/src/packfile/segments.c @@ -1,5 +1,5 @@ /* -Copyright (C) 2011, Parrot Foundation. +Copyright (C) 2011-2012, Parrot Foundation. =head1 NAME @@ -88,6 +88,8 @@ static opcode_t * default_pack( __attribute__nonnull__(2) FUNC_MODIFIES(*dest); +PARROT_PURE_FUNCTION +PARROT_WARN_UNUSED_RESULT static size_t default_packed_size(ARGIN(const PackFile_Segment *self)) __attribute__nonnull__(1); @@ -339,6 +341,11 @@ PackFile_ConstTable_clear(PARROT_INTERP, ARGMOD(PackFile_ConstTable *self)) self->string_hash = NULL; } + if (self->tag_map) { + mem_gc_free(interp, self->tag_map); + self->ntags = 0; + } + return; } @@ -420,6 +427,13 @@ PackFile_ConstTable_unpack(PARROT_INTERP, ARGMOD(PackFile_Segment *seg), Parrot_ns_store_sub(interp, pmc); } + self->ntags = PF_fetch_opcode(pf, &cursor); + self->tag_map = mem_gc_allocate_n_zeroed_typed(interp, self->ntags, PackFile_ConstTagPair); + for (i = 0; i < self->ntags; i++) { + self->tag_map[i].tag_idx = PF_fetch_opcode(pf, &cursor); + self->tag_map[i].const_idx = PF_fetch_opcode(pf, &cursor); + } + return cursor; err: @@ -688,6 +702,7 @@ PackFile_Annotations_dump(PARROT_INTERP, ARGIN(const PackFile_Segment *seg)) Parrot_io_printf(interp, "\n [\n"); for (i = 0; i < self->num_keys; ++i) { const PackFile_Annotations_Key * const key = &self->keys[i]; + const size_t key_end = key->start + key->len; Parrot_io_printf(interp, " #%d\n [\n", i); Parrot_io_printf(interp, " NAME => %Ss\n", self->code->const_table->str.constants[key->name]); @@ -696,7 +711,7 @@ PackFile_Annotations_dump(PARROT_INTERP, ARGIN(const PackFile_Segment *seg)) key->type == PF_ANNOTATION_KEY_TYPE_STR ? "string" : key->type == PF_ANNOTATION_KEY_TYPE_PMC ? "pmc" : ""); - for (j = key->start; j < key->len; j++) { + for (j = key->start; j < key_end; j++) { Parrot_io_printf(interp, " [\n", i); Parrot_io_printf(interp, " BYTECODE_OFFSET => %d\n", self->base.data[j * 2 + ANN_ENTRY_OFF]); @@ -778,7 +793,7 @@ default_unpack(PARROT_INTERP, ARGMOD(PackFile_Segment *self), ARGIN(const opcode } if (!self->pf->need_endianize && !self->pf->need_wordsize) { - mem_sys_memcopy(self->data, cursor, self->size * sizeof (opcode_t)); + memcpy(self->data, cursor, self->size * sizeof (opcode_t)); cursor += self->size; } else { @@ -841,7 +856,7 @@ default_dump(PARROT_INTERP, ARGIN(const PackFile_Segment *self)) Parrot_io_printf(interp, "\n %04x: ", (int) i); Parrot_io_printf(interp, "%08lx ", (unsigned long) - self->data ? self->data[i] : self->pf->src[i]); + (self->data ? self->data[i] : self->pf->src[i])); } Parrot_io_printf(interp, "\n]\n"); @@ -1109,7 +1124,7 @@ PackFile_Segment_unpack(PARROT_INTERP, ARGMOD(PackFile_Segment *self), /* -=item C +=item C Dumps the segment C. @@ -1119,7 +1134,7 @@ Dumps the segment C. PARROT_EXPORT void -PackFile_Segment_dump(PARROT_INTERP, ARGIN(PackFile_Segment *self)) +PackFile_Segment_dump(PARROT_INTERP, ARGIN(const PackFile_Segment *self)) { ASSERT_ARGS(PackFile_Segment_dump) self->pf->PackFuncs[self->type].dump(interp, self); @@ -1621,6 +1636,8 @@ Returns the default size of the segment C. */ +PARROT_PURE_FUNCTION +PARROT_WARN_UNUSED_RESULT static size_t default_packed_size(ARGIN(const PackFile_Segment *self)) { diff --git a/src/platform/aix/asm.s b/src/platform/aix/asm.s index 24b5c570ee..f76ed547b5 100644 --- a/src/platform/aix/asm.s +++ b/src/platform/aix/asm.s @@ -39,28 +39,3 @@ st 3,68(SP) cal SP,80(SP) bcr BO_ALWAYS,CR0_LT - -# -# see jit/ppc/asm.s - -# .Parrot_ppc_jit_restore_nonvolatile_registers: -# .function .Parrot_ppc_jit_restore_nonvolatile_registers,.Parrot_ppc_jit_restore_nonvolatile_registers,2,0 -# lfd 14,-84(SP) -# lfd 15,-92(SP) -# lfd 16,-100(SP) -# lfd 17,-108(SP) -# lfd 18,-116(SP) -# lfd 19,-124(SP) -# lfd 20,-132(SP) -# lfd 21,-140(SP) -# lfd 22,-148(SP) -# lfd 23,-156(SP) -# lfd 24,-164(SP) -# lfd 25,-172(SP) -# lfd 26,-180(SP) -# lfd 27,-188(SP) -# lfd 28,-196(SP) -# lfd 29,-204(SP) -# lfd 30,-212(SP) -# lfd 31,-220(SP) -# bcr BO_ALWAYS,CR0_LT diff --git a/src/platform/darwin/hires_timer.c b/src/platform/darwin/hires_timer.c index c1765a6c99..ea5f954e8e 100644 --- a/src/platform/darwin/hires_timer.c +++ b/src/platform/darwin/hires_timer.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2009, Parrot Foundation. + * Copyright (C) 2009-2011, Parrot Foundation. */ /* @@ -61,6 +61,7 @@ Return the number of ns that each time unit from Parrot_hires_get_time represent */ +PARROT_CONST_FUNCTION UINTVAL Parrot_hires_get_tick_duration(void) { diff --git a/src/platform/generic/dl.c b/src/platform/generic/dl.c index 6d6a1dab5a..1f255552c7 100644 --- a/src/platform/generic/dl.c +++ b/src/platform/generic/dl.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2004-2010, Parrot Foundation. + * Copyright (C) 2004-2012, Parrot Foundation. */ /* @@ -23,12 +23,114 @@ Parrot functions which wrap around standard library functions for handling dynam #include "parrot/parrot.h" #ifdef PARROT_HAS_HEADER_DLFCN +# include +# include # include #endif +/* HEADERIZER HFILE: none */ +/* HEADERIZER BEGIN: static */ +/* Don't modify between HEADERIZER BEGIN / HEADERIZER END. Your changes will be lost. */ + +PARROT_WARN_UNUSED_RESULT +PARROT_CAN_RETURN_NULL +static void * find_handle_entry(ARGIN(const void *handle)) + __attribute__nonnull__(1); + +static void push_handle_entry(ARGIN_NULLOK(void *handle)); +static void remove_handle_entry(ARGIN_NULLOK(void *handle)); +#define ASSERT_ARGS_find_handle_entry __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ + PARROT_ASSERT_ARG(handle)) +#define ASSERT_ARGS_push_handle_entry __attribute__unused__ int _ASSERT_ARGS_CHECK = (0) +#define ASSERT_ARGS_remove_handle_entry __attribute__unused__ int _ASSERT_ARGS_CHECK = (0) +/* Don't modify between HEADERIZER BEGIN / HEADERIZER END. Your changes will be lost. */ +/* HEADERIZER END: static */ + + #define PARROT_DLOPEN_FLAGS RTLD_LAZY -/* HEADERIZER HFILE: none */ +#ifdef PARROT_HAS_HEADER_DLFCN + +/* + +=item C + +=item C + +=item C + +Helper functions to load and unload libraries. + +=cut + +*/ + +struct handle_entry { + void *handle; + struct handle_entry *next; +}; + +struct handle_entry *handle_list = NULL; + +static void +push_handle_entry(ARGIN_NULLOK(void *handle)) +{ + ASSERT_ARGS(push_handle_entry) + + struct handle_entry *e; + + e = (struct handle_entry *) malloc(sizeof (struct handle_entry)); + if (!e) { + return; + } + + e->handle = handle; + e->next = handle_list; + handle_list = e; +} + +PARROT_WARN_UNUSED_RESULT +PARROT_CAN_RETURN_NULL +static void * +find_handle_entry(ARGIN(const void *handle)) +{ + ASSERT_ARGS(find_handle_entry) + + const struct handle_entry *e; + + for (e = handle_list; e; e = e->next) { + if (e->handle == handle) + return e->handle; + } + + return NULL; +} + +static void +remove_handle_entry(ARGIN_NULLOK(void *handle)) +{ + ASSERT_ARGS(remove_handle_entry) + + if (handle_list) { + if (handle_list->handle == handle) { + struct handle_entry * const p = handle_list; + handle_list = p->next; + free(p); + } + else { + struct handle_entry *cur, *prev; + for (cur = handle_list; cur; prev = cur, cur = cur->next) { + if (cur->handle == handle) { + prev->next = cur->next; + free(cur); + } + } + } + } +} +#endif /* PARROT_HAS_HEADER_DLFCN */ + + /* @@ -41,15 +143,20 @@ argument and returns a handle to it. */ +PARROT_WARN_UNUSED_RESULT PARROT_CAN_RETURN_NULL void * Parrot_dlopen(const char *filename, Parrot_dlopen_flags flags) { #ifdef PARROT_HAS_HEADER_DLFCN - return dlopen(filename, PARROT_DLOPEN_FLAGS - | ((flags & Parrot_dlopen_global_FLAG) ? RTLD_GLOBAL : 0)); + void *h; + + h = dlopen(filename, PARROT_DLOPEN_FLAGS | + ((flags & Parrot_dlopen_global_FLAG) ? RTLD_GLOBAL : 0)); + push_handle_entry(h); + return h; #else - return 0; + return NULL; #endif } @@ -64,6 +171,7 @@ failure in use of C, C or C. */ +PARROT_WARN_UNUSED_RESULT PARROT_CAN_RETURN_NULL const char * Parrot_dlerror(void) @@ -71,7 +179,7 @@ Parrot_dlerror(void) #ifdef PARROT_HAS_HEADER_DLFCN return dlerror(); #else - return 0; + return NULL; #endif } @@ -86,6 +194,7 @@ returns address where symbol is located. */ +PARROT_WARN_UNUSED_RESULT PARROT_CAN_RETURN_NULL void * Parrot_dlsym(void *handle, const char *symbol) @@ -110,14 +219,20 @@ by argument. Returns C<0> on success and C<-1> on failure. */ +PARROT_WARN_UNUSED_RESULT int Parrot_dlclose(void *handle) { #ifdef PARROT_HAS_HEADER_DLFCN - return dlclose(handle); -#else - return -1; + int rv; + + if (find_handle_entry(handle)) { + remove_handle_entry(handle); + rv = dlclose(handle); + return rv; + } #endif + return -1; } /* diff --git a/src/platform/generic/entropy.c b/src/platform/generic/entropy.c index ca266d5c7d..24ec1fdbda 100644 --- a/src/platform/generic/entropy.c +++ b/src/platform/generic/entropy.c @@ -43,7 +43,7 @@ Parrot_get_entropy(PARROT_INTERP) { if (!urand_fh) { const char *msg = "Couldn't open /dev/urandom for reading."; /* This function is called during interp init, so use the GC registry - * as a way to figure out interp's initialziedness. + * as a way to figure out interp's initializedness. */ if (interp->gc_registry) Parrot_ex_throw_from_c_args(interp, NULL, 1, msg); diff --git a/src/platform/generic/file.c b/src/platform/generic/file.c index 8719f534ec..551e20363d 100644 --- a/src/platform/generic/file.c +++ b/src/platform/generic/file.c @@ -24,7 +24,7 @@ This file implements OS-specific file functions for generic UNIX platforms. #include "parrot/parrot.h" -/* TT #1050 apparently, strerror_r is thread-safe and should be used instead.*/ +/* GH #655 apparently, strerror_r is thread-safe and should be used instead.*/ #define THROW(msg) Parrot_ex_throw_from_c_args(interp, NULL, \ EXCEPTION_EXTERNAL_ERROR, "%s failed: %s", (msg), strerror(errno)) diff --git a/src/platform/generic/hires_timer.c b/src/platform/generic/hires_timer.c index b5fcabfeaf..db1b757873 100644 --- a/src/platform/generic/hires_timer.c +++ b/src/platform/generic/hires_timer.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2009, Parrot Foundation. + * Copyright (C) 2009-2011, Parrot Foundation. */ /* @@ -78,6 +78,7 @@ Return the number of ns that each time unit from Parrot_hires_get_time represent */ +PARROT_CONST_FUNCTION UINTVAL Parrot_hires_get_tick_duration(void) { diff --git a/src/platform/generic/io.c b/src/platform/generic/io.c index 10bb988ebc..d8957f2180 100644 --- a/src/platform/generic/io.c +++ b/src/platform/generic/io.c @@ -186,47 +186,51 @@ Parrot_io_dup(SHIM_INTERP, PIOHANDLE handle) return dup(handle); } -#if PARROT_ASYNC_DEVEL - /* -=item C - -Experimental asynchronous IO. - -This is available if C is defined. - -Only works on Linux at the moment. +=item C -Toggles the C flag on the IO file descriptor. +Sets a handle C<*pmc> to blocking or non-blocking mode =cut */ +PARROT_EXPORT +PARROT_WARN_UNUSED_RESULT INTVAL -Parrot_io_async_unix(PARROT_INTERP, ARGMOD(PMC *filehandle), INTVAL b) +Parrot_io_async(PARROT_INTERP, ARGMOD(PMC *pmc), INTVAL async) { -# if defined(linux) + ASSERT_ARGS(Parrot_io_is_async) int rflags; - PIOHANDLE file_descriptor = Parrot_io_get_os_handle(interp, filehandle); + PIOHANDLE file_descriptor; + + if (Parrot_io_is_closed(interp, pmc)) + return 0; + +#if defined(linux) + file_descriptor = Parrot_io_get_os_handle(interp, pmc); if ((rflags = fcntl(file_descriptor, F_GETFL, 0)) >= 0) { - if (b) + if (async) rflags |= O_ASYNC; else rflags &= ~O_ASYNC; - return fcntl(file_descriptor, F_SETFL, rflags); + if ((rflags = fcntl(file_descriptor, F_SETFL, rflags)) == 0) { + if (async) + Parrot_io_set_flags(interp, pmc, Parrot_io_get_flags(interp, pmc) | PIO_F_ASYNC); + else + Parrot_io_set_flags(interp, pmc, Parrot_io_get_flags(interp, pmc) & ~PIO_F_ASYNC); + } + return rflags; } -# else +#else Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_PIO_NOT_IMPLEMENTED, "Async support not available"); -# endif +#endif return -1; } -#endif - /* =item C @@ -287,6 +291,7 @@ if it was available at compile time, otherwise C is returned. */ +PARROT_CONST_FUNCTION INTVAL Parrot_io_getblksize(PIOHANDLE fd) { diff --git a/src/platform/generic/socket.c b/src/platform/generic/socket.c index 6bbb60dee9..691e02b9ac 100644 --- a/src/platform/generic/socket.c +++ b/src/platform/generic/socket.c @@ -476,7 +476,8 @@ Parrot_io_socket(PARROT_INTERP, int fam, int type, int proto) "creating socket failed: %Ss", Parrot_platform_strerror(interp, PIO_SOCK_ERRNO)); - setsockopt(sock, SOL_SOCKET, SO_REUSEADDR, &value, sizeof (value)); + setsockopt(sock, SOL_SOCKET, SO_REUSEADDR, (const char *)&value, + sizeof (value)); #ifdef IPV6_V6ONLY if (fam == AF_INET6) diff --git a/src/platform/generic/time.c b/src/platform/generic/time.c index 52824db7f3..a495948070 100644 --- a/src/platform/generic/time.c +++ b/src/platform/generic/time.c @@ -98,6 +98,28 @@ Parrot_usleep(unsigned int microseconds) /* +=item C + +Sleep for the specified number of seconds. + +=cut + +*/ + +void +Parrot_floatval_sleep(FLOATVAL time) +{ + if (time > 1000) { + /* prevent integer overflow when converting to microseconds */ + const int seconds = floor(time); + Parrot_sleep(seconds); + time -= seconds; + } + Parrot_usleep((UINTVAL) time*1000000); +} + +/* + =item C Parrot wrapper around standard library C function. diff --git a/src/platform/linux/encoding.c b/src/platform/linux/encoding.c index 554c1c5275..fdb3795c03 100644 --- a/src/platform/linux/encoding.c +++ b/src/platform/linux/encoding.c @@ -54,7 +54,7 @@ Parrot_init_platform_encoding(PARROT_INTERP) else { /* Can't use Parrot_warn here, the interpreter is not ready */ fprintf(stderr, - "Unknown codeset `%s', defaulting to ASCII", codeset); + "Unknown codeset `%s', defaulting to ASCII\n", codeset); Parrot_platform_encoding_ptr = Parrot_ascii_encoding_ptr; } } diff --git a/src/platform/win32/dl.c b/src/platform/win32/dl.c index 8c8ccfdcb7..4f5858801c 100644 --- a/src/platform/win32/dl.c +++ b/src/platform/win32/dl.c @@ -90,7 +90,7 @@ expected IF NCI-RELATED THINGS START BREAKING WHEN YOU UPDATE WINDOWS, THIS IS A VERY GOOD PLACE TO LOOK FOR THE CAUSE OF THE FAILURES. -Visit TT #2150 to register a complaint. +Visit GH #449 to register a complaint. =cut @@ -112,7 +112,7 @@ Parrot_dlsym(void *handle, const char *symbol) compatible for most versions of windows. It's not pretty, however, and it would be awesome if we could find a better, documented way to perform module lookups. - See TT #2150 for more insults about this code. */ + See GH #449 for more insults about this code. */ if (handle == NULL) { void * proc = NULL; handle = find_hmodule_from_func(Parrot_dlsym); diff --git a/src/platform/win32/entropy.c b/src/platform/win32/entropy.c index 925627edb3..2a955a5fbc 100644 --- a/src/platform/win32/entropy.c +++ b/src/platform/win32/entropy.c @@ -21,6 +21,8 @@ Get some entropy from the system. */ #include "parrot/parrot.h" + +#include #include /* HEADERIZER HFILE: none */ @@ -42,7 +44,7 @@ Parrot_get_entropy(PARROT_INTERP) { if (!CryptAcquireContext(&hCryptProv, NULL, NULL, PROV_RSA_FULL, CRYPT_VERIFYCONTEXT)){ const char *msg = "Couldn't crypt context."; /* This function is called during interp init, so use the GC registry - * as a way to figure out interp's initialziedness. + * as a way to figure out interp's initializedness. */ if (interp->gc_registry) Parrot_ex_throw_from_c_args(interp, NULL, 1, msg); diff --git a/src/platform/win32/file.c b/src/platform/win32/file.c index bbc141bff1..3ad26905bf 100644 --- a/src/platform/win32/file.c +++ b/src/platform/win32/file.c @@ -24,10 +24,10 @@ This file implements OS-specific file functions for Win32 platforms. # endif #endif -#include -#include #include "parrot/parrot.h" +#include + #define THROW(msg) Parrot_ex_throw_from_c_args(interp, NULL, \ EXCEPTION_EXTERNAL_ERROR, "%s failed: %Ss", (msg), \ Parrot_platform_strerror(interp, GetLastError())) diff --git a/src/platform/win32/hires_timer.c b/src/platform/win32/hires_timer.c index 484d46a03a..0603d4044c 100644 --- a/src/platform/win32/hires_timer.c +++ b/src/platform/win32/hires_timer.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2009, Parrot Foundation. + * Copyright (C) 2009-2011, Parrot Foundation. */ /* @@ -54,6 +54,7 @@ Return the number of nanoseconds that each time unit from Parrot_hires_get_time */ +PARROT_CONST_FUNCTION UINTVAL Parrot_hires_get_tick_duration(void) { @@ -65,8 +66,6 @@ Parrot_hires_get_tick_duration(void) } - - /* =back diff --git a/src/platform/win32/io.c b/src/platform/win32/io.c index 70b23401a7..594ed79b35 100644 --- a/src/platform/win32/io.c +++ b/src/platform/win32/io.c @@ -24,6 +24,8 @@ Win32 System Programming, 2nd Edition. #include "parrot/parrot.h" #include "../../io/io_private.h" +#include + /* HEADERIZER HFILE: none */ /* HEADERIZER BEGIN: static */ @@ -48,10 +50,6 @@ static void convert_flags_to_win32( /* Don't modify between HEADERIZER BEGIN / HEADERIZER END. Your changes will be lost. */ /* HEADERIZER END: static */ -#include - -#define PIO_TRACE 0 - /* =item C. */ +PARROT_CONST_FUNCTION INTVAL Parrot_io_getblksize(SHIM(PIOHANDLE fd)) { @@ -229,6 +228,41 @@ Parrot_io_dup(PARROT_INTERP, PIOHANDLE handle) /* +=item C + +Sets a handle C<*pmc> to blocking or non-blocking mode + +=cut + +*/ + +PARROT_EXPORT +PARROT_WARN_UNUSED_RESULT +INTVAL +Parrot_io_async(PARROT_INTERP, ARGMOD(PMC *pmc), INTVAL async) +{ + ASSERT_ARGS(Parrot_io_is_async) + int rflags; + PIOHANDLE file_descriptor; + if (Parrot_io_is_closed(interp, pmc)) + return 0; + +#if 0 + if (async) + Parrot_io_set_flags(interp, pmc, Parrot_io_get_flags(interp, pmc) | PIO_F_ASYNC); + else + Parrot_io_set_flags(interp, pmc, Parrot_io_get_flags(interp, pmc) & ~PIO_F_ASYNC); + + file_descriptor = Parrot_io_get_os_handle(interp, filehandle); +#else + Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_PIO_NOT_IMPLEMENTED, + "Async support not available"); +#endif + return -1; +} + +/* + =item C Calls C to close C<*io>'s file descriptor. @@ -514,7 +548,7 @@ Parrot_io_open_pipe(PARROT_INTERP, ARGIN(STRING *command), INTVAL flags, /* Redirect input to NULL. This is to avoid * interferences in case both the child and * the parent tries to read from stdin. - * May be unneccessary or even interfere + * May be unnecessary or even interfere * with valid usages, need more feedback. */ hnull = CreateFile("NUL", GENERIC_READ|GENERIC_WRITE, 0, &sec, OPEN_EXISTING, diff --git a/src/pmc.c b/src/pmc.c index 25d0173777..eecfce02c4 100644 --- a/src/pmc.c +++ b/src/pmc.c @@ -28,11 +28,32 @@ The base vtable calling functions /* HEADERIZER BEGIN: static */ /* Don't modify between HEADERIZER BEGIN / HEADERIZER END. Your changes will be lost. */ +PARROT_WARN_UNUSED_RESULT +PARROT_CAN_RETURN_NULL +static PMC* check_get_std_props(PARROT_INTERP, + ARGIN(const PMC *self), + ARGIN(const STRING *key)) + __attribute__nonnull__(1) + __attribute__nonnull__(2) + __attribute__nonnull__(3); + static void check_pmc_reuse_flags(PARROT_INTERP, UINTVAL srcflags, UINTVAL destflags) __attribute__nonnull__(1); +PARROT_WARN_UNUSED_RESULT +static INTVAL check_set_std_props(PARROT_INTERP, + ARGMOD(PMC *pmc), + ARGIN(const STRING *key), + ARGMOD(PMC *value)) + __attribute__nonnull__(1) + __attribute__nonnull__(2) + __attribute__nonnull__(3) + __attribute__nonnull__(4) + FUNC_MODIFIES(*pmc) + FUNC_MODIFIES(*value); + PARROT_WARN_UNUSED_RESULT PARROT_CANNOT_RETURN_NULL static PMC * create_class_pmc(PARROT_INTERP, INTVAL type) @@ -45,6 +66,17 @@ static PMC * get_new_pmc_header(PARROT_INTERP, UINTVAL flags) __attribute__nonnull__(1); +PARROT_WARN_UNUSED_RESULT +static INTVAL has_pending_std_props(ARGIN(const PMC *self)) + __attribute__nonnull__(1); + +PARROT_CANNOT_RETURN_NULL +PARROT_WARN_UNUSED_RESULT +static PMC* make_prop_hash(PARROT_INTERP, ARGMOD(PMC *self)) + __attribute__nonnull__(1) + __attribute__nonnull__(2) + FUNC_MODIFIES(*self); + PARROT_CANNOT_RETURN_NULL PARROT_WARN_UNUSED_RESULT static PMC* Parrot_pmc_reuse_noinit(PARROT_INTERP, @@ -54,15 +86,40 @@ static PMC* Parrot_pmc_reuse_noinit(PARROT_INTERP, __attribute__nonnull__(2) FUNC_MODIFIES(*pmc); +static void propagate_std_props(PARROT_INTERP, + ARGIN(PMC *self), + ARGIN(PMC *prop_hash)) + __attribute__nonnull__(1) + __attribute__nonnull__(2) + __attribute__nonnull__(3); + +#define ASSERT_ARGS_check_get_std_props __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ + PARROT_ASSERT_ARG(interp) \ + , PARROT_ASSERT_ARG(self) \ + , PARROT_ASSERT_ARG(key)) #define ASSERT_ARGS_check_pmc_reuse_flags __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ PARROT_ASSERT_ARG(interp)) +#define ASSERT_ARGS_check_set_std_props __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ + PARROT_ASSERT_ARG(interp) \ + , PARROT_ASSERT_ARG(pmc) \ + , PARROT_ASSERT_ARG(key) \ + , PARROT_ASSERT_ARG(value)) #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_has_pending_std_props __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ + PARROT_ASSERT_ARG(self)) +#define ASSERT_ARGS_make_prop_hash __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ + PARROT_ASSERT_ARG(interp) \ + , PARROT_ASSERT_ARG(self)) #define ASSERT_ARGS_Parrot_pmc_reuse_noinit __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ PARROT_ASSERT_ARG(interp) \ , PARROT_ASSERT_ARG(pmc)) +#define ASSERT_ARGS_propagate_std_props __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ + PARROT_ASSERT_ARG(interp) \ + , PARROT_ASSERT_ARG(self) \ + , PARROT_ASSERT_ARG(prop_hash)) /* Don't modify between HEADERIZER BEGIN / HEADERIZER END. Your changes will be lost. */ /* HEADERIZER END: static */ @@ -363,6 +420,25 @@ Parrot_pmc_reuse_by_class(PARROT_INTERP, ARGMOD(PMC *pmc), ARGIN(PMC *class_), U return pmc; } +/* + +=item C + +Returns the special C PMC. + +=cut + +*/ + +PARROT_EXPORT +PARROT_PURE_FUNCTION +PARROT_CAN_RETURN_NULL +Parrot_PMC +Parrot_pmc_null(void) +{ + ASSERT_ARGS(Parrot_pmc_null) + return PMCNULL; +} /* @@ -526,49 +602,6 @@ Parrot_pmc_new_noinit(PARROT_INTERP, INTVAL base_type) } -/* - -=item C - -Creates a new constant PMC of type C. - -=cut - -*/ - -PARROT_EXPORT -PARROT_CANNOT_RETURN_NULL -PARROT_WARN_UNUSED_RESULT -PMC * -Parrot_pmc_new_constant_noinit(PARROT_INTERP, INTVAL base_type) -{ - ASSERT_ARGS(Parrot_pmc_new_constant_noinit) - return get_new_pmc_header(interp, base_type, PObj_constant_FLAG); -} - - -/* - -=item C - -Creates a new constant PMC of type C, then calls its C. - -=cut - -*/ - -PARROT_EXPORT -PARROT_CANNOT_RETURN_NULL -PMC * -Parrot_pmc_new_constant(PARROT_INTERP, INTVAL base_type) -{ - ASSERT_ARGS(Parrot_pmc_new_constant) - PMC * const pmc = get_new_pmc_header(interp, base_type, PObj_constant_FLAG); - VTABLE_init(interp, pmc); - return pmc; -} - - /* =item C @@ -629,55 +662,6 @@ Parrot_pmc_new_init_int(PARROT_INTERP, INTVAL base_type, INTVAL init) } - -/* - -=item C - -As C, but passes C to the PMC's C vtable -entry. - -=cut - -*/ - -PARROT_EXPORT -PARROT_CANNOT_RETURN_NULL -PMC * -Parrot_pmc_new_constant_init(PARROT_INTERP, INTVAL base_type, ARGIN_NULLOK(PMC *init)) -{ - ASSERT_ARGS(Parrot_pmc_new_constant_init) - PMC * const pmc = get_new_pmc_header(interp, base_type, PObj_constant_FLAG); - VTABLE_init_pmc(interp, pmc, init); - return pmc; -} - - -/* - -=item C - -As C, but passes C to the PMC's C vtable -entry. - -=cut - -*/ - -PARROT_EXPORT -PARROT_CANNOT_RETURN_NULL -PMC * -Parrot_pmc_new_constant_init_int(PARROT_INTERP, INTVAL base_type, INTVAL init) -{ - ASSERT_ARGS(Parrot_pmc_new_constant_init_int) - PMC * const pmc = get_new_pmc_header(interp, base_type, PObj_constant_FLAG); - VTABLE_init_int(interp, pmc, init); - return pmc; -} - - /* =item C @@ -692,7 +676,7 @@ allow the storage of any regular PMC in this PMC. Temporary PMCs do not participate in garbage collection, and mixing them with PMCs that are garbage-collected will cause bugs. -If you don't know what this means means, or you can't tell if either case +If you don't know what this means, or you can't tell if either case will happen as the result of any call you make on or with this PMC, B use this function, lest you cause weird crashes and memory errors. Use C instead. @@ -1166,6 +1150,246 @@ Parrot_pmc_type_does(PARROT_INTERP, ARGIN(const STRING *role), INTVAL type) } while (1); } + +/* + +=item C + +Returns the property for C<*key>. If no property is defined then the +NULL PMC is returned. + +=cut + +*/ + +PARROT_EXPORT +PARROT_CAN_RETURN_NULL +PMC * +Parrot_pmc_getprop(PARROT_INTERP, ARGIN(PMC *pmc), ARGIN(STRING *key)) +{ + ASSERT_ARGS(Parrot_pmc_getprop) + if (PMC_IS_NULL(PMC_metadata(pmc))) + return check_get_std_props(interp, pmc, key); + else + return VTABLE_get_pmc_keyed_str(interp, PMC_metadata(pmc), key); +} + +/* + +=item C + +Sets the property for C<*key> to C<*value>. + +=cut + +*/ + +PARROT_EXPORT +void +Parrot_pmc_setprop(PARROT_INTERP, ARGIN(PMC *pmc), ARGIN(STRING *key), ARGIN(PMC *value)) +{ + ASSERT_ARGS(Parrot_pmc_setprop) + if (check_set_std_props(interp, pmc, key, value)) + return; + + if (PMC_IS_NULL(PMC_metadata(pmc))) + PMC_metadata(pmc) = make_prop_hash(interp, pmc); + + VTABLE_set_pmc_keyed_str(interp, PMC_metadata(pmc), key, value); +} + +/* + +=item C + +Deletes the property for C<*key>. + +=cut + +*/ + +PARROT_EXPORT +void +Parrot_pmc_delprop(PARROT_INTERP, ARGIN(PMC *pmc), ARGIN(STRING *key)) +{ + ASSERT_ARGS(Parrot_pmc_delprop) + if (!PMC_IS_NULL(PMC_metadata(pmc))) + VTABLE_delete_keyed_str(interp, PMC_metadata(pmc), key); +} + +/* + +=item C + +Returns the PMC's properties or the NULL PMC if no properties exist. + +=cut + +*/ + +PARROT_EXPORT +PARROT_CAN_RETURN_NULL +PMC * +Parrot_pmc_getprops(PARROT_INTERP, ARGIN(PMC *pmc)) +{ + ASSERT_ARGS(Parrot_pmc_getprops) + if (PMC_IS_NULL(PMC_metadata(pmc))) { + if (has_pending_std_props(pmc)) + PMC_metadata(pmc) = make_prop_hash(interp, pmc); + else + return PMCNULL; + } + + return PMC_metadata(pmc); +} + +/* + +=item C + +Called from C. + +Returns a true value if C can avoid actually setting a property +in the prophash. If it returns true, the property setting will be reflected +in a future call to C + +=cut + +*/ + +PARROT_WARN_UNUSED_RESULT +static INTVAL +check_set_std_props(PARROT_INTERP, ARGMOD(PMC *pmc), ARGIN(const STRING *key), ARGMOD(PMC *value)) +{ + ASSERT_ARGS(check_set_std_props) + + /* + * s2 in STRING_equal is freed here + */ + if (STRING_equal(interp, key, CONST_STRING(interp, "_ro"))) { + /* pmc should set/clear readonly */ + const INTVAL on = VTABLE_get_bool(interp, value); + + /* morph to Const/normal class or readonly class */ + 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))) + VTABLE_morph(interp, pmc, interp->vtables[pmc->vtable->base_type - 1]->pmc_class); + else if (on && (pmc->vtable->flags & VTABLE_HAS_READONLY_FLAG)) + pmc->vtable = pmc->vtable->ro_variant_vtable; + else if (!on && (pmc->vtable->flags & VTABLE_IS_READONLY_FLAG) + && pmc->vtable->ro_variant_vtable) + pmc->vtable = pmc->vtable->ro_variant_vtable; + else + return 0; + + return 1; + } + + return 0; +} + +/* + +=item C + +Set pending standard properties in C. + +=cut + +*/ + +static void +propagate_std_props(PARROT_INTERP, ARGIN(PMC *self), ARGIN(PMC *prop_hash)) +{ + ASSERT_ARGS(propagate_std_props) + + if (self->vtable->flags & (VTABLE_IS_CONST_FLAG | VTABLE_IS_READONLY_FLAG)){ + PMC * const pmc_true = Parrot_pmc_new_init_int(interp, + enum_class_Integer, 1); + VTABLE_set_pmc_keyed_str(interp, prop_hash, CONST_STRING(interp, "_ro"), pmc_true); + } +} + +/* + +=item C + +Returns true if propagate_std_props() would create a non-empty prophash. + +=cut + +*/ + +PARROT_WARN_UNUSED_RESULT +static INTVAL +has_pending_std_props(ARGIN(const PMC *self)) +{ + ASSERT_ARGS(has_pending_std_props) + + if (self->vtable->flags & (VTABLE_IS_CONST_FLAG | VTABLE_IS_READONLY_FLAG)) + return 1; + else + return 0; +} + + +/* + +=item C + +Checks if we can infer the value of C property from C without +looking at its prophash. Returns C if not, returns the value otherwise. + +=cut +*/ + +PARROT_WARN_UNUSED_RESULT +PARROT_CAN_RETURN_NULL +static PMC* +check_get_std_props(PARROT_INTERP, ARGIN(const PMC *self), ARGIN(const STRING *key)) +{ + ASSERT_ARGS(check_get_std_props) + + if ((self->vtable->flags & (VTABLE_IS_CONST_FLAG | VTABLE_IS_READONLY_FLAG)) + && STRING_equal(interp, key, CONST_STRING(interp, "_ro"))) { + PMC * const ret_val = Parrot_pmc_new_init_int(interp, + enum_class_Integer, 1); + return ret_val; + } + else + return PMCNULL; +} + +/* + +=item C + +Create a property hash for C. Returns the created hash. Inferred +properties will be added to the hash. + +=cut + +*/ + +PARROT_CANNOT_RETURN_NULL +PARROT_WARN_UNUSED_RESULT +static PMC* +make_prop_hash(PARROT_INTERP, ARGMOD(PMC *self)) +{ + ASSERT_ARGS(make_prop_hash) + + PMC * const prop = Parrot_pmc_new(interp, enum_class_Hash); + + propagate_std_props(interp, self, prop); + PARROT_GC_WRITE_BARRIER(interp, self); + return prop; +} + /* =back diff --git a/src/pmc/alarm.pmc b/src/pmc/alarm.pmc new file mode 100644 index 0000000000..72ccd0b5e5 --- /dev/null +++ b/src/pmc/alarm.pmc @@ -0,0 +1,227 @@ +/* +Copyright (C) 2001-2008, Parrot Foundation. +$Id$ + +=head1 NAME + +src/pmc/alarm.pmc - Alarm + +=head1 SYNOPSIS + + .include 'alarm.pasm' + + new P0, 'Alarm' + set P0[.PARROT_ALARM_TIME], N_time # A FLOATVAL + set P0[.PARROT_ALARM_SUB], P_sub # set handler sub PMC + invoke P0 # schedule the alarm + +=head1 DESCRIPTION + +Sometime after N_time, P_sub will be called exactly once. + +=head2 Functions + +=over 4 + +=cut + +*/ + +#include "parrot/scheduler_private.h" + +/* HEADERIZER HFILE: none */ +/* HEADERIZER BEGIN: static */ +/* HEADERIZER END: static */ + +pmclass Alarm provides invokable auto_attrs { + ATTR FLOATVAL alarm_time; + ATTR PMC *alarm_task; + +/* + +=item C + +Initializes the alarm. + +=cut + +*/ + + VTABLE void init() { + Parrot_Alarm_attributes *data = PARROT_ALARM(SELF); + data->alarm_time = 0.0; + data->alarm_task = PMCNULL; + + PObj_custom_mark_SET(SELF); + } + +/* + +=item C + +Create a copy of the alarm. + +=cut + +*/ + + VTABLE PMC *clone() { + PMC *copy = Parrot_pmc_new(INTERP, SELF->vtable->base_type); + + Parrot_Alarm_attributes *new_struct = PARROT_ALARM(copy); + Parrot_Alarm_attributes *old_struct = PARROT_ALARM(SELF); + + new_struct->alarm_time = old_struct->alarm_time; + new_struct->alarm_task = old_struct->alarm_task; + + return copy; + } + +/* + +=item C + +Returns the PMC associated with C. + +=cut + +*/ + + VTABLE PMC *get_pmc_keyed_int(INTVAL key) { + if (key == PARROT_ALARM_TASK) { + const Parrot_Alarm_attributes * const data = PARROT_ALARM(SELF); + return data->alarm_task; + } + + return PMCNULL; + } + +/* + +=item C + +Returns the number associated with C. + +=cut + +*/ + + VTABLE FLOATVAL get_number_keyed_int(INTVAL key) { + if (key == PARROT_ALARM_TIME) { + const Parrot_Alarm_attributes * const data = PARROT_ALARM(SELF); + return data->alarm_time; + } + + return 0.0; + } + +/* + +=item C + +Having the alarm numify to the time is convienient for sorting. + +=cut + +*/ + + VTABLE FLOATVAL get_number() { + const Parrot_Alarm_attributes * const data = PARROT_ALARM(SELF); + return data->alarm_time; + } + +/* + +=item C + +Sets the PMC associated with C to C<*value>. + +=cut + +*/ + + VTABLE void set_pmc_keyed_int(INTVAL key, PMC *value) { + if (key == PARROT_ALARM_TASK) { + SET_ATTR_alarm_task(INTERP, SELF, value); + } + } + +/* + +=item C + +Schedules the alarm and adds it to the alarm queue. + +=cut + +*/ + + VTABLE opcode_t *invoke(void *next) { + Parrot_cx_schedule_alarm(INTERP, SELF); + return (opcode_t *)next; + } + +/* + +=item C + +Sets the floating-point value associated with C to C. + +=cut + +*/ + + VTABLE void set_number_keyed_int(INTVAL key, FLOATVAL value) { + if (key == PARROT_ALARM_TIME) { + SET_ATTR_alarm_time(INTERP, SELF, value); + } + } + +/* + +Required functions for GC and Freeze / Thaw. + +*/ + + VTABLE void mark() { + PMC *sub; + GET_ATTR_alarm_task(INTERP, SELF, sub); + Parrot_gc_mark_PMC_alive(INTERP, sub); + } + + VTABLE void visit(PMC *info) { + PMC *sub; + GET_ATTR_alarm_task(INTERP, SELF, sub); + VISIT_PMC(INTERP, info, sub); + SUPER(info); + } + + VTABLE void freeze(PMC *info) { + SUPER(info); + VTABLE_push_integer(INTERP, info, VTABLE_elements(INTERP, SELF)); + } + + VTABLE void thaw(PMC *info) { + SUPER(info); + SELF.set_integer_native(VTABLE_shift_integer(INTERP, info)); + } +} + + + + + +/* + +=back + +=cut + +*/ + +/* + * Local variables: + * c-file-style: "parrot" + * End: + * vim: expandtab shiftwidth=4 cinoptions='\:2=2' : + */ diff --git a/src/pmc/arrayiterator.pmc b/src/pmc/arrayiterator.pmc index f509d0057a..ccb937e6aa 100644 --- a/src/pmc/arrayiterator.pmc +++ b/src/pmc/arrayiterator.pmc @@ -63,7 +63,7 @@ static void out_of_bounds(PARROT_INTERP) /* Don't modify between HEADERIZER BEGIN / HEADERIZER END. Your changes will be lost. */ /* HEADERIZER END: static */ -pmclass ArrayIterator extends Iterator no_ro auto_attrs { +pmclass ArrayIterator extends Iterator provides 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 */ diff --git a/src/pmc/bytebuffer.pmc b/src/pmc/bytebuffer.pmc index 0b453e94ba..f3ea9881c3 100644 --- a/src/pmc/bytebuffer.pmc +++ b/src/pmc/bytebuffer.pmc @@ -27,12 +27,25 @@ static STRING * build_string(PARROT_INTERP, __attribute__nonnull__(1) __attribute__nonnull__(4); +PARROT_CANNOT_RETURN_NULL +PARROT_WARN_UNUSED_RESULT +static STRING * build_string_from_string(PARROT_INTERP, + ARGIN_NULLOK(STRING *from), + INTVAL pos, + INTVAL size, + ARGIN(const STR_VTABLE *encoding)) + __attribute__nonnull__(1) + __attribute__nonnull__(5); + PARROT_WARN_UNUSED_RESULT static INTVAL grow_to(INTVAL position); #define ASSERT_ARGS_build_string __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ PARROT_ASSERT_ARG(interp) \ , PARROT_ASSERT_ARG(encoding)) +#define ASSERT_ARGS_build_string_from_string __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ + PARROT_ASSERT_ARG(interp) \ + , PARROT_ASSERT_ARG(encoding)) #define ASSERT_ARGS_grow_to __attribute__unused__ int _ASSERT_ARGS_CHECK = (0) /* Don't modify between HEADERIZER BEGIN / HEADERIZER END. Your changes will be lost. */ /* HEADERIZER END: static */ @@ -196,7 +209,6 @@ Reset the buffer with the content of the string. } SET_ATTR_source(INTERP, SELF, new_string); SET_ATTR_size(INTERP, SELF, Parrot_str_byte_length(INTERP, new_string)); - SET_ATTR_content(INTERP, SELF, (unsigned char *)new_string->strstart); } /* @@ -211,10 +223,21 @@ Get the value of the byte at position or 0 if out of bounds. VTABLE INTVAL get_integer_keyed_int(INTVAL position) { INTVAL size; - unsigned char *content; GET_ATTR_size(INTERP, SELF, size); - GET_ATTR_content(INTERP, SELF, content); - return (position >= 0 && position < size) ? content[position] : (INTVAL) 0; + if (position < 0 || position >= size) + return 0; + else { + unsigned char *content; + GET_ATTR_content(INTERP, SELF, content); + if (content == NULL) { + STRING *source; + GET_ATTR_source(INTERP, SELF, source); + if (STRING_IS_NULL(source)) + return 0; + content = (unsigned char*)source->strstart; + } + return content[position]; + } } /* @@ -301,6 +324,12 @@ Return a pointer to the content. Use with care. VTABLE void *get_pointer() { unsigned char *content; GET_ATTR_content(INTERP, SELF, content); + if (content == NULL) { + STRING *source; + GET_ATTR_source(INTERP, SELF, source); + if (! STRING_IS_NULL(source)) + content = (unsigned char*)source->strstart; + } return (void *)content; } @@ -341,7 +370,13 @@ Create a string with the buffer content and the encoding specified. const STR_VTABLE *encoding = Parrot_find_encoding_by_string(INTERP, encodingname); GET_ATTR_content(INTERP, SELF, content); GET_ATTR_size(INTERP, SELF, size); - result = build_string(INTERP, content, size, encoding); + if (content == NULL) { + STRING *source; + GET_ATTR_source(INTERP, SELF, source); + result = build_string_from_string(interp, source, 0, size, encoding); + } + else + result = build_string(INTERP, content, size, encoding); RETURN(STRING *result); } @@ -364,7 +399,13 @@ as the string argument. STRING_IS_NULL(as) ? Parrot_default_encoding_ptr : as->encoding; GET_ATTR_content(INTERP, SELF, content); GET_ATTR_size(INTERP, SELF, size); - result = build_string(INTERP, content, size, encoding); + if (content == NULL) { + STRING *source; + GET_ATTR_source(INTERP, SELF, source); + result = build_string_from_string(interp, source, 0, size, encoding); + } + else + result = build_string(INTERP, content, size, encoding); RETURN(STRING *result); } @@ -394,6 +435,12 @@ length in codepoints. EXCEPTION_OUT_OF_BOUNDS, "get_chars: index out of bounds"); + if (content == NULL) { + STRING *source; + GET_ATTR_source(INTERP, SELF, source); + if (! STRING_IS_NULL(source)) + content = (unsigned char*)source->strstart; + } result = Parrot_str_extract_chars(INTERP, (char *)content + pos, size - pos, length, encoding); RETURN(STRING *result); @@ -419,6 +466,11 @@ decrease the number of reallocations. Build a string from the buffer content with the encoding specified. +=item C + +Build a string from part of a string content with the encoding specified. + =cut */ @@ -454,6 +506,26 @@ build_string(PARROT_INTERP, ARGIN_NULLOK(const unsigned char *content), } } +PARROT_CANNOT_RETURN_NULL +PARROT_WARN_UNUSED_RESULT +static STRING * +build_string_from_string(PARROT_INTERP, ARGIN_NULLOK(STRING *from), + INTVAL pos, INTVAL size, ARGIN(const STR_VTABLE *encoding)) +{ + ASSERT_ARGS(build_string_from_string) + STRING *result; + if (STRING_IS_NULL(from)) + result = Parrot_str_new_init(interp, NULL, 0, encoding, 0); + else { + result = Parrot_str_new_noinit(interp, size); + memcpy(result->strstart, from->strstart + pos, size); + result->bufused = size; + result->encoding = encoding; + encoding->scan(interp, result); + } + return result; +} + /* =back diff --git a/src/pmc/callback.pmc b/src/pmc/callback.pmc new file mode 100644 index 0000000000..07537d2377 --- /dev/null +++ b/src/pmc/callback.pmc @@ -0,0 +1,66 @@ +/* +Copyright (C) 2010, Parrot Foundation. +$Id$ + +=head1 NAME + +src/pmc/callback.pmc - Callback + +=head1 SYNOPSIS + +Callback PMCs are generated by the NCI interface when asynchronous callbacks +occur and are scheduled as tasks by the task scheduler. + +=head2 Functions + +=over 4 + +=cut + +*/ + +#include "parrot/scheduler_private.h" + +/* HEADERIZER HFILE: none */ +/* HEADERIZER BEGIN: static */ +/* HEADERIZER END: static */ + +pmclass Callback extends Task provides invokable auto_attrs { + ATTR PMC *user_data; + ATTR PMC *external_data; + +/* + +=item C + +Actually run the callback. + +=cut + +*/ + + VTABLE opcode_t *invoke(void *next) { + Parrot_Callback_attributes *cb_data = PARROT_CALLBACK(SELF); + PMC *user_data = cb_data->user_data; + PMC *ext_data = cb_data->external_data; + + Parrot_run_callback(INTERP, user_data, ext_data); + + return (opcode_t*) next; + } +} + +/* + +=back + +=cut + +*/ + +/* + * Local variables: + * c-file-style: "parrot" + * End: + * vim: expandtab shiftwidth=4 cinoptions='\:2=2' : + */ diff --git a/src/pmc/callcontext.pmc b/src/pmc/callcontext.pmc index ee5b78ef79..32e1d3f116 100644 --- a/src/pmc/callcontext.pmc +++ b/src/pmc/callcontext.pmc @@ -327,7 +327,7 @@ autobox_string(PARROT_INTERP, ARGIN(const Pcc_cell *cell)) } /* exception */ - return NULL; + return STRINGNULL; } /* @@ -519,7 +519,6 @@ pmclass CallContext provides array provides hash auto_attrs { /* 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 opcode_t *current_pc; /* program counter of Sub invocation */ ATTR PMC *current_sig; /* temporary CallContext PMC for active call */ @@ -547,6 +546,8 @@ pmclass CallContext provides array provides hash auto_attrs { ATTR PMC *return_flags; /* Integer array of return flags */ ATTR Hash *hash; /* Hash of named arguments */ + ATTR PMC *continuation; /* Reusable continuation */ + /* =item C @@ -620,15 +621,16 @@ Mark any referenced strings and PMCs. 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_current_sig(INTERP, SELF, tmp); Parrot_gc_mark_PMC_alive(INTERP, tmp); + /* We don't keep reusable continuation alive. It will keep too many + other things alive as well. Just NULL it */ + SET_ATTR_continuation(INTERP, SELF, PMCNULL); + GET_ATTR_n_regs_used(INTERP, SELF, n_regs_used); if (n_regs_used) { @@ -944,10 +946,6 @@ return list of ExceptioHandlers return current Continuation -=item current_object - -return current Object (if in method call) - =item current_namespace return current Namespace @@ -978,8 +976,6 @@ return current Namespace GET_ATTR_current_sub(INTERP, SELF, value); else if (STRING_equal(INTERP, key, CONST_STRING(INTERP, "current_cont"))) GET_ATTR_current_cont(INTERP, SELF, value); - else if (STRING_equal(INTERP, key, CONST_STRING(INTERP, "current_object"))) - GET_ATTR_current_object(INTERP, SELF, value); else if (STRING_equal(INTERP, key, CONST_STRING(INTERP, "current_namespace"))) GET_ATTR_current_namespace(INTERP, SELF, value); else if (STRING_equal(INTERP, key, CONST_STRING(INTERP, "handlers"))) @@ -1146,7 +1142,13 @@ return current Namespace return 0; GET_ATTR_positionals(INTERP, SELF, cells); - return autobox_intval(INTERP, &cells[key]); + { + const Pcc_cell *cell = &cells[key]; + if (CELL_TYPE_MASK(cell) == INTCELL) + return CELL_INT(cell); + + return autobox_intval(INTERP, cell); + } } VTABLE FLOATVAL get_number_keyed_int(INTVAL key) { @@ -1167,7 +1169,7 @@ return current Namespace GET_ATTR_num_positionals(INTERP, SELF, num_pos); if (key >= num_pos || key < 0) - return NULL; + return STRINGNULL; GET_ATTR_positionals(INTERP, SELF, cells); return autobox_string(INTERP, &cells[key]); @@ -1352,8 +1354,12 @@ return current Namespace void * const k = Parrot_hash_key_from_string(INTERP, hash, key); Pcc_cell * const cell = (Pcc_cell *)Parrot_hash_get(INTERP, hash, k); - if (cell) + if (cell) { + if (CELL_TYPE_MASK(cell) == INTCELL) + return CELL_INT(cell); + return autobox_intval(INTERP, cell); + } } return 0; @@ -1387,7 +1393,7 @@ return current Namespace return autobox_string(INTERP, cell); } - return NULL; + return STRINGNULL; } VTABLE PMC * get_pmc_keyed_str(STRING *key) { @@ -1417,8 +1423,11 @@ return current Namespace void * const k = Parrot_hash_key_from_pmc(INTERP, hash, key); Pcc_cell * const cell = (Pcc_cell *)Parrot_hash_get(INTERP, hash, k); - if (cell) + if (cell) { + if (CELL_TYPE_MASK(cell) == INTCELL) + return CELL_INT(cell); return autobox_intval(INTERP, cell); + } } return 0; @@ -1451,7 +1460,7 @@ return current Namespace return autobox_string(INTERP, cell); } - return NULL; + return STRINGNULL; } VTABLE PMC * get_pmc_keyed(PMC *key) { diff --git a/src/pmc/class.pmc b/src/pmc/class.pmc index eb292a427f..76ca4064cd 100644 --- a/src/pmc/class.pmc +++ b/src/pmc/class.pmc @@ -239,7 +239,8 @@ build_attrib_index(PARROT_INTERP, ARGIN(PMC *self)) Parrot_Class_attributes * const _class = PARROT_CLASS(self); int cur_index = 0; PMC * const attrib_index = Parrot_pmc_new(interp, enum_class_Hash); - PMC * const cache = Parrot_pmc_new(interp, enum_class_Hash); + PMC * const cache = Parrot_pmc_new_init_int(interp, + enum_class_Hash, enum_type_INTVAL); const int num_classes = VTABLE_elements(interp, _class->all_parents); int i; @@ -1081,7 +1082,7 @@ String PMC containing the name of the class =item namespace -NameSpace PMC of the the namespace attached to the class. +NameSpace PMC of the namespace attached to the class. =item attributes @@ -1361,7 +1362,9 @@ Creates a new PMC object of the type of the class and calls init(). Parrot_Object_attributes * const objattr = PMC_data_typed(object, Parrot_Object_attributes *); objattr->_class = SELF; - objattr->attrib_store = Parrot_pmc_new(INTERP, enum_class_ResizablePMCArray); + objattr->attrib_store = + Parrot_pmc_new_init_int(INTERP, enum_class_ResizablePMCArray, + VTABLE_elements(INTERP, _class->attrib_index)); PARROT_GC_WRITE_BARRIER(INTERP, object); } @@ -1590,6 +1593,11 @@ Returns whether the class does the given C<*role>. return VTABLE_isa_pmc(INTERP, SELF, role); } + VTABLE INTVAL is_equal(PMC * p) + { + return p == SELF; + } + /* =item C diff --git a/src/pmc/continuation.pmc b/src/pmc/continuation.pmc index c4ce9b7fad..0f0d06b004 100644 --- a/src/pmc/continuation.pmc +++ b/src/pmc/continuation.pmc @@ -285,6 +285,7 @@ destination to continue execution. GET_ATTR_seg(INTERP, SELF, seg); GET_ATTR_address(INTERP, SELF, pc); + SET_ATTR_invoked(INTERP, SELF, 1); Parrot_sub_continuation_check(INTERP, SELF); Parrot_sub_continuation_rewind_environment(INTERP, SELF); @@ -314,7 +315,7 @@ Experimental: returns caller info as a STRING. PMC *to_ctx; GET_ATTR_to_ctx(INTERP, SELF, to_ctx); - return Parrot_sub_Context_infostr(INTERP, to_ctx); + return Parrot_sub_Context_infostr(INTERP, to_ctx, 0); } @@ -369,7 +370,7 @@ Experimental: return callers PMC or PMCNULL if none. =item C -Experimental: returns continuation PMC of this Continuation or PMCNULL if none. +Experimental: fetches the return continuation PMC of this Continuation or PMCNULL if none. =cut diff --git a/src/pmc/coroutine.pmc b/src/pmc/coroutine.pmc index d02a299718..e613528d13 100644 --- a/src/pmc/coroutine.pmc +++ b/src/pmc/coroutine.pmc @@ -158,7 +158,6 @@ Swaps the "context". PMC *ctx; opcode_t *dest; PackFile_ByteCode *wanted_seg; - opcode_t * const next_op = (opcode_t *)next; PMC * const signature = Parrot_pcc_get_signature(INTERP, CURRENT_CONTEXT(INTERP)); @@ -176,13 +175,10 @@ Swaps the "context". PMC *ctx = Parrot_pcc_get_signature(INTERP, caller_ctx); PMC *ccont = INTERP->current_cont; - if (ccont == NEED_CONTINUATION) { - ccont = pmc_new(INTERP, enum_class_Continuation); - VTABLE_set_pointer(INTERP, ccont, next_op); - } + PARROT_ASSERT(!PMC_IS_NULL(ccont)); if (PObj_get_FLAGS(ccont) & SUB_FLAG_TAILCALL) - Parrot_ex_throw_from_c_args(INTERP, NULL, CONTROL_ERROR, + Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_INVALID_OPERATION, "tail call to coroutine not allowed"); /* first time set current sub, cont, object */ @@ -202,7 +198,6 @@ Swaps the "context". Parrot_pcc_set_sub(INTERP, ctx, SELF); Parrot_pcc_set_continuation(INTERP, ctx, ccont); - Parrot_pcc_set_object(INTERP, ctx, PMCNULL); INTERP->current_cont = PMCNULL; @@ -259,7 +254,7 @@ Swaps the "context". GET_ATTR_yield(INTERP, SELF, yield); if (!yield) - Parrot_ex_throw_from_c_args(INTERP, NULL, CONTROL_ERROR, + Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_INVALID_OPERATION, "Cannot resume dead coroutine."); SET_ATTR_yield(INTERP, SELF, 0); @@ -282,7 +277,7 @@ Swaps the "context". 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, + Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_INVALID_OPERATION, "Cannot resume dead coroutine."); } diff --git a/src/pmc/default.pmc b/src/pmc/default.pmc index cd5a56f034..12f1826b8f 100644 --- a/src/pmc/default.pmc +++ b/src/pmc/default.pmc @@ -41,68 +41,12 @@ static void cant_do_write_method(PARROT_INTERP, int index) __attribute__nonnull__(1); -PARROT_WARN_UNUSED_RESULT -PARROT_CAN_RETURN_NULL -static PMC* check_get_std_props(PARROT_INTERP, - ARGIN(const PMC *self), - ARGIN(const STRING *key)) - __attribute__nonnull__(1) - __attribute__nonnull__(2) - __attribute__nonnull__(3); - -PARROT_WARN_UNUSED_RESULT -static INTVAL check_set_std_props(PARROT_INTERP, - ARGMOD(PMC *pmc), - ARGIN(const STRING *key), - ARGIN(PMC *value)) - __attribute__nonnull__(1) - __attribute__nonnull__(2) - __attribute__nonnull__(3) - __attribute__nonnull__(4) - FUNC_MODIFIES(*pmc); - -PARROT_WARN_UNUSED_RESULT -static INTVAL has_pending_std_props(ARGIN(const PMC *self)) - __attribute__nonnull__(1); - -PARROT_CANNOT_RETURN_NULL -PARROT_WARN_UNUSED_RESULT -static PMC* make_prop_hash(PARROT_INTERP, ARGMOD(PMC *self)) - __attribute__nonnull__(1) - __attribute__nonnull__(2) - FUNC_MODIFIES(*self); - -static void propagate_std_props(PARROT_INTERP, - ARGIN(PMC *self), - ARGIN(PMC *prop_hash)) - __attribute__nonnull__(1) - __attribute__nonnull__(2) - __attribute__nonnull__(3); - #define ASSERT_ARGS_caller __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ PARROT_ASSERT_ARG(interp)) #define ASSERT_ARGS_cant_do_method __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ PARROT_ASSERT_ARG(interp)) #define ASSERT_ARGS_cant_do_write_method __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ PARROT_ASSERT_ARG(interp)) -#define ASSERT_ARGS_check_get_std_props __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ - PARROT_ASSERT_ARG(interp) \ - , PARROT_ASSERT_ARG(self) \ - , PARROT_ASSERT_ARG(key)) -#define ASSERT_ARGS_check_set_std_props __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ - PARROT_ASSERT_ARG(interp) \ - , PARROT_ASSERT_ARG(pmc) \ - , PARROT_ASSERT_ARG(key) \ - , PARROT_ASSERT_ARG(value)) -#define ASSERT_ARGS_has_pending_std_props __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ - PARROT_ASSERT_ARG(self)) -#define ASSERT_ARGS_make_prop_hash __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ - PARROT_ASSERT_ARG(interp) \ - , PARROT_ASSERT_ARG(self)) -#define ASSERT_ARGS_propagate_std_props __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ - PARROT_ASSERT_ARG(interp) \ - , PARROT_ASSERT_ARG(self) \ - , PARROT_ASSERT_ARG(prop_hash)) /* Don't modify between HEADERIZER BEGIN / HEADERIZER END. Your changes will be lost. */ /* HEADERIZER END: static */ @@ -175,154 +119,6 @@ cant_do_write_method(PARROT_INTERP, ARGIN_NULLOK(PMC *pmc), int index) caller(interp, pmc)); } -/* - -=item C - -Called from C. - -Returns a true value if C can avoid actually setting a property -in the prophash. If it returns true, the property setting will be reflected -in a future call to C - -=cut - -*/ - -PARROT_WARN_UNUSED_RESULT -static INTVAL -check_set_std_props(PARROT_INTERP, ARGMOD(PMC *pmc), ARGIN(const STRING *key), ARGIN(PMC *value)) -{ - ASSERT_ARGS(check_set_std_props) - - /* - * s2 in STRING_equal is freed here - */ - if (STRING_equal(interp, key, CONST_STRING(interp, "_ro"))) { - /* pmc should set/clear readonly */ - const INTVAL on = VTABLE_get_bool(interp, value); - - /* morph to Const/normal class or readonly class */ - 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))) - VTABLE_morph(interp, pmc, interp->vtables[pmc->vtable->base_type - 1]->pmc_class); - else if (on && (pmc->vtable->flags & VTABLE_HAS_READONLY_FLAG)) - pmc->vtable = pmc->vtable->ro_variant_vtable; - else if (!on && (pmc->vtable->flags & VTABLE_IS_READONLY_FLAG) - && pmc->vtable->ro_variant_vtable) - pmc->vtable = pmc->vtable->ro_variant_vtable; - else - return 0; - - return 1; - } - - return 0; -} - -/* - -=item C - -Set pending standard properties in C. - -=cut - -*/ - -static void -propagate_std_props(PARROT_INTERP, ARGIN(PMC *self), ARGIN(PMC *prop_hash)) -{ - ASSERT_ARGS(propagate_std_props) - - if (self->vtable->flags & (VTABLE_IS_CONST_FLAG | VTABLE_IS_READONLY_FLAG)){ - PMC * const pmc_true = Parrot_pmc_new_init_int(interp, - enum_class_Integer, 1); - VTABLE_set_pmc_keyed_str(interp, prop_hash, CONST_STRING(interp, "_ro"), pmc_true); - } -} - -/* - -=item C - -Returns true if propagate_std_props() would create a non-empty prophash. - -=cut - -*/ - -PARROT_WARN_UNUSED_RESULT -static INTVAL -has_pending_std_props(ARGIN(const PMC *self)) -{ - ASSERT_ARGS(has_pending_std_props) - - if (self->vtable->flags & (VTABLE_IS_CONST_FLAG | VTABLE_IS_READONLY_FLAG)) - return 1; - else - return 0; -} - - -/* - -=item C - -Checks if we can infer the value of C property from C without -looking at its prophash. Returns C if not, returns the value otherwise. - -=cut -*/ - -PARROT_WARN_UNUSED_RESULT -PARROT_CAN_RETURN_NULL -static PMC* -check_get_std_props(PARROT_INTERP, ARGIN(const PMC *self), ARGIN(const STRING *key)) -{ - ASSERT_ARGS(check_get_std_props) - - if ((self->vtable->flags & (VTABLE_IS_CONST_FLAG | VTABLE_IS_READONLY_FLAG)) - && STRING_equal(interp, key, CONST_STRING(interp, "_ro"))) { - PMC * const ret_val = Parrot_pmc_new_init_int(interp, - enum_class_Integer, 1); - return ret_val; - } - else - return PMCNULL; -} - -/* - -=item C - -Create a property hash for C. Returns the created hash. Inferred -properties will be added to the hash. - -=cut - -*/ - -PARROT_CANNOT_RETURN_NULL -PARROT_WARN_UNUSED_RESULT -static PMC* -make_prop_hash(PARROT_INTERP, ARGMOD(PMC *self)) -{ - ASSERT_ARGS(make_prop_hash) - - PMC * const prop = PObj_constant_TEST(self) - ? Parrot_pmc_new_constant(interp, enum_class_Hash) - : Parrot_pmc_new(interp, enum_class_Hash); - - propagate_std_props(interp, self, prop); - PARROT_GC_WRITE_BARRIER(interp, self); - return prop; -} - pmclass default abstract { /* @@ -342,6 +138,8 @@ Does nothing. */ VTABLE void init() { + UNUSED(INTERP); + UNUSED(SELF); } /* @@ -391,6 +189,8 @@ Does nothing. */ VTABLE void destroy() { + UNUSED(INTERP); + UNUSED(SELF); } /* @@ -430,85 +230,12 @@ Panics with a "no custom mark routine defined" error message. */ VTABLE void mark() { + UNUSED(SELF); PANIC(INTERP, "custom_mark flag set but no custom mark routine defined"); } /* -=item C - -Returns the property for C<*key>. If no property is defined then the -NULL PMC is returned. - -=cut - -*/ - - VTABLE PMC *getprop(STRING *key) { - 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); - } - -/* - -=item C - -Sets the property for C<*key> to C<*value>. - -=cut - -*/ - - VTABLE void setprop(STRING *key, PMC *value) { - if (check_set_std_props(INTERP, SELF, key, value)) - return; - - if (PMC_IS_NULL(PMC_metadata(SELF))) - PMC_metadata(SELF) = make_prop_hash(INTERP, SELF); - - VTABLE_set_pmc_keyed_str(INTERP, PMC_metadata(SELF), key, value); - } - -/* - -=item C - -Deletes the property for C<*key>. - -=cut - -*/ - - VTABLE void delprop(STRING *key) { - if (!PMC_IS_NULL(PMC_metadata(SELF))) - VTABLE_delete_keyed_str(INTERP, PMC_metadata(SELF), key); - } - -/* - -=item C - -Returns the PMC's properties or the NULL PMC if no properties exist. - -=cut - -*/ - - VTABLE PMC *getprops() { - if (PMC_IS_NULL(PMC_metadata(SELF))) { - if (has_pending_std_props(SELF)) - PMC_metadata(SELF) = make_prop_hash(INTERP, SELF); - else - return PMCNULL; - } - - return PMC_metadata(SELF); - } - -/* - =item C Returns the PMC's type. @@ -518,6 +245,7 @@ Returns the PMC's type. */ VTABLE INTVAL type() { + UNUSED(INTERP); return SELF->vtable->base_type; } @@ -532,6 +260,7 @@ Returns the name of the PMC. */ VTABLE STRING *name() { + UNUSED(INTERP); return SELF->vtable->whoami; } @@ -548,6 +277,9 @@ Role-y. */ VTABLE void add_attribute(STRING *name, PMC *type) { + UNUSED(SELF); + UNUSED(name); + UNUSED(type); Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_INVALID_OPERATION, "Cannot add attribute to non-class"); } @@ -660,20 +392,6 @@ C with it. /* -=item C - -Returns the address of the PMC. - -=cut - -*/ - - VTABLE void *get_pointer() { - return SELF; - } - -/* - =item C Returns whether the PMC is the same PMC as C (whether they're the @@ -684,6 +402,7 @@ same pointer). */ VTABLE INTVAL is_same(PMC *value) { + UNUSED(INTERP); return SELF == value; } @@ -886,6 +605,8 @@ Returns true. */ VTABLE INTVAL defined() { + UNUSED(INTERP); + UNUSED(SELF); return 1; } @@ -963,7 +684,9 @@ Reports whether the PMC "does" the C. */ VTABLE INTVAL does_pmc(PMC *role) { - UNUSED(role) + UNUSED(INTERP); + UNUSED(SELF); + UNUSED(role); /* No C-level roles yet. */ return 0; } @@ -1119,7 +842,7 @@ Add class C to the list of our parents. */ VTABLE void add_parent(PMC *parent) { - UNUSED(parent) + UNUSED(parent); if (!PObj_is_class_TEST(SELF)) Parrot_ex_throw_from_c_args(INTERP, NULL, 1, "Only classes can be subclassed"); @@ -1139,6 +862,9 @@ Used by GC to mark the PMC. */ VTABLE void visit(PMC *info) { + UNUSED(INTERP); + UNUSED(SELF); + UNUSED(info); } /* @@ -1166,7 +892,9 @@ Does nothing. */ VTABLE void freeze(PMC *info) { - UNUSED(info) + UNUSED(INTERP); + UNUSED(SELF); + UNUSED(info); /* default - no action */ } @@ -1181,6 +909,8 @@ Initializes the PMC during unarchiving. */ VTABLE void thaw(PMC *info) { + UNUSED(INTERP); + UNUSED(info); /* default - initialize the PMC */ SELF.init(); } @@ -1196,7 +926,9 @@ Does nothing. */ VTABLE void thawfinish(PMC *info) { - UNUSED(info) + UNUSED(INTERP); + UNUSED(SELF); + UNUSED(info); /* default - no action */ } diff --git a/src/pmc/env.pmc b/src/pmc/env.pmc index 0d9b787d9a..8fe74d9b26 100644 --- a/src/pmc/env.pmc +++ b/src/pmc/env.pmc @@ -278,7 +278,7 @@ Returns whether the environment variable for C<*key> exists. =item C -Deletes the the environment variable for C<*key>. +Deletes the environment variable for C<*key>. =cut diff --git a/src/pmc/eval.pmc b/src/pmc/eval.pmc index 5a49ced726..ff27b8b2d8 100644 --- a/src/pmc/eval.pmc +++ b/src/pmc/eval.pmc @@ -53,7 +53,7 @@ Initializes a new empty Eval. =item C -Destroy the Eval and its asscociated bytecode. +Destroy the Eval and its associated bytecode. =item C @@ -88,7 +88,6 @@ Mark this Eval. * OTOH - if the global exists - this eval pmc ought * to be alive and destroy isn't called. */ - PackFile_Segment *seg; PackFile_ByteCode *cur_cs; Parrot_Sub_attributes *sub_data; @@ -157,7 +156,7 @@ Returns the address of the associated packfile. Parrot_Sub_attributes *sub; PMC_get_sub(INTERP, SELF, sub); if (sub) { - PackFile_ByteCode *seg = sub->seg; + const PackFile_ByteCode * const seg = sub->seg; if (seg) return seg->base.pf; } @@ -294,7 +293,7 @@ Unarchives the code. SUPER(info); pf = PackFile_new(INTERP, 0); - pfpmc = Parrot_pf_get_packfile_pmc(INTERP, pf); + pfpmc = Parrot_pf_get_packfile_pmc(INTERP, pf, STRINGNULL); if (!PackFile_unpack(INTERP, pf, (opcode_t *)packed->strstart, packed->strlen)) @@ -330,11 +329,11 @@ Unarchives the code. seg = sub->seg; if (seg) { - PackFile_ConstTable *const ct = seg->const_table; + const PackFile_ConstTable * const ct = seg->const_table; if (ct) { INTVAL i; STRING * const SUB = CONST_STRING(interp, "Sub"); - for (i = n = 0; i < ct->pmc.const_count; ++i) { + for (i = 0; i < ct->pmc.const_count; ++i) { PMC * const x = ct->pmc.constants[i]; if (VTABLE_isa(interp, x, SUB)) ++n; @@ -363,7 +362,7 @@ Return the main sub, if any, null PMC otherwise. METHOD get_main() { - PMC *mainsub = Parrot_pf_get_packfile_main_sub(INTERP, SELF); + PMC * const mainsub = Parrot_pf_get_packfile_main_sub(INTERP, SELF); RETURN(PMC * mainsub); } @@ -397,10 +396,10 @@ get_sub(PARROT_INTERP, ARGIN(PMC *self), int idx) seg = sub->seg; if (seg) { - PackFile_ConstTable * const ct = seg->const_table; + const PackFile_ConstTable * const ct = seg->const_table; if (ct) { - INTVAL i, n; - for (i = n = 0; i < ct->pmc.const_count; ++i) { + INTVAL i; + for (i = 0; i < ct->pmc.const_count; ++i) { STRING * const SUB = CONST_STRING(interp, "Sub"); PMC * const x = ct->pmc.constants[i]; if (VTABLE_isa(interp, x, SUB)) diff --git a/src/pmc/exception.pmc b/src/pmc/exception.pmc index a116c3e6b0..77926a43f8 100644 --- a/src/pmc/exception.pmc +++ b/src/pmc/exception.pmc @@ -62,8 +62,9 @@ typedef enum { attr_exit_code, attr_backtrace, attr_handled, - attr_handler_iter, + attr_handler, attr_handler_ctx, + attr_handlers_left, attr_thrower, attr_bt_strings, attr_NONE = -1 @@ -86,20 +87,21 @@ static AttrEnum getAttrEnum(PARROT_INTERP, ARGIN(const STRING *name)) pmclass Exception provides Exception auto_attrs { - ATTR INTVAL id; /* The task ID in the scheduler. */ - ATTR FLOATVAL birthtime; /* The creation time stamp of the exception. */ - ATTR STRING *message; /* The exception message. */ - ATTR PMC *payload; /* The payload for the exception. */ - ATTR PMC *resume; /* Continuation for resuming after handling the exception. */ - ATTR INTVAL severity; /* The severity of the exception. */ - ATTR INTVAL type; /* The type of the exception. */ - ATTR INTVAL exit_code; /* The exit code of the exception. */ - 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 PMC *handler_ctx; /* A stored context for handler iterator. */ - ATTR PMC *thrower; /* The position we were at when thrown. */ - ATTR PMC *bt_strings; /* A cache of old backtraces, for rethrows */ + ATTR INTVAL id; /* The task ID in the scheduler. */ + ATTR FLOATVAL birthtime; /* The creation time stamp of the exception. */ + ATTR STRING *message; /* The exception message. */ + ATTR PMC *payload; /* The payload for the exception. */ + ATTR PMC *resume; /* Continuation for resuming after exception handling. */ + ATTR INTVAL severity; /* The severity of the exception. */ + ATTR INTVAL type; /* The type of the exception. */ + ATTR INTVAL exit_code; /* The exit code of the exception. */ + ATTR PMC *backtrace; /* The backtrace of an exception. */ + ATTR INTVAL handled; /* Whether the exception has been handled. */ + ATTR PMC *handler; /* The last handler that caught us, for finalize. */ + ATTR PMC *handler_ctx; /* The context of the handler. */ + ATTR INTVAL handlers_left; /* Number of handlers left in the handler array. */ + ATTR PMC *thrower; /* The position we were at when thrown. */ + ATTR PMC *bt_strings; /* A cache of old backtraces, for rethrows. */ /* @@ -125,7 +127,7 @@ Initializes the exception with default values. SET_ATTR_resume(INTERP, SELF, PMCNULL); SET_ATTR_severity(INTERP, SELF, EXCEPT_error); SET_ATTR_backtrace(INTERP, SELF, PMCNULL); - SET_ATTR_handler_iter(INTERP, SELF, PMCNULL); + SET_ATTR_handler(INTERP, SELF, PMCNULL); SET_ATTR_handler_ctx(INTERP, SELF, PMCNULL); SET_ATTR_thrower(INTERP, SELF, PMCNULL); SET_ATTR_bt_strings(INTERP, SELF, PMCNULL); @@ -298,7 +300,7 @@ Mark any active exception data as live. 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); Parrot_gc_mark_PMC_alive(INTERP, core_struct->handler_ctx); Parrot_gc_mark_PMC_alive(INTERP, core_struct->thrower); Parrot_gc_mark_PMC_alive(INTERP, core_struct->bt_strings); @@ -403,6 +405,9 @@ Returns the integer value for C<*key>. case attr_handled: GET_ATTR_handled(INTERP, SELF, result); break; + case attr_handlers_left: + GET_ATTR_handlers_left(INTERP, SELF, result); + break; default: /* If unknown attribute name, throw an exception. */ Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_ATTRIB_NOT_FOUND, @@ -534,6 +539,9 @@ Sets the integer value for C<*key>. case attr_handled: SET_ATTR_handled(INTERP, SELF, value); break; + case attr_handlers_left: + SET_ATTR_handlers_left(INTERP, SELF, value); + break; default: /* If unknown attribute name, throw an exception. */ Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_ATTRIB_NOT_FOUND, @@ -701,8 +709,8 @@ Retrieve an attribute value for the exception object. case attr_backtrace: GET_ATTR_backtrace(INTERP, SELF, value); break; - case attr_handler_iter: - GET_ATTR_handler_iter(INTERP, SELF, value); + case attr_handler: + GET_ATTR_handler(INTERP, SELF, value); break; case attr_thrower: GET_ATTR_thrower(INTERP, SELF, value); @@ -773,8 +781,8 @@ Set an attribute value for the exception object. case attr_backtrace: SET_ATTR_backtrace(INTERP, SELF, value); break; - case attr_handler_iter: - SET_ATTR_handler_iter(INTERP, SELF, value); + case attr_handler: + SET_ATTR_handler(INTERP, SELF, value); break; case attr_thrower: SET_ATTR_thrower(INTERP, SELF, value); @@ -794,39 +802,6 @@ Set an attribute value for the exception object. /* -=item C - -Set this PMC as shared. - -=cut - -*/ - - VTABLE PMC *share_ro() { - PMC *shared_self; - Parrot_Exception_attributes *shared_struct; - - if (PObj_is_PMC_shared_TEST(SELF)) - return SELF; - - shared_self = pt_shared_fixup(INTERP, SELF); - shared_struct = PARROT_EXCEPTION(shared_self); - - if (!PMC_IS_NULL(shared_struct->payload)) - shared_struct->payload = pt_shared_fixup(INTERP, shared_struct->payload); - - if (!PMC_IS_NULL(shared_struct->backtrace)) - shared_struct->backtrace = pt_shared_fixup(INTERP, shared_struct->backtrace); - - if (!PMC_IS_NULL(shared_struct->handler_iter)) - shared_struct->handler_iter = pt_shared_fixup(INTERP, shared_struct->handler_iter); - - return shared_self; - } - - -/* - =item C Gets any bytecode annotations in force at the point where the exception was @@ -870,6 +845,13 @@ which holds the PMC representing the sub, and C 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. +=item C + +Return an array of strings representing a displayable backtrace. Each element +in the array is the backtrace at the time when the exception was thrown. +Rethrowing the exception adds a new entry. The first item in the list is the +most recent throw of the Exception. + =cut */ @@ -907,7 +889,7 @@ sub, or for the point of the call a level deeper for the rest. GET_ATTR_bt_strings(INTERP, SELF, bt_strings); if (PMC_IS_NULL(bt_strings)) bt_strings = Parrot_pmc_new(INTERP, enum_class_ResizablePMCArray); - VTABLE_unshift_string(INTERP, bt_strings, bt); + VTABLE_push_string(INTERP, bt_strings, bt); RETURN(PMC *bt_strings); } @@ -960,10 +942,12 @@ getAttrEnum(PARROT_INTERP, ARGIN(const STRING *name)) r = attr_backtrace; else if (STRING_equal(interp, name, CONST_STRING(interp, "handled"))) r = attr_handled; - else if (STRING_equal(interp, name, CONST_STRING(interp, "handler_iter"))) - r = attr_handler_iter; + else if (STRING_equal(interp, name, CONST_STRING(interp, "handler"))) + r = attr_handler; else if (STRING_equal(interp, name, CONST_STRING(interp, "handler_ctx"))) r = attr_handler_ctx; + else if (STRING_equal(interp, name, CONST_STRING(interp, "handlers_left"))) + r = attr_handlers_left; else if (STRING_equal(interp, name, CONST_STRING(interp, "thrower"))) r = attr_thrower; else if (STRING_equal(interp, name, CONST_STRING(interp, "bt_strings"))) diff --git a/src/pmc/exceptionhandler.pmc b/src/pmc/exceptionhandler.pmc index 1a8b7face7..a258943ff1 100644 --- a/src/pmc/exceptionhandler.pmc +++ b/src/pmc/exceptionhandler.pmc @@ -20,6 +20,7 @@ exception object's C<_P5> attribute. */ #include "parrot/oplib/ops.h" +#include "pmc/pmc_exception.h" /* HEADERIZER HFILE: none */ /* HEADERIZER BEGIN: static */ @@ -70,6 +71,44 @@ Initializes the exception handler with one handled type. VTABLE_set_integer_keyed_int(INTERP, attrs->handled_types, 0, handledtype); } + +/* + +=item C + +Initializes the exception handler with one handled type. If the argument +is a key, intitialize it with the key contents. + +=cut + +*/ + + VTABLE void init_pmc(PMC *handledtype) { + Parrot_ExceptionHandler_attributes * const attrs = PARROT_EXCEPTIONHANDLER(SELF); + SELF.init(); + if (handledtype->vtable->base_type == enum_class_Key) { + PMC *key; + /* check if the key only consists of integers */ + for (key = handledtype; key; key = Parrot_key_next(INTERP, key)) + if ((PObj_get_FLAGS(key) & KEY_type_FLAGS) != KEY_integer_FLAG) + break; + if (!key) { + /* yes, directly use the key */ + attrs->handled_types = handledtype; + return; + } + /* no, create a RPA from the key */ + attrs->handled_types = Parrot_pmc_new(interp, enum_class_ResizablePMCArray); + for (key = handledtype; key; key = Parrot_key_next(INTERP, key)) + VTABLE_push_integer(interp, attrs->handled_types, Parrot_key_integer(INTERP, key)); + } + else { + INTVAL type = VTABLE_get_integer(INTERP, handledtype); + attrs->handled_types = Parrot_pmc_new_init_int(INTERP, enum_class_FixedIntegerArray, 1); + VTABLE_set_integer_keyed_int(INTERP, attrs->handled_types, 0, type); + } + } + /* =item C @@ -199,38 +238,63 @@ Report whether the exception handler can handle a particular type of exception. */ METHOD can_handle(PMC *exception) { - STRING * const sev = CONST_STRING(INTERP, "severity"); STRING * const ex_str = CONST_STRING(INTERP, "Exception"); - INTVAL severity = VTABLE_get_integer_keyed_str(INTERP, exception, sev); - /* We handle Exception and anything that claims to implement that role here. Include the base_type check as a sort of optimization */ if (exception->vtable->base_type == enum_class_Exception || VTABLE_isa(INTERP, exception, ex_str)) { + INTVAL severity; PMC *handled_types; PMC *handled_types_except; INTVAL min_severity, max_severity; GET_ATTR_max_severity(INTERP, SELF, max_severity); GET_ATTR_min_severity(INTERP, SELF, min_severity); + if (exception->vtable->base_type == enum_class_Exception) + GETATTR_Exception_severity(INTERP, exception, severity); + else { + STRING * const severity_str = CONST_STRING(INTERP, "severity"); + severity = VTABLE_get_integer_keyed_str(INTERP, exception, severity_str); + } + if (severity < min_severity) { RETURN(INTVAL 0); } if (max_severity > 0 && severity > max_severity) { RETURN(INTVAL 0); } + GET_ATTR_handled_types(INTERP, SELF, handled_types); if (! PMC_IS_NULL(handled_types)) { - const INTVAL elems = VTABLE_elements(INTERP, handled_types); - const INTVAL type = VTABLE_get_integer_keyed_str(INTERP, exception, CONST_STRING(INTERP, "type")); - INTVAL i; + INTVAL type; - for (i = 0; i < elems; ++i) { - const INTVAL handled_type = - VTABLE_get_integer_keyed_int(INTERP, handled_types, i); - if (handled_type == type) - RETURN(INTVAL 1); + if (exception->vtable->base_type == enum_class_Exception) + GETATTR_Exception_type(INTERP, exception, type); + else { + STRING * const type_str = CONST_STRING(INTERP, "type"); + type = VTABLE_get_integer_keyed_str(INTERP, exception, type_str); + } + if (handled_types->vtable->base_type == enum_class_Key) { + PMC *key = handled_types; + for (; key; key = Parrot_key_next(INTERP, key)) { + const INTVAL handled_type = Parrot_key_integer(INTERP, key); + if (handled_type == type || + handled_type == (type | EXCEPTION_TYPE_ALL_MASK)) + RETURN(INTVAL 1); + } + } + else { + const INTVAL elems = VTABLE_elements(INTERP, handled_types); + INTVAL i; + + for (i = 0; i < elems; ++i) { + const INTVAL handled_type = + VTABLE_get_integer_keyed_int(INTERP, handled_types, i); + if (handled_type == type || + handled_type == (type | EXCEPTION_TYPE_ALL_MASK)) + RETURN(INTVAL 1); + } } RETURN(INTVAL 0); @@ -238,13 +302,19 @@ Report whether the exception handler can handle a particular type of exception. GET_ATTR_handled_types_except(INTERP, SELF, handled_types_except); if (! PMC_IS_NULL(handled_types_except)) { const INTVAL elems = VTABLE_elements(INTERP, handled_types_except); - const INTVAL type = VTABLE_get_integer_keyed_str(INTERP, exception, CONST_STRING(INTERP, "type")); - INTVAL i; + INTVAL i, type; + + if (exception->vtable->base_type == enum_class_Exception) + GETATTR_Exception_type(INTERP, exception, type); + else { + STRING * const type_str = CONST_STRING(INTERP, "type"); + type = VTABLE_get_integer_keyed_str(INTERP, exception, type_str); + } for (i = 0; i < elems; ++i) { const INTVAL handled_type = VTABLE_get_integer_keyed_int(INTERP, handled_types_except, i); - if (handled_type == type) + if (handled_type == type || handled_type == (type | EXCEPTION_TYPE_ALL_MASK)) RETURN(INTVAL 0); } } diff --git a/src/pmc/filehandle.pmc b/src/pmc/filehandle.pmc index e6c75f575c..19719e2827 100644 --- a/src/pmc/filehandle.pmc +++ b/src/pmc/filehandle.pmc @@ -543,26 +543,11 @@ Print the passed in integer, number, string, or PMC to the filehandle. METHOD print(PMC *to_print) { STRING * const string_to_print = VTABLE_get_string(INTERP, to_print); - Parrot_io_putps(INTERP, SELF, string_to_print); - } - - -/* - -=item C - -Print the string to the filehandle. - -=cut - -*/ + const INTVAL status = Parrot_io_putps(INTERP, SELF, string_to_print); - METHOD puts(STRING *to_print) { - const INTVAL status = Parrot_io_putps(INTERP, SELF, to_print); RETURN(INTVAL status); } - /* =item C @@ -695,6 +680,23 @@ in the file. RETURN(INTVAL flags); } + +/* + +=item C + +Returns the INTVAL used by the OS to identify this filehandle. + +=cut + +*/ + + METHOD handle() { + INTVAL handle; + GET_ATTR_os_handle(INTERP, SELF, handle); + RETURN(INTVAL handle); + } + /* =item C @@ -775,12 +777,35 @@ Returns the next byte from the stream, but does not remove it. /* +=item C + +=cut + +*/ + METHOD setasync() { + Parrot_io_async(INTERP, SELF, 1); + } + +/* + +=item C + +=cut + +*/ + METHOD setblocking() { + Parrot_io_async(INTERP, SELF, 0); + } + +/* + =back =cut */ + } /* end pmclass */ /* diff --git a/src/pmc/fixedbooleanarray.pmc b/src/pmc/fixedbooleanarray.pmc index 42d4853863..cb358c0da5 100644 --- a/src/pmc/fixedbooleanarray.pmc +++ b/src/pmc/fixedbooleanarray.pmc @@ -143,7 +143,7 @@ Creates and returns a copy of the array. SET_ATTR_resize_threshold(INTERP, dest, resize_threshold); clone_bit_array = mem_gc_allocate_n_typed(INTERP, size_in_bytes, unsigned char); - mem_sys_memcopy(clone_bit_array, my_bit_array, size_in_bytes); + memcpy(clone_bit_array, my_bit_array, size_in_bytes); SET_ATTR_bit_array(INTERP, dest, clone_bit_array); } diff --git a/src/pmc/fixedfloatarray.pmc b/src/pmc/fixedfloatarray.pmc index 574367aae9..12a04c07fd 100644 --- a/src/pmc/fixedfloatarray.pmc +++ b/src/pmc/fixedfloatarray.pmc @@ -466,6 +466,69 @@ C. SELF.set_pmc_keyed_int(k, value); } +/* + +=item C + +=item C + +Returns the Parrot string representation C + +=cut + +*/ + + VTABLE STRING *get_string() { + return STATICSELF.get_repr(); + } + + VTABLE STRING *get_repr() { + STRING *str = CONST_STRING(INTERP, "[ "); + STRING *comma = CONST_STRING(INTERP, ", "); + UINTVAL i; + const UINTVAL elems = SELF.elements(); + + if (elems > 0) + str = Parrot_str_concat(INTERP, str, + SELF.get_string_keyed_int(0)); + + for (i = 1; i < elems; ++i) { + str = Parrot_str_concat(INTERP, str, comma); + str = Parrot_str_concat(INTERP, str, + SELF.get_string_keyed_int((INTVAL)i)); + } + + str = Parrot_str_concat(INTERP, str, CONST_STRING(INTERP, " ]")); + return str; + } + +/* + +=item C + +Reverse the contents of the array. + +=cut + +*/ + + METHOD reverse() { + INTVAL n; + GET_ATTR_size(INTERP, SELF, n); + if (n > 1) { + FLOATVAL val; + FLOATVAL *data; + INTVAL i; + + GET_ATTR_float_array(INTERP, SELF, data); + for (i = 0; i <= --n; i++) { + val = data[i]; + data[i] = data[n]; + data[n] = val; + } + } + } + } /* diff --git a/src/pmc/fixedintegerarray.pmc b/src/pmc/fixedintegerarray.pmc index 7e35c9fc3c..e598bb944a 100644 --- a/src/pmc/fixedintegerarray.pmc +++ b/src/pmc/fixedintegerarray.pmc @@ -109,10 +109,7 @@ Creates and returns a copy of the array. */ INTVAL * int_array; - PMC * const dest = - PObj_constant_TEST(SELF) - ? Parrot_pmc_new_constant(INTERP, SELF->vtable->base_type) - : Parrot_pmc_new(INTERP, SELF->vtable->base_type); + PMC * const dest = Parrot_pmc_new(INTERP, SELF->vtable->base_type); GET_ATTR_int_array(INTERP, SELF, int_array); @@ -269,6 +266,8 @@ Returns the Parrot string value of the element at index C. /* +=item C + =item C Returns the Parrot string representation C. @@ -277,6 +276,10 @@ Returns the Parrot string representation C. */ + VTABLE STRING *get_string() { + return STATICSELF.get_repr(); + } + VTABLE STRING *get_repr() { STRING *res = CONST_STRING(INTERP, "[ "); INTVAL n; @@ -645,6 +648,33 @@ Sort the array and return self. RETURN(PMC *SELF); } +/* + +=item C + +Reverse the contents of the array. + +=cut + +*/ + + METHOD reverse() { + INTVAL n; + GET_ATTR_size(INTERP, SELF, n); + if (n > 1) { + INTVAL val; + INTVAL *data; + INTVAL i; + + GET_ATTR_int_array(INTERP, SELF, data); + for (i = 0; i <= --n; i++) { + val = data[i]; + data[i] = data[n]; + data[n] = val; + } + } + } + } /* diff --git a/src/pmc/fixedpmcarray.pmc b/src/pmc/fixedpmcarray.pmc index 02fc9d3445..25fca8e7ad 100644 --- a/src/pmc/fixedpmcarray.pmc +++ b/src/pmc/fixedpmcarray.pmc @@ -68,6 +68,32 @@ Sort this array, optionally using the provided cmp_func RETURN(PMC *SELF); } + +/* + +=item C + +Reverse the contents of the array. + +=cut + +*/ + METHOD reverse() { + INTVAL n = SELF.elements(); + if (n > 1) { + PMC *val; + PMC **data = PMC_array(SELF); + INTVAL i; + + for (i = 0; i <= --n; i++) { + val = data[i]; + data[i] = data[n]; + data[n] = val; + } + } + } + + /* =back @@ -403,28 +429,6 @@ array. PMC_array(SELF) = data; } - VTABLE void set_pmc(PMC *value) { - INTVAL size; - INTVAL i; - - if (SELF == value) - return; - - if (!VTABLE_does(INTERP, value, CONST_STRING(INTERP, "array"))) - Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_OUT_OF_BOUNDS, - _("Can't set self from this type")); - - if (PMC_array(SELF)) - mem_gc_free(INTERP, PMC_array(SELF)); - - size = PMC_size(SELF) = VTABLE_elements(INTERP, value); - PMC_array(SELF) = mem_gc_allocate_n_typed(INTERP, size, PMC *); - - for (i = 0; i < size; ++i) - (PMC_array(SELF))[i] = VTABLE_get_pmc_keyed_int(INTERP, value, i); - - PObj_custom_mark_destroy_SETALL(SELF); - } /* =item C diff --git a/src/pmc/fixedstringarray.pmc b/src/pmc/fixedstringarray.pmc index 213edf859b..1b050afe04 100644 --- a/src/pmc/fixedstringarray.pmc +++ b/src/pmc/fixedstringarray.pmc @@ -101,7 +101,7 @@ Creates and returns a copy of the array. mem_size = size * sizeof (STRING *); dest_str_array = mem_gc_allocate_n_zeroed_typed(INTERP, size, STRING *); - mem_sys_memcopy(dest_str_array, my_str_array, mem_size); + memcpy(dest_str_array, my_str_array, mem_size); SET_ATTR_str_array(INTERP, dest, dest_str_array); SET_ATTR_size(INTERP, dest, size); @@ -626,6 +626,34 @@ Used to unarchive the string. str_array[i] = VTABLE_shift_string(INTERP, info); } } + +/* + +=item C + +Reverse the contents of the array. + +=cut + +*/ + + METHOD reverse() { + UINTVAL n; + GET_ATTR_size(INTERP, SELF, n); + if (n > 1) { + STRING *val; + STRING **data; + UINTVAL i; + + GET_ATTR_str_array(INTERP, SELF, data); + for (i = 0; i <= --n; i++) { + val = data[i]; + data[i] = data[n]; + data[n] = val; + } + } + } + } /* diff --git a/src/pmc/hash.pmc b/src/pmc/hash.pmc index be195a7533..de465dbc00 100644 --- a/src/pmc/hash.pmc +++ b/src/pmc/hash.pmc @@ -838,6 +838,30 @@ Sets C<*value> as the value for C<*key>. /* +=item C + +Sets C<*value> as the value for C<*key>. + +=cut + +*/ + + VTABLE void set_pmc_keyed_int(INTVAL key, PMC *value) { + Hash * const hash = (Hash *)SELF.get_pointer(); + + if (PObj_constant_TEST(SELF) + && (!PObj_constant_TEST((PObj *)value))) + Parrot_ex_throw_from_c_args(INTERP, NULL, + EXCEPTION_INVALID_OPERATION, + "Used non-constant PMC value in constant hash."); + + Parrot_hash_put(INTERP, hash, + Parrot_hash_key_from_int(INTERP, hash, key), + Parrot_hash_value_from_pmc(INTERP, hash, value)); + } + +/* + =item C =cut @@ -947,6 +971,19 @@ Returns whether the value for C<*key> is defined. /* +=item C + +=cut + +*/ + + VTABLE void delete_keyed_int(INTVAL. key) { + Hash * const hash = (Hash *)SELF.get_pointer(); + Parrot_hash_delete(INTERP, hash, Parrot_hash_key_from_int(INTERP, hash, key)); + } + +/* + =item C Deletes the element associated with C<*key>. @@ -1135,6 +1172,11 @@ NB: this method will destroy all old data! Return type of values in Hash. +=item C + +Copies all entries from the other hash into the hash, overwriting +entries with the same key. + =cut */ @@ -1184,6 +1226,17 @@ Return type of values in Hash. RETURN(INTVAL ret); } + METHOD update(PMC *other) { + if (other->vtable->base_type == SELF->vtable->base_type + || other->vtable->base_type == enum_class_Hash) { + Parrot_hash_update(INTERP, (Hash *)SELF.get_pointer(), + (Hash *)VTABLE_get_pointer(INTERP, other)); + } + else { + Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_UNIMPLEMENTED, + "Hash: don't know how to update from a non-Hash type"); + } + } } /* @@ -1228,7 +1281,7 @@ get_next_hash(PARROT_INTERP, ARGIN(const Hash *hash), ARGIN(const void *key)) =item C -Throw the appropiate exception. +Throw the appropriate exception. =cut diff --git a/src/pmc/hashiterator.pmc b/src/pmc/hashiterator.pmc index ea14864d28..918d09abdb 100644 --- a/src/pmc/hashiterator.pmc +++ b/src/pmc/hashiterator.pmc @@ -118,7 +118,7 @@ advance_to_next(ARGMOD(PMC *self)) return; } -pmclass HashIterator extends Iterator no_ro auto_attrs { +pmclass HashIterator extends Iterator provides 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 */ @@ -293,7 +293,22 @@ the next one. return Parrot_hash_key_to_string(INTERP, attrs->parrot_hash, attrs->bucket->key); } +/* + +*/ + VTABLE INTVAL shift_integer() { + Parrot_HashIterator_attributes * const attrs = PARROT_HASHITERATOR(SELF); + + /* Move to next bucket */ + advance_to_next(SELF); + + if (attrs->elements < 0) + Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_OUT_OF_BOUNDS, + "StopIteration"); + + return Parrot_hash_key_to_int(INTERP, attrs->parrot_hash, attrs->bucket->key); + } } /* diff --git a/src/pmc/imageiofreeze.pmc b/src/pmc/imageiofreeze.pmc index 71c28f4128..be58fee5c5 100644 --- a/src/pmc/imageiofreeze.pmc +++ b/src/pmc/imageiofreeze.pmc @@ -174,7 +174,7 @@ create_buffer(PARROT_INTERP, ARGIN_NULLOK(PMC *pmc), ARGMOD(PMC *info)) len = FREEZE_BYTES_PER_ITEM; PARROT_IMAGEIOFREEZE(info)->buffer = - Parrot_gc_new_bufferlike_header(interp, sizeof (Buffer)); + Parrot_gc_new_bufferlike_header(interp, sizeof (Parrot_Buffer)); Parrot_gc_allocate_buffer_storage_aligned(interp, PARROT_IMAGEIOFREEZE(info)->buffer, len); SET_VISIT_CURSOR(info, @@ -198,7 +198,7 @@ ensure_buffer_size(PARROT_INTERP, ARGIN(PMC *io), size_t len) { ASSERT_ARGS(ensure_buffer_size) - Buffer * const buf = PARROT_IMAGEIOFREEZE(io)->buffer; + Parrot_Buffer * const buf = PARROT_IMAGEIOFREEZE(io)->buffer; const size_t used = PARROT_IMAGEIOFREEZE(io)->pos; const int need_free = Buffer_buflen(buf) - used - len; @@ -243,7 +243,7 @@ check_seen(PARROT_INTERP, ARGIN(PMC *self), ARGIN(PMC *v)) } pmclass ImageIOFreeze auto_attrs { - ATTR Buffer *buffer; /* buffer to store the image */ + ATTR Parrot_Buffer *buffer; /* buffer to store the image */ ATTR size_t pos; /* current read/write buf position */ ATTR PMC *seen; /* seen hash */ ATTR PMC *todo; /* todo list */ @@ -518,7 +518,7 @@ Sets the constant table of this ImageIO PMC. PObj_custom_destroy_SET(SELF); ensure_buffer_size(INTERP, SELF, header_length); - mem_sys_memcopy(GET_VISIT_CURSOR(SELF), + memcpy(GET_VISIT_CURSOR(SELF), PARROT_IMAGEIOFREEZE(SELF)->pf->header, PACKFILE_HEADER_BYTES); INC_VISIT_CURSOR(SELF, header_length); } diff --git a/src/pmc/imageiosize.pmc b/src/pmc/imageiosize.pmc index 38f1476eb3..1addc96cfe 100644 --- a/src/pmc/imageiosize.pmc +++ b/src/pmc/imageiosize.pmc @@ -24,7 +24,9 @@ Gets the size of an ImageIO image without the allocation costs. /* Don't modify between HEADERIZER BEGIN / HEADERIZER END. Your changes will be lost. */ PARROT_INLINE -static int check_seen(PARROT_INTERP, ARGIN(PMC *self), ARGIN(PMC *v)) +static int check_seen(PARROT_INTERP, + ARGIN(const PMC *self), + ARGIN(const PMC *v)) __attribute__nonnull__(1) __attribute__nonnull__(2) __attribute__nonnull__(3); @@ -38,7 +40,7 @@ static int check_seen(PARROT_INTERP, ARGIN(PMC *self), ARGIN(PMC *v)) /* -=item C +=item C Check the seen hash to prevent duplicate serialization. @@ -49,11 +51,12 @@ Check the seen hash to prevent duplicate serialization. PARROT_INLINE static int -check_seen(PARROT_INTERP, ARGIN(PMC *self), ARGIN(PMC *v)) +check_seen(PARROT_INTERP, ARGIN(const PMC *self), ARGIN(const PMC *v)) { ASSERT_ARGS(check_seen) - Hash *seen = (Hash *)VTABLE_get_pointer(interp, PARROT_IMAGEIOSIZE(self)->seen); - HashBucket *b = Parrot_hash_get_bucket(interp, seen, v); + const Hash * const seen = + (Hash *)VTABLE_get_pointer(interp, PARROT_IMAGEIOSIZE(self)->seen); + const HashBucket * const b = Parrot_hash_get_bucket(interp, seen, v); if (b) return 1; else @@ -258,8 +261,8 @@ hasn't been seen yet, it is also pushed onto the todo list. SELF.push_integer(0); else { INTVAL cno, idx; - PackFile_ConstTable *ct = PARROT_IMAGEIOSIZE(SELF)->pf_ct; - Hash *seen = (Hash *)VTABLE_get_pointer(INTERP, + PackFile_ConstTable * const ct = PARROT_IMAGEIOSIZE(SELF)->pf_ct; + Hash * const seen = (Hash *)VTABLE_get_pointer(INTERP, PARROT_IMAGEIOSIZE(SELF)->seen); if (PObj_flag_TEST(private1, SELF) @@ -285,7 +288,7 @@ hasn't been seen yet, it is also pushed onto the todo list. VTABLE void set_pmc(PMC *p) { if (!PObj_flag_TEST(private1, SELF)) { - UINTVAL header_length = GROW_TO_16_BYTE_BOUNDARY(PACKFILE_HEADER_BYTES); + const UINTVAL header_length = GROW_TO_16_BYTE_BOUNDARY(PACKFILE_HEADER_BYTES); PARROT_IMAGEIOSIZE(SELF)->size += header_length; } diff --git a/src/pmc/imccompiler.pmc b/src/pmc/imccompiler.pmc index 4757286fff..7d78788029 100644 --- a/src/pmc/imccompiler.pmc +++ b/src/pmc/imccompiler.pmc @@ -30,21 +30,32 @@ static PMC * get_packfile_eval_pmc(PARROT_INTERP, __attribute__nonnull__(1) __attribute__nonnull__(2); -PARROT_CANNOT_RETURN_NULL -PARROT_WARN_UNUSED_RESULT -static PMC * get_packfile_pmc(PARROT_INTERP, ARGIN(PMC *pf_ptr_pmc)) - __attribute__nonnull__(1) - __attribute__nonnull__(2); - #define ASSERT_ARGS_get_packfile_eval_pmc __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ PARROT_ASSERT_ARG(interp) \ , PARROT_ASSERT_ARG(pf_pmc)) -#define ASSERT_ARGS_get_packfile_pmc __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ - PARROT_ASSERT_ARG(interp) \ - , PARROT_ASSERT_ARG(pf_ptr_pmc)) /* Don't modify between HEADERIZER BEGIN / HEADERIZER END. Your changes will be lost. */ /* HEADERIZER END: static */ +#define BEGIN_IMCC_COMPILE(i) \ + do { \ + UINTVAL __regs_used[4] = {3, 3, 3, 3}; \ + PMC * const __newcontext = Parrot_push_context((i), __regs_used); \ + PackFile_ByteCode * const __old_bc = (i)->code; \ + Parrot_block_GC_mark((i)); \ + Parrot_pcc_set_HLL((i), __newcontext, 0); \ + Parrot_pcc_set_sub((i), __newcontext, 0); \ + +#define END_IMCC_COMPILE(i) \ + Parrot_pop_context((i)); \ + Parrot_unblock_GC_mark((i)); \ + (i)->code = __old_bc; \ + } while (0) + +#define ERROR_IMCC_COMPILE(i) \ + Parrot_pop_context((i)); \ + Parrot_unblock_GC_mark((i)); \ + (i)->code = __old_bc; \ + /* =over 4 @@ -78,31 +89,6 @@ get_packfile_eval_pmc(PARROT_INTERP, ARGIN(PMC *pf_pmc), INTVAL current_eval) return eval_pmc; } -/* - -=item C - -Get a PMC pointer to a passed packfile pointer - -=back - -=cut - -*/ - -PARROT_CANNOT_RETURN_NULL -PARROT_WARN_UNUSED_RESULT -static PMC * -get_packfile_pmc(PARROT_INTERP, ARGIN(PMC *pf_ptr_pmc)) -{ - ASSERT_ARGS(get_packfile_pmc) - - PackFile * const pf = (PackFile*)VTABLE_get_pointer(interp, pf_ptr_pmc); - PMC * const pf_pmc = Parrot_pmc_new(interp, enum_class_PackfileView); - VTABLE_set_pointer(interp, pf_pmc, pf); - return pf_pmc; -} - /* HEADERIZER HFILE: none */ pmclass IMCCompiler auto_attrs provides HLLCompiler provide invokable { @@ -131,6 +117,7 @@ pmclass IMCCompiler auto_attrs provides HLLCompiler provide invokable { } /* provided to emulate the current NCI compreg */ + /* DEPRECATED. See TT #1967 */ VTABLE opcode_t* invoke(void* next) { Parrot_IMCCompiler_attributes * const attrs = PARROT_IMCCOMPILER(SELF); imc_info_t * const imcc = (imc_info_t*) attrs->imcc_info; @@ -163,7 +150,7 @@ pmclass IMCCompiler auto_attrs provides HLLCompiler provide invokable { /* Handle the case where we we've been tailcalled into. See NCI.invoke for more details */ - if (cont && cont != NEED_CONTINUATION + if (!PMC_IS_NULL(cont) && (PObj_get_FLAGS(cont) & SUB_FLAG_TAILCALL)) { cont = Parrot_pcc_get_continuation(interp, CURRENT_CONTEXT(interp)); next = VTABLE_invoke(INTERP, cont, next); @@ -199,75 +186,64 @@ pmclass IMCCompiler auto_attrs provides HLLCompiler provide invokable { } METHOD compile(STRING *source, - STRING *target :named("target") :optional, INTVAL has_target :opt_flag, - PMC *outer_ctx :named("outer_ctx") :optional, INTVAL has_ctx :opt_flag) + STRING *path :optional, INTVAL has_path :opt_flag, + STRING *target :named("target") :optional, INTVAL has_target :opt_flag, + PMC *outer_ctx :named("outer_ctx") :optional, INTVAL has_ctx :opt_flag) { Parrot_IMCCompiler_attributes * const attrs = PARROT_IMCCOMPILER(SELF); PMC * pf; - PMC * eval_pmc = PMCNULL; imc_info_t * const imcc = (imc_info_t*)attrs->imcc_info; - UINTVAL regs_used[4] = {3, 3, 3, 3}; - PMC * const newcontext = Parrot_push_context(interp, regs_used); - PackFile_ByteCode * const old_bc = interp->code; if (has_target) Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_INVALID_OPERATION, "IMCCompiler: compiler does not support the target option"); - Parrot_block_GC_mark(interp); - Parrot_pcc_set_HLL(interp, newcontext, 0); - Parrot_pcc_set_sub(interp, newcontext, 0); + BEGIN_IMCC_COMPILE(interp); /* TODO: Handle outer_ctx */ pf = imcc_compile_string(imcc, source, attrs->is_pasm); if (PMC_IS_NULL(pf)) { STRING * const msg = imcc_last_error_message(imcc); INTVAL code = imcc_last_error_code(imcc); + ERROR_IMCC_COMPILE(interp); Parrot_ex_throw_from_c_args(INTERP, NULL, code, "%Ss", msg); } - eval_pmc = get_packfile_pmc(INTERP, pf); + if (has_path) + VTABLE_set_string_native(INTERP, pf, path); - Parrot_pop_context(interp); - Parrot_unblock_GC_mark(interp); - interp->code = old_bc; + END_IMCC_COMPILE(interp); - RETURN(PMC *eval_pmc); + RETURN(PMC *pf); } METHOD compile_file(STRING *filename, - STRING *target :named("target") :optional, INTVAL has_target :opt_flag, - PMC *outer_ctx :named("outer_ctx") :optional, INTVAL has_ctx :opt_flag) + STRING *path :optional, INTVAL has_path :opt_flag, + STRING *target :named("target") :optional, INTVAL has_target :opt_flag, + PMC *outer_ctx :named("outer_ctx") :optional, INTVAL has_ctx :opt_flag) { Parrot_IMCCompiler_attributes * const attrs = PARROT_IMCCOMPILER(SELF); PMC * pf = PMCNULL; imc_info_t * const imcc = (imc_info_t*)attrs->imcc_info; - UINTVAL regs_used[4] = {3, 3, 3, 3}; - PMC * const newcontext = Parrot_push_context(interp, regs_used); - PMC * const old_pf = Parrot_pf_get_current_packfile(interp); - PMC * pf_pmc; if (has_target) Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_INVALID_OPERATION, "IMCCompiler: compiler does not support the target option"); - Parrot_block_GC_mark(interp); - Parrot_pcc_set_HLL(interp, newcontext, 0); - Parrot_pcc_set_sub(interp, newcontext, 0); + BEGIN_IMCC_COMPILE(interp); /* TODO: Handle outer_ctx */ pf = imcc_compile_file(imcc, filename, attrs->is_pasm); if (PMC_IS_NULL(pf)) { STRING * const msg = imcc_last_error_message(imcc); const INTVAL code = imcc_last_error_code(imcc); + ERROR_IMCC_COMPILE(interp); Parrot_ex_throw_from_c_args(INTERP, NULL, code, "%Ss", msg); } - /* This causes errors during the build */ - /*pf_pmc = get_packfile_pmc(INTERP, pf);*/ - Parrot_pop_context(interp); - Parrot_unblock_GC_mark(interp); - if (!PMC_IS_NULL(old_pf)) - Parrot_pf_set_current_packfile(interp, old_pf); + if (has_path) + VTABLE_set_string_native(INTERP, pf, path); + + END_IMCC_COMPILE(interp); RETURN(PMC *pf); } diff --git a/src/pmc/integer.pmc b/src/pmc/integer.pmc index ef5440a18f..201ba0b22a 100644 --- a/src/pmc/integer.pmc +++ b/src/pmc/integer.pmc @@ -1279,6 +1279,49 @@ Used to unarchive the integer. SUPER(info); SELF.set_integer_native(VTABLE_shift_integer(INTERP, info)); } + +/* + +=item C + +Set to a random value. + + SELF.set_random() # value from [INTVAL_MIN..INTVAL_MAX] + SELF.set_random(0) # same + SELF.set_random(a) # value from [0..a] or [a..0] if a is negative + SELF.set_random(a, b) # value from [a..b] (b > a) + +=cut + +*/ + + METHOD set_random(INTVAL a :optional, INTVAL has_a :opt_flag, + INTVAL b :optional, INTVAL has_b :opt_flag) + { + INTVAL r; + if (has_a && a != 0) { + if (!has_b) { + if (a < 0) + b = 0; + if (a > 0) { + b = a; + a = 0; + } + } + if (a == b || a > b) { + Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_OUT_OF_BOUNDS, + "set_random: range start must be less than range end (%d, %d)", a, b); + } + { + const double spread = (double)(b - a + 1); + const double randpart = Parrot_util_float_rand(0); + r = a + (INTVAL)(spread * randpart); + } + } + else + r = Parrot_util_int_rand(0); + SELF.set_integer_native(r); + } } /* diff --git a/src/pmc/iterator.pmc b/src/pmc/iterator.pmc index f6cae307ae..548597cd11 100644 --- a/src/pmc/iterator.pmc +++ b/src/pmc/iterator.pmc @@ -60,7 +60,7 @@ in that aggregate. /* HEADERIZER BEGIN: static */ /* HEADERIZER END: static */ -pmclass Iterator no_ro { +pmclass Iterator no_ro provides iterator { /* diff --git a/src/pmc/key.pmc b/src/pmc/key.pmc index b3c9964746..61bbc06ab6 100644 --- a/src/pmc/key.pmc +++ b/src/pmc/key.pmc @@ -342,7 +342,7 @@ Called after the Key has been thawed: convert last PMC_NULL key to NULL. SET_ATTR_next_key(INTERP, k, NULL); } else { - SET_ATTR_next_key(INTERP, k, Parrot_pmc_new_constant(INTERP, enum_class_Key)); + SET_ATTR_next_key(INTERP, k, Parrot_pmc_new(INTERP, enum_class_Key)); GET_ATTR_next_key(INTERP, k, k); } } diff --git a/src/pmc/lexpad.pmc b/src/pmc/lexpad.pmc index 7e41a07cff..53e4ed3eb3 100644 --- a/src/pmc/lexpad.pmc +++ b/src/pmc/lexpad.pmc @@ -29,49 +29,124 @@ These are the vtable functions for the lexpad PMC. /* HEADERIZER BEGIN: static */ /* Don't modify between HEADERIZER BEGIN / HEADERIZER END. Your changes will be lost. */ +PARROT_INLINE +PARROT_CAN_RETURN_NULL +static HashBucket * register_bucket(PARROT_INTERP, + ARGMOD(PMC *info), + ARGIN(STRING *name)) + __attribute__nonnull__(1) + __attribute__nonnull__(2) + __attribute__nonnull__(3) + FUNC_MODIFIES(*info); + static INTVAL register_number_for_get(PARROT_INTERP, - ARGMOD(PMC *self), ARGMOD(PMC *info), ARGIN(STRING *name), INTVAL reg_type) __attribute__nonnull__(1) __attribute__nonnull__(2) __attribute__nonnull__(3) - __attribute__nonnull__(4) - FUNC_MODIFIES(*self) FUNC_MODIFIES(*info); static INTVAL register_number_for_set(PARROT_INTERP, - ARGMOD(PMC *self), ARGMOD(PMC *info), ARGMOD(STRING *name), INTVAL reg_type) __attribute__nonnull__(1) __attribute__nonnull__(2) __attribute__nonnull__(3) - __attribute__nonnull__(4) - FUNC_MODIFIES(*self) FUNC_MODIFIES(*info) FUNC_MODIFIES(*name); +PARROT_DOES_NOT_RETURN +static void throw_lexical_not_found(PARROT_INTERP, ARGIN(STRING *name)) + __attribute__nonnull__(1) + __attribute__nonnull__(2); + +PARROT_DOES_NOT_RETURN +static void throw_wrong_register_type(PARROT_INTERP, ARGIN(STRING *name)) + __attribute__nonnull__(1) + __attribute__nonnull__(2); + +#define ASSERT_ARGS_register_bucket __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ + PARROT_ASSERT_ARG(interp) \ + , PARROT_ASSERT_ARG(info) \ + , PARROT_ASSERT_ARG(name)) #define ASSERT_ARGS_register_number_for_get __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ PARROT_ASSERT_ARG(interp) \ - , PARROT_ASSERT_ARG(self) \ , PARROT_ASSERT_ARG(info) \ , PARROT_ASSERT_ARG(name)) #define ASSERT_ARGS_register_number_for_set __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ PARROT_ASSERT_ARG(interp) \ - , PARROT_ASSERT_ARG(self) \ , PARROT_ASSERT_ARG(info) \ , PARROT_ASSERT_ARG(name)) +#define ASSERT_ARGS_throw_lexical_not_found __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ + PARROT_ASSERT_ARG(interp) \ + , PARROT_ASSERT_ARG(name)) +#define ASSERT_ARGS_throw_wrong_register_type __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ + PARROT_ASSERT_ARG(interp) \ + , PARROT_ASSERT_ARG(name)) /* Don't modify between HEADERIZER BEGIN / HEADERIZER END. Your changes will be lost. */ /* HEADERIZER END: static */ /* -=item C +=item C + +=item C + +Helper functions for common exceptions. + +=cut + +*/ + +PARROT_DOES_NOT_RETURN +static void +throw_wrong_register_type(PARROT_INTERP, ARGIN(STRING *name)) +{ + ASSERT_ARGS(throw_wrong_register_type) + Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_LEX_NOT_FOUND, + "Lexical '%Ss' is of wrong register type in lexical lookup", name); +} + +PARROT_DOES_NOT_RETURN +static void +throw_lexical_not_found(PARROT_INTERP, ARGIN(STRING *name)) +{ + ASSERT_ARGS(throw_lexical_not_found) + Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_LEX_NOT_FOUND, + "Lexical '%Ss' not found", name); +} + +/* + +=item C + +Helper for register_number_ functions. + +=cut + +*/ + +PARROT_INLINE +PARROT_CAN_RETURN_NULL +static HashBucket * +register_bucket(PARROT_INTERP, ARGMOD(PMC *info), ARGIN(STRING *name)) +{ + ASSERT_ARGS(register_bucket) + const Hash * const hash = (const Hash *)VTABLE_get_pointer(interp, info); + return hash->entries ? + Parrot_hash_get_bucket(interp, hash, name) : + NULL; +} + +/* + +=item C Locates the register number for getting the specified name and type of lexical. @@ -81,32 +156,24 @@ and type of lexical. */ static INTVAL -register_number_for_get(PARROT_INTERP, ARGMOD(PMC *self), ARGMOD(PMC *info), - ARGIN(STRING *name), INTVAL reg_type) +register_number_for_get(PARROT_INTERP, ARGMOD(PMC *info), ARGIN(STRING *name), + INTVAL reg_type) { ASSERT_ARGS(register_number_for_get) - const Hash *hash; - HashBucket *b; - - hash = (const Hash *)VTABLE_get_pointer(interp, info); - if (!hash->entries) - return -1; - - b = Parrot_hash_get_bucket(interp, hash, name); + const HashBucket * const b = register_bucket(interp, info, name); if (!b) return -1; if (((INTVAL)b->value & 3) != reg_type) - Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_LEX_NOT_FOUND, - "Lexical '%Ss' is of wrong register type in lexical lookup", name); + throw_wrong_register_type(interp, name); return ((INTVAL)b->value) >> 2; } /* -=item C +=item C Locates the register number for setting the specified name and type of lexical. @@ -116,23 +183,16 @@ and type of lexical. */ static INTVAL -register_number_for_set(PARROT_INTERP, ARGMOD(PMC *self), ARGMOD(PMC *info), - ARGMOD(STRING *name), INTVAL reg_type) +register_number_for_set(PARROT_INTERP, ARGMOD(PMC *info), ARGMOD(STRING *name), + INTVAL reg_type) { ASSERT_ARGS(register_number_for_set) - const Hash * hash; - HashBucket * b; - - hash = (const Hash *)VTABLE_get_pointer(interp, info); - b = Parrot_hash_get_bucket(interp, hash, name); - + const HashBucket * const b = register_bucket(interp, info, name); if (!b) - Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_LEX_NOT_FOUND, - "Lexical '%Ss' not found", name); + throw_lexical_not_found(interp, name); if (((INTVAL)b->value & 3) != reg_type) - Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_LEX_NOT_FOUND, - "Lexical '%Ss' is of wrong register type in lexical lookup", name); + throw_wrong_register_type(interp, name); return ((INTVAL)b->value) >> 2; } @@ -225,8 +285,8 @@ Return the LexInfo PMC, if any or a Null PMC. PMC *ctx; INTVAL reg; - GET_ATTR_lexinfo(interp, SELF, info); - reg = register_number_for_get(INTERP, SELF, info, name, REGNO_PMC); + GET_ATTR_lexinfo(INTERP, SELF, info); + reg = register_number_for_get(INTERP, info, name, REGNO_PMC); if (reg < 0) return PMCNULL; @@ -239,11 +299,10 @@ Return the LexInfo PMC, if any or a Null PMC. PMC *ctx; INTVAL reg; - GET_ATTR_lexinfo(interp, SELF, info); - reg = register_number_for_get(INTERP, SELF, info, name, REGNO_INT); + GET_ATTR_lexinfo(INTERP, SELF, info); + reg = register_number_for_get(INTERP, info, name, REGNO_INT); if (reg < 0) - Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_LEX_NOT_FOUND, - "Lexical '%Ss' not found", name); + throw_lexical_not_found(INTERP, name); GET_ATTR_ctx(INTERP, SELF, ctx); return CTX_REG_INT(INTERP, ctx, reg); @@ -254,11 +313,10 @@ Return the LexInfo PMC, if any or a Null PMC. PMC *ctx; INTVAL reg; - GET_ATTR_lexinfo(interp, SELF, info); - reg = register_number_for_get(INTERP, SELF, info, name, REGNO_NUM); + GET_ATTR_lexinfo(INTERP, SELF, info); + reg = register_number_for_get(INTERP, info, name, REGNO_NUM); if (reg < 0) - Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_LEX_NOT_FOUND, - "Lexical '%Ss' not found", name); + throw_lexical_not_found(INTERP, name); GET_ATTR_ctx(INTERP, SELF, ctx); return CTX_REG_NUM(INTERP, ctx, reg); @@ -269,11 +327,10 @@ Return the LexInfo PMC, if any or a Null PMC. PMC *ctx; INTVAL reg; - GET_ATTR_lexinfo(interp, SELF, info); - reg = register_number_for_get(INTERP, SELF, info, name, REGNO_STR); + GET_ATTR_lexinfo(INTERP, SELF, info); + reg = register_number_for_get(INTERP, info, name, REGNO_STR); if (reg < 0) - Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_LEX_NOT_FOUND, - "Lexical '%Ss' not found", name); + throw_lexical_not_found(INTERP, name); GET_ATTR_ctx(INTERP, SELF, ctx); return CTX_REG_STR(INTERP, ctx, reg); @@ -304,8 +361,8 @@ Return the LexInfo PMC, if any or a Null PMC. PMC *ctx; INTVAL reg; - GET_ATTR_lexinfo(interp, SELF, info); - reg = register_number_for_set(INTERP, SELF, info, name, REGNO_PMC); + GET_ATTR_lexinfo(INTERP, SELF, info); + reg = register_number_for_set(INTERP, info, name, REGNO_PMC); GET_ATTR_ctx(INTERP, SELF, ctx); CTX_REG_PMC(INTERP, ctx, reg) = value; @@ -317,8 +374,8 @@ Return the LexInfo PMC, if any or a Null PMC. PMC *ctx; INTVAL reg; - GET_ATTR_lexinfo(interp, SELF, info); - reg = register_number_for_set(INTERP, SELF, info, name, REGNO_INT); + GET_ATTR_lexinfo(INTERP, SELF, info); + reg = register_number_for_set(INTERP, info, name, REGNO_INT); GET_ATTR_ctx(INTERP, SELF, ctx); CTX_REG_INT(INTERP, ctx, reg) = value; @@ -329,8 +386,8 @@ Return the LexInfo PMC, if any or a Null PMC. PMC *ctx; INTVAL reg; - GET_ATTR_lexinfo(interp, SELF, info); - reg = register_number_for_set(INTERP, SELF, info, name, REGNO_NUM); + GET_ATTR_lexinfo(INTERP, SELF, info); + reg = register_number_for_set(INTERP, info, name, REGNO_NUM); GET_ATTR_ctx(INTERP, SELF, ctx); CTX_REG_NUM(INTERP, ctx, reg) = value; @@ -341,8 +398,8 @@ Return the LexInfo PMC, if any or a Null PMC. PMC *ctx; INTVAL reg; - GET_ATTR_lexinfo(interp, SELF, info); - reg = register_number_for_set(INTERP, SELF, info, name, REGNO_STR); + GET_ATTR_lexinfo(INTERP, SELF, info); + reg = register_number_for_set(INTERP, info, name, REGNO_STR); GET_ATTR_ctx(INTERP, SELF, ctx); CTX_REG_STR(INTERP, ctx, reg) = value; @@ -390,8 +447,43 @@ Get iterator for declared lexicals. return VTABLE_get_iter(INTERP, lexinfo); } -} +/* +=item C + +Returns a number based on the type of the variable named name. + +=over 4 + +=item * -1 = Not Found + +=item * 0 = Integer + +=item * 1 = Num + +=item * 2 = String + +=item * 3 = PMC + +=back + +=cut + +*/ + + METHOD INTVAL register_type(STRING *name) { + PMC *info; + HashBucket *b; + INTVAL ret = -1; + + GET_ATTR_lexinfo(INTERP, SELF, info); + b = register_bucket(INTERP, info, name); + if (b) + ret = (INTVAL) b->value & 3; + RETURN(INTVAL ret); + } + +} /* diff --git a/src/pmc/managedstruct.pmc b/src/pmc/managedstruct.pmc index 7a8140cb4f..f52759ca57 100644 --- a/src/pmc/managedstruct.pmc +++ b/src/pmc/managedstruct.pmc @@ -49,6 +49,7 @@ Initializes an empty struct. */ VTABLE void init() { + UNUSED(INTERP) PObj_custom_destroy_SET(SELF); } @@ -85,10 +86,12 @@ Otherwise, mem_gc_free() is used. if (ptr) { const custom_free_func_t free_func = PARROT_MANAGEDSTRUCT(SELF)->custom_free_func; if (free_func) { - void *free_data = PARROT_MANAGEDSTRUCT(SELF)->custom_free_priv; + void * const free_data = PARROT_MANAGEDSTRUCT(SELF)->custom_free_priv; free_func(INTERP, ptr, free_data); - } else + } + else { mem_gc_free(INTERP, ptr); + } } } diff --git a/src/pmc/mappedbytearray.pmc b/src/pmc/mappedbytearray.pmc index 60cc2db407..bcb097a46c 100644 --- a/src/pmc/mappedbytearray.pmc +++ b/src/pmc/mappedbytearray.pmc @@ -7,7 +7,7 @@ src/pmc/mappedbytearray.pmc - Mapped byte array =head1 DESCRIPTION -A memory mapped file or shared memory segment accesible as array of bytes. +A memory mapped file or shared memory segment accessible as array of bytes. Bare minimal functionality available, only for posix platforms (tested on linux). @@ -29,6 +29,7 @@ Bare minimal functionality available, only for posix platforms # ifdef __MINGW32__ # define ENABLED # define MAPW32 +# include # endif #endif @@ -445,7 +446,7 @@ in codepoints. =item C -Throws appropiately for functionality not available in the current platform. +Throws appropriately for functionality not available in the current platform. =item C diff --git a/src/pmc/multisub.pmc b/src/pmc/multisub.pmc index ee67c60364..abb37259aa 100644 --- a/src/pmc/multisub.pmc +++ b/src/pmc/multisub.pmc @@ -22,47 +22,62 @@ Sub PMCs with the same short name, but different long names. /* HEADERIZER HFILE: none */ /* HEADERIZER BEGIN: static */ +/* Don't modify between HEADERIZER BEGIN / HEADERIZER END. Your changes will be lost. */ + +static void check_is_valid_sub(PARROT_INTERP, ARGIN(PMC * sub)) + __attribute__nonnull__(1) + __attribute__nonnull__(2); + +#define ASSERT_ARGS_check_is_valid_sub __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ + PARROT_ASSERT_ARG(interp) \ + , PARROT_ASSERT_ARG(sub)) +/* Don't modify between HEADERIZER BEGIN / HEADERIZER END. Your changes will be lost. */ /* HEADERIZER END: static */ -pmclass MultiSub extends ResizablePMCArray auto_attrs provides array provides invokable { +/* + +=item C + +TK + +=cut + +*/ + +static void +check_is_valid_sub(PARROT_INTERP, ARGIN(PMC * sub)) +{ + ASSERT_ARGS(check_is_valid_sub) + STRING * const invokable_str = CONST_STRING(interp, "invokable"); + if (!VTABLE_does(interp, sub, invokable_str)) + Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_INVALID_OPERATION, + "attempt to add non-invokable PMC"); +} + +pmclass MultiSub + extends ResizablePMCArray + auto_attrs + provides array + provides invokable { VTABLE STRING * get_string() { PMC * const sub0 = VTABLE_get_pmc_keyed_int(INTERP, SELF, 0); + /*if (PMC_IS_NULL(sub0)) + return STRINGNULL;*/ STRING * const name = VTABLE_get_string(INTERP, sub0); return name; } VTABLE void push_pmc(PMC *value) { - if (!VTABLE_does(INTERP, value, CONST_STRING(INTERP, "invokable"))) - Parrot_ex_throw_from_c_args(INTERP, NULL, - EXCEPTION_INVALID_OPERATION, "attempt to push non Sub PMC"); - + check_is_valid_sub(INTERP, value); SUPER(value); } VTABLE void set_pmc_keyed_int(INTVAL key, PMC *value) { - STRING * const _sub = CONST_STRING(INTERP, "Sub"); - if (!VTABLE_isa(INTERP, value, _sub)) - Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_INVALID_OPERATION, - "attempt to set non Sub PMC"); + check_is_valid_sub(INTERP, value); SUPER(key, value); } - VTABLE void set_integer_keyed_int(INTVAL key, INTVAL value) { - Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_INVALID_OPERATION, - "attempt to set non Sub PMC"); - } - - VTABLE void set_string_keyed_int(INTVAL key, STRING *value) { - Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_INVALID_OPERATION, - "attempt to set non Sub PMC"); - } - - VTABLE void set_number_keyed_int(INTVAL key, FLOATVAL value) { - Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_INVALID_OPERATION, - "attempt to set non Sub PMC"); - } - VTABLE opcode_t *invoke(void *next) { PMC * const sig_obj = CONTEXT(INTERP)->current_sig; PMC * const func = Parrot_mmd_sort_manhattan_by_sig_pmc(INTERP, @@ -74,56 +89,6 @@ pmclass MultiSub extends ResizablePMCArray auto_attrs provides array provides in VTABLE_get_string(INTERP, SELF)); return VTABLE_invoke(INTERP, func, next); } - - - /* 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 VTABLEs of the same names. Hopefully we - don't need anything beyond that. */ - VTABLE PMC *get_pmc_keyed(PMC *key) { - 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 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 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 candidates found to dispatch to for '%Ss'", - VTABLE_get_string(INTERP, SELF)); - return SUPER(s); - } - - /* get_iter method should take one of two inputs: either an array of - arguments, or a string with a whitespace delimited function signature - (N, I, S, P). It should sort the argument list according to closeness - to this input argument list and return an iterator over that list. */ - - METHOD get_iter(PMC *args) { - STRING * const _array = CONST_STRING(INTERP, "Array"); - STRING * const _string = CONST_STRING(INTERP, "String"); - - if (VTABLE_isa(INTERP, args, _array)){ - /* TODO: What goes here? */ - } - else if (VTABLE_isa(INTERP, args, _string)) { - STRING * const s = VTABLE_get_string(INTERP, args); - /* TODO: What goes here? */ - } - else - Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_INVALID_OPERATION, - "attempt to call get_iter method with invalid arg type.\n"); - } } /* @@ -133,8 +98,6 @@ pmclass MultiSub extends ResizablePMCArray auto_attrs provides array provides in =head1 SEE ALSO F, -F<$perl6/doc/trunk/design/apo/A12.pod>, -F<$perl6/doc/trunk/design/syn/S12.pod> =cut diff --git a/src/pmc/namespace.pmc b/src/pmc/namespace.pmc index 1aec580c47..2fe526c207 100644 --- a/src/pmc/namespace.pmc +++ b/src/pmc/namespace.pmc @@ -1161,7 +1161,7 @@ Returns the class or role PMC that is associated with this namespace. */ METHOD get_class() { - Parrot_NameSpace_attributes * const nsinfo = PARROT_NAMESPACE(SELF); + const Parrot_NameSpace_attributes * const nsinfo = PARROT_NAMESPACE(SELF); PMC *ret_class = nsinfo->_class; if (PMC_IS_NULL(ret_class)) diff --git a/src/pmc/nativepccmethod.pmc b/src/pmc/nativepccmethod.pmc index 11e785138a..84289589da 100644 --- a/src/pmc/nativepccmethod.pmc +++ b/src/pmc/nativepccmethod.pmc @@ -38,7 +38,7 @@ Initializes the PMC with a C function pointer. */ VTABLE void init() { - Parrot_NativePCCMethod_attributes *attrs = PARROT_NATIVEPCCMETHOD(SELF); + Parrot_NativePCCMethod_attributes * const attrs = PARROT_NATIVEPCCMETHOD(SELF); attrs->func = NULL; attrs->signature = STRINGNULL; @@ -125,7 +125,7 @@ Call the function pointer. { PMC *cont = INTERP->current_cont; - if (cont && cont != NEED_CONTINUATION + if (!PMC_IS_NULL(cont) && (PObj_get_FLAGS(cont) & SUB_FLAG_TAILCALL)) { cont = Parrot_pcc_get_continuation(interp, CURRENT_CONTEXT(interp)); next = VTABLE_invoke(INTERP, cont, next); @@ -146,7 +146,7 @@ Mark contained elements for GC. */ VTABLE void mark() { - Parrot_NativePCCMethod_attributes *attrs = PARROT_NATIVEPCCMETHOD(SELF); + const Parrot_NativePCCMethod_attributes * const attrs = PARROT_NATIVEPCCMETHOD(SELF); Parrot_gc_mark_STRING_alive(interp, attrs->signature); Parrot_gc_mark_STRING_alive(interp, attrs->mmd_long_signature); @@ -165,8 +165,8 @@ Create a clone of this PMC. VTABLE PMC *clone() { PMC * const ret = Parrot_pmc_new(INTERP, SELF->vtable->base_type); - Parrot_NativePCCMethod_attributes *self_attrs = PARROT_NATIVEPCCMETHOD(SELF); - Parrot_NativePCCMethod_attributes *ret_attrs = PARROT_NATIVEPCCMETHOD(ret); + const Parrot_NativePCCMethod_attributes * const self_attrs = PARROT_NATIVEPCCMETHOD(SELF); + Parrot_NativePCCMethod_attributes * const ret_attrs = PARROT_NATIVEPCCMETHOD(ret); ret_attrs->func = self_attrs->func; ret_attrs->signature = self_attrs->signature; diff --git a/src/pmc/nci.pmc b/src/pmc/nci.pmc index 1e9443c134..a52f0e7553 100644 --- a/src/pmc/nci.pmc +++ b/src/pmc/nci.pmc @@ -278,7 +278,7 @@ class, the PMC arguments are shifted down. * return continuation here, which gets rid of this frame * and returns the real return address */ - if (cont && cont != NEED_CONTINUATION + if (!PMC_IS_NULL(cont) && (PObj_get_FLAGS(cont) & SUB_FLAG_TAILCALL)) { cont = Parrot_pcc_get_continuation(interp, CURRENT_CONTEXT(interp)); next = VTABLE_invoke(INTERP, cont, next); diff --git a/src/pmc/null.pmc b/src/pmc/null.pmc index 0410664e9d..4fb45dab89 100644 --- a/src/pmc/null.pmc +++ b/src/pmc/null.pmc @@ -1,5 +1,5 @@ /* -Copyright (C) 2001-2010, Parrot Foundation. +Copyright (C) 2001-2012, Parrot Foundation. =head1 NAME @@ -45,20 +45,24 @@ Overrides the default to do nothing. VTABLE void init() { UNUSED(INTERP) + UNUSED(SELF) } VTABLE void *get_pointer() { UNUSED(INTERP) + UNUSED(SELF) return PMCNULL; } VTABLE void set_pointer(void *p) { UNUSED(INTERP) + UNUSED(SELF) PMCNULL = (PMC *)p; } VTABLE INTVAL does(STRING *what) { UNUSED(INTERP) + UNUSED(SELF) UNUSED(what) /* XXX maybe a hack to get TGE running again */ return 0; @@ -74,6 +78,8 @@ Returns true if value is also a null PMC, false otherwise. */ VTABLE INTVAL is_same(PMC *value) { + UNUSED(INTERP) + UNUSED(SELF) return PMC_IS_NULL(value); } @@ -88,6 +94,7 @@ Gives a more informative message than the automaticaly generated version. */ VTABLE PMC *find_method(STRING *method_name) { + UNUSED(SELF) Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_NULL_REG_ACCESS, "Null PMC access in find_method('%Ss')", method_name); @@ -99,7 +106,7 @@ Gives a more informative message than the automaticaly generated version. =back -=head2 Auxiliar functions +=head2 Auxiliary functions =over 4 diff --git a/src/pmc/object.pmc b/src/pmc/object.pmc index d384161bea..0f4f009343 100644 --- a/src/pmc/object.pmc +++ b/src/pmc/object.pmc @@ -33,6 +33,12 @@ static void cache_method(PARROT_INTERP, __attribute__nonnull__(3) __attribute__nonnull__(4); +PARROT_CAN_RETURN_NULL +PARROT_WARN_UNUSED_RESULT +static PMC* clone_key_arg(PARROT_INTERP, ARGIN(PMC *key)) + __attribute__nonnull__(1) + __attribute__nonnull__(2); + PARROT_WARN_UNUSED_RESULT PARROT_CAN_RETURN_NULL static PMC * find_cached(PARROT_INTERP, @@ -65,6 +71,9 @@ static INTVAL get_attrib_index_keyed(PARROT_INTERP, , PARROT_ASSERT_ARG(_class) \ , PARROT_ASSERT_ARG(name) \ , PARROT_ASSERT_ARG(method)) +#define ASSERT_ARGS_clone_key_arg __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ + PARROT_ASSERT_ARG(interp) \ + , PARROT_ASSERT_ARG(key)) #define ASSERT_ARGS_find_cached __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ PARROT_ASSERT_ARG(interp) \ , PARROT_ASSERT_ARG(_class) \ @@ -99,24 +108,22 @@ get_attrib_index(PARROT_INTERP, ARGIN(PMC *self), ARGIN(STRING *name)) ASSERT_ARGS(get_attrib_index) Parrot_Class_attributes * const _class = PARROT_CLASS(self); const INTVAL cur_hll = Parrot_pcc_get_HLL(interp, CURRENT_CONTEXT(interp)); + INTVAL index = -1; int num_classes, i; - INTVAL retval; - - 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, + const INTVAL retval = VTABLE_get_integer_keyed_str(interp, _class->attrib_cache, name); /* there's a semi-predicate problem with a retval of 0 */ if (retval - || VTABLE_exists_keyed_str(interp, _class->attrib_cache, name)) { - Parrot_pcc_set_HLL(interp, CURRENT_CONTEXT(interp), cur_hll); + || VTABLE_exists_keyed_str(interp, _class->attrib_cache, name)) return retval; - } /* No hit. We need to walk up the list of parents to try and find the * attribute. */ + Parrot_pcc_set_HLL(interp, CURRENT_CONTEXT(interp), 0); + num_classes = VTABLE_elements(interp, _class->all_parents); for (i = 0; i < num_classes; i++) { @@ -131,18 +138,17 @@ get_attrib_index(PARROT_INTERP, ARGIN(PMC *self), ARGIN(STRING *name)) /* Look up. */ if (VTABLE_exists_keyed_str(interp, _class->attrib_index, fq_name)) { /* Found it. Get value, cache it and we're done. */ - const INTVAL index = VTABLE_get_integer_keyed_str(interp, + index = VTABLE_get_integer_keyed_str(interp, _class->attrib_index, fq_name); VTABLE_set_integer_keyed_str(interp, _class->attrib_cache, name, index); - Parrot_pcc_set_HLL(interp, CURRENT_CONTEXT(interp), cur_hll); - return index; + break; } } Parrot_pcc_set_HLL(interp, CURRENT_CONTEXT(interp), cur_hll); - return -1; + return index; } /* @@ -163,30 +169,17 @@ static INTVAL get_attrib_index_keyed(PARROT_INTERP, ARGIN(PMC *self), ARGIN(PMC *key), ARGIN(STRING *name)) { ASSERT_ARGS(get_attrib_index_keyed) - Parrot_Class_attributes * const _class = PARROT_CLASS(self); - PMC * const class_cache = - VTABLE_get_pmc_keyed_str(interp, _class->attrib_cache, - VTABLE_get_string(interp, key)); - - PMC *parent_class; - STRING *fq_name; - - if (!PMC_IS_NULL(class_cache)) - if (VTABLE_exists_keyed_str(interp, class_cache, name)) - return VTABLE_get_integer_keyed_str(interp, class_cache, name); + Parrot_Class_attributes * const _class = PARROT_CLASS(self); /* Build a string representing the fully qualified attribute name. */ - parent_class = Parrot_oo_get_class(interp, key); - fq_name = VTABLE_get_string(interp, parent_class); - fq_name = Parrot_str_concat(interp, fq_name, name); + PMC * const parent_class = Parrot_oo_get_class(interp, key); + STRING * const fq_name = Parrot_str_concat(interp, + VTABLE_get_string(interp, parent_class), name); /* Look up. */ - if (VTABLE_exists_keyed_str(interp, _class->attrib_index, fq_name)) { - /* Found it. Get value and we're done. */ - const INTVAL index = VTABLE_get_integer_keyed_str(interp, + if (VTABLE_exists_keyed_str(interp, _class->attrib_index, fq_name)) + return VTABLE_get_integer_keyed_str(interp, _class->attrib_index, fq_name); - return index; - } return -1; } @@ -240,6 +233,41 @@ ARGIN(PMC *method)) VTABLE_set_pmc_keyed_str(interp, cache, name, method); } +/* + +=item C + +Replaces any src registers by their values. Used for C<*_keyed> overrides. + +=cut + +*/ + +PARROT_CAN_RETURN_NULL +PARROT_WARN_UNUSED_RESULT +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; !PMC_IS_NULL(t); t=Parrot_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; +} + + 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. */ diff --git a/src/pmc/opcode.pmc b/src/pmc/opcode.pmc index 75e0420734..80b27c44b4 100644 --- a/src/pmc/opcode.pmc +++ b/src/pmc/opcode.pmc @@ -3,11 +3,12 @@ Copyright (C) 2010-2011, Parrot Foundation. =head1 NAME -src/pmc/opcode.pmc +src/pmc/opcode.pmc - Opcode information =head1 DESCRIPTION -Implements opcode VTABLEs. +Contains information on an opcode. Returned by various functions in the +C PMC. =cut @@ -23,11 +24,36 @@ pmclass Opcode auto_attrs { ATTR op_info_t *info; ATTR INTVAL op_number; +/* + +=head2 Vtable functions + +=over 4 + +=item C + +Throws an exception. Opcode PMCs are not to be created directly. + +=cut + +*/ + VTABLE void init() { Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_INVALID_OPERATION, "Opcode must be created from OpLib."); } +/* + +=item C + +Sets the C this PMC gets information from. Throws an exception if +the pointer has already been set. See also C, below. + +=cut + +*/ + VTABLE void set_pointer(void *i) { Parrot_Opcode_attributes * const attrs = PARROT_OPCODE(SELF); if (attrs->info) @@ -36,6 +62,18 @@ pmclass Opcode auto_attrs { attrs->info = (op_info_t *)i; } +/* + +=item C + +=item C + +Returns the opcode number. + +=cut + +*/ + VTABLE INTVAL get_integer() { const Parrot_Opcode_attributes * const attrs = PARROT_OPCODE(SELF); if (!attrs->info) @@ -47,6 +85,18 @@ pmclass Opcode auto_attrs { return STATICSELF.get_integer(); } +/* + +=item C + +Sets the number for this opcode. See also C, above. + +Throws an exception if set_pointer has already been called. + +=cut + +*/ + VTABLE void set_integer_native(INTVAL value) { Parrot_Opcode_attributes * const attrs = PARROT_OPCODE(SELF); if (attrs->info) @@ -55,6 +105,16 @@ pmclass Opcode auto_attrs { attrs->op_number = value; } +/* + +=item C + +Returns the full name of the opcode. + +=cut + +*/ + VTABLE STRING* get_string() { Parrot_Opcode_attributes * const attrs = PARROT_OPCODE(SELF); const char * const name = attrs->info->full_name; @@ -62,6 +122,16 @@ pmclass Opcode auto_attrs { return Parrot_str_new(INTERP, name, len); } +/* + +=item C + +Returns the number of arguments for the opcode. + +=cut + +*/ + VTABLE INTVAL elements() { const Parrot_Opcode_attributes * const attrs = PARROT_OPCODE(SELF); if (!attrs->info) @@ -69,6 +139,44 @@ pmclass Opcode auto_attrs { return attrs->info->op_count - 1; } +/* + +=item C + +Returns the type information for the Cth argument. Returns -1 if the C +is out of range. + +The type is returned as an integer. The value is determined by bitwise oring +together the basic type and a number of flags: + +Basic Types: + +=over 4 + +=item * 0 = Integer + +=item * 1 = String + +=item * 2 = PMC + +=item * 3 = Float + +=back + +Flags: + +=over 4 + +=item * 0x10 = Constant + +=item * 0x20 = Keyed + +=back + +=cut + +*/ + VTABLE INTVAL get_integer_keyed_int(INTVAL i) { const Parrot_Opcode_attributes * const attrs = PARROT_OPCODE(SELF); return i < attrs->info->op_count - 1 @@ -76,6 +184,22 @@ pmclass Opcode auto_attrs { : -1; } +/* + +=back + +=head2 Methods + +=over 4 + +=item C + +Returns the family, or short, name of the opcode. + +=cut + +*/ + METHOD family_name() { const char * const name = PARROT_OPCODE(SELF)->info->name; const INTVAL len = strlen(name); @@ -83,12 +207,44 @@ pmclass Opcode auto_attrs { RETURN(STRING *result); } +/* + +=item C + +Returns the jump value for the opcode. + +=cut + +*/ + METHOD jump() { const op_info_t * const info = PARROT_OPCODE(SELF)->info; const INTVAL jump = info->jump; RETURN(INTVAL jump); } +/* + +=item C + +Returns an array of direction information for the arguments. + +=over 4 + +=item * 0 = ignored + +=item * 1 = in (read-only) + +=item * 2 = out (write-only) + +=item * 3 = inout (read-write) + +=back + +=cut + +*/ + METHOD dirs() { const op_info_t * const info = PARROT_OPCODE(SELF)->info; const INTVAL arg_count = info->op_count - 1; @@ -104,6 +260,16 @@ pmclass Opcode auto_attrs { RETURN(PMC *result); } +/* + +=item C + +Returns an array describing if each argument is a label. (0 or 1) + +=cut + +*/ + METHOD labels() { const op_info_t * const info = PARROT_OPCODE(SELF)->info; PMC * const result = Parrot_pmc_new(INTERP, enum_class_FixedIntegerArray); @@ -119,6 +285,17 @@ pmclass Opcode auto_attrs { } +/* + +=back + +=head1 SEE ALSO + +F + +=cut +*/ + /* * Local variables: * c-file-style: "parrot" diff --git a/src/pmc/oplib.pmc b/src/pmc/oplib.pmc index dd271a05dd..651a779097 100644 --- a/src/pmc/oplib.pmc +++ b/src/pmc/oplib.pmc @@ -3,11 +3,11 @@ Copyright (C) 2010-2011, Parrot Foundation. =head1 NAME -src/pmc/oplib.pmc +src/pmc/oplib.pmc - Information about an opcode library =head1 DESCRIPTION -Implements oplib VTABLEs. +The PMC provides introspection on the opcodes contained in a library. =cut @@ -23,11 +23,35 @@ Implements oplib VTABLEs. pmclass OpLib auto_attrs { ATTR op_lib_t *oplib; +/* + +=head2 Vtable functions + +=over 4 + +=item C + +Throws an error. OpLib requires an argument to init. See C. + +=cut + +*/ + VTABLE void init() { Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_INVALID_OPERATION, "OpLib must be initialized with an oplib name"); } +/* + +=item C + +Initializes the OpLib with information about an oplib. + +=cut + +*/ + VTABLE void init_pmc(PMC *name_pmc) { STRING * const name = VTABLE_get_string(INTERP, name_pmc); char * const name_cstr = Parrot_str_to_cstring(INTERP, name); @@ -55,8 +79,27 @@ pmclass OpLib auto_attrs { SET_ATTR_oplib(INTERP, SELF, oplib); } - /* Look up an opnumber given the name of the op. First we look for the - specific name, then the more general short name. */ + +/* + +=item C + +=item C + +=item C + +=item C + +Look up an op number given the name of the op. First we look for the +specific name, then the more general short name. + +The VTABLEs that return integers return -1 when an opcode could not be found. +The VTABLEs that return PMCs throw exceptions instead. + +=cut + +*/ + VTABLE INTVAL get_integer_keyed_str(STRING *name) { const op_lib_t *oplib; char * const cstr = Parrot_str_to_cstring(INTERP, name); @@ -87,6 +130,17 @@ pmclass OpLib auto_attrs { return VTABLE_get_pmc_keyed_str(INTERP, SELF, strkey); } +/* + +=item C + +Returns an C PMC for a given opcode number. To find an opcode number +from a name, see C above. + +=cut + +*/ + VTABLE PMC* get_pmc_keyed_int(INTVAL value) { op_lib_t *oplib; GET_ATTR_oplib(INTERP, SELF, oplib); @@ -103,6 +157,18 @@ pmclass OpLib auto_attrs { } } +/* + +=item C + +=item C + +Returns the number of opcodes in the library. + +=cut + +*/ + VTABLE INTVAL elements() { const op_lib_t *oplib; GET_ATTR_oplib(INTERP, SELF, oplib); @@ -113,12 +179,39 @@ pmclass OpLib auto_attrs { return STATICSELF.elements(); } +/* + +=item C + +Returns the C pointer for the opcode library. + +=cut + +*/ + VTABLE void* get_pointer() { op_lib_t *oplib; GET_ATTR_oplib(INTERP, SELF, oplib); return oplib; } +/* + +=back + +=head2 Methods + +=over 4 + +=item C + +Returns an array of C PMCs for all the opcodes in the library that +share the given short name. + +=cut + +*/ + METHOD op_family(STRING *shortname) { char * const sname = Parrot_str_to_cstring(INTERP, shortname); const op_lib_t *oplib; @@ -139,17 +232,44 @@ pmclass OpLib auto_attrs { RETURN(PMC *result); } +/* + +=item C + +Returns an array containing the three version numbers (major, minor, patch) of +the library. + +=cut + +*/ + METHOD version() { const op_lib_t *oplib; - PMC * const version_array = Parrot_pmc_new(INTERP, enum_class_ResizableIntegerArray); + PMC * const version_array = Parrot_pmc_new_init_int(INTERP, + enum_class_FixedIntegerArray, 3); GET_ATTR_oplib(INTERP, SELF, oplib); - VTABLE_push_integer(INTERP, version_array, oplib->major_version); - VTABLE_push_integer(INTERP, version_array, oplib->minor_version); - VTABLE_push_integer(INTERP, version_array, oplib->patch_version); + VTABLE_set_integer_keyed_int(INTERP, version_array, + 0, oplib->major_version); + VTABLE_set_integer_keyed_int(INTERP, version_array, + 1, oplib->minor_version); + VTABLE_set_integer_keyed_int(INTERP, version_array, + 2, oplib->patch_version); RETURN(PMC *version_array); } } +/* + +=back + +=head1 SEE ALSO + +F + +=cut + +*/ + /* * Local variables: * c-file-style: "parrot" diff --git a/src/pmc/orderedhashiterator.pmc b/src/pmc/orderedhashiterator.pmc index c277ea6b63..7403d42f55 100644 --- a/src/pmc/orderedhashiterator.pmc +++ b/src/pmc/orderedhashiterator.pmc @@ -1,5 +1,5 @@ /* -Copyright (C) 2001-2009, Parrot Foundation. +Copyright (C) 2001-2012, Parrot Foundation. =head1 NAME @@ -24,7 +24,7 @@ Implementation of Iterator for OrderedHash. /* HEADERIZER BEGIN: static */ /* HEADERIZER END: static */ -pmclass OrderedHashIterator extends Iterator no_ro auto_attrs { +pmclass OrderedHashIterator extends Iterator provides 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; /* */ @@ -78,6 +78,8 @@ Marks the hash as live. */ VTABLE PMC* clone() { + UNUSED(INTERP) + UNUSED(SELF) return PMCNULL; } @@ -122,6 +124,7 @@ Returns this Iterator's Hash. */ VTABLE PMC* get_pmc() { + UNUSED(INTERP) return PARROT_ORDEREDHASHITERATOR(SELF)->pmc_hash; } @@ -150,10 +153,12 @@ Returns the number of remaining elements in the Hash. */ VTABLE INTVAL elements() { + UNUSED(INTERP) return PARROT_ORDEREDHASHITERATOR(SELF)->elements; } VTABLE INTVAL get_integer() { + UNUSED(INTERP) return SELF.elements(); } diff --git a/src/pmc/packfile.pmc b/src/pmc/packfile.pmc index 636d597171..b7f27fa878 100644 --- a/src/pmc/packfile.pmc +++ b/src/pmc/packfile.pmc @@ -201,7 +201,15 @@ Implementation note: taken from the bottom end of Parrot_pbc_read(). copy_packfile_header(INTERP, SELF, pf); VTABLE_set_pointer(INTERP, attrs->directory, &pf->directory); Parrot_unblock_GC_mark(INTERP); + + /* XXX memory leak + * Destroying the packfile here frees segments that may still have live references + * (eg: sub->seg) + * A memory leak is better than an invalid memory access + */ +#if 0 PackFile_destroy(INTERP, pf); +#endif } /* @@ -250,8 +258,6 @@ Fetch an integer keyed value from the packfile object. Valid keys are: =item uuid_type -=item uuid_length - =back =cut @@ -469,7 +475,7 @@ Return raw serialized PBC file data. Synonym for get_string. /* -=item C +=item C Parse raw serialized PBC file data into the Packfile data structure. Synonym for set_string. @@ -501,7 +507,7 @@ start of the packfile. const Parrot_Packfile_attributes * const attrs = PARROT_PACKFILE(SELF); PackFile * const pf = (PackFile*)VTABLE_get_pointer(INTERP, attrs->directory); - PMC * const view = Parrot_pf_get_packfile_pmc(INTERP, pf); + PMC * const view = Parrot_pf_get_packfile_pmc(INTERP, pf, STRINGNULL); RETURN(PMC * view); } diff --git a/src/pmc/packfileannotation.pmc b/src/pmc/packfileannotation.pmc index d5c8c45fe7..6d4c512b02 100644 --- a/src/pmc/packfileannotation.pmc +++ b/src/pmc/packfileannotation.pmc @@ -126,6 +126,80 @@ Set the name of the annotation. } +/* + +=item C + +Fetch the PMC value of the annotation. + +=cut + +*/ + METHOD get_pmc_value() { + const Parrot_PackfileAnnotation_attributes * const attrs = PARROT_PACKFILEANNOTATION(SELF); + if (attrs->value_type != PF_ANNOTATION_KEY_TYPE_PMC) + Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_INVALID_OPERATION, + "Trying to fetch wrong type of value from annotation"); + RETURN(PMC * attrs->pmc_value); + } + + +/* + +=item C + +Set the PMC value of the annotation. + +=cut + +*/ + METHOD set_pmc_value(PMC * value) { + Parrot_PackfileAnnotation_attributes * const attrs = PARROT_PACKFILEANNOTATION(SELF); + attrs->value_type = PF_ANNOTATION_KEY_TYPE_PMC; + attrs->pmc_value = value; + } + + +/* + +=item C + +Get the type of the annotation. + +=over 4 + +=item * 0 = Integer + +=item * 1 = String + +=item * 2 = PMC + +=back + +=cut + +*/ + METHOD get_type() { + /* These values were chosen to match the type values for opcodes */ + Parrot_PackfileAnnotation_attributes * const attrs = PARROT_PACKFILEANNOTATION(SELF); + INTVAL ret; + + switch (attrs->value_type) { + case PF_ANNOTATION_KEY_TYPE_INT: + ret = 0; + break; + case PF_ANNOTATION_KEY_TYPE_STR: + ret = 1; + break; + case PF_ANNOTATION_KEY_TYPE_PMC: + ret = 2; + break; + } + + RETURN(INTVAL ret); + } + + /* =item C diff --git a/src/pmc/packfileannotations.pmc b/src/pmc/packfileannotations.pmc index a48b76a9c0..aaa5fa90e5 100644 --- a/src/pmc/packfileannotations.pmc +++ b/src/pmc/packfileannotations.pmc @@ -52,6 +52,7 @@ Initialize PackfileAnnotations. Parrot_PackfileAnnotations_attributes * const attrs = PMC_data_typed(SELF, Parrot_PackfileAnnotations_attributes*); + SUPER(); attrs->annotations = Parrot_pmc_new(INTERP, enum_class_ResizablePMCArray); /* Don't initialize C. It will be set to NULL bu auto_attrs @@ -180,8 +181,11 @@ PackfileAnnotationKeys. METHOD set_directory(PMC *directory) { Parrot_PackfileAnnotations_attributes * const attrs = PARROT_PACKFILEANNOTATIONS(SELF); - PMC * const iter = VTABLE_get_iter(INTERP, directory); + + /* This should be SUPER(directory), but that doesn't work. */ + attrs->directory = directory; + while (VTABLE_get_bool(INTERP, iter)) { STRING * const name = VTABLE_shift_string(INTERP, iter); PMC * const segment = VTABLE_get_pmc_keyed_str(INTERP, directory, name); diff --git a/src/pmc/packfileconstanttable.pmc b/src/pmc/packfileconstanttable.pmc index d185c84874..9b852c180e 100644 --- a/src/pmc/packfileconstanttable.pmc +++ b/src/pmc/packfileconstanttable.pmc @@ -32,6 +32,7 @@ pmclass PackfileConstantTable auto_attrs extends PackfileSegment { ATTR PMC *num_constants; ATTR PMC *str_constants; ATTR PMC *pmc_constants; + ATTR PMC *tag_map; /* @@ -50,6 +51,7 @@ Create empty PackfileConstantTable. attrs->num_constants = Parrot_pmc_new(INTERP, enum_class_ResizableFloatArray); attrs->str_constants = Parrot_pmc_new(INTERP, enum_class_ResizableStringArray); attrs->pmc_constants = Parrot_pmc_new(INTERP, enum_class_ResizablePMCArray); + attrs->tag_map = Parrot_pmc_new(INTERP, enum_class_ResizableIntegerArray); PObj_custom_mark_SET(SELF); PMC_data(SELF) = attrs; @@ -72,6 +74,7 @@ Marks the object as live. Parrot_gc_mark_PMC_alive(INTERP, attrs->num_constants); Parrot_gc_mark_PMC_alive(INTERP, attrs->str_constants); Parrot_gc_mark_PMC_alive(INTERP, attrs->pmc_constants); + Parrot_gc_mark_PMC_alive(INTERP, attrs->tag_map); SUPER(); } @@ -98,6 +101,7 @@ Set pointer to underlying PackFile_ConstTable VTABLE_set_integer_native(INTERP, attrs->num_constants, table->num.const_count); VTABLE_set_integer_native(INTERP, attrs->str_constants, table->str.const_count); VTABLE_set_integer_native(INTERP, attrs->pmc_constants, table->pmc.const_count); + VTABLE_set_integer_native(INTERP, attrs->tag_map, table->ntags * 2); for (i = 0; i < table->num.const_count; i++) SELF.set_number_keyed_int(i, table->num.constants[i]); @@ -107,6 +111,12 @@ Set pointer to underlying PackFile_ConstTable for (i = 0; i < table->pmc.const_count; i++) SELF.set_pmc_keyed_int(i, table->pmc.constants[i]); + + for (i = 0; i < table->ntags; i++) { + const INTVAL ptr = i * 2; + VTABLE_set_integer_keyed_int(INTERP, attrs->tag_map, ptr, table->tag_map[i].tag_idx); + VTABLE_set_integer_keyed_int(INTERP, attrs->tag_map, ptr, table->tag_map[i].const_idx); + } } /* @@ -121,6 +131,7 @@ Set pointer to underlying PackFile_ConstTable PackFile_ConstTable * const pftable = mem_gc_allocate_zeroed_typed(INTERP, PackFile_ConstTable); opcode_t i; + const int tag_elts = VTABLE_elements(INTERP, attrs->tag_map); pftable->base.type = PF_CONST_SEG; @@ -148,6 +159,12 @@ Set pointer to underlying PackFile_ConstTable pftable->pmc.constants[i] = VTABLE_get_pmc_keyed_int(INTERP, attrs->pmc_constants, i); + for (i = 0; i < tag_elts; i += 2) { + Parrot_pf_tag_constant(interp, pftable, + VTABLE_get_integer_keyed_int(INTERP, attrs->tag_map, i), + VTABLE_get_integer_keyed_int(INTERP, attrs->tag_map, i + 1)); + } + return pftable; } @@ -399,6 +416,21 @@ Set segment type. RETURN(INTVAL PF_CONST_SEG); } +/* + +=item C + +Add a string->pmc tag mapping + +*/ + + METHOD add_tag_mapping(INTVAL pmc_idx, INTVAL str_idx) { + Parrot_PackfileConstantTable_attributes * const attrs = + PARROT_PACKFILECONSTANTTABLE(SELF); + INTVAL idx = VTABLE_elements(INTERP, attrs->tag_map); + VTABLE_set_integer_keyed_int(INTERP, attrs->tag_map, idx, pmc_idx); + VTABLE_set_integer_keyed_int(INTERP, attrs->tag_map, idx, str_idx); + } } /* diff --git a/src/pmc/packfiledebug.pmc b/src/pmc/packfiledebug.pmc index d05b7170e2..6ce2fdf440 100644 --- a/src/pmc/packfiledebug.pmc +++ b/src/pmc/packfiledebug.pmc @@ -29,6 +29,9 @@ Initial and experimental version, using some vtables as a quick way of testing. /* HEADERIZER END: static */ pmclass PackfileDebug auto_attrs extends PackfileRawSegment { + /* ConstantTable used for name lookup */ + ATTR PMC *const_table; + /* Number of file mappings */ ATTR INTVAL num_mappings; /* File name mapping */ @@ -49,6 +52,13 @@ Create empty PackfileDebug. SUPER(); SET_ATTR_type(INTERP, SELF, PF_DEBUG_SEG); Parrot_warn_experimental(interp, "PackfileDebug is experimental"); + + /* Don't initialize C. It will be set to NULL by + * auto_attrs handling. And should be set to proper PMC in + * set_directory. + */ + + PObj_custom_mark_SET(SELF); } /* @@ -62,12 +72,12 @@ Marks the object as live. */ VTABLE void mark() { - PMC *mapping_offset; - PMC *mapping_filename; - GET_ATTR_mapping_offset(INTERP, SELF, mapping_offset); - GET_ATTR_mapping_filename(INTERP, SELF, mapping_filename); - Parrot_gc_mark_PMC_alive(INTERP, mapping_offset); - Parrot_gc_mark_PMC_alive(INTERP, mapping_filename); + Parrot_PackfileDebug_attributes * const attrs = + PARROT_PACKFILEDEBUG(SELF); + + Parrot_gc_mark_PMC_alive(INTERP, attrs->const_table); + Parrot_gc_mark_PMC_alive(INTERP, attrs->mapping_offset); + Parrot_gc_mark_PMC_alive(INTERP, attrs->mapping_filename); SUPER(); } @@ -105,6 +115,9 @@ Set pointer to underlying PackFile_ConstTable /* =item C + +Builds a Packfile_Debug segment for this PMC. + =cut */ @@ -132,6 +145,8 @@ Set pointer to underlying PackFile_ConstTable =item C +=item C + Get the number of filename mappings. =cut @@ -139,6 +154,10 @@ Get the number of filename mappings. */ VTABLE INTVAL get_integer() { + return STATICSELF.elements(); + } + + VTABLE INTVAL elements() { INTVAL num_mappings; GET_ATTR_num_mappings(INTERP, SELF, num_mappings); return num_mappings; @@ -146,49 +165,101 @@ Get the number of filename mappings. /* -=item C +=item C + -Get the filename mapping n. +=item C + +Get the line mapping n. If n is greater than C, then the integer +version returns -1 and the PMC version returns PMCNULL; =cut */ VTABLE PMC *get_pmc_keyed_int(INTVAL n) { - INTVAL num_mappings; - GET_ATTR_num_mappings(INTERP, SELF, num_mappings); - if (n < num_mappings) { - PMC *mapping_offset; - INTVAL offset; - PMC *result; - GET_ATTR_mapping_offset(INTERP, SELF, mapping_offset); - offset = VTABLE_get_integer_keyed_int(INTERP, mapping_offset, n); - result = Parrot_pmc_new(INTERP, enum_class_Integer); - VTABLE_set_integer_native(INTERP, result, offset); - return result; - } - else return PMCNULL; + INTVAL line = STATICSELF.get_integer_keyed_int(n); + if (line < 0) + return PMCNULL; + + return Parrot_pmc_new_init_int(INTERP, enum_class_Integer, line); + } + + VTABLE INTVAL get_integer_keyed_int(INTVAL n) { + Parrot_PackfileDebug_attributes * const attrs = + PARROT_PACKFILEDEBUG(SELF); + + if (n >= attrs->num_mappings) + return -1; + + return VTABLE_get_integer_keyed_int(INTERP, attrs->mapping_offset, n); } /* =item C -Get the filename mapping n. +Get the filename mapping n. If C has been used, this will +return the filename. Otherwise it returns a string of the integer index into +the constant table. =cut */ VTABLE STRING *get_string_keyed_int(INTVAL n) { - INTVAL num_mappings; - GET_ATTR_num_mappings(INTERP, SELF, num_mappings); - if (n < num_mappings) { - PMC *mapping_filename; - GET_ATTR_mapping_filename(INTERP, SELF, mapping_filename); - return VTABLE_get_string_keyed_int(INTERP, mapping_filename, n); + Parrot_PackfileDebug_attributes * const attrs = + PARROT_PACKFILEDEBUG(SELF); + INTVAL filename; + + if (n >= attrs->num_mappings) + return STRINGNULL; + + filename = VTABLE_get_integer_keyed_int(INTERP, + attrs->mapping_filename, n); + + if (attrs->const_table != PMCNULL) + return VTABLE_get_string_keyed_int(INTERP, + attrs->const_table, filename); + + return Parrot_str_from_int(INTERP, filename); + } + +/* + +=back + +=head2 Methods + +=over 4 + +=item C + +Find PackfileConstantTable in PackfileDirectory and use it to perform lookup +for filenames. + +=cut + +*/ + + METHOD set_directory(PMC *directory) { + Parrot_PackfileDebug_attributes * const attrs = + PARROT_PACKFILEDEBUG(SELF); + STRING * const const_table_str = + Parrot_str_new_constant(INTERP, "PackfileConstantTable"); + PMC * const iter = VTABLE_get_iter(INTERP, directory); + + /* This should be SUPER(directory), but that doesn't work. */ + attrs->directory = directory; + + while (VTABLE_get_bool(INTERP, iter)) { + STRING * const name = VTABLE_shift_string(INTERP, iter); + PMC * const segment = VTABLE_get_pmc_keyed_str(INTERP, directory, name); + if (VTABLE_isa(INTERP, segment, const_table_str)) { + attrs->const_table = segment; + break; + } } - else return STRINGNULL; } } diff --git a/src/pmc/packfileopmap.pmc b/src/pmc/packfileopmap.pmc index dd1e6e823b..845a87d54a 100644 --- a/src/pmc/packfileopmap.pmc +++ b/src/pmc/packfileopmap.pmc @@ -4,7 +4,7 @@ Copyright (C) 2001-2011, Parrot Foundation. =head1 NAME -src/pmc/packfileopmap.pmc - Packfile Debug Segment PMC +src/pmc/packfileopmap.pmc - Packfile Op Map PMC =head1 DESCRIPTION @@ -222,7 +222,7 @@ Marks the object as live. =item C -Get the number of filename mappings. +Get the number of opcode mappings. =cut @@ -344,6 +344,44 @@ Construct PackFile_ByteCode_OpMapping. return m; } +/* + +=back + +=head2 Methods + +=over 4 + +=item C + +Returns an hash of name to C PMCs for all oplibs loaded in the map. + +=cut + +*/ + + METHOD oplibs() { + STRING *oplib_str = CONST_STRING(INTERP, "oplib"); + STRING *oplib_name = CONST_STRING(INTERP, "oplib_name"); + PMC *op_maps, *result; + INTVAL i, size; + + GET_ATTR_op_maps(INTERP, SELF, op_maps); + + result = Parrot_pmc_new(INTERP, enum_class_Hash); + + size = VTABLE_elements(INTERP, op_maps); + for (i = 0; i < size; ++i) { + PMC * const op_map = VTABLE_get_pmc_keyed_int(INTERP, op_maps, i); + PMC * const oplib = VTABLE_get_pmc_keyed_str(INTERP, op_map, oplib_str); + STRING * const name = VTABLE_get_string_keyed_str(INTERP, op_map, oplib_name); + + VTABLE_set_pmc_keyed_str(INTERP, result, name, oplib); + } + + RETURN(PMC *result); + } + } diff --git a/src/pmc/packfileview.pmc b/src/pmc/packfileview.pmc index f85ffd08b2..4300cffd0f 100644 --- a/src/pmc/packfileview.pmc +++ b/src/pmc/packfileview.pmc @@ -34,7 +34,7 @@ static void add_called_tag(PARROT_INTERP, static INTVAL find_called_tag(PARROT_INTERP, ARGIN(PMC * self), - ARGIN(STRING *tag)) + ARGIN(STRING * tag)) __attribute__nonnull__(1) __attribute__nonnull__(2) __attribute__nonnull__(3); @@ -86,8 +86,23 @@ get_const_table(PARROT_INTERP, ARGIN(PMC * self)) return bt->const_table; } +/* + +=item C + +Find a called tag in the cache. Return 1 if it exists, 0 otherwise. + +=item C + +Add a called tag to the cache, if it doesn't exist already. Do nothing +otherwise. + +=cut + +*/ + static INTVAL -find_called_tag(PARROT_INTERP, ARGIN(PMC * self), ARGIN(STRING *tag)) +find_called_tag(PARROT_INTERP, ARGIN(PMC * self), ARGIN(STRING * tag)) { ASSERT_ARGS(find_called_tag) Parrot_PackfileView_attributes * const attrs = PARROT_PACKFILEVIEW(self); @@ -350,8 +365,8 @@ Return a ResizablePMCArray with all Sub constants from the constant table. } } - METHOD subs_by_flag(STRING *flag) { - PMC * const subs = Parrot_pf_subs_by_flag(INTERP, SELF, flag); + METHOD subs_by_tag(STRING *flag) { + PMC * const subs = Parrot_pf_subs_by_tag(INTERP, SELF, flag); RETURN(PMC *subs); } @@ -442,11 +457,28 @@ given .pbc bytecode file. METHOD read_from_file(STRING * filename) { PackFile * const pf = Parrot_pf_read_pbc_file(INTERP, filename); VTABLE_set_pointer(INTERP, SELF, pf); + pf->view = SELF; + VTABLE_set_string_native(INTERP, SELF, filename); } METHOD write_to_file(STRING *filename) { Parrot_pf_write_pbc_file(INTERP, SELF, filename); } + +/* + +=item C + +Return a stringified version number of the packfile + +=cut + +*/ + + METHOD get_version() { + STRING * const version = Parrot_pf_get_version_string(INTERP, SELF); + RETURN(STRING * version); + } } /* diff --git a/src/pmc/parrotinterpreter.pmc b/src/pmc/parrotinterpreter.pmc index 58afe53a8a..5a243634c8 100644 --- a/src/pmc/parrotinterpreter.pmc +++ b/src/pmc/parrotinterpreter.pmc @@ -24,7 +24,6 @@ These are the vtable functions for the ParrotInterpreter base class */ -#include "parrot/embed.h" #include "parrot/dynext.h" #include "parrot/io.h" #include "parrot/runcore_api.h" @@ -66,7 +65,6 @@ clone_interpreter(Parrot_Interp d, Parrot_Interp s, INTVAL flags) Parrot_block_GC_mark(d); d->scheduler = Parrot_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) @@ -149,12 +147,6 @@ clone_interpreter(Parrot_Interp d, Parrot_Interp s, INTVAL flags) } } - if (flags & PARROT_CLONE_CODE) - pt_clone_code(d, s); - - if (flags & PARROT_CLONE_GLOBALS) - pt_clone_globals(d, s); - Parrot_unblock_GC_mark(d); } @@ -176,16 +168,11 @@ create_interp(ARGIN(PMC *self), ARGIN_NULLOK(Parrot_Interp parent)) Interp_flags flag = PARROT_NO_FLAGS; Parrot_Interp new_interp; - if (self->vtable->base_type == enum_class_ParrotThread) - flag = PARROT_IS_THREAD; - - new_interp = make_interpreter(parent, (INTVAL)flag); + new_interp = Parrot_interp_make_interpreter(parent, (INTVAL)flag); PMC_interp(self) = new_interp; VTABLE_set_pmc_keyed_int(new_interp, new_interp->iglobals, (INTVAL) IGLOBALS_INTERPRETER, self); - - new_interp->current_cont = NEED_CONTINUATION; } pmclass ParrotInterpreter no_ro manual_attrs provides invokable { @@ -215,10 +202,6 @@ new. */ - METHOD yield() { - pt_thread_yield(); - } - METHOD recursion_limit(INTVAL l :optional, INTVAL has_l :opt_flag) { const INTVAL ret = INTERP->recursion_limit; if (has_l) @@ -237,19 +220,13 @@ Initializes the interpreter. */ VTABLE void init() { - /* - * init/init_pmc may be called internally (from thread creation in - * ParrotThread::init_pmc() or stand-alone - * so we check, if the interpreter is already set up - */ if (!PMC_data(SELF)) { Parrot_ParrotInterpreter_attributes * const attrs = mem_gc_allocate_zeroed_typed(INTERP, Parrot_ParrotInterpreter_attributes); PMC_data(SELF) = attrs; } - if (!PMC_interp(SELF)) { + if (!PMC_interp(SELF)) create_interp(SELF, INTERP); - } PObj_custom_destroy_SET(SELF); } @@ -266,17 +243,13 @@ C and uses that thread. */ VTABLE void init_pmc(PMC *parent) { - /* XXX Can this be moved inside the block where it's used */ - Parrot_Interp p = PMC_interp(parent); - if (!PMC_data(SELF)) { Parrot_ParrotInterpreter_attributes * const attrs = mem_gc_allocate_zeroed_typed(INTERP, Parrot_ParrotInterpreter_attributes); PMC_data(SELF) = attrs; } - if (!PMC_interp(SELF)) { - create_interp(SELF, p); - } + if (!PMC_interp(SELF)) + create_interp(SELF, PMC_interp(parent)); PObj_custom_destroy_SET(SELF); } @@ -349,8 +322,6 @@ Returns the thread id of the interpreter. VTABLE INTVAL get_integer() { const Parrot_Interp i = PMC_interp(SELF); - if (i->thread_data) - return (INTVAL)i->thread_data->tid; return 0; } @@ -367,9 +338,6 @@ Runs the interpreter's byte code. VTABLE opcode_t *invoke(void *next) { Interp * const new_interp = PMC_interp(SELF); - /* setup code */ - pt_thread_prepare_for_run(new_interp, INTERP); - /* TODO pass arguments from parent (interp) to child (new_interp) by * possibly clone of share the arguments r/o args can be passed as is */ @@ -489,7 +457,7 @@ Introspection interface. C can be: level = 1; if (level < 0) - Parrot_ex_throw_from_c_args(INTERP, NULL, CONTROL_ERROR, + Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_INVALID_OPERATION, "No such caller depth"); ctx = CURRENT_CONTEXT(INTERP); @@ -499,7 +467,7 @@ Introspection interface. C can be: 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"); + EXCEPTION_INVALID_OPERATION, "No such outer depth"); } } else { @@ -508,13 +476,13 @@ Introspection interface. C can be: if (PMC_IS_NULL(cont) || !PARROT_CONTINUATION(cont)->seg) Parrot_ex_throw_from_c_args(INTERP, NULL, - CONTROL_ERROR, "No such caller depth"); + EXCEPTION_INVALID_OPERATION, "No such caller depth"); ctx = PARROT_CONTINUATION(cont)->to_ctx; if (PMC_IS_NULL(Parrot_pcc_get_sub(INTERP, ctx))) Parrot_ex_throw_from_c_args(INTERP, NULL, - CONTROL_ERROR, "No such caller depth"); + EXCEPTION_INVALID_OPERATION, "No such caller depth"); } } @@ -581,7 +549,7 @@ Returns the interpreter info for C. if (key == -1) return (INTVAL)new_interp->flags; - return interpinfo(new_interp, key); + return Parrot_interp_info(new_interp, key); } /* @@ -601,8 +569,8 @@ Sets the interpreter info for C to C. if (key == -1) { const INTVAL allowed = PARROT_BOUNDS_FLAG | PARROT_PROFILE_FLAG | PARROT_GC_DEBUG_FLAG; - Parrot_clear_flag(new_interp, allowed); - Parrot_set_flag(new_interp, val & allowed); + Parrot_interp_clear_flag(new_interp, allowed); + Parrot_interp_set_flag(new_interp, val & allowed); } } @@ -644,24 +612,7 @@ have the same thread id. MULTI INTVAL is_equal(ParrotInterpreter val) { Parrot_Interp self = PMC_interp(SELF); Parrot_Interp other = PMC_interp(val); - - if (!self->thread_data && !other->thread_data) - return 1; - - if (self->thread_data && other->thread_data && - self->thread_data->tid == other->thread_data->tid) - return 1; - - return 0; - } - - MULTI INTVAL is_equal(ParrotThread value) { - Parrot_Interp self = PMC_interp(SELF); - - if (!self->thread_data) - return 0; - - return self->thread_data->tid == (UINTVAL) VTABLE_get_integer(INTERP, value); + return self == other; } MULTI INTVAL is_equal(DEFAULT value) { @@ -794,6 +745,12 @@ support it. RETURN(INTVAL id); } + METHOD current_task() { + Interp * const this_interp = PMC_interp(SELF); + PMC * const current_task = this_interp->cur_task; + RETURN(PMC *current_task); + } + } /* diff --git a/src/pmc/parrotlibrary.pmc b/src/pmc/parrotlibrary.pmc index 3e86d12167..f82380598a 100644 --- a/src/pmc/parrotlibrary.pmc +++ b/src/pmc/parrotlibrary.pmc @@ -120,7 +120,7 @@ Returns the name of the loaded library. VTABLE STRING *get_string() { STRING * const key = CONST_STRING(INTERP, "_filename"); - PMC * const prop = VTABLE_getprop(INTERP, SELF, key); + PMC * const prop = Parrot_pmc_getprop(INTERP, SELF, key); return VTABLE_get_string(INTERP, prop); } diff --git a/src/pmc/parrotthread.pmc b/src/pmc/parrotthread.pmc deleted file mode 100644 index 65732b22fb..0000000000 --- a/src/pmc/parrotthread.pmc +++ /dev/null @@ -1,179 +0,0 @@ -/* -Copyright (C) 2001-2011, Parrot Foundation. - -=head1 NAME - -src/pmc/parrotthread.pmc - Represents a Parrot Thread. - -=head1 DESCRIPTION - -This type represents a parrot thread. - -It provides the following methods: - - join - - detach - - kill - - pid - -=head2 Methods - -=over 4 - -=cut - -*/ - -#include "parrot/embed.h" - - -pmclass ParrotThread no_ro auto_attrs { - ATTR INTVAL tid; /* thread id */ - -/* HEADERIZER HFILE: none */ -/* HEADERIZER BEGIN: static */ -/* HEADERIZER END: static */ - -/* - -=item C - -Create a new, invalid handle to a running thread. - -=cut - -*/ - - VTABLE void init() { - VTABLE_set_integer_native(INTERP, SELF, -1); - } - -/* - -=item C - -Create a new, invalid handle to a running thread. - -=cut - -*/ - - VTABLE void init_pmc(PMC *notused) { - VTABLE_set_integer_native(INTERP, SELF, -1); - } - -/* - -=item C - -Return the thread ID of this thread. - -=cut - -*/ - - VTABLE INTVAL get_integer() { - INTVAL ttid; - GETATTR_ParrotThread_tid(INTERP, SELF, ttid); - return ttid; - } - - VTABLE void set_integer_native(INTVAL ttid) { - SETATTR_ParrotThread_tid(INTERP, SELF, ttid); - } - - -/* - -=item C - -Join the thread, returning whatever its main method returns. - -=cut - -*/ - METHOD run_clone(PMC *sub, PMC *args :slurpy) { - INTVAL ttid; - if (PMC_IS_NULL(sub)) { - Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_INVALID_OPERATION, - "Invalid thread sub"); - } - - ttid = pt_thread_create_run(INTERP, - enum_class_ThreadInterpreter, PARROT_CLONE_DEFAULT, sub, args); - VTABLE_set_integer_native(INTERP, SELF, ttid); - } - - METHOD run(INTVAL clone_flags, PMC *sub, PMC *args :slurpy) { - INTVAL ttid; - if (PMC_IS_NULL(sub)) { - Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_INVALID_OPERATION, - "Invalid thread sub"); - } - - ttid = pt_thread_create_run(INTERP, enum_class_ThreadInterpreter, clone_flags, sub, args); - VTABLE_set_integer_native(INTERP, SELF, ttid); - } -/* - -=item C - -Join the thread, returning whatever its main method returns. - -=cut - -*/ - METHOD join() { - const INTVAL ttid = VTABLE_get_integer(INTERP, SELF); - PMC * const ret = pt_thread_join(INTERP, ttid); - - /* invalidate self */ - VTABLE_set_integer_native(INTERP, SELF, -1); - - RETURN(PMC *ret); - } - -/* - -=item C - -Detach the thread so it cannot be joined and will free its resources -immediately when it exits. - -=cut - -*/ - - METHOD detach() { - pt_thread_detach((UINTVAL)VTABLE_get_integer(INTERP, SELF)); - } - -/* - -=item C - -Terminate a running thread. - -=cut - -*/ - - METHOD kill() { - pt_thread_kill((UINTVAL)VTABLE_get_integer(INTERP, SELF)); - } - -} - -/* - -=back - -=cut - -*/ - -/* - * Local variables: - * c-file-style: "parrot" - * End: - * vim: expandtab shiftwidth=4 cinoptions='\:2=2' : - */ diff --git a/src/pmc/pmclist.pmc b/src/pmc/pmclist.pmc new file mode 100644 index 0000000000..b72fe41c98 --- /dev/null +++ b/src/pmc/pmclist.pmc @@ -0,0 +1,598 @@ +/* +Copyright (C) 2010-2012, Parrot Foundation. +$Id$ + +=head1 NAME + +src/pmc/pmclist.pmc - List of PMCs + +=head1 DESCRIPTION + +A doubly linked list of PMCs, for when push, pop, shift, and unshift +all want to be O(1). + +=head2 Vtable Functions + +=over 4 + +=cut + +*/ + +BEGIN_PMC_HEADER_PREAMBLE + +PARROT_EXPORT +void +Parrot_pmc_list_insert_by_number(PARROT_INTERP, PMC *list, PMC *value); + +END_PMC_HEADER_PREAMBLE + + + +/* HEADERIZER HFILE: none */ +/* HEADERIZER BEGIN: static */ +/* Don't modify between HEADERIZER BEGIN / HEADERIZER END. Your changes will be lost. */ + +PARROT_DOES_NOT_RETURN +static void throw_pop_empty(PARROT_INTERP) + __attribute__nonnull__(1); + +PARROT_DOES_NOT_RETURN +static void throw_shift_empty(PARROT_INTERP) + __attribute__nonnull__(1); + +#define ASSERT_ARGS_throw_pop_empty __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ + PARROT_ASSERT_ARG(interp)) +#define ASSERT_ARGS_throw_shift_empty __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 */ + + +/* It's a doubly linked list */ +typedef struct PMC_List_Item { + PMC *data; + struct PMC_List_Item *prev; + struct PMC_List_Item *next; +} PMC_List_Item; + +pmclass PMCList auto_attrs { + ATTR void *head; + ATTR void *foot; + ATTR INTVAL size; + +/* +=item C + +Initializes the list. + +=cut +*/ + + VTABLE void init() { + PObj_custom_mark_SET(SELF); + PObj_custom_destroy_SET(SELF); + + SET_ATTR_head(INTERP, SELF, NULL); + SET_ATTR_foot(INTERP, SELF, NULL); + SET_ATTR_size(INTERP, SELF, 0); + } + +/* +=item C + +Free all the list cells. + +=cut +*/ + + VTABLE void destroy() { + void *tmp; + PMC_List_Item *aa; + + GET_ATTR_head(INTERP, SELF, tmp); + aa = (PMC_List_Item*) tmp; + + while (aa != NULL) { + PMC_List_Item * const bb = aa; + aa = aa->next; + free(bb); + } + } + +/* +=item C + +Returns the size of the list. + +=cut +*/ + + VTABLE INTVAL get_integer() { + INTVAL size; + GET_ATTR_size(INTERP, SELF, size); + return size; + } + + VTABLE INTVAL elements() { + INTVAL size; + GET_ATTR_size(INTERP, SELF, size); + return size; + } + +/* +=item C + +Removes and returns an item from the start of the array. + +=cut +*/ + + VTABLE PMC *shift_pmc() { + INTVAL size; + void *tmp; + PMC_List_Item *head; + PMC_List_Item *item; + PMC *data; + + GET_ATTR_size(INTERP, SELF, size); + + if (0 >= size) + throw_shift_empty(INTERP); + + GET_ATTR_head(INTERP, SELF, tmp); + item = (PMC_List_Item*) tmp; + data = item->data; + + size -= 1; + SET_ATTR_size(INTERP, SELF, size); + + head = item->next; + SET_ATTR_head(INTERP, SELF, head); + + if (head == NULL) { + /* size == 0 */ + SET_ATTR_foot(INTERP, SELF, NULL); + } + else { + head->prev = NULL; + } + + if (size == 1) { + head->next = NULL; + SET_ATTR_foot(INTERP, SELF, head); + } + + free(item); + + return data; + } + +/* +=item C + +Extends the array by adding an element of value C<*value> to the end of +the array. + +=cut + +*/ + + VTABLE void push_pmc(PMC *value) { + INTVAL size; + void *tmp; + PMC_List_Item *foot; + PMC_List_Item *item; + + GET_ATTR_size(INTERP, SELF, size); + GET_ATTR_foot(INTERP, SELF, tmp); + foot = (PMC_List_Item*) tmp; + + item = (PMC_List_Item*) malloc(sizeof (PMC_List_Item)); + item->next = NULL; + item->prev = foot; + item->data = value; + + if (foot) + foot->next = item; + + size += 1; + + SET_ATTR_foot(INTERP, SELF, item); + SET_ATTR_size(INTERP, SELF, size); + + if (size == 1) + SET_ATTR_head(INTERP, SELF, item); + + return; + } + +/* +=item C + +Removes and returns the last element in the array. + +=cut +*/ + + VTABLE PMC *pop_pmc() { + INTVAL size; + void *tmp; + PMC_List_Item *foot; + PMC_List_Item *item; + PMC *data; + + GET_ATTR_size(INTERP, SELF, size); + + if (0 >= size) + throw_pop_empty(INTERP); + + GET_ATTR_foot(INTERP, SELF, tmp); + item = (PMC_List_Item*) tmp; + data = item->data; + + size -= 1; + SET_ATTR_size(INTERP, SELF, size); + + foot = item->prev; + SET_ATTR_foot(INTERP, SELF, foot); + + if (foot == NULL) { + /* size == 0 */ + SET_ATTR_head(INTERP, SELF, NULL); + } + else { + foot->next = NULL; + } + + if (size == 1) { + foot->prev = NULL; + SET_ATTR_head(INTERP, SELF, foot); + } + + free(item); + + return data; + } + +/* + +=item C + +Extends the array by adding an element of value C<*value> to the begin of +the array. + +=cut +*/ + + VTABLE void unshift_pmc(PMC *value) { + INTVAL size; + void *tmp; + PMC_List_Item *head; + PMC_List_Item *item; + + GET_ATTR_size(INTERP, SELF, size); + GET_ATTR_head(INTERP, SELF, tmp); + head = (PMC_List_Item*) tmp; + + item = (PMC_List_Item*) malloc(sizeof (PMC_List_Item)); + item->prev = NULL; + item->next = head; + item->data = value; + + if (head) + head->prev = item; + + size += 1; + + SET_ATTR_head(INTERP, SELF, item); + SET_ATTR_size(INTERP, SELF, size); + + if (size == 1) + SET_ATTR_foot(INTERP, SELF, item); + + return; + } + +/* + +=item C + +Creates and returns a copy of the list. + +=cut + +*/ + + VTABLE PMC *clone() { + PMC * const copy = Parrot_pmc_new(INTERP, SELF->vtable->base_type); + void* tmp; + PMC_List_Item *it; + + GET_ATTR_head(INTERP, SELF, tmp); + it = (PMC_List_Item*) tmp; + + while (it != NULL) { + VTABLE_push_pmc(INTERP, copy, it->data); + it = it->next; + } + + return copy; + } + +/* + +=item C + +Returns the Parrot string representation C. + +=cut + +*/ + + VTABLE STRING *get_repr() { + PMC_List_Item *it; + void* tmp; + STRING *res = CONST_STRING(INTERP, "[ "); + STRING * const space = CONST_STRING(INTERP, " "); + + GET_ATTR_head(INTERP, SELF, tmp); + it = (PMC_List_Item*) tmp; + + while (it != NULL) { + res = Parrot_str_concat(INTERP, res, VTABLE_get_repr(INTERP, it->data)); + res = Parrot_str_concat(INTERP, res, space); + it = it->next; + } + + return Parrot_str_concat(INTERP, res, CONST_STRING(INTERP, "]")); + } + + VTABLE STRING *get_string() { + return VTABLE_get_repr(INTERP, SELF); + } + + +/* + +=item C + +This is used by freeze/thaw to visit the contents of the array. + +C<*info> is the visit info, (see F). + +=item C + +Used to archive the array. + +=item C + +Used to unarchive the array. + +=cut + +*/ + + VTABLE void visit(PMC *info) { + void* tmp; + PMC_List_Item *it; + + GET_ATTR_head(INTERP, SELF, tmp); + it = (PMC_List_Item*) tmp; + + while (it != NULL) { + VISIT_PMC(INTERP, info, it->data); + it = it->next; + } + SUPER(info); + } + + VTABLE void freeze(PMC *info) { + SUPER(info); + VTABLE_push_integer(INTERP, info, VTABLE_get_integer(INTERP, SELF)); + } + + VTABLE void thaw(PMC *info) { + int n, i; + SUPER(info); + n = VTABLE_shift_integer(INTERP, info); + SET_ATTR_size(INTERP, SELF, n); + + for (i = 0; i < n; ++i) + VTABLE_push_pmc(INTERP, SELF, PMCNULL); + } + +/* +=item C + +Mark the stuff. + +=cut +*/ + + VTABLE void mark() { + void* tmp; + PMC_List_Item *it; + + GET_ATTR_head(INTERP, SELF, tmp); + it = (PMC_List_Item*) tmp; + + while (it != NULL) { + if (!PObj_is_PMC_TEST(it->data)) { + fprintf(stderr, "not a pmc\n"); + exit(1); + } + + Parrot_gc_mark_PMC_alive(INTERP, it->data); + it = it->next; + } + } + + +/* + +=item METHOD PMC* shift() + +=item METHOD PMC* pop() + +Method forms to remove and return a PMC from the beginning or +end of the array. + +=cut + +*/ + + METHOD shift() { + PMC * const value = VTABLE_shift_pmc(INTERP, SELF); + RETURN(PMC *value); + } + + METHOD pop() { + PMC * const value = VTABLE_pop_pmc(INTERP, SELF); + RETURN(PMC *value); + } + +/* + +=item METHOD unshift(PMC* value) + +=item METHOD push(PMC* value) + +Method forms to add a PMC to the beginning or end of the array. + +=cut + +*/ + + METHOD unshift(PMC* value) { + VTABLE_unshift_pmc(INTERP, SELF, value); + } + + METHOD push(PMC* value) { + VTABLE_push_pmc(INTERP, SELF, value); + } + +/* +=item METHOD insert_by_number(PMC* value) + +Inserts an item into an ordered list by it's number value. + +=cut +*/ + + METHOD insert_by_number(PMC* value) { + Parrot_pmc_list_insert_by_number(INTERP, SELF, value); + } + +} + +/* + +=back + +=head2 Auxiliary functions + +=over 4 + +=item C + +Insert an item into a sorted list by its num value. + +=cut + +*/ + + +PARROT_EXPORT +void +Parrot_pmc_list_insert_by_number(PARROT_INTERP, PMC *list, PMC *value) +{ + void *tmp; + PMC_List_Item *item; + FLOATVAL vkey; + int size; + + GETATTR_PMCList_size(interp, list, size); + GETATTR_PMCList_head(interp, list, tmp); + + item = (PMC_List_Item*) malloc(sizeof (PMC_List_Item)); + item->data = value; + item->next = (PMC_List_Item*) tmp; + item->prev = NULL; + + vkey = VTABLE_get_number(interp, value); + + /* Find the list item to insert before */ + while (item->next != NULL) { + const FLOATVAL ikey = VTABLE_get_number(interp, item->next->data); + if (ikey > vkey) + break; + item->prev = item->next; + item->next = item->next->next; + } + + if (item->next == NULL) { + SETATTR_PMCList_foot(interp, list, item); + } + else { + item->next->prev = item; + } + + if (item->prev == NULL) { + SETATTR_PMCList_head(interp, list, item); + } + else { + item->prev->next = item; + } + + SETATTR_PMCList_size(interp, list, size + 1); +} + +/* +=item C + +=item C + +Throws with the appropiate message. + +=cut + +*/ + +PARROT_DOES_NOT_RETURN +static void +throw_shift_empty(PARROT_INTERP) +{ + ASSERT_ARGS(throw_shift_empty) + Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_OUT_OF_BOUNDS, + "PMCList: Can't shift from an empty list!"); +} + +PARROT_DOES_NOT_RETURN +static void +throw_pop_empty(PARROT_INTERP) +{ + ASSERT_ARGS(throw_pop_empty) + Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_OUT_OF_BOUNDS, + "PMCList: Can't pop from an empty list!"); +} + +/* + +=back + +=head1 See also + +F. + +=cut + +*/ + +/* + * Local variables: + * c-file-style: "parrot" + * End: + * vim: expandtab shiftwidth=4 cinoptions='\:2=2' : + */ diff --git a/src/pmc/pointer.pmc b/src/pmc/pointer.pmc index d98b198823..40c4f581b7 100644 --- a/src/pmc/pointer.pmc +++ b/src/pmc/pointer.pmc @@ -1,5 +1,5 @@ /* -Copyright (C) 2001-2007, Parrot Foundation. +Copyright (C) 2001-2011, Parrot Foundation. =head1 NAME @@ -38,6 +38,7 @@ Initializes the pointer. */ VTABLE void init() { + UNUSED(interp); PObj_custom_mark_SET(SELF); } @@ -54,7 +55,7 @@ Marks the pointer as live. VTABLE void mark() { void (*mark_function)(Interp *, void *) = (void (*)(Interp *, void *))D2FPTR(PARROT_POINTER(SELF)->mark_function); - void * data = PARROT_POINTER(SELF)->pointer; + void * const data = PARROT_POINTER(SELF)->pointer; if (data && mark_function) (*mark_function)(INTERP, data); } @@ -87,6 +88,7 @@ Sets the pointer value. */ VTABLE void set_pointer(void *ptr) { + UNUSED(interp); PARROT_POINTER(SELF)->pointer = ptr; } @@ -101,6 +103,7 @@ Returns the pointer value. */ VTABLE void *get_pointer() { + UNUSED(interp); return PARROT_POINTER(SELF)->pointer; } @@ -115,6 +118,7 @@ Returns the pointer value as an integer. */ VTABLE INTVAL get_integer() { + UNUSED(interp); return (INTVAL)(PARROT_POINTER(SELF)->pointer); } @@ -129,6 +133,7 @@ Returns the pointer value as a floating-point number. */ VTABLE FLOATVAL get_number() { + UNUSED(interp); return (FLOATVAL)(INTVAL)(PARROT_POINTER(SELF)->pointer); } @@ -143,6 +148,7 @@ Returns the pointer value as a Parrot string. */ VTABLE STRING *get_repr() { + UNUSED(interp); return Parrot_sprintf_c(INTERP, "Pointer = 0x%p", PARROT_POINTER(SELF)->pointer); } @@ -172,6 +178,7 @@ Returns whether the pointer is not C. */ VTABLE INTVAL get_bool() { + UNUSED(interp); return (INTVAL)(PMC_data(SELF) != NULL); } @@ -186,6 +193,7 @@ Returns whether the pointer has the same value as C<*pmc2>. */ VTABLE INTVAL is_same(PMC *pmc2) { + UNUSED(interp); return (INTVAL)(SELF->vtable == pmc2->vtable && PARROT_POINTER(SELF)->pointer == PARROT_POINTER(pmc2)->pointer); } diff --git a/src/pmc/ptr.pmc b/src/pmc/ptr.pmc index 7b5f3d708a..061eacdaf5 100644 --- a/src/pmc/ptr.pmc +++ b/src/pmc/ptr.pmc @@ -33,6 +33,8 @@ BEGIN_PMC_HEADER_PREAMBLE #define PTR_FAT_CLEAR(i, s) PObj_flag_CLEAR(private1, (s)) END_PMC_HEADER_PREAMBLE +#include "parrot/string_funcs.h" + /* HEADERIZER HFILE: none */ /* HEADERIZER BEGIN: static */ /* HEADERIZER END: static */ @@ -184,21 +186,8 @@ specified. If the encoding is omitted or null, use platform encoding. */ METHOD as_string(STRING *encodingname :optional) { - STRING *result = STRINGNULL; const char * content = (const char *)SELF.get_pointer(); - if (content) { - const STR_VTABLE *encoding = STRING_IS_NULL(encodingname) ? - Parrot_platform_encoding_ptr : - Parrot_find_encoding_by_string(INTERP, encodingname); - if (encoding == NULL) - Parrot_ex_throw_from_c_args(interp, NULL, - EXCEPTION_INVALID_ENCODING, - "Invalid encoding"); - else { - int size = strlen(content); - result = Parrot_str_new_init(INTERP, content, size, encoding, 0); - } - } + STRING *result = Parrot_str_new_from_cstring(INTERP, content, encodingname); RETURN(STRING result); } diff --git a/src/pmc/resizablebooleanarray.pmc b/src/pmc/resizablebooleanarray.pmc index dd9824bed2..661089033e 100644 --- a/src/pmc/resizablebooleanarray.pmc +++ b/src/pmc/resizablebooleanarray.pmc @@ -168,7 +168,7 @@ Resizes the array to C elements. /* Replace old array with new array, and free old array */ SET_ATTR_bit_array(INTERP, SELF, - (unsigned char *)mem_sys_memmove( + (unsigned char *)memmove( new_store, old_store, copy_size)); mem_gc_free(INTERP, old_store); } @@ -260,7 +260,7 @@ beginning. /* Copy contents of old array to new array, moving the head * position forward by one allocation unit (in bytes). */ old_mem_size = ROUND_BYTES(tail_pos); - mem_sys_memmove(new_bit_array + (BITS_TO_BYTES(MIN_ALLOC)), + memmove(new_bit_array + (BITS_TO_BYTES(MIN_ALLOC)), old_bit_array, old_mem_size); /* Replace old array with new array, and free old array */ @@ -321,7 +321,7 @@ Removes and returns the first element. /* Copy contents of old array to new array, move the head position * offset back by one allocation unit (in bytes) */ GET_ATTR_bit_array(INTERP, SELF, old_bit_array); - mem_sys_memmove(new_bit_array, old_bit_array + (BITS_TO_BYTES(MIN_ALLOC)), + memmove(new_bit_array, old_bit_array + (BITS_TO_BYTES(MIN_ALLOC)), new_mem_size); /* Replace old array with new array, and free old array */ @@ -392,7 +392,7 @@ Returns a copy of the array. if (my_bit_array) { const size_t size_in_bits = tail_pos / BITS_PER_CHAR + 1; dest_bit_array = (unsigned char *)Parrot_gc_allocate_memory_chunk(INTERP, size_in_bits); - mem_sys_memcopy(dest_bit_array, my_bit_array, size_in_bits); + memcpy(dest_bit_array, my_bit_array, size_in_bits); } else dest_bit_array = NULL; diff --git a/src/pmc/resizablefloatarray.pmc b/src/pmc/resizablefloatarray.pmc index d52d3939a9..32532122fa 100644 --- a/src/pmc/resizablefloatarray.pmc +++ b/src/pmc/resizablefloatarray.pmc @@ -222,7 +222,7 @@ Removes and returns an item from the start of the array. value = float_array[0]; SET_ATTR_size(INTERP, SELF, --size); - mem_sys_memmove(float_array, float_array + 1, size * sizeof (FLOATVAL)); + memmove(float_array, float_array + 1, size * sizeof (FLOATVAL)); return value; } @@ -243,7 +243,7 @@ Add and integer to the start of the array. GET_ATTR_size(INTERP, SELF, size); SELF.set_integer_native(size + 1); GET_ATTR_float_array(INTERP, SELF, float_array); - mem_sys_memmove(float_array + 1, float_array, size * sizeof (FLOATVAL)); + memmove(float_array + 1, float_array, size * sizeof (FLOATVAL)); float_array[0] = value; } diff --git a/src/pmc/resizableintegerarray.pmc b/src/pmc/resizableintegerarray.pmc index e616693721..2705fb5e5f 100644 --- a/src/pmc/resizableintegerarray.pmc +++ b/src/pmc/resizableintegerarray.pmc @@ -224,7 +224,7 @@ Removes and returns an item from the start of the array. value = int_array[0]; --size; - mem_sys_memmove(int_array, int_array + 1, size * sizeof (INTVAL)); + memmove(int_array, int_array + 1, size * sizeof (INTVAL)); SELF.set_integer_native(size); return value; } @@ -245,7 +245,7 @@ Add an integer to the start of the array. SELF.set_integer_native(size + 1); GET_ATTR_int_array(INTERP, SELF, int_array); - mem_sys_memmove(int_array + 1, int_array, size * sizeof (INTVAL)); + memmove(int_array + 1, int_array, size * sizeof (INTVAL)); int_array[0] = value; } @@ -270,7 +270,7 @@ Removes the element at C. INTVAL *int_array; GET_ATTR_int_array(INTERP, SELF, int_array); --size; - mem_sys_memmove(int_array + key, int_array + key + 1, (size - key) * sizeof (INTVAL)); + memmove(int_array + key, int_array + key + 1, (size - key) * sizeof (INTVAL)); SELF.set_integer_native(size); } } diff --git a/src/pmc/resizablepmcarray.pmc b/src/pmc/resizablepmcarray.pmc index be1851a820..db98391f84 100644 --- a/src/pmc/resizablepmcarray.pmc +++ b/src/pmc/resizablepmcarray.pmc @@ -66,7 +66,7 @@ do_shift(ARGIN(PMC *arr)) PMC ** const item = PMC_array(arr); PMC_size(arr) = --size; - mem_sys_memmove(item, item + 1, size * sizeof (PMC *)); + memmove(item, item + 1, size * sizeof (PMC *)); item[size] = PMCNULL; } @@ -80,7 +80,7 @@ do_unshift(PARROT_INTERP, ARGIN(PMC *arr), ARGIN(PMC *val)) VTABLE_set_integer_native(interp, arr, size + 1); item = PMC_array(arr); - mem_sys_memmove(item + 1, item, size * sizeof (PMC *)); + memmove(item + 1, item, size * sizeof (PMC *)); item[0] = val; } @@ -306,11 +306,34 @@ Sets the PMC value of the element keyed by C to C<*src>. SUPER(key, src); } + VTABLE void set_pmc(PMC *value) { + INTVAL size; + INTVAL i; + + if (SELF == value) + return; + + if (!VTABLE_does(INTERP, value, CONST_STRING(INTERP, "array"))) + Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_OUT_OF_BOUNDS, + _("Can't set self from this type")); + + if (PMC_array(SELF)) + mem_gc_free(INTERP, PMC_array(SELF)); + + size = PMC_size(SELF) = VTABLE_elements(INTERP, value); + PMC_array(SELF) = mem_gc_allocate_n_typed(INTERP, size, PMC *); + + for (i = 0; i < size; ++i) + (PMC_array(SELF))[i] = VTABLE_get_pmc_keyed_int(INTERP, value, i); + + PObj_custom_mark_destroy_SETALL(SELF); + } + /* -=item C +=item C -=item C +=item C Delete the element at index C. @@ -647,7 +670,7 @@ Note that the C PMC can be of any of the various array types. item = PMC_array(SELF); if (tail > 0 && count > elems1) { /* we're shrinking the array, so first move the tail left */ - mem_sys_memmove(item + offset + elems1, item + offset + count, + memmove(item + offset + elems1, item + offset + count, tail * sizeof (PMC *)); } @@ -657,7 +680,7 @@ Note that the C PMC can be of any of the various array types. item = PMC_array(SELF); if (tail > 0 && count < elems1) { /* the array grew, so move the tail to the right */ - mem_sys_memmove(item + offset + elems1, item + offset + count, + memmove(item + offset + elems1, item + offset + count, tail * sizeof (PMC *)); } diff --git a/src/pmc/role.pmc b/src/pmc/role.pmc index ce24d47445..e469bcd7dc 100644 --- a/src/pmc/role.pmc +++ b/src/pmc/role.pmc @@ -392,7 +392,7 @@ available information is: =item name - String PMC containing the name of the role -=item namespce - NameSpace PMC of the the namespace attached to the role +=item namespce - NameSpace PMC of the namespace attached to the role =item attributes - Hash keyed on attribute name, value is hash describing it diff --git a/src/pmc/scalar.pmc b/src/pmc/scalar.pmc index 8c35b9bdfa..1f6abdc40f 100644 --- a/src/pmc/scalar.pmc +++ b/src/pmc/scalar.pmc @@ -832,32 +832,6 @@ C. return STRING_substr(INTERP, VTABLE_get_string(INTERP, SELF), offset, length); } - -/* - -=item C - -Sets this PMC as shared and read-only. - -=cut - -*/ - VTABLE PMC *share_ro() { - PMC * const ret = pt_shared_fixup(INTERP, SELF); - PMC * const _true = Parrot_pmc_new_init_int(INTERP, enum_class_Integer, 1); - - /* first set readonly */ - VTABLE_setprop(INTERP, ret, CONST_STRING(INTERP, "_ro"), _true); - - /* We're sharing this, so make sure it has a PMC_sync */ - PObj_is_PMC_shared_SET(ret); - - /* XXX FIXME workaround lack of metadata sharing*/ - PMC_metadata(SELF) = NULL; - - return ret; - } - } /* diff --git a/src/pmc/scheduler.pmc b/src/pmc/scheduler.pmc index bff38e66d1..b088980144 100644 --- a/src/pmc/scheduler.pmc +++ b/src/pmc/scheduler.pmc @@ -1,5 +1,5 @@ /* -Copyright (C) 2001-2010, Parrot Foundation. +Copyright (C) 2001-2011, Parrot Foundation. =head1 NAME @@ -24,20 +24,22 @@ Implements the core concurrency scheduler. /* HEADERIZER END: static */ pmclass Scheduler auto_attrs { + ATTR INTVAL id; /* The scheduler's ID. */ + ATTR PMC *handlers; /* The list of currently active handlers. */ + ATTR PMC *messages; /* A message queue used for communication + between schedulers. */ - ATTR INTVAL id; /* The scheduler's ID. */ - ATTR INTVAL max_tid; /* The highest assigned task ID. */ - ATTR INTVAL pending; /* A count of pending tasks (cached for fast - lookup). */ - ATTR PMC *task_list; /* The current list of tasks. */ - ATTR PMC *task_index; /* An index into the current list of tasks, - ordered by priority. */ - ATTR PMC *wait_index; /* An unordered index of inactive tasks. */ - ATTR PMC *handlers; /* The list of currently active handlers. */ - ATTR PMC *messages; /* A message queue used for communication - between schedulers. */ - ATTR Parrot_mutex msg_lock; /* Lock to synchronize the message queue. */ - ATTR Parrot_Interp interp; /* A link to the scheduler's interpreter. */ + ATTR PMC *task_queue; /* List of tasks/green threads waiting to run */ + ATTR PMC *alarms; /* List of future alarms ordered by time */ + + ATTR PMC *all_tasks; /* Hash of all active tasks by ID */ + ATTR UINTVAL next_task_id; /* ID to assign to the next created task */ + ATTR INTVAL enable_preemption; + /* Can perform uncooperative task preemption */ + ATTR INTVAL enable_scheduling; + /* Can perform task scheduling behaviors */ + + ATTR Parrot_Interp interp; /* A link to the scheduler's interpreter. */ /* @@ -58,15 +60,20 @@ Initializes a concurrency scheduler object. PObj_custom_destroy_SET(SELF); /* Set up the core struct. */ - core_struct->id = 0; - core_struct->max_tid = 0; - core_struct->task_list = Parrot_pmc_new(INTERP, enum_class_Hash); - core_struct->task_index = Parrot_pmc_new(INTERP, enum_class_ResizableIntegerArray); - core_struct->wait_index = Parrot_pmc_new(INTERP, enum_class_ResizablePMCArray); - core_struct->handlers = Parrot_pmc_new(INTERP, enum_class_ResizablePMCArray); - core_struct->messages = Parrot_pmc_new(interp, enum_class_ResizablePMCArray); - core_struct->interp = INTERP; - MUTEX_INIT(core_struct->msg_lock); + core_struct->id = 0; + core_struct->handlers = Parrot_pmc_new(INTERP, enum_class_ResizablePMCArray); + core_struct->messages = Parrot_pmc_new(INTERP, enum_class_ResizablePMCArray); + core_struct->task_queue = Parrot_pmc_new(INTERP, enum_class_PMCList); + core_struct->alarms = Parrot_pmc_new(INTERP, enum_class_PMCList); + core_struct->all_tasks = Parrot_pmc_new(INTERP, enum_class_Hash); + core_struct->enable_scheduling = 0; + core_struct->enable_preemption = 0; + core_struct->next_task_id = 0; + core_struct->interp = INTERP; + + /* Chandon TODO: Delete from int-keyed hash doesn't like me. */ + /* VTABLE_set_integer_native(interp, core_struct->all_tasks, Hash_key_type_int); */ + } @@ -105,7 +112,6 @@ An C representing the unique identifier for this scheduler. core_struct->id = VTABLE_get_integer(INTERP, elem); } - /* =item C @@ -118,29 +124,10 @@ current maximum, and a birthtime of the current time. */ void push_pmc(PMC *task) { + /* TODO: This doesn't appear to do anything */ Parrot_Scheduler_attributes * const core_struct = PARROT_SCHEDULER(SELF); - STRING *task_id_str; - INTVAL new_tid; - - task = VTABLE_share_ro(INTERP, task); - VTABLE_set_number_native(INTERP, task, Parrot_floatval_time()); - - new_tid = ++(core_struct->max_tid); - VTABLE_set_integer_native(INTERP, task, new_tid); - task_id_str = Parrot_str_from_int(INTERP, new_tid); - - VTABLE_set_pmc_keyed_str(INTERP, core_struct->task_list, - task_id_str, task); - - if (task->vtable->base_type == enum_class_Timer) - VTABLE_push_integer(INTERP, core_struct->wait_index, new_tid); - else - VTABLE_push_integer(INTERP, core_struct->task_index, new_tid); - - SCHEDULER_cache_valid_CLEAR(SELF); - - if (!VTABLE_does(interp, task, CONST_STRING(interp, "Exception"))) - Parrot_cx_runloop_wake(core_struct->INTERP, SELF); + PMC * const type_pmc = VTABLE_get_attr_str(interp, task, CONST_STRING(interp, "type")); + STRING * const type = VTABLE_get_string(interp, type_pmc); } @@ -156,20 +143,8 @@ recalculates it before retrieving the next task. */ VTABLE PMC *pop_pmc() { - const Parrot_Scheduler_attributes * const core_struct = PARROT_SCHEDULER(SELF); - PMC *task = PMCNULL; - - /* Pull the next valid task off the task list, skipping expired and - * deleted tasks. */ - while (PMC_IS_NULL(task) - && VTABLE_elements(INTERP, core_struct->task_index) > 0) { - const INTVAL tid = VTABLE_shift_integer(INTERP, core_struct->task_index); - - if (tid > 0) - task = VTABLE_get_pmc_keyed_int(INTERP, - core_struct->task_list, tid); - } - + Parrot_Scheduler_attributes * const core_struct = PARROT_SCHEDULER(SELF); + PMC * const task = VTABLE_shift_pmc(INTERP, core_struct->task_queue); return task; } @@ -185,57 +160,8 @@ Retrieves the number of pending tasks in the scheduler's task list. */ VTABLE INTVAL get_integer() { - Parrot_Scheduler_attributes * core_struct = PARROT_SCHEDULER(SELF); - return VTABLE_elements(INTERP, core_struct->task_index); - } - - -/* - -=item C - -Removes the task with the given task ID from the task list. - -=cut - -*/ - - VTABLE void delete_keyed_int(INTVAL key) { - const Parrot_Scheduler_attributes * const core_struct = PARROT_SCHEDULER(SELF); - STRING * const task_id_str = Parrot_str_from_int(INTERP, key); - - VTABLE_delete_keyed_str(INTERP, core_struct->task_list, task_id_str); - SCHEDULER_cache_valid_CLEAR(SELF); - } - - -/* - -=item C - -Sets this PMC as shared. - -=cut - -*/ - - VTABLE PMC *share_ro() { - PMC *shared_self; - Parrot_Scheduler_attributes *sched; - - if (PObj_is_PMC_shared_TEST(SELF)) - return SELF; - - shared_self = pt_shared_fixup(INTERP, SELF); - sched = PARROT_SCHEDULER(shared_self); - - sched->task_list = pt_shared_fixup(INTERP, sched->task_list); - sched->task_index = pt_shared_fixup(INTERP, sched->task_index); - sched->wait_index = pt_shared_fixup(INTERP, sched->wait_index); - sched->handlers = pt_shared_fixup(INTERP, sched->handlers); - sched->messages = pt_shared_fixup(INTERP, sched->messages); - - return shared_self; + Parrot_Scheduler_attributes * const core_struct = PARROT_SCHEDULER(SELF); + return VTABLE_elements(INTERP, core_struct->task_queue); } @@ -250,11 +176,9 @@ Frees the scheduler's underlying struct. */ VTABLE void destroy() { Parrot_Scheduler_attributes * const core_struct = PARROT_SCHEDULER(SELF); + UNUSED(interp); + core_struct->interp->scheduler = NULL; - /* TT #946: this line is causing an order-of-destruction error - because the scheduler is being freed before its tasks. - Commenting this out till we get a real fix (although it's a hack) */ - /* MUTEX_DESTROY(core_struct->msg_lock); */ } @@ -271,12 +195,12 @@ Marks any referenced strings and PMCs as live. if (PARROT_SCHEDULER(SELF)) { Parrot_Scheduler_attributes * const core_struct = PARROT_SCHEDULER(SELF); - 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); - } + Parrot_gc_mark_PMC_alive(INTERP, core_struct->task_queue); + Parrot_gc_mark_PMC_alive(INTERP, core_struct->alarms); + Parrot_gc_mark_PMC_alive(INTERP, core_struct->all_tasks); + } } @@ -294,10 +218,16 @@ C<*info> is the visit info (see F). VTABLE void visit(PMC *info) { /* 1) visit task list */ - VISIT_PMC_ATTR(INTERP, info, SELF, Scheduler, task_list); + VISIT_PMC_ATTR(INTERP, info, SELF, Scheduler, task_queue); /* 2) visit the handlers */ VISIT_PMC_ATTR(INTERP, info, SELF, Scheduler, handlers); + + /* 3) visit the alarms */ + VISIT_PMC_ATTR(INTERP, info, SELF, Scheduler, alarms); + + /* 3) visit all tasks */ + VISIT_PMC_ATTR(INTERP, info, SELF, Scheduler, all_tasks); } @@ -316,12 +246,8 @@ Archives the scheduler. /* 1) freeze scheduler id */ VTABLE_push_integer(INTERP, info, core_struct->id); - - /* 2) freeze maximum task id */ - VTABLE_push_integer(INTERP, info, core_struct->max_tid); } - /* =item C @@ -336,17 +262,11 @@ Unarchives the scheduler. /* 1. thaw scheduler id */ const INTVAL id = VTABLE_shift_integer(INTERP, info); - /* 2. thaw maximum task id */ - const INTVAL max_tid = VTABLE_shift_integer(INTERP, info); - /* Allocate the scheduler's core data struct and set custom flags. */ SELF.init(); /* Set the scheduler's id to the frozen id */ PARROT_SCHEDULER(SELF)->id = id; - - /* Set the scheduler's maximum task id to the frozen tid */ - PARROT_SCHEDULER(SELF)->max_tid = max_tid; } @@ -361,7 +281,7 @@ Finishes thawing the scheduler. */ VTABLE void thawfinish(PMC *info) { - Parrot_cx_refresh_task_list(INTERP, SELF); + /* Parrot_cx_refresh_task_list(INTERP, SELF); */ } @@ -379,156 +299,29 @@ Finishes thawing the scheduler. /* -=item C - -Adds a handler to the scheduler. - -=cut - -*/ - - METHOD add_handler(PMC *handler) { - const Parrot_Scheduler_attributes * const core_struct = PARROT_SCHEDULER(SELF); - VTABLE_unshift_pmc(INTERP, core_struct->handlers, handler); - } - - -/* - -=item C - -Deletes a handler from the scheduler. - -=cut - -*/ - - METHOD delete_handler(STRING *type :optional, INTVAL have_type :opt_flag) { - PMC *handlers; - INTVAL elements, index; - STRING * const except_str = CONST_STRING(INTERP, "exception"); - STRING * const event_str = CONST_STRING(INTERP, "event"); - - GET_ATTR_handlers(INTERP, SELF, handlers); - elements = VTABLE_elements(INTERP, handlers); - - if (!have_type) - VTABLE_shift_pmc(INTERP, handlers); - - /* Loop from newest handler to oldest handler. */ - for (index = 0; index < elements; ++index) { - const PMC * const handler = VTABLE_get_pmc_keyed_int(INTERP, handlers, index); - if (!PMC_IS_NULL(handler)) { - if (STRING_equal(INTERP, type, except_str) - && handler->vtable->base_type == enum_class_ExceptionHandler) { - VTABLE_set_pmc_keyed_int(INTERP, handlers, index, PMCNULL); - RETURN(void); - } - else if (STRING_equal(INTERP, type, event_str) - && handler->vtable->base_type == enum_class_EventHandler) { - VTABLE_set_pmc_keyed_int(INTERP, handlers, index, PMCNULL); - RETURN(void); - } - } - } - - Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_INVALID_OPERATION, - "No handler to delete."); - } - - -/* - -=item C - -Searchs for a handler for the given task. If no handler is found, returns -PMCNULL. - -=cut - -*/ - - METHOD find_handler(PMC *task) { - STRING * const handled_str = CONST_STRING(INTERP, "handled"); - STRING * const iter_str = CONST_STRING(INTERP, "handler_iter"); - STRING * const exception_str = CONST_STRING(INTERP, "Exception"); - PMC *iter; - - /* Exceptions store the handler iterator for rethrow, other kinds of - * tasks don't (though they could). */ - if (VTABLE_does(interp, task, exception_str) - && VTABLE_get_integer_keyed_str(INTERP, task, handled_str) == -1) { - iter = VTABLE_get_attr_str(INTERP, task, iter_str); - } - else { - PMC *handlers; - GET_ATTR_handlers(INTERP, SELF, handlers); - iter = VTABLE_get_iter(INTERP, handlers); - - if (task->vtable->base_type == enum_class_Exception) - VTABLE_set_attr_str(INTERP, task, iter_str, iter); - } - - /* Loop from newest handler to oldest handler. */ - while (VTABLE_get_bool(INTERP, iter)) { - PMC * const handler = VTABLE_shift_pmc(INTERP, iter); - - INTVAL valid_handler; - if (!PMC_IS_NULL(handler)) { - (const INTVAL valid_handler) = PCCINVOKE(INTERP, handler, "can_handle", PMC *task); - if (valid_handler) { - if (!VTABLE_does(interp, task, exception_str)) - VTABLE_set_integer_native(INTERP, handler, 1); - RETURN(PMC *handler); - } - } - - } - - RETURN(PMC *PMCNULL); - } - - -/* - -=item C +=item C -Returns the number of handlers currently held by the scheduler. If a type -argument is passed, only counts handlers of that type (C, C). -If no type argument is passed, counts all handlers. +Returns a ResizablePMCArray containing pointers to all active tasks. =cut */ - METHOD count_handlers(STRING *type :optional, INTVAL have_type :opt_flag) { - /* avoid uninitialized value warning */ - PMC *handlers = NULL; - INTVAL elements; - INTVAL count = 0; - INTVAL index; - - GET_ATTR_handlers(INTERP, SELF, handlers); - elements = VTABLE_elements(INTERP, handlers); - - if (!have_type) - RETURN(INTVAL elements); - - for (index = 0; index < elements; ++index) { - const PMC * const handler = VTABLE_get_pmc_keyed_int(INTERP, handlers, index); - const STRING * const exception = CONST_STRING(INTERP, "exception"); - const STRING * const event = CONST_STRING(INTERP, "event"); - - if (!PMC_IS_NULL(handler)) { - if ((STRING_equal(INTERP, type, exception) - && handler->vtable->base_type == enum_class_ExceptionHandler) - || (STRING_equal(INTERP, type, event) - && handler->vtable->base_type == enum_class_EventHandler)) - ++count; - } + METHOD active_tasks() { + Parrot_Scheduler_attributes *sdata = PARROT_SCHEDULER(SELF); + PMC * const tasks = Parrot_pmc_new(interp, enum_class_ResizablePMCArray); + PMC * const iter = Parrot_pmc_new_init(interp, enum_class_HashIterator, sdata->all_tasks); + + while (!VTABLE_get_bool(interp, iter)) { + PMC * const pair = VTABLE_shift_pmc(interp, iter); + PMC * task = PMCNULL; + STRING * const value = CONST_STRING(interp, "value"); + Parrot_pcc_invoke_method_from_c_args(interp, pair, + value, "->P", &task); + VTABLE_push_pmc(interp, tasks, task); } - RETURN(INTVAL count); + RETURN(PMC* tasks); } } diff --git a/src/pmc/schedulermessage.pmc b/src/pmc/schedulermessage.pmc index 670c5e0ec9..248d951cd2 100644 --- a/src/pmc/schedulermessage.pmc +++ b/src/pmc/schedulermessage.pmc @@ -170,31 +170,6 @@ Set the message type. core_struct->type = value; } - -/* - -=item C - -Set this PMC as shared. - -=cut - -*/ - - VTABLE PMC *share_ro() { - PMC *shared_self; - Parrot_SchedulerMessage_attributes *shared_struct; - - if (PObj_is_PMC_shared_TEST(SELF)) - return SELF; - - shared_self = pt_shared_fixup(INTERP, SELF); - shared_struct = PARROT_SCHEDULERMESSAGE(shared_self); - shared_struct->data = pt_shared_fixup(INTERP, shared_struct->data); - - return shared_self; - } - /* =item C diff --git a/src/pmc/socket.pmc b/src/pmc/socket.pmc index 663ab7c6b5..21630c9bae 100644 --- a/src/pmc/socket.pmc +++ b/src/pmc/socket.pmc @@ -157,7 +157,7 @@ Returns whether the Socket is currently open. =item C -Watches the socket for C seconds and C milliseconds. C +Watches the socket for C seconds and C microseconds. C is a bitmask representing the states you want to watch for. Or together 1 for readable, two for writeable, and four for exceptions. @@ -439,27 +439,32 @@ Read the given number of bytes from the socket and return them in a string. /* -=item C +=item C -Read a line from the socket and return it in a string. +Read a line from the socket and return it in a string. If C is +present, it is used to determine line endings instead of the default C<\n>. =cut */ - METHOD readline() { + METHOD readline(STRING *delimiter :optional, + INTVAL has_delimiter :opt_flag) { INTVAL idx; STRING *result; STRING *buf; GET_ATTR_buf(INTERP, SELF, buf); + if (!has_delimiter) + delimiter = CONST_STRING(INTERP, "\n"); + if (Parrot_io_socket_is_closed(INTERP, SELF)) RETURN(STRING * STRINGNULL); if (buf == STRINGNULL) buf = Parrot_io_reads(INTERP, SELF, CHUNK_SIZE); - while ((idx = Parrot_str_find_index(INTERP, buf, CONST_STRING(INTERP, "\n"), 0)) < 0) { + while ((idx = Parrot_str_find_index(INTERP, buf, delimiter, 0)) < 0) { STRING * const more = Parrot_io_reads(INTERP, SELF, CHUNK_SIZE); if (Parrot_str_length(INTERP, more) == 0) { SET_ATTR_buf(INTERP, SELF, STRINGNULL); @@ -468,7 +473,7 @@ Read a line from the socket and return it in a string. buf = Parrot_str_concat(INTERP, buf, more); } - idx++; + idx += Parrot_str_length(INTERP, delimiter); result = Parrot_str_substr(INTERP, buf, 0, idx); buf = Parrot_str_substr(INTERP, buf, idx, Parrot_str_length(INTERP, buf) - idx); SET_ATTR_buf(INTERP, SELF, buf); diff --git a/src/pmc/string.pmc b/src/pmc/string.pmc index c4116c39e9..25332e56c8 100644 --- a/src/pmc/string.pmc +++ b/src/pmc/string.pmc @@ -728,18 +728,6 @@ characters, other digit representations aren't allowed. } } - VTABLE PMC *share_ro() { - STRING *str_val; - PMC * const ret = SUPER(); - - GET_ATTR_str_val(INTERP, SELF, str_val); - if (!STRING_IS_NULL(str_val)) { - /* prevent wrong garbage collection */ - PObj_is_shared_SET(str_val); - } - return ret; - } - VTABLE STRING* get_repr() { return VTABLE_get_string(INTERP, SELF); } diff --git a/src/pmc/stringbuilder.pmc b/src/pmc/stringbuilder.pmc index 35b5c9f6de..88712dec7e 100644 --- a/src/pmc/stringbuilder.pmc +++ b/src/pmc/stringbuilder.pmc @@ -27,7 +27,20 @@ PARROT_WARN_UNUSED_RESULT PARROT_CONST_FUNCTION static size_t calculate_capacity(PARROT_INTERP, size_t needed); +static void convert_encoding(PARROT_INTERP, + ARGIN(STR_VTABLE *dest_encoding), + ARGMOD(STRING *buffer), + size_t size_to_add) + __attribute__nonnull__(1) + __attribute__nonnull__(2) + __attribute__nonnull__(3) + FUNC_MODIFIES(*buffer); + #define ASSERT_ARGS_calculate_capacity __attribute__unused__ int _ASSERT_ARGS_CHECK = (0) +#define ASSERT_ARGS_convert_encoding __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ + PARROT_ASSERT_ARG(interp) \ + , PARROT_ASSERT_ARG(dest_encoding) \ + , PARROT_ASSERT_ARG(buffer)) /* Don't modify between HEADERIZER BEGIN / HEADERIZER END. Your changes will be lost. */ /* HEADERIZER END: static */ @@ -183,24 +196,8 @@ Append string to current buffer. if (s->encoding != Parrot_utf8_encoding_ptr) s = Parrot_utf8_encoding_ptr->to_encoding(interp, s); - if (buffer->encoding != Parrot_utf8_encoding_ptr) { - /* Create new temporary string */ - STRING * new_buffer; - - new_buffer = Parrot_utf8_encoding_ptr->to_encoding(interp, buffer); - total_size = new_buffer->bufused + s->bufused; - - if (total_size > buffer->_buflen) { - /* Reallocate */ - total_size = calculate_capacity(INTERP, total_size); - Parrot_gc_reallocate_string_storage(INTERP, buffer, total_size); - } - buffer->bufused = new_buffer->bufused; - buffer->encoding = new_buffer->encoding; - - mem_sys_memcopy(buffer->strstart, new_buffer->strstart, - new_buffer->bufused); - } + if (buffer->encoding != Parrot_utf8_encoding_ptr) + convert_encoding(INTERP, Parrot_utf8_encoding_ptr, buffer, s->bufused); } } @@ -216,7 +213,7 @@ Append string to current buffer. } /* Tack s on the end of buffer */ - mem_sys_memcopy((void *)((ptrcast_t)buffer->_bufstart + buffer->bufused), + memcpy((void *)((ptrcast_t)buffer->_bufstart + buffer->bufused), s->strstart, s->bufused); /* Update buffer */ @@ -228,6 +225,32 @@ Append string to current buffer. PARROT_ASSERT(buffer->bufused <= Buffer_buflen(buffer)); } + VTABLE void push_integer(INTVAL value) { + STRING * s = PARROT_STRINGBUILDER(SELF)->buffer; + String_iter iter; + size_t total_size; + + if (s->encoding != Parrot_utf8_encoding_ptr && value > 0x7F) { + if (s->strlen == 0) + s->encoding = Parrot_utf8_encoding_ptr; + else + convert_encoding(INTERP, Parrot_utf8_encoding_ptr, s, sizeof (INTVAL)); + } + + total_size = s->bufused + sizeof (INTVAL); + if (total_size > s->_buflen) { + total_size = calculate_capacity(INTERP, total_size); + Parrot_gc_reallocate_string_storage(INTERP, s, total_size); + } + + STRING_ITER_INIT(INTERP, &iter); + iter.charpos = s->strlen; + iter.bytepos = s->bufused; + STRING_iter_set_and_advance(INTERP, s, &iter, value); + s->strlen = iter.charpos; + s->bufused = iter.bytepos; + } + /* =item C @@ -278,7 +301,7 @@ Set content of buffer to passed string or PMC } /* Tack s on the buffer */ - mem_sys_memcopy((void *)((char*)buffer->_bufstart), + memcpy((void *)((char*)buffer->_bufstart), s->strstart, s->bufused); /* Update buffer */ @@ -321,7 +344,7 @@ For testing purpose only? VTABLE STRING *substr(INTVAL offset, INTVAL length) { STRING *buffer; GET_ATTR_buffer(INTERP, SELF, buffer); - /* We must clone here becase we can reallocate buffer behind the scene... */ + /* We must clone here because we can reallocate buffer behind the scene... */ /* TODO Optimize it to avoid creation of redundant STRING */ return Parrot_str_clone(INTERP, STRING_substr(INTERP, buffer, offset, length)); @@ -464,8 +487,6 @@ Returns length of currently built string. Calculate capacity for string. We allocate double the amount needed. -=back - =cut */ @@ -484,6 +505,43 @@ calculate_capacity(SHIM_INTERP, size_t needed) return needed; } +/* + +=item C + +Convert buffer content to the encoding specified and increase its size, +reallocating it if needed. + +=back + +=cut + +*/ + +static void +convert_encoding(PARROT_INTERP, ARGIN(STR_VTABLE *dest_encoding), + ARGMOD(STRING *buffer), size_t size_to_add) +{ + ASSERT_ARGS(convert_encoding) + STRING * new_buffer; + size_t total_size; + + new_buffer = dest_encoding->to_encoding(interp, buffer); + total_size = new_buffer->bufused + size_to_add; + + if (total_size > buffer->_buflen) { + /* Reallocate */ + total_size = calculate_capacity(interp, total_size); + Parrot_gc_reallocate_string_storage(interp, buffer, total_size); + } + buffer->bufused = new_buffer->bufused; + buffer->encoding = new_buffer->encoding; + + memcpy(buffer->strstart, new_buffer->strstart, + new_buffer->bufused); +} + /* * Local variables: * c-file-style: "parrot" diff --git a/src/pmc/stringiterator.pmc b/src/pmc/stringiterator.pmc index 066f3382ea..6a6a061fcc 100644 --- a/src/pmc/stringiterator.pmc +++ b/src/pmc/stringiterator.pmc @@ -25,7 +25,7 @@ Implementation of Iterator for String PMC. /* HEADERIZER BEGIN: static */ /* HEADERIZER END: static */ -pmclass StringIterator auto_attrs extends Iterator { +pmclass StringIterator auto_attrs extends Iterator provides iterator { ATTR STRING *str_val; /* String to iterate over */ ATTR String_iter iter; /* String iterator */ ATTR INTVAL reverse; /* Direction of iteration. 1 - for reverse iteration */ diff --git a/src/pmc/structview.pmc b/src/pmc/structview.pmc index 7c589b6ae0..2702be48e2 100644 --- a/src/pmc/structview.pmc +++ b/src/pmc/structview.pmc @@ -44,6 +44,45 @@ typedef struct elt_desc_t { } elt_desc_t; END_PMC_HEADER_PREAMBLE +/* HEADERIZER HFILE: none */ +/* HEADERIZER BEGIN: static */ +/* Don't modify between HEADERIZER BEGIN / HEADERIZER END. Your changes will be lost. */ + +PARROT_DOES_NOT_RETURN +static void buffer_too_small(PARROT_INTERP, + size_t self_size, + size_t buf_size) + __attribute__nonnull__(1); + +static void deallocate_ptrobj(PARROT_INTERP, PMC *obj, ARGFREE(void *ptr)); +PARROT_DOES_NOT_RETURN +static void dereference_null(PARROT_INTERP) + __attribute__nonnull__(1); + +PARROT_DOES_NOT_RETURN +static void dereference_unaligned(PARROT_INTERP, + ARGIN(const void *base_ptr), + size_t align) + __attribute__nonnull__(1) + __attribute__nonnull__(2); + +PARROT_DOES_NOT_RETURN +static void index_out_of_bounds(PARROT_INTERP, INTVAL i) + __attribute__nonnull__(1); + +#define ASSERT_ARGS_buffer_too_small __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ + PARROT_ASSERT_ARG(interp)) +#define ASSERT_ARGS_deallocate_ptrobj __attribute__unused__ int _ASSERT_ARGS_CHECK = (0) +#define ASSERT_ARGS_dereference_null __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ + PARROT_ASSERT_ARG(interp)) +#define ASSERT_ARGS_dereference_unaligned __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ + PARROT_ASSERT_ARG(interp) \ + , PARROT_ASSERT_ARG(base_ptr)) +#define ASSERT_ARGS_index_out_of_bounds __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 */ + #define ALIGN_UP(addr, align) (((addr) + ((align) - 1)) & ~((align) - 1)) #define MAX(x, y) ((y) > (x) ? (y) : (x)) @@ -62,63 +101,28 @@ END_PMC_HEADER_PREAMBLE i = Parrot_key_integer((interp), (k)); \ (k) = orig_k; \ if (i < 0 || n_elts <= (size_t)i) \ - Parrot_ex_throw_from_c_args((interp), NULL, 0, \ - "Struct index out of bounds (%d)", \ - i); \ + index_out_of_bounds((interp), i); \ base_ptr = VTABLE_get_pointer((interp), ptr_pmc); \ ptr = ((char *)base_ptr) + elts[i].byte_offset; \ /* guard against null pointer dereference */ \ if (!base_ptr) \ - Parrot_ex_throw_from_c_args((interp), NULL, 0, \ - "Attempt to derefrence null pointer"); \ + dereference_null((interp)); \ /* guard against out of bounds access */ \ { \ size_t buf_size = VTABLE_get_integer((interp), ptr_pmc); \ size_t self_size; \ GETATTR_StructView_size((interp), (s), self_size); \ if (buf_size && buf_size < self_size) \ - Parrot_ex_throw_from_c_args((interp), NULL, 0, \ - "Buffer length too small for struct " \ - "(at least %d required, got %d)", \ - self_size, buf_size); \ + buffer_too_small((interp), self_size, buf_size); \ } \ /* guard against unaligned access */ \ { \ size_t align; \ GETATTR_StructView_align((interp), (s), align); \ if ((size_t)base_ptr != ALIGN_UP((size_t)base_ptr, align)) \ - Parrot_ex_throw_from_c_args((interp), NULL, 0, \ - "Attempt to dereference unaligned pointer " \ - "(%x, required alignment: %d)", \ - base_ptr, align); \ + dereference_unaligned((interp), base_ptr, align); \ } -/* HEADERIZER HFILE: none */ -/* HEADERIZER BEGIN: static */ -/* Don't modify between HEADERIZER BEGIN / HEADERIZER END. Your changes will be lost. */ - -static void deallocate_ptrobj(PARROT_INTERP, PMC *obj, ARGFREE(void *ptr)); -#define ASSERT_ARGS_deallocate_ptrobj __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 - -Deallocation function to be attached to allocated instances. - -=cut - -*/ - -static void -deallocate_ptrobj(SHIM_INTERP, SHIM(PMC *obj), ARGFREE(void *ptr)) -{ - ASSERT_ARGS(deallocate_ptrobj) - mem_sys_free(ptr); -} - pmclass StructView auto_attrs { ATTR PARROT_DATA_TYPE pack_type; ATTR size_t n_elts; @@ -590,8 +594,8 @@ Get/Set an integer-type element from a struct-pointer PMC. { UINTVAL ux = x; size_t bits, n; - unsigned char tempc; - unsigned char *cptr = (unsigned char *)ptr; + unsigned char tempc = 0; + unsigned char *cptr = (unsigned char *)ptr; switch (elts[i].type) { case enum_type_uint1: @@ -606,7 +610,9 @@ Get/Set an integer-type element from a struct-pointer PMC. } /* cache last byte (for restoring hi bits) */ - tempc = cptr[(bits + elts[i].bit_offset)/8]; + if (bits > 1) { + tempc = cptr[(bits + elts[i].bit_offset - 1)/8]; + } /* write hi bits of first byte */ n = 8 - elts[i].bit_offset; @@ -937,8 +943,8 @@ Return a C to the Cth element of an array of structs. */ METHOD array_offs(PMC *array, INTVAL n) { - void *p = VTABLE_get_pointer(INTERP, array); - INTVAL array_size = VTABLE_get_integer(INTERP, array); + void * const p = VTABLE_get_pointer(INTERP, array); + const INTVAL array_size = VTABLE_get_integer(INTERP, array); PMC *ret; size_t size, align; GET_ATTR_size(INTERP, SELF, size); @@ -946,18 +952,14 @@ Return a C to the Cth element of an array of structs. /* sanity checks */ if (!p) - Parrot_ex_throw_from_c_args(INTERP, NULL, 0, - "Attempt to dereference null pointer"); + dereference_null(INTERP); if (array_size && array_size < (int)size * n) Parrot_ex_throw_from_c_args(INTERP, NULL, 0, "Buffer length too small for struct array " "(at least %d required, got %d)", size * n, array_size); if ((size_t)p != ALIGN_UP((size_t)p, align)) - Parrot_ex_throw_from_c_args(INTERP, NULL, 0, - "Attempt to dereference unaligned pointer " - "(%x, required alignement: %d)", - p, align); + dereference_unaligned(INTERP, p, align); size = ALIGN_UP(size, align); ret = Parrot_pmc_new_init_int(INTERP, enum_class_Ptr, (INTVAL)((char *)p + size * n)); @@ -985,13 +987,11 @@ Return a C to the Cth element of a struct. /* sanity checks */ if (n < 0 || n_elts <= (size_t)n) - Parrot_ex_throw_from_c_args(INTERP, NULL, 0, - "Struct index out of bounds (%d)", n); + index_out_of_bounds(INTERP, n); if (!p) - Parrot_ex_throw_from_c_args(INTERP, NULL, 0, - "Attempt to dereference null pointer"); + dereference_null(INTERP); { - size_t buf_size = VTABLE_get_integer(INTERP, array); + const size_t buf_size = VTABLE_get_integer(INTERP, array); size_t self_size; GET_ATTR_size(INTERP, SELF, self_size); if (buf_size && buf_size < self_size) @@ -1004,10 +1004,7 @@ Return a C to the Cth element of a struct. size_t align; GET_ATTR_align(INTERP, SELF, align); if ((size_t)p != ALIGN_UP((size_t)p, align)) - Parrot_ex_throw_from_c_args(INTERP, NULL, 0, - "Attempt to dereference unaligned pointer " - "(%x, required alignement: %d)", - p, align); + dereference_unaligned(INTERP, p, align); } p = ((char *)p) + elts[n].byte_offset; @@ -1123,6 +1120,80 @@ Implement the freeze/thaw API. =back +=head2 Auxiliar functions + +=over 4 + +=item C + +Deallocation function to be attached to allocated instances. + +=item C + +=item C + +=item C + +=item C + +Throw the appropiate exception. + +=cut + +*/ + +static void +deallocate_ptrobj(SHIM_INTERP, SHIM(PMC *obj), ARGFREE(void *ptr)) +{ + ASSERT_ARGS(deallocate_ptrobj) + mem_sys_free(ptr); +} + +PARROT_DOES_NOT_RETURN +static void +dereference_null(PARROT_INTERP) +{ + ASSERT_ARGS(dereference_null) + Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_UNEXPECTED_NULL, + "Attempt to derefrence null pointer"); +} + +PARROT_DOES_NOT_RETURN +static void +index_out_of_bounds(PARROT_INTERP, INTVAL i) +{ + ASSERT_ARGS(index_out_of_bounds) + Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_OUT_OF_BOUNDS, + "Struct index out of bounds (%d)", + i); +} + +PARROT_DOES_NOT_RETURN +static void +buffer_too_small(PARROT_INTERP, size_t self_size, size_t buf_size) +{ + ASSERT_ARGS(buffer_too_small) + Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_BAD_BUFFER_SIZE, + "Buffer length too small for struct (at least %d required, got %d)", + self_size, buf_size); +} + +PARROT_DOES_NOT_RETURN +static void +dereference_unaligned(PARROT_INTERP, ARGIN(const void *base_ptr), size_t align) +{ + ASSERT_ARGS(dereference_unaligned) + Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_INVALID_OPERATION, + "Attempt to dereference unaligned pointer (%x, required alignment: %d)", + base_ptr, align); +} + +/* + +=back + =cut */ @@ -1133,4 +1204,3 @@ Implement the freeze/thaw API. * End: * vim: expandtab shiftwidth=4 cinoptions='\:2=2' : */ - diff --git a/src/pmc/sub.pmc b/src/pmc/sub.pmc index dbff658c43..ff9ca14b3e 100644 --- a/src/pmc/sub.pmc +++ b/src/pmc/sub.pmc @@ -79,7 +79,6 @@ pmclass Sub auto_attrs provides invokable { 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. */ @@ -236,8 +235,7 @@ surboutine is fully constructed but not attached to interpreter. attrs->arg_info->named_slurpy = VTABLE_get_integer_keyed_str(INTERP, tmp, CONST_STRING(INTERP, "named_slurpy")); } - /* C and C are not handled here, and shouldn't be, - * because of run-time nature. */ + /* C not handled here, and shouldn't be, because of run-time nature. */ PObj_custom_mark_destroy_SETALL(SELF); } @@ -378,7 +376,6 @@ Invokes the subroutine. VTABLE opcode_t *invoke(void *next) { PMC * const caller_ctx = CURRENT_CONTEXT(INTERP); PMC *ccont = INTERP->current_cont; - PMC *object; /* plain subroutine call * create new context, place it in interpreter */ @@ -416,11 +413,6 @@ Invokes the subroutine. pc = sub->seg->base.data + sub->start_offs; INTERP->current_cont = NULL; - if (ccont == NEED_CONTINUATION) { - ccont = pmc_new(INTERP, enum_class_Continuation); - VTABLE_set_pointer(INTERP, ccont, next); - } - PARROT_ASSERT(!PMC_IS_NULL(ccont)); if (PMC_IS_NULL(context)) @@ -428,11 +420,13 @@ Invokes the subroutine. Parrot_pcc_set_context(INTERP, context); Parrot_pcc_set_caller_ctx(INTERP, context, caller_ctx); + + /* support callcontext reuse */ + if (context == caller_ctx) + Parrot_pcc_free_registers(INTERP, context); + Parrot_pcc_allocate_registers(INTERP, context, sub->n_regs_used); - /* Preserve object */ - object = Parrot_pcc_get_object(INTERP, context); Parrot_pcc_init_context(INTERP, context, caller_ctx); - Parrot_pcc_set_object(INTERP, context, object); Parrot_pcc_set_sub(INTERP, context, SELF); Parrot_pcc_set_continuation(INTERP, context, ccont); @@ -440,7 +434,7 @@ Invokes the subroutine. /* check recursion/call depth */ if (Parrot_pcc_inc_recursion_depth(INTERP, context) > INTERP->recursion_limit) - Parrot_ex_throw_from_c_args(INTERP, next, CONTROL_ERROR, + Parrot_ex_throw_from_c_args(INTERP, next, EXCEPTION_INTERNAL_PANIC, "maximum recursion depth exceeded"); /* and copy set context variables */ @@ -612,13 +606,20 @@ Marks the sub as live. Parrot_gc_mark_STRING_alive(INTERP, sub->ns_entry_name); Parrot_gc_mark_PMC_alive(INTERP, sub->ctx); - Parrot_gc_mark_PMC_alive(INTERP, sub->eval_pmc); Parrot_gc_mark_PMC_alive(INTERP, sub->lex_info); Parrot_gc_mark_PMC_alive(INTERP, sub->outer_ctx); Parrot_gc_mark_PMC_alive(INTERP, sub->outer_sub); Parrot_gc_mark_PMC_alive(INTERP, sub->namespace_name); Parrot_gc_mark_PMC_alive(INTERP, sub->multi_signature); Parrot_gc_mark_PMC_alive(INTERP, sub->namespace_stash); + + /* XXX + * Workaround for things that subclass sub but don't point into packfiles + * (eg: EventHandler) + * TODO: use inheritance properly to avoid this + */ + if (sub->seg) + Parrot_gc_mark_PMC_alive(INTERP, sub->seg->base.pf->view); } /* @@ -1022,7 +1023,7 @@ slurpy arguments). PMC_get_sub(INTERP, SELF, sub); /* - XXX Rakudo's failing with with this code on ASSERT. Why??? + XXX Rakudo's failing with this code on ASSERT. Why??? GET_ATTR_namespace_stash(INTERP, SELF, _namespace); PARROT_ASSERT(_namespace == sub->namespace_stash || !"consistency!!!"); */ @@ -1161,6 +1162,10 @@ slurpy arguments). (Experimental) Returns Sub flags. +=item C + +(Experimental) Returns the packfile that contains this Sub + =back =cut @@ -1181,6 +1186,16 @@ slurpy arguments). RETURN(INTVAL flags); } + METHOD get_packfile() { + Parrot_Sub_attributes *sub; + PMC *view; + PMC_get_sub(INTERP, SELF, sub); + view = sub->seg->base.pf->view; + if (!view) + view = PMCNULL; + RETURN(PMC * view); + } + } diff --git a/src/pmc/task.pmc b/src/pmc/task.pmc index 4621ece055..e2b6908db5 100644 --- a/src/pmc/task.pmc +++ b/src/pmc/task.pmc @@ -7,7 +7,7 @@ src/pmc/task.pmc - A concurrent task =head1 DESCRIPTION -Implements the basic task behavior for the concurrency scheduler. +The Task PMC represents a concurrent running "green thread". =head2 Functions @@ -18,22 +18,22 @@ Implements the basic task behavior for the concurrency scheduler. */ #include "parrot/scheduler_private.h" +#include "pmc/pmc_scheduler.h" /* HEADERIZER HFILE: none */ /* HEADERIZER BEGIN: static */ /* HEADERIZER END: static */ -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. */ - ATTR STRING *type; /* The type of the task. */ - ATTR STRING *subtype; /* The subtype of the task. */ - ATTR STRING *status; /* The status of the task. */ - ATTR Parrot_Interp interp; /* The interpreter that created the task. */ - ATTR PMC *codeblock; /* An (optional) codeblock for the task. */ - ATTR PMC *data; /* Additional data for the task. */ - ATTR char *cb_data; /* Additional data for a callback event. */ +pmclass Task provides invokable auto_attrs { + ATTR UINTVAL id; /* Unique identifier for this task */ + ATTR FLOATVAL birthtime; /* The creation time stamp of the task */ + ATTR Parrot_Interp interp; /* The interpreter that created the task */ + ATTR PMC *code; /* An (optional) code for the task */ + ATTR PMC *data; /* Additional data for the task */ + ATTR INTVAL killed; /* Dead tasks don't get run */ + ATTR PMC *mailbox; /* List of incoming messages */ + ATTR PMC *waiters; /* Tasks waiting on this one */ + ATTR Parrot_jump_buff abort_jump; /* Jump buffer to abort task */ /* @@ -47,24 +47,30 @@ Initialize a concurrency task object. VTABLE void init() { Parrot_Task_attributes * const core_struct = PARROT_TASK(SELF); + Parrot_Scheduler_attributes * const sched_data = + PARROT_SCHEDULER(interp->scheduler); /* Set flags for custom GC mark. */ PObj_custom_mark_SET(SELF); /* Set up the core struct. */ - core_struct->id = 0; - core_struct->type = CONST_STRING(INTERP, ""); - core_struct->subtype = CONST_STRING(INTERP, ""); - core_struct->priority = 0; - core_struct->status = CONST_STRING(INTERP, "created"); - core_struct->birthtime = 0.0; - core_struct->codeblock = PMCNULL; - core_struct->data = PMCNULL; - core_struct->interp = INTERP; - - /* Make sure the flag is cleared by default */ - TASK_terminate_runloop_CLEAR(SELF); - + core_struct->birthtime = Parrot_floatval_time(); + core_struct->code = PMCNULL; + core_struct->data = PMCNULL; + core_struct->interp = INTERP; + core_struct->killed = 0; + core_struct->mailbox = PMCNULL; /* Created lazily on demand */ + core_struct->waiters = PMCNULL; /* Created lazily on demand */ + + /* Assign a unique ID */ + /* TODO: Fix collisions. */ + core_struct->id = sched_data->next_task_id; + sched_data->next_task_id += 1; + + /* By default, all flags are clear. */ + TASK_active_CLEAR(SELF); + TASK_in_preempt_CLEAR(SELF); + TASK_recv_block_CLEAR(SELF); } /* @@ -75,101 +81,120 @@ Initializes a new Task with a C PMC with any or all of the keys: =over 4 -=item C +=item C -An C representing the task's unique identifier. +The time at which this Task was created. -=item C +=item C -A C representing the type of the task. +An C PMC related to this task. -=item C +=item C -A C representing the subtype of the task. (Used mostly by events and -exceptions to identify appropriate handlers.) +Some data that will be passed to C when invoked. -=item C +=back -An C representing the task's priority, from 0 to 100. +=cut -=item C +*/ -A C representing the task's status, one of C, C, -C, or C. + VTABLE void init_pmc(PMC *data) { + PMC *elem; + Parrot_Task_attributes * const core_struct = PARROT_TASK(SELF); -=item C + SELF.init(); -The time at which this Task was inserted into the task list. + if (VTABLE_isa(INTERP, data, CONST_STRING(INTERP, "Sub"))) { + core_struct->code = data; + } + else if (VTABLE_isa(INTERP, data, CONST_STRING(INTERP, "Hash"))) { + elem = VTABLE_get_pmc_keyed_str(INTERP, data, CONST_STRING(INTERP, "birthtime")); + if (! PMC_IS_NULL(elem)) + core_struct->birthtime = VTABLE_get_number(INTERP, elem); + + elem = VTABLE_get_pmc_keyed_str(INTERP, data, CONST_STRING(INTERP, "code")); + if (! PMC_IS_NULL(elem)) + core_struct->code = elem; + + elem = VTABLE_get_pmc_keyed_str(INTERP, data, CONST_STRING(INTERP, "data")); + if (! PMC_IS_NULL(elem)) + core_struct->data = elem; + } + else { + Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_INVALID_OPERATION, + "Task initializer must be a Hash or Sub"); + } + } -=item C +/* -A C or descendant PMC related to this task. +=item C -=item C +Invokes whatever is in the Task's associated code. -An interpreter in which to execute this task. - -=back +If the Task's data attribute is not null, pass it to the +code as the first argument. =cut */ - VTABLE void init_pmc(PMC *data) { - PMC *elem; - Parrot_Task_attributes *core_struct; + VTABLE opcode_t *invoke(void *next) { + Parrot_Task_attributes * const task = PARROT_TASK(SELF); + Parrot_Scheduler_attributes * const sdata = + PARROT_SCHEDULER(interp->scheduler); + PMC * const active_tasks = sdata->all_tasks; - if (! VTABLE_isa(INTERP, data, CONST_STRING(INTERP, "Hash"))) - Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_INVALID_OPERATION, - "Task initializer must be a Hash"); + /* If a task is pre-empted, this will be set again. */ + TASK_in_preempt_CLEAR(SELF); + +#ifndef WIN32 + if (setjmp(task->abort_jump)) { + /* do nothing, we're back where we want to be */ + } +#endif + + if (!(task->killed || PMC_IS_NULL(task->code))) { + const int current_depth = + Parrot_pcc_get_recursion_depth(interp, CURRENT_CONTEXT(interp)); + /* Add the task to the set of active Tasks */ + PMC *task_id = Parrot_pmc_new(interp, enum_class_Integer); + VTABLE_set_integer_native(interp, task_id, task->id); + VTABLE_set_pmc_keyed(interp, active_tasks, task_id, SELF); + TASK_active_SET(SELF); + + /* Actually run the task */ + Parrot_ext_call(interp, task->code, "P->", task->data); + /* Restore recursion_depth since Parrot_Sub_invoke increments recursion_depth + which would not be decremented anymore if the sub is preempted */ + Parrot_pcc_set_recursion_depth(interp, CURRENT_CONTEXT(interp), current_depth); + } - core_struct = (Parrot_Task_attributes *) PMC_data(SELF); + if (task->killed || !TASK_in_preempt_TEST(SELF)) { + /* The task is done. */ + /* Remove it from the set of active Tasks */ - /* Set flags for custom GC mark. */ - PObj_custom_mark_SET(SELF); + int i, n = 0; + PMC * const task_id = Parrot_pmc_new(interp, enum_class_Integer); + VTABLE_set_integer_native(interp, task_id, task->id); + TASK_active_CLEAR(SELF); + VTABLE_delete_keyed(interp, active_tasks, task_id); - /* Set up the core struct. */ + /* schedule any waiters. */ + if (!PMC_IS_NULL(task->waiters)) + n = VTABLE_get_integer(interp, task->waiters); - elem = VTABLE_get_pmc_keyed_str(INTERP, data, CONST_STRING(INTERP, "id")); - if (! PMC_IS_NULL(elem)) - core_struct->id = VTABLE_get_integer(INTERP, elem); - else - core_struct->id = 0; - - elem = VTABLE_get_pmc_keyed_str(INTERP, data, CONST_STRING(INTERP, "type")); - if (! PMC_IS_NULL(elem)) - core_struct->type = VTABLE_get_string(INTERP, elem); - else - core_struct->type = CONST_STRING(INTERP, ""); - - elem = VTABLE_get_pmc_keyed_str(INTERP, data, CONST_STRING(INTERP, "subtype")); - if (! PMC_IS_NULL(elem)) - core_struct->subtype = VTABLE_get_string(INTERP, elem); - else - core_struct->subtype = CONST_STRING(INTERP, ""); - - elem = VTABLE_get_pmc_keyed_str(INTERP, data, CONST_STRING(INTERP, "priority")); - if (! PMC_IS_NULL(elem)) - core_struct->priority = VTABLE_get_integer(INTERP, elem); - else - core_struct->priority = 0; - - elem = VTABLE_get_pmc_keyed_str(INTERP, data, CONST_STRING(INTERP, "status")); - if (! PMC_IS_NULL(elem)) - core_struct->status = VTABLE_get_string(INTERP, elem); - else - core_struct->status = CONST_STRING(INTERP, "created"); - - elem = VTABLE_get_pmc_keyed_str(INTERP, data, CONST_STRING(INTERP, "birthtime")); - if (! PMC_IS_NULL(elem)) - core_struct->birthtime = VTABLE_get_number(INTERP, elem); - else - core_struct->birthtime = 0.0; - - core_struct->codeblock = VTABLE_get_pmc_keyed_str(INTERP, data, CONST_STRING(INTERP, "code")); - core_struct->interp = (Parrot_Interp)VTABLE_get_pmc_keyed_str(INTERP, data, CONST_STRING(INTERP, "data")); + for (i = 0; i < n; ++i) { + PMC * const wtask = VTABLE_get_pmc_keyed_int(interp, task->waiters, i); + Parrot_cx_schedule_task(interp, wtask); + } + } + + return (opcode_t*) next; } + /* =item C @@ -187,14 +212,12 @@ Create a copy of the task, resetting status, ID, and birthtime. Parrot_Task_attributes * const new_struct = PARROT_TASK(copy); const Parrot_Task_attributes * const old_struct = PARROT_TASK(SELF); - new_struct->codeblock = VTABLE_clone(INTERP, old_struct->codeblock); - new_struct->data = old_struct->data; - new_struct->type = old_struct->type; - new_struct->subtype = old_struct->subtype; - new_struct->priority = old_struct->priority; + new_struct->code = VTABLE_clone(INTERP, old_struct->code); + new_struct->data = VTABLE_clone(INTERP, old_struct->data); return copy; } + /* =item C @@ -204,36 +227,20 @@ Gets the value of an attribute for this task. =cut */ + VTABLE PMC *get_attr_str(STRING *name) { Parrot_Task_attributes * const core_struct = PARROT_TASK(SELF); - PMC *value; + PMC * value = PMCNULL; - if (STRING_equal(INTERP, name, CONST_STRING(INTERP, "id"))) { - value = Parrot_pmc_new_init_int(INTERP, enum_class_Integer, - core_struct->id); - } - else if (STRING_equal(INTERP, name, CONST_STRING(INTERP, "type"))) { - value = Parrot_pmc_new(INTERP, enum_class_String); - VTABLE_set_string_native(INTERP, value, core_struct->type); - } - else if (STRING_equal(INTERP, name, CONST_STRING(INTERP, "subtype"))) { - value = Parrot_pmc_new(INTERP, enum_class_String); - VTABLE_set_string_native(INTERP, value, core_struct->subtype); - } - else if (STRING_equal(INTERP, name, CONST_STRING(INTERP, "priority"))) { - value = Parrot_pmc_new_init_int(INTERP, enum_class_Integer, - core_struct->priority); - } - else if (STRING_equal(INTERP, name, CONST_STRING(INTERP, "status"))) { - value = Parrot_pmc_new(INTERP, enum_class_String); - VTABLE_set_string_native(INTERP, value, core_struct->status); - } - else if (STRING_equal(INTERP, name, CONST_STRING(INTERP, "birthtime"))) { + if (Parrot_str_equal(INTERP, name, CONST_STRING(INTERP, "birthtime"))) { value = Parrot_pmc_new(INTERP, enum_class_Float); VTABLE_set_number_native(INTERP, value, core_struct->birthtime); } - else { - value = PMCNULL; + else if (Parrot_str_equal(INTERP, name, CONST_STRING(INTERP, "code"))) { + value = core_struct->code; + } + else if (Parrot_str_equal(INTERP, name, CONST_STRING(INTERP, "data"))) { + value = core_struct->data; } return value; @@ -248,29 +255,15 @@ Sets the value of an attribute for this task. =cut */ + VTABLE void set_attr_str(STRING *name, PMC *value) { Parrot_Task_attributes * const core_struct = PARROT_TASK(SELF); - if (STRING_equal(INTERP, name, CONST_STRING(INTERP, "id"))) { - core_struct->id = VTABLE_get_integer(INTERP, value); - } - else if (STRING_equal(INTERP, name, CONST_STRING(INTERP, "type"))) { - core_struct->type = VTABLE_get_string(INTERP, value); - } - else if (STRING_equal(INTERP, name, CONST_STRING(INTERP, "subtype"))) { - core_struct->subtype = VTABLE_get_string(INTERP, value); - } - else if (STRING_equal(INTERP, name, CONST_STRING(INTERP, "priority"))) { - core_struct->priority = VTABLE_get_integer(INTERP, value); - } - else if (STRING_equal(INTERP, name, CONST_STRING(INTERP, "status"))) { - core_struct->status = VTABLE_get_string(INTERP, value); - } - else if (STRING_equal(INTERP, name, CONST_STRING(INTERP, "birthtime"))) { + if (Parrot_str_equal(INTERP, name, CONST_STRING(INTERP, "birthtime"))) { core_struct->birthtime = VTABLE_get_number(INTERP, value); } - else if (STRING_equal(INTERP, name, CONST_STRING(INTERP, "code"))) { - core_struct->codeblock = value; + else if (Parrot_str_equal(INTERP, name, CONST_STRING(INTERP, "code"))) { + core_struct->code = value; } else if (STRING_equal(INTERP, name, CONST_STRING(INTERP, "data"))) { core_struct->data = value; @@ -279,98 +272,6 @@ Sets the value of an attribute for this task. /* -=item C - -Retrieves the task ID for this task. - -=cut - -*/ - VTABLE INTVAL get_integer() { - const Parrot_Task_attributes * const core_struct = PARROT_TASK(SELF); - UNUSED(INTERP); - return core_struct->id; - } - -/* - -=item C - -Sets the task ID of the task. - -=cut - -*/ - - VTABLE void set_integer_native(INTVAL value) { - Parrot_Task_attributes * const core_struct = PARROT_TASK(SELF); - UNUSED(INTERP); - core_struct->id = value; - } - -/* - -=item C - -Sets the birthtime of the task. - -=cut - -*/ - - VTABLE void set_number_native(FLOATVAL value) { - Parrot_Task_attributes * const core_struct = PARROT_TASK(SELF); - UNUSED(INTERP); - core_struct->birthtime = value; - } - -/* - -=item C - -Sets the type of the task. - -=cut - -*/ - - VTABLE void set_string_native(STRING *value) { - Parrot_Task_attributes * const core_struct = PARROT_TASK(SELF); - UNUSED(INTERP); - core_struct->type = value; - } - -/* - -=item C - -Set this PMC as shared. - -=cut - -*/ - - VTABLE PMC *share_ro() { - PMC *shared_self; - Parrot_Task_attributes *shared_struct; - - if (PObj_is_PMC_shared_TEST(SELF)) - return SELF; - - shared_self = pt_shared_fixup(INTERP, SELF); - shared_struct = PARROT_TASK(shared_self); - - if (!PMC_IS_NULL(shared_struct->codeblock)) - shared_struct->codeblock = pt_shared_fixup(INTERP, shared_struct->codeblock); - - if (!PMC_IS_NULL(shared_struct->data)) - shared_struct->data = pt_shared_fixup(INTERP, shared_struct->data); - - return shared_self; - } - -/* - =item C Mark any referenced strings and PMCs. @@ -382,11 +283,10 @@ Mark any referenced strings and PMCs. if (PARROT_TASK(SELF)) { Parrot_Task_attributes * const core_struct = PARROT_TASK(SELF); - 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->code); Parrot_gc_mark_PMC_alive(INTERP, core_struct->data); + Parrot_gc_mark_PMC_alive(INTERP, core_struct->mailbox); + Parrot_gc_mark_PMC_alive(INTERP, core_struct->waiters); } } @@ -404,7 +304,10 @@ C<*info> is the visit info, (see F). VTABLE void visit(PMC *info) { /* 1) visit code block */ - VISIT_PMC_ATTR(INTERP, info, SELF, Task, codeblock); + VISIT_PMC_ATTR(INTERP, info, SELF, Task, code); + VISIT_PMC_ATTR(INTERP, info, SELF, Task, data); + VISIT_PMC_ATTR(INTERP, info, SELF, Task, mailbox); + VISIT_PMC_ATTR(INTERP, info, SELF, Task, waiters); } /* @@ -420,23 +323,7 @@ Used to archive the task. VTABLE void freeze(PMC *info) { const Parrot_Task_attributes * const core_struct = PARROT_TASK(SELF); - /* 1) freeze task id */ - VTABLE_push_integer(INTERP, info, core_struct->id); - - /* 2) freeze task birthtime */ VTABLE_push_float(INTERP, info, core_struct->birthtime); - - /* 3) freeze task priority */ - VTABLE_push_integer(INTERP, info, core_struct->priority); - - /* 4) freeze task type */ - VTABLE_push_string(INTERP, info, core_struct->type); - - /* 5) freeze task subtype */ - VTABLE_push_string(INTERP, info, core_struct->subtype); - - /* 6) freeze task status */ - VTABLE_push_string(INTERP, info, core_struct->status); } /* @@ -450,63 +337,98 @@ Used to unarchive the task. */ VTABLE void thaw(PMC *info) { - /* 1. thaw task id */ - const INTVAL id = VTABLE_shift_integer(INTERP, info); - - /* 2. thaw task birthtime */ const FLOATVAL birthtime = VTABLE_shift_float(INTERP, info); - /* 3. thaw task priority */ - const INTVAL priority = VTABLE_shift_integer(INTERP, info); - - /* 4. thaw task type */ - STRING * const type = VTABLE_shift_string(INTERP, info); - - /* 5. thaw task subtype */ - STRING * const subtype = VTABLE_shift_string(INTERP, info); - - /* 6. thaw task status */ - STRING * const status = VTABLE_shift_string(INTERP, info); - /* Allocate the task's core data struct and set custom flags. */ SELF.init(); - /* Set the task's id to the frozen id */ - PARROT_TASK(SELF)->id = id; - /* Set the task's birthtime to the frozen birthtime */ PARROT_TASK(SELF)->birthtime = birthtime; + } + +/* + +=item C - /* Set the task's type to the frozen type */ - PARROT_TASK(SELF)->type = type; +Called after the task has been thawed. - /* Set the task's subtype to the frozen subtype */ - PARROT_TASK(SELF)->subtype = subtype; +=cut - /* Set the task's priority to the frozen priority */ - PARROT_TASK(SELF)->priority = priority; +*/ - /* Set the task's status to the frozen status */ - PARROT_TASK(SELF)->status = status; + VTABLE void thawfinish(PMC *info) { + /* Parrot_Task_attributes * const core_struct = PARROT_TASK(SELF); */ + /* UNUSED(core_struct); *//* Do nothing */ } /* -=item C +=back -Called after the task has been thawed. +=head2 Methdods + +=over 4 + +=item METHOD send(PMC *message) + +Send a message to this task. =cut */ - VTABLE void thawfinish(PMC *info) { - Parrot_Task_attributes * core_struct = PARROT_TASK(SELF); + METHOD send(PMC *message) { + Parrot_Task_attributes * const tdata = PARROT_TASK(SELF); + if (PMC_IS_NULL(tdata->mailbox)) + tdata->mailbox = Parrot_pmc_new(interp, enum_class_PMCList); + VTABLE_push_pmc(interp, tdata->mailbox, message); + + if (TASK_recv_block_TEST(SELF)) { + TASK_recv_block_CLEAR(SELF); + Parrot_cx_schedule_task(interp, SELF); + } + } + +/* + METHOD receive() { + } +*/ - UNUSED(core_struct); /* TODO: Rebuild the task index. */ + METHOD code(PMC * code :optional, INTVAL has_code :opt_flag) { + Parrot_Task_attributes * const tdata = PARROT_TASK(SELF); + if (has_code) { + tdata->code = code; + PARROT_GC_WRITE_BARRIER(INTERP, SELF); + } + code = tdata->code; + RETURN(PMC *code); + } + + METHOD data(PMC * data :optional, INTVAL has_data :opt_flag) { + Parrot_Task_attributes * const tdata = PARROT_TASK(SELF); + if (has_data) { + tdata->data = data; + PARROT_GC_WRITE_BARRIER(INTERP, SELF); + } + data = tdata->data; + RETURN(PMC *data); } +/* + +=item METHOD kill() + +Kill this task. + +=cut + +*/ + + METHOD kill() { + Parrot_Task_attributes * const tdata = PARROT_TASK(SELF); + tdata->killed = 1; + } } /* diff --git a/src/pmc/threadinterpreter.pmc b/src/pmc/threadinterpreter.pmc deleted file mode 100644 index de3ee21665..0000000000 --- a/src/pmc/threadinterpreter.pmc +++ /dev/null @@ -1,108 +0,0 @@ -/* -Copyright (C) 2001-2011, Parrot Foundation. - -=head1 NAME - -src/pmc/threadinterpreter.pmc - INTERNAL Interpreter for OS level worker thread(pthread). - -=head1 DESCRIPTION - -ThreadInterpreter extends ParrotInterpreter to provide a interpreter -to be used internally in a OS level worker thread(pthread). -which supports: - -=head2 Methods - -=over 4 - -=cut - -*/ - -#include "parrot/embed.h" - -/* HEADERIZER HFILE: none */ -/* HEADERIZER BEGIN: static */ -/* Don't modify between HEADERIZER BEGIN / HEADERIZER END. Your changes will be lost. */ - -static void stop_GC(ARGMOD(Interp *parent), ARGMOD(Interp *thread)) - __attribute__nonnull__(1) - __attribute__nonnull__(2) - FUNC_MODIFIES(*parent) - FUNC_MODIFIES(*thread); - -#define ASSERT_ARGS_stop_GC __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ - PARROT_ASSERT_ARG(parent) \ - , PARROT_ASSERT_ARG(thread)) -/* Don't modify between HEADERIZER BEGIN / HEADERIZER END. Your changes will be lost. */ -/* HEADERIZER END: static */ - -#define PMC_interp(x) ((Parrot_ParrotInterpreter_attributes *)PMC_data(x))->interp - -/* - * can't do multi-threaded GC yet - * XXX a quick hack to pass the few tests - */ - -/* - -=item C - -stop GC running - multi-threaded GC is not available yet - -=cut - -*/ - -static void -stop_GC(ARGMOD(Interp *parent), ARGMOD(Interp *thread)) -{ - ASSERT_ARGS(stop_GC) - Parrot_block_GC_mark(parent); - Parrot_block_GC_mark(thread); - Parrot_block_GC_sweep(parent); - Parrot_block_GC_sweep(thread); -} - - - -pmclass ThreadInterpreter extends ParrotInterpreter no_ro manual_attrs { - -/* - -=item C - -Initializes the thread. - -=cut - -*/ - - VTABLE void init() { - /* protect interpreter creation and list handling */ - LOCK(interpreter_array_mutex); - - SUPER(); - pt_add_to_interpreters(INTERP, PMC_interp(SELF)); - - UNLOCK(interpreter_array_mutex); - - /* can't allow GC runs for now */ - stop_GC(INTERP, PMC_interp(SELF)); - } -} - -/* - -=back - -=cut - -*/ - -/* - * Local variables: - * c-file-style: "parrot" - * End: - * vim: expandtab shiftwidth=4 cinoptions='\:2=2' : - */ diff --git a/src/pmc/timer.pmc b/src/pmc/timer.pmc index dc42f6854c..62a33e0c09 100644 --- a/src/pmc/timer.pmc +++ b/src/pmc/timer.pmc @@ -28,11 +28,6 @@ src/pmc/timer.pmc - Timer This is the Timer base class -Running timers are kept in a linked list. Each timer has a tick count, -which gets decremented if the system timer expires. If the tick count -reaches zero, the timer handler gets invoked via Parrot's event handling -code. - The Timer resolution is operating system dependent. It's only guaranteed that the Timer will fire some time after the programmed interval. @@ -55,16 +50,22 @@ initializer. */ #include "parrot/scheduler_private.h" +#include "pmc/pmc_task.h" /* HEADERIZER HFILE: none */ /* HEADERIZER BEGIN: static */ /* HEADERIZER END: static */ -pmclass Timer extends Task provides event provides invokable auto_attrs { +pmclass Timer provides invokable auto_attrs { + ATTR PMC *code; /* The sub to execute */ + ATTR FLOATVAL birthtime; /* When the timer was created */ 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 */ + ATTR INTVAL started; /* 0 = delay for duration then invoke + 1 = delay for interval then invoke */ + ATTR INTVAL running; /* 0 = never started or since cancelled */ /* @@ -78,26 +79,16 @@ Initializes the timer. VTABLE void init() { Parrot_Timer_attributes * const core_struct = PARROT_TIMER(SELF); - - /* Set flags for custom GC mark and destroy. */ - PObj_custom_mark_SET(SELF); - PObj_custom_destroy_SET(SELF); + SUPER(); /* Set up the core struct. */ - core_struct->id = 0; - core_struct->type = CONST_STRING(INTERP, "timer"); - core_struct->subtype = CONST_STRING(INTERP, ""); - core_struct->priority = 0; - core_struct->status = CONST_STRING(interp, "created"); - core_struct->birthtime = 0.0; - core_struct->codeblock = PMCNULL; - core_struct->interp = INTERP; - core_struct->duration = 0.0; - core_struct->interval = 0.0; - core_struct->repeat = 0; - - /* Make sure the flag is cleared by default */ - TASK_terminate_runloop_CLEAR(SELF); + core_struct->code = PMCNULL; + core_struct->birthtime = 0.0; + core_struct->duration = 0.0; + core_struct->interval = 0.0; + core_struct->repeat = 0; + core_struct->started = 0; + core_struct->running = 0; } /* @@ -129,6 +120,7 @@ Takes an even-length collection of keys and values. } break; case PARROT_TIMER_NSEC: + case PARROT_TIMER_INTERVAL: { const FLOATVAL nval = VTABLE_get_number_keyed_int(INTERP, init, i+1); SELF.set_number_keyed_int(key, nval); @@ -157,33 +149,21 @@ Create a copy of the timer, resetting status, id, and birthtime. */ VTABLE PMC *clone() { - PMC * const copy = SUPER(); + PMC * const copy = Parrot_pmc_new(INTERP, SELF->vtable->base_type); + Parrot_Timer_attributes * const new_struct = PARROT_TIMER(copy); const Parrot_Timer_attributes * const old_struct = PARROT_TIMER(SELF); new_struct->duration = old_struct->duration; new_struct->interval = old_struct->interval; new_struct->repeat = old_struct->repeat; + new_struct->code = old_struct->code; return copy; } /* -=item C - -Destroys the timer. - -=cut - -*/ - - VTABLE void destroy() { - Parrot_cx_delete_task(INTERP, SELF); - } - -/* - =item C Returns the timer info for C. @@ -227,7 +207,7 @@ Returns the PMC associated with C. UNUSED(INTERP); if (key == PARROT_TIMER_HANDLER) { const Parrot_Timer_attributes * const core_struct = PARROT_TIMER(SELF); - return core_struct->codeblock; + return core_struct->code; } return PMCNULL; @@ -286,10 +266,9 @@ Sets the value associated with C to C. core_struct->interval = value; break; case PARROT_TIMER_RUNNING: + core_struct->running = value; if (value) - Parrot_cx_schedule_task(INTERP, SELF); - else - Parrot_cx_delete_task(INTERP, SELF); + (void) SELF.invoke(0); break; default: Parrot_ex_throw_from_c_args(INTERP, NULL, @@ -311,11 +290,7 @@ Sets the PMC associated with C to C<*value>. VTABLE void set_pmc_keyed_int(INTVAL key, PMC *value) { if (key == PARROT_TIMER_HANDLER) { -/* - Parrot_Timer_attributes * const core_struct = PARROT_TIMER(SELF); - core_struct->codeblock = value; -*/ - SET_ATTR_codeblock(INTERP, SELF, value); + SET_ATTR_code(INTERP, SELF, value); } } @@ -323,15 +298,71 @@ Sets the PMC associated with C to C<*value>. =item C -Adds the timer to the event queue. +Either: +Initially schedule the timer. +or +Invoke the codeblock and schedule any repeats. =cut */ VTABLE opcode_t *invoke(void *next) { - Parrot_cx_schedule_task(INTERP, SELF); - return (opcode_t *)next; + Parrot_Timer_attributes *const timer = PARROT_TIMER(SELF); + FLOATVAL now_time; + PMC* alarm; + PMC* task; + Parrot_Task_attributes *tdata; + + /* If the timer has been cancelled, we're done */ + if (timer->running == 0) + return (opcode_t*) next; + + if (timer->started == 0) { + /* We're being called to start the timer. */ + timer->started = 1; + timer->running = 1; + + now_time = Parrot_floatval_time(); + + task = Parrot_pmc_new(INTERP, enum_class_Task); + tdata = PARROT_TASK(task); + tdata->code = SELF; + + alarm = Parrot_pmc_new(INTERP, enum_class_Alarm); + VTABLE_set_number_keyed_int(INTERP, alarm, PARROT_ALARM_TIME, + now_time + timer->duration); + + + VTABLE_set_pmc_keyed_int(INTERP, alarm, PARROT_ALARM_TASK, task); + next = VTABLE_invoke(INTERP, alarm, next); + } + else { + /* This is the timer triggering. */ + if (!PMC_IS_NULL(timer->code)) { + Parrot_ext_call(interp, timer->code, "->"); + } + + /* Repeat semantics as documented. */ + if (timer->repeat != 0) { + if (timer->repeat > 0) + timer->repeat--; + + now_time = Parrot_floatval_time(); + + task = Parrot_pmc_new(INTERP, enum_class_Task); + tdata = PARROT_TASK(task); + tdata->code = SELF; + + alarm = Parrot_pmc_new(INTERP, enum_class_Alarm); + VTABLE_set_number_keyed_int(INTERP, alarm, PARROT_ALARM_TIME, + now_time + timer->interval); + VTABLE_set_pmc_keyed_int(INTERP, alarm, PARROT_ALARM_TASK, task); + next = VTABLE_invoke(INTERP, alarm, next); + } + } + + return (opcode_t*) next; } /* @@ -361,6 +392,23 @@ Sets the floating-point value associated with C to C. key); } } + +/* + +=item C + +Mark any referenced strings and PMCs. + +=cut + +*/ + VTABLE void mark() { + if (PARROT_TIMER(SELF)) { + Parrot_Timer_attributes * const core_struct = PARROT_TIMER(SELF); + Parrot_gc_mark_PMC_alive(INTERP, core_struct->code); + } + } + } /* diff --git a/src/pmc/undef.pmc b/src/pmc/undef.pmc index 303b4e5bc8..10a34ef363 100644 --- a/src/pmc/undef.pmc +++ b/src/pmc/undef.pmc @@ -49,7 +49,7 @@ appropriate type. } else { PMC * const clone = VTABLE_clone(INTERP, other); - void *attrs = PMC_data(clone); + void * const attrs = PMC_data(clone); PMC * const meta = PMC_metadata(clone); /* now swap memory without leaking it */ @@ -63,7 +63,7 @@ appropriate type. 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); + Parrot_pmc_setprop(INTERP, SELF, key, value); } } PMC_data(clone) = NULL; diff --git a/src/pmc/unmanagedstruct.pmc b/src/pmc/unmanagedstruct.pmc index 5f49174653..976b4dcd3b 100644 --- a/src/pmc/unmanagedstruct.pmc +++ b/src/pmc/unmanagedstruct.pmc @@ -1,5 +1,5 @@ /* -Copyright (C) 2001-2011, Parrot Foundation. +Copyright (C) 2001-2012, Parrot Foundation. =head1 NAME @@ -22,6 +22,7 @@ bounds access will very likely segfault. */ #include "parrot/compiler.h" +#include "parrot/string_funcs.h" /* HEADERIZER HFILE: none */ /* HEADERIZER BEGIN: static */ @@ -309,7 +310,7 @@ char_offset_key(PARROT_INTERP, ARGIN(PMC *pmc), ARGIN(PMC *key), ARGOUT(int *typ /* the struct PMC is hanging off the initializer element * as property "_struct" */ PMC * const ptr = VTABLE_get_pmc_keyed_int(interp, init, ix); - init = VTABLE_getprop(interp, ptr, CONST_STRING(interp, "_struct")); + init = Parrot_pmc_getprop(interp, ptr, CONST_STRING(interp, "_struct")); PARROT_ASSERT(init && (init->vtable->base_type == enum_class_UnManagedStruct @@ -531,7 +532,7 @@ ret_pmc(PARROT_INTERP, ARGIN(PMC *pmc), ARGIN(char *p), int type, INTVAL idx) /* now check if initializer has a signature attached */ if (PMC_metadata(ptr)) { STRING *signature_str = CONST_STRING(interp, "_signature"); - PMC * const sig = VTABLE_getprop(interp, ptr, signature_str); + PMC * const sig = Parrot_pmc_getprop(interp, ptr, signature_str); if (VTABLE_defined(interp, sig)) { STRING * const sig_str = VTABLE_get_string(interp, sig); ret = Parrot_pmc_new(interp, enum_class_NCI); @@ -546,7 +547,7 @@ ret_pmc(PARROT_INTERP, ARGIN(PMC *pmc), ARGIN(char *p), int type, INTVAL idx) /* grab the struct from the metadata */ if (PMC_metadata(ptr)) - ret = VTABLE_getprop(interp, ptr, CONST_STRING(interp, "_struct")); + ret = Parrot_pmc_getprop(interp, ptr, CONST_STRING(interp, "_struct")); else { Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_INVALID_OPERATION, @@ -687,14 +688,13 @@ calc_align(PARROT_INTERP, ARGIN(PMC *type_pmc), int type, size_t offs) if (type == enum_type_struct || type == enum_type_struct_ptr) { /* a nested structs alignment is the biggest item in it * so go through that struct and check */ - nested = VTABLE_getprop(interp, type_pmc, CONST_STRING(interp, "_struct")); + nested = Parrot_pmc_getprop(interp, type_pmc, CONST_STRING(interp, "_struct")); nested_init = PARROT_UNMANAGEDSTRUCT(nested)->init; } if (type == enum_type_struct) { INTVAL i; const INTVAL n = (size_t)VTABLE_elements(interp, nested_init); int a_max = 0; - int new_offs; if (n % 3) Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_INVALID_OPERATION, @@ -705,8 +705,7 @@ calc_align(PARROT_INTERP, ARGIN(PMC *type_pmc), int type, size_t offs) nested_init, i); const int nested_type = (int)VTABLE_get_integer(interp, nested_type_pmc); - new_offs = calc_align(interp, - nested_type_pmc, nested_type, offs); + const int new_offs = calc_align(interp, nested_type_pmc, nested_type, offs); if (new_offs > a_max) a_max = new_offs; @@ -776,15 +775,15 @@ calc_offsets(PARROT_INTERP, ARGIN(PMC *pmc), ARGIN(PMC *value), size_t toff) toff = offs; if (type == enum_type_struct) { - PMC * const nested = VTABLE_getprop(interp, type_pmc, _struct); + PMC * const nested = Parrot_pmc_getprop(interp, type_pmc, _struct); size = VTABLE_get_integer(interp, nested); } else if (type == enum_type_struct_ptr) { - PMC * const nested = VTABLE_getprop(interp, type_pmc, _struct); + PMC * const nested = Parrot_pmc_getprop(interp, type_pmc, _struct); /* must clone this struct so as not to share its memory */ if (nested->vtable->base_type == enum_class_ManagedStruct) - VTABLE_setprop(interp, type_pmc, _struct, + Parrot_pmc_setprop(interp, type_pmc, _struct, VTABLE_clone(interp, nested)); size = data_types[type - enum_first_type].size; @@ -856,7 +855,7 @@ Return a clone of this PMC. VTABLE PMC *clone() { PMC * const clone = Parrot_pmc_new(INTERP, enum_class_UnManagedStruct); - mem_sys_memmove(PMC_data(clone), PMC_data(SELF), + memmove(PMC_data(clone), PMC_data(SELF), sizeof (Parrot_UnManagedStruct_attributes)); PARROT_UNMANAGEDSTRUCT(clone)->init = VTABLE_clone(INTERP, PARROT_UNMANAGEDSTRUCT(SELF)->init); @@ -987,7 +986,7 @@ Returns the integer value associated with C<*key>. VTABLE INTVAL get_integer_keyed(PMC *key) { int type; - char * const p = char_offset_key(INTERP, SELF, key, &type); + const char * const p = char_offset_key(INTERP, SELF, key, &type); return ret_int(INTERP, p, type); } @@ -1233,21 +1232,8 @@ specified. If the encoding is omitted or null, use platform encoding. */ METHOD as_string(STRING *encodingname :optional) { - STRING *result = STRINGNULL; const char * content = (const char *)SELF.get_pointer(); - if (content) { - const STR_VTABLE *encoding = STRING_IS_NULL(encodingname) ? - Parrot_platform_encoding_ptr : - Parrot_find_encoding_by_string(INTERP, encodingname); - if (encoding == NULL) - Parrot_ex_throw_from_c_args(interp, NULL, - EXCEPTION_INVALID_ENCODING, - "Invalid encoding"); - else { - int size = strlen(content); - result = Parrot_str_new_init(INTERP, content, size, encoding, 0); - } - } + STRING * const result = Parrot_str_new_from_cstring(INTERP, content, encodingname); RETURN(STRING result); } diff --git a/src/pointer_array.c b/src/pointer_array.c index f63427f6d7..8f7df15c34 100644 --- a/src/pointer_array.c +++ b/src/pointer_array.c @@ -17,20 +17,6 @@ src/pointer_array.c - Implementation Pointer Array storage. /* HEADERIZER HFILE: include/parrot/pointer_array.h */ -/* HEADERIZER BEGIN: static */ -/* Don't modify between HEADERIZER BEGIN / HEADERIZER END. Your changes will be lost. */ - -static void allocate_more_chunks(PARROT_INTERP, - ARGIN(Parrot_Pointer_Array *self)) - __attribute__nonnull__(1) - __attribute__nonnull__(2); - -#define ASSERT_ARGS_allocate_more_chunks __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ - PARROT_ASSERT_ARG(interp) \ - , PARROT_ASSERT_ARG(self)) -/* Don't modify between HEADERIZER BEGIN / HEADERIZER END. Your changes will be lost. */ -/* HEADERIZER END: static */ - /* =over 4 @@ -50,7 +36,7 @@ Parrot_Pointer_Array * Parrot_pa_new(PARROT_INTERP) { ASSERT_ARGS(Parrot_pa_new) - Parrot_Pointer_Array * const res = mem_allocate_zeroed_typed(Parrot_Pointer_Array); + Parrot_Pointer_Array * const res = mem_internal_allocate_zeroed_typed(Parrot_Pointer_Array); return res; } @@ -118,8 +104,8 @@ Parrot_pa_count_used(PARROT_INTERP, ARGIN(const Parrot_Pointer_Array *self)) /* -=item C +=item C Check that C pointer is stored in C cell. Used during system stack t @@ -127,9 +113,10 @@ Check that C pointer is stored in C cell. Used during system stack t */ PARROT_EXPORT +PARROT_WARN_UNUSED_RESULT int -Parrot_pa_is_owned(PARROT_INTERP, ARGIN(Parrot_Pointer_Array *self), - ARGIN(void *orig), ARGIN_NULLOK(void *ref)) +Parrot_pa_is_owned(ARGIN(const Parrot_Pointer_Array *self), + ARGIN(const void *orig), ARGIN_NULLOK(const void *ref)) { ASSERT_ARGS(Parrot_pa_is_owned) size_t i; @@ -146,7 +133,7 @@ Parrot_pa_is_owned(PARROT_INTERP, ARGIN(Parrot_Pointer_Array *self), continue; if (PTR2UINTVAL(ref) > PTR2UINTVAL(chunk) + CHUNK_SIZE) continue; - return (*(void **)ref == orig); + return (*(void * const *)ref == orig); } return 0; diff --git a/src/runcore/cores.c b/src/runcore/cores.c index 5ea4e619a0..dfe1b4313f 100644 --- a/src/runcore/cores.c +++ b/src/runcore/cores.c @@ -242,7 +242,6 @@ next opcode, or examine and manipulate data from the executing program. */ #include "parrot/runcore_api.h" -#include "parrot/embed.h" #include "parrot/runcore_trace.h" #include "cores.str" @@ -253,10 +252,6 @@ next opcode, or examine and manipulate data from the executing program. #include "pmc/pmc_sub.h" #include "pmc/pmc_callcontext.h" -#ifdef WIN32 -# define getpid _getpid -#endif - /* HEADERIZER HFILE: include/parrot/runcore_api.h */ /* HEADERIZER BEGIN: static */ @@ -561,7 +556,8 @@ runops_trace_core(PARROT_INTERP, ARGIN(opcode_t *pc)) /* set the top of the stack so GC can trace it for GC-able pointers * see trace_system_areas() in src/gc/system.c */ - debugger->lo_var_ptr = interp->lo_var_ptr; + /* Chandon FIXME: debugger */ + /* debugger->lo_var_ptr = interp->lo_var_ptr; */ pio = Parrot_io_STDERR(debugger); diff --git a/src/runcore/main.c b/src/runcore/main.c index d55ede386c..e380d1245f 100644 --- a/src/runcore/main.c +++ b/src/runcore/main.c @@ -20,6 +20,7 @@ The runcore API handles running the operations. #include "parrot/parrot.h" #include "parrot/runcore_api.h" #include "parrot/runcore_profiling.h" +#include "parrot/runcore_subprof.h" #include "parrot/oplib/core_ops.h" #include "parrot/oplib/ops.h" #include "main.str" @@ -68,6 +69,7 @@ Parrot_runcore_init(PARROT_INTERP) Parrot_runcore_slow_init(interp); Parrot_runcore_fast_init(interp); + Parrot_runcore_subprof_init(interp); Parrot_runcore_exec_init(interp); Parrot_runcore_gc_debug_init(interp); Parrot_runcore_debugger_init(interp); @@ -293,14 +295,6 @@ dynop_register(PARROT_INTERP, ARGIN(PMC *lib_pmc)) op_lib_t *lib; oplib_init_f init_func; - if (n_interpreters > 1) { - /* This is not supported yet because interp->all_op_libs - * and interp->op_hash are shared. - */ - Parrot_ex_throw_from_c_args(interp, NULL, 1, "loading a new dynoplib while " - "more than one thread is running is not supported."); - } - if (!interp->all_op_libs) interp->all_op_libs = mem_gc_allocate_n_zeroed_typed(interp, interp->n_libs + 1, op_lib_t*); @@ -356,7 +350,7 @@ parrot_hash_oplib(PARROT_INTERP, ARGIN(op_lib_t *lib)) /* -=item C +=item C Restore old function table. @@ -368,9 +362,9 @@ XXX This is only implemented for the function core at present. PARROT_EXPORT void -disable_event_checking(PARROT_INTERP) +Parrot_runcore_disable_event_checking(PARROT_INTERP) { - ASSERT_ARGS(disable_event_checking) + ASSERT_ARGS(Parrot_runcore_disable_event_checking) PackFile_ByteCode *cs = interp->code; /* restore func table */ PARROT_ASSERT(cs->save_func_table); @@ -381,7 +375,7 @@ disable_event_checking(PARROT_INTERP) /* -=item C +=item C Replace func table with one that does event checking for all opcodes. @@ -396,9 +390,9 @@ XXX This is only implemented for the function core at present. PARROT_EXPORT void -enable_event_checking(PARROT_INTERP) +Parrot_runcore_enable_event_checking(PARROT_INTERP) { - ASSERT_ARGS(enable_event_checking) + ASSERT_ARGS(Parrot_runcore_enable_event_checking) PackFile_ByteCode *cs = interp->code; /* only save if we're not already event checking */ diff --git a/src/runcore/profiling.c b/src/runcore/profiling.c index c8d1268ce8..b0cad48b67 100644 --- a/src/runcore/profiling.c +++ b/src/runcore/profiling.c @@ -19,7 +19,6 @@ Functions controlling Parrot's profiling runcore. #include "parrot/runcore_api.h" #include "parrot/extend.h" -#include "parrot/embed.h" #include "parrot/runcore_profiling.h" #include "parrot/oplib/core_ops.h" @@ -29,10 +28,6 @@ Functions controlling Parrot's profiling runcore. #include "pmc/pmc_callcontext.h" #include "pmc/pmc_namespace.h" -#ifdef WIN32 -# define getpid _getpid -#endif - #define PPROF_VERSION 2 #define code_start interp->code->base.data diff --git a/src/runcore/subprof.c b/src/runcore/subprof.c new file mode 100644 index 0000000000..5001a1855e --- /dev/null +++ b/src/runcore/subprof.c @@ -0,0 +1,1605 @@ +/* +Copyright (C) 2001-2011, Parrot Foundation. + +=head1 NAME + +src/runcore/subprof.c - Parrot's subroutine-level profiler + +=head2 Functions + +=over 4 + +=cut + +*/ + +#include "parrot/runcore_api.h" +#include "parrot/runcore_subprof.h" + +#include "parrot/oplib/ops.h" +#include "parrot/oplib/core_ops.h" +#include "parrot/dynext.h" + +#include "subprof.str" + +#include "pmc/pmc_sub.h" +#include "pmc/pmc_callcontext.h" + +/* HEADERIZER HFILE: include/parrot/runcore_subprof.h */ + +/* HEADERIZER BEGIN: static */ +/* Don't modify between HEADERIZER BEGIN / HEADERIZER END. Your changes will be lost. */ + +static void buildcallchain(PARROT_INTERP, + ARGIN(subprofiledata *spdata), + ARGIN_NULLOK(PMC *ctx), + ARGIN_NULLOK(PMC *subpmc)) + __attribute__nonnull__(1) + __attribute__nonnull__(2); + +static void createlines(PARROT_INTERP, + ARGIN(subprofiledata *spdata), + ARGIN(subprofile *sp)) + __attribute__nonnull__(1) + __attribute__nonnull__(2) + __attribute__nonnull__(3); + +static void dump_profile_data(PARROT_INTERP, ARGIN(subprofiledata *spdata)) + __attribute__nonnull__(1) + __attribute__nonnull__(2); + +PARROT_CAN_RETURN_NULL +static opcode_t * findlineannotations(PARROT_INTERP, + ARGIN(subprofiledata *spdata), + ARGIN(subprofile *sp), + ARGOUT(size_t *cntp)) + __attribute__nonnull__(1) + __attribute__nonnull__(2) + __attribute__nonnull__(3) + __attribute__nonnull__(4) + FUNC_MODIFIES(*cntp); + +static void finishcallchain(PARROT_INTERP, ARGIN(subprofiledata *spdata)) + __attribute__nonnull__(1) + __attribute__nonnull__(2); + +static void free_profile_data(PARROT_INTERP, ARGIN(subprofiledata *spdata)) + __attribute__nonnull__(1) + __attribute__nonnull__(2); + +static void free_subprofile(PARROT_INTERP, ARGIN(subprofile *sp)) + __attribute__nonnull__(1) + __attribute__nonnull__(2); + +PARROT_WARN_UNUSED_RESULT +PARROT_CANNOT_RETURN_NULL +static subprofiledata * get_subprofiledata(PARROT_INTERP, + ARGIN(Parrot_runcore_t *runcore), + int type) + __attribute__nonnull__(1) + __attribute__nonnull__(2); + +PARROT_INLINE +static UHUGEINTVAL getticks(void); + +static UHUGEINTVAL getticks(void); +static void Parrot_runcore_subprof_hll_init(PARROT_INTERP) + __attribute__nonnull__(1); + +static void Parrot_runcore_subprof_ops_init(PARROT_INTERP) + __attribute__nonnull__(1); + +static void Parrot_runcore_subprof_sub_init(PARROT_INTERP) + __attribute__nonnull__(1); + +static void popcallchain(PARROT_INTERP, ARGIN(subprofiledata *spdata)) + __attribute__nonnull__(1) + __attribute__nonnull__(2); + +static void printspname(PARROT_INTERP, + ARGIN(const subprofiledata *spdata), + ARGIN(const subprofile *sp)) + __attribute__nonnull__(1) + __attribute__nonnull__(2) + __attribute__nonnull__(3); + +static void runops_subprof_destroy(PARROT_INTERP, + ARGIN(Parrot_runcore_t *runcore)) + __attribute__nonnull__(1) + __attribute__nonnull__(2); + +PARROT_WARN_UNUSED_RESULT +PARROT_CAN_RETURN_NULL +static opcode_t * runops_subprof_hll_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_subprof_ops_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_subprof_sub_core(PARROT_INTERP, + ARGIN(Parrot_runcore_t *runcore), + ARGIN(opcode_t *pc)) + __attribute__nonnull__(1) + __attribute__nonnull__(2) + __attribute__nonnull__(3); + +PARROT_CANNOT_RETURN_NULL +static INTVAL * sptodebug(PARROT_INTERP, + ARGMOD(subprofiledata *spdata), + ARGIN(const subprofile *sp)) + __attribute__nonnull__(1) + __attribute__nonnull__(2) + __attribute__nonnull__(3) + FUNC_MODIFIES(*spdata); + +PARROT_INLINE +PARROT_CANNOT_RETURN_NULL +static char * str2cs(PARROT_INTERP, ARGIN_NULLOK(const STRING *s)) + __attribute__nonnull__(1); + +PARROT_CANNOT_RETURN_NULL +static subprofile * sub2subprofile(PARROT_INTERP, + ARGIN(subprofiledata *spdata), + ARGIN(PMC *ctx), + ARGIN(PMC *subpmc)) + __attribute__nonnull__(1) + __attribute__nonnull__(2) + __attribute__nonnull__(3) + __attribute__nonnull__(4); + +static void sync_callchainchange(PARROT_INTERP, + ARGIN(subprofiledata *spdata), + ARGIN(PMC *ctx), + ARGIN_NULLOK(PMC *subpmc)) + __attribute__nonnull__(1) + __attribute__nonnull__(2) + __attribute__nonnull__(3); + +PARROT_CANNOT_RETURN_NULL +static lineinfo * sync_hll_linechange(PARROT_INTERP, + ARGIN(subprofiledata *spdata), + ARGIN_NULLOK(opcode_t *pc_op)) + __attribute__nonnull__(1) + __attribute__nonnull__(2); + +#define ASSERT_ARGS_buildcallchain __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ + PARROT_ASSERT_ARG(interp) \ + , PARROT_ASSERT_ARG(spdata)) +#define ASSERT_ARGS_createlines __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ + PARROT_ASSERT_ARG(interp) \ + , PARROT_ASSERT_ARG(spdata) \ + , PARROT_ASSERT_ARG(sp)) +#define ASSERT_ARGS_dump_profile_data __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ + PARROT_ASSERT_ARG(interp) \ + , PARROT_ASSERT_ARG(spdata)) +#define ASSERT_ARGS_findlineannotations __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ + PARROT_ASSERT_ARG(interp) \ + , PARROT_ASSERT_ARG(spdata) \ + , PARROT_ASSERT_ARG(sp) \ + , PARROT_ASSERT_ARG(cntp)) +#define ASSERT_ARGS_finishcallchain __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ + PARROT_ASSERT_ARG(interp) \ + , PARROT_ASSERT_ARG(spdata)) +#define ASSERT_ARGS_free_profile_data __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ + PARROT_ASSERT_ARG(interp) \ + , PARROT_ASSERT_ARG(spdata)) +#define ASSERT_ARGS_free_subprofile __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ + PARROT_ASSERT_ARG(interp) \ + , PARROT_ASSERT_ARG(sp)) +#define ASSERT_ARGS_get_subprofiledata __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ + PARROT_ASSERT_ARG(interp) \ + , PARROT_ASSERT_ARG(runcore)) +#define ASSERT_ARGS_getticks __attribute__unused__ int _ASSERT_ARGS_CHECK = (0) +#define ASSERT_ARGS_getticks __attribute__unused__ int _ASSERT_ARGS_CHECK = (0) +#define ASSERT_ARGS_Parrot_runcore_subprof_hll_init \ + __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ + PARROT_ASSERT_ARG(interp)) +#define ASSERT_ARGS_Parrot_runcore_subprof_ops_init \ + __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ + PARROT_ASSERT_ARG(interp)) +#define ASSERT_ARGS_Parrot_runcore_subprof_sub_init \ + __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ + PARROT_ASSERT_ARG(interp)) +#define ASSERT_ARGS_popcallchain __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ + PARROT_ASSERT_ARG(interp) \ + , PARROT_ASSERT_ARG(spdata)) +#define ASSERT_ARGS_printspname __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ + PARROT_ASSERT_ARG(interp) \ + , PARROT_ASSERT_ARG(spdata) \ + , PARROT_ASSERT_ARG(sp)) +#define ASSERT_ARGS_runops_subprof_destroy __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ + PARROT_ASSERT_ARG(interp) \ + , PARROT_ASSERT_ARG(runcore)) +#define ASSERT_ARGS_runops_subprof_hll_core __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ + PARROT_ASSERT_ARG(interp) \ + , PARROT_ASSERT_ARG(runcore) \ + , PARROT_ASSERT_ARG(pc)) +#define ASSERT_ARGS_runops_subprof_ops_core __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ + PARROT_ASSERT_ARG(interp) \ + , PARROT_ASSERT_ARG(runcore) \ + , PARROT_ASSERT_ARG(pc)) +#define ASSERT_ARGS_runops_subprof_sub_core __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ + PARROT_ASSERT_ARG(interp) \ + , PARROT_ASSERT_ARG(runcore) \ + , PARROT_ASSERT_ARG(pc)) +#define ASSERT_ARGS_sptodebug __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ + PARROT_ASSERT_ARG(interp) \ + , PARROT_ASSERT_ARG(spdata) \ + , PARROT_ASSERT_ARG(sp)) +#define ASSERT_ARGS_str2cs __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ + PARROT_ASSERT_ARG(interp)) +#define ASSERT_ARGS_sub2subprofile __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ + PARROT_ASSERT_ARG(interp) \ + , PARROT_ASSERT_ARG(spdata) \ + , PARROT_ASSERT_ARG(ctx) \ + , PARROT_ASSERT_ARG(subpmc)) +#define ASSERT_ARGS_sync_callchainchange __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ + PARROT_ASSERT_ARG(interp) \ + , PARROT_ASSERT_ARG(spdata) \ + , PARROT_ASSERT_ARG(ctx)) +#define ASSERT_ARGS_sync_hll_linechange __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ + PARROT_ASSERT_ARG(interp) \ + , PARROT_ASSERT_ARG(spdata)) +/* Don't modify between HEADERIZER BEGIN / HEADERIZER END. Your changes will be lost. */ +/* HEADERIZER END: static */ + + +/* + +=item C + +Unpacks the debug segment data into an array indexed by the opcode offset. +Hashes the result in spdata->seg2debug. + +=cut + +*/ + +PARROT_CANNOT_RETURN_NULL +static INTVAL * +sptodebug(PARROT_INTERP, ARGMOD(subprofiledata *spdata), ARGIN(const subprofile *sp)) +{ + ASSERT_ARGS(sptodebug) + + INTVAL *xdebug; + size_t di, op; + opcode_t *base_pc, *debug_ops; + size_t code_size, debug_size; + + if (!spdata->seg2debug) + spdata->seg2debug = Parrot_hash_new_pointer_hash(interp); + xdebug = (INTVAL *)Parrot_hash_get(interp, spdata->seg2debug, (void*)sp->subattrs->seg); + if (xdebug) + return xdebug; + + base_pc = sp->subattrs->seg->base.data; + code_size = sp->subattrs->seg->base.size; + debug_ops = sp->subattrs->seg->debugs->base.data; + debug_size = sp->subattrs->seg->debugs->base.size; + + xdebug = (INTVAL *)mem_sys_allocate_zeroed(code_size * sizeof (INTVAL)); + for (di = 0, op = 0; op < code_size && di < debug_size; di++) { + const op_info_t * const op_info = sp->subattrs->seg->op_info_table[*base_pc]; + opcode_t opsize = op_info->op_count; + ADD_OP_VAR_PART(interp, sp->subattrs->seg, base_pc, opsize); + base_pc += opsize; + xdebug[op++] = *debug_ops >= 0 ? *debug_ops : -1; + while (--opsize > 0) { + xdebug[op++] = -2; + } + debug_ops++; + } + while (op < code_size) + xdebug[op++] = -2; + Parrot_hash_put(interp, spdata->seg2debug, (void*)sp->subattrs->seg, (void*)xdebug); + return xdebug; +} + +/* + +=item C + +Convert a STRING* to a char*, or a STRINGNULL to "STRINGNULL". + +=cut + +*/ + +PARROT_INLINE +PARROT_CANNOT_RETURN_NULL +static char * +str2cs(PARROT_INTERP, ARGIN_NULLOK(const STRING *s)) +{ + ASSERT_ARGS(str2cs) + + if (s == STRINGNULL) + return mem_sys_strdup("STRNULL"); + return Parrot_str_to_cstring(interp, s); +} + + +/* + +=item C + +Return a pointer to the first line annotation of the sub and the number +of line annotations for this sub. + +=cut + +*/ + +PARROT_CAN_RETURN_NULL +static opcode_t * +findlineannotations(PARROT_INTERP, + ARGIN(subprofiledata *spdata), + ARGIN(subprofile *sp), + ARGOUT(size_t *cntp)) +{ + ASSERT_ARGS(findlineannotations) + + int i; + size_t j, + cnt, + first; + + PackFile_Annotations *ann = sp->subattrs->seg->annotations; + PackFile_Annotations_Key *key; + STRING *line_str; + + if (!ann) + return NULL; + + line_str = Parrot_str_new_constant(interp, "line"); + + /* search for the first line annotation in our sub */ + for (i = 0; i < ann->num_keys; i++) { + STRING * const test_key = ann->code->const_table->str.constants[ann->keys[i].name]; + + if (STRING_equal(interp, test_key, line_str)) + break; + } + + if (i == ann->num_keys) + return NULL; /* no annotations with this key */ + + cnt = 0; + first = 0; + key = ann->keys + i; + + for (j = key->start; j < key->start + key->len; j++) { + if ((size_t)ann->base.data[j * 2 + ANN_ENTRY_OFF] < sp->subattrs->start_offs) + continue; + if ((size_t)ann->base.data[j * 2 + ANN_ENTRY_OFF] >= sp->subattrs->end_offs) + break; + if (!cnt++) { + first = j; + } + } + + *cntp = cnt; + + return cnt ? ann->base.data + first * 2 : NULL; +} + + +/* + +=item C + +Create the lines array from the annotations/debug segment. Every line +describes a opcode segment. +Also sets sp->srcfile and sp->srcline. + +=cut + +*/ + +static void +createlines(PARROT_INTERP, ARGIN(subprofiledata *spdata), ARGIN(subprofile *sp)) +{ + ASSERT_ARGS(createlines) + + if (spdata->profile_type == SUBPROF_TYPE_OPS) { + int i, lasti; + INTVAL *xdebug = sptodebug(interp, spdata, sp); + + sp->nlines = sp->subattrs->end_offs - sp->subattrs->start_offs; + sp->lines = (lineinfo *) mem_sys_allocate_zeroed( + ((sp->nlines ? sp->nlines : 1) + 1) * sizeof (lineinfo)); + sp->lines[0].op_offs = sp->subattrs->start_offs; /* just in case */ + + for (i = lasti = 0; i < sp->nlines; i++) { + INTVAL line = xdebug[sp->subattrs->start_offs + i]; + + if (line != -2) { + sp->lines[i].op_offs = sp->subattrs->start_offs + i; + sp->lines[lasti + 1].op_offs = sp->subattrs->start_offs + i; + lasti = i; + } + } + + { + STRING *filename = Parrot_sub_get_filename_from_pc(interp, + sp->subpmc, + sp->code_ops + + sp->subattrs->start_offs); + + sp->lines[lasti + 1].op_offs = sp->subattrs->end_offs; + sp->srcline = xdebug[sp->subattrs->start_offs]; + sp->srcfile = str2cs(interp, filename); + } + + return; + } + + if (sp->subattrs->seg->annotations) { + PackFile_Annotations *ann = sp->subattrs->seg->annotations; + size_t cnt = 0; + opcode_t *anndata = findlineannotations(interp, spdata, sp, &cnt); + + if (anndata) { + PMC *srcfilepmc; + size_t i, j; + + if (spdata->profile_type == SUBPROF_TYPE_SUB) { + /* we just need the first annotation for sub profiling */ + cnt = 1; + } + + /* set srcfile and srcline */ + sp->srcline = anndata[ANN_ENTRY_VAL]; + /* + 1 needed because Annotations_lookup looks up the annotation _before_ the pc */ + srcfilepmc = PackFile_Annotations_lookup(interp, + ann, + anndata[ANN_ENTRY_OFF] + 1, + Parrot_str_new_constant(interp, "file")); + + if (PMC_IS_NULL(srcfilepmc)) + sp->srcfile = mem_sys_strdup("???"); + else + sp->srcfile = str2cs(interp, VTABLE_get_string(interp, srcfilepmc)); + + sp->lines = (lineinfo *) mem_sys_allocate_zeroed((cnt + 1) * sizeof (lineinfo)); + + for (i = j = 0; i < cnt; i++) { + if (j && sp->lines[j - 1].op_offs == (size_t)anndata[i * 2 + ANN_ENTRY_OFF]) { + /* no empty segments, please */ + continue; + } + + sp->lines[j++].op_offs = anndata[i * 2 + ANN_ENTRY_OFF]; + } + + sp->lines[0].op_offs = sp->subattrs->start_offs; /* workaround */ + sp->lines[j].op_offs = sp->subattrs->end_offs; + + if (j > 1 && sp->lines[j - 1].op_offs == sp->subattrs->end_offs) + /* no empty segments, please */ + j--; + + sp->nlines = j; + } + } + + if (!sp->nlines) { + /* no annotations, fall back to debug segment */ + STRING *filename = Parrot_sub_get_filename_from_pc(interp, + sp->subpmc, + sp->code_ops + + sp->subattrs->start_offs); + + sp->srcline = Parrot_sub_get_line_from_pc(interp, + sp->subpmc, + sp->code_ops + sp->subattrs->start_offs); + sp->srcfile = str2cs(interp, filename); + sp->lines = (lineinfo *) mem_sys_allocate_zeroed((1 + 1) * sizeof (lineinfo)); + sp->lines[0].op_offs = sp->subattrs->start_offs; + sp->lines[1].op_offs = sp->subattrs->end_offs; + sp->nlines = 1; + } +} + +/* + +=item C + +... + +=cut + +*/ + +PARROT_CANNOT_RETURN_NULL +static subprofile * +sub2subprofile(PARROT_INTERP, ARGIN(subprofiledata *spdata), ARGIN(PMC *ctx), ARGIN(PMC *subpmc)) +{ + ASSERT_ARGS(sub2subprofile) + + subprofile *sp; + Parrot_Sub_attributes *subattrs; + + PMC_get_sub(interp, subpmc, subattrs); + + if (!spdata->sphash) + spdata->sphash = Parrot_hash_new_pointer_hash(interp); + sp = (subprofile *) Parrot_hash_get(interp, + spdata->sphash, + (void *) (subattrs->seg->base.data + + subattrs->start_offs)); + + if (!sp) { + sp = (subprofile *) mem_sys_allocate_zeroed(sizeof (subprofile)); + sp->subattrs = subattrs; + sp->subpmc = subpmc; + sp->code_ops = sp->subattrs->seg->base.data; + + createlines(interp, spdata, sp); + + Parrot_hash_put(interp, + spdata->sphash, + (void *) (subattrs->seg->base.data + subattrs->start_offs), + (void *) sp); + + VTABLE_push_pmc(interp, spdata->markpmcs, subpmc); + } + + return sp; +} + + +/* + +=item C + +... + +=cut + +*/ + +static void +popcallchain(PARROT_INTERP, ARGIN(subprofiledata *spdata)) +{ + ASSERT_ARGS(popcallchain) + + subprofile * const sp = spdata->cursp; + subprofile * const csp = sp->caller; + + if (sp->callerci) { + sp->callerci->ops += sp->callerops; + sp->callerci->ticks += sp->callerticks; + } + + if (csp) { + csp->callerops += sp->callerops; + csp->callerticks += sp->callerticks; + } + + sp->caller = NULL; + sp->callerci = NULL; + sp->ctx = NULL; + sp->callerops = 0; + sp->callerticks = 0; + + spdata->cursubpmc = csp ? csp->subpmc : NULL; + spdata->curctx = csp ? csp->ctx : NULL; + spdata->cursp = csp; +} + +/* + +=item C + +Propagate timing information up the call chain, clearing out old frames during +the process. + +=cut + +*/ + +static void +finishcallchain(PARROT_INTERP, ARGIN(subprofiledata *spdata)) +{ + ASSERT_ARGS(finishcallchain) + + subprofile *sp, *csp; + + /* finish all calls */ + for (sp = spdata->cursp; sp; sp = csp) { + csp = sp->caller; + + if (sp->callerci) { + sp->callerci->ops += sp->callerops; + sp->callerci->ticks += sp->callerticks; + } + + if (csp) { + csp->callerops += sp->callerops; + csp->callerticks += sp->callerticks; + } + + sp->caller = NULL; + sp->callerci = NULL; + sp->ctx = NULL; + sp->callerops = 0; + sp->callerticks = 0; + } + + spdata->cursp = NULL; + spdata->curctx = NULL; + spdata->cursubpmc = NULL; +} + +/* + +=item C + +... + +=cut + +*/ + +static void +buildcallchain(PARROT_INTERP, + ARGIN(subprofiledata *spdata), + ARGIN_NULLOK(PMC *ctx), + ARGIN_NULLOK(PMC *subpmc)) +{ + ASSERT_ARGS(buildcallchain) + + PMC *cctx; + subprofile *sp; + lineinfo *li; + + cctx = Parrot_pcc_get_caller_ctx(interp, ctx); + + if (cctx) { + PMC * const csubpmc = Parrot_pcc_get_sub(interp, cctx); + if (spdata->curctx != cctx || spdata->cursubpmc != csubpmc) + buildcallchain(interp, spdata, cctx, csubpmc); + } + + if (PMC_IS_NULL(subpmc)) + return; + + /* find the correct subprofile */ + sp = sub2subprofile(interp, spdata, ctx, subpmc); + + while (sp->ctx) { + /* recursion! */ + if (!sp->rnext) { + subprofile *rsp; + rsp = (subprofile *)mem_sys_allocate_zeroed(sizeof (subprofile)); + rsp->subattrs = sp->subattrs; + rsp->subpmc = sp->subpmc; + rsp->code_ops = sp->code_ops; + rsp->rcnt = sp->rcnt + 1; + rsp->srcline = sp->srcline; + rsp->srcfile = mem_sys_strdup(sp->srcfile); + sp->rnext = rsp; + if (sp->nlines) { + int i; + rsp->lines = (lineinfo *)mem_sys_allocate_zeroed( + (sp->nlines + 1) * sizeof (lineinfo)); + rsp->nlines = sp->nlines; + for (i = 0; i < sp->nlines + 1; i++) + rsp->lines[i].op_offs = sp->lines[i].op_offs; + } + } + sp = sp->rnext; + } + + sp->ctx = ctx; + sp->caller = spdata->cursp; + + if (sp->caller) { + subprofile * const csp = sp->caller; + + /* get caller pc */ + opcode_t * const cpc_op = Parrot_pcc_get_pc(interp, csp->ctx); + size_t cpc = cpc_op ? cpc_op - csp->code_ops : 0; + + if (cpc > csp->subattrs->start_offs) + cpc--; + + /* convert cpc into line */ + if (spdata->profile_type != SUBPROF_TYPE_OPS) { + int i; + /* might do a binary seach instead */ + for (i = 0, li = csp->lines; i < csp->nlines; i++, li++) + if (cpc >= li->op_offs && cpc < li[1].op_offs) + break; + + if (i >= csp->nlines) + li = csp->lines - 1; /* just in case */ + } + else { + li = csp->lines + (cpc - csp->subattrs->start_offs); + + while (li > csp->lines && (li->op_offs == 0 || li->op_offs > cpc)) + li--; + } + } + else { + li = &spdata->rootline; + } + + if (li) { + /* add caller to line */ + callinfo *ci; + + if (!li->calls) { + li->calls = (callinfo *) mem_sys_allocate((1 + 8) * sizeof (*ci)); + ci = li->calls; + ci->callee = NULL; + } + else { + for (ci = li->calls; ci->callee; ci++) + if (ci->callee == sp) + break; + + if (!ci->callee) { + int ncalls = ci - li->calls; + + if ((ncalls & 7) == 0) { + li->calls = (callinfo *) mem_sys_realloc( + li->calls, (ncalls + (1 + 8)) * sizeof (*ci)); + ci = li->calls + ncalls; + } + } + } + + if (!ci->callee) { + memset(ci, 0, sizeof (*ci)); + ci->callee = sp; + ci[1].callee = NULL; + } + + sp->callerci = ci; + } + else { + sp->callerci = NULL; + } + + spdata->cursp = sp; + spdata->curctx = ctx; + spdata->cursubpmc = subpmc; +} + +/* + +=item C + +Prints the name of the subprofile given in C. + +=cut + +*/ + +static void +printspname(PARROT_INTERP, ARGIN(const subprofiledata *spdata), ARGIN(const subprofile *sp)) +{ + ASSERT_ARGS(printspname) + + char * const cname = str2cs(interp, sp->subattrs->name); + + fprintf(stderr, "%p:%s", sp, cname); + + if (sp->rcnt) + fprintf(stderr, "'%d", sp->rcnt); + + mem_sys_free(cname); +} + +/* + +=item C + +After the program has completed, print the resulting callgrind-compatible +profile to stderr. + +=cut + +*/ + + +static void +dump_profile_data(PARROT_INTERP, ARGIN(subprofiledata *spdata)) +{ + ASSERT_ARGS(dump_profile_data) + + unsigned int totalops = 0; + UHUGEINTVAL totalticks = 0; + + if (!spdata->profile_type) + return; + + finishcallchain(interp, spdata); /* just in case */ + + if (!spdata->sphash) + spdata->sphash = Parrot_hash_create(interp, enum_type_ptr, Hash_key_type_PMC_ptr); + + parrot_hash_iterate(spdata->sphash, + subprofile *hsp = (subprofile*)_bucket->value; + subprofile *sp; + + for (sp = hsp; sp; sp = sp->rnext) { + int j; + for (j = 0; j < sp->nlines; j++) { + totalops += sp->lines[j].ops; + totalticks += sp->lines[j].ticks; + } + }); + + fprintf(stderr, "events: ops ticks\n"); + fprintf(stderr, "summary: %d %lld\n", totalops, totalticks); + + parrot_hash_iterate(spdata->sphash, + subprofile *hsp = (subprofile*)_bucket->value; + subprofile *sp; + + for (sp = hsp; sp; sp = sp->rnext) { + opcode_t *anndata = NULL; + INTVAL *xdebug = NULL; + size_t cnt = 0; + int i; + + if (spdata->profile_type != SUBPROF_TYPE_OPS) + anndata = findlineannotations(interp, spdata, sp, &cnt); + else + xdebug = sptodebug(interp, spdata, sp); + + fprintf(stderr, "\n"); + fprintf(stderr, "fl=%s\n", sp->srcfile); + fprintf(stderr, "fn="); + printspname(interp, spdata, sp); + fprintf(stderr, "\n"); + + for (i = 0; i < sp->nlines; i++) { + lineinfo *li = sp->lines + i; + callinfo *ci; + INTVAL srcline = -1; + if (!li->ops && !li->ticks && !li->calls) + continue; + if (i == 0) { + /* easy for the first annotation */ + srcline = sp->srcline; + } + else { + if (spdata->profile_type == SUBPROF_TYPE_OPS) { + srcline = xdebug[sp->subattrs->start_offs + i]; + } + else if (anndata) { + while (cnt > 1 && (size_t) anndata[ANN_ENTRY_OFF + 2] <= li->op_offs) { + anndata += 2; + cnt--; + } + srcline = anndata[ANN_ENTRY_VAL]; + anndata += 2; + cnt--; + } + } + + if (li->ops || li->ticks) + fprintf(stderr, + "%d %u %llu\n", + (int) srcline, + (unsigned int) li->ops, + (unsigned long long) li->ticks); + + for (ci = li->calls; ci && ci->callee; ci++) { + subprofile *csp = ci->callee; + fprintf(stderr, "cfl=%s\n", csp->srcfile); + fprintf(stderr, "cfn="); + printspname(interp, spdata, csp); + fprintf(stderr, "\n"); + fprintf(stderr, "calls=%u %d\n", (unsigned int) ci->count, (int) csp->srcline); + fprintf(stderr, + "%d %u %llu\n", + (int) srcline, + (unsigned int) ci->ops, + (unsigned long long) ci->ticks); + } + } + }); + + /* also dump profiling root if there are more than one callees */ + if (spdata->rootline.calls + && spdata->rootline.calls[0].callee + && spdata->rootline.calls[1].callee) { + + lineinfo *li = &spdata->rootline; + callinfo *ci; + + fprintf(stderr, "\n"); + fprintf(stderr, "fl=\n"); + fprintf(stderr, "fn=__profiling_root__\n"); + + for (ci = li->calls; ci && ci->callee; ci++) { + subprofile *csp = ci->callee; + fprintf(stderr, "cfl=%s\n", csp->srcfile); + fprintf(stderr, "cfn="); + printspname(interp, spdata, csp); + fprintf(stderr, "\n"); + fprintf(stderr, "calls=%u %d\n", (unsigned int) ci->count, (int) csp->srcline); + fprintf(stderr, + "%d %u %llu\n", + 0, + (unsigned int) ci->ops, + (unsigned long long) ci->ticks); + } + } + + fprintf(stderr, "\ntotals: %d %lld\n", totalops, totalticks); +} + + +/* + +=item C + +free memory we allocated for this subprofile + +=cut + +*/ + +static void +free_subprofile(PARROT_INTERP, ARGIN(subprofile *sp)) +{ + ASSERT_ARGS(free_subprofile) + + if (sp->srcfile) + mem_sys_free(sp->srcfile); + + if (sp->lines) { + int i; + + for (i = 0; i < sp->nlines; i++) { + lineinfo *li = sp->lines + i; + + if (li->calls) + mem_sys_free(li->calls); + } + + mem_sys_free(sp->lines); + } + + mem_sys_free(sp); +} + + +/* + +=item C + +Free all profile data that's been accumulated. + +=cut + +*/ + +static void +free_profile_data(PARROT_INTERP, ARGIN(subprofiledata *spdata)) +{ + ASSERT_ARGS(free_profile_data) + + if (spdata->sphash) { + parrot_hash_iterate(spdata->sphash, + subprofile *sp = (subprofile*)_bucket->value; + subprofile *rsp; + for (; sp; sp = rsp) { + rsp = sp->rnext; + free_subprofile(interp, sp); + }); + Parrot_hash_destroy(interp, spdata->sphash); + } + Parrot_pmc_gc_unregister(interp, spdata->markpmcs); + spdata->markpmcs = NULL; + + if (spdata->rootline.calls) + mem_sys_free(spdata->rootline.calls); + + if (spdata->seg2debug) { + parrot_hash_iterate(spdata->seg2debug, + INTVAL *xdebug = (INTVAL *)_bucket->value; + mem_sys_free(xdebug);); + Parrot_hash_destroy(interp, spdata->seg2debug); + } + mem_sys_free(spdata); +} + +/* + +=item C + +Returns a high-resolution number representing how long Parrot has been running. + +Inline operation. + +=cut + +*/ + +/* + +=item C + +Returns a high-resolution number representing how long Parrot has been running. + +=cut + +*/ + +#if defined(__GNUC__) && (defined(__i386) || defined(__x86_64)) + +# include + +PARROT_INLINE +static UHUGEINTVAL +getticks(void) { + ASSERT_ARGS(getticks) + + uint32_t lo, hi; + __asm__ __volatile__("rdtsc" : "=a" (lo), "=d" (hi)); + return (UHUGEINTVAL) hi << 32 | lo; +} +#else +static UHUGEINTVAL +getticks(void) { + return Parrot_hires_get_time(); +} +#endif + +/* + +=item C + +Brings the profile context chain back in sync with the context's call chain. + +=cut + +*/ + +static void +sync_callchainchange(PARROT_INTERP, + ARGIN(subprofiledata *spdata), + ARGIN(PMC *ctx), + ARGIN_NULLOK(PMC *subpmc)) +{ + ASSERT_ARGS(sync_callchainchange) + + subprofile *sp = spdata->cursp; + + if (sp) { + /* optimize common cases */ + /* did we just return? */ + if (sp->caller && sp->caller->subpmc == subpmc && sp->caller->ctx == ctx) { + /* a simple return */ + popcallchain(interp, spdata); + } + else { + PMC *cctx = Parrot_pcc_get_caller_ctx(interp, ctx); + PMC *csubpmc = Parrot_pcc_get_sub(interp, cctx); + + if (spdata->curctx == cctx && spdata->cursubpmc == csubpmc) { + /* a simple call */ + buildcallchain(interp, spdata, ctx, subpmc); + } + else if (sp->caller && sp->caller->subpmc == csubpmc && sp->caller->ctx == cctx) { + /* some kind of tailcall */ + popcallchain(interp, spdata); + buildcallchain(interp, spdata, ctx, subpmc); + } + } + } + + if (subpmc != spdata->cursubpmc || ctx != spdata->curctx) { + /* out of luck! redo call chain */ + finishcallchain(interp, spdata); + buildcallchain(interp, spdata, ctx, subpmc); + } + +} + + +/* + +=item C + +bring the line data in sync with the pc + +=cut + +*/ + +PARROT_CANNOT_RETURN_NULL +static lineinfo * +sync_hll_linechange(PARROT_INTERP, ARGIN(subprofiledata *spdata), ARGIN_NULLOK(opcode_t *pc_op)) +{ + ASSERT_ARGS(sync_hll_linechange) + + const subprofile * const sp = spdata->cursp; + lineinfo *li; + + if (sp->nlines > 1) { + const size_t pc = pc_op ? pc_op - sp->code_ops : 0; + int i; + + for (i = 0, li = sp->lines; i < sp->nlines; i++, li++) + if (pc >= li->op_offs && pc < li[1].op_offs) + break; + + if (i == sp->nlines) + li = sp->lines; /* just in case */ + } + else { + li = sp->lines; + } + + return li; +} + +/* + +=item C + +Returns the subprofile data for C. + +The C parameter specifies the type of data to return. Accepted values +are C, C, or C. + +=cut + +*/ + +PARROT_WARN_UNUSED_RESULT +PARROT_CANNOT_RETURN_NULL +static subprofiledata * +get_subprofiledata(PARROT_INTERP, ARGIN(Parrot_runcore_t *runcore), int type) +{ + ASSERT_ARGS(get_subprofiledata) + + Parrot_subprof_runcore_t *core = (Parrot_subprof_runcore_t *) runcore; + subprofiledata *spdata = core->spdata; + + if (!spdata) { + spdata = (subprofiledata *) mem_sys_allocate_zeroed(sizeof (subprofiledata)); + spdata->profile_type = type; + spdata->interp = interp; + spdata->markpmcs = Parrot_pmc_new(interp, enum_class_ResizablePMCArray); + Parrot_pmc_gc_register(interp, spdata->markpmcs); + core->spdata = spdata; + } + + if (spdata->profile_type != type) + Parrot_ex_throw_from_c_args(interp, NULL, 1, "illegal profile type change while profiling"); + + if (spdata->interp != interp) + Parrot_ex_throw_from_c_args(interp, NULL, 1, "illegal interpreter change while profiling"); + + return core->spdata; +} + + +#ifdef code_start +# undef code_start +#endif +#ifdef code_end +# undef code_end +#endif + +#define code_start interp->code->base.data +#define code_end (interp->code->base.data + interp->code->base.size) + +/* + +=item C + +Destroy callback. We use it to print the profile data. + +*/ + +static void +runops_subprof_destroy(PARROT_INTERP, ARGIN(Parrot_runcore_t *runcore)) +{ + ASSERT_ARGS(runops_subprof_destroy) + + Parrot_subprof_runcore_t *core = (Parrot_subprof_runcore_t *)runcore; + + if (core->spdata) { + dump_profile_data(interp, core->spdata); + free_profile_data(interp, core->spdata); + core->spdata = NULL; + } +} + +/* + +=item C + +Runs the opcodes starting at C until none remain. Runs bounds checking. + +=cut + +*/ + +PARROT_WARN_UNUSED_RESULT +PARROT_CAN_RETURN_NULL +static opcode_t * +runops_subprof_sub_core(PARROT_INTERP, ARGIN(Parrot_runcore_t *runcore), ARGIN(opcode_t *pc)) +{ + ASSERT_ARGS(runops_subprof_sub_core) + + PMC *ctx, + *subpmc; + + subprofiledata *spdata = get_subprofiledata(interp, runcore, SUBPROF_TYPE_SUB); + subprofile *sp = spdata->cursp; + + while (pc) { + 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"); + + ctx = CURRENT_CONTEXT(interp); + Parrot_pcc_set_pc(interp, ctx, pc); + subpmc = ((Parrot_Context *) PMC_data_typed(ctx, Parrot_Context *))->current_sub; + + if (!PMC_IS_NULL(subpmc)) { + if (subpmc != spdata->cursubpmc || ctx != spdata->curctx) { + /* context changed! either called new sub or returned from sub */ + + /* finish old ticks */ + UHUGEINTVAL tick = getticks(); + if (spdata->tickadd) { + UHUGEINTVAL tickdiff = tick - spdata->starttick; + *spdata->tickadd += tickdiff; + *spdata->tickadd2 += tickdiff; + } + sync_callchainchange(interp, spdata, ctx, subpmc); + sp = spdata->cursp; + if (pc == sp->code_ops + sp->subattrs->start_offs) { + /* assume new call */ + if (sp->callerci) + sp->callerci->count++; + } + spdata->tickadd = &sp->lines->ticks; + spdata->tickadd2 = &sp->callerticks; + spdata->starttick = getticks(); + } + + sp->lines->ops++; + sp->callerops++; + } + DO_OP(pc, interp); + } + + return pc; +} + +/* + +=item C + +Registers the subprof_sub runcore with Parrot. + +=cut + +*/ + +static void +Parrot_runcore_subprof_sub_init(PARROT_INTERP) +{ + ASSERT_ARGS(Parrot_runcore_subprof_sub_init) + + Parrot_subprof_runcore_t * const coredata + = mem_gc_allocate_zeroed_typed(interp, Parrot_subprof_runcore_t); + coredata->name = CONST_STRING(interp, "subprof_sub"); + coredata->id = PARROT_SUBPROF_SUB_CORE; + coredata->opinit = PARROT_CORE_OPLIB_INIT; + coredata->runops = runops_subprof_sub_core; + coredata->prepare_run = NULL; + coredata->destroy = runops_subprof_destroy; + coredata->flags = 0; + + PARROT_RUNCORE_FUNC_TABLE_SET(coredata); + + Parrot_runcore_register(interp, (Parrot_runcore_t *)coredata); +} + +/* + +=item C + +Runs the Parrot operations starting at C until there are no more +operations, with sub-level profiling and bounds checking enabled. + +=cut + +*/ + +PARROT_WARN_UNUSED_RESULT +PARROT_CAN_RETURN_NULL +static opcode_t * +runops_subprof_hll_core(PARROT_INTERP, ARGIN(Parrot_runcore_t *runcore), ARGIN(opcode_t *pc)) +{ + ASSERT_ARGS(runops_subprof_hll_core) + + subprofiledata *spdata = get_subprofiledata(interp, runcore, SUBPROF_TYPE_HLL); + subprofile *sp = spdata->cursp; + lineinfo *curline = sp ? sp->lines : NULL; + opcode_t *startop = NULL; + opcode_t *endop = NULL; /* triggers pc >= endop below */ + + while (pc) { + PMC *ctx; + PMC *subpmc; + 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"); + + ctx = CURRENT_CONTEXT(interp); + Parrot_pcc_set_pc(interp, ctx, pc); + subpmc = ((Parrot_Context *)PMC_data_typed(ctx, Parrot_Context*))->current_sub; + + if (!PMC_IS_NULL(subpmc)) { + + if (subpmc != spdata->cursubpmc || ctx != spdata->curctx) { + /* context changed! either called new sub or returned from sub */ + + /* finish old ticks */ + UHUGEINTVAL tick = getticks(); + if (spdata->tickadd) { + UHUGEINTVAL tickdiff = tick - spdata->starttick; + *spdata->tickadd += tickdiff; + *spdata->tickadd2 += tickdiff; + } + sync_callchainchange(interp, spdata, ctx, subpmc); + sp = spdata->cursp; + if (pc == sp->code_ops + sp->subattrs->start_offs) { + /* assume new call */ + if (sp->callerci) + sp->callerci->count++; + } + curline = sync_hll_linechange(interp, spdata, pc); + spdata->tickadd = &curline->ticks; + spdata->tickadd2 = &sp->callerticks; + startop = sp->code_ops + curline->op_offs; + endop = sp->code_ops + curline[1].op_offs; + spdata->starttick = getticks(); + } + + if (pc >= endop) { + /* finish old ticks */ + UHUGEINTVAL tick = getticks(); + if (spdata->tickadd) { + const UHUGEINTVAL tickdiff = tick - spdata->starttick; + *spdata->tickadd += tickdiff; + *spdata->tickadd2 += tickdiff; + } + spdata->starttick = tick; + /* bring curline in sync with the pc */ + while (pc >= sp->code_ops + curline[1].op_offs) { + curline++; + } + startop = sp->code_ops + curline->op_offs; + endop = sp->code_ops + curline[1].op_offs; + spdata->tickadd = &curline->ticks; + } + else if (pc < startop) { + /* finish old ticks */ + const UHUGEINTVAL tick = getticks(); + if (spdata->tickadd) { + UHUGEINTVAL tickdiff = tick - spdata->starttick; + *spdata->tickadd += tickdiff; + *spdata->tickadd2 += tickdiff; + } + spdata->starttick = tick; + /* bring curline in sync with the pc */ + while (pc < sp->code_ops + curline->op_offs) { + curline--; + } + startop = sp->code_ops + curline->op_offs; + endop = sp->code_ops + curline[1].op_offs; + spdata->tickadd = &curline->ticks; + } + + curline->ops++; + sp->callerops++; + } + DO_OP(pc, interp); + } + + return pc; +} + +/* + +=item C + +Registers the subprof_hll runcore with Parrot. + +=cut + +*/ + +static void +Parrot_runcore_subprof_hll_init(PARROT_INTERP) +{ + ASSERT_ARGS(Parrot_runcore_subprof_hll_init) + + Parrot_subprof_runcore_t * const coredata + = mem_gc_allocate_zeroed_typed(interp, Parrot_subprof_runcore_t); + coredata->name = CONST_STRING(interp, "subprof_hll"); + coredata->id = PARROT_SUBPROF_HLL_CORE; + coredata->opinit = PARROT_CORE_OPLIB_INIT; + coredata->runops = runops_subprof_hll_core; + coredata->prepare_run = NULL; + coredata->destroy = runops_subprof_destroy; + coredata->flags = 0; + + PARROT_RUNCORE_FUNC_TABLE_SET(coredata); + + Parrot_runcore_register(interp, (Parrot_runcore_t *)coredata); +} + + +/* + +=item C + +Runs the Parrot operations starting at C until there are no more +operations, with sub-level profiling and bounds checking enabled. + +=cut + +*/ + +PARROT_WARN_UNUSED_RESULT +PARROT_CAN_RETURN_NULL +static opcode_t * +runops_subprof_ops_core(PARROT_INTERP, ARGIN(Parrot_runcore_t *runcore), ARGIN(opcode_t *pc)) +{ + ASSERT_ARGS(runops_subprof_ops_core) + + subprofiledata *spdata = get_subprofiledata(interp, runcore, SUBPROF_TYPE_OPS); + subprofile *sp = spdata->cursp; + opcode_t *startop = sp ? sp->code_ops + sp->subattrs->start_offs : NULL; + + while (pc) { + PMC *ctx; + PMC *subpmc; + 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"); + + ctx = CURRENT_CONTEXT(interp); + Parrot_pcc_set_pc(interp, ctx, pc); + subpmc = ((Parrot_Context *)PMC_data_typed(ctx, Parrot_Context*))->current_sub; + + if (!PMC_IS_NULL(subpmc)) { + /* finish old ticks */ + const UHUGEINTVAL tick = getticks(); + if (spdata->tickadd) { + const UHUGEINTVAL tickdiff = tick - spdata->starttick; + *spdata->tickadd += tickdiff; + *spdata->tickadd2 += tickdiff; + spdata->starttick = tick; + } + + if (subpmc != spdata->cursubpmc || ctx != spdata->curctx) { + /* context changed! either called new sub or returned from sub */ + sync_callchainchange(interp, spdata, ctx, subpmc); + sp = spdata->cursp; + if (pc == sp->code_ops + sp->subattrs->start_offs) { + /* assume new call */ + if (sp->callerci) + sp->callerci->count++; + } + startop = sp->code_ops + sp->subattrs->start_offs; + spdata->tickadd2 = &sp->callerticks; + spdata->starttick = getticks(); + } + sp->lines[(int)(pc - startop)].ops++; + sp->callerops++; + spdata->tickadd = &sp->lines[(int)(pc - startop)].ticks; + } + DO_OP(pc, interp); + } + + return pc; +} + +/* + +=item C + +Registers the subprof_ops runcore with Parrot. + +=cut + +*/ + +static void +Parrot_runcore_subprof_ops_init(PARROT_INTERP) +{ + ASSERT_ARGS(Parrot_runcore_subprof_ops_init) + + Parrot_subprof_runcore_t * const coredata + = mem_gc_allocate_zeroed_typed(interp, Parrot_subprof_runcore_t); + coredata->name = CONST_STRING(interp, "subprof_ops"); + coredata->id = PARROT_SUBPROF_OPS_CORE; + coredata->opinit = PARROT_CORE_OPLIB_INIT; + coredata->runops = runops_subprof_ops_core; + coredata->prepare_run = NULL; + coredata->destroy = runops_subprof_destroy; + coredata->flags = 0; + + PARROT_RUNCORE_FUNC_TABLE_SET(coredata); + + Parrot_runcore_register(interp, (Parrot_runcore_t *) coredata); +} + +/* + +=item C + +Register all three subprof cores + +=cut + +*/ + +void +Parrot_runcore_subprof_init(PARROT_INTERP) +{ + ASSERT_ARGS(Parrot_runcore_subprof_init) + + Parrot_runcore_subprof_sub_init(interp); + Parrot_runcore_subprof_hll_init(interp); + Parrot_runcore_subprof_ops_init(interp); +} + +/* + +=back + +=cut + +*/ + +/* + * Local variables: + * c-file-style: "parrot" + * End: + * vim: expandtab shiftwidth=4 cinoptions='\:2=2' : + */ + diff --git a/src/scheduler.c b/src/scheduler.c index ba22d9b872..0e7bc04aee 100644 --- a/src/scheduler.c +++ b/src/scheduler.c @@ -1,5 +1,5 @@ /* -Copyright (C) 2007-2010, Parrot Foundation. +Copyright (C) 2007-2011, Parrot Foundation. =head1 NAME @@ -19,38 +19,33 @@ exceptions, async I/O, and concurrent tasks (threads). #include "parrot/extend.h" #include "parrot/scheduler_private.h" #include "parrot/runcore_api.h" +#include "parrot/alarm.h" +#include "parrot/scheduler.h" #include "pmc/pmc_scheduler.h" #include "pmc/pmc_task.h" #include "pmc/pmc_timer.h" +#include "pmc/pmc_alarm.h" +#include "pmc/pmc_pmclist.h" +#include "pmc/pmc_continuation.h" #include "scheduler.str" -#define CX_DEBUG 0 - /* HEADERIZER HFILE: include/parrot/scheduler.h */ /* HEADERIZER BEGIN: static */ /* Don't modify between HEADERIZER BEGIN / HEADERIZER END. Your changes will be lost. */ -static void scheduler_process_messages(PARROT_INTERP, - ARGMOD(PMC *scheduler)) - __attribute__nonnull__(1) - __attribute__nonnull__(2) - FUNC_MODIFIES(*scheduler); - -static void scheduler_process_wait_list(PARROT_INTERP, - ARGMOD(PMC *scheduler)) - __attribute__nonnull__(1) - __attribute__nonnull__(2) - FUNC_MODIFIES(*scheduler); - -#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(interp) \ - , PARROT_ASSERT_ARG(scheduler)) +static void Parrot_cx_disable_preemption(PARROT_INTERP) + __attribute__nonnull__(1); + +static void Parrot_cx_enable_preemption(PARROT_INTERP) + __attribute__nonnull__(1); + +#define ASSERT_ARGS_Parrot_cx_disable_preemption __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ + PARROT_ASSERT_ARG(interp)) +#define ASSERT_ARGS_Parrot_cx_enable_preemption __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 */ @@ -74,572 +69,347 @@ void Parrot_cx_init_scheduler(PARROT_INTERP) { ASSERT_ARGS(Parrot_cx_init_scheduler) - if (!interp->parent_interpreter) { - PMC *scheduler; - - /* Add the very first interpreter to the list of interps. */ - pt_add_to_interpreters(interp, NULL); + interp->quantum_done = Parrot_floatval_time() + PARROT_TASK_SWITCH_QUANTUM; - scheduler = Parrot_pmc_new(interp, enum_class_Scheduler); - scheduler = VTABLE_share_ro(interp, scheduler); + if (!interp->parent_interpreter) { + interp->scheduler = Parrot_pmc_new(interp, enum_class_Scheduler); - interp->scheduler = scheduler; + /* Make sure the program can handle alarm signals */ + Parrot_alarm_init(); } } /* -=item C +=item C -If a wake request has been received, handle tasks. +Construct the main task, add it to the task queue, and then execute tasks +until the task queue becomes empty. =cut */ +PARROT_EXPORT void -Parrot_cx_check_tasks(PARROT_INTERP, ARGMOD(PMC *scheduler)) +Parrot_cx_begin_execution(PARROT_INTERP, ARGIN(PMC *main), ARGIN(PMC *argv)) { - ASSERT_ARGS(Parrot_cx_check_tasks) - if (SCHEDULER_wake_requested_TEST(scheduler)) - Parrot_cx_handle_tasks(interp, interp->scheduler); + ASSERT_ARGS(Parrot_cx_begin_execution) + PMC * const scheduler = interp->scheduler; + Parrot_Scheduler_attributes * const sched = PARROT_SCHEDULER(scheduler); + PMC * const main_task = Parrot_pmc_new(interp, enum_class_Task); + Parrot_Task_attributes * const tdata = PARROT_TASK(main_task); + INTVAL task_count; + + tdata->code = main; + tdata->data = argv; + PARROT_GC_WRITE_BARRIER(interp, main_task); + + sched->enable_scheduling = 1; + + Parrot_cx_schedule_immediate(interp, main_task); + Parrot_cx_outer_runloop(interp); + + task_count = VTABLE_get_integer(interp, sched->all_tasks); + if (task_count > 0) + Parrot_warn(interp, PARROT_WARNINGS_ALL_FLAG, + "Exiting with %d active tasks.\n", task_count); } /* -=item C +=item C -Handle the pending tasks in the scheduler's task list. Returns when there are -no more pending tasks. +This is the core loop performed by each active OS thread. If it's the +thread that needs to be running, it invokes the Scheduler to pick a +task. =cut */ -PARROT_EXPORT void -Parrot_cx_handle_tasks(PARROT_INTERP, ARGMOD(PMC *scheduler)) +Parrot_cx_outer_runloop(PARROT_INTERP) { - ASSERT_ARGS(Parrot_cx_handle_tasks) - - /* avoid recursive calls */ - if (SCHEDULER_in_handler_TEST(scheduler)) - return; - - SCHEDULER_in_handler_SET(scheduler); - SCHEDULER_wake_requested_CLEAR(scheduler); - Parrot_cx_refresh_task_list(interp, scheduler); - - while (VTABLE_get_integer(interp, scheduler) > 0) { - PMC * const task = VTABLE_pop_pmc(interp, scheduler); - if (!PMC_IS_NULL(task)) { - PMC * const type_pmc = VTABLE_get_attr_str(interp, task, CONST_STRING(interp, "type")); - STRING * const type = VTABLE_get_string(interp, type_pmc); - - if (STRING_equal(interp, type, CONST_STRING(interp, "callback"))) { - Parrot_cx_invoke_callback(interp, task); - } - else if (STRING_equal(interp, type, CONST_STRING(interp, "timer"))) { - Parrot_cx_timer_invoke(interp, task); - } - else if (STRING_equal(interp, type, CONST_STRING(interp, "event"))) { - 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_ext_call(interp, handler_sub, "PP->", handler, task); - } - } - else { - Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_INVALID_OPERATION, - "Unknown task type '%Ss'.\n", type); - } - - Parrot_cx_delete_task(interp, task); + ASSERT_ARGS(Parrot_cx_outer_runloop) + PMC * const scheduler = interp->scheduler; + Parrot_Scheduler_attributes * const sched = PARROT_SCHEDULER(scheduler); + INTVAL alarm_count; + + do { + while (VTABLE_get_integer(interp, sched->task_queue) > 0) { + /* there can be no active runloops at this point, so it should be save + * to start counting at 0 again. This way the continuation in the next + * task will find a runloop with id 1 when encountering an exception */ + interp->current_runloop_level = 0; + reset_runloop_id_counter(interp); + + Parrot_cx_next_task(interp, scheduler); + + /* add expired alarms to the task queue */ + Parrot_cx_check_alarms(interp, interp->scheduler); } - /* If the scheduler was flagged to terminate, make sure you process all - * tasks. */ - if (SCHEDULER_terminate_requested_TEST(scheduler)) - Parrot_cx_refresh_task_list(interp, scheduler); - - } /* end of pending tasks */ - - SCHEDULER_in_handler_CLEAR(scheduler); + alarm_count = VTABLE_get_integer(interp, sched->alarms); + if (alarm_count > 0) { +#ifdef _WIN32 + /* TODO: Implement on Windows */ +#else + /* Nothing to do except to wait for the next alarm to expire */ + pause(); +#endif + Parrot_cx_check_alarms(interp, interp->scheduler); + } + } while (alarm_count); } /* -=item C +=item C -Tell the scheduler to perform maintenance on its list of active tasks, checking -for completed timers or sleep events, sorting for priority, checking for -messages, etc. - -=cut +Set the task switch alarm for the scheduler. */ void -Parrot_cx_refresh_task_list(PARROT_INTERP, ARGMOD(PMC *scheduler)) +Parrot_cx_set_scheduler_alarm(PARROT_INTERP) { - ASSERT_ARGS(Parrot_cx_refresh_task_list) - scheduler_process_wait_list(interp, scheduler); - scheduler_process_messages(interp, scheduler); + ASSERT_ARGS(Parrot_cx_set_scheduler_alarm) + const FLOATVAL time_now = Parrot_floatval_time(); - /* TODO: Sort the task list index */ + interp->quantum_done = time_now + PARROT_TASK_SWITCH_QUANTUM; - SCHEDULER_cache_valid_SET(scheduler); - return; + Parrot_alarm_set(interp->quantum_done); } /* -=item C +=item C -Wake a sleeping scheduler runloop (generally called when new tasks are added to -the scheduler's task list). +Run the task at the head of the task queue until it ends or is +pre-empted. =cut */ void -Parrot_cx_runloop_wake(PARROT_INTERP, ARGMOD(PMC *scheduler)) +Parrot_cx_next_task(PARROT_INTERP, ARGIN(PMC *scheduler)) { - ASSERT_ARGS(Parrot_cx_runloop_wake) - enable_event_checking(interp); - SCHEDULER_wake_requested_SET(scheduler); -} + ASSERT_ARGS(Parrot_cx_next_task) + Parrot_Scheduler_attributes * const sched = PARROT_SCHEDULER(scheduler); + PMC * const task = VTABLE_shift_pmc(interp, sched->task_queue); + interp->cur_task = task; -/* - -=item C - -Schedule an event to terminate the scheduler runloop. - -=cut + if (!VTABLE_isa(interp, task, CONST_STRING(interp, "Task"))) + Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_INVALID_OPERATION, + "Found a non-Task in the task queue.\n"); -*/ +#ifdef _WIN32 + /* TODO: Implement on Windows */ +#else + if (VTABLE_get_integer(interp, sched->task_queue) > 0) + Parrot_cx_enable_preemption(interp); + else + Parrot_cx_disable_preemption(interp); +#endif -PARROT_EXPORT -void -Parrot_cx_runloop_end(PARROT_INTERP) -{ - ASSERT_ARGS(Parrot_cx_runloop_end) - SCHEDULER_terminate_requested_SET(interp->scheduler); - Parrot_cx_handle_tasks(interp, interp->scheduler); + Parrot_ext_call(interp, task, "->"); } /* -=item C +=item C -Add a task to scheduler's task list. Cannot be called across -interpreters/threads, must be called from within the interpreter's runloop. +Does the scheduler need to wake up and do anything? If so, do that now. =cut */ -PARROT_EXPORT -void -Parrot_cx_schedule_task(PARROT_INTERP, ARGIN(PMC *task)) +PARROT_CANNOT_RETURN_NULL +opcode_t* +Parrot_cx_check_scheduler(PARROT_INTERP, ARGIN(opcode_t *next)) { - ASSERT_ARGS(Parrot_cx_schedule_task) - if (!interp->scheduler) - Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_INVALID_OPERATION, - "Scheduler was not initialized for this interpreter.\n"); - - VTABLE_push_pmc(interp, interp->scheduler, task); -} - -/* - -=item C - -Retrieve the the top task on the scheduler's task list, but don't remove it -from the list. - -=cut - -*/ + ASSERT_ARGS(Parrot_cx_check_scheduler) + PMC * const scheduler = interp->scheduler; -PARROT_EXPORT -PARROT_CAN_RETURN_NULL -PMC * -Parrot_cx_peek_task(PARROT_INTERP) -{ - ASSERT_ARGS(Parrot_cx_peek_task) - if (!interp->scheduler) - Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_INVALID_OPERATION, - "Scheduler was not initialized for this interpreter.\n"); + if (Parrot_alarm_check(&(interp->last_alarm)) + || SCHEDULER_wake_requested_TEST(scheduler)) { + SCHEDULER_wake_requested_CLEAR(scheduler); + return Parrot_cx_run_scheduler(interp, scheduler, next); + } - return VTABLE_pop_pmc(interp, interp->scheduler); + return next; } /* -=item C +=item C -Create a new timer event due at C from now, repeated at C -and running the passed C. +Checks to see if any tasks need to be scheduled or if the current task +needs to be pre-empted. =cut */ +PARROT_CANNOT_RETURN_NULL PARROT_EXPORT -void -Parrot_cx_schedule_timer(PARROT_INTERP, - ARGIN_NULLOK(STRING *type), FLOATVAL duration, FLOATVAL interval, - INTVAL repeat, ARGIN_NULLOK(PMC *sub)) +opcode_t* +Parrot_cx_run_scheduler(PARROT_INTERP, ARGIN(PMC *scheduler), ARGIN(opcode_t *next)) { - ASSERT_ARGS(Parrot_cx_schedule_timer) - PMC * const timer = Parrot_pmc_new(interp, enum_class_Timer); - - VTABLE_set_number_keyed_int(interp, timer, PARROT_TIMER_NSEC, duration); - VTABLE_set_number_keyed_int(interp, timer, PARROT_TIMER_INTERVAL, interval); - VTABLE_set_integer_keyed_int(interp, timer, PARROT_TIMER_REPEAT, repeat); - - if (!PMC_IS_NULL(sub)) - VTABLE_set_pmc_keyed_int(interp, timer, PARROT_TIMER_HANDLER, sub); - - if (!STRING_IS_NULL(type)) - VTABLE_set_string_native(interp, timer, type); - - if (repeat && FLOAT_IS_ZERO(interval)) - VTABLE_set_number_keyed_int(interp, timer, PARROT_TIMER_INTERVAL, duration); + ASSERT_ARGS(Parrot_cx_run_scheduler) + const Parrot_Scheduler_attributes * const sched = PARROT_SCHEDULER(interp->scheduler); - Parrot_cx_schedule_task(interp, timer); -} - -/* + Parrot_cx_check_alarms(interp, scheduler); + Parrot_cx_check_quantum(interp, scheduler); -=item C + if (SCHEDULER_resched_requested_TEST(scheduler)) { + SCHEDULER_resched_requested_CLEAR(scheduler); -Add a repeat task to scheduler's task list. - -=cut + /* A task switch will only work in the outer runloop of a fully + booted Parrot. In a Parrot that hasn't called begin_execution, + or in a nested runloop, we silently ignore task switches. */ + if (sched->enable_scheduling && interp->current_runloop_level <= 1) + return Parrot_cx_preempt_task(interp, scheduler, next); + } -*/ +#ifdef _WIN32 + /* TODO: Implement on Windows */ +#else + /* Some alarm seems to have fired, but not the scheduler's. + * Re-set the scheduler alarm */ + if (sched->enable_preemption) + Parrot_alarm_set(interp->quantum_done); +#endif -PARROT_EXPORT -void -Parrot_cx_schedule_repeat(PARROT_INTERP, ARGIN(PMC *task)) -{ - ASSERT_ARGS(Parrot_cx_schedule_repeat) - INTVAL repeat = VTABLE_get_integer_keyed_int(interp, task, - PARROT_TIMER_REPEAT); - FLOATVAL duration = VTABLE_get_number_keyed_int(interp, task, - PARROT_TIMER_INTERVAL); - if (repeat != 0) { - PMC * const repeat_task = VTABLE_clone(interp, task); - VTABLE_set_number_keyed_int(interp, repeat_task, PARROT_TIMER_NSEC, duration); - - if (repeat > 0) - VTABLE_set_integer_keyed_int(interp, repeat_task, - PARROT_TIMER_REPEAT, repeat - 1); - - Parrot_cx_schedule_task(interp, repeat_task); - } + return next; } /* -=item C +=item C -Create a new callback event, with an argument for the call. +If the quantum has expired, schedule the next task. =cut */ -PARROT_EXPORT void -Parrot_cx_schedule_callback(PARROT_INTERP, - ARGIN(PMC *user_data), ARGIN(char *ext_data)) +Parrot_cx_check_quantum(PARROT_INTERP, ARGIN(PMC *scheduler)) { - ASSERT_ARGS(Parrot_cx_schedule_callback) - PMC * const callback = Parrot_pmc_new(interp, enum_class_Task); - Parrot_Task_attributes * const task_struct = PARROT_TASK(callback); - - task_struct->type = CONST_STRING(interp, "callback"); - task_struct->data = user_data; - task_struct->cb_data = ext_data; + ASSERT_ARGS(Parrot_cx_check_quantum) + Parrot_Scheduler_attributes * const sched = PARROT_SCHEDULER(scheduler); + const FLOATVAL time_now = Parrot_floatval_time(); - Parrot_cx_schedule_task(interp, callback); + if (sched->enable_preemption && time_now >= interp->quantum_done) + SCHEDULER_resched_requested_SET(scheduler); } /* +=item C -=item C - -Tell the scheduler to suspend for GC at the next safe pause. +Stop the current task and pack it up into a PMC what can be used to resume later. =cut - */ PARROT_EXPORT -void -Parrot_cx_request_suspend_for_gc(PARROT_INTERP) +PARROT_CANNOT_RETURN_NULL +PMC* +Parrot_cx_stop_task(PARROT_INTERP, ARGIN(opcode_t *next)) { - ASSERT_ARGS(Parrot_cx_request_suspend_for_gc) -#if CX_DEBUG - fprintf(stderr, "requesting gc suspend [interp=%p]\n", interp); -#endif - Parrot_cx_send_message(interp, CONST_STRING(interp, "suspend_for_gc"), PMCNULL); -} - -/* + ASSERT_ARGS(Parrot_cx_stop_task) + PMC * const task = Parrot_cx_current_task(interp); + Parrot_Task_attributes * const tdata = PARROT_TASK(task); + PMC * const cont = Parrot_pmc_new(interp, enum_class_Continuation); -=item C + VTABLE_set_pointer(interp, cont, next); -Remove a task from the scheduler's task list. - -=cut + if (PMC_IS_NULL(task) || !VTABLE_isa(interp, task, CONST_STRING(interp, "Task"))) + Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_INVALID_OPERATION, + "Attempt to stop invalid interp->current_task.\n"); -*/ + tdata->code = cont; + PARROT_GC_WRITE_BARRIER(interp, task); + TASK_in_preempt_SET(task); -PARROT_EXPORT -void -Parrot_cx_delete_task(PARROT_INTERP, ARGIN(PMC *task)) -{ - ASSERT_ARGS(Parrot_cx_delete_task) - if (interp->scheduler) { - const INTVAL tid = VTABLE_get_integer(interp, task); - VTABLE_delete_keyed_int(interp, interp->scheduler, tid); - } - else if (interp->scheduler) - Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_INVALID_OPERATION, - "Scheduler was not initialized for this interpreter.\n"); + return task; } - /* +=item C -=item C - -Remove a message that would suspend GC from the message queue. (Provided for -backward compatibility in the threads implementation.) +Pre-empt the current task. It goes on the foot of the task queue, +and then we jump all the way back to the task scheduling loop. =cut - */ -PARROT_EXPORT PARROT_CAN_RETURN_NULL -PMC * -Parrot_cx_delete_suspend_for_gc(PARROT_INTERP) +opcode_t* +Parrot_cx_preempt_task(PARROT_INTERP, ARGIN(PMC *scheduler), ARGIN(opcode_t *next)) { - ASSERT_ARGS(Parrot_cx_delete_suspend_for_gc) - if (interp->scheduler) { - STRING *suspend_str = CONST_STRING(interp, "suspend_for_gc"); - Parrot_Scheduler_attributes * sched_struct = PARROT_SCHEDULER(interp->scheduler); - INTVAL num_tasks, index; + ASSERT_ARGS(Parrot_cx_preempt_task) + Parrot_Scheduler_attributes * const sched = PARROT_SCHEDULER(scheduler); + PMC * const task = Parrot_cx_stop_task(interp, next); + VTABLE_push_pmc(interp, sched->task_queue, task); -#if CX_DEBUG - fprintf(stderr, "called delete_suspend_for_gc\n"); -#endif - -#if CX_DEBUG - fprintf(stderr, "locking msg_lock (delete) [interp=%p]\n", interp); -#endif - LOCK(sched_struct->msg_lock); - /* Search the task index for GC suspend tasks */ - num_tasks = VTABLE_elements(interp, sched_struct->messages); - for (index = 0; index < num_tasks; ++index) { - PMC *message = VTABLE_get_pmc_keyed_int(interp, sched_struct->messages, index); - if (!PMC_IS_NULL(message) - && STRING_equal(interp, VTABLE_get_string(interp, message), - suspend_str)) { - VTABLE_delete_keyed_int(interp, sched_struct->messages, index); - UNLOCK(sched_struct->msg_lock); - return message; - } - } -#if CX_DEBUG - fprintf(stderr, "unlocking msg_lock (delete) [interp=%p]\n", interp); -#endif - UNLOCK(sched_struct->msg_lock); - - } - else - Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_INVALID_OPERATION, - "Scheduler was not initialized for this interpreter.\n"); - - return PMCNULL; + return (opcode_t*)NULL; } /* -=item C +=item C -Add a handler to the current context's list of handlers. +Wake a sleeping scheduler runloop (generally called when new tasks are added to +the scheduler's task list). =cut */ -PARROT_EXPORT void -Parrot_cx_add_handler_local(PARROT_INTERP, ARGIN(PMC *handler)) +Parrot_cx_runloop_wake(PARROT_INTERP, ARGIN(PMC *scheduler)) { - ASSERT_ARGS(Parrot_cx_add_handler_local) - PMC *handlers = Parrot_pcc_get_handlers(interp, interp->ctx); - if (PMC_IS_NULL(handlers)) { - handlers = Parrot_pmc_new(interp, enum_class_ResizablePMCArray); - Parrot_pcc_set_handlers(interp, interp->ctx, handlers); - } - VTABLE_unshift_pmc(interp, handlers, handler); - + ASSERT_ARGS(Parrot_cx_runloop_wake) + Parrot_runcore_enable_event_checking(interp); + SCHEDULER_wake_requested_SET(scheduler); } + /* -=item C +=item C -Remove the top task handler of a particular type from the context's list of -handlers. +Schedule an event to terminate the scheduler runloop. =cut */ -PARROT_EXPORT void -Parrot_cx_delete_handler_local(PARROT_INTERP, ARGIN_NULLOK(STRING *handler_type)) +Parrot_cx_runloop_end(PARROT_INTERP) { - ASSERT_ARGS(Parrot_cx_delete_handler_local) - 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, - "No handler to delete."); - - if (STRING_IS_NULL(handler_type) || STRING_IS_EMPTY(handler_type)) - VTABLE_shift_pmc(interp, handlers); - else { - /* Loop from newest handler to oldest handler. */ - STRING *exception_str = CONST_STRING(interp, "exception"); - STRING *event_str = CONST_STRING(interp, "event"); - STRING *handler_str = CONST_STRING(interp, "ExceptionHandler"); - const INTVAL elements = VTABLE_elements(interp, handlers); - INTVAL index; - typedef enum { Hunknown, Hexception, Hevent } Htype; - - const Htype htype = - STRING_equal(interp, handler_type, exception_str) ? - Hexception : - STRING_equal(interp, handler_type, event_str) ? - Hevent : - Hunknown; - STRING * const handler_name = (htype == Hexception) ? handler_str : (STRING *)NULL; - - for (index = 0; index < elements; ++index) { - PMC * const 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; - } - } - } - - Parrot_ex_throw_from_c_args(interp, NULL, - EXCEPTION_INVALID_OPERATION, "No handler to delete."); - } + ASSERT_ARGS(Parrot_cx_runloop_end) + SCHEDULER_terminate_requested_SET(interp->scheduler); + /* Chandon TODO: Why is this here? */ + /* Parrot_cx_handle_tasks(interp, interp->scheduler); */ } - /* -=item C - -Count the number of active handlers of a particular type from the -context's list of handlers. - -=cut - -*/ - -PARROT_EXPORT -INTVAL -Parrot_cx_count_handlers_local(PARROT_INTERP, ARGIN(STRING *handler_type)) -{ - ASSERT_ARGS(Parrot_cx_count_handlers_local) - PMC * const handlers = Parrot_pcc_get_handlers(interp, interp->ctx); - INTVAL elements; - - if (PMC_IS_NULL(handlers)) - return 0; - - elements = VTABLE_elements(interp, handlers); - - if (STRING_IS_NULL(handler_type) || STRING_IS_EMPTY(handler_type)) - return elements; - - /* Loop from newest handler to oldest handler. */ - { - STRING *exception_str = CONST_STRING(interp, "exception"); - STRING *event_str = CONST_STRING(interp, "event"); - STRING *handler_str = CONST_STRING(interp, "ExceptionHandler"); - INTVAL count = 0; - INTVAL index; - typedef enum { Hunknown, Hexception, Hevent } Htype; - - const Htype htype = - (STRING_equal(interp, handler_type, exception_str)) ? - Hexception : - (STRING_equal(interp, handler_type, event_str)) ? - Hevent : - Hunknown; - STRING * const handler_name = (htype == Hexception) ? handler_str : (STRING *)NULL; - - for (index = 0; index < elements; ++index) { - PMC * const 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; - } - } - } - return count; - } -} - - -/* +=item C -=item C +Add a task to to the task queue for execution. -Add a task handler to scheduler's list of handlers. +Probably cannot be called across interpreters/threads, must instead be +called from within the interpreter's runloop. =cut @@ -647,24 +417,47 @@ Add a task handler to scheduler's list of handlers. PARROT_EXPORT void -Parrot_cx_add_handler(PARROT_INTERP, ARGIN(PMC *handler)) +Parrot_cx_schedule_task(PARROT_INTERP, ARGIN(PMC *task_or_sub)) { - ASSERT_ARGS(Parrot_cx_add_handler) - STRING * const add_handler = CONST_STRING(interp, "add_handler"); + ASSERT_ARGS(Parrot_cx_schedule_task) + Parrot_Scheduler_attributes * const sched = PARROT_SCHEDULER(interp->scheduler); + PMC * task = PMCNULL; + if (!interp->scheduler) Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_INVALID_OPERATION, "Scheduler was not initialized for this interpreter.\n"); - Parrot_pcc_invoke_method_from_c_args(interp, interp->scheduler, add_handler, "P->", handler); + if (VTABLE_isa(interp, task_or_sub, CONST_STRING(interp, "Task"))) { + task = task_or_sub; + } + else if (VTABLE_isa(interp, task_or_sub, CONST_STRING(interp, "Sub"))) { + Parrot_Task_attributes *tdata; + task = Parrot_pmc_new(interp, enum_class_Task); + tdata = PARROT_TASK(task); + tdata->code = task_or_sub; + PARROT_GC_WRITE_BARRIER(interp, task); + } + else { + Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_INVALID_OPERATION, + "Can only schedule Tasks and Subs.\n"); + } + + VTABLE_push_pmc(interp, sched->task_queue, task); + +#ifdef _WIN32 + /* TODO: Implement on Windows */ +#else + /* going from single to multi tasking? */ + if (VTABLE_get_integer(interp, sched->task_queue) == 1) + Parrot_cx_enable_preemption(interp); +#endif } /* -=item C +=item C -Remove the top task handler of a particular type from the scheduler's list of -handlers. +Add a task to the task queue for immediate execution. =cut @@ -672,42 +465,49 @@ handlers. PARROT_EXPORT void -Parrot_cx_delete_handler_typed(PARROT_INTERP, ARGIN(STRING *handler_type)) +Parrot_cx_schedule_immediate(PARROT_INTERP, ARGIN(PMC *task_or_sub)) { - ASSERT_ARGS(Parrot_cx_delete_handler_typed) - if (!interp->scheduler) + ASSERT_ARGS(Parrot_cx_schedule_immediate) + Parrot_Scheduler_attributes * const sched = PARROT_SCHEDULER(interp->scheduler); + PMC *task; + + if (VTABLE_isa(interp, task_or_sub, CONST_STRING(interp, "Task"))) { + task = task_or_sub; + } + else if (VTABLE_isa(interp, task_or_sub, CONST_STRING(interp, "Sub"))) { + Parrot_Task_attributes *tdata; + task = Parrot_pmc_new(interp, enum_class_Task); + tdata = PARROT_TASK(task); + tdata->code = task_or_sub; + PARROT_GC_WRITE_BARRIER(interp, task); + } + else { Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_INVALID_OPERATION, - "Scheduler was not initialized for this interpreter.\n"); + "Can only schedule Tasks and Subs.\n"); + } - Parrot_pcc_invoke_method_from_c_args(interp, interp->scheduler, CONST_STRING(interp, "delete_handler"), "S->", handler_type); + VTABLE_unshift_pmc(interp, sched->task_queue, task); + SCHEDULER_wake_requested_SET(interp->scheduler); + SCHEDULER_resched_requested_SET(interp->scheduler); } /* -=item C +=item C -Count the number of active handlers of a particular type (event, exception) in -the concurrency scheduler. +Returns the task that is currently running. =cut */ -PARROT_EXPORT -INTVAL -Parrot_cx_count_handlers_typed(PARROT_INTERP, ARGIN(STRING *handler_type)) +PARROT_CANNOT_RETURN_NULL +PARROT_PURE_FUNCTION +PMC* +Parrot_cx_current_task(PARROT_INTERP) { - ASSERT_ARGS(Parrot_cx_count_handlers_typed) - INTVAL count = 0; - - if (!interp->scheduler) - Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_INVALID_OPERATION, - "Scheduler was not initialized for this interpreter.\n"); - - Parrot_pcc_invoke_method_from_c_args(interp, interp->scheduler, CONST_STRING(interp, "count_handlers"), "S->I", handler_type, &count); - - return count; + ASSERT_ARGS(Parrot_cx_current_task) + return interp->cur_task; } /* @@ -736,255 +536,73 @@ Parrot_cx_send_message(PARROT_INTERP, ARGIN(STRING *messagetype), ARGIN(SHIM(PMC { ASSERT_ARGS(Parrot_cx_send_message) if (interp->scheduler) { - Parrot_Scheduler_attributes * sched_struct = PARROT_SCHEDULER(interp->scheduler); - PMC *message = Parrot_pmc_new(interp, enum_class_SchedulerMessage); + Parrot_Scheduler_attributes * const sched_struct = + PARROT_SCHEDULER(interp->scheduler); + PMC * const message = Parrot_pmc_new(interp, enum_class_SchedulerMessage); VTABLE_set_string_native(interp, message, messagetype); - message = VTABLE_share_ro(interp, message); -#if CX_DEBUG - fprintf(stderr, "sending message[interp=%p]\n", interp); -#endif - -#if CX_DEBUG - fprintf(stderr, "locking msg_lock (send) [interp=%p]\n", interp); -#endif - LOCK(sched_struct->msg_lock); VTABLE_push_pmc(interp, sched_struct->messages, message); -#if CX_DEBUG - fprintf(stderr, "unlocking msg_lock (send) [interp=%p]\n", interp); -#endif - UNLOCK(sched_struct->msg_lock); Parrot_cx_runloop_wake(interp, interp->scheduler); - } - } /* -=item C +=item C -Send a message to the schedulers in all interpreters/threads linked to this -one. +Schedule an alarm. =cut */ -PARROT_EXPORT void -Parrot_cx_broadcast_message(PARROT_INTERP, ARGIN(STRING *messagetype), ARGIN_NULLOK(PMC *data)) +Parrot_cx_schedule_alarm(PARROT_INTERP, ARGIN(PMC *alarm)) { - ASSERT_ARGS(Parrot_cx_broadcast_message) - UINTVAL i; - LOCK(interpreter_array_mutex); - for (i = 0; i < n_interpreters; ++i) { - Parrot_Interp other_interp = interpreter_array[i]; - if (interp == other_interp) - continue; - Parrot_cx_send_message(other_interp, messagetype, data); - } - UNLOCK(interpreter_array_mutex); - -} - -/* - -=back - -=head2 Task Interface Functions - -Functions that are used to interface with a specific task in the concurrency scheduler. - -=over 4 + ASSERT_ARGS(Parrot_cx_schedule_alarm) + Parrot_Scheduler_attributes * const sched = PARROT_SCHEDULER(interp->scheduler); + FLOATVAL alarm_time = VTABLE_get_number(interp, alarm); -=item C + Parrot_alarm_set(alarm_time); -Retrieve a handler appropriate to a given task. If the scheduler has no -appropriate handler, returns PMCNULL. - -=cut - -*/ - -PARROT_EXPORT -PARROT_CAN_RETURN_NULL -PMC * -Parrot_cx_find_handler_for_task(PARROT_INTERP, ARGIN(PMC *task)) -{ - ASSERT_ARGS(Parrot_cx_find_handler_for_task) - PMC *handler = PMCNULL; -#if CX_DEBUG - fprintf(stderr, "searching for handler\n"); -#endif - - if (!interp->scheduler) - Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_INVALID_OPERATION, - "Scheduler was not initialized for this interpreter.\n"); - - 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"); -#endif - - return handler; + /* Insert new alarm at correct (ordered by time) position in array. */ + Parrot_pmc_list_insert_by_number(interp, sched->alarms, alarm); } /* -=item C +=item C -Retrieve a handler appropriate to a given task from the local context. If the -context has no appropriate handler, returns PMCNULL. +Add the subs attached to any expired alarms to the task queue. =cut */ PARROT_EXPORT -PARROT_CAN_RETURN_NULL -PMC * -Parrot_cx_find_handler_local(PARROT_INTERP, ARGIN(PMC *task)) +void +Parrot_cx_check_alarms(PARROT_INTERP, ARGIN(PMC *scheduler)) { - ASSERT_ARGS(Parrot_cx_find_handler_local) - - /* - * Quick&dirty way to avoid infinite recursion - * when an exception is thrown while looking - * for a handler - */ - static int already_doing = 0; - static PMC * keep_context = NULL; - - PMC *context; - PMC *iter = PMCNULL; - STRING * const handled_str = CONST_STRING(interp, "handled"); - STRING * const handler_iter_str = CONST_STRING(interp, "handler_iter"); - STRING * const exception_str = CONST_STRING(interp, "Exception"); - const Parrot_Int is_exception = VTABLE_does(interp, task, exception_str); - - if (already_doing) { - Parrot_io_eprintf(interp, - "** Exception caught while looking for a handler, trying next **\n"); - if (! keep_context) - return NULL; - /* - * Note that we are now trying to handle the new exception, - * not the initial task argument (exception or whatever). - */ - context = Parrot_pcc_get_caller_ctx(interp, keep_context); - keep_context = NULL; - if (context) { - PMC * const handlers = Parrot_pcc_get_handlers(interp, context); - if (!PMC_IS_NULL(handlers)) - iter = VTABLE_get_iter(interp, handlers); - } - } - else { - ++already_doing; - - /* Exceptions store the handler iterator for rethrow, other kinds of - * tasks don't (though they could). */ - if (is_exception && - VTABLE_get_integer_keyed_str(interp, task, handled_str) == -1) { - iter = VTABLE_get_attr_str(interp, task, handler_iter_str); - context = (PMC *)VTABLE_get_pointer(interp, task); + ASSERT_ARGS(Parrot_cx_check_alarms) + Parrot_Scheduler_attributes * const sched = PARROT_SCHEDULER(scheduler); + INTVAL alarm_count = VTABLE_get_integer(interp, sched->alarms); + const FLOATVAL now_time = Parrot_floatval_time(); + + while (alarm_count) { + PMC * const alarm = VTABLE_shift_pmc(interp, sched->alarms); + const FLOATVAL alarm_time = VTABLE_get_number(interp, alarm); + + if (alarm_time < now_time) { + Parrot_Alarm_attributes *data = PARROT_ALARM(alarm); + Parrot_cx_schedule_immediate(interp, data->alarm_task); } else { - PMC * handlers; - context = CURRENT_CONTEXT(interp); - handlers = Parrot_pcc_get_handlers(interp, context); - if (!PMC_IS_NULL(handlers)) - iter = VTABLE_get_iter(interp, handlers); - } - } - - while (context) { - keep_context = context; - /* Loop from newest handler to oldest handler. */ - while (!PMC_IS_NULL(iter) && VTABLE_get_bool(interp, iter)) { - PMC * const handler = VTABLE_shift_pmc(interp, iter); - - if (!PMC_IS_NULL(handler)) { - INTVAL valid_handler = 0; - Parrot_pcc_invoke_method_from_c_args(interp, handler, CONST_STRING(interp, "can_handle"), - "P->I", task, &valid_handler); - - if (valid_handler) { - if (is_exception) { - /* Store iterator and context for a later rethrow. */ - VTABLE_set_attr_str(interp, task, handler_iter_str, iter); - VTABLE_set_pointer(interp, task, context); - } - --already_doing; - keep_context = NULL; - return handler; - } - } + Parrot_alarm_set(alarm_time); + VTABLE_unshift_pmc(interp, sched->alarms, alarm); + break; } - /* Continue the search in the next context up the chain. */ - context = Parrot_pcc_get_caller_ctx(interp, context); - if (context) { - PMC * const handlers = Parrot_pcc_get_handlers(interp, context); - iter = PMC_IS_NULL(handlers) ? PMCNULL : - VTABLE_get_iter(interp, handlers); - } - else - iter = PMCNULL; - } - - /* Reached the end of the context chain without finding a handler. */ - - --already_doing; - return PMCNULL; -} - -/* - -=item C - -Run the associated code block for a timer event, when the timer fires. - -=cut - -*/ - -void -Parrot_cx_timer_invoke(PARROT_INTERP, ARGIN(PMC *timer)) -{ - ASSERT_ARGS(Parrot_cx_timer_invoke) - Parrot_Timer_attributes * const timer_struct = PARROT_TIMER(timer); -#if CX_DEBUG - fprintf(stderr, "current timer time: %f, %f\n", - timer_struct->birthtime + timer_struct->duration, - Parrot_floatval_time()); -#endif - if (!PMC_IS_NULL(timer_struct->codeblock)) { - Parrot_ext_call(interp, timer_struct->codeblock, "->"); - } -} - -/* - -=item C - -Run the associated code block for a callback event. - -=cut - -*/ - -void -Parrot_cx_invoke_callback(PARROT_INTERP, ARGIN(PMC *callback)) -{ - ASSERT_ARGS(Parrot_cx_invoke_callback) - Parrot_Task_attributes * const task_struct = PARROT_TASK(callback); - if (!PMC_IS_NULL(task_struct->data)) { - Parrot_run_callback(interp, task_struct->data, - task_struct->cb_data); + alarm_count--; } } @@ -1016,139 +634,67 @@ opcode_t * Parrot_cx_schedule_sleep(PARROT_INTERP, FLOATVAL time, ARGIN_NULLOK(opcode_t *next)) { ASSERT_ARGS(Parrot_cx_schedule_sleep) - - /* Tell the scheduler runloop to wake, this is a good time to process - * pending tasks. */ - Parrot_cx_runloop_wake(interp, interp->scheduler); - -#ifdef PARROT_HAS_THREADS - { - Parrot_cond condition; - Parrot_mutex lock; - const FLOATVAL timer_end = time + Parrot_floatval_time(); - struct timespec time_struct; - - /* Tell this thread to sleep for the requested time. */ - COND_INIT(condition); - MUTEX_INIT(lock); - LOCK(lock); - time_struct.tv_sec = (time_t) timer_end; - time_struct.tv_nsec = (long)((timer_end - time_struct.tv_sec)*1000.0f) *1000L*1000L; - COND_TIMED_WAIT(condition, lock, &time_struct); - UNLOCK(lock); - COND_DESTROY(condition); - MUTEX_DESTROY(lock); - } -#else - /* A more primitive, platform-specific, non-threaded form of sleep. */ - if (time > 1000) { - /* prevent integer overflow when converting to microseconds */ - const int seconds = floor(time); - Parrot_sleep(seconds); - time -= seconds; - } - Parrot_usleep((UINTVAL) time*1000000); -#endif - return next; + const FLOATVAL now_time = Parrot_floatval_time(); + const FLOATVAL done_time = now_time + time; + PMC * const alarm = Parrot_pmc_new(interp, enum_class_Alarm); + Parrot_Alarm_attributes * const adata = PARROT_ALARM(alarm); + PMC * const task = Parrot_cx_stop_task(interp, next); + + adata->alarm_time = done_time; + adata->alarm_task = task; + PARROT_GC_WRITE_BARRIER(interp, alarm); + (void) VTABLE_invoke(interp, alarm, NULL); + + return (opcode_t*) NULL; } - /* =back -=head2 Internal Functions +=head2 Internal functions -Functions that are only used within the scheduler. +Functions that are used by the scheduler itself. =over 4 -=item C +=item C -Scheduler maintenance, scan the list of waiting tasks to see if any are ready -to become active tasks. +Enable preemption. Used when more than one task is runnable. =cut */ static void -scheduler_process_wait_list(PARROT_INTERP, ARGMOD(PMC *scheduler)) +Parrot_cx_enable_preemption(PARROT_INTERP) { - ASSERT_ARGS(scheduler_process_wait_list) - Parrot_Scheduler_attributes * sched_struct = PARROT_SCHEDULER(scheduler); - INTVAL num_tasks, index; - - /* Sweep the wait list for completed timers */ - num_tasks = VTABLE_elements(interp, sched_struct->wait_index); - for (index = 0; index < num_tasks; ++index) { - INTVAL tid = VTABLE_get_integer_keyed_int(interp, sched_struct->wait_index, index); - if (tid > 0) { - PMC *task = VTABLE_get_pmc_keyed_int(interp, sched_struct->task_list, tid); - if (PMC_IS_NULL(task)) { - /* Cleanup expired tasks. */ - VTABLE_set_integer_keyed_int(interp, sched_struct->wait_index, index, 0); - } - else { - /* Move the timer to the active task list if the timer has - * completed. */ - FLOATVAL timer_end_time = VTABLE_get_number_keyed_int(interp, - task, PARROT_TIMER_NSEC); - if (timer_end_time <= Parrot_floatval_time()) { - VTABLE_push_integer(interp, sched_struct->task_index, tid); - VTABLE_set_integer_keyed_int(interp, sched_struct->wait_index, index, 0); - Parrot_cx_schedule_repeat(interp, task); - SCHEDULER_cache_valid_CLEAR(scheduler); - } - } - } - } + ASSERT_ARGS(Parrot_cx_enable_preemption) +#ifdef _WIN32 + /* TODO: Implement on Windows */ +#else + Parrot_Scheduler_attributes * const sched = PARROT_SCHEDULER(interp->scheduler); + sched->enable_preemption = 1; + Parrot_cx_set_scheduler_alarm(interp); +#endif } /* -=item C +=item C -Scheduler maintenance, scan the list of messages sent from other schedulers and -take appropriate action on any received. +Disable preemption. Used when only one task is runnable. =cut */ static void -scheduler_process_messages(PARROT_INTERP, ARGMOD(PMC *scheduler)) +Parrot_cx_disable_preemption(PARROT_INTERP) { - ASSERT_ARGS(scheduler_process_messages) - Parrot_Scheduler_attributes * sched_struct = PARROT_SCHEDULER(scheduler); - - PMC *message; - STRING *suspend_str = CONST_STRING(interp, "suspend_for_gc"); - -#if CX_DEBUG - fprintf(stderr, "processing messages [interp=%p]\n", interp); -#endif - - while (VTABLE_elements(interp, sched_struct->messages) > 0) { -#if CX_DEBUG - fprintf(stderr, "locking msg_lock (process) [interp=%p]\n", interp); -#endif - LOCK(sched_struct->msg_lock); - message = VTABLE_pop_pmc(interp, sched_struct->messages); -#if CX_DEBUG - fprintf(stderr, "unlocking msg_lock (process) [interp=%p]\n", interp); -#endif - UNLOCK(sched_struct->msg_lock); - if (!PMC_IS_NULL(message) - && STRING_equal(interp, VTABLE_get_string(interp, message), - suspend_str)) { -#if CX_DEBUG - fprintf(stderr, "found a suspend, suspending [interp=%p]\n", interp); -#endif - pt_suspend_self_for_gc(interp); - } - } - + ASSERT_ARGS(Parrot_cx_disable_preemption) + Parrot_Scheduler_attributes * const sched = PARROT_SCHEDULER(interp->scheduler); + sched->enable_preemption = 0; } /* diff --git a/src/spf_render.c b/src/spf_render.c index d03eac6a59..f1e73e995d 100644 --- a/src/spf_render.c +++ b/src/spf_render.c @@ -364,7 +364,7 @@ canonicalize_exponent(ARGMOD(char *tc), ARGIN(const SpfInfo *info)) ? len - non0_pos : exp_digits + (len - last_pos - 1); - mem_sys_memmove(&tc[sign_pos+1], &tc[len - keep], keep+1); + memmove(&tc[sign_pos+1], &tc[len - keep], keep+1); len = sign_pos + 1 + keep; /* If it's a fixed-width field and we're too short now, @@ -381,7 +381,7 @@ canonicalize_exponent(ARGMOD(char *tc), ARGIN(const SpfInfo *info)) } else { size_t i; - mem_sys_memmove(&tc[info->width - len], &tc[0], len+1); + memmove(&tc[info->width - len], &tc[0], len+1); for (i = 0; i < info->width - len; ++i) tc[i] = (info->flags & FLAG_ZERO) ? '0' : ' '; } diff --git a/src/string/api.c b/src/string/api.c index 90a2ce277a..a1c2715081 100644 --- a/src/string/api.c +++ b/src/string/api.c @@ -1,5 +1,5 @@ /* -Copyright (C) 2001-2011, Parrot Foundation. +Copyright (C) 2001-2012, Parrot Foundation. =head1 NAME @@ -25,6 +25,7 @@ members, beside setting C/C for external strings. #include #include "parrot/parrot.h" +#include "parrot/events.h" #include "private_cstring.h" #include "api.str" @@ -73,6 +74,12 @@ static void throw_illegal_escape(PARROT_INTERP) /* Don't modify between HEADERIZER BEGIN / HEADERIZER END. Your changes will be lost. */ /* HEADERIZER END: static */ +/* + Buffer size for hexadecimal conversions: + Expected at most 8 characters plus room for some prefixes and suffixes. +*/ +#define HEX_BUF_SIZE 16 + /* =item C @@ -351,7 +358,7 @@ Parrot_str_clone(PARROT_INTERP, ARGIN_NULLOK(const STRING *s)) Parrot_gc_allocate_string_storage(interp, result, alloc_size); /* and copy it over */ - mem_sys_memcopy(result->strstart, s->strstart, alloc_size); + memcpy(result->strstart, s->strstart, alloc_size); } result->bufused = alloc_size; @@ -497,7 +504,7 @@ Parrot_str_concat(PARROT_INTERP, ARGIN_NULLOK(const STRING *a), PObj_is_string_copy_CLEAR(dest); /* Append b */ - mem_sys_memcopy(dest->strstart + dest->bufused, + memcpy(dest->strstart + dest->bufused, b->strstart, b->bufused); dest->encoding = enc; @@ -515,10 +522,10 @@ Parrot_str_concat(PARROT_INTERP, ARGIN_NULLOK(const STRING *a), dest->encoding = enc; /* Copy A first */ - mem_sys_memcopy(dest->strstart, a->strstart, a->bufused); + memcpy(dest->strstart, a->strstart, a->bufused); /* Tack B on the end of A */ - mem_sys_memcopy((void *)((ptrcast_t)dest->strstart + a->bufused), + memcpy((void *)((ptrcast_t)dest->strstart + a->bufused), b->strstart, b->bufused); } @@ -558,8 +565,8 @@ Parrot_str_new(PARROT_INTERP, ARGIN_NULLOK(const char *buffer), const UINTVAL le /* -=item C +=item C Makes a Parrot string from a Buffer. @@ -575,7 +582,7 @@ PARROT_WARN_UNUSED_RESULT PARROT_MALLOC PARROT_CANNOT_RETURN_NULL STRING * -Parrot_str_new_from_buffer(PARROT_INTERP, ARGMOD(Buffer *buffer), const UINTVAL len) +Parrot_str_new_from_buffer(PARROT_INTERP, ARGMOD(Parrot_Buffer *buffer), const UINTVAL len) { ASSERT_ARGS(Parrot_str_new_from_buffer) @@ -612,7 +619,7 @@ Parrot_str_new_constant(PARROT_INTERP, ARGIN(const char *buffer)) { ASSERT_ARGS(Parrot_str_new_constant) DECL_CONST_CAST; - Hash * const cstring_cache = (Hash *)interp->const_cstring_hash; + Hash * const cstring_cache = interp->const_cstring_hash; STRING *s = (STRING *)Parrot_hash_get(interp, cstring_cache, buffer); @@ -629,15 +636,13 @@ Parrot_str_new_constant(PARROT_INTERP, ARGIN(const char *buffer)) return s; } - /* =item C -Given a buffer, its length, an encoding, a character set, and STRING flags, -creates and returns a new string. If buffer is NULL and len >= 0, allocates -len bytes. +Given a buffer, its length, an encoding, and STRING flags, creates and returns +a new string. If buffer is NULL and len >= 0, allocates len bytes. =cut @@ -676,7 +681,7 @@ Parrot_str_new_init(PARROT_INTERP, ARGIN_NULLOK(const char *buffer), UINTVAL len Parrot_gc_allocate_string_storage(interp, s, len); if (buffer && len) { - mem_sys_memcopy(s->strstart, buffer, len); + memcpy(s->strstart, buffer, len); s->bufused = len; STRING_scan(interp, s); } @@ -687,6 +692,45 @@ Parrot_str_new_init(PARROT_INTERP, ARGIN_NULLOK(const char *buffer), UINTVAL len } +/* + +=item C + +Given a buffer and an encoding, creates and returns a new string. If buffer is +NULL the result is a null string. Otherwise, the buffer should be a zero +terminated c-style string and its content must be valid for the encoding +specified. If encoding is null, assume plaftorm encoding. + +=cut + +*/ + +PARROT_WARN_UNUSED_RESULT +PARROT_CANNOT_RETURN_NULL +STRING * +Parrot_str_new_from_cstring(PARROT_INTERP, ARGIN_NULLOK(const char *buffer), + ARGIN_NULLOK(STRING *encodingname)) +{ + ASSERT_ARGS(Parrot_str_new_from_cstring) + STRING *result = STRINGNULL; + if (buffer) { + const STR_VTABLE *encoding = STRING_IS_NULL(encodingname) ? + Parrot_platform_encoding_ptr : + Parrot_find_encoding_by_string(interp, encodingname); + if (encoding == NULL) + Parrot_ex_throw_from_c_args(interp, NULL, + EXCEPTION_INVALID_ENCODING, + "Invalid encoding"); + else { + int size = strlen(buffer); + result = Parrot_str_new_init(interp, buffer, size, encoding, 0); + } + } + return result; +} + + /* =item C @@ -712,7 +756,7 @@ Parrot_str_from_platform_cstring(PARROT_INTERP, ARGIN_NULLOK(const char *c)) if (setjmp(jmp.resume)) { /* catch */ - Parrot_cx_delete_handler_local(interp, STRINGNULL); + Parrot_cx_delete_handler_local(interp); retv = Parrot_str_new_init(interp, c, strlen(c), Parrot_binary_encoding_ptr, 0); } @@ -721,7 +765,7 @@ Parrot_str_from_platform_cstring(PARROT_INTERP, ARGIN_NULLOK(const char *c)) Parrot_ex_add_c_handler(interp, &jmp); retv = Parrot_str_new_init(interp, c, Parrot_str_platform_strlen(interp, c), Parrot_platform_encoding_ptr, 0); - Parrot_cx_delete_handler_local(interp, STRINGNULL); + Parrot_cx_delete_handler_local(interp); } return retv; @@ -991,7 +1035,7 @@ Parrot_str_repeat(PARROT_INTERP, ARGIN(const STRING *s), UINTVAL num) char * destpos = dest->strstart; const char * const srcpos = s->strstart; for (i = 0; i < num; ++i) { - mem_sys_memcopy(destpos, srcpos, length); + memcpy(destpos, srcpos, length); destpos += length; } @@ -1056,7 +1100,7 @@ Parrot_str_iter_substr(PARROT_INTERP, ASSERT_ARGS(Parrot_str_iter_substr) STRING * const dest = Parrot_str_copy(interp, str); - dest->strstart = (char *)dest->strstart + l->bytepos; + dest->strstart += l->bytepos; if (r == NULL) { dest->bufused = str->bufused - l->bytepos; @@ -1247,15 +1291,15 @@ Parrot_str_replace(PARROT_INTERP, ARGIN(const STRING *src), dest->bufused = buf_size; /* Copy begin of string */ - mem_sys_memcopy(dest->strstart, src->strstart, start_byte); + memcpy(dest->strstart, src->strstart, start_byte); /* Copy the replacement in */ - mem_sys_memcopy((char *)dest->strstart + start_byte, rep->strstart, + memcpy(dest->strstart + start_byte, rep->strstart, rep->bufused); /* Copy the end of old string */ - mem_sys_memcopy((char *)dest->strstart + start_byte + rep->bufused, - (char *)src->strstart + end_byte, + memcpy(dest->strstart + start_byte + rep->bufused, + src->strstart + end_byte, src->bufused - end_byte); dest->strlen = src->strlen - (end_char - start_char) + rep->strlen; @@ -2041,7 +2085,7 @@ Parrot_str_to_num(PARROT_INTERP, ARGIN_NULLOK(const STRING *s)) /* 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. */ + See https://github.com/parrot/parrot/issues/451 for more details. */ # define POW pow @@ -2233,7 +2277,7 @@ Parrot_str_pin(SHIM_INTERP, ARGMOD(STRING *s)) const size_t size = Buffer_buflen(s); char * const memory = (char *)mem_internal_allocate(size); - mem_sys_memcopy(memory, Buffer_bufstart(s), size); + memcpy(memory, Buffer_bufstart(s), size); Buffer_bufstart(s) = memory; s->strstart = memory; @@ -2279,7 +2323,7 @@ Parrot_str_unpin(PARROT_INTERP, ARGMOD(STRING *s)) Parrot_block_GC_sweep(interp); Parrot_gc_allocate_string_storage(interp, s, size); Parrot_unblock_GC_sweep(interp); - mem_sys_memcopy(Buffer_bufstart(s), memory, size); + memcpy(Buffer_bufstart(s), memory, size); /* Mark the memory as neither immobile nor system allocated */ PObj_sysmem_CLEAR(s); @@ -2392,7 +2436,7 @@ Parrot_str_escape_truncate(PARROT_INTERP, STRING *result; UINTVAL i, len, charlen; String_iter iter; - char hex_buf[16]; + char hex_buf[HEX_BUF_SIZE]; char *dp; if (STRING_IS_NULL(src)) @@ -2406,8 +2450,8 @@ Parrot_str_escape_truncate(PARROT_INTERP, /* expect around 2x the chars */ charlen = 2 * len; - if (charlen < 16) - charlen = 16; + if (charlen < HEX_BUF_SIZE) + charlen = HEX_BUF_SIZE; /* create ascii result */ result = Parrot_str_new_init(interp, NULL, charlen, @@ -2425,7 +2469,7 @@ Parrot_str_escape_truncate(PARROT_INTERP, /* process ASCII chars */ if (i >= charlen - 2) { /* resize - still len codepoints to go */ - charlen += len * 2 + 16; + charlen += len * 2 + HEX_BUF_SIZE; result->bufused = i; Parrot_gc_reallocate_string_storage(interp, result, charlen); /* start can change */ @@ -2479,23 +2523,23 @@ Parrot_str_escape_truncate(PARROT_INTERP, /* escape by appending either \uhhhh or \x{hh...} */ if (c < 0x0100 || c >= 0x10000) - hex_len = snprintf(hex_buf, 15, "\\x{%x}", c); + hex_len = snprintf(hex_buf, HEX_BUF_SIZE - 1, "\\x{%x}", c); else - hex_len = snprintf(hex_buf, 15, "\\u%04x", c); + hex_len = snprintf(hex_buf, HEX_BUF_SIZE - 1, "\\u%04x", c); if (hex_len < 0) hex_len = 0; if (i + hex_len > charlen) { /* resize - still len codepoints to go */ - charlen += len * 2 + 16; + charlen += len * 2 + HEX_BUF_SIZE; result->bufused = i; Parrot_gc_reallocate_string_storage(interp, result, charlen); /* start can change */ dp = result->strstart; } - mem_sys_memcopy(dp + i, hex_buf, hex_len); + memcpy(dp + i, hex_buf, hex_len); /* adjust our insert idx */ i += hex_len; diff --git a/src/string/encoding/shared.c b/src/string/encoding/shared.c index 6a6adbbc63..009d58c784 100644 --- a/src/string/encoding/shared.c +++ b/src/string/encoding/shared.c @@ -1423,13 +1423,40 @@ convert_case_buf(PARROT_INTERP, ARGMOD_NULLOK(char *dest_buf), size_t dest_len, return res * 2; #else - UNUSED(dest_buf); + if (mode == ENCODING_TITLECASE) + Parrot_ex_throw_from_c_args(interp, NULL, + EXCEPTION_LIBRARY_ERROR, "no ICU lib loaded"); + else if (dest_buf) { + Parrot_UInt2 *s = (Parrot_UInt2 *)src_buf; + Parrot_UInt2 *d = (Parrot_UInt2 *)dest_buf; + UINTVAL len = src_len / 2; + UINTVAL i; + + for (i = 0; i < len; ++i) { + unsigned int c = s[i]; + if (c > 255) { + Parrot_ex_throw_from_c_args(interp, NULL, + EXCEPTION_LIBRARY_ERROR, "no ICU lib loaded"); + } + switch (mode) { + case ENCODING_UPCASE: + d[i] = (c >= 0xe0 && c != 0xf7) + ? c & ~0x20 + : toupper((unsigned char)c); + break; + case ENCODING_DOWNCASE: + d[i] = (c >= 0xc0 && c != 0xd7 && c <= 0xde) + ? c | 0x20 + : tolower((unsigned char)c); + break; + default: + d[i] = s[i]; + } + } + } + UNUSED(dest_len); - UNUSED(src_buf); - UNUSED(src_len); - UNUSED(mode); - Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_LIBRARY_ERROR, - "no ICU lib loaded"); + return src_len; #endif } diff --git a/src/string/encoding/utf8.c b/src/string/encoding/utf8.c index 2e52a2cfd4..9ae7e30f12 100644 --- a/src/string/encoding/utf8.c +++ b/src/string/encoding/utf8.c @@ -577,7 +577,9 @@ utf8_iter_set_and_advance(PARROT_INTERP, i->charpos += 1; i->bytepos += end - ptr; - PARROT_ASSERT(i->bytepos <= str->bufused); + /* Commenting this out allows us to iterate and assemble strings in empty + (but pre-allocated) buffers. */ + /* PARROT_ASSERT(i->bytepos <= str->bufused); */ } diff --git a/src/sub.c b/src/sub.c index bd7b7047a8..6ac5d6f26c 100644 --- a/src/sub.c +++ b/src/sub.c @@ -27,26 +27,6 @@ Subroutines, continuations, co-routines and other fun stuff... /* HEADERIZER HFILE: include/parrot/sub.h */ -/* - -=item C - -Indicate that a new round of context marking is about to take place. - -=cut - -*/ - -static int context_gc_mark = 0; - -void -Parrot_sub_mark_context_start(void) -{ - ASSERT_ARGS(Parrot_sub_mark_context_start) - if (++context_gc_mark == 0) context_gc_mark = 1; -} - - /* =item C @@ -221,7 +201,7 @@ Parrot_sub_get_line_from_pc(PARROT_INTERP, ARGIN_NULLOK(PMC *subpmc), ARGIN_NULL 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; + size_t i, op, current_annotation, debug_size, code_size; if (!subpmc || !pc) return -1; @@ -230,13 +210,14 @@ Parrot_sub_get_line_from_pc(PARROT_INTERP, ARGIN_NULLOK(PMC *subpmc), ARGIN_NULL debug_ops = sub->seg->debugs->base.data; debug_size = sub->seg->debugs->base.size; + code_size = sub->seg->base.size; base_pc = sub->seg->base.data; current_annotation = pc - base_pc; /* assert pc is in correct segment */ - PARROT_ASSERT(base_pc <= pc && pc <= base_pc + sub->seg->base.size); + PARROT_ASSERT(base_pc <= pc && pc <= base_pc + code_size); - for (i = op = 0; op < debug_size; ++i) { + for (i = op = 0; op < code_size; ++i) { op_info_t * const op_info = sub->seg->op_info_table[*base_pc]; opcode_t var_args = 0; @@ -290,7 +271,7 @@ Parrot_sub_get_filename_from_pc(PARROT_INTERP, ARGIN_NULLOK(PMC *subpmc), /* -=item C +=item C Formats context information for display. Takes a context pointer and returns a pointer to the text. Used in debug.c and warnings.c @@ -303,14 +284,12 @@ PARROT_EXPORT PARROT_CAN_RETURN_NULL PARROT_WARN_UNUSED_RESULT STRING* -Parrot_sub_Context_infostr(PARROT_INTERP, ARGIN(PMC *ctx)) +Parrot_sub_Context_infostr(PARROT_INTERP, ARGIN(PMC *ctx), int is_top) { ASSERT_ARGS(Parrot_sub_Context_infostr) Parrot_Context_info info; STRING *res = NULL; - const char * const msg = (CURRENT_CONTEXT(interp) == ctx) - ? "current instr.:" - : "called from Sub"; + const char * const msg = is_top ? "current instr.:" : "called from Sub"; Parrot_block_GC_mark(interp); if (Parrot_sub_context_get_info(interp, ctx, &info)) { diff --git a/src/thread.c b/src/thread.c deleted file mode 100644 index 8412cdda41..0000000000 --- a/src/thread.c +++ /dev/null @@ -1,1674 +0,0 @@ -/* -Copyright (C) 2001-2010, Parrot Foundation. - -=head1 NAME - -src/thread.c - Thread handling stuff - -=head1 DESCRIPTION - -Threads are created by creating new C objects. - -=head2 Functions - -=over 4 - -=cut - -*/ - -#include "parrot/parrot.h" -#include "parrot/extend.h" -#include "parrot/atomic.h" -#include "parrot/runcore_api.h" -#include "pmc/pmc_sub.h" -#include "pmc/pmc_parrotinterpreter.h" - -/* HEADERIZER HFILE: include/parrot/thread.h */ - -/* HEADERIZER BEGIN: static */ -/* Don't modify between HEADERIZER BEGIN / HEADERIZER END. Your changes will be lost. */ - -PARROT_CAN_RETURN_NULL -static Parrot_Interp detach(UINTVAL tid); - -PARROT_CAN_RETURN_NULL -static Shared_gc_info * get_pool(void); - -PARROT_WARN_UNUSED_RESULT -static int is_suspended_for_gc(PARROT_INTERP) - __attribute__nonnull__(1); - -PARROT_CAN_RETURN_NULL -static PMC * make_local_args_copy(PARROT_INTERP, - ARGIN(Parrot_Interp old_interp), - ARGIN_NULLOK(PMC *args)) - __attribute__nonnull__(1) - __attribute__nonnull__(2); - -PARROT_CAN_RETURN_NULL -static PMC * make_local_copy(PARROT_INTERP, - ARGIN(Parrot_Interp from), - ARGIN(PMC *arg)) - __attribute__nonnull__(1) - __attribute__nonnull__(2) - __attribute__nonnull__(3); - -static void mutex_unlock(ARGMOD(void *arg)) - __attribute__nonnull__(1) - FUNC_MODIFIES(*arg); - -static Parrot_Interp pt_check_tid(UINTVAL tid, ARGIN(const char *from)) - __attribute__nonnull__(2); - -static int pt_gc_count_threads(void); -static void pt_gc_wait_for_stage(PARROT_INTERP, - thread_gc_stage_enum from_stage, - thread_gc_stage_enum to_stage) - __attribute__nonnull__(1); - -static void pt_gc_wakeup_check(void); -static void pt_ns_clone(PARROT_INTERP, - ARGOUT(Parrot_Interp d), - ARGOUT(PMC *dest_ns), - ARGIN(Parrot_Interp s), - ARGIN(PMC *source_ns)) - __attribute__nonnull__(1) - __attribute__nonnull__(2) - __attribute__nonnull__(3) - __attribute__nonnull__(4) - __attribute__nonnull__(5) - FUNC_MODIFIES(d) - FUNC_MODIFIES(*dest_ns); - -static void pt_suspend_all_for_gc(PARROT_INTERP) - __attribute__nonnull__(1); - -static void pt_suspend_one_for_gc(PARROT_INTERP) - __attribute__nonnull__(1); - -static void pt_thread_signal(ARGIN(Parrot_Interp self), PARROT_INTERP) - __attribute__nonnull__(1) - __attribute__nonnull__(2); - -static void pt_thread_wait(PARROT_INTERP) - __attribute__nonnull__(1); - -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 = (0) -#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(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 = (0) -#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 = (0) -#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(self) \ - , PARROT_ASSERT_ARG(interp)) -#define ASSERT_ARGS_pt_thread_wait __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 */ - -#if defined THREAD_DEBUG && THREAD_DEBUG -# define DEBUG_ONLY(x) (x) -#else -# define DEBUG_ONLY(x) -#endif - -static int running_threads; - -void Parrot_really_destroy(PARROT_INTERP, int exit_code, void *arg); - -/* - -=item C - -Creates a local copy of the PMC if necessary. (No copy is made if it is marked -shared.) This includes workarounds for Parrot_clone() not doing the Right Thing -with subroutines (specifically, code segments aren't preserved and it is -difficult to do so as long as Parrot_clone() depends on freezing). - -=cut - -*/ - -PARROT_CAN_RETURN_NULL -static PMC * -make_local_copy(PARROT_INTERP, ARGIN(Parrot_Interp from), ARGIN(PMC *arg)) -{ - ASSERT_ARGS(make_local_copy) - PMC *ret_val; - STRING * const _sub = interp->vtables[enum_class_Sub]->whoami; - STRING * const _multi_sub = interp->vtables[enum_class_MultiSub]->whoami; - - if (PMC_IS_NULL(arg)) { - ret_val = PMCNULL; - } - else if (PObj_is_PMC_shared_TEST(arg)) { - ret_val = arg; - } - else if (VTABLE_isa(from, arg, _multi_sub)) { - INTVAL i = 0; - const INTVAL n = VTABLE_elements(from, arg); - ret_val = Parrot_pmc_new(interp, enum_class_MultiSub); - - for (i = 0; i < n; ++i) { - PMC *const orig = VTABLE_get_pmc_keyed_int(from, arg, i); - PMC *const copy = make_local_copy(interp, from, orig); - VTABLE_push_pmc(interp, ret_val, copy); - } - } - else if (VTABLE_isa(from, arg, _sub)) { - /* this is a workaround for cloning subroutines not actually - * working as one might expect mainly because the segment is - * not correctly copied - */ - Parrot_Sub_attributes *ret_val_sub, *arg_sub; - - ret_val = Parrot_clone(interp, arg); - PMC_get_sub(interp, ret_val, ret_val_sub); - PMC_get_sub(interp, arg, arg_sub); - ret_val_sub->seg = arg_sub->seg; - /* Skip vtable overrides and methods. */ - if (ret_val_sub->vtable_index == -1 - && !(ret_val_sub->comp_flags & SUB_COMP_FLAG_METHOD)) { - Parrot_ns_store_sub(interp, ret_val); - } - } - else { - ret_val = Parrot_clone(interp, arg); - } - return ret_val; -} - -/* - -=item C - -Gets the shared gc information. For now this is global data; ideally it will -become something other than a static variable. If everything uses this -function, it will be easier to change. - -=cut - -*/ - -PARROT_CAN_RETURN_NULL -static Shared_gc_info * -get_pool(void) -{ - ASSERT_ARGS(get_pool) - return shared_gc_info; -} - -/* - -=item C - -Frees the shared GC information. This clears any global data when joining all -threads at parent interpreter destruction. - -=cut - -*/ - -void -pt_free_pool(PARROT_INTERP) -{ - ASSERT_ARGS(pt_free_pool) - if (shared_gc_info) { - COND_DESTROY(shared_gc_info->gc_cond); - PARROT_ATOMIC_INT_DESTROY(shared_gc_info->gc_block_level); - mem_internal_free(shared_gc_info); - shared_gc_info = NULL; - } -} - -/* - -=item C - -Make a local copy of the corresponding array of arguments. - -=cut - -*/ - -PARROT_CAN_RETURN_NULL -static PMC * -make_local_args_copy(PARROT_INTERP, ARGIN(Parrot_Interp old_interp), ARGIN_NULLOK(PMC *args)) -{ - ASSERT_ARGS(make_local_args_copy) - PMC *ret_val; - INTVAL old_size; - INTVAL i; - - if (PMC_IS_NULL(args)) - return PMCNULL; - - old_size = VTABLE_get_integer(old_interp, args); - - /* XXX should this be a different type? */ - ret_val = Parrot_pmc_new(interp, enum_class_FixedPMCArray); - VTABLE_set_integer_native(interp, ret_val, old_size); - - for (i = 0; i < old_size; ++i) { - PMC * const copy = make_local_copy(interp, old_interp, - VTABLE_get_pmc_keyed_int(old_interp, args, i)); - - VTABLE_set_pmc_keyed_int(interp, ret_val, i, copy); - } - - return ret_val; -} - -/* - -=item C - -Modifies a PMC to be sharable. Right now, reassigns the vtable to one -owned by some master interpreter, so the PMC can be safely reused -after thread death. - -In the future the PMC returned might be different than the one -passed, e.g., if we need to reallocate the PMC in a different -interpreter. - -=cut - -*/ - -PARROT_CAN_RETURN_NULL -PMC * -pt_shared_fixup(PARROT_INTERP, ARGMOD(PMC *pmc)) -{ - ASSERT_ARGS(pt_shared_fixup) - /* TODO this will need to change for thread pools - * XXX should we have a separate interpreter for this? - */ - INTVAL type_num; - Parrot_Interp master = interpreter_array[0]; - const int is_ro = pmc->vtable->flags & VTABLE_IS_READONLY_FLAG; - - /* This lock is paired with one in objects.c. It is necessary to protect - * against the master interpreter adding classes and consequently - * resizing its classname->type_id hashtable and/or expanding its vtable - * array. - * TODO investigate if a read-write lock results in substantially - * better performance. - */ - LOCK_INTERPRETER(master); - type_num = pmc->vtable->base_type; - - if (type_num == enum_type_undef) { - UNLOCK_INTERPRETER(master); - Parrot_ex_throw_from_c_args(interp, NULL, 1, - "pt_shared_fixup: unsharable type"); - } - - pmc->vtable = master->vtables[type_num]; - - UNLOCK_INTERPRETER(master); - - if (is_ro) - pmc->vtable = pmc->vtable->ro_variant_vtable; - - PObj_is_PMC_shared_SET(pmc); - - /* make sure metadata doesn't go away unexpectedly */ - if (PMC_metadata(pmc)) - PMC_metadata(pmc) = pt_shared_fixup(interp, PMC_metadata(pmc)); - - return pmc; -} - -/* - -=item C - -Wakes up an C which should have called pt_thread_wait(). - -=cut - -*/ - -static void -pt_thread_signal(ARGIN(Parrot_Interp self), PARROT_INTERP) -{ - ASSERT_ARGS(pt_thread_signal) - COND_SIGNAL(interp->thread_data->interp_cond); -} - -/* - -=item C - -Waits for this interpreter to be signalled through its condition variable, -dealing properly with GC issues. C<*mutex> is assumed locked on entry and -will be locked on exit from this function. If a GC run occurs in the middle of -this function, then a spurious wakeup may occur. - -=cut - -*/ - -void -pt_thread_wait_with(PARROT_INTERP, ARGMOD(Parrot_mutex *mutex)) -{ - ASSERT_ARGS(pt_thread_wait_with) - LOCK(interpreter_array_mutex); - if (interp->thread_data->state & THREAD_STATE_SUSPEND_GC_REQUESTED) { - interp->thread_data->state |= THREAD_STATE_SUSPENDED_GC; - UNLOCK(interpreter_array_mutex); - UNLOCK(*mutex); - - pt_suspend_self_for_gc(interp); - - LOCK(*mutex); - /* since we unlocked the mutex something bad may have occurred */ - return; - } - - interp->thread_data->state |= THREAD_STATE_GC_WAKEUP; - - UNLOCK(interpreter_array_mutex); - COND_WAIT(interp->thread_data->interp_cond, *mutex); - LOCK(interpreter_array_mutex); - - interp->thread_data->state &= ~THREAD_STATE_GC_WAKEUP; - - if (interp->thread_data->state & THREAD_STATE_SUSPENDED_GC) { - UNLOCK(*mutex); - /* XXX loop needed? */ - do { - UNLOCK(interpreter_array_mutex); - /* fprintf(stderr, "%p: woken up, doing GC run\n", interp); */ - pt_suspend_self_for_gc(interp); - LOCK(interpreter_array_mutex); - } while (interp->thread_data->state & THREAD_STATE_SUSPENDED_GC); - - UNLOCK(interpreter_array_mutex); - LOCK(*mutex); - } - else { - UNLOCK(interpreter_array_mutex); - } -} - -/* - -=item C - -Waits for a signal, handling GC matters correctly. C -is assumed held. Spurious wakeups may occur. - -=cut - -*/ - -static void -pt_thread_wait(PARROT_INTERP) -{ - ASSERT_ARGS(pt_thread_wait) - if (interp->thread_data->state & THREAD_STATE_SUSPEND_GC_REQUESTED) { - interp->thread_data->state |= THREAD_STATE_SUSPENDED_GC; - /* fprintf(stderr, "%p: pt_thread_wait, before sleep, doing GC run\n", - * interp); */ - - UNLOCK(interpreter_array_mutex); - pt_suspend_self_for_gc(interp); - LOCK(interpreter_array_mutex); - - /* while we were GCing, whatever we were waiting on might have - * changed */ - return; - } - - interp->thread_data->state |= THREAD_STATE_GC_WAKEUP; - - COND_WAIT(interp->thread_data->interp_cond, interpreter_array_mutex); - - interp->thread_data->state &= ~THREAD_STATE_GC_WAKEUP; - - while (interp->thread_data->state & THREAD_STATE_SUSPENDED_GC) { - UNLOCK(interpreter_array_mutex); - /* fprintf(stderr, "%p: woken up, doing GC run\n", interp); */ - pt_suspend_self_for_gc(interp); - LOCK(interpreter_array_mutex); - } -} - - -/* - -=item C - -The actual thread function. - -=cut - -*/ - -PARROT_CAN_RETURN_NULL -static void* -thread_func(ARGIN_NULLOK(void *arg)) -{ - ASSERT_ARGS(thread_func) - Parrot_runloop jump_point; - int lo_var_ptr; - UINTVAL tid; - PMC * volatile sub_pmc; - PMC *sub_arg; - PMC * const self = (PMC*) arg; - PMC *ret_val = PMCNULL; - Parrot_Interp interp = - (Parrot_Interp)((Parrot_ParrotInterpreter_attributes *)PMC_data(self))->interp; - - Parrot_block_GC_mark(interp); - Parrot_block_GC_sweep(interp); - - /* need to set it here because argument passing can trigger GC */ - interp->lo_var_ptr = &lo_var_ptr; - GETATTR_ParrotInterpreter_sub(interp, self, sub_pmc); - sub_arg = VTABLE_get_pmc(interp, self); - - if (setjmp(jump_point.resume)) { - /* caught exception */ - /* XXX what should we really do here */ - /* PMC *exception = Parrot_cx_peek_task(interp); - Parrot_io_eprintf(interp, - "Unhandled exception in thread with tid %d " - "(message=%Ss, number=%d)\n", - interp->thread_data->tid, - VTABLE_get_string(interp, exception), - VTABLE_get_integer_keyed_str(interp, exception, - Parrot_str_new_constant(interp, "type"))); */ - } - else { - /* run normally */ - Parrot_ex_add_c_handler(interp, &jump_point); - Parrot_unblock_GC_mark(interp); - Parrot_unblock_GC_sweep(interp); - Parrot_ext_call(interp, sub_pmc, "Pf->P", sub_arg, &ret_val); - } - - /* thread is finito */ - LOCK(interpreter_array_mutex); - DEBUG_ONLY(fprintf(stderr, "marking an thread as finished\n")); - - interp->thread_data->state |= THREAD_STATE_FINISHED; - tid = interp->thread_data->tid; - - if (interp != interpreter_array[tid]) { - UNLOCK(interpreter_array_mutex); - PANIC(interp, "thread finished: interpreter mismatch"); - } - if (interp->thread_data->state & THREAD_STATE_DETACHED) { - interpreter_array[tid] = NULL; - DEBUG_ONLY(fprintf(stderr, - "really destroying an interpreter [exit while detached]\n")); - Parrot_really_destroy(interp, 0, NULL); - } - else if (interp->thread_data->state & THREAD_STATE_JOINED) { - pt_thread_signal(interp, interp->thread_data->joiner); - } - - /* make sure we don't block a GC run */ - pt_gc_wakeup_check(); - PARROT_ASSERT(interp->thread_data->state & THREAD_STATE_FINISHED); - - UNLOCK(interpreter_array_mutex); - - return ret_val; -} - -/* - -=back - -=head2 Helper functions used also for running plain interpreters - -=over 4 - -=item C - -Copies/clones the packfile/code from interpreter C to C. All -resources are created in C. - -=cut - -*/ - -void -pt_clone_code(Parrot_Interp d, Parrot_Interp s) -{ - ASSERT_ARGS(pt_clone_code) - Parrot_block_GC_mark(d); - Interp_flags_SET(d, PARROT_EXTERN_CODE_FLAG); - d->code = NULL; - Parrot_switch_to_cs(d, s->code, 1); - Parrot_unblock_GC_mark(d); -} - -/* - -=item C - -Clones all globals from C to C. - -=cut - -*/ - -static void -pt_ns_clone(PARROT_INTERP, ARGOUT(Parrot_Interp d), ARGOUT(PMC *dest_ns), - ARGIN(Parrot_Interp s), ARGIN(PMC *source_ns)) -{ - ASSERT_ARGS(pt_ns_clone) - PMC * const iter = VTABLE_get_iter(s, source_ns); - const INTVAL n = VTABLE_elements(s, source_ns); - INTVAL i; - - for (i = 0; i < n; ++i) { - /* XXX what if 'key' is a non-constant-pool string? */ - STRING * const key = VTABLE_shift_string(s, iter); - PMC * const val = VTABLE_get_pmc_keyed_str(s, source_ns, key); - - if (val->vtable->base_type == enum_class_NameSpace) { - PMC *sub_ns = VTABLE_get_pmc_keyed_str(d, dest_ns, key); - if (PMC_IS_NULL(sub_ns) || sub_ns->vtable->base_type != - enum_class_NameSpace) { - sub_ns = Parrot_pmc_new(d, enum_class_NameSpace); - VTABLE_set_pmc_keyed_str(d, dest_ns, key, sub_ns); - } - pt_ns_clone(s, d, sub_ns, s, val); - } - else { - PMC * const dval = VTABLE_get_pmc_keyed_str(d, dest_ns, key); - - if (PMC_IS_NULL(dval)) { - PMC * const copy = make_local_copy(d, s, val); - Parrot_Sub_attributes *val_sub; - - if (val->vtable->base_type == enum_class_Sub) - PMC_get_sub(interp, val, val_sub); - - /* Vtable overrides and methods were already cloned, so don't reclone them. */ - if (! (val->vtable->base_type == enum_class_Sub - && (val_sub->vtable_index != -1 - || val_sub->comp_flags & SUB_COMP_FLAG_METHOD))) { - VTABLE_set_pmc_keyed_str(d, dest_ns, key, copy); - } - } - } - } -} - -/* - -=item C - -Copies the global namespace when cloning a new interpreter. - -=cut - -*/ - -void -pt_clone_globals(Parrot_Interp d, Parrot_Interp s) -{ - ASSERT_ARGS(pt_clone_globals) - Parrot_block_GC_mark(d); - pt_ns_clone(s, d, d->root_namespace, s, s->root_namespace); - Parrot_unblock_GC_mark(d); -} - -/* - -=item C - -Sets up a new thread to run. - -=cut - -*/ - -void -pt_thread_prepare_for_run(Parrot_Interp d, SHIM(Parrot_Interp s)) -{ - ASSERT_ARGS(pt_thread_prepare_for_run) -} - -/* - -=back - -=head2 ParrotThread methods - -=over 4 - -=cut - -*/ - -/* - -=item C - -Clones the sub so that it's suitable for the other interpreter. - -=cut - -*/ - -PARROT_CAN_RETURN_NULL -PMC * -pt_transfer_sub(ARGOUT(Parrot_Interp d), ARGIN(Parrot_Interp s), ARGIN(PMC *sub)) -{ - ASSERT_ARGS(pt_transfer_sub) -#if defined THREAD_DEBUG && THREAD_DEBUG - Parrot_io_eprintf(s, "copying over subroutine [%Ss]\n", - Parrot_sub_full_sub_name(s, sub)); -#endif - return make_local_copy(d, s, sub); -} - -/* - -=item C - -create a pt_thread - -=cut - -*/ - -PARROT_EXPORT -PARROT_CANNOT_RETURN_NULL -PARROT_WARN_UNUSED_RESULT -PMC * -pt_thread_create(PARROT_INTERP, INTVAL type, INTVAL clone_flags) -{ - ASSERT_ARGS(pt_thread_create) - PMC * const new_interp_pmc = pmc_new(interp, type); - Interp * const new_interp = (Interp *)VTABLE_get_pointer(interp, new_interp_pmc); - - clone_interpreter(new_interp, interp, clone_flags); - pt_thread_prepare_for_run(new_interp, interp); - - return new_interp_pmc; -} - -/* - -=item C - -run a pt_thread - -=cut - -*/ - -int -pt_thread_run(PARROT_INTERP, ARGMOD(PMC *thread_interp_pmc), ARGIN(PMC *sub), - ARGIN_NULLOK(PMC *arg)) -{ - ASSERT_ARGS(pt_thread_run) - Interp * const thread_interp = (Interp *)VTABLE_get_pointer(interp, thread_interp_pmc); - - SETATTR_ParrotInterpreter_sub(interp, - thread_interp_pmc, pt_transfer_sub(thread_interp, interp, sub)); - VTABLE_set_pmc(interp, thread_interp_pmc, make_local_args_copy(thread_interp, interp, arg)); - thread_interp->thread_data->state = THREAD_STATE_JOINABLE; - - THREAD_CREATE_JOINABLE(thread_interp->thread_data->thread, thread_func, thread_interp_pmc); - - /* check for pending GC */ - /* - * can't do multi-threaded GC yet - * XXX a quick hack to pass the few tests - - LOCK(interpreter_array_mutex); - if (interp->thread_data->state & THREAD_STATE_SUSPEND_GC_REQUESTED) - pt_suspend_one_for_gc(new_interp); - UNLOCK(interpreter_array_mutex); - - */ - - return thread_interp->thread_data->tid; -} - -/* - -=item C - -create a pt_thread run - -=cut - -*/ - -int -pt_thread_create_run(PARROT_INTERP, - INTVAL type, INTVAL clone_flags, ARGIN(PMC *sub), ARGIN_NULLOK(PMC *arg)) -{ - ASSERT_ARGS(pt_thread_create_run) - PMC *thread_interp_pmc = pt_thread_create(interp, type, clone_flags); - return pt_thread_run(interp, thread_interp_pmc, sub, arg); -} - - -/* - -=item C - -Relinquishes hold on the processor. - -=cut - -*/ - -void -pt_thread_yield(void) -{ - ASSERT_ARGS(pt_thread_yield) - YIELD; -} - -/* - -=item C - -Helper function. Checks if the given thread ID is valid. The caller holds the -mutex. Returns the interpreter for C. - -=cut - -*/ - -static Parrot_Interp -pt_check_tid(UINTVAL tid, ARGIN(const char *from)) -{ - ASSERT_ARGS(pt_check_tid) - if (tid >= n_interpreters) { - UNLOCK(interpreter_array_mutex); - exit_fatal(1, "%s: illegal thread tid %d", from, tid); - } - if (tid == 0) { - UNLOCK(interpreter_array_mutex); - exit_fatal(1, "%s: illegal thread tid %d (main)", from, tid); - } - if (!interpreter_array[tid]) { - UNLOCK(interpreter_array_mutex); - exit_fatal(1, "%s: illegal thread tid %d - empty", from, tid); - } - return interpreter_array[tid]; -} - -/* - -=item C - -Unlocks the mutex C<*arg>. - -=cut - -*/ - -static void -mutex_unlock(ARGMOD(void *arg)) -{ - ASSERT_ARGS(mutex_unlock) - UNLOCK(*(Parrot_mutex *) arg); -} - -/* - -=item C - -Returns true iff C is suspended for a global GC run. Be sure to hold -C. - -=cut - -*/ - -PARROT_WARN_UNUSED_RESULT -static int -is_suspended_for_gc(PARROT_INTERP) -{ - ASSERT_ARGS(is_suspended_for_gc) - if (!interp) - return 1; - else if (interp->thread_data->wants_shared_gc) - return 1; - else if (interp->thread_data->state & THREAD_STATE_SUSPENDED_GC) - return 1; - else if ((interp->thread_data->state & THREAD_STATE_FINISHED) || - (interp->thread_data->state & THREAD_STATE_NOT_STARTED)) - return 1; - else - return 0; -} - -/* - -=item C - -Returns the number of active threads in the system (running or suspended). Be -sure to hold C. - -=cut - -*/ - -static int -pt_gc_count_threads(void) -{ - ASSERT_ARGS(pt_gc_count_threads) - UINTVAL i; - int count = 0; - - for (i = 0; i < n_interpreters; ++i) { - Parrot_Interp cur; - cur = interpreter_array[i]; - if (!cur) - continue; - if (cur->thread_data->state & (THREAD_STATE_NOT_STARTED | - THREAD_STATE_FINISHED)) - continue; - ++count; - } - DEBUG_ONLY(fprintf(stderr, "found %d threads\n", count)); - return count; -} - -/* - -=item C - -Waits until all threads have reached the desired stage. Takes an interpreter, -starting stage and ending stage as arguments. Updates the thread information. -Used in C and C. - -=cut - -*/ - -static void -pt_gc_wait_for_stage(PARROT_INTERP, thread_gc_stage_enum from_stage, - thread_gc_stage_enum to_stage) -{ - ASSERT_ARGS(pt_gc_wait_for_stage) - Shared_gc_info * const info = shared_gc_info; - int thread_count; - - DEBUG_ONLY(fprintf(stderr, "%p: gc_wait_for_stage: %d->%d\n", interp, from_stage, to_stage)); - - /* XXX well-timed thread death can mess this up */ - LOCK(interpreter_array_mutex); - - DEBUG_ONLY(fprintf(stderr, "%p: got lock\n", interp)); - thread_count = pt_gc_count_threads(); - - PARROT_ASSERT(info->gc_stage == from_stage); - PARROT_ASSERT(!(interp->thread_data->state & THREAD_STATE_NOT_STARTED)); - PARROT_ASSERT(!(interp->thread_data->state & THREAD_STATE_FINISHED)); - - if (from_stage == 0) - PARROT_ASSERT(interp->thread_data->state & THREAD_STATE_SUSPENDED_GC); - else - PARROT_ASSERT(!(interp->thread_data->state & THREAD_STATE_SUSPENDED_GC)); - - ++info->num_reached; - - DEBUG_ONLY(fprintf(stderr, "%p: gc_wait_for_stage: got %d\n", interp, info->num_reached)); - - if (info->num_reached == thread_count) { - info->gc_stage = to_stage; - info->num_reached = 0; - COND_BROADCAST(info->gc_cond); - } - else { - do { - COND_WAIT(info->gc_cond, interpreter_array_mutex); - } while (info->gc_stage != to_stage); - } - UNLOCK(interpreter_array_mutex); -} - - -/* - -=item C - -Checks if it's necessary to wake threads to perform garbage collection. This -is called after thread death. Be sure to hold C. - -=cut - -*/ - -static void -pt_gc_wakeup_check(void) -{ - ASSERT_ARGS(pt_gc_wakeup_check) - Shared_gc_info * const info = shared_gc_info; - int thread_count; - - if (!info) - return; - - thread_count = pt_gc_count_threads(); - - if (info->num_reached == thread_count) { - PARROT_ASSERT(info->gc_stage == THREAD_GC_STAGE_NONE); - info->gc_stage = THREAD_GC_STAGE_MARK; - info->num_reached = 0; - COND_BROADCAST(info->gc_cond); - } -} - -/* - -=item C - -Suspends a single interpreter for GC. Be sure to hold -C. - -=cut - -*/ - -static void -pt_suspend_one_for_gc(PARROT_INTERP) -{ - ASSERT_ARGS(pt_suspend_one_for_gc) - DEBUG_ONLY(fprintf(stderr, "suspend one: %p\n", interp)); - if (is_suspended_for_gc(interp)) { - DEBUG_ONLY(fprintf(stderr, "ignoring already suspended\n")); - return; - } - - if (interp->thread_data->state & THREAD_STATE_GC_WAKEUP) { - DEBUG_ONLY(fprintf(stderr, "just waking it up\n")); - interp->thread_data->state |= THREAD_STATE_SUSPENDED_GC; - COND_SIGNAL(interp->thread_data->interp_cond); - } - else { - DEBUG_ONLY(fprintf(stderr, "queuing event\n")); - interp->thread_data->state |= THREAD_STATE_SUSPEND_GC_REQUESTED; - Parrot_cx_request_suspend_for_gc(interp); - } -} - -/* - -=item C - -Notifies all threads to perform a GC run. - -=cut - -*/ - -static void -pt_suspend_all_for_gc(PARROT_INTERP) -{ - ASSERT_ARGS(pt_suspend_all_for_gc) - UINTVAL i; - - DEBUG_ONLY(fprintf(stderr, "suspend_all_for_gc [interp=%p]\n", interp)); - - LOCK(interpreter_array_mutex); - interp->thread_data->state |= THREAD_STATE_SUSPENDED_GC; - - if (interp->thread_data->state & THREAD_STATE_SUSPEND_GC_REQUESTED) { - DEBUG_ONLY(fprintf(stderr, "found while suspending all\n")); - Parrot_cx_delete_suspend_for_gc(interp); - interp->thread_data->state &= ~THREAD_STATE_SUSPEND_GC_REQUESTED; - UNLOCK(interpreter_array_mutex); - return; - } - - /* now send all the non-suspended threads to suspend for GC */ - for (i = 0; i < n_interpreters; ++i) { - Parrot_Interp other_interp = interpreter_array[i]; - - if (interp == other_interp) - continue; - - if (is_suspended_for_gc(other_interp)) - continue; - - pt_suspend_one_for_gc(other_interp); - } - UNLOCK(interpreter_array_mutex); -} - -/* - -=item C - -Suspends this thread for a full GC run. - -XXX FIXME -- if GC is blocked, we need to do a GC run as soon -as it becomes unblocked. - -=cut - -*/ - -void -pt_suspend_self_for_gc(PARROT_INTERP) -{ - ASSERT_ARGS(pt_suspend_self_for_gc) - PARROT_ASSERT(interp); - PARROT_ASSERT(!Parrot_is_blocked_GC_mark(interp)); - DEBUG_ONLY(fprintf(stderr, "%p: suspend_self_for_gc\n", interp)); - /* since we are modifying our own state, we need to lock - * the interpreter_array_mutex. - */ - LOCK(interpreter_array_mutex); - DEBUG_ONLY(fprintf(stderr, "%p: got lock\n", interp)); - - PARROT_ASSERT(interp->thread_data->state & - (THREAD_STATE_SUSPEND_GC_REQUESTED | THREAD_STATE_SUSPENDED_GC)); - - if (interp->thread_data->state & THREAD_STATE_SUSPEND_GC_REQUESTED) { - DEBUG_ONLY(fprintf(stderr, "remove queued request\n")); - while (!PMC_IS_NULL(Parrot_cx_delete_suspend_for_gc(interp))) {/*Empty body*/}; - DEBUG_ONLY(fprintf(stderr, "removed all queued requests\n")); - interp->thread_data->state &= ~THREAD_STATE_SUSPEND_GC_REQUESTED; - } - if (!(interp->thread_data->state & THREAD_STATE_SUSPENDED_GC)) { - interp->thread_data->state |= THREAD_STATE_SUSPENDED_GC; - } - else { - DEBUG_ONLY(fprintf(stderr, "no need to set suspended\n")); - } - UNLOCK(interpreter_array_mutex); - - /* mark and sweep our world -- later callbacks will keep - * it sync'd - */ - Parrot_gc_mark_and_sweep(interp, GC_trace_stack_FLAG); - - PARROT_ASSERT(!(interp->thread_data->state & THREAD_STATE_SUSPENDED_GC)); -} - -/* - -=item C - -Joins (by waiting for) a joinable thread. - -=cut - -*/ - -PARROT_CAN_RETURN_NULL -PMC* -pt_thread_join(ARGIN(Parrot_Interp parent), UINTVAL tid) -{ - ASSERT_ARGS(pt_thread_join) - int state; - Parrot_Interp interp; - - LOCK(interpreter_array_mutex); - - interp = pt_check_tid(tid, "join"); - - if (interp == parent) - do_panic(parent, "Can't join self", __FILE__, __LINE__); - - if ((!(interp->thread_data->state & (THREAD_STATE_DETACHED - | THREAD_STATE_JOINED)) && - !(interp->thread_data->state & THREAD_STATE_NOT_STARTED)) || - interp->thread_data->state == THREAD_STATE_FINISHED) { - void *raw_retval = NULL; - PMC *retval; - - interp->thread_data->state |= THREAD_STATE_JOINED; - - while (!(interp->thread_data->state & THREAD_STATE_FINISHED)) { - interp->thread_data->joiner = parent; - pt_thread_wait(parent); - } - - UNLOCK(interpreter_array_mutex); - JOIN(interp->thread_data->thread, raw_retval); - - retval = (PMC *)raw_retval; - /* - * we need to push a cleanup handler here: if cloning - * of the retval fails (e.g. it's a NULLPMC) this lock - * isn't released until eternity or someone hits ^C - * - * TODO This is needed for all places holding a lock for - * non-trivial tasks - * -leo - * TODO remove that and replace it with proper exception - * handling, so that a failing clone in the parent - * just stops that thread - * -leo - */ - LOCK(interpreter_array_mutex); - CLEANUP_PUSH(mutex_unlock, &interpreter_array_mutex); - - if (retval) { - PMC *parent_ret; - /* - * clone the PMC into caller, if it's not a shared PMC - * the PMC is not in the parents root set nor in the - * stack so block GC during clone - * XXX should probably acquire the parent's interpreter mutex - */ - Parrot_block_GC_mark(parent); - parent_ret = make_local_copy(parent, interp, retval); - - /* this PMC is living only in the stack of this currently - * dying interpreter, so register it in parent's GC registry - * XXX is this still needed? - */ - Parrot_pmc_gc_register(parent, parent_ret); - Parrot_unblock_GC_mark(parent); - retval = parent_ret; - } - else { - retval = PMCNULL; - } - interpreter_array[tid] = NULL; - --running_threads; - - DEBUG_ONLY(fprintf(stderr, "destroying an interpreter [join]\n")); - if (Interp_debug_TEST(parent, PARROT_THREAD_DEBUG_FLAG)) - fprintf(stderr, "running threads %d\n", running_threads); - - /* reparent it so memory pool merging works */ - interp->parent_interpreter = parent; - Parrot_really_destroy(interp, 0, NULL); - - CLEANUP_POP(1); - /* - * interpreter destruction is done - unregister the return - * value, caller gets it now - */ - if (retval) - Parrot_pmc_gc_unregister(parent, retval); - - return retval; - } - /* - * when here thread was in wrong state - */ - state = interp->thread_data->state; - UNLOCK(interpreter_array_mutex); - Parrot_ex_throw_from_c_args(interp, NULL, 1, - "join: illegal thread state %d tid %d", state, tid); -} - -/* - -=item C - -Possibly waits for other running threads. This is called when destroying -C. - -=cut - -*/ - -void -pt_join_threads(PARROT_INTERP) -{ - ASSERT_ARGS(pt_join_threads) - size_t i; - pt_free_pool(interp); - - /* if no threads were started - fine */ - LOCK(interpreter_array_mutex); - if (n_interpreters <= 1) { - n_interpreters = 0; - UNLOCK(interpreter_array_mutex); - return; - } - - /* only the first interpreter waits for other threads */ - if (interp != interpreter_array[0]) { - UNLOCK(interpreter_array_mutex); - return; - } - - for (i = 1; i < n_interpreters; ++i) { - Parrot_Interp thread_interp = interpreter_array[i]; - if (thread_interp == NULL) - continue; - if (thread_interp->thread_data->state == THREAD_STATE_JOINABLE || - (thread_interp->thread_data->state & THREAD_STATE_FINISHED)) { - - void *retval = NULL; - thread_interp->thread_data->state |= THREAD_STATE_JOINED; - UNLOCK(interpreter_array_mutex); - JOIN(thread_interp->thread_data->thread, retval); - LOCK(interpreter_array_mutex); - } - } - UNLOCK(interpreter_array_mutex); - return; -} - -/* - -=item C - -Helper for detach and kill. - -Returns the interpreter, if it didn't finish yet. - -=cut - -*/ - -PARROT_CAN_RETURN_NULL -static Parrot_Interp -detach(UINTVAL tid) -{ - ASSERT_ARGS(detach) - Parrot_Interp interp; - - LOCK(interpreter_array_mutex); - interp = pt_check_tid(tid, "detach"); - /* - * if interpreter is joinable, we detach em - */ - if (interp->thread_data->state == THREAD_STATE_JOINABLE || - interp->thread_data->state == THREAD_STATE_FINISHED) { - DETACH(interp->thread_data->thread); - interp->thread_data->state |= THREAD_STATE_DETACHED; - - if (interp->thread_data->state & THREAD_STATE_FINISHED) { - interpreter_array[tid] = NULL; - DEBUG_ONLY(fprintf(stderr, "destroying an interpreter [detach]\n")); - Parrot_really_destroy(interp, 0, NULL); - interp = NULL; - } - } - UNLOCK(interpreter_array_mutex); - return interp; -} - -/* - -=item C - -Detaches the thread, making it non-joinable. - -=cut - -*/ - -void -pt_thread_detach(UINTVAL tid) -{ - ASSERT_ARGS(pt_thread_detach) - (void) detach(tid); -} - -/* - -=item C - -Kills the thread. - -=cut - -*/ - -void -pt_thread_kill(UINTVAL tid) -{ - ASSERT_ARGS(pt_thread_kill) - PARROT_INTERP = detach(tid); - - /* schedule a terminate event for that interpreter */ - if (interp) - Parrot_cx_runloop_end(interp); -} - -/* - -=back - -=head2 Threaded interpreter book-keeping - -=over 4 - -=item C - -Stores the given interpreter in the array of all interpreters. Be sure to hold -C. - -=cut - -*/ - -void -pt_add_to_interpreters(PARROT_INTERP, ARGIN_NULLOK(Parrot_Interp new_interp)) -{ - ASSERT_ARGS(pt_add_to_interpreters) - size_t i; - DEBUG_ONLY(fprintf(stderr, "interp = %p\n", interp)); - - if (!new_interp) { - /* - * Create an entry for the very first interpreter, event - * handling needs it - */ - - if (interpreter_array || n_interpreters != 0) - Parrot_ex_throw_from_c_args(interp, NULL, 1, - "pt_add_to_interpreters: must pass new_interp when creating additional interps"); - - interpreter_array = mem_internal_allocate_typed(Interp *); - interpreter_array[0] = interp; - n_interpreters = 1; - - shared_gc_info = (Shared_gc_info *)mem_internal_allocate_zeroed(sizeof (*shared_gc_info)); - COND_INIT(shared_gc_info->gc_cond); - PARROT_ATOMIC_INT_INIT(shared_gc_info->gc_block_level); - PARROT_ATOMIC_INT_SET(shared_gc_info->gc_block_level, 0); - - /* XXX try to defer this until later */ - PARROT_ASSERT(interp == interpreter_array[0]); - interp->thread_data = mem_internal_allocate_zeroed_typed(Thread_data); - INTERPRETER_LOCK_INIT(interp); - interp->thread_data->tid = 0; - - return; - } - - - new_interp->thread_data = mem_internal_allocate_zeroed_typed(Thread_data); - INTERPRETER_LOCK_INIT(new_interp); - ++running_threads; - if (Interp_debug_TEST(interp, PARROT_THREAD_DEBUG_FLAG)) - fprintf(stderr, "running threads %d\n", running_threads); - - /* look for an empty slot */ - for (i = 0; i < n_interpreters; ++i) { - if (interpreter_array[i] == NULL) { - interpreter_array[i] = new_interp; - new_interp->thread_data->tid = i; - new_interp->thread_data->state = THREAD_STATE_NOT_STARTED; - return; - } - } - - /* need to resize */ - interpreter_array = (Interp **)mem_internal_realloc(interpreter_array, - (n_interpreters + 1) * sizeof (Interp *)); - - interpreter_array[n_interpreters] = new_interp; - new_interp->thread_data->tid = n_interpreters; - new_interp->thread_data->state = THREAD_STATE_NOT_STARTED; - - ++n_interpreters; -} - -/* - -=back - -=head2 GC Synchronization Functions - -=over 4 - -=item C - -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. - -C are the GC flags. We check if we need to collect shared objects or -not. - -TODO - Have a count of shared PMCs and check it during GC. - -TODO - Evaluate if a interpreter lock is cheaper when C is -updated. - -=cut - -*/ - -void -pt_gc_start_mark(PARROT_INTERP) -{ - ASSERT_ARGS(pt_gc_start_mark) - Shared_gc_info *info; - int block_level; - - DEBUG_ONLY(fprintf(stderr, "%p: pt_gc_start_mark\n", interp)); - /* if no other threads are running, we are safe */ - if (!running_threads) - return; - - info = get_pool(); - PARROT_ATOMIC_INT_GET(block_level, info->gc_block_level); - - DEBUG_ONLY(fprintf(stderr, "start threaded mark\n")); - /* - * TODO now check, if we are the owner of a shared memory pool - * if yes: - * - suspend all other threads by sending them a suspend event - * (or put a LOCK around updating the mark pointers) - * - return and continue the mark phase - * - then s. comments below - */ - LOCK(interpreter_array_mutex); - if (interp->thread_data->state & THREAD_STATE_SUSPENDED_GC) { - PARROT_ASSERT(!(interp->thread_data->state & - THREAD_STATE_SUSPEND_GC_REQUESTED)); - DEBUG_ONLY(fprintf(stderr, "already suspended...\n")); - UNLOCK(interpreter_array_mutex); - } - else if (block_level) { - /* unthreaded collection */ - DEBUG_ONLY(fprintf(stderr, "... but blocked\n")); - - /* holding the lock */ - return; - } - else if (interp->thread_data->state & - THREAD_STATE_SUSPEND_GC_REQUESTED) { - while (!PMC_IS_NULL(Parrot_cx_delete_suspend_for_gc(interp))) {/*Empty body*/}; - - interp->thread_data->state &= ~THREAD_STATE_SUSPEND_GC_REQUESTED; - interp->thread_data->state |= THREAD_STATE_SUSPENDED_GC; - - DEBUG_ONLY(fprintf(stderr, "%p: detected request\n", interp)); - UNLOCK(interpreter_array_mutex); - } - else { - /* we need to stop the world */ - DEBUG_ONLY(fprintf(stderr, "stop the world\n")); - UNLOCK(interpreter_array_mutex); - - pt_suspend_all_for_gc(interp); - } - - DEBUG_ONLY(fprintf(stderr, "%p: wait for stage\n", interp)); - pt_gc_wait_for_stage(interp, THREAD_GC_STAGE_NONE, THREAD_GC_STAGE_MARK); - - DEBUG_ONLY(fprintf(stderr, "actually mark\n")); - /* - * We can't allow parallel running GCs. - */ - LOCK(interpreter_array_mutex); - DEBUG_ONLY(fprintf(stderr, "got marking lock\n")); -} - -/* - -=item C - -Records that GC has finished for the root set. EXCEPTION_UNIMPLEMENTED - -=cut - -*/ - -void -pt_gc_mark_root_finished(SHIM_INTERP) -{ - ASSERT_ARGS(pt_gc_mark_root_finished) - if (!running_threads) - return; - /* - * TODO now check, if we are the owner of a shared memory pool - * if yes: - * - now mark all members of our pool - * - if all shared PMCs are marked by all threads then - * - we can continue to free unused objects - */ -} - -/* - -=item C - -Records that the mark phase of GC has completed. - -=cut - -*/ - -void -pt_gc_stop_mark(PARROT_INTERP) -{ - ASSERT_ARGS(pt_gc_stop_mark) - if (!running_threads) - return; - /* - * normal operation can continue now - * - other threads may or not free unused objects then, - * depending on their resource statistics - */ - if (!(interp->thread_data->state & THREAD_STATE_SUSPENDED_GC)) { - UNLOCK(interpreter_array_mutex); - return; - } - - PARROT_ASSERT(!(interp->thread_data->state & - THREAD_STATE_SUSPEND_GC_REQUESTED)); - interp->thread_data->state &= ~THREAD_STATE_SUSPENDED_GC; - - while (!PMC_IS_NULL(Parrot_cx_delete_suspend_for_gc(interp))) { - /* XXX FIXME make this message never trigger */ - fprintf(stderr, "%p: extraneous suspend_gc event\n", (void *)interp); - } - - DEBUG_ONLY(fprintf(stderr, "%p: unlock\n", interp)); - UNLOCK(interpreter_array_mutex); - DEBUG_ONLY(fprintf(stderr, "wait to sweep\n")); - - pt_gc_wait_for_stage(interp, THREAD_GC_STAGE_MARK, THREAD_GC_STAGE_SWEEP); -} - -/* - -=item C - -Blocks stop-the-world GC runs. - -=cut - -*/ - -PARROT_EXPORT -void -Parrot_shared_gc_block(SHIM_INTERP) -{ - ASSERT_ARGS(Parrot_shared_gc_block) - Shared_gc_info * const info = get_pool(); - - if (info) { - int level; - PARROT_ATOMIC_INT_INC(level, info->gc_block_level); - PARROT_ASSERT(level > 0); - } -} - -/* - -=item C - -Unblocks stop-the-world GC runs. - -=cut - -*/ - -PARROT_EXPORT -void -Parrot_shared_gc_unblock(SHIM_INTERP) -{ - ASSERT_ARGS(Parrot_shared_gc_unblock) - Shared_gc_info * const info = get_pool(); - if (info) { - int level; - PARROT_ATOMIC_INT_DEC(level, info->gc_block_level); - PARROT_ASSERT(level >= 0); - } -} - -/* - -=back - -=head1 SEE ALSO - -F - -=cut - -*/ - -/* - * Local variables: - * c-file-style: "parrot" - * End: - * vim: expandtab shiftwidth=4 cinoptions='\:2=2' : - */ diff --git a/src/vtable.tbl b/src/vtable.tbl index 52b62897d2..6ed8ae8f25 100644 --- a/src/vtable.tbl +++ b/src/vtable.tbl @@ -16,12 +16,6 @@ void mark() void destroy() PMC* get_namespace() -# XXX FIXME should this be marked as writing? -PMC* getprop(STRING* key) -void setprop(STRING* key, PMC* value) :write -void delprop(STRING* key) :write -PMC* getprops() - INTVAL type() STRING* name() @@ -268,8 +262,4 @@ void thaw(PMC* info) :write void thawfinish(PMC* info) :write void visit(PMC* info) -void share() - -PMC* share_ro() - void init_int(INTVAL initializer) :write diff --git a/src/warnings.c b/src/warnings.c index fadbb7d760..b644ed9e6f 100644 --- a/src/warnings.c +++ b/src/warnings.c @@ -52,7 +52,7 @@ print_pbc_location(PARROT_INTERP) interp->pdb->debugger : interp; Parrot_io_eprintf(tracer, "%Ss\n", - Parrot_sub_Context_infostr(interp, CURRENT_CONTEXT(interp))); + Parrot_sub_Context_infostr(interp, CURRENT_CONTEXT(interp), 1)); } /* diff --git a/t/README.pod b/t/README.pod index 897edc0820..5567e149ba 100644 --- a/t/README.pod +++ b/t/README.pod @@ -52,6 +52,11 @@ of what is tested in there. =over 4 +=item all_hll_test + +Run all the tests for all HLLs and libraries. Useful before and after +merges to detect regressions in projects using Parrot. + =item benchmark Benchmark tests. diff --git a/t/archive/README b/t/archive/README new file mode 100644 index 0000000000..ea00bec61b --- /dev/null +++ b/t/archive/README @@ -0,0 +1,3 @@ +README for t/archive + +This directory holds parrot_test_run.tar.gz. diff --git a/t/benchmark/benchmarks.t b/t/benchmark/benchmarks.t index 54469fe3af..bb778ff07f 100644 --- a/t/benchmark/benchmarks.t +++ b/t/benchmark/benchmarks.t @@ -151,7 +151,6 @@ FixedPMCArray:\s\d+\.\d+s\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, diff --git a/t/codingstd/c_arg_assert.t b/t/codingstd/c_arg_assert.t index 5974c59d49..3891f33443 100644 --- a/t/codingstd/c_arg_assert.t +++ b/t/codingstd/c_arg_assert.t @@ -20,7 +20,7 @@ t/codingstd/c_arg_assert.t - checks that all the headerizer asserts are used =head1 DESCRIPTION Finds all the argument guards generated by headerizer (asserts to enforce the -non-NULLness of specially marked pointers) are actually used. +non-NULLness of specially marked pointers) that are actually used. Verifies that macros are invoked on a sane position. =head1 SEE ALSO diff --git a/t/codingstd/case_sensitive_files.t b/t/codingstd/case_sensitive_files.t new file mode 100644 index 0000000000..02036d55f7 --- /dev/null +++ b/t/codingstd/case_sensitive_files.t @@ -0,0 +1,56 @@ +#! perl -T + +# Copyright (C) 2012, Parrot Foundation. + +use strict; +use warnings; + +use lib qw( . lib ../lib ../../lib ); +use Test::More; +use Parrot::Distribution (); + +=head1 NAME + +t/codingstd/case_sensitive_files.t - Checks for name conflicts on case-insensitive filesystems + +=head1 SYNOPSIS + + # test all files + % prove t/codingstd/case_sensitive_files.t + +=head1 DESCRIPTION + +Checks that there are no files in the distribution that would conflict +with other files on case-insensitive filesystems. + +If we have a F in the distro, and then we add a F +in the same directory, that's a problem. The creator F +might not notice, but this will cause problems for a Mac or Windows user +who checks out the repo or unpacks a tarball. + +=cut + +my @files = map { $_->path } Parrot::Distribution->new->get_all_files(); + +plan tests => scalar @files; + +my %paths; +foreach my $path (@files) { + my $lc_path = lc $path; + + if ( my $conflict = $paths{ $lc_path } ) { + fail( "$path conflicts with $conflict" ); + } + else { + pass( "No conflict in: $path" ); + $paths{ $lc_path } = $path; + } +} +done_testing(); + +# Local Variables: +# mode: cperl +# cperl-indent-level: 4 +# fill-column: 100 +# End: +# vim: expandtab shiftwidth=4: diff --git a/t/codingstd/copyright.t b/t/codingstd/copyright.t index d0216b8c64..d11b79c610 100644 --- a/t/codingstd/copyright.t +++ b/t/codingstd/copyright.t @@ -62,6 +62,9 @@ foreach my $file (@files) { my $buf = $DIST->slurp($path); + # skip autogenerated files (based on the first line of the file) + next if ( index( $buf, "# THIS IS A GENERATED FILE! DO NOT EDIT!" ) == 0 ); + # does there exist a copyright statement at all? if ( $buf !~ $copyright_simple ) { push @no_copyright_files, $path; @@ -131,7 +134,7 @@ my @permitted_duplicate_copyright_files = ( reason => 'heredoc for print_introduction()', }, { - file => 't/tools/dev/searchops/samples.pm', + file => 't/tools/dev/search_ops/samples.pm', reason => 'sample code used in testing', }, { diff --git a/t/codingstd/cuddled_else.t b/t/codingstd/cuddled_else.t index 0a2f97ef90..1f8e7ca825 100644 --- a/t/codingstd/cuddled_else.t +++ b/t/codingstd/cuddled_else.t @@ -41,7 +41,7 @@ my @files = @ARGV ? <@ARGV> : ( Parrot::Test::Util::Runloop->testloop( name => 'no cuddled elses', files => [@files], - per_line => sub { $_[0] !~ /}\s*else\s*{/ }, + per_line => sub { $_[0] !~ /}\s*else/ }, diag_prefix => 'Cuddled else found' ); diff --git a/t/codingstd/filenames.t b/t/codingstd/filenames.t index 1b756755c0..f38227e99c 100644 --- a/t/codingstd/filenames.t +++ b/t/codingstd/filenames.t @@ -74,7 +74,8 @@ foreach my $file ( @files ) { # check for multiple dots in filenames my $num_dots = grep(m/\./g, split( m//, $file)); if ( $num_dots > 1 ) { - push @multi_dots, $file . "\n"; + # this file is not used to build Parrot, so VMS can just deal with it + push @multi_dots, $file . "\n" unless $file eq '.travis.yml'; } # check the characters used in filenames diff --git a/t/compilers/data_json/to_parrot.t b/t/compilers/data_json/to_parrot.t index 16272c19c6..34e7861200 100644 --- a/t/compilers/data_json/to_parrot.t +++ b/t/compilers/data_json/to_parrot.t @@ -677,7 +677,7 @@ JSON ] OUT -# TT #1226 Need many more tests, exercising all aspects of http://www.json.org/ +# GH #570 Need many more tests, exercising all aspects of http://www.json.org/ sub json_dump_is { my ( $code, $dumped, $reason, %args ) = @_; diff --git a/t/compilers/imcc/syn/clash.t b/t/compilers/imcc/syn/clash.t index efbf912ced..7e0ff701b1 100644 --- a/t/compilers/imcc/syn/clash.t +++ b/t/compilers/imcc/syn/clash.t @@ -169,7 +169,7 @@ CODE ok OUT -pir_error_output_like( <<'CODE', <<'OUTPUT', 'new with a native type, no string constant', todo => 'TT #1323 not done yet' ); +pir_error_output_like( <<'CODE', <<'OUTPUT', 'new with a native type, no string constant', todo => 'GH #335 not done yet' ); .sub test :main $P1 = new INTVAL print "never\n" diff --git a/t/compilers/imcc/syn/const.t b/t/compilers/imcc/syn/const.t index 6f8761600f..c17b943866 100644 --- a/t/compilers/imcc/syn/const.t +++ b/t/compilers/imcc/syn/const.t @@ -8,7 +8,7 @@ use vars qw($TODO); use Test::More; use Parrot::Config; -use Parrot::Test tests => 35; +use Parrot::Test tests => 39; pir_output_is( <<'CODE', <<'OUT', "globalconst 1" ); @@ -603,6 +603,54 @@ CODE /^error:imcc:syntax error, duplicated IDENTIFIER/ OUT +pir_error_output_like( <<'CODE', <<'OUT', "invalid FixedIntegerArray" ); +.sub 'invalid' + .const 'FixedIntegerArray' $P0 = 'garbage' +.end +CODE +/FixedIntegerArray initialization/ +OUT + +pir_error_output_like( <<'CODE', <<'OUT', "FixedIntegerArray: forgot a comma" ); +.sub 'invalid' + .const 'FixedIntegerArray' $P0 = '(1 2)' +.end +CODE +/FixedIntegerArray initialization/ +OUT + +pir_error_output_like( <<'CODE', <<'OUT', "FixedIntegerArray: extra character" ); +.sub 'invalid' + .const 'FixedIntegerArray' $P0 = '(1d)' +.end +CODE +/FixedIntegerArray initialization/ +OUT + +pir_output_is( <<'CODE', <<'OUT', "valid FixedIntegerArray" ); +.sub 'main' :main + .const 'FixedIntegerArray' $P0 = ' (0, 1,0b10 , 010, 0x10 ) ' + $I0 = $P0[0] + say $I0 + $I0 = $P0[1] + say $I0 + $I0 = $P0[2] + say $I0 + $I0 = $P0[3] + say $I0 + $I0 = $P0[4] + say $I0 +.end +CODE +0 +1 +2 +8 +16 +OUT + + + # Local Variables: # mode: cperl # cperl-indent-level: 4 diff --git a/t/compilers/imcc/syn/file.t b/t/compilers/imcc/syn/file.t index 9f1c2a76fa..f276269954 100644 --- a/t/compilers/imcc/syn/file.t +++ b/t/compilers/imcc/syn/file.t @@ -398,7 +398,7 @@ END_PIR $err_msg =~ s/\r//g if $^O =~ /^(MSWin32|msys)$/i; is( $err_msg, << "OUT", 'including a non-existent file' ); -error:imcc:$enoent_err_msg +error:imcc:$enoent_err_msg 'non_existent.pir' \tin file '$temp_pir' line 1 OUT } diff --git a/t/compilers/imcc/syn/op.t b/t/compilers/imcc/syn/op.t index aa26482055..6aa6391169 100644 --- a/t/compilers/imcc/syn/op.t +++ b/t/compilers/imcc/syn/op.t @@ -174,7 +174,7 @@ .sub test_x_can $P0 = new 'FileHandle' - $I0 = can $P0, "puts" + $I0 = can $P0, "print" is($I0, 1, 'x = can') .end diff --git a/t/compilers/imcc/syn/pcc.t b/t/compilers/imcc/syn/pcc.t index 9d5e6aa607..907d0bf373 100644 --- a/t/compilers/imcc/syn/pcc.t +++ b/t/compilers/imcc/syn/pcc.t @@ -6,7 +6,7 @@ use warnings; use lib qw( . lib ../lib ../../lib ); use Test::More; use Parrot::Config; -use Parrot::Test tests => 26; +use Parrot::Test tests => 27; ############################## # Parrot Calling Conventions @@ -23,7 +23,6 @@ pir_output_is( <<'CODE', <<'OUT', "low-level syntax" ); .get_result z .end_call print z - end .end .sub _sub .param int a @@ -46,7 +45,6 @@ pir_output_is( <<'CODE', <<'OUT', "func() syntax" ); .local string z z = _sub(10, y) print z - end .end .sub _sub .param int a @@ -88,7 +86,6 @@ pir_output_is( <<'CODE', <<'OUT', "_func() syntax with var - global" ); .local pmc the_sub the_sub = get_global "_sub" the_sub(10, 20) - end .end .sub _sub .param int a @@ -97,7 +94,6 @@ pir_output_is( <<'CODE', <<'OUT', "_func() syntax with var - global" ); print "\n" print b print "\n" - end .end CODE 10 @@ -126,7 +122,6 @@ pir_output_is( <<'CODE', <<'OUT', "tail recursive sub" ); result = _fact(product, count) print result print "\n" - end .end .sub _fact @@ -280,7 +275,6 @@ pir_output_is( <<'CODE', <<'OUT', ".set_arg :flat" ); .set_arg z .call s .end_call - end .end .sub _sub .param pmc a @@ -328,7 +322,6 @@ pir_output_is( <<'CODE', <<'OUT', "foo (arg :flat)" ); push ar2, "ok 4\n" push ar2, "ok 5\n" _sub(x, ar :flat, y, ar2 :flat, z) - end .end .sub _sub @@ -364,7 +357,6 @@ OUT pir_output_is( <<'CODE', <<'OUT', ":main pragma, syntax only" ); .sub _main :main print "ok\n" - end .end CODE ok @@ -376,7 +368,6 @@ OUT pir_output_like( <<'CODE', <<'OUT', "more pragmas, syntax only" ); .sub _main :main :load :postcomp print "ok\n" - end .end CODE /(ok\n){1,2}/ @@ -401,14 +392,12 @@ pir_output_is( <<'CODE', <<'OUT', "\:main defined twice" ); set $S0, 'ok' print $S0 print "\r\n" - end .end .sub bar :main set $S0, 'not ok' print $S0 print "\r\n" - end .end CODE ok @@ -635,6 +624,20 @@ CODE 4 OUT +pir_output_is( <<'CODE', <<'OUT', 'Explicit self param should not conflict'); +.sub foo :method + .param pmc self + say self +.end + +.sub main :main + $P0 = box 'hello' + 'foo'($P0) +.end +CODE +hello +OUT + # Local Variables: # mode: cperl # cperl-indent-level: 4 diff --git a/t/compilers/imcc/syn/regressions.t b/t/compilers/imcc/syn/regressions.t index 7b9f7233bf..838ed0eb8b 100644 --- a/t/compilers/imcc/syn/regressions.t +++ b/t/compilers/imcc/syn/regressions.t @@ -36,7 +36,7 @@ ok 1 - caught div_i_ic_ic exception ok 2 - caught div_n_nc_nc exception OUT -pir_output_is( <<'CODE', <<'OUT', 'fold symbolic constants (TT #1652)'); +pir_output_is( <<'CODE', <<'OUT', 'fold symbolic constants (GH #473)'); .sub main :main .const int SECONDS_PER_MINUTE = 60 $I0 = 30 * SECONDS_PER_MINUTE diff --git a/t/compilers/opsc/01-parse.t b/t/compilers/opsc/01-parse.t index 121e451a7a..4a73b9d787 100644 --- a/t/compilers/opsc/01-parse.t +++ b/t/compilers/opsc/01-parse.t @@ -110,7 +110,7 @@ END BEGIN_OPS_PREAMBLE #include "parrot/dynext.h" -#include "parrot/embed.h" +#include "parrot/parrot.h" #include "parrot/runcore_api.h" #include "../pmc/pmc_continuation.h" #include "../pmc/pmc_parrotlibrary.h" diff --git a/t/compilers/opsc/03-past.t b/t/compilers/opsc/03-past.t index 6a0fbda66d..b2a599f7f5 100644 --- a/t/compilers/opsc/03-past.t +++ b/t/compilers/opsc/03-past.t @@ -1,5 +1,5 @@ #! ./parrot-nqp -# Copyright (C) 2010, Parrot Foundation. +# Copyright (C) 2010-2012, Parrot Foundation. # "Comprehensive" test for creating PAST for op. @@ -101,7 +101,7 @@ ok( $op.arg_types.join('_') eq 'i_pc_nc', "Second variant correct"); # Check body munching. $op := @ops[0]; -ok( $op.get_body($trans) ~~ /'return (opcode_t *)cur_opcode + 1'/ , "goto NEXT appended for non :flow ops"); +ok( $op.get_body($trans) ~~ /'return cur_opcode + 1'/ , "goto NEXT appended for non :flow ops"); # Check write barriers. ok( !$op.need_write_barrier, "Write Barrier is not required"); diff --git a/t/compilers/opsc/06-opsfile.t b/t/compilers/opsc/06-opsfile.t index b84c32f696..d1bbd64bf4 100644 --- a/t/compilers/opsc/06-opsfile.t +++ b/t/compilers/opsc/06-opsfile.t @@ -4,7 +4,9 @@ pir::load_bytecode("opsc.pbc"); pir::load_bytecode("nqp-setting.pbc"); -plan(7); +Q:PIR { + .include "test_more.pir" +}; my $oplib := Ops::OpLib.new; my @files := < @@ -18,27 +20,23 @@ my @ops := $f.ops; # 82 core # 116 math # We can generate more than 1 Ops::Op per op due args expansion. -say( "# Parsed " ~ +@ops); -# There is more than 200 ops in this 2 files. -# Feel free to update number if you change them. -ok(+@ops == 268, "Ops parsed correctly"); -say('# ' ~ +@ops); +diag( "Parsed " ~ +@ops); my $op := @ops[0]; #_dumper($op); # First op should be C and has code 0. -ok($op.name eq 'end', "First op is end"); -ok($op == 0, "... with code 0"); +is($op.name, 'end', "First op is correct"); +is($op, 0, "... with code 0"); $op := @ops[(+@ops)-1]; -ok($op.name eq 'sqrt', "Last op is tanh"); -say('# ' ~ $op.name); -ok($op > 84 + 116, "... with non zero code"); +ok($op > 84 + 116, "Last op has non zero code"); my $version := join(' ', |$f.version); ok( $version ~~ /^\d+ \s \d+ \s \d+$/, "Version parsed"); -say("# $version"); +diag($version); ok( $f.preamble ~~ /pmc_parrotlibrary.h/, "Preamble preserved"); +done_testing(); + # vim: expandtab shiftwidth=4 ft=perl6: diff --git a/t/compilers/opsc/08-emitter.t b/t/compilers/opsc/08-emitter.t index 62d1b6086d..07a9cfc600 100644 --- a/t/compilers/opsc/08-emitter.t +++ b/t/compilers/opsc/08-emitter.t @@ -1,5 +1,5 @@ #! ./parrot-nqp -# Copyright (C) 2010, Parrot Foundation. +# Copyright (C) 2010-2012, Parrot Foundation. pir::load_bytecode("opsc.pbc"); @@ -88,7 +88,7 @@ inline op branch(in LABEL) :base_loop :flow { goto OFFSET($1); }'; $new_body := translate_op_body($trans, $op_body); -$restart_addr_ok := $new_body ~~ /'return (opcode_t *)cur_opcode + IREG(1);'/; +$restart_addr_ok := $new_body ~~ /'return cur_opcode + IREG(1);'/; ok($restart_addr_ok, "goto OFFSET() and \$1 translated ok"); ok($new_body ~~ /'PARROT_JUMP_RELATIVE'/, "jump flags generated"); diff --git a/t/compilers/pct/past.t b/t/compilers/pct/past.t index 53558a6cfe..29c0966cfd 100644 --- a/t/compilers/pct/past.t +++ b/t/compilers/pct/past.t @@ -71,9 +71,9 @@ Integer } OUT -## TT #1476: test that return() is taken from the type of value when not specified +## GH #573: test that return() is taken from the type of value when not specified -## TT #1476: check the rest of the PAST::Var attributes +## GH #573: check the rest of the PAST::Var attributes pir_output_is( <<'CODE', <<'OUT', 'dump PAST::Var node in visual format' ); .sub _main :main load_bytecode 'PCT.pbc' diff --git a/t/compilers/tge/grammar.t b/t/compilers/tge/grammar.t index 38e68b75c2..c6a3eb2ff5 100644 --- a/t/compilers/tge/grammar.t +++ b/t/compilers/tge/grammar.t @@ -273,7 +273,7 @@ after transform, the value of the right-most leaf is: 1 OUT TODO: { - local $TODO = "unresolved bug; see: TT #1160"; + local $TODO = "unresolved bug; see: GH #388"; pir_output_is( <<'CODE', <<'OUT', 'two rules of the same name can apply to the same node, when called with a different dummy type' ); diff --git a/t/configure/008-file_based_configuration.t b/t/configure/008-file_based_configuration.t index 32e97a08f2..dabae85bb0 100644 --- a/t/configure/008-file_based_configuration.t +++ b/t/configure/008-file_based_configuration.t @@ -1,5 +1,5 @@ #! perl -# Copyright (C) 2007-2010, Parrot Foundation. +# Copyright (C) 2007-2011, Parrot Foundation. # 008-file_based_configuration.t use strict; @@ -11,7 +11,7 @@ BEGIN { our $topdir = realpath($Bin) . "/../.."; unshift @INC, qq{$topdir/lib}; } -use Test::More tests => 30; +use Test::More tests => 31; use Carp; use Parrot::Configure::Options qw| process_options |; @@ -20,22 +20,22 @@ use Parrot::Configure::Options qw| process_options |; my ($args, $steps_list_ref) = _test_good_config_file($configfile); ok(! defined $args->{maintainer}, - "Configuring from testfoobar: 'maintainer' not defined, as expected"); + "Configuring from $configfile: 'maintainer' not defined, as expected"); is($args->{'verbose-step'}, 'init::hints', - "Configuring from testfoobar: 'init::hints' is verbose step"); + "Configuring from $configfile: 'init::hints' is verbose step"); is($args->{'fatal-step'}, 'init::hints', - "Configuring from testfoobar: 'init::hints' is fatal step"); + "Configuring from $configfile: 'init::hints' is fatal step"); ok($args->{nomanicheck}, - "Configuring from testfoobar: will omit check of MANIFEST"); + "Configuring from $configfile: will omit check of MANIFEST"); is($args->{file}, $configfile, - "Configuring from testfoobar: config file correctly stored"); + "Configuring from $configfile: config file correctly stored"); ok($args->{debugging}, - "Configuring from testfoobar: debugging turned on"); + "Configuring from $configfile: debugging turned on"); my %steps_seen = map {$_ => 1} @{ $steps_list_ref }; ok(exists $steps_seen{'init::manifest'}, - "Configuring from testfoobar: init::manifest is in list even though it will be skipped"); + "Configuring from $configfile: init::manifest is in list even though it will be skipped"); ok(! exists $steps_seen{'auto::perldoc'}, - "Configuring from testfoobar: auto::perldoc not in list"); + "Configuring from $configfile: auto::perldoc not in list"); } { @@ -44,52 +44,55 @@ use Parrot::Configure::Options qw| process_options |; my $c_compiler = '/usr/bin/gcc'; my $cplusplus_compiler = '/usr/bin/g++'; + my $intval_setting = 'long long'; ok(! defined $args->{maintainer}, - "Configuring from yourfoobar: 'maintainer' not defined as expected"); + "Configuring from $configfile: 'maintainer' not defined as expected"); is($args->{'verbose-step'}, 'init::hints', - "Configuring from yourfoobar: 'init::hints' is verbose step"); + "Configuring from $configfile: 'init::hints' is verbose step"); ok($args->{nomanicheck}, - "Configuring from yourfoobar: will omit check of MANIFEST"); + "Configuring from $configfile: will omit check of MANIFEST"); is($args->{file}, $configfile, - "Configuring from yourfoobar: config file correctly stored"); + "Configuring from $configfile: config file correctly stored"); ok($args->{debugging}, - "Configuring from yourfoobar: debugging turned on"); + "Configuring from $configfile: debugging turned on"); is($args->{cc}, $c_compiler, - "Configuring from yourfoobar: C compiler is $c_compiler"); + "Configuring from $configfile: C compiler is $c_compiler"); is($args->{link}, $cplusplus_compiler, - "Configuring from yourfoobar: linker is $cplusplus_compiler"); + "Configuring from $configfile: linker is $cplusplus_compiler"); is($args->{ld}, $cplusplus_compiler, - "Configuring from yourfoobar: shared library loader is $cplusplus_compiler"); + "Configuring from $configfile: shared library loader is $cplusplus_compiler"); + is($args->{intval}, $intval_setting, + "Configuring from $configfile: 'intval' setting is $intval_setting"); my %steps_seen = map {$_ => 1} @{ $steps_list_ref }; ok(exists $steps_seen{'init::manifest'}, - "Configuring from yourfoobar: init::manifest is in list even though it will be skipped"); + "Configuring from $configfile: init::manifest is in list even though it will be skipped"); ok(! exists $steps_seen{'auto::perldoc'}, - "Configuring from yourfoobar: auto::perldoc not in list"); + "Configuring from $configfile: auto::perldoc not in list"); } { - my $configfile = q{t/configure/testlib/verbosefoobar}; + my $configfile = q{examples/config/file/configverbose}; my ($args, $steps_list_ref) = _test_good_config_file($configfile); ok(! defined $args->{maintainer}, - "Configuring from verbosefoobar: 'maintainer' not defined as expected"); + "Configuring from $configfile: 'maintainer' not defined as expected"); ok($args->{nomanicheck}, - "Configuring from verbosefoobar: will omit check of MANIFEST"); + "Configuring from $configfile: will omit check of MANIFEST"); is($args->{file}, $configfile, - "Configuring from verbosefoobar: config file correctly stored"); + "Configuring from $configfile: config file correctly stored"); ok($args->{debugging}, - "Configuring from verbosefoobar: debugging turned on"); + "Configuring from $configfile: debugging turned on"); is($args->{verbose}, 1, - "Configuring from verbosefoobar: verbose output is on"); + "Configuring from $configfile: verbose output is on"); my %steps_seen = map {$_ => 1} @{ $steps_list_ref }; ok(exists $steps_seen{'init::manifest'}, - "Configuring from verbosefoobar: init::manifest is in list even though it will be skipped"); + "Configuring from $configfile: init::manifest is in list even though it will be skipped"); ok(! exists $steps_seen{'auto::perldoc'}, - "Configuring from verbosefoobar: auto::perldoc not in list"); + "Configuring from $configfile: auto::perldoc not in list"); } { diff --git a/t/dynoplibs/io.t b/t/dynoplibs/io.t index f0ee50c1cd..0a0757ba99 100644 --- a/t/dynoplibs/io.t +++ b/t/dynoplibs/io.t @@ -201,7 +201,7 @@ CODE .end -# TT #1178 +# GH #465 .sub 'getfd_fdopen' getstdout $P0 $I0 = $P0.'get_fd'() diff --git a/t/dynpmc/foo-02.t b/t/dynpmc/foo-02.t index cd81d5545f..545a45aecf 100644 --- a/t/dynpmc/foo-02.t +++ b/t/dynpmc/foo-02.t @@ -7,7 +7,7 @@ loadlib $P1, 'foo_group' sweep 1 - $P2 = getprop '_type', $P1 + $P2 = getprop $P1, '_type' $S0 = $P2 is($S0, 'PMC', 'ParrotLibrary props survive GC') .end diff --git a/t/dynpmc/gziphandle.t b/t/dynpmc/gziphandle.t index a3e9db2d13..743afbf57e 100644 --- a/t/dynpmc/gziphandle.t +++ b/t/dynpmc/gziphandle.t @@ -60,7 +60,7 @@ Tests the C PMC, a zlib wrapper. .const string filename = 't/dynpmc/gziphandle.t.gz' $P1 = new 'GzipHandle' $P1.'open'(filename, 'wb') - $P1.'puts'($S0) + $P1.'print'($S0) $P1.'print'($S0) $P1.'close'() $I1 = stat filename, .STAT_FILESIZE diff --git a/t/dynpmc/os.t b/t/dynpmc/os.t index ab1ba258a8..f4e5676173 100644 --- a/t/dynpmc/os.t +++ b/t/dynpmc/os.t @@ -355,7 +355,7 @@ CODE } else { SKIP: { - skip 'broken test TT #457', 1 if $solaris; + skip 'broken test GH #457', 1 if $solaris; $stat = sprintf("0x%08x\n" x 13, @s); pir_output_is( <<'CODE', $stat, 'Test OS.stat' ); @@ -481,7 +481,7 @@ my $lstat; SKIP: { skip 'lstat not on Win32', 1 if $MSWin32; - skip 'broken test TT #457', 1 if $solaris; + skip 'broken test GH #457', 1 if $solaris; my @s = lstat('xpto'); $s[6] = 0; # Parrot does this internally @@ -501,7 +501,7 @@ SKIP: { $S2 = sprintf $S1, $P2 print $S2 - $P3 = $P1."lstat"("non-existant file") + $P3 = $P1."lstat"("non-existent file") end .end diff --git a/t/dynpmc/select.t b/t/dynpmc/select.t new file mode 100644 index 0000000000..d4471c4496 --- /dev/null +++ b/t/dynpmc/select.t @@ -0,0 +1,192 @@ +#!./parrot +# Copyright (C) 2010-2011, Parrot Foundation. + +=head1 NAME + +t/dynpmc/select.t - tests the Select PMC + +=head1 SYNOPSIS + + % prove t/dynpmc/select.t + +=head1 DESCRIPTION + +Tests the Select PMC: a PMC for monitoring multiple file handles, waiting for +it to become ready for an I/O operation. + +=cut + +.sub main :main + .include 'test_more.pir' + .include 'iglobals.pasm' + + load_bytecode 'osutils.pbc' + + plan(14) + + .local pmc interp + interp = getinterp + + .local pmc config + config = interp[.IGLOBALS_CONFIG_HASH] + + .local string osname + osname = config['osname'] + + if osname == 'MSWin32' goto todo_all + if osname == 'msys' goto todo_all + goto tests + + todo_all: + skip(14, 'Behavior of select() is undefined on Windows') + goto end + + tests: + test_load() + test_update() + test_read() + test_write() + test_select() + end: +.end + +.sub 'test_load' + $P0 = loadlib 'select' + $I0 = defined $P0 + ok($I0, "Loaded 'select' library") +.end + +.sub 'test_update' + $P9 = new 'String' + $P9 = 'FH1' + + $P0 = new ['FileHandle'] + $P0.'open'('README') + + $P1 = new ['Select'] + $P1.'update'($P0, $P9, 5) + + $P3 = new ['FileHandle'] + $P3.'open'('README') + + $P9 = new 'String' + $P9 = 'FH2' + + $P1.'update'($P3, $P9, 5) + + $I1 = $P0.'handle'() + $I2 = $P3.'handle'() + + if $I1 > $I2 goto a + $I1 = $I2 + + a: + $I0 = $P1.'max_fd'() + is($I0, $I1, 'Check maximum number of file handles') + + $P2 = $P1.'fd_map'() + $I3 = $P2 + is($I3, 2, 'Two file handles in Select PMC') + + $I0 = $P0.'handle'() + $S0 = $P2[$I0] + is($S0, 'FH1', 'Check fd_map() for FH1') + + $I0 = $P3.'handle'() + $S0 = $P2[$I0] + is($S0, 'FH2', 'Check fd_map for FH2') + + $P1.'remove'($P0) + $I3 = $P2 + is($I3, 1, 'One file handle in Select PMC') + + $P6 = $P1.'can_read'(1) +.end + +.sub 'test_read' + $P9 = new 'String' + $P9 = 'FH1' + + $P0 = new ['FileHandle'] + $P0.'open'('README') + + $P1 = new ['Select'] + $P1.'update'($P0, $P9, 5) + + $P6 = $P1.'can_read'(1) + $I0 = $P6 + is($I0, 1, 'Test can_read() for README') + + $P6 = $P1.'can_write'(0) + $I0 = $P6 + is($I0, 0, 'Test can_write() for README') +.end + +.sub 'test_write' + $S0 = 'README2' + + $P9 = new 'String' + $P9 = 'FH1' + + $P0 = new ['FileHandle'] + $P0.'open'($S0, 'w') + + $P1 = new ['Select'] + $P1.'update'($P0, $P9, 2) + sweep 1 + $P9 = new 'String' + $P9 = 'FH2' + + $P6 = $P1.'can_write'(1) + $I0 = $P6 + is($I0, 1, 'Test can_write() for README2') + $P2 = $P6[0] + is($P2, "FH1", 'can_write() returned the correct payload') + + $P6 = $P1.'can_read'(0) + $I0 = $P6 + is($I0, 0, 'Test can_read() for README2') + + unlink($S0) +.end + +.sub 'test_select' + $S0 = 'README2' + $P9 = new 'String' + $P9 = 'FH1' + + $P0 = new ['FileHandle'] + $P0.'open'('README', 'r') + + $P1 = new ['Select'] + $P1.'update'($P0, $P9, 5) + + $P9 = new 'String' + $P9 = 'FH2' + + $P0 = new ['FileHandle'] + $P0.'open'($S0, 'w') + + $P1.'update'($P0, $P9, 6) + + $P6 = $P1.'select'(1) + $P7 = $P6[0] + $I0 = $P7 + is($I0, 1, 'Test can_read() for README2 (array index)') + + $P7 = $P6[1] + $I0 = $P7 + is($I0, 1, 'Test can_write() for README2 (array index)') + + $P7 = $P6[2] + $I0 = $P7 + is($I0, 0, 'Test has_exception() for README2 (array index)', 'varies across OSes' :named('todo')) + + unlink($S0) +.end + +# Local Variables: +# mode: pir +# fill-column: 100 +# End: +# vim: expandtab shiftwidth=4 ft=pir: diff --git a/t/fullharness b/t/fullharness new file mode 100644 index 0000000000..cc5e5e8d12 --- /dev/null +++ b/t/fullharness @@ -0,0 +1,165 @@ +#!perl +# Copyright (C) 2012, Parrot Foundation. + +use strict; +use warnings; +use Carp; +use Getopt::Long; +use lib qw( ./lib ); +use TAP::Harness; +use Parrot::Harness::TestSets qw( + %test_groups + @major_test_group + @near_core_test_group +); +use Parrot::Harness::Options qw( + get_test_prog_args +); +use Parrot::Harness::Smoke qw( + collect_test_environment_data + send_archive_to_smolder +); + +my ($archive, $smolder, $IN_TESTING); +GetOptions( + 'archive' => \$archive, + 'send-to-smolder' => \$smolder, + 'in-testing' => \$IN_TESTING, +); + +my @runcore_test_files = glob("@{ $test_groups{runcore} }"); +my @testing_runcore_test_files = glob("@{ $test_groups{testing_runcore} }"); + +my @targets = (); +my @alternate_runcore_targets = ( qw| b f r | ); +foreach my $t (@alternate_runcore_targets) { + push @targets, set_alternate_runcore_target($t); +} + +my @other_targets = ( qw| + src run buildtools perl + compilers dynoplibs dynpmc + library miscellaneous + codingstd benchmark manifest + examples distro headerizer +| ); +foreach my $t ( @other_targets ) { + push @targets, set_usual_target($t); +} +if ($IN_TESTING) { + @targets = ( + ( map { set_alternate_runcore_target($_, $IN_TESTING) } + ( qw| b f | ) ), + ( map { set_usual_target($_) } ( qw| run manifest headerizer | ) ), + ); +} + +if ($archive) { + eval { + require TAP::Harness::Archive; + require TAP::Harness::Archive::MultipleHarnesses; + require TAP::Harness::ReportByDescription; + }; + if ($@) { + my $msg = "To run make smolder_fulltest, please install \n"; + $msg .= " TAP::Harness::Archive and TAP::Harness::ReportByDescription from CPAN.\n"; + $msg .= " From the cpan shell: 'install TAP::Harness::ReportByDescription'.\n"; + $msg .= " With cpanminus : cpanm TAP::Harness::ReportByDescription \n"; + croak $msg; + } + my %env_data = collect_test_environment_data(); + my $archive = TAP::Harness::Archive::MultipleHarnesses->new( { + verbosity => $ENV{HARNESS_VERBOSE}, + archive => 't/archive/parrot_test_run.tar.gz', + merge => 1, + jobs => $ENV{TEST_JOBS} || 1, + extra_properties => \%env_data, + extra_files => [ 'myconfig', 'config_lib.pir' ], + } ); + my $overall_aggregator = $archive->runtests(\@targets); + $archive->summary($overall_aggregator); + send_archive_to_smolder(%env_data) if $smolder; +} +else { + require TAP::Formatter::Console; + require TAP::Parser::Aggregator; + + my ($formatter, $aggregator); + $formatter = TAP::Formatter::Console->new( { + verbosity => $ENV{HARNESS_VERBOSE}, + jobs => $ENV{TEST_JOBS} || 1, + directives => 1, + timer => $ENV{HARNESS_TIMER} || 0, + } ); + $aggregator = TAP::Parser::Aggregator->new; + + $aggregator->start(); + foreach my $set (@targets) { + # rewrite environment + &{$set->{rule}} if defined $set->{rule}; + print STDERR "$set->{label}: running with: $ENV{TEST_PROG_ARGS}\n"; + my $harness = TAP::Harness->new( { + formatter => $formatter, + jobs => $ENV{TEST_JOBS} || 1, + } ); + $harness->aggregate_tests($aggregator, @{$set->{tests}}); + } + $aggregator->stop(); + $formatter->summary($aggregator); + # We'll treat both FAIL and NOTESTS as failures. + my $exit_value = ($aggregator->get_status() eq 'PASS') ? 0 : 1; + exit($exit_value); +} + +##### SUBROUTINES ##### + +sub set_usual_env_args { + my %opts = (); + _handle_opts(\%opts); +} + +sub set_alternate_runcore_env_args { + my $runcore = shift; + my %opts = ( $runcore => 1 ); + _handle_opts(\%opts); +} + +sub _handle_opts { + my $optsref = shift; + $optsref->{D} = + sprintf( '%x', hex(40) | (exists $optsref->{D} ? hex($optsref->{D}) : 0)); + my $args = get_test_prog_args( $optsref, 1, 0 ); + $ENV{TEST_PROG_ARGS} = $args; +} + +sub set_alternate_runcore_target { + my ($alt, $in_testing) = @_; + return { + label => "test$alt", + rule => sub { set_alternate_runcore_env_args($alt) }, + tests => [ map { [ $_, "test${alt}__$_", ] } + ( $in_testing + ? @testing_runcore_test_files + : @runcore_test_files + ) ], + }; +} + +sub set_usual_target { + my $label = shift; + return { + label => $label, + rule => \&set_usual_env_args, + tests => [ map { [ $_, "${label}__$_" ] } + glob("@{$test_groups{$label}}") + ], + }; +} + + +# Local Variables: +# mode: cperl +# cperl-indent-level: 4 +# fill-column: 100 +# End: +# vim: expandtab shiftwidth=4: diff --git a/t/harness b/t/harness index 5937957359..629f61a8cf 100644 --- a/t/harness +++ b/t/harness @@ -77,7 +77,7 @@ if ($longopts->{archive}) { $harness = TAP::Harness::Archive->new( { verbosity => $ENV{HARNESS_VERBOSE}, - archive => 'parrot_test_run.tar.gz', + archive => 't/archive/parrot_test_run.tar.gz', merge => 1, extra_properties => \%env_data, extra_files => [ 'myconfig', 'config_lib.pir' ], diff --git a/t/harness.pir b/t/harness.pir index 189f6dccc4..20e59d574e 100644 --- a/t/harness.pir +++ b/t/harness.pir @@ -68,7 +68,7 @@ HELP goto L3 L2: harness = new ['TAP';'Harness';'Archive'] - harness.'archive'('parrot_test_run.tar.gz') + harness.'archive'('t/archive/parrot_test_run.tar.gz') options['merge'] = 1 .local pmc env_data env_data = collect_test_environment_data() @@ -120,7 +120,7 @@ HELP L2: nb = elements files # currently, FixedStringArray hasn't the method sort. - # see TT #1356 + # see GH #384 $P0 = new 'FixedPMCArray' set $P0, nb $I0 = 0 @@ -379,7 +379,7 @@ TEST push contents, 'report_file' $P0 = new 'FixedStringArray' set $P0, 1 - $P0[0] = 'parrot_test_run.tar.gz' + $P0[0] = 't/archive/parrot_test_run.tar.gz' push contents, $P0 load_bytecode 'LWP/UserAgent.pir' .const string url = 'http://smolder.parrot.org/app/projects/process_add_report/1' diff --git a/t/library/p6object.t b/t/library/p6object.t index 519ab6a329..42bb531d99 100644 --- a/t/library/p6object.t +++ b/t/library/p6object.t @@ -151,7 +151,7 @@ Testing Perl 6 objects. $I0 = $P0.'can'(rpaobj, 'foo') ok($I0, '< ResizablePMCArray_obj.^can("foo") >') $I0 = $P0.'isa'(rpaobj, listproto) - todo($I0, '< ResizablePMCArray_obj.^isa(List) >', 'unimplemented: TT #1617') + todo($I0, '< ResizablePMCArray_obj.^isa(List) >', 'unimplemented: GH #403') ## create class with a different proto name .local pmc myobjectproto @@ -253,7 +253,7 @@ The available options include: msg = 'concat'(classname, '.WHERE') $P0 = proto.'WHERE'() - $I0 = get_addr proto + $I0 = get_id proto is($I0, $P0, msg) if null who goto proto_who_done @@ -289,7 +289,7 @@ The available options include: msg = 'concat'(objname, '.WHERE') $P0 = obj.'WHERE'() - $I0 = get_addr obj + $I0 = get_id obj is($I0, $P0, msg) if null who goto obj_who_done diff --git a/t/library/pg.t b/t/library/pg.t index 3da73cc823..dcdd68898d 100644 --- a/t/library/pg.t +++ b/t/library/pg.t @@ -256,11 +256,12 @@ no_pg: $I0 = $S0 == 'UnManagedStruct' test.'ok'($I0, 'notice callback got a struct') + .local pmc st st = get_root_global ['parrot';'Pg'], 'PQresultStatus' $I0 = st(res) $I1 = iseq $I0, PGRES_COMMAND_OK - test.'ok'($I1, 'notice result is still ok') + test.'todo'($I1, 'notice result is still ok') .end # Local Variables: diff --git a/t/native_pbc/annotations.pbc b/t/native_pbc/annotations.pbc new file mode 100644 index 0000000000..6f5db6695a Binary files /dev/null and b/t/native_pbc/annotations.pbc differ diff --git a/t/native_pbc/header.t b/t/native_pbc/header.t index 2b32648714..e5e928963a 100755 --- a/t/native_pbc/header.t +++ b/t/native_pbc/header.t @@ -6,7 +6,7 @@ use warnings; use lib qw( . lib ../lib ../../lib ); use Test::More; -use Parrot::Test skip_all => 'pending robust testing strategy, TT #357'; +use Parrot::Test skip_all => 'pending robust testing strategy, GH #394'; #use Parrot::Test tests => 9; use File::Temp; diff --git a/t/native_pbc/integer.pbc b/t/native_pbc/integer.pbc index cc815a4e5c..3ccef08bc8 100644 Binary files a/t/native_pbc/integer.pbc and b/t/native_pbc/integer.pbc differ diff --git a/t/native_pbc/integer.t b/t/native_pbc/integer.t index 8972d39d07..3a3a26242a 100644 --- a/t/native_pbc/integer.t +++ b/t/native_pbc/integer.t @@ -8,7 +8,7 @@ use Test::More; use Parrot::Config; use Parrot::BuildUtil; -use Parrot::Test skip_all => 'pending robust testing strategy, TT #357'; +use Parrot::Test skip_all => 'pending robust testing strategy, GH #394'; #use Parrot::Test tests => 7; =head1 NAME @@ -145,7 +145,7 @@ sub test_pbc_integer { $todo_msg = "$cvt $todo_msg" } else { - $todo_msg = "$cvt yet untested, TT #357. " + $todo_msg = "$cvt yet untested, GH #394. " . "Please report success." } pbc_output_is( undef, $output, "$cvt $desc", diff --git a/t/native_pbc/number.pbc b/t/native_pbc/number.pbc index 9f00036c33..0c8ec5634e 100644 Binary files a/t/native_pbc/number.pbc and b/t/native_pbc/number.pbc differ diff --git a/t/native_pbc/number.t b/t/native_pbc/number.t index 87ba39bb12..84a75c0833 100644 --- a/t/native_pbc/number.t +++ b/t/native_pbc/number.t @@ -8,7 +8,7 @@ use Test::More; use Parrot::Config; use Parrot::BuildUtil; -use Parrot::Test skip_all => 'pending robust testing strategy, TT #357'; +use Parrot::Test skip_all => 'pending robust testing strategy, GH #394'; #use Parrot::Test tests => 7; =head1 NAME @@ -86,7 +86,7 @@ into your report. We need your wordsize/floattype/endianess. =cut -# TT #357: testmatrix for coverage overview +# GH #394: testmatrix for coverage overview # float conversion src: left-side (pbc) to dest: upper-side (platform) # 1: tested ok, 0: fails (skip), ?: not yet tested (todo) # Note that the corresponding cvt_num* functions in F have odd names. @@ -219,7 +219,7 @@ sub test_pbc_number { $todo_msg = "$cvt $todo_msg" } else { - $todo_msg = "$cvt yet untested, TT #357. " + $todo_msg = "$cvt yet untested, GH #394. " . "Please report success." } pbc_output_is( undef, $expected, "$cvt $desc", diff --git a/t/native_pbc/number_4.pbc b/t/native_pbc/number_4.pbc index a8b9a08929..58e2b6a8c9 100644 Binary files a/t/native_pbc/number_4.pbc and b/t/native_pbc/number_4.pbc differ diff --git a/t/native_pbc/number_5.pbc b/t/native_pbc/number_5.pbc index 7bbb11f872..5709a4844e 100644 Binary files a/t/native_pbc/number_5.pbc and b/t/native_pbc/number_5.pbc differ diff --git a/t/native_pbc/string.pbc b/t/native_pbc/string.pbc index 2496faf64c..b1dff67114 100644 Binary files a/t/native_pbc/string.pbc and b/t/native_pbc/string.pbc differ diff --git a/t/native_pbc/string.t b/t/native_pbc/string.t index a9659dcf2f..df721e42b9 100644 --- a/t/native_pbc/string.t +++ b/t/native_pbc/string.t @@ -8,7 +8,7 @@ use Test::More; use Parrot::Config; use Parrot::BuildUtil; -use Parrot::Test skip_all => 'pending robust testing strategy, TT #357'; +use Parrot::Test skip_all => 'pending robust testing strategy, GH #394'; #use Parrot::Test tests => 6; =head1 NAME @@ -120,7 +120,7 @@ sub test_pbc_string { $todo_msg = "$cvt $todo_msg" } else { - $todo_msg = "$cvt yet untested, TT #357. " + $todo_msg = "$cvt yet untested, GH #394. " . "Please report success." } pbc_output_is( undef, $output, "$cvt $desc", diff --git a/t/native_pbc/string_4.pbc b/t/native_pbc/string_4.pbc index 689b324598..9e59320342 100644 Binary files a/t/native_pbc/string_4.pbc and b/t/native_pbc/string_4.pbc differ diff --git a/t/native_pbc/string_5.pbc b/t/native_pbc/string_5.pbc new file mode 100644 index 0000000000..b1dff67114 Binary files /dev/null and b/t/native_pbc/string_5.pbc differ diff --git a/t/oo/metamodel.t b/t/oo/metamodel.t index cb86c8f9d0..c6e78b2b66 100755 --- a/t/oo/metamodel.t +++ b/t/oo/metamodel.t @@ -45,7 +45,7 @@ Tests the metamodel for the OO implementation. $P1 = attributes['tail'] $S1 = $P1['type'] $I0 = iseq $S1, 'Str' - todo($I0, "tail attribute has a type", "not implemented: TT #1618") + todo($I0, "tail attribute has a type", "not implemented: GH #410") # is($S1,'Str', "tail attribute has a type") goto end_tail_attrib_test no_tail_attribute: diff --git a/t/oo/objects.t b/t/oo/objects.t index a03357ac93..652e3b64a9 100644 --- a/t/oo/objects.t +++ b/t/oo/objects.t @@ -683,10 +683,10 @@ l1: .sub PMC_as_classes get_class $P0, "Integer" - ok( 1, "get_class of Integer did't croak" ) + ok( 1, "get_class of Integer didn't croak" ) get_class $P0, "Integer" - ok( 1, "get_class of Integer did't croak second time" ) + ok( 1, "get_class of Integer didn't croak second time" ) typeof $S0, $P0 is( $S0, 'PMCProxy', 'typeof PMCProxy' ) @@ -1592,55 +1592,54 @@ end: # Foo54 and Bar54 have attribute accessor methods new $P5, ['String'] # set attribute values set $P5, "i" # attribute slots have reference semantics - set_args "0,0", $P5, "i" + set_args "0,0,0", $P13, $P5, "i" callmethodcc $P13, "Foo54__set" get_results "" new $P5, ['String'] set $P5, "j" - set_args "0,0", $P5, "j" + set_args "0,0,0", $P13, $P5, "j" callmethodcc $P13,"Foo54__set" get_results "" new $P5, ['String'] set $P5, "k" - set_args "0,0", $P5, "k" + set_args "0,0,0", $P13, $P5, "k" callmethodcc $P13,"Bar54__set" get_results "" new $P5, ['String'] set $P5, "l" - set_args "0,0", $P5, "l" + set_args "0,0,0", $P13, $P5, "l" callmethodcc $P13,"Bar54__set" get_results "" # now retrieve attributes - set_args "0", "i" + set_args "0,0", $P13, "i" callmethodcc $P13,"Foo54__get" get_results "0", $P5 is( $P5, "i", 'got attrib i from Bar54->Foo54__get' ) - set_args "0", "j" + set_args "0,0", $P13, "j" callmethodcc $P13,"Foo54__get" get_results "0", $P5 is( $P5, "j", 'got attrib j from Bar54->Foo54__get' ) - set_args "0", "k" + set_args "0,0", $P13, "k" callmethodcc $P13,"Bar54__get" get_results "0", $P5 is( $P5, "k", 'got attrib k from Bar54->Bar54__get' ) - set_args "0", "l" - callmethodcc $P13,"Bar54__get" + set_args "0,0", $P13, "l" + callmethodcc $P13, "Bar54__get" get_results "0", $P5 is( $P5, "l", 'got attrib l from Bar54->Bar54__get' ) .end # set(obj: Pvalue, Iattr_idx) .sub Foo54__set - get_params "0,0", $P5, $S4 + get_params "0,0,0", $P2, $P5, $S4 ok( 1, "in Foo54__set" ) - interpinfo $P2, .INTERPINFO_CURRENT_OBJECT setattribute $P2, $S4, $P5 set_returns "" returncc @@ -1648,17 +1647,15 @@ end: # Pattr = get(obj: Iattr_idx) .sub Foo54__get - get_params "0", $S4 + get_params "0,0", $P2, $S4 ok( 1, "in Foo54__get" ) - interpinfo $P2, .INTERPINFO_CURRENT_OBJECT getattribute $P5, $P2, $S4 set_returns "0", $P5 returncc .end .sub Bar54__set - get_params "0,0", $P5, $S4 - interpinfo $P2, .INTERPINFO_CURRENT_OBJECT + get_params "0,0,0", $P2, $P5, $S4 ok( 1, "in Bar54__set" ) setattribute $P2, $S4, $P5 set_returns "" @@ -1666,9 +1663,8 @@ end: .end .sub Bar54__get - get_params "0", $S4 + get_params "0,0", $P2, $S4 ok( 1, "in Bar54__get" ) - interpinfo $P2, .INTERPINFO_CURRENT_OBJECT getattribute $P5, $P2, $S4 set_returns "0", $P5 returncc @@ -1702,51 +1698,51 @@ end: # Foo56 and Bar56 have attribute accessor methods new $P5, ['String'] # set attribute values set $P5, "i" # attribute slots have reference semantics - set_args "0,0,0", $P5, "Foo56", "i" + set_args "0,0,0,0", $P2, $P5, "Foo56", "i" callmethodcc $P2, "set" new $P5, ['String'] set $P5, "j" - set_args "0,0,0", $P5, "Foo56", "j" + set_args "0,0,0,0", $P2, $P5, "Foo56", "j" callmethodcc $P2, "set" new $P5, ['String'] set $P5, "k" - set_args "0,0,0", $P5, "Bar56", "k" + set_args "0,0,0,0", $P2, $P5, "Bar56", "k" callmethodcc $P2, "set" new $P5, ['String'] set $P5, "l" - set_args "0,0,0", $P5, "Bar56", "l" + set_args "0,0,0,0", $P2, $P5, "Bar56", "l" callmethodcc $P2, "set" new $P5, ['String'] set $P5, "m" - set_args "0,0,0", $P5, "Bar56", "m" + set_args "0,0,0,0", $P2, $P5, "Bar56", "m" callmethodcc $P2, "set" # now retrieve attributes - set_args "0,0", "Foo56", "i" + set_args "0,0,0", $P2, "Foo56", "i" callmethodcc $P2, "get" get_results "0", $P5 is( $P5, 'i', 'got attrib i from subclass through parent method' ) - set_args "0,0", "Foo56", "j" + set_args "0,0,0", $P2, "Foo56", "j" callmethodcc $P2, "get" get_results "0", $P5 is( $P5, "j", 'got attrib i from subclass through parent method' ) - set_args "0,0", "Bar56", "k" + set_args "0,0,0", $P2, "Bar56", "k" callmethodcc $P2, "get" get_results "0", $P5 is( $P5, "k", 'got attrib i from subclass through parent method' ) - set_args "0,0", "Bar56", "l" + set_args "0,0,0", $P2, "Bar56", "l" callmethodcc $P2, "get" get_results "0", $P5 is( $P5, "l", 'got attrib i from subclass through parent method' ) - set_args "0,0", "Bar56", "m" + set_args "0,0,0", $P2, "Bar56", "m" callmethodcc $P2, "get" get_results "0", $P5 is( $P5, "m", 'got attrib i from subclass through parent method' ) @@ -1757,8 +1753,7 @@ end: # set(obj: Pvalue, SClass, Sattr) .sub set - get_params "0,0,0", $P5, $S4, $S5 - interpinfo $P2, .INTERPINFO_CURRENT_OBJECT + get_params "0,0,0,0", $P2, $P5, $S4, $S5 setattribute $P2, $S5, $P5 set_returns "" returncc @@ -1766,14 +1761,12 @@ end: # Pattr = get(obj: SClass, Sattr) .sub get - get_params "0,0", $S4, $S5 - interpinfo $P2, .INTERPINFO_CURRENT_OBJECT + get_params "0,0,0", $P2, $S4, $S5 getattribute $P5, $P2, $S5 set_returns "0", $P5 returncc .end - # Local Variables: # mode: pir # fill-column: 100 diff --git a/t/op/arithmetics.t b/t/op/arithmetics.t index 4bba170071..a08857eeac 100644 --- a/t/op/arithmetics.t +++ b/t/op/arithmetics.t @@ -163,7 +163,7 @@ number types. goto End_test1 Todo_test1: $I0 = $S0 == "-0" - todo($I0, 'negative zero, TT #313') + todo($I0, 'negative zero, GH #366') End_test1: set $N0, -0.0 @@ -185,7 +185,7 @@ End_test1: goto End_test4 Todo_test4: $I0 = $S0 == "-0" - todo($I0, 'negative zero, TT #313') + todo($I0, 'negative zero, GH #366') End_test4: .end diff --git a/t/op/calling.t b/t/op/calling.t index 24b37e4dee..867102b81f 100644 --- a/t/op/calling.t +++ b/t/op/calling.t @@ -1,12 +1,12 @@ #!perl -# Copyright (C) 2001-2009, Parrot Foundation. +# Copyright (C) 2001-2011, Parrot Foundation. use strict; use warnings; use lib qw( . lib ../lib ../../lib ); use Test::More; -use Parrot::Test tests => 103; +use Parrot::Test tests => 104; =head1 NAME @@ -257,6 +257,28 @@ ok 3 back OUTPUT +pir_error_output_like( <<'CODE', qr/Invalid operation on null string/, "return :flat" ); +.sub main :main + .local string s, r + .local pmc arr + + say "get" + s = s_get() + r = substr s, 0, 1 + print "'" + print r + print "'" + say " done" +.end + +.sub s_get + .local pmc arr + arr = new ["ResizableStringArray"] + # push arr, "xy" + .return(arr :flat ) +.end +CODE + pir_output_is( <<'CODE', <<'OUTPUT', "use it in PIR" ); .sub main :main $P0 = new 'String' @@ -2451,7 +2473,7 @@ CODE 2 OUTPUT -pir_error_output_like( <<'CODE', <<'OUTPUT', "arg mismatch with no params", todo=> 'TT #1033' ); +pir_error_output_like( <<'CODE', <<'OUTPUT', "arg mismatch with no params", todo=> 'GH #600' ); .sub main :main foo(1) .end @@ -2494,7 +2516,12 @@ pir_output_is( <<'CODE', <<'OUTPUT', "Handling :flat of empty arguments" ); .sub 'main' :main $P0 = new ['Undef'] ($P0) = foo() + unless null $P0 goto L1 + $S0 = "PMCNULL" + goto L2 + L1: $S0 = typeof $P0 + L2: say $S0 .end @@ -2506,7 +2533,7 @@ pir_output_is( <<'CODE', <<'OUTPUT', "Handling :flat of empty arguments" ); .end CODE ResizablePMCArray -Undef +PMCNULL OUTPUT pir_output_is( <<'CODE', <<'OUTPUT', "Tailcall from vtable" ); diff --git a/t/op/comp.t b/t/op/comp.t index 85201a099b..c9b096c0bb 100644 --- a/t/op/comp.t +++ b/t/op/comp.t @@ -148,7 +148,7 @@ Tests various conditional branch operations. set $P0, -1.2 new $P1, 'String' # -# fix problems with g++ 4.4.1 (with --optimize) on i386 - TT #1275 +# fix problems with g++ 4.4.1 (with --optimize) on i386 - GH #677 # set $P1, "-1.2" set $P1, "-1.2000000000" eq_num $P0, $P1, OK diff --git a/t/op/exceptions.t b/t/op/exceptions.t index db5772696e..3c2f0cd691 100644 --- a/t/op/exceptions.t +++ b/t/op/exceptions.t @@ -5,7 +5,9 @@ use strict; use warnings; use lib qw( . lib ../lib ../../lib ); use Test::More; -use Parrot::Test tests => 31; +use Parrot::Test tests => 32, + qw[run_command slurp_file]; +use Parrot::Test::Util 'create_tempfile'; =head1 NAME @@ -692,6 +694,88 @@ in the handler ok 3 ok 4 OUTPUT + +# Test massaged from TT #2188 +{ + sub compile_wx { + my $code = shift; + my ($fh, $wx_filename) = create_tempfile( SUFFIX => '.winxed', UNLINK => 1 ); + (undef, my $pir_filename) = create_tempfile( SUFFIX => '.pir', UNLINK => 1 ); + (undef, my $pbc_filename) = create_tempfile( SUFFIX => '.pbc', UNLINK => 1 ); + print $fh $code; + if (system(qw[./winxed --target=pir -o], $pir_filename, $wx_filename) + || system(qw[./parrot -o], $pbc_filename, $pir_filename)) { + die "couldn't compile winxed"; + } + close $fh; + return $pbc_filename; + } + + + my $friend = compile_wx(<<'WX1'); my $exptest = compile_wx(sprintf(<<'WX2', $friend)); +namespace em { + class Friend { + function Friend() {} + + function call() { + throw new 'Exception'({ + "message" : "Damned ! an exception !", + "severity" : 100}); + } + } +} +WX1 +$load '%s'; + +namespace em { + class Friend; + class User { + function User() {} + + function call0() { + try { + self.call1(); + } catch(ex) { + say(ex['message']); + for (string exstr in ex.backtrace_strings()) { + for (string str in split("\n",exstr)) { + say(str); + } + } + } + self.call1(); + } + + function call1() { + var friend = new em.Friend(); + friend.call(); + } + } +} + +function main[main](var argv) { + var user = new em.User(); + user.call0(); +} +WX2 + + (undef, my $user_bt_file) = create_tempfile( UNLINK => 1 ); + (undef, my $auto_bt_file) = create_tempfile( UNLINK => 1 ); + + run_command("./parrot $exptest", + STDOUT => $user_bt_file, + STDERR => $auto_bt_file); + + my @user_bt = split /\n/, slurp_file($user_bt_file); + my @auto_bt = split /\n/, slurp_file($auto_bt_file); + + # 3rd backtrace frame differs intentionally + delete $user_bt[3]; delete $auto_bt[3]; + + is_deeply([@user_bt], [@auto_bt], + "user-level backtraces the same as automatically generated backtraces"); +} + # Local Variables: # mode: cperl # cperl-indent-level: 4 diff --git a/t/op/gc.t b/t/op/gc.t index dfa96bb618..29650c656b 100755 --- a/t/op/gc.t +++ b/t/op/gc.t @@ -19,6 +19,11 @@ GC related bugs. .include 'interpinfo.pasm' .sub main :main + # XXX HACK + # :main is tailcalled from prt0, but tailcaller frames aren't eliminated + # until get_params is called. + .param pmc argv + .include 'test_more.pir' sweep_1() @@ -218,7 +223,7 @@ GC related bugs. .namespace ['Source'] .sub get_string :method :vtable # buffer $P4 = self - $P2 = getprop "buffer", $P4 + $P2 = getprop $P4, "buffer" sweep 1 unless_null $P2, buffer_ok $P2 = new ['Source'; 'Buffer'] @@ -234,7 +239,7 @@ buffer_ok: .sub get_string :method :vtable $P4 = self sweep 1 - $P2 = getprop "buf", $P4 + $P2 = getprop $P4, "buf" $S0 = $P2 .return($S0) .end @@ -268,7 +273,7 @@ buffer_ok: $P1 = 0 n = $P0."b11"($P1) ok(1, "recursion_and_exceptions") - is(n,8, "recursion_and_exceptions") + is(n, 7, "recursion_and_exceptions") .end .namespace ["b"] .sub b11 :method diff --git a/t/op/inf_nan.t b/t/op/inf_nan.t index d395e43bc9..e5a57a28eb 100644 --- a/t/op/inf_nan.t +++ b/t/op/inf_nan.t @@ -17,12 +17,13 @@ Tests for mathematical operations with Inf and Nan. .sub main :main .include 'test_more.pir' - plan(37) + plan(42) test_basic_arith() test_sqrt() test_neg() test_mix_nan_inf() + test_is_inf_or_nan() test_rounding_n() test_rounding_i() test_nan_complex() @@ -118,7 +119,27 @@ Tests for mathematical operations with Inf and Nan. is($N2, '-Inf', '... ceil -Inf') .end -#pir_output_is(<<'CODE',< 'lexicals not thawed properly from PBC, TT #1171' ) +plan( skip_all => 'lexicals not thawed properly from PBC, GH #430' ) if $ENV{TEST_PROG_ARGS} =~ /--run-pbc/; plan( tests => 54 ); diff --git a/t/op/literal.t b/t/op/literal.t index e1e5396c0f..27f27e9908 100644 --- a/t/op/literal.t +++ b/t/op/literal.t @@ -11,7 +11,7 @@ t/op/literal.t - Testing the PIR lexer =head1 DESCRIPTION -Tests the lexing of literal numbers. Taken from from the 2nd +Tests the lexing of literal numbers. Taken from the 2nd aoudad book (page 127). =cut diff --git a/t/op/number.t b/t/op/number.t index f682cae04a..f43e5ef870 100644 --- a/t/op/number.t +++ b/t/op/number.t @@ -612,7 +612,7 @@ Tests the use of Parrot floating-point number registers. .return () negative_zero_todoed: - todo(0, '-0.0 not implemented, TT #313') + todo(0, '-0.0 not implemented, GH #366') .end .sub test_mul_n_n diff --git a/t/op/sprintf.t b/t/op/sprintf.t index bacf0e36a9..db0e48e93f 100644 --- a/t/op/sprintf.t +++ b/t/op/sprintf.t @@ -350,7 +350,7 @@ tag C is allowed for todo tests that should fail on any system. local_branch jmpstack, set_skip_loop skip_info[114] = 'harness needs support for * modifier' - skip_info[144] = 'perl5 expresssion as test value' + skip_info[144] = 'perl5 expression as test value' skip_info[131] = 'harness needs support for * modifier' skip_info[141] = 'harness needs support for * modifier' skip_info[161] = 'harness needs support for * modifier' diff --git a/t/op/stringu.t b/t/op/stringu.t index d7b6ac9df8..ae1ff2a4b2 100644 --- a/t/op/stringu.t +++ b/t/op/stringu.t @@ -310,8 +310,6 @@ CODE AAAAAAAAAA\xd9\xa6 OUTPUT -SKIP: { - skip( 'no ICU lib', 3 ) unless $PConfig{has_icu}; pir_output_is( <<'CODE', <= $N1 goto good + ok(0, "Alarms actually waited") + .return() + +good: + ok(1, "Alarms actually waited") + + $P1 = get_global 'alarm_finish' + $N0 = time + $N0 = $N0 + 0.1 + + $P0 = new 'Float' + $P0 = $N0 + set_global 'FT', $P0 + + make_alarm($N0, $P1) + + sleep 5.0 + ok(0, "Alarm/sleep interaction") + all_tests_end: +.end + +.sub make_alarm + .param num when + .param pmc proc + + $P1 = new 'Alarm' + $P1[.PARROT_ALARM_TIME] = when + $P1[.PARROT_ALARM_TASK] = proc + + $P1() +.end + +.sub inc_A + $P0 = get_global 'A' + $P0 = $P0 + 1 + set_global 'A', $P0 + .return($P0) +.end + +.sub alarm1 + $P0 = inc_A() + + ok(1, "alarm 1") + .return() +.end + +.sub alarm2 + $P0 = inc_A() + + ok(1, "alarm 2") + .return() +.end + +.sub alarm3 + $P0 = inc_A() + + ok(1, "alarm 3") + .return() +.end + +.sub alarm4 + $P0 = inc_A() + + ok(1, "alarm 4") + .return() +.end + +.sub alarm_finish + $N0 = time + + $P0 = get_global 'FT' + $N1 = $P0 + + if $N0 < $N1 goto fail + $N1 = $N1 + 0.5 + if $N0 > $N1 goto fail + + ok(1, "Alarm/sleep interaction") + exit 0 + +fail: + ok(0, "Alarm/sleep interaction") +.end + +# Local Variables: +# mode: pir +# fill-column: 100 +# End: +# vim: expandtab shiftwidth=4 ft=pir: diff --git a/t/pmc/callcontext.t b/t/pmc/callcontext.t index cfb8fc1397..fbc42ba9f0 100644 --- a/t/pmc/callcontext.t +++ b/t/pmc/callcontext.t @@ -280,7 +280,7 @@ eh: unshift $P0, $P1 $P2 = shift $P0 - is($P2, 'derF', '... but not convert when unneccesary') + is($P2, 'derF', '... but not convert when unnecesary') $I0 = issame $P1, $P2 ok($I0, '... returning the same item' ) diff --git a/t/pmc/class.t b/t/pmc/class.t index bff5073bbf..7eb186a64c 100644 --- a/t/pmc/class.t +++ b/t/pmc/class.t @@ -280,7 +280,7 @@ Tests the Class PMC. is(test_string_val, 'bar', 'add_method() invoking method added to class works') t_class_meth: - todo( 0, 'add_method() invoking method added to class works', "classes don't seem to call methods yet: TT #1615") + todo( 0, 'add_method() invoking method added to class works', "classes don't seem to call methods yet: GH #396") obj_inst = class.'new'() test_string_val = obj_inst.'foo'() diff --git a/t/pmc/complex.t b/t/pmc/complex.t index 04b4050b7c..d2f533ee09 100644 --- a/t/pmc/complex.t +++ b/t/pmc/complex.t @@ -1024,19 +1024,19 @@ handler: .return() todo: - .complex_pow_todo( "2", "0.500000-0.000000i", -1, 'TT #313' ) - .complex_pow_todo( "2", "0.250000-0.000000i", -2, 'TT #313' ) - .complex_pow_todo( "-0.5", "0.250000-0.000000i", 2, 'TT #313' ) - .complex_pow_todo( "-0.5", "-2.000000-0.000000i", -1, 'TT #313' ) - .complex_pow_todo( "-2", "4.000000-0.000000i", 2, 'TT #313' ) - .complex_pow_todo( "-2", "-0.500000-0.000000i", -1, 'TT #313' ) - .complex_pow_todo( "0.5", "2.000000-0.000000i", -1, 'TT #313' ) - .complex_pow_todo( "0.5", "4.000000-0.000000i", -2, 'TT #313' ) - .complex_pow_todo( "0.5", "5.656854-0.000000i", -2.5, 'TT #313' ) - .complex_pow_todo( "3i", "-0.111111-0.000000i", -2, 'TT #313' ) - .complex_pow_todo( "-0.5-0.5i", "1.000000-0.000000i", 0, 'TT #313' ) - .complex_pow_todo( "-0.5-0.5i", "-0.000000+0.500000i", 2, 'TT #313' ) - .complex_pow_todo( "-0.5-0.5i", "-0.000000-2.000000i", -2, 'TT #313' ) + .complex_pow_todo( "2", "0.500000-0.000000i", -1, 'GH #366' ) + .complex_pow_todo( "2", "0.250000-0.000000i", -2, 'GH #366' ) + .complex_pow_todo( "-0.5", "0.250000-0.000000i", 2, 'GH #366' ) + .complex_pow_todo( "-0.5", "-2.000000-0.000000i", -1, 'GH #366' ) + .complex_pow_todo( "-2", "4.000000-0.000000i", 2, 'GH #366' ) + .complex_pow_todo( "-2", "-0.500000-0.000000i", -1, 'GH #366' ) + .complex_pow_todo( "0.5", "2.000000-0.000000i", -1, 'GH #366' ) + .complex_pow_todo( "0.5", "4.000000-0.000000i", -2, 'GH #366' ) + .complex_pow_todo( "0.5", "5.656854-0.000000i", -2.5, 'GH #366' ) + .complex_pow_todo( "3i", "-0.111111-0.000000i", -2, 'GH #366' ) + .complex_pow_todo( "-0.5-0.5i", "1.000000-0.000000i", 0, 'GH #366' ) + .complex_pow_todo( "-0.5-0.5i", "-0.000000+0.500000i", 2, 'GH #366' ) + .complex_pow_todo( "-0.5-0.5i", "-0.000000-2.000000i", -2, 'GH #366' ) .return() .end @@ -1300,8 +1300,8 @@ todo: .return() todo: - .complex_op_todo("0-2i", "-0.000000-0.909297i", 'sinh', 'TT #313' ) - .complex_op_todo("0+2i", "-0.000000+0.909297i", 'sinh', 'TT #313' ) + .complex_op_todo("0-2i", "-0.000000-0.909297i", 'sinh', 'GH #366' ) + .complex_op_todo("0+2i", "-0.000000+0.909297i", 'sinh', 'GH #366' ) .return() .end @@ -1431,10 +1431,10 @@ todo: .return() todo: - .complex_op_todo("0-1i", "-0.000000-1.570796i", 'asinh', 'TT #313' ) - .complex_op_todo("0-0.5i", "-0.000000-0.523599i", 'asinh', 'TT #313' ) - .complex_op_todo("0+0.5i", "-0.000000+0.523599i", 'asinh', 'TT #313' ) - .complex_op_todo("0+1i", "-0.000000+1.570796i", 'asinh', 'TT #313' ) + .complex_op_todo("0-1i", "-0.000000-1.570796i", 'asinh', 'GH #366' ) + .complex_op_todo("0-0.5i", "-0.000000-0.523599i", 'asinh', 'GH #366' ) + .complex_op_todo("0+0.5i", "-0.000000+0.523599i", 'asinh', 'GH #366' ) + .complex_op_todo("0+1i", "-0.000000+1.570796i", 'asinh', 'GH #366' ) .return() .end @@ -1447,16 +1447,16 @@ todo: .complex_op_is("-2+0i", "1.316958+3.141593i", 'acosh' ) .complex_op_is("2+0i", "-1.316958+0.000000i", 'acosh' ) - .complex_op_todo("0-2i", "1.443635-1.570796i", 'acosh', "TT #1891" ) - .complex_op_todo("0-1i", "0.881374-1.570796i", 'acosh', "TT #1891" ) - .complex_op_todo("0-0.5i", "0.481212-1.570796i", 'acosh', "TT #1891" ) + .complex_op_todo("0-2i", "1.443635-1.570796i", 'acosh', "GH #455" ) + .complex_op_todo("0-1i", "0.881374-1.570796i", 'acosh', "GH #455" ) + .complex_op_todo("0-0.5i", "0.481212-1.570796i", 'acosh', "GH #455" ) .complex_op_is("0+0.5i", "0.481212+1.570796i", 'acosh' ) .complex_op_is("0+1i", "0.881374+1.570796i", 'acosh' ) .complex_op_is("0+2i", "1.443635+1.570796i", 'acosh' ) .complex_op_is("2+3i", "1.983387+1.000144i", 'acosh' ) - .complex_op_todo("2-3i", "1.983387-1.000144i", 'acosh', "TT #1891" ) + .complex_op_todo("2-3i", "1.983387-1.000144i", 'acosh', "GH #455" ) .complex_op_is("-2+3i", "1.983387+2.141449i", 'acosh' ) - .complex_op_todo("-2-3i", "1.983387-2.141449i", 'acosh', "TT #1891" ) + .complex_op_todo("-2-3i", "1.983387-2.141449i", 'acosh', "GH #455" ) unless has_negative_zero goto todo .complex_op_is("-1+0i", "-0.000000+3.141593i", 'acosh' ) @@ -1466,10 +1466,10 @@ todo: .return() todo: - .complex_op_todo("-1+0i", "-0.000000+3.141593i", 'acosh', 'TT #313' ) - .complex_op_todo("-0.5+0i", "-0.000000+2.094395i", 'acosh', 'TT #313' ) - .complex_op_todo("0.5+0i", "-0.000000+1.047198i", 'acosh', 'TT #313' ) - .complex_op_todo("1+0i", "-0.000000+0.000000i", 'acosh', 'TT #313' ) + .complex_op_todo("-1+0i", "-0.000000+3.141593i", 'acosh', 'GH #366' ) + .complex_op_todo("-0.5+0i", "-0.000000+2.094395i", 'acosh', 'GH #366' ) + .complex_op_todo("0.5+0i", "-0.000000+1.047198i", 'acosh', 'GH #366' ) + .complex_op_todo("1+0i", "-0.000000+0.000000i", 'acosh', 'GH #366' ) .return() .end @@ -1480,7 +1480,7 @@ todo: config_hash = interp[.IGLOBALS_CONFIG_HASH] has_negative_zero = config_hash["has_negative_zero"] - .complex_op_todo("-2+0i", "-0.549306+1.570796i", 'atanh', "TT #1891" ) + .complex_op_todo("-2+0i", "-0.549306+1.570796i", 'atanh', "GH #455" ) .complex_op_is("-0.5+0i", "-0.549306+0.000000i", 'atanh' ) .complex_op_is("0.5+0i", "0.549306+0.000000i", 'atanh' ) .complex_op_is("1+0i", "Inf+0.000000i", 'atanh' ) @@ -1500,12 +1500,12 @@ todo: .return() todo: - .complex_op_todo("0-2i", "-0.000000-1.107149i", 'atanh', 'TT #313' ) - .complex_op_todo("0-1i", "-0.000000-0.785398i", 'atanh', 'TT #313' ) - .complex_op_todo("0-0.5i", "-0.000000-0.463648i", 'atanh', 'TT #313' ) - .complex_op_todo("0+0.5i", "-0.000000+0.463648i", 'atanh', 'TT #313' ) - .complex_op_todo("0+1i", "-0.000000+0.785398i", 'atanh', 'TT #313' ) - .complex_op_todo("0+2i", "-0.000000+1.107149i", 'atanh', 'TT #313' ) + .complex_op_todo("0-2i", "-0.000000-1.107149i", 'atanh', 'GH #366' ) + .complex_op_todo("0-1i", "-0.000000-0.785398i", 'atanh', 'GH #366' ) + .complex_op_todo("0-0.5i", "-0.000000-0.463648i", 'atanh', 'GH #366' ) + .complex_op_todo("0+0.5i", "-0.000000+0.463648i", 'atanh', 'GH #366' ) + .complex_op_todo("0+1i", "-0.000000+0.785398i", 'atanh', 'GH #366' ) + .complex_op_todo("0+2i", "-0.000000+1.107149i", 'atanh', 'GH #366' ) .return() .end @@ -1517,7 +1517,7 @@ todo: has_negative_zero = config_hash["has_negative_zero"] .complex_op_is("-2+0i", "-0.549306+0.000000i", 'acoth' ) - .complex_op_todo("-0.5+0i", "-0.549306+1.570796i", 'acoth', "TT #1891" ) + .complex_op_todo("-0.5+0i", "-0.549306+1.570796i", 'acoth', "GH #455" ) .complex_op_is("0.5+0i", "0.549306-1.570796i", 'acoth' ) .complex_op_is("1+0i", "Inf+0.000000i", 'acoth' ) .complex_op_is("2+0i", "0.549306+0.000000i", 'acoth' ) @@ -1536,12 +1536,12 @@ todo: .return() todo: - .complex_op_todo("0-2i", "-0.000000+0.463648i", 'acoth', 'TT #313' ) - .complex_op_todo("0-1i", "-0.000000+0.785398i", 'acoth', 'TT #313' ) - .complex_op_todo("0-0.5i", "-0.000000+1.107149i", 'acoth', 'TT #313' ) - .complex_op_todo("0+0.5i", "-0.000000-1.107149i", 'acoth', 'TT #313' ) - .complex_op_todo("0+1i", "-0.000000-0.785398i", 'acoth', 'TT #313' ) - .complex_op_todo("0+2i", "-0.000000-0.463648i", 'acoth', 'TT #313' ) + .complex_op_todo("0-2i", "-0.000000+0.463648i", 'acoth', 'GH #366' ) + .complex_op_todo("0-1i", "-0.000000+0.785398i", 'acoth', 'GH #366' ) + .complex_op_todo("0-0.5i", "-0.000000+1.107149i", 'acoth', 'GH #366' ) + .complex_op_todo("0+0.5i", "-0.000000-1.107149i", 'acoth', 'GH #366' ) + .complex_op_todo("0+1i", "-0.000000-0.785398i", 'acoth', 'GH #366' ) + .complex_op_todo("0+2i", "-0.000000-0.463648i", 'acoth', 'GH #366' ) .return() .end @@ -1573,10 +1573,10 @@ todo: .return() todo: - .complex_op_todo("0+1i", "-0.000000-1.570796i", 'acsch', 'TT #313' ) - .complex_op_todo("0+2i", "-0.000000-0.523599i", 'acsch', 'TT #313' ) - .complex_op_todo("0-2i", "-0.000000+0.523599i", 'acsch', 'TT #313' ) - .complex_op_todo("0-1i", "-0.000000+1.570796i", 'acsch', 'TT #313' ) + .complex_op_todo("0+1i", "-0.000000-1.570796i", 'acsch', 'GH #366' ) + .complex_op_todo("0+2i", "-0.000000-0.523599i", 'acsch', 'GH #366' ) + .complex_op_todo("0-2i", "-0.000000+0.523599i", 'acsch', 'GH #366' ) + .complex_op_todo("0-1i", "-0.000000+1.570796i", 'acsch', 'GH #366' ) .return() .end @@ -1588,16 +1588,16 @@ todo: has_negative_zero = config_hash["has_negative_zero"] .complex_op_is("-0.5+0i", "1.316958+3.141593i", 'asech' ) - .complex_op_todo("0.5+0i", "1.316958+0.000000i", 'asech', "TT #1891" ) + .complex_op_todo("0.5+0i", "1.316958+0.000000i", 'asech', "GH #455" ) .complex_op_is("0-2i", "0.481212+1.570796i", 'asech' ) .complex_op_is("0-1i", "0.881374+1.570796i", 'asech' ) .complex_op_is("0-0.5i", "1.443635+1.570796i", 'asech' ) - .complex_op_todo("0+0.5i", "1.443635-1.570796i", 'asech', "TT #1891" ) - .complex_op_todo("0+1i", "0.881374-1.570796i", 'asech', "TT #1891" ) - .complex_op_todo("0+2i", "0.481212-1.570796i", 'asech', "TT #1891" ) - .complex_op_todo("2+3i", "0.231335-1.420411i", 'asech', "TT #1891" ) + .complex_op_todo("0+0.5i", "1.443635-1.570796i", 'asech', "GH #455" ) + .complex_op_todo("0+1i", "0.881374-1.570796i", 'asech', "GH #455" ) + .complex_op_todo("0+2i", "0.481212-1.570796i", 'asech', "GH #455" ) + .complex_op_todo("2+3i", "0.231335-1.420411i", 'asech', "GH #455" ) .complex_op_is("2-3i", "0.231335+1.420411i", 'asech' ) - .complex_op_todo("-2+3i", "0.231335-1.721182i", 'asech', "TT #1891" ) + .complex_op_todo("-2+3i", "0.231335-1.721182i", 'asech', "GH #455" ) .complex_op_is("-2-3i", "0.231335+1.721182i", 'asech' ) unless has_negative_zero goto todo @@ -1608,10 +1608,10 @@ todo: .return() todo: - .complex_op_todo("-2+0i", "-0.000000+2.094395i", 'asech', 'TT #313' ) - .complex_op_todo("-1+0i", "-0.000000+3.141593i", 'asech', 'TT #313' ) - .complex_op_todo("1+0i", "-0.000000+0.000000i", 'asech', 'TT #313' ) - .complex_op_todo("2+0i", "-0.000000+1.047198i", 'asech', 'TT #313' ) + .complex_op_todo("-2+0i", "-0.000000+2.094395i", 'asech', 'GH #366' ) + .complex_op_todo("-1+0i", "-0.000000+3.141593i", 'asech', 'GH #366' ) + .complex_op_todo("1+0i", "-0.000000+0.000000i", 'asech', 'GH #366' ) + .complex_op_todo("2+0i", "-0.000000+1.047198i", 'asech', 'GH #366' ) .return() .end @@ -1643,7 +1643,7 @@ todo: $S0 = concat $S1, ' != ' $S1 = expected $S0 = concat $S0, $S1 - $S0 = concat $S0, ' - subclassing Complex add returns 0+0i - TT #562' + $S0 = concat $S0, ' - subclassing Complex add returns 0+0i - GH #548' $I0 = not $I0 # invert $I0 so todo does not pass todo( $I0, $S0 ) .end diff --git a/t/pmc/context.t b/t/pmc/context.t index 2ceb51a460..d641b08e77 100644 --- a/t/pmc/context.t +++ b/t/pmc/context.t @@ -22,7 +22,7 @@ TODO: Implement real tests when CallContext PMC will be migrated to use ATTRibut .sub main :main .include 'test_more.pir' - plan(20) + plan(19) test_new() @@ -87,10 +87,6 @@ TODO: Implement real tests when CallContext PMC will be migrated to use ATTRibut $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'] diff --git a/t/pmc/exceptionhandler.t b/t/pmc/exceptionhandler.t index dc3f986764..9fe982bb26 100644 --- a/t/pmc/exceptionhandler.t +++ b/t/pmc/exceptionhandler.t @@ -22,7 +22,7 @@ Tests the ExceptionHandler PMC. .include 'test_more.pir' # If test exited with "bad plan" MyHandlerCan.can_handle wasn't invoked. - plan(19) + plan(25) test_bool() test_int() @@ -103,6 +103,8 @@ Tests the ExceptionHandler PMC. pop_eh test_handle_types_except() + test_init_pmc_with_key() + test_all_types() goto init_int @@ -315,6 +317,101 @@ Tests the ExceptionHandler PMC. ok(i, 'type in except is list is not caught') .end +.sub 'test_init_pmc_with_key' + .const int TYPEUSED = .EXCEPTION_UNEXPECTED_NULL + .const int TYPEOTHER = .EXCEPTION_SYNTAX_ERROR + .local int i + .local pmc eh, ex + i = 0 + eh = new [ 'ExceptionHandler' ], [ TYPEUSED ] + set_label eh, catch1 + push_eh eh + ex = new ['Exception'] + ex['type'] = TYPEUSED + throw ex + goto report1 + catch1: + finalize eh + i = 1 + report1: + ok(i, 'exception handler created with one key caught exception') + pop_eh + push_eh report2 + push_eh eh + i = 1 + set_label eh, catch2 + ex = new ['Exception'] + ex['type'] = TYPEOTHER + throw ex + goto report2 + catch2: + i = 0 + report2: + ok(i, 'exception handler created with one key die not catch wrong exception') + pop_eh + pop_eh + i = 0 + eh = new ['ExceptionHandler'], [ TYPEUSED ; TYPEOTHER ] + set_label eh, catch3 + push_eh eh + ex = new ['Exception'] + ex['type'] = TYPEUSED + throw ex + goto report3 + catch3: + finalize eh + i = 1 + report3: + ok(i, 'exception handler created with two keys caught first exception') + i = 0 + set_label eh, catch4 + ex = new ['Exception'] + ex['type'] = TYPEOTHER + throw ex + goto report4 + catch4: + finalize eh + i = 1 + report4: + ok(i, 'exception handler created with two keys caught second exception') + pop_eh +.end + +.sub 'test_all_types' + .const int TYPEUSED = .EXCEPTION_UNEXPECTED_NULL + .const int CTRLTYPEUSED = .CONTROL_RETURN + .local int i + .local pmc eh, ex + i = 0 + eh = new [ 'ExceptionHandler' ], [ .EXCEPTION_ALL] + set_label eh, catch1 + push_eh eh + ex = new ['Exception'] + ex['type'] = TYPEUSED + throw ex + goto report1 + catch1: + finalize eh + i = 1 + report1: + ok(i, 'exception handler for EXCEPTION_ALL caught') + pop_eh + push_eh report2 + push_eh eh + i = 1 + set_label eh, catch2 + ex = new ['Exception'] + ex['type'] = CTRLTYPEUSED + throw ex + goto report2 + catch2: + i = 0 + report2: + ok(i, 'exception handler for EXCEPTION_ALL did not catch control exception') + pop_eh + pop_eh +.end + # Local Variables: # mode: pir # fill-column: 100 diff --git a/t/pmc/exporter.t b/t/pmc/exporter.t index 13aaaab6cd..8dbc156062 100644 --- a/t/pmc/exporter.t +++ b/t/pmc/exporter.t @@ -52,7 +52,7 @@ pir_output_is( <<'CODE', <<'OUT', 'source' ); say 'ok 1 - source() returns PMCNULL upon Exporter init' # get a NameSpace PMC for testing - # TT #1233 replace with make_namespace, when implemented + # GH #591 replace with make_namespace, when implemented .local pmc ns ns = get_namespace ['Eponymous'] @@ -83,7 +83,7 @@ pir_output_is( <<'CODE', <<'OUT', 'source' ); .end -# TT #1233 replace with make_namespace, when implemented +# GH #591 replace with make_namespace, when implemented .namespace ['Eponymous'] .sub 'Eponymous' :anon .end @@ -110,7 +110,7 @@ pir_output_is( <<'CODE', <<'OUT', 'destination' ); say 'ok 2 - ...which is current namespace at first' # get a NameSpace PMC for testing - # TT #1233 replace with make_namespace, when implemented + # GH #591 replace with make_namespace, when implemented .local pmc ns ns = get_namespace ['Eponymous'] @@ -141,7 +141,7 @@ pir_output_is( <<'CODE', <<'OUT', 'destination' ); .end -# TT #1233 replace with make_namespace, when implemented +# GH #591 replace with make_namespace, when implemented .namespace ['Eponymous'] .sub 'Eponymous' :anon .end @@ -462,8 +462,8 @@ CODE ok 1 OUT -# Test exporting mmd subs: TT #1205 -# https://trac.parrot.org/parrot/ticket/1205 +# Test exporting mmd subs: GH #542 +# https://github.com/parrot/parrot/issues/542 # Local Variables: # mode: cperl diff --git a/t/pmc/filehandle.t b/t/pmc/filehandle.t index 1038166ed8..14a904425d 100644 --- a/t/pmc/filehandle.t +++ b/t/pmc/filehandle.t @@ -167,7 +167,7 @@ SKIP: { pir_output_is( <<'CODE', <<'OUT', 'open and close - asynchronous' ); .sub 'test' :main - $P1 = # TT #1204 create a callback here + $P1 = # GH #535 create a callback here $P0 = new ['FileHandle'] $P0.'open'('README') @@ -384,9 +384,9 @@ ok 1 - read 10,000 lines OUT -# TT #1204 test reading long chunks, eof, and across newlines +# GH #535 test reading long chunks, eof, and across newlines -# TT #1204 pir_output_is( <<'CODE', <<'OUT', 'print, read, and readline - asynchronous', todo => 'not yet implemented' ); +# GH #535 pir_output_is( <<'CODE', <<'OUT', 'print, read, and readline - asynchronous', todo => 'not yet implemented' ); # L pir_output_is( <<"CODE", <<'OUT', 'record_separator' ); @@ -488,9 +488,9 @@ ok 2 - $S0 = $P1.buffer_type() # line-buffered ok 3 - $S0 = $P1.buffer_type() # full-buffered OUT -# TT #1204 test effects of buffer_type, not just set/get +# GH #535 test effects of buffer_type, not just set/get -# TT #1177 +# GH #458 # L # NOTES: try setting positive, zero, negative int # perform print and read ops @@ -823,7 +823,7 @@ expect 1 exit status: 1 OUTPUT SKIP: { - skip 'Timely destruction is deprecated. TT#1800' => 1; + skip 'Timely destruction is deprecated. GH #278' => 1; pir_output_is( sprintf(<<'CODE', $temp_file), <<'OUTPUT', "timely destruction" ); .const string temp_file = '%s' @@ -1070,7 +1070,7 @@ CODE 1 OUT -# TT #1178 +# GH #465 # L # NOTES: this is going to be platform dependent diff --git a/t/pmc/fixedbooleanarray.t b/t/pmc/fixedbooleanarray.t index 3d4df78e1a..60debc5164 100644 --- a/t/pmc/fixedbooleanarray.t +++ b/t/pmc/fixedbooleanarray.t @@ -19,7 +19,7 @@ out-of-bounds test. Checks INT and PMC keys. .sub 'test' :main .include 'test_more.pir' - plan(41) + plan(42) setting_array_size() resizing_not_allowed() @@ -38,6 +38,7 @@ out-of-bounds test. Checks INT and PMC keys. fill() test_new_style_init() test_invalid_init_tt1509() + test_get_string() .end .sub 'setting_array_size' @@ -361,6 +362,13 @@ CODE CODE .end +.sub test_get_string + $P0 = new 'FixedBooleanArray', 2 + $P0[1] = 1 + $S0 = $P0 + is($S0, '01', 'converts to string') +.end + # Local Variables: # mode: pir # fill-column: 100 diff --git a/t/pmc/fixedfloatarray.t b/t/pmc/fixedfloatarray.t index ec6df533b5..529c82382e 100644 --- a/t/pmc/fixedfloatarray.t +++ b/t/pmc/fixedfloatarray.t @@ -19,7 +19,7 @@ out-of-bounds test. Checks INT and PMC keys. .sub main :main .include 'fp_equality.pasm' .include 'test_more.pir' - plan(30) + plan(32) array_size_tests() element_set_tests() @@ -31,6 +31,7 @@ out-of-bounds test. Checks INT and PMC keys. get_iter_test() test_new_style_init() test_invalid_init_tt1509() + test_get_string() .end .sub array_size_tests @@ -272,6 +273,17 @@ CODE CODE .end +.sub test_get_string + $P0 = new 'FixedFloatArray', 3 + $P0[0] = -1.5 + $P0[1] = 0 + $P0[2] = 3.14 + $S0 = $P0 + is($S0, '[ -1.5, 0, 3.14 ]', 'converts to string') + $S0 = get_repr $P0 + is($S0, '[ -1.5, 0, 3.14 ]', 'has string representation') +.end + # Local Variables: # mode: pir # fill-column: 100 diff --git a/t/pmc/fixedintegerarray.t b/t/pmc/fixedintegerarray.t index e8a89cd776..ce84d31e65 100644 --- a/t/pmc/fixedintegerarray.t +++ b/t/pmc/fixedintegerarray.t @@ -264,6 +264,8 @@ out-of-bounds test. Checks INT and PMC keys. a1[1] = 1 r = get_repr a1 is(r, '[ 7, 1 ]', 'get_repr') + r = a1 + is(r, '[ 7, 1 ]', 'get_string') .end .sub 'test_new_style_init' diff --git a/t/pmc/fixedpmcarray.t b/t/pmc/fixedpmcarray.t index d8589da7d0..92d0df4222 100644 --- a/t/pmc/fixedpmcarray.t +++ b/t/pmc/fixedpmcarray.t @@ -20,11 +20,8 @@ out-of-bounds test. Checks INT and PMC keys. .sub main :main .include 'test_more.pir' - plan(88) + plan(86) test_setting_array_size() - test_assign_from_another() - test_assign_self() - test_assign_non_array() test_resize_exception() test_truthiness() test_tt991() @@ -41,6 +38,7 @@ out-of-bounds test. Checks INT and PMC keys. test_definedness() test_splice_oob() test_get_repr() + test_get_string() test_elements() test_equality() test_multi_keys() @@ -356,10 +354,18 @@ out-of-bounds test. Checks INT and PMC keys. .end .sub get_repr_fpa_n + .param int n + .local pmc fpa + .local string s + fpa = fpa_n(n) + s = get_repr fpa + .return(s) +.end + +.sub fpa_n .param int n .local int i .local pmc fpa, p - .local string s fpa = new ['FixedPMCArray'] fpa = n i = 0 @@ -370,8 +376,24 @@ next: inc i goto next done: - s = get_repr fpa - .return(s) + .return (fpa) +.end + +.sub test_get_string + .local string s, aux + .local pmc a + a = fpa_n(0) + s = a + a = fpa_n(1) + aux = a + s = concat s, aux + a = fpa_n(2) + aux = a + s = concat s, aux + a = fpa_n(3) + aux = a + s = concat s, aux + substring(s,'0123','get_string') .end .sub test_splice_oob @@ -664,37 +686,6 @@ CODE CODE .end -.sub test_assign_non_array - throws_substring(<<'CODE', "Can't set self from this type",'assign from non-array') - .sub main :main - .local pmc arr, other - .local int n - arr = new ['FixedPMCArray'] - other = new ['Integer'] - assign arr, other - .end -CODE -.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'] diff --git a/t/pmc/float.t b/t/pmc/float.t index 3fc822662e..1673c608fe 100644 --- a/t/pmc/float.t +++ b/t/pmc/float.t @@ -432,7 +432,7 @@ Tests the Float PMC. .return () negative_zero_todoed: - todo(0, '-0.0 not implemented, TT #313') + todo(0, '-0.0 not implemented, GH #366') .end .sub 'equality' diff --git a/t/pmc/freeze.t b/t/pmc/freeze.t index b1bc87a064..c318cd63c9 100644 --- a/t/pmc/freeze.t +++ b/t/pmc/freeze.t @@ -163,7 +163,7 @@ pasm_output_is( <<'CODE', <<'OUTPUT', "freeze/thaw a Integer with prop" ); set I11, P10 print I11 print "\n" - getprop P12, "answer", P10 + getprop P12, P10, "answer" print P12 print "\n" end @@ -200,7 +200,7 @@ pasm_output_is( <<'CODE', <<'OUTPUT', "freeze/thaw Array w Integer with prop" ); set P13, P10[1] print P13 print "\n" - getprop P12, "answer", P12 + getprop P12, P12, "answer" print P12 print "\n" end diff --git a/t/pmc/hash.t b/t/pmc/hash.t index 19434bd4a8..f2e9062d8e 100644 --- a/t/pmc/hash.t +++ b/t/pmc/hash.t @@ -75,6 +75,9 @@ well. equality_tests() pmc_keys() + update() + update_mixed() + lexed_key() 'done_testing'() .end @@ -1513,6 +1516,62 @@ postit_end: is ($P1, 42, "hashvalue was invoked") .end +# test the update method +.sub 'update' + .local pmc hash1, hash2, hash3 + hash1 = new ['Hash'] + hash2 = new ['Hash'] + hash3 = new ['Hash'] + hash1['one'] = "Hello Parrot!" + hash1['two'] = 1664 + hash1['three'] = 2.718 + hash2['three'] = "3.141" + hash2['four'] = "vier" + hash3['four'] = "vier" + hash3['three'] = "3.141" + hash3['two'] = 1664 + hash3['one'] = "Hello Parrot!" + hash1."update"(hash2) + $I0 = elements hash1 + is($I0, 4, "Got 4 elements in Hash after update") + is(hash1, hash3, 'update worked') +.end + +.sub 'update_mixed' + .local pmc hash1, hash2, hash3 + hash1 = new ['Hash'] + hash1 = .Hash_key_type_int + hash1.'set_value_type'(.DATATYPE_INTVAL) + hash2 = new ['Hash'] + hash2 = .Hash_key_type_PMC + hash2.'set_value_type'(.DATATYPE_STRING) + hash3 = new ['Hash'] + hash3 = .Hash_key_type_int + hash3.'set_value_type'(.DATATYPE_INTVAL) + hash1[1] = "42" + hash1[2] = 1664 + hash1[3] = 2.718 + hash2["3"] = "3.141" + hash2["4"] = "4" + hash3[4] = 4 + hash3[3] = 3 + hash3[2] = 1664 + hash3[1] = 42 + hash1."update"(hash2) + $I0 = elements hash1 + is($I0, 4, "Got 4 elements in Hash after update") + is(hash1, hash3, 'update_mixed worked') +.end + +.sub 'lexed_key' + .lex "$key", $S0 + $S0 = "hello" + $P0 = new ['Hash'] + set $P0[$S0], "TEST" + $S1 = $P0["hello"] + is($S1, 'TEST', 'access with a lexed key works') +.end + .namespace ['Foo'] .sub '' :method :vtable('hashvalue') $P0 = box 42 diff --git a/t/pmc/io.t b/t/pmc/io.t index fbcf2b13f2..3b06af115b 100644 --- a/t/pmc/io.t +++ b/t/pmc/io.t @@ -381,7 +381,7 @@ CODE Successful OUTPUT -# TT #1178 +# GH #465 pir_output_is( <<'CODE', <<'OUT', 'standard file descriptors' ); .sub main :main $P99 = getinterp @@ -409,34 +409,34 @@ ok 2 ok 3 OUT -pir_output_is( <<'CODE', <<'OUTPUT', 'puts method' ); +pir_output_is( <<'CODE', <<'OUTPUT', 'print method' ); .sub main :main $P0 = getinterp $P2 = $P0.'stdout_handle'() - can $I0, $P2, "puts" + can $I0, $P2, "print" if $I0, ok1 print "not " ok1: print "ok 1\n" set_args "0,0", $P2, "ok 2\n" - callmethodcc $P2, "puts" + callmethodcc $P2, "print" .end CODE ok 1 ok 2 OUTPUT -pir_output_is( <<'CODE', <<'OUTPUT', 'puts method - PIR' ); +pir_output_is( <<'CODE', <<'OUTPUT', 'print method - PIR' ); .sub main :main .local string s s = "ok 2\n" .local pmc io $P0 = getinterp io = $P0.'stdout_handle'() - $I0 = can io, "puts" + $I0 = can io, "print" if $I0 goto ok1 print "not " ok1: print "ok 1\n" - io."puts"(s) + io."print"(s) .end CODE @@ -444,14 +444,14 @@ ok 1 ok 2 OUTPUT -pasm_output_is( <<'CODE', <<'OUTPUT', 'callmethod puts' ); +pasm_output_is( <<'CODE', <<'OUTPUT', 'callmethod print' ); .pcc_sub :main main: getinterp P0 # invocant set_args "0", P0 callmethodcc P0, "stderr_handle" get_results "0", P2 # STDERR - set S0, "puts" # method + set S0, "print" # method set S5, "ok 1\n" # 2nd param set_args "0,0", P2, S5 callmethodcc P2, S0 diff --git a/t/pmc/io_iterator.t b/t/pmc/io_iterator.t index c3194e6029..32863bd7c5 100644 --- a/t/pmc/io_iterator.t +++ b/t/pmc/io_iterator.t @@ -24,7 +24,7 @@ Tests the I/O Iterator PMC described in PDD22. # L pir_output_is( <<'CODE', <<'OUT', 'new', todo => 'not yet implemented' ); .sub 'test' :main - $P99 = 1 # TT #1242 replace with io object + $P99 = 1 # GH #633 replace with io object $P0 = iter $P99 say "ok 1 - $P0 = iter $P1" .end @@ -33,9 +33,9 @@ ok 1 - $P0 = iter $P1 OUT # L -pir_output_is( <<'CODE', <<'OUT', 'shift', todo => 'not yet implemented: TT #1206' ); +pir_output_is( <<'CODE', <<'OUT', 'shift', todo => 'not yet implemented: GH #549' ); .sub 'test' :main - $P99 = 1 # TT #1242 replace with io object + $P99 = 1 # GH #633 replace with io object $P0 = iter $P99 $S0 = shift $P0 @@ -45,7 +45,7 @@ pir_output_is( <<'CODE', <<'OUT', 'shift', todo => 'not yet implemented: TT #120 ok_1: say 'ok 1 - $S0 = shift $P1 # success' - # TT #1206 test more return values, including end of file + # GH #549 test more return values, including end of file .end CODE ok 1 - $I0 = shift $P1 # success @@ -54,7 +54,7 @@ OUT # L pir_output_is( <<'CODE', <<'OUT', 'get_bool (vtable)', todo => 'not yet implemented' ); .sub 'test' :main - $P99 = 1 # TT #1242 replace with io object + $P99 = 1 # GH #633 replace with io object $P0 = iter $P99 # empty i/o object @@ -63,7 +63,7 @@ pir_output_is( <<'CODE', <<'OUT', 'get_bool (vtable)', todo => 'not yet implemen ok_1: say 'ok 1 - $P0 # empty i/o object returns false' - # TT #1242 setup i/o object with two lines + # GH #633 setup i/o object with two lines if $P0 got ok_2 print 'not ' ok_2: diff --git a/t/pmc/iterator.t b/t/pmc/iterator.t index e59bec27a2..ac797b27f0 100644 --- a/t/pmc/iterator.t +++ b/t/pmc/iterator.t @@ -34,7 +34,7 @@ CODE ok 1 OUTPUT -pasm_output_is( <<'CODE', <<'OUTPUT', "new iter fails (init)" ); +pasm_output_is( <<'CODE', <<'OUTPUT', "old-style Iterator now disallowed" ); .pcc_sub :main main: push_eh THROWN new P0, ['ResizablePMCArray'] diff --git a/t/pmc/lexpad.t b/t/pmc/lexpad.t index 2a9de267d1..da8515a5ff 100644 --- a/t/pmc/lexpad.t +++ b/t/pmc/lexpad.t @@ -18,12 +18,13 @@ Tests the LexPad PMC. .sub main :main .include 'test_more.pir' - plan(9) + plan(14) new_test() test_keyed() test_keyed_empty() test_iter() + test_register_type() .end .sub new_test @@ -102,6 +103,32 @@ iter_loop: iter_done: .end +.sub 'test_register_type' + .local int i + .local num n, type + .local string s + .local pmc pad, p + + .lex 'I', i + .lex 'N', n + .lex 'S', s + .lex 'P', p + + pad = getinterp + pad = pad['lexpad'] + + type = pad.'register_type'('?') + is(type, -1, 'type for non-existant lexical') + type = pad.'register_type'('I') + is(type, 0, 'type for integer lexical') + type = pad.'register_type'('N') + is(type, 1, 'type for num lexical') + type = pad.'register_type'('S') + is(type, 2, 'type for string lexical') + type = pad.'register_type'('P') + is(type, 3, 'type for PMC lexical') +.end + # Local Variables: # mode: pir # fill-column: 100 diff --git a/t/pmc/managedstruct.t b/t/pmc/managedstruct.t index 389c1ffc32..675e561361 100644 --- a/t/pmc/managedstruct.t +++ b/t/pmc/managedstruct.t @@ -92,7 +92,7 @@ Tests the ManagedStruct PMC. Checks element access and memory allocation. is($I0, 1, "char val of 1 is correct") set $I0, $P0[0;1] is($I0, 2, "char val of 258 retrieved as 2") - # now acces that as a short + # now access that as a short new $P2, ['ResizablePMCArray'] push $P2, .DATATYPE_SHORT push $P2, 1 diff --git a/t/pmc/mappedbytearray.t b/t/pmc/mappedbytearray.t index 37aa53fb26..8483e84e5c 100644 --- a/t/pmc/mappedbytearray.t +++ b/t/pmc/mappedbytearray.t @@ -80,7 +80,7 @@ Tests the MappedByteArray PMC. mm = new ['MappedByteArray'], filename $I0 = elements mm - # The test file is one line of text, and line ending may have beeen + # The test file is one line of text, and line ending may have been # converted, so the lenght can be one byte different. $I1 = $I0 == 43 $I2 = $I0 == 44 @@ -90,7 +90,7 @@ Tests the MappedByteArray PMC. $I1 = mm."close"() is( $I1, 0, 'Closed and unmapped testfile' ) - throws_substring(<<'CODE', 'cannot open file', 'mmap a nonexistant file') + throws_substring(<<'CODE', 'cannot open file', 'mmap a nonexistent file') .sub main $P0 = new ['String'] $P0 = "wezwuyebgjuzmhewrugnjzrg" diff --git a/t/pmc/multidispatch.t b/t/pmc/multidispatch.t index bc88e3d0f3..dd2a047156 100644 --- a/t/pmc/multidispatch.t +++ b/t/pmc/multidispatch.t @@ -640,7 +640,7 @@ PSt ok 3 String ok 4 OUT -pir_output_is( <<'CODE', <<'OUT', "MMD on PMC types - Any", todo => 'TT #1320' ); +pir_output_is( <<'CODE', <<'OUT', "MMD on PMC types - Any", todo => 'GH #328' ); .sub main :main $P0 = new ['String'] @@ -726,7 +726,7 @@ CODE 42 OUTPUT -pir_output_is( <<'CODE', <<'OUTPUT', "add as method - inherited", todo => 'TT #1320' ); +pir_output_is( <<'CODE', <<'OUTPUT', "add as method - inherited", todo => 'GH #328' ); .sub main :main .local pmc d, l, r .local pmc pint diff --git a/t/pmc/namespace-old.t b/t/pmc/namespace-old.t index 41a0284cbe..c3b2a947ed 100644 --- a/t/pmc/namespace-old.t +++ b/t/pmc/namespace-old.t @@ -1251,7 +1251,7 @@ Could not find sub nok/ OUT -pir_output_is( <<'CODE', <<'OUT', 'HLL_map on namespace', todo => 'TT #867'); +pir_output_is( <<'CODE', <<'OUT', 'HLL_map on namespace', todo => 'GH #404'); .HLL 'tcl' .sub 'foo' :anon :init diff --git a/t/pmc/namespace.t b/t/pmc/namespace.t index eb4004a2e1..a4ca9adc7b 100644 --- a/t/pmc/namespace.t +++ b/t/pmc/namespace.t @@ -252,7 +252,7 @@ Although NameSpace.'export_to'() is used in test_more.pir. # This value must be hardcoded here, update the test if the # vtable numbers change - .const int I_VTABLE_GET_STRING = 76 + .const int I_VTABLE_GET_STRING = 75 $P0 = get_namespace ["WithVtable"] $P1 = $P0[I_VTABLE_GET_STRING] $I0 = isnull $P1 diff --git a/t/pmc/nci.t b/t/pmc/nci.t index c8b1c6fed7..80a201f5cf 100644 --- a/t/pmc/nci.t +++ b/t/pmc/nci.t @@ -394,7 +394,7 @@ libnci_test was successfully loaded -4444 OUTPUT - pir_output_is( << 'CODE', << "OUTPUT", "nci_s - return a short in an INTEGER register" ); + pir_output_is( << 'CODE', << 'OUTPUT', 'nci_s - return a short in an INTEGER register' ); .include "datatypes.pasm" @@ -486,7 +486,7 @@ libnci_test was successfully loaded OUTPUT } - pasm_output_is( <<'CODE', <<'OUTPUT', "nci_dd - PASM" ); + pasm_output_is( <<'CODE', <<'OUTPUT', 'nci_dd - PASM' ); .pcc_sub :main main: loadlib P1, "libnci_test" print "loaded\n" @@ -508,7 +508,7 @@ dlfunced ok 1 OUTPUT - pir_output_is( << 'CODE', << 'OUTPUT', "nci_dd - PIR" ); + pir_output_is( << 'CODE', << 'OUTPUT', 'nci_dd - PIR' ); .sub test :main .local string library_name @@ -531,7 +531,7 @@ libnci_test was successfully loaded -8.256 OUTPUT - pir_output_is( << 'CODE', << "OUTPUT", "get_string()" ); + pir_output_is( << 'CODE', << 'OUTPUT', 'get_string()' ); .sub test :main .local string library_name @@ -556,7 +556,7 @@ CODE libnci_test was successfully loaded OUTPUT - pasm_output_is( <<'CODE', <<'OUTPUT', "nci_fff" ); + pasm_output_is( <<'CODE', <<'OUTPUT', 'nci_fff' ); .pcc_sub :main main: loadlib P1, "libnci_test" print "loaded\n" @@ -580,7 +580,7 @@ dlfunced ok 1 OUTPUT - pasm_output_is( <<'CODE', <<'OUTPUT', "nci_isc" ); + pasm_output_is( <<'CODE', <<'OUTPUT', 'nci_isc' ); .pcc_sub :main main: loadlib P1, "libnci_test" print "loaded\n" @@ -604,7 +604,7 @@ dlfunced ok 1 OUTPUT - pasm_output_is( <<'CODE', <<'OUTPUT', "nci_ssc" ); + pasm_output_is( <<'CODE', <<'OUTPUT', 'nci_ssc' ); .pcc_sub :main main: loadlib P1, "libnci_test" print "loaded\n" @@ -628,7 +628,7 @@ dlfunced ok 1 OUTPUT - pasm_output_is( <<'CODE', <<'OUTPUT', "nci_csc" ); + pasm_output_is( <<'CODE', <<'OUTPUT', 'nci_csc' ); .pcc_sub :main main: loadlib P1, "libnci_test" print "loaded\n" @@ -652,7 +652,7 @@ dlfunced ok 1 OUTPUT - pasm_output_is( <<'CODE', <<'OUTPUT', "nci_dd - stress test" ); + pasm_output_is( <<'CODE', <<'OUTPUT', 'nci_dd - stress test' ); .pcc_sub :main main: loadlib P1, "libnci_test" print "loaded\n" @@ -681,7 +681,7 @@ dlfunced ok 1 OUTPUT - pasm_output_is( <<'CODE', <<'OUTPUT', "nci_dd - clone" ); + pasm_output_is( <<'CODE', <<'OUTPUT', 'nci_dd - clone' ); .pcc_sub :main main: loadlib P1, "libnci_test" print "loaded\n" @@ -710,7 +710,7 @@ ok 1 ok 2 OUTPUT - pasm_output_is( <<'CODE', <<'OUTPUT', "nci_iiii" ); + pasm_output_is( <<'CODE', <<'OUTPUT', 'nci_iiii' ); .pcc_sub :main main: loadlib P1, "libnci_test" dlfunc P0, P1, "nci_iiii", "iiii" @@ -728,7 +728,7 @@ CODE 2 OUTPUT - pasm_output_is( <<'CODE', <<'OUTPUT', "nci_pi - struct with ints" ); + pasm_output_is( <<'CODE', <<'OUTPUT', 'nci_pi - struct with ints' ); .pcc_sub :main main: loadlib P1, "libnci_test" dlfunc P0, P1, "nci_pi", "pi" @@ -762,7 +762,7 @@ CODE 66 OUTPUT - pasm_output_is( <<'CODE', <<'OUTPUT', "nci_pi - struct with floats" ); + pasm_output_is( <<'CODE', <<'OUTPUT', 'nci_pi - struct with floats' ); .pcc_sub :main main: loadlib P1, "libnci_test" dlfunc P0, P1, "nci_pi", "pi" @@ -795,7 +795,7 @@ CODE 47.11 OUTPUT - pasm_output_like( <<'CODE', <<'OUTPUT', "nci_pi - align" ); + pasm_output_like( <<'CODE', <<'OUTPUT', 'nci_pi - align' ); .pcc_sub :main main: loadlib P1, "libnci_test" dlfunc P0, P1, "nci_pi", "pi" @@ -830,7 +830,7 @@ CODE / OUTPUT - pasm_output_is( <<'CODE', <<'OUTPUT', "nci_pi - char*" ); + pasm_output_is( <<'CODE', <<'OUTPUT', 'nci_pi - char*' ); .pcc_sub :main main: loadlib P1, "libnci_test" dlfunc P0, P1, "nci_pi", "pi" @@ -859,7 +859,7 @@ hello 20 OUTPUT - pasm_output_is( <<'CODE', <<'OUTPUT', "nci_pi - nested struct *" ); + pasm_output_is( <<'CODE', <<'OUTPUT', 'nci_pi - nested struct *' ); .pcc_sub :main main: loadlib P1, "libnci_test" dlfunc P0, P1, "nci_pi", "pi" @@ -915,7 +915,7 @@ CODE 200 OUTPUT - pasm_output_is( <<'CODE', <<'OUTPUT', "nci_pi - nested struct * w named access" ); + pasm_output_is( <<'CODE', <<'OUTPUT', 'nci_pi - nested struct * w named access' ); .pcc_sub :main main: loadlib P1, "libnci_test" dlfunc P0, P1, "nci_pi", "pi" @@ -1021,7 +1021,7 @@ hello call_back 4711 OUTPUT - pasm_output_is( <<'CODE', <<'OUTPUT', "nci_pi - nested struct aligned" ); + pasm_output_is( <<'CODE', <<'OUTPUT', 'nci_pi - nested struct aligned' ); .pcc_sub :main main: loadlib P1, "libnci_test" dlfunc P0, P1, "nci_pi", "pi" @@ -1077,7 +1077,7 @@ CODE 33 OUTPUT - pasm_output_is( <<'CODE', <<'OUTPUT', "nci_pi - nested struct unaligned" ); + pasm_output_is( <<'CODE', <<'OUTPUT', 'nci_pi - nested struct unaligned' ); .pcc_sub :main main: loadlib P1, "libnci_test" dlfunc P0, P1, "nci_pi", "pi" @@ -1133,7 +1133,7 @@ CODE 33 OUTPUT - pasm_output_is( <<'CODE', <<'OUTPUT', "nci_pi - nested, unaligned, named" ); + pasm_output_is( <<'CODE', <<'OUTPUT', 'nci_pi - nested, unaligned, named' ); .pcc_sub :main main: loadlib P1, "libnci_test" dlfunc P0, P1, "nci_pi", "pi" @@ -1226,7 +1226,7 @@ libnci_test was successfully loaded 55555 OUTPUT - pasm_output_is( <<'CODE', <<'OUTPUT', "nci_ip" ); + pasm_output_is( <<'CODE', <<'OUTPUT', 'nci_ip' ); .pcc_sub :main main: loadlib P1, "libnci_test" dlfunc P0, P1, "nci_ip", "ip" @@ -1289,7 +1289,7 @@ CODE got null OUTPUT - pasm_output_is( <<'CODE', <<'OUTPUT', "nci_vP", todo => 'Disabled to avoid linkage problems, see src/nci_test.c' ); + pasm_output_is( <<'CODE', <<'OUTPUT', 'nci_vP', todo => 'Disabled to avoid linkage problems, see src/nci_test.c' ); .pcc_sub :main main: loadlib P1, "libnci_test" dlfunc P0, P1, "nci_vP", "vP" @@ -1306,11 +1306,7 @@ ok got null OUTPUT - # Tests with callback functions - my @todo = $ENV{TEST_PROG_ARGS} =~ /--runcore=jit/ ? - ( todo => 'TT #1316, add scheduler tasks to JIT' ) : (); - - pasm_output_is( <<'CODE', <<'OUTPUT', "nci_cb_C1 - PASM", @todo ); + pasm_output_is( <<'CODE', <<'OUTPUT', 'nci_cb_C1 - PASM' ); .pcc_sub :main main: # we need a flag if the call_back is already done @@ -1370,7 +1366,7 @@ external data: succeeded done. OUTPUT - pir_output_is( <<'CODE', <<'OUTPUT', "nci_cb_C1 - PIR", @todo ); + pir_output_is( <<'CODE', <<'OUTPUT', "nci_cb_C1 - PIR" ); .sub test :main @@ -1444,7 +1440,7 @@ external data: succeeded the callback has run OUTPUT - pasm_output_is( <<'CODE', <<'OUTPUT', "nci_cb_C2 - PASM", @todo ); + pasm_output_is( <<'CODE', <<'OUTPUT', 'nci_cb_C2 - PASM' ); .pcc_sub :main main: # we need a flag if the call_back is already done new P10, ['Integer'] @@ -1504,7 +1500,7 @@ external data: 77 done. OUTPUT - pir_output_is( <<'CODE', <<'OUTPUT', "nci_cb_C3 - PIR", @todo ); + pir_output_is( <<'CODE', <<'OUTPUT', "nci_cb_C3 - PIR" ); .include "datatypes.pasm" @@ -1591,7 +1587,7 @@ external data: 99 the callback has run OUTPUT - pasm_output_is( <<'CODE', <<'OUTPUT', "nci_cb_D1 - PASM", @todo ); + pasm_output_is( <<'CODE', <<'OUTPUT', 'nci_cb_D1 - PASM' ); .pcc_sub :main main: # we need a flag if the call_back is already done @@ -1651,7 +1647,7 @@ external data: succeeded done. OUTPUT - pasm_output_is( <<'CODE', <<'OUTPUT', "nci_cb_D2 - PASM", @todo ); + pasm_output_is( <<'CODE', <<'OUTPUT', 'nci_cb_D2 - PASM' ); .pcc_sub :main main: # we need a flag if the call_back is already done new P10, ['Integer'] @@ -1711,7 +1707,7 @@ external data: 88 done. OUTPUT - pir_output_is( <<'CODE', <<'OUTPUT', "nci_cb_D2 - PIR", @todo ); + pir_output_is( <<'CODE', <<'OUTPUT', "nci_cb_D2 - PIR" ); .sub test :main @@ -1785,7 +1781,7 @@ external data: 88 the callback has run OUTPUT - pir_output_is( <<'CODE', <<'OUTPUT', "nci_cb_D3 - PIR", @todo ); + pir_output_is( <<'CODE', <<'OUTPUT', "nci_cb_D3 - PIR" ); .include "datatypes.pasm" @@ -1913,8 +1909,23 @@ OUTPUT .local pmc nci_cb_D4 nci_cb_D4 = dlfunc libnci_test, "nci_cb_D4", "vpP" print "loaded a function that takes a callback\n" + # This test might fail if we ever implement preemption of NCI calls + # since callbacks could start running before the 10 increments are done nci_cb_D4( cb_wrapped, user_data ) + # Wait till all async callbacks are done + .local int current +wait: + # Give the scheduler a point to interrupt this Task + # and switch to the asynchonous callback Task + pass + + # Usually a single pass will be enough, but on a loaded system preemption + # can interrupt an async callback and we would start the next test too + # early + current = int_cb_D4[0] + if current < 1000000000 goto wait + # reset int_cb_D4 to 1 int_cb_D4[0] = 1 @@ -2344,7 +2355,7 @@ libnci_test was successfully loaded 'non_existing' is not defined OUTPUT - pasm_output_is( << 'CODE', << 'OUTPUT', "loading same library twice" ); + pasm_output_is( << 'CODE', << 'OUTPUT', 'loading same library twice' ); .pcc_sub :main main: loadlib P1, "libnci_test" if P1, OK1 diff --git a/t/pmc/object-meths.t b/t/pmc/object-meths.t index 5df37f0ace..5c0e9a2519 100644 --- a/t/pmc/object-meths.t +++ b/t/pmc/object-meths.t @@ -5,7 +5,7 @@ use strict; use warnings; use lib qw( . lib ../lib ../../lib ); use Test::More; -use Parrot::Test tests => 39; +use Parrot::Test tests => 38; =head1 NAME @@ -250,7 +250,7 @@ pir_output_is( <<'CODE', <<'OUTPUT', "methods: self" ); .local pmc B print "A::foo\n" - getprop B, "B", self + getprop B, self, "B" self."blah"() B."blah"() @@ -648,30 +648,6 @@ CODE ok OUTPUT -pir_output_is( <<'CODE', <<'OUTPUT', "self - CURRENT_OBJECT" ); - -.sub _main :main - .local pmc A - - newclass A, "A" - new A, ['A'] - A."foo"() - end -.end - -.namespace ["A"] - -.sub foo :method - .include "interpinfo.pasm" - $P0 = interpinfo .INTERPINFO_CURRENT_OBJECT - eq_addr self, $P0, ok - print "not " -ok: print "ok\n" -.end -CODE -ok -OUTPUT - pir_output_is( <<'CODE', <<'OUTPUT', "Bug in method calling with nonconst keys" ); .sub _main :main diff --git a/t/pmc/opcode.t b/t/pmc/opcode.t index 40e467bd90..4e2b65dc51 100644 --- a/t/pmc/opcode.t +++ b/t/pmc/opcode.t @@ -52,7 +52,7 @@ CODE set $I1, op[100] is($I0, 2, 'get_integer_keyed_int returns valid type enum.') - is($I1, -1, 'get_integer_keyed_int nonexistant parameter type') + is($I1, -1, 'get_integer_keyed_int nonexistent parameter type') .end .sub get_data diff --git a/t/pmc/packfile.t b/t/pmc/packfile.t index 859dcf022a..edf752838b 100644 --- a/t/pmc/packfile.t +++ b/t/pmc/packfile.t @@ -35,7 +35,7 @@ Tests the Packfile PMC. 'test_pack_fresh_packfile'() 'test_pack'() - skip(2, "test_synonyms crash on many platforms. See TT #545") + skip(2, "test_synonyms crash on many platforms. See GH #514") # 'test_synonyms'() .end @@ -380,7 +380,7 @@ load_error: # $P1 = new ['FileHandle'] # $P1.'open'("/tmp/1.pbc", "w") - # $P1.'puts'($S0) + # $P1.'print'($S0) # $P1.'close'() pf = new 'Packfile' diff --git a/t/pmc/packfileconstanttable.t b/t/pmc/packfileconstanttable.t index a2da8e16c2..e1f566bc8d 100644 --- a/t/pmc/packfileconstanttable.t +++ b/t/pmc/packfileconstanttable.t @@ -25,13 +25,14 @@ Tests the PackfileConstantTable PMC. .sub 'main' :main .include 'test_more.pir' - 'plan'(15) + 'plan'(17) 'test_sanity'() 'test_counts'() 'test_get'() 'test_set'() 'test_get_or_create'() + 'test_subs_intact'() .end @@ -190,6 +191,43 @@ load_error: isnt($I0, $I2, "get_or_create_constant returns different index for different PMCs") .end +.sub 'test_subs_intact' + .local pmc pf, ct + push_eh load_error + pf = _pbc() + pop_eh + ct = _get_consttable(pf) + + # force a GC run + sweep 1 + + .local pmc sub + sub = ct[0] + + # validate assumption that ct[0] is a sub + $S0 = typeof sub + is($S0, 'Sub', 'First entry in constant table is a sub') + + # sub will perform I/O, mock output fh + $P0 = getinterp + $P1 = new ['StringHandle'] + $P1.'open'('','w') + $P2 = $P0.'stdout_handle'($P1) + + sub() + $P0.'stdout_handle'($P2) # restore normal output handle + + # if we're still here (no segfault), we pass + ok(1, "Can call Sub from PackfileConstantTable") + + .return () +load_error: + .get_results($P0) + pop_eh + report_load_error($P0, "Can call Sub from PackfileConstantTable") + .return() +.end + .sub '_get_consttable' .param pmc pf .local pmc dir, it diff --git a/t/pmc/packfileopmap.t b/t/pmc/packfileopmap.t index 4e442951de..fc8f11ceb6 100644 --- a/t/pmc/packfileopmap.t +++ b/t/pmc/packfileopmap.t @@ -93,6 +93,15 @@ Tests the PackfileOpMap PMC. invalid_op_name: ok(1, 'caught invalid op name') pop_eh + + .local pmc oplibs + oplibs = opmap.'oplibs'() + $I0 = isa oplibs, 'Hash' + ok($I0, 'oplibs gave a hash') + + $P0 = oplibs['core_ops'] + $I0 = defined $P0 + ok($I0, 'oplib contains core_ops') .end .sub 'load_lib' diff --git a/t/pmc/packfileview.t b/t/pmc/packfileview.t index a8e2226447..064e94adc4 100644 --- a/t/pmc/packfileview.t +++ b/t/pmc/packfileview.t @@ -4,16 +4,18 @@ .sub 'main' :main .include 'test_more.pir' - plan(15) + plan(20) test_create() + test_interp_same_after_compile() test_vtable_get_bool() test_vtable_get_pmc_keyed_int() test_vtable_get_string_keyed_int() test_vtable_get_number_keyed_int() test_method_constant_counts() test_method_main_sub() - test_method_subs_by_flag() + test_method_subs_by_tag() + test_method_subs_by_tag_tag_syntax() test_method_serialized_size() test_method_serialize() test_method_all_subs() @@ -26,6 +28,15 @@ $P0 = new ['PackfileView'] .end +.sub 'test_interp_same_after_compile' + $P0 = getinterp + $P2 = compreg "PIR" + $S0 = ".sub __init :anon :init\nok(1, 'init function executed on demand')\n.end" + $P5 = $P2.'compile'($S0) + $P1 = getinterp + is_same($P0, $P1, "interp['packfile'] does not change over IMCC invocation") +.end + .sub 'test_vtable_get_bool' $P0 = new ['PackfileView'] if $P0 goto fail_first @@ -76,30 +87,69 @@ .end # We are executing this file as a program, so :load functions shouldn't be -# triggered automatically. In the 'test_method_subs_by_flag' test, we do it +# triggered automatically. In the 'test_method_subs_by_tag' test, we do it # manually. .sub '__onload' :load ok(1, "can manually trigger :load") .end -.sub 'test_method_subs_by_flag' +.sub 'test_method_subs_by_tag' $P0 = getinterp $P1 = $P0["packfile"] - $P3 = $P1.'subs_by_flag'("load") + $P3 = $P1.'subs_by_tag'("load") $I0 = elements $P3 is($I0, 1) $P4 = $P3[0] $P4() $P2 = compreg "PIR" - $S0 = ".sub __init :init\nok(1, 'init function executed on demand')\n.end" - $P1 = $P2.'compile'($S0) - $P3 = $P1.'subs_by_flag'("init") + $S0 = ".sub __init :anon :init\nok(1, 'init function executed on demand')\n.end" + $P5 = $P2.'compile'($S0) + $P3 = $P5.'subs_by_tag'("init") $I0 = elements $P3 is($I0, 1) $P4 = $P3[0] $P4() .end +.sub 'test_method_subs_by_tag_tag_syntax' + $P0 = getinterp + $P1 = $P0["packfile"] + + $P2 = $P1.'subs_by_tag'("tag-a") + $I0 = elements $P2 + is($I0, 1, "Can get subs marked 'tag-a'") + + $P2 = $P1.'subs_by_tag'("tag-b") + $I0 = elements $P2 + is($I0, 2, "Can get subs marked 'tag-b'") + + $P2 = $P1.'subs_by_tag'("tag-c") + $I0 = elements $P2 + is($I0, 2, "Can get subs marked 'tag-c'") + + # For upgrade, verify that :init is the same as :tag("init") + $P2 = compreg "PIR" + $S0 = <<'__EOCODE__' + +.sub __init_old :init + .return("init_old") +.end + +.sub __init_tag :tag("init") + .return("init_tag") +.end + +.sub __not_init :tag("something-else") + .return("not_init") +.end +__EOCODE__ + + $P1 = $P2.'compile'($S0) + $P3 = $P1.'subs_by_tag'("init") + $I0 = elements $P3 + is($I0, 2) +.end + .sub 'test_method_serialized_size' $P0 = new ['PackfileView'] $I0 = $P0.'serialized_size'() @@ -140,11 +190,37 @@ .end .sub 'test_method_read_from_file' - # TODO: Would really like temporary files for this. TT #955 + # TODO: Would really like temporary files for this. GH #517 .end .sub 'test_method_write_to_file' - # TODO: Would really like temporary files for this. TT #955 + # TODO: Would really like temporary files for this. GH #517 +.end + +# Subs with :tag syntax +.sub 'tag1' :tag("tag-a") + .return('tag1') +.end + +.sub 'tag2' :tag("tag-b") + .return('tag2') +.end + +.sub 'tag3' :tag("tag-c") + .return('tag3') +.end + +.sub 'tag4' :tag("tag-c", "tag-b") + .return('tag4') +.end + +# Helper method +.sub 'is_same' + .param pmc x + .param pmc y + .param string msg + $I0 = issame x, y + 'ok'($I0, msg) .end # Local Variables: diff --git a/t/pmc/parrotio.t b/t/pmc/parrotio.t index 141363ce2b..a2efe1b452 100644 --- a/t/pmc/parrotio.t +++ b/t/pmc/parrotio.t @@ -85,7 +85,7 @@ SKIP: { pir_output_is( <<'CODE', <<'OUT', 'open and close - asynchronous' ); .sub 'test' :main - $P1 = # TT #1204 create a callback here + $P1 = # GH #535 create a callback here $P0 = new ['FileHandle'] $P0.open('README') @@ -165,9 +165,9 @@ ok 4 - $S0 = $P1.readline($I2) ok 5 - $S0 = $P1.readline($I2) # again on same stream OUT -# TT #1204 test reading long chunks, eof, and across newlines +# GH #535 test reading long chunks, eof, and across newlines -# TT #1204 pir_output_is( <<'CODE', <<'OUT', 'print, read, and readline - asynchronous', todo => 'not yet implemented' ); +# GH #535 pir_output_is( <<'CODE', <<'OUT', 'print, read, and readline - asynchronous', todo => 'not yet implemented' ); # L pir_output_is( <<'CODE', <<'OUT', 'buffer_type', todo => 'not yet implemented' ); @@ -227,16 +227,16 @@ ok 5 - $I0 = $P1.buffer_type() # PIO_FULLBUF ok 6 - $S0 = $P1.buffer_type() # PIO_FULLBUF OUT -# TT #1204 test effects of buffer_type, not just set/get +# GH #535 test effects of buffer_type, not just set/get -# TT #1177 +# GH #458 # L # 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 -# TT #1178 +# GH #465 # L # NOTES: this is going to be platform dependent diff --git a/t/pmc/parrotthread.t b/t/pmc/parrotthread.t deleted file mode 100644 index 5bd28f82fb..0000000000 --- a/t/pmc/parrotthread.t +++ /dev/null @@ -1,32 +0,0 @@ -#!./parrot -# Copyright (C) 2006-2008, Parrot Foundation. - -=head1 NAME - -t/pmc/parrotthread.t - test the ParrotThread PMC - -=head1 SYNOPSIS - - % prove t/pmc/parrotthread.t - -=head1 DESCRIPTION - -Tests the ParrotThread PMC. - -=cut - -.sub 'main' :main - .include 'test_more.pir' - - plan(1) - - new $P0, ['ParrotThread'] - ok(1, 'Instantiated a ParrotThread PMC') - -.end - -# Local Variables: -# mode: pir -# fill-column: 100 -# End: -# vim: expandtab shiftwidth=4 ft=pir: diff --git a/t/pmc/pmclist.t b/t/pmc/pmclist.t new file mode 100644 index 0000000000..98897e26d3 --- /dev/null +++ b/t/pmc/pmclist.t @@ -0,0 +1,229 @@ +#!./parrot +# Copyright (C) 2001-2010, Parrot Foundation. +# $Id$ + +.sub main :main + .include 'test_more.pir' + + plan(10) + + empty_exceptions() + push_five() + push_two_pop_two() + unshift_two_shift_two() + push_shift() + unshift_pop() + insert_by_num() +.end + +.sub empty_exceptions + $P0 = new 'PMCList' + + push_eh pop_good + $P1 = pop $P0 + pop_eh + + ok(0, "pop empty") + goto try_shift + +pop_good: + ok(1, "pop empty") + +try_shift: + + $P0 = new 'PMCList' + + push_eh shift_good + $P1 = pop $P0 + pop_eh + + ok(0, "shift empty") + .return() + +shift_good: + ok(1, "shift empty") +.end + +.sub push_many + .param pmc a + .param int n + + if n < 1 goto done + + $P0 = new 'Integer' + $P0 = n + push a, $P0 + + $N0 = n - 1 + push_many(a, $N0) + +done: + .return() +.end + +.sub push_five + $P0 = new 'PMCList' + + push_eh fail + push_many($P0, 5) + pop_eh + + $I0 = $P0 + + if $I0 != 5 goto fail + ok(1, "push five") + + .return() + +fail: + ok(0, "push five") +.end + +.sub push_two_pop_two + $P0 = new 'PMCList' + + push_many($P0, 2) + + $P1 = pop $P0 + $I0 = $P0 + + if $I0 == 1 goto size_good + + ok(0, "push two pop one") + goto try_value + +size_good: + ok(1, "push two pop one") + +try_value: + $P1 = pop $P0 + $I0 = $P1 + + if $I0 == 2 goto value_good + ok(0, "push two pop two") + .return() + +value_good: + ok(1, "push two pop two") +.end + +.sub unshift_two_shift_two + $P0 = new 'PMCList' + + $P1 = new 'Integer', 2 + unshift $P0, $P1 + + $P1 = new 'Integer', 1 + unshift $P0, $P1 + + $P1 = shift $P0 + $I0 = $P0 + + if $I0 == 1 goto size_good + + ok(0, "unshift shift size") + goto try_value + +size_good: + ok(1, "unshift shift size") + +try_value: + $P1 = shift $P0 + $I0 = $P1 + + if $I0 == 2 goto value_good + ok(0, "unshift shift value") + .return() + +value_good: + ok(1, "unshift shift value") +.end + +.sub push_shift + $P0 = new 'PMCList' + + $P1 = new 'Integer', 5 + push $P0, $P1 + + $P1 = new 'Integer', 6 + push $P0, $P1 + + $P1 = shift $P0 + $I0 = $P1 + + if $I0 == 5 goto value_good + ok(0, "push shift") + .return() + +value_good: + ok(1, "push shift") +.end + +.sub unshift_pop + $P0 = new 'PMCList' + + $P1 = new 'Integer', 5 + unshift $P0, $P1 + + $P1 = new 'Integer', 6 + unshift $P0, $P1 + + $P1 = pop $P0 + $I0 = $P1 + + if $I0 == 5 goto value_good + ok(0, "unshift pop") + .return() + +value_good: + ok(1, "unshift pop") +.end + +.sub insert_by_num + $P0 = new 'PMCList' + + $P1 = new 'Float' + $P1 = 3.14 + $P0.'insert_by_number'($P1) + + $P1 = new 'Float' + $P1 = 1.41 + $P0.'insert_by_number'($P1) + + $P1 = new 'Float' + $P1 = 9.8 + $P0.'insert_by_number'($P1) + + + $I0 = $P0 + if $I0 == 3 goto size_good + ok(0, "insert by num") + .return() + +size_good: + $P2 = shift $P0 + $P1 = new 'Float' + $P1 = 1.41 + + eq_num $P1, $P2, shift_good + ok(0, "insert by num") + .return() + +shift_good: + $P2 = pop $P0 + $P1 = new 'Float' + $P1 = 9.8 + + eq_num $P1, $P2, pop_good + ok(0, "insert by num") + .return() + +pop_good: + ok(1, "insert by num") +.end + +# Local Variables: +# mode: pir +# fill-column: 100 +# End: +# vim: expandtab shiftwidth=4 ft=pir: diff --git a/t/pmc/prop.t b/t/pmc/prop.t index 483f605c5e..b692f0427c 100644 --- a/t/pmc/prop.t +++ b/t/pmc/prop.t @@ -38,9 +38,9 @@ Tests property access on PMCs. set $P2, "zehn" setprop $P0, "de", $P2 is($P0, "10", "setprop is ok") - getprop $P3, "en", $P0 + getprop $P3, $P0, "en" is($P3, "ten", "getprop is ok") - getprop $P3, "de", $P0 + getprop $P3, $P0, "de" is($P3, "zehn", "getprop is ok") .end @@ -57,9 +57,9 @@ Tests property access on PMCs. set $P1, "No" setprop $P0, $S0, $P1 new $P2, ['String'] - getprop $P2, "Black", $P0 + getprop $P2, $P0, "Black" is($P2, "No", "'Black' property refers to right string") - getprop $P2, "Brown", $P0 + getprop $P2, $P0, "Brown" is($P2, "No", "'Brown' property refers to same string as 'Black'") .end @@ -72,11 +72,11 @@ Tests property access on PMCs. set $S0, "Type" set $P1, "Integer" setprop $P0, $S0, $P1 - getprop $P2, $S0, $P0 + getprop $P2, $P0, $S0 is($P2, "Integer", "'Type' property successfully set to Integer'") set $P3, "Float" setprop $P0, $S0, $P3 - getprop $P2, $S0, $P0 + getprop $P2, $P0, $S0 is($P2, "Float", "'Type' property successfully changed to Float'") .end @@ -84,7 +84,7 @@ Tests property access on PMCs. new $P1, ['Float'] new $P2, ['Integer'] - getprop $P2, "Wibble", $P1 + getprop $P2, $P1, "Wibble" defined $I2, $P2 is($I2, 0, "unset property isn't defined") .end @@ -99,12 +99,12 @@ Tests property access on PMCs. set $P2, "zehn" setprop $P0, "de", $P2 is($P0, "10", "ok") - getprop $P3, "en", $P0 + getprop $P3, $P0, "en" is($P3, "ten", "ok") - getprop $P3, "de", $P0 + getprop $P3, $P0, "de" is($P3, "zehn", "ok") delprop $P0, "de" - getprop $P3, "de", $P0 + getprop $P3, $P0, "de" if_null $P3, ok ok(0, "'de' property not deleted") goto end diff --git a/t/pmc/resizablefloatarray.t b/t/pmc/resizablefloatarray.t index 811bdfd60f..0c17c82bf8 100644 --- a/t/pmc/resizablefloatarray.t +++ b/t/pmc/resizablefloatarray.t @@ -16,7 +16,7 @@ out-of-bounds test. Checks INT and PMC keys. =cut -.const int TESTS = 55 +.const int TESTS = 63 .const num PRECISION = 1e-6 .sub 'test' :main @@ -49,6 +49,7 @@ out-of-bounds test. Checks INT and PMC keys. check_interface() get_iter() 'clone'() + method_reverse() .end .sub 'creation' @@ -458,6 +459,42 @@ out-of-bounds test. Checks INT and PMC keys. nok(0, 'clone made an evil clone') .end +.sub method_reverse + .local pmc array + array = new ['ResizableFloatArray'] + array."reverse"() + $I0 = elements array + is($I0, 0, "method_reverse - reverse of empty array") + push array, 3. + array."reverse"() + $S0 = array[0] + is($S0, "3", "method_reverse - reverse of array with one element") + push array, 1. + array."reverse"() + array."reverse"() + array."reverse"() + $S0 = array[0] + is($S0, "1", "method_reverse - reverse of array with two elements") + $S0 = array[1] + is($S0, "3", "method_reverse - reverse of array with two elements second element") + push array, 4.5 + array."reverse"() + push array, 5. + array."reverse"() + $S0 = join "", array + is($S0, "5134.5", "method_reverse - four elements") + array."reverse"() + $S0 = join "", array + is($S0, "4.5315", "method_reverse - four elements second reverse") + push array, 6. + array."reverse"() + $S0 = join "", array + is($S0, "65134.5", "method_reverse - five elements") + array."reverse"() + $S0 = join "", array + is($S0, "4.53156", "method_reverse - five elements second reverse") +.end + # Local Variables: # mode: pir # fill-column: 100 diff --git a/t/pmc/resizableintegerarray.t b/t/pmc/resizableintegerarray.t index a170829d97..9e39fbc0b2 100644 --- a/t/pmc/resizableintegerarray.t +++ b/t/pmc/resizableintegerarray.t @@ -42,7 +42,7 @@ Coverage plan: .sub main :main .include 'test_more.pir' - plan(47) + plan(55) test_does_interfaces() @@ -74,6 +74,7 @@ Coverage plan: test_iterator() test_clone() test_freeze() + method_reverse() .end .sub test_does_interfaces @@ -607,6 +608,42 @@ k0: is( ria, th, 'freeze/thaw copy is equal to original' ) .end +.sub method_reverse + .local pmc array + array = new ['ResizableIntegerArray'] + array."reverse"() + $I0 = elements array + is($I0, 0, "method_reverse - reverse of empty array") + push array, 3 + array."reverse"() + $S0 = array[0] + is($S0, "3", "method_reverse - reverse of array with one element") + push array, 1 + array."reverse"() + array."reverse"() + array."reverse"() + $S0 = array[0] + is($S0, "1", "method_reverse - reverse of array with two elements") + $S0 = array[1] + is($S0, "3", "method_reverse - reverse of array with two elements second element") + push array, 4 + array."reverse"() + push array, 5 + array."reverse"() + $S0 = join "", array + is($S0, "5134", "method_reverse - four elements") + array."reverse"() + $S0 = join "", array + is($S0, "4315", "method_reverse - four elements second reverse") + push array, 6 + array."reverse"() + $S0 = join "", array + is($S0, "65134", "method_reverse - five elements") + array."reverse"() + $S0 = join "", array + is($S0, "43156", "method_reverse - five elements second reverse") +.end + # Local Variables: # mode: pir # fill-column: 100 diff --git a/t/pmc/resizablepmcarray.t b/t/pmc/resizablepmcarray.t index 66eaa5b0b1..a8ec9cc922 100644 --- a/t/pmc/resizablepmcarray.t +++ b/t/pmc/resizablepmcarray.t @@ -22,7 +22,7 @@ out-of-bounds test. Checks INT and PMC keys. .include 'fp_equality.pasm' .include 'test_more.pir' - plan(143) + plan(151) init_tests() resize_tests() @@ -54,10 +54,13 @@ out-of-bounds test. Checks INT and PMC keys. iterate_subclass_of_rpa() method_forms_of_unshift_etc() sort_with_broken_cmp() - addr_tests() equality_tests() sort_tailcall() push_to_subclasses_array() + test_assign_from_another() + test_assign_self() + test_assign_non_array() + method_reverse() .end .sub init_negative @@ -365,7 +368,7 @@ done: s = concat s, ':' aux = join '-', arr s = concat s, aux - is(s, 'ssRPA:z-p-a', "sort works in a pir subclass, TT #218") + is(s, 'ssRPA:z-p-a', "sort works in a pir subclass, GH #303") .end .sub compare_reverse @@ -1051,22 +1054,6 @@ end: .return ($I0) .end -.sub 'addr_tests' - $P0 = new 'ResizablePMCArray' - $I0 = get_addr $P0 - $P1 = new 'ResizablePMCArray' - $I1 = get_addr $P1 - - $I2 = $I0 != 0 - ok($I2, 'ResizablePMCArray address is not zero') - $I2 = $I0 != $I1 - ok($I2, 'Two empty RPAs do not have same address') - - push $P0, 3 - $I1 = get_addr $P0 - is($I0, $I1, 'Adding element to RPA keeps same addr') -.end - .sub 'equality_tests' .local pmc array1, array2, array3, array4 array1 = new ['ResizablePMCArray'] @@ -1161,6 +1148,74 @@ end: ok(1, "Push to subclassed array works") .end +.sub test_assign_non_array + throws_substring(<<'CODE', "Can't set self from this type",'assign from non-array') + .sub main :main + .local pmc arr, other + .local int n + arr = new ['ResizablePMCArray'] + other = new ['Integer'] + assign arr, other + .end +CODE +.end + +.sub test_assign_self + .local pmc arr + arr = new ['ResizablePMCArray'] + assign arr, arr + ok(1, 'Can assign ResizablePMCArray to itself') +.end + +.sub test_assign_from_another + .local pmc arr1, arr2 + .local int n + arr1 = new ['ResizablePMCArray'] + arr1 = 32 + arr2 = new ['ResizablePMCArray'] + arr2 = 15 + assign arr1, arr2 + n = arr1 + is(n,15,'assigning to ResizablePMCArray from another ResizablePMCArray') +.end + +.sub method_reverse + .local pmc array + array = new ['ResizablePMCArray'] + array."reverse"() + $I0 = elements array + is($I0, 0, "method_reverse - reverse of empty array") + push array, 3 + array."reverse"() + $S0 = array[0] + is($S0, "3", "method_reverse - reverse of array with one element") + push array, "1" + array."reverse"() + array."reverse"() + array."reverse"() + $S0 = array[0] + is($S0, "1", "method_reverse - reverse of array with two elements") + $S0 = array[1] + is($S0, "3", "method_reverse - reverse of array with two elements second element") + push array, 4 + array."reverse"() + push array, 5 + array."reverse"() + $S0 = join "", array + is($S0, "5134", "method_reverse - four elements") + array."reverse"() + $S0 = join "", array + is($S0, "4315", "method_reverse - four elements second reverse") + push array, 6 + array."reverse"() + $S0 = join "", array + is($S0, "65134", "method_reverse - five elements") + array."reverse"() + $S0 = join "", array + is($S0, "43156", "method_reverse - five elements second reverse") +.end + + # don't forget to change the test plan # Local Variables: diff --git a/t/pmc/resizablestringarray.t b/t/pmc/resizablestringarray.t index 9df89e9b15..ecb7c66977 100644 --- a/t/pmc/resizablestringarray.t +++ b/t/pmc/resizablestringarray.t @@ -22,7 +22,7 @@ out-of-bounds test. Checks INT and PMC keys. .include 'test_more.pir' # set a test plan - plan(263) + plan(271) 'size/resize'() 'clone'() @@ -86,6 +86,7 @@ out-of-bounds test. Checks INT and PMC keys. method_unshift_string() method_unshift_integer() method_unshift_float() + method_reverse() .end # @@ -1818,6 +1819,42 @@ exception: is($S0, "3.3", "method_unshift_float (shrink, grow) - value") .end +.sub method_reverse + .local pmc array + array = new ['ResizableStringArray'] + array."reverse"() + $I0 = elements array + is($I0, 0, "method_reverse - reverse of empty array") + push array, "3" + array."reverse"() + $S0 = array[0] + is($S0, "3", "method_reverse - reverse of array with one element") + push array, "1" + array."reverse"() + array."reverse"() + array."reverse"() + $S0 = array[0] + is($S0, "1", "method_reverse - reverse of array with two elements") + $S0 = array[1] + is($S0, "3", "method_reverse - reverse of array with two elements second element") + push array, "4" + array."reverse"() + push array, "5" + array."reverse"() + $S0 = join "", array + is($S0, "5134", "method_reverse - four elements") + array."reverse"() + $S0 = join "", array + is($S0, "4315", "method_reverse - four elements second reverse") + push array, "6" + array."reverse"() + $S0 = join "", array + is($S0, "65134", "method_reverse - five elements") + array."reverse"() + $S0 = join "", array + is($S0, "43156", "method_reverse - five elements second reverse") +.end + # Local Variables: # mode: pir # fill-column: 100 diff --git a/t/pmc/scheduler.t b/t/pmc/scheduler.t deleted file mode 100644 index 32925a262d..0000000000 --- a/t/pmc/scheduler.t +++ /dev/null @@ -1,120 +0,0 @@ -#!./parrot -# Copyright (C) 2007-2010, Parrot Foundation. - -=head1 NAME - -t/pmc/scheduler.t - Concurrency Scheduler - -=head1 SYNOPSIS - - % prove t/pmc/scheduler.t - -=head1 DESCRIPTION - -Tests the concurrency scheduler PMC. - -=cut - - -.sub main :main - .include 'test_more.pir' - plan(6) - - create_and_set_attributes() - create_concurrent_scheduler_with_init() - add_event_and_handler_to_scheduler() -.end - -.sub create_and_set_attributes - $P0 = new ['Scheduler'] - $P1 = new ['Task'] - - push $P0, $P1 - - $P2 = pop $P0 - - if null $P2 goto no_task - $P3 = getattribute $P2, 'status' - $S0 = $P3 - is($S0, "created", "got task") - goto got_task - -no_task: - ok(0,"no task to retrieve") - -got_task: - - ok(1, "didn't explode") -.end - -.sub create_concurrent_scheduler_with_init - .local pmc data - data = new ['Hash'] - - .local pmc id - id = new ['Integer'] - id = 128 - data['id'] = id - - $P0 = new ['Scheduler'], data - $P1 = new ['Task'] - - push $P0, $P1 - - $P2 = pop $P0 - - if null $P2 goto no_task - $P3 = getattribute $P2, 'status' - $S0 = $P3 - is($S0, "created", "status is ok") - goto got_task - -no_task: - ok(0, 'no task to retrieve') - -got_task: - ok(1, "got a task") - - push_eh bad_initializer - $P0 = new ['Scheduler'], id - pop_eh - - ok(0, "No exception on invalid initializer? Uh oh!") - end - -bad_initializer: - ok(1, "Caught exception on bad initializer") -.end - - -.sub add_event_and_handler_to_scheduler - .local pmc handler, handler_init, handler_sub - .local pmc event, event_init - handler_init = new ['Hash'] - handler_init['type'] = 'myevent' - handler_sub = get_global 'my_event_handler' - handler_init['code'] = handler_sub - handler = new ['EventHandler'], handler_init - - addhandler handler - - event_init = new ['Hash'] - event_init['type'] = 'event' - event_init['subtype'] = 'myevent' - event = new ['Task'], event_init - - schedule event - -.end - -.sub my_event_handler - .param pmc handler - .param pmc handledtask - ok(1, "called event handler") -.end - -# Local Variables: -# mode: pir -# fill-column: 100 -# End: -# vim: expandtab shiftwidth=4 ft=pir: diff --git a/t/pmc/stringhandle.t b/t/pmc/stringhandle.t index 167ef3f407..0774a6374b 100644 --- a/t/pmc/stringhandle.t +++ b/t/pmc/stringhandle.t @@ -115,7 +115,7 @@ SKIP: { pir_output_is( <<'CODE', <<'OUT', 'open and close - asynchronous' ); .sub 'test' :main - $P1 = # TT #1204 create a callback here + $P1 = # GH #535 create a callback here $P0 = new ['StringHandle'] $P0.'open'('README') @@ -247,7 +247,7 @@ ok 5 - read integer back from file ok 6 - read string back from file OUT -pir_output_is( <<'CODE', <<'OUT', 'puts' ); +pir_output_is( <<'CODE', <<'OUT', 'print' ); .include 'except_types.pasm' .sub 'test' :main .local pmc sh, eh @@ -257,10 +257,10 @@ pir_output_is( <<'CODE', <<'OUT', 'puts' ); eh.'handle_types'(.EXCEPTION_PIO_ERROR) push_eh eh - # puts to SH not opened + # print to SH not opened result = 0 set_label eh, handle1 - sh.'puts'('something') + sh.'print'('something') result = 1 goto done1 handle1: @@ -268,11 +268,11 @@ handle1: done1: say result - # puts to SH opened for reading + # print to SH opened for reading result = 0 set_label eh, handle2 sh.'open'('mockname', 'r') - sh.'puts'('something') + sh.'print'('something') result = 1 goto done2 handle2: @@ -379,9 +379,9 @@ ok 1 - read 10,000 lines OUT -# TT #1204 test reading long chunks, eof, and across newlines +# GH #535 test reading long chunks, eof, and across newlines -# TT #1204 pir_output_is( <<'CODE', <<'OUT', 'print, read, and readline - asynchronous', todo => 'not yet implemented' ); +# GH #535 pir_output_is( <<'CODE', <<'OUT', 'print, read, and readline - asynchronous', todo => 'not yet implemented' ); # L pir_output_is( <<'CODE', <<'OUT', 'record_separator', todo => 'not yet implemented' ); @@ -452,9 +452,9 @@ ok 2 - $S0 = $P1.buffer_type() # line-buffered ok 3 - $S0 = $P1.buffer_type() # full-buffered OUT -# TT #1204 test effects of buffer_type, not just set/get +# GH #535 test effects of buffer_type, not just set/get -# TT #1177 +# GH #458 # L # NOTES: try setting positive, zero, negative int # perform print and read ops @@ -716,7 +716,7 @@ CODE ok OUTPUT -# TT #1178 +# GH #465 # L # NOTES: this is going to be platform dependent diff --git a/t/pmc/sub.t b/t/pmc/sub.t index 26bc7ba71a..57d2c238bf 100644 --- a/t/pmc/sub.t +++ b/t/pmc/sub.t @@ -1474,7 +1474,7 @@ I can has outer from eval? OUTPUT @todo = $testr - ? ( todo => 'lexicals not thawed properly from PBC, TT #1171' ) + ? ( todo => 'lexicals not thawed properly from PBC, GH #430' ) : (); pir_output_is( <<'CODE', <<'OUTPUT', ':outer with identical sub names', @todo ); .sub 'main' :main @@ -1669,7 +1669,7 @@ bar bazsubid OUTPUT -pir_output_is( <<'CODE', <<'OUTPUT', 'Thaw PIR subclass', todo => 'See TT #132' ); +pir_output_is( <<'CODE', <<'OUTPUT', 'Thaw PIR subclass', todo => 'See GH #276' ); .sub main :main $P0 = get_class 'Sub' diff --git a/t/pmc/task.t b/t/pmc/task.t index 4e5202f9b3..1a3e5e0440 100644 --- a/t/pmc/task.t +++ b/t/pmc/task.t @@ -1,270 +1,143 @@ -#! perl -# Copyright (C) 2007, Parrot Foundation. - -use strict; -use warnings; -use lib qw( . lib ../lib ../../lib ); -use Test::More; -use Parrot::Test tests => 6; - -=head1 NAME - -t/pmc/task.t - Concurrent Task - -=head1 SYNOPSIS - - % prove t/pmc/task.t - -=head1 DESCRIPTION - -Tests the task PMC used by the concurrency scheduler. - -=cut - -pir_output_is( <<'CODE', <<'OUT', "create a task and set attributes" ); - .sub main :main - $P0 = new ['Task'] - $P1 = getattribute $P0, 'status' - print $P1 - print "\n" - - $P2 = new ['String'] - $P2 = "inprocess" - setattribute $P0, 'status', $P2 - - $P3 = getattribute $P0, 'status' - print $P3 - print "\n" - - $P2 = new ['String'] - $P2 = "event" - setattribute $P0, 'type', $P2 - - $P3 = getattribute $P0, 'type' - print $P3 - print "\n" +#!./parrot +# Copyright (C) 2010-2011, Parrot Foundation. + +.include 'sysinfo.pasm' +.loadlib 'sys_ops' + +.sub main + .include 'test_more.pir' + + $S0 = sysinfo .SYSINFO_PARROT_OS + if $S0 == 'MSWin32' goto run_win32_tests + goto run_unix_tests + run_win32_tests: + say "1..1" + say "ok 1 - All tests skipped on Win32" + exit 0 + run_unix_tests: + + plan(10) + + tasks_run() + task_send_recv() + task_kill() + task_wait() + preempt_and_exit() +.end - $P2 = new ['String'] - $P2 = "sub event" - setattribute $P0, 'subtype', $P2 +.sub tasks_run + $P0 = new 'Integer', 0 + set_global 'N', $P0 - $P3 = getattribute $P0, 'subtype' - print $P3 - print "\n" + $P0 = get_global 'task1' + $P1 = new 'Task', $P0 + schedule $P1 - $P2 = new ['Integer'] - $P2 = 10 - setattribute $P0, 'priority', $P2 + $P0 = get_global 'sub1' + schedule $P0 - $P3 = getattribute $P0, 'priority' - print $P3 - print "\n" + $P0 = get_global 'task2' + $P1 = new 'Task', $P0 + schedule $P1 +.end - $P2 = new ['Integer'] - $P2 = 7405 - setattribute $P0, 'id', $P2 +.sub task1 + ok(1, "task1 ran") +.end - $P3 = getattribute $P0, 'id' - print $P3 - print "\n" +.sub sub1 + ok(1, "sub1 ran") +.end - $P2 = new ['Float'] - $P2 = 1.1 - setattribute $P0, 'birthtime', $P2 +.sub task2 + ok(1, "task2 ran") +.end - $P3 = getattribute $P0, 'birthtime' - print $P3 - print "\n" +.sub task_send_recv + $P0 = get_global 'recv_msg1' + $P1 = new 'Task', $P0 + schedule $P1 + pass - $P2 = new ['String'] - $P2 = "aditional data" - setattribute $P0, 'data', $P2 + $P2 = new 'String' + $P2 = "Hai 1" - $P2 = get_global 'code' - setattribute $P0, 'code', $P2 + $P1.'send'($P2) - # Make sure the mark vtable is exercised - sweep 1 + wait $P1 - end - .end + $P0 = get_global 'recv_msg2' + $P1 = new 'Task', $P0 - .sub code - say "sub" - .end -CODE -created -inprocess -event -sub event -10 -7405 -1.1 -OUT + $P2 = new 'String' + $P2 = "Hai 2" + $P1.'send'($P2) -pir_error_output_like( <<'CODE', <<'OUTPUT', "init with wrong initializer type" ); -.sub main :main - $P0 = new ['String'] - $P0 = 'foo' + schedule $P1 - $P1 = new ['Task'], $P0 + wait $P1 .end -CODE -/Task initializer must be a Hash/ -OUTPUT -pir_output_is( <<'CODE', <<'OUTPUT', "set_string_native set type of task" ); -.sub main :main - $P0 = new ['Task'] +.sub recv_msg1 + $P0 = receive + $P1 = new 'String' + $P1 = "Hai 1" + is($P0, $P1, "Got message after block") +.end - $P1 = getattribute $P0, 'type' - say $P1 +.sub recv_msg2 + $P0 = receive + $P1 = new 'String' + $P1 = "Hai 2" + is($P0, $P1, "Got existing message") +.end - $P2 = new ['String'] - $P2 = "new_type" - setattribute $P0, 'type', $P2 +.sub task_kill + $P0 = get_global 'task_to_kill' + $P1 = new 'Task', $P0 + schedule $P1 + pass + $P1.'kill'() + wait $P1 + ok(1, "task_to_kill killed") +.end - $P1 = getattribute $P0, 'type' - say $P1 +.sub task_to_kill + ok(1, "task_to_kill running") + sleep 0.2 + ok(0, "task_to_kill wasn't killed") +.end - $P0 = "newer_type" +.sub task_wait + $P0 = get_global 'wait_sub1' + $P1 = new 'Task', $P0 + schedule $P1 - $P1 = getattribute $P0, 'type' - say $P1 + wait $P1 + ok(1, "After wait") .end -CODE - -new_type -newer_type -OUTPUT -pir_output_is( <<'CODE', <<'OUT', 'create a task and set attributes in init' ); - .sub main :main - .local pmc data - data = new ['Hash'] +.sub wait_sub1 + ok(1, "in wait_sub1") +.end - $P2 = new ['String'] - $P2 = 'inprocess' - data['status'] = $P2 +.sub preempt_and_exit + $P0 = get_global 'exit0' + $P1 = new 'Task', $P0 + schedule $P1 - $P2 = new ['String'] - $P2 = 'event' - data['type'] = $P2 +again: + goto again +.end - $P2 = new ['Integer'] - $P2 = 10 - data['priority'] = $P2 - - $P2 = new ['Integer'] - $P2 = 7405 - data['id'] = $P2 - - $P2 = new ['Float'] - $P2 = 1.1 - data['birthtime'] = $P2 - - $P0 = new ['Task'], data - - $P3 = getattribute $P0, 'status' - say $P3 - - $P3 = getattribute $P0, 'type' - say $P3 - - $P3 = getattribute $P0, 'priority' - say $P3 - - $P3 = getattribute $P0, 'id' - say $P3 - - $P3 = getattribute $P0, 'birthtime' - say $P3 - end - .end -CODE -inprocess -event -10 -7405 -1.1 -OUT - -pir_output_is( <<'CODE', <<'OUT', 'create a task and get invalid attribute' ); - .sub main :main - $P0 = new ['Task'] - - $P0 = getattribute $P0, 'foobar' - isnull $I0, $P0 - - if $I0, ok - say 'fail' - - ok: - say 'ok' - .end -CODE -ok -OUT - -pir_output_is( <<'CODE', <<'OUT', "freeze and thaw a task" ); - .sub main :main - $P0 = new ['Task'] - - $P2 = new ['String'] - $P2 = "inprocess" - setattribute $P0, 'status', $P2 - - $P2 = new ['String'] - $P2 = "event" - setattribute $P0, 'type', $P2 - - $P2 = new ['Integer'] - $P2 = 10 - setattribute $P0, 'priority', $P2 - - $P2 = new ['Integer'] - $P2 = 7405 - setattribute $P0, 'id', $P2 - - $P2 = new ['Float'] - $P2 = 1.1 - setattribute $P0, 'birthtime', $P2 - - $S0 = freeze $P0 - $P10 = thaw $S0 - - $P3 = getattribute $P10, 'status' - print $P3 - print "\n" - - $P3 = getattribute $P10, 'type' - print $P3 - print "\n" - - $P3 = getattribute $P10, 'priority' - print $P3 - print "\n" - - $P3 = getattribute $P10, 'id' - print $P3 - print "\n" - - $P3 = getattribute $P10, 'birthtime' - print $P3 - print "\n" - end - .end -CODE -inprocess -event -10 -7405 -1.1 -OUT +.sub exit0 + ok(1, "Pre-empt and exit") + exit 0 +.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: + diff --git a/t/pmc/task_primes.t b/t/pmc/task_primes.t new file mode 100644 index 0000000000..e72ff759eb --- /dev/null +++ b/t/pmc/task_primes.t @@ -0,0 +1,152 @@ +#!./parrot +# Copyright (C) 2010-2011, Parrot Foundation. + +=head1 task_primes.t + +The classic threads/message passing prime checker +is now a Parrot test. + +=cut + +.include 'interpinfo.pasm' +.include 'sysinfo.pasm' +.loadlib 'sys_ops' + +.sub main + .include 'test_more.pir' + .local pmc nt, tt + + $S0 = sysinfo .SYSINFO_PARROT_OS + if $S0 == 'MSWin32' goto run_win32_tests + goto run_unix_tests + run_win32_tests: + say "1..1" + say "ok 1 - All tests skipped on Win32" + exit 0 + run_unix_tests: + + $P0 = get_global 'test_sub' + tt = new 'Task', $P0 + schedule tt + set_global 'test_task', tt + + plan(8) + + nt = make_checker() + + $I0 = 2 +loop: + send_int(nt, $I0) + $P0 = receive + $I0 = $I0 + 1 + if $I0 < 100 goto loop + + nt.'send'($I0) + $P1 = receive + + if $I0 < 20 goto loop + wait tt +.end + +.sub test_sub + .local int sum + sum = 0 + + $P0 = receive + is($P0, 2, "2 is prime") + + $P0 = receive + is($P0, 3, "3 is prime") + + $P0 = receive + is($P0, 5, "5 is prime") + + $P0 = receive + is($P0, 7, "7 is prime") + + $P0 = receive + is($P0, 11, "11 is prime") + + $P0 = receive + is($P0, 13, "13 is prime") + + $P0 = receive + is($P0, 17, "17 is prime") + + $P0 = receive + is($P0, 19, "19 is prime") +.end + +.sub send_int + .param pmc t + .param pmc i + $P0 = new 'Integer' + $P0 = i + t.'send'($P0) +.end + +.sub make_checker + .local pmc cp, ct + + cp = get_global 'check_prime' + ct = interpinfo .INTERPINFO_CURRENT_TASK + + $P0 = new 'Hash' + $P0['code'] = cp + $P0['data'] = ct + + $P1 = new 'Task', $P0 + schedule $P1 + .return($P1) +.end + +.sub check_prime + .param pmc pt + .local pmc nt, tt, M + .local int N, x + + tt = get_global 'test_task' + + N = 0 + +next_msg: + M = receive + x = M + + # The first number we get is the prime + # that this task will be checking. + if N >= 2 goto check_x + N = x + send_int(tt, x) + goto send_reply + +check_x: + $I0 = x % N + if $I0 != 0 goto maybe_prime + goto send_reply + +maybe_prime: + # Make sure there's a next task in the + # chain to send to. + unless null nt goto ship_it + nt = make_checker() + +ship_it: + # More syncrhonous message passing to the + # next task. + nt.'send'(M) + M = receive + +send_reply: + # And the reply for the previous task + # that's waiting on us. + pt.'send'(M) + goto next_msg +.end + + +# Local Variables: +# mode: pir +# fill-column: 100 +# End: +# vim: expandtab shiftwidth=4 ft=pir: diff --git a/t/pmc/testlib/number.pasm b/t/pmc/testlib/number.pasm index 7061efb599..2a63ff56c1 100644 --- a/t/pmc/testlib/number.pasm +++ b/t/pmc/testlib/number.pasm @@ -81,7 +81,7 @@ print "\n" print N25 print "\n" - end + returncc # Local Variables: # mode: pir diff --git a/t/pmc/threads.t b/t/pmc/threads.t deleted file mode 100644 index 3804880ce7..0000000000 --- a/t/pmc/threads.t +++ /dev/null @@ -1,901 +0,0 @@ -#! perl -# Copyright (C) 2001-2009, Parrot Foundation. - -use strict; -use warnings; -use lib qw( . lib ../lib ../../lib ); -use Test::More; -use Parrot::Test; -use Parrot::Config; - -=head1 NAME - -t/pmc/threads.t - Threads - -=head1 SYNOPSIS - - % prove t/pmc/threads.t - -=head1 DESCRIPTION - -Tests running threads. All tests skipped unless running on known-good -platform. - -=cut - -if ( $^O eq "cygwin" ) { - my @uname = split / /, qx'uname -v'; - - if ( $uname[0] eq "2004-09-04" ) { - plan skip_all => "This cygwin version is known to fail the thread tests"; - exit; - } -} -if ( $PConfig{HAS_THREADS} ) { - plan tests => 14; -} -else { - plan skip_all => "No threading enabled for '$^O'"; -} - -pasm_output_is( <<'CODE', <<'OUTPUT', "interp identity" ); -.pcc_sub :main main: - getinterp P2 - clone P3, P2 - ne P3, P2, ok1 - print "not" -ok1: - print "ok 1\n" - new P4, ['ParrotThread'] - ne P2, P4, ok2 - print "not" -ok2: - print "ok 2\n" - end -CODE -ok 1 -ok 2 -OUTPUT - -SKIP: { - skip 'busted on win32' => 2 if $^O eq 'MSWin32'; - - pir_output_is( <<'CODE', <<'OUTPUT', "thread type 1" ); -.sub main :main - .local pmc threadfunc - .local pmc thread - $I5 = 10 - threadfunc = get_global "foo" - thread = new ['ParrotThread'] - thread.'run_clone'(threadfunc) - - sleep 1 - print "main " - print $I5 - print "\n" - # get tid of thread - $I0 = thread - # wait for it - thread.'join'() -.end - -.sub foo - # check if vars are fresh - inc $I5 - print "thread" - # print I5 # not done because registers aren't guaranteed to be - # initialized to anything in particular - print "\n" - set $I3, 0 # no retval - returncc # ret and be done with thread -.end -# output from threads could be reversed -CODE -thread -main 10 -OUTPUT - - pir_output_is( <<'CODE', <<'OUTPUT', "thread type 1 -- repeated" ); -.sub real_main :main - $I0 = 0 -loop: - main() - inc $I0 - if $I0 < 2 goto loop -.end - -.sub main :main - .local pmc threadfunc - .local pmc thread - $I5 = 10 - threadfunc = get_global "foo" - thread = new ['ParrotThread'] - thread.'run_clone'(threadfunc) - - sleep 1 - print "main " - print $I5 - print "\n" - # get tid of thread - $I0 = thread - # wait for it - thread.'join'() -.end - -.sub foo - # check if vars are fresh - inc $I5 - print "thread" - # print I5 # not done because registers aren't guaranteed to be - # initialized to anything in particular - print "\n" - set $I3, 0 # no retval - returncc # ret and be done with thread -.end -# output from threads could be reversed -CODE -thread -main 10 -thread -main 10 -OUTPUT -} - - -pir_output_is( <<'CODE', <<'OUTPUT', "thread type 2" ); -.sub main :main - set $I5, 10 - .local pmc thread - .local pmc threadsub - $S5 = " interp\n" - $P6 = new ['String'] - $P6 = 'from ' - - print "ok 1\n" - threadsub = get_global "foo" - thread = new ['ParrotThread'] - thread.'run_clone'(threadsub, $P6) - sleep 1 # to let the thread run - print $P6 - print $I5 - print $S5 - thread.'join'() -.end - -.sub foo - .param pmc passed - inc $I5 - $S5 = " thread\n" - .local pmc salutation - salutation = box 'hello from' - print salutation - # print I5 # not done because register initialization is not guaranteed - print $S5 - $P0 = getinterp - $S0 = typeof $P0 - print $S0 - print ' tid ' - $I0 = $P0 - print $I0 - print "\n" -.end -CODE -ok 1 -hello from thread -ThreadInterpreter tid 1 -from 10 interp -OUTPUT - - -pir_output_is( <<'CODE', <<'OUTPUT', 'thread - kill' ); -.sub main :main - .local pmc threadsub - .local pmc thread - bounds 1 # assert slow core -S and -g are fine too - threadsub = get_global "foo" - thread = new ['ParrotThread'] - $I0 = thread - print 'start ' - print $I0 - print "\n" - thread.'run_clone'(threadsub) - - sleep 1 # to let the thread run - - thread.'kill'() - - print "done\n" -.end - -.sub foo - print "in thread\n" - # run an endles loop -lp: - noop - branch lp -.end -CODE -start -1 -in thread -done -OUTPUT - - -pir_output_is( <<'CODE', <<'OUTPUT', "join, get retval" ); -.sub _main :main :main - .const int MAX = 1000 - .local pmc kid - .local pmc Adder - Adder = get_global '_add' - kid = new ['ParrotThread'] - .local pmc from - from = new ['Integer'] - from = 0 - .local pmc to - to = new ['Integer'] - to = MAX - kid.'run_clone'(Adder, Adder, from, to) - - .local pmc result - result = kid.'join'() - print result - print "\n" - # sum = n * (n + 1)/2 - .local pmc Mul - Mul = new ['Integer'] - assign Mul, to - inc Mul - Mul = to * Mul - Mul = Mul / 2 - print Mul - print "\n" - end -.end - -.sub _add - .param pmc sub - .param pmc from - .param pmc to - .local pmc sum - sum = new ['Integer'] -loop: - add sum, from - inc from - le from, to, loop - - .begin_return - .set_return sum - .end_return -.end -CODE -500500 -500500 -OUTPUT - -pir_output_is( <<'CODE', <<'OUT', "sub name lookup in new thread" ); -.sub check - $P0 = get_global ['Foo'], 'foo' - $I0 = isa $P0, 'Sub' - if $I0 goto okay - print "not " -okay: - print "ok\n" -.end - -.sub main :main - check() - $P0 = new ['ParrotThread'] - .local pmc thread_main - thread_main = get_global 'thread_main' - $P0.'run_clone'(thread_main) - $P0.'join'() -.end - -.sub thread_main - check() -.end - -.namespace [ 'Foo' ] - -.sub foo - print "not reached\n" -.end -CODE -ok -ok -OUT - -pir_output_is( <<'CODE', <<'OUTPUT', "CLONE_CODE only" ); - -.namespace [ 'Test2' ] -.sub test2 - print "ok 2\n" -.end - -.namespace [ 'Test3' ] -.sub test3 - print "ok 3\n" -.end - -.namespace [ 'main' ] - -.include 'errors.pasm' -.sub thread_func - .param pmc test2 - print "ok 1\n" - test2() - .local pmc test3 - test3 = get_hll_global ['Test3'], 'test3' - test3() - .local pmc test4 - test4 = get_global 'test4' - if null test4 goto okay - print "not " -okay: - print "ok 4\n" -.end - -.include 'cloneflags.pasm' -.sub main :main - .local pmc test4 - .local pmc test2 - - test2 = get_hll_global ['Test2'], 'test2' - - test4 = new ['Integer'] - test4 = 42 - set_global 'test4', test4 - - .local pmc thread - thread = new ['ParrotThread'] - .local pmc thread_func - thread_func = get_global 'thread_func' - $I0 = .PARROT_CLONE_CODE - thread.'run'($I0, thread_func, test2) - thread.'join'() - print "ok 5\n" -.end -CODE -ok 1 -ok 2 -ok 3 -ok 4 -ok 5 -OUTPUT - -pir_output_is( <<'CODE', <<'OUTPUT', "CLONE_CODE | CLONE_GLOBALS" ); - -.namespace [ 'Foo' ] -.sub 'is' - .param pmc what - .param pmc expect - .param pmc label - .param pmc shortlabel - if what == expect goto okay - print "# " - print label - print "\n" - print "# got: " - print what - print "\n" - print "# expected: " - print expect - print "\nnot " -okay: - print "ok " - print shortlabel - print "\n" -.end - -.sub thread_test_func - $P0 = get_hll_global [ 'Bar' ], 'alpha' - 'is'($P0, 1, 'Bar::alpha == 1', 'alpha') - $P0 = 43 - sleep 0.2 # give enough time that the main thread might modify - # any shared Foo::beta can cause phantom errors - $P0 = get_global 'beta' - 'is'($P0, 2, 'Foo::beta == 2 [accessed locally]', 'beta1') - $P0 = 5 - $P0 = get_global 'beta' - 'is'($P0, 5, 'Foo::beta == 5 [accessed locally after assignment]', 'beta2') - $P0 = get_hll_global [ 'Foo' ], 'beta' - 'is'($P0, 5, 'Foo::beta == 5 [after assign; absolute]', 'beta3') -.end - -.namespace [ 'main' ] - -.sub test_setup - $P0 = new ['Integer'] - $P0 = 1 - set_hll_global [ 'Bar' ], 'alpha', $P0 - $P0 = new ['Integer'] - $P0 = 2 - set_hll_global [ 'Foo' ], 'beta', $P0 -.end - -.include 'cloneflags.pasm' -.sub main :main - 'test_setup'() - - .local pmc thread - thread = new ['ParrotThread'] - .local pmc _thread_func - _thread_func = get_hll_global [ 'Foo' ], 'thread_test_func' - $I0 = .PARROT_CLONE_CODE - bor $I0, $I0, .PARROT_CLONE_GLOBALS - print "in thread:\n" - thread.'run'($I0, _thread_func) - $P0 = get_hll_global [ 'Foo' ], 'beta' - $P0 = 42 - thread.'join'() - print "in main:\n" - $P0 = 2 - _thread_func() -.end -CODE -in thread: -ok alpha -ok beta1 -ok beta2 -ok beta3 -in main: -ok alpha -ok beta1 -ok beta2 -ok beta3 -OUTPUT - -TODO: { - 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' ] - -.sub foometh :method - print "called Foo's foometh\n" -.end - -.sub barmeth :method - print "called Foo's barmeth\n" -.end - -.namespace [ 'Bar' ] - -.sub barmeth :method - print "called Bar's barmeth\n" -.end - -.sub get_string :vtable :method - .return ("A Bar") -.end - -.namespace [ 'main' ] - -.sub init - $P1 = newclass 'Foo' - addattribute $P1, 'foo1' - addattribute $P1, 'foo2' - $P2 = subclass $P1, 'Bar' - addattribute $P2, 'bar1' -.end - -.sub thread_test_func - $P0 = new ['Bar'] - print $P0 - print "\n" - $P0.'barmeth'() - $P0.'foometh'() - $I0 = isa $P0, 'Integer' - print "Integer? " - print $I0 - print "\n" - $I0 = isa $P0, 'Foo' - print "Foo? " - print $I0 - print "\n" - $I0 = isa $P0, 'Bar' - print "Bar? " - print $I0 - print "\n" -.end - -.include 'cloneflags.pasm' -.sub main :main - init() - - .local pmc thread - thread = new ['ParrotThread'] - .local pmc _thread_func - _thread_func = get_hll_global ['main'], 'thread_test_func' - $I0 = .PARROT_CLONE_CODE - bor $I0, $I0, .PARROT_CLONE_CLASSES - print "in thread:\n" - thread.'run'($I0, _thread_func) - thread.'join'() - print "in main:\n" - _thread_func() -.end -CODE -in thread: -A Bar -called Bar's barmeth -called Foo's foometh -Integer? 0 -Foo? 1 -Bar? 1 -in main: -A Bar -called Bar's barmeth -called Foo's foometh -Integer? 0 -Foo? 1 -Bar? 1 -OUTPUT -} - -pir_output_is( <<'CODE', <<'OUTPUT', "CLONE_CODE | CLONE_CLASSES; superclass built-in", todo => 'likely incorrect test TT 1248'); -.namespace [ 'Foo' ] - -.sub foometh :method - print "called Foo's foometh\n" -.end - -.sub barmeth :method - print "called Foo's barmeth\n" -.end - -.namespace [ 'Bar' ] - -.sub barmeth :method - print "called Bar's barmeth\n" -.end - -.sub get_string :vtable :method - .return ("A Bar") -.end - -.namespace [ 'main' ] - -.sub init - $P0 = get_class 'Integer' - $P1 = subclass $P0, 'Foo' - addattribute $P1, 'foo1' - addattribute $P1, 'foo2' - $P2 = subclass $P1, 'Bar' - addattribute $P2, 'bar1' -.end - -.sub thread_test_func - $P0 = new ['Bar'] - print $P0 - print "\n" - $P0.'barmeth'() - $P0.'foometh'() - $I0 = isa $P0, 'Integer' - print "Integer? " - print $I0 - print "\n" - $I0 = isa $P0, 'Foo' - print "Foo? " - print $I0 - print "\n" - $I0 = isa $P0, 'Bar' - print "Bar? " - print $I0 - print "\n" -.end - -.include 'cloneflags.pasm' -.sub main :main - init() - - .local pmc thread - thread = new ['ParrotThread'] - .local pmc _thread_func - _thread_func = get_global 'thread_test_func' - $I0 = .PARROT_CLONE_CODE - bor $I0, $I0, .PARROT_CLONE_CLASSES - print "in thread:\n" - thread.'run'($I0, _thread_func) - thread.'join'() - print "in main:\n" - _thread_func() -.end -CODE -in thread: -A Bar -called Bar's barmeth -called Foo's foometh -Integer? 1 -Foo? 1 -Bar? 1 -in main: -A Bar -called Bar's barmeth -called Foo's foometh -Integer? 1 -Foo? 1 -Bar? 1 -OUTPUT - -pir_output_is( <<'CODE', <<'OUTPUT', "CLONE_CODE | CLONE_GLOBALS| CLONE_HLL" ); -.HLL 'Test' -.sub setup - $P0 = new ['Integer'] - $P0 = 42 - set_global 'x', $P0 -.end - -.include 'interpinfo.pasm' -.sub test - $P0 = get_global 'x' - if $P0 == 42 goto okay1 - print "not " -okay1: - print "ok 1\n" - $P1 = get_root_namespace - $P1 = $P1['test'] - $P1 = $P1['x'] - $P1 = 43 - if $P0 == 43 goto okay2 - print "not " -okay2: - print "ok 2\n" -.end - -.HLL '' - -.include 'cloneflags.pasm' - -.sub main :main - .local pmc setup - .local pmc test - setup = get_root_namespace - setup = setup['test'] - test = setup['test'] - setup = setup['setup'] - setup() - - .local pmc thread - .local int flags - thread = new ['ParrotThread'] - flags = .PARROT_CLONE_CODE - bor flags, flags, .PARROT_CLONE_GLOBALS - bor flags, flags, .PARROT_CLONE_HLL - print "in thread:\n" - thread.'run'(flags, test) - thread.'join'() - print "in main:\n" - test() -.end -CODE -in thread: -ok 1 -ok 2 -in main: -ok 1 -ok 2 -OUTPUT - -# 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 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: " - say what - print "# expected: " - say expect - print "not ok " - print number - say desc - inc number - $P0 = interpinfo .INTERPINFO_CURRENT_CONT -loop: - $I0 = defined $P0 - if $I0 == 0 goto done - print " " - say $P0 - $P0 = $P0.'continuation'() - branch loop -done: - .return () -okay: - print "ok " - print number - inc number - say desc -.end - -.sub setup - $P0 = new ['Integer'] - $P0 = 1 - set_global 'foo', $P0 -.end - -.sub _check_sanity - .param string desc - $P0 = get_global 'foo' - $P1 = get_hll_global [ 'Foo' ], 'foo' - is($P0, $P1, desc) -.end - -.sub mutate - $P0 = new ['Integer'] - $P0 = 2 - set_global 'foo', $P0 -.end - -.sub check_sanity -# _check_sanity( 'direct call' ) - $P0 = get_global '_check_sanity' - $P0( 'call from get_global' ) - $P0 = get_hll_global [ 'Foo' ], '_check_sanity' - $P0( 'call from get_hll_global' ) -.end - -.sub _check_value - .param int value - $P0 = get_global 'foo' - is($P0, value) -.end - -.sub check_value - .param int value -# _check_value(value) - $P0 = get_global '_check_value' - $P0(value) - $P0 = get_hll_global [ 'Foo' ], '_check_value' - $P0(value) -.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' - - .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' - .local pmc g_sanity - g_sanity = get_hll_global [ 'Foo' ], 'check_sanity' - .local pmc g_mutate - g_mutate = get_hll_global [ 'Foo' ], 'mutate' - .local pmc g_value - g_value = get_hll_global [ 'Foo' ], 'check_value' - - c_setup() - c_sanity() - g_sanity() - c_value(1) - g_value(1) - c_mutate() - c_value(2) - g_value(2) - c_sanity() - g_sanity() - - g_setup() - c_sanity() - g_sanity() - c_value(1) - g_value(1) - g_mutate() - c_value(2) - g_value(2) - c_sanity() - g_sanity() -.end - - - -.sub main :main - $P0 = new ['Integer'] - $P0 = 1 - set_global 'test_num', $P0 - - .const 'Sub' _check = 'full_check' - _check() - - $P0 = new ['ParrotThread'] - $P0.'run_clone'(_check) - $P0.'join'() -.end -CODE - -pir_output_is( - <<'CODE', <<'OUTPUT', 'CLONE_CODE|CLONE_GLOBALS|CLONE_HLL|CLONE_LIBRARIES - TT # 1250' ); -.HLL 'Perl' - -.include 'interpinfo.pasm' - -.loadlib 'foo_group' - -.sub test - .param pmc passed_value - .local pmc the_value - the_value = new ['Integer'] - the_value = 42 - 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 - ns = $P0.'get_namespace'() - ns = ns['Foo'] - $P0 = ns['x'] - if $P0 == the_value goto okay - print "not " -okay: - say "ok (equal)" - - $I0 = the_value - say $I0 -.end - -.include 'cloneflags.pasm' - -.sub main :main - .local pmc thread - .local int flags - thread = new ['ParrotThread'] - flags = .PARROT_CLONE_CODE - bor flags, flags, .PARROT_CLONE_GLOBALS - bor flags, flags, .PARROT_CLONE_HLL - bor flags, flags, .PARROT_CLONE_LIBRARIES - - .local pmc passed - passed = new ['Foo'] - passed = 15 - - .local pmc thread_func - thread_func = get_global 'test' - say "in thread:" - thread.'run'(flags, thread_func, passed) - thread.'join'() - say "in main:" - thread_func(passed) -.end -CODE -in thread: -0 -ok (equal) -42 -in main: -0 -ok (equal) -42 -OUTPUT - -# Local Variables: -# mode: cperl -# cperl-indent-level: 4 -# fill-column: 100 -# End: -# vim: expandtab shiftwidth=4: diff --git a/t/pmc/timer.t b/t/pmc/timer.t index 3b7717ee25..aa4fe02c82 100644 --- a/t/pmc/timer.t +++ b/t/pmc/timer.t @@ -1,16 +1,9 @@ -#! perl -# Copyright (C) 2001-2008, Parrot Foundation. - -use strict; -use warnings; -use lib qw( . lib ../lib ../../lib ); -use Test::More; -use Parrot::Test tests => 8; -use Parrot::Config; +#!./parrot +# Copyright (C) 2001-2012, Parrot Foundation. =head1 NAME -t/pmc/timer.t - Timer PMCs +t/pmc/timer.t - Timer PMC tests =head1 SYNOPSIS @@ -22,290 +15,165 @@ Tests the Timer PMC. =cut -$ENV{TEST_PROG_ARGS} ||= ''; - -pasm_output_is( <<'CODE', <<'OUT', "Timer setup" ); -.pcc_sub :main main: -.include "timer.pasm" - new P0, ['Timer'] - set P0[.PARROT_TIMER_SEC], 7 - set I0, P0[.PARROT_TIMER_SEC] - eq I0, 7, ok1 - print "not " -ok1: - print "ok 1\n" - set I0, P0[.PARROT_TIMER_USEC] - eq I0, 0, ok2 - print "not " -ok2: - print "ok 2\n" - - set I0, P0[.PARROT_TIMER_RUNNING] - eq I0, 0, ok3 - print "not " -ok3: - print "ok 3\n" - - # ensure destroy() is called. - null P0 - sweep 1 - end -CODE -ok 1 -ok 2 -ok 3 -OUT - -pasm_output_is( <<'CODE', <<'OUT', "Timer param test/invoke" ); -.include "timer.pasm" - -.pcc_sub :main main: - - new P0, ['Timer'] - - set P0[.PARROT_TIMER_INTERVAL], 2.2 - set P0[.PARROT_TIMER_INTERVAL], 2 +.sub tick + get_global $P0, 'counter' + inc $P0 +.end - set I0, P0[.PARROT_TIMER_INTERVAL] - say I0 +.sub main :main + .include 'test_more.pir' + .include "timer.pasm" + plan(17) + timer_setup() + timer_initialize() + timer_start_stop() + timer_repeat() + timer_start() + timer_stop() +.end - set I0, P0[99999] - say I0 +.sub timer_stop + .local pmc timer + .local int t1, t2, r + .const 'Sub' tick = 'tick' + $P0 = new 'Integer' + set_global 'counter', $P0 + timer = new ['Timer'] + timer[.PARROT_TIMER_HANDLER] = tick + timer[.PARROT_TIMER_INTERVAL] = 0.1 + timer[.PARROT_TIMER_REPEAT] = -1 + timer[.PARROT_TIMER_RUNNING] = 1 + # Allow at least two ticks + sleep 0.2 + sleep 0.2 + timer[.PARROT_TIMER_RUNNING] = 0 + # Give a chance to run a possible pending tick + sleep 0.2 + get_global $P0, 'counter' + t1 = $P0 + r = isgt t1, 1 + is(r,1,'counter = 1') + # Give a chance to tick to verify that is stopped + sleep 0.2 + sleep 0.2 + get_global $P0, 'counter' + t2 = $P0 + r = iseq t1, t2 + is(r,1,'counter = 1') +.end - set N0, P0[99999] - say N0 +.sub timer_start + new $P1, ['FixedPMCArray'] + set $P1, 6 + set $P1[0], .PARROT_TIMER_NSEC + set $P1[1], 0.5 + set $P1[2], .PARROT_TIMER_HANDLER + get_global $P2, "_timer_sub2" + set $P1[3], $P2 + set $P1[4], .PARROT_TIMER_RUNNING + set $P1[5], 1 + + new $P0, ['Timer'], $P1 + ok(1,'timer start') + sleep 1 + ok(1,'timer start') +.end - get_global P1, "_timer_sub" - set P0[.PARROT_TIMER_HANDLER], P1 - null P1 +.sub timer_repeat + new $P1, ['FixedPMCArray'] + set $P1, 8 + set $P1[0], .PARROT_TIMER_NSEC + set $P1[1], 0.2 + set $P1[2], .PARROT_TIMER_HANDLER + get_global $P2, "_timer_sub2" + set $P1[3], $P2 + set $P1[4], .PARROT_TIMER_REPEAT + set $P1[5], 2 + set $P1[6], .PARROT_TIMER_RUNNING + set $P1[7], 1 + + new $P0, ['Timer'], $P1 + ok(1,'repeat 1') + sleep 1 + sleep 1 + sleep 1 + sleep 1 + ok(1,'repeat 3') +.end - set P1, P0[.PARROT_TIMER_HANDLER] - unless_null P1, ok1 - print "not " -ok1:say "ok 1" +.sub timer_setup + new $P0, ['Timer'] + set $P0[.PARROT_TIMER_SEC], 7 + set $I0, $P0[.PARROT_TIMER_SEC] + $I1 = iseq $I0, 7 + ok($I1,'PARROT_TIMER_SEC') - set P1, P0[99999] - if_null P1, ok2 - print "not " -ok2:say "ok 2" + set $I2, $P0[.PARROT_TIMER_USEC] + $I3 = iseq $I2, 0 + ok($I3,'PARROT_TIMER_USEC') - push_eh ok3 - set P0[99999], 2 - print "no " -ok3:pop_eh - say "exception 1" + set $I0, $P0[.PARROT_TIMER_RUNNING] + $I1 = eq $I0, 0 + ok($I1,'PARROT_TIMER_RUNNING') +.end - push_eh ok4 - set P0[99999], 2.2 - print "no " -ok4:pop_eh - say "exception 2" +.sub timer_initialize + new $P1, ['FixedPMCArray'] + set $P1, 4 + set $P1[0], .PARROT_TIMER_SEC + set $P1[1], 8 + set $P1[2], .PARROT_TIMER_USEC + set $P1[3], 400000 - invokecc P0 - end + new $P0, ['Timer'], $P1 + set $I0, $P0[.PARROT_TIMER_SEC] -.pcc_sub _timer_sub: - say "hello world" - returncc -CODE -2 --1 --1 -ok 1 -ok 2 -exception 1 -exception 2 -hello world -OUT + $I1 = iseq $I0, 8 + ok($I1,'PARROT_TIMER_SEC') -pasm_output_is( <<'CODE', <<'OUT', "Timer setup - initializer" ); -.pcc_sub :main main: -.include "timer.pasm" - new P1, ['FixedPMCArray'] - set P1, 5 - set P1[0], .PARROT_TIMER_SEC - set P1[1], 8 - set P1[2], .PARROT_TIMER_USEC - set P1[3], 400000 - set P1[4], 24829375976 # test default case + set $I0, $P0[.PARROT_TIMER_USEC] - new P0, ['Timer'], P1 - set I0, P0[.PARROT_TIMER_SEC] - eq I0, 8, ok1 - print "not " -ok1: - print "ok 1\n" - set I0, P0[.PARROT_TIMER_USEC] - eq I0, 400000, ok2 - eq I0, 400001, ok2 - eq I0, 399999, ok2 - print "not " -ok2: - print "ok 2\n" + # I0 should be one of the following three + $I1 = iseq $I0, 400000 + $I2 = iseq $I0, 400001 + $I3 = iseq $I0, 399999 - set I0, P0[.PARROT_TIMER_RUNNING] - eq I0, 0, ok3 - print "not " -ok3: - print "ok 3\n" - end -CODE -ok 1 -ok 2 -ok 3 -OUT + $I4 = $I1 + $I2 + $I4 += $I3 + # so we assert the sum of the above registers is 1 + is($I4,1,'PARROT_TIMER_USEC') +.end -SKIP: { - skip( "No thread enabled", 3 ) unless ( $PConfig{HAS_THREADS} ); +.sub timer_start_stop + $P1 = new ['FixedPMCArray'], 6 + set $P1[0], .PARROT_TIMER_NSEC + set $P1[1], 0.5 + set $P1[2], .PARROT_TIMER_HANDLER + get_global $P2, "_timer_sub" + set $P1[3], $P2 + set $P1[4], .PARROT_TIMER_RUNNING + set $P1[5], 1 - pasm_output_like( <<'CODE', <<'OUT', "Timer setup - initializer/start" ); - .pcc_sub :main main: -.include "timer.pasm" - new P1, ['FixedPMCArray'] - set P1, 6 - set P1[0], .PARROT_TIMER_NSEC - set P1[1], 0.5 - set P1[2], .PARROT_TIMER_HANDLER - get_global P2, "_timer_sub" - set P1[3], P2 - set P1[4], .PARROT_TIMER_RUNNING - set P1[5], 1 + $P0 = new ['Timer'], $P1 + ok(1,'created Timer PMC') - new P0, ['Timer'], P1 - print "ok 1\n" + set $P0[.PARROT_TIMER_RUNNING], 0 sleep 1 - print "ok 3\n" - end -.pcc_sub _timer_sub: - print "ok 2\n" - returncc -CODE -/ok 2/ -OUT - - pasm_output_is( <<'CODE', <<'OUT', "Timer setup - initializer/start/stop" ); - .pcc_sub :main main: -.include "timer.pasm" - new P1, ['FixedPMCArray'] - set P1, 6 - set P1[0], .PARROT_TIMER_NSEC - set P1[1], 0.5 - set P1[2], .PARROT_TIMER_HANDLER - get_global P2, "_timer_sub" - set P1[3], P2 - set P1[4], .PARROT_TIMER_RUNNING - set P1[5], 1 + ok(1,'slept after stopping timer') +.end - new P0, ['Timer'], P1 - print "ok 1\n" - # stop the timer - set P0[.PARROT_TIMER_RUNNING], 0 - sleep 1 - print "ok 2\n" - end -.pcc_sub _timer_sub: +.sub _timer_sub print "never\n" returncc -CODE -ok 1 -ok 2 -OUT - - my @todo = $ENV{TEST_PROG_ARGS} =~ /--runcore=jit/ ? - ( todo => 'TT #1316, add scheduler features to JIT' ) : (); - pasm_output_is( <<'CODE', <<'OUT', "Timer setup - initializer/start/repeat" , @todo ); - .pcc_sub :main main: -.include "timer.pasm" - new P1, ['FixedPMCArray'] - set P1, 8 - set P1[0], .PARROT_TIMER_NSEC - set P1[1], 0.2 - set P1[2], .PARROT_TIMER_HANDLER - get_global P2, "_timer_sub" - set P1[3], P2 - set P1[4], .PARROT_TIMER_REPEAT - set P1[5], 2 - set P1[6], .PARROT_TIMER_RUNNING - set P1[7], 1 - - new P0, ['Timer'], P1 - print "ok 1\n" - sleep 1 - sleep 1 - sleep 1 - sleep 1 - print "ok 3\n" - end -.pcc_sub _timer_sub: - print "ok 2\n" - returncc -CODE -ok 1 -ok 2 -ok 2 -ok 2 -ok 3 -OUT -} - -pir_output_is( << 'CODE', << 'OUTPUT', "check whether interface is done" ); - -.sub _main :main - .local pmc pmc1 - pmc1 = new ['Timer'] - .local int bool1 - does bool1, pmc1, "scalar" - print bool1 - print "\n" - does bool1, pmc1, "event" - 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', "Timer - many repetitions" ); - -.include 'timer.pasm' - -.sub expired - $P0 = get_global "expired_count" - inc $P0 -.end - -.sub main :main - $P2 = new 'Integer' - set_global "expired_count", $P2 - - $P0 = new 'Timer' - $P1 = get_global "expired" - - $P0[.PARROT_TIMER_HANDLER] = $P1 - $P0[.PARROT_TIMER_SEC] = 0 - $P0[.PARROT_TIMER_REPEAT] = 9999 - $P0[.PARROT_TIMER_RUNNING] = 1 - -loop: - sleep 0 - if $P2 < 10000 goto loop - - sleep 0.5 - say $P2 +.sub _timer_sub2 + ok(1,'timer_sub2') + returncc .end -CODE -10000 -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: diff --git a/t/run/options.t b/t/run/options.t index 35a69d5b0c..49cf747bc9 100644 --- a/t/run/options.t +++ b/t/run/options.t @@ -90,7 +90,7 @@ $cmd = qq{"$PARROT" -D 8 -R slow "$second_pir_file" 2>&1}; like( qx{$cmd}, qr/Parrot VM: slow core/, "-r option <$cmd>" ); } -## TT #1150 test remaining options +## GH #346 test remaining options # Test --runtime-prefix like( qx{$PARROT --runtime-prefix}, qr/^.+$/, "--runtime-prefix" ); diff --git a/t/src/atomic.t b/t/src/atomic.t deleted file mode 100644 index b34a0d9889..0000000000 --- a/t/src/atomic.t +++ /dev/null @@ -1,243 +0,0 @@ -#!perl -# Copyright (C) 2006, Parrot Foundation. - -use strict; -use warnings; - -use lib qw(. lib ../lib ../../lib ); - -use Test::More; -use Parrot::Test; -use Parrot::Config; -use File::Spec::Functions; - -=head1 NAME - -t/src/atomic.t - Parrot Atomic operations - -=head1 SYNPOSIS - - % prove t/src/atomic.t - -=head1 DESCRIPTION - -Tests atomic operation support. - -=cut - -# generic tests - -plan skip_all => 'src/parrot_config.o does not exist' unless -e catfile(qw/src parrot_config.o/); - -plan tests => 4; - -c_output_is( <<'CODE', <<'OUTPUT', "PARROT_ATOMIC_PTR_GET/SET" ); - -#include -#include -#include - -int main(int argc, char* argv[]) -{ - void * dummy; - void * result; - Parrot_atomic_pointer a_ptr; - - dummy = (void *) "somewhere"; - result = (void *) "somewhere else"; - - PARROT_ATOMIC_PTR_INIT(a_ptr); - - PARROT_ATOMIC_PTR_SET(a_ptr, dummy); - - PARROT_ATOMIC_PTR_GET(result, a_ptr); - - if (result != dummy) { - fputs("not ", stdout); - } - - fputs("ok 1\n", stdout); - - PARROT_ATOMIC_PTR_SET(a_ptr, NULL); - - PARROT_ATOMIC_PTR_GET(result, a_ptr); - - if (result) { - fputs("not ", stdout); - } - - fputs("ok 2\n", stdout); - - PARROT_ATOMIC_PTR_DESTROY(a_ptr); - - return EXIT_SUCCESS; -} -CODE -ok 1 -ok 2 -OUTPUT - -c_output_is( <<'CODE', <<'OUTPUT', "PARROT_ATOMIC_INT_GET/SET" ); - -#include -#include -#include - -int main(int argc, char* argv[]) -{ - INTVAL result; - Parrot_atomic_integer a_int; - - PARROT_ATOMIC_INT_INIT(a_int); - - PARROT_ATOMIC_INT_SET(a_int, 0x7fff); - - PARROT_ATOMIC_INT_GET(result, a_int); - - if (result != 0x7fff) { - fputs("not ", stdout); - } - - fputs("ok 1\n", stdout); - - PARROT_ATOMIC_INT_SET(a_int, -1); - - PARROT_ATOMIC_INT_GET(result, a_int); - - if (result != -1) { - fputs("not ", stdout); - } - - fputs("ok 2\n", stdout); - - PARROT_ATOMIC_INT_DESTROY(a_int); - - return EXIT_SUCCESS; -} -CODE -ok 1 -ok 2 -OUTPUT - -c_output_is( <<'CODE', <<'OUTPUT', "PARROT_ATOMIC_PTR_CAS" ); - -#include -#include -#include - -int main(int argc, char *argv[]) -{ - int success_p; - void *value; - Parrot_atomic_pointer a_ptr; - void *tmp_a; - void *tmp_b; - - tmp_a = (void *) "string a"; - tmp_b = (void *) "string b"; - - PARROT_ATOMIC_PTR_INIT(a_ptr); - - PARROT_ATOMIC_PTR_SET(a_ptr, NULL); - - PARROT_ATOMIC_PTR_CAS(success_p, a_ptr, tmp_a, tmp_b); - - if (success_p) { - fputs("not ", stdout); - } - fputs("ok 1\n", stdout); - - PARROT_ATOMIC_PTR_CAS(success_p, a_ptr, NULL, tmp_a); - - if (!success_p) { - fputs("not ", stdout); - } - fputs("ok 2\n", stdout); - - PARROT_ATOMIC_PTR_CAS(success_p, a_ptr, tmp_a, tmp_b); - - if (!success_p) { - fputs("not ", stdout); - } - fputs("ok 3\n", stdout); - - PARROT_ATOMIC_PTR_GET(value, a_ptr); - if (value != tmp_b) { - fputs("not ", stdout); - } - - fputs("ok 4\n", stdout); - - PARROT_ATOMIC_PTR_DESTROY(a_ptr); - - return EXIT_SUCCESS; -} -CODE -ok 1 -ok 2 -ok 3 -ok 4 -OUTPUT - -c_output_is( <<'CODE', <<'OUTPUT', "PARROT_ATOMIC_INT_(CAS|INC|DEC)" ); -#include -#include -#include - -int main(int argc, char* argv[]) -{ - int i; - Parrot_atomic_integer a_int; - - PARROT_ATOMIC_INT_INIT(a_int); - - PARROT_ATOMIC_INT_SET(a_int, 0x7fff); - - for (i = 0; i < 0x7fff; ++i) { - int cur; - PARROT_ATOMIC_INT_DEC(cur, a_int); - if (cur != 0x7fff - i - 1) { - printf("DEC: error at i=%d / cur=%d\n", i, cur); - return EXIT_FAILURE; - } - } - - { - int cur; - PARROT_ATOMIC_INT_DEC(cur, a_int); - if (-1 != cur) { - printf("-1 != cur\n"); - return EXIT_FAILURE; - } - PARROT_ATOMIC_INT_INC(cur, a_int); - if (0 != cur) { - printf("0 != cur\n"); - return EXIT_FAILURE; - } - PARROT_ATOMIC_INT_CAS(cur, a_int, 0, 42); - if (!cur) { - printf("CAS failed\n"); - return EXIT_FAILURE; - } - PARROT_ATOMIC_INT_INC(cur, a_int); - if (cur != 43) { - printf("INC failed after CAS\n"); - return EXIT_FAILURE; - } - } - - PARROT_ATOMIC_INT_DESTROY(a_int); - - puts("ok 1"); - return EXIT_SUCCESS; -} -CODE -ok 1 -OUTPUT - -# Local Variables: -# mode: cperl -# cperl-indent-level: 4 -# fill-column: 100 -# End: -# vim: expandtab shiftwidth=4: diff --git a/t/src/basic.t b/t/src/basic.t index e90cd7f9b6..21a972b978 100644 --- a/t/src/basic.t +++ b/t/src/basic.t @@ -6,9 +6,12 @@ use warnings; use lib qw( . lib ../lib ../../lib ); use Test::More; use Parrot::Test; +use Parrot::Config; use File::Spec::Functions; -plan skip_all => 'src/parrot_config.o does not exist' unless -e catfile(qw/src parrot_config.o/); +my $parrot_config = "parrot_config" . $PConfig{o}; + +plan skip_all => 'src/parrot_config.o does not exist' unless -e catfile("src", $parrot_config); plan tests => 2; diff --git a/t/src/checkdepend.t b/t/src/checkdepend.t index d0b97980d4..25f3e72c2b 100644 --- a/t/src/checkdepend.t +++ b/t/src/checkdepend.t @@ -312,6 +312,7 @@ sub is_list_same { $exp_msg .= "$file($exp{$file})\n"; } + local $Test::Builder::Level = $Test::Builder::Level + 1; is ($got_msg, $exp_msg, $test); return; } diff --git a/t/src/embed.t b/t/src/embed.t index f6437f6bf9..b24c28615e 100644 --- a/t/src/embed.t +++ b/t/src/embed.t @@ -9,9 +9,11 @@ use Parrot::Test; use Parrot::Config; use File::Spec::Functions; -plan skip_all => 'src/parrot_config.o does not exist' unless -e catfile(qw/src parrot_config.o/); +my $parrot_config = "parrot_config" . $PConfig{o}; -plan tests => 16; +plan skip_all => 'src/parrot_config.o does not exist' unless -e catfile("src", $parrot_config); + +plan tests => 13; =head1 NAME @@ -40,7 +42,7 @@ my $common = linedirective(__LINE__) . <<'CODE'; #include #include #include -#include "parrot/embed.h" +#include "parrot/parrot.h" #include "parrot/extend.h" #include "parrot/extend_vtable.h" #include "imcc/api.h" @@ -62,7 +64,7 @@ static Parrot_String createstring(Parrot_Interp interp, const char * value) static Parrot_Interp new_interp() { - Parrot_Interp interp = Parrot_new(NULL); + Parrot_Interp interp = Parrot_interp_new(NULL); if (!interp) fail("Cannot create parrot interpreter"); return interp; @@ -71,40 +73,11 @@ static Parrot_Interp new_interp() CODE -c_output_is(linedirective(__LINE__) . <<'CODE', <<'OUTPUT', "Minimal embed, using just the embed.h header" ); - -#include -#include -#include "parrot/embed.h" - -void fail(const char *msg); - -void fail(const char *msg) -{ - fprintf(stderr, "failed: %s\n", msg); - exit(EXIT_FAILURE); -} - -int main(int argc, const char **argv) -{ - Parrot_Interp interp; - interp = Parrot_new(NULL); - if (! interp) - fail("Cannot create parrot interpreter"); - - puts("Done"); - Parrot_destroy(interp); - return 0; -} -CODE -Done -OUTPUT - c_output_is(linedirective(__LINE__) . <<'CODE', <<'OUTPUT', "Minimal embed, create multiple interps" ); #include #include -#include "parrot/embed.h" +#include "parrot/parrot.h" void fail(const char *msg); @@ -117,18 +90,18 @@ void fail(const char *msg) int main(int argc, const char **argv) { Parrot_Interp interp1, interp2; - interp1 = Parrot_new(NULL); + interp1 = Parrot_interp_new(NULL); if (!interp1) fail("Cannot create 1st parrot interpreter"); - interp2 = Parrot_new(interp1); + interp2 = Parrot_interp_new(interp1); if (!interp2) fail("Cannot create 2nd parrot interpreter"); puts("Done"); - Parrot_destroy(interp1); - Parrot_destroy(interp2); + Parrot_interp_destroy(interp1); + Parrot_interp_destroy(interp2); puts("Really done"); return 0; } @@ -137,12 +110,12 @@ Done Really done OUTPUT -c_output_is(linedirective(__LINE__) . <<'CODE', <<'OUTPUT', "Minimal embed, create multiple interps without giving 1st interp to Parrot_new ", todo => 'TT #1880 : Parrot_new requires the 1st interp created as an argument'); +c_output_is(linedirective(__LINE__) . <<'CODE', <<'OUTPUT', "Minimal embed, create multiple interps without giving 1st interp to Parrot_interp_new "); #include #include -#include "parrot/embed.h" +#include "parrot/parrot.h" void fail(const char *msg); @@ -155,18 +128,18 @@ void fail(const char *msg) int main(int argc, const char **argv) { Parrot_Interp interp1, interp2; - interp1 = Parrot_new(NULL); + interp1 = Parrot_interp_new(NULL); if (!interp1) fail("Cannot create 1st parrot interpreter"); - interp2 = Parrot_new(NULL); + interp2 = Parrot_interp_new(NULL); if (!interp2) fail("Cannot create 2nd parrot interpreter"); puts("Done"); - Parrot_destroy(interp1); - Parrot_destroy(interp2); + Parrot_interp_destroy(interp1); + Parrot_interp_destroy(interp2); puts("Really done"); return 0; } @@ -184,14 +157,14 @@ int main(int argc, const char **argv) Parrot_PMC func_pmc; char *str; - interp = Parrot_new(NULL); + interp = Parrot_interp_new(NULL); if (! interp) fail("Cannot create parrot interpreter"); lang = createstring(interp, "PIR"); func_pmc = Parrot_compile_string(interp, lang, ".sub foo\n copy\n.end", &err); Parrot_printf(interp, "%Ss\n", err); - Parrot_destroy(interp); + Parrot_interp_destroy(interp); return 0; } CODE @@ -207,14 +180,14 @@ int main(int argc, const char **argv) Parrot_PMC func_pmc; char *str; - interp = Parrot_new(NULL); + interp = Parrot_interp_new(NULL); if (! interp) fail("Cannot create parrot interpreter"); lang = createstring(interp, "Foo"); func_pmc = Parrot_compile_string(interp, lang, "This doesn't matter", &err); Parrot_printf(interp, "%Ss\n", err); - Parrot_destroy(interp); + Parrot_interp_destroy(interp); return 0; } CODE @@ -231,7 +204,7 @@ int main(int argc, const char **argv) Parrot_PMC func_pmc; char *str; - interp = Parrot_new(NULL); + interp = Parrot_interp_new(NULL); if (! interp) fail("Cannot create parrot interpreter"); lang = createstring(interp, "PIR"); @@ -239,7 +212,7 @@ int main(int argc, const char **argv) func_pmc = Parrot_compile_string(interp, lang, "The sleeper must awake", &err); Parrot_printf(interp,"Caught exception\n"); Parrot_printf(interp, "%Ss\n", err); - Parrot_destroy(interp); + Parrot_interp_destroy(interp); return 0; } CODE @@ -257,7 +230,7 @@ int main(void) Parrot_PMC code; /* Create the interpreter and show a message using parrot io */ - interp = Parrot_new(NULL); + interp = Parrot_interp_new(NULL); if (! interp) fail("Cannot create parrot interpreter"); Parrot_printf(interp, "Hello, parrot\n"); @@ -274,7 +247,7 @@ int main(void) ); Parrot_ext_call(interp, code, "->"); - Parrot_destroy(interp); + Parrot_interp_destroy(interp); return 0; } CODE @@ -298,7 +271,7 @@ int main(void) Parrot_PMC sub; /* Create the interpreter */ - interp = Parrot_new(NULL); + interp = Parrot_interp_new(NULL); if (! interp) fail("Cannot create parrot interpreter"); @@ -328,7 +301,7 @@ int main(void) /* Execute it */ Parrot_ext_call(interp, sub, "->"); - Parrot_destroy(interp); + Parrot_interp_destroy(interp); return 0; } CODE @@ -352,7 +325,7 @@ int main(void) Parrot_String retstr; /* Create the interpreter */ - interp = Parrot_new(NULL); + interp = Parrot_interp_new(NULL); if (! interp) fail("Cannot create parrot interpreter"); @@ -387,7 +360,7 @@ int main(void) Parrot_ext_call(interp, sub, "S->S", msg, &retstr); Parrot_printf(interp, "%Ss\n", retstr); - Parrot_destroy(interp); + Parrot_interp_destroy(interp); return 0; } CODE @@ -403,7 +376,7 @@ int main(void) Parrot_String compiler, errstr, parrotname, subname, msg; /* Create the interpreter */ - interp = Parrot_new(NULL); + interp = Parrot_interp_new(NULL); if (! interp) fail("Cannot create parrot interpreter"); @@ -442,7 +415,7 @@ int main(void) Parrot_ext_call(interp, sub, "S->P", msg, &ret); Parrot_printf(interp, "%.1Pf is the answer. What is the question?\n", ret); - Parrot_destroy(interp); + Parrot_interp_destroy(interp); return 0; } CODE @@ -459,7 +432,7 @@ int main(void) Parrot_PMC res1, res2; /* Create the interpreter */ - interp = Parrot_new(NULL); + interp = Parrot_interp_new(NULL); if (! interp) fail("Cannot create parrot interpreter"); @@ -502,7 +475,7 @@ int main(void) Parrot_printf(interp, "%.1Pf is the answer and pi*100 = %.1Pf\n", res1, res2); - Parrot_destroy(interp); + Parrot_interp_destroy(interp); return 0; } CODE @@ -526,7 +499,7 @@ int main(void) Parrot_Float ret; /* Create the interpreter */ - interp = Parrot_new(NULL); + interp = Parrot_interp_new(NULL); if (! interp) fail("Cannot create parrot interpreter"); @@ -560,58 +533,13 @@ int main(void) Parrot_ext_call(interp, sub, "S->N", msg, &ret); Parrot_printf(interp, "%.1f is the answer. What is the question?\n", ret); - Parrot_destroy(interp); + Parrot_interp_destroy(interp); return 0; } CODE 42.0 is the answer. What is the question? OUTPUT - -c_output_is($common . linedirective(__LINE__) . <<'CODE', <<'OUTPUT', "External sub", todo => "Must explicitly set a PIR compreg" ); - -void hello(Parrot_Interp interp); - -void hello(Parrot_Interp interp) -{ - Parrot_printf(interp, "Hello from C\n"); -} - -int main(void) -{ - Parrot_Interp interp; - Parrot_String compiler; - Parrot_String errstr; - Parrot_PMC code; - Parrot_PMC hellosub, pir_compiler, pasm_compiler, interp_pmc; - - /* Create the interpreter */ - interp = new_interp(); - - imcc_get_pir_compreg_api(interp_pmc, 1, &pir_compiler); - imcc_get_pir_compreg_api(interp_pmc, 1, &pasm_compiler); - - /* Compile pir */ - compiler = createstring(interp, "PIR"); - code = Parrot_compile_string(interp, compiler, -".sub externcall :main\n" -" .param pmc ec\n" -" ec()\n" -"\n" -".end\n" -"\n", - &errstr - ); - hellosub = Parrot_sub_new_from_c_func(interp, (void (*)())& hello, "vJ"); - Parrot_ext_call(interp, code, "P->", hellosub); - - Parrot_destroy(interp); - return 0; -} -CODE -Hello from C -OUTPUT - c_output_is($common . linedirective(__LINE__) . <<'CODE', <<'OUTPUT', "Insert external sub in namespace", todo => "Must explicitly set a PIR compreg" ); void hello(Parrot_Interp interp); @@ -627,7 +555,6 @@ int main(void) Parrot_String compiler, pir_compiler; Parrot_String errstr; Parrot_PMC code; - Parrot_PMC hellosub; Parrot_PMC rootns; Parrot_String parrotname; Parrot_PMC parrotns; @@ -635,7 +562,7 @@ int main(void) void *discard; /* Create the interpreter */ - interp = Parrot_new(NULL); + interp = Parrot_interp_new(NULL); if (! interp) fail("Cannot create parrot interpreter"); @@ -655,14 +582,13 @@ int main(void) rootns = Parrot_get_root_namespace(interp); parrotname = createstring(interp, "parrot"); parrotns = Parrot_PMC_get_pmc_keyed_str(interp, rootns, parrotname); - hellosub = Parrot_sub_new_from_c_func(interp, (void (*)())& hello, "vJ"); helloname = createstring(interp, "hello"); Parrot_PMC_set_pmc_keyed_str(interp, parrotns, helloname, hellosub); /* Call it */ Parrot_ext_call(interp, code, "->"); - Parrot_destroy(interp); + Parrot_interp_destroy(interp); return 0; } CODE @@ -680,7 +606,7 @@ SKIP: { c_output_is( <<'CODE', <<'OUTPUT', "Parrot Compile API Single call" ); #include -#include "parrot/embed.h" +#include "parrot/parrot.h" static opcode_t * run(PARROT_INTERP, int argc, cosnt char *argv[]) @@ -742,14 +668,14 @@ main(int margc, const char *margv[]) PackFile_Segment *seg; /* Interpreter set-up */ - interp = Parrot_new(NULL); + interp = Parrot_interp_new(NULL); if (interp == NULL) return 1; /* dummy pf and segment to get things started */ pf = PackFile_new_dummy(interp, "test_code"); - /* Parrot_set_flag(interp, PARROT_TRACE_FLAG); */ + /* Parrot_interp_set_flag(interp, PARROT_TRACE_FLAG); */ run(interp, argc, (char **)argv); Parrot_x_exit(interp, 0); return 0; @@ -760,7 +686,7 @@ OUTPUT c_output_is( <<'CODE', <<'OUTPUT', "Parrot Compile API Multiple Calls" ); #include -#include "parrot/embed.h" +#include "parrot/parrot.h" static void compile_run(PARROT_INTERP, const char *src, Parrot_String *type, int argc, @@ -832,14 +758,14 @@ main(int margc, const char *margv[]) PackFile_Segment *seg; /* Interpreter set-up */ - interp = Parrot_new(NULL); + interp = Parrot_interp_new(NULL); if (interp == NULL) return 1; /* dummy pf and segment to get things started */ pf = PackFile_new_dummy(interp, "test_code"); - /* Parrot_set_flag(interp, PARROT_TRACE_FLAG); */ + /* Parrot_interp_set_flag(interp, PARROT_TRACE_FLAG); */ run(interp, argc, (char **) argv); Parrot_x_exit(interp, 0); return 0; @@ -851,7 +777,7 @@ OUTPUT c_output_is( <<'CODE', <<'OUTPUT', "Parrot Compile API Multiple 1st bad PIR" ); #include -#include "parrot/embed.h" +#include "parrot/parrot.h" static void compile_run(PARROT_INTERP, const char *src, Parrot_String *type, int argc, @@ -923,14 +849,14 @@ main(int margc, const char *margv[]) PackFile_Segment *seg; /* Interpreter set-up */ - interp = Parrot_new(NULL); + interp = Parrot_interp_new(NULL); if (interp == NULL) return 1; /* dummy pf and segment to get things started */ pf = PackFile_new_dummy(interp, "test_code"); - /* Parrot_set_flag(interp, PARROT_TRACE_FLAG); */ + /* Parrot_interp_set_flag(interp, PARROT_TRACE_FLAG); */ run(interp, argc, argv); Parrot_x_exit(interp, 0); return 0; @@ -942,7 +868,7 @@ OUTPUT c_output_is( <<'CODE', <<'OUTPUT', "Parrot Compile API Multiple 2nd bad PIR" ); #include -#include "parrot/embed.h" +#include "parrot/parrot.h" static void compile_run(PARROT_INTERP, const char *src, Parrot_String *type, int argc, @@ -1013,14 +939,14 @@ main(int margc, const char *margv[]) PackFile_Segment *seg; /* Interpreter set-up */ - interp = Parrot_new(NULL); + interp = Parrot_interp_new(NULL); if (interp == NULL) return 1; /* dummy pf and segment to get things started */ pf = PackFile_new_dummy(interp, "test_code"); - /* Parrot_set_flag(interp, PARROT_TRACE_FLAG); */ + /* Parrot_interp_set_flag(interp, PARROT_TRACE_FLAG); */ run(interp, argc, argv); Parrot_x_exit(interp, 0); return 0; @@ -1032,7 +958,7 @@ OUTPUT c_output_is( <<'CODE', <<'OUTPUT', "Parrot Compile API Multiple bad PIR" ); #include -#include "parrot/embed.h" +#include "parrot/parrot.h" static void compile_run(PARROT_INTERP, const char *src, Parrot_String *type, int argc, @@ -1102,14 +1028,14 @@ main(int margc, const char *margv[]) PackFile_Segment *seg; /* Interpreter set-up */ - interp = Parrot_new(NULL); + interp = Parrot_interp_new(NULL); if (interp == NULL) return 1; /* dummy pf and segment to get things started */ pf = PackFile_new_dummy(interp, "test_code"); - /* Parrot_set_flag(interp, PARROT_TRACE_FLAG); */ + /* Parrot_interp_set_flag(interp, PARROT_TRACE_FLAG); */ run(interp, argc, argv); Parrot_x_exit(interp, 0); return 0; @@ -1121,39 +1047,6 @@ OUTPUT } -SKIP: { -skip 'Need extra NCI thunks',1 unless $PConfig{HAS_EXTRA_NCI_THUNKS}; - -c_output_is($common . linedirective(__LINE__) . <<'CODE', <<'OUTPUT', "Parrot_sub_new_from_c_func"); - -void test(int x); - -void test(int x) -{ - printf("Hello!\n", x); -} - -int main() -{ - Parrot_Interp interp; - Parrot_PMC test_pmc; - int x,y; - - /* Create the interpreter */ - interp = new_interp(); - - x = 10; - - test_pmc = Parrot_sub_new_from_c_func(interp, (void (*)())& test, "i"); - Parrot_ext_call(interp, test_pmc, "I->", x, &y); - - Parrot_x_exit(interp, 0); -} -CODE -Hello! -OUTPUT -} - # Local Variables: # mode: cperl # cperl-indent-level: 4 diff --git a/t/src/embed/api.t b/t/src/embed/api.t index caaa397477..340d28b846 100644 --- a/t/src/embed/api.t +++ b/t/src/embed/api.t @@ -6,10 +6,13 @@ use warnings; use lib qw( . lib ../lib ../../lib ); use Test::More; use Parrot::Test; +use Parrot::Config; use File::Spec::Functions; use Parrot::Test::Util 'create_tempfile'; -plan skip_all => 'src/parrot_config.o does not exist' unless -e catfile(qw/src parrot_config.o/); +my $parrot_config = "parrot_config" . $PConfig{o}; + +plan skip_all => 'src/parrot_config.o does not exist' unless -e catfile("src", $parrot_config); plan tests => 8; @@ -42,7 +45,6 @@ sub linedirective ##include ##include "parrot/parrot.h" ##include "parrot/api.h" -##include "parrot/embed.h" ##include "parrot/extend.h" # #static void fail(const char *msg); diff --git a/t/src/embed/pmc.t b/t/src/embed/pmc.t index 85affb7efc..624eb63208 100644 --- a/t/src/embed/pmc.t +++ b/t/src/embed/pmc.t @@ -24,7 +24,7 @@ Tests PMC API support. =cut -plan tests => 7; +plan tests => 8; c_output_is( <<'CODE', <<'OUTPUT', "get/set_keyed_int" ); @@ -344,6 +344,47 @@ Frozen and thawed: I am a string. I am a string. OUTPUT +c_output_is( <<'CODE', <<'OUTPUT', "Test pmc_box and pmc_get" ); + +#include +#include + +int main(int argc, char* argv[]) +{ + Parrot_Init_Args *initargs = NULL; + Parrot_PMC interpmc = NULL; + Parrot_PMC p_str = NULL, p_float = NULL, p_int = NULL; + Parrot_String s_teststr = NULL, s_outstr = NULL; + Parrot_Float outfloat = 0.0; + Parrot_Int outint = 0; + char *c_outstr = NULL; + int answer = 0; + + GET_INIT_STRUCT(initargs); + Parrot_api_make_interpreter(NULL, 0, initargs, &interpmc); + + Parrot_api_string_import_ascii(interpmc, "The answer is", &s_teststr); + Parrot_api_pmc_box_string(interpmc, s_teststr, &p_str); + Parrot_api_pmc_get_string(interpmc, p_str, &s_outstr); + Parrot_api_string_export_ascii(interpmc, s_outstr, &c_outstr); + printf("%s ", c_outstr); + + Parrot_api_pmc_box_float(interpmc, 10.5, &p_float); + Parrot_api_pmc_get_float(interpmc, p_float, &outfloat); + + Parrot_api_pmc_box_integer(interpmc, 21, &p_int); + Parrot_api_pmc_get_integer(interpmc, p_int, &outint); + + answer = (int)(2 * outfloat) + (int)outint; + printf("%i.\n", answer); + + return 0; +} + +CODE +The answer is 42. +OUTPUT + # Local Variables: # mode: cperl # cperl-indent-level: 4 diff --git a/t/src/embed/strings.t b/t/src/embed/strings.t index 0bd58355fc..80538ee0f8 100644 --- a/t/src/embed/strings.t +++ b/t/src/embed/strings.t @@ -31,7 +31,6 @@ plan tests => 1; c_output_is( <<'CODE', <<'OUTPUT', "wchar import / export" ); #include -#include #include #include @@ -40,7 +39,7 @@ c_output_is( <<'CODE', <<'OUTPUT', "wchar import / export" ); int main(int argc, char* argv[]) { - Parrot_Interp interp = Parrot_new(NULL); + Parrot_Interp interp = Parrot_interp_new(NULL); Parrot_PMC pmc = Parrot_pmc_new(interp, enum_class_ParrotInterpreter); Parrot_String str = NULL; diff --git a/t/src/exit.t b/t/src/exit.t index 2113399e6d..e12201a43f 100644 --- a/t/src/exit.t +++ b/t/src/exit.t @@ -6,9 +6,12 @@ use warnings; use lib qw( . lib ../lib ../../lib ); use Test::More; use Parrot::Test; +use Parrot::Config; use File::Spec::Functions; -plan skip_all => 'src/parrot_config.o does not exist' unless -e catfile(qw/src parrot_config.o/); +my $parrot_config = "parrot_config" . $PConfig{o}; + +plan skip_all => 'src/parrot_config.o does not exist' unless -e catfile("src", $parrot_config); plan tests => 1; @@ -29,7 +32,6 @@ Tests C and C functions. c_output_is( <<'CODE', <<'OUTPUT', "on_exit - interpreter" ); #include #include -#include void ex1(PARROT_INTERP, int x, void*p) @@ -54,7 +56,7 @@ main(int argc, char* argv[]) { Interp *interp; - interp = Parrot_new(NULL); + interp = Parrot_interp_new(NULL); if (interp) { Parrot_x_on_exit(interp, ex1, 0); Parrot_x_on_exit(interp, ex2, 0); diff --git a/t/src/extend.t b/t/src/extend.t index 48b8467700..cc62e8cc9d 100644 --- a/t/src/extend.t +++ b/t/src/extend.t @@ -12,9 +12,11 @@ use Parrot::Test; use Parrot::Config; use File::Spec::Functions; -plan skip_all => 'src/parrot_config.o does not exist' unless -e catfile(qw/src parrot_config.o/); +my $parrot_config = "parrot_config" . $PConfig{o}; -plan tests => 24; +plan skip_all => 'src/parrot_config.o does not exist' unless -e catfile("src", $parrot_config); + +plan tests => 20; =head1 NAME @@ -40,19 +42,19 @@ sub linedirective c_output_is( <<'CODE', <<'OUTPUT', 'Parrot_PMC_null' ); #include -#include "parrot/embed.h" +#include "parrot/parrot.h" #include "parrot/extend.h" int main(int argc, const char *argv[]) { - Parrot_Interp interp = Parrot_new(NULL); + Parrot_Interp interp = Parrot_interp_new(NULL); Parrot_PMC pmcnull; /* Interpreter set-up */ if (interp) { - pmcnull = Parrot_PMC_null(); - Parrot_destroy(interp); + pmcnull = Parrot_pmc_null(); + Parrot_interp_destroy(interp); } return 0; } @@ -62,23 +64,23 @@ OUTPUT c_output_is( <<'CODE', <<'OUTPUT', 'Parrot_get_root_namespace/Parrot_(un)register_pmc' ); #include -#include "parrot/embed.h" +#include "parrot/parrot.h" #include "parrot/extend.h" int main(int argc, const char *argv[]) { - Parrot_Interp interp = Parrot_new(NULL); + Parrot_Interp interp = Parrot_interp_new(NULL); Parrot_PMC ns; /* Interpreter set-up */ if (interp) { - ns = Parrot_get_root_namespace(interp); - Parrot_register_pmc(interp, ns); - Parrot_unregister_pmc(interp, ns); + ns = Parrot_ns_get_root_namespace(interp); + Parrot_pmc_gc_register(interp, ns); + Parrot_pmc_gc_unregister(interp, ns); Parrot_printf(interp,"%P\n", ns); - Parrot_destroy(interp); + Parrot_interp_destroy(interp); } return 0; } @@ -86,46 +88,17 @@ CODE OUTPUT -c_output_is( <<'CODE', <<'OUTPUT', 'set/get_intreg' ); -#include -#include "parrot/embed.h" -#include "parrot/extend.h" - -int -main(int argc, const char *argv[]) -{ - Parrot_Interp interp = Parrot_new(NULL); - Parrot_Int parrot_reg = 0; - Parrot_Int value = 42; - Parrot_Int new_value; - - /* Interpreter set-up */ - if (interp) { - Parrot_set_intreg(interp, parrot_reg, value); - new_value = Parrot_get_intreg(interp, parrot_reg); - - printf("%d\n", (int)new_value); - Parrot_destroy(interp); - } - return 0; -} - -CODE -42 -OUTPUT - c_output_is( <<'CODE', <<'OUTPUT', 'Parrot_fprintf'); #include // This is to get Parrot_io_STDOUT, is there a better way? #include "parrot/parrot.h" -#include "parrot/embed.h" #include "parrot/extend.h" int main(int argc, const char *argv[]) { Parrot_PMC pio; - Parrot_Interp interp = Parrot_new(NULL); + Parrot_Interp interp = Parrot_interp_new(NULL); pio = Parrot_io_STDOUT(interp); /* Interpreter set-up */ @@ -141,7 +114,7 @@ OUTPUT c_output_is( <<'CODE', <<'OUTPUT', 'Parrot_printf/Parrot_eprintf with no interp'); #include -#include "parrot/embed.h" +#include "parrot/parrot.h" #include "parrot/extend.h" int @@ -157,54 +130,25 @@ CODE 42 OUTPUT -c_output_is( <<'CODE', <<'OUTPUT', 'set/get_numreg' ); - -#include -#include "parrot/embed.h" -#include "parrot/extend.h" - -int -main(int argc, const char *argv[]) -{ - Parrot_Interp interp = Parrot_new(NULL); - Parrot_Int parrot_reg = 1; - Parrot_Float value = 2.5; - Parrot_Float new_value; - - /* Interpreter set-up */ - if (interp) { - Parrot_set_numreg(interp, parrot_reg, value); - new_value = Parrot_get_numreg(interp, parrot_reg); - - printf("%.1f\n", (double)new_value); - - Parrot_destroy(interp); - } - return 0; -} - -CODE -2.5 -OUTPUT - c_output_is( <<'CODE', <<'OUTPUT', 'Parrot_new_string' ); #include -#include "parrot/embed.h" +#include "parrot/parrot.h" #include "parrot/extend.h" +#include "parrot/misc.h" int main(int argc, const char *argv[]) { - Parrot_Interp interp = Parrot_new(NULL); + Parrot_Interp interp = Parrot_interp_new(NULL); Parrot_String output, output2; /* Interpreter set-up */ if (interp) { - output = Parrot_new_string(interp, "Test", 4, "iso-8859-1", 0); + output = Parrot_str_new(interp, "Test", 4/*, "iso-8859-1", 0*/); Parrot_eprintf(interp, "%S\n", output); - Parrot_destroy(interp); + Parrot_interp_destroy(interp); } return 0; } @@ -216,25 +160,25 @@ OUTPUT c_output_is( <<'CODE', <<'OUTPUT', 'Parrot_new_string/Parrot_(un)register_string' ); #include - #include "parrot/embed.h" +#include "parrot/parrot.h" #include "parrot/extend.h" int main(int argc, const char *argv[]) { - Parrot_Interp interp = Parrot_new(NULL); + Parrot_Interp interp = Parrot_interp_new(NULL); Parrot_String output, output2; /* Interpreter set-up */ if (interp) { - output = Parrot_new_string(interp, "Test_reg_unreg", 14, "iso-8859-1", 0); + output = Parrot_str_new(interp, "Test_reg_unreg", 14/*, "iso-8859-1", 0*/); - Parrot_register_string(interp, output); - Parrot_unregister_string(interp, output); + Parrot_str_gc_register(interp, output); + Parrot_str_gc_unregister(interp, output); Parrot_eprintf(interp, "%S\n", output); - Parrot_destroy(interp); + Parrot_interp_destroy(interp); } return 0; } @@ -243,46 +187,17 @@ CODE Test_reg_unreg OUTPUT -c_output_is( <<'CODE', <<'OUTPUT', 'set/get_strreg' ); - -#include -#include "parrot/embed.h" -#include "parrot/extend.h" - -int -main(int argc, const char *argv[]) -{ - Parrot_Interp interp = Parrot_new(NULL); - Parrot_Int parrot_reg = 2; - Parrot_String value, new_value; - - /* Interpreter set-up */ - if (interp) { - value = Parrot_new_string(interp, "Test", 4, "iso-8859-1", 0); - Parrot_set_strreg(interp, parrot_reg, value); - - new_value = Parrot_get_strreg(interp, parrot_reg); - Parrot_eprintf(interp, "%S\n", new_value); - - Parrot_destroy(interp); - } - return 0; -} - -CODE -Test -OUTPUT c_output_is( <<'CODE', <<'OUTPUT', 'PMC_set/get_integer' ); #include -#include "parrot/embed.h" +#include "parrot/parrot.h" #include "parrot/extend.h" int main(int argc, const char *argv[]) { - Parrot_Interp interp = Parrot_new(NULL); + Parrot_Interp interp = Parrot_interp_new(NULL); Parrot_Int value = 101010; Parrot_PMC testpmc; Parrot_Int type, new_value; @@ -290,14 +205,14 @@ main(int argc, const char *argv[]) /* Interpreter set-up */ if (interp) { type = Parrot_PMC_typenum(interp, "Integer"); - testpmc = Parrot_PMC_new(interp, type); + testpmc = Parrot_pmc_new(interp, type); Parrot_PMC_set_integer_native(interp, testpmc, value); new_value = Parrot_PMC_get_integer(interp, testpmc); printf("%ld\n", (long)new_value); - Parrot_destroy(interp); + Parrot_interp_destroy(interp); } return 0; } @@ -308,7 +223,7 @@ OUTPUT c_output_is( linedirective(__LINE__) . <<'CODE', <<'OUTPUT', 'Parrot_free_cstring'); #include #include "parrot/parrot.h" -#include "parrot/embed.h" +#include "parrot/parrot.h" #include "parrot/extend.h" static void fail(const char *msg); @@ -323,12 +238,12 @@ static void fail(const char *msg) static Parrot_String createstring(Parrot_Interp interp, const char * value) { - return Parrot_new_string(interp, value, strlen(value), (const char*)NULL, 0); + return Parrot_str_new(interp, value, strlen(value)); } static Parrot_Interp new_interp() { - Parrot_Interp interp = Parrot_new(NULL); + Parrot_Interp interp = Parrot_interp_new(NULL); if (!interp) fail("Cannot create parrot interpreter"); return interp; @@ -349,7 +264,7 @@ int main(int argc, const char **argv) Parrot_free_cstring(str); - Parrot_destroy(interp); + Parrot_interp_destroy(interp); return 0; } CODE @@ -359,18 +274,18 @@ c_output_is( <<'CODE', <<'OUTPUT', 'PMC_set/get_integer_keyed_int' ); #include #include "parrot/parrot.h" -#include "parrot/embed.h" +#include "parrot/parrot.h" #include "parrot/extend.h" int main(int argc, const char *argv[]) { - Parrot_Interp interp = Parrot_new(NULL); + Parrot_Interp interp = Parrot_interp_new(NULL); /* Interpreter set-up */ if (interp) { Parrot_Int type = Parrot_PMC_typenum(interp, "ResizablePMCArray"); - Parrot_PMC array = Parrot_PMC_new(interp, type); + Parrot_PMC array = Parrot_pmc_new(interp, type); Parrot_Int value = 12345; Parrot_Int key = 10; Parrot_Int new_value; @@ -380,7 +295,7 @@ main(int argc, const char *argv[]) new_value = Parrot_PMC_get_integer_keyed_int(interp, array, key); printf("%ld\n", (long)new_value); - Parrot_destroy(interp); + Parrot_interp_destroy(interp); } return 0; } @@ -388,54 +303,16 @@ CODE 12345 OUTPUT -c_output_is( <<'CODE', <<'OUTPUT', 'set/get_pmcreg' ); - -#include -#include "parrot/embed.h" -#include "parrot/extend.h" - -int -main(int argc, const char *argv[]) -{ - Parrot_Interp interp = Parrot_new(NULL); - Parrot_Int value = -123; - Parrot_Int parrot_reg = 31; - Parrot_Int type, new_value; - Parrot_PMC testpmc, newpmc; - - /* Interpreter set-up */ - if (interp) { - type = Parrot_PMC_typenum(interp, "Integer"); - testpmc = Parrot_PMC_new(interp, type); - - Parrot_PMC_set_integer_native(interp, testpmc, value); - - parrot_reg = 31; - Parrot_set_pmcreg(interp, parrot_reg, testpmc); - - newpmc = Parrot_get_pmcreg(interp, parrot_reg); - new_value = Parrot_PMC_get_integer(interp, newpmc); - - printf("%d\n", (int)new_value); - - Parrot_destroy(interp); - } - return 0; -} -CODE --123 -OUTPUT - c_output_is( <<'CODE', <<'OUTPUT', 'PMC_set/get_number' ); #include -#include "parrot/embed.h" +#include "parrot/parrot.h" #include "parrot/extend.h" int main(int argc, const char *argv[]) { - Parrot_Interp interp = Parrot_new(NULL); + Parrot_Interp interp = Parrot_interp_new(NULL); Parrot_Float value = 3.1415927; Parrot_Int type; Parrot_Float new_value; @@ -444,14 +321,14 @@ main(int argc, const char *argv[]) /* Interpreter set-up */ if (interp) { type = Parrot_PMC_typenum(interp, "Float"); - testpmc = Parrot_PMC_new(interp, type); + testpmc = Parrot_pmc_new(interp, type); Parrot_PMC_set_number_native(interp, testpmc, value); new_value = Parrot_PMC_get_number(interp, testpmc); printf("%.7f\n", (double)new_value); - Parrot_destroy(interp); + Parrot_interp_destroy(interp); } return 0; } @@ -462,13 +339,13 @@ OUTPUT c_output_is( <<'CODE', <<'OUTPUT', 'PMC_set/get_string' ); #include -#include "parrot/embed.h" +#include "parrot/parrot.h" #include "parrot/extend.h" int main(int argc, const char *argv[]) { - Parrot_Interp interp = Parrot_new(NULL); + Parrot_Interp interp = Parrot_interp_new(NULL); Parrot_Int type; Parrot_String value, new_value; Parrot_PMC testpmc; @@ -476,15 +353,15 @@ main(int argc, const char *argv[]) /* Interpreter set-up */ if (interp) { type = Parrot_PMC_typenum(interp, "String"); - testpmc = Parrot_PMC_new(interp, type); + testpmc = Parrot_pmc_new(interp, type); - value = Parrot_new_string(interp, "Pumpking", 8, "iso-8859-1", 0); + value = Parrot_str_new(interp, "Pumpking", 8/*, "iso-8859-1", 0*/); Parrot_PMC_set_string_native(interp, testpmc, value); new_value = Parrot_PMC_get_string(interp, testpmc); Parrot_eprintf(interp, "%S\n", new_value); - Parrot_destroy(interp); + Parrot_interp_destroy(interp); } return 0; } @@ -516,7 +393,7 @@ system(".$PConfig{slash}parrot$PConfig{exe}", '-o', $temp_pbc, $temp_pasm); c_output_is( <<"CODE", <<'OUTPUT', 'call a parrot sub' ); #include -#include +#include #include /* also both the test PASM and the_test() print to stderr @@ -525,13 +402,15 @@ c_output_is( <<"CODE", <<'OUTPUT', 'call a parrot sub' ); int main(int argc, const char *argv[]) { - Parrot_Interp interp = Parrot_new(NULL); + Parrot_Interp interp = Parrot_interp_new(NULL); if (interp) { - Parrot_PackFile pf = Parrot_pbc_read(interp, "$temp_pbc", 0); + Parrot_String temp_pbc_str = Parrot_str_new(interp, "$temp_pbc", 0); + PackFile* pf = Parrot_pf_read_pbc_file(interp, temp_pbc_str); Parrot_String name = Parrot_str_new_constant(interp, "_sub1"); PMC *sub, *arg; + Parrot_PMC pbc = Parrot_pf_get_packfile_pmc(interp, pf, STRINGNULL); - Parrot_pbc_load(interp, pf); + Parrot_pf_set_current_packfile(interp, pbc); sub = Parrot_ns_find_current_namespace_global(interp, name); Parrot_ext_call(interp, sub, "->"); Parrot_eprintf(interp, "back\\n"); @@ -549,7 +428,7 @@ main(int argc, const char *argv[]) Parrot_ext_call(interp, sub, "P->", arg); Parrot_eprintf(interp, "back\\n"); - Parrot_destroy(interp); + Parrot_interp_destroy(interp); } return 0; } @@ -564,7 +443,6 @@ OUTPUT c_output_is( <<"CODE", <<'OUTPUT', 'call a parrot sub using the unified interface' ); #include -#include #include /* also both the test PASM and the_test() print to stderr @@ -573,13 +451,15 @@ c_output_is( <<"CODE", <<'OUTPUT', 'call a parrot sub using the unified interfac int main(int argc, const char *argv[]) { - Parrot_Interp interp = Parrot_new(NULL); + Parrot_Interp interp = Parrot_interp_new(NULL); if (interp) { - Parrot_PackFile pf = Parrot_pbc_read(interp, "$temp_pbc", 0); + Parrot_String temp_pbc_str = Parrot_str_new(interp, "$temp_pbc", 0); + PackFile * pf = Parrot_pf_read_pbc_file(interp, temp_pbc_str); Parrot_String name = Parrot_str_new_constant(interp, "_sub1"); PMC *sub, *arg; + Parrot_PMC pbc = Parrot_pf_get_packfile_pmc(interp, pf, STRINGNULL); - Parrot_pbc_load(interp, pf); + Parrot_pf_set_current_packfile(interp, pbc); sub = Parrot_ns_find_current_namespace_global(interp, name); Parrot_ext_call(interp, sub, "->"); Parrot_eprintf(interp, "back\\n"); @@ -597,7 +477,7 @@ main(int argc, const char *argv[]) Parrot_ext_call(interp, sub, "P->", arg); Parrot_eprintf(interp, "back\\n"); - Parrot_destroy(interp); + Parrot_interp_destroy(interp); } return 0; } @@ -630,7 +510,6 @@ 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 -#include #include /* also both the test PASM and the_test() print to stderr @@ -639,14 +518,16 @@ c_output_is( <<"CODE", <<'OUTPUT', 'call a parrot sub and return an integer' ); int main(int argc, const char *argv[]) { - Parrot_Interp interp = Parrot_new(NULL); + Parrot_Interp interp = Parrot_interp_new(NULL); if (interp) { - Parrot_PackFile pf = Parrot_pbc_read(interp, "$temp_pbc", 0); + Parrot_String temp_pbc_str = Parrot_str_new(interp, "$temp_pbc", 0); + PackFile* pf = Parrot_pf_read_pbc_file(interp, temp_pbc_str); Parrot_String name = Parrot_str_new_constant(interp, "foo"); PMC *sub, *arg; Parrot_Int result; + Parrot_PMC pbc = Parrot_pf_get_packfile_pmc(interp, pf, STRINGNULL); - Parrot_pbc_load(interp, pf); + Parrot_pf_set_current_packfile(interp, pbc); sub = Parrot_ns_find_current_namespace_global(interp, name); arg = Parrot_pmc_new(interp, enum_class_String); @@ -657,7 +538,7 @@ main(int argc, const char *argv[]) Parrot_eprintf(interp, "result %d\\n", result); Parrot_eprintf(interp, "back\\n"); - Parrot_destroy(interp); + Parrot_interp_destroy(interp); } return 0; } @@ -687,7 +568,6 @@ system(".$PConfig{slash}parrot$PConfig{exe}", '-o', $temp_pbc, $temp_pasm); c_output_is( <<"CODE", <<'OUTPUT', 'call a parrot sub, catch exception' ); #include -#include #include /* also both the test PASM and the_test() print to stderr @@ -696,14 +576,16 @@ c_output_is( <<"CODE", <<'OUTPUT', 'call a parrot sub, catch exception' ); int main(int argc, const char *argv[]) { - Parrot_Interp interp = Parrot_new(NULL); + Parrot_Interp interp = Parrot_interp_new(NULL); if (interp) { - Parrot_PackFile pf = Parrot_pbc_read(interp, "$temp_pbc", 0); + Parrot_String temp_pbc_str = Parrot_str_new(interp, "$temp_pbc", 0); + PackFile* pf = Parrot_pf_read_pbc_file(interp, temp_pbc_str); Parrot_String name = Parrot_str_new_constant(interp, "_sub1"); PMC *sub; Parrot_runloop jump_point; + Parrot_PMC pbc = Parrot_pf_get_packfile_pmc(interp, pf, STRINGNULL); - Parrot_pbc_load(interp, pf); + Parrot_pf_set_current_packfile(interp, pbc); sub = Parrot_ns_find_current_namespace_global(interp, name); if (setjmp(jump_point.resume)) { @@ -719,7 +601,7 @@ main(int argc, const char *argv[]) Parrot_eprintf(interp, "back\\n"); - Parrot_destroy(interp); + Parrot_interp_destroy(interp); } return 0; } @@ -775,24 +657,26 @@ system(".$PConfig{slash}parrot$PConfig{exe}", '-o', $temp_pbc, $temp_pir); c_output_is( <<"CODE", <<'OUTPUT', 'eval code through a parrot sub - #39669', todo => "Must explicitly set a PIR compreg"); #include -#include int main(int argc, const char *argv[]) { - Parrot_PackFile packfile; + PackFile* packfile; const char * code[] = { ".sub foo\\nsay \\"Hello from foo!\\"\\n.end\\n" }; + Parrot_PMC pbc; - Parrot_Interp interp = Parrot_new(NULL); + Parrot_Interp interp = Parrot_interp_new(NULL); if (interp) { - packfile = Parrot_pbc_read( interp, "$temp_pbc", 0 ); + Parrot_String temp_pbc_str = Parrot_str_new(interp, "$temp_pbc", 0); + packfile = Parrot_pf_read_pbc_file(interp, temp_pbc_str); if (packfile) { - Parrot_pbc_load( interp, packfile ); + pbc = Parrot_pf_get_packfile_pmc(interp, pf, STRINGNULL); + Parrot_pf_set_current_packfile(interp, pbc); Parrot_runcode( interp, 1, code ); } - Parrot_destroy( interp ); + Parrot_interp_destroy( interp ); } return 0; } @@ -803,13 +687,12 @@ OUTPUT c_output_is( <<'CODE', <<'OUTPUT', 'compile string in a fresh interp - #39986', todo => "Must explicitly set a PIR compreg" ); #include -#include #include int main(int argc, const char *argv[]) { - Parrot_Interp interp = Parrot_new(NULL); + Parrot_Interp interp = Parrot_interp_new(NULL); const char *code = ".sub foo :main\nprint\"Hello from foo!\\n\"\n.end\n"; Parrot_PMC retval; Parrot_PMC sub; @@ -825,7 +708,7 @@ main(int argc, const char *argv[]) Parrot_ext_call(interp, sub, "->"); } - Parrot_destroy(interp); + Parrot_interp_destroy(interp); } return 0; } @@ -835,25 +718,26 @@ OUTPUT c_output_is( <<"CODE", <<'OUTPUT', 'call multi sub from C - #41511' ); #include -#include #include int main(int argc, const char *argv[]) { Parrot_Int result; - Parrot_PMC sub; - Parrot_PackFile pf; - Parrot_Interp interp = Parrot_new(NULL); + Parrot_PMC sub, pbc; + PackFile* pf; + Parrot_Interp interp = Parrot_interp_new(NULL); if (interp) { - pf = Parrot_pbc_read( interp, "$temp_pbc", 0 ); - Parrot_pbc_load( interp, pf ); + Parrot_String temp_pbc_str = Parrot_str_new(interp, "$temp_pbc", 0); + pf = Parrot_pf_read_pbc_file(interp, temp_pbc_str); + pbc = Parrot_pf_get_packfile_pmc(interp, pf, STRINGNULL); + Parrot_pf_set_current_packfile(interp, pbc); sub = Parrot_ns_find_current_namespace_global( interp, Parrot_str_new_constant( interp, "add" ) ); Parrot_ext_call(interp, sub, "II->I", 100, 200, &result); printf( "Result is %d.\\n", result ); - Parrot_destroy(interp); + Parrot_interp_destroy(interp); } return 0; } @@ -863,25 +747,26 @@ OUTPUT c_output_is( <<"CODE", <<'OUTPUT', 'call multi sub from C - unified interface' ); #include -#include #include int main(int argc, const char *argv[]) { Parrot_Int result; - Parrot_PMC sub; - Parrot_PackFile pf; - Parrot_Interp interp = Parrot_new(NULL); + Parrot_PMC sub, pbc; + PackFile* pf; + Parrot_Interp interp = Parrot_interp_new(NULL); if (interp) { - pf = Parrot_pbc_read( interp, "$temp_pbc", 0 ); - Parrot_pbc_load( interp, pf ); + Parrot_String temp_pbc_str = Parrot_str_new(interp, "$temp_pbc", 0); + pf = Parrot_pf_read_pbc_file(interp, temp_pbc_str); + pbc = Parrot_pf_get_packfile_pmc(interp, pf, STRINGNULL); + Parrot_pf_set_current_packfile(interp, pbc); sub = Parrot_ns_find_current_namespace_global( interp, Parrot_str_new_constant( interp, "add" ) ); Parrot_ext_call( interp, sub, "II->I", 100, 200, &result ); printf( "Result is %d.\\n", result ); - Parrot_destroy(interp); + Parrot_interp_destroy(interp); } return 0; } @@ -889,14 +774,13 @@ CODE Result is 300. OUTPUT -c_output_is( <<'CODE', <<'OUTPUT', 'multiple Parrot_new/Parrot_x_exit cycles' ); +c_output_is( <<'CODE', <<'OUTPUT', 'multiple Parrot_interp_new/Parrot_x_exit cycles' ); #include #include "parrot/parrot.h" -#include "parrot/embed.h" /* this is Parrot_x_exit without the exit() - * it will call Parrot_really_destroy() as an exit handler + * it will call Parrot_interp_really_destroy() as an exit handler */ void interp_cleanup(Parrot_Interp, int); @@ -924,9 +808,9 @@ main(int argc, const char *argv[]) for (i = 1; i <= niter; i++) { printf("Starting interp %d\n", i); fflush(stdout); - interp = Parrot_new(NULL); + interp = Parrot_interp_new(NULL); if (interp) { - Parrot_set_flag(interp, PARROT_DESTROY_FLAG); + Parrot_interp_set_flag(interp, PARROT_DESTROY_FLAG); printf("Destroying interp %d\n", i); fflush(stdout); diff --git a/t/src/extend_vtable.t b/t/src/extend_vtable.t index 074f556c4a..61b9c254a3 100644 --- a/t/src/extend_vtable.t +++ b/t/src/extend_vtable.t @@ -6,11 +6,15 @@ use warnings; use lib qw( . lib ../lib ../../lib ); use Test::More; use Parrot::Test; +use Parrot::Config; use File::Spec::Functions; -plan skip_all => 'src/parrot_config.o does not exist' unless -e catfile(qw/src parrot_config.o/); +my $parrot_config = "parrot_config" . $PConfig{o}; -plan tests => 139; +plan skip_all => 'src/parrot_config.o does not exist' unless -e catfile("src", $parrot_config); + + +plan tests => 134; =head1 NAME @@ -39,7 +43,7 @@ my $common = linedirective(__LINE__) . <<'CODE'; #include #include #include -#include "parrot/embed.h" +#include "parrot/parrot.h" #include "parrot/extend.h" #include "parrot/extend_vtable.h" @@ -56,12 +60,12 @@ static void fail(const char *msg) static Parrot_String createstring(Parrot_Interp interp, const char * value) { - return Parrot_new_string(interp, value, strlen(value), (const char*)NULL, 0); + return Parrot_str_new(interp, value, strlen(value)/*, (const char*)NULL, 0*/); } static Parrot_Interp new_interp() { - Parrot_Interp interp = Parrot_new(NULL); + Parrot_Interp interp = Parrot_interp_new(NULL); if (!interp) fail("Cannot create parrot interpreter"); return interp; @@ -93,42 +97,41 @@ void dotest(Parrot_Interp interp, void *unused) { Parrot_PMC pmc, pmc2, pmc3, pmc_string, pmc_string2, pmc_string3; Parrot_PMC pmc_float, pmc_float2; - Parrot_PMC rpa, rpa2, fpa, hash, hash_iter, continuation, continuation2, nci; + Parrot_PMC rpa, rpa2, fpa, hash, hash_iter, continuation, continuation2; Parrot_PMC key_int, key_str, hashkey, ns, object, klass; Parrot_Int type, value, integer, integer2; Parrot_Float number, number2; Parrot_String string, string2; type = Parrot_PMC_typenum(interp, "Integer"); - continuation = Parrot_PMC_new(interp, Parrot_PMC_typenum(interp, "Continuation")); - continuation2= Parrot_PMC_new(interp, Parrot_PMC_typenum(interp, "Continuation")); - rpa = Parrot_PMC_new(interp, Parrot_PMC_typenum(interp, "ResizablePMCArray")); - rpa2 = Parrot_PMC_new(interp, Parrot_PMC_typenum(interp, "ResizablePMCArray")); - fpa = Parrot_PMC_new(interp, Parrot_PMC_typenum(interp, "FixedPMCArray")); - hash = Parrot_PMC_new(interp, Parrot_PMC_typenum(interp, "Hash")); - ns = Parrot_PMC_new(interp, Parrot_PMC_typenum(interp, "Namespace")); - nci = Parrot_PMC_new(interp, Parrot_PMC_typenum(interp, "Nci")); - pmc = Parrot_PMC_new(interp, type); - pmc2 = Parrot_PMC_new(interp, type); - pmc3 = Parrot_PMC_new(interp, type); - key_int = Parrot_PMC_new(interp, Parrot_PMC_typenum(interp, "Key")); + continuation = Parrot_pmc_new(interp, Parrot_PMC_typenum(interp, "Continuation")); + continuation2= Parrot_pmc_new(interp, Parrot_PMC_typenum(interp, "Continuation")); + rpa = Parrot_pmc_new(interp, Parrot_PMC_typenum(interp, "ResizablePMCArray")); + rpa2 = Parrot_pmc_new(interp, Parrot_PMC_typenum(interp, "ResizablePMCArray")); + fpa = Parrot_pmc_new(interp, Parrot_PMC_typenum(interp, "FixedPMCArray")); + hash = Parrot_pmc_new(interp, Parrot_PMC_typenum(interp, "Hash")); + ns = Parrot_pmc_new(interp, Parrot_PMC_typenum(interp, "Namespace")); + pmc = Parrot_pmc_new(interp, type); + pmc2 = Parrot_pmc_new(interp, type); + pmc3 = Parrot_pmc_new(interp, type); + key_int = Parrot_pmc_new(interp, Parrot_PMC_typenum(interp, "Key")); type = Parrot_PMC_typenum(interp, "Class"); - klass = Parrot_PMC_new(interp, type); + klass = Parrot_pmc_new(interp, type); Parrot_PMC_set_integer_native(interp, key_int, 42); Parrot_PMC_push_pmc(interp, rpa2, continuation); - pmc_string = Parrot_PMC_new(interp, Parrot_PMC_typenum(interp,"String")); - pmc_string2 = Parrot_PMC_new(interp, Parrot_PMC_typenum(interp,"String")); - pmc_string3 = Parrot_PMC_new(interp, Parrot_PMC_typenum(interp,"String")); - pmc_float = Parrot_PMC_new(interp, Parrot_PMC_typenum(interp,"Float")); - pmc_float2 = Parrot_PMC_new(interp, Parrot_PMC_typenum(interp,"Float")); + pmc_string = Parrot_pmc_new(interp, Parrot_PMC_typenum(interp,"String")); + pmc_string2 = Parrot_pmc_new(interp, Parrot_PMC_typenum(interp,"String")); + pmc_string3 = Parrot_pmc_new(interp, Parrot_PMC_typenum(interp,"String")); + pmc_float = Parrot_pmc_new(interp, Parrot_PMC_typenum(interp,"Float")); + pmc_float2 = Parrot_pmc_new(interp, Parrot_PMC_typenum(interp,"Float")); string = createstring(interp,"Object"); Parrot_PMC_assign_string_native(interp, pmc_string, string); - object = Parrot_PMC_newclass(interp, pmc_string); + object = Parrot_oo_new_class_pmc(interp, pmc_string); CODE @@ -141,7 +144,7 @@ sub extend_vtable_output_like $common . linedirective(__LINE__) . < 'src/parrot_config.o does not exist' unless -e catfile(qw/src parrot_config.o/); +my $parrot_config = "parrot_config" . $PConfig{o}; + +plan skip_all => 'src/parrot_config.o does not exist' unless -e catfile("src", $parrot_config); plan tests => 4; @@ -40,7 +43,6 @@ c_output_is(linedirective(__LINE__) . <<'CODE', <<'OUTPUT', "Parrot_vsnprintf" ) #include #include "parrot/parrot.h" -#include "parrot/embed.h" #include "parrot/misc.h" void fail(const char *msg); @@ -55,13 +57,13 @@ int main(int argc, const char **argv) { Parrot_Interp interp; char buf[11]; - interp = Parrot_new(NULL); + interp = Parrot_interp_new(NULL); if (! interp) fail("Cannot create parrot interpreter"); Parrot_snprintf(interp, buf, 11, "test%d", 123456); puts(buf); - Parrot_destroy(interp); + Parrot_interp_destroy(interp); return 0; } CODE @@ -74,7 +76,6 @@ c_output_is(linedirective(__LINE__) . <<'CODE', <<'OUTPUT', "Parrot_vsnprintf wi #include #include "parrot/parrot.h" -#include "parrot/embed.h" #include "parrot/misc.h" void fail(const char *msg); @@ -89,7 +90,7 @@ int main(int argc, const char **argv) { Parrot_Interp interp; char buf[] = "unchanged"; - interp = Parrot_new(NULL); + interp = Parrot_interp_new(NULL); if (! interp) fail("Cannot create parrot interpreter"); Parrot_snprintf(interp, buf, 0, ""); @@ -97,7 +98,7 @@ int main(int argc, const char **argv) if (strcmp(buf, "unchanged") == 0) puts("Done"); else fail(buf); - Parrot_destroy(interp); + Parrot_interp_destroy(interp); return 0; } CODE diff --git a/t/src/pointer_array.t b/t/src/pointer_array.t index 72395b8f2f..5f9353345f 100644 --- a/t/src/pointer_array.t +++ b/t/src/pointer_array.t @@ -1,5 +1,5 @@ #!perl -# Copyright (C) 2006-2010, Parrot Foundation. +# Copyright (C) 2006-2012, Parrot Foundation. use strict; use warnings; @@ -11,7 +11,9 @@ use Parrot::Test; use Parrot::Config; use File::Spec::Functions; -plan skip_all => 'src/parrot_config.o does not exist' unless -e catfile(qw/src parrot_config.o/); +my $parrot_config = "parrot_config" . $PConfig{o}; + +plan skip_all => 'src/parrot_config.o does not exist' unless -e catfile("src", $parrot_config); =head1 NAME @@ -34,13 +36,12 @@ plan tests => 2; c_output_is( <<'CODE', <<'OUTPUT', "Pointer array" ); #include -#include #include #include int main(int argc, char* argv[]) { - Interp *interp = Parrot_new(NULL); + Interp *interp = Parrot_interp_new(NULL); Parrot_Pointer_Array *pa = Parrot_pa_new(interp); int i, count; void *pi, *pj; @@ -53,7 +54,7 @@ int main(int argc, char* argv[]) printf("ok 1\n"); /* Push first pointer */ - pi = Parrot_pa_insert(interp, pa, &i); + pi = Parrot_pa_insert(pa, &i); if (pa->total_chunks != 1) { printf("Fail to allocate 1 chunk"); @@ -69,7 +70,7 @@ int main(int argc, char* argv[]) /* Insert many pointers */ for (count = CELL_PER_CHUNK * 2; count; count--) { - pi = Parrot_pa_insert(interp, pa, &i); + pi = Parrot_pa_insert(pa, &i); } if (pa->total_chunks < 2) { printf("Fail to allocate more chunks"); @@ -96,21 +97,20 @@ OUTPUT c_output_is( <<'CODE', <<'OUTPUT', "Pointer array (iterating)" ); #include -#include #include #include int main(int argc, char* argv[]) { - Interp *interp = Parrot_new(NULL); + Interp *interp = Parrot_interp_new(NULL); Parrot_Pointer_Array *pa = Parrot_pa_new(interp); int i, j, k, count = 0; void *pi, *pj, *pk; /* Push first pointer */ - pi = Parrot_pa_insert(interp, pa, &i); - pj = Parrot_pa_insert(interp, pa, &j); - pk = Parrot_pa_insert(interp, pa, &k); + pi = Parrot_pa_insert(pa, &i); + pj = Parrot_pa_insert(pa, &j); + pk = Parrot_pa_insert(pa, &k); POINTER_ARRAY_ITER(pa, if (ptr == &i) @@ -120,7 +120,7 @@ int main(int argc, char* argv[]) else if (ptr == &k) ++count; else { - printf("Unkown poiner! %p - %p %p %p", ptr, pi, pj, pk); + printf("Unknown pointer! %p - %p %p %p", ptr, pi, pj, pk); return EXIT_FAILURE; } ); @@ -140,7 +140,7 @@ int main(int argc, char* argv[]) else if (ptr == &k) ++count; else { - printf("Unkown poiner! %p - %p %p %p", ptr, pi, pj, pk); + printf("Unknown pointer! %p - %p %p %p", ptr, pi, pj, pk); return EXIT_FAILURE; } ); @@ -156,7 +156,7 @@ int main(int argc, char* argv[]) if (ptr == &j) ++count; else { - printf("Unkown poiner! %p - %p %p %p", ptr, pi, pj, pk); + printf("Unknown pointer! %p - %p %p %p", ptr, pi, pj, pk); return EXIT_FAILURE; } ); @@ -167,10 +167,10 @@ int main(int argc, char* argv[]) printf("ok 4\n"); /* Push stuff back. Twice. */ - pi = Parrot_pa_insert(interp, pa, &i); - pi = Parrot_pa_insert(interp, pa, &i); - pk = Parrot_pa_insert(interp, pa, &k); - pk = Parrot_pa_insert(interp, pa, &k); + pi = Parrot_pa_insert(pa, &i); + pi = Parrot_pa_insert(pa, &i); + pk = Parrot_pa_insert(pa, &k); + pk = Parrot_pa_insert(pa, &k); POINTER_ARRAY_ITER(pa, if (ptr == &i) ++count; @@ -179,7 +179,7 @@ int main(int argc, char* argv[]) else if (ptr == &k) ++count; else { - printf("Unkown poiner! %p - %p %p %p", ptr, pi, pj, pk); + printf("Unknown pointer! %p - %p %p %p", ptr, pi, pj, pk); return EXIT_FAILURE; } ); diff --git a/t/src/threads_io.t b/t/src/threads_io.t new file mode 100644 index 0000000000..155960e257 --- /dev/null +++ b/t/src/threads_io.t @@ -0,0 +1,86 @@ +#! perl +# Copyright (C) 2010, Parrot Foundation. +# $Id$ + +use strict; +use warnings; +use File::Temp; +use Time::HiRes qw(sleep); + +print "1..0 # SKIP non-blocking or threaded I/O not yet implemented\n"; +exit 0; + +# TAP Plan +print "1..4\n"; + +my $pir = File::Temp->new(TEMPLATE => 'thread_io_XXXX', SUFFIX => '.pir'); +my $tmp = File::Temp->new(TEMPLATE => 'thread_io_XXXX', SUFFIX => '.tmp'); + +$pir->print(<<'EOF'); +#! ./parrot + +.sub main :main + .local pmc insub, spinsub, spintask + + insub = get_global 'insub' + $P0 = new 'Task', insub + schedule $P0 + + spinsub = get_global 'spin' + spintask = new 'Task', spinsub + schedule spintask + + pass + + say "ok 2 - main task sleeping" + sleep 0.5 + say "ok 4 - main task back" + + spintask.'kill'() +.end + +.sub insub + .local pmc stdin + stdin = getstdin + + $P0 = stdin.'readline'() + + $S0 = $P0 + if $S0 == "grumblecake\n" goto good + say "not ok 3" + .return() + +good: + say "ok 3 - got input" + .return() +.end + +.sub spin + say "ok 1 - spinning" + $I0 = 0 +spin_more: + $I0 = $I0 + 1 + $I1 = $I0 % 4096 + if $I1 != 0 goto spin_more + goto spin_more +.end + +EOF + +my $pir_file = $pir->filename; + +open my $run, '|-', "perl ${\$pir->filename} ${\$tmp->filename}"; + +sleep(0.05); +$run->print("grumblecake\n"); +$run->flush; +sleep(0.25); + +close($run); + +# Local Variables: +# mode: cperl +# cperl-indent-level: 4 +# fill-column: 100 +# End: +# vim: expandtab shiftwidth=4: diff --git a/t/src/warnings.t b/t/src/warnings.t index 28f797c548..670a2f2aed 100644 --- a/t/src/warnings.t +++ b/t/src/warnings.t @@ -6,9 +6,12 @@ use warnings; use lib qw( . lib ../lib ../../lib ); use Test::More; use Parrot::Test; +use Parrot::Config; use File::Spec::Functions; -plan skip_all => 'src/parrot_config.o does not exist' unless -e catfile(qw/src parrot_config.o/); +my $parrot_config = "parrot_config" . $PConfig{o}; + +plan skip_all => 'src/parrot_config.o does not exist' unless -e catfile("src", $parrot_config); plan tests => 2; @@ -33,18 +36,17 @@ Hacked from t/src/basics.t c_output_is( <<'CODE', <<'OUTPUT', "print_pbc_location" ); #include -#include int main(int argc, const char* argv[]) { - Parrot_Interp interp = Parrot_new(NULL); + Parrot_Interp interp = Parrot_interp_new(NULL); int error_val; if (interp) { print_pbc_location(interp); - Parrot_destroy(interp); + Parrot_interp_destroy(interp); } return 0; } @@ -55,12 +57,11 @@ OUTPUT c_output_is( <<'CODE', <<'OUTPUT', "Parrot_warn" ); #include -#include int main(int argc, const char* argv[]) { - Parrot_Interp interp = Parrot_new(NULL); + Parrot_Interp interp = Parrot_interp_new(NULL); int error_val; if (interp) { @@ -88,7 +89,7 @@ main(int argc, const char* argv[]) error_val = Parrot_warn(interp, 0, "eek"); /* should return error */ Parrot_io_eprintf(interp, "%d\n", error_val); - Parrot_destroy(interp); + Parrot_interp_destroy(interp); } return 0; } diff --git a/t/steps/auto/arch-01.t b/t/steps/auto/arch-01.t index 0a63013ebd..c90af5bebf 100644 --- a/t/steps/auto/arch-01.t +++ b/t/steps/auto/arch-01.t @@ -1,10 +1,10 @@ #! perl -# Copyright (C) 2007, Parrot Foundation. +# Copyright (C) 2007-2011, Parrot Foundation. # auto/arch-01.t use strict; use warnings; -use Test::More tests => 83; +use Test::More tests => 89; use Carp; use lib qw( lib t/configure/testlib ); use_ok('config::auto::arch'); @@ -196,6 +196,26 @@ is($conf->data->get('osname'), q{cygwin}, $conf->replenish($serialized); +########## mock msys ########## + +($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{msys}; +$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"); +is($conf->data->get('osname'), q{msys}, + "'osname' was set as expected"); + +$conf->replenish($serialized); + ########## mock powerpc-linux ########## ($args, $step_list_ref) = process_options( { diff --git a/t/steps/auto/headers-01.t b/t/steps/auto/headers-01.t index 83dc6b2d3c..d1c6a7a737 100644 --- a/t/steps/auto/headers-01.t +++ b/t/steps/auto/headers-01.t @@ -1,10 +1,10 @@ #! perl -# Copyright (C) 2007, Parrot Foundation. +# Copyright (C) 2007-2011, Parrot Foundation. # auto/headers-01.t use strict; use warnings; -use Test::More tests => 20; +use Test::More tests => 21; use Carp; use lib qw( lib t/configure/testlib ); use_ok('config::auto::headers'); @@ -85,8 +85,10 @@ ok(! $conf->data->get('i_niin'), "Mapping made correctly"); $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 @special_headers = qw(sysmman.h netdb.h sys/utsname.h); + foreach my $h (@special_headers) { + ok($extra_headers{$h}, "Special header $h set for $os"); + } } { diff --git a/t/steps/auto/icu-01.t b/t/steps/auto/icu-01.t index 144344f557..68d3e376c3 100644 --- a/t/steps/auto/icu-01.t +++ b/t/steps/auto/icu-01.t @@ -4,7 +4,7 @@ use strict; use warnings; -use Test::More tests => 136; +use Test::More tests => 134; use Carp; use Cwd; use File::Path qw( mkpath ); @@ -379,6 +379,7 @@ like($die, qr/Something is wrong with your ICU installation/s, $icuheaders = q{alpha}; my $status = $conf->data->get( 'ccflags' ); +my $gccversion = $conf->data->get( 'gccversion' ); { $conf->options->set(verbose => 1); @@ -399,10 +400,10 @@ my $status = $conf->data->get( 'ccflags' ); like($stdout, qr/Your compiler found the icu headers/, "Got expected verbose output"); } -$conf->data->set( ccflags => $status ); # re-set for next test { $conf->options->set(verbose => 1); + $conf->data->set(gccversion => '4.2'); my ($stdout, $stderr); capture( sub { @@ -417,32 +418,18 @@ $conf->data->set( ccflags => $status ); # re-set for next test \$stdout, \$stderr, ); - - if ($icuheaders =~ /\s/) { - like($stdout, qr/Adding -I \"\Q$icuheaders\E\" to ccflags for icu headers/, - "Got expected verbose output"); - } - else { - like($stdout, qr/Adding -I \Q$icuheaders\E to ccflags for icu headers/, - "Got expected verbose output"); - } -} -if ($icuheaders =~ /\s/) { - like($conf->data->get( 'ccflags' ), - qr/-I \"\Q$icuheaders\E\"/, - "ccflags augmented as expected" - ); -} -else { - like($conf->data->get( 'ccflags' ), - qr/-I \Q$icuheaders\E/, - "ccflags augmented as expected" - ); + like( + $stdout, + qr/Adding -isystem \"\Q$icuheaders\E\" to ccflags for icu headers/, + "Got expected verbose output" + ); } $conf->data->set( ccflags => $status ); # re-set for next test +$conf->data->set( gccversion => $gccversion ); # re-set for next test { - $conf->options->set( verbose => undef ); + $conf->options->set(verbose => 1); + $conf->data->set(gccversion => undef); my ($stdout, $stderr); capture( sub { @@ -457,23 +444,14 @@ $conf->data->set( ccflags => $status ); # re-set for next test \$stdout, \$stderr, ); - - ok(! $stdout, "No verbose output, as expected"); -} - -if ($icuheaders =~ /\s/) { - like($conf->data->get( 'ccflags'), - qr/-I \"\Q$icuheaders\E\"/, - "ccflags augmented as expected" - ); -} -else { - like($conf->data->get( 'ccflags'), - qr/-I \Q$icuheaders\E/, - "ccflags augmented as expected" - ); + like( + $stdout, + qr/Adding -I \"\Q$icuheaders\E\" to ccflags for icu headers/, + "Got expected verbose output" + ); } $conf->data->set( ccflags => $status ); # re-set for next test +$conf->data->set( gccversion => $gccversion ); # re-set for next test ########## _set_no_configure_with_icu() ########## diff --git a/t/steps/auto/sha1-01.t b/t/steps/auto/sha1-01.t deleted file mode 100644 index 3a87bcb098..0000000000 --- a/t/steps/auto/sha1-01.t +++ /dev/null @@ -1,157 +0,0 @@ -#! perl -# Copyright (C) 2010, Parrot Foundation. -# auto/sha1-01.t - -use strict; -use warnings; -use Test::More tests => 21; -use Carp; -use Cwd; -use File::Copy; -use File::Path qw( mkpath ); -use File::Spec; -use File::Temp qw( tempdir ); -use lib qw( lib t/configure/testlib ); -use_ok('config::auto::sha1'); -use Parrot::Configure::Options qw( process_options ); -use Parrot::Configure::Step::Test; -use Parrot::Configure::Test qw( - test_step_constructor_and_description -); - -########## regular ########## - -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::sha1}; - -$conf->add_steps($pkg); -$conf->options->set( %{$args} ); -my $step = test_step_constructor_and_description($conf); -SKIP: { - skip "No .git directory when working from tarball", 9 unless (-e '.git'); - { - no warnings 'once'; - local $Parrot::SHA1::current = undef; - my $ret = $step->runstep($conf); - ok( $ret, "runstep() returned true value" ); - is($step->result(), q{done}, - "Got expected result for undefined \$Parrot::SHA1::current" - ); - ok(! defined $conf->data->get( 'sha1' ), - "'sha1' undefined as expected" ); - $conf->data->set( sha1 => undef ); # prepare for next test - } - - $conf->replenish($serialized); - - { - no warnings 'once'; - local $Parrot::SHA1::current = 'invalid SHA1 string'; - my $ret; - eval { $ret = $step->runstep($conf); }; - like($@, qr/Invalid Parrot sha1 \(SHA1\)/, - "Got expected result for invalid SHA1 string" ); - ok( ! defined $ret, "runstep() returned undefined as expected" ); - } - - $conf->replenish($serialized); - - { - no warnings 'once'; - my $cur = 'abcdefABCDEF0123456789012345678901234567'; - my $abbrev_cur = substr($cur,0,7); - local $Parrot::SHA1::current = $cur; - my $ret = $step->runstep($conf); - ok( $ret, "runstep() returned true value" ); - is($step->result(), $abbrev_cur, - "Got expected result for valid \$Parrot::SHA1::current" - ); - is($conf->data->get('sha1'), $cur, - "Got expected value for sha1" ); - is($conf->data->get('abbrev_sha1'), $abbrev_cur, - "Got expected value for abbrev_sha1" ); - $conf->data->set( sha1 => undef ); # prepare for next test - $conf->data->set( abbrev_sha1 => undef ); # prepare for next test - } - - $conf->replenish($serialized); -} - -my $cwd = cwd(); -{ - my $tdir = tempdir( CLEANUP => 1 ); - chdir $tdir or croak "Unable to chdir for testing"; - - my $temp_libdir = File::Spec->catdir( $tdir, 'config', 'auto' ); - mkpath($temp_libdir, { mode => 0777 }) - or croak "Unable to make path $temp_libdir"; - ok( -d $temp_libdir, "temp directory $temp_libdir created" ); - my $from = qq{$cwd/config/auto/sha1.pm}; - my $to = qq{$temp_libdir/sha1.pm}; - copy $from => $to - or croak "Unable to copy sha1.pm for testing"; - ok( -f $to, "File copied for testing" ); - unshift @INC, $tdir; - - my $conf = Parrot::Configure::Step::Test->new; - $conf->include_config_results( $args ); - my $serialized = $conf->pcfreeze(); - - my $pkg = q{auto::sha1}; - - $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 true value" ); - is($step->result(), q{skipped}, - "Got expected result for no .git directory" ); - - chdir $cwd or croak "Could not change back dir after testing"; -} - -pass("Completed all tests in $0"); - -################### DOCUMENTATION ################### - -=head1 NAME - -auto/sha1-01.t - test auto::sha1 - -=head1 SYNOPSIS - - % prove t/steps/auto/sha1-01.t - -=head1 DESCRIPTION - -The files in this directory test functionality used by F. - -The tests in this file test execution paths in configuration step -C. - -=head1 AUTHOR - -James E Keenan - -=head1 SEE ALSO - -config::auto::sha1, F. - -=cut - -# Local Variables: -# mode: cperl -# cperl-indent-level: 4 -# fill-column: 100 -# End: -# vim: expandtab shiftwidth=4: diff --git a/t/tools/dev/headerizer/02_methods.t b/t/tools/dev/headerizer/02_methods.t index d253b0b54b..93d056619b 100644 --- a/t/tools/dev/headerizer/02_methods.t +++ b/t/tools/dev/headerizer/02_methods.t @@ -12,6 +12,7 @@ use File::Spec; use File::Temp qw( tempdir ); use Test::More qw(no_plan); # tests => 46; use lib qw( lib ); +use Parrot::Config; use Parrot::Headerizer::Functions qw( read_file ); use Parrot::Headerizer; use IO::CaptureOutput qw| capture |; @@ -142,7 +143,7 @@ $self->squawk($file, $func, $error[1]); my $srcdir = File::Spec->catpath( $tdir, 'src' ); my $srcopsdir = File::Spec->catpath( $tdir, 'src', 'ops' ); mkpath( $srcopsdir, 0, 0777 ); - my $srcopso = File::Spec->catfile( $srcopsdir, 'ops.o' ); + my $srcopso = File::Spec->catfile( $srcopsdir, "ops$PConfig{o}" ); touchfile($srcopso); $self = Parrot::Headerizer->new(); isa_ok( $self, 'Parrot::Headerizer' ); @@ -164,7 +165,7 @@ $self->squawk($file, $func, $error[1]); my $srcdir = File::Spec->catpath( $tdir, 'src' ); mkpath( $srcdir, 0, 0777 ); - my $srco = File::Spec->catfile( $srcdir, 'other.o' ); + my $srco = File::Spec->catfile( $srcdir, "other$PConfig{o}" ); touchfile($srco); my $srcs = File::Spec->catfile( $srcdir, 'other.s' ); touchfile($srcs); @@ -263,7 +264,7 @@ $self->squawk($file, $func, $error[1]); my $stub = 'fixedbooleanarray'; my $srcdir = File::Spec->catpath( $tdir, 'src', 'pmc' ); mkpath( $srcdir, 0, 0777 ); - my $srco = File::Spec->catfile( $srcdir, "$stub.o" ); + my $srco = File::Spec->catfile( $srcdir, "$stub$PConfig{o}" ); touchfile($srco); my $srcc = File::Spec->catfile( $srcdir, "$stub.c" ); copy "$cwd/t/tools/dev/headerizer/testlib/${stub}_pmc.in" => $srcc @@ -301,7 +302,7 @@ $self->squawk($file, $func, $error[1]); my $stub = 'nci'; my $srcdir = File::Spec->catpath( $tdir, 'src', 'pmc' ); mkpath( $srcdir, 0, 0777 ); - my $srco = File::Spec->catfile( $srcdir, "$stub.o" ); + my $srco = File::Spec->catfile( $srcdir, "$stub$PConfig{o}" ); touchfile($srco); my $srcc = File::Spec->catfile( $srcdir, "$stub.c" ); copy "$cwd/t/tools/dev/headerizer/testlib/${stub}_pmc.in" => $srcc @@ -699,7 +700,7 @@ sub setup_src_list_test { my $stub = 'list'; my $srcdir = File::Spec->catpath( $tdir, 'src' ); mkpath( $srcdir, 0, 0777 ); - my $srco = File::Spec->catfile( $srcdir, "$stub.o" ); + my $srco = File::Spec->catfile( $srcdir, "$stub$PConfig{o}" ); touchfile($srco); my $srcc = File::Spec->catfile( $srcdir, "$stub.c" ); copy "$cwd/t/tools/dev/headerizer/testlib/list.in" => $srcc diff --git a/t/tools/dev/searchops.t b/t/tools/dev/search_ops.t similarity index 89% rename from t/tools/dev/searchops.t rename to t/tools/dev/search_ops.t index bfa5e5f2ee..c965976bd2 100644 --- a/t/tools/dev/searchops.t +++ b/t/tools/dev/search_ops.t @@ -1,14 +1,16 @@ #! perl -# Copyright (C) 2001-2008, Parrot Foundation. +# Copyright (C) 2001-2011, Parrot Foundation. use strict; use warnings; -use File::Temp qw( tempdir ); -use Test::More tests => 10; -use lib qw( ./lib ./t/tools/dev/searchops ); -use IO::CaptureOutput qw( capture ); -use Parrot::SearchOps qw( search_all_ops_files help ); -use samples qw( $core $debug $mangled $string ); +use lib qw(lib t/tools/dev/search_ops); + +use File::Temp qw(tempdir); +use Test::More tests => 10; +use IO::CaptureOutput qw(capture); + +use Parrot::SearchOps qw(search_all_ops_files help); +use samples qw($core $debug $mangled $string); my %samples; @@ -27,7 +29,7 @@ my %samples; \$stderr, ); like($stdout, - qr/^\s*perl\stools\/dev\/search-ops\.pl.*?ops_pattern/s, + qr/^\s*perl\stools\/dev\/search_ops\.pl.*?ops_pattern/s, "Got expected start to help message", ); like($stdout, @@ -37,7 +39,7 @@ my %samples; } my $wrap_width = 70; -my $opsdir = q{t/tools/dev/searchops}; +my $opsdir = q{t/tools/dev/search_ops}; { my $tdir = tempdir( CLEANUP => 1 ); @@ -140,11 +142,11 @@ my $opsdir = q{t/tools/dev/searchops}; =head1 NAME -t/tools/dev/searchops.t - test subroutines used in tools/dev/search-ops.pl +t/tools/dev/search_ops.t - test subroutines used in tools/dev/search_ops.pl =head1 SYNOPSIS - % prove t/tools/dev/searchops.t + % prove t/tools/dev/search_ops.t =head1 DESCRIPTION @@ -172,7 +174,7 @@ followed by another paragraph will not print the C paragraph. =item * Demonstrate what happens when the C<--all> option is provided to -F. +F. =item * diff --git a/t/tools/dev/searchops/samples.pm b/t/tools/dev/search_ops/samples.pm similarity index 99% rename from t/tools/dev/searchops/samples.pm rename to t/tools/dev/search_ops/samples.pm index 571bee6764..17eea0058d 100644 --- a/t/tools/dev/searchops/samples.pm +++ b/t/tools/dev/search_ops/samples.pm @@ -18,7 +18,7 @@ $core = q{ BEGIN_OPS_PREAMBLE #include "parrot/dynext.h" -#include "parrot/embed.h" +#include "parrot/parrot.h" #include "../interp/interp_guts.h" END_OPS_PREAMBLE diff --git a/t/tools/install/01-create_directories.t b/t/tools/install/01-create_directories.t index 8d3386f148..e866f6d766 100644 --- a/t/tools/install/01-create_directories.t +++ b/t/tools/install/01-create_directories.t @@ -78,7 +78,7 @@ pass("Completed all tests in $0"); =head1 DESCRIPTION -The files in this directory test functionality used by the the scripts +The files in this directory test functionality used by the scripts F, F and F and are exported by F. diff --git a/t/tools/install/02-install_files.t b/t/tools/install/02-install_files.t index 20aa1bed19..d7969effec 100644 --- a/t/tools/install/02-install_files.t +++ b/t/tools/install/02-install_files.t @@ -259,7 +259,7 @@ pass("Completed all tests in $0"); =head1 DESCRIPTION -The files in this directory test functionality used by the the scripts +The files in this directory test functionality used by the scripts F, F and F and are exported by F. diff --git a/t/tools/install/03-lines_to_files.t b/t/tools/install/03-lines_to_files.t index 46c8fe656e..15f9b7593e 100644 --- a/t/tools/install/03-lines_to_files.t +++ b/t/tools/install/03-lines_to_files.t @@ -208,7 +208,7 @@ pass("Completed all tests in $0"); =head1 DESCRIPTION -The files in this directory test functionality used by the the scripts +The files in this directory test functionality used by the scripts F, F and F and are exported by F. diff --git a/t/tools/install/testlib/README b/t/tools/install/testlib/README index 05da3b4d02..efc48c5142 100644 --- a/t/tools/install/testlib/README +++ b/t/tools/install/testlib/README @@ -134,7 +134,7 @@ WEB SITES The following web sites have all the information you need about Parrot: http://www.parrot.org/ - http://trac.parrot.org/ + http://github.com/parrot/parrot/ http://www.parrotblog.org/ And Perl6: diff --git a/t/tools/pbc_dump.t b/t/tools/pbc_dump.t index ae6300f845..1a650608a3 100644 --- a/t/tools/pbc_dump.t +++ b/t/tools/pbc_dump.t @@ -175,7 +175,7 @@ close $pir_i; system($PARROT, '-o', $pbc_file, $pir_file); # Test -n option -dump_raw_output_like("-n " . $pbc_file, qr/0003: end/s, "pbc_dump -n command"); +dump_raw_output_like("-n " . $pbc_file, qr/0003: returncc/s, "pbc_dump -n command"); # Test -t option dump_raw_output_like("-t " . $pbc_file, qr/HEADER.*DIRECTORY.*BYTECODE.*CONSTANT/s, "pbc_dump -t command"); diff --git a/tools/build/parrot_config_c.pl b/tools/build/parrot_config_c.pl index b6bc4d4879..8a963231b9 100644 --- a/tools/build/parrot_config_c.pl +++ b/tools/build/parrot_config_c.pl @@ -1,5 +1,5 @@ #! perl -# Copyright (C) 2001-2006, Parrot Foundation. +# Copyright (C) 2001-2012, Parrot Foundation. use warnings; use strict; @@ -81,12 +81,14 @@ =head1 DESCRIPTION print << "EOF"; }; /* parrot_config */ +PARROT_CONST_FUNCTION const unsigned char * Parrot_get_config_hash_bytes(void) { return parrot_config; } +PARROT_CONST_FUNCTION int Parrot_get_config_hash_length(void) { diff --git a/tools/dev/README b/tools/dev/README deleted file mode 100644 index ddfa18e57d..0000000000 --- a/tools/dev/README +++ /dev/null @@ -1,6 +0,0 @@ -README for tools/dev/ - -This directory is intended to hold programs, templates and configuration files -found useful by Parrot developed other than those (a) invoked by the default -'make' target ('make all'), with or without command-line options, during the -Parrot build process; or (b) invoked by 'make install' diff --git a/tools/dev/README.md b/tools/dev/README.md new file mode 100644 index 0000000000..1a6df3e096 --- /dev/null +++ b/tools/dev/README.md @@ -0,0 +1,36 @@ +# Parrot Developer Tools + +This directory is intended to hold programs, templates and configuration files +found useful by Parrot developers other than those: + + * invoked by the default 'make' target ('make all') + * invoked by 'make install' + +They will sometimes require additional dependencies to fully function, such as +CPAN modules or third-party programs, like valgrind. + +Below is a list of Parrot Developer Tools and a short description of what they do: + +## dedeprecator.nqp + +This utility will scan your codebase to detect deprecated code and warn you about it. +For example, to find all deprecations in your PIR code: + + dedeprecator.nqp myproject/*.pir + +It uses api.yaml by default, but can read alternate YAML configuration files: + + dedeprecator.nqp --apiyaml foo.yaml myproject/*.pir + +## show_deprecated.nqp + +This utility nicely prints out all deprecations in api.yaml. + +## show_experimental.nqp + +This utility nicely prints out all experimental stuff in api.yaml. + +## resolve_deprecated.nqp + +Resolves deprecated features list in api.yaml by querying Trac. + diff --git a/tools/dev/all_hll_test.pl b/tools/dev/all_hll_test.pl new file mode 100755 index 0000000000..b7840b1b03 --- /dev/null +++ b/tools/dev/all_hll_test.pl @@ -0,0 +1,277 @@ +#! perl +# Copyright (C) 2011, Parrot Foundation. + +use strict; +use warnings; +use autodie; +use System::Command; +use File::Slurp; +use Data::Dumper; +use feature qw; + +=head1 NAME + +tools/dev/all_hll_test.pl - run the test suite for a many of Parrot-dependent +projects. + +=head1 SYNOPSIS + + $ perl tools/dev/all_hll_test.pl + +=head1 DESCRIPTION + +This script builds Parrot from the cwd, installs it to a temporary directory +and installs/tests a number of HLLs and libraries, storing the output from +their builds. Its goal is to provide us with improved assurance that changes +made to Parrot won't adversely affect HLLs and libraries without our knowledge. + +This program requires installation of the System::Command library from CPAN. + +Hopefully an irc bot or some other form of notification will get involved at +some point. + +=cut + + +my $tmp_dir = "/tmp/parrot_all_hll_test_$$"; +my $install_dir = "$tmp_dir/parrot_install"; +qx; +mkdir $tmp_dir; +mkdir $install_dir; +my $status = []; +my $verbose = 0; +if (defined $ARGV[0] && ($ARGV[0] eq '-v' || $ARGV[0] eq '--verbose')) { + $verbose = 1; +} +say "all output will be logged in $tmp_dir/logs"; + +build_project({ + "name" => "Parrot", + "configure" => [qq], + "build" => [qq], + "install" => [qq], + #"test" => [qq], + "tmp" => $tmp_dir, + "use_cwd" => 1, +}, $status); + +{ + local %ENV = %ENV; + $ENV{"PATH"} = "$install_dir/bin:" . $ENV{"PATH"}; + + build_project({ + "name" => "Winxed", + "clone" => [qw], + "build" => [qq], + "test" => [qq], + "tmp" => $tmp_dir, + }, $status); + + build_project({ + "name" => "Rosella", + "clone" => [qw], + "build" => [qq], + "test" => [qq], + # needed by parrot-linear-algebra and parrot-gmp + "install" => [qq], + "tmp" => $tmp_dir, + }, $status); + + build_project({ + "name" => "parrot-gmp", + "clone" => [qw], + "build" => [qq], + "test" => [qq], + "tmp" => $tmp_dir, + }, $status); + + build_project({ + "name" => "parrot-linear-algebra", + "clone" => [qw], + "build" => [qq], + "test" => [qq], + "tmp" => $tmp_dir, + }, $status); + + build_project({ + "name" => "ohm-eta-wink-kzd", + "clone" => [qw], + "build" => [qq], + "test" => [qq], + "tmp" => $tmp_dir, + }, $status); + + build_project({ + "name" => "Plumage", + "clone" => [qw], + "build" => [qq], + "test" => [qq], + "tmp" => $tmp_dir, + }, $status); + + build_project({ + "name" => "nqp", + "clone" => [qw], + "configure" => [qq], + "build" => [qq], + "test" => [qq], + # needed by Rakudo + "install" => [qq], + "tmp" => $tmp_dir, + }, $status); + + build_project({ + "name" => "Rakudo", + "clone" => [qw], + "configure" => [qq], + "build" => [qq], + "test" => [qq], + "tmp" => $tmp_dir, + }, $status); + + build_project({ + "name" => "Lua", + "clone" => [qw], + "build" => [qq], + "test" => [qq], + "tmp" => $tmp_dir, + }, $status); + + build_project({ + "name" => "Partcl-nqp", + "clone" => [qw], + "configure" => [qq], + "build" => [qq], + "test" => [qq], + "tmp" => $tmp_dir, + }, $status); +} + +my @pass; +my @fail; + +foreach my $proj_status (@$status) { + my $proj_name = (keys %$proj_status)[0]; + my $stage_num = 0; + my @bad_stages; + my @good_stages; + foreach my $stage (@{$proj_status->{$proj_name}}) { + if ($stage->{exit}) { + push @bad_stages, $stage->{stage}; + } + else { + push @good_stages, $stage->{stage}; + } + } + if (@bad_stages) { + push @fail, "$proj_name ($bad_stages[0])"; + } + else { + push @pass, $proj_name; + } +} + +say "\nresults for all projects:"; + +if (@pass) { + print "PASS: "; + say join(', ', @pass); +} +if (@fail) { + say "FAIL: "; + say join(', ', @fail); +} +else { + say "no projects failed!"; +} + + + +sub build_project { + my %opts = %{$_[0]}; + my $global_status = $_[1]; + my $proj_name = $opts{name}; + my $tmp_dir = $opts{tmp}; + my $use_cwd = exists $opts{use_cwd} ? 1 : 0; + my $stage_num = 0; + my @proj_status; + + my $proj_dir = lc($proj_name) . "_test"; + mkdir "$tmp_dir/logs" unless -d "$tmp_dir/logs"; + print "running $proj_name: "; + + foreach my $stage (qw){ + + if ($stage eq "clone" && exists $opts{$stage} && !$use_cwd) { + + print "$stage "; + print "\n" if $verbose; + chdir $tmp_dir; + qx; + + my @cmd_args = map { $_ =~ s/CLONE_DIR/$proj_dir/g; $_ } @{$opts{$stage}}; + my $cmd = System::Command->new(@cmd_args); + my $log_base_name = "$tmp_dir/logs/${proj_name}_stage${stage_num}_${stage}"; + write_file("${log_base_name}_cmdline.log", join(' ', $cmd->cmdline())); + + while (readline($cmd->stdout())) { + append_file("${log_base_name}_stdout.log", $_); + print $_ if $verbose; + } + + write_file("${log_base_name}_stderr.log", join('', readline($cmd->stderr()))); + + $cmd->close(); + push @proj_status, { + stage => $stage, + exit => $cmd->exit(), + }; + + if ($cmd->exit()) { + say "\n$stage failed"; + push @$global_status, { $proj_name => [ @proj_status ] }; + return; + } + chdir "$tmp_dir/$proj_dir"; + $stage_num++; + } + elsif (exists $opts{$stage}) { + + print "$stage "; + print "\n" if $verbose; + $use_cwd || chdir "$tmp_dir/$proj_dir"; + my $cmd = System::Command->new(@{$opts{$stage}}); + my $log_base_name = "$tmp_dir/logs/${proj_name}_stage${stage_num}_${stage}"; + write_file("${log_base_name}_cmdline.log", join(' ', $cmd->cmdline())); + + while (readline($cmd->stdout())) { + append_file("${log_base_name}_stdout.log", $_); + print $_ if $verbose; + } + + write_file("${log_base_name}_stderr.log", join('', readline($cmd->stderr()))); + + $cmd->close(); + push @proj_status, { + stage => $stage, + exit => $cmd->exit(), + }; + + if ($cmd->exit()) { + say "$stage FAILED"; + push @$global_status, { $proj_name => [ @proj_status ] }; + return; + } + $stage_num++; + } + } + say "ok!"; + push @$global_status, { $proj_name => [ @proj_status ] }; +} + +# Local Variables: +# mode: cperl +# cperl-indent-level: 4 +# fill-column: 100 +# End: +# vim: expandtab shiftwidth=4: diff --git a/tools/dev/faces.pl b/tools/dev/faces.pl index 02fd02c230..eb0b59acd0 100755 --- a/tools/dev/faces.pl +++ b/tools/dev/faces.pl @@ -16,7 +16,7 @@ =head1 SYNOPSIS =head1 DESCRIPTION -Used to create L +Used to create L =head1 PREREQUISITE @@ -46,9 +46,9 @@ =head1 PREREQUISITE } foreach my $email (sort keys %urls) { - print "[[Image($urls{$email},title=$email)]]\n"; + print "![]($urls{$email} \"$email\")\n"; } -print "[[BR]]''Generated by $0''\n"; +print "\n\n_Generated by $0_\n"; # Local Variables: # mode: cperl diff --git a/tools/dev/findhacks.pl b/tools/dev/find_hacks.pl similarity index 94% rename from tools/dev/findhacks.pl rename to tools/dev/find_hacks.pl index 583d7cd15b..1d5571a664 100755 --- a/tools/dev/findhacks.pl +++ b/tools/dev/find_hacks.pl @@ -6,12 +6,12 @@ =head1 NAME -tools/dev/findhacks.pl - Generates a TracWiki formatted list of 'hack' +tools/dev/find_hacks.pl - Generates a TracWiki formatted list of 'hack' comments in Parrot source. =head1 SYNOPSIS - $ perl tools/dev/findhacks.pl + $ perl tools/dev/find_hacks.pl =head1 DESCRIPTION @@ -37,7 +37,7 @@ =head1 DESCRIPTION # Make sure we're not triggering for 'hacker', though. next if $context =~ /hacker/; # And this script should not trigger. - next if $filename =~ /findhacks.pl$/; + next if $filename =~ /find_hacks.pl$/; # Process context for HTML, then do some stuff to it too. $context = encode_entities($context); @@ -109,7 +109,7 @@ =head1 DESCRIPTION # Print a footer. print '{{{ #!comment -Automatically generated by tools/dev/findhacks.pl +Automatically generated by tools/dev/find_hacks.pl }}}'; # Local Variables: diff --git a/tools/dev/install_files.pl b/tools/dev/install_files.pl index b121d81470..9b92e5792d 100755 --- a/tools/dev/install_files.pl +++ b/tools/dev/install_files.pl @@ -50,8 +50,6 @@ =head1 SEE ALSO See F for a detailed description of the MANIFEST format. -F - =cut ################################################################################ diff --git a/tools/dev/mk_inno.pl b/tools/dev/mk_inno.pl index 99b76c5af3..fec4435ad5 100755 --- a/tools/dev/mk_inno.pl +++ b/tools/dev/mk_inno.pl @@ -86,7 +86,7 @@ =head1 DESCRIPTION Name: "{group}\\{cm:UninstallProgram,parrot}"; Filename: "{uninstallexe}" [Registry] -Root: HKLM; SubKey: "SYSTEM\\CurrentControlSet\\Control\\Session Manager\\Environment\\"; ValueType: string; ValueName: "Path"; ValueData: "{reg:HKLM\\SYSTEM\\CurrentControlSet\\Control\\Session Manager\\Environment\\,Path};{app}\\bin" +Root: HKLM; SubKey: "SYSTEM\\CurrentControlSet\\Control\\Session Manager\\Environment\\"; ValueType: expandsz; ValueName: "Path"; ValueData: "{reg:HKLM\\SYSTEM\\CurrentControlSet\\Control\\Session Manager\\Environment\\,Path};{app}\\bin" }; close $OUT; diff --git a/tools/dev/mk_inno_language.pl b/tools/dev/mk_inno_language.pl index 30282893f0..c13c0b7884 100755 --- a/tools/dev/mk_inno_language.pl +++ b/tools/dev/mk_inno_language.pl @@ -56,7 +56,7 @@ =head1 DESCRIPTION ? qq{Source: ".\\parrot-*.exe"; DestDir: "{app}\\bin"; Flags:} : '; no .exe' ); -my $pbc = <*.pbc> && ! -d $lang +my $pbc = <*.pbc> && ! -d $lang && $lang ne 'rakudo' ? qq{Source: ".\\*.pbc"; DestDir: "{app}\\lib\\parrot\\languages\\$lang"; Flags:} : '; no .pbc'; my $lng = -d $lang @@ -83,6 +83,29 @@ =head1 DESCRIPTION ? qq{Source: ".\\README"; DestDir: "{app}\\share\\doc\\parrot\\languages\\$lang"; Flags:} : '; no README'; +my $rakudo = $lang eq 'rakudo' + ? <<'RAKUDO' : ''; +; nqp is required by rakudo +Source: ".\nqp\nqp.exe"; DestDir: "{app}\bin"; Flags: +Source: ".\nqp\src\pmc\*.dll"; DestDir: "{app}\lib\parrot\dynext"; Flags: +Source: ".\nqp\src\ops\*.dll"; DestDir: "{app}\lib\parrot\dynext"; Flags: +Source: ".\nqp\ModuleLoader.pbc"; DestDir: "{app}\lib\parrot\library"; Flags: +Source: ".\nqp\PASTRegex.pbc"; DestDir: "{app}\lib\parrot\library"; Flags: +Source: ".\nqp\NQPP6Regex.pbc"; DestDir: "{app}\lib\parrot\languages\nqp\lib"; Flags: +Source: ".\nqp\NQPRegex.pbc"; DestDir: "{app}\lib\parrot\languages\nqp\lib"; Flags: +Source: ".\nqp\NQPHLL.pbc"; DestDir: "{app}\lib\parrot\languages\nqp\lib"; Flags: +Source: ".\nqp\NQPCORE.setting.pbc"; DestDir: "{app}\lib\parrot\languages\nqp\lib"; Flags: +Source: ".\nqp\nqpmo.pbc"; DestDir: "{app}\lib\parrot\languages\nqp\lib"; Flags: +Source: ".\nqp\nqp.pbc"; DestDir: "{app}\lib\parrot\languages\nqp\lib"; Flags: +Source: ".\nqp\QRegex.pbc"; DestDir: "{app}\lib\parrot\languages\nqp\lib"; Flags: + +Source: ".\blib\Perl6\*.pbc"; DestDir: "{app}\lib\parrot\languages\nqp\lib\Perl6"; Flags: +Source: ".\perl6.pbc"; DestDir: "{app}\lib\parrot\languages\perl6"; Flags: +Source: ".\*.setting.pbc"; DestDir: "{app}\lib\parrot\languages\perl6\lib"; Flags: +Source: ".\lib\Test.pm"; DestDir: "{app}\lib\parrot\languages\perl6\lib"; Flags: +Source: ".\lib\Pod\To\Text.pm"; DestDir: "{app}\lib\parrot\languages\perl6\lib\Pod\To"; Flags: +RAKUDO + my $filename = 'parrot-' . $lclang . '.iss'; open my $OUT, '>', $filename or die "Can't open $filename ($!)"; @@ -106,6 +129,7 @@ =head1 DESCRIPTION Uninstallable=no [Files] +$rakudo $exe $pbc $lng diff --git a/tools/dev/mk_language_shell.in b/tools/dev/mk_language_shell.in index 38664a37cf..6bb778ba61 100644 --- a/tools/dev/mk_language_shell.in +++ b/tools/dev/mk_language_shell.in @@ -101,8 +101,8 @@ my $no_pmc = $with_pmc ? '' : '#'; my $path = $ARGV[1] || $lclang; ## 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 +## any instances of @lang@, @lclang@, @UCLANG@ with +## the language name. If the line has the form ## __filepath__, then start a new file. my $fh; while () { @@ -110,7 +110,6 @@ while () { s{\@lang\@} {$lang}g; s{\@lclang\@} {$lclang}ig; s{\@UCLANG\@} {$uclang}ig; - s{\@Id\@} {\$Id\$}ig; s{\@script\@} {$script}ig; s{\@rev\@} {$rev}ig; s{\@no_doc\@} {$no_doc}ig; @@ -174,7 +173,7 @@ sub start_new_file { ### The name of the file to be created is given as C<__filepath__>, ### and all subsequent lines up to the next C<__filepath__> are ### placed in the file (performing substitutions on @lang@, @lclang@, -### @UCLANG@, and @Id@ as appropriate). +### @UCLANG@ as appropriate). __DATA__ __README__ @@ -185,7 +184,6 @@ Language '@lang@' was created with @script@, r@rev@. __setup.pir__ #!/usr/bin/env parrot -# @Id@ =head1 NAME @@ -294,7 +292,6 @@ SOURCES __PARROT_REVISION__ @rev@ __doc/@lang@.pod__ -# @Id@ =head1 @lang@ @@ -309,7 +306,6 @@ __doc/@lang@.pod__ # End: # vim: expandtab shiftwidth=4: __doc/running.pod__ -# @Id@ =head1 Running @@ -340,7 +336,6 @@ __dynext/.ignore__ __@lclang@/.ignore__ __@lclang@.pir__ -# @Id@ =head1 TITLE @@ -381,7 +376,6 @@ to the @lang@ compiler. # vim: expandtab shiftwidth=4 ft=pir: __src/@lclang@.pir__ -# @Id@ =head1 TITLE @@ -554,7 +548,6 @@ sub say(*@args) { __src/pmc/@lclang@.pmc__ /* Copyright (C) 20xx, Parrot Foundation. -@Id@ =head1 NAME @@ -744,7 +737,6 @@ the end of the vector. */ __src/ops/@lclang@.ops__ /* - * @id@ * Copyright (C) 20xx, Parrot Foundation. */ diff --git a/tools/dev/new_changelog_skeleton.pl b/tools/dev/new_changelog_skeleton.pl new file mode 100644 index 0000000000..e5e417fac0 --- /dev/null +++ b/tools/dev/new_changelog_skeleton.pl @@ -0,0 +1,77 @@ +#! perl +# Copyright (C) 2012, Parrot Foundation. + +use strict; +use warnings; + +=head1 NAME + +F + +=head1 DESCRIPTION + +This program adds a new release announcement skeleton to ChangeLog. + +=head1 EXAMPLE + +Run this command + + perl tools/dev/new_changelog_skeleton.pl + +and then "git status" should show a modification to the ChangeLog file. + +=head1 AUTHOR + +Jonathan "Duke" Leto + +=cut + +sub read_changelog { + my ($x,$y,$z); + my ($year, $month, $day); + + open (my $fh, '<', 'ChangeLog') or die $!; + for my $line (<$fh>) { + if ($line =~ m/(\d+)-(\d+)-(\d+).*release (\d+)\.(\d+)\.(\d+)/) { + ($year, $month, $day, $x,$y,$z) = ($1,$2,$3,$4,$5,$6); + return ($year, $month, $day, $x,$y,$z); + } + } + close $fh; + return; +} + +sub run { + my ($year, $month, $day, $x, $y, $z) = read_changelog(); + + return unless $year && $x; + + $month eq '12' ? $month=1 : $month++; + + $y eq '11' ? ($x++, $y = 0, $z =0 ) : $y++; + + local $/; + open (my $fh, '<', 'ChangeLog') or die $!; + my $changelog = <$fh>; + my $skeleton =<', 'ChangeLog') or die $!; + print $wfh $skeleton, $changelog; + close $wfh; +} + +run(); + +# Local Variables: +# mode: cperl +# cperl-indent-level: 4 +# fill-column: 100 +# End: +# vim: expandtab shiftwidth=4: diff --git a/tools/dev/parrot-fuzzer b/tools/dev/parrot_fuzzer.py similarity index 79% rename from tools/dev/parrot-fuzzer rename to tools/dev/parrot_fuzzer.py index 9ca79c7477..6aefbbbb43 100755 --- a/tools/dev/parrot-fuzzer +++ b/tools/dev/parrot_fuzzer.py @@ -1,5 +1,6 @@ #!/usr/bin/env python -# Copyright (C) 2009, Parrot Foundation + +# Copyright (C) 2009-2011, Parrot Foundation. from fusil.application import Application from fusil.process.watch import WatchProcess @@ -17,64 +18,65 @@ =head1 NAME -parrot-fuzzer +parrot_fuzzer.py - opcode fuzzer =head1 DESCRIPTION -This is a fuzzer for Parrot, written in Python using the fusil library. It +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 -This script requires Python 2.5+ to run. The fusil +This script requires Python 2.5+ to run. The Fusil L and python-ptrace L libraries are also required. =head1 USAGE -Short version: C +Short version: C -C is run like any other fusil-based fuzzer. Fusil likes to be -run as root. This so that the child process in which Parrot runs can be put in -a more restricted environment, limiting potential damage. +C is run like any other Fusil-based fuzzer. Fusil likes to be +run as the root user so that the child process in which Parrot runs can be put +in a more restricted environment, limiting potential damage. -fusil assumes the existence of a C user and group. Parrot runs as this -user/group as part of its restricted environment. Passing C<--unsafe> allows -it to run as the current user. Although it is not likely that this will cause +Fusil assumes the existence of a C user and group. Parrot runs as this +user/group as part of its restricted environment. Passing C<--unsafe> allows +it to run as the current user. Although it is not likely that this will cause any damage to your system, it is possible. -C needs access to Parrot's source code in order to figure out -which PMCs and ops are available. It assumes that it's running in the root dir -of Parrot's source code. You can use a different dir via -C<--parrot_root=/some/other/path>. +C needs access to Parrot's source code in order to figure out +which PMCs and ops are available. It assumes that it's running in the root +directory of Parrot's source code. You can specify a different directory using +the C<--parrot-root> switch. =head1 OPTIONS =over 4 -=item C<--parrot_root=/path/to/parrot> +=item C<--parrot-root=/path/to/parrot> -Specify the path to the root of Parrot's source dir. By default, this is the -current dir. +Represents the path to the Parrot root directory. By default, this is the +current directory. =item C<--runcore=--some-runcore> -Specify which runcore to use when running Parrot. The default is the C -core. This option corresponds directly to Parrot's C<--runcore> option. Other -runcores include C. -See Parrot's help for more details. +Specifies which runcore to use when running Parrot. The default is the I +core. This option corresponds directly to Parrot's C<--runcore> option. Other +runcores include I. + +Run C for more details. -=item C<--ignore_blacklist> +=item C<--ignore-blacklist> -Some PMCs and opcodes are known to cause false positives or results of limited -value. These are blacklisted by default. Using C<--ignore_blacklist> causes -the fuzzer to use all available PMCs and opcodes, even those known to behave +Some PMC's and opcodes are known to cause false positives or results of limited +value. These are blacklisted by default. Using C<--ignore-blacklist> causes +the fuzzer to use all available PMC's and opcodes, even those known to behave badly during testing. =item C<--instructions=10> -Generate this number of instructions during test run. The default is 3. Note -that a larger number such as 20 does not necessarily result in more failures. +Represents the number of instructions during the test run. Note that a larger +number such as 20 does not necessarily result in more failures. Defaults to 3. =back @@ -88,12 +90,12 @@ class ParrotFuzzer(Application): - #base name of the dir where temp files and successful results will be stored - NAME="parrot-fuzz" + # Base name of the dir where temp files and successful results will be stored + NAME="parrot_fuzz" def createFuzzerOptions(self, parser): options = OptionGroup(parser, "Parrot fuzzer") - options.add_option("--parrot_root", + options.add_option("--parrot-root", help="Parrot program path (default: .)", type="str", default=".") @@ -105,7 +107,7 @@ def createFuzzerOptions(self, parser): help="Generate this many instructions per test run (default: 3)", type="int", default="3") - options.add_option("--ignore_blacklist", + options.add_option("--ignore-blacklist", help="Use opcodes and PMCs known to cause bad or questionable results (default: use blacklists)", action="store_true", default=False) @@ -146,14 +148,14 @@ def generatePir(self, filename): """ self.pir_postamble = """ catchall: - #Don't do anything with exceptions: we're hoping for a segfault or similar. + # Don't do anything with exceptions: we're hoping for a segfault or similar. .end """ - #how many instructions to generate - #Strangely, a low number like 3 seems to generate slightly more faults - #than a high number like 20. + # How many instructions to generate + # Strangely, a low number like 3 seems to generate slightly more faults + # than a high number like 20 opfunc_count = self.instruction_count - self.pir_body += " #generating "+str(opfunc_count)+" instructions\n" + self.pir_body += " # generating "+str(opfunc_count)+" instructions\n" arg_types = ['s', 'p', 'i', 'n', 'sc', 'ic', 'nc'] opfuncs = [] @@ -161,21 +163,20 @@ def generatePir(self, filename): self.createFile(filename) arg_gen = self.arg_gen - #pick some opfuncs + # Pick some opfuncs for i in range(opfunc_count): opfuncs.append(OpfuncCall(*self.opfunc_gen.getOpfunc())) - #calculate how many of each type of arg will be needed + # Calculate how many of each type of arg will be needed for arg_type in arg_types: arg_counts[arg_type] = 0 for opfunc in opfuncs: arg_counts[arg_type] += opfunc.getArgCount(arg_type) for arg_type in arg_types: - #print "need "+str(arg_counts[arg_type])+" args of type "+arg_type arg_gen.setArgCount(arg_type, arg_counts[arg_type]) - #generate the args, adding any supporting code to the preamble + # Generate the args, adding any supporting code to the preamble self.pir_preamble += arg_gen.generateStringArgs() self.pir_preamble += arg_gen.generatePMCArgs() self.pir_preamble += arg_gen.generateIntArgs() @@ -184,17 +185,14 @@ def generatePir(self, filename): self.pir_preamble += arg_gen.generateIntConstArgs() self.pir_preamble += arg_gen.generateNumConstArgs() - #put the args into the opfunc calls + # Put the args into the opfunc calls for opfunc in opfuncs: - #print "working on " + opfunc.getLongName() for arg_num in range(opfunc.getTotalArgCount()): arg_type = opfunc.getArgType(arg_num) - #print "arg type for #"+str(arg_num)+" is "+arg_type opfunc.setArgVal(arg_num, arg_gen.getArgVal(arg_type)) - #append getOpfuncCall self.pir_body += opfunc.getOpfuncCall() - #write the code + # Write the code self.write(0, self.pir_preamble) self.write(0, self.pir_body) self.write(0, self.pir_postamble) @@ -205,8 +203,8 @@ def on_session_start(self): self.generatePir(filename) self.send('pir_source', filename) -#Representation of a call to an opfunc, including values of arguments -#Note that argumens are literal, e.g. '$P0', '"foo"', etc +# Representation of a call to an opfunc, including values of arguments +# Note that argumens are literal, e.g. '$P0', '"foo"', etc class OpfuncCall: def __init__(self, name, sig): self.arg_types = [] @@ -217,13 +215,11 @@ def __init__(self, name, sig): else: self.long_name = name + '_' + sig self.total_arg_count = 0 - #print "making an opfunc: " + self.long_name if sig != '': for arg in string.split(sig, "_"): self.arg_types.append(arg) self.arg_vals.append('') self.total_arg_count += 1 - #print "found an arg: " + arg def getLongName(self): return self.long_name @@ -244,7 +240,7 @@ def setArgVal(self, n, arg_val): self.arg_vals[n] = arg_val def getOpfuncCall(self): - opfunc_call = '\n #'+self.long_name+'\n ' + self.name + opfunc_call = '\n # '+self.long_name+'\n ' + self.name for arg_val in self.arg_vals: opfunc_call += ' ' + arg_val + ',' opfunc_call = string.rstrip(opfunc_call, ",") @@ -334,7 +330,7 @@ def generateIntConstArgs(self): pir_preamble = "" self.args['ic'] = [] for n in range(self.arg_counts['ic']): - #negative numbers and zero mess up control flow-related ops + # Negative numbers and zero mess up control flow-related ops #num = random.choice(['neg_many','neg_one','zero','pos_one','pos_many']) num = random.choice(['pos_one','pos_many']) @@ -418,9 +414,9 @@ def getPMCType(self): class OpfuncGenerator: opfunc_list = [] opfunc_blacklist = [ - 'check_events', #only for testing - 'check_events__', #not for direct use - 'clears', #clearing all [SPIN] registers isn't useful + 'check_events', # Only for testing + 'check_events__', # Not for direct use + 'clears', # Clearing all [SPIN] registers isn't useful 'clearp', 'cleari', 'clearn', @@ -463,18 +459,18 @@ class OpfuncGenerator: def populateOpfuncList(self, parrot_root, ignore_blacklist): ops_h = parrot_root + "/src/ops/core_ops.c" ops_f = open(ops_h, 'r') - #This is a moderately fragile hack that relies on the specific - #format of some generated code. Expect breakage. + # This is a moderately fragile hack that relies on the specific + # format of some generated code, expect breakage for line in ops_f: if line.find('PARROT_INLINE_OP') > -1 or line.find('PARROT_FUNCTION_OP') > -1: line = ops_f.next() short_name = line line = ops_f.next() long_name = line - #strip leading space and opening double-quote + # Strip leading space and opening double-quote short_name = re.sub('[ ]+"', '', short_name) long_name = re.sub('[ ]+"', '', long_name) - #strip everything after closing double-quote + # Strip everything after closing double-quote short_name = re.sub('".*\n', '', short_name) long_name = re.sub('".*\n', '', long_name) @@ -483,7 +479,7 @@ def populateOpfuncList(self, parrot_root, ignore_blacklist): else: sig = string.replace(long_name, short_name + '_', '') - #XXX: don't know how to handle these args + #XXX: Don't know how to handle these args if (not re.search('(pc|k|ki|kc|kic)', sig)): if ignore_blacklist or short_name not in self.opfunc_blacklist: self.opfunc_list.append([short_name, sig]) diff --git a/tools/dev/pbc_to_exe.pir b/tools/dev/pbc_to_exe.pir index 0f7359867d..067ea29402 100644 --- a/tools/dev/pbc_to_exe.pir +++ b/tools/dev/pbc_to_exe.pir @@ -1,5 +1,6 @@ #! parrot -# Copyright (C) 2009-2011, Parrot Foundation. + +# Copyright (C) 2009-2012, Parrot Foundation. =head1 NAME @@ -46,7 +47,6 @@ Compile bytecode to executable. #include #include #include "parrot/api.h" -const void * get_program_code(void); int Parrot_set_config_hash(Parrot_PMC interp_pmc); static void show_last_error_and_exit(Parrot_PMC interp); static void print_parrot_string(Parrot_PMC interp, FILE *vector, Parrot_String str, int newline); @@ -80,15 +80,18 @@ HEADER print outfh, <<'MAIN' int main(int argc, const char *argv[]) { - PMC * interp; - PMC * pbc; - PMC * argsarray; + PMC *interp; + PMC *pbc; + PMC *argsarray; const unsigned char *program_code_addr; - Parrot_Init_Args *initargs; + + Parrot_Init_Args *initargs; GET_INIT_STRUCT(initargs); + initargs->gc_system = GCCORE; - program_code_addr = (const unsigned char *)get_program_code(); + program_code_addr = get_program_code(); + if (!program_code_addr) exit(EXIT_FAILURE); @@ -106,15 +109,24 @@ HEADER fprintf(stderr, "PARROT VM: Could not build args array"); show_last_error_and_exit(interp); } - if (!Parrot_api_load_bytecode_bytes(interp, program_code_addr, bytecode_size, &pbc)) { + + if (!Parrot_api_load_bytecode_bytes(interp, + program_code_addr, + (Parrot_Int) bytecode_size, + &pbc)) { fprintf(stderr, "PARROT VM: Could not load bytecode\n"); show_last_error_and_exit(interp); } + if (!Parrot_api_run_bytecode(interp, pbc, argsarray)) { show_last_error_and_exit(interp); } - Parrot_api_destroy_interpreter(interp); + if (!Parrot_api_destroy_interpreter(interp)) { + fprintf(stderr, "PARROT VM: Could not destroy interpreter\n"); + show_last_error_and_exit(interp); + } + exit(EXIT_SUCCESS); } @@ -127,6 +139,7 @@ HEADER if (!Parrot_api_get_result(interp, &is_error, &exception, &exit_code, &errmsg)) exit(EXIT_FAILURE); + if (is_error) { if (!Parrot_api_get_exception_backtrace(interp, exception, &backtrace)) exit(EXIT_FAILURE); @@ -140,13 +153,19 @@ HEADER static void print_parrot_string(Parrot_PMC interp, FILE *vector, Parrot_String str, int newline) { - char * msg_raw; + char *msg_raw; + if (!str) return; - Parrot_api_string_export_ascii(interp, str, &msg_raw); + + if (!Parrot_api_string_export_ascii(interp, str, &msg_raw)) + show_last_error_and_exit(interp); + if (msg_raw) { fprintf(vector, "%s%s", msg_raw, newline ? "\n" : ""); - Parrot_api_string_free_exported_ascii(interp, msg_raw); + + if (!Parrot_api_string_free_exported_ascii(interp, msg_raw)) + show_last_error_and_exit(interp); } } @@ -178,7 +197,7 @@ HEADER { Parrot_PMC is_pasm_pmc = NULL; Parrot_PMC compiler_pmc = NULL; - const char *name = is_pasm ? "PASM" : "PIR"; + const char * const name = is_pasm ? "PASM" : "PIR"; Parrot_String name_s = NULL; if (!Parrot_api_pmc_box_integer(interp, is_pasm, &is_pasm_pmc)) @@ -415,7 +434,7 @@ HELP print outfh, $S0 print outfh, ";\n" print outfh, <<'END_OF_FUNCTION' - const void * get_program_code(void) + const unsigned char * get_program_code(void) { return program_code; } @@ -470,7 +489,7 @@ END_OF_FUNCTION .local int size - print outfh, "const char * program_code =\n" + print outfh, "const unsigned char program_code[] =\n" print outfh, '"' size = 0 @@ -511,7 +530,7 @@ END_OF_FUNCTION print outfh, ";\n" print outfh, <<'END_OF_FUNCTION' - const void * get_program_code(void) + const unsigned char * get_program_code(void) { return program_code; } @@ -608,7 +627,7 @@ END_OF_DEFINES print outfh, ";\n" print outfh, <<'END_OF_FUNCTION' - const void * get_program_code(void) + const unsigned char * get_program_code(void) { HRSRC hResource; DWORD size; @@ -733,7 +752,7 @@ END_OF_FUNCTION $P0 = '_config'() .local string cc, link, link_dynamic, linkflags, ld_out, libparrot, libs, o .local string rpath, osname, build_dir, slash, icushared - .local string installed, libdir, versiondir + .local string installed, libdir, versiondir, optimize cc = $P0['cc'] link = $P0['link'] link_dynamic = $P0['link_dynamic'] @@ -750,6 +769,7 @@ END_OF_FUNCTION installed = $P0['installed'] libdir = $P0['libdir'] versiondir = $P0['versiondir'] + optimize = $P0['optimize'] .local string config, pathquote, exeprefix pathquote = '"' @@ -778,6 +798,11 @@ END_OF_FUNCTION config .= o config .= pathquote + unless osname == 'cygwin' goto skip_strip + unless install goto skip_strip + unless optimize > '' goto skip_strip + link .= ' -s' + skip_strip: link .= ' ' link .= ld_out link .= exefile diff --git a/tools/dev/resolve_deprecated.nqp b/tools/dev/resolve_deprecated.nqp index 5da50dbf40..e1cba121fa 100755 --- a/tools/dev/resolve_deprecated.nqp +++ b/tools/dev/resolve_deprecated.nqp @@ -8,8 +8,7 @@ pir::load_bytecode("nqp-setting.pbc"); pir::load_bytecode("dumper.pbc"); =begin NAME -resolve_deprecated.nqp - Resolve deprecated features listed in api.yaml by -quering trac for status of ticket. +resolve_deprecated.nqp - Resolve deprecated features =end NAME =begin SYNOPSIS @@ -18,7 +17,8 @@ quering trac for status of ticket. =end SYNOPSIS =begin DESCRIPTION -Resolve all freshly deprecated features. +Resolve all freshly deprecated features listed in api.yaml by quering trac for +status of ticket. =end DESCRIPTION =begin COMPLICATIONS diff --git a/tools/dev/resubmit_smolder.pl b/tools/dev/resubmit_smolder.pl new file mode 100755 index 0000000000..4175a59139 --- /dev/null +++ b/tools/dev/resubmit_smolder.pl @@ -0,0 +1,47 @@ +#! perl +# Copyright (C) 2011, Parrot Foundation. + +use strict; +use warnings; +use lib qw| lib |; + +use Parrot::Harness::Smoke qw( + collect_test_environment_data + send_archive_to_smolder +); + +my $tarball = 't/archive/parrot_test_run.tar.gz'; +die "Could not locate $tarball" unless (-f $tarball); + +send_archive_to_smolder(collect_test_environment_data()); + +=head1 NAME + +tools/dev/resubmit_smolder.pl + +=head1 SYNOPSIS + + perl tools/dev/resubmit_smolder.pl + +=head1 DESCRIPTION + +This program is a simple wrapper around the Parrot::Harness::Smoke functions +needed to resubmit a smoke test tarball to our Smolder server if the initial +transmission of that tarball failed. + +The command should be run from the top-level of your checkout of Parrot. It +will fail if no file named F exists in that +directory. + +=head1 AUTHOR + +James E Keenan (kid51) + +=cut + +# Local Variables: +# mode: cperl +# cperl-indent-level: 4 +# fill-column: 100 +# End: +# vim: expandtab shiftwidth=4: diff --git a/tools/dev/search-ops.pl b/tools/dev/search-ops.pl deleted file mode 100755 index bcb25e4188..0000000000 --- a/tools/dev/search-ops.pl +++ /dev/null @@ -1,76 +0,0 @@ -# perl -# Copyright (C) 2008, Parrot Foundation. -use strict; -use warnings; -use Carp; -use Getopt::Long (); -use lib qw( ./lib ); -use Parrot::SearchOps qw( - search_all_ops_files - usage - help -); - -my ($help, $all); -Getopt::Long::GetOptions( - "help" => \$help, - "all" => \$all, -) or exit 1; - -if ($help) { - help(); - exit 0; -} - -croak "You may search for only 1 ops code at a time: $!" - if @ARGV > 1; -unless ($all or $ARGV[0]) { - usage(); - exit 0; -} - -my $pattern = $all ? q{} : $ARGV[0]; -my $wrap_width = 70; -my $opsdir = q{src/ops}; - -my $total_identified = search_all_ops_files( - $pattern, $wrap_width, $opsdir -); - -print "No matches were found\n" unless $total_identified; -exit 0; - -=head1 NAME - -tools/dev/search-ops.pl - -=head1 DESCRIPTION - -Command-line tool to get descriptions of ops codes. - -=head1 USAGE - -From the top-level Parrot directory, - - perl tools/dev/search-ops.pl ops_pattern - -For help, - - perl tools/dev/search-ops.pl --help - -To display all ops codes, - - perl tools/dev/search-ops.pl --all - -=head1 AUTHOR - -James E Keenan, adapting Python program written by Bernhard Schmalhofer. - -=cut - -# Local Variables: -# mode: cperl -# cperl-indent-level: 4 -# fill-column: 100 -# End: -# vim: expandtab shiftwidth=4: diff --git a/tools/dev/search_ops.pl b/tools/dev/search_ops.pl new file mode 100755 index 0000000000..1b534a91b7 --- /dev/null +++ b/tools/dev/search_ops.pl @@ -0,0 +1,77 @@ +#! perl + +# Copyright (C) 2008-2011, Parrot Foundation. + +use strict; +use warnings; +use lib qw(lib); + +use Carp; +use Getopt::Long (); + +use Parrot::SearchOps qw( + search_all_ops_files + usage + help +); + +my ($help, $all); + +Getopt::Long::GetOptions("help" => \$help, + "all" => \$all) or exit 1; + +if ($help) { + help(); + exit 0; +} + +croak "You may search for only 1 opcode at a time: $!" if @ARGV > 1; + +unless ($all or $ARGV[0]) { + usage(); + exit 0; +} + +my $pattern = $all ? q{} : $ARGV[0]; +my $wrap_width = 70; +my $opsdir = q{src/ops}; + +my $total_identified = search_all_ops_files($pattern, $wrap_width, $opsdir); + +print "No matches were found!\n" unless $total_identified; +exit 0; + +=head1 NAME + +tools/dev/search_ops.pl - search for information on opcodes + +=head1 DESCRIPTION + +Command-line tool to get descriptions of opcodes. + +=head1 USAGE + +From the top-level Parrot directory: + + $ perl tools/dev/search_ops.pl ops_pattern + +For help: + + $ perl tools/dev/search_ops.pl --help + +To display all ops codes: + + $ perl tools/dev/search_ops.pl --all + +=head1 AUTHOR + +James E Keenan, adapting Python program written by Bernhard Schmalhofer. + +=cut + +# Local Variables: +# mode: cperl +# cperl-indent-level: 4 +# fill-column: 100 +# End: +# vim: expandtab shiftwidth=4: diff --git a/tools/dev/vtablize.pl b/tools/dev/vtablize.pl index b4ea8e1e0b..c57a86bbcf 100755 --- a/tools/dev/vtablize.pl +++ b/tools/dev/vtablize.pl @@ -223,8 +223,6 @@ =head1 SEE ALSO s/^(\s*)(void\s+thaw\(visit_info\s+\*\w*\)\s+{)/$1VTABLE $2/; s/^(\s*)(void\s+thaw_finish\(visit_info\s+\*\w*\)\s+{)/$1VTABLE $2/; s/^(\s*)(void\s+visit\(visit_info\s+\*\w*\)\s+{)/$1VTABLE $2/; -s/^(\s*)(void\s+share\(\)\s+{)/$1VTABLE $2/; -s/^(\s*)(PMC\s+\*share_ro\(\)\s+{)/$1VTABLE $2/; # Local Variables: # mode: cperl diff --git a/tools/docs/make_html_docs.pl b/tools/docs/make_html_docs.pl deleted file mode 100644 index 4bb08a7ae9..0000000000 --- a/tools/docs/make_html_docs.pl +++ /dev/null @@ -1,207 +0,0 @@ -#! perl -# Copyright (C) 2010-2011, Parrot Foundation. - -=head1 NAME - -tools/docs/make_html_docs.pl - Write HTML documentation - -=head1 SYNOPSIS - - % perl tools/docs/make_html_docs.pl [--version=VERSION] - -=head1 DESCRIPTION - -This script writes the HTML documentation for Parrot. - -=cut - -use strict; -use warnings; - -# as long as we have a separate docs/ makefile, this will be run from -# inside it. So jump up a dir to catch all the files. -chdir '..'; - -use lib 'lib'; -use Fatal qw/open close/; - -use File::Basename qw/basename dirname/; -use File::Path; -use File::Spec; -use Getopt::Long; -use JSON; -use Parrot::Docs::PodToHtml; -use Parrot::Docs::HTMLPage; - -my $version=''; - -GetOptions( 'version=s' => \$version ); - -my $target_dir = 'docs/html'; -my $resource_dir = '../resources'; - -my $json = JSON->new(); - -# Transform the json -my %pages; -my @json_index_files = glob 'docs/index/*.json'; -foreach my $index_file (@json_index_files) { - my $contents; - open my $fh, '<', $index_file; - { local $/; $contents = <$fh> } - my $section = ''; - eval { - $section = $json->decode($contents); - }; - if ($@) { - print STDERR "Error in $index_file:\n"; - die $@; - } - - my $outfile = $section->{page} . '.html'; - my $title = $section->{title}; - - foreach my $chunk (@{$section->{content}}) { - my @raw_sources; - if (ref $chunk->{source} eq "ARRAY" ) { - @raw_sources = @{$chunk->{source}}; - } - else { - push @raw_sources, $chunk->{source}; - }; - - my %sources; - my @sources_list; - - foreach my $source_elem (@raw_sources) { - foreach my $file (sort glob($source_elem)) { - $sources{$file} = 1; - push @sources_list, ($file) - } - } - - # These are only literals, no globs (for now?) - if (exists $chunk->{exclude}) { - foreach my $exclusion (@{$chunk->{exclude}}) { - delete $sources{$exclusion} - } - # remove exclusions from @sources_list - my @no_exclusions; - foreach my $not_excluded (@sources_list) { - push @no_exclusions, ($not_excluded) if $sources{$not_excluded}; - } - @sources_list = @no_exclusions; - } - $chunk->{input_files} = [keys %sources]; - $chunk->{sorted_list} = \@sources_list; - } - $pages{lc $section->{page}} = $section; -} - -foreach my $page (keys %pages) { - $page = $pages{$page}; - foreach my $section (@{$page->{content}}) { - foreach my $source (@{$section->{input_files}}) { - if ($source =~ /^:(.*)/) { - # Indicates link to other page. - my $link = lc $1; - if (! exists $pages{$link}) { - die "invalid link $source specified.\n"; - } - # assuming a link only in one page - $pages{$link}->{parent} = $page; - } - else { - transform_input($source, $page->{page}, $page->{title}); - } - } - } -} - - -my %file_titles; -# -# generate index/header pages -# - -foreach my $page (keys %pages) { - my $outfilename = $page; - $page = $pages{$page}; - my $title = $page->{title}; - - my $outfile = File::Spec->catfile($target_dir, $outfilename) . '.html'; - - # replace make_path with legacy functional mkpath to accomodate older versions of Perl - my $dir = File::Path::mkpath(File::Basename::dirname($outfile)); - - open my $out_fh, '>', $outfile; - - # set up and output header - my $nav_HTML = qq{
    Home}; - print $out_fh Parrot::Docs::HTMLPage->header($title, $nav_HTML, $resource_dir, $version); - - foreach my $section (@{$page->{content}}) { - # output Section title - print $out_fh "

    $section->{title}

    \n\n
      "; - - foreach my $source (@{$section->{sorted_list}}) { - if ($source =~ /^:(.*)/) { - my $link = lc $1; - # output link with title - print $out_fh qq(
    • $pages{$link}->{title}
    • \n); - } - else { - # output source and name (from title) - print $out_fh qq(
    • $file_titles{$source}
    • \n); - } - } - print $out_fh "
    \n\n"; - } - # output footer - print $out_fh Parrot::Docs::HTMLPage->footer('', $resource_dir, $version); -} - -# -# transform individual files from .pod to .html -# - -sub transform_input { - my ($input, $parent, $parent_title) = @_; - - if (! -f $input) { - die "$input not found or not a regular file\n" . - "You might need to restrict your glob specification."; - } - - my $formatter = Parrot::Docs::PodToHtml->new(); - $formatter->set_parent($parent, $parent_title); - - # Errata is currently noisy; e.g. complains about U<> even after - # formatting it as expected. skip it until we can properly quiet it down. - $formatter->no_errata_section(1); - - my $outfile = File::Spec->catfile($target_dir, $input) . '.html'; - - # replace make_path with legacy functional mkpath to accomodate older versions of Perl - my $dir = File::Path::mkpath(File::Basename::dirname($outfile)); - - open my $out_fh, '>', $outfile; - - $formatter->output_fh($out_fh); - $formatter->parse_file($input); - warn "$input generated no HTML output\n" - unless $formatter->content_seen; - - my $page_title = $formatter->return_page_title(); - - $file_titles{$input} = $page_title; -} - -exit 0; - -# Local Variables: -# mode: cperl -# cperl-indent-level: 4 -# fill-column: 100 -# End: -# vim: expandtab shiftwidth=4: diff --git a/tools/docs/mk_html_docs.pl b/tools/docs/mk_html_docs.pl new file mode 100644 index 0000000000..cc187130a7 --- /dev/null +++ b/tools/docs/mk_html_docs.pl @@ -0,0 +1,354 @@ +#! perl +# Copyright (C) 2010-2011, Parrot Foundation. + +=head1 NAME + +tools/docs/mk_html_docs.pl - Write HTML documentation + +=head1 SYNOPSIS + + % perl tools/docs/mk_html_docs.pl [--version=VERSION] + +=head1 DESCRIPTION + +This script writes the HTML documentation for Parrot by transforming existing POD +files into pretty HTML output. Index pages are also generated. + +This script will look in the F directory for JSON files. Each JSON +file will generate a separate "table of contents" page, and each referenced POD +file will generate a HTML page. Referenced files must reside within the Parrot +repo, but they may be located outside of the F directory. + +=head2 JSON Syntax + +Each JSON file should look similar to the following: + + { + "page" : "index", + "content" : [ + { + "title" : "Introduction", + "source" : [ + "docs/intro.pod", + "docs/project/*.pod" + ] + }, + { + "title" : "Working with Parrot", + "source" : [ + "docs/running.pod", + "docs/tests.pod", + "docs/gettingstarted.pod", + "docs/submissions.pod" + ], + "resource" : "docs/*.png" + }, + } + +=head3 Elements + +=over + +=item C + +The name of this page. It must be unique for all JSON pages; the generated HTML +will reside at "$target_dir/$page.html", where C<$target_dir> is the +destination for all generated content. + +Each page must contain a C element. + +=item C + +An array of sections shown for this page. + +Each section must be a hash that contains a C and C<source> entry. + +=item C<title> + +The title of each section. It need not be unique. + +=item C<source> + +A listing of POD files. This may be an array or a string; a string will behave as +an array of one element. + +Each element in the array must be a path relative to the Parrot repo, such as +"docs/pmc/default.pmc". Globbing is supported, so paths liek "docs/pmc/*.pmc" are +also allowed. + +=item C<resource> + +An optional listing of files that should be copied directly to C<$target_dir>. This +is useful for things like images that require no transformation, but should be accessible +to generated output. + +This element behaves similarly to C<source>: a string or array may be passed, and globbing +is performed for each element. + +=back + +=cut + +use strict; +use warnings; + +# as long as we have a separate docs/ makefile, this will be run from +# inside it. So jump up a dir to catch all the files. +chdir '..'; + +use lib 'lib'; +use Fatal qw/open close/; + +use File::Basename qw/basename dirname/; +use File::Path; +use File::Copy; +use File::Spec; +use Getopt::Long; +use JSON; +use Parrot::Docs::PodToHtml; +use Parrot::Docs::HTMLPage; + +my $version=''; + +GetOptions( 'version=s' => \$version ); + +my $target_dir = 'docs/html'; +my $resource_dir = '../resources'; + +my $json = JSON->new(); + +# Transform the json +my %pages; +my @json_index_files = glob 'docs/index/*.json'; +foreach my $index_file (@json_index_files) { + my $contents; + open my $fh, '<', $index_file; + { local $/; $contents = <$fh> } + my $section = ''; + eval { + $section = $json->decode($contents); + }; + if ($@) { + print STDERR "Error in $index_file:\n"; + die $@; + } + + my $outfile = $section->{page} . '.html'; + my $title = $section->{title}; + + foreach my $chunk (@{$section->{content}}) { + my @sources_list = canonicalize_files($chunk->{source}); + my @resources_list = canonicalize_files($chunk->{resource}); + + my %sources; + foreach my $file (@sources_list) { + $sources{$file} = 1; + } + + # These are only literals, no globs (for now?) + if (exists $chunk->{exclude}) { + foreach my $exclusion (@{$chunk->{exclude}}) { + delete $sources{$exclusion} + } + # remove exclusions from @sources_list + my @no_exclusions; + foreach my $not_excluded (@sources_list) { + push @no_exclusions, ($not_excluded) if $sources{$not_excluded}; + } + @sources_list = @no_exclusions; + } + $chunk->{input_files} = [keys %sources]; + $chunk->{sorted_list} = \@sources_list; + $chunk->{resources} = \@resources_list; + } + $pages{lc $section->{page}} = $section; +} + +foreach my $page (keys %pages) { + $page = $pages{$page}; + foreach my $section (@{$page->{content}}) { + foreach my $source (@{$section->{input_files}}) { + if ($source =~ /^:(.*)/) { + # Indicates link to other page. + my $link = lc $1; + if (! exists $pages{$link}) { + die "invalid link $source specified.\n"; + } + # assuming a link only in one page + $pages{$link}->{parent} = $page; + } + else { + transform_input($source, $page->{page}, $page->{title}); + } + } + foreach my $resource (@{$section->{resources}}) { + my $outfile = File::Spec->catfile($target_dir, $resource); + File::Path::mkpath(File::Basename::dirname($outfile)); + File::Copy::copy($resource, $outfile); + } + } +} + + +my %file_titles; +# +# generate index/header pages +# + +foreach my $page (keys %pages) { + my $outfilename = $page; + $page = $pages{$page}; + my $title = $page->{title}; + + my $outfile = File::Spec->catfile($target_dir, $outfilename) . '.html'; + + # replace make_path with legacy functional mkpath to accommodate older versions of Perl + my $dir = File::Path::mkpath(File::Basename::dirname($outfile)); + + open my $out_fh, '>', $outfile; + + # set up and output header + my $nav_HTML = qq{<a href="index.html">Home</a>}; + print $out_fh Parrot::Docs::HTMLPage->header($title, $nav_HTML, $resource_dir, $version); + + foreach my $section (@{$page->{content}}) { + # output Section title + print $out_fh "<h2>$section->{title}</h2>\n\n<ul>"; + + foreach my $source (@{$section->{sorted_list}}) { + if ($source =~ /^:(.*)/) { + my $link = lc $1; + # output link with title + print $out_fh qq(<li><a href="$link.html">$pages{$link}->{title}</a></li>\n); + } + else { + # output source and name (from title) + print $out_fh qq(<li><a href="$source.html">$file_titles{$source}</a></li>\n); + } + } + print $out_fh "</ul>\n\n"; + } + + # ========================================================================# + # Note: The below is a'bit of a hack to output html links directly into # + # the 'index.html' file. The reason for this hackery is, this # + # script uses json formatted files to pull in various *.pod files # + # in order to create the 'index.html' (along with other *.html # + # pages. Unfortunately, there is no simple way to insert html # + # markup directly into the 'index.html' file; hence, the below # + # bits. -- acy 01/25/12 # + # # + # Note: We only want to do this with the 'index.html' page, and NOT any # + # of the others pages (e.g., 'ops.html' ... 'pct_tutorial.html'). # + # ========================================================================# + if ($outfilename eq "index") { + my $title = "<h2>Development Languages</h2>\n\n"; + my $lang1 = "<ul><li><a href=\"http://whiteknight.github.com/Rosella/winxed/index.html\">The Winxed Programming Language</a></li>\n"; + my $lang2 = "<li><a href=\"https://github.com/perl6/nqp\">The NQP Programming Language</a></li>\n</ul>\n\n"; + print $out_fh Parrot::Docs::HTMLPage->body($title, $lang1, $lang2); + } + + # output footer + print $out_fh Parrot::Docs::HTMLPage->footer('', $resource_dir, $version); +} + +exit 0; + +=head2 Utility Methods + +=over + +=item C<canonicalize_files($json_chunk)> + +Process a given JSON chunk to retrieve a list of input files. Currently, this +is used to retrieve input POD files and static images. + +The JSON chunk may be an array or a string (which is transformed into a +single-element array). + +Each array element should be a file path relative to the parrot repo; it is not +necessary for resources to live under docs/. Globs are also allowed, so you can +include many files at once. + +=cut + +sub canonicalize_files { + my ($file_chunk) = @_; + + my @raw_files; + if (ref $file_chunk eq "ARRAY" ) { + @raw_files = @{$file_chunk}; + } + elsif ($file_chunk) { + push @raw_files, $file_chunk; + }; + + my @files_list; + + foreach my $file_elem (@raw_files) { + foreach my $file (sort glob($file_elem)) { + push @files_list, ($file) + } + } + + return @files_list; +} + + +=item C<transform_input($input, $parent, $parent_title)> + +Transform the specfied POD file into HTML. C<$input> should be a path to the +POD file, relative to the Parrot repo (e.g., "src/pmc/default.pmc"). C<$parent> +and C<$parent_title> both refer to the parent's "page" JSON chunk and "title" +JSON chunk, respectively. Parent information will be used to create breadcrumb +links. + +The resulting HTML will be copied to C<$target_dir>, preserving the relative +location of the input file, for example: + + "src/pmc/default.pmc" => "$target_dir/src/pmc/default.pmc" + +=cut + +sub transform_input { + my ($input, $parent, $parent_title) = @_; + + if (! -f $input) { + die "$input not found or not a regular file\n" . + "You might need to restrict your glob specification."; + } + + my $formatter = Parrot::Docs::PodToHtml->new(); + $formatter->set_parent($parent, $parent_title); + + # Errata is currently noisy; e.g. complains about U<> even after + # formatting it as expected. skip it until we can properly quiet it down. + $formatter->no_errata_section(1); + + my $outfile = File::Spec->catfile($target_dir, $input) . '.html'; + + # replace make_path with legacy functional mkpath to accommodate older versions of Perl + my $dir = File::Path::mkpath(File::Basename::dirname($outfile)); + + open my $out_fh, '>', $outfile; + + $formatter->output_fh($out_fh); + $formatter->parse_file($input); + warn "$input generated no HTML output\n" + unless $formatter->content_seen; + + my $page_title = $formatter->return_page_title(); + + $file_titles{$input} = $page_title; +} + +=back + +=cut + +# Local Variables: +# mode: cperl +# cperl-indent-level: 4 +# fill-column: 100 +# End: +# vim: expandtab shiftwidth=4: diff --git a/tools/release/auto_release.pl b/tools/release/auto_release.pl new file mode 100644 index 0000000000..0ba7e84d59 --- /dev/null +++ b/tools/release/auto_release.pl @@ -0,0 +1,556 @@ +#! perl + +# Copyright (C) 2011, Parrot Foundation. + +=head1 NAME + +tools/release/auto_release.pl - automates the release process + +=head1 SYNOPSIS + + $ perl tools/release/auto_release.pl [OPTION]... VERSION + +=head1 DESCRIPTION + +This script fully automates much of the process of packaging a release. It +handles tasks such as running tests, creating tarballs, tagging the release, +etc. + +If you are familiar with the Release Manager Guide +(F<docs/project/release_manager_guide.pod>), this script can take care of +everything up until section IX. + +=head1 OPTIONS + +=over 4 + +=item B<-h>, B<--help> + +Displays help message and exits. + +=item B<-d>, B<--developer> + +Builds a developer release. Cannot be used in conjunction with C<-s>. + +Specifying the C<-d> switch is a bit redundant as C<auto_release.pl> builds a +developer release by default. It's merely provided for the sake of consistency. + +=item B<-s>, B<--supported> + +Builds a supported release. Cannot be used in conjunction with C<-d>. + +=item B<-t>, B<--test-jobs>=I<n> + +Represents the number of test harnesses to run simultaneously when the test +suite is being run. If given, it's value will override the one in the +C<$TEST_JOBS> environment variable. + +If not given, it will default to 1 unless C<$TEST_JOBS> is defined; in which +case, C<$TEST_JOBS> will be used as a default. + +Using the C<-t> switch (or C<$TEST_JOBS>) is strongly recommended as it can +significantly reduce the amount of time spent on running the test suite which +can take up to several minutes. + +=item B<-v>, B<--version>=I<a.b.c> + +Specifies the new release version. Must be a string of the form a.b.c (e.g. +3.8.0). + +The release version passed to C<-v> always takes precedence over the one given +as C<VERSION> (if any). + +=back + +=head1 HISTORY + +* [2011-09-20] Initial version written by Kevin Polulak <kpolulak@gmail.com> + +=head1 SEE ALSO + +F<docs/project/release_manager_guide.pod> + +=cut + +use 5.008; +use strict; +use warnings; + +use Getopt::Long; +use Pod::Usage; +use System::Command; + +# TODO Migrate code from update_version.pl +# TODO Edit '== ==' strings so that newlines are on top and bottom + +# Switches +my $version; # Version number +my $developer; # Developer release +my $supported; # Supported release +my $test_jobs = 1; # Number of parallel test harnesses +my $help; # Displays help message + +my $type; # Developer or supported release + +my $result = GetOptions('v|version=s' => \$version, + 'd|developer' => \$developer, + 's|supported' => \$supported, + 't|test-jobs=i' => \$test_jobs, + 'h|help' => \$help); + +# Catch unrecognized switches +pod2usage() unless $result; + +# Display help message if -h was given +pod2usage(0) if $help; + +# Determine whether to build a developer or supported release +set_release_type(\$developer, \$supported, \$type); + +# Don't run without a release version +$version = shift unless defined $version; +stop('You must specify the release version') unless $version; + +# Parse version number +stop('Release version must be of the form a.b.c (e.g. 3.8.0)') + if $version !~ /^(\d+)\.(\d+)\.(\d+)$/; + +# Prompt user to begin packaging release +while (1) { + print "Begin building $version $type release? [y/n] "; + + my $answer = <>; + + chomp $answer; + + if ($answer eq 'y') { + last; + } + elsif ($answer eq 'n') { + exit 1; + } +} + +# Begin release process +get_recent_version(); +check_local_commits(); +build_old_version(); +update_version($version); +distro_tests(); + +update_pbc_compat() unless $developer; + +build_and_run_tests(); +commit_changes(); +prepare_tarball(); +verify_new_version($version, $type); +tag_release($version); +push_to_ftp_server($version, $type); +crow(); + +########################## +# Subroutine definitions # +########################## + +# Rebuilds Parrot and runs the full test suite +sub build_and_run_tests { + print "== BUILDING NEW VERSION ==\n"; + + system('make', 'realclean') == 0 or stop(); + system('perl', 'Configure.pl', '--test') == 0 or stop(); + + # XXX Use separate filehandles to redirect stderr/stdout to log file + system('make', 'world', 'html') == 0 or stop(); + + #_edit('make_world_html.log'); + + print "== RUNNING FULL TEST SUITE ==\n"; + + # XXX Use separate filehandles to redirect stderr/stdout to log file + if (defined $ENV{'TEST_JOBS'}) { + system('make', 'fulltest', $ENV{'TEST_JOBS'}) == 0 or stop(); + } + else { + system('make', 'fulltest', $test_jobs) == 0 or stop(); + } + + #_edit('make_fulltest.log'); +} + +# Builds an old version of Parrot so that ops can be bootstrapped +sub build_old_version { + print "== REBUILDING PARROT ==\n"; + + system('perl', 'Configure.pl') == 0 or stop(); + system('make') == 0 or stop(); +} + +# Verifies that there aren't any uncommitted local changes +sub check_local_commits { + my $ret = `git log origin/master..`; + + stop('Uncommitted local changes were found. ' + . 'Please push all changes before continuing') if $ret; +} + +# Pushes changes to master branch +sub commit_changes { + print "== PREPARING COMMIT ==\n"; + + while (1) { + print "Do you want to review the diff patch before pushing to master? " + . "[y/n] "; + + my $answer = <>; + + chomp $answer; + + if ($answer eq 'y') { + system('git', 'diff') == 0 or stop(); + last; + } + elsif ($answer eq 'n') { + last; + } + } + + my $msg; + + # Set commit message + print "Please enter the commit message (default: 'Released $version'): "; + + $msg = <>; + + chomp $msg; + + # XXX Should I use global $version or pass it as an argument? + $msg = "Released $version" if length $msg == 0; + + print "== COMMITTING LOCAL CHANGES ==\n"; + + system('git', 'commit', '-a', "-m $msg") == 0 or stop(); + + # Get SHA-1 digest for commit + open my $REV_PARSE, '-|', 'git rev-parse master' or stop(); + + my $commit = <$REV_PARSE>; + close $REV_PARSE; + + chomp $commit; + $commit = substr $commit, 0, 7; + + while (1) { + print "Do you want to review commit $commit? [y/n] "; + + my $answer = <>; + + chomp $answer; + + if ($answer eq 'y') { + system('git', 'show') == 0 or stop(); + last; + } + elsif ($answer eq 'n') { + last; + } + } + + print "== PUSHING COMMIT TO MASTER BRANCH ==\n"; + + system('git', 'push', 'origin', 'master') == 0 or stop(); +} + +# Generates release announcement using `crow.pir` +sub crow { + my $announcement = 'release_announcement.txt'; + + print "== GENERATING ANNOUNCEMENT MESSAGE ==\n"; + + open my $CROW, '-|', './parrot tools/release/crow.pir --type=text' or stop(); + open my $CROW_OUTPUT, '>', $announcement or stop(); + + while (<$CROW>) { + print $CROW_OUTPUT $_; + } + + close $CROW; + close $CROW_OUTPUT; + + _edit($announcement); +} + +# Runs distribution tests +sub distro_tests { + print "== RUNNING DISTRIBUTION TESTS ==\n"; + + if (defined $ENV{'TEST_JOBS'}) { + system('make', 'distro_tests', $ENV{'TEST_JOBS'}) == 0 or stop(); + } + else { + system('make', 'distro_tests', $test_jobs) == 0 or stop(); + } +} + +# Clones a local copy of 'master' branch +sub get_recent_version { + print "== CLONING MOST RECENT VERSION OF MASTER ==\n"; + + system('git', 'checkout', 'master') == 0 or stop(); + system('git', 'pull', '--rebase') == 0 or stop(); +} + +# Creates release tarball and verifies that it builds properly after extracting +sub prepare_tarball { + # XXX Should this be `make reconfig` instead? If so, update guide + system('perl', 'Configure.pl') == 0 or stop(); + system('make', 'release_check') == 0 or stop(); +} + +# Opens an SSH connection parrot@ftp-osl.osuosl.org and copies tarball +sub push_to_ftp_server { + my ($ver, $type) = @_; + + my $server = 'parrot@ftp-osl.osuosl.org'; + my $remote_dir = '~/ftp/releases'; + + # Wait for user input so commands don't start running without permission + while (1) { + print "Do you want to push the tarballs to $server? [y/n] "; + + my $answer = <>; + + chomp $answer; + + if ($answer eq 'y') { + last; + } + elsif ($answer eq 'n') { + return; + } + } + + # Create tarball filenames (gzip and bzip2) + my $sha256 = '.sha256'; + my $gz = '.gz'; + my $bz2 = '.bz2'; + + my $gz_tarball = "parrot-$ver" . $gz; + my $bz2_tarball = "parrot-$ver" . $bz2; + + my $gz_sha256 = $gz_tarball . $sha256; + my $bz2_sha256 = $bz2_tarball . $sha256; + + my $ssh; + my $ssh_stdin; + + print "== CONNECTING TO OSUOSL FTP SERVER ==\n"; + + # SSH into FTP server to create new directory for tarball + $ssh = System::Command->new('ssh', $server) or stop(); + $ssh_stdin = $ssh->stdin; + + # Wait for user to enter password + sleep 6; + + # Determine pathname based on release type + if ($type eq 'developer') { + $remote_dir .= "/devel/$ver"; + } + else { + $remote_dir .= "/supported/$ver"; + } + + print $ssh_stdin "mkdir $remote_dir"; + + $ssh->close; + + stop("Failed to login to $server") unless $ssh->exit == 0; + + my $scp; + my $scp_files = "$gz_tarball $bz2_tarball $gz_sha256 $bz2_sha256"; + my $scp_dir = "$server:$remote_dir"; + + print "== COPYING TARBALLS TO OSUOSL FTP SERVER ==\n"; + + # Copy tarballs into newly created directories on FTP server + $scp = System::Command->new('scp', $scp_files, $scp_dir) or stop(); + $scp->close; + + stop("Failed to copy tarballs to $server") unless $scp->exit == 0; + + my $trigger; + my $trigger_stdin; + + print "== PUSHING CHANGES TO OSUOSL FTP MIRRORS ==\n"; + + # Run `trigger-parrot` to push changes to all FTP mirrors + $trigger = System::Command->('ssh', $server) or stop(); + $trigger_stdin = $trigger->stdin; + + sleep 6; + + print $trigger_stdin "~/trigger-parrot"; + + $trigger->close; + + stop("Failed to push changes to FTP mirrors") unless $trigger->exit == 0; +} + +# Determines the type of release: developer or supported +sub set_release_type { + my ($dev, $supp, $type) = @_; + + # Fail if both -d and -s were given + stop('You may not use both the -d and -s switches. ' + . 'Use one or the other') if $$dev and $$supp; + + # Set type to supported if -s was given + if ($$supp) { + $$type = "supported"; + + return; + } + + # Default to developer release if -d or -s weren't given + if (!($$dev and $$supp)) { + $$dev = 1; + $$type = "developer"; + } +} + +# Customized version of die() for more consistent diagnostics +sub stop { + if (@_ == 0) { + print '[FATAL ERROR] '; + + if ($!) { + print $!; + } + else { + print 'An unrecoverable error has occurred'; + } + } + else { + my $msg = shift; + print "[ERROR] $msg"; + + if ($!) { + print ": $!"; + } + } + + print "!\n"; + + exit 1; +} + +# Adds a lightweight tag to the Git repository for the new release +sub tag_release { + my $ver = shift; + + print "== TAGGING NEW RELEASE ==\n"; + + # Transform version number so that it's of the form 'RELEASE_a_b_c' + $ver = 'RELEASE_' . $ver; + $ver =~ s/\./_/g; + + system('git', 'tag', "$ver") == 0 or stop(); + system('git', 'push', '--tags') == 0 or stop(); +} + +# Prompts user to edit PBC_COMPAT and regenerates bytecode +sub update_pbc_compat { + _edit('PBC_COMPAT'); + + print "== UPDATING PBC FILES ==\n"; + + system('sh', 'tools/dev/mk_packfile_pbc') == 0 or stop(); + system('sh', 'tools/dev/mk_native_pbc') == 0 or stop(); +} + +# Updates version-specific information in particular files +sub update_version { + my $ver = shift; + + print "== UPDATING VERSION INFORMATION ==\n"; + + system('perl', 'tools/release/update_version.pl', "$ver") == 0 or stop(); + + _edit('docs/parrothist.pod'); + _edit('docs/project/release_manager_guide.pod'); + _edit('ChangeLog'); + _edit('tools/release/release.json'); + _edit('RESPONSIBLE_PARTIES'); + _edit('CREDITS'); +} + +sub verify_new_version { + my ($ver, $type) = @_; + + print "== VERIFYING NEW VERSION ==\n"; + + open my $PARROT, '-|', './parrot -V' or stop(); + + my @output = <$PARROT>; + + close $PARROT; + + # XXX There has got to be a better way to do this + if ($type eq 'developer') { + # Avoid using regex in void context + if ($output[0] ~~ /(?=This is Parrot version )\d+\.\d+\.\d+(?=-devel)/) { } + + stop("Version $ver could not be verified. Found $& instead") if $& ne $ver; + } + else { + # Avoid using regex in void context + if ($output[0] ~~ /(?=This is Parrot version )\d+\.\d+\.\d+/) { } + + stop("Version $ver could not be verified. Found $& instead") if $& ne $ver; + } +} + +####################### +# Private subroutines # +####################### + +# Prompts the user to edit a file +sub _edit { + my $doc = shift; + + while (1) { + print "Do you want to edit $doc? [y/n] "; + + my $answer = <>; + + chomp $answer; + + # XXX Use an OS-dependent solution (with $^O) for the default editor + if ($answer eq 'y') { + if (defined $ENV{'EDITOR'}) { + system("$ENV{'EDITOR'} $doc") == 0 or stop(); + } + else { + system("vim $doc") == 0 or stop(); + } + + last; + } + elsif ($answer eq 'n') { + last; + } + } +} + +################### +# Signal handlers # +################### + +$SIG{'INT'} = sub { stop('SIGINT received. Stopping') }; + +# Local Variables: +# mode: cperl +# cperl-indent-level: 4 +# fill-column: 100 +# End: +# vim: expandtab shiftwidth=4: diff --git a/tools/release/cut.pl b/tools/release/cut.pl new file mode 100644 index 0000000000..f816c03cb4 --- /dev/null +++ b/tools/release/cut.pl @@ -0,0 +1,43 @@ +# perl +# Copyright (C) 2011, Parrot Foundation. + +use strict; +use warnings; +use Archive::Tar; +use ExtUtils::Manifest qw(maniread); + +=head1 Purpose + +Generate a gzip'd and bzip2'd tar file for release. + +Remove the DEVELOPING file (and its line from the MANIFEST). + +=cut + +my $VERSION = shift; + +$VERSION or die "Usage: $0 <version>"; + +my $manifest = maniread(); + +my $tar = Archive::Tar -> new(); + +$tar->add_files( keys %$manifest ); + +# Remove DEVELOPING from the tarball +$tar->remove("DEVELOPING"); + +open my $mf, "<", "MANIFEST"; +my $tarnifest = join "", grep { ! /^DEVELOPING /} <$mf>; + +$tar->replace_content("MANIFEST", $tarnifest); + +$tar->write("parrot-$VERSION.tar.gz", COMPRESS_GZIP, "parrot-$VERSION"); +$tar->write("parrot-$VERSION.tar.bz2", COMPRESS_BZIP, "parrot-$VERSION"); + +# Local Variables: +# mode: cperl +# cperl-indent-level: 4 +# fill-column: 100 +# End: +# vim: expandtab shiftwidth=4: diff --git a/tools/release/parrot_github_release.pl b/tools/release/parrot_github_release.pl new file mode 100644 index 0000000000..6828cf2289 --- /dev/null +++ b/tools/release/parrot_github_release.pl @@ -0,0 +1,430 @@ +#! perl + +# Copyright (C) 2012, Parrot Foundation. + +=head1 NAME + +tools/release/parrot_github_release.pl - automates the 'parrot.github.com' +release process + +=head1 SYNOPSIS + + $ perl tools/release/parrot_github_release.pl [OPTIONS] + +=head1 DESCRIPTION + +This script automates the packaging of the 'parrot.github.com' repository and +the archiving of the previous documentation release into the appropriate +'parrot-docsx' repository. + +In short, this script automates Section X of the Release Manager Guide +(F<docs/project/release_manager_guide.pod>) as outlined in the Release Parrot +Github Guide (F<docs/project/release_parrot_github_guide.pod>). + +=head1 OPTIONS + +=over 4 + +=item B<-d>, B<--docs>=[/path_to/previous/docs/] + +The path to the directory which contains the previous documentation release. +Specifically, the 'docs/' directory of the previous release of parrot. + +=item B<-r>, B<--repos>=[/path_to/clone/repos/] + +The path on your local file system in which to clone the 'parrot.github.com' +and the 'parrot-docsx' repositories. + +=item B<--delete> + +The default is to retain both the 'parrot.github.com' and the 'parrot-docsx' +repositories. This option deletes the repositories after pushing the updates. + +=item B<-h>, B<--help> + +Displays this help message and exits. + +=item B<-v>, B<--version> + +Displays the version and copyright information and exits. + +=back + +=head1 QUERY SYSTEM + +If you do not apply the above options on the command-line, the script will +invoke a rather minimal query system with which to obtain the necessary +information. + +=head1 LIMITATIONS + +This script is limited to *nix (and related) systems. + +=head1 NOTES + +1. This script assumes you are the Release Manager, working on Section X of +the Release Manger Guide, and have, therefore, already cut the new Parrot +release. + +2. You must use fully qualified paths for both the '-d' and the '-r' options. +This is true for the query system as well. + +=head1 HISTORY + +* [2012-03-21] Initial version written by Alvis Yardley <ac.yardley@gmail.com> + +=head1 SEE ALSO + +F<docs/project/release_manager_guide.pod> + +F<docs/project/release_parrot_github_guide.pod> + +=cut + +use strict; +use warnings; + +use Getopt::Long; +use Pod::Usage; +use System::Command; +use lib qw( ./lib ); +use Parrot::Config; +use Cwd; + +# Switches +my $docs; # Path to the previous docs release +my $repos; # Path in which to clone the repos +my $delete; # Delete the repos +my $help; # Displays help message +my $version; # Displays version and copyright information + +my $result = GetOptions('d|docs=s' => \$docs, + 'r|repos=s' => \$repos, + 'delete' => \$delete, + 'h|help' => \$help, + 'v|version' => \$version); + +# Catch unrecognized switches +pod2usage() unless $result; + +# Display help message if '-h' was given +pod2usage(0) if $help; + +# Display version and copyright information if '-v' was given +version() && exit(0) if $version; + +# Explanatory display if the options are left unspecified +query_system() unless $docs and $repos and $delete; + +# Get 'docs/' directory if not supplied +get_docs_directory() unless $docs; + +# Get the directory in which to clone the repos if not supplied +get_repo_directory() unless $repos; + +# Get VERSION +open my $FH, '<', 'VERSION' or stop("Unable to open 'VERSION' file"); +chomp($version = <$FH>); +close $FH; + +# Parse version number +my ($major, $minor, $patch); # Quiet perlcritic +($major, $minor, $patch) = ($1, $2, $3) if $version =~ /^(\d+)\.(\d+)\.(\d+)$/; +stop("There is some problem with the major or the minor release numbers") + unless $major and $minor; + +# Set to the previous release version +if ($minor == 0) { + $minor = 11; + $major -= 1; +} +else { + $minor -= 1; +} + +# Get the current working directory +my $parrot_dir = getcwd(); + +# Release process +get_parrot_github(); +get_parrot_docsx(); +archive_parrot_docsx(); +update_parrot_github(); +delete_repos() if $delete; +exit(0); + +########################## +# Subroutine definitions # +########################## + +# Minimal query system +sub query_system { + my $questions; + if ((!defined $docs and !defined $repos) or + (!defined $docs and defined $repos) or + ( defined $docs and !defined $repos)) { + $questions = "a couple of questions"; + } + else { + $questions = "a question"; + } + + print "\nHello. I am the parrot_github_release.pl script. Because you ", + "didn't employ all of the command line options, I need to ask you ", + "$questions.\n\n"; +} + +# Get 'docs/' directory +sub get_docs_directory { + while (1) { + print "What is the path to the previous documentation release? "; + $docs = <>; + chomp $docs; + + last if -d $docs; + } + + $docs .= '/' if $docs =~ /[a-zA-Z0-9]$/; +} + +# Get the directory in which to clone the repos +sub get_repo_directory { + while (1) { + print "What is the path in which to clone the 'parrot.github.com' ", + "and the 'parrot-docsx' repositories? "; + $repos = <>; + chomp $repos; + + last if -d $repos; + } + + $repos .= '/' if $repos =~ /[a-zA-Z0-9]$/; +} + +# Clone a local copy of 'parrot.github.com' +sub get_parrot_github { + chdir $repos; + + print "\n== CLONING 'PARROT.GITHUB.COM' ==\n"; + system('git', 'clone', 'git@github.com:parrot/parrot.github.com.git') == 0 + or stop("Unable to clone 'parrot.github.com'"); + + chdir $parrot_dir; +} + +# Clone a local copy of 'parrot-docsx' +sub get_parrot_docsx { + my $parrot_docsx = 'git@github.com:parrot/parrot-docs' . $major . '.git'; + chdir $repos; + + print "\n== CLONING 'PARROT-DOCSX' ==\n"; + system('git', 'clone', $parrot_docsx) == 0 or + stop("Unable to clone the appropriate 'parrot-docsx' repo."); + + chdir $parrot_dir; +} + +# Archive the previous documentation release to the 'parrot-docsx' repository +sub archive_parrot_docsx { + my $parrot_docsx = $repos . 'parrot-docs' . $major . '/'; + chdir $parrot_docsx; + + print "\n== CHECKING OUT GH-PAGES BRANCH ==\n"; + system('git', 'checkout', 'gh-pages') == 0 or + stop("Unable to switch to the 'gh-pages' branch"); + + my $previous = $major . '.' . $minor . '.' . $patch; + my $copy_to = $parrot_docsx . $previous . '/'; + my $copy_from = $docs . '*'; + + print "\n== MAKING NEW DIRECTORY IN 'PARROT-DOCSX' ==\n"; + mkdir($copy_to) or stop("Unable to make new directory in 'parrot-docsx'"); + + print "\n== COPYING DOCS TO 'PARROT-DOCSX' ==\n"; + # Use shell globbing, for convenience. (Should I rewrite this?) + system("cp -r --target-directory=$copy_to $copy_from") == 0 or + stop("Unable to copy 'docs/' to 'parrot-docsx'"); + + print "\n== GIT ADD ('PARROT-DOCSX') ==\n"; + system('git', 'add', '.') == 0 or + stop("Unable to add to 'parrot-docsx'"); + + print "\n== GIT COMMIT ('PARROT-DOCSX') ==\n"; + system('git', 'commit', '-m', "'Archiving documentation release'") == 0 or + stop("Unable to commit to 'parrot-docsx'"); + + print "\n== CHECKING OUT MASTER ==\n"; + system('git', 'checkout', 'master') == 0 or + stop("Unable to switch to 'master'"); + + print "\n== PUSHING 'PARROT-DOCSX' ==\n"; + system('git', 'push', 'origin', 'gh-pages') == 0 or + stop("Unable to push updates to 'parrot-docsx'"); + + chdir $parrot_dir; +} + +# Update parrot.github.com with present release docs +sub update_parrot_github { + my $parrot_github = $repos . 'parrot.github.com' . '/'; + chdir $parrot_github; + + my $tmp = $PConfig{tempdir}; + + print "\n== SAVING KEY 'PARROT.GITHUB.COM' FILES ==\n"; + system('cp', "--target-directory=$tmp", 'README.pod') == 0 or + stop("Unable to save 'README.pod'"); + system('cp', "--target-directory=$tmp", 'index.html') == 0 or + stop("Unable to save 'index.html'"); + system('cp', "--target-directory=$tmp", 'releases.html') == 0 or + stop("Unable to save 'releases.html'"); + + print "\n== GIT RM ('PARROT.GITHUB.COM') ==\n"; + system('git', 'rm', '-rf', '*') == 0 or + stop("Unable to remove files from 'parrot.github.com'"); + + print "\n== GIT ADD ('PARROT.GITHUB.COM') ==\n"; + system('git', 'add', '-A') == 0 or + stop("Unable to add to 'parrot.github.com'"); + + print "\n== GIT COMMIT ('PARROT.GITHUB.COM') ==\n"; + system('git', 'commit', '-m', "'Removed files from 'parrot.github.com'") == 0 or + stop("Unable to commit to 'parrot.github.com'"); + + print "\n== RESTORING KEY 'PARROT.GITHUB.COM' FILES ==\n"; + system('cp', "$tmp/README.pod", '.') == 0 or + stop("Unable to restore 'README.pod'"); + system('cp', "$tmp/index.html", '.') == 0 or + stop("Unable to restore 'index.html'"); + system('cp', "$tmp/releases.html", '.') == 0 or + stop("Unable to restore 'releases.html'"); + + update_index_html(); + update_releases_html(); + + my $parrot_docs = $parrot_dir . '/' . 'docs/*'; + print "\n== COPYING 'DOCS/' TO 'PARROT.GITHUB.COM' ==\n"; + # Here I am, relying on the shell, again. <sigh> + system("cp -r $parrot_docs .") == 0 or + stop("Unable to copy 'docs/' to 'parrot.github.com'"); + + print "\n== GIT ADD ('PARROT.GITHUB.COM') ==\n"; + system('git', 'add', '.') == 0 or + stop("Unable to add to 'parrot.github.com'"); + + print "\n== GIT COMMIT ('PARROT.GITHUB.COM') ==\n"; + system('git', 'commit', '-m', "'Updated 'parrot.github.com'") == 0 or + stop("Unable to commit to 'parrot.github.com'"); + + print "\n== PUSHING ('PARROT.GITHUB.COM') ==\n"; + system('git', 'push', 'origin', 'master') == 0 or + stop("Unable to push updates to 'parrot.github.com' master"); + + chdir $parrot_dir; +} + +# Update the link to 'Parrot Documentation Releases' in 'index.html' +sub update_index_html { + my $buffer = ''; + open my $FH, '+<', 'index.html' or stop("Unable to open 'index.html'"); + while (<$FH>) { + s/$1/$version/ if /Parrot ($major\.$minor\.$patch)-devel - Home/; + s/$1/$version/ if /Parrot version ($major\.$minor\.$patch)-devel/; + s/$1/$major\.$minor\.$patch/ + if /Parrot Documentation Releases \((\d.\d.\d) - 0.1.1\)/; + $buffer .= $_; + } + seek($FH, 0, 0) or stop("Unable to seek start of 'index.html'"); + print $FH $buffer or stop("Unable to print out 'index.html'"); + truncate($FH, tell($FH)) or stop("Unable to truncate 'index.html'"); + close $FH or stop("Unable to close 'index.html'"); +} + +# Update 'releases.html' to point to the newly archived documents in +# 'parrot-docsx' +sub update_releases_html { + my $buffer = ''; + my $ul = '<ul>'; + my $li = '<li><a href="./parrot-docs' . $major . '/' . $major . '.' . + $minor . '.' . $patch . '/html/index.html">Release ' . $major . '.' . + $minor . '.' . $patch . '</a></li>'; + + open my $FH, '+<', 'releases.html' or stop("Unable to open 'releases.html'"); + while (<$FH>) { + s/$1/$version/ if /Parrot ($major\.$minor\.$patch)-devel - Home/; + s/$1/$version/ if /Parrot version ($major\.$minor\.$patch)-devel/; + if (/<ul>/) { + $buffer .= $_; + $buffer .= $li; + next; # So we don't duplicate the '<ul>' tag. + } + $buffer .= $_; + } + seek($FH, 0, 0) or stop("Unable to seek to start of 'releases.html'"); + print $FH $buffer or stop("Unable to print out 'releases.html'"); + truncate($FH, tell($FH)) or stop("Unable to truncate 'releases.html'"); + close $FH or stop("Unable to close 'releases.html'"); +} + +# Delete the downloaded repositories +sub delete_repos { + my $parrot_docsx = $repos . 'parrot-docs' . $major . '/'; + my $parrot_github = $repos . 'parrot.github.com' . '/'; + + print "\n== DELETING PARROT-DOCSX ==\n"; + system('rm', '-rf', $parrot_docsx) == 0 or + stop("Unable to delete the 'parrot-docsx' repo"); + + print "\n== DELETING PARROT.GITHUB.COM ==\n"; + system('rm', '-rf', $parrot_github) == 0 or + stop("Unable to delete the 'parrot.github.com' repo"); +} + +# Customized version of die() for more consistent diagnostics +sub stop { + if (@_ == 0) { + print '[FATAL ERROR] '; + + if ($!) { + print $!; + } + else { + print 'An unrecoverable error has occurred'; + } + } + else { + my $msg = shift; + print "[ERROR] $msg"; + + if ($!) { + print ": $!"; + } + } + + print "!\n"; + + exit 1; +} + +sub version { + (my $version = <<VERSION_END) =~ s/^\S+//gm; + This is parrot_github_release.pl, v1.0 + + Copyright (C) 2001-2012, Parrot Foundation. + +VERSION_END + print "\n$version"; +} + +################### +# Signal handlers # +################### + +$SIG{'INT'} = sub { stop('SIGINT received. Stopping') }; + +# Local Variables: +# mode: cperl +# cperl-indent-level: 4 +# fill-column: 100 +# End: +# vim: expandtab shiftwidth=4: diff --git a/tools/release/release.json b/tools/release/release.json index 6b580b5963..a78cef7f7d 100644 --- a/tools/release/release.json +++ b/tools/release/release.json @@ -1,9 +1,9 @@ { - "release.version" : "3.6.0", - "release.name" : "Pjaros del Caribe", + "release.version" : "4.3.0", + "release.name" : "In Which...", "release.day" : "Tuesday", - "release.date" : "19 July 2011", - "release.nextdate" : "16 August 2011", + "release.nextdate" : "17 April 2012", + "release.nextdate" : "15 May 2012", "web.root" : "http://parrot.org/", "web.source" : "download", @@ -12,10 +12,10 @@ "web.org_root" : "https://github.com/parrot", "bugday.day" : "Saturday", - "bugday.date" : "13 August 2011", + "bugday.date" : "13 May 2012", - "wiki.root" : "https://trac.parrot.org/parrot/wiki/", - "wiki.bugday" : "bug_day_2011_08_13", + "wiki.root" : "https://github.com/parrot/parrot/wiki", + "wiki.bugday" : "bug_day_2012_03_17", - "ftp.path" : "ftp://ftp.parrot.org/pub/parrot/releases/devel/3.6.0/" + "ftp.path" : "ftp://ftp.parrot.org/pub/parrot/releases/stable/4.3.0/" } diff --git a/tools/release/releasecheck.pl b/tools/release/releasecheck.pl index 2a86bd2549..8eb3c8acc5 100644 --- a/tools/release/releasecheck.pl +++ b/tools/release/releasecheck.pl @@ -3,11 +3,13 @@ use strict; use warnings; -use Data::Dumper;$Data::Dumper::Indent=1; +use Archive::Tar; use Carp; use Cwd; use File::Copy; use File::Temp qw( tempdir ); +use lib qw( ./lib ); +use Parrot::Config; my $cwd = cwd(); opendir my $DIRH, $cwd @@ -32,19 +34,22 @@ my $ctarball = "$tdir/$tb"; copy "$cwd/$tb" => $ctarball or croak "Unable to copy $tb"; - system(qq{tar xzf $ctarball}) - and croak "Unable to untar $ctarball"; + my $tar = Archive::Tar->new; + $tar->read($ctarball); + $tar->extract(); chdir $distro or croak "Unable to chdir to $distro"; print "Reconfiguring\n"; system(qq{$^X Configure.pl --silent}) and croak "Unable to configure"; print "Rebuilding\n"; - system(qq{make --silent}) and croak "Unable to build"; + my $make = $PConfig{make}; + my $silent = $make =~ 'nmake' ? '/S' : '--silent'; + system(qq{$make $silent}) and croak "Unable to build"; print "Retesting\n"; - system(qq{make test}) and croak "'make test' did not complete successfully"; + system(qq{$make test}) and croak "'$make test' did not complete successfully"; print "Rereleasing\n"; - system(qq{make release --silent}) and croak "Unable to release"; + system(qq{$make release $silent}) and croak "Unable to release"; print "Recleaning\n"; - system(qq{make realclean --silent}) and croak "Unable to realclean"; + system(qq{$make realclean $silent}) and croak "Unable to realclean"; chdir $cwd or croak "Unable to change dir back"; print "Leaving temporary directory\n"; } diff --git a/tools/release/sha256sum.pl b/tools/release/sha256sum.pl new file mode 100644 index 0000000000..1e2f071bff --- /dev/null +++ b/tools/release/sha256sum.pl @@ -0,0 +1,20 @@ +# perl +# Copyright (C) 2011, Parrot Foundation. +use strict; +use warnings; +use Digest; + +my $t = shift(@ARGV); +my $d = Digest->new('SHA-256'); +open my $f, '<:raw', $t or die "Cannot open file '$t' for reading: $t"; +binmode $f; +$d->addfile($f); +close $f; +print $d->hexdigest, ' ', $t, "\n"; + +# Local Variables: +# mode: cperl +# cperl-indent-level: 4 +# fill-column: 100 +# End: +# vim: expandtab shiftwidth=4: diff --git a/tools/release/templates.json b/tools/release/templates.json index c4a05c670d..4b0b9e83c3 100644 --- a/tools/release/templates.json +++ b/tools/release/templates.json @@ -37,7 +37,7 @@ instructions</a>. For those who want to hack on Parrot or languages that run on we recommend <a href=\"@web.org_root@\">our organization page</a> on GitHub, or you can go directly to the official Parrot Git repo on <a href=\"@web.repository@\">Github</a> -To clone the the Parrot Git repo into a directory called 'parrot', use the following: +To clone the Parrot Git repo into a directory called 'parrot', use the following: <pre> git clone git://github.com/parrot/parrot.git </pre> diff --git a/tools/release/update_version.pl b/tools/release/update_version.pl index 4398fd1d71..e8f0b778f8 100644 --- a/tools/release/update_version.pl +++ b/tools/release/update_version.pl @@ -65,7 +65,7 @@ =head1 AUTHOR open my $OUT, '>', $new or croak "Unable to open $new for writing"; while (<$IN>) { chomp; - s/$old_version/$new_version/g; + s/\Q$old_version\E/$new_version/g; print $OUT "$_\n"; } close $OUT or croak "Unable to close $new after writing";