3 # Copyright (c) 1996-1998 Malcolm Beattie
5 # You may distribute under the terms of either the GNU General Public
6 # License or the Artistic License, as specified in the README file.
12 use B qw(main_cv main_root main_start comppadlist
13 class peekop walkoptree svref_2object cstring walksymtable
14 init_av begin_av end_av
15 SVf_POK SVp_POK SVf_IOK SVp_IOK SVf_NOK SVp_NOK
16 SVf_READONLY GVf_IMPORTED_AV GVf_IMPORTED_CV GVf_IMPORTED_HV
19 use B::Asmdata qw(@optype @specialsv_name);
20 use B::Assembler qw(assemble_fh);
24 for ($i = 0; $i < @optype; $i++) {
25 $optype_enum{$optype[$i]} = $i;
28 # Following is SVf_POK|SVp_POK
29 # XXX Shouldn't be hardwired
30 sub POK () { SVf_POK|SVp_POK }
32 # Following is SVf_IOK|SVp_IOK
33 # XXX Shouldn't be hardwired
34 sub IOK () { SVf_IOK|SVp_IOK }
36 # Following is SVf_NOK|SVp_NOK
37 # XXX Shouldn't be hardwired
38 sub NOK () { SVf_NOK|SVp_NOK }
39 # nonexistant flags (see B::GV::bytecode for usage)
40 sub GVf_IMPORTED_IO () { 0; }
41 sub GVf_IMPORTED_FORM () { 0; }
42 my ($verbose, $module_only, $no_assemble, $debug_bc, $debug_cv);
45 my @packages; # list of packages to compile
46 # Optimisation options. On the command line, use hyphens instead of
47 # underscores for compatibility with gcc-style options. We use
48 # underscores here because they are OK in (strict) barewords.
49 my ($strip_syntree, $compress_nullops, $omit_seq, $bypass_nullops);
50 my %optimise = (strip_syntax_tree => \$strip_syntree,
51 compress_nullops => \$compress_nullops,
52 omit_sequence_numbers => \$omit_seq,
53 bypass_nullops => \$bypass_nullops);
56 my %symtable; # maps object addresses to object indices.
57 # Filled in at allocation (newsv/newop) time.
58 my %saved; # maps object addresses (for SVish classes) to "saved yet?"
59 # flag. Set at FOO::bytecode time usually by SV::bytecode.
60 # Manipulated via saved(), mark_saved(), unmark_saved().
62 my $svix = -1; # we keep track of when the sv register contains an element
63 # of the object table to avoid unnecessary repeated
64 # consecutive ldsv instructions.
65 my $opix = -1; # Ditto for the op register.
106 return cstring($str . "\0");
113 # print full precision
114 my $str = sprintf "%.40f", $_[0];
117 sub saved { $saved{${$_[0]}} }
118 sub mark_saved { $saved{${$_[0]}} = 1 }
119 sub unmark_saved { $saved{${$_[0]}} = 0 }
121 sub debug { $debug_bc = shift }
125 warn sprintf("bytecode save method for %s (0x%x) not yet implemented\n",
130 # objix may stomp on the op register (for op objects)
131 # or the sv register (for SV objects)
133 sub B::OBJECT::objix {
135 my $ix = $symtable{$$obj};
139 $obj->newix($nextix);
140 return $symtable{$$obj} = $nextix++;
146 printf "newsv %d\t# %s\n", $sv->FLAGS & 0xf, class($sv);
152 my $gvname = $gv->NAME;
153 my $name = cstring($gv->STASH->NAME . "::" . $gvname);
154 print "gv_fetchpv $name\n";
160 my $name = $hv->NAME;
163 printf "gv_stashpv %s\n", cstring($name);
166 # It's an ordinary HV. Fall back to ordinary newix method
167 $hv->B::SV::newix($ix);
171 sub B::SPECIAL::newix {
173 # Special case. $$sv is not the address of the SV but an
174 # index into svspecialsv_list.
175 printf "ldspecsv $$sv\t# %s\n", $specialsv_name[$$sv];
181 my $class = class($op);
182 my $typenum = $optype_enum{$class};
183 require('Carp.pm'), Carp::croak("OP::newix: can't understand class $class")
184 unless defined($typenum);
185 print "newop $typenum\t# $class\n";
189 sub B::OP::walkoptree_debug {
191 warn(sprintf("walkoptree: %s\n", peekop($op)));
194 sub B::OP::bytecode {
196 my $next = $op->next;
198 my $sibix = $op->sibling->objix unless $strip_syntree;
200 my $type = $op->type;
202 if ($bypass_nullops) {
203 $next = $next->next while $$next && $next->type == 0;
205 $nextix = $next->objix;
207 printf "# %s\n", peekop($op) if $debug_bc;
209 print "op_next $nextix\n";
210 print "op_sibling $sibix\n" unless $strip_syntree;
211 printf "op_type %s\t# %d\n", "pp_" . $op->name, $type;
212 printf("op_seq %d\n", $op->seq) unless $omit_seq;
213 if ($type || !$compress_nullops) {
214 printf "op_targ %d\nop_flags 0x%x\nop_private 0x%x\n",
215 $op->targ, $op->flags, $op->private;
219 sub B::UNOP::bytecode {
221 my $firstix = $op->first->objix unless $strip_syntree;
222 $op->B::OP::bytecode;
223 if (($op->type || !$compress_nullops) && !$strip_syntree) {
224 print "op_first $firstix\n";
228 sub B::LOGOP::bytecode {
230 my $otherix = $op->other->objix;
231 $op->B::UNOP::bytecode;
232 print "op_other $otherix\n";
235 sub B::SVOP::bytecode {
238 my $svix = $sv->objix;
239 $op->B::OP::bytecode;
240 print "op_sv $svix\n";
244 sub B::PADOP::bytecode {
246 my $padix = $op->padix;
247 $op->B::OP::bytecode;
248 print "op_padix $padix\n";
251 sub B::PVOP::bytecode {
254 $op->B::OP::bytecode;
256 # This would be easy except that OP_TRANS uses a PVOP to store an
257 # endian-dependent array of 256 shorts instead of a plain string.
259 if ($op->name eq "trans") {
260 my @shorts = unpack("s256", $pv); # assembler handles endianness
261 print "op_pv_tr ", join(",", @shorts), "\n";
263 printf "newpv %s\nop_pv\n", pvstring($pv);
267 sub B::BINOP::bytecode {
269 my $lastix = $op->last->objix unless $strip_syntree;
270 $op->B::UNOP::bytecode;
271 if (($op->type || !$compress_nullops) && !$strip_syntree) {
272 print "op_last $lastix\n";
276 sub B::LISTOP::bytecode {
278 my $children = $op->children unless $strip_syntree;
279 $op->B::BINOP::bytecode;
280 if (($op->type || !$compress_nullops) && !$strip_syntree) {
281 print "op_children $children\n";
285 sub B::LOOP::bytecode {
287 my $redoopix = $op->redoop->objix;
288 my $nextopix = $op->nextop->objix;
289 my $lastopix = $op->lastop->objix;
290 $op->B::LISTOP::bytecode;
291 print "op_redoop $redoopix\nop_nextop $nextopix\nop_lastop $lastopix\n";
294 sub B::COP::bytecode {
296 my $file = $op->file;
297 my $line = $op->line;
298 if ($debug_bc) { # do this early to aid debugging
299 printf "# line %s:%d\n", $file, $line;
301 my $stashpv = $op->stashpv;
302 my $warnings = $op->warnings;
303 my $warningsix = $warnings->objix;
305 $op->B::OP::bytecode;
306 printf <<"EOT", pvstring($op->label), pvstring($stashpv), $op->cop_seq, pvstring($file), $op->arybase;
316 cop_warnings $warningsix
320 sub B::PMOP::bytecode {
322 my $replroot = $op->pmreplroot;
323 my $replrootix = $replroot->objix;
324 my $replstartix = $op->pmreplstart->objix;
325 my $opname = $op->name;
326 # pmnext is corrupt in some PMOPs (see misc.t for example)
327 #my $pmnextix = $op->pmnext->objix;
330 # OP_PUSHRE (a mutated version of OP_MATCH for the regexp
331 # argument to a split) stores a GV in op_pmreplroot instead
332 # of a substitution syntax tree. We don't want to walk that...
333 if ($opname eq "pushre") {
336 walkoptree($replroot, "bytecode");
339 $op->B::LISTOP::bytecode;
340 if ($opname eq "pushre") {
341 printf "op_pmreplrootgv $replrootix\n";
343 print "op_pmreplroot $replrootix\nop_pmreplstart $replstartix\n";
345 my $re = pvstring($op->precomp);
346 # op_pmnext omitted since a perl bug means it's sometime corrupt
347 printf <<"EOT", $op->pmflags, $op->pmpermflags;
355 sub B::SV::bytecode {
357 return if saved($sv);
359 my $refcnt = $sv->REFCNT;
360 my $flags = sprintf("0x%x", $sv->FLAGS);
362 print "sv_refcnt $refcnt\nsv_flags $flags\n";
366 sub B::PV::bytecode {
368 return if saved($sv);
369 $sv->B::SV::bytecode;
370 printf("newpv %s\nxpv\n", pvstring($sv->PV)) if $sv->FLAGS & POK;
373 sub B::IV::bytecode {
375 return if saved($sv);
377 $sv->B::SV::bytecode;
378 printf "%s $iv\n", $sv->needs64bits ? "xiv64" : "xiv32" if $sv->FLAGS & IOK; # could be PVNV
381 sub B::NV::bytecode {
383 return if saved($sv);
384 $sv->B::SV::bytecode;
385 printf "xnv %s\n", nv($sv->NVX);
388 sub B::RV::bytecode {
390 return if saved($sv);
392 my $rvix = $rv->objix;
394 $sv->B::SV::bytecode;
398 sub B::PVIV::bytecode {
400 return if saved($sv);
402 $sv->B::PV::bytecode;
403 printf "%s $iv\n", $sv->needs64bits ? "xiv64" : "xiv32";
406 sub B::PVNV::bytecode {
408 my $flag = shift || 0;
409 # The $flag argument is passed through PVMG::bytecode by BM::bytecode
410 # and AV::bytecode and indicates special handling. $flag = 1 is used by
411 # BM::bytecode and means that we should ensure we save the whole B-M
412 # table. It consists of 257 bytes (256 char array plus a final \0)
413 # which follow the ordinary PV+\0 and the 257 bytes are *not* reflected
414 # in SvCUR. $flag = 2 is used by AV::bytecode and means that we only
415 # call SV::bytecode instead of saving PV and calling NV::bytecode since
416 # PV/NV/IV stuff is different for AVs.
417 return if saved($sv);
419 $sv->B::SV::bytecode;
422 $sv->B::IV::bytecode;
423 printf "xnv %s\n", nv($sv->NVX);
425 $pv .= "\0" . $sv->TABLE;
426 printf "newpv %s\npv_cur %d\nxpv\n", pvstring($pv),length($pv)-257;
428 printf("newpv %s\nxpv\n", pvstring($pv)) if $sv->FLAGS & POK;
433 sub B::PVMG::bytecode {
434 my ($sv, $flag) = @_;
435 # See B::PVNV::bytecode for an explanation of $flag.
436 return if saved($sv);
437 # XXX We assume SvSTASH is already saved and don't save it later ourselves
438 my $stashix = $sv->SvSTASH->objix;
439 my @mgchain = $sv->MAGIC;
442 # We need to traverse the magic chain and get objix for each OBJ
443 # field *before* we do B::PVNV::bytecode since objix overwrites
444 # the sv register. However, we need to write the magic-saving
445 # bytecode *after* B::PVNV::bytecode since sv isn't initialised
446 # to refer to $sv until then.
448 @mgobjix = map($_->OBJ->objix, @mgchain);
449 $sv->B::PVNV::bytecode($flag);
450 print "xmg_stash $stashix\n";
451 foreach $mg (@mgchain) {
452 printf "sv_magic %s\nmg_obj %d\nnewpv %s\nmg_pv\n",
453 cstring($mg->TYPE), shift(@mgobjix), pvstring($mg->PTR);
457 sub B::PVLV::bytecode {
459 return if saved($sv);
460 $sv->B::PVMG::bytecode;
461 printf <<'EOT', $sv->TARGOFF, $sv->TARGLEN, cstring($sv->TYPE);
468 sub B::BM::bytecode {
470 return if saved($sv);
471 # See PVNV::bytecode for an explanation of what the argument does
472 $sv->B::PVMG::bytecode(1);
473 printf "xbm_useful %d\nxbm_previous %d\nxbm_rare %d\n",
474 $sv->USEFUL, $sv->PREVIOUS, $sv->RARE;
477 sub B::GV::bytecode {
479 return if saved($gv);
480 return unless grep { $_ eq $gv->STASH->NAME; } @packages;
484 printf <<"EOT", $gv->FLAGS, $gv->GvFLAGS;
488 my $refcnt = $gv->REFCNT;
489 printf("sv_refcnt_add %d\n", $refcnt - 1) if $refcnt > 1;
490 return if $gv->is_empty;
491 printf <<"EOT", $gv->LINE, pvstring($gv->FILE);
496 my $gvname = $gv->NAME;
497 my $name = cstring($gv->STASH->NAME . "::" . $gvname);
499 my $egvix = $egv->objix;
500 my $gvrefcnt = $gv->GvREFCNT;
501 printf("gp_refcnt_add %d\n", $gvrefcnt - 1) if $gvrefcnt > 1;
502 if ($gvrefcnt > 1 && $ix != $egvix) {
503 print "gp_share $egvix\n";
505 if ($gvname !~ /^([^A-Za-z]|STDIN|STDOUT|STDERR|ARGV|SIG|ENV)$/) {
507 my @subfield_names = qw(SV AV HV CV FORM IO);
508 @subfield_names = grep {;
510 !($gv->GvFLAGS & ${\"GVf_IMPORTED_$_"}->());
512 my @subfields = map($gv->$_(), @subfield_names);
513 my @ixes = map($_->objix, @subfields);
514 # Reset sv register for $gv
516 for ($i = 0; $i < @ixes; $i++) {
517 printf "gp_%s %d\n", lc($subfield_names[$i]), $ixes[$i];
519 # Now save all the subfields
521 foreach $sv (@subfields) {
528 sub B::HV::bytecode {
530 return if saved($hv);
532 my $name = $hv->NAME;
535 # It's an ordinary HV. Stashes have NAME set and need no further
536 # saving beyond the gv_stashpv that $hv->objix already ensures.
537 my @contents = $hv->ARRAY;
539 for ($i = 1; $i < @contents; $i += 2) {
540 push(@ixes, $contents[$i]->objix);
542 for ($i = 1; $i < @contents; $i += 2) {
543 $contents[$i]->bytecode;
546 for ($i = 0; $i < @contents; $i += 2) {
547 printf("newpv %s\nhv_store %d\n",
548 pvstring($contents[$i]), $ixes[$i / 2]);
550 printf "sv_refcnt %d\nsv_flags 0x%x\n", $hv->REFCNT, $hv->FLAGS;
554 sub B::AV::bytecode {
556 return if saved($av);
558 my $fill = $av->FILL;
563 @ixes = map($_->objix, @array);
565 foreach $sv (@array) {
569 # See PVNV::bytecode for the meaning of the flag argument of 2.
570 $av->B::PVMG::bytecode(2);
571 # Recover sv register and set AvMAX and AvFILL to -1 (since we
572 # create an AV with NEWSV and SvUPGRADE rather than doing newAV
573 # which is what sets AvMAX and AvFILL.
575 printf "sv_flags 0x%x\n", $av->FLAGS & ~SVf_READONLY; # SvREADONLY_off($av) in case PADCONST
576 printf "xav_flags 0x%x\nxav_max -1\nxav_fill -1\n", $av->AvFLAGS;
579 foreach $elix (@ixes) {
580 print "av_push $elix\n";
584 print "av_extend $max\n";
587 printf "sv_flags 0x%x\n", $av->FLAGS; # restore flags from above
590 sub B::CV::bytecode {
592 return if saved($cv);
593 return if ${$cv->GV} && ($cv->GV->GvFLAGS & GVf_IMPORTED_CV);
595 $cv->B::PVMG::bytecode;
597 my @subfield_names = qw(ROOT START STASH GV PADLIST OUTSIDE);
598 my @subfields = map($cv->$_(), @subfield_names);
599 my @ixes = map($_->objix, @subfields);
600 # Save OP tree from CvROOT (first element of @subfields)
601 my $root = shift @subfields;
603 walkoptree($root, "bytecode");
605 # Reset sv register for $cv (since above ->objix calls stomped on it)
607 for ($i = 0; $i < @ixes; $i++) {
608 printf "xcv_%s %d\n", lc($subfield_names[$i]), $ixes[$i];
610 printf "xcv_depth %d\nxcv_flags 0x%x\n", $cv->DEPTH, $cv->CvFLAGS;
611 printf "newpv %s\nxcv_file\n", pvstring($cv->FILE);
612 # Now save all the subfields (except for CvROOT which was handled
613 # above) and CvSTART (now the initial element of @subfields).
614 shift @subfields; # bye-bye CvSTART
616 foreach $sv (@subfields) {
621 sub B::IO::bytecode {
623 return if saved($io);
625 my $top_gv = $io->TOP_GV;
626 my $top_gvix = $top_gv->objix;
627 my $fmt_gv = $io->FMT_GV;
628 my $fmt_gvix = $fmt_gv->objix;
629 my $bottom_gv = $io->BOTTOM_GV;
630 my $bottom_gvix = $bottom_gv->objix;
632 $io->B::PVMG::bytecode;
634 print "xio_top_gv $top_gvix\n";
635 print "xio_fmt_gv $fmt_gvix\n";
636 print "xio_bottom_gv $bottom_gvix\n";
638 foreach $field (qw(TOP_NAME FMT_NAME BOTTOM_NAME)) {
639 printf "newpv %s\nxio_%s\n", pvstring($io->$field()), lc($field);
641 foreach $field (qw(LINES PAGE PAGE_LEN LINES_LEFT SUBPROCESS)) {
642 printf "xio_%s %d\n", lc($field), $io->$field();
644 printf "xio_type %s\nxio_flags 0x%x\n", cstring($io->IoTYPE), $io->IoFLAGS;
647 $bottom_gv->bytecode;
650 sub B::SPECIAL::bytecode {
651 # nothing extra needs doing
654 sub bytecompile_object {
656 svref_2object($sv)->bytecode;
660 sub B::GV::bytecodecv {
663 if ($$cv && !saved($cv)) {
665 warn sprintf("saving extra CV &%s::%s (0x%x) from GV 0x%x\n",
666 $gv->STASH->NAME, $gv->NAME, $$cv, $$gv);
672 sub save_call_queues {
673 if (ref(begin_av()) eq "B::AV") { # this is just to save 'use Foo;' calls
674 for my $cv (begin_av->ARRAY) {
675 my $name = $cv->STASH->NAME;
676 next unless grep { $_ eq $name } @packages;
678 $op = $op->next while ($$op && ref $op ne "B::UNOP");
679 if ($$op && $op->name eq 'require') { # should be first UNOP
681 printf "push_begin %d\n", $cv->objix;
685 if (ref(init_av()) eq "B::AV") {
686 for my $cv (init_av->ARRAY) {
687 next unless grep { $_ eq $cv->STASH->NAME } @packages;
689 printf "push_init %d\n", $cv->objix;
692 if (ref(end_av()) eq "B::AV") {
693 for my $cv (end_av->ARRAY) {
694 next unless grep { $_ eq $cv->STASH->NAME } @packages;
696 printf "push_end %d\n", $cv->objix;
703 my $ok = 1 if grep { (my $name = $_[0]) =~ s/::$//; $_ eq $name;} @packages;
704 if (grep { /^$_[0]/; } @packages) {
705 walksymtable(\%{"$_[0]"}, "bytecodecv", \&symwalk, $_[0]);
707 warn "considering $_[0] ... " . ($ok ? "accepted\n" : "rejected\n")
712 sub bytecompile_main {
713 my $curpad = (comppadlist->ARRAY)[1];
714 my $curpadix = $curpad->objix;
716 walkoptree(main_root, "bytecode") unless ref(main_root) eq "B::NULL";
717 warn "done main program, now walking symbol table\n" if $debug_bc;
721 walksymtable(\%{"main::"}, "bytecodecv", \&symwalk);
723 die "No packages requested for compilation!\n";
726 printf "main_root %d\n", main_root->objix;
727 printf "main_start %d\n", main_start->objix;
728 printf "curpad $curpadix\n";
729 # XXX Do min_intro_pending and max_intro_pending matter?
732 sub prepare_assemble {
733 my $newfh = IO::File->new_tmpfile;
741 seek($fh, 0, 0); # rewind the temporary file
742 assemble_fh($fh, sub { print OUT @_ });
747 my ($option, $opt, $arg);
748 open(OUT, ">&STDOUT");
752 while ($option = shift @options) {
753 if ($option =~ /^-(.)(.*)/) {
757 unshift @options, $option;
760 if ($opt eq "-" && $arg eq "-") {
763 } elsif ($opt eq "o") {
764 $arg ||= shift @options;
765 open(OUT, ">$arg") or return "$arg: $!\n";
767 } elsif ($opt eq "a") {
768 $arg ||= shift @options;
769 open(OUT, ">>$arg") or return "$arg: $!\n";
771 } elsif ($opt eq "D") {
772 $arg ||= shift @options;
773 foreach $arg (split(//, $arg)) {
777 } elsif ($arg eq "o") {
779 } elsif ($arg eq "a") {
780 B::Assembler::debug(1);
781 } elsif ($arg eq "C") {
785 } elsif ($opt eq "v") {
787 } elsif ($opt eq "m") { # XXX: NOP
789 } elsif ($opt eq "S") {
791 } elsif ($opt eq "f") {
792 $arg ||= shift @options;
793 my $value = $arg !~ s/^no-//;
795 my $ref = $optimise{$arg};
799 warn qq(ignoring unknown optimisation option "$arg"\n);
801 } elsif ($opt eq "O") {
802 $arg = 1 if $arg eq "";
804 foreach $ref (values %optimise) {
814 $compress_nullops = 1;
817 } elsif ($opt eq "P") {
818 $arg ||= shift @options;
819 push @packages, $arg;
823 warn "No package specified for compilation, assuming main::\n";
824 @packages = qw(main);
826 if (@options) { # XXX: unsupported and untested!
830 $newfh = prepare_assemble() unless $no_assemble;
831 foreach $objname (@options) {
832 eval "bytecompile_object(\\$objname)";
834 do_assemble($newfh) unless $no_assemble;
839 $newfh = prepare_assemble() unless $no_assemble;
841 do_assemble($newfh) unless $no_assemble;
852 B::Bytecode - Perl compiler's bytecode backend
856 perl -MO=Bytecode[,OPTIONS] foo.pl
860 This compiler backend takes Perl source and generates a
861 platform-independent bytecode encapsulating code to load the
862 internal structures perl uses to run your program. When the
863 generated bytecode is loaded in, your program is ready to run,
864 reducing the time which perl would have taken to load and parse
865 your program into its internal semi-compiled form. That means that
866 compiling with this backend will not help improve the runtime
867 execution speed of your program but may improve the start-up time.
868 Depending on the environment in which your program runs this may
869 or may not be a help.
871 The resulting bytecode can be run with a special byteperl executable
872 or (for non-main programs) be loaded via the C<byteload_fh> function
877 If there are any non-option arguments, they are taken to be names of
878 objects to be saved (probably doesn't work properly yet). Without
879 extra arguments, it saves the main program.
885 Output to filename instead of STDOUT.
889 Append output to filename.
893 Force end of options.
897 Force optimisations on or off one at a time. Each can be preceded
898 by B<no-> to turn the option off (e.g. B<-fno-compress-nullops>).
900 =item B<-fcompress-nullops>
902 Only fills in the necessary fields of ops which have
903 been optimised away by perl's internal compiler.
905 =item B<-fomit-sequence-numbers>
907 Leaves out code to fill in the op_seq field of all ops
908 which is only used by perl's internal compiler.
910 =item B<-fbypass-nullops>
912 If op->op_next ever points to a NULLOP, replaces the op_next field
913 with the first non-NULLOP in the path of execution.
915 =item B<-fstrip-syntax-tree>
917 Leaves out code to fill in the pointers which link the internal syntax
918 tree together. They're not needed at run-time but leaving them out
919 will make it impossible to recompile or disassemble the resulting
920 program. It will also stop C<goto label> statements from working.
924 Optimisation level (n = 0, 1, 2, ...). B<-O> means B<-O1>.
925 B<-O1> sets B<-fcompress-nullops> B<-fomit-sequence numbers>.
926 B<-O6> adds B<-fstrip-syntax-tree>.
930 Debug options (concatenated or separate flags like C<perl -D>).
934 Prints each OP as it's processed.
938 Print debugging information about bytecompiler progress.
942 Tells the (bytecode) assembler to include source assembler lines
943 in its output as bytecode comments.
947 Prints each CV taken from the final symbol tree walk.
951 Output (bytecode) assembler source rather than piping it
952 through the assembler and outputting bytecode.
956 Stores package in the output.
962 perl -MO=Bytecode,-O6,-ofoo.plc,-Pmain foo.pl
964 perl -MO=Bytecode,-S,-Pmain foo.pl > foo.S
965 assemble foo.S > foo.plc
967 Note that C<assemble> lives in the C<B> subdirectory of your perl
968 library directory. The utility called perlcc may also be used to
969 help make use of this compiler.
971 perl -MO=Bytecode,-PFoo,-oFoo.pmc Foo.pm
975 Output is still huge and there are still occasional crashes during
976 either compilation or ByteLoading. Current status: experimental.
980 Malcolm Beattie, C<mbeattie@sable.ox.ac.uk>
981 Benjamin Stuhl, C<sho_pi@hotmail.com>