NAME

src/pmc/parrotinterpreter.pmc - ParrotInterpreter PMC

DESCRIPTION

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

PMC * clone_interpreter(Parrot_Interp s, INTVAL flags)
Clones the interpreter as specified by the flags.TODO: Move this logic into src/interp/api.c or src/threads.c, as appropriate
static void create_interp(PMC *self, Parrot_Interp parent)
Creates a new child interpreter of parent.

Methods

yield
Yield the current thread
recursion_limit(INTVAL l :optional, INTVAL has_l :opt_flag )
Gets the recursion limit of the interpreter, optionally setting it to something new.
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 destroy()
Destroys the PMC.
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.
opcode_t *invoke(void *next)
Runs the interpreter's byte code.
PMC *get_pmc()
Return this Thread's args.
void set_pmc(PMC *args)
Set this Thread's args.
PMC *get_pmc_keyed_int(INTVAL key)
Returns the PMC global value for key.
PMC *get_pmc_keyed(PMC *key)
Introspection interface. key can be:
  "context"                 ... return Context PMC
  "sub"                     ... return Sub object of this subroutine
  "continuation"            ... return Continuation PMC
  "lexpad"                  ... return lexpad PMC for this sub
  "namespace"               ... return namespace PMC for this sub
  "outer"                   ... return outer sub of this closure
  "<item>"; level           ... same for caller <level>
  "annotations"; level > 0  ... annotations at point of call <level>s down
  "outer"; "<item>"         ... same for outer level 1
  "outer"; "<item>"; level  ... same for outer <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.
void visit(PMC *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(PMC *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(PMC *info)
Used to unarchive the interpreter. This merges the changes into this interpreter instance.
void thawfinish(PMC *info)
Finish thawing.
METHOD hll_map(PMC core_type,PMC hll_type)
Map core_type to hll_type.
METHOD stdin_handle(PMC *newhandle :optional)
If a PMC object is provided, the standard input handle for this interpreter is set to that PMC, and the new PMC handle is returned.If no PMC object is provided, the current standard input handle is returned.
METHOD stdout_handle(PMC *newhandle :optional)
If a PMC object is provided, the standard output handle for this interpreter is set to that PMC, and the new PMC handle is returned.If no PMC object is provided, the current standard output handle is returned.
METHOD stderr_handle(PMC *newhandle :optional)
If a PMC object is provided, the standard error handle for this interpreter is set to that PMC, and the new PMC handle is returned.If no PMC object is provided, the current standard error handle is returned.
METHOD getpid()
Returns the pid of the current process, 0 in platforms that doesn't support it.
METHOD current_task()
Returns the task currently executed by this interpreter.
METHOD schedule(PMC *task)
Schedules the given task on this interpreter.
METHOD schedule_proxied(PMC *task, PMC *proxy)
Schedules the given task on the proxy's interpreter.