| parrotcode: Parrot Interpreter | |
| Contents | C |

src/interpreter.c - Parrot Interpreter

The interpreter API handles running the operations.
The predereferenced code chunk is pre-initialized with the opcode function pointers,
addresses,
or opnumbers of the prederef__ opcode.
This opcode then calls the do_prederef() function,
which then fills in the real function,
address or op number.
Because the prederef__ opcode returns the same pc_prederef it was passed,
the runops loop will re-execute the same location,
which will then have the pointer to the real prederef opfunc and prederef args.
Pointer arithmetic is used to determine the index into the bytecode corresponding to the currect opcode. The bytecode and prederef arrays have the same number of elements because there is a one-to-one mapping.

prederef_argsdo_prederef() to deal with any arguments.pc_prederef is the current opcode.do_prederefpc_prederef is the current opcode,
and type is the run core type.turn_ev_checkevent_checker opcode,
or restores original ops in all branch locations of the opcode stream.on is true,
this is being called from the event handler thread.get_op_lib_initop_lib init function.core_op indicates whether the opcode represents a core Parrot operation.which is the run core type.core_op will be 0 and lib will be a ParrotLibrary PMC.load_prederefinterp->op_lib = prederefed oplib.init_predereffunc_table,
file prederef.code.stop_prederefexec_init_prederefinterp->op_lib = prederefed oplibop_lib has a copy in the interpreter structure - but get the op_code lookup function from standard core prederef has no op_info_tableinit_jitprepare_for_runrunops_jitrunops_execrunops_cgpgoto,
predereferenced core.runops_switchswitch core.runops_intInterp_flags.
When a restart opcode is encountered,
a different core may be selected and evaluation of opcode continues.Parrot_setup_event_func_ptrsfunc_table containing pointers (or addresses) of the check_event__ opcode.
dynop_registerdynop_register_xxop_lib with other cores.notify_func_tabledisable_event_checkingenable_event_checkingenable_event_checking() is called async by the event handler thread.
All action done from here has to be async safe.
include/parrot/interpreter.h, src/inter_cb.c, src/inter_create.c, src/inter_misc.c, src/inter_run.c.
|
|
|