[perl #45697] [PROPOSAL][IMCC] Remove optional comma for sub flags
# New Ticket Created by Klaas-Jan Stol # Please include the string: [perl #45697] # in the subject line of all future correspondence about this issue. # URL: http://rt.perl.org/rt3/Ticket/Display.html?id=45697 Hi, .sub-routines have flags, such as :load, :main, etc. These flags can currently be separated with a comma... or not. The comma is optional. For .params this is not true. .params can also take flags, such as :optional, :named, etc, but they have no optional comma. I do admit this is a minor issue, but nevertheless, I'm trying to remove as much cruft from imcc.y as possible. Having optional syntax elements makes the language unnecessarily complex and less readable, IMHO. More importantly, some users will adopt the comma while others don't, resulting in non-uniform looking code. Furthermore, ti would be more consistent with .param flags syntax. As the .param flags don't allow for commas to separate them I propose the following. I propose to remove the optional comma for .sub flags. By doing so, the following is NO LONGER allowed: .sub :load, :init :main ## newbies may wonder why there's a comma sometimes #... .end Instead, it should look like this: .sub :load :init :main # ... .end regards, kjs
[perl #45695] [PATCH] Remove seemingly unnecessary Parrot_cont-from_ctx
# New Ticket Created by Bram Geron # Please include the string: [perl #45695] # in the subject line of all future correspondence about this issue. # URL: http://rt.perl.org/rt3/Ticket/Display.html?id=45695 Parrot_cont (the internal structure storing info about (Ret)Continuations) has two fields 'to_ctx' and 'from_ctx'. 'to_ctx' stores the context that should be active after invoking the Continuation, but I don't know what 'from_ctx' is supposed to hold (the context it was made in? the context it was called from?) To test if 'from_ctx' is redundant, I tried removing the field and all accesses to it, and no extra tests failed (see patch). I think we can safely remove the field, if nobody objects. The patch slightly modifies invalidate_retc_context (which makes sure we don't get a Continuation that continues to a RetContinuation, that would be illegal) to explicitly end the loop when we get to the topmost context. If it wouldn't, Parrot segfaults with from_ctx removed. include/parrot/sub.h |2 -- lib/Parrot/Pmc2c/PCCMETHOD.pm |2 -- src/inter_call.c |1 - src/pmc/continuation.pmc |6 ++ src/pmc/coroutine.pmc |1 - src/pmc/exception_handler.pmc |1 - src/pmc/retcontinuation.pmc |5 - src/pmc/sub.pmc |3 --- src/sub.c | 12 ++-- 9 files changed, 8 insertions(+), 25 deletions(-) Regards, Bram Geron diff --git a/include/parrot/sub.h b/include/parrot/sub.h index 6a1b978..bd6c01e 100644 --- a/include/parrot/sub.h +++ b/include/parrot/sub.h @@ -188,8 +188,6 @@ typedef struct Parrot_cont { opcode_t *address; /* start of bytecode, addr to continue */ struct Parrot_Context *to_ctx; /* pointer to dest context */ struct Stack_Chunk *dynamic_state; /* dest dynamic state */ -/* a Continuation keeps the from_ctx alive */ -struct Parrot_Context *from_ctx; /* sub, this cont is returning from */ opcode_t *current_results; /* ptr into code with get_results opcode full continuation only */ int runloop_id; /* id of the creating runloop. */ diff --git a/lib/Parrot/Pmc2c/PCCMETHOD.pm b/lib/Parrot/Pmc2c/PCCMETHOD.pm index 2004d51..f0a900c 100644 --- a/lib/Parrot/Pmc2c/PCCMETHOD.pm +++ b/lib/Parrot/Pmc2c/PCCMETHOD.pm @@ -391,7 +391,6 @@ sub rewrite_pccmethod { } ctx-current_cont= ret_cont; -PMC_cont(ret_cont)-from_ctx = ctx; current_args = interp-current_args; interp-current_args = NULL; @@ -558,7 +557,6 @@ END interp-current_object = $invocant; interp-current_cont = NEED_CONTINUATION; ctx-current_cont= ret_cont; - PMC_cont(ret_cont)-from_ctx = ctx; pccinvoke_meth = VTABLE_find_method(interp, $invocant, $method_name); if (PMC_IS_NULL(pccinvoke_meth)) diff --git a/src/inter_call.c b/src/inter_call.c index f4f66e5..8f2ec02 100644 --- a/src/inter_call.c +++ b/src/inter_call.c @@ -1610,7 +1610,6 @@ Parrot_PCCINVOKE(PARROT_INTERP, NULLOK(PMC* pmc), NOTNULL(STRING *method_name), interp-current_object = pmc; interp-current_cont = NEED_CONTINUATION; ctx-current_cont= ret_cont; -PMC_cont(ret_cont)-from_ctx = ctx; ctx-ref_count++; pccinvoke_meth = VTABLE_find_method(interp, pmc, method_name); diff --git a/src/pmc/continuation.pmc b/src/pmc/continuation.pmc index 4f65a7c..8b5a529 100644 --- a/src/pmc/continuation.pmc +++ b/src/pmc/continuation.pmc @@ -105,12 +105,10 @@ Destroys the continuation. #if CTX_LEAK_DEBUG if (Interp_debug_TEST(interp, PARROT_CTX_DESTROY_DEBUG_FLAG)) { fprintf(stderr, -[destroy cont%p, to_ctx %p, from_ctx %p]\n, -(void *)SELF, (void *)cc-to_ctx, (void *)cc-from_ctx); +[destroy cont%p, to_ctx %p]\n, +(void *)SELF, (void *)cc-to_ctx); } #endif -if (cc-from_ctx) -Parrot_free_context(interp, cc-from_ctx, 0); mem_sys_free(cc); PMC_struct_val(SELF) = NULL; } diff --git a/src/pmc/coroutine.pmc b/src/pmc/coroutine.pmc index 4ff46f7..fcdd9fa 100644 --- a/src/pmc/coroutine.pmc +++ b/src/pmc/coroutine.pmc @@ -175,7 +175,6 @@ Swaps the context. co-ctx = ctx; co-dynamic_state = interp-dynamic_env; ctx-caller_ctx = caller_ctx; -PMC_cont(ccont)-from_ctx = ctx; ctx-current_sub = SELF; ctx-current_HLL = co-HLL_id; ctx-current_namespace= co-namespace_stash; diff --git a/src/pmc/exception_handler.pmc b/src/pmc/exception_handler.pmc index 93c0b64..46a21bf 100644 --- a/src/pmc/exception_handler.pmc +++ b/src/pmc/exception_handler.pmc
[perl #45703] [PATCH] my 1st patch: cleaning up some headerizer warnings as noted in RT 45593
# New Ticket Created by [EMAIL PROTECTED] # Please include the string: [perl #45703] # in the subject line of all future correspondence about this issue. # URL: http://rt.perl.org/rt3/Ticket/Display.html?id=45703 As a start of contributing to parrot, I cleaned a file of the headerizer warnings as noted in RT 45593, because this is my first patch i only changed one file (to keep it simple). Files changed: (by hand): compilers/imcc/imc.c: added NOTNULL and PARROT_CANNOT_RETURN_NULL marcos (automagically by headerizer) don't know if these should have be in the patch... changes seem ok though compilers/imcc/imc.h compilers/imcc/main.c compilers/imcc/imcparser.c imc.c |7 +-- imc.h |3 ++- imcparser.c | 58 -- main.c | 10 ++ 4 files changed, 33 insertions(+), 45 deletions(-) docs.patch Description: Binary data
Re: [perl #45695] [PATCH] Remove seemingly unnecessary Parrot_cont-from_ctx
-if (cc-from_ctx) -Parrot_free_context(interp, cc-from_ctx, 0); -Parrot_free_context(INTERP, from_ctx, 1); I don't know much about this context stuff, so maybe I don't see something, but how are those contexts freed after your patch?
Re: [perl #45695] [PATCH] Remove seemingly unnecessary Parrot_cont-from_ctx
Am Sonntag, 23. September 2007 20:19 schrieb Bram Geron: To test if 'from_ctx' is redundant, I tried removing the field and all accesses to it, and no extra tests failed (see patch). Did you run a memory leak test? The from_ctx is refcounted for some reason. leo
Parrot Bug Summary
Parrot Bug Summary http://rt.perl.org/rt3/NoAuth/parrot/Overview.html Generated at Mon Sep 24 12:40:04 2007 GMT --- * Numbers * New Issues * Overview of Open Issues * Ticket Status By Version * Requestors with most open tickets --- Numbers Ticket Counts: 27 new + 558 open = 585 Created this week: 13 Closed this week: 8 --- New Issues New issues that have not been responded to yet 1 - 2 weeks old 45479 [CAGE] config/gen/PodText.pm: Find better location 45453 [PROPOSAL][IMCC] Change .HLL_map to take STRINGC args instead of INTC 45367 [TODO] Limit the required interface for PMCs 45365 [TODO] Update parrot.el to remove return argument parenthesis requirement 45357 [TODO] Which exception should be thrown with register overflow? 2 - 3 weeks old 45307 [BUG] Misleading time-zone display at http://smoke.parrotcode.org/smoke/ 45267 [TODO] Option '--trace' of the parrot executable 3 - 4 weeks old 45055 [TODO] JIT segs are currently not built 4 - 5 weeks old 44979 [BUG] TGE reports an error, but won't say which line it's on. 44945 [CAGE] Add Documentation to Undef PMC 44861 [TODO]: remove compiler warnings note from README 44851 Update step 2.f in release_manager_guide.pod 5 - 6 weeks old 44765 [PATCH] Don't reuse interpreter argument on stack 6 - 7 weeks old 44487 Exporter docs rely on t/pmc/exporter.t for examples 44471 [PATCH] :vtable is ignored when :anon 7 - 8 weeks old 44307 PIR tutorial 8 - 9 weeks old 44139 opcodes, warnings, and exceptions 9 - 10 weeks old 10 - 11 weeks old 11 - 12 weeks old 12 - 13 weeks old 13 - 14 weeks old 14 - 15 weeks old 15 - 16 weeks old 16 - 17 weeks old 17 - 18 weeks old 18 - 19 weeks old 19 - 20 weeks old 20 - 21 weeks old --- Overview of Open Issues PlatformSeverity Tag Lang aix0abandoned 0 5005threads 0 Amber0 All3fatal 3 bounce0 BASIC0 bsdos 0High 0 Bug 61 bc 0 cygwin 7low 1 compiler 1 befunge 0 cygwin_nt 0medium0 configure 0 bf 0 darwin 5none 0 core 0 cola 0 dec_osf0Normal1 dailybuild0 forth0 dgux 0unknown 0 docs 1 jako 0 dos0Wishlist 3 duplicate 0 Lisp 2 dynixptx 0 install 1 m4 0 freebsd8 library 0 ook 0 generic0 notabug 0 perl61 gnu0 notok 0 plot 0 HPUX 2 ok0 punie0 irix 0 Patch42 pynie2 irix64 0 regex 0 python 0 Linux 3 sendToCPAN0 ruby 0 lynxos 0 Todo292 scheme 0 mac0 unknown 0 tcl 72 machten0 utilities 0 urm 0 macos 0 wontfix 0 Zcode0 MacOS X2 mswin320 netbsd 1 next 0 openbsd2 os20 os390 0 other 0 powerux0 qnx0 riscos 0 sco0 Solaris5 sunos 1 svr4 0 svr5 0 sysv 0 unicos 0 unicosmk 0 unix 0 unknown0 uts0 vms0 VOS0 Win32 10 --- Ticket Status By Version New or OpenResolved --- Requestors with most open tickets Paul Cochrane 149 James Keenan 59 Will Coleda44 Jerry Gay 40 chromatic 26 jerry gay 25 Matt Diephouse 22 Chip Salzenberg15 Bernhard Schmalhofer 15 Andy Lester14 --- * Total Issues * New Issues * Overview of Open Issues * Ticket Status By Version * Requestors with most open tickets --- This page is CPU intensive to create, it will be updated only once every 30 minutes
Re: [perl #45697] [PROPOSAL][IMCC] Remove optional comma for sub flags
Klaas-Jan Stol (via RT) schrieb: .sub :load, :init :main ## newbies may wonder why there's a comma sometimes #... .end Instead, it should look like this: .sub :load :init :main # ... .end The version without the ',' looks saner and consistency is a good thing. So I second this proposal. Regards, Bernhard
Re: [perl #45703] [PATCH] my 1st patch: cleaning up some headerizer warnings as noted in RT 45593
[EMAIL PROTECTED] (via RT) schrieb: # New Ticket Created by [EMAIL PROTECTED] # Please include the string: [perl #45703] # in the subject line of all future correspondence about this issue. # URL: http://rt.perl.org/rt3/Ticket/Display.html?id=45703 As a start of contributing to parrot, I cleaned a file of the headerizer warnings as noted in RT 45593, because this is my first patch i only changed one file (to keep it simple). Hi, welcome to the vibrant world of Parrot. I have a question regarding your patch. Are you sure about @@ -87,7 +89,7 @@ PARROT_API void -imc_cleanup(PARROT_INTERP, void *yyscanner) +imc_cleanup(PARROT_INTERP, NULLOK(void *yyscanner)) { IMCC_pop_parser_state(interp, yyscanner); clear_globals(interp); I gather that imc_cleanup() does cleaning up and probably needs an initialized yyscanner. So Parrot should either be prepared for yyscanner being NULL or complain loudly. Best regards, Bernhard
Re: [perl #45697] [PROPOSAL][IMCC] Remove optional comma for sub flags
Klaas-Jan Stol (via RT) wrote: I propose to remove the optional comma for .sub flags. [...] sub :load :init :main # ... end Agreed and approved. Please take the usual deprecation steps, and make a quick note of the syntax change in the draft PIR PDD (docs/pdds/draft/pdd19_pir.pod). Thanks, Allison
[perl #45737] [PATCH] [NEW] Change interface to all configuration step runstep() methods
# New Ticket Created by James Keenan # Please include the string: [perl #45737] # in the subject line of all future correspondence about this issue. # URL: http://rt.perl.org/rt3/Ticket/Display.html?id=45737 This patch is submitted in response to a question which I posed in http://rt.perl.org/rt3/Ticket/Display.html?id=45523 over the weekend, viz., What do we gain by having some configuration step classes' runstep() methods return $self (the step object itself)? Why can't we simply have a step return 1 upon success and undef otherwise? The answer is: There is no good reason why some of the configuration steps' runstep() methods return $self instead of 1. It's totally unnecessary. The patch demonstrates this and proposes: 1. Change in the specification for a step's runstep() method in docs/ configuration.pod. 2. In all config/*/*.pm modules, wherever a runstep() method returned $self, it now returns 1. Each such method continues to return undef upon failure -- failure in the sense of the step didn't accomplish what you wanted it to do. 3. Several test files are modified to reflect the new interface. 4. Parrot::Configure::_run_this_step() is modified to reflect the new interface from the caller's point of view. This is a significant revision both for the number of files it affects and also for the fact that this will help us get to --fatal- step options and logging of unsuccessful steps (two other recently created RT tickets). This was tested on Linux with both 'perl Configure.pl --test' and 'make test'. All tests passed. Please review and comment. Thank you very much. kid51 Index: docs/configuration.pod === --- docs/configuration.pod (revision 21533) +++ docs/configuration.pod (working copy) @@ -149,11 +149,12 @@ =item Lrunstep This method is called to actually execute the step. The global -LParrot::Configure is passed in as the first parameter. The return value is -undefined. +LParrot::Configure is passed in as the first parameter. The return +value should be C1 if the step accomplishes what it is intended to do. +Otherwise, the step should simply Creturn, Ii.e., return an +undefined value. -IXXX In the near future the return value of this method will be significant -and there will be a means of passing additional parameters. +IXXX In the near future there will be a means of passing additional parameters. =back Index: MANIFEST === --- MANIFEST(revision 21533) +++ MANIFEST(working copy) @@ -1,7 +1,7 @@ # ex: set ro: # $Id$ # -# generated by tools/dev/mk_manifest_and_skip.pl Mon Sep 24 13:09:40 2007 UT +# generated by tools/dev/mk_manifest_and_skip.pl Tue Sep 25 02:16:39 2007 UT # # See tools/dev/install_files.pl for documentation on the # format of this file. @@ -2988,9 +2988,11 @@ t/configure/testlib/init/beta.pm[] t/configure/testlib/init/delta.pm [] t/configure/testlib/init/epsilon.pm [] +t/configure/testlib/init/eta.pm [] t/configure/testlib/init/foobar.pm [] t/configure/testlib/init/gamma.pm [] t/configure/testlib/init/zeta.pm[] +t/configure/testlib/inter/theta.pm [] t/distro/file_metadata.t[] t/distro/manifest.t [] t/distro/test_file_coverage.t [] Index: lib/Parrot/Configure.pm === --- lib/Parrot/Configure.pm (revision 21533) +++ lib/Parrot/Configure.pm (working copy) @@ -186,7 +186,8 @@ Crunstep() method, followed by any parameters that were registered for that step. -Accepts no arguments and modifies the data structure within the LParrot::Configure object. +Accepts no arguments and modifies the data structure within the +LParrot::Configure object. =cut @@ -194,19 +195,18 @@ my $conf = shift; my $n = 0;# step number -my ( $verbose, $verbose_step, $ask ) = $conf-options-get(qw( verbose verbose-step ask )); +my ( $verbose, $verbose_step, $ask ) = +$conf-options-get(qw( verbose verbose-step ask )); foreach my $task ( $conf-steps ) { $n++; -$conf-_run_this_step( -{ -task = $task, -verbose = $verbose, -verbose_step = $verbose_step, -ask = $ask, -n= $n, -} -); +my $rv = $conf-_run_this_step( { +task= $task, +verbose = $verbose, +verbose_step= $verbose_step, +ask = $ask, +n
Re: PDD 15 - accessing parent's attributes
Jonathan Worthington wrote: PMC* get_attr_keyed(PMC* key, STRING* idx) void set_attr_keyed(PMC* key, STRING* idx, PMC* value) :write _keyed is consistent, but not particularly descriptive - it's not *really* a keyed access that we're doing here. _super maybe is better, though I'm not sure I like that. Different object models may choose to use this vtable for different internal behavior, so in this case it's better to stick with the consistent. Anyway, nobody seems to hate it so far so I'll look at implementing it, if nobody beats me to that. I've just implemented it in the pdd15oo branch. While you're at it, any chance of some suggested PIR syntax for calling super-methods? Guess we need a _keyed/_super/_worreva variant of find_method too, for this. I'd like to keep the concepts of 'super' and 'find_method' separate, if possible. Maybe a PIR syntax of: obj.SUPER.'foo'() Which breaks down to: $P0 = get_super obj $P0.'foo'() But, the super-ness of 'find_method' may be too deeply intertwined to allow that. At the very least, we should start by looking at all the places we'll need the concept of 'super' and design them to work together sanely. Allison