This updates the InternalVariable hierarchy to be based on a sealed base class InternalVariable with no connection to IVariable. IVariable is removed and unused properties of InternalVariable are removed.
TEST=existing
Change-Id: Iacfbe9ab21d1c9aab043712099cd1ee6e4cee174
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/510825
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
The debugger assumes a null suspend state variable in an asynchronous
function means that the function is still in the prologue prior
to setting up the suspend state. However, the interpreter clears the
suspend state variable before returning, and the debugger needs to be
able to pause before returning when single stepping, so earlier a hack
was added to the debugger that detects being at the direct call of the
async return method and/or the return instruction with a null suspend
state variable.
However, there's a much simpler way of ensuring the debugger pauses
before returning: just emit the source position for the return prior to
clearing the suspend state variable. This also ensures that the debugger
still has access to the function's suspend state when pausing before
the return, instead of waiting until it has been cleared and thus is no
longer accessible.
TEST=ci (should not change the result of any current tests)
Cq-Include-Trybots: luci.dart.try:vm-dyn-linux-debug-x64-try
Change-Id: I401cceb169d8692ac379cdc5a531e07cafbe9a65
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/500740
Commit-Queue: Tess Strickland <sstrickl@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
For closures generated from both FunctionDeclarations and
FunctionExpressions, the starting file offset of the generated closure
function should be the file offset of the node itself, not the file
offset of the FunctionNode.
(This matches the logic in KernelLoader::LoadClosureFunction.)
TEST=pkg/vm_service/test/coverage_extension_methods_test
Cq-Include-Trybots: luci.dart.try:vm-dyn-linux-debug-x64-try
Change-Id: I25a0cd0aa6505e122a215237ca6ef7e8edb031af
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/507424
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Tess Strickland <sstrickl@google.com>
Some instance calls involving numbers in bytecode are converted to
specialized bytecode instead of generating an InstanceCall instruction.
When emitting RecordCoverage instructions, add them prior to these
specialized bytecodes as well.
TEST=ci
Cq-Include-Trybots: luci.dart.try:vm-dyn-linux-debug-x64-try
Change-Id: Ic1ab6be4123766d7ce583966dfde393a5df77579
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/507421
Reviewed-by: Alexander Markov <alexmarkov@google.com>
This adds a VariableDeclaration node which is used in ForStatement instead of VariableStatement.
This is a step towards removing the initializer from Variable. Long term, VariableDeclaration will own the initializer expression for variables and function parameters will have a defaultValue property instead of using the initializer property for the default value.
TEST=existing
Change-Id: I4a663eeb6006a0f9f098fb2b3e3b502d2ae583b0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/505681
Reviewed-by: Stephen Adams <sra@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
The RecordCoverage instruction has an A/E encoding. The A argument
is the type of coverage being recorded, whereas the E argument is
the logical index into the coverage array for updating whether that
source position has been hit.
Also adds new metadata to the bytecode component for the coverage
arrays associated with bytecode containing RecordCoverage instructions
and a new runtime entry for lazily allocate the coverage array for
an interpreted function when needed.
The type of coverage is encoded in the RecordCoverage instruction,
despite being redundant with the information in the coverage array, so that checking whether that type of coverage is currently enabled at
runtime doesn't require either accessing the coverage array (which may
be lazily allocated), forcing allocation of the coverage array just to
discover that type of coverage is currently disabled, or reading the
serialized bytecode component to avoid that forced allocation.
------
Other changes:
Source reporting now treats unexecuted interpreted functions when
not forcing compilation as if they were uncompiled native functions,
so that the source report from running the same code gives the same
result whether using the interpreter or the native compiler.
Bytecode closures are no longer skipped in source reports. Previously
any closure without a context scope was skipped, but bytecode closures
don't have those.
TEST=vm/cc/SourceReport_Coverage
Cq-Include-Trybots: luci.dart.try:vm-dyn-linux-debug-x64-try,vm-aot-dyn-linux-debug-x64-try,vm-aot-dyn-linux-product-x64-try
Change-Id: I7557e5dd4c98331c7ca2f5c867dd5f6d03e9d756
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/501520
Reviewed-by: Alexander Markov <alexmarkov@google.com>
This separates VariableDeclaration from Statement. VariableDeclaration no longer implements Statement and variable declared in a block or in a for-statement are now wrapped by a VariableStatement.
Currently there are two VariableStatement implementations; LegacyVariableStatement for variables in the current model, called LegacyVariable, and VariableInitialization for variables used in the new, still experimental, encoding that supports scope computation.
This CL is a step towards realigning the AST nodes to the new model in which each kind of variable has its own distinct subclass. (LocalVariable, PositionalParameter, NamedParameter, SyntheticVariable, etc.)
Note that it is not the intent to use VariableStatement in ForStatement going forward but that will be handled in a follow-up.
TEST=existing.
Change-Id: I5b309cd62c9b138f95b74fb054686edffa49a393
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/502681
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
This change introduces flags to allow the use of dynamic calls now that
they have their corresponding validation and runtime check. This will
enable us to add end-to-end tests next.
TEST=none yet - will be added in subsequent CL (see CL chain)
Bug: b/448095881
Change-Id: I82448824e94dd940ce5346f79554d34847ecb610
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/498320
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
This CL only adds the option and appropriate uses of it. Followup
CLs will use it to actually generate appropriate instructions and
metadata for collecting coverage information.
TEST=ci (just adding flag)
Cq-Include-Trybots: luci.dart.try:vm-dyn-linux-debug-x64-try,vm-aot-dyn-linux-debug-x64-try,vm-aot-dyn-linux-product-x64-try
Change-Id: I194154ef926abe7dae8bb93f397fb68029e2db3c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/501500
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Tess Strickland <sstrickl@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
In the VM, factory constructors always had an extra "type arguments"
parameter, even if class is not generic. Factory constructor bodies
were using class type parameters instead of function type parameters.
This results in extra code when calling non-generic factories
which is slightly inefficient in terms of code size and performance.
Also, it creates an additional complexity throughout the system as
factories should be special cased in many places.
This change removes artificial "type arguments" parameter, treating
factory constructors basically as static methods. This matches
kernel AST representation.
TEST=ci
Change-Id: I957583cb2ce9a3c408699880a04036e06b01dd31
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/501762
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
This removes the LegacyVariableDeclaration and VariableInitializationBase classes to create a simpler hierarchy. This is done preparation for splitting variables from statements.
TEST=existing
Change-Id: If29c9eee1e3d8bed819ce53ed178c3efa3bffaea
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/501961
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
* Rename additionalDills to additionalDillModules to indicate that it
is used to load a "module", not any old dill file.
* Where additionalDills was used to provide the platform use sdkSummary
instead.
* Remove unused constructor in KernelCompilationResults.
Tested: Existing tests.
Change-Id: I5f73f61db73b2bc932c211fb0b2e66ec2f5c50c5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/495981
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Call sites targeting a procedure annotated with `external-effect` will
not produce any code, including the argument which will not be
evaluated.
However, the single parameter will be treated as 'live' for the purposes
of any global analysis the backends do. This is useful for things like
protobuf shaking where a user may want to retain certain protobuf
messages without actually emitting the code that retains those messages.
Today this functionality is available internally in the vm and wasm SDK
libraries. dart2js has similar functionality represented via the
opaqueTrue and opaqueFalse booleans (which will cause conditional
branches to get shaken after analysis). This will replace dart2js's
opaque(True/False).
This also adds validation to the frontend to ensure a method annotated
with 'external-effect' is well-formed.
Change-Id: If1c4096673e655c58fe7638840a16125003e7809
Tested: Backend tests for codegen were added. A frontend test was added for the validation. A language test was added to confirm the behavior.
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/476020
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Nate Biggs <natebiggs@google.com>
Doesn't change anything in `front_end/*testcases/primary_constructors/`.
(Would have skipped any other file with `test` in its path and
an explicit language version marker, but there weren't any outside
of those `front_end` directories).
Almost no files used as test input were affected, and none testing the actual syntax changed.
The `.../nnbd/required_2.dart` test case was split into a legacy version retaining the `var`/`final` with a language marker, and a new version without the `var`/`final` cases.
The `pkg/analyzer/` tests, and any other tests that have source code
in strings, are not migrated by this CL.
Tested: No change to behavior. One test split into legacy and new.
Change-Id: I7f5aa4cc98001a9adecacd106c0b3be14f96be1c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/480542
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Nate Bosch <nbosch@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Lasse Nielsen <lrn@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
This is a reland of commit 88496ba1c3
Fixes on top of the original change:
* Closure layout is changed to avoid gap between fixed fields and
variable-length elements on compressed pointers architecture.
This gap was causing crashes in the GC when scanning closure
objects.
* pkg/vm_snapshot_analysis/test/instruction_sizes_test is fixed
on arm64 by decreasing threshold for detecting size changes.
Original change's description:
> [vm,dart2bytecode,modular_aot] Variable-length closure objects
>
> Extend closure objects with variable number of elements to capture.
> This is needed to support capturing multiple independent contexts
> after capturing is computed in the front-end.
>
> The following fixed Closure fields are moved into variable-length
> elements:
> - delayed type arguments;
> - instantiator type arguments;
> - function type arguments;
> - context.
>
> Number of elements and presence/indices of various type arguments
> are encoded into the new length_and_flags field in the Closure.
>
> Most closure objects don't need any of the type arguments so this
> change will reduce average Closure object size.
TEST=ci
Issue: https://github.com/dart-lang/sdk/issues/61572
Issue: https://github.com/dart-lang/sdk/issues/61635
Change-Id: I8685e632e2d0832766ecdc470f3cf9a6b880de48
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/494243
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Tess Strickland <sstrickl@google.com>
Reviewed-by: Slava Egorov <vegorov@google.com>
Extend closure objects with variable number of elements to capture.
This is needed to support capturing multiple independent contexts
after capturing is computed in the front-end.
The following fixed Closure fields are moved into variable-length
elements:
- delayed type arguments;
- instantiator type arguments;
- function type arguments;
- context.
Number of elements and presence/indices of various type arguments
are encoded into the new length_and_flags field in the Closure.
Most closure objects don't need any of the type arguments so this
change will reduce average Closure object size.
TEST=ci
Issue: https://github.com/dart-lang/sdk/issues/61572
Issue: https://github.com/dart-lang/sdk/issues/61635
Change-Id: I7ca5cec0fd8725c432a01d51781fb14e803997dd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/489482
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Slava Egorov <vegorov@google.com>
Reviewed-by: Tess Strickland <sstrickl@google.com>
When instantiating a closure, allocate a new closure object in
the same boostrap native method as checking bounds.
This simplifies code generation and prepares for variable-length
closure objects by removing the only place where closure of unknown
length was allocated in the generated code.
TEST=ci
Change-Id: I9ac51c862081612bca2160699ebe24526d4fc915
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/490360
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
This CL adjusts the predicate `_isFormalParameter` in the constant
evaluator, so that it includes variables from the new
model. Additionally, `IntenralPositionalParameters` and
`InternalNamedParameters` that were emitted as parts of function
declarations are replaced with their corresponding `astVariable`s in
the output.
The CL allows to unskip the last test in the bytecode generator when
the new variable model is enabled.
Part of https://github.com/dart-lang/sdk/issues/61572
Change-Id: Ibb8df47bf53f7f31aab58f8d5d104192edc83718
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/489380
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Chloe Stefantsova <cstefantsova@google.com>
This CL is part of an effort to bump the SDK requirement to `3.12.0-0`
for all the packages in `pkg` that are not published to `pub`, so that
we can get better testing of the "private named parameters" feature.
(Packages that *are* published to `pub` can't be safely bumped yet,
because SDK 3.12 hasn't been released, and I don't want to block those
packages' ability to publish useful updates to customers.)
This change covers the following packages, which are owned by
OWNERS_VM:
- pkg/dart2bytecode
- pkg/dart2native
- pkg/dtd_impl (jointly owned with OWNERS_DEVTOOLS)
- pkg/mmap
- pkg/observatory
- pkg/vm
Changes to `pubspec.yaml` files were made manually.
Changes to `.dart` files were made automatically, using `dart
fix`. Two kinds of changes were made:
- Migrate to using private named parameters where it is possible to do
so without changing semantics. Note that this migration is
conservative; see https://github.com/dart-lang/sdk/issues/58607 for
details.
- Migrate to using null aware elements.
Tested: Standard trybots
Change-Id: I1666e5771a34ef3c30ceeadced3d505d6a6a6964
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/487942
Auto-Submit: Paul Berry <paulberry@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Daco Harkes <dacoharkes@google.com>
In the new variable encoding, variables exist either in the internal
form (InternalLocalVariable, InternalSyntheticVariable, etc) or in the
output form, which is passed to the backends. Normally, type inference
is the mechanism that consumes the variables in the internal forma and
produces the variables in the output form. However, some expressions are
produced before type inference (in the BodyBuilder) and will never be
processed by type inference. Synthetic assignments in for-in loops is an
example of such expressions.
This CL modifies the expression generators used by the BodyBuilder, so
that the synthetic assignments are produced directly in the output form,
since they will not be touched by type inference.
This change makes the `loop.dart`, `switch.dart`,
`instance_creation.dart`, `asserts.dart`, `field_initializers.dart`,
`optional_params.dart`, `bootstrapping.dart`, `ffi.dart`, and
`invisible.dart` tests of the bytecode generator to pass, so it can be
removed from the excluded tests when the closure-context-lowering
experiment is enabled.
Part of https://github.com/dart-lang/sdk/issues/61572
Change-Id: I8d828b7da8e33c6e9fa6bfdda1f201bcdfad9ac4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/487840
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Chloe Stefantsova <cstefantsova@google.com>
Adds a new isInvisible flag for both FunctionDeclarations and
ClosureDeclarations and sets it if the function or closure declaration
is annotated with @pragma('vm:invisible'). This way, function visibility
is appropriately recorded even if options.emitAnnotations is false.
The bytecode reader checks for the isInvisible flag when reading
FunctionDeclarations and ClosureDeclarations and appropriately
sets the is_visible flag for the Function object accordingly.
TEST=pkg/dart2bytecode/test/bytecode_generator_test
vm/dart/invisible_function_pragma_test
Cq-Include-Trybots: luci.dart.try:vm-dyn-linux-debug-x64-try
Change-Id: If435afbe5e74adc022ce064784b6b3e5e8a88164
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/486381
Commit-Queue: Tess Strickland <sstrickl@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
This CL is a part of work that migrates the bytecode generator to the
new variable model produced by the CFE. The code is changed in such a
way that it's compatible with both the old model and the new model.
Specifically in this CL the invocatoins of the getter
`VariableGet.variable` are replaced with the invocations of
`VariableGet.expressionVariable`, which has the return type
`ExpressionVariable` from the new variable model. Some formal
parameters of procedures and types of fields are also adjusted to
accomodate for the change.
Part of https://github.com/dart-lang/sdk/issues/61572
Change-Id: Ic32bac325d0498f82b3b4da7fe800e999926c2d2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/485481
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Chloe Stefantsova <cstefantsova@google.com>
Previously, the onus was on the BytecodeGenerator to emit Nops in cases
where a source position may be overwritten by the next emitted
instruction.
Instead, change SourcePositions.add to return whether or not the
requested mapping would overwrite an existing one. With that,
Assembler.emitSourcePosition[ForCall] now emits Nop instructions if
needed to ensure that the requested source position is recorded.
TEST=pkg/vm_service/test/set_sdk_library_debuggable_test
Cq-Include-Trybots: luci.dart.try:vm-dyn-linux-debug-x64-try
Change-Id: Ieebef0b59dbee3c21e598acfc45c5b47a7c19543
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/484100
Commit-Queue: Tess Strickland <sstrickl@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Normally, bytecodes no longer in use would be renamed to Unused<X>.
However, in the case of DebugCheck, its only use was to call the
debugger when single stepping, and since its original creation, the
interpreter has been changed to call the debugger when single stepping
on every instruction. Thus, DebugCheck instructions are effectively
no-ops, only used as a distinct PC offset for source positions, and this
CL changes their name to reflect this.
This CL also changes the bytecode generator to detect uses of debugger()
from dart:developer and to add a Nop after it, mimicking how
StreamingFlowGraphBuilder recognizes uses of debugger() and adds a
DebugStepCheck instruction afterwards. Doing this instead of just
using asm.emitSourcePosition() at the end of visitStaticInvocation
ensures that the source position isn't overwritten by the next emitted
instruction.
TEST=pkg/vm_service/test/set_sdk_library_debuggable_test
Cq-Include-Trybots: luci.dart.try:vm-dyn-linux-debug-x64-try,vm-dyn-mac-debug-arm64-try
Change-Id: Ie24bcea0b5aeb9e41d7765f25b1cd123bb2565b4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/480203
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Tess Strickland <sstrickl@google.com>
In addition to passing in the libraries that should be visited to the
bytecode generator, also pass the libraries which are needed by the
component and either are not in the component or should not be visited
(e.g., libraries from the platform when the platform is not included).
This way, the bytecode generator can create appropriate LibraryIndexes
to detect the use of `dart:` libraries which aren't already in
VmTarget.extraIndexedLibraries, and thus in coreTypes.index (e.g.,
'dart:ffi').
TEST=pkg/dart2bytecode
Cq-Include-Trybots: luci.dart.try:vm-dyn-linux-debug-x64-try,vm-dyn-mac-debug-arm64-try
Change-Id: Ic08f2022753950bf639c446c0b2594e1e269872a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/476760
Commit-Queue: Tess Strickland <sstrickl@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
This CL does not yet remove the DebugCheck instruction from the
assembler/reader/interpreter and replace the DebugCheck opcode with
Unused##. Once the debugger fixups are complete without needing it,
then I'll remove that side of things.
Calls to _emitSourcePositions in the BytecodeGenerator have been
either replaced with asm.emitSourcePosition() or removed entirely
if the emit<Opcode> method in the assembler already calls
emitSourcePosition internally.
Cq-Include-Trybots: luci.dart.try:vm-dyn-linux-debug-x64-try,vm-dyn-mac-debug-arm64-try
Change-Id: Ibcb24da4a7b7a80c4d6ae56485cf33287a5aa68b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/474180
Commit-Queue: Tess Strickland <sstrickl@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reduces the usage of temps in the following cases to remove unneeded
StoreLocal/Push instructions:
Refactors visitVariableSet so that a temporary is used only if the
variable is captured and the result is not ignored. (That is,
sets of uncaptured late final fields no longer need a temporary.)
Only allocate a temp for FunctionDeclarations and FunctionExpressions
if there are function type arguments to capture or if the function
is generic (in which case the delayed type arguments field must be
empty-initialized, not null initialized).
-----
Clean up how source positions are emitted to both be more consistent
and to also move some source position emissions closer to the actual
instruction that performs the operation:
Move emission of debugging information for FunctionDeclaration,
and VariableSet to when the variable is actually set. The emission
in VariableDeclaration stays before the initializer as that's when
debugger tests expect to pause at it.
Change the implementation of _genConditionAndJumpIf to use if/else
chaining instead of early returns so that the condition's source
position can be recorded once before the if/then chain and then the
previous source position restored afterward the chain. This means
that _emitDebuggerInformation can be used.
_generateNonLocalControlTransfer is only called during visit methods
where the parent call to _generateNode has already recorded the from
node's position, so there's no need to record it during that call.
Instead, move the emission of the source position to the jump within the
passed continuation.
Remove _emitLocalSourcePosition, since it is no longer used.
Cq-Include-Trybots: luci.dart.try:vm-dyn-linux-debug-x64-try,vm-dyn-mac-debug-arm64-try
Change-Id: Id7722146769c57713ae466d67401258c010cee37
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/473380
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Tess Strickland <sstrickl@google.com>