The single loader does the same thing here:
ef59500e6f/sdk/lib/_internal/js_runtime/lib/js_helper.dart (L3257)
This retry token acts as a cache-buster for requests where the download succeeded but the part file was corrupted and failed to initialize. In that case Chrome has to re-download the file, it can't use the cached file.
I just missed passing this parameter when I added the new multiloader.
b/348644880
Change-Id: I26f4bc0da6c7e6fd714f442df8d32b8f10678047
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/372700
Commit-Queue: Nate Biggs <natebiggs@google.com>
Reviewed-by: Mayank Patke <fishythefish@google.com>
Auto-Submit: Nate Biggs <natebiggs@google.com>
This removes the special runtime blob for string conversions, instead we
make 2 functions for conversions use our built-in `JS<>()` support.
This will allow specializing the implementation in a future CL.
Change-Id: I06df25ed805042c0a3e2efb966eaebd1ce67dc0c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/372660
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Ömer Ağacan <omersa@google.com>
This WasmArray-backed list classes to `dart:_list`, similar to
`dart:_string` and `dart:_typed_data`
This will allow having internally-public list members like unchecked
getters and setters that we will use in the rest of the standard
library.
This CL doesn't add anything new, just renames things.
- `dart.core._ListBase` -> `dart._list.WasmListBase`
This is to avoid confusion with `dart.core.ListBase` (defined by Dart
standard library), and also to be consistent with `WasmTypedDataBase`
and `WasmStringBase`.
- `dart.core._List` -> `dart._list.ModifiableFixedLengthList`
Similar to the above, to avoid confusion with `dart.core.List`.
- `GrowableList.ofOther` -> `GrowableList.fromIterable`
`ofOther` sounds like it should make a growable list from another
growable list, but the type is more general than that. To reflect what
it actually does we call it `fromIterable`.
Tested: Existing tests.
Change-Id: I24398765e1b0d549fc70b03ba94161479c5fc54c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/372622
Commit-Queue: Ömer Ağacan <omersa@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Since sound null safety, 'vm:non-nullable-result-type' pragma is
no longer useful as the same information is conveyed by a non-nullable
return type.
TEST=ci
Change-Id: Ie6a61aca38cfea47cb005b12ca7f0d7631791024
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/372200
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Slava Egorov <vegorov@google.com>
CoreLibraryReviewExempt: Trivial change.
Change-Id: I5c23641ed562efe51c0c7c35517ba75fffdd05ad
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/372503
Reviewed-by: Kevin Moore <kevmoo@google.com>
Commit-Queue: Lasse Nielsen <lrn@google.com>
Add new string extensions with unchecked `codeUnitAt` and `substring`
methods.
Replace old unchecked functions `oneByteStringCodeUnitAtUnchecked` and
others with the extension methods.
Most of the CL replaces old functions with extensions. New uses are only
introduced in `dart:convert`.
Change-Id: I44151bbc65c0bf4467d88911f8a088bbe1910eaa
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/372443
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Ömer Ağacan <omersa@google.com>
This moves `JSStringImpl` class from `dart:_js_types` to `dart:_string`.
This allows implementing a common base class with unchecked operations
to all string classes as internal methods (so users won't be able to
call them via `dyanmic`), and extension methods to call these unchecked
methods in libraries like `dart:convert`.
Uses of these methods are introduced in
https://dart-review.googlesource.com/c/sdk/+/372443.
Change-Id: Ie4cfe778654c42d62bc4a90391fe349fa783a42c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/372442
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Ömer Ağacan <omersa@google.com>
Currently code uses `double` to represent array indices, array lengths
etc. This seems wrong because `double`s can loose precision. This is
also a high overhead.
Understandably one could use `double` and only start to loose precision
with more than 32 bits, but realistically string lenghts, array lengths
cannot exceed 31-bits (i.e. 2 GBs) in practice.
=> Use Wasmi32 to represent array indices, array lengths, bytes loaded
from integer arrays, ...
Change-Id: Ife540622c85118d890a8e487677db56e2ce06f5a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/372424
Reviewed-by: Ömer Ağacan <omersa@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
Adds an interface which implements both `TypedData`
and `List`. That allows abstracting over types that are both
`List` and `TypedData` without losing access to one of the
interfaces.
Tested: typed_data_interface_test.dart
Change-Id: Idbdfc084ea5d2d9a072887973e2e9d29a5fd94ce
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/371100
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Lasse Nielsen <lrn@google.com>
Reviewed-by: Nate Bosch <nbosch@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
Flow graph builder implementation of certain dart:math and Double
methods is now used unconditionally, so corresponding native
methods are never used and can be removed.
This is a follow-up to
https://dart-review.googlesource.com/c/sdk/+/371980.
TEST=ci
Change-Id: Ibca2729f70f39af26a899d99724ce62efc3c8dae
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/372180
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
18994e6e46 removed unmodifiable view classes in the standard library
that can make any implementation of `ByteData` and other typed_data
types unmodifiable.
Add a `_immutable` field to `JSDataViewImpl`, implement
`asUnmodifiableView`.
An alternative implementation would be adding a subcalss with overridden
setters. However I think a simple boolean flag check should be better,
as adding a subtype can make call sites polymorphic and prevent direct
calls and inlining.
(We can't do the same in native typed_data types because we allocate
Wasm arrays with different element types for the fastest possible
implementation in the common cases, so we need different `ByteData`
implementations for different Wasm array types.)
Bug: #56014
Change-Id: I674121cff14559128bc2a9deb318a3bc6adf316d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/372082
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Ömer Ağacan <omersa@google.com>
This removes the outer check in `List<int>` element check:
```
if (allowMalformed) {
... check code units in `List<int>`, write 0xFF for invalid bytes ...
} else {
... check code units in `List<int>`, throw for invalid bytes ...
}
```
and moves the `allowMalformed` check to the inside of the loop, when the
`int` value is negative or more then 255.
`allowMalformed` in UTF8 is used for two things:
1. To allow invalid bytes in `List<int>` argument.
2. To allow invalid UTF-8 encodings.
Both of these will happen rarely, but (1) will almost never happen as
any code that cares about performance will pass a `Uint8List`. So it
makes sense to assume that (1) will hold very rarely, and optimize based
on that.
Change-Id: I3ecec24d29d1cc2ec8f986a87ac3e7d609002d89
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/372060
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Ömer Ağacan <omersa@google.com>
In theory, such casts should be optimized out, but in some
cases, they might not be (DDC or lower optimization flags).
Instead, we should use the primary constructor and
representation field to go between the representation type
and the JS type. Similarly, we do unnecessary casts in
dart2wasm to convert JSValue to the right JS type. We can
avoid those by directly calling the primary constructor.
Change-Id: I8fdac18f6d634b379e70951fe5d3a1ed7ad4bf15
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/371423
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Srujan Gaddam <srujzs@google.com>
The Dart != check lowers to !== in JS. The RTI property doesn't
exist in the JS function, so the result is undefined. However,
undefined !== null returns true, so JS functions are accidentally
treated as Dart functions. This fixes that.
Change-Id: I4c4e0018768c0ac29f4b5ee228c504b7cb0b7232
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/369200
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Srujan Gaddam <srujzs@google.com>
Use `U16List` instead of `Uint16List` as the character buffer type.
Access the Wasm array directly when writing characters and converting
the final buffer to a String. This avoids bounds checks and uses
`array.copy` when allocating the final string.
Change-Id: I570494e8349adc7a268544544516c9947abc8604
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/371681
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Ömer Ağacan <omersa@google.com>
This affects very common string interpolation expressions where we now
avoid creating arrays and looping over arrays and casting references
when getting things out of arrays.
e.g. `StringBuffer.write()` uses "$obj" in it's implementation
which will benefit from this.
Change-Id: Ie6615e5f76a4a8ccb4ff9aa85c05c7e39eab6f00
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/371660
Reviewed-by: Ömer Ağacan <omersa@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
The buffer type is always `Uint8List`, improve the type from `List<int>`
to `Uint8List`.
Tested: existing tests
Change-Id: I03ad84a0f1fe1ade8a46719545f3c33eeccd99b7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/371402
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Ömer Ağacan <omersa@google.com>
In most cases, the (now removed) SDK class was patched so that the constructor redirected to a platform-specific implementation of the unmodifiable view. Uses of the SDK class in the platform code could be rewritten to the more direct use of the implementation class.
The big +/- file changes are from moving the implementation classes from the patch file (typed_data_patch.dart), where they are no longer needed, to the internal file (typed_data.dart).
TEST=ci
Bug: #53785
Change-Id: Iaa7370de25b7fc2d26b24f7733c2892868e593cb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/370661
Reviewed-by: Ömer Ağacan <omersa@google.com>
Reviewed-by: Lasse Nielsen <lrn@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Brian Quinlan <bquinlan@google.com>
- Use unchecked reads when reading from `U8List` chunks.
- Use unchecked reads when reading from "transition table" in UTF16 decoder.
- Fix a typo in a comment.
Tested: performance refactoring, covered by existing tests.
Change-Id: I1b90781f2b419188d6a560994159b48faad16075
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/371301
Commit-Queue: Ömer Ağacan <omersa@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
The flutter platform file is compiled slightly differently from the way
we compile the normal SDK platform file. This slight difference -
somehow related to how -D environments are used in CFE - results in a
constant `VariableDeclaration` to stay in the kernel in flutter's case
but not in the Dart SDK's case.
(All usages of constant variables / fields will be
`ConstantExpression(<const>)` instead of
`VariableGet(<constant-variable>)`)
That in itself causes the kernel verifier AST visitor (which we call
from `pkg/dart2wasm/lib/compile.dart` in assertion mode enabled) to
report an error.
=> To work around this issue we hoist the only variable affected by this
to top-level.
=> That will allow us to run the dart2wasm compiler in assertions mode
on flutter apps without hitting the verifier problem.
(This has very likely to do with the fact that in flutter's case the
variable must result in an `UnevaluatedConstant` which then at a later
stage gets evaluated whereas in Dart's case we do that eagerly).
There's no easy way to write a test for this, as normal test files will
have an environment and therefore don't result in unevaluated constants
afaik.
Change-Id: I883b91bdc37ede8b45e35a15d0dddc296d9da9ba
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/371340
Reviewed-by: Ömer Ağacan <omersa@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
This CL adds a new --interop-null-assertions flag (cf.
--native-null-assertions) with the goal of validating that JS interop
APIs with non-nullable static return types do not return null values.
This flag is currently disabled by default but is intended to assist in
sound null safety migrations.
In general, we don't guarantee type soundness of package:js interop
since users can write incorrect static types which are not backed by
any runtime checks. However, it is likely that during the null safety
migration, some interop APIs which should have been made nullable
weren't. Therefore, we want to offer some additional (but limited)
checking for this case.
For static invocations of functions with non-nullable return types, we
can simply perform a null check on the result of the call.
For instance methods (which could be invoked virtually/dynamically), we
want to perform a null check on the return value in the callee (the
interceptor method) itself when possible.
It's possible for multiple interop bindings to share the same
interceptor method. We produce a null check in the interceptor method
body if all the methods have non-nullable return types. Otherwise, we
insert checks at callsites when appropriate.
Change-Id: Ifd155d7f8326152b6d57d61199e0b7973c4a1211
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/369784
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Mayank Patke <fishythefish@google.com>
Use `WasmArray<WasmI8>` for number buffer when decoding numbers.
This saves one allocation when growing the number buffer and on initial
allocation of the buffer, and eliminates one layer of indirection when
writing to the buffer.
Change-Id: Ic210bc13072f0dd34918361a1bee8c7b29ce61cd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/371064
Commit-Queue: Ömer Ağacan <omersa@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Removes risk of DDS connection information being split across two stream
events, causing JSON decoding to fail.
Also updates DDS to close stderr, even in the error case.
TEST=Existing service and dartdev tests
Change-Id: I5cceab899aac1fa63bd7578dd658b34096722bd3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/371000
Reviewed-by: Derek Xu <derekx@google.com>
Currently if we have a `<obj> is/as Iterable<T>` check we will
* allocate a `WasmArray<_Type>` array and put value for `T` in it
* allocate a `_InterfaceType` object with the array as type arguments
* call to RTT which is looping over the type arguments array
With this CL we recognize in the compiler if we generate tests against
interface types and specialize the most common cases (0, 1 or 2 type
arguments). This in return will make us
* call to 0/1/2 specialized RTT isInterfaceSubtype implementation
which will use unrolled loops to do the checking.
=> We avoid allocation of `_InterfaceType` always
=> We avoid allocation of `WasmArray<_Type>` for length=0/1/2
=> We have faster checking due to unrolled loops.
(It is very unlikely binaryen can achieve the same, as it would
need to do very aggressive inlining & loop unrolling to get to the
same result. If we'd force it to inline then every is/as check
would be very large).
Issue https://github.com/dart-lang/sdk/issues/55516
Change-Id: Ia99548d514683f678178ea30d07aeb742ae914ca
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/370260
Reviewed-by: Ömer Ağacan <omersa@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
We make the compiler emit a special index (namely 0) into the
canonical type argument substitution table iff no substitution has to be
performed.
This is very common:
```
class List<T> implements Iterable<T> {}
```
=> The translation of the type arguments from `List` to those of
`Iterable` is a NOP and can therefore be skipped.
Issue https://github.com/dart-lang/sdk/issues/55516
Change-Id: I16ad8d7196656dddeba15801e80c2e23ae0af51b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/370242
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Ömer Ağacan <omersa@google.com>
When an implicit or explicit `as` check fails we throw a [TypeError]
exception with a stack trace. Though that stack trace doesn't really
have to have the top-frame being where the check failed, it's fine if
there's an additional frame from the runtime code that actually throws
the exception.
Doing so removes `StackTrace.current` from every `as` check and
therefore reduces size.
Change-Id: Ia34b59ebaa54b8cdcd2dc7b153a1e4e2fe1dd0e9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/370340
Reviewed-by: Ömer Ağacan <omersa@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
This CL optimizes the RTT data structures by
* Having a canonical table for substitution arrays
* Stores the (canonical) substitution index to use right next
to the super class id, thereby
* Removing an indirection when looking up substitutions
See more information in `sdk/lib/_internal/wasm/lib/type.dart`
This reduces
* `Hello.Compile.Size.wasm.opt` by ~ 4%
* `FluteComplex.Compile.Size.wasm.opt` by ~0.5%
Issue https://github.com/dart-lang/sdk/issues/55516
Change-Id: If0a50780a9a604886bd67a08a2f345103f0bcb32
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/369641
Reviewed-by: Ömer Ağacan <omersa@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
When checking against a destination type that isn't generic, we can
safely ignore the type arguments of the concrete class (as we only care
whether the object's class has the destination type in its transitive
super type hierarchy).
=> Avoid calling `Object._getTypeArguments(o)` if dst type is non-generic.
Issue https://github.com/dart-lang/sdk/issues/55516
Change-Id: Ie9c6a3ab2d99acc07546f9d28ca71ac740c4aad5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/369462
Reviewed-by: Srujan Gaddam <srujzs@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
If we do a type check against a class that isn't generic, then we can
safely ignore all the type arguments - because irrespective of their
values - either the class we test against is in the transitive super
hierarchy of an object's class or not.
Issue https://github.com/dart-lang/sdk/issues/55516
Change-Id: Ibf6950492d4c33d7eaf55d6ce8389ebfac201b00
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/369461
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Srujan Gaddam <srujzs@google.com>
In 7fa9b814d2
(https://dart-review.googlesource.com/c/sdk/+/369141) a limit was
introduced to prevent OOM.
It however introduced a bug where `available` would be out of sync
(> 0 when it should be 0) causing issues - seemingly an infinite loop
where it continues trying to read even though no data is available - and
e.g. the weekly bot timed out after 12 hours because stuff didn't work.
(I think the issue is `stopRead()` returning false, but isn't sure).
This CL fixes the issue by updating the field before the possible break.
TEST=Hopefully a test will be added in a follow-up.
Change-Id: I722c8868fd7354fc9403e8d2f387914c3fab884a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/369243
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
There's no need to make an instance of _TypeUniverse and pass around a
`this` reference to method calls as there's no state.
Issue https://github.com/dart-lang/sdk/issues/55516
Change-Id: I522a3ef677d0301c0a5dcd1d83499a99293618a3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/369242
Reviewed-by: Ömer Ağacan <omersa@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
If HttpResponse is being closed prematurally (e.g. because client
decided to close its request) we need to propagate cancellation
to the stream which is being piped into the response. Otherwise
we will keep that stream forever hanging around and leak underlying
resources.
Fixes https://github.com/dart-lang/sdk/issues/55886
TEST=tests/standalone/io/regress_55886_test.dart
R=kustermann@google.com
Change-Id: I7c294ed19cc7c350fd101b078bd650ce8a6526a2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/369061
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
Original change: https://dart-review.googlesource.com/c/sdk/+/366963
This reverts commit 72b2883c6f.
[js_runtime, js_dev_runtime] Implement `microsecond` field of `DataTime`
- Move DateTime implementation for dart2js and DDC into a shared place to reduce duplication.
- Add a _microsecond field to the web DateTime to track microseconds outside of the JavaScript Date.
- The cute dart2js optimization whereby `DateTime.now().millisecondsSinceEpoch` is compiled to `Date.now()` still works.
- Both implementations report better errors.
- Fixed VM bug with in-range sentinel.
Issue: https://github.com/dart-lang/sdk/issues/44876
Issue: https://github.com/firebase/flutterfire/issues/12102
Issue: b/342552853
CoreLibraryReviewExempt: Reapply of unchanged code
Change-Id: I7f14b69e412a052ef3fe6b43cc9cf9d96319adb8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/368380
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Lasse Nielsen <lrn@google.com>
This reverts commit fb057ea4e0.
Reason for revert: b/342552853
Original change's description:
> [js_runtime, js_dev_runtime] Implement `microsecond` field of `DataTime`
>
> - Move DateTime implementation for dart2js and DDC into a shared place to reduce duplication.
>
> - Add a _microsecond field to the web DateTime to track microseconds outside of the JavaScript Date.
>
> - The cute dart2js optimization whereby `DateTime.now().millisecondsSinceEpoch` is compiled to `Date.now()` still works.
>
> - Both implementations report better errors.
>
> - Fixed VM bug with in-range sentinel.
>
>
> Change-Id: I9156255bdb6ecc195500ae9bc88f91fb315b6297
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/366963
> Reviewed-by: Alexander Aprelev <aam@google.com>
> Reviewed-by: Martin Kustermann <kustermann@google.com>
> Reviewed-by: Lasse Nielsen <lrn@google.com>
> Commit-Queue: Stephen Adams <sra@google.com>
Change-Id: I58572256a7710df4589bb5e41c7afee295c2388b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/368103
Reviewed-by: Alexander Thomas <athom@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Auto-Submit: Ivan Inozemtsev <iinozemtsev@google.com>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
- Move DateTime implementation for dart2js and DDC into a shared place to reduce duplication.
- Add a _microsecond field to the web DateTime to track microseconds outside of the JavaScript Date.
- The cute dart2js optimization whereby `DateTime.now().millisecondsSinceEpoch` is compiled to `Date.now()` still works.
- Both implementations report better errors.
- Fixed VM bug with in-range sentinel.
Change-Id: I9156255bdb6ecc195500ae9bc88f91fb315b6297
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/366963
Reviewed-by: Alexander Aprelev <aam@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Reviewed-by: Lasse Nielsen <lrn@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
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#51343.
Fixes#51342.
Change-Id: Ife6eab43b2721b003ebf9bc0f03796748fd5df46
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/367041
Commit-Queue: Ömer Ağacan <omersa@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>