develooper Front page | perl.perl5.porters | Postings from July 2013

[perl #116296] [PATCH] remove PL_patchlevel from and optimize S_minus_v

Thread Previous | Thread Next
From:
bulk88 via RT
Date:
July 5, 2013 15:34
Subject:
[perl #116296] [PATCH] remove PL_patchlevel from and optimize S_minus_v
Message ID:
rt-3.6.HEAD-2552-1373038441-1600.116296-15-0@perl.org
On Fri Jul 05 00:01:09 2013, tonyc wrote:
> On Fri Jan 04 09:37:10 2013, bulk88 wrote:
> > See attached patch.
> 
> This patch no longer applies.

I'll have to work on it then.

> 
> I can see a couple of places it could be improved:
> 
> +		    level = Perl_newSVpvf_nocontext("%s", num);
> 
> Couldn't this just be:
> 
>   level = newSVpvn(num, num_len);

No for code size reasons. There is a 2nd Perl_newSVpvf_nocontext below
in the other branch. Compiler will put params on C stack then jump to
the "call Perl_newSVpvf_nocontext" instruction. The "call
Perl_newSVpvf_nocontext" is shared by both branches.
Perl_newSVpvf_nocontext takes 2 params, newSVpvn takes 3 params on ithreads.

> 
>  	PerlIO_printf(PIO_stdout,
> -		Perl_form(aTHX_ "\nThis is perl, %"SVf"\n",
> -		    SVfARG(vstringify(PL_patchlevel))));
> +		Perl_form(aTHX_ "\nThis is perl, " "v" PERL_VERSION_STRING "\n");
> 
> Why is Perl_form() being called here?

Good catch. It is redundant.

> 
> #elif defined(UNDER_CE)
>  			"WINCE port by Rainer Keuchel, 2001-2002\n"
>  			"Built on " __DATE__ " " __TIME__ "\n\n");
>  	wce_hitreturn();
> -#endif
> -#ifdef __SYMBIAN32__
> -	PerlIO_printf(PIO_stdout,
> -		      "Symbian port by Nokia, 2004-2005\n");
> -#endif
> +#elif defined(__SYMBIAN32__)
> +		      "Symbian port by Nokia, 2004-2005\n"
> +#endif /* end of additional copyright lines */
> +
>  #ifdef BINARY_BUILD_NOTICE
> +#  ifndef UNDER_CE
> +	); /* close Larry Wall copyright printf */
> +#  endif
>  	BINARY_BUILD_NOTICE;
> -#endif
>  	PerlIO_printf(PIO_stdout,
> +#elif defined(UNDER_CE) /* because of wce_hitreturn() open new printf */
> +	PerlIO_printf(PIO_stdout,
> +/* else CPP catenation continues from Larry Wall copyright printf */
> +#endif
> 
> The contortions to handle UNDER_CE ending the PerlIO_printf() are
> confusing.  Wouldn't it be better to put the wce_hitreturn() in it's own
> #ifdef UNDER_CE ?

So confusing I need more time to think up an answer. I have to try to
get this to apply to blead so I will figure out what can be done about
UNDER_CE when I try to compile the code.

> 
> Tony

-- 
bulk88 ~ bulk88 at hotmail.com

---
via perlbug:  queue: perl5 status: open
https://rt.perl.org:443/rt3/Ticket/Display.html?id=116296

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About