Commit Graph

16884 Commits

Author SHA1 Message Date
Ben Konyi a71449925a [ VM / DartDev ] Disable DartDev for the 2.8 release
Change-Id: I0b2d588599bee57b546c304b61c3edf1bc92f64c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/141020
Reviewed-by: Jaime Wren <jwren@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2020-03-26 16:50:23 +00:00
Siva Annamalai ba389f9061 Revert "[VM] - Delete non-nullable-flag() function and adjust code that was"
This reverts commit 1178f96600.

Reason for revert: "Gets an error VM initialization failed: To use --null-safety, please enable --enable-experiment=non-nullable"

Original change's description:
> [VM] - Delete non-nullable-flag() function and adjust code that was
>        using it.
> 
> Change-Id: Ibaf439fbef5e5e183f16240c4ee02b7031bc35c4
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/140882
> Commit-Queue: Siva Annamalai <asiva@google.com>
> Reviewed-by: Régis Crelier <regis@google.com>

TBR=kevmoo@google.com,asiva@google.com,regis@google.com

Change-Id: Ia651ec60f8ecfc82a305bcff855a6ca6c2ab9e27
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/141026
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Siva Annamalai <asiva@google.com>
2020-03-26 03:32:56 +00:00
Ryan Macnak bc53ecefae [vm] Don't try to include resume_capabilities, exit_listeners or error_listeners in snapshots.
Change-Id: I50ed4b5e0adbf98f157fec0905dfbb2ce38cd285
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/140942
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2020-03-25 23:12:47 +00:00
asiva 1178f96600 [VM] - Delete non-nullable-flag() function and adjust code that was
using it.

