Closed Bug 1530754 Opened 8 months ago Closed 7 months ago

Don't create unnecessary iterator result objects in async generators

Categories

(Core :: JavaScript Engine, enhancement, P2)

enhancement

Tracking

()

RESOLVED FIXED
mozilla68
Tracking Status
firefox68 --- fixed

People

(Reporter: anba, Assigned: anba)

References

Details

Attachments

(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 ccoroiu@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/db9d50041a0b
Part 1: Remove "unwrapped" prefix from parameter name. r=jorendorff
https://hg.mozilla.org/integration/autoland/rev/98c9901e6ca6
Part 2: Update step comments. r=arai
https://hg.mozilla.org/integration/autoland/rev/b86f47596771
Part 3: Don't create unnecessary iterator result objects in async generators. r=arai
https://hg.mozilla.org/integration/autoland/rev/92de6c120d41
Part 4: Add missing Await in yield* when 'return' method not present. r=arai
https://hg.mozilla.org/integration/autoland/rev/de3485ca2212
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.