Skip to content

Commit

Permalink
BC: add ix to -Dv debug output
Browse files Browse the repository at this point in the history
  • Loading branch information
Reini Urban committed Oct 31, 2012
1 parent 87d023f commit 5ada1e0
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 8 deletions.
17 changes: 12 additions & 5 deletions STATUS
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
5.8, 5.6 and earlier had a good core perl compiler, but we are much better.

Our Bytecode compiler disabled for 5.6, we keep the old. The old core compiler
fails 50% but in mine is a 5.6 blocker.
Our Bytecode compiler disabled for 5.6, we keep the old. The old core
compiler fails 50% but in mine is a 5.6 blocker.
Bytecode is only stable for >=5.8, non-debugging, threaded.

C is used in production, but a bit unstable, not all methods packages are detected.
C is used in production, but a bit unstable, not all methods packages
are detected.

CC is very unstable and slow, work in progress.

Expand Down Expand Up @@ -95,7 +96,7 @@ t/bytecode 27,46
t/c -
t/cc 14,21,30,46,50,103,105

5.15.7:
5.16.1:
t/bytecode 27,46
t/c -
t/cc 14,21,30,46,50,103,105
Expand All @@ -114,10 +115,16 @@ generally: pass 100%
5.10.1 pass 100%
5.12.4 pass 100%
5.14.2 pass 100%
5.15.7 fail 4% (unshare_hek) Moose MooseX::Types DateTime DateTime::TimeZone
5.16.1 fail 4% (unshare_hek) Moose MooseX::Types DateTime DateTime::TimeZone
5.17.6 ??

Run-time tests not yet fully done

5.17.x status
-----------
PADLIST support not yet stable.
op_static fixed since 5.17.6, 5.17.2-5.17.5 are unusable without -fno-destruct

5.16 status
-----------
new XSLoader:load_file
Expand Down
11 changes: 8 additions & 3 deletions bytecode.pl
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ BEGIN
/* -*- buffer-read-only: t -*-
*
* Copyright (c) 1996-1999 Malcolm Beattie
* Copyright (c) 2008,2009,2010,2011 Reini Urban
* Copyright (c) 2008,2009,2010,2011,2012 Reini Urban
*
* You may distribute under the terms of either the GNU General Public
* License or the Artistic License, as specified in the README file.
Expand Down Expand Up @@ -465,7 +465,7 @@ package B::Asmdata;
printf BYTERUN_C "\t\tDEBUG_v(Perl_deb(aTHX_ \"(insn %%3d) $insn $argtype:%s\\n\", insn, $printarg%s));\n",
$argfmt, ($argtype =~ /index$/ ? ', (int)ix' : '');
if ($insn eq 'newopx' or $insn eq 'newop') {
print BYTERUN_C "\t\tDEBUG_v(Perl_deb(aTHX_ \"\t [%s]\\n\", PL_op_name[arg>>7]));\n";
print BYTERUN_C "\t\tDEBUG_v(Perl_deb(aTHX_ \"\t [%s %d]\\n\", PL_op_name[arg>>7], bstate->bs_ix));\n";
}
if ($fundtype eq 'PV') {
print BYTERUN_C "\t\tDEBUG_v(Perl_deb(aTHX_ \"\t BGET_PV(arg) => \\\"%s\\\"\\n\", bstate->bs_pv.xpv_pv));\n";
Expand All @@ -482,9 +482,14 @@ package B::Asmdata;
print BYTERUN_C "\t\tif (force)\n\t" if $unsupp;
print BYTERUN_C "\t\tBSET_$insn($lvalue$optarg);\n";
my $optargcast = $optarg eq ", arg" ? ", $printarg" : '';
$optargcast .= ($insn =~ /x$/ and $optarg eq ", arg" ? ", bstate->bs_ix-1" : '');
printf BYTERUN_C "\t\tDEBUG_v(Perl_deb(aTHX_ \"\t BSET_$insn($lvalue%s)\\n\"$optargcast));\n",
$optarg eq ", arg"
? ($fundtype =~ /(strconst|pvcontents)/ ? ', \"%s\"' : ", ".($argtype =~ /index$/ ? '0x%'.$UVxf : $argfmt))
? ($fundtype =~ /(strconst|pvcontents)/
? ($insn =~ /x$/ ? ', \"%s\" ix:%d' : ', \"%s\"')
: (", " .($argtype =~ /index$/ ? '0x%'.$UVxf : $argfmt)
.($insn =~ /x$/ ? ' ix:%d' : ''))
)
: '';
} elsif ($flags =~ /s/) {
# Store instructions to bytecode_obj_list[arg]. "lvalue" field is rvalue.
Expand Down
1 change: 1 addition & 0 deletions lib/B/Bytecode.pm
Original file line number Diff line number Diff line change
Expand Up @@ -652,6 +652,7 @@ sub B::PAD::bsave {
my @array = $av->ARRAY;
$_ = $_->ix for @array; # save the elements
$av->B::NULL::bsave($ix);
# av_extend always allocs 3
asm "av_extend", scalar @array if @array;
asm "av_pushx", $_ for @array;
}
Expand Down

0 comments on commit 5ada1e0

Please sign in to comment.