Commit graph

16860 commits

Author SHA1 Message Date
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
Ryan Macnak 9a140bab87 [vm] Use acquire-release ordering to publish and consume the class table backing arrays.
Change-Id: I57a3109b3ba42e1addf97c15c5d8108cd0338266
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/139860
Reviewed-by: Alexander Aprelev <aam@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2020-03-18 17:18:55 +00:00
Regis Crelier a94fb21f08 [VM/nnbd] Fix normalization of FutureOr<T> after instantiation (fixes #41005).
Note that the remaining failure on line 28 of test
language/nnbd/type_equality/futureOr_normalization_legacy_test
is due to the CFE failing to normalize at compile time.

Change-Id: I8e982830f59cfa5cdf45314aa7a34026975ba952
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/139863
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Régis Crelier <regis@google.com>
2020-03-18 16:02:11 +00:00
Teagan Strickland 5f8802b82f [vm] Add sizes to ELF static symbols for Code payloads.
Change-Id: I7868ec621e08773b7d379e95fe091e820bf29c94
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/+/139807
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Commit-Queue: Teagan Strickland <sstrickl@google.com>
2020-03-18 10:23:36 +00:00
Ryan Macnak 6f5db9189b Revert "[vm] Fix CreateWithinExistingIsolateGroup calling RegisterIsolate without a write lock."
This reverts commit 5379edb62b.

Reason for revert: https://github.com/dart-lang/sdk/issues/41080

Original change's description:
> [vm] Fix CreateWithinExistingIsolateGroup calling RegisterIsolate without a write lock.
> 
> Detected by TSAN as a data race between the registration code and iteration code.
> 
> Bug: https://github.com/dart-lang/sdk/issues/39611
> Change-Id: Ic232e9382a775369ce5898f3c4e5a90e8c0160c0
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/139495
> Reviewed-by: Martin Kustermann <kustermann@google.com>
> Commit-Queue: Ryan Macnak <rmacnak@google.com>

TBR=kustermann@google.com,aam@google.com,rmacnak@google.com

Change-Id: I8b6f2b4152ca0e6979ea015561006f794d0e5510
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: https://github.com/dart-lang/sdk/issues/39611
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/139900
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2020-03-17 23:34:25 +00:00
Ryan Macnak 4ef342680b [vm] Fix data race installing into the SharedClassTable.
Bug: https://github.com/dart-lang/sdk/issues/39611
Change-Id: I391717a8f175f16a8286e6e8928aa5240bb28a90
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/139828
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2020-03-17 21:59:15 +00:00
Ben Konyi 31fdba6cec [ VM ] Fix issue where DartDev snapshot would not be found when Dart is installed with Brew
Brew uses symlinks to symlinks, and code to determine the directory of
the current Dart executable was assuming that only one level of
symlinking could occur. This change results in symlink evaluation being
performed until we find the absolute path of the executable.

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

Change-Id: Id7326f09e01383150a41754e71174400cc6ec6b8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/139781
Reviewed-by: Jaime Wren <jwren@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2020-03-17 20:16:25 +00:00
Martin Kustermann 933d8e913f [vm/compiler] Do not speculate operands to e kSmiCid if we know from interface target it cannot be a Smi
Hitting the assertion from the issue (see below) is innocent: It
informs us that we should avoid speculating operands to be Smis if we
actually know for sure the receiver cannot be a Smi (based on interface
target).

This particular case was hit on an instance call `a ^ b` where the interface
type tells us it is `boo.^` - so we shouldn't insert CheckedSmiOp.

There might be more cases where we insert CheckedSmiOp/CheckedSmiComparison
instructions where we shouldn't (because interface target tells us
receiver cannot be a Smi).
-> In debug mode we'll hit this assertion, so if the fuzzer finds more such
   cases, we should fix them one-by-one.

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

Change-Id: I55624f77b9edeece4d1334f1629ce5514cf3784a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/139812
Reviewed-by: Ben Konyi <bkonyi@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2020-03-17 19:59:05 +00:00
Martin Kustermann a67aac8c6a Re-land "[vm/tfa] Convert named and optional parameters to required parameters where possible."
When performing protobuf-aware treeshaking, we may generate a kernel
file which will later be used in conjunction with a non-transformed
platform kernel. In this case signature shaking is unsafe.

