Skip to content
Browse files

Merge branch 'master' into nwellnhof/gc_dynamic_threshold

Conflicts:
	frontend/parrot/main.c
	include/parrot/gc_api.h
	include/parrot/pmc.h
	src/gc/api.c
  • Loading branch information...
2 parents efba30e + a823c01 commit 400feaed625fd50c0226aeee86c7edd113107234 @nwellnhof nwellnhof committed Jan 23, 2011
Showing with 5,262 additions and 5,772 deletions.
  1. +18 −11 .gitignore
  2. +26 −7 CREDITS
  3. +6 −2 ChangeLog
  4. +8 −14 Configure.pl
  5. +102 −31 DEPRECATED.pod
  6. +4 −0 DONORS.pod
  7. +74 −83 MANIFEST
  8. +24 −10 MANIFEST.SKIP
  9. +6 −4 MANIFEST.generated
  10. +44 −0 NEWS
  11. +1 −3 PBC_COMPAT
  12. +1 −1 PLATFORMS
  13. +2 −2 README
  14. +1 −1 VERSION
  15. +9 −2 compilers/imcc/Rules.in
  16. +7 −10 compilers/imcc/debug.c
  17. +2 −4 compilers/imcc/imc.c
  18. +120 −109 compilers/imcc/imc.h
  19. +58 −64 compilers/imcc/imcc.l
  20. +14 −5 compilers/imcc/imcc.y
  21. +1,776 −1,763 compilers/imcc/imclexer.c
  22. +637 −619 compilers/imcc/imcparser.c
  23. +1 −1 compilers/imcc/imcparser.h
  24. +35 −33 compilers/imcc/instructions.c
  25. +3 −5 compilers/imcc/instructions.h
  26. +616 −179 compilers/imcc/main.c
  27. +1 −1 compilers/imcc/optimizer.c
  28. +1 −1 compilers/imcc/parser.h
  29. +22 −518 compilers/imcc/parser_util.c
  30. +193 −185 compilers/imcc/pbc.c
  31. +6 −4 compilers/imcc/pbc.h
  32. +0 −1 compilers/imcc/symreg.c
  33. +1 −1 compilers/imcc/symreg.h
  34. +1 −1 compilers/imcc/unit.h
  35. +125 −113 compilers/opsc/ops2c.nqp
  36. +24 −24 compilers/pct/src/PAST/Compiler.pir
  37. +1 −1 compilers/pct/src/PCT/Dumper.pir
  38. +2 −1 compilers/pct/src/PCT/Grammar.pir
  39. +3 −3 compilers/pct/src/PCT/HLLCompiler.pir
  40. +7 −7 compilers/pct/src/POST/Compiler.pir
  41. +3 −3 compilers/pge/PGE/Exp.pir
  42. +4 −0 compilers/pge/PGE/P5Regex.pir
  43. +23 −2 compilers/pge/PGE/Perl6Regex.pir
  44. +13 −0 compilers/pge/PGE/Regex.pir
  45. +1 −1 compilers/tge/TGE/Compiler.pir
  46. +1 −1 config/auto/arch.pm
  47. +0 −2 config/auto/cpu/i386/auto.pm
  48. +0 −1 config/auto/cpu/ppc/auto.pm
  49. +1 −1 config/auto/gc.pm
  50. +1 −1 config/auto/git_describe.pm
  51. +0 −65 config/auto/jit.pm
  52. +91 −0 config/auto/platform.pm
  53. +104 −9 config/auto/pmc.pm
  54. +0 −13 config/gen/config_h/config_h.in
  55. +1 −1 config/gen/config_pm/config_lib_pir.in
  56. +0 −3 config/gen/config_pm/myconfig.in
  57. +14 −11 config/gen/makefiles/docs.in
  58. +263 −167 config/gen/makefiles/root.in
  59. +0 −332 config/gen/platform.pm
  60. +0 −24 config/gen/platform/ansi/io.h
  61. +0 −51 config/gen/platform/ansi/pid.c
  62. +0 −13 config/gen/platform/darwin/begin.c
  63. +0 −20 config/gen/platform/generic/dl.h
  64. +0 −142 config/gen/platform/generic/exec.c
  65. +0 −23 config/gen/platform/generic/io.h
  66. +0 −36 config/gen/platform/generic/math.h
  67. +0 −136 config/gen/platform/generic/memexec.c
  68. +0 −55 config/gen/platform/generic/pid.c
  69. +0 −37 config/gen/platform/generic/platform_limits.h
  70. +0 −57 config/gen/platform/generic/signal.c
  71. +0 −38 config/gen/platform/generic/signal.h
  72. +0 −22 config/gen/platform/generic/stat.h
  73. +0 −31 config/gen/platform/generic/threads.h
  74. +0 −89 config/gen/platform/netbsd/math.c
  75. +0 −18 config/gen/platform/netbsd/misc.h
  76. +0 −103 config/gen/platform/openbsd/memexec.c
  77. +0 −24 config/gen/platform/openbsd/misc.h
  78. +0 −19 config/gen/platform/win32/begin.c
  79. +0 −24 config/gen/platform/win32/io.h
  80. +0 −30 config/gen/platform/win32/misc.h
  81. +0 −49 config/gen/platform/win32/pid.c
  82. +0 −14 config/gen/platform/win32/signal.c
  83. +0 −19 config/gen/platform/win32/signal.h
  84. +0 −43 config/gen/platform/win32/stat.h
  85. +0 −23 config/gen/platform/win32/string.h
  86. +0 −26 config/gen/platform/win32/threads.h
  87. +1 −3 config/init/defaults.pm
  88. +0 −62 config/init/headers.pm
  89. +4 −2 config/init/hints/darwin.pm
  90. +10 −3 config/init/hints/mswin32.pm
  91. +13 −13 config/init/optimize.pm
  92. +6 −6 config/inter/libparrot.pm
  93. +0 −8 docs/book/draft/ch10_opcode_reference.pod
  94. +1 −1 docs/dev/c_functions.pod
  95. +3 −3 docs/dev/coverage.pod
  96. +1 −1 docs/dev/headerizer.pod
  97. +5 −5 docs/dev/longopt.pod
  98. +3 −3 docs/dev/profiling.pod
  99. +6 −4 docs/embed.pod
  100. +334 −0 docs/embed_new.pod
  101. +29 −0 docs/index/developer.json
  102. +62 −0 docs/index/index.json
  103. +14 −0 docs/index/ops.json
  104. +20 −0 docs/index/pct_tutorial.json
  105. +13 −0 docs/index/pdds.json
  106. +38 −0 docs/index/pmcs.json
  107. +64 −0 docs/index/tools.json
  108. +5 −3 docs/parrot.pod
  109. +3 −1 docs/parrothist.pod
  110. +1 −4 docs/pdds/pdd07_codingstd.pod
  111. +2 −2 docs/pdds/{draft → }/pdd10_embedding.pod
  112. +0 −20 docs/pdds/pdd27_multiple_dispatch.pod
  113. +1 −1 docs/pmc/array.pod
  114. +1 −1 docs/pmc/struct.pod
  115. +1 −1 docs/pmc/subs.pod
  116. +67 −1 docs/project/git_workflow.pod
  117. +15 −9 docs/project/release_manager_guide.pod
  118. +1 −1 docs/running.pod
  119. +34 −0 docs/submissions.pod
  120. +2 −11 docs/tests.pod
