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

Comparing Faster/Faster.pm (file contents):
Revision 1.4 by root, Thu Mar 9 22:32:17 2006 UTC vs.
Revision 1.5 by root, Thu Mar 9 22:55:56 2006 UTC

54 entertry unsafe 54 entertry unsafe
55 substconst unsafe 55 substconst unsafe
56 formline unsafe 56 formline unsafe
57 grepstart unsafe 57 grepstart unsafe
58 require unsafe 58 require unsafe
59 match unsafe todo
60 subst unsafe todo
61 entereval unsafe todo
62 mapstart unsafe todo
59 63
60 pushmark noasync 64 pushmark noasync
61 padsv noasync 65 padsv noasync
62 entersub noasync 66 entersub noasync
63 aassign noasync 67 aassign noasync
94} 98}
95 99
96sub out_next { 100sub out_next {
97 my ($op) = @_; 101 my ($op) = @_;
98 102
103 if (${$op->next}) {
99 $source .= " nextop = (OP *)${$op->next}L;\n"; 104 $source .= " nextop = (OP *)${$op->next}L;\n";
100 $source .= " goto op_${$op->next};\n"; 105 $source .= " goto op_${$op->next};\n";
106 } else {
107 $source .= " return 0;\n";
108 }
101} 109}
102 110
103sub callop { 111sub callop {
104 my ($op) = @_; 112 my ($op) = @_;
105 113
106 my $name = $op->name; 114 my $name = $op->name;
107 115
108 $name eq "entersub" 116 $name eq "entersub"
109 ? "(PL_ppaddr [OP_ENTERSUB]) (aTHX)" 117 ? "(PL_ppaddr [OP_ENTERSUB]) (aTHX)"
118 : $name eq "mapstart"
119 ? "Perl_pp_grepstart (aTHX)"
110 : "Perl_pp_$name (aTHX)" 120 : "Perl_pp_$name (aTHX)"
111} 121}
112 122
113sub op_nextstate { 123sub op_nextstate {
114 my ($op) = @_; 124 my ($op) = @_;
115 125
150 my ($op) = @_; 160 my ($op) = @_;
151 161
152 $source .= <<EOF; 162 $source .= <<EOF;
153 { 163 {
154 dSP; 164 dSP;
165
155 if (SvTRUE (TOPs)) 166 if (SvTRUE (TOPs))
156 { 167 {
157 --SP; 168 --SP;
158 PUTBACK; 169 PUTBACK;
159 nextop = (OP *)${$op->other}L; 170 nextop = (OP *)${$op->other}L;
160 goto op_${$op->other}; 171 goto op_${$op->other};
161 } 172 }
162
163 nextop = (OP *)${$op->next}L;
164 goto op_${$op->next};
165 } 173 }
166EOF 174EOF
175
176 out_next $op;
167} 177}
168 178
169sub op_padsv { 179sub op_padsv {
170 my ($op) = @_; 180 my ($op) = @_;
171 181
299 $source .= " PERL_ASYNC_CHECK ();\n"; 309 $source .= " PERL_ASYNC_CHECK ();\n";
300 } 310 }
301 311
302 if (my $can = __PACKAGE__->can ("op_$name")) { 312 if (my $can = __PACKAGE__->can ("op_$name")) {
303 $can->($op); 313 $can->($op);
314 } elsif (exists $flag{unsafe}{$name}) {
315 $source .= " assert ((\"$name\", nextop == (OP *)$$op));\n";#d#
316 $source .= " PL_op = nextop; return " . (callop $op) . ";\n";
304 } elsif ("LOGOP" eq B::class $op or exists $flag{otherop}{$name}) { 317 } elsif ("LOGOP" eq B::class $op or exists $flag{otherop}{$name}) {
305 $source .= " assert ((\"$name\", nextop == (OP *)$$op));\n";#d# 318 $source .= " assert ((\"$name\", nextop == (OP *)$$op));\n";#d#
306 $source .= " PL_op = nextop; nextop = " . (callop $op) . ";\n"; 319 $source .= " PL_op = nextop; nextop = " . (callop $op) . ";\n";
307 $source .= " if (nextop == (OP *)${$op->other}L) goto op_${$op->other};\n"; 320 $source .= " if (nextop == (OP *)${$op->other}L) goto op_${$op->other};\n";
308 $source .= " assert ((\"$name\", nextop == (OP *)${$op->next}));\n";#d# 321 $source .= " assert ((\"$name\", nextop == (OP *)${$op->next}));\n";#d#
309 $source .= " goto op_${$op->next};\n"; 322 $source .= ${$op->next} ? " goto op_${$op->next};\n" : " return 0;\n";
310 } elsif (exists $flag{unsafe}{$name}) {
311 $source .= " assert ((\"$name\", nextop == (OP *)$$op));\n";#d#
312 $source .= " PL_op = nextop; return " . (callop $op) . ";\n";
313 } else { 323 } else {
314 $source .= " assert ((\"$name\", nextop == (OP *)$$op));\n";#d# 324 $source .= " assert ((\"$name\", nextop == (OP *)$$op));\n";#d#
315 $source .= " PL_op = nextop; nextop = " . (callop $op) . ";\n"; 325 $source .= " PL_op = nextop; nextop = " . (callop $op) . ";\n";
316 if ($name eq "entersub") { 326 if ($name eq "entersub") {
317 $source .= <<EOF; 327 $source .= <<EOF;
321 PL_op = nextop; nextop = (PL_op->op_ppaddr)(aTHX); 331 PL_op = nextop; nextop = (PL_op->op_ppaddr)(aTHX);
322 } 332 }
323EOF 333EOF
324 } 334 }
325 $source .= " assert ((\"$name\", nextop == (OP *)${$op->next}));\n";#d# 335 $source .= " assert ((\"$name\", nextop == (OP *)${$op->next}));\n";#d#
326 $source .= " goto op_${$op->next};\n"; 336 $source .= ${$op->next} ? " goto op_${$op->next};\n" : " return 0;\n";
327 } 337 }
328 } 338 }
329 339
330 $source .= "}\n"; 340 $source .= "}\n";
331 #warn $source; 341 #warn $source;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines