JSPL::SM::Opcode - Class that encapsulates SpiderMonkey's jsopcodes.
use JSPL::SM::Opcode qw(:opcodes @Opcodes);
my $oppush = $Opcodes[JSOP_PUSH];
print $oppush->name; # 'push'
Provides access to SM's jsopcodes. Useful if you ever need to work with SpiderMonkey bytecode. See jsopcode.tbl is SM sources for details.
This array hold the jsopcodes defined in SM. Every value is an JSPL::SM::Opcode object. You can use the JSOP_* constants for indexing @Opcodes.
Returns the id of the jsopcode. For example "JSOP_PUSH"
Returns the number of the jsopcode, that is its index in @Opcodes.
Returns the name of the jsopcode. For example "push".
Returns the length of the jsopcode in bytes including any immediate operands, or -1 for jsopcodes with variable len.
Returns the number of stack elements consumed by the jsopcode, -1 if variadic.
Returns the number of stack elements produced by the jsopcode.
Returns the operator precedence, zero if not an operator.
Returns the encoding format of the jsopcode.
To install JSPL, copy and paste the appropriate command in to your terminal.
perl -MCPAN -e shell
For more information on module installation, please visit the detailed CPAN module installation guide.