Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge branch 'master' into m0-spec

  • Loading branch information...
commit cb24ece0bd703241f46ae670d5ba3ed289a402ff 2 parents c386e91 + 8b56ba3
Duke Leto leto authored
Showing with 8,751 additions and 8,548 deletions.
  1. +1 −4 .gitignore
  2. +6 −2 CREDITS
  3. +8 −0 ChangeLog
  4. +8 −7 Configure.pl
  5. +29 −23 MANIFEST
  6. +2 −8 MANIFEST.SKIP
  7. +5 −3 MANIFEST.generated
  8. +42 −1 NEWS
  9. +1 −1  PLATFORMS
  10. +1 −1  README
  11. +1 −1  VERSION
  12. +75 −61 api.yaml
  13. +2 −1  compilers/imcc/Defines.mak
  14. +46 −0 compilers/imcc/Rules.in
  15. +210 −0 compilers/imcc/api.c
  16. +148 −124 compilers/imcc/cfg.c
  17. +21 −22 compilers/imcc/cfg.h
  18. +94 −32 compilers/imcc/debug.c
  19. +43 −23 compilers/imcc/debug.h
  20. +49 −48 compilers/imcc/imc.c
  21. +118 −177 compilers/imcc/imc.h
  22. +353 −298 compilers/imcc/imcc.l
  23. +554 −528 compilers/imcc/imcc.y
  24. +503 −449 compilers/imcc/imclexer.c
  25. +878 −850 compilers/imcc/imcparser.c
  26. +1 −1  compilers/imcc/imcparser.h
  27. +31 −157 compilers/imcc/instructions.c
  28. +22 −27 compilers/imcc/instructions.h
  29. +361 −863 compilers/imcc/main.c
  30. +197 −177 compilers/imcc/optimizer.c
  31. +17 −10 compilers/imcc/optimizer.h
  32. +13 −16 compilers/imcc/parser.h
  33. +80 −72 compilers/imcc/parser_util.c
  34. +521 −474 compilers/imcc/pbc.c
  35. +48 −28 compilers/imcc/pbc.h
  36. +113 −260 compilers/imcc/pcc.c
  37. +96 −81 compilers/imcc/reg_alloc.c
  38. +17 −16 compilers/imcc/sets.c
  39. +24 −15 compilers/imcc/sets.h
  40. +186 −174 compilers/imcc/symreg.c
  41. +125 −73 compilers/imcc/symreg.h
  42. +1 −2  compilers/opsc/Defines.mak
  43. +0 −3  compilers/opsc/Rules.mak
  44. +0 −2  compilers/opsc/opsc.pir
  45. +3 −4 compilers/opsc/src/Ops/OpLib.pm
  46. +0 −107 compilers/opsc/src/Ops/Renumberer.pm
  47. +7 −6 compilers/opsc/src/Ops/Trans/C.pm
  48. +0 −12 compilers/pct/src/PAST/Compiler.pir
  49. +0 −107 config/auto/frames.pm
  50. +0 −75 config/auto/frames/test_exec_cygwin_c.in
  51. +0 −70 config/auto/frames/test_exec_linux_c.in
  52. +0 −70 config/auto/frames/test_exec_openbsd_c.in
  53. +2 −6 config/auto/gc.pm
  54. +0 −64 config/auto/git_describe.pm
  55. +1 −1  config/auto/icu.pm
  56. +3 −2 config/auto/ipv6/test.in
  57. +10 −9 config/auto/llvm.pm
  58. +3 −0  config/auto/opengl.pm
  59. +1 −0  config/auto/platform.pm
  60. +2 −0  config/auto/pmc.pm
  61. +0 −67 config/auto/sha1.pm
  62. +2 −0  config/auto/warnings.pm
  63. +3 −3 config/gen/config_h/config_h.in
  64. +4 −0 config/gen/config_pm.pm
  65. +1 −0  config/gen/config_pm/config_lib_pir.in
  66. +53 −103 config/gen/makefiles/root.in
  67. +111 −103 config/gen/opengl.pm
  68. +3 −2 config/init/defaults.pm
  69. +4 −6 config/init/hints/darwin.pm
  70. +2 −1  config/init/hints/mswin32.pm
  71. +3 −3 docs/book/pir/ch03_basic_syntax.pod
  72. +2 −2 docs/book/pir/ch04_variables.pod
  73. +9 −6 docs/book/pir/ch09_exceptions.pod
  74. +10 −8 docs/compiler_faq.pod
  75. +231 −0 docs/deprecations/deprecations.pod
  76. +73 −0 docs/deprecations/deprecations_2_6.pod
  77. +200 −0 docs/deprecations/deprecations_2_9.pod
  78. +222 −0 docs/deprecations/deprecations_3_0.pod
  79. +28 −0 docs/deprecations/deprecations_3_3.pod
  80. +59 −0 docs/deprecations/deprecations_3_6.pod
  81. +135 −0 docs/deprecations/how_to_deprecate.pod
  82. +6 −6 docs/imcc/operation.pod
  83. +13 −0 docs/index/developer.json
  84. +3 −0  docs/parrothist.pod
  85. +6 −6 docs/pdds/pdd19_pir.pod
  86. +11 −11 docs/pdds/pdd20_lexical_vars.pod
  87. +4 −4 docs/pdds/pdd22_io.pod
  88. +1 −1  docs/project/git_workflow.pod
  89. +33 −1 docs/project/hacking_tips.pod
  90. +19 −7 docs/project/release_manager_guide.pod
  91. +6 −2 docs/project/support_policy.pod
  92. +5 −2 docs/submissions.pod
  93. +176 −176 docs/translations/README.BGR
  94. +1 −1  docs/translations/README.deutsch
  95. +2 −2 examples/library/ncurses_life.pir
  96. +222 −32 frontend/parrot/main.c
  97. +4 −5 frontend/parrot_debugger/main.c
  98. +8 −5 frontend/pbc_dump/main.c
  99. +4 −6 frontend/pbc_merge/main.c
  100. +64 −0 include/imcc/api.h
  101. +135 −0 include/imcc/embed.h
  102. +21 −0 include/imcc/yyscanner.h
  103. +88 −91 include/parrot/api.h
  104. +17 −13 include/parrot/call.h
  105. +7 −3 include/parrot/compiler.h
  106. +84 −42 include/parrot/context.h
  107. +2 −0  include/parrot/core_types.h
  108. +13 −8 include/parrot/datatypes.h
  109. +3 −3 include/parrot/debugger.h
  110. +13 −9 include/parrot/encoding.h
  111. +1 −1  include/parrot/exceptions.h
  112. +0 −8 include/parrot/exit.h
  113. +5 −3 include/parrot/extend.h
  114. +3 −1 include/parrot/gc_api.h
  115. +2 −3 include/parrot/global_setup.h
  116. +7 −5 include/parrot/hash.h
  117. +12 −15 include/parrot/hll.h
  118. +21 −40 include/parrot/interpreter.h
  119. +65 −48 include/parrot/io.h
  120. +1 −1  include/parrot/key.h
  121. +7 −7 include/parrot/list.h
  122. +1 −0  include/parrot/longopt.h
  123. +3 −23 include/parrot/misc.h
  124. +15 −13 include/parrot/namespace.h
  125. +9 −30 include/parrot/nci.h
  126. +7 −7 include/parrot/oo.h
  127. +1 −1  include/parrot/oplib/core_ops.h
  128. +53 −48 include/parrot/packfile.h
  129. +7 −0 include/parrot/platform_interface.h
  130. +9 −7 include/parrot/pmc.h
  131. +2 −1  include/parrot/pmc_freeze.h
  132. +7 −3 include/parrot/pobj.h
  133. +1 −1  include/parrot/runcore_api.h
  134. +5 −3 include/parrot/scheduler.h
  135. +8 −4 include/parrot/string.h
  136. +15 −14 include/parrot/string_funcs.h
  137. +4 −4 include/parrot/thread.h
  138. +1 −1  include/parrot/vtables.h
  139. +2 −4 lib/Parrot/Configure/Options/Conf.pm
  140. +1 −2  lib/Parrot/Configure/Options/Conf/Shared.pm
  141. +0 −3  lib/Parrot/Configure/Step/List.pm
  142. +3 −42 lib/Parrot/Git/Describe.pm
  143. +3 −4 lib/Parrot/Headerizer.pm
  144. +23 −48 lib/Parrot/Headerizer/Functions.pm
  145. +0 −1  lib/Parrot/Manifest.pm
  146. +1 −1  lib/Parrot/Pmc2c/Emitter.pm
  147. +2 −2 lib/Parrot/Pmc2c/MULTI.pm
  148. +1 −2  lib/Parrot/Pmc2c/Method.pm
  149. +7 −9 lib/Parrot/Pmc2c/PMC.pm
  150. +4 −2 lib/Parrot/Pmc2c/PMC/default.pm
  151. +2 −0  lib/Parrot/Pmc2c/Parser.pm
  152. +1 −2  lib/Parrot/Pmc2c/Pmc2cMain.pm
  153. +3 −41 lib/Parrot/SHA1.pm
  154. +3 −103 lib/Parrot/Test.pm
  155. +19 −6 lib/Parrot/Vtable.pm
  156. +0 −5 ports/debian/README.source
  157. +35 −0 ports/debian/changelog
  158. +5 −5 ports/debian/control
  159. +3 −3 ports/debian/control.in
  160. +251 −232 ports/debian/copyright
  161. +0 −1  ports/debian/parrot-devel.install.in
  162. +1 −1  ports/debian/parrot.docs
  163. +1 −0  ports/debian/patches/03_fix_nqp_man.patch
  164. +0 −50 ports/debian/patches/04_fix_opsc_man.patch
  165. +0 −13 ports/debian/patches/05_fix_gc_ftbfs_ia64.patch
  166. +0 −2  ports/debian/patches/series
  167. +4 −6 ports/debian/rules
  168. +1 −0  ports/debian/source/format
  169. 0  ports/fedora/{2.11.0 → 3.3.0}/parrot.desk.in.tar.gz
  170. +31 −13 ports/fedora/{2.11.0 → 3.3.0}/parrot.spec
  171. +2 −2 runtime/parrot/library/Archive/Tar.pir
  172. +2 −2 runtime/parrot/library/Archive/Zip.pir
  173. +2 −2 runtime/parrot/library/HTTP/Message.pir
  174. +2 −2 runtime/parrot/library/LWP/Protocol.pir
  175. +3 −3 runtime/parrot/library/LWP/UserAgent.pir
  176. +329 −34 runtime/parrot/library/NCI/Utils.pir
  177. +64 −7 runtime/parrot/library/OpenGL.pir
  178. +0 −2  runtime/parrot/library/PGE/Dumper.pir
  179. +1 −1  runtime/parrot/library/Stream/Sub.pir
  180. +2 −2 runtime/parrot/library/Stream/Writer.pir
  181. +3 −3 runtime/parrot/library/TAP/Harness.pir
  182. +2 −2 runtime/parrot/library/TAP/Parser.pir
  183. +5 −6 runtime/parrot/library/distutils.pir
  184. +31 −25 runtime/parrot/library/libpcre.pir
  185. +0 −659 runtime/parrot/library/ncurses.pasm
  186. +5 −10 runtime/parrot/library/osutils.pir
  187. +34 −4 runtime/parrot/library/pcre.pir
  188. +0 −197 runtime/parrot/library/postgres.pasm
  189. +304 −195 runtime/parrot/library/postgres.pir
  190. +7 −36 runtime/parrot/library/uuid.pir
  191. +63 −69 src/call/args.c
  192. +2 −2 src/call/context.c
