Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

coroutines end and DFG

11 views
Skip to first unread message

Leopold Toetsch

unread,
Mar 4, 2003, 3:42:53 PM3/4/03
to P6I
Does a couroutine end? And how?
The current implementation jumps forth and back by the B<invoke> opcode,
one is a "call coroutine" the other is a "yield". There seems to be no
possibility, that the coroutine states, "I'm finished now" - with
possibly meaning "don't call me again".

And from imcc's register allocations POV the whole coroutine stuff is a
PITA, no registers are preserved, AFAIK, so a coroutines and the caller
+ all edges out from both do share the same registers, don't they?

leo

Jonathan Sillito

unread,
Mar 4, 2003, 4:23:47 PM3/4/03
to Perl6-Internals, Leopold Toetsch
> -----Original Message-----
> From: Leopold Toetsch [mailto:l...@toetsch.at]
>
> Does a couroutine end? And how?
> The current implementation jumps forth and back by the B<invoke> opcode,
> one is a "call coroutine" the other is a "yield". There seems to be no
> possibility, that the coroutine states, "I'm finished now" - with
> possibly meaning "don't call me again".

That's correct.

> And from imcc's register allocations POV the whole coroutine stuff is a
> PITA, no registers are preserved, AFAIK, so a coroutines and the caller
> + all edges out from both do share the same registers, don't they?

They do, except that each coroutine has its own user stack so saveall and
restoreall can work properly.

-- jonathan sillito

Leopold Toetsch

unread,
Mar 5, 2003, 2:27:27 AM3/5/03
to Jonathan Sillito, Perl6-Internals
Jonathan Sillito wrote:

>>-----Original Message-----
>>From: Leopold Toetsch [mailto:l...@toetsch.at]
>

>>And from imcc's register allocations POV the whole coroutine stuff is a
>>PITA, no registers are preserved, AFAIK, so a coroutines and the caller
>>+ all edges out from both do share the same registers, don't they?
>>
>
> They do, except that each coroutine has its own user stack so saveall and
> restoreall can work properly.


Yep. But due to that fact, passing arguments via stack is not possible.
So a HL can only communicate with a coroutine through lexcicals or
globals. And imcc will need another set of hints to figure out what's
going on.


> -- jonathan sillito

leo

0 new messages