The save/resume opcodes are so unusual that they cause confusion in the bytecode liveness analysis. In particular, they don't have context-free use/def behavior and their live-in calculation cannot be expressed in terms of use/def. Normally, the use/def of a bytecode is determined just by that bytecode. Save/resume's use/def is context-sensitive: you need to look at some surrounding code to determine what they use and def. Worse, use/def is insufficient to calculate the live-in of resume. The live-in of resume is invariant: the only thing live-in is the argument token. This is an unusual rule, and would require resume to be special-cased. Linked bytecode has many clients: the bytecode liveness analysis, the LLInt, baseline JIT, and DFG parser. I think that instead of having so many special cases in linked bytecode for generators, we should do a generator conversion before even getting to linked bytecode. This will mean that linked bytecode won't have to worry about what it means to be a generator.
Yusuke, do you have a bug that this can be duped to?
https://bugs.webkit.org/show_bug.cgi?id=152723 this patch will include this separated analysis change to transform save, resume to get_from_scope & put_to_scope.
Our generator mechanism was rewritten and this problems is gone!