Change-Id: Ibaf439fbef5e5e183f16240c4ee02b7031bc35c4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/140882
Commit-Queue: Siva Annamalai <asiva@google.com>
Reviewed-by: Régis Crelier <regis@google.com>
2020-03-25 22:57:46 +00:00
Regis Crelier 33cafef25e [VM/nnbd] Do not check nullability of LHS too early in strong mode (fixes #41160).
Nullability of left hand side in type test was checked too early, i.e. before
handling FutureOr on the right hand side.

The following tests began passing (in strong mode):

standalone/io/addlatexhash_test was fixed (RuntimeError -> Pass)
standalone/io/file_output_stream_test was fixed (RuntimeError -> Pass)
standalone/io/file_stream_test was fixed (RuntimeError -> Pass)
standalone/io/file_system_async_links_test was fixed (RuntimeError -> Pass)
standalone/io/file_system_links_test was fixed (RuntimeError -> Pass)
standalone/io/file_write_only_test was fixed (RuntimeError -> Pass)
standalone/io/pipe_server_test/0 was fixed (RuntimeError -> Pass)
standalone/io/pipe_server_test/1 was fixed (RuntimeError -> Pass)
standalone/io/pipe_server_test/2 was fixed (RuntimeError -> Pass)
standalone/io/pipe_server_test/3 was fixed (RuntimeError -> Pass)
standalone/io/pipe_server_test/4 was fixed (RuntimeError -> Pass)
standalone/io/pipe_server_test/5 was fixed (RuntimeError -> Pass)
standalone/io/stream_pipe_test/0 was fixed (RuntimeError -> Pass)
standalone/io/stream_pipe_test/1 was fixed (RuntimeError -> Pass)
standalone/io/stream_pipe_test/2 was fixed (RuntimeError -> Pass)
standalone/io/stream_pipe_test/3 was fixed (RuntimeError -> Pass)

Change-Id: I855328f101382cf5f1af9119b396aa9d0cb14e40
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/140776
Commit-Queue: Régis Crelier <regis@google.com>
Reviewed-by: Liam Appelbe <liama@google.com>
2020-03-25 20:26:26 +00:00
Alexander Markov e0b7841d16 [vm/nnbd] Fix CompileType::IsAssignableTo for nullable types in strong mode
Also, tests/corelib/string_operations_with_null_test.dart is fixed for
strong mode: in strong mode TypeError is thrown when null is casted
to a non-nullable type; in weak mode null is silently passed and
ArgumentError or NoSuchMethodError is thrown.

Change-Id: I566a80293ffb03752cc3409e1b79491f0aff6888
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/140779
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2020-03-25 17:32:02 +00:00
Daco Harkes 55659b0372 [vm] Make our AOT pipeline work independent of the FLAG_precompiled_mode
Closes: https://github.com/dart-lang/sdk/issues/36521

Change-Id: I8f56d7bc9f3bfc7f4a6f0dcbee66f99838dde3cb
Cq-Include-Trybots: luci.dart.try:vm-kernel-precomp-linux-debug-x64-try,vm-kernel-linux-debug-x64-try,vm-kernel-linux-release-simarm-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/136622
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
2020-03-25 11:58:20 +00:00
Zichang Guo cd162ea78e fix Unix domain socket test failure
unix_domain_sockets_ is not initialized.
Fuzzing test fail the assertion when passing a null.

Bug: https://github.com/dart-lang/sdk/issues/41141
Change-Id: Ib50d31f4b63fbc253ba3c720d4c8d54483a24f88
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/140644
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Zichang Guo <zichangguo@google.com>
2020-03-25 05:01:10 +00:00
Lasse R.H. Nielsen 8760283247 New implementation of runZoned.
A combination of `runZoned` and `runZonedGuarded` where only the latter allows an `onError` parameter,
and only that has a nullable return type.

Retains the `onError` parameter on `runZoned` for now because it's too breaking to remove it until packages have been migrated off of it.
It will be removed in a follow-up CL.

Change-Id: If0e86c8d14e13fa089c66f4af975aeacb2616cf6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/137302
Reviewed-by: Jake Macdonald <jakemac@google.com>
Reviewed-by: Nate Bosch <nbosch@google.com>
2020-03-25 00:24:33 +00:00
Alexander Markov 8c4909aa8f [vm/nnbd] Mark static fields in opted-in libraries as late
According to the NNBD feature specification, "a toplevel or static
variable with an initializer is evaluated as if it was marked late".
This change actually marks all static fields in opted-in libraries
as late, in order to make sure that the rest of the VM handles
such fields uniformly as late.

Without this change implicit getters for such fields were generated
as late, but type propagation didn't treat these fields as nullable,
so field initialization checks were removed if field has a non-nullable
type.

Change-Id: I95bc096fb1d304b112369428dbb29d346964383f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/140767
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Régis Crelier <regis@google.com>
Reviewed-by: Liam Appelbe <liama@google.com>
2020-03-24 22:22:57 +00:00
Alexander Markov fa54a92970 [vm/nnbd] NNBD fixes for bytecode
* Take nullability of type parameters into account.
* Handle CheckNull instruction with null selector name.

Fixes https://github.com/dart-lang/sdk/issues/41162
Fixes https://github.com/dart-lang/sdk/issues/41163

Change-Id: I0ff4c2790ea63e8f23ead6c9f479b8806045f012
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/140800
Reviewed-by: Régis Crelier <regis@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2020-03-24 21:50:57 +00:00
Ryan Macnak 678ce14ba5 [vm] Remove data race initializing snapshot BSS.
The snapshot BSS may be initialized by multiple threads if multiple isolates run the same snapshot. The race is harmless because the initialization is idempotent, but use a CAS anyway to satisfy TSAN. Compare similar idempotent initialization in SharedClassTable.

Bug: https://github.com/dart-lang/sdk/issues/39611
Change-Id: If6e15de3c8b71bf3eb61f358dff9cddbe2830ae6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/140705
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2020-03-24 16:58:25 +00:00
Ryan Macnak 1d3a6f8be4 [vm] Delay registering an isolate until its main port has been setup.
Fixes a data race detected by TSAN between initializing the port and reading the port in RegisterIsolatesVisitor. A similar race would also exist with the VM service's getVM RPC.

Bug: https://github.com/dart-lang/sdk/issues/39611
Change-Id: I609bcdf4cca541f79032bff3f9bb4c1138527449
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/140706
Reviewed-by: Alexander Aprelev <aam@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2020-03-24 16:15:19 +00:00
Regis Crelier 0bc8474383 [VM/compiler] Cleanup ABIs for instantiation and type testing code and stubs.
Change-Id: Ifc211c98804fcaff5b7788f6823ea631d2867974
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/140441
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Régis Crelier <regis@google.com>
2020-03-24 15:54:39 +00:00
Erik Ernst e3af7e724f Update usage of int/String fromEnvironment
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>
2020-03-24 11:19:14 +00:00
Teagan Strickland 46b1f9dbf8 [gardening] Fix vm/dart/v8_snapshot_profile_writer test in Product mode.
Change-Id: Ic911950fb54bcc3a2116960b90012f1e50be04a8
Cq-Include-Trybots: luci.dart.try:vm-kernel-precomp-linux-product-x64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/140653
Commit-Queue: Teagan Strickland <sstrickl@google.com>
Reviewed-by: Clement Skau <cskau@google.com>
2020-03-24 10:07:10 +00:00
Johnni Winther 62f84880ef [cfe] Report error on missing return from non-nullable function
Closes #40520
Closes #40948
Closes #40425

Change-Id: I0aa3cfa51b410c90dd0bea963846eeb6b2e73efb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/140540
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2020-03-24 08:21:36 +00:00
Ryan Macnak b5d657c3f0 [vm] Fix memory leaks during ELF generation.
Change-Id: I8c7d5506a91a4e2190951e083438fee652b736ed
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/140371
Reviewed-by: Teagan Strickland <sstrickl@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2020-03-24 01:09:35 +00:00
Teagan Strickland 48ed5e5b0e [vm/aot] Fix disassembler bug in bare instructions mode.
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>
2020-03-23 23:32:35 +00:00
Vyacheslav Egorov 18bdb28ef6 [vm/profiler] On Android use alternative stack for handling SIGPROF.
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>
2020-03-23 21:49:37 +00:00
Ryan Macnak 13ec6ef5ff [vm] Address TSAN errors in FFI tests.
Bug: https://github.com/dart-lang/sdk/issues/39611
Change-Id: I34556155d1d20ab48af952ddc4fdb6959db960d5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/140250
Reviewed-by: Daco Harkes <dacoharkes@google.com>
2020-03-23 21:19:36 +00:00
Jason Simmons c58ad1fadf [dart:io] Fix Unix domain socket headers for Fuchsia
Change-Id: I053b41e29184f5edb3d4f19573ead5124528f12c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/140624
Reviewed-by: Zichang Guo <zichangguo@google.com>
Commit-Queue: Jason Simmons <jsimmons@google.com>
2020-03-23 20:35:47 +00:00
Teagan Strickland 34742535d6 [vm] Look up dynamic symbols in DWARF stack traces.
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>
2020-03-23 10:13:43 +00:00
Alexander Thomas 8350f423ee [vm] Add the channel name to the VM/dart:io version string
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>
2020-03-23 10:00:03 +00:00
Zichang Guo ed83a28d3e [dart:io] support Unix domain communications
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>
2020-03-23 03:51:40 +00:00
Ben Konyi fd37652c92 [ VM / Service ] Remove package:test timeout for VM service tests
Change-Id: I85b2c674c9ac8a7b67d0ae8d37e4ddd57092982b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/140482
Reviewed-by: Ben Konyi <bkonyi@google.com>
2020-03-21 18:39:36 +00:00
Ben Konyi f247613737 Reland "[ VM / Service ] Migrated Observatory service tests from package:unittest to package:test and package:expect."
This reverts commit 32ed244f63.

Reason for revert: Hopefully clear up bot failures

Original change's description:
> Revert "Reland "[ VM / Service ] Migrated Observatory service tests from package:unittest to package:test and package:expect.""
> 
> This reverts commit d03b7ea721.
> 
> Reason for revert: Hitting assert in VM (https://logs.chromium.org/logs/dart/buildbucket/cr-buildbucket.appspot.com/8885275470407956944/+/steps/test_results/0/logs/new_test_failures__logs_/0)
> 
> Original change's description:
> > Reland "[ VM / Service ] Migrated Observatory service tests from package:unittest to package:test and package:expect."
> > 
> > This reverts commit 01dc1756c4.
> > 
> > Change-Id: I1c9186947af2368ff48c02a392da9ced85770335
> > Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/140254
> > Commit-Queue: Ben Konyi <bkonyi@google.com>
> > Reviewed-by: Ryan Macnak <rmacnak@google.com>
> 
> TBR=bkonyi@google.com,rmacnak@google.com
> 
> Change-Id: I640adf8e96672476f46fc1f4580a7231b5cfd8fe
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/140379
> Reviewed-by: Ben Konyi <bkonyi@google.com>
> Commit-Queue: Ben Konyi <bkonyi@google.com>

TBR=bkonyi@google.com,rmacnak@google.com

Change-Id: I3127f2f39e64e87daa5ae0c02e14cd24cb586f5f
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/140480
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2020-03-21 06:28:36 +00:00
Ben Konyi 32ed244f63 Revert "Reland "[ VM / Service ] Migrated Observatory service tests from package:unittest to package:test and package:expect.""
This reverts commit d03b7ea721.

Reason for revert: Hitting assert in VM (https://logs.chromium.org/logs/dart/buildbucket/cr-buildbucket.appspot.com/8885275470407956944/+/steps/test_results/0/logs/new_test_failures__logs_/0)

Original change's description:
> Reland "[ VM / Service ] Migrated Observatory service tests from package:unittest to package:test and package:expect."
> 
> This reverts commit 01dc1756c4.
> 
> Change-Id: I1c9186947af2368ff48c02a392da9ced85770335
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/140254
> Commit-Queue: Ben Konyi <bkonyi@google.com>
> Reviewed-by: Ryan Macnak <rmacnak@google.com>

TBR=bkonyi@google.com,rmacnak@google.com

Change-Id: I640adf8e96672476f46fc1f4580a7231b5cfd8fe
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/140379
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2020-03-21 00:45:50 +00:00
Ben Konyi 94b8759eb1 Revert "[ Service ] Bump package:test timeout to 10 minutes for VM service tests"
This reverts commit 6b1139dc07.

Reason for revert: Reverting parent (https://dart-review.googlesource.com/c/sdk/+/140254)

Original change's description:
> [ Service ] Bump package:test timeout to 10 minutes for VM service tests
> 
> Change-Id: Ic1337aeec40f3fc6f7e781640cf7a1745c2f6d44
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/140374
> Reviewed-by: Siva Annamalai <asiva@google.com>

TBR=bkonyi@google.com,rmacnak@google.com,asiva@google.com

Change-Id: If441170655b133ceac82db4a7cb7cd8bf69496d9
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/140378
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2020-03-21 00:45:00 +00:00
Ryan Macnak bdb484ef42 [vm] Increase precision of MSAN unpoisoning during deopt.
Make DartAPI_ExternalByteDataFinalizer MSAN clean.

Change-Id: I90c952dec6e9aa4257a1481160395dc5ef6423fe
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/140362
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2020-03-21 00:36:09 +00:00
Ben Konyi 6b1139dc07 [ Service ] Bump package:test timeout to 10 minutes for VM service tests
Change-Id: Ic1337aeec40f3fc6f7e781640cf7a1745c2f6d44
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/140374
Reviewed-by: Siva Annamalai <asiva@google.com>
2020-03-20 23:32:41 +00:00
Ben Konyi d03b7ea721 Reland "[ VM / Service ] Migrated Observatory service tests from package:unittest to package:test and package:expect."
This reverts commit 01dc1756c4.

Change-Id: I1c9186947af2368ff48c02a392da9ced85770335
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/140254
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2020-03-20 20:16:56 +00:00
Jason Simmons 4f2cb5afbe [vm] Disable integer division on Android ARM emulators
Some Android ARM emulators claim support for idiv features in /proc/cpuinfo
but trigger a SIGILL when executing these instructions.

See https://github.com/flutter/flutter/issues/37193

Change-Id: Ie2a93df7a286a933190164bb31d6210c1658a260
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/140248
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2020-03-20 19:05:48 +00:00
Alexander Markov ae28b143b5 [vm/nnbd] Run kernel-service and vm-service isolates in NNBD weak mode
Also, add null-safety compatibility flag to snapshots with code.

Fixes https://github.com/dart-lang/sdk/issues/41085

Change-Id: I74d2ad6d4f0850b7cc64e082309a425c683a573c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/140240
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Régis Crelier <regis@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
2020-03-20 17:48:27 +00:00
Martin Kustermann 9dc2d8a817 [vm/compiler] Compiler::CompileFunction can no longer fallback to Precompiler::CompileFunction
Since constant evaluation moved out to the CFE we should no longer hit
thise code path.

Change-Id: Ifeec982f7c09b089e7bfd442f84ee32667b31ab6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/140281
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2020-03-20 15:00:19 +00:00
asiva 1bab476834 [VM/NNBD] - Make the null safety flag be isolate specific.
Change-Id: I73a1e8a22db770ca14af6d53707a335bbbcdabcb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/139029
Commit-Queue: Siva Annamalai <asiva@google.com>
Reviewed-by: Régis Crelier <regis@google.com>
2020-03-20 02:09:29 +00:00
Ben Konyi 01dc1756c4 Revert "[ VM / Service ] Migrated Observatory service tests from package:unittest to package:test and package:expect."
This reverts commit a4c6356df3.

Reason for revert: external_service_notification_invocation_test failing on at least AOT

Original change's description:
> [ VM / Service ] Migrated Observatory service tests from package:unittest to package:test and package:expect.
> 
> Tests which previously used 'expect' in the target process have been
> changed to use 'Expect.*' as 'package:test' throws an exception when
> using 'expect' outside of a 'test(...)' scope.
> 
> Change-Id: I4e031cafd19f294bfcb1deb6a253b42b4122e653
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/140160
> Commit-Queue: Ben Konyi <bkonyi@google.com>
> Reviewed-by: Ryan Macnak <rmacnak@google.com>

TBR=bkonyi@google.com,rmacnak@google.com,asiva@google.com

Change-Id: I242156e0868d6bd0a3b6d7f7db94c22001d5dbc4
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/140221
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2020-03-20 00:29:10 +00:00
Ben Konyi a4c6356df3 [ VM / Service ] Migrated Observatory service tests from package:unittest to package:test and package:expect.
Tests which previously used 'expect' in the target process have been
changed to use 'Expect.*' as 'package:test' throws an exception when
using 'expect' outside of a 'test(...)' scope.

Change-Id: I4e031cafd19f294bfcb1deb6a253b42b4122e653
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/140160
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2020-03-19 23:44:50 +00:00
Ryan Macnak 67def5685b [observatory] Prepare for the future signature of Object.==.
Change-Id: I74728f6c7aa673c7d7918c152be9b93594affa61
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/140006
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2020-03-19 23:41:21 +00:00
Leaf Petersen 7aace6fa60 Make StackTrace generally not nullable in migrated NNBD library.
Bug: https://github.com/dart-lang/sdk/issues/40130
Change-Id: I13aba0c2a3fa5b1c3d3995f075ffd38f03aca897
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/139880
Reviewed-by: Bob Nystrom <rnystrom@google.com>
2020-03-19 23:31:30 +00:00
Zichang Guo e91e09d1e4 Revert "[dart:io] Fix hanging on zero-length datagram"
This reverts commit c326c587c5.

Reason for revert: Analyzer and Co19 test is broken.

https://logs.chromium.org/logs/dart/buildbucket/cr-buildbucket.appspot.com/8885365974080167440/+/steps/test_results/0/logs/new_test_failures__logs_/0

https://logs.chromium.org/logs/dart/buildbucket/cr-buildbucket.appspot.com/8885364415750725248/+/steps/test_results/0/logs/new_test_failures__logs_/0

Original change's description:
> [dart:io] Fix hanging on zero-length datagram
> 
> This is observed on Win and Linux.
> Here is a doc to explain the problem: https://docs.google.com/document/d/1ZzyBUMrDHLU6vNryjgSMJfUruOdpmTImtE_s2E0J8IQ/edit?usp=sharing.
> 
> Bug: https://github.com/dart-lang/sdk/issues/39910
> Change-Id: Ia961239f45615f14108bcd66043ac33d9a0a4abe
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/137425
> Commit-Queue: Zichang Guo <zichangguo@google.com>
> Reviewed-by: Siva Annamalai <asiva@google.com>

TBR=sortie@google.com,lrn@google.com,zra@google.com,asiva@google.com,zichangguo@google.com

Change-Id: Id84a7cafbc14d6353fa6af8e294e8b0c751a969f
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: https://github.com/dart-lang/sdk/issues/39910
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/140009
Reviewed-by: Zichang Guo <zichangguo@google.com>
Commit-Queue: Zichang Guo <zichangguo@google.com>
2020-03-19 23:05:59 +00:00
Ryan Macnak 8fc486fb48 [observatory] Remove use of the default List constructor.
This constructor will be broken in Dart 3.

Change-Id: I8c11a862ba55bb1310d87c66e6ce5c3d85825b88
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/140004
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2020-03-19 22:11:39 +00:00
Liam Appelbe 347793ec70 [vm] Fix a bug in required param function subtyping
I missed an edge case in the subtyping rule. If the this function
has a required param, and the other function is entirely missing
that param, then we would mistakenly call that a valid subtype.

language/nnbd/required_named_parameters/required_named_args_strong_test
found the bug. This test is now passing in strong mode.

Bug: https://github.com/dart-lang/sdk/issues/40968
Change-Id: Ica13bcf4d287e13050f81652e07dcc40c155a801
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/140143
Commit-Queue: Liam Appelbe <liama@google.com>
Reviewed-by: Régis Crelier <regis@google.com>
2020-03-19 20:37:38 +00:00
Zichang Guo c326c587c5 [dart:io] Fix hanging on zero-length datagram
This is observed on Win and Linux.
Here is a doc to explain the problem: https://docs.google.com/document/d/1ZzyBUMrDHLU6vNryjgSMJfUruOdpmTImtE_s2E0J8IQ/edit?usp=sharing.

Bug: https://github.com/dart-lang/sdk/issues/39910
Change-Id: Ia961239f45615f14108bcd66043ac33d9a0a4abe
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/137425
Commit-Queue: Zichang Guo <zichangguo@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
2020-03-19 20:23:08 +00:00
Liam Appelbe 318b42572e [vm] Mark member signatures as not reflectable
This fixes some mirrors failures in NNBD legacy mode, since the CFE is
inserting more synthetic functions now, to handle interfacing between
libraries with different NNBD status.

Change-Id: Iad5cb2548ef118f842bf2eadf249d4dca9f38fa7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/139740
Commit-Queue: Liam Appelbe <liama@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2020-03-19 17:54:19 +00:00
Ryan Macnak 23792e7816 [vm] Require explicit loads and stores when using AcqRelAtomic.
Change-Id: I19d64667cea7dd735c3bf7194285383289019aaa
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/139942
Reviewed-by: Alexander Aprelev <aam@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2020-03-19 16:19:59 +00:00
Ryan Macnak a1563c2cb6 [vm] Fix data race on BackgroundCompiler::running_.
Bug: https://github.com/dart-lang/sdk/issues/39611
Change-Id: Ieab26d313790d0cda3503c6b6ac30f6c72a76f2b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/139958
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2020-03-19 16:07:59 +00:00
Regis Crelier eca06cd299 [VM/nnbd] Normalize FutureOr<T> when loading kernel file.
CFE does not always normalize FutureOr<T> eagerly, e.g. it does not normalize
FutureOr<Null> parsed in the source. However, it normalizes inference or
instantiation results.
For performance reasons, the VM chooses to do it eagerly, i.e. it must also
normalize unnormalized types from a kernel file.

Change-Id: I5798333ba3c58c5b2851045ef32c345d94f58268
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/139955
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Régis Crelier <regis@google.com>
2020-03-19 00:19:10 +00:00
Regis Crelier 4e75fc1609 [VM/nnbd] Use correct top type in inline code for is-test.
Instantiate with correct nullability and normalization in type testing stubs.

Change-Id: I24a74625d450e2ce1d9cdf23fbfdc1f9983ffdb1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/139951
Reviewed-by: Liam Appelbe <liama@google.com>
Commit-Queue: Régis Crelier <regis@google.com>
2020-03-18 23:26:00 +00:00
Ryan Macnak 5b21a43c55 Reland "[vm] Fix CreateWithinExistingIsolateGroup calling RegisterIsolate without a write lock."
Avoid deadlock by not holding the write lock to more than one isolate group at a time.

Bug: https://github.com/dart-lang/sdk/issues/39611
Bug: https://github.com/dart-lang/sdk/issues/41080
Change-Id: I229b2a30da0901c7798c3df89fdf2a9547aae557
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/139941
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2020-03-18 22:22:09 +00:00