> >     - None of the JIT ports implement it.  This will save work.
>
> As long as my JITed jumptables are fast.

If you like coding assembly :-)

>
> >     - It is in general impossible for an optimizer to determine
> >       where the branch targets are if you allow registers as
> >       branch targets.  Even when it's possible, it's too hard.

If you want to do the optimizations before start running the bytecode it's
impossible to determine the branch targets, and if you want to optimize
at runtime in the case where the branch target changes a lot you may end
up spending more time optimizing than the win that you got on the
optimized code.


 >
> This reminds me of when this is necessary. How will we be calling
> methods? We'll be looking up some kind of code address by index or
> name and putting it into a register. (jump_i sounds plausible for
> this.)
>
> The optimizer argument only matters when register addresses are
> actually used. If you're right and nobody ever uses it, then the
> optimizer doesn't care. When it is used, it's just as hard for the
> optimizer to deal with
>
>       unless P0, $REG_BRANCH_1
>       ...
>   $REG_BRANCH_1:
>       jump I0
>
> as it would be to deal with 'unless P0, I0', no?

Sure. (May be a little bit more difficult).

Daniel Grunblatt


Reply via email to