At 11:59 PM +0200 6/13/03, Leopold Toetsch wrote:
Dan Sugalski wrote:

At 11:33 AM +0200 6/13/03, Leopold Toetsch wrote:
register windows

I'd rather not have the window, but...

Saving and restoring all the registers is obviously a waste of time in many cases.


This sentence seems to contradict pdd03 - not that's a waste but ... When it comes to return values they clearly clobber these values that the caller is obligued to save.

The caller's not obliged to save anything really. In a caller-save system, the caller is responsible for saving those things that it cares about--it relieves the called sub of the responsibility to do so. If the caller doesn't have anything it wants to save, then it doesn't have to do so.


OTOH the callee has to preserve P0-P2, S0, I0.

Well... strictly speaking it doesn't, though it really needs to keep track of the return data in P1.


Other registers, mainly I1-I4 must be set on each sub return. The state of all other registers - at least according to calling conventions - has to be preserved.

I think I need to go back and rework the text of PDD03 then--I can tell it desperately needs an edit.


Not a big deal--the only reason it's not done is it has Jit repercussions and I wanted you and Daniel to have a chance to bring up problems with the scheme before I went and broke the JIT.

No JIT involved currently AFAIK.

Cool. I double-checked with Daniel on IRC and he's fine with it as well.


IMCC is a much bigger problem here.

I'm not sure it does, or at least that it should. (Though if people play interesting games with register set swapping it could, I suppose)


Back to register windows for a minute:
Do you already have data structures in mind for multi threading? The registers are for sure separated per thread. So the extra pointer for the register window or something similar would be needed anyway.

Well... I'm not thinking of windows per se, just shrinking the size of the frames on the stacks, so there's not a lot of wasted space. If most of the pushes will be half-sets it seems sensible to just shrink the frames so they hold half a set, and have the full frame saves just do to half-set pushes. Seems to work out OK.


I need to think a bit about the current ramifications of threads, since I wasn't planning on allowing multiple threads to share things like continuations, but given the code I think we can do that, and if we can it's pretty much open season on threads. (Though there's still the issue of buffer and pmc structs migrating across interpreters in ways that don't make things go bang)
--
Dan


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

Reply via email to