|parrotcode: Delegate PMC|
|Contents | PMCs|
classes/delegate.pmc - Delegate PMC
Delegate each and every function to parrot bytecode.
Almost all methods are auto-generated in lib/Parrot/Pmc2c.pm
The following bit is a fast register save/restore pair.
They currently count on the registers in the interpreter structure being in the same order as in the
and that the registers are at the beginning of the interpreter structure.
Yes, it's damned evil, but it's what we need, since we have to preserve the registers -- vtable methods can't change them.
Also note that if the vtable method clobbers a register that contains a string or PMC not otherwise rooted it could be collected too early.
static PMC *find_meth(Interp *interpreter, PMC *pmc, STRING *name)
static PMC *find_or_die(Interp *interpreter, PMC *pmc, STRING *name)
find_meth()with the arguments, raising an exception if no method is found.
All these functions to run code can leak a full parrot register file, as well as potentially permanently unroot some PMCs or strings, if the vtable method throws an exception. It really ought be caught rather than let flow through.
PARROT_INLINE static void noarg_noreturn(Interp *interpreter, PMC *obj, const char *meth, int die)
dieis true then an exception will be raised if the method is not found.
__init()method if it exists.
__instantiatemethod if it exists.