NAME
src/pmc/eval.pmc - Dynamic code evaluation
DESCRIPTION
Eval
extends Sub
to provide eval
-like dynamic code evaluation and execution.
Vtable functions
void init()
Initializes a new empty Eval.
void destroy()
Destroy the Eval and its associated bytecode.
void mark()
Mark this Eval.
void *get_pointer()
Returns the address of the associated packfile.
opcode_t *invoke(void *next)
Invokes the first subroutine in the eval code.
STRING *get_string
Get a STRING representing the bytecode for this code segment,
suitable for writing to disc and later loading via PMC *get_pmc_keyed_int(INTVAL key)
Returns the Sub PMC of the element at index void freeze(PMC *info)
Archives the evaled code
void thaw(PMC *info)
Unarchives the code.
load_bytecode
.
key
or PMCNULL.
Methods
get_main()
Return the main sub,
if any,
null PMC otherwise.
all_subs()
Return an object providing indexed access to all subs in the compilation unit (i.e.,
self).
Provides compability with new packfile_pmc API.
is_initialized(STRING* tag)
Dummy method to emulate
is_initialized
method of the PackFileView PMC.
Returns true if tag
is equal to "init"
,
since :init
subs are automatically invoked when an EvalPMC is loaded,
and false for all other tags.Auxiliar functions
static PMC* get_sub(PARROT_INTERP, PMC *self, int idx)
Get the static void mark_ct(PARROT_INTERP, PMC *self)
Mark the bytecode segment pointed to by this Eval for GC.
idx
th Sub PMC from the constants table.