The original revision is in patchset 1.

This reverts commit b59dad38df.

Change-Id: I1a85e42f245fcdbd821fa1f07b2e9966b8c2d958
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/139100
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2020-03-17 19:54:05 +00:00
Martin Kustermann 1569b25fde [vm] Follow-up changes to process_fuchsia.cc
This is a follow-up to

 https://dart-review.googlesource.com/c/sdk/+/139640

Due to the lack of fuchsia builders on Dart CI this was only uncovered
by the roller.

Issue https://github.com/dart-lang/sdk/issues/41076

Change-Id: Ib2bb69aa3b6d1a12f79e544323a8bd3cefe496e0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/139810
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2020-03-17 18:26:50 +00:00
Martin Kustermann 8acd25a2e8 [vm/reload] Use CFEs Class::hasConstConstructor flag
The CFE has added this flag (on VM's request) in [0]. We can now use it
instead of our approximation of all fields are final (i.e. this is a
follow-up to [1])

[0] https://dart-review.googlesource.com/c/sdk/+/134292
[1] https://dart-review.googlesource.com/c/sdk/+/133228

Issue https://github.com/dart-lang/sdk/issues/40440

Change-Id: I3975ef84f29cd47d56b5a3211c649d42da654f53
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/139620
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2020-03-17 17:33:02 +00:00
Ryan Macnak 5379edb62b [vm] Fix CreateWithinExistingIsolateGroup calling RegisterIsolate without a write lock.
Detected by TSAN as a data race between the registration code and iteration code.

Bug: https://github.com/dart-lang/sdk/issues/39611
Change-Id: Ic232e9382a775369ce5898f3c4e5a90e8c0160c0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/139495
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2020-03-17 17:08:53 +00:00
Ryan Macnak b87a2bf9ae [vm] Remove an access to the Dart heap while in the kThreadInNative state.
TSAN reported this as a data race between the native resolution reading the resolver function when the compactor could move it.

Fix a similar pattern in reload.

Bug: https://github.com/dart-lang/sdk/issues/39611
Change-Id: Ia62a8201aacfe105697d4af6dc6724fbc513dbfc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/139540
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2020-03-17 17:03:31 +00:00
Martin Kustermann 7310377823 [vm/compiler] Tests, cleanups and fixes to Type Testing Stubs.
So far we relied on our normal Dart tests to exercise and test TTS.

This CL adds concrete TTS unit tests, which directly construct the
values the TTS accepts via the calling convention (instance,
dst_type, instantiator tav, function tav), and allows us to test

  * whether TTS handled the type test
  * whether TTS was falling back to STC which handled the type test
  * whether TTS (and STC) preserve the necessary registers

This CL also gets rid of TMP usage in TTS related code.

This CL also adds documentation about TTS to
runtime/docs/compiler/type_testing_stubs.md.

This CL also fixes two issues:

  * handle all-dynamic null vector `as Foo<..., T, ...>`
  * compare the actual type parameter value in `as Foo<..., T, ...>`
    (instead of using type_class_id>)

There seem to be no major performance changes, some benchmarks change
positive/negative but many of them seem to be bi-modal.

Issue https://github.com/dart-lang/sdk/issues/40964
Issue https://github.com/dart-lang/sdk/issues/40736

Change-Id: Iad41e405fe693c67be6221a18e3dad03cc0a5f24
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/139461
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Régis Crelier <regis@google.com>
2020-03-17 14:11:02 +00:00
Martin Kustermann 0ae869771a [vm] Avoid allocating Monitor/Mutex/... with global initializer, use Init()/Cleanup() functions instead
This CL adds a `dart::embedder::Cleanup()` (we already have `dart::embedder::InitOnce()`).
This allows us to allocate the global state and also tear it down.

As a side-effect this will also not allocate those variables if not
needed, which should fix b/151210948

Change-Id: I3c5c619586380bf27ee863ba026bbc631f243d85
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/139640
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2020-03-17 08:49:52 +00:00
Ryan Macnak 056bbd88f9 [vm, gc] Fix data races on Scavenger::external_size_.
Mutliple isolates can now concurrently allocate or delete weak handles in the same new-space.

Bug: https://github.com/dart-lang/sdk/issues/39611
Change-Id: I09f1668bcd887e9e7f84de51d1e268846e3725ca
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/139741
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2020-03-16 23:47:31 +00:00
Ryan Macnak 714b1d197f [vm] Fix flaky debug-mode crashes when GC happens while a mutator thread is descheduled.
A thread can exit an isolate while it still has Dart frames. The Dart frames must still be visited by the GC, but the dart::Thread is no longer associated with an dart::OSThread.

Add the PID to stack dumps to make it easier to match core dumps to stacks dumps.

Change-Id: Icb427ad99f4c0072d54b7c9516e922904403d1c1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/139747
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Régis Crelier <regis@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2020-03-16 23:46:01 +00:00
Simon Binder f9e67ea621 Fix observatory crash with null root uri of library
The observatory used to crash when viewing a library without a root uri,
because it attempts to view a script that doesn't exist. Now, we show a
message explaining that the library doesn't have a root script instead.

I also noticed that, for sources without file uris (which in my understanding
is legal in Kernel), the ScriptRefElement displays an empty link that
can't be clicked. Now we show some a fallback text.

Change-Id: I5f67d3a308eee44d2d05cc2427c5e75d6af89f18
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/139287
Auto-Submit: Simon Binder <simolus3@gmail.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2020-03-16 23:34:31 +00:00
Alexander Markov 70e5532795 [vm] Optimize phis and branches more extensively
Remove phis which have redefinitions of the same value in the arguments:

  v1 = ...
  v2 = Redefinition(v1)
  v3 = phi(v1, v2)

Also eliminate redundant branches after DCE and merge blocks after
branches are eliminated.

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

Change-Id: I9d4e6c8ed356ab185fee85678e45841d82357403
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/139602
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2020-03-16 22:19:46 +00:00
Regis Crelier 7953996d4c [VM/nnbd] Print non-nullable Object as bound in strong mode only.
Change-Id: I030ca9e1f8dd5f1a764ba83d7949fc596cbaded3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/139687
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Régis Crelier <regis@google.com>
2020-03-16 22:02:26 +00:00
Ben Konyi 2cfa00791a [ dart:http ] Update HTTP client request logging to use filterKey TimelineTask constructor
Change-Id: Id99e102c455fade1165f650a4bcc4f7589a7f398
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/139685
Reviewed-by: Kenzie Schmoll <kenzieschmoll@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2020-03-16 19:38:51 +00:00
Jason Simmons 704e8eae49 [build] Add the depfile as an output for gen_kernel_bytecode_dill
This will ensure that the depfile's directory is created before running
gen_kernel.

Change-Id: I82452b0161e533f31e1749f8e5894be7e58a6b4d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/139146
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Jason Simmons <jsimmons@google.com>
2020-03-16 18:23:58 +00:00
Ben Konyi 09f756b9a1 [ dart:developer ] Added filterKey optional parameter to TimelineTask constructors.
Providing `filterKey` will result in all timeline events associated with
the TimelineTask including a `filterKey` entry in their arguments map,
set to the value provided in the constructor. This will allow for a
consistent way for tooling to filter asynchronous timeline events.

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

Change-Id: I06d3f9c73f06c2ff0e495f1b6a57fcf357d625a8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/139312
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Kenzie Schmoll <kenzieschmoll@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
2020-03-16 18:04:58 +00:00
Dmitry Stefantsov 928f9fc932 [cfe] Remove flag --force-nnbd-checks
The checks are now always enabled for the "non-nullable" experiment

Closes #40980.

Bug: https://github.com/dart-lang/sdk/issues/40980
Change-Id: I32a141a93f0ba86ebdab554e1f312c2147927993
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/139440
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Dmitry Stefantsov <dmitryas@google.com>
2020-03-16 15:01:38 +00:00
Erik Ernst 330ec173a9 Add bool.hasEnvironment constructor and tests
Change-Id: I65ebfcb48bf46292d5ae611ecb7431e0666f753c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/139286
Reviewed-by: Martin Kustermann <kustermann@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Erik Ernst <eernst@google.com>
2020-03-16 11:17:58 +00:00