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

[perl #16087] [PATCH] Scratchpad pmc

5 views
Skip to first unread message

Sean O'Rourke

unread,
Aug 12, 2002, 11:14:49 PM8/12/02
to Melvin Smith, Jonathan Sillito, Dan Sugalski, Perl internals mailing list
On Mon, 12 Aug 2002, Melvin Smith wrote:
> >4) Parrot_Coroutine's 'init' is not longer used and can go away, I guess
> >I could remove it in a future patch ... ok so that's not a question
>
> I wish this wouldn't go away. I think passing the constructor argument
> for any PMC is a good optimization. How to do it flexibly is another thing.

It's not the constructor argument, I think. Coroutines used to have two
different code pointers, one for the first call, and one for their yield
point. When I removed those ops awhile back, I also simplified coroutines
to only use one code pointer. The first time a coroutine's called, it
points to wherever that coro starts. Afterwards, it points to the last
yield point. This seems to give us the old semantics without the extra
pointer (not a big deal).

/s

Melvin Smith

unread,
Aug 12, 2002, 11:02:37 PM8/12/02
to Jonathan Sillito, Dan Sugalski, Perl internals mailing list
At 01:10 PM 8/12/2002 -0600, Jonathan Sillito wrote:
>1) The Parrot_Sub struct in sub.h has its own user_stack and
>control_stack. Why is this necessary?

Probably an artifact of my failed experiments. :)
Originally Dan said subs would need their own stacks. Either way,
they should be part of Parrot_Context now anyway.

>4) Parrot_Coroutine's 'init' is not longer used and can go away, I guess
>I could remove it in a future patch ... ok so that's not a question

I wish this wouldn't go away. I think passing the constructor argument
for any PMC is a good optimization. How to do it flexibly is another thing.

-Melvin


Melvin Smith

unread,
Aug 12, 2002, 11:18:28 PM8/12/02
to Sean O'Rourke, Jonathan Sillito, Dan Sugalski, Perl internals mailing list
At 08:14 PM 8/12/2002 -0700, Sean O'Rourke wrote:
>On Mon, 12 Aug 2002, Melvin Smith wrote:
> > >4) Parrot_Coroutine's 'init' is not longer used and can go away, I guess
> > >I could remove it in a future patch ... ok so that's not a question
> >
> > I wish this wouldn't go away. I think passing the constructor argument
> > for any PMC is a good optimization. How to do it flexibly is another thing.
>
>It's not the constructor argument, I think. Coroutines used to have two
>different code pointers, one for the first call, and one for their yield

Eek, sorry. Its embarrassing to forget my own code. I remember now
and I did read your patch. I liked the "feel" of the yield op, but who cares
since its machine generated anyway?

>point. When I removed those ops awhile back, I also simplified coroutines
>to only use one code pointer. The first time a coroutine's called, it
>points to wherever that coro starts. Afterwards, it points to the last
>yield point. This seems to give us the old semantics without the extra
>pointer (not a big deal).

You are correct. My first implementation was meant to be easy to understand
and lead the way for more hackers to improve. Mission accomplished. :)

-Melvin


0 new messages