Breaking change 40678 requires the constructors int.fromEnvironment and
String.fromEnvironment to get new default values for the named
parameter `defaultValue`. This CL changes usages of these constructors
such that they do not depend on the default value, such that it
becomes a non-breaking change for code in the SDK repo to perform the
change in sdk and in sdk_nnbd.
Change-Id: I82af0e1f92d6cd3618b65c0c50d754ae8c39eb0a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/140284
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>
Commit-Queue: Erik Ernst <eernst@google.com>
Fixes many of the test failures on the unfork WIP change
https://dart-review.googlesource.com/c/sdk/+/138902.
These packages should now build as expected regardless
of the experiment flag status.
Change-Id: I982daaec200bb25b6fd14753f3aac6975a4f09dd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/140704
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
These messages are created when a type check of a generic class fails
and were designed to help in the Dart 2.0 migration by suggesting a type
that would work. They should either be updated to suggest types
correctly in the presence of the Null Safety features, or be removed
entirely if they are no longer helpful.
Issue: https://github.com/dart-lang/sdk/issues/40326
Change-Id: Ic8ecc83cad534471a88a16baf22035d90b0336ca
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/140341
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
In bare instructions mode, we do not have a per-Code object pool,
but rather a global shared object pool. When generating instructions
that access the object pool, we use the index in the (eventually
created) global object pool.
Recently, when the V8 snapshot profile writer is active, we began
attaching an per-Code object pool so that each object in the global
object pool can be attributed to the Code objects that caused its
inclusion. This pool only has those objects attributable to this
Code object, and not all objects in the global pool up to the point
of compiling the Code object.
However, the disassembler currently only looks at whether the current
Code object has an object pool when decoding object pool accesses.
This was safe when there were no per-Code object pools in bare
instruction mode, but since the change described above, it attempts
to access the object in the Code-local pool at the same index as the
global pool and crashes.
This change fixes the disassembler so that we only try to decode the
object being accessed in the object pool when in non-bare instructions
mode.
Fixes https://github.com/dart-lang/sdk/issues/41149
Cq-Include-Trybots: luci.dart.try:vm-kernel-precomp-linux-release-x64-try,vm-kernel-precomp-linux-release-simarm_x64-try,vm-kernel-precomp-mac-release-simarm64-try,vm-kernel-precomp-win-release-x64-try
Change-Id: I96fd61d05c657a5ee1d86565cc39c83ebee587f1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/140603
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Commit-Queue: Teagan Strickland <sstrickl@google.com>
Bionic implementation of setjmp mangles[1] stack pointer - which means
it is unsafe to handle signals on the thread stack (see b/152210274).
Thread interrupter is constantly sending SIGPROF to the Dart thread -
which means with a small probability it might hit the case when we are
inside setjmp. If SP is mangled it might point to random writable memory
or to non-writable region. In the first case we will get a very obscure
memory corruption, and in the second case kernel would send us SIGSEGV
because it fails to deliver original signal.
This bug is the source of the numerous mysterious crashes reported for Flutter,
looking like this:
F/libc (11547): Fatal signal 11 (SIGSEGV), code 128, fault addr 0x0 in tid 11572 (1.ui), pid 11547 (ectivity_change)
...
signal 11 (SIGSEGV), code 128 (SI_KERNEL), fault addr 0x0
...
backtrace:
#00 pc 00018abc /system/lib/libc.so (sigsetjmp+120)
Note the following key points: SIGSEGV has code SI_KERNEL (meaning it
was triggered by kernel - rather than by a hardware fault) and the first
and only frame is inside sigsetjmp (unwinding is obviously also broken
because SP is mangled).
Fixes https://github.com/flutter/flutter/issues/27077
[1] https://android.googlesource.com/platform/bionic/+/refs/heads/master/libc/arch-x86/bionic/setjmp.S#132
Change-Id: I91afa42dbf6575db0cce8e223368b857a49b39b8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/140643
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
Related to DOM clobbering of previousSibling
Change-Id: Ib4ed1cdba4217c351804b0689a999b73713f79ed
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/140622
Auto-Submit: Kevin Moore <kevmoo@google.com>
Reviewed-by: Vijay Menon <vsm@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Migrated test caused a compiler error due to an added type declaration:
Error: The argument type 'Null? Function(dynamic, int)' can't be
assigned to the parameter type 'void Function(dynamic, dynamic)'.
Change-Id: I65541ddcf10eff18bd6013c07567835d87b0daab
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/140661
Reviewed-by: Bob Nystrom <rnystrom@google.com>
Commit-Queue: Riley Porter <rileyporter@google.com>
Code completion will now include void, dynamic and other class declaration keywords in the return type location, in the following snippet: '@override void someMethod(...) {}'
This is relatively common, this happens 103 times in the collection package.
Bug: https://github.com/dart-lang/sdk/issues/41039
Change-Id: I28129f2d735d2ff7d0a0e65194b7963c74b01c51
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/140360
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Jaime Wren <jwren@google.com>
This makes these checks useful in situations where you don't want to spend
an extra statement, like `=>` bodies or initializer lists (including
forwarding generative constructors).
Change-Id: Ia55b8741a7c75af631db48ac70e64597d8f96c73
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/135649
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Bob Nystrom <rnystrom@google.com>
The new version 0.16.1 does not use `fromEnvironment` constructors,
whereas the old version 0.15.7 does use it, and 0.15.7 uses it in a way
which requires updates in order to keep working when the breaking
change #40678 is landed.
Change-Id: I10cabc2d7799c448f7b42d88e24bb8406fcf0672
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/140604
Reviewed-by: Alexander Thomas <athom@google.com>
Commit-Queue: Erik Ernst <eernst@google.com>
This re-attempts dacd22bdc2
which was reverted in 1e9b55888f
Change-Id: I6c0bb1b7163b89bf64f54838749cdacca2b501bb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/140562
Auto-Submit: Kevin Moore <kevmoo@google.com>
Commit-Queue: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Bob Nystrom <rnystrom@google.com>
This reverts commit a0e4f0575a.
Reason for revert: Issues with hot restart in google3, see b/152181536.
Original change's description:
> Revert "Revert "[dartdevc] record metrics""
>
> Reland with fixes for internal build (patch set 2+)
>
> Change-Id: I5b130d020c9437a2c52dd074ad007e1fef7a8fa5
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/139241
> Commit-Queue: Vijay Menon <vsm@google.com>
> Reviewed-by: Sigmund Cherem <sigmund@google.com>
> Reviewed-by: Gary Roumanis <grouma@google.com>
TBR=vsm@google.com,sigmund@google.com,grouma@google.com
# Not skipping CQ checks because original CL landed > 1 day ago.
Change-Id: I012e1adaa405e85fd1a3d7d280b889b7df44e5b3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/140580
Reviewed-by: David Morgan <davidmorgan@google.com>
Commit-Queue: David Morgan <davidmorgan@google.com>
This is a bare-bones implementation (and test) for having an explicit
toString on all `Node`s.
This can then be extended as-needed to better suit our debugging
purposes. It's not allowed to leak, though.
Change-Id: I8d3f5a9cd13b292ed7a6bf33762e507286f3fa7d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/139805
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
If lookup succeeds, then the DWARF stack frame uses the symbol
name and offset instead of the dynamic library name. The
native_stack_traces package (once updated) can translate these
stack frames into symbolic stack frames even if given a partial
stack trace without the header.
Also, consistently use uword instead of a mix of uintptr_t and uword.
Change-Id: Ida9ba4726a306fb77b141cb9c6ad635a12a320ec
Cq-Include-Trybots: luci.dart.try:vm-kernel-precomp-linux-release-x64-try,vm-kernel-precomp-linux-release-simarm_x64-try,vm-kernel-precomp-mac-release-simarm64-try,vm-kernel-precomp-win-release-x64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/140282
Commit-Queue: Teagan Strickland <sstrickl@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Dev and beta version strings will look very look very similar, so adding
the channel name will make it easy for users to see if they are on be,
dev, beta, or stable. This will change both the output of
`dart --version` as well as the value of `Platform.version`.
This also removes the Flutter stable release version hack.
Fixes https://github.com/dart-lang/sdk/issues/40993
Change-Id: Iceb8e84a9cf4d0bfb7659669878e42d0a59febc4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/140287
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Alexander Thomas <athom@google.com>
Support Unix domain sockets communication on Linux, MacOS and Android.
Changes:
1. Add a field for InternetAddressType named unix.
2. Constructor of InternetAddress gains one more optional field: type. InternetAddress(String address, {InternetAddressType type});
3. Add another constructor to InternetAddress which taks raw address/path for ip/unix addresses as an argument. InternetAddress.fromRawAddress(Uint8List rawAddress, {InternetAddressType type});
The operation for unix domain sockets communication is basically the same as normal sockets except an InternetAddress with type unix should be passed.
Change-Id: I6a1135bbdd7f4e4fc745ccf8f95dec5272b6839b
Bug: https://github.com/dart-lang/sdk/issues/21403
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/125932
Commit-Queue: Zichang Guo <zichangguo@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
I saw crashes because of this internally, mostly around ListLiteral
resolution (which were arguments of method invocations), and left
unresolved.
Change-Id: I814a7ac6cb4bfdffff701a8ed51b80849cedb82c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/140483
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>