Dan Sugalski wrote:
At 6:40 PM +0200 9/8/04, Leopold Toetsch wrote:

[ register backing stacks ]

> The register spilling code could easily use them

See 1) below

That makes the interpreter unbearable slow and non-competitive. That's the reason for my alternate calling scheme proposal.

Then we put it in and deal with it. It must be in to express the semantics properly. After its in we can see what we have to do to make it fast.

I see two possible ways to go:

1) Indirection of register pointer(s)
* needs copying of context
* no copying of registers, just advance/restore a base-pointer
? could allow interpreter->bp->xxx_reg[-n] to access function args
- else copying of function args/return values needed
+ register range could be adjusted to needed amount
- overhead of call/return increases with context size
- coroutines need separate register stack
- indrection in register access
+ prederef can get rid of indirection, but needs to be
  redone, if function is called at different stack depth
? 1 one 4 base pointers - using only one would simplify JIT

2) Swapping in and out whole interpreter structures
* needs copying of function arguments and return values
* the interpreter is the context
+ no copying of context for function returns
+ no indirection for register access
+ coroutines are simple
- recursion needs a new interpreter structure per nesting
- overhead of call/return increases with argument count
- register spilling not addressed

leo



Reply via email to