Matt S Trout > Rakudo-Star-2012.08_001 > src/pmc/opcode.pmc

Download:
Rakudo-Star-2012.08_001.tar.gz

Annotate this POD

Source  

NAME ^

src/pmc/opcode.pmc - Opcode information

DESCRIPTION ^

Contains information on an opcode. Returned by various functions in the OpLib PMC.

Vtable functions

void init()

Throws an exception. Opcode PMCs are not to be created directly.

void set_pointer(void *i)

Sets the op_info_t this PMC gets information from. Throws an exception if the pointer has already been set. See also set_integer_native(), below.

INTVAL get_integer()
FLOATVAL get_number()

Returns the opcode number.

void set_integer_native(INTVAL value)

Sets the number for this opcode. See also set_pointer, above.

Throws an exception if set_pointer has already been called.

STRING* get_string()

Returns the full name of the opcode.

INTVAL elements()

Returns the number of arguments for the opcode.

INTVAL get_integer_keyed_int(INTVAL i)

Returns the type information for the ith argument. Returns -1 if the i is out of range.

The type is returned as an integer. The value is determined by bitwise oring together the basic type and a number of flags:

Basic Types:

  • 0 = Integer
  • 1 = String
  • 2 = PMC
  • 3 = Float

Flags:

  • 0x10 = Constant
  • 0x20 = Keyed

Methods

STRING *family_name()

Returns the family, or short, name of the opcode.

INTVAL jump()

Returns the jump value for the opcode.

PMC *dirs()

Returns an array of direction information for the arguments.

  • 0 = ignored
  • 1 = in (read-only)
  • 2 = out (write-only)
  • 3 = inout (read-write)
labels()

Returns an array describing if each argument is a label. (0 or 1)

SEE ALSO ^

src/pmc/oplib.pmc

syntax highlighting: