Content deleted Content added
m Disambiguating links to Hello World (disambiguation) (link changed to "Hello, World!" program) using DisamAssist. |
m Bot: http → https |
||
Line 4:
===Opcodes===
The Perl compiler outputs a compiled program into memory as an internal structure which can be represented as a tree graph in which each node represents an opcode. Opcodes are represented internally by [[typedef]]s. Each opcode has ''next'' / ''other'' and ''first'' / ''sibling'' pointers, so the opcode tree can be drawn as a basic OP tree starting from root node or as flat OP list in the order they would normally execute from start node. Opcodes tree can be mapped to the source code, so it is possible to [[Decompiler|decompile]] to high-level source code.<ref>{{cite web | url=
Perl's opcodes interpreter is implemented as a tree walker which travels the opcode tree in execution order from the start node, following the ''next'' or ''other'' pointers. Each opcode has a function pointer to a pp_''opname'' function, i.e. the ''say'' opcode calls the ''pp_say'' function of internal Perl API.
The phase of compiling a Perl program is hidden from the end user, but it can be exposed with the B Perl module<ref name="B">{{cite web | url=https://metacpan.org/module/B | title=B - The Perl Compiler Backend}}</ref> or other specialized modules, as the B::Concise Perl module.<ref>{{cite web | url=
An example of a simple compiled [["Hello, World!" program|Hello world]] program dumped in execute order (with the B::Concise Perl module):
Line 80:
==External links==
*[
*[
*[https://metacpan.org/module/RURBAN/B-C-1.42/perloptree.pod The "B" op tree.]
|