B-C
view release on metacpan or search on metacpan
Needed to call utf8::SWASHINIT at init with CALLREGCOMP and /i
Avoid duplicate PL_utf8_tofold ToCf swash initialization with 5.18 (#330)
* CC (1.15): Skip saving non-existing methods analog to B::C 1.43_06 (CC test 50)
Fix failing CopFILE_free and CopSTASH_free in END blocks with threads (#296, CC test 48)
Handle duplicate function names, like multiple END blocks or anon functions (#297)
Replace each %hash with foreach sort keys (#307)
* Bytecode (1.15): Replace each %hash with foreach keys (#307)
* Bblock (1.04): Do not pollute B::CC (find_leaders) with B::Concise
1.45 2014-02-11 rurban
* t/issue281.t: fix wrong test ($[ vs $])
1.44 2014-02-10 rurban
added adjusted CORE testsuite for 5.14. passes for 5.14.4-nt, not for 5.18.2-nt
(cPanel code_monkeys)
still missing in general are:
- global destruction (use lexicals!),
- attribute handlers,
- compile-time perlio layers
* C: Fix -O3 with ~ and ~~ formatstrings (#277)
No conversion code for loading older bytecode needed, but fragile (double => 2 int)
* t/modules.t: refactored by Todd Rinaldo (toddr). 4*tests per module:
-s a, exitcode 0, ok, no warnings on stderr
* t/TESTS: added 38, failing on CC (Nick Koston).
added 39, failing everywhere.
* t/test.pl: refactor: Try to timeout on all tests (compiler and exec) if
IPC::Run is installed
* MANIFEST, *.pod: Moved conference pods to ramblings,
removed lib/B/Asmdata.pm again, added t/qr_loaded_module.pm
* t/testm.sh, t/modules.pm: added, -t not working yet though
* t/b.t: $[ => $]
1.18 2010-02-06 rurban
evaltry (test 12) still broken on most systems.
* C.pm, C.xs: fixed r-magic for 5.6 (ExtUtils::Install,
File::Temp, Template::Stash). need tests for run-time checks (33).
5.6 misses MG->pregcomp
* t/modules.t: check for a.out (test from toddr)
* Makefile.PL: create lib/B/Asmdata.pm beforehand (toddr)
* ByteLoader: fixed duplicate + missing bl_header for bsd and Darwin
See test 30.
Arithmetic
Optimized compiled Perl programs use native C arithmetic
much more frequently than standard perl. So operations on
large numbers or on boundary cases may produce different behaviour.
Deprecated features
Features of standard perl such as $[ which have been deprecated
in standard perl since version 5 was released have not been
implemented in the compiler.
STATUS
C is stable, CC is unstable.
Bytecode stable until 5.16
The Bytecode compiler is disabled for 5.6.2, use the default instead.
See STATUS for details.
README.alpha view on Meta::CPAN
generates the output
456123E0
with standard Perl but gives a compile-time error with compiled Perl.
Arithmetic
Compiled Perl programs use native C arithemtic much more frequently
than standard perl. Operations on large numbers or on boundary
cases may produce different behaviour.
Deprecated features
Features of standard perl such as $[ which have been deprecated
in standard perl since version 5 was released have not been
implemented in the compiler.
Others
I'll add to this list as I remember what they are.
BUGS
Here are some things which may cause the compiler problems.
The following render the compiler useless (without serious hacking):
* Use of the DATA filehandle (via __END__ or __DATA__ tokens)
* Operator overloading with %OVERLOAD
* The (deprecated) magic array-offset variable $[ does not work
* The following operators are not yet implemented for CC
goto
sort with a non-default comparison (i.e. a named sub or inline block)
* You can't use "last" to exit from a non-loop block.
The following may give significant problems:
* BEGIN blocks containing complex initialisation code
* Code which is only ever referred to at runtime (e.g. via eval "..." or
via method calls): see the -u option for the C and CC backends.
* Run-time lookups of lexical variables in "outside" closures
then ok 41, ok 39.DESTROY probs
op/regexp.t OK ok ok (trivially all eval'd)
op/repeat.t OK ok ok
op/sleep.t OK ok ok
op/sort.t OK ok 1..10, ok 1, Out of memory!
op/split.t OK ok ok
op/sprintf.t OK ok ok
op/stat.t OK ok ok
op/study.t OK ok ok
op/subst.t OK ok ok
op/substr.t OK ok ok1-22 except 7-9,11 (all $[)
op/taint.t
op/tie.t
op/tiearray.t
op/tiehandle.t
op/time.t OK ok ok
op/tr.t
op/undef.t omit 21 ok ok
op/universal.t
op/unshift.t OK ok ok
op/utf8decode.t
print sprintf(qq{ sv_setpv_mg(get_svs(":", GV_ADD|GV_NOTQUAL), %s);\n}, cstring($:)) if $: ne " \n-"; #LINE_BREAK_CHARACTERS
print sprintf(qq/ sv_setpv_mg(get_svs("^", GV_ADD|GV_NOTQUAL), savepvn(%s, %u));\n/, cstring($^), length($^))
if $^ ne "STDOUT_TOP";
print sprintf(qq/ sv_setpv_mg(get_svs("~", GV_ADD|GV_NOTQUAL), savepvn(%s, %u));\n/, cstring($~), length($~))
if $~ ne "STDOUT";
print qq{ sv_setiv_mg(get_svs("%", GV_ADD|GV_NOTQUAL), $%);\n} if $%; #PAGE_NUMBER
print qq{ sv_setiv_mg(get_svs("-", GV_ADD|GV_NOTQUAL), $-);\n} unless ($- == 0 or $- == 60); #LINES_LEFT
print qq{ sv_setiv_mg(get_svs("=", GV_ADD|GV_NOTQUAL), $=);\n} if $= != 60; #LINES_PER_PAGE
# deprecated global vars
print qq{ {SV* s = get_svs("[",GV_NOTQUAL); sv_setiv(s, $[); mg_set(s);}\n} if $[; #ARRAY_BASE
if ($] < 5.010) { # OFMT and multiline matching
eval q[
print sprintf(qq{ sv_setpv(GvSVn(gv_fetchpv("\$#", GV_ADD|GV_NOTQUAL, SVt_PV)), %s);\n},
cstring($#)) if $#;
print sprintf(qq{ sv_setiv(GvSVn(gv_fetchpv("\$*", GV_ADD|GV_NOTQUAL, SVt_IV)), %d);\n}, $*) if $*;
];
}
print sprintf(qq{ sv_setpv_mg(get_svs("\030", GV_ADD|GV_NOTQUAL), %s); /* \$^X */\n},
cstring($Config{perlpath}));
lib/B/CC.pm view on Meta::CPAN
=head2 Arithmetic
Compiled Perl programs use native C arithmetic much more frequently
than standard perl. Operations on large numbers or on boundary
cases may produce different behaviour.
In doubt B::CC code behaves more like with C<use integer>.
=head2 Deprecated features
Features of standard perl such as C<$[> which have been deprecated
in standard perl since Perl5 was released have not been implemented
in the optimizing compiler.
=head1 AUTHORS
Malcolm Beattie C<MICB at cpan.org> I<(1996-1998, retired)>,
Vishal Bhatia <vishal at deja.com> I(1999),
Gurusamy Sarathy <gsar at cpan.org> I(1998-2001),
Reini Urban C<perl-compiler at googlegroups.com> I(2008-now),
Heinz Knutzen C<heinz.knutzen at gmx.de> I(2010)
ramblings/remark.js view on Meta::CPAN
require=function(e,t,n){function i(n,s){if(!t[n]){if(!e[n]){var o=typeof require=="function"&&require;if(!s&&o)return o(n,!0);if(r)return r(n,!0);throw new Error("Cannot find module '"+n+"'")}var u=t[n]={exports:{}};e[n][0].call(u.exports,function(t)...
this.QUOTE_STRING_MODE={className:"string",begin:'"',end:'"',illegal:"\\n",contains:[this.BACKSLASH_ESCAPE]};this.PHRASAL_WORDS_MODE={begin:/\b(a|an|the|are|I|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such)...
SUBST.contains=EXPRESSIONS;return{aliases:["coffee","cson","iced"],keywords:KEYWORDS,contains:EXPRESSIONS.concat([{className:"comment",begin:"###",end:"###"},hljs.HASH_COMMENT_MODE,{className:"function",begin:"("+JS_IDENT_RE+"\\s*=\\s*)?(\\(.*\\))?\\...
}()},{}],8:[function(require,module,exports){exports.addClass=function(element,className){element.className=exports.getClasses(element).concat([className]).join(" ")};exports.removeClass=function(element,className){element.className=exports.getClasse...
events.on("slideChanged",updateHash);navigateByHash()}function navigateByHash(){var slideNoOrName=(dom.getLocationHash()||"").substr(1);events.emit("gotoSlide",slideNoOrName)}function updateHash(slideNoOrName){dom.setLocationHash("#"+slideNoOrName)}}...
t/issue338.t view on Meta::CPAN
}
use Test::More tests => 2;
use Config;
my $todo = ($] > 5.009 and $] < 5.011) ? "TODO " : "";
ctestok(1, 'C,-O3', 'ccode338i', <<'EOF', $todo.'C #338 qr utf8');
use utf8; my $l = "ñ"; my $re = qr/ñ/; print $l =~ $re ? qq{ok\n} : length($l)."\n".ord($l)."\n";
EOF
# $todo = ($] > 5.021) ? "TODO " : $todo; # 5.22 fixed with B-C-1.52_13
if ($[ < 5.025 or $Config{usecperl}) {
ctestok(2, 'C,-O3', 'ccode333i', <<'EOF', $todo.'C #333 qr utf8');
use encoding "utf8";
my @hiragana = map {chr} ord("ã")..ord("ã");
my @katakana = map {chr} ord("ã¡")..ord("ã³");
my $hiragana = join(q{} => @hiragana);
my $katakana = join(q{} => @katakana);
my %h2k; @h2k{@hiragana} = @katakana;
$str = $hiragana;
$str =~ s/([ã-ã])/$h2k{$1}/go;
print $str eq $katakana ? "ok\n" : "not ok\n$hiragana\n$katakana\n";
print "a: ". ord(lc("\x{1E9E}"))." ; ";
print "b: ". ord("\x{df}")."\n";
foo(lc("\x{1E9E}"), "\x{df}");'
result[2450]='a: 223 ; b: 223
a: 223 ; b: 223 [ from foo ]'
tests[246]='no warnings "experimental::const_attr"; print qq{ok} if &{sub () : const { 42 }} == 42;'
# see t/issue235.t test 2
tests[2460]='sub foo($\@); eval q/foo "s"/; print $@'
result[2460]='Not enough arguments for main::foo at (eval 1) line 1, at EOF'
tests[247]='# WontFix
no warnings; $[ = 1; $big = "N\xabN\xab"; print qq{ok\n} if rindex($big, "N", 3) == 3'
tests[248]='#WONTFIX lexical $_ in re-eval
{my $s="toto";my $_="titi";{$s =~ /to(?{ print "-$_-$s-\n";})to/;}}'
result[248]='-titi-toto-'
tests[249]='use version; print version::is_strict(q{01}) ? 1 : q(ok)'
tests[2501]='#TODO version
use warnings qw/syntax/; use version; $withversion::VERSION = undef; eval q/package withversion 1.1_;/; print $@;'
result[2501]='Misplaced _ in number at (eval 1) line 1.
Invalid version format (no underscores) at (eval 1) line 1, near "package withversion "
syntax error at (eval 1) line 1, near "package withversion 1.1_"'
if [[ $v518 -gt 0 ]]; then
t/testcc.sh view on Meta::CPAN
print "a: ". ord(lc("\x{1E9E}"))." ; ";
print "b: ". ord("\x{df}")."\n";
foo(lc("\x{1E9E}"), "\x{df}");'
result[2450]='a: 223 ; b: 223
a: 223 ; b: 223 [ from foo ]'
tests[246]='no warnings "experimental::const_attr"; print qq{ok} if &{sub () : const { 42 }} == 42;'
# see t/issue235.t test 2
tests[2460]='sub foo($\@); eval q/foo "s"/; print $@'
result[2460]='Not enough arguments for main::foo at (eval 1) line 1, at EOF'
tests[247]='# WontFix
no warnings; $[ = 1; $big = "N\xabN\xab"; print qq{ok\n} if rindex($big, "N", 3) == 3'
tests[248]='#WONTFIX lexical $_ in re-eval
{my $s="toto";my $_="titi";{$s =~ /to(?{ print "-$_-$s-\n";})to/;}}'
result[248]='-titi-toto-'
tests[249]='use version; print version::is_strict(q{01}) ? 1 : q(ok)'
tests[2501]='#TODO version
use warnings qw/syntax/; use version; $withversion::VERSION = undef; eval q/package withversion 1.1_;/; print $@;'
result[2501]='Misplaced _ in number at (eval 1) line 1.
Invalid version format (no underscores) at (eval 1) line 1, near "package withversion "
syntax error at (eval 1) line 1, near "package withversion 1.1_"'
if [[ $v518 -gt 0 ]]; then
t/testplc.sh view on Meta::CPAN
}
print "a: ". ord(lc("\x{1E9E}"))." ; ";
print "b: ". ord("\x{df}")."\n";
foo(lc("\x{1E9E}"), "\x{df}");'
result[245]='a: 223 ; b: 223
a: 223 ; b: 223 [ from foo ]'
# see t/issue235.t test 2
tests[246]='sub foo($\@); eval q/foo "s"/; print $@'
result[246]='Not enough arguments for main::foo at (eval 1) line 1, at EOF'
tests[247]='# WontFix
no warnings; $[ = 1; $big = "N\xabN\xab"; print qq{ok\n} if rindex($big, "N", 3) == 3'
tests[248]='#WONTFIX lexical $_ in re-eval
{my $s="toto";my $_="titi";{$s =~ /to(?{ print "-$_-$s-\n";})to/;}}'
result[248]='-titi-toto-'
tests[249]='#TODO version
use version; print version::is_strict(q{01}) ? 1 : 0'
result[249]='0'
tests[250]='#TODO version
use warnings qw/syntax/; use version; $withversion::VERSION = undef; eval q/package withversion 1.1_;/; print $@;'
result[250]='Misplaced _ in number at (eval 1) line 1.
Invalid version format (no underscores) at (eval 1) line 1, near "package withversion "
( run in 0.529 second using v1.01-cache-2.11-cpan-b61123c0432 )