Sorry, we could not display the entire diff because too many files (398) changed.
5 .gitignore
View
@@ -251,6 +251,7 @@
/runtime/parrot/include/*.fpmc
/runtime/parrot/include/*.pasm
/runtime/parrot/include/*.pbc
+/runtime/parrot/include/*.pir
/runtime/parrot/languages/JSON/JSON.pir
/runtime/parrot/languages/data_json
/runtime/parrot/library/*.pbc
@@ -386,10 +387,6 @@
/t/compilers/data_json/*.pir
/t/compilers/data_json/*_pbcexe
/t/compilers/imcc/*.pbc
-/t/compilers/imcc/imcpasm/*.pasm
-/t/compilers/imcc/imcpasm/*.pbc
-/t/compilers/imcc/imcpasm/*.pir
-/t/compilers/imcc/imcpasm/*_pbcexe
/t/compilers/imcc/reg/*.pasm
/t/compilers/imcc/reg/*.pbc
/t/compilers/imcc/reg/*.pir
8 CREDITS
View
@@ -100,7 +100,7 @@ E: yDNA@cpan.org
N: Andrew Whitworth
D: Internals development
D: Documentation
-D: Release manager for 0.8.2, 1.3.0, 1.5.0, 2.4.0 and 2.11.0
+D: Release manager for 0.8.2, 1.3.0, 1.5.0, 2.4.0, 2.11.0 and 3.3.0
E: wknight8111@gmail.com
U: Whiteknight
@@ -434,7 +434,7 @@ D: Miscellaneous codingstd fixes
N: Gerd Pokorra
A: gerd
E: pokorra@uni-siegen.de
-D: Release manager for 1.9.0, 2.3.0, 2.5.0, 2.8.0, 2.9.0 and 3.2.0
+D: Release manager for 1.9.0, 2.3.0, 2.5.0, 2.8.0, 2.9.0, 3.2.0 and 3.4.0
N: Goplat
D: Win98 and other fixes.
@@ -719,6 +719,10 @@ N: Markus Mayr
D: Implementation of the Rational PMC
D: Fixing SDL-bindings and examples
+N: Matt Boyle
+U: ligne
+D: Fixes to docs and test-suite.
+
N: Matt Diephouse
U: mdiep
E: matt@diephouse.com
8 ChangeLog
View
@@ -1,5 +1,13 @@
#1
+2011.05.17 Gerd
+ * Released 3.4.0
+ See NEWS for more.
+
+2011.04.19 Whiteknight
+ * Released 3.3.0
+ See NEWS for more.
+
2011.03.15 Gerd
* Released 3.2.0
See NEWS for more.
15 Configure.pl
View
@@ -66,8 +66,9 @@
# from Parrot::Configure::Data
$conf->options->set( %{$args} );
# save the command-line for make reconfig
-$conf->data->set(configure_args => @ARGV ? '"'.join("\" \"", map {qq($_)} @ARGV).'"'
- : '');
+$conf->data->set(configure_args => @ARGV
+ ? '"'.join("\" \"", map {qq($_)} @ARGV).'"'
+ : '');
# Log files created by Configure.pl in MANIFEST.configure.generated
$conf->{active_configuration} = 1;
@@ -358,10 +359,6 @@ =head2 Parrot Options
Use the given ops files.
-=item C<--buildframes>
-
-Dynamically build NCI call frames.
-
=back
=head2 International Components For Unicode (ICU) Options
@@ -407,6 +404,11 @@ =head2 Other Options
Use this option if you want imcc's parser and lexer files to be generated.
Needs a working parser and lexer.
+=item C<--with-llvm>
+
+Use this option if you have a recent version of LLVM installed and wish Parrot
+to link to it.
+
=back
=head1 CONFIGURATION-FILE INTERFACE
@@ -618,7 +620,6 @@ =head2 Example
auto::isreg
auto::arch
auto::jit
- auto::frames
auto::cpu
auto::inline
auto::gc
52 MANIFEST
View
@@ -35,6 +35,7 @@ compilers/data_json/data_json/grammar.pg [data_json]
compilers/data_json/data_json/pge2pir.tg [data_json]
compilers/imcc/Defines.mak [imcc]
compilers/imcc/Rules.in [imcc]
+compilers/imcc/api.c [imcc]
compilers/imcc/cfg.c [imcc]
compilers/imcc/cfg.h [imcc]
compilers/imcc/debug.c [imcc]
@@ -77,7 +78,6 @@ compilers/opsc/src/Ops/Emitter.pm [opsc]
compilers/opsc/src/Ops/File.pm [opsc]
compilers/opsc/src/Ops/Op.pm [opsc]
compilers/opsc/src/Ops/OpLib.pm [opsc]
-compilers/opsc/src/Ops/Renumberer.pm [opsc]
compilers/opsc/src/Ops/Trans.pm [opsc]
compilers/opsc/src/Ops/Trans/C.pm [opsc]
compilers/opsc/src/builtins.pir [opsc]
@@ -139,17 +139,12 @@ config/auto/env.pm []
config/auto/env/test_setenv_c.in []
config/auto/env/test_unsetenv_c.in []
config/auto/format.pm []
-config/auto/frames.pm []
-config/auto/frames/test_exec_cygwin_c.in []
-config/auto/frames/test_exec_linux_c.in []
-config/auto/frames/test_exec_openbsd_c.in []
config/auto/gc.pm []
config/auto/gc/test_c.in []
config/auto/gcc.pm []
config/auto/gcc/test_c.in []
config/auto/gettext.pm []
config/auto/gettext/gettext_c.in []
-config/auto/git_describe.pm []
config/auto/glibc.pm []
config/auto/glibc/test_c.in []
config/auto/gmp.pm []
@@ -189,7 +184,6 @@ config/auto/pod2man.pm []
config/auto/readline.pm []
config/auto/readline/readline_c.in []
config/auto/revision.pm []
-config/auto/sha1.pm []
config/auto/signal.pm []
config/auto/signal/test1_c.in []
config/auto/signal/test2_c.in []
@@ -292,6 +286,13 @@ docs/compiler_faq.pod [doc]
docs/configuration.pod [doc]
docs/debug.pod [doc]
docs/debugger.pod [doc]
+docs/deprecations/deprecations.pod [doc]
+docs/deprecations/deprecations_2_6.pod [doc]
+docs/deprecations/deprecations_2_9.pod [doc]
+docs/deprecations/deprecations_3_0.pod [doc]
+docs/deprecations/deprecations_3_3.pod [doc]
+docs/deprecations/deprecations_3_6.pod [doc]
+docs/deprecations/how_to_deprecate.pod [doc]
docs/dev/byteorder.pod [doc]
docs/dev/c_functions.pod [doc]
docs/dev/coverage.pod [doc]
@@ -866,6 +867,9 @@ frontend/parrot_debugger/main.c []
frontend/pbc_dump/main.c []
frontend/pbc_dump/packdump.c []
frontend/pbc_merge/main.c []
+include/imcc/api.h [main]include
+include/imcc/embed.h [main]include
+include/imcc/yyscanner.h [main]include
include/parrot/api.h [main]include
include/parrot/atomic.h [main]include
include/parrot/atomic/fallback.h [main]include
@@ -1156,7 +1160,6 @@ runtime/parrot/library/distutils.pir [library]
runtime/parrot/library/dumper.pir [library]
runtime/parrot/library/libpcre.pir [library]
runtime/parrot/library/ncurses.declarations [library]
-runtime/parrot/library/ncurses.pasm [library]
runtime/parrot/library/ncurses.pir [library]
runtime/parrot/library/openssl.declarations [library]
runtime/parrot/library/osutils.pir [library]
@@ -1164,7 +1167,6 @@ runtime/parrot/library/parrotlib.pir [library]
runtime/parrot/library/pcore.pir [library]
runtime/parrot/library/pcre.pir [library]
runtime/parrot/library/postgres.declarations [library]
-runtime/parrot/library/postgres.pasm [library]
runtime/parrot/library/postgres.pir [library]
runtime/parrot/library/random_lib.pir [library]
runtime/parrot/library/uuid.pir [library]
@@ -1206,6 +1208,7 @@ src/dynpmc/rotest.pmc []
src/dynpmc/subproxy.pmc []
src/embed.c []
src/embed/api.c []
+src/embed/bytecode.c []
src/embed/embed_private.h []
src/embed/pmc.c []
src/embed/strings.c []
@@ -1288,6 +1291,7 @@ src/platform/darwin/hires_timer.c []
src/platform/darwin/sysmem.c []
src/platform/generic/dl.c []
src/platform/generic/encoding.c []
+src/platform/generic/entropy.c []
src/platform/generic/env.c []
src/platform/generic/error.c []
src/platform/generic/exec.c []
@@ -1308,6 +1312,7 @@ src/platform/openbsd/math.c []
src/platform/solaris/math.c []
src/platform/solaris/time.c []
src/platform/win32/dl.c []
+src/platform/win32/entropy.c []
src/platform/win32/env.c []
src/platform/win32/error.c []
src/platform/win32/exec.c []
@@ -1353,6 +1358,7 @@ src/pmc/imageiofreeze.pmc []
src/pmc/imageiosize.pmc []
src/pmc/imageiostrings.pmc []
src/pmc/imageiothaw.pmc []
+src/pmc/imccompiler.pmc []
src/pmc/integer.pmc []
src/pmc/iterator.pmc []
src/pmc/key.pmc []
@@ -1478,12 +1484,6 @@ t/codingstd/tabs.t [test]
t/codingstd/trailing_space.t [test]
t/compilers/data_json/from_parrot.t [test]
t/compilers/data_json/to_parrot.t [test]
-t/compilers/imcc/imcpasm/cfg.t [test]
-t/compilers/imcc/imcpasm/opt0.t [test]
-t/compilers/imcc/imcpasm/opt1.t [test]
-t/compilers/imcc/imcpasm/opt2.t [test]
-t/compilers/imcc/imcpasm/optc.t [test]
-t/compilers/imcc/imcpasm/pcc.t [test]
t/compilers/imcc/reg/alloc.t [test]
t/compilers/imcc/reg/spill.t [test]
t/compilers/imcc/reg/spill_old.t [test]
@@ -1603,10 +1603,8 @@ t/configure/050-fatal.t [test]
t/configure/051-fatal_step.t [test]
t/configure/059-silent.t [test]
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/062-sha1.t [test]
+t/configure/063-git_describe.t [test]
t/configure/testlib/Make_VERSION_File.pm [test]
t/configure/testlib/Tie/Filehandle/Preempt/Stdin.pm [test]
t/configure/testlib/adefectivefoobar [test]
@@ -1644,7 +1642,16 @@ t/dynoplibs/trans-old.t [test]
t/dynoplibs/trans.t [test]
t/dynpmc/dynlexpad.t [test]
t/dynpmc/file.t [test]
-t/dynpmc/foo.t [test]
+t/dynpmc/foo-01.t [test]
+t/dynpmc/foo-02.t [test]
+t/dynpmc/foo-03.t [test]
+t/dynpmc/foo-04.t [test]
+t/dynpmc/foo-05.t [test]
+t/dynpmc/foo-06.t [test]
+t/dynpmc/foo-07.t [test]
+t/dynpmc/foo-08.t [test]
+t/dynpmc/foo-09.t [test]
+t/dynpmc/foo-10.t [test]
t/dynpmc/foo2.t [test]
t/dynpmc/gziphandle.t [test]
t/dynpmc/os.t [test]
@@ -1682,6 +1689,7 @@ t/library/iter.t [test]
t/library/lwp.t [test]
t/library/md5.t [test]
t/library/mime_base64.t [test]
+t/library/nciutils.t [test]
t/library/osutils.t [test]
t/library/p6object.t [test]
t/library/parrotlib.t [test]
@@ -1970,7 +1978,6 @@ t/steps/auto/cpu-01.t [test]
t/steps/auto/ctags-01.t [test]
t/steps/auto/env-01.t [test]
t/steps/auto/format-01.t [test]
-t/steps/auto/frames-01.t [test]
t/steps/auto/gc-01.t [test]
t/steps/auto/gcc-01.t [test]
t/steps/auto/gettext-01.t [test]
@@ -2078,13 +2085,11 @@ t/tools/install/testlib/phony [test]
t/tools/install/testlib/phony.exe [test]
t/tools/install/testlib/runtime/parrot/include/sockets.pasm [test]
t/tools/install/testlib/runtime/parrot/library/TGE.pbc [test]
-t/tools/install/testlib/src/ops/ops.num [test]
t/tools/install/testlib/src/pmc/pmc_object.h [test]
t/tools/install/testlib/tools/build/ops2c.pl [test]
t/tools/install/testlib/vtable.dump [test]
t/tools/mk_language_shell.t [test]
t/tools/parrot_config.t [test]
-t/tools/parrot_debugger.t [test]
t/tools/pbc_disassemble.t [test]
t/tools/pbc_dump.t [test]
t/tools/pbc_merge.t [test]
@@ -2099,6 +2104,7 @@ t/tools/testdata [test]
tools/build/README []doc
tools/build/c2str.pl []
tools/build/fixup_gen_file.pl []
+tools/build/gen_version.pl []
tools/build/h2inc.pl []
tools/build/ops2c.pl [devel]
tools/build/parrot_config_c.pl []
10 MANIFEST.SKIP
View
@@ -512,6 +512,8 @@
^/runtime/parrot/include/.*\.pasm/
^/runtime/parrot/include/.*\.pbc$
^/runtime/parrot/include/.*\.pbc/
+^/runtime/parrot/include/.*\.pir$
+^/runtime/parrot/include/.*\.pir/
^/runtime/parrot/languages/JSON/JSON\.pir$
^/runtime/parrot/languages/JSON/JSON\.pir/
^/runtime/parrot/languages/data_json$
@@ -866,14 +868,6 @@
^/t/compilers/data_json/.*_pbcexe/
^/t/compilers/imcc/.*\.pbc$
^/t/compilers/imcc/.*\.pbc/
-^/t/compilers/imcc/imcpasm/.*\.pasm$
-^/t/compilers/imcc/imcpasm/.*\.pasm/
-^/t/compilers/imcc/imcpasm/.*\.pbc$
-^/t/compilers/imcc/imcpasm/.*\.pbc/
-^/t/compilers/imcc/imcpasm/.*\.pir$
-^/t/compilers/imcc/imcpasm/.*\.pir/
-^/t/compilers/imcc/imcpasm/.*_pbcexe$
-^/t/compilers/imcc/imcpasm/.*_pbcexe/
^/t/compilers/imcc/reg/.*\.pasm$
^/t/compilers/imcc/reg/.*\.pasm/
^/t/compilers/imcc/reg/.*\.pbc$
8 MANIFEST.generated
View
@@ -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.3.2.0.dylib [main]lib
+blib/lib/libparrot.3.4.0.dylib [main]lib
blib/lib/libparrot.a [main]lib
blib/lib/libparrot.dylib [main]lib
blib/lib/libparrot.so [main]lib
-blib/lib/libparrot.so.3.2.0 [main]lib
+blib/lib/libparrot.so.3.4.0 [main]lib
compilers/data_json/data_json.pbc [data_json]
config/gen/call_list/opengl.in []
docs/ops/bit.pod [doc]
@@ -70,6 +70,7 @@ include/pmc/pmc_imageiofreeze.h [devel]include
include/pmc/pmc_imageiosize.h [devel]include
include/pmc/pmc_imageiostrings.h [devel]include
include/pmc/pmc_imageiothaw.h [devel]include
+include/pmc/pmc_imccompiler.h [devel]include
include/pmc/pmc_integer.h [devel]include
include/pmc/pmc_iterator.h [devel]include
include/pmc/pmc_key.h [devel]include
@@ -233,6 +234,7 @@ runtime/parrot/include/iterator.pasm [main]
runtime/parrot/include/libpaths.pasm [main]
runtime/parrot/include/longopt.pasm [main]
runtime/parrot/include/opengl_defines.pasm [main]
+runtime/parrot/include/parrot_version.pir [main]
runtime/parrot/include/parrotlib.pbc [main]
runtime/parrot/include/pmctypes.pasm [main]
runtime/parrot/include/signal.pasm [main]
@@ -376,6 +378,7 @@ src/pmc/imageiofreeze.dump [devel]src
src/pmc/imageiosize.dump [devel]src
src/pmc/imageiostrings.dump [devel]src
src/pmc/imageiothaw.dump [devel]src
+src/pmc/imccompiler.dump [devel]src
src/pmc/integer.dump [devel]src
src/pmc/iterator.dump [devel]src
src/pmc/key.dump [devel]src
@@ -439,5 +442,4 @@ src/pmc/unmanagedstruct.dump [devel]src
src/string_private_cstring.h []
tools/build/dynpmc.pl []
tools/dev/mk_language_shell.pl [devel]
-tools/dev/ncidef2pir.pl [devel]
vtable.dump [devel]src
43 NEWS
View
@@ -1,6 +1,47 @@
+New in 3.5.0
+- Core
+- Languages
+- Tests
+ + The Parrot test suite harness now understands the HARNESS_TIMER environment
+ variable. Setting it to a true value will show timing results for a test run.
+ + IPv6 tests are now parallel testing friendly
+
+New in 3.4.0
+- Core
+ + The Generational Mark and Sweep garbage collector is the new default.
+ + The --gc-nursery-size command line argument was added.
+ + Parrot now gets entropy from the underlying OS.
+ + The NCI subsystem now supports 8, 16, 32 and 64 bit integers.
+ + The NCI subsystem now supports "long long" and "long double" signatures.
+ Not all platforms/compilers support these non-standard types, so developers
+ are cautioned to take note that using them reduces portability.
+ + Many more OpenGL functions in the Parrot OpenGL bindings are available,
+ which required the above-mentioned signatures.
+ + Bytecode-related embedding api functions moved to src/embed/bytecode.c.
+- Languages
+ + Winxed
+ - Use 'using extern' for module imports.
+ - Improved stage 0 prefix ++ and -- operators.
+ - Allow 'null' in conditional operator.
+ - Several examples are updated.
+- Community
+ + Google Summer of Code Bonding period is going well. Students are mostly done
+ with their classes and much code will flow soon.
+- Documentation
+ + More PCT introductions are available at: http://github.com/benabik/cish
+
New in 3.3.0
- Core
- + The isa and isa_pmc vtables can be overridden from PIR
+ + The isa and isa_pmc vtables can now be overridden from PIR
+ + IMCC has a new improved external interface
+ + A new IMCCompiler PMC adds prototype PDD31-alike functionality for the PIR and PASM compilers
+ + New --with-llvm option to Configure.pl, which will link to LLVM if it is available
+- Community
+ + Parrot Virtual Machine was accepted into Google Summer of Code 2011
+- Ecosystem
+ + Rosella adds a stable "Event" library to implement a publish/subscribe mechanism
+- Tests
+ + The test coverage of the extend_vtable subsystem was greatly increased
New in 3.2.0
- Core
2  PLATFORMS
View
@@ -54,7 +54,7 @@ netbsd4.0-arm-gcc-4.1.2 Y ? Y Y Y Y ? 20090518
netbsd4.0-i386-gcc-4.1.2 Y ? Y Y Y Y ? 20090517
netbsd4.0-ppc-gcc-4.1.2 B Y ? Y Y Y Y ? 20090519
netbsd4.0-sparc64-gcc-4.1.2 B8 Y - Y Y Y Y ? 20090519
-netbsd4.0-x86_64-gcc-4.1.2 8 Y ? Y Y Y Y ? 20090519
+netbsd4.0-x86_64-gcc-4.1.2 8 Y ? Y Y Y Y ? 20110418
netbsd5.0-i386-gcc-4.1.3 Y ? Y Y Y Y ? 20090519
netbsd5.0-ppc-gcc-4.1.3 B Y ? Y Y Y Y ? 20090517
netbsd5.0-mipseb32-gcc-4.1.3 B Y ? Y Y Y Y ? 20090518
2  README
View
@@ -1,4 +1,4 @@
-This is Parrot, version 3.2.0
+This is Parrot, version 3.4.0
------------------------------
Parrot is Copyright (C) 2001-2011, Parrot Foundation.
2  VERSION
View
@@ -1 +1 @@
-3.2.0
+3.4.0
136 api.yaml
View
@@ -1,5 +1,12 @@
---
-
+ name: '"Advanced" NCI parameter types'
+ eligible: '3.1'
+ ticket: 'http://trac.parrot.org/parrot/ticket/1931'
+ tags:
+ - 'deprecated'
+ - 'completed'
+-
name: 'Pointer, UnManagedStruct, and ManagedStruct'
eligible: '3.4'
ticket: 'http://trac.parrot.org/parrot/ticket/2035'
@@ -7,7 +14,7 @@
name: 'add write barrier to all PMCs that write in unusual VTABLE functions'
eligible: '3.4'
note: 'VTABLE functions not marked with :write that mutate the PMCs need to use the write barrier. See ticket for more information.'
- tags:
+ tags:
- 'C'
- 'deprecated'
ticket: 'http://trac.parrot.org/parrot/ticket/2010'
@@ -15,7 +22,7 @@
name: '":init" Sub flag'
eligible: '3.4'
note: 'At this point, ":init" is a no-op, and will therefore be removed.'
- tags:
+ tags:
- 'PIR'
- 'syntax'
- 'deprecated'
@@ -27,7 +34,7 @@
name: '":load" and ":init" Sub flags doing different things'
eligible: '3.1'
note: 'Currently, ":init" and ":load" flagged Subs get called depending on the way a PIR file has been loaded. This distinction is silly and will cease to be. The ":load" flag will be triggered both for scenarios. ":init" becomes a no-op for a deprecation cycle (see below).'
- tags:
+ tags:
- 'deprecated'
- 'PIR'
- 'syntax'
@@ -36,7 +43,7 @@
name: ':main Sub behaviour and selection.'
eligible: '2.7'
note: 'Currently, if no :main sub is found, the first .sub in a file is used as main. Also, arguments are passed to the main sub regardless of the .param declarations in that sub. After this change, if no sub is marked with :main, an exception will be raised. Multiple :main declarations will be still be allowed, and all but the first will be ignored. This change will also force all subs, including :main, to have their arguments checked - to allow an arbitrary number of arguments, have this be the only .param declaration in the sub.'
- tags:
+ tags:
- 'deprecated'
- 'PIR'
- 'syntax'
@@ -44,27 +51,27 @@
-
name: 'Action methods in rules'
note: 'Per Synopsis 5, all regexes will have an implied {*} token at the end which cause invocation of an action method if a ":action" object is supplied.'
- tags:
+ tags:
- 'deprecated'
- 'compiler'
- 'completed'
ticket: 'https://trac.parrot.org/parrot/ticket/843'
-
name: 'Archive::Tar & Archive::Zip'
- tags:
+ tags:
- 'library'
- 'experimental'
ticket: 'https://trac.parrot.org/parrot/ticket/1598'
-
name: 'Assigning to registers in parrot_debugger'
- tags:
+ tags:
- 'debugger'
- 'experimental'
-
name: 'Auto-vivification of nested aggregates'
eligible: '2.4'
note: 'E.g. will not auto-vivify nested hashes and return PMCNULL early.'
- tags:
+ tags:
- 'deprecated'
- 'PMC'
- 'completed'
@@ -73,7 +80,7 @@
name: 'C API coding standards cleanup'
eligible: '1.1'
note: 'All C API functions that aren''t currently named according to the ''Parrot_<system>_*'' scheme will be renamed. A list of renamed functions will be kept in the ticket at:'
- tags:
+ tags:
- 'deprecated'
- 'functions'
ticket: 'https://trac.parrot.org/parrot/ticket/443'
@@ -81,7 +88,7 @@
name: 'Complex PMC'
eligible: '3.1'
note: 'This perennially broken PMC will be removed.'
- tags:
+ tags:
- 'deprecated'
- 'PMC'
detection:
@@ -90,7 +97,7 @@
ticket: 'https://trac.parrot.org/parrot/ticket/1892'
-
name: 'Cross-HLL library loading'
- tags:
+ tags:
- 'library'
- 'experimental'
ticket: 'https://trac.parrot.org/parrot/ticket/754'
@@ -98,33 +105,33 @@
name: 'GC timely destruction'
eligible: '3.1'
note: 'All PIR ops and internal semantics related to timely destruction of PMCs is deprecated.'
- tags:
+ tags:
- 'deprecated'
- 'functions'
ticket: 'https://trac.parrot.org/parrot/ticket/1800'
-
name: 'GC_SYS_NAME option to interpinfo_s_i'
note: 'Ability to get the string name of the current GC core from the interpinfo_s_i. See r43900 and r43904 for details.'
- tags:
+ tags:
- 'Opcodes'
- 'experimental'
ticket: 'https://trac.parrot.org/parrot/ticket/1581'
-
name: 'IPv6 Support'
- tags:
+ tags:
- 'experimental'
- ticket:
+ ticket:
note: 'IPv6 support is still being perfected and being made portable'
-
name: 'JSON and Config;JSON'
eligible: '1.5'
- tags:
+ tags:
- 'deprecated'
- 'library'
ticket: 'https://trac.parrot.org/parrot/ticket/508'
-
name: 'LWP, https::Message, URI & URI::Escape'
- tags:
+ tags:
- 'library'
- 'experimental'
ticket: 'https://trac.parrot.org/parrot/ticket/1637'
@@ -132,13 +139,13 @@
name: 'ManagedStruct reallocations based on shape changes'
eligible: '2.4'
note: 'Since shape changes may simply be used for re-interpreting data, and may also occur in several steps, re-allocating after any one shape change may be undesirable. In stead, an explicit allocate/reallocate method will be provided.'
- tags:
+ tags:
- 'deprecated'
- 'PMC'
ticket: 'https://trac.parrot.org/parrot/ticket/1554'
-
name: 'MappedByteArray PMC'
- tags:
+ tags:
- 'PMC'
- 'experimental'
ticket: 'https://trac.parrot.org/parrot/ticket/1877'
@@ -146,14 +153,14 @@
name: 'Meta-model implementation used by PCT'
eligible: '2.7'
note: 'PCT is set to switch to a new meta-model implementation for its classes and objects. This will most likely only affect those who rely on the interface of what is returned from .HOW, or rely on PCT objects exhibiting various other peculiarities of the P6object implementation. (Even when that is the case, the HOW API will not be changing too drastically, so for most PCT users there should be little to no upheavel.)'
- ticket:
- tags:
+ ticket:
+ tags:
- 'deprecated'
- 'compiler'
-
name: 'Method unescape on String'
note: 'This is a helper method for testing of Parrot_str_unescape_string.'
- tags:
+ tags:
- 'PMC'
- 'experimental'
- 'completed'
@@ -161,20 +168,20 @@
-
name: 'NCI_FB_CB and NCI_FB_UD in iglobals'
note: 'Hooks allowing a runtime-loadable dynamic frame builder.'
- tags:
+ tags:
- 'opcodes'
- 'experimental'
ticket: 'https://trac.parrot.org/parrot/ticket/1582'
-
name: 'OpenGL bindings and libraries'
- tags:
+ tags:
- 'library'
- 'experimental'
ticket: 'https://trac.parrot.org/parrot/ticket/852'
-
name: 'Overriding vtable invoke in PIR objects'
note: 'The VTABLE invoke in object.pmc puts SELF at the start of the signature call arguments when there is no current object and is not already here. This allows the usage of $P0() instead of $P0($P0).'
- tags:
+ tags:
- 'PMC'
- 'experimental'
- 'completed'
@@ -182,7 +189,7 @@
-
name: 'PARROT_LIBRARY and PARROT_INCLUDE environment variables'
note: 'A way to provide an equivalent of -L and -I parrot command line options to language that doesn''t support it.'
- tags:
+ tags:
- 'library'
- 'experimental'
ticket: 'https://trac.parrot.org/parrot/ticket/1429'
@@ -190,7 +197,7 @@
name: 'PAST::Val node generation'
eligible: '1.5'
note: 'The PAST::Compiler may generate the code for PAST::Val nodes (i.e., constants) at the beginning of the block (Parrot sub) instead of the location where they occur in the PAST tree.'
- tags:
+ tags:
- 'deprecated'
- 'compiler'
- 'completed'
@@ -199,7 +206,7 @@
name: 'PCT::HLLCompiler from Perl 5''s Test::Harness'
eligible: '1.1'
note: 'In order to facilitate using PCT::HLLCompiler with test harnesses, the ''command_line'' method of PCT::HLLCompiler object exits silently if it detects that it is being run in a sample run from Perl''s Test::Harness. Currently this detection is done by checking the second command line argument for @INC; future releases may use a different detection mechanism or eliminate it altogether.'
- tags:
+ tags:
- 'deprecated'
- 'compiler'
ticket: 'https://trac.parrot.org/parrot/ticket/463'
@@ -207,7 +214,7 @@
name: 'PCT::HLLCompiler stages'
eligible: '1.1'
note: 'The interface of various methods for adding, removing, and modifying the list stages in a PCT::HLLCompiler object is subject to change. The existing actual stages will remain; only the mechanism for specifying the order of individual stages is likely to change.'
- tags:
+ tags:
- 'deprecated'
- 'compiler'
- 'completed'
@@ -215,33 +222,33 @@
-
name: 'PMC Attributes Allocation Functions'
note: 'These items and related helper functions are added as experimental support for <https://trac.parrot.org/parrot/ticket/1506>'
- tags:
+ tags:
- 'functions'
- 'experimental'
- 'completed'
-
name: 'PMC numbering'
- tags:
+ tags:
- 'bytecode'
- 'experimental'
- 'completed'
ticket: 'https://trac.parrot.org/parrot/ticket/451'
-
name: 'PackfileDebug'
- tags:
+ tags:
- 'PMC'
- 'experimental'
ticket: 'https://trac.parrot.org/parrot/ticket/1599'
-
name: 'Parrot_load_bytecode_file'
note: 'Load a .pbc file into the interpreter. Experimental.'
- tags:
+ tags:
- 'functions'
- 'experimental'
-
name: 'Parrot_str_unescape_string'
note: 'This function is an experimental addition to enhance and maybe replace Parrot_str_unescape'
- tags:
+ tags:
- 'functions'
- 'experimental'
- 'completed'
@@ -250,7 +257,7 @@
name: 'Protoobject'
eligible: '2.7'
note: 'Use P6Object instead.'
- tags:
+ tags:
- 'deprecated'
- 'library'
- 'completed'
@@ -259,7 +266,7 @@
name: 'STRING COW'
eligible: '2.4'
note: 'COW strings are to be removed. All "inplace" string modification functions and all "inplace" string ops are deprecated.'
- tags:
+ tags:
- 'deprecated'
- 'functions'
- 'completed'
@@ -268,21 +275,21 @@
name: 'STRING Out parameters in Parrot_str_* functions'
eligible: '2.1'
note: 'All STRING modification functions will return a STRING pointer; capture and use this rather than relying on in-place modification of an existing pointer.'
- tags:
+ tags:
- 'deprecated'
- 'functions'
- 'completed'
ticket: 'https://trac.parrot.org/parrot/ticket/1584'
-
name: 'Threads and Parallelism'
- tags:
+ tags:
- 'experimental'
ticket: 'https://trac.parrot.org/parrot/ticket/1601'
-
name: 'UnManagedStruct get_integer, set_integer_native'
eligible: '2.4'
note: 'These will no longer refer to the byte length of the buffer, but to the number of times the struct is repeated; emulating an array of structs.'
- tags:
+ tags:
- 'deprecated'
- 'PMC'
ticket: 'https://trac.parrot.org/parrot/ticket/1553'
@@ -290,7 +297,7 @@
name: 'UnManagedStruct handling nested structure'
eligible: '2.4'
note: 'UnManagedStruct will be simplified to only support flat structures. This means that elements which themselves have structure - struct pointers and function pointers will be stored as "void *" and "void (*)(void)" respectively. To use these, they will need to be cast to the appropriate signature on access.'
- tags:
+ tags:
- 'PMC'
- 'deprecated'
ticket: 'https://trac.parrot.org/parrot/ticket/1551'
@@ -298,7 +305,7 @@
name: 'UnManagedStruct initializer structure'
eligible: '2.4'
note: 'The initializer structure will cease to be an array of triples. Instead, an array of flags (no counts or offsets), or a string representation of the same information may be used.'
- tags:
+ tags:
- 'deprecated'
- 'PMC'
ticket: 'https://trac.parrot.org/parrot/ticket/1552'
@@ -306,7 +313,7 @@
name: 'charset, charsetname, find_charset, trans_charset'
eligible: '2.10'
note: 'These opcodes will be removed. The corresponding encoding opcodes should be used instead.'
- tags:
+ tags:
- 'deprecated'
- 'opcodes'
- 'completed'
@@ -314,7 +321,7 @@
-
name: 'continuation-based ExceptionHandlers'
eligible: '2.1'
- tags:
+ tags:
- 'deprecated'
- 'PIR'
- 'syntax'
@@ -324,14 +331,14 @@
name: 'dlfunc and new_callback signature string format'
eligible: '2.4'
note: 'These will be changed to allow more flexibility in types.'
- tags:
+ tags:
- 'deprecated'
- 'opcodes'
ticket: 'https://trac.parrot.org/parrot/ticket/1565'
-
name: 'finalize'
note: 'Finalize exception handler, unrolling inner runloops if needed.'
- tags:
+ tags:
- 'opcodes'
- 'experimental'
- 'completed'
@@ -340,7 +347,7 @@
name: 'fixed_8 encoding'
eligible: '2.10'
note: 'The ''fixed_8'' encoding is going away. Use ''ascii'' instead. If you want to test for a fixed_8 encoding, you have to compare the encoding to ''ascii'', ''iso-8859-1'' and ''binary'' separately.'
- tags:
+ tags:
- 'deprecated'
- 'opcodes'
- 'completed'
@@ -349,7 +356,7 @@
name: 'get_addr and set_addr'
eligible: '1.5'
note: 'These opcodes are being repurposed. They will always return a unique memory address of the PMC. Uses of get_addr and set_addr that would set label values for Sub, Exception, and related PMC types will instead be handled by get_label and set_label.'
- tags:
+ tags:
- 'deprecated'
- 'opcodes'
ticket: 'https://trac.parrot.org/parrot/ticket/218'
@@ -357,7 +364,7 @@
name: 'get_results opcode order and features'
eligible: '2.1'
note: 'get_results no longer used to fetch exception object.'
- tags:
+ tags:
- 'deprecated'
- 'opcodes'
- 'completed'
@@ -365,7 +372,7 @@
-
name: 'implicit optional named parameters'
eligible: '2.1'
- tags:
+ tags:
- 'completed'
- 'deprecated'
- 'PIR'
@@ -375,7 +382,7 @@
name: 'inplace string updates.'
eligible: '2.4'
note: 'All "inplace" string update ops are deprecated. E.g. "chopn_s", etc. Part of COW removal.'
- tags:
+ tags:
- 'deprecated'
- 'opcodes'
- 'completed'
@@ -383,7 +390,7 @@
-
name: 'loadlib_p_s_p'
note: 'Ability to use non-default dynamic loading behaviour.'
- tags:
+ tags:
- 'opcodes'
- 'experimental'
ticket: 'https://trac.parrot.org/parrot/ticket/1583'
@@ -391,7 +398,7 @@
name: 'logical PMC ops'
eligible: '2.7'
note: 'These fall out from the logical vtables deprecation.'
- tags:
+ tags:
- 'deprecated'
- 'opcodes'
ticket: 'https://trac.parrot.org/parrot/ticket/1655'
@@ -399,21 +406,21 @@
name: 'logical_* vtables'
eligible: '2.7'
note: 'These can be replaced by ''get_bool'' and intval ops unless you''re using them for things that aren''t really logical ops (don''t do that!). Logical vtables are removed in r49012, and logical ops on PMCs are converted to use ''get_bool'' internally. Rakudo seems to depend on logical ops on PMC.'
- tags:
+ tags:
- 'deprecated'
- 'PMC'
ticket: 'https://trac.parrot.org/parrot/ticket/1655'
-
name: 'mmd_cvt_to_types'
eligible: '1.1'
- tags:
+ tags:
- 'deprecated'
- 'functions'
ticket: 'https://trac.parrot.org/parrot/ticket/907'
-
name: 'multiple dispatch within core PMC'
eligible: '1.1'
- tags:
+ tags:
- 'deprecated'
- 'PMC'
ticket: 'https://trac.parrot.org/parrot/ticket/452'
@@ -421,13 +428,13 @@
name: 'new_callback_p_p_p_s'
eligible: '2.4'
note: 'To be replaced with new_callback_p_p_p_p_s.'
- tags:
+ tags:
- 'deprecated'
- 'opcodes'
ticket: 'https://trac.parrot.org/parrot/ticket/1548'
-
name: 'opcode numbering'
- tags:
+ tags:
- 'bytecode'
- 'experimental'
- 'completed'
@@ -436,13 +443,13 @@
name: 'open and close opcodes will be removed'
eligible: '2.7'
note: 'These opcodes will be removed. The open/close methods on File or the FileHandle PMC should be used instead.'
- tags:
+ tags:
- 'deprecated'
- 'opcodes'
ticket: 'https://trac.parrot.org/parrot/ticket/1697'
-
name: 'packfile structure'
- tags:
+ tags:
- 'bytecode'
- 'experimental'
- 'completed'
@@ -451,14 +458,21 @@
name: 'pkg-config support'
eligible: '3.1'
note: 'Use "parrot_config" instead.'
- tags:
+ tags:
- 'deprecated'
- 'library'
- 'completed'
ticket: 'https://trac.parrot.org/parrot/ticket/1853'
-
name: 'Parrot_ext_try function'
- tags:
+ tags:
- 'experimental'
- 'functions'
ticket: 'https://trac.parrot.org/parrot/ticket/1996'
+-
+ name: 'LANG search path with -L'
+ tags:
+ - 'experimental'
+ - 'api'
+ - 'library'
+ ticket: ''
3  compilers/imcc/Defines.mak
View
@@ -13,4 +13,5 @@ IMCC_O_FILES = \
compilers/imcc/optimizer$(O) \
compilers/imcc/pbc$(O) \
compilers/imcc/parser_util$(O) \
- compilers/imcc/pcc$(O)
+ compilers/imcc/pcc$(O) \
+ compilers/imcc/api$(O)
46 compilers/imcc/Rules.in
View
@@ -1,3 +1,21 @@
+compilers/imcc/api$(O) : \
+ compilers/imcc/api.c \
+ include/imcc/api.h \
+ include/imcc/embed.h \
+ include/parrot/extend_vtable.h \
+ compilers/imcc/imc.h \
+ compilers/imcc/cfg.h \
+ include/parrot/extend.h \
+ include/parrot/oplib/ops.h \
+ compilers/imcc/symreg.h \
+ compilers/imcc/sets.h \
+ compilers/imcc/unit.h \
+ include/imcc/yyscanner.h \
+ compilers/imcc/debug.h \
+ include/parrot/api.h \
+ compilers/imcc/instructions.h \
+ $(PARROT_H_HEADERS)
+
compilers/imcc/pcc$(O) : \
compilers/imcc/pcc.c \
compilers/imcc/cfg.h \
@@ -9,6 +27,8 @@ compilers/imcc/pcc$(O) : \
compilers/imcc/sets.h \
compilers/imcc/symreg.h \
compilers/imcc/unit.h \
+ include/imcc/yyscanner.h \
+ include/imcc/embed.h \
$(INC_DIR)/oplib/ops.h \
$(INC_DIR)/oplib/core_ops.h \
$(INC_DIR)/runcore_api.h \
@@ -25,6 +45,8 @@ compilers/imcc/instructions$(O) : \
compilers/imcc/sets.h \
compilers/imcc/symreg.h \
compilers/imcc/unit.h \
+ include/imcc/yyscanner.h \
+ include/imcc/embed.h \
$(INC_DIR)/oplib/ops.h \
$(INC_DIR)/oplib/core_ops.h \
$(INC_DIR)/runcore_api.h \
@@ -40,6 +62,8 @@ compilers/imcc/pbc$(O) : \
compilers/imcc/sets.h \
compilers/imcc/symreg.h \
compilers/imcc/unit.h \
+ include/imcc/yyscanner.h \
+ include/imcc/embed.h \
$(INC_DIR)/oplib/ops.h \
$(INC_DIR)/oplib/core_ops.h \
$(INC_DIR)/runcore_api.h \
@@ -60,6 +84,8 @@ compilers/imcc/parser_util$(O) : \
compilers/imcc/sets.h \
compilers/imcc/symreg.h \
compilers/imcc/unit.h \
+ include/imcc/yyscanner.h \
+ include/imcc/embed.h \
$(INC_DIR)/dynext.h \
$(INC_DIR)/embed.h \
$(INC_DIR)/oplib/ops.h \
@@ -76,6 +102,8 @@ compilers/imcc/imc$(O) : \
compilers/imcc/sets.h \
compilers/imcc/symreg.h \
compilers/imcc/unit.h \
+ include/imcc/yyscanner.h \
+ include/imcc/embed.h \
$(INC_DIR)/oplib/ops.h \
$(PARROT_H_HEADERS)
@@ -89,6 +117,8 @@ compilers/imcc/cfg$(O) : \
compilers/imcc/sets.h \
compilers/imcc/symreg.h \
compilers/imcc/unit.h \
+ include/imcc/yyscanner.h \
+ include/imcc/embed.h \
$(INC_DIR)/oplib/ops.h \
$(INC_DIR)/oplib/core_ops.h \
$(INC_DIR)/runcore_api.h \
@@ -103,6 +133,8 @@ compilers/imcc/debug$(O) : \
compilers/imcc/sets.h \
compilers/imcc/symreg.h \
compilers/imcc/unit.h \
+ include/imcc/yyscanner.h \
+ include/imcc/embed.h \
$(INC_DIR)/oplib/ops.h \
$(PARROT_H_HEADERS)
@@ -118,6 +150,8 @@ compilers/imcc/imclexer$(O) : \
compilers/imcc/sets.h \
compilers/imcc/symreg.h \
compilers/imcc/unit.h \
+ include/imcc/yyscanner.h \
+ include/imcc/embed.h \
$(INC_DIR)/oplib/ops.h \
$(PARROT_H_HEADERS)
$(CC) $(CFLAGS) @optimize::compilers/imcc/imclexer.c@ @ccwarn::compilers/imcc/imclexer.c@ @cc_shared@ -I$(@D) @cc_o_out@$@ -c compilers/imcc/imclexer.c
@@ -136,12 +170,15 @@ compilers/imcc/imcparser$(O) : \
compilers/imcc/sets.h \
compilers/imcc/symreg.h \
compilers/imcc/unit.h \
+ include/imcc/yyscanner.h \
+ include/imcc/embed.h \
$(INC_DIR)/dynext.h \
$(INC_DIR)/oplib/ops.h \
$(PARROT_H_HEADERS)
$(CC) $(CFLAGS) @optimize::compilers/imcc/imcparser.c@ @ccwarn::compilers/imcc/imcparser.c@ @cc_shared@ -I$(@D) @cc_o_out@$@ -c compilers/imcc/imcparser.c
compilers/imcc/main$(O) : \
+ include/imcc/embed.h \
compilers/imcc/main.c \
compilers/imcc/cfg.h \
compilers/imcc/debug.h \
@@ -154,6 +191,7 @@ compilers/imcc/main$(O) : \
compilers/imcc/sets.h \
compilers/imcc/symreg.h \
compilers/imcc/unit.h \
+ include/imcc/yyscanner.h \
$(INC_DIR)/embed.h \
$(INC_DIR)/oplib/ops.h \
$(INC_DIR)/runcore_api.h \
@@ -174,6 +212,8 @@ compilers/imcc/optimizer$(O) : \
compilers/imcc/sets.h \
compilers/imcc/symreg.h \
compilers/imcc/unit.h \
+ include/imcc/yyscanner.h \
+ include/imcc/embed.h \
$(INC_DIR)/oplib/ops.h \
$(INC_DIR)/oplib/core_ops.h \
$(INC_DIR)/runcore_api.h \
@@ -190,6 +230,8 @@ compilers/imcc/reg_alloc$(O) : \
compilers/imcc/sets.h \
compilers/imcc/symreg.h \
compilers/imcc/unit.h \
+ include/imcc/yyscanner.h \
+ include/imcc/embed.h \
$(INC_DIR)/oplib/ops.h \
$(PARROT_H_HEADERS)
@@ -202,6 +244,8 @@ compilers/imcc/sets$(O) : \
compilers/imcc/sets.h \
compilers/imcc/symreg.h \
compilers/imcc/unit.h \
+ include/imcc/yyscanner.h \
+ include/imcc/embed.h \
$(INC_DIR)/oplib/ops.h \
$(PARROT_H_HEADERS)
@@ -214,6 +258,8 @@ compilers/imcc/symreg$(O) : \
compilers/imcc/sets.h \
compilers/imcc/symreg.h \
compilers/imcc/unit.h \
+ include/imcc/yyscanner.h \
+ include/imcc/embed.h \
$(INC_DIR)/oplib/ops.h \
$(PARROT_H_HEADERS)
210 compilers/imcc/api.c
View
@@ -0,0 +1,210 @@
+/*
+ *
+ * IMCC call-in routines for use with the Parrot embedding API
+ *
+ * Copyright (C) 2011, Parrot Foundation.
+ */
+
+/*
+
+=head1 NAME
+
+compilers/imcc/api.c
+
+=head1 DESCRIPTION
+
+IMCC call-in routines for use with the Parrot embedding API
+
+=head2 Functions
+
+=over 4
+
+=cut
+
+*/
+
+#include "parrot/parrot.h"
+#include "parrot/extend.h"
+#include "imcc/api.h"
+#include "imc.h"
+
+/* HEADERIZER HFILE: include/imcc/api.h */
+
+/* HEADERIZER BEGIN: static */
+/* Don't modify between HEADERIZER BEGIN / HEADERIZER END. Your changes will be lost. */
+
+PARROT_CANNOT_RETURN_NULL
+PARROT_WARN_UNUSED_RESULT
+static PMC * get_compreg_pmc(PARROT_INTERP, int is_pasm, int add_compreg)
+ __attribute__nonnull__(1);
+
+#define ASSERT_ARGS_get_compreg_pmc __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+ PARROT_ASSERT_ARG(interp))
+/* Don't modify between HEADERIZER BEGIN / HEADERIZER END. Your changes will be lost. */
+/* HEADERIZER END: static */
+
+#define GET_RAW_INTERP(p) Parrot_int_get_interp_from_pmc(p)
+#define GET_INTERP(p) (PMC_IS_NULL(p) ? NULL : GET_RAW_INTERP(p))
+
+#define IMCC_API_CALLIN(p, i) \
+ Parrot_jump_buff env; \
+ if (setjmp(env)) { \
+ Interp * const __interp = GET_INTERP(p); \
+ __interp->api_jmp_buf = NULL; \
+ return !__interp->exit_code; \
+ } \
+ else { \
+ Interp * const (i) = GET_INTERP(p); \
+ void * _oldtop = (i)->lo_var_ptr; \
+ if (_oldtop == NULL) \
+ (i)->lo_var_ptr = &_oldtop; \
+ (i)->api_jmp_buf = &env; \
+ {
+
+#define IMCC_API_CALLOUT(p, i) \
+ } \
+ (i)->api_jmp_buf = NULL; \
+ if (!_oldtop) { \
+ PARROT_ASSERT((i)->lo_var_ptr == &_oldtop); \
+ (i)->lo_var_ptr = NULL; \
+ } \
+ return 1; \
+ }
+
+/*
+
+=item C<Parrot_Int imcc_get_pir_compreg_api(Parrot_PMC interp_pmc, int
+add_compreg, Parrot_PMC *compiler)>
+
+Get a registerable compiler object for the "PIR" language. If C<add_compreg>
+is 1, register that compiler with Parrot under the name "PIR".
+
+=cut
+
+*/
+
+PARROT_EXPORT
+PARROT_CANNOT_RETURN_NULL
+Parrot_Int
+imcc_get_pir_compreg_api(Parrot_PMC interp_pmc, int add_compreg, ARGOUT(Parrot_PMC *compiler))
+{
+ ASSERT_ARGS(imcc_get_pir_compreg_api)
+ IMCC_API_CALLIN(interp_pmc, interp)
+ *compiler = get_compreg_pmc(interp, 0, add_compreg);
+ if (PMC_IS_NULL(*compiler))
+ Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_UNEXPECTED_NULL,
+ "Could not create PIR compiler PMC");
+ IMCC_API_CALLOUT(interp_pmc, interp)
+}
+
+/*
+
+=item C<Parrot_Int imcc_get_pasm_compreg_api(Parrot_PMC interp_pmc, int
+add_compreg, Parrot_PMC *compiler)>
+
+Get a registerable compiler object for the "PASM" language. If C<add_compreg>
+is 1, register that compiler with Parrot under the name "PASM".
+
+=cut
+
+*/
+
+PARROT_EXPORT
+Parrot_Int
+imcc_get_pasm_compreg_api(Parrot_PMC interp_pmc, int add_compreg, ARGOUT(Parrot_PMC *compiler))
+{
+ ASSERT_ARGS(imcc_get_pasm_compreg_api)
+ IMCC_API_CALLIN(interp_pmc, interp)
+ *compiler = get_compreg_pmc(interp, 1, add_compreg);
+ if (PMC_IS_NULL(*compiler))
+ Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_UNEXPECTED_NULL,
+ "Could not create PASM compiler PMC");
+ IMCC_API_CALLOUT(interp_pmc, interp)
+}
+
+/*
+
+=item C<static PMC * get_compreg_pmc(PARROT_INTERP, int is_pasm, int
+add_compreg)>
+
+Get an IMCC compiler PMC. Register it under its preferred name if
+C<add_compreg> is 1.
+
+=cut
+*/
+
+PARROT_CANNOT_RETURN_NULL
+PARROT_WARN_UNUSED_RESULT
+static PMC *
+get_compreg_pmc(PARROT_INTERP, int is_pasm, int add_compreg)
+{
+ ASSERT_ARGS(get_compreg_pmc)
+ PMC * const comp = Parrot_pmc_new_init_int(interp, enum_class_IMCCompiler, is_pasm);
+ if (add_compreg) {
+ STRING * const name = VTABLE_get_string(interp, comp);
+ Parrot_set_compiler(interp, name, comp);
+ }
+ return comp;
+}
+
+/*
+
+=item C<Parrot_Int imcc_compile_file_api(Parrot_PMC interp_pmc, Parrot_PMC
+compiler, Parrot_String file, Parrot_PMC *pbc)>
+
+Compile a file using the given IMCCompiler PMC.
+
+=cut
+
+*/
+
+PARROT_EXPORT
+PARROT_WARN_UNUSED_RESULT
+Parrot_Int
+imcc_compile_file_api(Parrot_PMC interp_pmc, Parrot_PMC compiler,
+ Parrot_String file, ARGOUT(Parrot_PMC *pbc))
+{
+ ASSERT_ARGS(imcc_compile_file_api)
+ IMCC_API_CALLIN(interp_pmc, interp)
+ STRING * const meth_name = Parrot_str_new(interp, "compile_file", 0);
+ PMC * result = PMCNULL;
+
+ Parrot_pcc_invoke_method_from_c_args(interp, compiler, meth_name,
+ "S->P", file, &result);
+
+ *pbc = result;
+ IMCC_API_CALLOUT(interp_pmc, interp)
+}
+
+/*
+
+=item C<Parrot_Int imcc_preprocess_file_api(Parrot_PMC interp_pmc, Parrot_PMC
+compiler, Parrot_String file)>
+
+Preprocess the specified file only, using the given IMCCompiler PMC. Currently
+the preprocessed text is dumped directly to stdout.
+
+=cut
+
+*/
+
+PARROT_EXPORT
+PARROT_WARN_UNUSED_RESULT
+Parrot_Int
+imcc_preprocess_file_api(Parrot_PMC interp_pmc, Parrot_PMC compiler,
+ Parrot_String file)
+{
+ ASSERT_ARGS(imcc_preprocess_file_api)
+ IMCC_API_CALLIN(interp_pmc, interp)
+ STRING * const meth_name = Parrot_str_new(interp, "preprocess", 0);
+ Parrot_pcc_invoke_method_from_c_args(interp, compiler, meth_name,
+ "S->", file);
+ IMCC_API_CALLOUT(interp_pmc, interp)
+}
+
+/*
+ * Local variables:
+ * c-file-style: "parrot"
+ * End:
+ * vim: expandtab shiftwidth=4 cinoptions='\:2=2' :
+ */
272 compilers/imcc/cfg.c
View
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2002-2009, Parrot Foundation.
+ * Copyright (C) 2002-2011, Parrot Foundation.
*/
/*
@@ -35,7 +35,8 @@ between blocks.
/* HEADERIZER BEGIN: static */
/* Don't modify between HEADERIZER BEGIN / HEADERIZER END. Your changes will be lost. */
-static void bb_add_edge(PARROT_INTERP,
+static void bb_add_edge(
+ ARGMOD(imc_info_t *imcc),
ARGMOD(IMC_Unit *unit),
ARGIN(Basic_block *from),
ARGMOD(Basic_block *to))
@@ -43,10 +44,12 @@ static void bb_add_edge(PARROT_INTERP,
__attribute__nonnull__(2)
__attribute__nonnull__(3)
__attribute__nonnull__(4)
+ FUNC_MODIFIES(*imcc)
FUNC_MODIFIES(*unit)
FUNC_MODIFIES(*to);
-static void bb_check_set_addr(PARROT_INTERP,
+static void bb_check_set_addr(
+ ARGMOD(imc_info_t *imcc),
ARGMOD(IMC_Unit *unit),
ARGMOD(Basic_block *bb),
ARGIN(const SymReg *label))
@@ -54,10 +57,12 @@ static void bb_check_set_addr(PARROT_INTERP,
__attribute__nonnull__(2)
__attribute__nonnull__(3)
__attribute__nonnull__(4)
+ FUNC_MODIFIES(*imcc)
FUNC_MODIFIES(*unit)
FUNC_MODIFIES(*bb);
-static void bb_findadd_edge(PARROT_INTERP,
+static void bb_findadd_edge(
+ ARGMOD(imc_info_t *imcc),
ARGMOD(IMC_Unit *unit),
ARGIN(Basic_block *from),
ARGIN(const SymReg *label))
@@ -65,6 +70,7 @@ static void bb_findadd_edge(PARROT_INTERP,
__attribute__nonnull__(2)
__attribute__nonnull__(3)
__attribute__nonnull__(4)
+ FUNC_MODIFIES(*imcc)
FUNC_MODIFIES(*unit);
static void bb_remove_edge(ARGMOD(IMC_Unit *unit), ARGMOD(Edge *edge))
@@ -74,12 +80,21 @@ static void bb_remove_edge(ARGMOD(IMC_Unit *unit), ARGMOD(Edge *edge))
FUNC_MODIFIES(*edge);
PARROT_WARN_UNUSED_RESULT
-static int check_invoke_type(PARROT_INTERP,
+static int blocks_are_connected(
+ ARGIN(const Basic_block *from),
+ ARGIN(const Basic_block *to))
+ __attribute__nonnull__(1)
+ __attribute__nonnull__(2);
+
+PARROT_WARN_UNUSED_RESULT
+static int check_invoke_type(
+ ARGMOD(imc_info_t *imcc),
ARGIN(const IMC_Unit *unit),
ARGIN(const Instruction *ins))
__attribute__nonnull__(1)
__attribute__nonnull__(2)
- __attribute__nonnull__(3);
+ __attribute__nonnull__(3)
+ FUNC_MODIFIES(*imcc);
static void free_dominance_frontiers(ARGMOD(IMC_Unit *unit))
__attribute__nonnull__(1)
@@ -97,54 +112,65 @@ static void free_loops(ARGMOD(IMC_Unit *unit))
__attribute__nonnull__(1)
FUNC_MODIFIES(*unit);
-static void init_basic_blocks(PARROT_INTERP, ARGMOD(IMC_Unit *unit))
+static void init_basic_blocks(
+ ARGMOD(imc_info_t *imcc),
+ ARGMOD(IMC_Unit *unit))
__attribute__nonnull__(1)
__attribute__nonnull__(2)
+ FUNC_MODIFIES(*imcc)
FUNC_MODIFIES(*unit);
PARROT_CANNOT_RETURN_NULL
PARROT_WARN_UNUSED_RESULT
-static Basic_block* make_basic_block(PARROT_INTERP,
+static Basic_block* make_basic_block(
+ ARGMOD(imc_info_t *imcc),
ARGMOD(IMC_Unit *unit),
ARGMOD(Instruction *ins))
__attribute__nonnull__(1)
__attribute__nonnull__(2)
__attribute__nonnull__(3)
+ FUNC_MODIFIES(*imcc)
FUNC_MODIFIES(*unit)
FUNC_MODIFIES(*ins);
-static void mark_loop(PARROT_INTERP,
+static void mark_loop(
+ ARGMOD(imc_info_t *imcc),
ARGMOD(IMC_Unit *unit),
ARGIN(const Edge *e))
__attribute__nonnull__(1)
__attribute__nonnull__(2)
__attribute__nonnull__(3)
+ FUNC_MODIFIES(*imcc)
FUNC_MODIFIES(*unit);
-static void sort_loops(PARROT_INTERP, ARGIN(IMC_Unit *unit))
+static void sort_loops(ARGMOD(imc_info_t *imcc), ARGIN(IMC_Unit *unit))
__attribute__nonnull__(1)
- __attribute__nonnull__(2);
+ __attribute__nonnull__(2)
+ FUNC_MODIFIES(*imcc);
#define ASSERT_ARGS_bb_add_edge __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
- PARROT_ASSERT_ARG(interp) \
+ PARROT_ASSERT_ARG(imcc) \
, PARROT_ASSERT_ARG(unit) \
, PARROT_ASSERT_ARG(from) \
, PARROT_ASSERT_ARG(to))
#define ASSERT_ARGS_bb_check_set_addr __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
- PARROT_ASSERT_ARG(interp) \
+ PARROT_ASSERT_ARG(imcc) \
, PARROT_ASSERT_ARG(unit) \
, PARROT_ASSERT_ARG(bb) \
, PARROT_ASSERT_ARG(label))
#define ASSERT_ARGS_bb_findadd_edge __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
- PARROT_ASSERT_ARG(interp) \
+ PARROT_ASSERT_ARG(imcc) \
, PARROT_ASSERT_ARG(unit) \
, PARROT_ASSERT_ARG(from) \
, PARROT_ASSERT_ARG(label))
#define ASSERT_ARGS_bb_remove_edge __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
PARROT_ASSERT_ARG(unit) \
, PARROT_ASSERT_ARG(edge))
+#define ASSERT_ARGS_blocks_are_connected __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+ PARROT_ASSERT_ARG(from) \
+ , PARROT_ASSERT_ARG(to))
#define ASSERT_ARGS_check_invoke_type __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
- PARROT_ASSERT_ARG(interp) \
+ PARROT_ASSERT_ARG(imcc) \
, PARROT_ASSERT_ARG(unit) \
, PARROT_ASSERT_ARG(ins))
#define ASSERT_ARGS_free_dominance_frontiers __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
@@ -156,18 +182,18 @@ static void sort_loops(PARROT_INTERP, ARGIN(IMC_Unit *unit))
#define ASSERT_ARGS_free_loops __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
PARROT_ASSERT_ARG(unit))
#define ASSERT_ARGS_init_basic_blocks __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
- PARROT_ASSERT_ARG(interp) \
+ PARROT_ASSERT_ARG(imcc) \
, PARROT_ASSERT_ARG(unit))
#define ASSERT_ARGS_make_basic_block __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
- PARROT_ASSERT_ARG(interp) \
+ PARROT_ASSERT_ARG(imcc) \
, PARROT_ASSERT_ARG(unit) \
, PARROT_ASSERT_ARG(ins))
#define ASSERT_ARGS_mark_loop __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
- PARROT_ASSERT_ARG(interp) \
+ PARROT_ASSERT_ARG(imcc) \
, PARROT_ASSERT_ARG(unit) \
, PARROT_ASSERT_ARG(e))
#define ASSERT_ARGS_sort_loops __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
- PARROT_ASSERT_ARG(interp) \
+ PARROT_ASSERT_ARG(imcc) \
, PARROT_ASSERT_ARG(unit))
/* Don't modify between HEADERIZER BEGIN / HEADERIZER END. Your changes will be lost. */
/* HEADERIZER END: static */
@@ -181,8 +207,8 @@ static void sort_loops(PARROT_INTERP, ARGIN(IMC_Unit *unit))
/*
-=item C<static int check_invoke_type(PARROT_INTERP, const IMC_Unit *unit, const
-Instruction *ins)>
+=item C<static int check_invoke_type(imc_info_t *imcc, const IMC_Unit *unit,
+const Instruction *ins)>
Given an invoke-type instruction, returns the type of the invocation.
@@ -192,7 +218,7 @@ Given an invoke-type instruction, returns the type of the invocation.
PARROT_WARN_UNUSED_RESULT
static int
-check_invoke_type(PARROT_INTERP, ARGIN(const IMC_Unit *unit),
+check_invoke_type(ARGMOD(imc_info_t *imcc), ARGIN(const IMC_Unit *unit),
ARGIN(const Instruction *ins))
{
ASSERT_ARGS(check_invoke_type)
@@ -213,8 +239,8 @@ check_invoke_type(PARROT_INTERP, ARGIN(const IMC_Unit *unit),
return INVOKE_SUB_RET;
/* 4) other usage, too complex to follow */
- IMCC_INFO(interp)->dont_optimize = 1;
- IMCC_INFO(interp)->optimizer_level &= ~OPT_PASM;
+ imcc->dont_optimize = 1;
+ imcc->optimizer_level &= ~OPT_PASM;
return INVOKE_SUB_OTHER;
}
@@ -222,7 +248,7 @@ check_invoke_type(PARROT_INTERP, ARGIN(const IMC_Unit *unit),
/*
-=item C<void find_basic_blocks(PARROT_INTERP, IMC_Unit *unit, int first)>
+=item C<void find_basic_blocks(imc_info_t *imcc, IMC_Unit *unit, int first)>
Finds all basic blocks in the given IMC_Unit, expanding PCC calls if first is
true.
@@ -232,7 +258,7 @@ true.
*/
void
-find_basic_blocks(PARROT_INTERP, ARGMOD(IMC_Unit *unit), int first)
+find_basic_blocks(ARGMOD(imc_info_t *imcc), ARGMOD(IMC_Unit *unit), int first)
{
ASSERT_ARGS(find_basic_blocks)
Basic_block *bb;
@@ -241,8 +267,8 @@ find_basic_blocks(PARROT_INTERP, ARGMOD(IMC_Unit *unit), int first)
int nu = 0;
unsigned int i;
- IMCC_info(interp, 2, "find_basic_blocks\n");
- init_basic_blocks(interp, unit);
+ IMCC_info(imcc, 2, "find_basic_blocks\n");
+ init_basic_blocks(imcc, unit);
for (i = 0; i < hsh->size; i++) {
SymReg *r;
@@ -256,14 +282,14 @@ find_basic_blocks(PARROT_INTERP, ARGMOD(IMC_Unit *unit), int first)
ins = unit->instructions;
if (unit->type & IMC_PCCSUB) {
- IMCC_debug(interp, DEBUG_CFG, "pcc_sub %s nparams %d\n",
+ IMCC_debug(imcc, DEBUG_CFG, "pcc_sub %s nparams %d\n",
ins->symregs[0]->name, ins->symregs[0]->pcc_sub->nargs);
- expand_pcc_sub(interp, unit, ins);
+ expand_pcc_sub(imcc, unit, ins);
}
ins->index = i = 0;
- bb = make_basic_block(interp, unit, ins);
+ bb = make_basic_block(imcc, unit, ins);
if (ins->type & ITBRANCH) {
SymReg * const addr = get_branch_reg(bb->end);
@@ -279,19 +305,19 @@ find_basic_blocks(PARROT_INTERP, ARGMOD(IMC_Unit *unit), int first)
if (!ins->op
&& (ins->type & ITPCCPARAM)
&& first) {
- expand_pcc_sub(interp, unit, ins);
+ expand_pcc_sub(imcc, unit, ins);
ins->type &= ~ITPCCPARAM;
}
else if (!ins->op
&& (ins->type & ITPCCSUB)
&& first) {
if (ins->type & ITLABEL) {
- expand_pcc_sub_ret(interp, unit, ins);
+ expand_pcc_sub_ret(imcc, unit, ins);
ins->type &= ~ITLABEL;
}
else {
/* if this is a sub call expand it */
- expand_pcc_sub_call(interp, unit, ins);
+ expand_pcc_sub_call(imcc, unit, ins);
}
ins->type &= ~ITPCCSUB;
@@ -307,7 +333,7 @@ find_basic_blocks(PARROT_INTERP, ARGMOD(IMC_Unit *unit), int first)
nu = 0;
else if (ins->type & ITLABEL) {
bb->end = ins->prev;
- bb = make_basic_block(interp, unit, ins);
+ bb = make_basic_block(imcc, unit, ins);
}
/* a branch is the end of a basic block
@@ -323,14 +349,14 @@ find_basic_blocks(PARROT_INTERP, ARGMOD(IMC_Unit *unit), int first)
continue;
if (ins->next)
- bb = make_basic_block(interp, unit, ins->next);
+ bb = make_basic_block(imcc, unit, ins->next);
nu = 1;
}
}
- if (IMCC_INFO(interp)->debug & DEBUG_CFG) {
- dump_instructions(interp, unit);
+ if (imcc->debug & DEBUG_CFG) {
+ dump_instructions(imcc, unit);
dump_labels(unit);
}
}
@@ -338,8 +364,8 @@ find_basic_blocks(PARROT_INTERP, ARGMOD(IMC_Unit *unit), int first)
/*
-=item C<static void bb_check_set_addr(PARROT_INTERP, IMC_Unit *unit, Basic_block
-*bb, const SymReg *label)>
+=item C<static void bb_check_set_addr(imc_info_t *imcc, IMC_Unit *unit,
+Basic_block *bb, const SymReg *label)>
Looks for a C<set_addr> op in the current unit referring to the given label.
@@ -348,22 +374,22 @@ Looks for a C<set_addr> op in the current unit referring to the given label.
*/
static void
-bb_check_set_addr(PARROT_INTERP, ARGMOD(IMC_Unit *unit),
+bb_check_set_addr(ARGMOD(imc_info_t *imcc), ARGMOD(IMC_Unit *unit),
ARGMOD(Basic_block *bb), ARGIN(const SymReg *label))
{
ASSERT_ARGS(bb_check_set_addr)
const Instruction *ins;
- op_lib_t *core_ops = PARROT_GET_CORE_OPLIB(interp);
+ op_lib_t *core_ops = PARROT_GET_CORE_OPLIB(imcc->interp);
for (ins = unit->instructions; ins; ins = ins->next) {
if ((ins->op == &core_ops->op_info_table[PARROT_OP_set_addr_p_ic])
&& STREQ(label->name, ins->symregs[1]->name)) {
- IMCC_debug(interp, DEBUG_CFG, "set_addr %s\n",
+ IMCC_debug(imcc, DEBUG_CFG, "set_addr %s\n",
ins->symregs[1]->name);
/* connect this block with first and last block */
- bb_add_edge(interp, unit, unit->bb_list[0], bb);
- bb_add_edge(interp, unit, unit->bb_list[unit->n_basic_blocks - 1], bb);
+ bb_add_edge(imcc, unit, unit->bb_list[0], bb);
+ bb_add_edge(imcc, unit, unit->bb_list[unit->n_basic_blocks - 1], bb);
break;
}
@@ -373,7 +399,7 @@ bb_check_set_addr(PARROT_INTERP, ARGMOD(IMC_Unit *unit),
/*
-=item C<void build_cfg(PARROT_INTERP, IMC_Unit *unit)>
+=item C<void build_cfg(imc_info_t *imcc, IMC_Unit *unit)>
Once the basic blocks have been computed, build_cfg computes the dependencies
between them.
@@ -383,14 +409,14 @@ between them.
*/
void
-build_cfg(PARROT_INTERP, ARGMOD(IMC_Unit *unit))
+build_cfg(ARGMOD(imc_info_t *imcc), ARGMOD(IMC_Unit *unit))
{
ASSERT_ARGS(build_cfg)
Basic_block *last = NULL;
unsigned int i;
int changes;
- IMCC_info(interp, 2, "build_cfg\n");
+ IMCC_info(imcc, 2, "build_cfg\n");
for (i = 0; i < unit->n_basic_blocks; i++) {
Basic_block * const bb = unit->bb_list[i];
@@ -398,21 +424,21 @@ build_cfg(PARROT_INTERP, ARGMOD(IMC_Unit *unit))
/* if the block can fall-through */
if (i > 0 && ! (last->end->type & IF_goto))
- bb_add_edge(interp, unit, last, bb);
+ bb_add_edge(imcc, unit, last, bb);
/* check first ins, if label try to find a set_addr op */
if (bb->start->type & ITLABEL)
- bb_check_set_addr(interp, unit, bb, bb->start->symregs[0]);
+ bb_check_set_addr(imcc, unit, bb, bb->start->symregs[0]);
/* look if last instruction is a branch */
addr = get_branch_reg(bb->end);
if (addr)
- bb_findadd_edge(interp, unit, bb, addr);
+ bb_findadd_edge(imcc, unit, bb, addr);
else if (STREQ(bb->start->opname, "invoke")
|| STREQ(bb->start->opname, "invokecc")) {
- if (check_invoke_type(interp, unit, bb->start) == INVOKE_SUB_LOOP)
- bb_add_edge(interp, unit, bb, unit->bb_list[0]);
+ if (check_invoke_type(imcc, unit, bb->start) == INVOKE_SUB_LOOP)
+ bb_add_edge(imcc, unit, bb, unit->bb_list[0]);
}
last = bb;
@@ -431,7 +457,7 @@ build_cfg(PARROT_INTERP, ARGMOD(IMC_Unit *unit))
/* Remove all successor edges of block bb */
while (bb->succ_list) {
bb_remove_edge(unit, bb->succ_list);
- IMCC_debug(interp, DEBUG_CFG,
+ IMCC_debug(imcc, DEBUG_CFG,
"remove edge from bb: %d\n", bb->index);
changes = 1;
}
@@ -439,15 +465,15 @@ build_cfg(PARROT_INTERP, ARGMOD(IMC_Unit *unit))
}
} while (changes);
- if (IMCC_INFO(interp)->debug & DEBUG_CFG)
+ if (imcc->debug & DEBUG_CFG)
dump_cfg(unit);
}
/*
-=item C<static void bb_findadd_edge(PARROT_INTERP, IMC_Unit *unit, Basic_block
-*from, const SymReg *label)>
+=item C<static void bb_findadd_edge(imc_info_t *imcc, IMC_Unit *unit,
+Basic_block *from, const SymReg *label)>
Finds the placement of the given label and links its containing block to the
given basic block.
@@ -457,37 +483,37 @@ given basic block.
*/
static void
-bb_findadd_edge(PARROT_INTERP, ARGMOD(IMC_Unit *unit), ARGIN(Basic_block *from),
- ARGIN(const SymReg *label))
+bb_findadd_edge(ARGMOD(imc_info_t *imcc), ARGMOD(IMC_Unit *unit),
+ ARGIN(Basic_block *from), ARGIN(const SymReg *label))
{
ASSERT_ARGS(bb_findadd_edge)
- Instruction *ins;
- const SymReg * const r = find_sym(interp, label->name);
+ const SymReg * const r = find_sym(imcc, label->name);
if (r && (r->type & VTADDRESS) && r->first_ins)
- bb_add_edge(interp, unit, from, unit->bb_list[r->first_ins->bbindex]);
+ bb_add_edge(imcc, unit, from, unit->bb_list[r->first_ins->bbindex]);
else {
- IMCC_debug(interp, DEBUG_CFG, "register branch %d ", from->end);
+ const Instruction *ins;
+ IMCC_debug(imcc, DEBUG_CFG, "register branch %d ", from->end);
for (ins = from->end; ins; ins = ins->prev) {
if ((ins->type & ITBRANCH)
&& STREQ(ins->opname, "set_addr")
&& ins->symregs[1]->first_ins) {
- bb_add_edge(interp, unit, from,
+ bb_add_edge(imcc, unit, from,
unit-> bb_list[ins->symregs[1]->first_ins->bbindex]);
- IMCC_debug(interp, DEBUG_CFG, "(%s) ", ins->symregs[1]->name);
+ IMCC_debug(imcc, DEBUG_CFG, "(%s) ", ins->symregs[1]->name);
break;
}
}
- IMCC_debug(interp, DEBUG_CFG, "\n");
+ IMCC_debug(imcc, DEBUG_CFG, "\n");
}
}
/*
-=item C<int blocks_are_connected(const Basic_block *from, const Basic_block
-*to)>
+=item C<static int blocks_are_connected(const Basic_block *from, const
+Basic_block *to)>
Returns true or false whether the given blocks are linked.
@@ -496,10 +522,8 @@ Returns true or false whether the given blocks are linked.
*/
PARROT_WARN_UNUSED_RESULT
-PARROT_PURE_FUNCTION
-int
-blocks_are_connected(ARGIN(const Basic_block *from),
- ARGIN(const Basic_block *to))
+static int
+blocks_are_connected(ARGIN(const Basic_block *from), ARGIN(const Basic_block *to))
{
ASSERT_ARGS(blocks_are_connected)
const Edge *pred = to->pred_list;
@@ -518,7 +542,7 @@ blocks_are_connected(ARGIN(const Basic_block *from),
/*
-=item C<static void bb_add_edge(PARROT_INTERP, IMC_Unit *unit, Basic_block
+=item C<static void bb_add_edge(imc_info_t *imcc, IMC_Unit *unit, Basic_block
*from, Basic_block *to)>
Adds an edge between the two given blocks.
@@ -528,7 +552,7 @@ Adds an edge between the two given blocks.
*/
static void
-bb_add_edge(PARROT_INTERP,
+bb_add_edge(ARGMOD(imc_info_t *imcc),
ARGMOD(IMC_Unit *unit),
ARGIN(Basic_block *from),
ARGMOD(Basic_block *to))
@@ -540,7 +564,7 @@ bb_add_edge(PARROT_INTERP,
/* we assume that the data is correct, and thus if the edge is not
* on the predecessors of 'from', it won't be on the successors of 'to' */
- e = mem_gc_allocate_typed(interp, Edge);
+ e = mem_gc_allocate_typed(imcc->interp, Edge);
e->succ_next = from->succ_list;
e->from = from;
@@ -672,7 +696,7 @@ edge_count(ARGIN(const IMC_Unit *unit))
/*
-=item C<void compute_dominators(PARROT_INTERP, IMC_Unit *unit)>
+=item C<void compute_dominators(imc_info_t *imcc, IMC_Unit *unit)>
Computes the dominators tree of the CFG. Basic block A dominates B if each
path to B passes through A
@@ -684,7 +708,7 @@ See gcc:flow.c compute_dominators
*/
void
-com