… | |
… | |
58 | |
58 | |
59 | # we don't need no steenking PIC on x86 |
59 | # we don't need no steenking PIC on x86 |
60 | $COMPILE =~ s/-f(?:PIC|pic)//g |
60 | $COMPILE =~ s/-f(?:PIC|pic)//g |
61 | if $Config{archname} =~ /^(i[3456]86)-/; |
61 | if $Config{archname} =~ /^(i[3456]86)-/; |
62 | |
62 | |
63 | my $opt_assert = 0; |
63 | my $opt_assert = $ENV{FASTER_DEBUG}; |
|
|
64 | my $verbose = $ENV{FASTER_VERBOSE}+0; |
64 | |
65 | |
65 | our $source; |
66 | our $source; |
66 | |
67 | |
67 | our @ops; |
68 | our @ops; |
68 | our $op; |
69 | our $op; |
… | |
… | |
286 | out_next; |
287 | out_next; |
287 | } |
288 | } |
288 | |
289 | |
289 | sub op_padsv { |
290 | sub op_padsv { |
290 | my $flags = $op->flags; |
291 | my $flags = $op->flags; |
291 | my $target = $op->targ; |
292 | my $targ = $op->targ; |
292 | |
293 | |
293 | $source .= <<EOF; |
294 | $source .= <<EOF; |
294 | { |
295 | { |
295 | dSP; |
296 | dSP; |
296 | XPUSHs (PAD_SV ((PADOFFSET)$target)); |
297 | XPUSHs (PAD_SV ((PADOFFSET)$targ)); |
297 | PUTBACK; |
298 | PUTBACK; |
298 | EOF |
299 | EOF |
299 | if ($op->flags & B::OPf_MOD) { |
300 | if ($op->flags & B::OPf_MOD) { |
300 | if ($op->private & B::OPpLVAL_INTRO) { |
301 | if ($op->private & B::OPpLVAL_INTRO) { |
301 | $source .= " SAVECLEARSV (PAD_SVl ((PADOFFSET)$target));\n"; |
302 | $source .= " SAVECLEARSV (PAD_SVl ((PADOFFSET)$targ));\n"; |
302 | } elsif ($op->private & B::OPpDEREF) { |
303 | } elsif ($op->private & B::OPpDEREF) { |
303 | my $deref = $op->private & B::OPpDEREF; |
304 | my $deref = $op->private & B::OPpDEREF; |
304 | $source .= " Perl_vivify_ref (PAD_SVl ((PADOFFSET)$target), $deref);\n"; |
305 | $source .= " Perl_vivify_ref (PAD_SVl ((PADOFFSET)$targ), $deref);\n"; |
305 | } |
306 | } |
306 | } |
307 | } |
307 | $source .= <<EOF; |
308 | $source .= <<EOF; |
308 | } |
309 | } |
309 | EOF |
310 | EOF |
… | |
… | |
541 | |
542 | |
542 | my $pkg = $cv->STASH->NAME; |
543 | my $pkg = $cv->STASH->NAME; |
543 | |
544 | |
544 | return if $ignore{$pkg}; |
545 | return if $ignore{$pkg}; |
545 | |
546 | |
546 | warn "compiling ", $cv->STASH->NAME;#d# |
547 | warn "compiling ", $cv->STASH->NAME, "\n" |
|
|
548 | if $verbose; |
547 | |
549 | |
548 | eval { |
550 | eval { |
549 | my @cv; |
551 | my @cv; |
550 | my @cv_source; |
552 | my @cv_source; |
551 | |
553 | |
… | |
… | |
582 | |
584 | |
583 | 1; |
585 | 1; |
584 | |
586 | |
585 | =back |
587 | =back |
586 | |
588 | |
|
|
589 | =head1 ENVIRONMENT VARIABLES |
|
|
590 | |
|
|
591 | The following environment variables influence the behaviour of Faster: |
|
|
592 | |
|
|
593 | =over 4 |
|
|
594 | |
|
|
595 | =item FASTER_VERBOSE |
|
|
596 | |
|
|
597 | Faster will output more informational messages when set to values higher |
|
|
598 | than C<0>. Currently, C<1> outputs which packages are being compiled. |
|
|
599 | |
|
|
600 | =item FASTER_DEBUG |
|
|
601 | |
|
|
602 | Add debugging code when set to values higher than C<0>. Currently, this |
|
|
603 | adds 1-3 C<assert>'s per perl op, to ensure that opcode order and C |
|
|
604 | execution order are compatible. |
|
|
605 | |
|
|
606 | =item FASTER_CACHE |
|
|
607 | |
|
|
608 | NOT YET IMPLEMENTED |
|
|
609 | |
|
|
610 | Set a persistent cache directory that caches compiled code |
|
|
611 | fragments. Normally, code compiled by Faster will be deleted immediately, |
|
|
612 | and every restart will recompile everything. Setting this variable to a |
|
|
613 | directory makes Faster cache the generated files for re-use. |
|
|
614 | |
|
|
615 | This directory will always grow in contents, so you might need to erase it |
|
|
616 | from time to time. |
|
|
617 | |
|
|
618 | =back |
|
|
619 | |
587 | =head1 BUGS/LIMITATIONS |
620 | =head1 BUGS/LIMITATIONS |
588 | |
621 | |
589 | Perl will check much less often for asynchronous signals in |
622 | Perl will check much less often for asynchronous signals in |
590 | Faster-compiled code. It tries to check on every function call, loop |
623 | Faster-compiled code. It tries to check on every function call, loop |
591 | iteration and every I/O operator, though. |
624 | iteration and every I/O operator, though. |