NAME ^

src/packout.c - Functions for writing out packfiles

DESCRIPTION ^

Functions ^

opcode_t PackFile_pack_size(Interp*, struct PackFile *self)

Description.

void PackFile_pack(Interp*, struct PackFile *self, opcode_t *cursor)

Pack the PackFile into a contiguous region of memory.

Note that the memory block had better have at least the amount of memory indicated by PackFile_pack_size().

This means that you MUST call PackFile_pack_size() before PackFile_pack()

Other pack routines are in src/packfile.c.

size_t PackFile_ConstTable_pack_size(struct PackFile_Segment *seg)

Determine the size of the buffer needed in order to pack the PackFile constant table into a contiguous region of memory.

opcode_t *PackFile_ConstTable_pack(Interp *, struct PackFile_Segment *seg, opcode_t *cursor)

Pack the PackFile ConstTable into a contiguous region of memory.

Note that the memory block had better have at least the amount of memory indicated by PackFile_pack_size().

This means that you MUST call PackFile_pack_size() before PackFile_ConstTable_pack()

static int find_in_const(PMC *key, int type)

This is really ugly, we don't know where our PARROT_ARG_SC key constant is in constant table, so we have to search for it.

opcode_t *PackFile_Constant_pack(Interp*, struct PackFile_Constant *self, opcode_t *cursor)

Pack a PackFile Constant into a contiguous region of memory.

Note that the memory block had better have at least the amount of memory indicated by PackFile_pack_size().

This means that you MUST call PackFile_pack_size() before PackFile_Constant_pack()

The data is zero-padded to an opcode_t-boundary, so pad bytes may be added. (Note this padding is not yet implemented for FLOATVALs.)

HISTORY ^

Rework by Melvin; new bytecode format, make bytecode portable. (Do endian conversion and wordsize transforms on the fly.)

leo: rewrite to use new directory-based format.


parrot