Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge branch 'master' of github.com:parrot/parrot

  • Loading branch information...
commit 6b79d2490597d797daa6fffc668633e4e3e59c1b 2 parents 86406d0 + 7e33b2f
@petdance petdance authored
Showing with 1,861 additions and 171 deletions.
  1. +4 −0 .gitignore
  2. +5 −0 CREDITS
  3. +15 −8 MANIFEST
  4. +9 −1 MANIFEST.SKIP
  5. +11 −1 NEWS
  6. +177 −0 README.deutsch
  7. +183 −0 README.espanol
  8. +186 −0 README.polski
  9. +3 −3 config/gen/makefiles/docs.in
  10. +52 −52 config/gen/makefiles/root.in
  11. +39 −38 docs/project/git_workflow.pod
  12. +179 −0 docs/project/merge_review_guidelines.pod
  13. +5 −0 examples/nci/ls.pir
  14. +28 −0 examples/pir/md5sum.pir
  15. 0  {src → frontend/parrot}/main.c
  16. 0  src/parrot_debugger.c → frontend/parrot_debugger/main.c
  17. 0  src/pbc_dump.c → frontend/pbc_dump/main.c
  18. 0  {src → frontend/pbc_dump}/packdump.c
  19. 0  src/pbc_merge.c → frontend/pbc_merge/main.c
  20. +0 −12 include/parrot/oplib.h
  21. +12 −1 src/dynpmc/os.pmc
  22. +2 −2 src/gc/fixed_allocator.c
  23. +72 −0 src/nci/framebuilder.pod
  24. +1 −5 src/ops/core.ops
  25. +1 −1  src/{packfile.c → packfile/api.c}
  26. +1 −1  src/{pmc_freeze.c → packfile/object_serialization.c}
  27. 0  src/{packout.c → packfile/output.c}
  28. +58 −31 src/pmc/hash.pmc
  29. +0 −4 src/pmc/string.pmc
  30. +2 −2 src/runcore/main.c
  31. +584 −7 t/pmc/integer.t
  32. +113 −1 t/pmc/string.t
  33. +1 −1  t/tools/dev/searchops/samples.pm
  34. +118 −0 tools/dev/github_post_receive.pl
