Hi,

Computed goto is a feature supported by GCC (not sure which others) that 
allows using dynamic
addresses as jump targets from C. This allows the opcode tables to be 
loaded and jumps to
the op can be much faster than a subroutine call. On the other hand, good 
compilers can sometimes
optimize their switch statements to be comparable. Either case is much 
faster than having every op
as a stub routine and a function call overhead per op.

Predereferencing is Parrot's term for converting opcode offsets to their 
actual addresses so a jump
can use the actual address stored in the bytecode op and not have to add 
it to an offset. Prederef
is done at loadtime of the bytecode segment. I think Gregory Purdy is the 
source of Parrot's form of this
optimization.

Computed-goto is mutually exclusive to the plain C switch core, but can be 
combined with the
prederef code, although I'm rusty and don't remember if the cores have 
been combined. At one
time their were several seperate cores, CG, switch and prederef.

Hope that helps,

-Melvin





Nathanael Kuipers <[EMAIL PROTECTED]>
08/21/2003 05:00 PM

 
        To:     [EMAIL PROTECTED]
        cc: 
        Subject:        RE: Should I target Parrot?



Nicholas Clarke wrote:

>the computed-goto-predereference core

Zarniwoop!  Can you explain what this means?

Thanks,

Nathanael Kuipers 



Reply via email to