NAME ^

Parrot::OpTrans::CPrederef - C Predereferenced Transform

DESCRIPTION ^

Parrot::OpTrans::CPrederef inherits from Parrot::OpTrans::C to provide predereferenced register addressing run loop.

Instance Methods ^

core_type()

The core type is PARROT_PREDEREF_CORE.

prefix()

The prefix is 'Parrot_pred_'.

This is used in Parrot::Op's func_name().

defines()

Returns the C #define macros required by the ops.

suffix()

The suffix is '_prederef'.

opsarraytype()

The ops array type is void *.

gen_goto($where)

TODO - This is the same implementation as in Parrot::OpTrans. It should not be duplicated.

expr_pop()

Addresses on the stack are pointers into the bytecode array, and so must be converted to pointers into the prederef array.

expr_address($address)

Same logic as expr_pop().

expr_offset($offset)

goto_offset($offset)

goto_address($address)

CPrederef is funky in that expr OFFSET(n) uses a pointer to the original bytecode, but goto OFFSET(n) returns a pointer into the prederef array. (see expr_pop(), above, for a description of why this works.)

access_arg($type, $num, $op)

Returns the C code for the specified op argument type (see Parrot::OpTrans) and value. $op is an instance of Parrot::Op.

SEE ALSO ^

Parrot::OpTrans

Parrot::OpTrans::C

Parrot::OpTrans::CGP

Parrot::OpTrans::CGoto

Parrot::OpTrans::CSwitch

Parrot::OpTrans::Compiled


parrot