View
4 .gitignore
@@ -238,6 +238,10 @@
/ext/Parrot-Embed/t/*.pbc
# generated from svn:ignore of 'ext/nqp-rx/src/stage0/'
/ext/nqp-rx/src/stage0/nqp-setting.pir
+/frontend/parrot/main.o
+/frontend/parrot_debugger/main.o
+/frontend/pbc_dump/main.o
+/frontend/pbc_merge/main.o
# generated from svn:ignore of 'include/parrot/'
/include/parrot/*.tmp
/include/parrot/config.h
View
5 CREDITS
@@ -798,6 +798,11 @@ U: nwellnhof
N: Nikolay Ananiev
D: Win32 build fix
+N: Nolan Lum
+E: nol888@gmail.com
+D: Test coverage improvement.
+U: Yuki`N
+
N: Norman Nunley
D: Shaving a Ponie
E: nnunley@gmail.com
View
23 MANIFEST
@@ -23,6 +23,9 @@ NEWS [main]doc
PBC_COMPAT [main]doc
PLATFORMS [devel]doc
README [devel]doc
+README.deutsch []
+README.espanol []
+README.polski []
README_cygwin.pod [devel]doc
README_win32.pod [devel]doc
RESPONSIBLE_PARTIES [main]doc
@@ -426,6 +429,7 @@ docs/project/core_inclusion.pod [doc]
docs/project/debian_packaging_guide.pod [doc]
docs/project/git_terminology.pod [doc]
docs/project/git_workflow.pod [doc]
+docs/project/merge_review_guidelines.pod [doc]
docs/project/metacommitter_guide.pod [doc]
docs/project/release_manager_guide.pod [doc]
docs/project/roles_responsibilities.pod [doc]
@@ -670,6 +674,7 @@ examples/pir/life.pir [examples]
examples/pir/local_label.pir [examples]
examples/pir/make_hello_pbc.pir [examples]
examples/pir/mandel.pir [examples]
+examples/pir/md5sum.pir [examples]
examples/pir/mysqltest.bas [examples]
examples/pir/perl6.bas [examples]
examples/pir/pirric.pir [examples]
@@ -898,6 +903,11 @@ ext/nqp-rx/t/p6regex/rx_modifiers [test]
ext/nqp-rx/t/p6regex/rx_quantifiers [test]
ext/nqp-rx/t/p6regex/rx_subrules [test]
ext/nqp-rx/t/p6regex/rx_syntax [test]
+frontend/parrot/main.c []
+frontend/parrot_debugger/main.c []
+frontend/pbc_dump/main.c []
+frontend/pbc_dump/packdump.c []
+frontend/pbc_merge/main.c []
include/parrot/atomic.h [main]include
include/parrot/atomic/fallback.h [main]include
include/parrot/atomic/gcc_pcc.h [main]include
@@ -1284,7 +1294,6 @@ src/libnci_test.def []
src/library.c []
src/list.c []
src/longopt.c []
-src/main.c []
src/misc.c []
src/multidispatch.c []
src/namespace.c []
@@ -1293,6 +1302,7 @@ src/nci/core_thunks.c []
src/nci/core_thunks.nci []
src/nci/extra_thunks.c []
src/nci/extra_thunks.nci []
+src/nci/framebuilder.pod []
src/nci/libffi.c []
src/nci/signatures.c []
src/nci_test.c []
@@ -1311,15 +1321,12 @@ src/ops/set.ops []
src/ops/string.ops []
src/ops/sys.ops []
src/ops/var.ops []
-src/packdump.c []
-src/packfile.c []
+src/packfile/api.c []
src/packfile/byteorder.h []
+src/packfile/object_serialization.c []
+src/packfile/output.c []
src/packfile/pf_items.c []
-src/packout.c []
-src/parrot_debugger.c []
src/pbc_disassemble.c []
-src/pbc_dump.c []
-src/pbc_merge.c []
src/pmc.c []
src/pmc/addrregistry.pmc []
src/pmc/arrayiterator.pmc []
@@ -1407,7 +1414,6 @@ src/pmc/threadinterpreter.pmc []
src/pmc/timer.pmc []
src/pmc/undef.pmc []
src/pmc/unmanagedstruct.pmc []
-src/pmc_freeze.c []
src/pointer_array.c []
src/runcore/cores.c []
src/runcore/main.c []
@@ -2086,6 +2092,7 @@ tools/dev/gen_charset_tables.pl []
tools/dev/gen_class.pl []
tools/dev/gen_makefile.pl [devel]
tools/dev/gen_valgrind_suppressions.pl []
+tools/dev/github_post_receive.pl []
tools/dev/headerizer.pl []
tools/dev/install_dev_files.pl []
tools/dev/install_doc_files.pl []
View
10 MANIFEST.SKIP
@@ -1,6 +1,6 @@
# ex: set ro:
# $Id$
-# generated by tools/dev/mk_manifest_and_skip.pl Mon Nov 15 22:12:26 2010 UT
+# generated by tools/dev/mk_manifest_and_skip.pl
#
# This file should contain a transcript of the svn:ignore properties
# of the directories in the Parrot subversion repository. (Needed for
@@ -304,6 +304,14 @@
^/ext/Parrot-Embed/t/.*\.pbc/
^/ext/nqp-rx/src/stage0/nqp-setting\.pir$
^/ext/nqp-rx/src/stage0/nqp-setting\.pir/
+^/frontend/parrot/main\.o$
+^/frontend/parrot/main\.o/
+^/frontend/parrot_debugger/main\.o$
+^/frontend/parrot_debugger/main\.o/
+^/frontend/pbc_dump/main\.o$
+^/frontend/pbc_dump/main\.o/
+^/frontend/pbc_merge/main\.o$
+^/frontend/pbc_merge/main\.o/
^/include/parrot/.*\.tmp$
^/include/parrot/.*\.tmp/
^/include/parrot/config\.h$
View
12 NEWS
@@ -2,10 +2,20 @@ 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.
+ + Several public functions in libparrot have been brought up to standard
+ naming conventions.
- 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
New in 2.10.0
- Core
View
177 README.deutsch
@@ -0,0 +1,177 @@
+Das ist Parrot, version 2.10.1
+------------------------------
+
+Parrot ist Kopiergeschützt (C) 2001-2010, Parrot Foundation.
+
+
+LIZENZ INFORMATION
+-------------------
+
+Dieser Code ist veröffentlicht unter den Bedingungen von Artistic License 2.0.
+Für mehr details, lesen sie die Datei LICENSE.
+
+ÜBERSICHT
+--------
+Parrot ist eine virtuelle Maschine gebaut um effektiv
+bytecode für dynamisch Sprachen auszuführen.
+
+ANFORDERUNGEN
+-------------
+
+Du brauchst ein C Kompiler,ein Linker, und natürlich ein make Programm.
+
+Wenn du mit der ICU library verbinden wirst musst du dies herunterladen und installieren
+bevor du Parrot konfigurierst. Dies ist hier verfügbar: http://site.icu-project.org/download
+
+Du wirst auch Perl 5.8.4 gebrauchen, und Storable 2.12 oder neuer
+um einige Konfigurationen auszuführen oder Build Scripts.
+
+Für alle PLattformen die wir unterstüzen sollte Parrot ohne Änderung
+gebrauchbar sein. docs/parrot.pod zeigt unsere unterstützten Plattformen. PLATFORMS stellt
+Berichte zur Verfügung über die Plattformen für welche Parrot gebaut wurde.
+
+WIE MAN PARROT VON GITHUB INSTALLIERT
+----------------------------------
+I. Git installieren:
+
+Linux:
+Die Methode ist abhängig auf ihre Distribution. Zum installieren solltest du dies ausführen: (als root oder sudo <cmd>):
+
+Auf Ubuntu/Debian (apt-based):
+
+ apt-get install git-core
+
+Auf Red Hat, Fedora (rpm-based):
+
+ yum install git
+
+Auf Gentoo (portage):
+
+ emerge -av dev-vcs/git
+
+Windows: Es gibt 2 Git Ports auf Windows:
+
+msysgit http://code.google.com/p/msysgit/downloads/list
+TortoiseGit http://code.google.com/p/tortoisegit/downloads/list
+
+Macintosh OS X:
+
+Eine Suche auf dem Internet wird eine Menge an Git installers für Mac OS X
+finden, unter anderem diese:
+
+ http://help.github.com/mac-git-installation/
+
+II. Parrot von github.com holen
+
+Um eine Kopie der Parrot git Repository zu holen:
+
+ git clone git://github.com/parrot/parrot.git
+
+Dies wird von Anfang an als Master ausführen. Um ein lokaler Branch zu kreiren
+dass den Branch "some_branch" trackt:
+
+ git checkout -b --track some_branch origin/some_branch
+
+Alle URL die ober erwähnt wurden sind read-only. Wenn du ein Parrot core
+Entwickler bist, dann benütze die folgende URL:
+
+ git clone git@github.com:parrot/parrot.git
+
+Du kannst eine komplette Liste der Branches finden unter:
+http://github.com/parrot
+
+ANLEITUNGEN
+------------
+
+Für jetzt, packe dein Parrot tarball aus, (wenn du dies liest, hast du das
+wahrscheinlich schon gemacht) und schreibe:
+
+ perl Configure.pl
+
+um den Configure Script auszuführen. Der Configure.pl Script nimmt Konfiguration
+heraus vom laufenden perl5 Programm Du must dem Konfiguration erklären genau
+welche Compiler Und Linker zu benutzen. Zum Beispiel, Compile C Dateien mit 'cc',
+C++ Dateien mit 'CC', und verbindet alles zumsammen mit 'CC', würdest du
+schreiben:
+
+ perl Configure.pl --cc=cc --cxx=CC --link=CC --ld=CC
+
+Siehe "perl Configure.pl --help" für mehr Optionen und docs/configuration.pod
+für mehr Details.
+
+Für Systeme wie HPUX die nicht inet_pton haben, fürhe dies aus:
+
+ perl Configure.pl --define=inet_aton
+
+Configure.pl ausführen wird einen config.h Header configurieren, ein Parrot::Config
+Model, Plattform Dateien und viele Makefiles.
+
+Die Datei "myconfig" hat eine Übersicht über Konfiguration Einstellungen.
+Als nächstes, führe make aus. (Configure.pl wird dir sagen welche Version von make it
+für dein System optimiert ist.)
+
+Als nächstes soll der Build gemacht werden. Wenn du den ICU Library machst,
+(Dies ist default bei den meisten Systemen), brauchst du GNU make
+(oder etwas kompatibel damit).
+
+Du kannst Parrot ausführen indem du "make test" ausführst. Du kannst die Tests mit
+"make TEST_JOBS=3 test" gleichzeitig ausführen.
+
+Du kannst den ganzen Test Suite ausführen:
+
+ make fulltest
+
+Merke: PLATFORMS beinhaltet Notzizen ob die Tests auf deinem System
+erfolgreich sein werden
+
+Du kannst Parrot installieren mit:
+
+ make install
+
+Bei default installiert dies bei /usr/local, mit dem Parrot Programm in
+/usr/local/bin. Wenn du Parrot irgendwo anderst installieren willst, benützte:
+
+ perl Configure.pl --prefix=/home/joe/bird
+ make install
+
+Merke dir dass dynamische libs nicht gefunden werden für nicht-standarde
+Orte ausser du LD_LIBRARY_PATH benützt oder etwas ähnliches.
+
+Schaue bei docs/parrot.pod and docs/intro.pod wie du von hier weitermachen sollst. Wenn du
+irgendwelche Probleme hast, siehe den Abteil "How To Submit A Bug Report" in
+docs/submissions.pod. Diese Dokumente sind in POD format. Du kannst diese
+Dateien sehen mit dem Command:
+
+ perldoc -F docs/intro.pod
+
+ÄNDERUNGEN
+----------
+
+Für Dokumentationen über die user-sichtbare Änderungen zwischen dieser Version und
+alte Versionen, siehe NEWS.
+
+MAILING LISTEN
+--------------
+
+Die Parrot user Mailing Liste ist parrot-users@lists.parrot.org. Abonniere mit dem Formular bei
+http://lists.parrot.org/mailman/listinfo/parrot-users .
+Die Liste ist archived bei http://lists.parrot.org/pipermail/parrot-users/ .
+
+Für Entwickler Diskussionen siehe die Information bei docs/gettingstarted.pod.
+
+BERICHTE, PATCHES, usw.
+-----------------------
+
+Siehe ocs/submissions.pod für mehr Information über wie man Bugs und Patches
+reportiert.
+
+WEBSEITEN
+---------
+
+Die folgenden Webseiten haben Information über Parrot:
+ http://www.parrot.org/
+ http://trac.parrot.org/
+ http://docs.parrot.org/
+
+Viel Spass,
+ The Parrot Team.
View
183 README.espanol
@@ -0,0 +1,183 @@
+LÉASE
+------------------------
+
+Esta es la versión Parrot, 2.10.1
+-----------------------------
+
+Parrot Copyright (C) 2001-2010, Parrot Foundation.
+
+
+INFORMACIÓN DE LICENCIA
+-------------------
+
+Este código se distribuye bajo los términos de la Licencia Artística 2.0.
+Para más detalles, vea el texto completo de la licencia en el archivo de licencia.
+
+RESUMEN
+--------
+Parrot es una máquina virtual diseñada para compilar y ejecutar de manera eficiente
+bytecode para lenguajes dinámicos.
+
+REQUISITOS PREVIOS
+-------------
+
+Necesitas un compilador de C, enlazador, y por supuesto, un programa.
+
+Si va a vincular con la biblioteca de la ICU tienes que descargarlo e instalarlo
+antes de configurar Parrot. Lo puedes obtener desde el sitio http://site.icu-project.org/download
+
+También necesitas Perl 5.8.4 o posterior, y Storable 2.12 o más reciente
+para el funcionamiento de diversos configura y crea secuencias de comandos.
+
+Para la mayoría de las plataformas que nos están apoyando inicialmente, Parrot debe construir
+afuera de la caja. docs / parrot.pod listas de las plataformas principales. PLATAFORMAS proporcionan
+informes sobre las plataformas en las que Parrot ha sido construido y probado.
+
+COMO CONSEGUIR PARROT DESDE GITHUB
+-----------------------------
+I. Tienes que instalar Git.
+
+Linux:
+El método depende de su distribución. Para instalar se debe ejecutar (como root o sudo <cmd>):
+
+En Ubuntu/Debian (apt-based):
+
+ apt-get install git-core
+
+En Red Hat, Fedora (rpm-based):
+
+ yum install git
+
+En Gentoo (portage):
+
+ emerge-av dev-vcs/git
+
+Windows:
+Hay dos puertos de Git en Windows:
+
+msysgit http://code.google.com/p/msysgit/downloads/list
+TortoiseGit http://code.google.com/p/tortoisegit/downloads/list
+
+Macintosh OS X:
+
+Una búsqueda en Internet localizara una variedad de instaladores de git para Mac OS X,
+http://help.github.com/mac-git-installation/
+
+II. Para obtener Parrot desde Github.com
+
+Para obtener una copia del repositorio Git Parrot:
+
+ git clone git://github.com/parrot/parrot.git
+Esto echa un vistazo a la Branch principal de forma predeterminada. Para crear una sección local
+que sigue la sucursal "some_branch":
+
+ git checkout -b --track some_branch origin/some_branch
+
+Todas las URL anteriores son de sólo lectura. Si eres es un desarrollador principal Parrot, a
+
+continuación,
+utiliza la lectura y escritura URL:
+
+ git clone git@github.com:parrot/parrot.git
+
+Puede ver la lista de Branch en http://github.com/parrot/parrot
+
+INSTRUCCIONES
+------------
+Por ahora, descomprime el archivo tar Parrot, (si estás leyendo esto,
+probablemente ya lo ha hecho) y escriba
+
+
+ perl Configure.pl
+
+para ejecutar el script de configuración. La secuencia de comandos Configure.pl extrae la
+
+configuración
+de la ejecución programa Perl5. Puede que tenga que decirle explícitamente a Configure.pl
+que compilador y enlazador debe de usar Por ejemplo, para compilar archivos de C con 'cc',
+C++ archivos con "CC", y todo vínculo con "CC", escribiría
+
+ perl Configure.pl --cc=cc --cxx=CC --link=CC --ld=CC
+
+Consulte "perl Configure.pl - help" para obtener más opciones y docs / configuration.pod
+para más detalles.
+
+Para los sistemas como HP / UX que no tienen inet_pton por favor, ejecuta
+
+ perl Configure.pl --define=inet_aton
+
+Ejecutando Config.pl generará un encabezado config.h, al modulo Parrot::Config
+, los archivos de la plataforma y muchos Makefiles
+
+El archivo "myconfig" tiene una visión general de la configuración.
+
+A continuación, ejecuta make. (Configure.pl le dirá qué versión de make
+recomienda para su sistema.)
+
+Ahora, el intérprete debe construir. Si estas construyendo la biblioteca de la ICU
+(Este es el defecto en la mayoría de sistemas), es necesario utilizar GNU Make en lugar
+(O algo compatible con él).
+
+Puede probar Parrot ejecutando "make test". Puedes ejecutar las pruebas en paralelo
+con "make TEST_JOBS = 3 prueba".
+
+Puedes ejecutar la suite de pruebas con
+
+make fulltest
+
+Nota: PLATAFORMAS contiene notas acerca de si se esperan fallas de prueba
+en tu sistema
+
+Puedes instalar Parrot con:
+
+ make install
+
+De forma predeterminada, se instala en /usr/local, con el ejecutable de Parrot en
+/usr/local/bin. Si desea instalar Parrot en otro lugar de uso:
+
+ perl Configure.pl --prefix=/home/joe/bird
+ make install
+
+Pero ten en cuenta que bibliotecas dinámicas no se pueden encontrar en lugares no estándar
+a menos que establezca LD_LIBRARY_PATH o algo similar.
+
+vea docs/parrot.pod and docs/intro.pod para dónde ir desde aquí. Si encuentras cualquier problema,
+
+consulta la sección "Cómo presentar una informe de errores" en
+docs/submissions.pod. Estos documentos están en formato POD. puede ver estos
+archivos con el comando:
+
+ perldoc -F docs/intro.pod
+
+CAMBIOS
+-------
+
+Para obtener documentación sobre los cambios visibles para el usuario entre esta versión y la
+versiones anteriores, consulta NOTICIAS.
+
+LISTAS DE CORREO
+-------------
+
+La lista de correo de usuarios Parrot es parrot-users@lists.parrot.org. Subscribase llenando el
+
+formulario en http://lists.parrot.org/mailman/listinfo/parrot-users .
+La lista se archiva en http://lists.parrot.org/pipermail/parrot-users/.
+
+Para debates de desarollo vea la información en docs/gettingstarted.pod.
+
+COMENTARIOS, PARCHES, etc.
+-----------------------
+
+Vea docs / submissions.pod para obtener más información sobre cómo informar errores y
+el envío de parches.
+
+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/
+
+ Que se diviertan,
+ El equipo de Parrot.
View
186 README.polski
@@ -0,0 +1,186 @@
+To jest Parrot, wersja 2.10.1
+-----------------------------
+
+Prawa autorskie (C) Parrota należą do 2001-2010, Parrot Foundation.
+
+INFORMACJA O LICENCJI
+---------------------
+
+Ten kod jest rozpowszechniany na warunkach licencji Artistic License 2.0.
+Więcej szczegółów znajduje się w pliku LICENCE, gdzie można znaleźć cały
+tekst licencji.
+
+OPIS
+----
+
+Parrot jest maszyną wirtualną, zaprojektowaną, aby efektywnie kompilować
+i wykonywać kod języków dynamicznych.
+
+WYMAGANIA
+---------
+
+Potrzebujesz kompilator języka C, linker, i oczywiście program make.
+
+Jeśli będziesz linkował z biblioteką ICU, musisz ją ściągnąć i zainstalować
+przed konfigurowaniem Parrota. Pobierz ją z http://site.icu-project.org/download
+
+Potrzebujesz również Perla 5.8.4 lub nowszego, i Storable 2.12 lub nowszego,
+aby uruchamiać różne skrypty służące do konfiguracji i budowania.
+
+Na większości z platform, które wspieramy od początku, Parrot powinien zbudować
+się sam. Lista wspieranych platform znajduje się w docs/parrot.pod.
+Plik PLATFORMS przechowuje informacje dotyczące raportów z platform, na
+których Parrot był zbudowany i testowany.
+
+JAK UZYSKAĆ PARROT Z GITHUB
+---------------------------
+I. Zainstaluj Git.
+
+Linux:
+Metoda instalacji zależy od twojej dystrybucji. Instalacja rozpocznie się po
+wpisaniu (jako root, albo sudo <komenda>):
+
+Na Ubuntu/Debianie (oparte na apt):
+
+ apt-get install git-core
+
+Na Red Hat/Fedorze (oparte na rpm):
+
+ yum install git
+
+Na Gentoo (portage):
+
+ emerge -av dev-vcs/git
+
+Windows:
+Są 2 porty Git na Windows:
+
+msysgit http://code.google.com/p/msysgit/downloads/list
+TortoiseGit http://code.google.com/p/tortoisegit/downloads/list
+
+Macintosh OS X:
+
+Przejrzenie internetu pozwoli znaleźć wiele różnych instalatorów git dla
+Mac OS X, w tym:
+
+ http://help.github.com/mac-git-installation/
+
+II. Uzyskanie Parrot z github.com
+
+Aby ściągnąć kopię repozytorium Git Parrota:
+
+ git clone git://github.com/parrot/parrot.git
+
+Ta komenda domyślnie ustawi gałąź na master. Aby utworzyć lokalną gałąź,
+która śledzi gałąź "some_branch":
+
+ git checkout -b --track some_branch origin/some_branch
+
+Wszystkie powyższe adresy URL służą jedynie do ściągania danych. Jeśli jesteś
+deweloperem jądra Parrot, użyj adresu, który pozwoli na odczyt i zapis:
+
+ git clone git@github.com:parrot/parrot.git
+
+Możesz zobaczyć listę wszystkich gałęzi na http://github.com/parrot/parrot
+
+INSTRUKCJE
+----------
+
+Na początek, wypakuj tarballa Parrota (jeśli to czytasz, to prawdopodobnie
+już to zrobiłeś) i wpisz
+
+ perl Configure.pl
+
+aby uruchomić skrypt Configure. Skrypt ten odczyta konfigurację
+z uruchomionego programu perl5. Możliwe, że będziesz musiał jawnie pokazać
+Configure.pl którego kompilatora i linkera ma użyć. Na przykład, aby
+kompilować pliki C za pomocą 'cc', pliki C++ za pomocą 'CC', a linkować
+wszystko za pomocą 'CC', należy wpisać
+
+ perl Configure.pl --cc=cc --cxx=CC --link=CC --ld=CC
+
+Uruchom "perl Configure.pl --help", aby poznać więcej opcji i do
+docs/configuration.pod po więcej szczegółów.
+
+W systemach podobnych do HPUX, które nie posiadają inet_pton, należy uruchomić
+
+ perl Configure.pl --define=inet_aton
+
+Configure.pl wygeneruje nagłówek config.h, moduł Parrot:Config,
+pliki zależne od platformy i wiele plików Makefile.
+
+Plik "myconfig" posiada przegląd ustawień konfiguracji.
+
+Następnie uruchom make. (Configure.pl poda, którą wersję make'a zaleca dla twojego systemu)
+
+Teraz interpreter powinien zbudować program. Jeśli budujesz bibliotekę ICU
+(co jest domyślne dla większości systemów), powinieneś użyć GNU make
+(lub czegoś, co jest z nim kompatybilne).
+
+Możesz przetestować Parrota za pomocą "make test". Możesz uruchomić testy
+równolegle za pomocą "make TEST_JOBS=3 test".
+
+Możesz uruchomić pełną gamę testów za pomocą
+
+ make fulltest
+
+Uwaga: plik PLATFORMS zawiera informacje o tym, jakich błędów
+powinieneś się spodziewać.
+
+Możesz zainstalować Parrot za pomocą:
+
+ make install
+
+Domyślnie, ta komenda instaluje Parrota w /usr/local, a jego plik wykonywalny
+umieszcza w /usr/local/bin. Jeśli chcesz zainstalować Parrota w innym miejscu,
+użyj:
+
+ perl Configure.pl --prefix=/home/joe/bird
+ make install
+
+Zwróć uwagę na to, że biblioteki dynamiczne nie będą znalezione
+w niestandardowych lokalizacjach, chyba że ustawisz LD_LIBRARY_PATH,
+albo coś podobnego.
+
+Zajrzyj do docs/parrot.pod i docs/intro.pod, aby dowiedzieć się, co dalej.
+Jeśli masz jakiekolwiek problemy, spójrz do rozdziału "How To Submit A
+Bug Report" w docs/submissions.pod. Te dokumenty są w formacie POD.
+Możesz je obejrzeć za pomocą komendy:
+
+ perldoc -F docs/intro.pod
+
+ZMIANY
+------
+
+Spis zmian zauważalnych przez użytkownika pomiędzy tą,
+a poprzednimi wersjami znajduje się w pliku NEWS.
+
+LISTY DYSKUSYJNE
+----------------
+
+Lista dyskusyjna użytkowników Parrot to parrot-users@lists.parrot.org.
+Dołącz do niej poprzez wypełnienie formularza
+http://lists.parrot.org/mailman/listinfo/parrot-users .
+Lista dyskusyjna jest dostępna pod adresem
+http://lists.parrot.org/pipermail/parrot-users/ .
+
+Aby uzyskać informację na temat list dyskusyjnych deweloperów, zajrzyj
+do docs/gettingstarted.pod.
+
+PRZEKAZANIE OPINII, PATCHA, itd.
+--------------------------------
+
+Zajrzyj do docs/submissions.pod po więcej informacji na temat
+zgłaszania błędów i wysyłania patchów.
+
+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/
+
+Miłej zabawy,
+ The Parrot Team.
View
6 config/gen/makefiles/docs.in
@@ -39,9 +39,9 @@ doc-prep:
$(MKPATH) ops
$(TOUCH) doc-prep
-packfile-c.pod: ../src/packfile.c
-#IF(new_perldoc): $(PERLDOC_BIN) -ud packfile-c.pod ../src/packfile.c
-#ELSE: $(PERLDOC_BIN) -u ../src/packfile.c > packfile-c.pod
+packfile-c.pod: ../src/packfile/api.c
+#IF(new_perldoc): $(PERLDOC_BIN) -ud packfile-c.pod ../src/packfile/api.c
+#ELSE: $(PERLDOC_BIN) -u ../src/packfile/api.c > packfile-c.pod
clean:
$(RM_F) packfile-c.pod $(POD) doc-prep
View
104 config/gen/makefiles/root.in
@@ -495,10 +495,8 @@ INTERP_O_FILES = \
#IF(has_core_nci_thunks): src/nci/core_thunks$(O) \
#IF(has_extra_nci_thunks): src/nci/extra_thunks$(O) \
src/oo$(O) \
- src/packfile$(O) \
- src/packout$(O) \
src/platform$(O) \
- src/pmc_freeze$(O) \
+ src/packfile/object_serialization$(O) \
src/pmc$(O) \
src/runcore/main$(O) \
src/runcore/cores$(O) \
@@ -513,6 +511,8 @@ INTERP_O_FILES = \
src/utils$(O) \
src/vtables$(O) \
src/warnings$(O) \
+ src/packfile/api$(O) \
+ src/packfile/output$(O) \
src/packfile/pf_items$(O) \
@TEMP_atomic_o@ \
@TEMP_gc_o@ \
@@ -591,7 +591,7 @@ MAKE = @make_c@
.SUFFIXES : .c .S .s .pmc .dump $(O) .str .pir .pbc
.c$(O) : # suffix rule (limited support)
- $(CC) $(CFLAGS) @optimize@ $(CC_WARN) -I$(@D) @cc_o_out@$@ -c $<
+ $(CC) $(CFLAGS) @optimize@ $(CC_WARN) -I$(@D) -Isrc/ @cc_o_out@$@ -c $<
#UNLESS(win32):.s$(O) : # suffix rule (limited support)
#UNLESS(win32): $(CC) $(CFLAGS) @optimize@ $(CC_WARN) -I$(@D) @cc_o_out@$@ -c $<
@@ -700,10 +700,10 @@ STR_FILES = \
#IF(has_core_nci_thunks): src/nci/core_thunks.str \
#IF(has_extra_nci_thunks): src/nci/extra_thunks.str \
src/nci/signatures.str \
- src/packfile.str \
+ src/packfile/api.str \
+ src/packfile/object_serialization.str \
src/packfile/pf_items.str \
src/pmc.str \
- src/pmc_freeze.str \
src/oo.str \
src/runcore/cores.str \
src/runcore/main.str \
@@ -857,11 +857,11 @@ runtime/parrot/include/config.fpmc : myconfig config_lib.pir \
runtime/parrot/include/datatypes.pasm $(MINIPARROT)
$(MINIPARROT) -Iruntime/parrot/include config_lib.pir > $@
-$(PARROT) : src/main$(O) $(GEN_HEADERS) $(LIBPARROT) \
+$(PARROT) : frontend/parrot/main$(O) $(GEN_HEADERS) $(LIBPARROT) \
src/parrot_config$(O) \
$(MINIPARROT)
$(LINK) @ld_out@$@ \
- src/main$(O) src/parrot_config$(O) \
+ frontend/parrot/main$(O) src/parrot_config$(O) \
@rpath_blib@ $(ALL_PARROT_LIBS) $(LINKFLAGS) $(LINK_DYNAMIC)
#IF(win32): if exist $@.manifest mt.exe -nologo -manifest $@.manifest -outputresource:$@;1
@@ -885,17 +885,17 @@ $(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) : src/main$(O) $(GEN_HEADERS) $(LIBPARROT) \
+$(MINIPARROT) : frontend/parrot/main$(O) $(GEN_HEADERS) $(LIBPARROT) \
src/null_config$(O)
- $(LINK) @ld_out@$@ src/main$(O) src/null_config$(O) \
+ $(LINK) @ld_out@$@ frontend/parrot/main$(O) src/null_config$(O) \
@rpath_blib@ $(ALL_PARROT_LIBS) $(LINKFLAGS)
#IF(win32): if exist $@.manifest mt.exe -nologo -manifest $@.manifest -outputresource:$@;1
-$(INSTALLABLEPARROT) : src/main$(O) $(GEN_HEADERS) $(LIBPARROT) \
+$(INSTALLABLEPARROT) : frontend/parrot/main$(O) $(GEN_HEADERS) $(LIBPARROT) \
src/install_config$(O) \
$(PARROT)
$(LINK) @ld_out@$@ \
- src/main$(O) src/install_config$(O) \
+ frontend/parrot/main$(O) src/install_config$(O) \
@rpath_lib@ $(ALL_PARROT_LIBS) $(LINKFLAGS)
#IF(win32): if exist $@.manifest mt.exe -nologo -manifest $@.manifest -outputresource:$@;1
@@ -1023,20 +1023,20 @@ $(INSTALLABLEPROVE) : parrot-prove.pbc $(PBC_TO_EXE) src/install_config$(O)
# Parrot Debugger
#
-src/parrot_debugger$(O) : $(PARROT_H_HEADERS) src/parrot_debugger.c \
+frontend/parrot_debugger/main$(O) : $(PARROT_H_HEADERS) frontend/parrot_debugger/main.c \
$(INC_DIR)/embed.h \
$(INC_DIR)/runcore_api.h
-$(PDB) : src/parrot_debugger$(O) src/parrot_config$(O) $(LIBPARROT)
+$(PDB) : frontend/parrot_debugger/main$(O) src/parrot_config$(O) $(LIBPARROT)
$(LINK) @ld_out@$@ \
- src/parrot_debugger$(O) \
+ frontend/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) : src/parrot_debugger$(O) $(LIBPARROT) src/parrot_config$(O)
+$(INSTALLABLEPDB) : frontend/parrot_debugger/main$(O) $(LIBPARROT) src/parrot_config$(O)
$(LINK) @ld_out@$@ \
- src/parrot_debugger$(O) \
+ frontend/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
@@ -1064,28 +1064,28 @@ $(INSTALLABLEDIS) : src/pbc_disassemble$(O) \
#
# Parrot Dump
#
-src/packdump$(O) : $(PARROT_H_HEADERS) include/pmc/pmc_sub.h \
- include/pmc/pmc_key.h src/packdump.c
+frontend/pbc_dump/packdump$(O) : $(PARROT_H_HEADERS) include/pmc/pmc_sub.h \
+ include/pmc/pmc_key.h frontend/pbc_dump/packdump.c
-$(PDUMP) : src/pbc_dump$(O) src/packdump$(O) $(LIBPARROT)
+$(PDUMP) : frontend/pbc_dump/main$(O) frontend/pbc_dump/packdump$(O) $(LIBPARROT)
$(LINK) @ld_out@$@ \
- src/pbc_dump$(O) \
- src/packdump$(O) @rpath_blib@ $(ALL_PARROT_LIBS) $(LINKFLAGS)
+ frontend/pbc_dump/main$(O) \
+ frontend/pbc_dump/packdump$(O) @rpath_blib@ $(ALL_PARROT_LIBS) $(LINKFLAGS)
#IF(win32): if exist $@.manifest mt.exe -nologo -manifest $@.manifest -outputresource:$@;1
-src/pbc_dump$(O) : \
+frontend/pbc_dump/main$(O) : \
$(INC_DIR)/embed.h \
$(INC_DIR)/oplib/ops.h \
$(INC_DIR)/oplib/core_ops.h \
$(PARROT_H_HEADERS) \
$(INC_DIR)/runcore_api.h \
- src/pbc_dump.c
+ frontend/pbc_dump/main.c
-$(INSTALLABLEPDUMP) : src/pbc_dump$(O) src/packdump$(O) \
+$(INSTALLABLEPDUMP) : frontend/pbc_dump/main$(O) frontend/pbc_dump/packdump$(O) \
src/install_config$(O) $(LIBPARROT)
$(LINK) @ld_out@$@ \
- src/pbc_dump$(O) \
- src/packdump$(O) \
+ frontend/pbc_dump/main$(O) \
+ frontend/pbc_dump/packdump$(O) \
@rpath_lib@ $(ALL_PARROT_LIBS) $(LINKFLAGS)
#IF(win32): if exist $@.manifest mt.exe -nologo -manifest $@.manifest -outputresource:$@;1
@@ -1095,16 +1095,16 @@ $(INSTALLABLEPDUMP) : src/pbc_dump$(O) src/packdump$(O) \
# Parrot Bytecode File Merger
#
-$(PBC_MERGE) : src/pbc_merge$(O) $(LIBPARROT) src/parrot_config$(O)
+$(PBC_MERGE) : frontend/pbc_merge/main$(O) $(LIBPARROT) src/parrot_config$(O)
$(LINK) @ld_out@$@ \
- src/pbc_merge$(O) \
+ frontend/pbc_merge/main$(O) \
src/parrot_config$(O) \
@rpath_blib@ $(ALL_PARROT_LIBS) $(LINK_DYNAMIC) $(LINKFLAGS)
#IF(win32): if exist $@.manifest mt.exe -nologo -manifest $@.manifest -outputresource:$@;1
-$(INSTALLABLEPBC_MERGE) : src/pbc_merge$(O) $(LIBPARROT) $(INSTALLABLECONFIG)
+$(INSTALLABLEPBC_MERGE) : frontend/pbc_merge/main$(O) $(LIBPARROT) $(INSTALLABLECONFIG)
$(LINK) @ld_out@$@ \
- src/pbc_merge$(O) \
+ frontend/pbc_merge/main$(O) \
src/install_config$(O) \
@rpath_lib@ $(ALL_PARROT_LIBS) $(LINKFLAGS)
#IF(win32): if exist $@.manifest mt.exe -nologo -manifest $@.manifest -outputresource:$@;1
@@ -1295,7 +1295,7 @@ src/namespace$(O) : $(PARROT_H_HEADERS) src/namespace.str src/namespace.c \
src/pmc$(O) : include/pmc/pmc_class.h src/pmc.c \
src/pmc.str $(PARROT_H_HEADERS)
-src/pmc_freeze$(O) : $(PARROT_H_HEADERS) src/pmc_freeze.str src/pmc_freeze.c
+src/packfile/object_serialization$(O) : $(PARROT_H_HEADERS) src/packfile/object_serialization.str src/packfile/object_serialization.c
src/hash$(O) : $(PARROT_H_HEADERS) src/hash.c
@@ -1537,13 +1537,13 @@ src/io/win32$(O) : $(PARROT_H_HEADERS) src/io/io_private.h \
src/gc/alloc_memory$(O) : $(PARROT_H_HEADERS) src/gc/alloc_memory.c
-src/main$(O) : \
+frontend/parrot/main$(O) : \
$(INC_DIR)/imcc.h \
$(PARROT_H_HEADERS) \
$(INC_DIR)/embed.h \
$(INC_DIR)/runcore_api.h \
src/gc/gc_private.h \
- src/main.c \
+ frontend/parrot/main.c \
src/gc/variable_size_pool.h
src/multidispatch$(O) : \
@@ -1555,9 +1555,9 @@ src/multidispatch$(O) : \
include/pmc/pmc_nci.h \
include/pmc/pmc_sub.h
-src/packfile$(O) : \
- src/packfile.str \
- src/packfile.c \
+src/packfile/api$(O) : \
+ src/packfile/api.str \
+ src/packfile/api.c \
include/pmc/pmc_sub.h \
include/pmc/pmc_key.h \
include/pmc/pmc_parrotlibrary.h \
@@ -1577,14 +1577,14 @@ src/packfile$(O) : \
$(PARROT_H_HEADERS) \
$(INC_DIR)/runcore_api.h
+src/packfile/output$(O) : $(PARROT_H_HEADERS) include/pmc/pmc_key.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
-src/packout$(O) : $(PARROT_H_HEADERS) include/pmc/pmc_key.h src/packout.c
-
src/parrot$(O) : $(GENERAL_H_FILES)
src/runcore/cores$(O) : src/runcore/cores.str \
@@ -1707,9 +1707,9 @@ src/string/encoding/ucs4$(O) : $(PARROT_H_HEADERS) \
src/string/encoding/shared.h \
src/string/unicode.h
-src/pbc_merge$(O) : \
+frontend/pbc_merge/main$(O) : \
$(INC_DIR)/embed.h \
- src/pbc_merge.c \
+ frontend/pbc_merge/main.c \
include/pmc/pmc_sub.h \
$(INC_DIR)/oplib/ops.h \
$(INC_DIR)/oplib/core_ops.h \
@@ -2062,12 +2062,12 @@ prog-clean :
parrot-prove.pbc parrot-prove.c parrot-prove$(O) parrot-prove$(EXE) \
parrot_config$(EXE) parrot_config.c parrot_config$(O) parrot_config.pbc \
compilers/imcc/main$(O) \
- $(PDUMP) src/pbc_dump$(O) src/packdump$(O) \
- $(PDB) src/parrot_debugger$(O) \
- $(PBC_MERGE) src/pbc_merge$(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) src/pbc_disassemble$(O)
$(RM_F) \
- src/main$(O) \
+ frontend/parrot/main$(O) \
src/null_config$(O) \
src/parrot_config$(O) \
src/install_config$(O) \
@@ -2100,9 +2100,9 @@ archclean: dynext-clean
$(INSTALLABLECONFIG) \
$(INSTALLABLENQP) \
compilers/imcc/main$(O) \
- $(PDUMP) src/pbc_dump$(O) src/packdump$(O) \
- $(PDB) src/parrot_debugger$(O) \
- $(PBC_MERGE) src/pbc_merge$(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) src/pbc_disassemble$(O) \
$(PARROT_CONFIG) parrot_config$(O) parrot_config.c \
src/parrot_config$(O) parrot_config.pbc \
@@ -2216,7 +2216,7 @@ status :
patch :
git diff
-LINTABLE_CFILES = `echo src/main$(O) $(O_FILES) src/parrot_config$(O) | $(PERL) -pe @PQ@s/\.o/\.c/g@PQ@`
+LINTABLE_CFILES = `echo frontend/parrot/main$(O) $(O_FILES) src/parrot_config$(O) | $(PERL) -pe @PQ@s/\.o/\.c/g@PQ@`
lint : sunlint
@@ -2728,9 +2728,9 @@ cagecritic:
HEADERIZER_O_FILES = \
$(O_FILES) \
- src/main$(O) \
- src/packdump$(O) \
- src/pbc_merge$(O) \
+ frontend/parrot/main$(O) \
+ frontend/pbc_dump/packdump$(O) \
+ frontend/pbc_merge/main$(O) \
headerizer : src/core_pmcs.c
$(HEADERIZER) $(HEADERIZER_O_FILES) compilers/imcc/imcc.y
View
77 docs/project/git_workflow.pod
@@ -8,19 +8,19 @@ docs/project/git_workflow.pod - How to use Git to work on Parrot
To minimize the disruption of feature development on language and tool
developers, all major changes to Parrot core take place in a branch. Ideally,
-branches are short-lived, and contain the smallest set of changes possible.
-It is also good practice to have "atomic" commits, in the sense that each
-commit does one thing, so that it makes it easier to accept/revert some
-things while keeping others. Git provides many powerful tools in the
-maintainence of branches. This document aims to provide everything a Parrot
-developer needs to know about Git to successfully create a branch, work on
-it, keep it in sync with changes on master and finally merge the branch.
+branches are short-lived, and contain the smallest set of changes possible. It
+is also good practice to have "atomic" commits, in the sense that each commit
+does one thing, so that it makes it easier to accept/revert some things while
+keeping others. Git provides many powerful tools in the maintenance of
+branches. This document aims to provide everything a Parrot developer needs to
+know about Git to successfully create a branch, work on it, keep it in sync
+with changes on master and finally merge the branch.
=head2 Cloning the Git Repository
-To get the full version history Parrot, which is called "cloning a repository",
-you will use the C<git clone> command. This will show how to clone the repo from
-L<http://github.com> :
+To get the full version history of Parrot, which is called "cloning a
+repository", you will use the C<git clone> command. This will show how to clone
+the repo from L<http://github.com>:
git clone git://github.com/parrot/parrot.git
@@ -60,8 +60,8 @@ branch:
git checkout username/foo
-If you would like to checkout a branch that already exists, first make sure
-to get the lastest commits with:
+If you would like to checkout a branch that already exists, first make sure to
+get the latest commits with:
git fetch
@@ -119,9 +119,9 @@ or other branches.
=head2 How to commit
-Let's say you modified the file foo.c and added the file bar.c and you want to commit
-these changes. To add these changes to the staging area (the list of stuff
-that will be included in your next commit) :
+Let's say you modified the file foo.c and added the file bar.c and you want to
+commit these changes. To add these changes to the staging area (the list of
+stuff that will be included in your next commit):
git add foo.c bar.c
@@ -133,14 +133,14 @@ 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 the --force
-flag.
+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
+the --force flag.
-Now for actually creating your commit! Since Git is a distributed version control
-system, committing code is seperate from sending your changes to a remote server.
-Keep this in mind if you are used to Subversion or similar VCS's, where committing
-and sending changes are tied together.
+Now for actually creating your commit! Since Git is a distributed version
+control system, committing code is separate from sending your changes to a
+remote server. Keep this in mind if you are used to Subversion or similar
+VCS's, where committing and sending changes are tied together.
git commit -m "This is an awesome and detailed commit message"
@@ -177,21 +177,23 @@ To update your local git index from origin:
git fetch
-If you are following multiple remotes, you can fetch updates from all of them with
+If you are following multiple remotes, you can fetch updates from all of them
+with:
git fetch --all
Note that this command requires a recent (1.7.x.x) version of git.
-The command C<git fetch> only modifies the index, not your working copy or staging
-area. To update your working copy of the branch bobby/tables
+The command C<git fetch> only modifies the index, not your working copy or
+staging area. To update your working copy of the branch bobby/tables:
git checkout bobby/tables # make sure we are on the branch
git rebase origin/bobby/tables # get the latest sql injections
-If you have a topic branch and want to pick up the most recent changes in master
-since the topic branch diverged, you can merge the master branch into the topic
-branch. In this case, we assume the topic branch is called parrot/beak:
+If you have a topic branch and want to pick up the most recent changes in
+master since the topic branch diverged, you can merge the master branch into
+the topic branch. In this case, we assume the topic branch is called
+parrot/beak:
git checkout parrot/beak # make sure we are on the branch
git merge master # merge master into parrot/beak
@@ -202,7 +204,8 @@ branch.
=head2 Preparing to Merge a Branch
Post to parrot-dev@lists.parrot.org letting people know that you're about to
-merge a branch.
+merge a branch. Follow the guidelines in
+L<docs/project/merge_review_guidelines.pod>, especially:
=over
@@ -231,7 +234,7 @@ want tested.
=head2 Merging a Branch
When you're ready to merge your changes back into master, use the C<git merge>
-command. First, make sure you are on the master branch with
+command. First, make sure you are on the master branch with:
git checkout master
@@ -262,7 +265,7 @@ and mention the branch.
Why use "--no-ff" ? This flag mean "no fast forwards". Usually fast forwards
are good, but if there is a branch that has all the commits of master, plus
a few more, when you merge without --no-ff, there will be no merge commit.
-Git is smart enought to "fast forward." But for the purpose of looking at
+Git is smart enough to "fast forward." But for the purpose of looking at
history, Parrot would like to always have a merge commit for a merge, even
if it *could* be fast-forwarded.
@@ -336,7 +339,6 @@ pull request, since adding Signed-Off-By lines changes
the SHA1's which Github uses to automatically close
pull requests.
-
=head2 Announcing a Merge
Send a message to parrot-dev@lists.parrot.org letting people know that your
@@ -350,15 +352,14 @@ before merging but couldn't get any response from the responsible person, you
may want to include some warning in the announcement that you weren't able to
test that piece fully.
-
=head2 Deleting a Branch
-After merging a branch, you will have a local copy of the merged branch, as well
-as a copy of the branch on your remote. To remove the local branch:
+After merging a branch, you will have a local copy of the merged branch, as
+well as a copy of the branch on your remote. To remove the local branch:
git branch -d user/foo
-To remove the remote branch user/foo on the remote origin :
+To remove the remote branch user/foo on the remote origin:
git push origin :user/foo
@@ -366,8 +367,8 @@ This follows the general pattern of
git push origin local_branch_name:remote_branch_name
-When local_branch_name is empty, you are pushing "nothing" to the remote branch,
-which deletes it.
+When local_branch_name is empty, you are pushing "nothing" to the remote
+branch, which deletes it.
=cut
View
179 docs/project/merge_review_guidelines.pod
@@ -0,0 +1,179 @@
+# Copyright (C) 2010, Parrot Foundation.
+
+=head1 NAME
+
+docs/project/merge_review_guidelines.pod - Guidelines for pending merge reviews
+
+=head1 DESCRIPTION
+
+To maintain Parrot's standards of quality, we evaluate each branch proposed for
+merging to trunk in terms of several criteria. Not every criterion applies to
+every branch; these guidelines are guidelines to which we apply our best
+judgment. As well, these guidelines are not exhaustive.
+
+=head2 Documentation
+
+The purpose of the branch governs the amount and type of documentation it
+requires. Documentation falls into three broad categories:
+
+=over 4
+
+=item * User-visible documentation
+
+How do users (language developers, people running Parrot directly, people
+embedding Parrot, people writing PIR, people packaging Parrot) use the feature?
+What do they need to know to enable it, how does it work, and what
+configuration options are available?
+
+=item * Design documentation
+
+How does the feature fit into Parrot as a whole? What design considerations
+did you make? Are there patterns you followed, or is there literature to read?
+
+=item * Developer documentation
+
+What functions are available, and to whom are they available? What data
+structures are present, and what do other developers need to understand about
+them? What are areas of future work, and what are invariants that underlie the
+whole system?
+
+=back
+
+=head2 Testing
+
+We know that well-tested features work and we know that well-tested features
+will continue to work. Under-tested features give us and users much less
+confidence. A well-tested branch demonstrates several attributes:
+
+=over 4
+
+=item * Coverage
+
+A full coverage report from an automated testing tool is very valuable, but in
+lieu of that the tests for the branch's feature should pass the eyeball test.
+Is everything documented as working tested effectively? If there are gaps in
+testing, are they clear? Do they have tickets for cage cleaners and other
+volunteers?
+
+=item * Language Testing
+
+If your feature affects languages running on Parrot (and what feature
+doesn't?), the branch needs testing from a couple of major languages to
+demonstrate that it does not harm those languages. If those languages need
+changes to accommodate the branch, we must work with the language to schedule
+those changes or to review them as per our deprecation policy.
+
+=item * Platform Testing
+
+Does your feature work on the platform combinations we support? Be especially
+aware of the differences between C and C++ compilers and 32-bit and 64-bit
+support, as well as any deviations from POSIX. C<make fulltest> should pass on
+all of our target platforms.
+
+=back
+
+=head2 Deprecation Policy
+
+We manage incompatible changes of features and interfaces in multiple ways:
+
+=over 4
+
+=item * Replacements for removed features
+
+If the branch supplants or supersedes an existing feature, follow the
+deprecation policy to provide alternatives, shims, compatibility layers, and
+whatever other mechanisms the deprecation notice promises.
+
+=item * New deprecations recorded
+
+If the branch necessitates new deprecations, the deprecation list needs
+sufficient detail to help affected users plan their upgrades.
+
+=item * Removals marked clearly
+
+If you've removed any deprecated items, have you marked them as such?
+
+=item * User-visible exclusions to policy marked and dated clearly
+
+If you need any exclusions to the deprecation policy, have you asked for and
+received them? Have you documented them appropriately?
+
+=back
+
+=head2 Roadmap
+
+Branches may implement features requested on the roadmap in whole or in part.
+They may also affect the schedule of other roadmap items. Have you documented
+the implications?
+
+=head2 Code Quality
+
+Any branch proposed for merging must meet our quality standards in several
+areas not previously mentioned:
+
+=over 4
+
+=item * Coding standards
+
+At a minimum, the code must pass all of our active coding standards tests. It
+must also follow our naming conventions and organizational principles. This
+means review from other developers. This also means a clean run of C<make
+codingstd>.
+
+=item * User-visible features
+
+We have no strict guideline for how user-visible features should work apart
+from a few systems (vtables, embedding and extension API). In general, any
+public features need review from the user point of view.
+
+=item * API review
+
+Internal features for developers also need a review, especially of any
+functions or data structures you expose to other parts of Parrot. Where
+possible, stick with Parrot conventions, especially for constness and the
+avoiding of null parameters.
+
+=item * Performance characteristics
+
+How does your branch affect performance on our selected benchmarks? For hosted
+languages? Does it have memory leaks? Does it affect memory use or startup
+time? We have traditionally let these questions go unanswered, but we can be
+more disciplined here.
+
+=back
+
+=head2 Integration into Parrot Proper
+
+Your branch must also integrate into Parrot as well as possible. In
+particular:
+
+=over 4
+
+=item * Manage dependencies
+
+This includes proper dependencies in our configuration and build system for
+building the code as well as any external configuration or dependencies.
+Certain parts of Parrot core can depend on external tools such as NQP, while
+others cannot.
+
+=item * Identify configuration options
+
+If your feature adds configuration options, they need documentation and review
+outside of the code itself. If your feature depends on configuration options,
+it needs explicit testing and documentation. This should be self-evident, but
+it is worth detailed review.
+
+=item * Encapsulation and isolation
+
+Does your branch respect the encapsulation of other parts of Parrot? Does it
+provide its own sensible encapsulation boundaries? If you need to make changes
+to other parts of Parrot, should we consider them as a separate branch?
+
+=back
+
+=cut
+
+__END__
+Local Variables:
+ fill-column:78
+End:
View
5 examples/nci/ls.pir
@@ -8,6 +8,11 @@ examples/nci/ls.pir - a directory lister
List the content of the directory 'docs'.
+This program uses the 'dirent' structure, whose content is not fully
+standarized, thus may need modifications depending on platform.
+
+In this encarnation it works on linux i386 and amd64 systems.
+
=cut
.sub _main :main
View
28 examples/pir/md5sum.pir
@@ -0,0 +1,28 @@
+# Copyright (C) 2010, Parrot Foundation.
+
+.sub main
+ .param pmc argv
+ load_bytecode "Digest/MD5.pbc"
+ .local pmc mba
+ .local string filename
+
+ set filename, argv[1]
+ $S0 = "Creating new MappedByteArray, and opening " . filename
+ say $S0
+ mba = new 'MappedByteArray'
+ mba.'open'(filename)
+
+ say 'getting the data from the Mapped Byte Array...'
+ $I1 = elements mba
+ $S0 = mba.'get_string'(0, $I1, 'binary')
+
+ $P1 = _md5sum($S0)
+ $S0 = _md5_hex($P1)
+ say $S0
+.end
+
+# Local Variables:
+# mode: pir
+# fill-column: 100
+# End:
+# vim: expandtab shiftwidth=4 ft=pir:
View
0  src/main.c → frontend/parrot/main.c
File renamed without changes
View
0  src/parrot_debugger.c → frontend/parrot_debugger/main.c
File renamed without changes
View
0  src/pbc_dump.c → frontend/pbc_dump/main.c
File renamed without changes
View
0  src/packdump.c → frontend/pbc_dump/packdump.c
File renamed without changes
View
0  src/pbc_merge.c → frontend/pbc_merge/main.c
File renamed without changes
View
12 include/parrot/oplib.h
@@ -41,18 +41,6 @@ typedef enum {
/* when init = true initialize, else de_initialize */
typedef op_lib_t *(*oplib_init_f)(PARROT_INTERP, long init);
-/* core.ops special opcode numbers */
-typedef enum {
- CORE_OPS_end, /* halt the runloop */
- CORE_OPS_noop, /* do nothing */
- CORE_OPS_check_events, /* explicit event check */
- CORE_OPS_check_events__, /* inserted into op dispatch when an event
- got scheduled */
- CORE_OPS_wrapper__ /* inserted by dynop_register for new ops */
- /* 2 more reserved */
-} special_core_ops_enum;
-
-
#endif /* PARROT_OPLIB_H_GUARD */
/*
View
13 src/dynpmc/os.pmc
@@ -495,7 +495,18 @@ reads entries from a directory.
}
while ((dirent = readdir(dir)) != NULL) {
- VTABLE_push_string(INTERP, array, Parrot_str_new(INTERP, dirent->d_name, 0));
+ /* We don't have yet a good way to know what encoding should be
+ * used. In the meantime, use binary when there is any non ascii
+ * character */
+ const char *const name = dirent->d_name;
+ STR_VTABLE *encoding;
+ size_t l = strlen(name);
+ size_t i;
+ for (i = 0; i < l; ++i)
+ if ((unsigned char)name[i] > 127)
+ break;
+ encoding = i == l ? Parrot_ascii_encoding_ptr : Parrot_binary_encoding_ptr;
+ VTABLE_push_string(INTERP, array, Parrot_str_new_init(INTERP, name, l, encoding, 0));
}
closedir(dir);
View
4 src/gc/fixed_allocator.c
@@ -437,10 +437,10 @@ allocate_new_pool_arena(ARGMOD(Pool_Allocator *pool))
pool->num_free_objects += num_items;
pool->total_objects += num_items;
- if (pool->lo_arena_ptr > new_arena)
+ if (pool->lo_arena_ptr > (void *)new_arena)
pool->lo_arena_ptr = new_arena;
- if (pool->hi_arena_ptr < (char *)new_arena + GC_FIXED_SIZE_POOL_SIZE)
+ if ((char *)pool->hi_arena_ptr < (char *)new_arena + GC_FIXED_SIZE_POOL_SIZE)
pool->hi_arena_ptr = (char *)new_arena + GC_FIXED_SIZE_POOL_SIZE;
}
View
72 src/nci/framebuilder.pod
@@ -0,0 +1,72 @@
+# Copyright (C) 2010, Parrot Foundation.
+
+=pod
+
+=head1 NAME
+
+src/nci/framebuilder.pod - Parrot Native Call Frame Builder API
+
+=head1 DESCRIPTION
+
+Parrot's frame builder is fully pluggable at runtime. That is to say, a new implementation of the
+frame builder can be installed at any time.
+
+=head2 REGISTRATION
+
+Parrot has 2 slots for the frame builder function - a callback PMC and a user data PMC. The
+callback PMC is expected to return a valid C<nci_fb_func_t> native function from its C<get_pointer>
+vtable.
+
+The callback for a framebuilder should be registerd in parrot's C<iglobals> array under
+C<NCI_FB_CB>. The user data is likewise registered in C<iglobals> under C<NCI_FB_UD>.
+
+=head2 C<nci_fb_func_t>
+
+C<nci_fb_func_t> functions receive an interpreter, the registered frame builder user data, and a
+signature string. They are expected to produce a thunk PMC, and throw an exception or return C<NULL>
+on failure. B<IMPORTANT:> frame builders should not parse the signature string themselves but
+delegate to C<Parrot_nci_parse_signature> to ensure consistency between implementations.
+
+=head2 Thunk PMCs
+
+Thunk PMCs, produced by the frame builder callback, are expected to return a valid C<nci_thunk_t>
+native function from their C<get_pointer> vtables.
+
+C<nci_thunk_t> functions receive an interpreter, an NCI PMC, and a thunk PMC. They are expected to
+unpack Parrot's PCC arguments and pass them to the native function pointer in the NCI PMC using the
+appropriate native function calling conventions and to do the reverse with return values. The exact
+details of what operations to perform are specified in the signature supplied to the frame builder
+when the thunk is created.
+
+=head2 The Thunk Cache
+
+Thunks are generated lazily on demand and cached. Generally, only one thunk will exist for a given
+NCI signature. The cache is held in C<iglobals> under C<NCI_FUNCS>. This cache can be operated on
+directly, for example, clearing the cache is possible by running the following PIR code:
+
+ .include 'iglobals.pasm'
+ .sub 'clear-nci-cache'
+ $P0 = getinterp
+ $P0 = $P0[.IGLOBALS_NCI_FUNCS]
+ $P1 = iter $P0
+ loop:
+ unless $P1 goto end_loop
+ $S0 = shift $P1
+ delete $P0[$S0]
+ goto loop
+ end_loop:
+ .end
+
+Note however, that this will B<not> remove thunks from NCI PMCs which have already been invoked
+(these cache their Thunk PMC locally).
+
+Another use of direct manipulation of the C<NCI_FUNCS> cache is nci thunk dynext libraries,
+generated by C<nci_thunk_gen>, which add additional statically compiled thunks to parrot at runtime.
+
+=head1 WARNING
+
+The frame builder API is currently in a state of flux. Expected improvements are to isolate frame
+builders further from the signature strings and also to reduce the C-bias in the API.
+
+=cut
+
View
6 src/ops/core.ops
@@ -49,7 +49,7 @@ internal use only; don't emit these opcodes.
=item B<end>()
-Halts the interpreter. (Must be op #0, CORE_OPS_end). See also B<exit>.
+Halts the interpreter. See also B<exit>.
=cut
@@ -63,26 +63,22 @@ inline op end() :base_core :check_event :flow {
=item B<noop>()
Does nothing other than waste an iota of time and 32 bits of bytecode space.
-(Must be op #1, CORE_OPS_noop)
=item B<check_events>()
Check the event queue and run event handlers if there are unhandled events.
Note: This opcode is mainly for testing. It should not be necessary to ever
use it explicitly.
-(Must be op #3, CORE_OPS_check_events).
=item B<check_events__>()
Check the event queue and run event handlers if there are unhandled events.
Note: Do B<not> use this opcode. It is for internal use only.
-(Must be op #4, CORE_OPS_check_events__).
=item B<wrapper__>()
Internal opcode to wrap unknown ops from loaded opcode libs.
Don't use.
-(Must be op #5, CORE_OPS_wrapper__).
=item B<load_bytecode>(in STR)
View
2  src/packfile.c → src/packfile/api.c
@@ -30,7 +30,7 @@ about the structure of the frozen bytecode.
#include "parrot/dynext.h"
#include "parrot/runcore_api.h"
#include "../compilers/imcc/imc.h"
-#include "packfile.str"
+#include "api.str"
#include "pmc/pmc_sub.h"
#include "pmc/pmc_key.h"
#include "pmc/pmc_callcontext.h"
View
2  src/pmc_freeze.c → src/packfile/object_serialization.c
@@ -23,7 +23,7 @@ individual action vtable (freeze/thaw) is then called for all todo-PMCs.
#include "parrot/parrot.h"
#include "pmc/pmc_callcontext.h"
-#include "pmc_freeze.str"
+#include "object_serialization.str"
/* when thawing a string longer then this size, we first do a GC run and then
* block GC - the system can't give us more headers */
View
0  src/packout.c → src/packfile/output.c
File renamed without changes
View
89 src/pmc/hash.pmc
@@ -51,6 +51,14 @@ These are the vtable functions for the Hash PMC.
/* HEADERIZER BEGIN: static */
/* Don't modify between HEADERIZER BEGIN / HEADERIZER END. Your changes will be lost. */
+PARROT_DOES_NOT_RETURN
+static void cannot_autovivify_nested(PARROT_INTERP)
+ __attribute__nonnull__(1);
+
+PARROT_DOES_NOT_RETURN
+static void entry_type_must_be_pmc(PARROT_INTERP)
+ __attribute__nonnull__(1);
+
PARROT_CANNOT_RETURN_NULL
PARROT_WARN_UNUSED_RESULT
static PMC* get_next_hash(PARROT_INTERP,
@@ -61,6 +69,10 @@ static PMC* get_next_hash(PARROT_INTERP,
__attribute__nonnull__(3)
FUNC_MODIFIES(*hash);
+#define ASSERT_ARGS_cannot_autovivify_nested __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+ PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_entry_type_must_be_pmc __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+ PARROT_ASSERT_ARG(interp))
#define ASSERT_ARGS_get_next_hash __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
PARROT_ASSERT_ARG(interp) \
, PARROT_ASSERT_ARG(hash) \
@@ -88,8 +100,7 @@ get_next_hash(PARROT_INTERP, ARGMOD(Hash *hash), ARGIN(void *key))
HashBucket *bucket;
if (hash->entry_type != enum_type_PMC)
- Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_INVALID_OPERATION,
- "Hash entry type must be PMC for multipart keys.");
+ entry_type_must_be_pmc(interp);
bucket = parrot_hash_get_bucket(interp, hash, key);
@@ -468,8 +479,7 @@ Returns the integer value for the element at C<*key>.
return hash_value_to_int(INTERP, hash, b->value);
if (hash->entry_type != enum_type_PMC)
- Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_INVALID_OPERATION,
- "Hash entry type must be PMC for multipart keys.");
+ entry_type_must_be_pmc(INTERP);
/* Recursively call to enclosed aggregate */
return VTABLE_get_integer_keyed(INTERP, (PMC *)b->value, key);
@@ -502,9 +512,7 @@ Returns the integer value for the element at C<*key>.
else {
PMC * const next_hash = get_next_hash(INTERP, hash, hash_key);
if (PMC_IS_NULL(next_hash))
- Parrot_ex_throw_from_c_args(INTERP, NULL,
- EXCEPTION_INVALID_OPERATION,
- "Cannot autovivify nested hashes");
+ cannot_autovivify_nested(INTERP);
VTABLE_set_integer_keyed(INTERP, next_hash, key, value);
}
}
@@ -593,8 +601,7 @@ Returns the floating-point value for the element at C<*key>.
return hash_value_to_number(INTERP, hash, b->value);
if (hash->entry_type != enum_type_PMC)
- Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_INVALID_OPERATION,
- "Hash entry type must be PMC for multipart keys.");
+ entry_type_must_be_pmc(INTERP);
return VTABLE_get_number_keyed(INTERP, (PMC *)b->value, key);
}
@@ -658,8 +665,7 @@ Returns the string value for the element at C<*key>.
return hash_value_to_string(INTERP, hash, b->value);
if (hash->entry_type != enum_type_PMC)
- Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_INVALID_OPERATION,
- "Hash entry type must be PMC for multipart keys.");
+ entry_type_must_be_pmc(INTERP);
/* Recursively call to enclosed aggregate */
return VTABLE_get_string_keyed(INTERP, (PMC *)b->value, key);
@@ -697,9 +703,7 @@ Returns the string value for the element at C<*key>.
else {
PMC * const next_hash = get_next_hash(INTERP, hash, hash_key);
if (PMC_IS_NULL(next_hash))
- Parrot_ex_throw_from_c_args(INTERP, NULL,
- EXCEPTION_INVALID_OPERATION,
- "Cannot autovivify nested hashes");
+ cannot_autovivify_nested(INTERP);
VTABLE_set_string_keyed(INTERP, next_hash, key, value);
}
}
@@ -806,8 +810,7 @@ Returns the PMC value for the element at C<*key>.
return hash_value_to_pmc(INTERP, hash, b->value);
if (hash->entry_type != enum_type_PMC)
- Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_INVALID_OPERATION,
- "Hash entry type must be PMC for multipart keys.");
+ entry_type_must_be_pmc(INTERP);
/* Recursively call to enclosed aggregate */
return VTABLE_get_pmc_keyed(INTERP, (PMC *)b->value, key);
@@ -840,9 +843,7 @@ Returns the PMC value for the element at C<*key>.
else {
PMC * const next_hash = get_next_hash(INTERP, hash, hash_key);
if (PMC_IS_NULL(next_hash))
- Parrot_ex_throw_from_c_args(INTERP, NULL,
- EXCEPTION_INVALID_OPERATION,
- "Cannot autovivify nested hashes");
+ cannot_autovivify_nested(INTERP);
VTABLE_set_number_keyed(INTERP, next_hash, key, value);
}
}
@@ -902,9 +903,7 @@ Sets C<value> as the value for C<*key>.
else {
PMC * const next_hash = get_next_hash(INTERP, hash, hash_key);
if (PMC_IS_NULL(next_hash))
- Parrot_ex_throw_from_c_args(INTERP, NULL,
- EXCEPTION_INVALID_OPERATION,
- "Cannot autovivify nested hashes");
+ cannot_autovivify_nested(INTERP);
VTABLE_set_pmc_keyed(INTERP, next_hash, key, value);
}
}
@@ -979,9 +978,7 @@ Returns whether a key C<*key> exists in the hash.
return 1;
if (h->entry_type != enum_type_PMC)
- Parrot_ex_throw_from_c_args(INTERP, NULL,
- EXCEPTION_INVALID_OPERATION,
- "Hash entry type must be PMC for multipart keys.");
+ entry_type_must_be_pmc(INTERP);
return VTABLE_exists_keyed(INTERP, (PMC *)b->value, key);
}
@@ -1031,9 +1028,7 @@ Returns whether the value for C<*key> is defined.
return VTABLE_defined(INTERP, hash_value_to_pmc(INTERP, h, b->value));
if (h->entry_type != enum_type_PMC)
- Parrot_ex_throw_from_c_args(INTERP, NULL,
- EXCEPTION_INVALID_OPERATION,
- "Hash entry type must be PMC for multipart keys.");
+ entry_type_must_be_pmc(INTERP);
return VTABLE_defined_keyed(INTERP, (PMC *)b->value, key);
}
@@ -1078,9 +1073,7 @@ Deletes the element associated with C<*key>.
}
if (h->entry_type != enum_type_PMC)
- Parrot_ex_throw_from_c_args(INTERP, NULL,
- EXCEPTION_INVALID_OPERATION,
- "Hash entry type must be PMC for multipart keys.");
+ entry_type_must_be_pmc(INTERP);
VTABLE_delete_keyed(INTERP, (PMC *)b->value, key);
}
@@ -1221,6 +1214,40 @@ Used to unarchive the hash.
=back
+=head1 Auxiliar functions
+
+=over 4
+
+=item C<static void entry_type_must_be_pmc(PARROT_INTERP)>
+
+=item C<static void cannot_autovivify_nested(PARROT_INTERP)>
+
+*/
+
+PARROT_DOES_NOT_RETURN
+static void
+entry_type_must_be_pmc(PARROT_INTERP)
+{
+ ASSERT_ARGS(entry_type_must_be_pmc)
+ Parrot_ex_throw_from_c_args(interp, NULL,
+ EXCEPTION_INVALID_OPERATION,
+ "Hash entry type must be PMC for multipart keys.");
+}
+
+PARROT_DOES_NOT_RETURN
+static void
+cannot_autovivify_nested(PARROT_INTERP)
+{
+ ASSERT_ARGS(cannot_autovivify_nested)
+ Parrot_ex_throw_from_c_args(interp, NULL,
+ EXCEPTION_INVALID_OPERATION,
+ "Cannot autovivify nested hashes");
+}
+
+/*
+
+=back
+
=head1 SEE ALSO
F<docs/pdds/pdd08_keys.pod>.
View
4 src/pmc/string.pmc
@@ -245,10 +245,6 @@ they match.
return (INTVAL)(STRING_equal(INTERP, str_val, v));
}
- MULTI INTVAL is_equal(PMC *value) {
- return SELF.is_equal(value);
- }
-
/*
=item C<INTVAL is_equal_num(PMC *value)>
View
4 src/runcore/main.c
@@ -416,8 +416,8 @@ enable_event_checking(PARROT_INTERP)
cs->op_count, op_func_t);
for (i = interp->evc_func_table_size; i < cs->op_count; i++)
- interp->evc_func_table[i] = (op_func_t)
- D2FPTR(((void**)core_lib->op_func_table)[CORE_OPS_check_events__]);
+ interp->evc_func_table[i] =
+ core_lib->op_func_table[PARROT_OP_check_events__];
interp->evc_func_table_size = cs->op_count;
}
View
591 t/pmc/integer.t
@@ -15,10 +15,12 @@ Tests the Integer PMC.
=cut
+.loadlib 'sys_ops'
+
.sub 'test' :main
.include 'test_more.pir'
- plan(61)
+ plan(141)
test_init()
test_basic_math()
test_truthiness_and_definedness()
@@ -31,13 +33,53 @@ Tests the Integer PMC.
test_istrue_isfalse()
test_if_unless()
test_add()
+ test_sub()
+ test_mul()
+ test_div()
test_arithmetic()
+ test_mod()
+ test_neg()
test_get_as_base()
test_get_as_base10()
test_get_as_base_various()
test_get_as_base_bounds_check()
test_cmp_subclass()
test_cmp_RT59336()
+ test_cmp_num()
+
+ $I0 = has_bigint()
+ unless $I0 goto no_bigint
+ test_autopromotion_to_BigInt()
+ test_add_BigInt()
+ test_sub_BigInt()
+ test_mul_BigInt()
+ test_div_BigInt()
+ test_mod_BigInt()
+ test_neg_BigInt()
+ goto done_bigint_tests
+ no_bigint:
+ skip_n_bigint_tests(28)
+ done_bigint_tests:
+.end
+
+.sub has_bigint
+ push_eh _dont_have_bigint
+ $P0 = new ['BigInt']
+ pop_eh
+ .return(1)
+ _dont_have_bigint:
+ pop_eh
+ .return(0)
+.end
+
+.sub skip_n_bigint_tests
+ .param int n
+ loop_top:
+ if n == 0 goto _done
+ skip("No BigInt library")
+ n = n - 1
+ goto loop_top
+ _done:
.end
.sub test_init
@@ -71,25 +113,76 @@ CODE
.sub test_basic_math
.local pmc int_1
int_1 = new ['Integer']
- is(int_1,0)
+ is(int_1, 0, 'Integer PMC creation')
int_1 = 1
- is(int_1,1)
+ is(int_1, 1, '... set')
int_1 += 777777
int_1 -= 777776
- is(int_1,2)
+ is(int_1, 2, '... add/sub')
int_1 *= -333333
int_1 /= -222222
- is(int_1,3)
+ is(int_1, 3, '... mul/div')
inc int_1
inc int_1
dec int_1
- is(int_1,4)
+ is(int_1, 4, '... inc/dec')
neg int_1
dec int_1
neg int_1
- is(int_1,5)
+ is(int_1, 5, '... neg')
+
+ throws_substring(<<'CODE', 'Integer overflow', 'mul integer overflow')
+
+ .sub main
+ .include 'errors.pasm'
+ errorson .PARROT_ERRORS_OVERFLOW_FLAG
+ .include 'sysinfo.pasm'
+ $I0 = sysinfo .SYSINFO_PARROT_INTMAX
+
+ $P0 = new ['Integer']
+ $P0 = $I0
+ $P0 *= 2
+ .end
+CODE
+
+ int_1 = new ['Integer']
+ int_1 = -57494
+ int_1 = abs int_1
+ is(int_1, 57494, 'absolute value, assignment')
+
+ int_1 = new ['Integer']
+ int_1 = 6
+ abs int_1
+ is(int_1, 6, 'absolute value, in-place')
.end
+.sub test_autopromotion_to_BigInt
+ push_eh _dont_have_bigint_library
+ .include 'sysinfo.pasm'
+ .local pmc bigint_1
+ .local pmc int_1
+
+ int_1 = new ['Integer']
+ bigint_1 = new ['BigInt']
+
+ $I0 = sysinfo .SYSINFO_PARROT_INTMIN
+ int_1 = $I0
+ bigint_1 = int_1 - 1
+
+ dec int_1
+ $P0 = typeof int_1
+ is(int_1, bigint_1, 'dec integer overflow promotion')
+ is($P0, 'BigInt', 'dec integer overflow type check')
+
+ goto _have_bigint_library
+ _dont_have_bigint_library:
+ pop_eh
+
+ # TODO: What should we do here?
+ ok(1, "no bigint library")
+ ok(1, "no bigint library")
+ _have_bigint_library:
+.end
.sub test_truthiness_and_definedness
.local pmc int_1
@@ -286,6 +379,20 @@ OK4:
fin:
.end
+.sub test_add_BigInt
+ .include 'sysinfo.pasm'
+ new $P0, ['Integer']
+ new $P1, ['BigInt']
+ sysinfo $I0, .SYSINFO_PARROT_INTMAX
+ set $P0, $I0
+ set $P1, $I0
+ add $P0, $P0, 1
+ add $P1, $P1, 1
+ typeof $P2, $P0
+ is($P0, $P1, 'add integer overflow promotion')
+ is($P2, 'BigInt', 'add integer overflow type check')
+.end
+
.sub test_add
new $P0, ['Integer']
set $P0, 5
@@ -300,6 +407,304 @@ fin:
add $P2, $P1, $P0
set $S0, $P2
is($S0,50)
+
+ new $P0, ['Integer']
+ new $P1, ['Complex']
+ set $P0, 20
+ set $P1, 4
+ add $P0, $P1
+ is($P0, "4+0i", 'add complex number')
+
+ new $P0, ['Integer']
+ new $P1, ['Float']
+ set $P0, 31
+ set $P1, 20.1
+ add $P0, $P1
+ is($P0, 51, 'add DEFAULT')
+
+ new $P0, ['Integer']
+ set $P0, 2
+ add $P0, 3.14159
+ add $P0, 5.75
+ is($P0, 10, 'add_float')
+.end
+
+.sub test_sub_BigInt
+ $P0 = new ['BigInt']
+ $P0 = 424124
+ $P1 = new ['Integer']
+ $P1 = 424125
+ sub $P1, $P1, $P0
+ is($P1, 1, 'BigInt sub (no exception)')
+
+ .include 'sysinfo.pasm'
+ $P0 = new ['Integer']
+ $P1 = new ['BigInt']
+ $I0 = sysinfo .SYSINFO_PARROT_INTMIN
+ $P0 = $I0
+ $P1 = $I0
+ sub $P0, $P0, 1
+ sub $P1, $P1, 1
+ typeof $P2, $P0
+ is($P0, $P1, 'subtract overflow promotion')
+ is($P2, 'BigInt', 'subtract overflow type check')
+
+ $P0 = new ['Integer']
+ $P0 = $I0
+ sub $P0, 1
+ typeof $P2, $P0
+ is($P0, $P1, 'i_subtract_int overflow promotion')
+ is($P2, 'BigInt', 'i_subtract_int overflow type check')
+
+ $P0 = new ['Integer']
+ $P2 = new ['Integer']
+ $P0 = $I0
+ $P2 = 1
+ sub $P0, $P2
+ typeof $P3, $P0
+ is($P0, $P1, 'i_subtract overflow promotion')
+ is($P3, 'BigInt', 'i_subtract overflow type check')
+.end
+
+.sub test_sub
+ $P0 = new ['Float']
+ $P0 = 3.1
+ $P1 = new ['Integer']
+ $P1 = 10
+ sub $P1, $P1, $P0
+ is($P1, 6.9, 'DEFAULT sub')
+
+ $P0 = new ['Integer']
+ $P0 = 5
+ sub $P0, 4.5
+ is($P0, .5, 'i_subtract_float')
+
+ $P0 = new ['Integer']
+ $P1 = new ['Complex']
+ $P0 = 0
+ $P1 = "4+2i"
+ sub $P0, $P1
+ is($P0, "-4-2i", 'subtract Complex number')
+
+ $P0 = new ['Integer']
+ $P1 = new ['Float']
+ $P0 = 5
+ $P1 = 4.5
+ sub $P0, $P1
+ is($P0, .5, 'subtract DEFAULT multimethod')
+.end
+
+.sub test_mul
+ $P0 = new ['Integer']
+ $P1 = new ['String']
+ $P0 = 1
+ $P1 = "256"
+ mul $P0, $P0, $P1
+ is($P0, 256, 'multiply Integer PMC by String PMC')
+
+ $P1 = new ['Float']
+ $P0 = 2
+ $P1 = 3.14
+ mul $P0, $P0, $P1
+ is($P0, 6, 'multiply Integer PMC by Float PMC')
+
+ $P1 = new ['Integer']
+ $P1 = 4
+ mul $P0, $P1
+ is($P0, 24, 'i_multiply Integer PMC by Integer PMC')
+
+ $P0 = new ['Integer']
+ $P1 = new ['Complex']
+ $P2 = new ['Complex']
+ $P0 = 2
+ $P1 = "2+4i"
+ $P2 = "4+8i"
+ mul $P0, $P1
+ $I0 = iseq $P0, $P2
+ todo($I0, 'i_multiply Integer PMC by Complex PMC', 'unresolved bug, see TT #1887')
+
+ $P0 = new ['Integer']
+ $P1 = new ['Float']
+ $P0 = 2
+ $P1 = 3.5
+ mul $P0, $P1
+ is($P0, 7, 'i_multiply Integer PMC by DEFAULT')
+
+ $P0 = new ['Integer']
+ $P0 = 2
+ mul $P0, 5.5
+ is($P0, 11, 'i_multiply_float')
+.end
+
+.sub test_mul_BigInt
+ $P0 = new ['Integer']
+ $P1 = new ['BigInt']
+ $P2 = new ['Integer']
+ $P0 = 24
+ $P1 = 2
+ $P2 = 48
+ mul $P0, $P1
+ $I0 = iseq $P0, $P2
+ todo($I0, 'i_multiply Integer PMC by BigInt PMC', 'unresolved bug, see TT #1887')
+
+ .include 'sysinfo.pasm'
+ $P0 = new ['Integer']
+ $I0 = sysinfo .SYSINFO_PARROT_INTMAX
+ $P0 = $I0
+ $P1 = $I0
+ mul $P0, 2
+ mul $P1, 2
+ $P2 = typeof $P0
+ is($P0, $P1, 'i_multiply_int overflow promotion')
+ is($P2, 'BigInt', 'i_multiple_int overflow type check')
+.end
+
+.sub test_div_BigInt
+ $P0 = new ['Integer']
+ $P1 = new ['BigInt']
+ $P0 = 50
+ $P1 = 25
+ $P2 = div $P0, $P1
+ $P3 = typeof $P2
+ is($P2, 2, 'divide overflow promotion')
+ is($P3, 'BigInt', 'divide overflow type check')
+
+ $P0 = new ['Integer']
+ $P1 = new ['BigInt']
+ $P0 = 50
+ $P1 = 25
+ div $P0, $P1
+ $P2 = typeof $P0
+ is($P0, 2, 'i_divide overflow promotion')
+ is($P2, 'BigInt', 'i_divide overflow type check')
+
+ $P0 = new ['Integer']
+ $P1 = new ['BigInt']
+ $P0 = 10
+ $P1 = 7
+ $P0 = fdiv $P0, $P1
+ $P2 = typeof $P0
+ is($P0, 1, 'floor_divide overflow promotion')
+ is($P2, 'BigInt', 'floor_divide overflow type check')
+
+ $P0 = new ['Integer']
+ $P1 = new ['BigInt']
+ $P0 = 20
+ $P1 = 9
+ fdiv $P0, $P1
+ $P2 = typeof $P0
+ is($P0, 2, 'i_floor_divide overflow promotion')
+ is($P2, 'BigInt', 'i_floor_divide overflow type check')
+.end
+
+.sub test_div
+ throws_substring(<<'CODE', 'float division by zero', 'divide by 0 (Float PMC)')
+ .sub main
+ $P0 = new ['Integer']
+ $P1 = new ['Float']
+ $P0 = 50
+ $P1 = 0
+ $P2 = div $P0, $P1
+ say $P2
+ .end
+CODE
+
+ $P0 = new ['Integer']
+ $P1 = new ['Float']
+ $P0 = 50
+ $P1 = .5
+ div $P0, $P1
+ is($P0, 100, 'i_divide DEFAULT multi')
+
+ throws_substring(<<'CODE', 'float division by zero', 'i_divide by 0 (Float PMC)')
+ .sub main
+ $P0 = new ['Integer']
+ $P1 = new ['Float']
+ $P0 = 50
+ $P1 = 0
+ div $P0, $P1
+ say $P0
+ .end
+CODE
+
+ throws_substring(<<'CODE', 'float division by zero', 'floor_divide by 0 (Float PMC)')
+ .sub main
+ $P0 = new ['Integer']
+ $P1 = new ['Float']
+ $P0 = 50
+ $P1 = 0
+ $P0 = fdiv $P0, $P1
+ say $P0
+ .end
+CODE
+
+ throws_substring(<<'CODE', 'float division by zero', 'floor_divide by 0 (FLOATVAL)')
+ .sub main
+ $P0 = new ['Integer']
+ $P0 = 50
+ $P0 = fdiv $P0, 0.0
+ say $P0
+ .end
+CODE
+
+ $P0 = new ['Integer']
+ $P0 = 22
+ $P0 = fdiv $P0, 7
+ is($P0, 3, 'floor_divide INTVAL')
+
+ throws_substring(<<'CODE', 'float division by zero', 'floor_divide by 0 (INTVAL)')
+ .sub main
+ $P0 = new ['Integer']
+ $P0 = 50
+ $P0 = fdiv $P0, 0
+ say $P0
+ .end
+CODE
+
+ $P0 = new ['Integer']
+ $P1 = new ['Float']
+ $P0 = 20
+ $P1 = 2.3
+ fdiv $P0, $P1
+ is($P0, 8, 'i_floor_divide DEFAULT multi')
+
+ throws_substring(<<'CODE', 'float division by zero', 'i_floor_divide by 0 (DEFAULT)')
+ .sub main
+ $P0 = new ['Integer']