Bug 150290
Summary: | [ES6] Implement Generators | ||
---|---|---|---|
Product: | WebKit | Reporter: | Yusuke Suzuki <ysuzuki> |
Component: | JavaScriptCore | Assignee: | Nobody <webkit-unassigned> |
Status: | RESOLVED FIXED | ||
Severity: | Normal | CC: | adam, ashvayka, fealebenpae, fpizlo, ggaren, gskachkov, keith_miller, mark.lam, msaboff, saam, sam |
Priority: | P2 | ||
Version: | WebKit Nightly Build | ||
Hardware: | Unspecified | ||
OS: | Unspecified | ||
Bug Depends on: | 151547, 150769, 150792, 151545, 151546, 151552 | ||
Bug Blocks: |
Yusuke Suzuki
Implement ES6 generators.
Consider the following case,
let generator = gen();
// first example.
for (let value of generator) {
...
}
function* gen() {
// (1).
...
// (2).
yield;
}
in for-of, we call generator.next(). In the first case, it starts from (1). And the second call starts from (2).
So I think generating the following code for ES6 generator is the easiest way to handle it in DFG / FTL. How about this?
// Entry point is only one. Every time we call generator.next(), the function will start from here.
resume_to_yield (generator_object) // This resumes frame and jump.
label_1:
// (1).
special_return;
label_2:
// (2).
special_return;
Attachments | ||
---|---|---|
Add attachment proposed patch, testcase, etc. |
Yusuke Suzuki
Working on syntax part at first...