At 4:54 AM -0400 4/9/02, Michel J Lambert wrote: > > So, I think #2 is the way to go. We'll add a new flag, >> (BUFFER|PMC)_stay_of_execution_FLAG or something, that gets added to >> allocated PMCs and Buffers. It'll be treated the same way as the >> constant/immortal flag is treated for DOD purposes, with one >> difference--there'll be an op which specifically clears the flags. >> Since the flag is *not* valid to be set across ops, we're fine. > >Sounds good to me. This requires that we manually insert this >clear_soe_flag op in code, where we want it. If we don't insert it, we >effectively make everything immortal/immune, forever.
Right. A good spot for it is in either explicit DOD request ops, or we require it as one of the ops run at block exit or something. We may do a sweep when an exception's triggered as well. >Finding 'proper' >places to insert this could be hard to do for the compiler writer, imo. Nah, I don't think so. There are plenty of reasonable places, and odds are it won't affect many structures anyway, so if we defer it a lot there's no harm nor foul there. >The larger the amount of code in a loop, the more likely this op is to >exist inside the loop? Not sure what other heuristics there would be. Don't > > Only those functions that *must* set it will, and they are also >> required to make sure the stay_of_execution_count interpreter >> variable is set to the proper number (or at least large enough) on >> abnormal exit. (That way we can keep the flag clearing op from >> actually running if there's no reason) > >Aren't most functions going to be required to set it, indirectly? No. >new_*_header seems like an ideal place to set the SOE flag, and increment >the internal counter. Gah! No, absolutely not! The *only* place it should be set is in those functions that both: 1) Allocate structs and 2) Can't guarantee those structs are reachable when calling a function that may trigger the GC. That's a rather vanishingly small number of functions, really. I think we'll be OK, and we might add in a counted version of new_*_header to atomically request multiple PMC/Buffer/STRING structs which would alleviate many of the problems as well. (Which still leaves us with the issue of maintaining non-deathness across allocations of multiple struct types) Most of the functions that allocate structs are leaf-node type functions, so I think we'll be OK there. Also, the functions that set it should probably reset it when they're done, though I could argue against requiring that one for speed purposes. I think I'd want benchmarks for it, though. -- Dan --------------------------------------"it's like this"------------------- Dan Sugalski even samurai [EMAIL PROTECTED] have teddy bears and even teddy bears get drunk