Dan Sugalski <[EMAIL PROTECTED]> wrote:
> Okay, as I see it there are two big things that we can do to speed
> objects up. (Well, besides speeding up the creation of continuation
> PMCs, which I am, at the moment, sorely tempted to put in a special
> pool for fast allocation)

I though about that already. Returncontinuations created via the *cc
opcode variants are created in the opcode and used exactly once just for
returning from the sub.  So I'd do for these a per-interpreter
freelist, where they get put back after invokeing the return
contination.

> 1) A method cache. Which we need anyway, so this isn't any surprise

> 2) Pre-figuring the delegated vtable functions.

> At the moment I'm considering two storage schemes for the PMC
> pointers (one hanging off the vtable itself, another in the class
> attributes) but I'm open to suggestions here.

Or: after the 1st delegate lookup create a JITed stub that is in
pseudo-code:

  enter
  call saveregs
  S0 = "meth"
  P2 = obj
  P5 = value  # arguments
  call runops
  call restoreregs
  # handle return val
  leave
  ret

This function's address replaces the vtable slot of the old one and is
now called directly as the delegate. When the register assignments are
done interpreter-relative, this stub should be reusable by different
threads too.

> --
>                                          Dan

> --------------------------------------"it's like this"-------------------
> Dan Sugalski                          even samurai
> [EMAIL PROTECTED]                         have teddy bears and even
>                                        teddy bears get drunk

leo

Reply via email to