NAME ^

src/embed.c - The Parrot embedding interface

DESCRIPTION ^

This file implements the Parrot embedding interface.

Functions ^

Parrot_new

Returns a new Parrot interpreter.

The first created interpreter (parent is NULL) is the last one to get destroyed.

Parrot_init

Parrot_init_stacktop

Initializes the new interpreter when it hasn't been initialized before.

Additionally sets the stack top, so that Parrot objects created in inner stack frames will be visible during DODs stack walking code. stack_top should be the address of an automatic variable in the caller's stack frame. All unanchored Parrot objects (PMCs) must live in inner stack frames so that they are not destroyed during DOD runs.

Use this function when you call into Parrot before entering a run loop.

Parrot_set_flag

Sets a flag in the interpreter specified by flag, any of PARROT_BOUNDS_FLAG, or PARROT_PROFILE_FLAG to enable profiling, and bounds checking respectively or PARROT_THR_TYPE_1, PARROT_THR_TYPE_2, or PARROT_THR_TYPE_3 to disable thread communication and variable sharing, disable variable sharing but enable thread communication, or to enable variable sharing.

Parrot_set_debug

Set a debug flag: PARROT_DEBUG_FLAG.

Parrot_set_trace

Set a trace flag: PARROT_TRACE_FLAG

Parrot_clear_flag

Clears a flag in the interpreter.

Parrot_clear_debug

Clears a flag in the interpreter.

Parrot_clear_trace

Clears a flag in the interpreter.

Parrot_test_flag

Test the interpreter flags specified in flag.

Parrot_test_debug

Test the interpreter flags specified in flag.

Parrot_test_trace

Test the interpreter flags specified in flag.

Parrot_set_run_core

Sets the specified run core.

Parrot_setwarnings

Activates the given warnings.

Parrot_readbc

Read in a bytecode, unpack it into a PackFile structure, and do fixups.

Parrot_loadbc

Loads the PackFile returned by Parrot_readbc().

setup_argv

Creates and returns ARGS array PMC.

prof_sort_f

Sort function for profile data. Sorts by time.

op_name

Returns the name of the opcode.

calibrate

With this calibration, reported times of parrot -p almost match those measured with time parrot -b.

print_profile

Prints out a profile listing.

print_debug

Prints GC info.

Parrot_runcode

Sets up ARGV and runs the ops.

Parrot_debug

Runs the interpreter's bytecode in debugging mode.

Parrot_disassemble

Disassembles and prints out the interpreter's bytecode.

This is used by the Parrot disassembler.

Parrot_run_native

Run the C function func through the program [enternative, end]. This ensures that the function is run with the same setup as in other run loops.

This function is used in some of the source tests in t/src which use the interpreter outside a runloop.

SEE ALSO ^

include/parrot/embed.h and docs/embed.pod.

HISTORY ^

Initial version by Brent Dax on 2002.1.28.


parrot