This is a breaking change. https://github.com/dart-lang/sdk/issues/40483
The Process class will now throw a StateError if the process is detached
upon accessing the exitCode getter. It now also throws when not
connected to the child process's stdio upon accessing the stdin, stdout,
and stderr getters. Previously these getters would all return null.
The getters in question are meaningless for detached processes and there
is no reason to use them in that case. To provide a better experience
when Dart becomes null-safe, these getters are changed to throw and
never return null, which avoids all legitimate uses of the getters from
needing a null check that will never fail.
The NNBD migration required making subtle changes to some dart:io
semantics in order to provide a better API. This change backports one of
these semantic changes to the unmigrated SDK so any issues can be
discovered now instead of blocking the future SDK unfork.
Change-Id: I776e0dc8bcd517d70332c60dd8ab88db17746aa5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134329
Commit-Queue: Jonas Termansen <sortie@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
This reduces the instructions sizes of the Flutter benchmarks by between
0.22% and 0.36% (0.24% for Flutter Gallery) and the total sizes by
between 0.15% and 0.23% (0.15% for Flutter Gallery).
Change-Id: I69c0551883d31afcbaad0f592aafcd3115ecb347
Cq-Do-Not-Cancel-Tryjobs: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/135904
Commit-Queue: Aske Simon Christensen <askesc@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
This makes the register available for the global dispatch table.
Change-Id: Ic77974a1c3e46395b2f8bab6e117187163972221
Cq-Do-Not-Cancel-Tryjobs: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134724
Reviewed-by: Martin Kustermann <kustermann@google.com>
In the legacy SDK these two methods in ListMixin take Object, not E.
When I migrated them to NNBD, I changed them to E to match the
declaration of the methods in List. This was an unintended breaking
change.
Fix that by changing them to "Object?", which is the NNBD equivalent of
the declarations in the legacy SDK.
Change-Id: I2a75e9f26a8198e4f51cb32a55055d5e64a69ed1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/136412
Reviewed-by: Srujan Gaddam <srujzs@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Auto-Submit: Bob Nystrom <rnystrom@google.com>
Fixes tests/language_2/subtyping_static/future_or_subtype_test
Also simplifies code making use of TypeAtNullSafe().
Change-Id: I045a030b2ece9d6980f7a9ba785948f0c10f697b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/135625
Commit-Queue: Régis Crelier <regis@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Updated to keep up with changes to available declarations.
Change-Id: I80405f396e4946ebae93bc9501a68855d45dd3fd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/136540
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
This CL fix an assertion inside Serializer::WriteInstructions
that was always failing in debug mode AOT 32-bit platforms
which used to happen when Utils::IsUint was called with a
signed type value was being passed.
It also fixes a bug that happens on some architectures that do not
support atomic unaligned load operations of 64-bit values.
Change-Id: Ic26cdeabccb55fcda5257da00f13dc400fa37e9a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/136228
Commit-Queue: Victor Agnez Lima <victoragnez@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Several method bodies did not return a value conditionally or at all.
Change-Id: I01ca87e2e0501597bacb49bcddd10668b59026b0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/135626
Commit-Queue: Srujan Gaddam <srujzs@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Since deleted code is shown in red in the preview tool (rather than
being deleted), we should only look at insertions when computing the
offsets for applying navigation links to the preview text.
Fixes a bug wherein a large block of deleted text near the top of a
file would cause a crash due to a bogus negative offset.
Change-Id: I704b2cecaf4b93eeb91f16d9bd5890ad3e3080e3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/136403
Reviewed-by: Mike Fairhurst <mfairhurst@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
Differentiate between class references and constructor references when
the class name comes first.
Start gathering data for general cases (start of expression, start of
statement) to determine whether we need fine-grained handling based on
the context or whether all expressions (for example) follow the same
distribution.
Change-Id: Iec403474aa19a3468fd15c0b90ec26392bf040f8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/136440
Reviewed-by: Jaime Wren <jwren@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Usually when migration removes dead code it can just delete it
(e.g. because it's removing a statement from a block and blocks can
contain any number of statements). However, in certain contexts dead
code must be replaced with something else, such as an empty statement.
Change-Id: I65faf017897215d750395dc78a2bf8a157d8dce0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/136441
Reviewed-by: Janice Collins <jcollins@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
The postmortem output is currently only generated if the static
constant NullabilityMigrationImpl._postmortemPath is non-null. The
generated file can be analyzed using
pkg/nnbd_migration/tool/postmortem.dart.
Change-Id: Ic5bf7aecc4176306839c00237eed668c2cd42571
Bug: https://github.com/dart-lang/sdk/issues/40624
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/136003
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Mike Fairhurst <mfairhurst@google.com>
Just mechanical movement of methods.
Change-Id: Ieb62190d2d531652b50cd233145f3dea22c00d97
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/136302
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Need for this was discovered while landing shared heap.
Change-Id: I95a27a5b8de51f94289ff67e2844279c189ea6c3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/135584
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
This reverts commit 34447c8dbb.
Reason for revert: Last Dart_AllocateWithNativeFields usage removed in Tonic
Original change's description:
> Revert "[ VM ] Removed Dart_Allocate, Dart_AllocateWithNativeFields, and Dart_InvokeConstructor from embedding API"
>
> This reverts commit 3d1b8b26c2.
>
> Reason for revert: Broke Flutter HHH. Dart_AllocateWithNativeFields is still used in Tonic.
>
> Original change's description:
> > [ VM ] Removed Dart_Allocate, Dart_AllocateWithNativeFields, and Dart_InvokeConstructor from embedding API
> >
> > These methods are no longer necessary and all objects should be created
> > using Dart_New instead.
> >
> > Change-Id: If64d3e3579fc03dd1a2eb6bfec73c35e90c66d8f
> > Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/135523
> > Reviewed-by: Ryan Macnak <rmacnak@google.com>
>
> TBR=bkonyi@google.com,rmacnak@google.com,asiva@google.com
>
> Change-Id: I3dca62a1db60a90bbcc78c34ae150df628cd85c8
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/135642
> Reviewed-by: Clement Skau <cskau@google.com>
> Commit-Queue: Clement Skau <cskau@google.com>
TBR=bkonyi@google.com,rmacnak@google.com,asiva@google.com,cskau@google.com
# Not skipping CQ checks because original CL landed > 1 day ago.
Change-Id: I2ac83e1bfccccd9b626acfa4a6ac517b4f3968fb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/136020
Auto-Submit: Ben Konyi <bkonyi@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>