-
Notifications
You must be signed in to change notification settings - Fork 1.7k
[dart2wasm] Support switch
in sync*
functions
#51342
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Implemented in https://dart-review.googlesource.com/c/sdk/+/292740. |
Just to update: we implemented |
I'm fixing the remaining |
…x sync* This is the last part of the series of patches to implement missing sync* features and fix bugs. Move common code generation functions between async and sync* code generators to the state_machine library, with the name `StateMachineCodeGenerator`. This class allows overriding parts that differ between the async and sync* code generators. Fixes tests: - co19/Language/Statements/Yield_and_Yield_Each/Yield_Each/execution_sync_t05 - language/sync_star/generator3_test/test1 - language/sync_star/generator3_test/test2 - language/sync_star/sync_star_exception_iterator_test - language/sync_star/sync_star_exception_nested_test - language/sync_star/sync_star_exception_test - language/sync_star/sync_star_exception_current_test Fixes dart-lang#51343. Fixes dart-lang#51342.
…x sync* This is the last part of the series of patches to implement missing sync* features and fix bugs. Move common code generation functions between async and sync* code generators to the state_machine library, with the name `StateMachineCodeGenerator`. This class allows overriding parts that differ between the async and sync* code generators. Fixes tests: - co19/Language/Statements/Yield_and_Yield_Each/Yield_Each/execution_sync_t05 - language/sync_star/generator3_test/test1 - language/sync_star/generator3_test/test2 - language/sync_star/sync_star_exception_iterator_test - language/sync_star/sync_star_exception_nested_test - language/sync_star/sync_star_exception_test - language/sync_star/sync_star_exception_current_test Fixes dart-lang#51343. Fixes dart-lang#51342. Change-Id: Ife6eab43b2721b003ebf9bc0f03796748fd5df46
This cherry-picks commits: 6de879e - [dart2wasm] Fix exception handling in async functions 7e237a1 - [dart2wasm] Small refactoring in async code generator eabb2b3 - [dart2wasm] Catch JS exceptions in async functions e44bc22 - [dart2wasm] Fix bug in restoration of `this` in async functions. 350954a - [dart2wasm] Fix `this` restoration code in sync* handling. 8ccb412 - [dart2wasm] Move type parameter bounds checks & parameter type check logic together with logic setting up variables e7dde83 - [dart2wasm] Port VM fix for #52083 (sync*) 3863e78 - [dart2wasm] Move yield finder to a shared library 829261e - [dart2wasm] Move async compiler utilities to state_machine library fab56db - [dart2wasm] Move common code generation routines to state_machine, fix sync* Bugs: #55347, #55457, #51343, #51342 Cherry-pick: https://dart-review.googlesource.com/c/sdk/+/368300 Cherry-pick-request: #55847 Change-Id: I0a4186533fbdf4c5727911295ad48696a90f715f Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/368300 Commit-Queue: Ömer Ağacan <[email protected]> Reviewed-by: Martin Kustermann <[email protected]> Commit-Queue: Martin Kustermann <[email protected]>
The
sync*
implementation in dart2wasm currently does not supportswitch
statements.To implement these via the
sync*
CFG, eachcase
needs a target label that theswitch
can jump to and which can also be jumped to bycontinue
statements. The implementations does not need the workarounds for backwardscontinue
that the normalswitch
implementation has, since this workaround is essentially already there in the form of the switch-in-loop implementation of thesync*
CFG.The text was updated successfully, but these errors were encountered: