Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fix conflicts after merge to newest master

  • Loading branch information...
commit 3fe43f8234974aab3d7e55d36a9e5c484d2d3dc2 2 parents a074845 + 65e6ab7
@Whiteknight Whiteknight authored
Showing with 6,942 additions and 7,739 deletions.
  1. +0 −33 .gitignore
  2. +20 −2 ChangeLog
  3. +2 −20 MANIFEST
  4. +0 −64 MANIFEST.SKIP
  5. +2 −2 MANIFEST.generated
  6. +1 −0  PBC_COMPAT
  7. +1 −1  README
  8. +1 −1  VERSION
  9. +0 −2  compilers/imcc/Rules.in
  10. +1 −1  compilers/imcc/main.c
  11. +0 −1  compilers/imcc/parser_util.c
  12. +7 −3 compilers/pct/src/PCT/HLLCompiler.pir
  13. +0 −8 config/gen/makefiles.pm
  14. +0 −67 config/gen/makefiles/ext.in
  15. +9 −27 config/gen/makefiles/root.in
  16. +2 −5 docs/embed.pod
  17. +2 −1  docs/parrothist.pod
  18. +2 −2 docs/pdds/pdd10_embedding.pod
  19. +10 −0 docs/pdds/pdd17_pmc.pod
  20. +19 −30 docs/project/release_manager_guide.pod
  21. +1 −2  docs/tests.pod
  22. +0 −1  examples/c/pbc_info.c
  23. +1 −1  examples/c/test_main.c
  24. +0 −1  examples/compilers/japhc.c
  25. +1 −1  examples/embed/cotorra.c
  26. +3 −0  examples/languages/abc/src/parser/actions.nqp
  27. +1 −0  examples/languages/abc/t/abc_functions
  28. +0 −141 ext/Parrot-Embed/Build.PL
  29. +0 −17 ext/Parrot-Embed/Changes
  30. +0 −12 ext/Parrot-Embed/MANIFEST
  31. +0 −28 ext/Parrot-Embed/README
  32. +0 −10 ext/Parrot-Embed/TODO
  33. +0 −57 ext/Parrot-Embed/lib/Parrot/Embed.pm
  34. +0 −251 ext/Parrot-Embed/lib/Parrot/Embed.xs
  35. +0 −129 ext/Parrot-Embed/lib/Parrot/Interpreter.pm
  36. +0 −93 ext/Parrot-Embed/lib/Parrot/PMC.pm
  37. +0 −39 ext/Parrot-Embed/t/00-load.t
  38. +0 −28 ext/Parrot-Embed/t/greet.pir
  39. +0 −108 ext/Parrot-Embed/t/interp.t
  40. +0 −40 ext/Parrot-Embed/t/languages.t
  41. +0 −82 ext/Parrot-Embed/t/pipp.t
  42. +0 −63 ext/Parrot-Embed/tools/check_embed_coverage.pl
  43. +0 −26 ext/Parrot-Embed/tools/write_typemap.pl
  44. +0 −35 ext/Parrot-Embed/typemap
  45. +5,121 −5,114 ext/winxed/compiler.pir
  46. +15 −123 frontend/parrot2/prt0.pir
  47. +5 −3 frontend/parrot2/prt0.winxed
  48. +12 −17 frontend/parrot_debugger/main.c
  49. +0 −6 frontend/pbc_disassemble/main.c
  50. +6 −6 frontend/pbc_dump/main.c
  51. +0 −8 frontend/pbc_merge/main.c
  52. +43 −0 include/parrot/disassemble.h
  53. +0 −119 include/parrot/embed.h
  54. +13 −0 include/parrot/hash.h
  55. +1 −1  include/parrot/io.h
  56. +1 −1  include/parrot/oplib/core_ops.h
  57. +2 −2 include/parrot/packfile.h
  58. +1 −0  include/parrot/parrot.h
  59. +1 −0  include/parrot/platform_interface.h
  60. +1 −1  lib/Parrot/Harness/DefaultTests.pm
  61. +1 −1  ports/debian/rules
  62. +3 −3 runtime/parrot/library/Archive/Tar.pir
  63. +2 −2 runtime/parrot/library/Archive/Zip.pir
  64. +3 −3 runtime/parrot/library/distutils.pir
  65. +3 −2 runtime/parrot/library/postgres.pir
  66. +0 −2  src/debug.c
  67. +243 −0 src/disassemble.c
  68. +2 −0  src/dynpmc/dynlexpad.pmc
  69. +151 −127 src/dynpmc/select.pmc
  70. +0 −545 src/embed.c
  71. +0 −1  src/embed/api.c
  72. +0 −1  src/embed/bytecode.c
  73. +76 −0 src/hash.c
  74. +6 −7 src/io/buffer.c
  75. +0 −1  src/ops/core.ops
  76. +4 −5 src/ops/core_ops.c
  77. +73 −3 src/packfile/api.c
  78. +0 −1  src/packfile/pf_private.h
  79. +1 −0  src/platform/generic/io.c
  80. +1 −0  src/platform/win32/io.c
  81. +38 −4 src/pmc/bytebuffer.pmc
  82. +32 −7 src/pmc/default.pmc
  83. +63 −0 src/pmc/fixedfloatarray.pmc
  84. +33 −0 src/pmc/fixedintegerarray.pmc
  85. +26 −0 src/pmc/fixedpmcarray.pmc
  86. +28 −0 src/pmc/fixedstringarray.pmc
  87. +16 −0 src/pmc/hash.pmc
  88. +11 −8 src/pmc/imageiosize.pmc
  89. +179 −2 src/pmc/opcode.pmc
  90. +128 −8 src/pmc/oplib.pmc
  91. +1 −3 src/pmc/packfile.pmc
  92. +5 −1 src/pmc/packfileannotations.pmc
  93. +100 −29 src/pmc/packfiledebug.pmc
  94. +40 −2 src/pmc/packfileopmap.pmc
  95. +0 −1  src/pmc/parrotinterpreter.pmc
  96. +10 −2 src/pmc/pointer.pmc
  97. +5 −3 src/pmc/scheduler.pmc
  98. +1 −1  src/pmc/socket.pmc
  99. +1 −1  src/pmc/undef.pmc
  100. +0 −1  src/runcore/cores.c
  101. +0 −1  src/runcore/profiling.c
  102. +0 −1  src/runcore/subprof.c
  103. +1 −1  t/compilers/opsc/01-parse.t
  104. +7 −2 t/dynpmc/select.t
  105. +2 −1  t/library/pg.t
  106. BIN  t/native_pbc/number.pbc
  107. BIN  t/native_pbc/string.pbc
  108. +9 −1 t/pmc/fixedbooleanarray.t
  109. +13 −1 t/pmc/fixedfloatarray.t
  110. +2 −0  t/pmc/fixedintegerarray.t
  111. +29 −4 t/pmc/fixedpmcarray.t
  112. +49 −0 t/pmc/hash.t
  113. +9 −0 t/pmc/packfileopmap.t
  114. +38 −1 t/pmc/resizablefloatarray.t
  115. +38 −1 t/pmc/resizableintegerarray.t
  116. +38 −1 t/pmc/resizablepmcarray.t
  117. +38 −1 t/pmc/resizablestringarray.t
  118. +9 −38 t/src/embed.t
  119. +0 −1  t/src/embed/api.t
  120. +0 −1  t/src/embed/strings.t
  121. +0 −1  t/src/exit.t
  122. +49 −43 t/src/extend.t
  123. +1 −1  t/src/extend_vtable.t
  124. +0 −2  t/src/misc.t
  125. +0 −2  t/src/pointer_array.t
  126. +0 −2  t/src/warnings.t
  127. +1 −1  t/tools/dev/search_ops/samples.pm
  128. +6 −1 tools/dev/mk_inno_language.pl
  129. +3 −11 tools/dev/mk_language_shell.in
  130. +6 −6 tools/release/release.json
