At 7:40 PM -0400 6/7/02, Melvin Smith wrote: >I just did a bunch of commits, people might need a fresh checkout. > >Its a start for subroutines and co-routines. The keyword is 'start', >not final product. The ops are call/callco, but these will become >vtable entries for the 4 aforementioned sub types by Dan. >David has some pending patches for PMC so I didn't want to >get into any conflicts with that, so I'm waiting until he's done >with the PMC cleanup. > >I committed 2 examples to the examples/assembly directory, >and I'll patch them inline here at the bottom. > >Warning: This is not the final convention, it is still up in the air. Dan >has spec'd some of it out, but for now, we can work with this. > >The support isn't complete, for example, co-routines, etc. need to >swap in their own context, which right now they don't do. > >Also we'll have to do fun stuff like copy return values off of the co's >local stack onto the returnee's stack, unless someone has >suggestion. I know JVM does something like this. > >However, you can write resumeable routines with the support that is >there now.
Cool. Two things: First, we need to beef up ret, but that's a problem of definition. It should walk the control stack until it hits something it can return, so we can undo exception handler pushes, scope change, and suchlike things. (My problem, I'll update the docs) Second, in the final go, the callco op won't be needed--call should be sufficient, but that'll need support in the PMCs. I'm not sure about return values yet. We'll see what that brings. -- Dan --------------------------------------"it's like this"------------------- Dan Sugalski even samurai [EMAIL PROTECTED] have teddy bears and even teddy bears get drunk