Closed Bug 1530754 Opened 8 months ago Closed 7 months ago

Don't create unnecessary iterator result objects in async generators


(Core :: JavaScript Engine, enhancement, P2)




Tracking Status
firefox68 --- fixed


(Reporter: anba, Assigned: anba)




(5 files)

For performance and spec compliance reasons: bug 1530324, comment #20.

Priority: -- → P2

The parameter isn't an unwrapped object from another compartment and therefore
shouldn't be prefixed with "unwrapped".

Depends on D23512

Per spec, IteratorValue() must be called outside of the implicit try-catch-finally
block in yield*. But when IteratorValue is already called in the generated byte
code for yield*, we no longer have an iterator result object to pass back to
AsyncGeneratorResume. So change AsyncGeneratorResume to use the already unpacked
iterator value instead of an iterator result object.
This implies other parts of async generators now also no longer can work with
iterator result objects, for example AsyncGeneratorReturn in AsyncIteration.js
or when generating byte code guarded with FunctionBox::needsIteratorResult().

Depends on D23513

Step 7.c.iii.2. from yield* was missing in our implementation.

Depends on D23514

Pushed by
Part 1: Remove "unwrapped" prefix from parameter name. r=jorendorff
Part 2: Update step comments. r=arai
Part 3: Don't create unnecessary iterator result objects in async generators. r=arai
Part 4: Add missing Await in yield* when 'return' method not present. r=arai
Part 5: Update test262 to pick up new tests for async generator changes. r=arai

Keywords: checkin-needed
Regressions: 1547039
You need to log in before you can comment on or make changes to this bug.