Simon Glover <[EMAIL PROTECTED]> wrote:
>   Try and explain what invoke is supposed to do. NB this still needs work

[ snip ]

>   +=item void* invoke(INTERP, PMC* self, void* next)

[ snap ]

>   +It should set up the environment for the sub, and should return the
>   +location at which operation flow should continue after the subroutine
>   +returns.

The C<invoke> vtable method gets a bytecode address, that is the
NEXT() in the opcode stream. But it returns the address, where it wants
to jump to. Returning to the passed address is not up to the called
subroutine object, setting up specific environment depends on the
called subroutine object. A look at docs/pmc/subs.pod might provide some
hints.

So the invoke opcode branches to the address it got from the invoke
vtable, normally: eval.pmc is slightly different or it takes just longer
to branch really there ;-)

Sorry if that was missleading in my first answer regarding that topic.

Anyway, there are no really general rules what the vtables do. They are
some kind of overloading (e.g. get_integer()):

   set I0, P0   # get an integer from a scalar
   set I1, P1   # get size of aggregate P1

leo

Reply via email to