Dan Sugalski <[EMAIL PROTECTED]> wrote:
> At 1:11 PM +0100 11/6/04, Leopold Toetsch wrote:

> [calling convention change snippage]

> I've already said no changes to the calling conventions, quite a
> while ago.

This doesn't really change calling convention, it changes call opcodes.
It makes register usage explicit.

> ... I don't see inconvenience in the register allocation code
> as a reason to change it. Got a better reason?

1) please grep -w invoke in imcc. There is quite an amount of code that
tracks register usage of this opcode.

2) I've outlined that the usage of especially P0 - P2 blocks registers
because we've to allocate them as non-volatiles too. This reduces
the usable register count by 3 for methods.

Current produced code looks like this:

   set P16, P1  # preserve our return continuation
   set P17, P2  # preserve self
   set S0, "meth"   # this method unavailable
   set P2, obj
   callmethodcc  # call the meth  P0 gets overwritten
   set P1, P16   # restore P1
   set P2, P17   # restore self

3) We have these variables in the context. Having them in registers too
just duplicates argument copying. It's not needed.

The return continuation works similar to the link register on PPC. There
are 2 opcodes to access this register. You can use it for branches...
Why should we have it additionally in P1, where it clutters the caller's
usage of P1 to be able to return?

leo

Reply via email to