classes/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 ^

static void clone_regs_interp(Parrot_Interp d, Parrot_Interp s, PMC *dest)

Copy/clone all interpreter registers. All resources are created in the destination interpreter.

static int need_reg(Parrot_Interp s, int i, int i3)

Called from clone_regs_thread(). Currently commented out.

static void clone_regs_thread(Parrot_Interp d, Parrot_Interp s, PMC *dest)

Copy/clone thread start paramaters. All resources are created in the destination interpreter.

static void clone_regs(Parrot_Interp d, Parrot_Interp s, PMC *dest)

Clones the registers.

void clone_interpreter(PMC *dest, PMC *self)

Clones the interpreter.

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.

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.

void *invoke(void *next)

Runs the interpreter's byte code.

PMC *get_pmc_keyed_int(INTVAL key)

Returns the PMC global value for key.

PMC *get_pmc_keyed_str(STRING *key)

Introspection interface. key can be:

  "sub"            ... return Sub object of this subroutine
  "continuation"   ... return Continuation PMC
  "pad"            ... return scratchpad PMC for this sub
  ["<item>"; level ] ... same for caller <level>

  "globals"        ... return global stash
INTVAL get_integer_keyed_int(INTVAL key)

Returns the interpreter info for key.

void set_integer_keyed_int(INTVAL key, INTVAL val)

Sets the interpreter info for key to val.

PMC *clone()

First attempt to make things running, and to see, where problems may arise. Only minimal items are done yet.

XXX this should of course call Parrot_clone() and use freeze/thaw.

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.