Dan Sugalski <[EMAIL PROTECTED]> wrote:
> At 12:00 PM 6/13/2001 +0100, Dave Mitchell wrote:
> >should we abandon vtables (ie arrays of fn pointers indexed by op),
> >and just have a single hander function per type which has the op as an arg?
> 
> Are you talking vtables (which we're using for functions attached to data) 
> or the indirect opcode function table? If the former, we don't want to 
> abandon the idea for anything other than a crippling speed hit, since it 
> gives us a lot of flexibility cheaply. Abandoning a function table for the 
> ops for a switch means that extension opcodes are going to be slower than 
> normal ones--we'll essentially have to maintain both the switch and the 
> dispatch table.

I'm talking about the former, ie calling a function in a vtable.
The problem with vtables is that we get an explosion of micro functions,
all containing similar chunks of code. If instead of providing a vtable,
a PMC type just provides a since generic handler function, then each
individual type gets to choose how to best dispatch its own functions.

I guess it depends to what extent we expect Perl to mess with vtables:
if a particular PMC type gets to statically(ish) define its own vtable,
a single handler *may* may make sense. If Perl is going to go around 
gratuitously altering vtable contents on the fly without the cooperation of
that PMC type, then it's not a goer.


Reply via email to