Bug 159281 - Linked bytecode should not have save/resume
Summary: Linked bytecode should not have save/resume
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: WebKit Nightly Build
Hardware: All All
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-06-29 16:12 PDT by Filip Pizlo
Modified: 2018-07-11 01:46 PDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Filip Pizlo 2016-06-29 16:12:52 PDT
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.
Comment 1 Filip Pizlo 2016-06-29 16:13:13 PDT
Yusuke, do you have a bug that this can be duped to?
Comment 2 Yusuke Suzuki 2016-06-29 17:15:10 PDT
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.
Comment 3 Yusuke Suzuki 2018-07-11 01:46:22 PDT
Our generator mechanism was rewritten and this problems is gone!