home *** CD-ROM | disk | FTP | other *** search
-
- <HTML>
- <HEAD>
- <TITLE>B::Bytecode - Perl compiler's bytecode backend</TITLE>
- <LINK REL="stylesheet" HREF="../../Active.css" TYPE="text/css">
- <LINK REV="made" HREF="mailto:">
- </HEAD>
-
- <BODY>
- <TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0 WIDTH=100%>
- <TR><TD CLASS=block VALIGN=MIDDLE WIDTH=100% BGCOLOR="#cccccc">
- <STRONG><P CLASS=block> B::Bytecode - Perl compiler's bytecode backend</P></STRONG>
- </TD></TR>
- </TABLE>
-
- <A NAME="__index__"></A>
- <!-- INDEX BEGIN -->
-
- <UL>
-
- <LI><A HREF="#name">NAME</A></LI><LI><A HREF="#supportedplatforms">SUPPORTED PLATFORMS</A></LI>
-
- <LI><A HREF="#synopsis">SYNOPSIS</A></LI>
- <LI><A HREF="#description">DESCRIPTION</A></LI>
- <LI><A HREF="#options">OPTIONS</A></LI>
- <LI><A HREF="#examples">EXAMPLES</A></LI>
- <LI><A HREF="#bugs">BUGS</A></LI>
- <LI><A HREF="#author">AUTHOR</A></LI>
- </UL>
- <!-- INDEX END -->
-
- <HR>
- <P>
- <H1><A NAME="name">NAME</A></H1>
- <P>B::Bytecode - Perl compiler's bytecode backend</P>
- <P>
- <HR>
- <H1><A NAME="supportedplatforms">SUPPORTED PLATFORMS</A></H1>
- <UL>
- <LI>Linux</LI>
- <LI>Solaris</LI>
- <LI>Windows</LI>
- </UL>
- <HR>
- <H1><A NAME="synopsis">SYNOPSIS</A></H1>
- <PRE>
- perl -MO=Bytecode[,OPTIONS] foo.pl</PRE>
- <P>
- <HR>
- <H1><A NAME="description">DESCRIPTION</A></H1>
- <P>This compiler backend takes Perl source and generates a
- platform-independent bytecode encapsulating code to load the
- internal structures perl uses to run your program. When the
- generated bytecode is loaded in, your program is ready to run,
- reducing the time which perl would have taken to load and parse
- your program into its internal semi-compiled form. That means that
- compiling with this backend will not help improve the runtime
- execution speed of your program but may improve the start-up time.
- Depending on the environment in which your program runs this may
- or may not be a help.</P>
- <P>The resulting bytecode can be run with a special byteperl executable
- or (for non-main programs) be loaded via the <CODE>byteload_fh</CODE> function
- in the <EM>B</EM> module.</P>
- <P>
- <HR>
- <H1><A NAME="options">OPTIONS</A></H1>
- <P>If there are any non-option arguments, they are taken to be names of
- objects to be saved (probably doesn't work properly yet). Without
- extra arguments, it saves the main program.</P>
- <DL>
- <DT><STRONG><A NAME="item_%2Dofilename"><STRONG>-ofilename</STRONG></A></STRONG><BR>
- <DD>
- Output to filename instead of STDOUT.
- <P></P>
- <DT><STRONG><A NAME="item_%2Dafilename"><STRONG>-afilename</STRONG></A></STRONG><BR>
- <DD>
- Append output to filename.
- <P></P>
- <DT><STRONG><A NAME="item_%2D%2D"><STRONG>--</STRONG></A></STRONG><BR>
- <DD>
- Force end of options.
- <P></P>
- <DT><STRONG><A NAME="item_%2Df"><STRONG>-f</STRONG></A></STRONG><BR>
- <DD>
- Force optimisations on or off one at a time. Each can be preceded
- by <STRONG>no-</STRONG> to turn the option off (e.g. <STRONG>-fno-compress-nullops</STRONG>).
- <P></P>
- <DT><STRONG><A NAME="item_%2Dfcompress%2Dnullops"><STRONG>-fcompress-nullops</STRONG></A></STRONG><BR>
- <DD>
- Only fills in the necessary fields of ops which have
- been optimised away by perl's internal compiler.
- <P></P>
- <DT><STRONG><A NAME="item_%2Dfomit%2Dsequence%2Dnumbers"><STRONG>-fomit-sequence-numbers</STRONG></A></STRONG><BR>
- <DD>
- Leaves out code to fill in the op_seq field of all ops
- which is only used by perl's internal compiler.
- <P></P>
- <DT><STRONG><A NAME="item_%2Dfbypass%2Dnullops"><STRONG>-fbypass-nullops</STRONG></A></STRONG><BR>
- <DD>
- If op->op_next ever points to a NULLOP, replaces the op_next field
- with the first non-NULLOP in the path of execution.
- <P></P>
- <DT><STRONG><A NAME="item_%2Dfstrip%2Dsyntax%2Dtree"><STRONG>-fstrip-syntax-tree</STRONG></A></STRONG><BR>
- <DD>
- Leaves out code to fill in the pointers which link the internal syntax
- tree together. They're not needed at run-time but leaving them out
- will make it impossible to recompile or disassemble the resulting
- program. It will also stop <CODE>goto label</CODE> statements from working.
- <P></P>
- <DT><STRONG><A NAME="item_%2DOn"><STRONG>-On</STRONG></A></STRONG><BR>
- <DD>
- Optimisation level (n = 0, 1, 2, ...). <STRONG>-O</STRONG> means <STRONG>-O1</STRONG>.
- <STRONG>-O1</STRONG> sets <STRONG>-fcompress-nullops</STRONG> <STRONG>-fomit-sequence numbers</STRONG>.
- <STRONG>-O6</STRONG> adds <STRONG>-fstrip-syntax-tree</STRONG>.
- <P></P>
- <DT><STRONG><A NAME="item_%2DD"><STRONG>-D</STRONG></A></STRONG><BR>
- <DD>
- Debug options (concatenated or separate flags like <CODE>perl -D</CODE>).
- <P></P>
- <DT><STRONG><A NAME="item_%2DDo"><STRONG>-Do</STRONG></A></STRONG><BR>
- <DD>
- Prints each OP as it's processed.
- <P></P>
- <DT><STRONG><A NAME="item_%2DDb"><STRONG>-Db</STRONG></A></STRONG><BR>
- <DD>
- Print debugging information about bytecompiler progress.
- <P></P>
- <DT><STRONG><A NAME="item_%2DDa"><STRONG>-Da</STRONG></A></STRONG><BR>
- <DD>
- Tells the (bytecode) assembler to include source assembler lines
- in its output as bytecode comments.
- <P></P>
- <DT><STRONG><A NAME="item_%2DDC"><STRONG>-DC</STRONG></A></STRONG><BR>
- <DD>
- Prints each CV taken from the final symbol tree walk.
- <P></P>
- <DT><STRONG><A NAME="item_%2DS"><STRONG>-S</STRONG></A></STRONG><BR>
- <DD>
- Output (bytecode) assembler source rather than piping it
- through the assembler and outputting bytecode.
- <P></P>
- <DT><STRONG><A NAME="item_%2Dm"><STRONG>-m</STRONG></A></STRONG><BR>
- <DD>
- Compile as a module rather than a standalone program. Currently this
- just means that the bytecodes for initialising <CODE>main_start</CODE>,
- <CODE>main_root</CODE> and <CODE>curpad</CODE> are omitted.
- <P></P></DL>
- <P>
- <HR>
- <H1><A NAME="examples">EXAMPLES</A></H1>
- <PRE>
- perl -MO=Bytecode,-O6,-o,foo.plc foo.pl</PRE>
- <PRE>
- perl -MO=Bytecode,-S foo.pl > foo.S
- assemble foo.S > foo.plc</PRE>
- <P>Note that <CODE>assemble</CODE> lives in the <CODE>B</CODE> subdirectory of your perl
- library directory. The utility called perlcc may also be used to
- help make use of this compiler.</P>
- <PRE>
- perl -MO=Bytecode,-m,-oFoo.pmc Foo.pm</PRE>
- <P>
- <HR>
- <H1><A NAME="bugs">BUGS</A></H1>
- <P>Plenty. Current status: experimental.</P>
- <P>
- <HR>
- <H1><A NAME="author">AUTHOR</A></H1>
- <P>Malcolm Beattie, <CODE>mbeattie@sable.ox.ac.uk</CODE></P>
- <TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0 WIDTH=100%>
- <TR><TD CLASS=block VALIGN=MIDDLE WIDTH=100% BGCOLOR="#cccccc">
- <STRONG><P CLASS=block> B::Bytecode - Perl compiler's bytecode backend</P></STRONG>
- </TD></TR>
- </TABLE>
-
- </BODY>
-
- </HTML>
-