ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/Faster/Faster.pm
(Generate patch)

Comparing Faster/Faster.pm (file contents):
Revision 1.8 by root, Fri Mar 10 01:51:14 2006 UTC vs.
Revision 1.9 by root, Fri Mar 10 01:55:12 2006 UTC

142 : $op_name eq "mapstart" 142 : $op_name eq "mapstart"
143 ? "Perl_pp_grepstart (aTHX)" 143 ? "Perl_pp_grepstart (aTHX)"
144 : "Perl_pp_$op_name (aTHX)" 144 : "Perl_pp_$op_name (aTHX)"
145} 145}
146 146
147sub out_next { 147sub out_gotonext {
148 if (${$op->next}) { 148 if (${$op->next}) {
149 $source .= " nextop = (OP *)${$op->next}L;\n";
150 $source .= " assert ((\"$op_name\", nextop == (OP *)${$op->next}));\n"; 149 $source .= " assert ((\"$op_name\", nextop == (OP *)${$op->next}));\n";
151 $source .= " goto op_${$op->next};\n"; 150 $source .= " goto op_${$op->next};\n";
152 } else { 151 } else {
153 $source .= " return 0;\n"; 152 $source .= " return 0;\n";
154 } 153 }
154}
155
156sub out_next {
157 $source .= " nextop = (OP *)${$op->next}L;\n";
158
159 out_gotonext;
155} 160}
156 161
157sub out_linear { 162sub out_linear {
158 $source .= " assert ((\"$op_name\", nextop == (OP *)$$op));\n";#d# 163 $source .= " assert ((\"$op_name\", nextop == (OP *)$$op));\n";#d#
159 $source .= " PL_op = nextop; nextop = " . (callop $op) . ";\n"; 164 $source .= " PL_op = nextop; nextop = " . (callop $op) . ";\n";
165 PL_op = nextop; nextop = (PL_op->op_ppaddr)(aTHX); 170 PL_op = nextop; nextop = (PL_op->op_ppaddr)(aTHX);
166 } 171 }
167EOF 172EOF
168 } 173 }
169 174
170 out_next; 175 out_gotonext;
171} 176}
172 177
173sub op_nextstate { 178sub op_nextstate {
174 $source .= " PL_curcop = (COP *)nextop;\n"; 179 $source .= " PL_curcop = (COP *)nextop;\n";
175 $source .= " PL_stack_sp = PL_stack_base + cxstack[cxstack_ix].blk_oldsp;\n"; 180 $source .= " PL_stack_sp = PL_stack_base + cxstack[cxstack_ix].blk_oldsp;\n";
414 419
415 if (my $can = __PACKAGE__->can ("op_$op_name")) { 420 if (my $can = __PACKAGE__->can ("op_$op_name")) {
416 $can->($op); 421 $can->($op);
417 } elsif (exists $flag{unsafe}{$op_name}) { 422 } elsif (exists $flag{unsafe}{$op_name}) {
418 $source .= " assert ((\"$op_name\", nextop == (OP *)$$op));\n"; 423 $source .= " assert ((\"$op_name\", nextop == (OP *)$$op));\n";
419 $source .= " PL_op = nextop; return " . (callop $op) . ";\n"; 424 $source .= " return nextop;\n";
420 } elsif ("LOGOP" eq B::class $op or exists $flag{otherop}{$op_name}) { 425 } elsif ("LOGOP" eq B::class $op or exists $flag{otherop}{$op_name}) {
421 $source .= " assert ((\"$op_name\", nextop == (OP *)$$op));\n"; 426 $source .= " assert ((\"$op_name\", nextop == (OP *)$$op));\n";
422 $source .= " PL_op = nextop; nextop = " . (callop $op) . ";\n"; 427 $source .= " PL_op = nextop; nextop = " . (callop $op) . ";\n";
423 $source .= " if (nextop == (OP *)${$op->other}L) goto op_${$op->other};\n"; 428 $source .= " if (nextop == (OP *)${$op->other}L) goto op_${$op->other};\n";
424 $source .= " assert ((\"$op_name\", nextop == (OP *)${$op->next}));\n"; 429 $source .= " assert ((\"$op_name\", nextop == (OP *)${$op->next}));\n";

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines