From 6450bbf921454a975e6279b756e0f1b26270d580 Mon Sep 17 00:00:00 2001 From: Whiteknight Date: Tue, 19 Aug 2008 21:08:02 +0000 Subject: [PATCH] [gsoc_pdd09] update to trunk from r30310 git-svn-id: https://svn.parrot.org/parrot/branches/gsoc_pdd09@30354 d31e2699-5ff4-0310-a27c-f18f2fbe73fe --- NEWS | 16 +- PLATFORMS | 6 +- compilers/pct/src/PAST/Compiler.pir | 25 ++- docs/pdds/pdd09_gc.pod | 85 ++++---- languages/lua/src/lua51.pir | 9 +- languages/perl6/docs/spectest-progress.csv | 1 + languages/perl6/src/parser/actions.pm | 18 ++ languages/perl6/t/spectest_regression.data | 2 + languages/t/harness | 8 +- languages/tcl/src/ops/tcl.ops | 6 +- ports/debian/changelog | 10 + ports/debian/control.in | 2 +- ports/debian/copyright | 5 +- ports/debian/libparrot-dev.install | 1 - ports/debian/parrot-doc.docs | 215 +++++++++++---------- ports/debian/parrot.docs | 123 +++++++++++- ports/debian/parrot.install | 2 +- ports/debian/rules | 12 +- src/debug.c | 37 +++- src/inter_call.c | 9 +- src/interpreter.c | 4 + src/library.c | 15 +- src/parrot_debugger.c | 3 + 23 files changed, 418 insertions(+), 196 deletions(-) diff --git a/NEWS b/NEWS index a83ea43939..646feada5f 100644 --- a/NEWS +++ b/NEWS @@ -9,23 +9,32 @@ New in 0.7.0 [r29473 through r30270] + PDD27: add multisub lookup - Languages + Cardinal (Ruby): + - Class variables + - Parsing improvements + - Minor additions to class builtins + - Add support for block parameters to functions + Lua: - various language fixes - refactor all libraries (namespace, method registration) - add a OpenGL binding (still incomplete) + - lost user back trace (see ppd25 & pushaction) + Pipp (PHP): - Add support for while- and for-loops - Add support for increment and decrement - - Designate PHP 5.3 as the reference implementation + - Designate PHP 5.3 as the reference implementation - Improve support for string literals + Pugs (Perl 6): - removed due to bit rot + Rakudo (Perl 6): + - now over 2200 passing spectests - updated the Rakudo roadmap - Perl 6 multi dispatch - dispatch with slurpies - class attributes ("my $.x") - - now up to 2196 passing tests + - anonymous classes + - OO and metaclass improvements (.WHAT, .WHICH, .WHENCE) + - additional builtin methods and subs + - improved make test targets and harness + Tcl: - implement [lreverse], [lsort -command] - allow [incr] to autovivify @@ -35,6 +44,9 @@ New in 0.7.0 [r29473 through r30270] - Compilers + PCT: - :scope('register') for PAST::Var nodes + - allow invocant specification in attribute scope PAST::Var nodes + - correct ordering of sub generation from POST + - add 'loadinit' attribute to PAST::Block for block initialization + PIRC: - PIR registers now use the vanilla register allocator - all PASM output now uses PASM registers diff --git a/PLATFORMS b/PLATFORMS index 45ae15a72e..d7f271f1a2 100644 --- a/PLATFORMS +++ b/PLATFORMS @@ -35,8 +35,8 @@ linux-x86_64-gcc4.1.0 8 Y - - Y Y Y Y ? 20070116 linux-x86_64-gcc4.1.0 4 Y - - Y Y Y Y/2 ? 20060807 linux-x86_64-gcc4.1.2 8 Y - - Y Y Y Y ? 20080220 openbsd-zaurus-gcc3.3.5 Y - - Y Y Y ? ? 20070309 -sol8-sparc-cc B - - - - - - Y/1 ? 20080401 -sol8-sparc-gcc_4.1.0 B - - - - - - Y/77 ? 20080401 +sol8-sparc-cc B - - - - - - Y/85 ? 20080818 +sol8-sparc-gcc_4.1.0 B - - - - - - Y/87 ? 20080818 sol10-sparc-cc_5.8 B Y - - Y Y Y Y/9 ? 20060807 sol10-sparc-cc_5.9 B4*4 Y - - Y Y Y Y ? 20080510 sol10-sparc-cc_5.9 B8 Y - - Y Y Y Y/2 ? 20080518 @@ -48,7 +48,7 @@ opensolaris-x86-gcc_4.0.3 4 Y Y ? ? ? Y Y/2 ? 20080325 tru64-alpha-compaq_c6.5 8 ? ? ? Y ? Y Y/2 ? 20060203 cygwin1.5.24-x86-gcc3.4.4 4 Y Y - - - Y Y/6*1 ? 20071016 cygwin1.5.25-x86-gcc3.4.4 4 Y Y - - - Y Y/6*1 ? 20080513 -win32-x86-mingw_gcc3.4.5 Y Y - - - Y Y/2 Y 20080617 +win32-x86-mingw_gcc3.4.5 Y Y - - - Y Y/1 Y 20080819 win32-x86-mingw_gcc4.2.1 Y Y - - - Y Y/11 ? 20080520 win32-x86-msvc_6.0 - Y - Y - Y Y/5 ? 20080520 win32-x86-msvc_7.1 - Y - Y - Y Y/11 ? 20080520 diff --git a/compilers/pct/src/PAST/Compiler.pir b/compilers/pct/src/PAST/Compiler.pir index 0961f5f519..a6691e3922 100644 --- a/compilers/pct/src/PAST/Compiler.pir +++ b/compilers/pct/src/PAST/Compiler.pir @@ -518,21 +518,27 @@ Return the POST representation of a C. blockpast = get_global '@?BLOCK' unshift blockpast, node - .local string name + .local string name, pirflags, blocktype + .local pmc ns name = node.'name'() + pirflags = node.'pirflags'() + blocktype = node.'blocktype'() + ns = node.'namespace'() + + ## handle anonymous blocks if name goto have_name name = self.'unique'('_block') + if ns goto have_name + pirflags = concat pirflags, ' :anon' have_name: ## create a POST::Sub node for this block - .local string blocktype - blocktype = node.'blocktype'() - .local pmc ns, pirflags - ns = node.'namespace'() - pirflags = node.'pirflags'() .local pmc bpost $P0 = get_hll_global ['POST'], 'Sub' - bpost = $P0.'new'('node'=>node, 'name'=>name, 'blocktype'=>blocktype, 'namespace'=>ns, 'pirflags'=>pirflags) + bpost = $P0.'new'('node'=>node, 'name'=>name, 'blocktype'=>blocktype, 'namespace'=>ns) + unless pirflags goto pirflags_done + bpost.'pirflags'(pirflags) + pirflags_done: ## determine the outer POST::Sub for the new one .local pmc outerpost @@ -672,7 +678,10 @@ Return the POST representation of a C. $P0 = get_hll_global ['POST'], 'Ops' bpost = $P0.'new'(bpost, 'node'=>node, 'result'=>result) if ns goto block_decl_ns - bpost.'push_pirop'('get_global', result, name) + concat $S0, '.const .Sub ', result + concat $S0, ' = ' + concat $S0, name + bpost.'push_pirop'($S0) goto block_done block_decl_ns: bpost.'push_pirop'('get_hll_global', result, ns, name) diff --git a/docs/pdds/pdd09_gc.pod b/docs/pdds/pdd09_gc.pod index ad5cb82e40..a8013d1beb 100644 --- a/docs/pdds/pdd09_gc.pod +++ b/docs/pdds/pdd09_gc.pod @@ -377,7 +377,7 @@ the GC in the Arenas->gc_private field. Trigger or perform a GC run. With an incremental GC core, this may only start/continue a partial mark phase or sweep phase, rather than performing an entire run from start to finish. It may take several calls to C in -order to complete an entire incremental run. +order to complete an entire run of an incremental collector. For a concurrent collector, calls to this function may activate a concurrent collection thread or, if such a thread is already running, do nothing at all. @@ -432,17 +432,20 @@ proper operation. =item C Called during interpreter destruction. Free used resources and memory pools. +All PMCs must be swept, and PMCs with custom destroy VTABLE methods must have +those called. =item C -Initialize the given pool. This function should set the following function -pointers for use with the pool. +Initialize the given pool. Populates the C structure with +initial values, and sets a series of function pointers for working with the +pool. The function pointers used with the pool are discussed next. =back =head3 Small_Object_Pool function pointers -Each GC core defines 4 function pointers stored in the Small_Object_Pool +Each GC core defines 4 function pointers stored in the C structures. These function pointers are used throughout Parrot to implement basic behaviors for the pool. @@ -458,7 +461,10 @@ is zeroed. =item C -Add a freed object to the pool's free list. +Add a freed object to the pool's free list. This function is most often called +internally to the GC itself to add items to the free list after a sweep, or +when a new arena is created to add the new items to the free list. It does +not need to be used in this way, however. =item C @@ -471,93 +477,104 @@ factor which increases the size of each new allocated arena. Reallocation for additional objects. It has the same signature as C, and in some GC cores the same function pointer is used for both. In some GC cores, C may do a GC run in an attempt to free -existing objects without having to allocate new ones. +existing objects without having to allocate new ones. This function may also +call Calloc_objects> internally, to allocate objects if a GC run fails +to free any old objects. =back =head3 Write Barrier -Each GC core has to provide these (possibly empty) macros: +Each GC core has to provide the following macros. All of these might be +defined empty, for GC cores which do not use them. =over 4 =item C This macro is invoked when in aggregate C the element C is getting -overritten by C. Both C and C may be NULL. +overwritten by C. Either C, C, or both may be NULL. =item C -Like above. Invoked when a hash key is inserted, possibly replacing an old -key. +Similar to C. Invoked when a hash key C is +inserted into hash C with value C, possibly replacing a key/value +pair C and C, respectively. Any of C, C, C +or C might be C. =back =head2 Blocking GC Being able to block GC is important, so newly allocated Buffers or PMCs won't -be collected before they're attached to the live tree. The following -routines control GC: +be collected before they're attached to the live tree. Parrot provides locking +mechanisms to prevent the GC from taking certain actions, such as marking +or sweeping. GC block functions are nesting, and multiple calls to a lock +function requires the same number of calls to the corresponding unlock +function in order to operate the GC normally again. The following functions +are used to block the GC from performing certain actions: =over 4 =item Parrot_block_GC_mark(Interp *interpreter) -Block the GC mark phase for the passed interpreter. (But not the sweep phase) +Block the GC mark phase for the passed interpreter, but do not block the sweep +phase. In a stop-the-world collector, this will prevent the entire collection +run, but in an incremental collector this will only block if the GC is in the +trace state. =item Parrot_block_GC_sweep(Interp *interpreter) -Block the GC sweep phase for the passed interpreter. (But not the mark phase) +Block the GC sweep phase for the passed interpreter, but do not block the +trace phase. =item Parrot_unblock_GC_mark(Interp *interpreter) -Unblock the GC mark phase for the passed interpreter. (But not the sweep -phase) +Unblock the GC mark phase for the passed interpreter, but do not unblock a +blocked sweep phase, if it is blocked using C. =item Parrot_unblock_GC_sweep(Interp *interpreter) -Unblock the GC sweep phase for the passed interpreter. (But not the mark -phase) +Unblock the GC sweep phase for the passed interpreter, but do not unblock the +mark phase if it has been blocked by C. =item Parrot_is_blocked_GC_mark(Interp *interpreter) -Test whether the mark phase has been blocked. +Test whether the mark phase has been blocked. Notice that the sweep phase can +be locked independently and cannot be determined using this function. =item Parrot_is_blocked_GC_sweep(Interp *interpreter) -Test whether the sweep phase has been blocked. +Test whether the sweep phase has been blocked. Notice that the mark phase can +be locked independently and cannot be determined using this function. =back -Note that the blocking is recursive--if you call Parrot_block_GC_sweep() three -times in succession, you need to call Parrot_unblock_GC_sweep() three times to -re-enable the GC sweep phase. - =head2 PMC/Buffer API =head3 Flags For PMCs and Buffers to be collected properly, you must set the appropriate -flags on them. - -Directly manipulating these flags is not recommended. Always use the macros -defined in F. +flags on them. Directly manipulating these flags is not recommended because +the exact values can be changed over time. A series of macros have been created +in F that set and check for these flags. Always use +these provided macros when you need to test or set these flags. =over 4 =item PObj_active_destroy_FLAG The PMC has some sort of active destructor, and will have that destructor -called when the PMC is destroyed. +called when the PMC is destroyed. The destructor is typically called from +within C. =item PObj_custom_mark_FLAG The C vtable slot will be called during the GC mark phase. The mark function must call C for all non-NULL objects (Buffers and -PMCs) that PMC refers to. - -Please note that C may be a macro. +PMCs) that PMC refers to. This flag is typically tested and the custom mark +VTABLE method called from C. =item PObj_data_is_PMC_array_FLAG @@ -587,7 +604,9 @@ The following flags can be used by the GC subsystem: =item PObj_live_FLAG -The system considers the object to be alive for collection purposes. +The system considers the object to be alive for collection purposes. Objects +with this flag set should never be collected, freed, destroyed, or put on the +free list. =item PObj_on_free_list_FLAG diff --git a/languages/lua/src/lua51.pir b/languages/lua/src/lua51.pir index 201c37ce97..a581d7dac8 100644 --- a/languages/lua/src/lua51.pir +++ b/languages/lua/src/lua51.pir @@ -198,15 +198,20 @@ used in F .sub 'pir' :method :multi(_, ['Lua::POST::Chunk']) .param pmc node + .local pmc subcode + subcode = get_global '@!subcode' + $P0 = new 'CodeString' + push subcode, $P0 .local pmc code code = self.'pir_children'(node) $S0 = node.'prologue'() if $S0 == '' goto L1 new code, 'CodeString' code.'emit'($S0) - $P0 = self.'code'() + $P0 = pop subcode code .= $P0 - self.'code'(code) + $P0 = subcode[-1] + $P0 .= code L1: .return (code) .end diff --git a/languages/perl6/docs/spectest-progress.csv b/languages/perl6/docs/spectest-progress.csv index bf0e7b01d5..050c9b587d 100644 --- a/languages/perl6/docs/spectest-progress.csv +++ b/languages/perl6/docs/spectest-progress.csv @@ -88,3 +88,4 @@ "2008-08-16 00:00",30256,121,3268,2220,0,134,914,6138 "2008-08-17 00:00",30275,121,3268,2220,0,134,914,6170 "2008-08-18 00:00",30292,121,3268,2220,0,134,914,6170 +"2008-08-19 00:00",30322,121,3268,2220,0,134,914,6242 diff --git a/languages/perl6/src/parser/actions.pm b/languages/perl6/src/parser/actions.pm index 8bf0919e7b..0fc87a15f3 100644 --- a/languages/perl6/src/parser/actions.pm +++ b/languages/perl6/src/parser/actions.pm @@ -29,6 +29,23 @@ method TOP($/) { # Make sure we have the interpinfo constants. $past.unshift( PAST::Op.new( :inline('.include "interpinfo.pasm"') ) ); + # convert the last operation of the block into a .return op + # so that :load block below isn't used as return value + $past.push( PAST::Op.new( $past.pop(), :pirop('return') ) ); + # automatically invoke mainline on :load (but not :init) + $past.push( + PAST::Block.new( + PAST::Op.new( + :inline( + '$P0 = interpinfo .INTERPINFO_CURRENT_SUB', + '$P0 = $P0."get_outer"()', + '$P0()' + ) + ), + :pirflags(':load') + ) + ); + make $past; } @@ -1332,6 +1349,7 @@ method noun($/, $key) { $past.unshift(PAST::Var.new( :name('$_'), :scope('lexical'), + :viviself('Failure'), :node($/) )); } diff --git a/languages/perl6/t/spectest_regression.data b/languages/perl6/t/spectest_regression.data index 33b652a704..f7bf29be85 100644 --- a/languages/perl6/t/spectest_regression.data +++ b/languages/perl6/t/spectest_regression.data @@ -7,10 +7,12 @@ S02-builtin_data_types/array_extending.t S02-builtin_data_types/array.t S02-builtin_data_types/flattening.t S02-builtin_data_types/hash.t +S02-builtin_data_types/hash_ref.t S02-builtin_data_types/nested_arrays.t S02-builtin_data_types/nested_pairs.t S02-builtin_data_types/num.t S02-builtin_data_types/range.t +S02-builtin_data_types/subscripts_and_context.t S02-builtin_data_types/type.t S02-literals/autoref.t S02-literals/hex_chars.t diff --git a/languages/t/harness b/languages/t/harness index a17c537066..1e81913fee 100644 --- a/languages/t/harness +++ b/languages/t/harness @@ -46,7 +46,7 @@ For almost all languages you can do something like: =item Run a single test for more detailed output. - cd languages/tcl && prove t/joe_test.t + cd languages/tcl && prove -v t/cmd_lsort.t =back @@ -79,12 +79,10 @@ my $result = GetOptions( 'html' => \$do_gen_html, # ecmascript No t/harness # eclectus # forth No t/harness -# lua many test failures # perl6 test scripts are written in Perl 6, not Perl 5 # pheme test scripts are written in Scheme, not Perl 5 # PIR many test failures # pynie test scripts are written in PIR, not Perl 5 -# python not maintained # scheme many test failures # urm uses deprecated parrot features # Zcode Method 'instantiate' not found for 'Zmachine' @@ -99,7 +97,7 @@ my @unified_testable_languages dotnet hq9plus jako - lazy-k lisp + lazy-k lisp lua m4 ook parrot_compiler pipp punie @@ -114,6 +112,8 @@ my @harnesses @unified_testable_languages; # Step 2: Get a listing of files from these harnesses. +# +# See L for information regarding --master. my @tests; foreach my $harness (@harnesses) { diff --git a/languages/tcl/src/ops/tcl.ops b/languages/tcl/src/ops/tcl.ops index 7a10fc34e8..f6ef61fc34 100644 --- a/languages/tcl/src/ops/tcl.ops +++ b/languages/tcl/src/ops/tcl.ops @@ -3,10 +3,6 @@ * Copyright (C) 2006-2008, The Perl Foundation. */ -/* -** tcl.ops -*/ - #include "parrot/parrot.h" #include "parrot/string_funcs.h" #include "parrot/exceptions.h" @@ -24,7 +20,7 @@ tcl.ops =head1 DESCRIPTION A dynamic opcode library for tcl on parrot that provides a few opcodes -that simplify PIR generation for tclPIR generation for tcl +that simplify PIR generation for tcl. BUGS: pull out the TCL_ constants, as well as the code slot(#9) diff --git a/ports/debian/changelog b/ports/debian/changelog index 068751ab37..ff431d606e 100644 --- a/ports/debian/changelog +++ b/ports/debian/changelog @@ -1,3 +1,13 @@ +parrot (0.6.4-1) unstable; urgency=low + + * New upstream release + * debian/copyright: + - Added license link. + - Updated copyright years. + - Removed copyright info for files no longer in distribution. + + -- Nuno Carvalho Sat, 16 Aug 2008 14:15:14 +0200 + parrot (0.5.1-1) unstable; urgency=low * New upstream release (Closes: #444707). diff --git a/ports/debian/control.in b/ports/debian/control.in index 648882479d..47049eec0a 100644 --- a/ports/debian/control.in +++ b/ports/debian/control.in @@ -34,7 +34,7 @@ Description: Virtual machine for dynamic languages Package: libparrot-dev Architecture: any Section: libdevel -Depends: libparrot%SOVERSION% (= ${Source-Version}), parrot, libicu-dev +Depends: libparrot%SOVERSION% (= ${binary:Version}), parrot, libicu-dev Description: Virtual machine for dynamic languages Parrot is a virtual machine designed to efficiently compile and execute bytecode for dynamic languages. Parrot currently hosts a variety of language diff --git a/ports/debian/copyright b/ports/debian/copyright index e574191c35..0cd68b3208 100644 --- a/ports/debian/copyright +++ b/ports/debian/copyright @@ -8,7 +8,7 @@ It was downloaded from http://parrotcode.org/ Copyright for most of the code is held by: -Copyright (C) 2001-2007, The Perl Foundation. +Copyright (C) 2001-2008, The Perl Foundation. Some files have a different copyright: @@ -22,9 +22,6 @@ languages/regex/lib/Regex/Grammar.pm: languages/urm: 2003 (c) by Marcus Thiesen -lib/Digest/Perl/MD5.pm: -Copyright (C) 1991-2, RSA Data Security, Inc. Created 1991. All rights reserved. - lib/Pod/: Copyright (c) 2001-2002 Sean M. Burke. All rights reserved. diff --git a/ports/debian/libparrot-dev.install b/ports/debian/libparrot-dev.install index d1cad0e8c5..005da77c3a 100644 --- a/ports/debian/libparrot-dev.install +++ b/ports/debian/libparrot-dev.install @@ -1,4 +1,3 @@ usr/include/* -usr/bin/parrot-config usr/lib/libparrot.a usr/lib/pkgconfig/parrot.pc diff --git a/ports/debian/parrot-doc.docs b/ports/debian/parrot-doc.docs index e055375191..cc430bc404 100644 --- a/ports/debian/parrot-doc.docs +++ b/ports/debian/parrot-doc.docs @@ -1,125 +1,134 @@ -docs/art/pp001-intro.pod -docs/art/pp002-pmc.pod -docs/art/pp003-oop.pod -docs/book/ch01_overview.pod -docs/book/ch02_getting_started.pod -docs/book/ch03_pir_basics.pod -docs/book/ch04_pir_subroutines.pod -docs/book/ch05_pasm.pod -docs/book/ch06_testing.pod -docs/book/ch07_architecture.pod -docs/book/ch08_reference.pod -docs/compiler_faq.pod -docs/configuration.pod -docs/debugger.pod -docs/debug.pod -docs/dev/byteorder.pod -docs/dev/debugging_with_msvc.pod -docs/dev/dod.pod -docs/dev/events.pod -docs/dev/fhs.pod -docs/dev/headerizer.pod -docs/dev/infant.pod -docs/dev/jit_i386.pod -docs/dev/longopt.pod -docs/dev/optimizer.pod -docs/dev/parrot_api.pod -docs/dev/pccmethods.pod -docs/dev/pcc_state.pod -docs/dev/pmc_freeze.pod -docs/dev/pmc_obj_design_meeting_notes.pod -docs/dev/seatbelts.pod -docs/embed.pod -docs/extend.pod -docs/faq.pod -docs/gettingstarted.pod -docs/glossary.pod -docs/imcc/imcc.pod -docs/imcc/imcfaq.pod -docs/imcc/macros.pod -docs/imcc/operation.pod -docs/imcc/parsing.pod -docs/intro.pod -docs/jit.pod -docs/memory_internals.pod -docs/mmd.pod -docs/native_exec.pod -docs/ops/core.pod +docs/ops/cmp.pod +docs/ops/set.pod +docs/ops/pic.pod +docs/ops/string.pod docs/ops/debug.pod -docs/ops/experimental.pod docs/ops/io.pod -docs/ops/math.pod -docs/ops/object.pod -docs/ops/obscure.pod -docs/ops/pic.pod -docs/ops/pmc.pod -docs/ops/set.pod -docs/ops/stack.pod +docs/ops/bit.pod +docs/ops/core.pod docs/ops/stm.pod -docs/ops/string.pod +docs/ops/object.pod docs/ops/sys.pod +docs/ops/math.pod +docs/ops/obscure.pod docs/ops/var.pod -docs/optable.pod +docs/ops/experimental.pod +docs/ops/pmc.pod +docs/submissions.pod +docs/jit.pod +docs/vtables.pod +docs/stm/atomic.pod +docs/stm/internals.pod +docs/stm/stm_frontend.pod +docs/stm/thread-issues.pod +docs/stm/howto.pod +docs/Makefile docs/overview.pod -docs/parrotbyte.pod -docs/parrothist.pod -docs/parrot.pod -docs/pdds/draft/pdd01_overview.pod -docs/pdds/draft/pdd04_datatypes.pod -docs/pdds/draft/pdd05_opfunc.pod -docs/pdds/draft/pdd06_pasm.pod -docs/pdds/draft/pdd08_keys.pod -docs/pdds/draft/pdd09_gc.pod +docs/debug.pod +docs/resources/up.gif +docs/resources/favicon.ico +docs/resources/perl.css +docs/resources/parrot_small.png +docs/imcc/operation.pod +docs/imcc/README +docs/imcc/imcfaq.pod +docs/pdds/pdd28_strings.pod +docs/pdds/pdd09_gc.pod +docs/pdds/pdd24_events.pod +docs/pdds/pdd15_object_metamodel.svg +docs/pdds/pdd18_security.pod +docs/pdds/pdd22_io.pod +docs/pdds/README +docs/pdds/pdd03_calling_conventions.pod +docs/pdds/pdd27_multiple_dispatch.pod +docs/pdds/pdd00_pdd.pod +docs/pdds/pdd15_objects.pod docs/pdds/draft/pdd10_embedding.pod -docs/pdds/draft/pdd11_extending.pod -docs/pdds/draft/pdd12_assembly.pod -docs/pdds/draft/pdd14_bignum.pod +docs/pdds/draft/pdd29_compiler_tools.pod docs/pdds/draft/pdd16_native_call.pod -docs/pdds/draft/pdd18_security.pod +docs/pdds/draft/pdd14_bignum.pod +docs/pdds/draft/pdd08_keys.pod +docs/pdds/draft/pdd06_pasm.pod +docs/pdds/draft/pdd11_extending.pod +docs/pdds/draft/pdd04_datatypes.pod docs/pdds/draft/pdd19_pir.pod -docs/pdds/pdd00_pdd.pod -docs/pdds/pdd03_calling_conventions.pod +docs/pdds/draft/pdd05_opfunc.pod +docs/pdds/draft/pdd01_overview.pod docs/pdds/pdd07_codingstd.pod +docs/pdds/pdd25_concurrency.pod docs/pdds/pdd13_bytecode.pod -docs/pdds/pdd15_objects.pod -docs/pdds/pdd17_pmc.pod docs/pdds/pdd20_lexical_vars.pod -docs/pdds/pdd21_namespaces.pod -docs/pdds/pdd22_io.pod +docs/pdds/pdd15_object_metamodel.png docs/pdds/pdd23_exceptions.pod -docs/pdds/pdd24_events.pod -docs/pdds/pdd25_concurrency.pod +docs/pdds/pdd21_namespaces.pod +docs/pdds/pdd17_pmc.pod docs/pdds/pdd26_ast.pod docs/pdds/pdd_template.pod -docs/pdds/README -docs/pmc2c.pod -docs/pmc/array.pod -docs/pmc/documentation.pod -docs/pmc.pod -docs/pmc/struct.pod -docs/pmc/subs.pod -docs/porting_intro.pod -docs/project/cage_cleaners_guide.pod +docs/glossary.pod +docs/faq.pod +docs/project/roles_responsibilities.pod docs/project/committer_guide.pod +docs/project/release_manager_guide.pod docs/project/metacommitter_guide.pod docs/project/pause_guide.pod -docs/project/release_manager_guide.pod +docs/project/cage_cleaners_guide.pod docs/project/ticket_wrangler_guide.pod -docs/req/model_users.pod -docs/resources/favicon.ico -docs/resources/parrot_small.png -docs/resources/perl.css -docs/resources/up.gif -docs/ROADMAP.pod -docs/roles_responsibilities.pod +docs/project/debian_packaging_guide.pod +docs/packfile-c.pod +docs/memory_internals.pod +docs/parrothist.pod +docs/gettingstarted.pod +docs/book/ch04_pir_subroutines.pod +docs/book/ch01_overview.pod +docs/book/ch05_pasm.pod +docs/book/ch06_testing.pod +docs/book/ch08_reference.pod +docs/book/ch02_getting_started.pod +docs/book/ch03_pir_basics.pod +docs/book/ch07_architecture.pod +docs/book/appendix.pod +docs/book/figs/p6e_0801.png +docs/debugger.pod docs/running.pod +docs/req/model_users.pod +docs/optable.pod +docs/intro.pod docs/stability.pod -docs/stm/atomic.pod -docs/stm/howto.pod -docs/stm/internals.pod -docs/stm/stm_frontend.pod -docs/stm/thread-issues.pod -docs/strings.pod -docs/submissions.pod docs/tests.pod -docs/vtables.pod +docs/pmc/subs.pod +docs/pmc/struct.pod +docs/pmc/documentation.pod +docs/pmc/array.pod +docs/porting_intro.pod +docs/extend.pod +docs/parrot.pod +docs/mmd.pod +docs/embed.pod +docs/compiler_faq.pod +docs/native_exec.pod +docs/dev/pmc_obj_design_meeting_notes.pod +docs/dev/seatbelts.pod +docs/dev/events.pod +docs/dev/debugging_with_msvc.pod +docs/dev/infant.pod +docs/dev/fhs.pod +docs/dev/pcc_state.pod +docs/dev/jit_i386.pod +docs/dev/headerizer.pod +docs/dev/longopt.pod +docs/dev/byteorder.pod +docs/dev/parrot_api.pod +docs/dev/pccmethods.pod +docs/dev/optimizer.pod +docs/dev/pmc_freeze.pod +docs/ROADMAP.pod +docs/art/pp003-oop.pod +docs/art/pp002-pmc.pod +docs/art/pp001-intro.pod +docs/configuration.pod +docs/pmc.pod +docs/pct/past_building_blocks.pod +docs/pct/pct_optable_guide.pod +docs/pct/gettingstarted.pod +docs/pmc2c.pod +docs/parrotbyte.pod diff --git a/ports/debian/parrot.docs b/ports/debian/parrot.docs index a8701a7645..c5734102b9 100644 --- a/ports/debian/parrot.docs +++ b/ports/debian/parrot.docs @@ -1,7 +1,116 @@ -CREDITS -DEPRECATED.pod -NEWS -PBC_COMPAT -PLATFORMS -RESPONSIBLE_PARTIES -TODO +docs/submissions.pod +docs/jit.pod +docs/vtables.pod +docs/stm/atomic.pod +docs/stm/internals.pod +docs/stm/stm_frontend.pod +docs/stm/thread-issues.pod +docs/stm/howto.pod +docs/overview.pod +docs/debug.pod +docs/resources/up.gif +docs/resources/favicon.ico +docs/resources/perl.css +docs/resources/parrot_small.png +docs/imcc/operation.pod +docs/imcc/README +docs/imcc/imcfaq.pod +docs/pdds/pdd28_strings.pod +docs/pdds/pdd09_gc.pod +docs/pdds/pdd24_events.pod +docs/pdds/pdd15_object_metamodel.svg +docs/pdds/pdd18_security.pod +docs/pdds/pdd22_io.pod +docs/pdds/README +docs/pdds/pdd03_calling_conventions.pod +docs/pdds/pdd27_multiple_dispatch.pod +docs/pdds/pdd00_pdd.pod +docs/pdds/pdd15_objects.pod +docs/pdds/draft/pdd10_embedding.pod +docs/pdds/draft/pdd29_compiler_tools.pod +docs/pdds/draft/pdd16_native_call.pod +docs/pdds/draft/pdd14_bignum.pod +docs/pdds/draft/pdd08_keys.pod +docs/pdds/draft/pdd06_pasm.pod +docs/pdds/draft/pdd11_extending.pod +docs/pdds/draft/pdd04_datatypes.pod +docs/pdds/draft/pdd19_pir.pod +docs/pdds/draft/pdd05_opfunc.pod +docs/pdds/draft/pdd01_overview.pod +docs/pdds/pdd07_codingstd.pod +docs/pdds/pdd25_concurrency.pod +docs/pdds/pdd13_bytecode.pod +docs/pdds/pdd20_lexical_vars.pod +docs/pdds/pdd15_object_metamodel.png +docs/pdds/pdd23_exceptions.pod +docs/pdds/pdd21_namespaces.pod +docs/pdds/pdd17_pmc.pod +docs/pdds/pdd26_ast.pod +docs/pdds/pdd_template.pod +docs/glossary.pod +docs/faq.pod +docs/project/roles_responsibilities.pod +docs/project/committer_guide.pod +docs/project/release_manager_guide.pod +docs/project/metacommitter_guide.pod +docs/project/pause_guide.pod +docs/project/cage_cleaners_guide.pod +docs/project/ticket_wrangler_guide.pod +docs/project/debian_packaging_guide.pod +docs/memory_internals.pod +docs/parrothist.pod +docs/gettingstarted.pod +docs/book/ch04_pir_subroutines.pod +docs/book/ch01_overview.pod +docs/book/ch05_pasm.pod +docs/book/ch06_testing.pod +docs/book/ch08_reference.pod +docs/book/ch02_getting_started.pod +docs/book/ch03_pir_basics.pod +docs/book/ch07_architecture.pod +docs/book/appendix.pod +docs/book/figs/p6e_0801.png +docs/debugger.pod +docs/running.pod +docs/req/model_users.pod +docs/optable.pod +docs/intro.pod +docs/stability.pod +docs/tests.pod +docs/pmc/subs.pod +docs/pmc/struct.pod +docs/pmc/documentation.pod +docs/pmc/array.pod +docs/porting_intro.pod +docs/extend.pod +docs/parrot.pod +docs/mmd.pod +docs/embed.pod +docs/compiler_faq.pod +docs/native_exec.pod +docs/dev/pmc_obj_design_meeting_notes.pod +docs/dev/seatbelts.pod +docs/dev/events.pod +docs/dev/debugging_with_msvc.pod +docs/dev/infant.pod +docs/dev/fhs.pod +docs/dev/pcc_state.pod +docs/dev/jit_i386.pod +docs/dev/headerizer.pod +docs/dev/longopt.pod +docs/dev/byteorder.pod +docs/dev/parrot_api.pod +docs/dev/pccmethods.pod +docs/dev/optimizer.pod +docs/dev/pmc_freeze.pod +docs/ROADMAP.pod +docs/art/pp003-oop.pod +docs/art/pp002-pmc.pod +docs/art/pp001-intro.pod +docs/configuration.pod +docs/pmc.pod +docs/pct/past_building_blocks.pod +docs/pct/pct_optable_guide.pod +docs/pct/gettingstarted.pod +docs/pmc2c.pod +docs/parrotbyte.pod diff --git a/ports/debian/parrot.install b/ports/debian/parrot.install index f158c62a2f..e8b231ad07 100644 --- a/ports/debian/parrot.install +++ b/ports/debian/parrot.install @@ -1,5 +1,5 @@ usr/bin/parrot -usr/bin/disassemble +usr/bin/pbc_disassemble usr/bin/pbc_info usr/bin/pbc_merge usr/bin/pdump diff --git a/ports/debian/rules b/ports/debian/rules index 13490cf73b..67e7f649fc 100755 --- a/ports/debian/rules +++ b/ports/debian/rules @@ -25,9 +25,9 @@ build-stamp: configure-stamp dh_testdir $(MAKE) installable pod2man --section=1 --release="Debian Project" --center="Debian GNU/Linux manual" docs/running.pod debian/parrot.1 - pod2man --section=1 --release="Debian Project" --center="Debian GNU/Linux manual" parrot-config debian/parrot-config.1 + pod2man --section=1 --release="Debian Project" --center="Debian GNU/Linux manual" parrot_config debian/parrot_config.1 pod2man --section=1 --release="Debian Project" --center="Debian GNU/Linux manual" src/pdump.c debian/pdump.1 - pod2man --section=1 --release="Debian Project" --center="Debian GNU/Linux manual" src/disassemble.c debian/disassemble.1 + pod2man --section=1 --release="Debian Project" --center="Debian GNU/Linux manual" src/pbc_disassemble.c debian/pbc_disassemble.1 pod2man --section=1 --release="Debian Project" --center="Debian GNU/Linux manual" src/pdb.c debian/parrot-debugger.1 pod2man --section=1 --release="Debian Project" --center="Debian GNU/Linux manual" src/pbc_info.c debian/pbc_info.1 pod2man --section=1 --release="Debian Project" --center="Debian GNU/Linux manual" src/pbc_merge.c debian/pbc_merge.1 @@ -36,8 +36,8 @@ build-stamp: configure-stamp clean: dh_testdir dh_testroot - rm -f build-stamp configure-stamp debian/parrot.1 debian/parrot-config.1 debian/pdump.1 debian/disassemble.1 debian/parrot-debugger.1 debian/pbc_info.1 debian/pbc_merge.1 debian/libparrot$(SOVERSION).install src/nci_test.o src/main.o ext/Parrot-Embed/Makefile.PL languages/PIR/Makefile languages/perl5/Makefile languages/pynie/Makefile runtime/parrot/include/signal.pasm test.c test.ldo - -$(MAKE) realclean + rm -f build-stamp configure-stamp debian/parrot.1 debian/parrot_config.1 debian/pdump.1 debian/pbc_disassemble.1 debian/parrot-debugger.1 debian/pbc_info.1 debian/pbc_merge.1 debian/libparrot$(SOVERSION).install src/nci_test.o src/main.o ext/Parrot-Embed/Makefile.PL languages/PIR/Makefile languages/perl5/Makefile languages/pynie/Makefile runtime/parrot/include/signal.pasm test.c test.ldo + [ ! -f Makefile ] || $(MAKE) distclean dh_clean debian/libparrot$(SOVERSION).install: debian/libparrot.install VERSION @@ -61,7 +61,7 @@ binary-indep: build install dh_testdir -i dh_testroot -i dh_installchangelogs -i ChangeLog - dh_installman -plibparrot-dev debian/parrot-config.1 + dh_installman -plibparrot-dev debian/parrot_config.1 dh_installdocs -i dh_link -plibparrot-dev usr/lib/libparrot.so.$(SOVERSION) usr/lib/libparrot.so dh_compress -pparrot-doc -X.pod @@ -77,7 +77,7 @@ binary-arch: build install dh_testdir -a dh_testroot -a dh_installchangelogs -a ChangeLog - dh_installman -pparrot debian/parrot.1 debian/pdump.1 debian/disassemble.1 debian/parrot-debugger.1 debian/pbc_info.1 debian/pbc_merge.1 + dh_installman -pparrot debian/parrot.1 debian/pdump.1 debian/pbc_disassemble.1 debian/parrot-debugger.1 debian/pbc_info.1 debian/pbc_merge.1 dh_installdocs -a dh_strip -a dh_compress -a diff --git a/src/debug.c b/src/debug.c index a799ede123..21dd981386 100644 --- a/src/debug.c +++ b/src/debug.c @@ -406,6 +406,7 @@ debugger_cmdline(PARROT_INTERP) PDB_run_command(interp, command); } + TRACEDEB_MSG("debugger_cmdline finished"); } static void @@ -415,6 +416,9 @@ close_script_file(PARROT_INTERP) if (interp->pdb->script_file) { fclose(interp->pdb->script_file); interp->pdb->script_file = NULL; + interp->pdb->state|= PDB_STOPPED; + interp->pdb->last_command[0] = '\0'; + interp->pdb->cur_command[0] = '\0'; } } @@ -499,6 +503,8 @@ Parrot_debugger_load(PARROT_INTERP, ARGIN_NULLOK(STRING *filename)) { char *file; + TRACEDEB_MSG("Parrot_debugger_load"); + if (!interp->pdb) Parrot_ex_throw_from_c_args(interp, NULL, 0, "No debugger"); @@ -638,14 +644,12 @@ PDB_get_command(PARROT_INTERP) FILE *fd = interp->pdb->script_file; char buf[DEBUG_CMD_BUFFER_LENGTH+1]; char *ptr = buf; - buf[0]='\0'; - if (feof(fd)) { - close_script_file(interp); - return; - } do { - fgets(buf, DEBUG_CMD_BUFFER_LENGTH, fd); + if (fgets(buf, DEBUG_CMD_BUFFER_LENGTH, fd) == NULL) { + close_script_file(interp); + return; + } /* skip spaces */ for (ptr = (char *)&buf; *ptr && isspace((unsigned char)*ptr); ptr++); @@ -655,7 +659,6 @@ PDB_get_command(PARROT_INTERP) continue; } while (0); - buf[strlen(buf)-1]='\0'; /* RT #46117: handle command error and print out script line * PDB_run_command should return non-void value? * stop execution of script if fails @@ -667,7 +670,6 @@ PDB_get_command(PARROT_INTERP) close_script_file(interp); return; } - strcpy(pdb->cur_command, buf); } else { @@ -715,6 +717,8 @@ PDB_script_file(PARROT_INTERP, ARGIN(const char *command)) { FILE *fd; + TRACEDEB_MSG("PDB_script_file"); + /* If already executing a script, close it */ close_script_file(interp); @@ -728,6 +732,7 @@ PDB_script_file(PARROT_INTERP, ARGIN(const char *command)) return; } interp->pdb->script_file = fd; + TRACEDEB_MSG("PDB_script_file finished"); } /* @@ -1858,6 +1863,8 @@ PDB_disassemble_op(PARROT_INTERP, ARGOUT(char *dest), int space, /* Write the opcode name */ const char * p = full_name ? info->full_name : info->name; + TRACEDEB_MSG("PDB_disassemble_op"); + if (! p) p= "**UNKNOWN**"; strcpy(dest, p); @@ -2074,7 +2081,7 @@ PDB_disassemble_op(PARROT_INTERP, ARGOUT(char *dest), int space, " :unused004", " :unused008", " :const", - " :flat", /* should be :slurpy for args */ + " :flat", /* should be :slurpy for args */ " :unused040", " :optional", " :opt_flag", @@ -2156,6 +2163,8 @@ PDB_disassemble(PARROT_INTERP, SHIM(const char *command)) size_t space; /* How much space do we have? */ size_t size, alloced, n; + TRACEDEB_MSG("PDB_disassemble"); + pfile = mem_allocate_typed(PDB_file_t); pline = mem_allocate_typed(PDB_line_t); @@ -2351,9 +2360,12 @@ PDB_load_source(PARROT_INTERP, ARGIN(const char *command)) PDB_file_t *pfile; PDB_line_t *pline; PDB_t * const pdb = interp->pdb; - opcode_t *pc = pdb->cur_opcode; + opcode_t *pc = interp->code->base.data; + unsigned long size = 0; + TRACEDEB_MSG("PDB_load_source"); + /* If there was a file already loaded or the bytecode was disassembled, free it */ if (pdb->file) @@ -2383,6 +2395,9 @@ PDB_load_source(PARROT_INTERP, ARGIN(const char *command)) pfile->line = pline; pline->number = 1; + PARROT_ASSERT(interp->op_info_table); + PARROT_ASSERT(pc); + while ((c = fgetc(file)) != EOF) { /* Grow it */ if (++size == 1024) { @@ -2417,6 +2432,8 @@ PDB_load_source(PARROT_INTERP, ARGIN(const char *command)) pdb->state |= PDB_SRC_LOADED; pdb->file = pfile; + + TRACEDEB_MSG("PDB_load_source finished"); } /* diff --git a/src/inter_call.c b/src/inter_call.c index d66d6eb802..51d776a6c5 100644 --- a/src/inter_call.c +++ b/src/inter_call.c @@ -632,7 +632,10 @@ Parrot_fetch_arg(PARROT_INTERP, ARGMOD(call_state *st)) =item C -RT#48260: Not yet documented!!! +Fetches the next argument from the call state and converts it to the proper +data type for the call signature. If the next argument is a slurpy array, +all the remaining arguments are slurped together into a ResizablePMCArray +PMC which is then set as the PMC value of the call_state object. =cut @@ -1039,7 +1042,9 @@ store_arg(ARGIN(const call_state *st), INTVAL idx) =item C -RT#48260: Not yet documented!!! +Stores the next function argument into the appropriate destination register. +Calls C to do most of the work. Returns 0 if an attempt is made +to store more values then there are in the signature. Returns 1 otherwise. =cut diff --git a/src/interpreter.c b/src/interpreter.c index ce6fcdb749..521aad0d5c 100644 --- a/src/interpreter.c +++ b/src/interpreter.c @@ -275,6 +275,10 @@ do_prederef(void **pc_prederef, PARROT_INTERP, int type) opinfo = &interp->op_info_table[*pc]; /* first arguments - PIC needs it */ + + /* check for RT#58044 */ + PARROT_ASSERT(CONTEXT(interp)->n_regs_used); + prederef_args(pc_prederef, interp, pc, opinfo); switch (type) { diff --git a/src/library.c b/src/library.c index 0cb438ddf1..47431bbd8b 100644 --- a/src/library.c +++ b/src/library.c @@ -223,7 +223,9 @@ get_search_paths(PARROT_INTERP, enum_lib_paths which) =item C -RT#48260: Not yet documented!!! +Determines whether a file name given by a fixed-8 or utf8 C is an +absolute file name. Returns C<1> if the filename is absolute, returns C<0> +otherwise. =cut @@ -244,7 +246,7 @@ is_abs_path(ARGIN(const STRING *file)) (strncmp(file_name+1, ":\\", 2) == 0 || strncmp(file_name+1, ":/", 2) == 0))) #else - if (file_name[0] == '/') /* XXX ../foo, ./bar */ + if (file_name[0] == '/') /* XXX ../foo, ./bar */ #endif { return 1; @@ -287,7 +289,10 @@ cnv_to_win32_filesep(ARGMOD(STRING *path)) =item C -RT#48260: Not yet documented!!! +Ensures the given STRING C has a C-style NULL character at the end. The +length of the string is not increased to account for this NULL, however. In +WIN32 systems, the path separator is switched from the unix-style "/" to the +Windows-style "\". =cut @@ -409,7 +414,9 @@ static const char* load_ext_code[ LOAD_EXT_CODE_LAST + 1 ] = { =item C -RT#48260: Not yet documented!!! +Attempts to load a file with name C. If the file is successfully located, +the finalized name of the file is returned as a STRING. Otherwise, returns +NULL. =cut diff --git a/src/parrot_debugger.c b/src/parrot_debugger.c index 674de4b4d3..0b2b24c67b 100644 --- a/src/parrot_debugger.c +++ b/src/parrot_debugger.c @@ -209,6 +209,9 @@ main(int argc, char *argv[]) fclose(imc_yyin_get(yyscanner)); PackFile_fixup_subs(interp, PBC_POSTCOMP, NULL); + + /* load the source for debugger list */ + PDB_load_source(interp, filename); } Parrot_unblock_GC_mark(interp);