NAME ^

compilers/imcc/pcc.c

DESCRIPTION ^

Parrot calling convention implementation.

see: docs/pdds/pdd03_calling_conventions.pod

PCC Implementation by Leopold Toetsch

Functions ^

static Instruction *insINS(PARROT_INTERP, IMC_Unit *unit, NOTNULL(Instruction *ins), char *name, SymReg **regs, int n)

Utility instruction routine. Creates and inserts an instruction into the current block in one call.

SymReg *get_pasm_reg(PARROT_INTERP, const char *name)

get or create the SymReg

SymReg *get_const(PARROT_INTERP, const char *name, int type)

get or create a constant

static Instruction *pcc_get_args(PARROT_INTERP, IMC_Unit *unit, NOTNULL(Instruction *ins), char *op_name, int n, SymReg **args, int *arg_flags)

set arguments or return values get params or results used by expand_pcc_sub_call and expand_pcc_sub

static void unshift_self(NOTNULL(SymReg *sub), SymReg *obj)

prepend the object to args or self to params

void expand_pcc_sub(PARROT_INTERP, NOTNULL(NOTNULL(IMC_Unit *unit)), NOTNULL(NOTNULL(Instruction *ins)))

Expand a PCC (Parrot Calling Convention) subroutine by generating the appropriate prologue and epilogue for parameter passing/returning.

void expand_pcc_sub_ret(PARROT_INTERP, NOTNULL(IMC_Unit *unit), NOTNULL(Instruction *ins))

Expand a PCC sub return directive into its PASM instructions

static int pcc_reg_mov(PARROT_INTERP, unsigned char d, unsigned char s, NOTNULL(void *vinfo))

TODO: Not yet documented!!!

static Instruction *move_regs(PARROT_INTERP, IMC_Unit *unit, NOTNULL(Instruction *ins), int n, SymReg **dest, SymReg **src)

TODO: Not yet documented!!!

static int recursive_tail_call(PARROT_INTERP, NOTNULL(NOTNULL(IMC_Unit *unit)), NOTNULL(NOTNULL(Instruction *ins)), NOTNULL(SymReg *sub))

convert a recursive tailcall into a loop

static void insert_tail_call(PARROT_INTERP, NOTNULL(IMC_Unit *unit), NOTNULL(NOTNULL(Instruction *ins)), NOTNULL(SymReg *sub), NULLOK(SymReg *meth))

TODO: Not yet documented!!!

void expand_pcc_sub_call(PARROT_INTERP, NOTNULL(IMC_Unit *unit), NOTNULL(Instruction *ins))

Expand a PCC subroutine call (IMC) into its PASM instructions This is the nuts and bolts of pdd03 routine call style


parrot