Sorry, we could not display the entire diff because too many files (673) changed.
View
29 .gitignore
@@ -1,11 +1,19 @@
-# ex: set ro:
-# $Id$
-# generated by tools/dev/mk_manifest_and_skip.pl
-# .gitignore
-#
-# Ignore any remaining SVN directories
+# Ignore SVN, if people are using the SVN Github interface (danger!)
/\B.svn\b
+
+# Ignore core files
+/core*
+
+# Ignore patch-related stuff
+*.rej
+*.orig
+*.patch
+*.diff
+
# ports/ should not go into release tarballs
+*.obj
+*.rc
+*.res
/ports
/*.core
/*.def
@@ -37,6 +45,7 @@
/blib
/config_lib.pir
/cover_db
+/generated_hello.pbc
/install_config.fpmc
/installable*
/libparrot.def
@@ -213,9 +222,6 @@
/include/parrot/has_header.h
/include/parrot/opsenum.h
/include/parrot/pbcversion.h
-/include/parrot/platform.h
-/include/parrot/platform_interface.h
-/include/parrot/platform_limits.h
/include/parrot/vtable.h
/include/pmc/*.h
/lib/DumbLink.pm
@@ -286,6 +292,7 @@
/src/*.str
/src/asmfun.*
/src/core_pmcs.c
+/src/embed/*.o
/src/exec_cpu.c
/src/exec_dep.c
/src/exec_dep.h
@@ -302,8 +309,7 @@
/src/null_config.c
/src/parrot_config.c
/src/parrot_config.h
-/src/platform.c
-/src/platform_asm.s
+/src/platform/*/*.o
/src/revision.c
/src/atomic/*.o
/src/call/*.o
@@ -442,6 +448,7 @@
/t/src/*_*
/t/src/*.gcov
/t/src/*.gcdada
+/t/src/embed/*.c
/t/stress/*.out
/t/stress/*.pasm
/t/stress/*.pbc
View
33 CREDITS
@@ -57,7 +57,7 @@ U: heimdall
E: Nattfodd@gmail.com
N: Allison Randal
-D: Architect (0.4.6...) & Lead Developer
+D: Architect (0.4.6 - 2.8.0) & Lead Developer
E: allison@parrot.org
U: allison
@@ -224,8 +224,8 @@ U: creiss
E: creiss@cc.gatech.edu
N: Chip Salzenberg
-D: Release manager emeritus (0.4.6-0.4.7)
-D: Architect emeritus (0.1.2-0.4.5)
+D: Release manager emeritus (0.4.6 - 0.4.7)
+D: Architect emeritus (0.1.2 - 0.4.5)
U: chip
E: chip@pobox.com
@@ -243,12 +243,11 @@ D: Rakudo patches
N: Christoph Otto
U: cotto
-D: Patch for key flags in pdd08
+D: Architect (2.9.0 - current)
D: Range check in Env PMC
A: christoph_googleacct@mksig.org
A: christop...@mksig.org
A: Christoph Otto
-D: Pipp, Lorito taskmaster
E: christoph@mksig.org
N: chromatic
@@ -299,9 +298,13 @@ N: Damian Miles Knopp
U: dmknopp
E: dmknopp@loyola.edu
+N: Daniel Kang
+U: jumpyshoes
+D: improve pbc_disassemble's test coverage
+
N: Dan Sugalski
U: dan
-D: Architect emeritus (0.0.1-0.1.1)
+D: Architect emeritus (0.0.1 - 0.1.1)
E: dan@sidhe.org
W: http://www.sidhe.org/~dan/blog/
@@ -323,6 +326,11 @@ N: Dave Woldrich
D: Win32 build fixes
E: dave@woldrich.com
+N: David Czech
+U: kapace
+E: davidczech510@gmail.com
+D: increasing EventHandler test coverage
+
N: David M. Lloyd
U: dmlloyd
E: dmlloyd@tds.net
@@ -674,6 +682,10 @@ U: LylePerl
D: Win32 and CGI testing
W: http://perl.bristolbath.org/blog/lyle/
+N: Mariano Wahlmann
+E: dichoso@gmail.com
+A: bluescreen
+
N: Marcelo Serra Castilhos
E: mhelix@terra.com.br
D: Bug fix
@@ -712,7 +724,9 @@ N: Matt Kennedy
D: Some Env PMC method implementations and tests
N: Matt Rajca
-D: Code refactoring
+E: mattmatt.rajca@me.com
+A: mattrajca
+D: Code refactoring, increasing test coverage
N: Mattia Barbon
D: Win32 fixes, dynamic PMC creation and loading
@@ -1047,6 +1061,11 @@ D: Nicer command line handling in ops2c.pl
N: Tony Payne
D: Example hanoi.pasm
+N: Tony Young
+E: rofflwaffls@gmail.com
+U: rfw
+D: increasing PMC test coverage
+
N: Tyler Curtis
U: tcurtis
E: tyler.l.curtis@gmail.com
View
8 ChangeLog
@@ -1,8 +1,12 @@
#1 $Id$
+2011.01.18 cotto
+ * Released 3.0.0
+ See NEWS for more.
+
2010.12.21 Whiteknight
- * Released 2.11.0
- See NEWS for more.
+ * Released 2.11.0
+ See NEWS for more.
2010.11.16 tcurtis
* Released 2.10.0
View
22 Configure.pl
@@ -5,6 +5,7 @@
use 5.008;
use strict;
use warnings;
+use Data::Dumper;$Data::Dumper::Indent=1;
use lib 'lib';
use Parrot::Configure;
@@ -41,6 +42,7 @@
}
);
exit(1) unless defined $args;
+#print STDERR Dumper $args;
my $opttest = Parrot::Configure::Options::Test->new($args);
@@ -51,7 +53,8 @@
my $parrot_version = $Parrot::Configure::Options::Conf::parrot_version;
# from Parrot::Configure::Messages
-print_introduction($parrot_version);
+print_introduction($parrot_version)
+ unless $args->{silent};
# Update revision number if needed
Parrot::Revision::update();
@@ -79,7 +82,7 @@
my $make = $conf->data->get('make');
# from Parrot::Configure::Messages
-( print_conclusion( $conf, $make ) ) ? exit 0 : exit 1;
+( print_conclusion( $conf, $make, $args ) ) ? exit 0 : exit 1;
################### DOCUMENTATION ###################
@@ -198,7 +201,7 @@ =head2 General Options
=item C<--coveragedir>
-In preparation for calling C<make quickcover> to perform coverage analysis,
+In preparation for calling C<make cover> to perform coverage analysis,
provide a user-specified directory for top level of HTML output.
=item Operating system-specific configuration options
@@ -355,18 +358,10 @@ =head2 Parrot Options
Use the given ops files.
-=item C<--jitcapable>
-
-Use JIT system.
-
=item C<--buildframes>
Dynamically build NCI call frames.
-=item C<--execcapable>
-
-Use JIT to emit a native executable.
-
=back
=head2 International Components For Unicode (ICU) Options
@@ -553,7 +548,7 @@ =head1 CONFIGURATION-FILE INTERFACE
...
init::hints verbose-step
- init::headers
+ ...
inter::progs fatal-step
...
auto::gcc verbose-step
@@ -600,7 +595,6 @@ =head2 Example
init::defaults
init::install
init::hints verbose-step
- init::headers
inter::progs
inter::make
inter::lex
@@ -645,11 +639,11 @@ =head2 Example
auto::ctags
auto::revision
auto::icu
+ auto::platform
gen::config_h
gen::core_pmcs
gen::opengl
gen::makefiles
- gen::platform
gen::config_pm
=cut
View
133 DEPRECATED.pod
@@ -104,12 +104,6 @@ will not auto-vivify nested hashes and return PMCNULL early.
L<https://trac.parrot.org/parrot/ticket/1561>
-=item Method unescape on String [experimental]
-
-This is a helper method for testing of Parrot_str_unescape_string.
-
-L<https://trac.parrot.org/parrot/ticket/1628>
-
=item logical_* vtables [eligiblie in 2.7]
These can be replaced by C<get_bool> and intval ops unless you're using them for
@@ -126,6 +120,44 @@ This perennially broken PMC will be removed.
L<http://trac.parrot.org/parrot/ticket/1892>
+=item Scalar PMC [eligible in 3.1]
+
+The Scalar PMC can be removed, so long as the behaviors of PMCs which inherit
+from it do not change.
+
+L<https://trac.parrot.org/parrot/ticket/1754>
+
+=item "Advanced" NCI parameter types [eligible in 3.1]
+
+Many NCI parameter types that implement complex functionalities will be removed.
+See ticket for list and replacement suggestions.
+
+L<http://trac.parrot.org/parrot/ticket/1931>
+
+=item FixedPMCArray set_pmc vtable [eligible in 3.1]
+
+set_pmc on FPA will be removed. The assign op, which uses this vtable will cease
+to work on this type.
+
+L<http://trac.parrot.org/parrot/ticket/1904>
+
+=item The Eval PMC [eligible in 3.1]
+
+The Eval PMC will be removed. Uses of it returned from compilers will be
+replaced with PackFile PMCs instead.
+
+L<http://trac.parrot.org/parrot/ticket/1969>
+
+=item The PIR and PASM compreg PMCs [eligible in 3.1]
+
+The PMC returned by C<compreg "PIR"> 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.
+
+L<http://trac.parrot.org/parrot/ticket/1967>
+
=back
=head1 Opcodes
@@ -200,24 +232,24 @@ These will be changed to allow more flexibility in types.
L<https://trac.parrot.org/parrot/ticket/1565>
-=item inplace string updates. [eligible in 2.4]
-
-All "inplace" string update ops are deprecated. E.g. "chopn_s", etc.
-Part of COW removal.
+=item logical PMC ops [eligible in 2.7]
-L<https://trac.parrot.org/parrot/ticket/1540>
+These fall out from the logical vtables deprecation.
-=item finalize [experimental]
+L<https://trac.parrot.org/parrot/ticket/1655>
-Finalize exception handler, unrolling inner runloops if needed.
+=item "constant" PObj [eligible in 3.1]
-L<https://trac.parrot.org/parrot/ticket/1635>
+"constant" PObj (which is never collected) are deprecated. All PMCs and STRINGs
+should be properly marked during GC.
-=item logical PMC ops [eligible in 2.7]
+Functions C<Parrot_pmc_new_constant>, C<Parrot_pmc_new_constant_noinit>,
+C<Parrot_pmc_new_constant_init> and C<Parrot_pmc_new_constant_init_int>
+will be removed.
-These fall out from the logical vtables deprecation.
+PObj flag C<PObj_constant_FLAG> and related macros will be removed.
-L<https://trac.parrot.org/parrot/ticket/1655>
+L<https://trac.parrot.org/parrot/ticket/1875>
=back
@@ -237,6 +269,13 @@ L<https://trac.parrot.org/parrot/ticket/451>
L<https://trac.parrot.org/parrot/ticket/451>
+=item X-to-Y native PBC reading [eligible in 3.1]
+
+Support for PBC files optimized for alternate platforms will be dropped in
+favour of a universal network PBC format.
+
+L<https://trac.parrot.org/parrot/ticket/1961>
+
=back
=head1 Debugger
@@ -291,6 +330,12 @@ At this point, C<:init> is a no-op, and will therefore be removed.
L<https://trac.parrot.org/parrot/ticket/1896>
+=item encoding:charset:"" string literals [eligible in 3.1]
+
+This form of string literals will be removed.
+
+L<https://trac.parrot.org/parrot/ticket/1808>
+
=back
=head1 Functions
@@ -324,20 +369,6 @@ this rather than relying on in-place modification of an existing pointer.
L<https://trac.parrot.org/parrot/ticket/1584>
-=item STRING COW [eligible in 2.4]
-
-COW strings are to be removed. All "inplace" string modification
-functions and all "inplace" string ops are deprecated.
-
-L<https://trac.parrot.org/parrot/ticket/1540>
-
-=item Parrot_str_unescape_string [experimental]
-
-This function is an experimental addition to enhance and maybe replace
-Parrot_str_unescape
-
-L<https://trac.parrot.org/parrot/ticket/1628>
-
=item Parrot_load_bytecode_file [experimental]
Load a .pbc file into the interpreter. Experimental.
@@ -349,10 +380,50 @@ is deprecated.
L<http://trac.parrot.org/parrot/ticket/1800>
+=item Non-const STRING* arguments [eligible in 3.1]
+
+Due immutable nature of STRINGs we are changing internal handling to use only
+const STRING pointers. It will improve optimizations possibilities by compiler,
+make parrot const-correct, etc.
+
+Passing of non-const STRING* arguments is deprecated and will be changed to
+const STRING*. This includes (but not limited to) all string API functions,
+VTABLEs, PCC, etc.
+
+L<http://trac.parrot.org/parrot/ticket/1906>
+
+=item Old string_* functions [eligible in 3.0]
+
+The old string_* functions will be removed.
+
+L<http://trac.parrot.org/parrot/ticket/1809>
+
+=item Old embedding API in src/embed.c
+
+Functions in src/embed.c are deprecated. Functions in that file will
+either be deleted outright if they are superfluous, or will be moved and
+renamed in a way that is more appropriate. The file src/embed.c and
+include/parrot/embed.h will both be deleted eventually.
+
+L<http://trac.parrot.org/parrot/ticket/1910>
+
=back
=head1 Compiler tools
+=head2 IMCC
+
+=over 4
+
+=item PIR compiler availability [eligible in 3.1]
+
+The PIR compiler (currently IMCC) will be extracted to a separately loadable
+component.
+
+L<http://trac.parrot.org/parrot/ticket/1868>
+
+=back
+
=head2 Parrot Grammar Engine (PGE)
=over 4
View
4 DONORS.pod
@@ -1,5 +1,9 @@
# Parrot is Copyright (C) 2001-2008, Parrot Foundation.
+=head1 NAME
+
+DONORS
+
=head1 DONORS
We would like to thank the following people and institutions,
View
157 MANIFEST
@@ -23,9 +23,6 @@ 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
@@ -167,7 +164,6 @@ config/auto/ipv6.pm []
config/auto/ipv6/test.in []
config/auto/isreg.pm []
config/auto/isreg/test_c.in []
-config/auto/jit.pm []
config/auto/libffi.pm []
config/auto/libffi/test_c.in []
config/auto/llvm.pm []
@@ -185,6 +181,7 @@ config/auto/ops.pm []
config/auto/pcre.pm []
config/auto/pcre/pcre_c.in []
config/auto/perldoc.pm []
+config/auto/platform.pm []
config/auto/pmc.pm []
config/auto/pod2man.pm []
config/auto/readline.pm []
@@ -233,63 +230,7 @@ config/gen/makefiles/parrot_embed_pl.in []
config/gen/makefiles/parrot_pc.in []
config/gen/makefiles/root.in []
config/gen/opengl.pm []
-config/gen/platform.pm []
-config/gen/platform/aix/asm.s []
-config/gen/platform/ansi/dl.c []
-config/gen/platform/ansi/exec.c []
-config/gen/platform/ansi/io.h []
-config/gen/platform/ansi/pid.c []
-config/gen/platform/ansi/time.c []
-config/gen/platform/cygwin/math.c []
-config/gen/platform/darwin/begin.c []
-config/gen/platform/darwin/hires_timer.c []
-config/gen/platform/darwin/sysmem.c []
-config/gen/platform/generic/dl.c []
-config/gen/platform/generic/dl.h []
-config/gen/platform/generic/env.c []
-config/gen/platform/generic/exec.c []
-config/gen/platform/generic/hires_timer.c []
-config/gen/platform/generic/io.h []
-config/gen/platform/generic/itimer.c []
-config/gen/platform/generic/math.c []
-config/gen/platform/generic/math.h []
-config/gen/platform/generic/memexec.c []
-config/gen/platform/generic/pid.c []
-config/gen/platform/generic/platform_limits.h []
-config/gen/platform/generic/signal.c []
-config/gen/platform/generic/signal.h []
-config/gen/platform/generic/stat.c []
-config/gen/platform/generic/stat.h []
-config/gen/platform/generic/sysmem.c []
-config/gen/platform/generic/threads.h []
-config/gen/platform/generic/time.c []
-config/gen/platform/ia64/asm.s []
-config/gen/platform/netbsd/math.c []
-config/gen/platform/netbsd/misc.c []
-config/gen/platform/netbsd/misc.h []
-config/gen/platform/openbsd/math.c []
-config/gen/platform/openbsd/memexec.c []
-config/gen/platform/openbsd/misc.h []
-config/gen/platform/solaris/math.c []
-config/gen/platform/solaris/time.c []
-config/gen/platform/win32/begin.c []
-config/gen/platform/win32/dl.c []
-config/gen/platform/win32/env.c []
-config/gen/platform/win32/exec.c []
-config/gen/platform/win32/hires_timer.c []
-config/gen/platform/win32/io.h []
-config/gen/platform/win32/misc.c []
-config/gen/platform/win32/misc.h []
-config/gen/platform/win32/pid.c []
-config/gen/platform/win32/signal.c []
-config/gen/platform/win32/signal.h []
-config/gen/platform/win32/stat.h []
-config/gen/platform/win32/string.h []
-config/gen/platform/win32/sysmem.c []
-config/gen/platform/win32/threads.h []
-config/gen/platform/win32/time.c []
config/init/defaults.pm []
-config/init/headers.pm []
config/init/hints.pm []
config/init/hints/aix.pm []
config/init/hints/cygwin.pm []
@@ -368,13 +309,21 @@ docs/dev/pmc_freeze.pod [doc]
docs/dev/pmc_obj_design_meeting_notes.pod [doc]
docs/dev/profiling.pod [doc]
docs/embed.pod [doc]
+docs/embed_new.pod [doc]
docs/extend.pod [doc]
docs/faq.pod [doc]
docs/gettingstarted.pod [doc]
docs/glossary.pod [doc]
docs/imcc/README [doc]
docs/imcc/imcfaq.pod [doc]
docs/imcc/operation.pod [doc]
+docs/index/developer.json [doc]
+docs/index/index.json [doc]
+docs/index/ops.json [doc]
+docs/index/pct_tutorial.json [doc]
+docs/index/pdds.json [doc]
+docs/index/pmcs.json [doc]
+docs/index/tools.json [doc]
docs/intro.pod [doc]
docs/memory_internals.pod [doc]
docs/multidispatch.pod [doc]
@@ -390,7 +339,6 @@ docs/pdds/draft/pdd01_overview.pod [doc]
docs/pdds/draft/pdd05_opfunc.pod [doc]
docs/pdds/draft/pdd06_pasm.pod [doc]
docs/pdds/draft/pdd08_keys.pod [doc]
-docs/pdds/draft/pdd10_embedding.pod [doc]
docs/pdds/draft/pdd11_extending.pod [doc]
docs/pdds/draft/pdd14_numbers.pod [doc]
docs/pdds/draft/pdd16_native_call.pod [doc]
@@ -400,6 +348,7 @@ docs/pdds/pdd00_pdd.pod [doc]
docs/pdds/pdd03_calling_conventions.pod [doc]
docs/pdds/pdd07_codingstd.pod [doc]
docs/pdds/pdd09_gc.pod [doc]
+docs/pdds/pdd10_embedding.pod [doc]
docs/pdds/pdd13_bytecode.pod [doc]
docs/pdds/pdd15_object_metamodel.png [doc]
docs/pdds/pdd15_object_metamodel.svg [doc]
@@ -447,6 +396,12 @@ docs/running.pod [doc]
docs/stability.pod [doc]
docs/submissions.pod [doc]
docs/tests.pod [doc]
+docs/translations/README.BGR [doc]
+docs/translations/README.deutsch [doc]
+docs/translations/README.espanol [doc]
+docs/translations/README.francais [doc]
+docs/translations/README.polski [doc]
+docs/translations/README.pt-BR [doc]
docs/user/pir/exceptions.pod [doc]
docs/user/pir/intro.pod [doc]
docs/user/pir/objects.pod [doc]
@@ -677,6 +632,7 @@ 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/md5sum_oo.pir [examples]
examples/pir/mysqltest.bas [examples]
examples/pir/perl6.bas [examples]
examples/pir/pirric.pir [examples]
@@ -936,12 +892,8 @@ include/parrot/global_setup.h [main]include
include/parrot/hash.h [main]include
include/parrot/hll.h [main]include
include/parrot/imageio.h [main]include
-include/parrot/imcc.h [main]include
include/parrot/interpreter.h [main]include
include/parrot/io.h [main]include
-include/parrot/io_portable.h [main]include
-include/parrot/io_unix.h [main]include
-include/parrot/io_win32.h [main]include
include/parrot/key.h [main]include
include/parrot/library.h [main]include
include/parrot/list.h [main]include
@@ -974,9 +926,7 @@ include/parrot/settings.h [main]include
include/parrot/stat.h [main]include
include/parrot/string.h [main]include
include/parrot/string_funcs.h [main]include
-include/parrot/string_primitives.h [main]include
include/parrot/sub.h [main]include
-include/parrot/sysmem.h [main]include
include/parrot/thr_pthread.h [main]include
include/parrot/thr_windows.h [main]include
include/parrot/thread.h [main]include
@@ -1013,6 +963,7 @@ lib/Parrot/Docs/Group.pm [devel]lib
lib/Parrot/Docs/HTMLPage.pm [devel]lib
lib/Parrot/Docs/Item.pm [devel]lib
lib/Parrot/Docs/POD2HTML.pm [devel]lib
+lib/Parrot/Docs/PodToHtml.pm [devel]lib
lib/Parrot/Docs/Section.pm [devel]lib
lib/Parrot/Docs/Section/C.pm [devel]lib
lib/Parrot/Docs/Section/Compilers.pm [devel]lib
@@ -1290,13 +1241,7 @@ src/io/buffer.c []
src/io/core.c []
src/io/filehandle.c []
src/io/io_private.h []
-src/io/portable.c []
src/io/socket_api.c []
-src/io/socket_unix.c []
-src/io/socket_win32.c []
-src/io/unix.c []
-src/io/utf8.c []
-src/io/win32.c []
src/key.c []
src/libnci_test.def []
src/library.c []
@@ -1335,6 +1280,42 @@ src/packfile/object_serialization.c []
src/packfile/output.c []
src/packfile/pf_items.c []
src/pbc_disassemble.c []
+src/platform/aix/asm.s []
+src/platform/ansi/dl.c []
+src/platform/ansi/exec.c []
+src/platform/ansi/time.c []
+src/platform/cygwin/math.c []
+src/platform/darwin/hires_timer.c []
+src/platform/darwin/sysmem.c []
+src/platform/generic/dl.c []
+src/platform/generic/encoding.c []
+src/platform/generic/env.c []
+src/platform/generic/exec.c []
+src/platform/generic/hires_timer.c []
+src/platform/generic/io.c []
+src/platform/generic/itimer.c []
+src/platform/generic/math.c []
+src/platform/generic/misc.c []
+src/platform/generic/socket.c []
+src/platform/generic/stat.c []
+src/platform/generic/sysmem.c []
+src/platform/generic/time.c []
+src/platform/generic/uid.c []
+src/platform/ia64/asm.s []
+src/platform/linux/encoding.c []
+src/platform/netbsd/misc.c []
+src/platform/openbsd/math.c []
+src/platform/solaris/math.c []
+src/platform/solaris/time.c []
+src/platform/win32/dl.c []
+src/platform/win32/env.c []
+src/platform/win32/exec.c []
+src/platform/win32/hires_timer.c []
+src/platform/win32/io.c []
+src/platform/win32/misc.c []
+src/platform/win32/sysmem.c []
+src/platform/win32/time.c []
+src/platform/win32/uid.c []
src/pmc.c []
src/pmc/addrregistry.pmc []
src/pmc/arrayiterator.pmc []
@@ -1390,9 +1371,11 @@ src/pmc/orderedhashiterator.pmc []
src/pmc/packfile.pmc []
src/pmc/packfileannotation.pmc []
src/pmc/packfileannotations.pmc []
+src/pmc/packfilebytecodesegment.pmc []
src/pmc/packfileconstanttable.pmc []
src/pmc/packfiledebug.pmc []
src/pmc/packfiledirectory.pmc []
+src/pmc/packfileopmap.pmc []
src/pmc/packfilerawsegment.pmc []
src/pmc/packfilesegment.pmc []
src/pmc/parrotinterpreter.pmc []
@@ -1442,10 +1425,9 @@ src/string/encoding/tables.c []
src/string/encoding/tables.h []
src/string/encoding/ucs2.c []
src/string/encoding/ucs4.c []
+src/string/encoding/unicode.h []
src/string/encoding/utf16.c []
src/string/encoding/utf8.c []
-src/string/primitives.c []
-src/string/unicode.h []
src/sub.c []
src/thread.c []
src/utils.c []
@@ -1470,7 +1452,6 @@ t/codingstd/c_struct.t [test]
t/codingstd/c_todo.t [test]
t/codingstd/check_isxxx.t [test]
t/codingstd/check_toxxx.t [test]
-t/codingstd/checkdepend.t [test]
t/codingstd/copyright.t [test]
t/codingstd/cuddled_else.t [test]
t/codingstd/filenames.t [test]
@@ -1615,6 +1596,7 @@ t/configure/061-revision_from_cache.t [test]
t/configure/062-sha1_to_cache.t [test]
t/configure/063-git_describe_to_cache.t [test]
t/configure/064-sha1_from_cache.t [test]
+t/configure/065-git_describe_from_cache.t [test]
t/configure/testlib/Make_VERSION_File.pm [test]
t/configure/testlib/Tie/Filehandle/Preempt/Stdin.pm [test]
t/configure/testlib/adefectivefoobar [test]
@@ -1698,6 +1680,7 @@ t/library/pg.t [test]
t/library/protoobject.t [test]
t/library/rand.t [test]
t/library/range.t [test]
+t/library/sha.t [test]
t/library/streams.t [test]
t/library/string_utils.t [test]
t/library/tap_parser.t [test]
@@ -1882,6 +1865,7 @@ t/pmc/multisub.t [test]
t/pmc/namespace-old.t [test]
t/pmc/namespace-subs.t [test]
t/pmc/namespace.t [test]
+t/pmc/nativepccmethod.t [test]
t/pmc/nci.t [test]
t/pmc/null.t [test]
t/pmc/object-meths.t [test]
@@ -1894,8 +1878,10 @@ t/pmc/orderedhashiterator.t [test]
t/pmc/packfile.t [test]
t/pmc/packfileannotation.t [test]
t/pmc/packfileannotations.t [test]
+t/pmc/packfilebytecodesegment.t [test]
t/pmc/packfileconstanttable.t [test]
t/pmc/packfiledirectory.t [test]
+t/pmc/packfileopmap.t [test]
t/pmc/packfilerawsegment.t [test]
t/pmc/packfilesegment.t [test]
t/pmc/parrotclass.t [test]
@@ -1928,9 +1914,11 @@ t/pmc/stringiterator.t [test]
t/pmc/sub.t [test]
t/pmc/sys.t [test]
t/pmc/task.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/threads.t [test]
t/pmc/timer.t [test]
t/pmc/undef.t [test]
@@ -1946,11 +1934,15 @@ 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]
+t/src/embed/api.t [test]
t/src/embed/pmc.t [test]
t/src/embed/strings.t [test]
t/src/exit.t [test]
t/src/extend.t [test]
+t/src/extend_vtable.t [test]
+t/src/misc.t [test]
t/src/pointer_array.t [test]
t/src/warnings.t [test]
t/steps/auto/arch-01.t [test]
@@ -1974,7 +1966,6 @@ t/steps/auto/icu-01.t [test]
t/steps/auto/inline-01.t [test]
t/steps/auto/ipv6-01.t [test]
t/steps/auto/isreg-01.t [test]
-t/steps/auto/jit-01.t [test]
t/steps/auto/libffi-01.t [test]
t/steps/auto/llvm-01.t [test]
t/steps/auto/memalign-01.t [test]
@@ -1984,6 +1975,7 @@ t/steps/auto/opengl-01.t [test]
t/steps/auto/ops-01.t [test]
t/steps/auto/pcre-01.t [test]
t/steps/auto/perldoc-01.t [test]
+t/steps/auto/platform-01.t [test]
t/steps/auto/pmc-01.t [test]
t/steps/auto/pod2man-01.t [test]
t/steps/auto/readline-01.t [test]
@@ -2005,9 +1997,7 @@ t/steps/gen/config_pm-01.t [test]
t/steps/gen/core_pmcs-01.t [test]
t/steps/gen/makefiles-01.t [test]
t/steps/gen/opengl-01.t [test]
-t/steps/gen/platform-01.t [test]
t/steps/init/defaults-01.t [test]
-t/steps/init/headers-01.t [test]
t/steps/init/hints-01.t [test]
t/steps/init/hints/darwin-01.t [test]
t/steps/init/hints/linux-01.t [test]
@@ -2049,8 +2039,6 @@ t/tools/dump_pbc.t [test]
t/tools/install/01-create_directories.t [test]
t/tools/install/02-install_files.t [test]
t/tools/install/03-lines_to_files.t [test]
-t/tools/install/dev_overall.t [test]
-t/tools/install/overall.t [test]
t/tools/install/testlib/LICENSE [test]
t/tools/install/testlib/MANIFEST.1defective [test]
t/tools/install/testlib/README []doc
@@ -2111,6 +2099,9 @@ tools/dev/debian_docs.sh []
tools/dev/dump_pbc.pl []
tools/dev/faces.pl []
tools/dev/fetch_languages.pl []
+tools/dev/findhacks.pl []
+tools/dev/gdb-pp-load.py []
+tools/dev/gdb-pp.py []
tools/dev/gen_charset_tables.pl []
tools/dev/gen_class.pl []
tools/dev/gen_makefile.pl [devel]
@@ -2121,7 +2112,7 @@ tools/dev/install_dev_files.pl []
tools/dev/install_doc_files.pl []
tools/dev/install_files.pl []
tools/dev/lib_deps.pl []
-tools/dev/list_unjitted.pl []
+tools/dev/make_cover.pl []
tools/dev/manicheck.pl []
tools/dev/mk_author_map.pl []
tools/dev/mk_inno.pl []
@@ -2162,9 +2153,9 @@ 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/ops_summary.pl []
-tools/docs/write_docs.pl []
tools/install/smoke.pl []
tools/install/smoke_languages.pl []
tools/release/README []doc
View
34 MANIFEST.SKIP
@@ -14,6 +14,20 @@
# ports/ should not go into release tarballs
^ports$
^ports/
+^.*\.diff$
+^.*\.diff/
+^.*\.obj$
+^.*\.obj/
+^.*\.orig$
+^.*\.orig/
+^.*\.patch$
+^.*\.patch/
+^.*\.rc$
+^.*\.rc/
+^.*\.rej$
+^.*\.rej/
+^.*\.res$
+^.*\.res/
^/.*\.core$
^/.*\.core/
^/.*\.def$
@@ -134,6 +148,8 @@
^/compilers/tge/tgc\.pbc/
^/config_lib\.pir$
^/config_lib\.pir/
+^/core.*$
+^/core.*/
^/cover_db$
^/cover_db/
^/docs/.*\.tmp$
@@ -350,6 +366,8 @@
^/frontend/pbc_merge/.*\.gcov/
^/frontend/pbc_merge/main\.o$
^/frontend/pbc_merge/main\.o/
+^/generated_hello\.pbc$
+^/generated_hello\.pbc/
^/include/parrot/.*\.tmp$
^/include/parrot/.*\.tmp/
^/include/parrot/config\.h$
@@ -366,12 +384,6 @@
^/include/parrot/opsenum\.h/
^/include/parrot/pbcversion\.h$
^/include/parrot/pbcversion\.h/
-^/include/parrot/platform\.h$
-^/include/parrot/platform\.h/
-^/include/parrot/platform_interface\.h$
-^/include/parrot/platform_interface\.h/
-^/include/parrot/platform_limits\.h$
-^/include/parrot/platform_limits\.h/
^/include/parrot/vtable\.h$
^/include/parrot/vtable\.h/
^/include/pmc/.*\.h$
@@ -676,6 +688,8 @@
^/src/dynpmc/.*\.pdb/
^/src/dynpmc/.*\.so$
^/src/dynpmc/.*\.so/
+^/src/embed/.*\.o$
+^/src/embed/.*\.o/
^/src/exec_cpu\.c$
^/src/exec_cpu\.c/
^/src/exec_dep\.c$
@@ -776,10 +790,8 @@
^/src/parrot_config\.c/
^/src/parrot_config\.h$
^/src/parrot_config\.h/
-^/src/platform\.c$
-^/src/platform\.c/
-^/src/platform_asm\.s$
-^/src/platform_asm\.s/
+^/src/platform/.*/.*\.o$
+^/src/platform/.*/.*\.o/
^/src/pmc/.*\.c$
^/src/pmc/.*\.c/
^/src/pmc/.*\.dump$
@@ -978,6 +990,8 @@
^/t/src/.*\.gcov/
^/t/src/.*_.*$
^/t/src/.*_.*/
+^/t/src/embed/.*\.c$
+^/t/src/embed/.*\.c/
^/t/stress/.*\.out$
^/t/stress/.*\.out/
^/t/stress/.*\.pasm$
View
10 MANIFEST.generated
@@ -1,11 +1,11 @@
# 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.2.11.0.dylib [main]lib
+blib/lib/libparrot.3.0.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.2.11.0 [main]lib
+blib/lib/libparrot.so.3.0.0 [main]lib
compilers/data_json/data_json.pbc [data_json]
config/gen/call_list/opengl.in []
docs/ops/bit.pod [doc]
@@ -33,8 +33,6 @@ include/parrot/extend_vtable.h [main]include
include/parrot/feature.h [main]include
include/parrot/has_header.h [main]include
include/parrot/pbcversion.h [devel]include
-include/parrot/platform.h [main]include
-include/parrot/platform_limits.h [devel]include
include/parrot/vtable.h [main]include
include/pmc/pmc_addrregistry.h [devel]include
include/pmc/pmc_arrayiterator.h [devel]include
@@ -92,11 +90,13 @@ include/pmc/pmc_orderedhashiterator.h [devel]include
include/pmc/pmc_packfile.h [devel]include
include/pmc/pmc_packfileannotation.h [devel]include
include/pmc/pmc_packfileannotations.h [devel]include
+include/pmc/pmc_packfilebytecodesegment.h [devel]include
include/pmc/pmc_packfileconstanttable.h [devel]include
include/pmc/pmc_packfiledebug.h [devel]include
include/pmc/pmc_packfiledirectory.h [devel]include
include/pmc/pmc_packfilefixupentry.h [devel]include
include/pmc/pmc_packfilefixuptable.h [devel]include
+include/pmc/pmc_packfileopmap.h [devel]include
include/pmc/pmc_packfilerawsegment.h [devel]include
include/pmc/pmc_packfilesegment.h [devel]include
include/pmc/pmc_parrotinterpreter.h [devel]include
@@ -390,11 +390,13 @@ src/pmc/orderedhashiterator.dump [devel]src
src/pmc/packfile.dump [devel]src
src/pmc/packfileannotation.dump [devel]src
src/pmc/packfileannotations.dump [devel]src
+src/pmc/packfilebytecodesegment.dump [devel]src
src/pmc/packfileconstanttable.dump [devel]src
src/pmc/packfiledebug.dump [devel]src
src/pmc/packfiledirectory.dump [devel]src
src/pmc/packfilefixupentry.dump [devel]src
src/pmc/packfilefixuptable.dump [devel]src
+src/pmc/packfileopmap.dump [devel]src
src/pmc/packfilerawsegment.dump [devel]src
src/pmc/packfilesegment.dump [devel]src
src/pmc/parrotinterpreter.dump [devel]src
View
44 NEWS
@@ -1,3 +1,47 @@
+New in 3.1.0
+- Core
+ + Exception PMCs are now subclassable from PIR
+
+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
View
4 PBC_COMPAT
@@ -28,9 +28,7 @@
# please insert tab separated entries at the top of the list
-9.3 2010.11.24 NotFound move op find_codepoint out of experimental TT #1629
-9.2 2010.11.21 plobsing remove CodeString PMC
-9.1 2010.10.27 nwellnhof remove charset ops
+10.0 2011.01.18 cotto released 3.0.0
9.0 2010.10.19 gerd released 2.9.0
8.0 2010.07.20 coke released 2.6.0
7.0 2010.04.20 gerd released 2.3.0 (version # added ex post facto, as all previous version #s were published)
View
2 PLATFORMS
@@ -12,6 +12,7 @@ Supported platforms:
Platform B8 Runloops Feature Comp Test Inst YYYYMMDD
CGoto EXEC Thr Sig
--------------------------------------------------------------------------------
+linux-sparc64-gcc-4.3.2 ? Y Y 20110114
cygwin1.5.25-x86-gcc3.4.4 4 Y - - - Y Y Y 20090315
darwin8.11.1-x86-gcc4.0.1 ?? Y ? ? ? Y Y N 20091020
linux-x86-gcc4.1.2 Y ? Y Y Y Y ? 20090419
@@ -83,7 +84,6 @@ B ... Processor is big endian
4 ... opcode_t is 4 byte, --m=32 on a 64 bit machine
CGoto ... CGoto runloop is supported
-JIT ... JIT core is supported
EXEC ... compiling to native executables is supported
Thr ... Parrot is multi-threaded
Sig ... Parrot catches a SIGHUP signal
View
4 README
@@ -1,7 +1,7 @@
-This is Parrot, version 2.11.0
+This is Parrot, version 3.0.0
------------------------------
-Parrot is Copyright (C) 2001-2010, Parrot Foundation.
+Parrot is Copyright (C) 2001-2011, Parrot Foundation.
LICENSE INFORMATION
View
0 README.deutsch
Sorry, we could not display the changes to this file because there were too many other changes to display.
View
0 README.espanol
Sorry, we could not display the changes to this file because there were too many other changes to display.
View
0 README.polski
Sorry, we could not display the changes to this file because there were too many other changes to display.
View
2 VERSION
@@ -1 +1 @@
-2.11.0
+3.0.0
View
11 compilers/imcc/Rules.in
@@ -148,17 +148,18 @@ compilers/imcc/main$(O) : \
compilers/imcc/imc.h \
compilers/imcc/imcparser.h \
compilers/imcc/instructions.h \
+ compilers/imcc/optimizer.h \
compilers/imcc/parser.h \
compilers/imcc/pbc.h \
compilers/imcc/sets.h \
compilers/imcc/symreg.h \
compilers/imcc/unit.h \
$(INC_DIR)/embed.h \
- $(INC_DIR)/imcc.h \
$(INC_DIR)/oplib/ops.h \
$(INC_DIR)/runcore_api.h \
$(INC_DIR)/api.h \
$(INC_DIR)/longopt.h \
+ include/pmc/pmc_sub.h \
$(PARROT_H_HEADERS)
## SUFFIX OVERRIDE - Warnings (This is generated code)
@@ -218,7 +219,7 @@ compilers/imcc/symreg$(O) : \
# imcc file dependencies
#
-# The .flag files are needed because we keep some derived files in SVN,
+# The .flag files are needed because we keep some generated files in Git,
# which does not keep accurate timestamps on the files, relative to each other.
# Note that YACC or LEX may be null commands, so we must `touch` all the
# target files, instead of just the .flag files.
@@ -232,3 +233,9 @@ compilers/imcc/imcc.y.flag compilers/imcc/imcparser.c compilers/imcc/imcparser.h
compilers/imcc/imcc.l.flag compilers/imcc/imclexer.c : compilers/imcc/imcc.l
$(LEX) -ocompilers/imcc/imclexer.c compilers/imcc/imcc.l
$(TOUCH) compilers/imcc/imcc.l.flag compilers/imcc/imclexer.c
+
+# Needed for parallel builds. The rules above might still be executed multiple
+# times, but not in parallel.
+compilers/imcc/imcparser.c : compilers/imcc/imcc.y.flag
+compilers/imcc/imcparser.h : compilers/imcc/imcparser.c
+compilers/imcc/imclexer.c : compilers/imcc/imcc.l.flag
View
17 compilers/imcc/debug.c
@@ -115,9 +115,6 @@ IMCC_warning(PARROT_INTERP, ARGIN(const char *fmt), ...)
{
ASSERT_ARGS(IMCC_warning)
va_list ap;
- if (IMCC_INFO(interp)->imcc_warn)
- return;
-
va_start(ap, fmt);
imcc_vfprintf(interp, Parrot_io_STDERR(interp), fmt, ap);
va_end(ap);
@@ -188,32 +185,32 @@ dump_instructions(PARROT_INTERP, ARGIN(const IMC_Unit *unit))
const Instruction *ins;
int pc;
- Parrot_io_fprintf(interp, Parrot_io_STDERR(interp),
+ Parrot_io_eprintf(interp,
"\nDumping the instructions status:"
"\n-------------------------------\n");
- Parrot_io_fprintf(interp, Parrot_io_STDERR(interp),
+ Parrot_io_eprintf(interp,
"nins line blck deep flags\t type opnr size pc X ins\n");
for (pc = 0, ins = unit->instructions; ins; ins = ins->next) {
const Basic_block * const bb = unit->bb_list[ins->bbindex];
if (bb) {
- Parrot_io_fprintf(interp, Parrot_io_STDERR(interp),
+ Parrot_io_eprintf(interp,
"%4i %4d %4d %4d\t%x\t%8x %4d %4d %4d ",
ins->index, ins->line, bb->index, bb->loop_depth,
ins->flags, ins->type, OP_INFO_OPNUM(ins->op),
ins->opsize, pc);
}
else {
- fprintf(stderr, "\t");
+ Parrot_io_eprintf(interp, "\t");
}
- Parrot_io_fprintf(interp, Parrot_io_STDERR(interp), "%s\n", ins->opname);
- ins_print(interp, Parrot_io_STDERR(interp), ins);
+ Parrot_io_eprintf(interp, "%s\n", ins->opname);
+ ins_print(interp, PIO_STDHANDLE(interp, PIO_STDERR_FILENO), ins);
pc += ins->opsize;
}
- Parrot_io_fprintf(interp, Parrot_io_STDERR(interp), "\n");
+ Parrot_io_eprintf(interp, "\n");
}
/*
View
6 compilers/imcc/imc.c
@@ -143,10 +143,8 @@ imc_cleanup(PARROT_INTERP, ARGIN_NULLOK(void *yyscanner))
mem_sys_free(IMCC_INFO(interp)->ghash.data);
IMCC_INFO(interp)->ghash.data = NULL;
- if (IMCC_INFO(interp)->state) {
- mem_sys_free(IMCC_INFO(interp)->state->file);
- IMCC_INFO(interp)->state->file = NULL;
- }
+ if (IMCC_INFO(interp)->state)
+ IMCC_INFO(interp)->state->file = STRINGNULL;
}
View
229 compilers/imcc/imc.h
@@ -61,6 +61,114 @@ enum {
#define N_ELEMENTS(x) (sizeof (x)/sizeof ((x)[0]))
+/* HEADERIZER BEGIN: compilers/imcc/main.c */
+/* Don't modify between HEADERIZER BEGIN / HEADERIZER END. Your changes will be lost. */
+
+PARROT_EXPORT
+PARROT_CANNOT_RETURN_NULL
+void * imcc_compile_file(PARROT_INTERP,
+ ARGIN(STRING *fullname),
+ ARGOUT(STRING **error_message))
+ __attribute__nonnull__(1)
+ __attribute__nonnull__(2)
+ __attribute__nonnull__(3)
+ FUNC_MODIFIES(*error_message);
+
+PARROT_EXPORT
+int imcc_run_api(
+ ARGMOD(PMC * interp_pmc),
+ ARGIN(STRING *sourcefile),
+ int argc,
+ ARGIN_NULLOK(const char **argv),
+ ARGOUT(PMC **pbcpmc))
+ __attribute__nonnull__(1)
+ __attribute__nonnull__(2)
+ __attribute__nonnull__(5)
+ FUNC_MODIFIES(* interp_pmc)
+ FUNC_MODIFIES(*pbcpmc);
+
+PARROT_WARN_UNUSED_RESULT
+PARROT_CANNOT_RETURN_NULL
+PMC * imcc_compile(PARROT_INTERP,
+ ARGIN(const char *s),
+ int pasm_file,
+ ARGOUT(STRING **error_message))
+ __attribute__nonnull__(1)
+ __attribute__nonnull__(2)
+ __attribute__nonnull__(4)
+ FUNC_MODIFIES(*error_message);
+
+PARROT_WARN_UNUSED_RESULT
+PARROT_CANNOT_RETURN_NULL
+PMC * imcc_compile_pasm_ex(PARROT_INTERP, ARGIN(const char *s))
+ __attribute__nonnull__(1)
+ __attribute__nonnull__(2);
+
+PARROT_WARN_UNUSED_RESULT
+PARROT_CANNOT_RETURN_NULL
+PMC * IMCC_compile_pasm_s(PARROT_INTERP,
+ ARGIN(const char *s),
+ ARGOUT(STRING **error_message))
+ __attribute__nonnull__(1)
+ __attribute__nonnull__(2)
+ __attribute__nonnull__(3)
+ FUNC_MODIFIES(*error_message);
+
+PARROT_WARN_UNUSED_RESULT
+PARROT_CANNOT_RETURN_NULL
+PMC * imcc_compile_pir_ex(PARROT_INTERP, ARGIN(const char *s))
+ __attribute__nonnull__(1)
+ __attribute__nonnull__(2);
+
+PARROT_WARN_UNUSED_RESULT
+PARROT_CANNOT_RETURN_NULL
+PMC * IMCC_compile_pir_s(PARROT_INTERP,
+ ARGIN(const char *s),
+ ARGOUT(STRING **error_message))
+ __attribute__nonnull__(1)
+ __attribute__nonnull__(2)
+ __attribute__nonnull__(3)
+ FUNC_MODIFIES(*error_message);
+
+void imcc_destroy(PARROT_INTERP)
+ __attribute__nonnull__(1);
+
+void imcc_init(PARROT_INTERP)
+ __attribute__nonnull__(1);
+
+#define ASSERT_ARGS_imcc_compile_file __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+ PARROT_ASSERT_ARG(interp) \
+ , PARROT_ASSERT_ARG(fullname) \
+ , PARROT_ASSERT_ARG(error_message))
+#define ASSERT_ARGS_imcc_run_api __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+ PARROT_ASSERT_ARG(interp_pmc) \
+ , PARROT_ASSERT_ARG(sourcefile) \
+ , PARROT_ASSERT_ARG(pbcpmc))
+#define ASSERT_ARGS_imcc_compile __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+ PARROT_ASSERT_ARG(interp) \
+ , PARROT_ASSERT_ARG(s) \
+ , PARROT_ASSERT_ARG(error_message))
+#define ASSERT_ARGS_imcc_compile_pasm_ex __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+ PARROT_ASSERT_ARG(interp) \
+ , PARROT_ASSERT_ARG(s))
+#define ASSERT_ARGS_IMCC_compile_pasm_s __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+ PARROT_ASSERT_ARG(interp) \
+ , PARROT_ASSERT_ARG(s) \
+ , PARROT_ASSERT_ARG(error_message))
+#define ASSERT_ARGS_imcc_compile_pir_ex __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+ PARROT_ASSERT_ARG(interp) \
+ , PARROT_ASSERT_ARG(s))
+#define ASSERT_ARGS_IMCC_compile_pir_s __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+ PARROT_ASSERT_ARG(interp) \
+ , PARROT_ASSERT_ARG(s) \
+ , PARROT_ASSERT_ARG(error_message))
+#define ASSERT_ARGS_imcc_destroy __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+ PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_imcc_init __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+ PARROT_ASSERT_ARG(interp))
+/* Don't modify between HEADERIZER BEGIN / HEADERIZER END. Your changes will be lost. */
+/* HEADERIZER END: compilers/imcc/main.c */
+
/* HEADERIZER BEGIN: compilers/imcc/imcc.y */
/* Don't modify between HEADERIZER BEGIN / HEADERIZER END. Your changes will be lost. */
@@ -183,16 +291,6 @@ Instruction * INS_LABEL(PARROT_INTERP,
/* HEADERIZER BEGIN: compilers/imcc/parser_util.c */
/* Don't modify between HEADERIZER BEGIN / HEADERIZER END. Your changes will be lost. */
-PARROT_EXPORT
-PARROT_CANNOT_RETURN_NULL
-void * imcc_compile_file(PARROT_INTERP,
- ARGIN(const char *fullname),
- ARGOUT(STRING **error_message))
- __attribute__nonnull__(1)
- __attribute__nonnull__(2)
- __attribute__nonnull__(3)
- FUNC_MODIFIES(*error_message);
-
void check_op(PARROT_INTERP,
ARGOUT(op_info_t **op_info),
ARGOUT(char *fullname),
@@ -208,66 +306,12 @@ void check_op(PARROT_INTERP,
FUNC_MODIFIES(*op_info)
FUNC_MODIFIES(*fullname);
-PARROT_WARN_UNUSED_RESULT
-PARROT_CANNOT_RETURN_NULL
-PMC * imcc_compile(PARROT_INTERP,
- ARGIN(const char *s),
- int pasm_file,
- ARGOUT(STRING **error_message))
- __attribute__nonnull__(1)
- __attribute__nonnull__(2)
- __attribute__nonnull__(4)
- FUNC_MODIFIES(*error_message);
-
-PARROT_WARN_UNUSED_RESULT
-PARROT_CANNOT_RETURN_NULL
-PMC * imcc_compile_pasm(PARROT_INTERP, ARGIN(const char *s))
- __attribute__nonnull__(1)
- __attribute__nonnull__(2);
-
-PARROT_WARN_UNUSED_RESULT
-PARROT_CANNOT_RETURN_NULL
-PMC * imcc_compile_pasm_ex(PARROT_INTERP, ARGIN(const char *s))
- __attribute__nonnull__(1)
- __attribute__nonnull__(2);
-
-PARROT_WARN_UNUSED_RESULT
-PARROT_CANNOT_RETURN_NULL
-PMC * IMCC_compile_pasm_s(PARROT_INTERP,
- ARGIN(const char *s),
- ARGOUT(STRING **error_message))
+int imcc_string_ends_with(PARROT_INTERP,
+ ARGIN(const STRING *str),
+ ARGIN(const char *ext))
__attribute__nonnull__(1)
__attribute__nonnull__(2)
- __attribute__nonnull__(3)
- FUNC_MODIFIES(*error_message);
-
-PARROT_WARN_UNUSED_RESULT
-PARROT_CANNOT_RETURN_NULL
-PMC * imcc_compile_pir(PARROT_INTERP, ARGIN(const char *s))
- __attribute__nonnull__(1)
- __attribute__nonnull__(2);
-
-PARROT_WARN_UNUSED_RESULT
-PARROT_CANNOT_RETURN_NULL
-PMC * imcc_compile_pir_ex(PARROT_INTERP, ARGIN(const char *s))
- __attribute__nonnull__(1)
- __attribute__nonnull__(2);
-
-PARROT_WARN_UNUSED_RESULT
-PARROT_CANNOT_RETURN_NULL
-PMC * IMCC_compile_pir_s(PARROT_INTERP,
- ARGIN(const char *s),
- ARGOUT(STRING **error_message))
- __attribute__nonnull__(1)
- __attribute__nonnull__(2)
- __attribute__nonnull__(3)
- FUNC_MODIFIES(*error_message);
-
-void imcc_destroy(PARROT_INTERP)
- __attribute__nonnull__(1);
-
-void imcc_init(PARROT_INTERP)
- __attribute__nonnull__(1);
+ __attribute__nonnull__(3);
PARROT_IGNORABLE_RESULT
int /*@alt void@*/
@@ -312,47 +356,16 @@ void op_fullname(
__attribute__nonnull__(3)
FUNC_MODIFIES(*dest);
-void register_compilers(PARROT_INTERP)
- __attribute__nonnull__(1);
-
-#define ASSERT_ARGS_imcc_compile_file __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
- PARROT_ASSERT_ARG(interp) \
- , PARROT_ASSERT_ARG(fullname) \
- , PARROT_ASSERT_ARG(error_message))
#define ASSERT_ARGS_check_op __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
PARROT_ASSERT_ARG(interp) \
, PARROT_ASSERT_ARG(op_info) \
, PARROT_ASSERT_ARG(fullname) \
, PARROT_ASSERT_ARG(name) \
, PARROT_ASSERT_ARG(r))
-#define ASSERT_ARGS_imcc_compile __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+#define ASSERT_ARGS_imcc_string_ends_with __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
PARROT_ASSERT_ARG(interp) \
- , PARROT_ASSERT_ARG(s) \
- , PARROT_ASSERT_ARG(error_message))
-#define ASSERT_ARGS_imcc_compile_pasm __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
- PARROT_ASSERT_ARG(interp) \
- , PARROT_ASSERT_ARG(s))
-#define ASSERT_ARGS_imcc_compile_pasm_ex __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
- PARROT_ASSERT_ARG(interp) \
- , PARROT_ASSERT_ARG(s))
-#define ASSERT_ARGS_IMCC_compile_pasm_s __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
- PARROT_ASSERT_ARG(interp) \
- , PARROT_ASSERT_ARG(s) \
- , PARROT_ASSERT_ARG(error_message))
-#define ASSERT_ARGS_imcc_compile_pir __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
- PARROT_ASSERT_ARG(interp) \
- , PARROT_ASSERT_ARG(s))
-#define ASSERT_ARGS_imcc_compile_pir_ex __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
- PARROT_ASSERT_ARG(interp) \
- , PARROT_ASSERT_ARG(s))
-#define ASSERT_ARGS_IMCC_compile_pir_s __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
- PARROT_ASSERT_ARG(interp) \
- , PARROT_ASSERT_ARG(s) \
- , PARROT_ASSERT_ARG(error_message))
-#define ASSERT_ARGS_imcc_destroy __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
- PARROT_ASSERT_ARG(interp))
-#define ASSERT_ARGS_imcc_init __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
- PARROT_ASSERT_ARG(interp))
+ , PARROT_ASSERT_ARG(str) \
+ , PARROT_ASSERT_ARG(ext))
#define ASSERT_ARGS_imcc_vfprintf __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
PARROT_ASSERT_ARG(interp) \
, PARROT_ASSERT_ARG(io) \
@@ -369,8 +382,6 @@ void register_compilers(PARROT_INTERP)
PARROT_ASSERT_ARG(dest) \
, PARROT_ASSERT_ARG(name) \
, PARROT_ASSERT_ARG(args))
-#define ASSERT_ARGS_register_compilers __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
- PARROT_ASSERT_ARG(interp))
/* Don't modify between HEADERIZER BEGIN / HEADERIZER END. Your changes will be lost. */
/* HEADERIZER END: compilers/imcc/parser_util.c */
@@ -458,8 +469,8 @@ struct nodeType_t;
struct parser_state_t {
struct parser_state_t *next;
Interp *interp;
- char *file;
- FILE *handle;
+ STRING *file;
+ PIOHANDLE handle;
int line;
int pasm_file; /* pasm_file mode of this frame */
};
@@ -548,7 +559,6 @@ typedef struct _imc_info_t {
int emitter;
int error_code; /* The Error code. */
int expect_pasm;
- int gc_off;
int imcc_warn;
int in_pod;
int ins_line;
@@ -561,6 +571,7 @@ typedef struct _imc_info_t {
int compiler_state; /* see PBC_* flags */
int verbose;
int write_pbc;
+ int seen_main;
opcode_t npc;
} imc_info_t;
@@ -612,8 +623,8 @@ typedef struct macro_t {
#define UNSET_STATE_RUN_FROM_FILE(i) (COMPILER_STATE(i) &= ~PBC_RUN_FILE)
/* imclexer.c */
-FILE * imc_yyin_set(FILE *new_yyin, void *yyscanner);
-FILE * imc_yyin_get(void *yyscanner);
+void imc_yyin_set(PIOHANDLE new_yyin, void *yyscanner);
+PIOHANDLE imc_yyin_get(void *yyscanner);
#endif /* PARROT_IMCC_IMC_H_GUARD */
View
122 compilers/imcc/imcc.l
@@ -67,7 +67,7 @@ static macro_t *find_macro(PARROT_INTERP, ARGIN(const char *name));
static void scan_string(macro_frame_t *frame, ARGIN(const char *expansion),
ARGMOD(void *yyscanner));
-static void scan_file(PARROT_INTERP, ARGIN(struct macro_frame_t *frame), ARGMOD(FILE *file),
+static void scan_file(PARROT_INTERP, ARGIN(struct macro_frame_t *frame), PIOHANDLE file,
ARGMOD(void *yyscanner));
static int destroy_frame(macro_frame_t *frame, ARGMOD(void *yyscanner));
@@ -79,7 +79,7 @@ static int read_macro(YYSTYPE *valp, PARROT_INTERP, ARGMOD(void *yyscanner));
static int expand_macro(PARROT_INTERP, ARGIN(const char *name), ARGMOD(void *yyscanner));
-static void include_file(PARROT_INTERP, char *file_name, ARGMOD(void *yyscanner));
+static void include_file(PARROT_INTERP, ARGIN(STRING *file_name), ARGMOD(void *yyscanner));
static int handle_identifier(PARROT_INTERP, YYSTYPE *valp, ARGIN(const char *id));
@@ -104,6 +104,9 @@ static int handle_identifier(PARROT_INTERP, YYSTYPE *valp, ARGIN(const char *id)
} \
} while (0)
+#define YY_INPUT(buf, result, max_size) \
+ (result) = PIO_READ((Interp *)yyextra, (PIOHANDLE)yyin, (buf), (max_size))
+
%}
%option reentrant
@@ -179,13 +182,12 @@ SP [ ]
/* Newline in the heredoc. Realloc and cat on. */
IMCC_INFO(interp)->heredoc_content =
(char*)mem_sys_realloc(IMCC_INFO(interp)->heredoc_content,
- strlen(IMCC_INFO(interp)->heredoc_content) +
- strlen(yytext) + 2);
+ strlen(IMCC_INFO(interp)->heredoc_content) + 3);
strcpy(IMCC_INFO(interp)->heredoc_content +
- strlen(IMCC_INFO(interp)->heredoc_content), yytext);
+ strlen(IMCC_INFO(interp)->heredoc_content), "\n");
}
-<heredoc2>.* {
+<heredoc2>([^\r\n]|\r[^\n])* {
SET_LINE_NUMBER;
/* Are we at the end of the heredoc? */
if (STREQ(IMCC_INFO(interp)->heredoc_end, yytext)) {
@@ -223,11 +225,14 @@ SP [ ]
}
<cmt2>[^"]+ {
+ STRING *str;
+
yy_pop_state(yyscanner);
yy_push_state(cmt3, yyscanner);
- IMCC_INFO(interp)->frames->s.file = mem_sys_strdup(yytext);
- IMCC_INFO(interp)->cur_unit->file = mem_sys_strdup(yytext);
+ str = Parrot_str_new(interp, yytext,0);
+ IMCC_INFO(interp)->frames->s.file = str;
+ IMCC_INFO(interp)->cur_unit->file = str;
return FILECOMMENT;
}
@@ -447,14 +452,16 @@ SP [ ]
<emit,INITIAL>".include" {
const int c = yylex(valp, yyscanner, interp);
+ STRING *filename;
if (c != STRINGC)
return c;
/* STRINGCs have a mem_sys_strdup()ed valp->s */
mem_sys_free(valp->s);
YYCHOP();
- include_file(interp, yytext + 1, yyscanner);
+ filename = Parrot_str_new(interp, yytext + 1, 0);
+ include_file(interp, filename, yyscanner);
}
<emit,INITIAL>{ID}"$:" {
@@ -752,12 +759,12 @@ new_frame(PARROT_INTERP) {
tmp->label = ++label;
tmp->s.line = IMCC_INFO(interp)->line;
- tmp->s.handle = NULL;
+ tmp->s.handle = PIO_INVALID_HANDLE;
if (IMCC_INFO(interp)->frames) {
tmp->s.pasm_file = IMCC_INFO(interp)->frames->s.pasm_file;
if (IMCC_INFO(interp)->frames->s.file)
- tmp->s.file = mem_sys_strdup(IMCC_INFO(interp)->frames->s.file);
+ tmp->s.file = IMCC_INFO(interp)->frames->s.file;
}
tmp->s.interp = interp;
@@ -799,7 +806,6 @@ destroy_frame(struct macro_frame_t *frame, void *yyscanner)
} else
ret = frame->s.line;
- mem_sys_free(frame->s.file);
mem_sys_free(frame);
if (buffer != NULL)
@@ -1070,8 +1076,8 @@ define_macro(PARROT_INTERP, ARGIN(const char *name), ARGIN(const params_t *param
m = mem_gc_allocate_zeroed_typed(interp, macro_t);
if (!IMCC_INFO(interp)->macros)
- IMCC_INFO(interp)->macros = parrot_new_cstring_hash(interp);
- parrot_hash_put(interp, IMCC_INFO(interp)->macros,
+ IMCC_INFO(interp)->macros = Parrot_hash_new_cstring_hash(interp);
+ Parrot_hash_put(interp, IMCC_INFO(interp)->macros,
PARROT_const_cast(char *, name), m);
}
@@ -1090,7 +1096,7 @@ find_macro(PARROT_INTERP, const char *name)
if (!IMCC_INFO(interp)->macros)
return NULL;
- return (macro_t *)parrot_hash_get(interp, IMCC_INFO(interp)->macros, name);
+ return (macro_t *)Parrot_hash_get(interp, IMCC_INFO(interp)->macros, name);
}
static int
@@ -1119,12 +1125,7 @@ expand_macro(PARROT_INTERP, ARGIN(const char *name), void *yyscanner)
/* When an error occurs, then report it as being in a macro */
frame->is_macro = 1;
- /* remember macro name for error reporting
- * first free any filename allocated in new_frame() */
- if (frame->s.file)
- mem_sys_free(frame->s.file);
-
- frame->s.file = mem_sys_strdup(name);
+ frame->s.file = Parrot_str_new(interp, name, 0);
/* whitespace can be safely ignored */
do {
@@ -1202,44 +1203,37 @@ expand_macro(PARROT_INTERP, ARGIN(const char *name), void *yyscanner)
}
static void
-include_file(PARROT_INTERP, char *file_name, void *yyscanner)
+include_file(PARROT_INTERP, ARGIN(STRING *file_name), void *yyscanner)
{
yyguts_t * const yyg = (yyguts_t *)yyscanner;
macro_frame_t * const frame = new_frame(interp);
- char *s = Parrot_locate_runtime_file(interp, file_name,
- PARROT_RUNTIME_FT_INCLUDE);
- char *ext;
- FILE *file;
-
- if (!s || !(file = fopen(s, "r"))) {
- if (frame->s.file)
- mem_sys_free(frame->s.file);
+ STRING *s = Parrot_locate_runtime_file_str(interp,
+ file_name, PARROT_RUNTIME_FT_INCLUDE);
+ char *ext;
+ PIOHANDLE file;
+
+ if (STRING_IS_NULL(s)
+ || (file = PIO_OPEN(interp, s, PIO_F_READ)) == PIO_INVALID_HANDLE) {
IMCC_fataly(interp, EXCEPTION_EXTERNAL_ERROR, strerror(errno));
}
- if (frame->s.file)
- mem_sys_free(frame->s.file);
- mem_sys_free(s);
- frame->s.file = mem_sys_strdup(file_name);
- frame->s.handle = file;
- ext = strrchr(file_name, '.');
+ frame->s.file = file_name;
+ frame->s.handle = file;
- if (ext) {
- if (STREQ(ext, ".pasm")) {
- frame->s.pasm_file = 1;
- BEGIN(emit);
- }
- else if (STREQ(ext, ".pir")) {
- frame->s.pasm_file = 0;
- BEGIN(INITIAL);
- }
+ if (imcc_string_ends_with(interp, file_name, ".pasm")) {
+ frame->s.pasm_file = 1;
+ BEGIN(emit);
+ }
+ else if (imcc_string_ends_with(interp, file_name, ".pir")) {
+ frame->s.pasm_file = 0;
+ BEGIN(INITIAL);
}
scan_file(interp, frame, file, yyscanner);
}
static void
-scan_file(PARROT_INTERP, macro_frame_t *frame, FILE *file, void *yyscanner)
+scan_file(PARROT_INTERP, macro_frame_t *frame, PIOHANDLE file, void *yyscanner)
{
yyguts_t * const yyg = (yyguts_t *)yyscanner;
const int oldline = IMCC_INFO(interp)->line;
@@ -1251,7 +1245,7 @@ scan_file(PARROT_INTERP, macro_frame_t *frame, FILE *file, void *yyscanner)
/* let the start of line rule increment this to 1 */
IMCC_INFO(interp)->line = 0;
- yy_switch_to_buffer(yy_create_buffer(file, YY_BUF_SIZE, yyscanner),
+ yy_switch_to_buffer(yy_create_buffer((FILE *)file, YY_BUF_SIZE, yyscanner),
yyscanner);
IMCC_INFO(interp)->line = oldline;
@@ -1274,8 +1268,8 @@ pop_parser_state(PARROT_INTERP, void *yyscanner)
macro_frame_t * const tmp = IMCC_INFO(interp)->frames;
if (tmp) {
int l;
- if (tmp->s.handle)
- fclose(tmp->s.handle);
+ if (tmp->s.handle != PIO_INVALID_HANDLE)
+ PIO_CLOSE(interp, tmp->s.handle);
IMCC_INFO(interp)->frames =
(macro_frame_t *)IMCC_INFO(interp)->frames->s.next;
@@ -1296,15 +1290,15 @@ IMCC_pop_parser_state(PARROT_INTERP, void *yyscanner)
}
void
-compile_file(PARROT_INTERP, FILE *file, void *yyscanner)
+compile_file(PARROT_INTERP, PIOHANDLE file, void *yyscanner)
{
yyguts_t * const yyg = (yyguts_t *)yyscanner;
YY_BUFFER_STATE volatile buffer;
IMCC_INFO(interp)->frames->s.next = NULL;
buffer = YY_CURRENT_BUFFER;
- yy_switch_to_buffer(yy_create_buffer(file, YY_BUF_SIZE, yyscanner),
+ yy_switch_to_buffer(yy_create_buffer((FILE *)file, YY_BUF_SIZE, yyscanner),
yyscanner);
emit_open(interp, 1, NULL);
@@ -1361,19 +1355,19 @@ void
IMCC_print_inc(PARROT_INTERP)
{
macro_frame_t *f;
- const char *old = IMCC_INFO(interp)->frames->s.file;
+ STRING *old = IMCC_INFO(interp)->frames->s.file;
if (IMCC_INFO(interp)->frames && IMCC_INFO(interp)->frames->is_macro)
- fprintf(stderr, "\n\tin macro '.%s' line %d\n",
+ IMCC_warning(interp, "\n\tin macro '.%Ss' line %d\n",
IMCC_INFO(interp)->frames->s.file, IMCC_INFO(interp)->line);
else
- fprintf(stderr, "\n\tin file '%s' line %d\n",
+ IMCC_warning(interp, "\n\tin file '%Ss' line %d\n",
IMCC_INFO(interp)->frames->s.file, IMCC_INFO(interp)->line);
for (f = IMCC_INFO(interp)->frames; f; f = (macro_frame_t *)f->s.next) {
- if (!STREQ(f->s.file, old)) {
- fprintf(stderr, "\tincluded from '%s' line %d\n",
+ if (!STRING_equal(interp, f->s.file, old)) {
+ IMCC_warning(interp, "\tincluded from '%Ss' line %d\n",
f->s.file, f->s.line);
}
@@ -1394,7 +1388,9 @@ parser does not have access to the lexer's private bits.
void
set_filename(PARROT_INTERP, char * const filename)
{
- IMCC_INFO(interp)->frames->s.file = filename;
+ STRING *str = Parrot_str_new(interp, filename, 0);
+
+ IMCC_INFO(interp)->frames->s.file = str;
/* in case .line is used outside a .sub, then this
* can't be done; hence the check.
@@ -1404,23 +1400,21 @@ set_filename(PARROT_INTERP, char * const filename)
* During the parse, the STRINGC is already mem_sys_strdup()ed once.
*/
if (IMCC_INFO(interp)->cur_unit)
- IMCC_INFO(interp)->cur_unit->file = mem_sys_strdup(filename);
+ IMCC_INFO(interp)->cur_unit->file = str;
}
/* Functions to set and get yyin, as we can't decorate it for export
(since it is defined in a file generated by yacc/bison). */
-FILE* imc_yyin_set(FILE* new_yyin, void *yyscanner)
+void imc_yyin_set(PIOHANDLE new_yyin, void *yyscanner)
{
yyguts_t * const yyg = (yyguts_t *)yyscanner;
- yyg->yyin_r = new_yyin;
-
- return yyg->yyin_r;
+ yyg->yyin_r = (FILE *)new_yyin;
}
-FILE* imc_yyin_get(void *yyscanner)
+PIOHANDLE imc_yyin_get(void *yyscanner)
{
const yyguts_t * const yyg = (yyguts_t *)yyscanner;
- return yyg->yyin_r;
+ return (PIOHANDLE)yyg->yyin_r;
}
/* return true if scanner is at EOF */
View
19 compilers/imcc/imcc.y
@@ -927,6 +927,8 @@ add_pcc_named_return(PARROT_INTERP,
=item C<static void adv_named_set(PARROT_INTERP, const char *name)>
+=item C<static void adv_named_set_u(PARROT_INTERP, const char *name)>
+
Sets the name of the current named argument.
C<adv_named_set_u> is the Unicode version of this function.
@@ -1315,8 +1317,8 @@ sub:
{
IMCC_INFO(interp)->cur_call->pcc_sub->pragma = $5;
if (!IMCC_INFO(interp)->cur_unit->instructions->symregs[0]->subid) {
- IMCC_INFO(interp)->cur_unit->instructions->symregs[0]->subid = mem_sys_strdup(
- IMCC_INFO(interp)->cur_unit->instructions->symregs[0]->name);
+ IMCC_INFO(interp)->cur_unit->instructions->symregs[0]->subi