NAME ^

src/inter_run.c - Parrot Interpreter - Run Ops and Methods

DESCRIPTION ^

Various functions that call the run loop.

Functions ^

void runops

Run parrot ops. Set exception handler and/or resume after exception.

Parrot_Context *Parrot_runops_fromc

Runs the Parrot ops, called from C code. The function arguments are already setup according to Parrot calling conventions, the sub argument is an invocable Sub PMC.

static Parrot_Context *runops_args

Calls the PMC subroutine sub with optional name meth. If PMC object obj is provided, the call is treated as a method call on that object. The function has a function signature sig and a variadic argument list ap.

Signatures are similar to NCI:

    v ... void return
    I ... INTVAL (not Interpreter)
    N ... NUMVAL
    S ... STRING*
    P ... PMC*
TODO: Update this list of possible signature elements.

void *Parrot_run_meth_fromc

Run a method sub from C. The function arguments are already setup according to Parrot calling conventions, the sub argument is an invocable Sub PMC.

If a PMC return value is registered it is returned.

PMC *Parrot_runops_fromc_args

Run parrot ops, called from C code, function arguments are passed as va_args according to the signature. The sub argument is an invocable Sub PMC.

void *Parrot_runops_fromc_args_event

Run code from within event handlers. This variant deals with some reentrency issues. It also should do sanity checks, if e.g. the handler subroutine didn't return properly.

INTVAL Parrot_runops_fromc_args_reti

Called from C code, runs a Parrot subroutine sub. The subroutine has function signature sig and a C variadic argument list. Returns an INTVAL.

FLOATVAL Parrot_runops_fromc_args_retf

Called from C code, runs a Parrot subroutine sub. The subroutine has function signature sig and a C variadic argument list. Returns a FLOATVAL.

void *Parrot_run_meth_fromc_args

Called from C code, runs a Parrot subroutine sub as a method on object obj. The subroutine has function signature sig and a C variadic argument list.

INTVAL Parrot_run_meth_fromc_args_reti

Called from C code, runs a Parrot subroutine sub as a method on object obj. The subroutine has function signature sig and a C variadic argument list. Returns an INTVAL.

FLOATVAL Parrot_run_meth_fromc_args_retf

Called from C code, runs a Parrot subroutine sub as a method on object obj. The subroutine has function signature sig and a C variadic argument list args. Returns a FLOATVAL.

void *Parrot_runops_fromc_arglist

Called from C code, runs a Parrot subroutine sub. The subroutine has function signature sig and a C va_list argument list args.

INTVAL Parrot_runops_fromc_arglist_reti

Called from C code, runs a Parrot subroutine sub. The subroutine has function signature sig and a C va_list argument list args. Returns an INTVAL.

FLOATVAL Parrot_runops_fromc_arglist_retf

Called from C code, runs a Parrot subroutine sub. The subroutine has function signature sig and a C va_list argument list args. Returns an FLOATVAL.

void *Parrot_run_meth_fromc_arglist

Calls the subroutine sub as a method on object obj. The method to be called is named meth, has the function signature sig and arguments args. args is a C variadic argument list created with va_start.

INTVAL Parrot_run_meth_fromc_arglist_reti

Calls the subroutine sub as a method on object obj. The method to be called is named meth, has the function signature sig and arguments args. args is a C variadic argument list created with va_start. Returns an INTVAL.

FLOATVAL Parrot_run_meth_fromc_arglist_retf

Calls the subroutine sub as a method on object obj. The method to be called is named meth, has the function signature sig and arguments args. args is a C variadic argument list created with va_start. Returns a FLOATVAL.

Helper Functions ^

void new_runloop_jump_point

Create a new runloop jump point, either by allocating it or by getting one from the free list.

void free_runloop_jump_point

Place runloop jump point back on the free list.

void destroy_runloop_jump_points

Destroys (and frees the memory of) the runloop jump point list and the associated free list for the specified interpreter.

void really_destroy_runloop_jump_points

Takes a pointer to a runloop jump point (which had better be the last one in the list). Walks back through the list, freeing the memory of each one, until it encounters NULL. Used by destroy_runloop_jump_points.

SEE ALSO ^

include/parrot/interpreter.h, src/interpreter.c.


parrot