• Kevin Modzelewski's avatar
    Restructure the way we collect generator stacks · 6446c7d5
    Kevin Modzelewski authored
    Previously it was pretty implicit where we rely on the fact that the generator
    object will exist on the previous stack, and once we notice the generator
    its GC handler will crawl the generator stack.
    
    I think we also missed the generator's registers, but only the top generator
    and only if it wasn't the current thread (was unable to reproduce this).
    
    Now, keep explicit track of all the previous stacks that a thread had been on.
    This cleans that up, and since things are explicit now, we can also track
    where we stopped executing on each stack.  We were doing this hackily for the main
    stack before, but now we can do that for generator stacks, which will let
    us make those auto-growing as well.
    
    My confidence in this change: low.
    6446c7d5
generator_nonrunning_collection.py 371 Bytes