src/pmc/parrotinterpreter.pmc - Parrot Interpreter


These are the vtable functions for the ParrotInterpreter base class

   getinterp P0
   set P1, P0[.IGLOBALS_*]  # access interpreter globals
   set I0, P0[x]            # interpinfo I0, x
   set I0, P0[-1]           # get interpreter flags
   set P0[-1], x            # set flags on interpreter
                            # NOTE: this doesn't restart

Functions ^

void clone_interpreter(Parrot_Interp dest, const Parrot_Interp source, INTVAL flags)

Clones the interpreter as specified by the flags.

static void create_interp(PMC *self, Parrot_Interp parent)

Creates a new child interpreter of parent.

Methods ^

void class_init()

Class initialization.

void init()

Initializes the interpreter.

void init_pmc(PMC *parent)

Initializes a child interpreter with *parent if parent is a ParrotInterpreter instance. Otherwise takes the thread ID from parent and uses that thread.

void set_pointer(void *value)

Sets struct_val to *value.

void *get_pointer()

Returns struct_val.

INTVAL get_integer()

Returns the thread id of the interpreter.

INTVAL is_equal(PMC *val)

Returns whether the interpreter is equal to *val.

Two interpreters (threads) are equal if both are non-threaded or they have the same thread id.

void visit(visit_info *info)

This is used by freeze/thaw to visit the contents of the interpreter.

*info is the visit info, (see include/parrot/pmc_freeze.h).

void freeze(visit_info *info)

Used to archive the interpreter. Actually not the whole interpreter is frozen but the state of the interpreter, which includes everything that has changes since creating an empty interpreter.

void thaw(visit_info *info)

Used to unarchive the interpreter. This merges the changes into this interpreter instance.

void thawfinish(visit_info *info)

Finish thawing.