Enable Jit for Generators, Asyncs and Async Generators #6662
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR enables the JIT in both FullJit and SimpleJit mode for Generator Functions, Async Functions and Async Generator Functions (Collectively referred to internally as Coroutines)
Exceptions
Work Done in this PR
Fix register mismatch in Jit
yield*
statements within Async GeneratorsFix handling of For-In
yields
was not working correctlyDisable BailOnNoProfile in Coroutines
++i
is marked as dead++i
is dead, i is marked as a single definition int - a constantyield 0
-> BailOnNoProfile -> yield 1 (in the interpreter) -> try jitted code again - Bails out with i = 0 as it is a const -> yield 1 (in the interpreter)Remove unnecessary startup yield
Enable
Future Work
A. Look at enabling for functions containing try/catch - needs to be explored don't know what issues may arise
B. Create an alternative form of BailOnNoProfile that can be used in Coroutines
C. Look at Jitting loop bodies that don't contain yield - (including loop bodies in Modules)
Fix #5877