View
33 .gitignore
@@ -180,39 +180,6 @@ cachegrind.out.*
/examples/pir/befunge/MANIFEST
/examples/pir/befunge/befunge
/examples/pir/befunge/installable_befunge
-/ext/Makefile
-/ext/Parrot-Embed/*.bs
-/ext/Parrot-Embed/*.bundle
-/ext/Parrot-Embed/*.c
-/ext/Parrot-Embed/*.def
-/ext/Parrot-Embed/*.dll
-/ext/Parrot-Embed/*.dump
-/ext/Parrot-Embed/*.dylib
-/ext/Parrot-Embed/*.exe
-/ext/Parrot-Embed/*.exp
-/ext/Parrot-Embed/*.h
-/ext/Parrot-Embed/*.ilk
-/ext/Parrot-Embed/*.lib
-/ext/Parrot-Embed/*.manifest
-/ext/Parrot-Embed/*.o
-/ext/Parrot-Embed/*.obj
-/ext/Parrot-Embed/*.old
-/ext/Parrot-Embed/*.pdb
-/ext/Parrot-Embed/*.pdb
-/ext/Parrot-Embed/*.so
-/ext/Parrot-Embed/*.tmp
-/ext/Parrot-Embed/*.xs
-/ext/Parrot-Embed/Build
-/ext/Parrot-Embed/Build.bat
-/ext/Parrot-Embed/Makefile
-/ext/Parrot-Embed/Makefile.PL
-/ext/Parrot-Embed/_build
-/ext/Parrot-Embed/blib
-/ext/Parrot-Embed/dll.base
-/ext/Parrot-Embed/pm_to_blib
-/ext/Parrot-Embed/lib/Parrot/*.c
-/ext/Parrot-Embed/lib/Parrot/*.obj
-/ext/Parrot-Embed/t/*.pbc
/ext/nqp-rx/src/stage0/nqp-setting.pir
/frontend/parrot/main.o
/frontend/parrot2/main.o
View
22 ChangeLog
@@ -1,3 +1,13 @@
+2011-11-15 release 3.10.0
+ - Core
+ + The mark VTABLE was added to the Select PMC
+ + The Parrot::Embed Perl 5 module was removed from parrot.git and now lives
+ at https://github.com/parrot/parrot-embed
+ - Languages
+ - Community
+ - Documentation
+ - Tests
+
2011-10-18 release 3.9.0
- Core
+ The whiteknight/kill_threads branch was merged, which removes the old and broken
@@ -9,13 +19,21 @@
useful and caused hard-to-find bugs.
+ A new subroutine profiling runcore was added. It can be enabled with the command-line
argument of -R subprof . The resulting data can be analyzed with kcachegrind.
+ + Added get_string VTABLE to FixedIntegerArray and FixedFloatArray PMCs
+ + The update() method was added to the Hash PMC, which updates one Hash with the contents
+ of another. This speeds up rakudo/nqp startup time.
- Languages
+ Winxed
- - Updated snapshot
+ - Updated snapshot to version 1.3.0
+ - Added the builtin sleep
+ - Modifier 'multi' allows some more multi functionality
- Community
+ New repo for the Parrot Alternate Compiler Toolkit, a re-implementation of
- PCT in Winxed: https://github.com/parrot/PACT
+ PCT in Winxed: https://github.com/parrot/PACT
- Documentation
+ + We are in the process to migrating our Trac wiki at http://trac.parrot.org/ to Github
+ at https://github.com/parrot/parrot/wiki
+ + Packfile PMC documentation was updated
- Tests
+ Select PMC tests improved to pass on non-Linuxy platforms
View
22 MANIFEST
@@ -219,7 +219,6 @@ config/gen/core_pmcs.pm []
config/gen/makefiles.pm []
config/gen/makefiles/docs.in []
config/gen/makefiles/editor.in []
-config/gen/makefiles/ext.in []
config/gen/makefiles/parrot_embed_pl.in []
config/gen/makefiles/root.in []
config/gen/opengl.pm []
@@ -782,23 +781,6 @@ examples/tutorial/81_continuation.pir [examples]
examples/tutorial/82_coroutine.pir [examples]
examples/tutorial/83_external_libraries.pir [examples]
examples/tutorial/90_writing_tests.pir [examples]
-ext/Parrot-Embed/Build.PL []
-ext/Parrot-Embed/Changes []
-ext/Parrot-Embed/MANIFEST []
-ext/Parrot-Embed/README []doc
-ext/Parrot-Embed/TODO []
-ext/Parrot-Embed/lib/Parrot/Embed.pm []
-ext/Parrot-Embed/lib/Parrot/Embed.xs []
-ext/Parrot-Embed/lib/Parrot/Interpreter.pm []
-ext/Parrot-Embed/lib/Parrot/PMC.pm []
-ext/Parrot-Embed/t/00-load.t [test]
-ext/Parrot-Embed/t/greet.pir [test]
-ext/Parrot-Embed/t/interp.t [test]
-ext/Parrot-Embed/t/languages.t [test]
-ext/Parrot-Embed/t/pipp.t [test]
-ext/Parrot-Embed/tools/check_embed_coverage.pl []
-ext/Parrot-Embed/tools/write_typemap.pl []
-ext/Parrot-Embed/typemap []
ext/nqp-rx/CREDITS []
ext/nqp-rx/Defines.mak []
ext/nqp-rx/LICENSE []
@@ -893,8 +875,8 @@ include/parrot/context.h [main]include
include/parrot/core_types.h [main]include
include/parrot/datatypes.h [main]include
include/parrot/debugger.h [main]include
+include/parrot/disassemble.h [main]include
include/parrot/dynext.h [main]include
-include/parrot/embed.h [main]include
include/parrot/encoding.h [main]include
include/parrot/enums.h [main]include
include/parrot/events.h [main]include
@@ -1187,6 +1169,7 @@ src/call/ops.c []
src/call/pcc.c []
src/datatypes.c []
src/debug.c []
+src/disassemble.c []
src/dynext.c []
src/dynoplibs/Defines.in []
src/dynoplibs/README []doc
@@ -1214,7 +1197,6 @@ src/dynpmc/rational.pmc []
src/dynpmc/rotest.pmc []
src/dynpmc/select.pmc []
src/dynpmc/subproxy.pmc []
-src/embed.c []
src/embed/api.c []
src/embed/bytecode.c []
src/embed/embed_private.h []
View
64 MANIFEST.SKIP
@@ -264,70 +264,6 @@
^/examples/pir/befunge/befunge/
^/examples/pir/befunge/installable_befunge$
^/examples/pir/befunge/installable_befunge/
-^/ext/Makefile$
-^/ext/Makefile/
-^/ext/Parrot-Embed/.*\.bs$
-^/ext/Parrot-Embed/.*\.bs/
-^/ext/Parrot-Embed/.*\.bundle$
-^/ext/Parrot-Embed/.*\.bundle/
-^/ext/Parrot-Embed/.*\.c$
-^/ext/Parrot-Embed/.*\.c/
-^/ext/Parrot-Embed/.*\.def$
-^/ext/Parrot-Embed/.*\.def/
-^/ext/Parrot-Embed/.*\.dll$
-^/ext/Parrot-Embed/.*\.dll/
-^/ext/Parrot-Embed/.*\.dump$
-^/ext/Parrot-Embed/.*\.dump/
-^/ext/Parrot-Embed/.*\.dylib$
-^/ext/Parrot-Embed/.*\.dylib/
-^/ext/Parrot-Embed/.*\.exe$
-^/ext/Parrot-Embed/.*\.exe/
-^/ext/Parrot-Embed/.*\.exp$
-^/ext/Parrot-Embed/.*\.exp/
-^/ext/Parrot-Embed/.*\.h$
-^/ext/Parrot-Embed/.*\.h/
-^/ext/Parrot-Embed/.*\.ilk$
-^/ext/Parrot-Embed/.*\.ilk/
-^/ext/Parrot-Embed/.*\.lib$
-^/ext/Parrot-Embed/.*\.lib/
-^/ext/Parrot-Embed/.*\.manifest$
-^/ext/Parrot-Embed/.*\.manifest/
-^/ext/Parrot-Embed/.*\.o$
-^/ext/Parrot-Embed/.*\.o/
-^/ext/Parrot-Embed/.*\.obj$
-^/ext/Parrot-Embed/.*\.obj/
-^/ext/Parrot-Embed/.*\.old$
-^/ext/Parrot-Embed/.*\.old/
-^/ext/Parrot-Embed/.*\.pdb$
-^/ext/Parrot-Embed/.*\.pdb/
-^/ext/Parrot-Embed/.*\.so$
-^/ext/Parrot-Embed/.*\.so/
-^/ext/Parrot-Embed/.*\.tmp$
-^/ext/Parrot-Embed/.*\.tmp/
-^/ext/Parrot-Embed/.*\.xs$
-^/ext/Parrot-Embed/.*\.xs/
-^/ext/Parrot-Embed/Build$
-^/ext/Parrot-Embed/Build/
-^/ext/Parrot-Embed/Build\.bat$
-^/ext/Parrot-Embed/Build\.bat/
-^/ext/Parrot-Embed/Makefile$
-^/ext/Parrot-Embed/Makefile/
-^/ext/Parrot-Embed/Makefile\.PL$
-^/ext/Parrot-Embed/Makefile\.PL/
-^/ext/Parrot-Embed/_build$
-^/ext/Parrot-Embed/_build/
-^/ext/Parrot-Embed/blib$
-^/ext/Parrot-Embed/blib/
-^/ext/Parrot-Embed/dll\.base$
-^/ext/Parrot-Embed/dll\.base/
-^/ext/Parrot-Embed/lib/Parrot/.*\.c$
-^/ext/Parrot-Embed/lib/Parrot/.*\.c/
-^/ext/Parrot-Embed/lib/Parrot/.*\.obj$
-^/ext/Parrot-Embed/lib/Parrot/.*\.obj/
-^/ext/Parrot-Embed/pm_to_blib$
-^/ext/Parrot-Embed/pm_to_blib/
-^/ext/Parrot-Embed/t/.*\.pbc$
-^/ext/Parrot-Embed/t/.*\.pbc/
^/ext/nqp-rx/src/stage0/nqp-setting\.pir$
^/ext/nqp-rx/src/stage0/nqp-setting\.pir/
^/frontend/parrot/.*\.gcda$
View
4 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.3.8.0.dylib [main]lib
+blib/lib/libparrot.3.9.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.8.0 [main]lib
+blib/lib/libparrot.so.3.9.0 [main]lib
compilers/data_json/data_json.pbc [data_json]
config/gen/call_list/opengl.in []
docs/ops/bit.pod [doc]
View
1  PBC_COMPAT
@@ -28,6 +28,7 @@
# please insert tab separated entries at the top of the list
+12.0 2011.10.18 dukeleto released 3.9.0
11.0 2011.07.19 jkeenan released 3.6.0
10.0 2011.01.18 cotto released 3.0.0
9.0 2010.10.19 gerd released 2.9.0
View
2  README
@@ -1,4 +1,4 @@
-This is Parrot, version 3.8.0
+This is Parrot, version 3.9.0
------------------------------
Parrot is Copyright (C) 2001-2011, Parrot Foundation.
View
2  VERSION
@@ -1 +1 @@
-3.8.0
+3.9.0
View
2  compilers/imcc/Rules.in
@@ -87,7 +87,6 @@ compilers/imcc/parser_util$(O) : \
include/imcc/yyscanner.h \
include/imcc/embed.h \
$(INC_DIR)/dynext.h \
- $(INC_DIR)/embed.h \
$(INC_DIR)/oplib/ops.h \
$(PARROT_H_HEADERS) \
include/pmc/pmc_sub.h
@@ -192,7 +191,6 @@ compilers/imcc/main$(O) : \
compilers/imcc/symreg.h \
compilers/imcc/unit.h \
include/imcc/yyscanner.h \
- $(INC_DIR)/embed.h \
$(INC_DIR)/oplib/ops.h \
$(INC_DIR)/runcore_api.h \
$(INC_DIR)/api.h \
View
2  compilers/imcc/main.c
@@ -29,7 +29,7 @@ IMCC helpers.
#include <stdlib.h>
#include "imc.h"
-#include "parrot/embed.h"
+#include "parrot/parrot.h"
#include "parrot/longopt.h"
#include "parrot/runcore_api.h"
#include "pmc/pmc_callcontext.h"
View
1  compilers/imcc/parser_util.c
@@ -19,7 +19,6 @@
#include "imc.h"
#include "parrot/dynext.h"
-#include "parrot/embed.h"
#include "pmc/pmc_sub.h"
#include "pmc/pmc_callcontext.h"
#include "pbc.h"
View
10 compilers/pct/src/PCT/HLLCompiler.pir
@@ -855,6 +855,10 @@ Generic method for compilers invoked from a shell command line.
$I0 = adverbs['version']
if $I0 goto version
+ .local string target
+ target = adverbs['target']
+ target = downcase target
+
.local int can_backtrace, ll_backtrace
can_backtrace = can self, 'backtrace'
unless can_backtrace goto no_push_eh
@@ -882,6 +886,9 @@ Generic method for compilers invoked from a shell command line.
goto save_output
eval_line:
result = self.'eval'($S0, '-e', args :flat, adverbs :flat :named)
+ if target == '' goto save_output
+ if target == 'pir' goto save_output
+ '_dumper'(result, target)
save_output:
unless can_backtrace goto no_pop_eh
@@ -890,9 +897,6 @@ Generic method for compilers invoked from a shell command line.
if null result goto end
$I0 = defined result
unless $I0 goto end
- .local string target
- target = adverbs['target']
- target = downcase target
if target != 'pir' goto end
.local string output
.local pmc ofh
View
8 config/gen/makefiles.pm
@@ -29,9 +29,6 @@ sub _init {
'Makefile' => {
SOURCE => 'config/gen/makefiles/root.in',
},
- 'ext/Makefile' => {
- SOURCE => 'config/gen/makefiles/ext.in',
- },
'compilers/imcc/Rules.mak' => {
SOURCE => 'compilers/imcc/Rules.in',
},
@@ -42,11 +39,6 @@ sub _init {
SOURCE => 'src/dynoplibs/Defines.in',
},
- 'ext/Parrot-Embed/Makefile.PL' => {
- SOURCE => 'config/gen/makefiles/parrot_embed_pl.in',
- conditioned_lines => 1,
- },
-
'src/dynpmc/Rules.mak' => {
SOURCE => 'src/dynpmc/Rules.in',
},
View
67 config/gen/makefiles/ext.in
@@ -1,67 +0,0 @@
-# Copyright (C) 2006-2009, Parrot Foundation.
-
-# setup of commands
-@make_set_make@
-MAKE = @make@
-PERL = @perl@
-RM_F = @rm_f@
-
-# add new languages here
-# remove obsolete languages here
-EXT = \
- Parrot-Embed
-
-# the default target
-all: $(EXT)
-
-# hard-code these for now
-test: Parrot-Embed
- - cd Parrot-Embed && $(MAKE) test
-
-
-# This is a listing of all targets, that are meant to be called by users
-help:
- @echo ""
- @echo "Following targets are available for the user:"
- @echo ""
- @echo " all: Make a lot of language implementations."
- @echo " This is the default."
- @echo " test: Unified test suite for a lot of languages."
- @echo ""
- @echo " clean: Clean up a lot of languages."
- @echo ""
- @echo " help: Print this help message."
- @echo ""
- @echo "Following languages are available:"
- @echo " $(LANGUAGES)"
- @echo "A particular language <lang> can be built, tested and cleand up"
- @echo " make <lang>"
- @echo " make <lang>.test"
- @echo " make <lang>.clean"
- @echo "For the status of individual languages see:"
- @echo " https://trac.parrot.org/parrot/wiki/Languages"
- @echo ""
-
-clean: \
- Parrot-Embed.clean
-
-#
-# Extension specific targets
-#
-
-# The *.dummy targets are a replacement for the target .PHONY in 'GNU make'
-
-Parrot-Embed : Parrot-Embed.dummy
-
-Parrot-Embed.dummy:
-#IF(win32): - cd Parrot-Embed && $(PERL) Makefile.PL && nmake
-#UNLESS(win32): - cd Parrot-Embed && $(PERL) Makefile.PL && $(MAKE)
-
-Parrot-Embed.clean:
-#IF(win32): - cd Parrot-Embed && nmake clean
-#UNLESS(win32): - cd Parrot-Embed && $(MAKE) clean
-
-# Local variables:
-# mode: makefile
-# End:
-# vim: ft=make:
View
36 config/gen/makefiles/root.in
@@ -151,7 +151,6 @@ GEN_MAKEFILES = \
Makefile \
docs/Makefile \
editor/Makefile \
- ext/Makefile \
src/dynoplibs/Rules.mak \
src/dynoplibs/Defines.mak \
src/dynpmc/Rules.mak \
@@ -214,7 +213,6 @@ GEN_PM_INCLUDES = \
CONFIGURE_GENERATED_FILES = \
$(GEN_CONFIGS) \
$(GEN_MAKEFILES) \
- ext/Parrot-Embed/Makefile.PL \
myconfig \
MANIFEST.configure.generated \
.configure_trace.sto \
@@ -376,6 +374,7 @@ PARROT_H_HEADERS = \
$(INC_DIR)/pmc_freeze.h \
$(INC_DIR)/vtable.h \
$(INC_DIR)/context.h \
+ $(INC_DIR)/disassemble.h \
$(INC_DIR)/exceptions.h \
$(INC_DIR)/warnings.h \
$(INC_DIR)/memory.h \
@@ -439,8 +438,8 @@ INTERP_O_FILES = \
src/core_pmcs$(O) \
src/datatypes$(O) \
src/debug$(O) \
+ src/disassemble$(O) \
src/dynext$(O) \
- src/embed$(O) \
src/embed/api$(O) \
src/embed/bytecode$(O) \
src/embed/strings$(O) \
@@ -714,7 +713,6 @@ STR_FILES = \
src/string/api.str \
src/string/encoding.str \
src/sub.str \
- src/embed.str \
$(CLASS_STR_FILES)
src/string/private_cstring.h : $(STR_FILES) $(BUILD_TOOLS_DIR)/c2str.pl
@@ -1092,8 +1090,7 @@ $(INSTALLABLEPARROT_PROVE) : parrot-prove.pbc $(PBC_TO_EXE) src/install_config$(
frontend/parrot_debugger/main$(O) : \
$(PARROT_H_HEADERS) \
frontend/parrot_debugger/main.c \
- $(INC_DIR)/runcore_api.h \
- $(INC_DIR)/embed.h
+ $(INC_DIR)/runcore_api.h
$(PDB) : frontend/parrot_debugger/main$(O) src/parrot_config$(O) $(LIBPARROT)
$(LINK) @ld_out@$@ \
@@ -1150,7 +1147,6 @@ $(PDUMP) : frontend/pbc_dump/main$(O) frontend/pbc_dump/packdump$(O) $(LIBPARROT
frontend/pbc_dump/main$(O) : \
$(INC_DIR)/longopt.h \
$(INC_DIR)/api.h \
- $(INC_DIR)/embed.h \
$(INC_DIR)/oplib/ops.h \
$(INC_DIR)/oplib/core_ops.h \
$(PARROT_H_HEADERS) \
@@ -1489,9 +1485,8 @@ src/runcore/trace$(O) : \
$(INC_DIR)/oplib/core_ops.h \
$(INC_DIR)/runcore_api.h
-src/debug$(O) : $(INC_DIR)/embed.h \
+src/debug$(O) : \
$(PARROT_H_HEADERS) src/debug.c \
- $(EXTEND_HEADERS) \
$(INC_DIR)/oplib/ops.h \
$(INC_DIR)/oplib/core_ops.h \
$(INC_DIR)/runcore_api.h $(INC_DIR)/runcore_trace.h \
@@ -1550,7 +1545,6 @@ src/runcore/main$(O) : \
src/runcore/subprof$(O) : src/runcore/subprof.str src/runcore/subprof.c \
$(INC_DIR)/dynext.h \
- $(INC_DIR)/embed.h \
$(INC_DIR)/oplib/core_ops.h \
$(INC_DIR)/oplib/ops.h \
$(INC_DIR)/runcore_api.h \
@@ -1562,7 +1556,7 @@ src/runcore/profiling$(O) : src/runcore/profiling.str src/runcore/profiling.c \
$(INC_PMC_DIR)/pmc_sub.h \
$(INC_PMC_DIR)/pmc_namespace.h \
$(INC_DIR)/oplib/core_ops.h $(INC_DIR)/runcore_api.h \
- $(INC_DIR)/runcore_profiling.h $(INC_DIR)/embed.h \
+ $(INC_DIR)/runcore_profiling.h \
$(PARROT_H_HEADERS) \
$(EXTEND_HEADERS)
@@ -1667,9 +1661,8 @@ src/packfile/api$(O) : \
$(INC_PMC_DIR)/pmc_packfileview.h \
$(INC_DIR)/oplib/core_ops.h \
$(INC_DIR)/dynext.h \
- $(INC_DIR)/embed.h \
- $(PARROT_H_HEADERS) \
$(EXTEND_HEADERS) \
+ $(PARROT_H_HEADERS) \
$(INC_DIR)/runcore_api.h
src/packfile/output$(O) : \
@@ -1679,7 +1672,6 @@ src/packfile/output$(O) : \
$(INC_DIR)/dynext.h \
$(INC_DIR)/runcore_api.h \
src/packfile/pf_private.h \
- $(INC_DIR)/embed.h \
$(INC_DIR)/oplib/core_ops.h \
src/packfile/output.c
@@ -1693,7 +1685,6 @@ src/packfile/segments$(O) : \
src/packfile/segments.str \
$(INC_DIR)/oplib/core_ops.h \
$(INC_DIR)/dynext.h \
- $(INC_DIR)/embed.h \
$(PARROT_H_HEADERS) \
$(EXTEND_HEADERS) \
src/packfile/pf_private.h \
@@ -1787,28 +1778,22 @@ src/platform/win32/uid$(O) : src/platform/win32/uid.c $(PARROT_H_HEADERS)
src/runcore/cores$(O) : src/runcore/cores.str \
src/runcore/cores.c \
$(INC_PMC_DIR)/pmc_sub.h \
- $(INC_DIR)/dynext.h $(INC_DIR)/embed.h $(INC_DIR)/oplib/core_ops.h \
+ $(INC_DIR)/dynext.h $(INC_DIR)/oplib/core_ops.h \
$(INC_DIR)/oplib/ops.h \
$(INC_DIR)/runcore_api.h $(INC_DIR)/runcore_trace.h \
$(PARROT_H_HEADERS)
-src/embed$(O) : \
+src/disassemble$(O) : \
$(PARROT_H_HEADERS) \
- $(EXTEND_HEADERS) \
- src/embed.c \
- src/embed.str \
+ src/disassemble.c \
$(INC_DIR)/oplib/ops.h \
- $(INC_DIR)/embed.h \
$(INC_DIR)/runcore_api.h \
$(INC_DIR)/oplib/core_ops.h \
$(INC_PMC_DIR)/pmc_sub.h \
- include/imcc/embed.h \
- include/imcc/yyscanner.h \
src/embed/api$(O) : \
$(PARROT_H_HEADERS) \
$(INC_DIR)/api.h \
- $(INC_DIR)/embed.h \
$(INC_DIR)/runcore_api.h \
src/embed/api.c \
src/embed/embed_private.h \
@@ -1817,7 +1802,6 @@ src/embed/api$(O) : \
src/embed/bytecode$(O) : \
$(PARROT_H_HEADERS) \
$(INC_DIR)/api.h \
- $(INC_DIR)/embed.h \
$(INC_DIR)/runcore_api.h \
src/embed/bytecode.c \
src/embed/embed_private.h \
@@ -1968,7 +1952,6 @@ src/string/encoding/ucs4$(O) : \
src/string/encoding/unicode.h
frontend/pbc_merge/main$(O) : \
- $(INC_DIR)/embed.h \
$(INC_DIR)/api.h \
$(INC_DIR)/longopt.h \
frontend/pbc_merge/main.c \
@@ -1990,7 +1973,6 @@ src/packfile/pf_items$(O) : $(PARROT_H_HEADERS) src/packfile/pf_items.c
src/ops/core_ops$(O) : src/ops/core_ops.c \
$(PARROT_H_HEADERS) \
$(INC_DIR)/dynext.h \
- $(INC_DIR)/embed.h \
$(INC_DIR)/oplib/core_ops.h \
$(INC_DIR)/runcore_api.h \
$(INC_PMC_DIR)/pmc_continuation.h \
View
7 docs/embed.pod
@@ -12,8 +12,8 @@ for the newer API is located at F<docs/embed_new.pod>.
=head1 SYNOPSIS
- #include <parrot/embed.h>
- #include <parrot/extend.h>
+ #include "parrot/parrot.h"
+ #include "parrot/extend.h"
int main(int argc, char* argv[])
{
@@ -39,8 +39,6 @@ for the newer API is located at F<docs/embed_new.pod>.
=over 4
-=item F<include/parrot/embed.h>
-
=item F<include/parrot/extend.h>
=back
@@ -462,7 +460,6 @@ performing both compiling and linking in one step.
=head2 Load bytecode as a library and run a single subroutine
#include <parrot/parrot.h>
- #include <parrot/embed.h>
#include <parrot/extend.h>
int main(int argc, char *argv[])
View
3  docs/parrothist.pod
@@ -11,7 +11,7 @@ This document records Parrot source code releases, and their release managers.
Simon Cozens, Jeff Goff, Steve Fink, Leo Toetsch, Chip Salzenberg, Jerry Gay,
Patrick Michaud, Will "coke" Coleda, Matt Diephouse, chromatic, Allison Randal,
Jonathan Worthington, Bob Rogers, Bernhard Schmalhofer, Andrew Whitworth,
-Francois Perrad, Jonathan Leto, Michael Hind, James E Keenan.
+Francois Perrad, Jonathan "Duke" Leto, Michael Hind, James E Keenan.
=head1 THE RECORDS
@@ -132,5 +132,6 @@ Starred release numbers indicate supported releases.
jkeenan 3.6.0 * 2011-Jul-19 "Pájaros del Caribe"
coke 3.7.0 2011-Aug-16 "Wanda"
soh_cah_toa 3.8.0 2011-Sep-20 "Magrathea"
+ dukeleto 3.9.0 * 2011-Oct-18 "Archaeopteryx"
=cut
View
4 docs/pdds/pdd10_embedding.pod
@@ -108,7 +108,7 @@ do less work through the API, and more work through bytecode and the runcore.
=item * The embed API uses a single header file: L<include/parrot/api.h>.
Embedding applications should use only this header file and no other header
files from Parrot. Embedding applications should NOT use
-L<include/parrot/parrot.h> or L<include/parrot/embed.h>, or any other files.
+L<include/parrot/parrot.h>, or any other files.
=item * libparrot does little to no signal handling. Those are typically the
responsibility of the embedder.
@@ -246,7 +246,7 @@ later use.
Currently there are two functions to get a bytecode PMC.
- Parrot_api_load_bytecode(interp, filename, *pbc)
+ Parrot_api_load_bytecode_file(interp, filename, *pbc)
Parrot_api_load_bytecode_bytes(interp, bytecode, size, *pbc)
The first function loads bytecode from a file. The second loads bytecode in
View
10 docs/pdds/pdd17_pmc.pod
@@ -434,6 +434,16 @@ null value passed as the initializer parameter is allowed.
NOTE: It is strongly suggested that init_pmc(PMCNULL) be equivalent to
init(), though there will of necessity be exceptions.
+=item init_init
+
+ void init_int(INTERP, PMC *self, INTVAL initializer)
+
+Alternative entry point called when a PMC is first instantiated. Accepts an
+integer parameter used to initialize the given object. Interpretation of the
+integer initializer is left open, each PMC is free to choose its own
+implementation. This is very useful for PMCs that require an integer size
+parameter and is used as such in FixedPMCArray and related.
+
=item instantiate
PMC* instantiate(INTERP, PMC *self, PMC *init)
View
49 docs/project/release_manager_guide.pod
@@ -367,7 +367,7 @@ necessary) to add a "highlights" section to draw attention to major new
features. If you do, be sure to say the same thing in both text and HTML
versions.
-Be sure to include the SHA1 sums of the tarballs in the release announcement
+Be sure to include the SHA256 sums of the tarballs in the release announcement
which are automatically generated by C<make release>.
=head2 IX. Update the Website
@@ -458,7 +458,7 @@ Modify the topic on C<#parrot>:
=item 4
-Update the wiki frontpage at L<http://trac.parrot.org/parrot/>.
+Update the wiki frontpage at L<https://github.com/parrot/parrot/wiki>
=item 5
@@ -471,17 +471,7 @@ Update the C2 wiki entry at L<http://c2.com/cgi/wiki?ParrotCode>.
=back
-=head2 XI. Review the Milestones
-
-Review the milestone for the current release in Trac at
-L<http://trac.parrot.org/parrot/roadmap> and mark it as I<Completed>. Marking a
-milestone as I<Completed> will migrate all open tickets to a selected milestone
-(generally the next milestone). Non-critical tickets can have their milestone
-unset.
-
-Also make sure to close any completed release-related tickets.
-
-=head2 XII. Changes to Trac
+=head2 XI. Changes to Trac
=over 4
@@ -500,9 +490,9 @@ Remove any sufficiently old versions listed there.
=back
-=head2 XIII. Finish
+=head2 XII. Finish
-You're done! Help yourself to a beer, cola, or other celebratory drink.
+You're done! Help yourself to a beer, cola, or other delicious celebratory drink.
=head1 SEE ALSO
@@ -523,21 +513,20 @@ L<http://www.google.com/calendar/render?cid=ldhctdamsgfg5a1cord52po9h8@group.cal
Versions with an asterisk (*) are supported releases:
- - Oct 18, 2011 - 3.9* - dukeleto
- - Nov 15, 2011 - 3.10 - ??
- - Dec 20, 2011 - 3.11 - cotto
- - Jan 17, 2012 - 4.0 - ??
- - Feb 21, 2012 - 4.1 - ??
- - Mar 20, 2012 - 4.2 - ??
- - Apr 17, 2012 - 4.3 - ??
- - May 15, 2012 - 4.4 - ??
- - Jun 19, 2012 - 4.5 - ??
- - Jul 17, 2012 - 4.6 - ??
- - Aug 21, 2012 - 4.7 - ??
- - Sep 18, 2012 - 4.8 - ??
- - Oct 16, 2012 - 4.9 - ??
- - Nov 20, 2012 - 4.10 - ??
- - Dec 18, 2012 - 4.11 - ??
+ - Nov 15, 2011 - 3.10.0 - Whiteknight
+ - Dec 20, 2011 - 3.11.0 - cotto
+ - Jan 17, 2012 - 4.0.0 - ??
+ - Feb 21, 2012 - 4.1.0 - ??
+ - Mar 20, 2012 - 4.2.0 - ??
+ - Apr 17, 2012 - 4.3.0 - ??
+ - May 15, 2012 - 4.4.0 - ??
+ - Jun 19, 2012 - 4.5.0 - ??
+ - Jul 17, 2012 - 4.6.0 - ??
+ - Aug 21, 2012 - 4.7.0 - ??
+ - Sep 18, 2012 - 4.8.0 - ??
+ - Oct 16, 2012 - 4.9.0 - ??
+ - Nov 20, 2012 - 4.10.0 - ??
+ - Dec 18, 2012 - 4.11.0 - ??
=cut
__END__
View
3  docs/tests.pod
@@ -97,7 +97,6 @@ C source tests are usually located in F<t/src/*.t>. A simple test looks like:
c_output_is(<<'CODE', <<'OUTPUT', "name for test");
#include <stdio.h>
#include "parrot/parrot.h"
- #include "parrot/embed.h"
int main(int argc, char* argv[]) {
Parrot_Interp interp;
@@ -190,7 +189,7 @@ errors if make has completed.) You can run them with any of the following:
=head2 Testing language implementations
-Language implementations are usually tested with
+Language implementations are usually tested with
C<language_output_is> and friends.
=head1 Ideal tests:
View
1  examples/c/pbc_info.c
@@ -23,7 +23,6 @@ over the main directory.
*/
#include "parrot/parrot.h"
-#include "parrot/embed.h"
/*
=item C<static INTVAL iter(PARROT_INTERP, PackFile_Segment *seg, void
View
2  examples/c/test_main.c
@@ -21,7 +21,7 @@ sample up to date with respect to the latest parrot functionality.
*/
-#include "parrot/embed.h"
+#include "parrot/parrot.h"
#include "parrot/longopt.h"
#include <stdio.h>
#include <stdlib.h>
View
1  examples/compilers/japhc.c
@@ -27,7 +27,6 @@ example compiler used by japh16.pasm
*/
#include "parrot/parrot.h"
-#include "parrot/embed.h"
#include "../../src/pmc/pmc_sub.h"
#define C_DEBUG 0
View
2  examples/embed/cotorra.c
@@ -25,7 +25,7 @@ options and able to run only pbc files.
#include <stdlib.h>
#include <string.h>
-#include "parrot/embed.h"
+#include "parrot/parrot.h"
#include "parrot/extend.h"
/**********************************************************************/
View
3  examples/languages/abc/src/parser/actions.nqp
@@ -38,6 +38,7 @@ method TOP($/) {
make PAST::Block.new(
:blocktype('declaration'),
:hll('abc'),
+ :loadlibs('trans_ops'),
$<statement_list>.ast);
}
@@ -75,6 +76,7 @@ method statement:sym<expr>($/) {
if pir::typeof__sp($past) ne 'PAST::Op' && ~$past.name() ne '&infix:<=>' {
my $last := PAST::Var.new( :name('last'),
:scope('package'),
+ :namespace(['abc','vars']),
:lvalue(1) );
$past := PAST::Op.new( $last,
$past,
@@ -204,6 +206,7 @@ method term:sym<variable>($/) {
else {
make PAST::Var.new( :name( ~$<name> ),
:scope('package'),
+ :namespace(['abc', 'vars']),
:viviself('Float'),
:lvalue(1),
:node( $/ )
View
1  examples/languages/abc/t/abc_functions
@@ -2,6 +2,7 @@
length(1) 1\n length function
length(11) 2\n length function
length(111) 3\n length function
+length(abc) 1\n abc isn't last - TT161
# read function
# TODO?
View
141 ext/Parrot-Embed/Build.PL
@@ -1,141 +0,0 @@
-#! perl
-
-use strict;
-use warnings;
-
-use Cwd;
-use Config;
-use Module::Build;
-use File::Spec::Functions qw( rel2abs catdir catfile updir path );
-
-diag( my $in_parrot_tree = in_parrot_tree() );
-diag( my $dl_env_var = get_dl_env_var() );
-diag( my ($libp, $incp) = get_paths() );
-diag( my ($cflags, $lflags) = get_compiler_flags( $in_parrot_tree ) );
-diag( my $parrot = get_parrot_path( $in_parrot_tree ) );
-diag( my $path_sep = get_path_separator() );
-
-my $class = Module::Build->subclass(
- code => <<"END_HERE",
- use File::Spec;
-
- sub ACTION_build
- {
- my \$self = shift;
- my \@cmd = ( qw( $parrot -o ),
- map { File::Spec->catfile( 't', "greet.\$_" ) } qw( pbc pir ) );
-
- system( \@cmd ) == 0 or die "Cannot compile PBC for test: \$?";
-
- \$self->SUPER::ACTION_build( \@_ );
- }
-
- sub ACTION_test
- {
- my \$self = shift;
- \$ENV{$dl_env_var} = join( '$path_sep',
- split( /$path_sep/, ( \$ENV{$dl_env_var} || '' ) ), '$libp' )
- if $in_parrot_tree;
-
- \$self->SUPER::ACTION_test( \@_ );
- }
-
-END_HERE
-);
-
-my $builder = $class->new(
- module_name => 'Parrot::Embed',
- license => 'perl',
- dist_author => 'chromatic <chromatic@wgz.org>',
- dist_version_from => 'lib/Parrot/Embed.pm',
- build_requires =>
- {
- 'Test::More' => 0,
- 'ExtUtils::CBuilder' => 0,
- },
- add_to_cleanup => [ 'Parrot-Embed-*' ],
- include_dirs => [ $incp ],
- extra_compiler_flags => $cflags,
- extra_linker_flags => $lflags,
-);
-
-$builder->create_build_script();
-
-sub in_parrot_tree
-{
- my $cwd = cwd();
- return $cwd =~ /\bext\b.Parrot/;
-}
-
-sub get_dl_env_var
-{
- return $Config{ldlibpthname} if $Config{ldlibpthname};
- return 'DYLD_LIBRARY_PATH' if $^O =~ /darwin/;
- return 'PATH' if $^O =~ /Win32/;
- return 'LD_LIBRARY_PATH';
-}
-
-sub get_path_separator
-{
- return ';' if $^O =~ /Win32/;
- return ':';
-}
-
-sub get_compiler_flags
-{
- my $in_parrot_tree = shift;
- my $parrot_config = $in_parrot_tree ? "./parrot_config" : "parrot_config";
- return (`$parrot_config embed-cflags`, `$parrot_config embed-ldflags`);
-}
-
-sub get_paths
-{
- my $updir = updir();
- my @lib_dir = $^O =~ /Win32/ ? () : qw( blib lib );
- my $lib_path = rel2abs( catdir( ($updir) x 2, @lib_dir ) );
- my $inc_path = rel2abs( catdir( ($updir) x 2, 'include' ) );
-
- return( $lib_path, $inc_path );
-}
-
-sub get_parrot_path
-{
- my $in_parrot_tree = shift;
- return get_parrot_path_internal() if $in_parrot_tree;
- return get_parrot_path_external();
-}
-
-sub get_parrot_path_internal
-{
- my $updir = updir();
- my $path = catfile(($updir) x 2, get_parrot_executable_name());
-
- die "parrot apparently not built!\n" unless -e $path;
- return $path;
-}
-
-sub get_parrot_path_external
-{
- my $parrot = get_parrot_executable_name();
-
- for my $path ( path() )
- {
- my $file = catfile( $path, $parrot );
- next unless -e $file;
- return $file;
- }
-
- die "parrot apparently not installed in \$PATH\n";
-}
-
-sub get_parrot_executable_name
-{
- return 'parrot' unless $^O =~ /Win32/;
- return 'parrot.exe';
-}
-
-sub diag
-{
- return unless $ENV{PE_DEBUG};
- print STDERR "<$_>\n" for @_;
-}
View
17 ext/Parrot-Embed/Changes
@@ -1,17 +0,0 @@
-Revision history for Parrot-Embed
-
-20081006 Mon Oct 6 07:37:02 UTC 2008
- - removed long-removed Parrot_revision()
- - applied minor cleanups to packaging
-
-0.02 Tue Oct 24 02:45:12 UTC 2006
- - added documentation
- - fixed Parrot::Interpreter synopsis code
-
- Fri Oct 13 22:14:45 UTC 2006
- - made Parrot::Interpreter and Parrot::PMC objects
- - attempted to make GC and refcounts work correctly
- - fix in-tree build (hopefully)
-
-0.01 Date/time
- - First version, released on an unsuspecting world.
View
12 ext/Parrot-Embed/MANIFEST
@@ -1,12 +0,0 @@
-Build.PL
-Changes
-MANIFEST
-README
-lib/Parrot/Embed.pm
-lib/Parrot/Embed.xs
-lib/Parrot/Interpreter.pm
-lib/Parrot/PMC.pm
-t/greet.pir
-t/interp.t
-TODO
-typemap
View
28 ext/Parrot-Embed/README
@@ -1,28 +0,0 @@
-Parrot::Embed
--------------
-
-This is an embedding interface to use Parrot from Perl 5.
-
-Be afraid.
-
-INSTALLATION
-
-To install this module, run the following commands:
-
- perl Build.PL
- perl ./Build
- perl ./Build test
- perl ./Build install
-
-If you're building this within the Parrot tree (that is, if you don't have a
-Parrot installed somewhere else), you need to set the proper environment
-variable to tell your dynamic linker where to find the F<libparrot.so> or
-F<libparrot.dll> or F<libparrot.dylib> file to load. I believe this is
-C<LD_LIBRARY_PATH> on Unix-like systems and C<PATH> on Windows.
-
-COPYRIGHT AND LICENCE
-
-Copyright (C) 2006 - 2008 Parrot Foundation/chromatic
-
-This program is free software; you can redistribute it and/or modify it
-under the same terms as Parrot itself.
View
10 ext/Parrot-Embed/TODO
@@ -1,10 +0,0 @@
-TODO:
- - move tests into ../../t during build ?
- - update with new embedding strategy
- - allow more signatures on call_sub()
- - fill in method documentation for Parrot::Interpreter and Parrot::PMC
- - store parent interpreter in Parrot::PMC objects
- - allow invoke() on appropriate Parrot::PMC objects directly
- - bless Parrot::PMC objects into appropriate subclasses if possible
- - allow overloading magic on Parrot::PMC objects
- - improve tests for failure conditions
View
57 ext/Parrot-Embed/lib/Parrot/Embed.pm
@@ -1,57 +0,0 @@
-package Parrot::Embed;
-# Copyright (C) 2006-2009, Parrot Foundation.
-
-use strict;
-use warnings;
-
-our $VERSION = '20081006';
-
-use base 'DynaLoader';
-
-Parrot::Embed->bootstrap($VERSION);
-
-1;
-
-__END__
-
-=head1 NAME
-
-Parrot::Embed - use Parrot from Perl 5
-
-=head1 VERSION
-
-Version 20081006
-
-=head1 SYNOPSIS
-
- use Parrot::Embed qw(Parrot_revision);
-
-=head1 DESCRIPTION
-
-This module embeds libparrot in Perl 5 programs. You can load Parrot bytecode,
-compile your own code, and call Parrot subroutines and send and receive values
-to them.
-
-It provides the core implementation used by the L<Parrot::Interpreter> module.
-Do consider using L<Parrot::Interpreter> first however. See also
-L<Parrot::PMC>.
-
-This module provides no user-inspectable code.
-
-=head1 AUTHOR
-
-chromatic, C<< <chromatic at wgz.org> >>
-
-=head1 BUGS
-
-Please report any bugs or feature requests to the Parrot Porters mailing list.
-Someday there may be a CPAN version of this code. Who knows?
-
-=cut
-
-# Local Variables:
-# mode: cperl
-# cperl-indent-level: 4
-# fill-column: 100
-# End:
-# vim: expandtab shiftwidth=4:
View
251 ext/Parrot-Embed/lib/Parrot/Embed.xs
@@ -1,251 +0,0 @@
-#define PERL_NO_GET_CONTEXT
-#include "parrot/parrot.h"
-#include "parrot/embed.h"
-#include "parrot/extend.h"
-#include "EXTERN.h"
-#include "perl.h"
-#include "XSUB.h"
-
-#define get_interp( i ) (INT2PTR(Interpreter_struct*, SvIV( SvRV( (SV*)i ) )))->interp
-
-typedef Parrot_Interp Parrot_Interpreter;
-
-typedef struct Interpreter_struct
-{
- SV *parent;
- Parrot_Interp interp;
-} Interpreter_struct;
-
-typedef struct PMC_struct
-{
- SV *interp;
- Parrot_PMC pmc;
-} PMC_struct;
-
-
-Interpreter_struct*
-make_interp( pTHX_ SV *parent, PARROT_INTERP )
-{
- Interpreter_struct *interp_struct;
-
- if (!interp)
- return NULL;
-
- New( 0, interp_struct, 1, Interpreter_struct );
-
- SvREFCNT_inc( parent );
- interp_struct->parent = parent;
- interp_struct->interp = interp;
-
- return interp_struct;
-}
-
-
-PMC_struct*
-make_pmc( pTHX_ SV *interp, Parrot_PMC pmc )
-{
- PMC_struct *pmc_struct;
-
- if (!pmc)
- return NULL;
-
- New( 0, pmc_struct, 1, PMC_struct );
-
- SvREFCNT_inc( interp );
- pmc_struct->interp = interp;
- pmc_struct->pmc = pmc;
-
- Parrot_register_pmc( get_interp( interp ), pmc );
-
- return pmc_struct;
-}
-
-
-MODULE = Parrot::Embed PACKAGE = Parrot::Interpreter
-
-Parrot_Interp
-new( class, ... )
- char *class
-PREINIT:
- SV *parent_sv = NULL;
- Parrot_Interp parent;
- Parrot_Interp interp;
- Parrot_PackFile pf;
-CODE:
- if (items == 1)
- parent = 0;
- else if ( items == 2 && sv_derived_from( ST(1), "Parrot::Interpreter" ))
- {
- parent_sv = ST(1);
- parent = get_interp( parent_sv );
- }
- else
- Perl_croak( aTHX_ "Usage: Parrot::Interpreter->new( [ parent ] )" );
-
- interp = Parrot_new( (Parrot_Interp)parent );
- pf = PackFile_new( interp, 0 );
- Parrot_pbc_load( interp, pf );
-
- /* Can't use RETVAL/OUTPUT here because typemap loses class variable */
- ST(0) = sv_newmortal();
- sv_setref_pv( ST(0), class, (void*)make_interp( aTHX_ parent_sv, interp ) );
-
-
-bool
-load_file( interp, filename )
- Interpreter_struct *interp
- char *filename
-PREINIT:
- Parrot_Interp real_interp;
- Parrot_PackFile pf;
-CODE:
- real_interp = interp->interp;
- pf = Parrot_pbc_read( real_interp, filename, 0 );
-
- if (!pf)
- Perl_croak( aTHX_
- "File '%s' not found in $parrot_interpreter->load_file()", filename );
-
- Parrot_pbc_load( real_interp, pf );
- RETVAL = 1;
-OUTPUT:
- RETVAL
-
-
-PMC_struct*
-find_global( interp, global, ... )
- Interpreter_struct *interp
- char *global
-PREINIT:
- SV *namespace;
- Parrot_Interp real_interp;
- Parrot_String p_namespace;
- Parrot_String p_global;
- Parrot_PMC pmc;
-CODE:
- if ( items < 2 || items > 3 )
- Perl_croak( aTHX_
- "Usage: $parrot_interpreter->find_global( name, [ namespace ] )");
-
- real_interp = interp->interp;
- p_global = Parrot_str_new_constant( real_interp, global );
-
- if (items == 3)
- namespace = ST(2);
- else
- namespace = &PL_sv_undef;
-
- if (namespace != &PL_sv_undef )
- {
- char *ns_copy = savepv(SvPV_nolen(namespace));
- char *ns_str = ns_copy;
- char *prev = ns_str;
- PMC *ns = NULL;
-
- while (*ns_str++)
- {
- STRING *ns_part;
-
- if (! (*ns_str == ':' && *(ns_str + 1) == ':'))
- continue;
-
- *ns_str = 0;
- ns_str += 2;
-
- if (!ns)
- ns = Parrot_ns_find_current_namespace_global(real_interp,
- Parrot_str_new_constant(real_interp, prev));
- else
- ns = Parrot_ns_find_namespace_global(real_interp, ns,
- Parrot_str_new_constant(real_interp, prev));
- prev = ns_str;
- }
-
- if (!ns)
- ns = Parrot_ns_find_current_namespace_global(real_interp,
- Parrot_str_new_constant(real_interp, prev));
- else
- ns = Parrot_ns_find_namespace_global(real_interp, ns,
- Parrot_str_new_constant(real_interp, prev));
-
- pmc = Parrot_ns_find_namespace_global(real_interp, ns, p_global);
- Safefree(ns_copy);
- }
- else
- pmc = Parrot_ns_find_current_namespace_global( real_interp, p_global );
-
- RETVAL = make_pmc( aTHX_ ST(0), pmc );
-OUTPUT:
- RETVAL
-
-
-PMC_struct*
-compile( interp, code )
- Interpreter_struct *interp
- char *code
-PREINIT:
- STRING *code_type;
- STRING *error;
- Parrot_Interp real_interp;
- Parrot_PMC out_pmc;
-CODE:
- real_interp = interp->interp;
- code_type = Parrot_str_new_constant( real_interp, "PIR" );
- out_pmc = Parrot_compile_string( real_interp, code_type, code, &error );
- RETVAL = make_pmc( aTHX_ ST(0), out_pmc );
-OUTPUT:
- RETVAL
-
-
-void
-DESTROY( interp )
- Interpreter_struct *interp
-CODE:
- if (interp->parent)
- SvREFCNT_dec( interp->parent );
-
- Parrot_destroy( interp->interp );
-
-MODULE = Parrot::Embed PACKAGE = Parrot::PMC
-
-
-PMC_struct*
-invoke( pmc, signature, argument )
- PMC_struct *pmc
- const char *signature
- const char *argument
-PREINIT:
- Parrot_PMC pmc_actual;
- Parrot_PMC out_pmc;
- Parrot_Interp interp;
- Parrot_String arg_string;
-CODE:
- pmc_actual = pmc->pmc;
- interp = get_interp( pmc->interp );
- arg_string = Parrot_str_new_constant( interp, argument );
- Parrot_pcc_invoke_sub_from_c_args( interp, pmc_actual, signature, arg_string, &out_pmc );
- RETVAL = make_pmc( aTHX_ pmc->interp, out_pmc );
-OUTPUT:
- RETVAL
-
-
-char *
-get_string( pmc )
- PMC_struct *pmc
-CODE:
- RETVAL = Parrot_PMC_get_cstring( get_interp( pmc->interp ), pmc->pmc );
-OUTPUT:
- RETVAL
-
-void
-DESTROY( pmc )
- PMC_struct *pmc
-PREINIT:
- Parrot_Interp interp;
-CODE:
- interp = get_interp( pmc->interp );
-
- if (interp)
- SvREFCNT_dec( interp );
-
- Parrot_unregister_pmc( interp, pmc->pmc );
View
129 ext/Parrot-Embed/lib/Parrot/Interpreter.pm
@@ -1,129 +0,0 @@
-package Parrot::Interpreter;
-# Copyright (C) 2006-2009, Parrot Foundation.
-
-use strict;
-use warnings;
-our $VERSION = '20081006';
-
-use Parrot::Embed;
-
-1;
-
-__END__
-
-=head1 NAME
-
-Parrot::Interpreter - access a Parrot interpreter from Perl 5
-
-=head1 VERSION
-
-Version 20081006
-
-=head1 SYNOPSIS
-
- # the first interpreter created in the program
- my $interp = Parrot::Interpreter->new();
-
- # all subsequent interpreters need a parent
- my $child_interp = $interp->new( $interp );
-
- # load a file that Parrot can recognize as code
- $interp->load_file( 'some_parrot_file.pbc' );
- $interp->load_file( 'some_parrot_file.pir' );
- $interp->load_file( 'some_parrot_file.pasm' );
-
- # compile a string of Parrot code
- $interp->compile( $some_parrot_code );
-
- # find a subroutine to invoke
- my $sub_pmc = $interp->find_global( 'some_parrot_sub' );
- my $other_sub_pmc = $interp->find_global( 'another_sub', 'NameSpace' );
-
- # invoke the subroutine
- my $result_pmc = $sub_pmc->invoke( $signature, @args );
-
- # get the values out of it
- print "Invoking the Sub gave ", $result_pmc->get_string( $interp ), "!\n";
-
-All Parrot access goes through an I<interpreter>, mediated through a
-C<Parrot::Interpreter> object. There is always at least one active interpreter
-in a system. An interpreter allows you to load code, to compile code, and to
-find and store global symbols in Parrot. These are usually subroutines but
-they may be other types of PMCs.
-
-=head3 Memory and Resource Implications
-
-If you have multiple active interpreters, the second and subsequent
-interpreters must each have an active interpreter as a parent. In general,
-this may not be an issue, but if you forget, you will receive strange error
-messages.
-
-Note that the parent interpreter must outlive its children, in Perl 5 terms.
-In general, you do not need to worry about this. However, if you cache these
-objects, be aware that they do keep references to each other appropriately
-internally.
-
-As well, all C<Parrot::PMC> objects keep references to their parent
-interpreters for similar reasons.
-
-=head1 METHODS
-
-This class provides several methods:
-
-=over 4
-
-=item * C<new( [ $parent ] )>
-
-This class method creates and returns a new C<Parrot::Interpreter> object. If
-there is an existing and active C<Parrot::Interpreter> object, pass it as
-C<$parent>. Otherwise, pass no argument.
-
-=item * C<load_file( $filename )>
-
-Given the path to a file on disk, loads and compiles the code into the
-interpreter. This will throw an exception if Parrot could not load or compile
-the code successfully.
-
-=item * C<compile( $code )>
-
-Given a string containing Parrot PIR code, compiles the code into the
-interpreter. This will return a C<Parrot::PMC> object representing the code.
-
-A future version of this method may allow compiling other types of code.
-
-=item * C<find_global( $name, [ $namespace ] )>
-
-Given the name of a global and, optionally, the namespace of the global,
-attempts to find a global PMC associated with that name in the invoking
-interpreter. This will return a C<Parrot::PMC> object if successful and
-C<undef> if there is no PMC found.
-
-This method right now supports only single-level string namespaces; this will
-change in the future.
-
-=back
-
-=head1 AUTHOR
-
-chromatic, C<< <chromatic at wgz.org> >>
-
-=head1 BUGS
-
-This code might be able to detect the presence or absence of a parent
-interpreter and act appropriately.
-
-This code needs to support more operations on interpreters.
-
-Patches welcome.
-
-Please report any bugs or feature requests to the Parrot Porters mailing list.
-Someday there may be a CPAN version of this code. Who knows?
-
-=cut
-
-# Local Variables:
-# mode: cperl
-# cperl-indent-level: 4
-# fill-column: 100
-# End:
-# vim: expandtab shiftwidth=4:
View
93 ext/Parrot-Embed/lib/Parrot/PMC.pm
@@ -1,93 +0,0 @@
-package Parrot::PMC;
-# Copyright (C) 2006-2009, Parrot Foundation.
-
-use strict;
-use warnings;
-our $VERSION = '20081006';
-
-use Parrot::Embed;
-
-1;
-
-__END__
-
-=head1 NAME
-
-Parrot::PMC - access a Parrot PMC from Perl 5
-
-=head1 VERSION
-
-Version 20081006
-
-=head1 SYNOPSIS
-
- # find a subroutine to invoke
- my $sub_pmc = $interp->find_global( 'some_parrot_sub' );
- my $other_sub_pmc = $interp->find_global( 'another_sub', 'NameSpace' );
-
- # invoke the subroutine
- my $result_pmc = $sub_pmc->invoke( $signature, @args );
-
- # get the values out of it
- my $string_val = $result_pmc->get_string( $interp );
-
-=head1 METHODS
-
-This object provides several methods:
-
-=over 4
-
-=item * C<invoke( $signature, $argument )>
-
-Given a Sub PMC or derivative, calls the appropriate Parrot function, parsing
-the C<$signature> and passing a single string C<$argument>. The first
-character of the C<$signature> string denotes the return value. The remaining
-characters are the argument values, per the list:
-
-=over 4
-
-=item v void (return only)
-
-=item I integer
-
-=item N float
-
-=item S string
-
-=item P PMC
-
-=back
-
-In the future, this method may handle this translation for you automatically,
-though it may I<not> deduce the return type correctly.
-
-=item * C<get_string()>
-
-Retrieves the string value of the PMC. Not all PMCs support this.
-
-=back
-
-=head1 AUTHOR
-
-chromatic, C<< <chromatic at wgz.org> >>
-
-=head1 BUGS
-
-There are three known deficiencies. First, there should be separate classes
-for separate Parrot PMC types. Second, there should be overloadings to handle
-various types of getting and setting values on PMCs. Third, the C<invoke()>
-methods do not handle enough signatures.
-
-Patches welcome.
-
-Please report any bugs or feature requests to the Parrot Porters mailing list.
-Someday there may be a CPAN version of this code. Who knows?
-
-=cut
-
-# Local Variables:
-# mode: cperl
-# cperl-indent-level: 4
-# fill-column: 100
-# End:
-# vim: expandtab shiftwidth=4:
View
39 ext/Parrot-Embed/t/00-load.t
@@ -1,39 +0,0 @@
-#!perl
-
-# Copyright (C) 2006-2008, Parrot Foundation.
-
-use strict;
-use warnings;
-
-use Test::More tests => 9;
-use File::Spec;
-
-use_ok('Parrot::Embed' ) or exit;
-
-my $module = 'Parrot::Interpreter';
-can_ok( $module, 'new' );
-
-my $interp = $module->new();
-ok( $interp, 'new() should return a valid interpreter' );
-isa_ok( $interp, $module );
-
-my $interp2 = $module->new($interp);
-ok( $interp, 'new() should return a valid interpreter, given a parent interp' );
-isa_ok( $interp, $module );
-
-isnt( $$interp, $$interp2, '... but different interpreters' );
-
-{
- local @Subclass::ISA = $module;
- my $sc = Subclass->new($interp2);
- isa_ok( $sc, $module );
- isa_ok( $sc, 'Subclass' );
-}
-
-
-# Local Variables:
-# mode: cperl
-# cperl-indent-level: 4
-# fill-column: 100
-# End:
-# vim: expandtab shiftwidth=4:
View
28 ext/Parrot-Embed/t/greet.pir
@@ -1,28 +0,0 @@
-# Copyright (C) 2006-2009, Parrot Foundation.
-
-.sub greet
- .param pmc name
-
- .local string name_str
- name_str = name
-
- .local pmc greeting
- greeting = new 'String'
- greeting = 'Hello, '
- greeting .= name_str
- greeting .= '!'
-
- .return( greeting )
-.end
-
-.namespace [ 'Elsewhere' ]
-
-.sub greet
- .return( 'Hiya!' )
-.end
-
-# Local Variables:
-# mode: pir
-# fill-column: 100
-# End:
-# vim: expandtab shiftwidth=4 ft=pir:
View
108 ext/Parrot-Embed/t/interp.t
@@ -1,108 +0,0 @@
-#!perl
-
-# Copyright (C) 2006-2010, Parrot Foundation.
-
-use strict;
-use warnings;
-
-use Test::More tests => 23;
-use File::Spec;
-
-my $hello_pbc = File::Spec->catfile( 't', 'greet.pbc' );
-
-my $module = 'Parrot::Interpreter';
-use_ok('Parrot::Embed') or exit;
-
-can_ok( $module, 'new' );
-my $interp = $module->new();
-ok( $interp, 'new() should return a valid interpreter' );
-isa_ok( $interp, $module );
-
-can_ok( $module, 'load_file' );
-my $result = eval { $interp->load_file('no file here') };
-my $except = $@;
-ok( !$result, 'load_file() should return false unless it can load a file' );
-like( $except, qr/File 'no file here' not found/, '... throwing exception' );
-$result = eval { $interp->load_file($hello_pbc) };
-$except = $@;
-ok( $result, '... returning true if it could load the file' );
-is( $except, '', '... throwing no exception if so' );
-
-can_ok( $module, 'find_global' );
-my $global_greet = $interp->find_global('greet');
-ok( $global_greet, 'find_global() should return non-namespaced global, if found' );
-isa_ok( $global_greet, 'Parrot::PMC' );
-
-ok( !$interp->find_global('goat'),
- '... or nothing, if there is no non-namespaced global of that name' );
-
-my $else_greet = $interp->find_global( 'greet', 'Elsewhere' );
-ok( $else_greet, '... or a namespaced global, if it exists in the namespace' );
-isnt( $$global_greet, $$else_greet, '... and definitely the namespaced version' );
-
-ok( !$interp->find_global( 'goat', 'Elsewhere' ),
- '... but again, not if there is no global of that name there' );
-
-can_ok( $global_greet, 'invoke' );
-my $pmc = $global_greet->invoke( 'S->P', 'Bob' );
-ok( $pmc, 'invoke() should return a PMC, given that signature' );
-
-is( $pmc->get_string(), 'Hello, Bob!', '... containing a string returned in the PMC' );
-
-can_ok( $module, 'compile' );
-my $eval = $interp->compile( <<END_PIR );
-.sub foo
- .param pmc in_string
-
- .local string string_s
- string_s = in_string
- string_s .= ' FOO '
-
- .return( string_s )
-.end
-END_PIR
-
-ok( $eval, 'compile() should compile PIR code and return a PMC' );
-isa_ok( $eval, 'Parrot::PMC' );
-
-=for comment
-
-TODO:
-{
- local $TODO = 'compile_string() returns wrong results';
- # ok( !$interp->compile('blah'), '... but only for valid PIR' );
-}
-
-$pmc = $else_greet->invoke( 'S->P', '' );
-is( $pmc->get_string(), 'Hiya!', '... calling the passed-in subroutine' );
-
-my $foo = $interp->find_global('foo');
-$pmc = $foo->invoke( 'S->P', 'BAR' );
-is( $pmc->get_string(), 'BAR FOO ',
- '... and compiled sub should work just like any other Sub pmc' );
-
-my $foo;
-
-=cut
-
-my $foo;
-
-{
- my $die_interp = $module->new($interp);
- eval { $die_interp->load_file($hello_pbc) };
- $foo = $die_interp->find_global('greet');
-}
-
-$pmc = $foo->invoke( 'S->P', 'out of scope' );
-is(
- $pmc->get_string(),
- 'Hello, out of scope!',
- '... even if interpreter object has gone out of scope'
-);
-
-# Local Variables:
-# mode: cperl
-# cperl-indent-level: 4
-# fill-column: 100
-# End:
-# vim: expandtab shiftwidth=4:
View
40 ext/Parrot-Embed/t/languages.t
@@ -1,40 +0,0 @@
-#!perl
-
-# Copyright (C) 2009, Parrot Foundation.
-
-use strict;
-use warnings;
-
-use Test::More;
-use File::Spec;
-
-my $abc_pbc = File::Spec->catfile( '..', '..', 'languages', 'abc', 'abc.pbc' );
-plan skip_all => "Need to first run make in languages/abc" unless -e $abc_pbc;
-
-plan tests => 8;
-
-use_ok('Parrot::Embed') or exit;
-
-my $module = 'Parrot::Interpreter';
-my $interp = $module->new();
-ok( $interp, 'new() should return a valid interpreter' );
-isa_ok( $interp, $module );
-
-my $result = eval { $interp->load_file($abc_pbc) };
-my $except = $@;
-ok( $result, '... returning true if it could load the file' );
-is( $except, '', '... throwing no exception if so' );
-
-my $abc = $interp->find_global( 'main', 'abc::Compiler' );
-isa_ok( $abc, 'Parrot::PMC' );
-
-my $pmc = $abc->invoke('PS', '2+3');
-ok( $pmc, 'invoke() should return a PMC, given that signature' );
-is( $pmc->get_string(), 1, 'value returned in the PMC' );
-
-# Local Variables:
-# mode: cperl
-# cperl-indent-level: 4
-# fill-column: 100
-# End:
-# vim: expandtab shiftwidth=4:
View
82 ext/Parrot-Embed/t/pipp.t
@@ -1,82 +0,0 @@
-#!perl
-# Copyright (C) 2008-2010, Parrot Foundation.
-
-use strict;
-use warnings;
-
-use Test::More;
-use File::Spec;
-
-my $pipp_pbc = File::Spec->catfile( '..', '..', 'languages', 'pipp', 'pipp.pbc' );
-plan skip_all => "Need to first run make in languages/pipp" if not -e $pipp_pbc;
-
-plan tests => 6;
-
-use_ok('Parrot::Embed') or exit;
-
-
-my $module = 'Parrot::Interpreter';
-my $interp = $module->new();
-ok( $interp, 'new() should return a valid interpreter' );
-isa_ok( $interp, $module );
-
-my $result = eval { $interp->load_file($pipp_pbc) };
-my $except = $@;
-ok( $result, '... returning true if it could load the file' );
-is( $except, '', '... throwing no exception if so' );
-
-# What is 'Pipp' in hll namespace 'parrot' ?
-my $pipp_x = $interp->find_global( 'Pipp' );
-{
- local $TODO = 'Namespace and HLL not working yet';
- isa_ok( $pipp_x, 'Parrot::PMC' );
-}
-
-# todo: get hll id of Pipp
-# todo: set hll namespace root to 'pipp'
-# find sub 'eval' and hll namespace 'pipp'
-my $pipp_eval = $interp->find_global( 'pipp', 'eval' );
-# isa_ok( $pipp_eval, 'Parrot::PMC', todo => '$pipp_eval is not found' );
-# can_ok($pipp, 'invoke');
-
-
-my $code = <<'END_CODE';
-<?php
-function add($a, $b) {
- return $a+$b;
-}
-?>
-END_CODE
-
-# compile some PHP code
-if (0)
-{
- my $pmc = $pipp_eval->invoke( 'PS', $code );
- ok( $pmc, 'invoke() should return a PMC, given that signature' );
- is( $pmc->get_string(), 1, 'string returned in the PMC should be true?' );
-}
-
-
-# invoke a built-in php function
-if (0)
-{
- my $pmc = $pipp_eval->invoke( 'PS', 'strlen', 'some string' );
- ok( $pmc, 'invoke() should return a PMC, given that signature' );
- is( $pmc->get_string(), 11, 'value returned in the PMC' );
-}
-
-# invoke a php function
-if (0)
-{
- my $pmc = $pipp_eval->invoke( 'PS', 'add', 23, 19 );
- ok( $pmc, 'invoke() should return a PMC, given that signature' );
- is( $pmc->get_string(), 42, 'value returned in the PMC' );
-}
-
-
-# Local Variables:
-# mode: cperl
-# cperl-indent-level: 4
-# fill-column: 100
-# End:
-# vim: expandtab shiftwidth=4:
View
63 ext/Parrot-Embed/tools/check_embed_coverage.pl
@@ -1,63 +0,0 @@
-#!perl
-
-# Copyright (C) 2007-2008, Parrot Foundation.
-
-use strict;
-use warnings;
-use 5.008;
-
-use Getopt::Long;
-
-my $opt_verbose = 0;
-GetOptions( 'verbose' => \$opt_verbose );
-
-die "usage: $0 path/to/embed.h path/to/Embed.xs\n"
- unless @ARGV == 2;
-
-my ($embed_h, $embed_xs) = @ARGV;
-
-my $embed_funcs_h_ref = extract_parrot_funcs($embed_h);
-print "$embed_h: @{[ sort keys %$embed_funcs_h_ref ]}\n" if $opt_verbose;
-
-my $embed_funcs_xs_ref = extract_parrot_funcs($embed_xs);
-print "$embed_xs: @{[ sort keys %$embed_funcs_xs_ref ]}\n" if $opt_verbose;
-
-my %funcs_not_used = %{ $embed_funcs_h_ref };
-delete @funcs_not_used{ keys %{ $embed_funcs_xs_ref } };
-
-if (%funcs_not_used) {
-
- warn sprintf "%d out of %d Parrot_* functions in %s not used in %s:\n",
- scalar(keys %funcs_not_used), scalar keys %$embed_funcs_h_ref, $embed_h, $embed_xs;
-
- for my $func (sort keys %funcs_not_used) {
- printf "\t%s\n", $func;
- }
-
- exit 1;
-}
-
-exit 0;
-
-
-sub extract_parrot_funcs {
- my ($filename) = @_;
-
- open my $fh, "<", $filename
- or die "Can't open $filename $!\n";
-
- my %names;
- while (<$fh>) {
- next unless m/ \b (Parrot_\w+) \s* \( /x;
- $names{ $1 }++;
- }
-
- return \%names;
-}
-
-# Local Variables:
-# mode: cperl
-# cperl-indent-level: 4
-# fill-column: 100
-# End:
-# vim: expandtab shiftwidth=4:
View
26 ext/Parrot-Embed/tools/write_typemap.pl
@@ -1,26 +0,0 @@
-#!perl
-
-# Copyright (C) 2007, Parrot Foundation.
-
-use strict;
-use warnings;
-
-use File::Spec::Functions;
-use ExtUtils::MakeMaker;
-
-chdir( catdir(qw( lib Parrot )) );
-my $custom_typemap = catfile(qw( .. .. typemap ));
-
-( my $perl_typemap = $INC{'ExtUtils/MakeMaker.pm'} ) =~ s/MakeMaker.pm/typemap/;
-
-my $c_file = qx/xsubpp -prototypes -typemap $perl_typemap -typemap $custom_typemap Embed.xs/;
-open( my $file, '>', 'Embed.c' ) or die "Cannot write Embed.c\n";
-print {$file} $c_file;
-close $file;
-
-# Local Variables:
-# mode: cperl
-# cperl-indent-level: 4
-# fill-column: 100
-# End:
-# vim: expandtab shiftwidth=4:
View
35 ext/Parrot-Embed/typemap
@@ -1,35 +0,0 @@
-TYPEMAP
-Parrot_Interp T_PTR
-Parrot_PackFile T_PTR
-Parrot_String T_PTR
-
-Parrot_PMC T_PTROBJ_PARROT
-Parrot_Interp T_PTROBJ_PARROT
-Interpreter_struct* T_PTROBJ_PARROT_STRUCT
-PMC_struct* T_PTROBJ_PARROT_STRUCT
-
-INPUT
-T_PTROBJ_PARROT_STRUCT
- if (sv_derived_from($arg, \"${ (my $type = $ntype) =~ s/^(\w+)_struct.*$/Parrot::$1/; \$type}\"))
- {
- IV tmp = SvIV((SV*)SvRV($arg));
- $var = INT2PTR($type, tmp);
- }
- else
- croak(\"$var is not of type Parrot::$ntype\")
-
-T_PTROBJ_PARROT
- if (sv_derived_from($arg, \"${(my $ntt=$ntype)=~s/_/::/g;\$ntt}\"))
- {
- IV tmp = SvIV((SV*)SvRV($arg));
- $var = INT2PTR($type, tmp);
- }
- else
- croak(\"$var is not of type ${(my $ntt=$ntype)=~s/_/::/g;\$ntt}\")
-
-OUTPUT
-T_PTROBJ_PARROT
- sv_setref_pv($arg, \"${(my $ntt=$ntype)=~s/_/::/g;\$ntt}\", (void*)$var);
-
-T_PTROBJ_PARROT_STRUCT
- sv_setref_pv($arg, \"${ (my $type = $ntype) =~ s/^(\w+)_struct.*$/Parrot::$1/; \$type}\", (void*)$var);
View
10,235 ext/winxed/compiler.pir
5,121 additions, 5,114 deletions not shown
View
138 frontend/parrot2/prt0.pir
@@ -20,42 +20,30 @@
.const 'Sub' WSubId_6 = "WSubId_6"
# Body
# {
-.annotate 'file', 'frontend/parrot2/prt0.winxed'
-.annotate 'line', 14
# exe_name: $S1
null $S1
-.annotate 'line', 15
# pirop shift
shift $S1, __ARG_1
-.annotate 'line', 16
# prog_name: $S2
null $S2
-.annotate 'line', 17
# input_file_type: $I1
null $I1
-.annotate 'line', 18
# output_file: $S3
null $S3
-.annotate 'line', 19