Commit Graph

585 Commits

Author SHA1 Message Date
Michael Thomsen 8d65076f18 Change terms to be more divisive
Based on guidance in https://developers.google.com/style/

Related to https://github.com/dart-lang/sdk/issues/42247

Change-Id: Ia4edb2cb0540781f1119c369406a7b65553e26f6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/150632
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Michael Thomsen <mit@google.com>
2020-06-10 17:14:37 +00:00
Zichang Guo ae789e2cf8 Reland "[dart:io] Fixes the FileIO performance regression"
This is a reland of ba25fd190e

Original change's description:
> [dart:io] Fixes the FileIO performance regression
> 
> Previous CL (https://dart-review.googlesource.com/c/sdk/+/139881) causes
> performance regression.
> 
> Improves:
> FileIO_readwrite_512kb: 196.5%, 224.1%
> FileIO_readwrite_verify_512kb: 38.28% 46.71%
> 
> 
> Change-Id: I5fb7752f14a2b39238e82bf45b059fe145b9087f
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/148563
> Commit-Queue: Zichang Guo <zichangguo@google.com>
> Reviewed-by: Martin Kustermann <kustermann@google.com>
> Reviewed-by: Jonas Termansen <sortie@google.com>

Change-Id: I86d4919716ac3a333000482e4a96532fe4e7d543
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/149882
Commit-Queue: Zichang Guo <zichangguo@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2020-06-09 05:31:44 +00:00
Zichang Guo 391d3bcdd8 File::Copy avoids direct copying on Windows
There is a race condition for copying file on Windows, where CopyFile()
returns success but data has not been populated into destination file.
E.g process is killed or died in the middle.

This cl will change File::Copy as
1. Copy file to a temp file in the same directory of destination file.
2. Rename the file to the target file.

Bug: https://github.com/dart-lang/sdk/issues/42119
Change-Id: I39b6d451f6ace970bc554501148259d33de232c7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/149667
Commit-Queue: Zichang Guo <zichangguo@google.com>
Reviewed-by: Zach Anderson <zra@google.com>
2020-06-09 00:03:05 +00:00
Zichang Guo 7112027a9d Unlink file before Unix socket binds
Previously, an unix domain socket will be cleaned up within Socket's
finalizer. But if processes are killed, the file(socket) will remain and
prevent following bind().

Throw an exception when the file exists and no
active sockets has the same path.

Closes https://github.com/dart-lang/sdk/issues/42103
Change-Id: Ieb04b9e1b197064531ab6361c027b374c3d44411
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/149081
Commit-Queue: Zichang Guo <zichangguo@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
2020-06-03 22:10:40 +00:00
Zichang Guo 4489805956 Revert "[dart:io] Fixes the FileIO performance regression"
This reverts commit ba25fd190e.

Reason for revert: It broke dart2js. https://logs.chromium.org/logs/dart/buildbucket/cr-buildbucket.appspot.com/8878578963299042720/+/steps/build_dart/0/stdout?format=raw.
Unimplemented handling of missing static target.

Original change's description:
> [dart:io] Fixes the FileIO performance regression
> 
> Previous CL (https://dart-review.googlesource.com/c/sdk/+/139881) causes
> performance regression.
> 
> Improves:
> FileIO_readwrite_512kb: 196.5%, 224.1%
> FileIO_readwrite_verify_512kb: 38.28% 46.71%
> 
> 
> Change-Id: I5fb7752f14a2b39238e82bf45b059fe145b9087f
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/148563
> Commit-Queue: Zichang Guo <zichangguo@google.com>
> Reviewed-by: Martin Kustermann <kustermann@google.com>
> Reviewed-by: Jonas Termansen <sortie@google.com>

TBR=sortie@google.com,kustermann@google.com,zichangguo@google.com

Change-Id: I170eeed56484f2ece3c3b7f1b93f54edf5ae2736
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/149743
Reviewed-by: Zichang Guo <zichangguo@google.com>
Commit-Queue: Zichang Guo <zichangguo@google.com>
2020-06-02 19:14:05 +00:00
Zichang Guo ba25fd190e [dart:io] Fixes the FileIO performance regression
Previous CL (https://dart-review.googlesource.com/c/sdk/+/139881) causes
performance regression.

Improves:
FileIO_readwrite_512kb: 196.5%, 224.1%
FileIO_readwrite_verify_512kb: 38.28% 46.71%


Change-Id: I5fb7752f14a2b39238e82bf45b059fe145b9087f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/148563
Commit-Queue: Zichang Guo <zichangguo@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Reviewed-by: Jonas Termansen <sortie@google.com>
2020-06-02 17:47:05 +00:00
Tess Strickland 826576dcfc [vm] Store relocated addresses for text sections in BSS.
The relocated addresses are populated during BSS::Initialize() for
natively loaded ELF snapshots, and during the non-native loader when it
is used. Putting this information in the BSS segment avoids having to
change the embedder interface, since we only need this information for
AOT snapshots. This also avoids depending on our ELF snapshot layout
to reverse-engineer the DSO base for ELF-compiled snapshots.

We now always print the DSO base for both the VM and isolate in
non-symbolic stack traces, not just for ELF-compiled snapshots. However,
we still only print the relocated addresses in individual stack frames
if we're guaranteed they match those in separately saved debugging
information.

Bug: https://github.com/dart-lang/sdk/issues/41880

Cq-Include-Trybots: luci.dart.try:vm-kernel-precomp-linux-release-x64-try,vm-kernel-precomp-linux-product-x64-try,vm-kernel-precomp-linux-debug-x64-try,vm-kernel-precomp-win-release-x64-try,vm-kernel-precomp-mac-release-simarm64-try
Change-Id: I4837262f78e6e73a32eb7e24ef7a68ccb8ec2669
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/148441
Commit-Queue: Tess Strickland <sstrickl@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2020-05-26 08:47:30 +00:00
Ben Konyi 65113fd73d Reland "[ VM / DartDev ] Fix issue where EXEUtils returned a relative directory path instead of an absolute path"
This reverts commit c0976b6037.

Change-Id: I17e9b3087ba1e65bf64053011200e4df43c90a44
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/148943
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2020-05-22 01:55:52 +00:00
Ben Konyi c0976b6037 Revert "[ VM / DartDev ] Fix issue where EXEUtils returned a relative directory path instead of an absolute path"
This reverts commit af5ad5f1b0.

Reason for revert: Failing Windows bots.

Original change's description:
> [ VM / DartDev ] Fix issue where EXEUtils returned a relative directory path instead of an absolute path
> 
> This was causing the DartDev snapshot discovery to fail for brew
> installs as the last symlink resolved to '../libexec/bin/dart' which
> meant that we were looking for the snapshot at
> '../libexec/bin/snapshots/dartdev.dart.snapshot'.
> `
> 
> Change-Id: Ic68bfa13ba060f7a059d07e25c04076583b0b118
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/148542
> Commit-Queue: Ben Konyi <bkonyi@google.com>
> Reviewed-by: Siva Annamalai <asiva@google.com>

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

Change-Id: I55d3102e87c4cc522bac3a55421ed85f22f97035
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/148745
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2020-05-20 19:36:42 +00:00
Ben Konyi af5ad5f1b0 [ VM / DartDev ] Fix issue where EXEUtils returned a relative directory path instead of an absolute path
This was causing the DartDev snapshot discovery to fail for brew
installs as the last symlink resolved to '../libexec/bin/dart' which
meant that we were looking for the snapshot at
'../libexec/bin/snapshots/dartdev.dart.snapshot'.
`

Change-Id: Ic68bfa13ba060f7a059d07e25c04076583b0b118
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/148542
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
2020-05-20 18:59:05 +00:00
Zichang Guo cdc98a045f [dart:io] Support abstract unix domain socket on Linux
Abstract unix domain socket(UDS) is not supported on platforms other
than Linux/Android. So it has not been supported in the initial design.

This cl will enable users to use abstract UDS.

As long as InternetAddress has a path starting with '@', it will be
interpreted as abstract UDS on Linux/Android.

For abstract UDS, checkout unix man page for more information.

Bug: https://b.corp.google.com/issues/156871566

Change-Id: I393d798b2fc65304677a60639223f90e20aabaa3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/148380
Commit-Queue: Zichang Guo <zichangguo@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
2020-05-19 21:33:10 +00:00
Zichang Guo efabc6f848 [dart:io] Fixes _HttpHeaders forcing lowercased Header fields.
Outgoing HttpHeaders will use _build() to build headers. This cl make
_build() uses case-sensitive HttpHeaders.

Original change's description:
> [dart:io] Preserve header case in http header _builds()
>
> Bug: https://github.com/dart-lang/sdk/issues/33501
> Change-Id: I57d9bba251b76314bf40b81d1b09bd4643dce4d2
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/141911
> Commit-Queue: Zichang Guo <zichangguo@google.com>
> Reviewed-by: Siva Annamalai <asiva@google.com>
> Reviewed-by: Jonas Termansen <sortie@google.com>

Bug: https://github.com/dart-lang/sdk/issues/33501
Change-Id: I2d42351b9593d86ad1b2ea248faaea625d321e96
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/143081
Commit-Queue: Zichang Guo <zichangguo@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
2020-05-19 19:24:08 +00:00
Zichang Guo 8fb7471017 [dart:io] Reset _connecting when socket connects failed
_connecting doesn't get updated when socket connects failed, which will
block all following connect() from the same HttpClient().

Bug: https://github.com/dart-lang/sdk/issues/34477
Change-Id: I9c24a75efb5ef90b2dc1af65b9efb8ed45a71699
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/147688
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Zichang Guo <zichangguo@google.com>
2020-05-18 19:39:07 +00:00
Jonas Termansen 2676764792 [dart:io] Fix late localAddress initialization in non-socket errors.
An oversight was made in the dart:io null safety migration where it
wasn't noticed that errors on non-TCP/non-UDP native sockets would read
the late localAddress field that would never be initialized. This
condition can happen for e.g. pipes to other processes where an error
would cause a LateInitializationError instead of a SocketException.

This changelist fixes the problem by making sure the field is never read
except on TCP and UDP sockets, and furthermore statically ensures the
field is always initialized for TCP and UDP sockets.

A regression test is added to reproduce the problem and to confirm it is
indeed fixed by this changelist.

Bug: https://github.com/flutter/flutter/issues/57125
Change-Id: I18f65d94d905d2990afc72e33ce25bda8211606e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/148063
Commit-Queue: Jonas Termansen <sortie@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
2020-05-14 12:41:27 +00:00
Zichang Guo 9a60982089 [dart:io] serialize UnmodifiableListView to Uint8List for file write
Bug: https://github.com/dart-lang/sdk/issues/41029
Change-Id: I5902f01a22787922439f0918b6e845eb004b8984
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/139881
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Zichang Guo <zichangguo@google.com>
2020-05-12 00:19:01 +00:00
Ben Konyi acf7b4bc1d Update comments in snapshot_fail_test
Change-Id: I3ff794dcf88d96931cec75b6b8b8ce8742eed3e3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/146693
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2020-05-05 23:44:12 +00:00
Zichang Guo 4549484390 [dart:io] tests http parsing decoding latin1
Closes https://github.com/dart-lang/sdk/issues/41706

Change-Id: Icde8046b40bb3f77b015a61478b8ef6f94f5870c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/145500
Commit-Queue: Zichang Guo <zichangguo@google.com>
Reviewed-by: Jonas Termansen <sortie@google.com>
2020-05-05 20:32:03 +00:00
Ben Konyi 918eae3e5e Reland "[ dartdev / DDS ] Spawn a Dart Development Service instance when running with --observe via dartdev"
This reverts commit 798b6e7c8d.

Change-Id: I5af5eb126d83d8f67b18d5159ead0a276665034e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/146661
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2020-05-05 18:48:58 +00:00
Lasse Reichstein Holst Nielsen 7bb38670d2 Don't run tests depending on member names when obfuscated.
Bug: http://dartbug.com/41771
Change-Id: I1f4a7d4900e225ca05bb445db0e22e85a71f8723
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/146582
Reviewed-by: Tess Strickland <sstrickl@google.com>
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
2020-05-05 12:46:54 +00:00
Lasse Reichstein Holst Nielsen 2ca3555c44 Allow NoSuchMethodError.withInvocation to accept any Invocation.
Currently the VM only accepts an `_InvocationMirror` instance, not a user created `Invocation`.

Fixes #33124

Bug: http://dartbug.com/33124
Change-Id: Ifdc95861cbe632bc317ca8d9fb92cf0d3ae600f0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/140100
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
2020-05-05 08:10:13 +00:00
Nate Bosch 420f50a392 Remove tests for addresses with leading 0s
Closes #41727

These are invalid on linux, but treated as valid on mac.

Change-Id: I0ccee97048b163f419ad88f8cfcd3d5cde427ea9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/145641
Commit-Queue: Nate Bosch <nbosch@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Auto-Submit: Nate Bosch <nbosch@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2020-04-30 19:30:02 +00:00
Nate Bosch 9b34bee90b Add InternetAddress.tryParse
Closes #40692

Allows a better pattern for parsing user input than catching an
`ArgumentError`.

- Add a new static method to InternetAddress and implement it in all
  patch files.
- Add tests which match the tests for the constructor.

Change-Id: Idc76fc4875578f7a381219c0e7e12d1931d98fd8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/136406
Commit-Queue: Nate Bosch <nbosch@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Auto-Submit: Nate Bosch <nbosch@google.com>
2020-04-30 17:19:02 +00:00
Konstantin Shcheglov 8990c063b7 Issue 41603. await voidExpression is an error.
Bug: https://github.com/dart-lang/sdk/issues/41603
Change-Id: I6cbd8938c62e7f5f60e48e0ee65b80f4924a3a65
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/144681
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2020-04-24 03:42:52 +00:00
Zichang Guo 913cf2583e Revert "[dart:io] Fixes Ping/Pong mechanism not updating readyState when closing"
This reverts commit ac5b24123d.

Reason for revert: Tests are hanging on Windows. https://logs.chromium.org/logs/dart/buildbucket/cr-buildbucket.appspot.com/8882288664919412608/+/steps/test_results/0/logs/new_test_failures__logs_/0

Original change's description:
> [dart:io] Fixes Ping/Pong mechanism not updating readyState when closing
> 
> Bug: https://github.com/dart-lang/sdk/issues/33362
> Change-Id: Icf21ad5c9b66c4176ec65e018f9499b24690ed2c
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/143890
> Commit-Queue: Zichang Guo <zichangguo@google.com>
> Reviewed-by: Jonas Termansen <sortie@google.com>

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

Change-Id: I6f32f4a5bf29d949f26381394ce16e103e715c65
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: https://github.com/dart-lang/sdk/issues/33362
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/144490
Reviewed-by: Zichang Guo <zichangguo@google.com>
Commit-Queue: Zichang Guo <zichangguo@google.com>
2020-04-22 21:28:11 +00:00
Zichang Guo ac5b24123d [dart:io] Fixes Ping/Pong mechanism not updating readyState when closing
Bug: https://github.com/dart-lang/sdk/issues/33362
Change-Id: Icf21ad5c9b66c4176ec65e018f9499b24690ed2c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/143890
Commit-Queue: Zichang Guo <zichangguo@google.com>
Reviewed-by: Jonas Termansen <sortie@google.com>
2020-04-22 20:12:59 +00:00
Siva Annamalai af4330d382 Revert "[tests] rewrite and format several tests on http"
This reverts commit e35120cfd1.

Reason for revert: This CL caused some breakages in the bot.

Original change's description:
> [tests] rewrite and format several tests on http
> 
> Resolve comments in previous cls.
> https://dart-review.googlesource.com/c/sdk/+/140564
> https://dart-review.googlesource.com/c/sdk/+/136322
> https://dart-review.googlesource.com/c/sdk/+/138860
> 
> Change-Id: I9549019fe871f35187af5ff75df320748792498b
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/141845
> Commit-Queue: Zichang Guo <zichangguo@google.com>
> Reviewed-by: Jonas Termansen <sortie@google.com>

TBR=sortie@google.com,rmacnak@google.com,zichangguo@google.com

Change-Id: I1ae183dcc4b202b7b1e21d30a1407f9b038791ba
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/144306
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Siva Annamalai <asiva@google.com>
2020-04-22 03:27:36 +00:00
Zichang Guo e35120cfd1 [tests] rewrite and format several tests on http
Resolve comments in previous cls.
https://dart-review.googlesource.com/c/sdk/+/140564
https://dart-review.googlesource.com/c/sdk/+/136322
https://dart-review.googlesource.com/c/sdk/+/138860

Change-Id: I9549019fe871f35187af5ff75df320748792498b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/141845
Commit-Queue: Zichang Guo <zichangguo@google.com>
Reviewed-by: Jonas Termansen <sortie@google.com>
2020-04-21 21:41:08 +00:00
Ben Konyi de6cfe7e15 [ VM ] Fixed issue where resolving symlinks while trying to get the executable directory path would fail resulting in a "No such file" error
As part of adding support for brew installations, a bug was introduced
which resulted in the executable directory path not being resolved
correctly if the process was launched via a symlink. This resulted in
the script path passed to the CFE not being fully qualified relative to
the executable location which would cause lookup failures for relative
script paths.

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

Change-Id: I31813ccbc024eb0e4dd6dc265986ba3aefd9898e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/144005
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
2020-04-21 00:09:04 +00:00
Zichang Guo 18bf8c3560 [dart:io] Fix empty Process.run arguments on Windows
Closes https://github.com/dart-lang/sdk/issues/40060
Change-Id: I3d8c15efea3b24a628846b090701ffd245f09651
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/143700
Commit-Queue: Zichang Guo <zichangguo@google.com>
Reviewed-by: Jonas Termansen <sortie@google.com>
2020-04-17 20:12:54 +00:00
Ben Konyi dc9f500960 Reland "[ VM / DartDev ] Fixed issue where trying to find the directory of the Dart executable would fail if we encountered a relative symlink while trying to determine the absolute path."
This reland contains fixes related to: https://github.com/dart-lang/sdk/issues/41329

This reverts commit 05e43cff92.

Fixes: https://github.com/dart-lang/sdk/issues/41329
Change-Id: I1abef994cf6ffbac7e5c6bddd6de15f4f53535ab
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/142440
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
2020-04-13 21:11:52 +00:00
Ryan Macnak 4978dcc928 Reland "[vm, gc] Parallel scavenge."
Fix ScavengeVisitorBase::HasWork to account for undone allocations.

Bug: b/153524644
Change-Id: Ifc30017a411c5b65716d4e38752f2edeeb80a77e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/142908
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
2020-04-10 19:27:04 +00:00
David Morgan fb0902a05d Revert "[dart:io] Preserve header case in http header _builds()"
This reverts commit af19f9638d.

Reason for revert: Breaks package:shelf tests.

Original change's description:
> [dart:io] Preserve header case in http header _builds()
> 
> Bug: https://github.com/dart-lang/sdk/issues/33501
> Change-Id: I57d9bba251b76314bf40b81d1b09bd4643dce4d2
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/141911
> Commit-Queue: Zichang Guo <zichangguo@google.com>
> Reviewed-by: Siva Annamalai <asiva@google.com>
> Reviewed-by: Jonas Termansen <sortie@google.com>

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

Change-Id: I9c0418a256cb53e415ed0d5aeab84c4b0b4a161d
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: https://github.com/dart-lang/sdk/issues/33501
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/142980
Reviewed-by: David Morgan <davidmorgan@google.com>
Commit-Queue: David Morgan <davidmorgan@google.com>
2020-04-09 10:38:29 +00:00
Zichang Guo af19f9638d [dart:io] Preserve header case in http header _builds()
Bug: https://github.com/dart-lang/sdk/issues/33501
Change-Id: I57d9bba251b76314bf40b81d1b09bd4643dce4d2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/141911
Commit-Queue: Zichang Guo <zichangguo@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
Reviewed-by: Jonas Termansen <sortie@google.com>
2020-04-09 06:37:28 +00:00
Zichang Guo 8f7b40be77 [dart:io] Throw a FormatException when filters receive bad data.
Bug: https://github.com/dart-lang/sdk/issues/41270
Change-Id: Ie4de46129d6fe6ba00fde27f6c1c96cc3f42c888
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/141914
Commit-Queue: Zichang Guo <zichangguo@google.com>
Reviewed-by: Jonas Termansen <sortie@google.com>
2020-04-08 20:38:34 +00:00
Martin Kustermann 13c84d8794 Revert "Reland "[vm, gc] Parallel scavenge.""
This reverts commit 898b080d09.

Reason for revert: Seems to cause crashes in g3, see b/153524644.

Original change's description:
> Reland "[vm, gc] Parallel scavenge."
> 
> Remove header access from typed data case in RawObject::HeapSizeFromClass.
> 
> Address data race between visiting remembered cards and allocating new large pages for promotion.
> 
> Change-Id: I92cc4604ed38ab8f42b87b140a26a8118e7030d4
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/142565
> Reviewed-by: Martin Kustermann <kustermann@google.com>
> Commit-Queue: Ryan Macnak <rmacnak@google.com>

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

Change-Id: I3ef7bd5c3d0ca575f33cf5f712f58476037d2d90
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/142861
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2020-04-08 14:21:32 +00:00
Ryan Macnak 898b080d09 Reland "[vm, gc] Parallel scavenge."
Remove header access from typed data case in RawObject::HeapSizeFromClass.

Address data race between visiting remembered cards and allocating new large pages for promotion.

Change-Id: I92cc4604ed38ab8f42b87b140a26a8118e7030d4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/142565
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2020-04-07 17:07:06 +00:00
Ryan Macnak bb95f88139 Revert "[vm, gc] Parallel scavenge."
This reverts commit 9209f522d6.

Reason for revert: Flaky analyzer crashes

Original change's description:
> [vm, gc] Parallel scavenge.
> 
> Run N tasks that compete to copy or promote survivors. Installation of the forwarding pointer uses a CAS.
> Tasks do not share the list of copied objects to be processed.
> Tasks do share the list of promoted objects to be processed.
> Divide the freelist in N copies. Each scavenger task uses one without locking. The sweeper inserts into the freelists round-robin.
> 
> Change-Id: I54c7839ac5f15829462b3be7cf8c9635c01b785f
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/135962
> Commit-Queue: Ryan Macnak <rmacnak@google.com>
> Reviewed-by: Martin Kustermann <kustermann@google.com>

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

Change-Id: I0d97b8d9148b2a81cabafde4602512e423eba223
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/142554
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2020-04-06 22:51:08 +00:00
Ryan Macnak 9209f522d6 [vm, gc] Parallel scavenge.
Run N tasks that compete to copy or promote survivors. Installation of the forwarding pointer uses a CAS.
Tasks do not share the list of copied objects to be processed.
Tasks do share the list of promoted objects to be processed.
Divide the freelist in N copies. Each scavenger task uses one without locking. The sweeper inserts into the freelists round-robin.

Change-Id: I54c7839ac5f15829462b3be7cf8c9635c01b785f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/135962
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2020-04-06 20:14:54 +00:00
Mehmet Fidanboylu 74a20b7bfd Reland "[dart:_http] Allow the embedder to prohibit HTTP traffic."
This is a reland of 6b44c631ad

Original change's description:
> [dart:_http] Allow the embedder to prohibit HTTP traffic.
> 
> This can be configured by embedders by setting the `_embedderAllowsHttp`
> variable. It can also be overridden by client apps by introducing a
> `Zone` with the variable `#dart.library.io.allow_http` set to `true` or
> `false`.
> 
> The default behavior in SDK is unchanged.
> 
> Bug: https://github.com/dart-lang/sdk/issues/40548
> Change-Id: Ifec0ad2d759de4bbb836644840d8c312e560f285
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/138911
> Commit-Queue: Martin Kustermann <kustermann@google.com>
> Reviewed-by: Jonas Termansen <sortie@google.com>

Bug: https://github.com/dart-lang/sdk/issues/40548
Change-Id: I6ced6c1248b3b6687f6c7d998e5206b2b385f00b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/142446
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2020-04-06 17:46:44 +00:00
Aske Simon Christensen a5611cdda2 Revert "[dart:_http] Allow the embedder to prohibit HTTP traffic."
This reverts commit 6b44c631ad.

Reason for revert: Tests timing out on Windows

Original change's description:
> [dart:_http] Allow the embedder to prohibit HTTP traffic.
> 
> This can be configured by embedders by setting the `_embedderAllowsHttp`
> variable. It can also be overridden by client apps by introducing a
> `Zone` with the variable `#dart.library.io.allow_http` set to `true` or
> `false`.
> 
> The default behavior in SDK is unchanged.
> 
> Bug: https://github.com/dart-lang/sdk/issues/40548
> Change-Id: Ifec0ad2d759de4bbb836644840d8c312e560f285
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/138911
> Commit-Queue: Martin Kustermann <kustermann@google.com>
> Reviewed-by: Jonas Termansen <sortie@google.com>

TBR=sortie@google.com,lrn@google.com,kustermann@google.com,mehmetf@google.com

Change-Id: I824a1845e82b5facb839109f74bb482e7095e313
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: https://github.com/dart-lang/sdk/issues/40548
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/142363
Reviewed-by: Aske Simon Christensen <askesc@google.com>
Commit-Queue: Aske Simon Christensen <askesc@google.com>
2020-04-03 18:19:17 +00:00
Mehmet Fidanboylu 6b44c631ad [dart:_http] Allow the embedder to prohibit HTTP traffic.
This can be configured by embedders by setting the `_embedderAllowsHttp`
variable. It can also be overridden by client apps by introducing a
`Zone` with the variable `#dart.library.io.allow_http` set to `true` or
`false`.

The default behavior in SDK is unchanged.

Bug: https://github.com/dart-lang/sdk/issues/40548
Change-Id: Ifec0ad2d759de4bbb836644840d8c312e560f285
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/138911
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Jonas Termansen <sortie@google.com>
2020-04-03 16:39:26 +00:00
Jonas Termansen 778eb8f1d0 [dart:_http] Fix HeaderValue.parse if valueSeparator is parameterSeparator.
Closes https://github.com/dart-lang/sdk/issues/31080.

Change-Id: Iba235a339c345d1793935f65e3abe6ffdc157cb5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/140869
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Commit-Queue: Jonas Termansen <sortie@google.com>
2020-03-31 12:46:30 +00:00
Zichang Guo 236dd991e5 [dart:io] Fix parsing the response of the HTTP connect method
According to RFC 7231 4.3.6,
A client MUST ignore any "Content-Length" or "Transfer-Encoding" header
fields received in a successful response to CONNECT.

Bug: https://github.com/dart-lang/sdk/issues/37808
Change-Id: I776f54b93807b4b7f9d9c9b9139728fa0415942a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/140564
Commit-Queue: Zichang Guo <zichangguo@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
Reviewed-by: Jonas Termansen <sortie@google.com>
2020-03-27 20:03:04 +00:00
Zichang Guo fdf4762c99 Reland "[dart:io] Fix hanging on zero-length datagram"
This is a reland of c326c587c5

The fix is to remove "_availableDatagram" check at the start of receive(). Since receive() can be called without receiver being listening, this check will block the receive().

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>

Bug: https://github.com/dart-lang/sdk/issues/39910
Change-Id: Iefc0af96ed4e1b433396bb5fe11276e8a04c00d5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/140164
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Zichang Guo <zichangguo@google.com>
2020-03-27 15:28:23 +00:00
Martin Kustermann 1402e8e1a4 [gardening] Ensure standalone/io/non_utf8_output_test flushes stdout
This can remove flakiness of the test, the approval status will be NonUtf8Output.

Change-Id: Ie911547481ed0421632a54a3a74ce93984656948
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/141123
Reviewed-by: Teagan Strickland <sstrickl@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2020-03-26 13:15:18 +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
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
Teagan Strickland ba8baa46b4 [pkg/native_stack_traces] Return stub call information when appropriate.
Now when -v/--verbose is used, we will also print call information
when those calls appear in stubs that do not correspond to Dart code.
The returned information contains the name of the stub (the name of
the static symbol in the ELF file generated for the stub) as well as
the offset of the frame PC within the stub payload.

This change also adds a flag --dump-debug-file-contents that
outputs the parsed information from the file passed via -d/--debug.

Change-Id: Ic52dd6825f2f3564efa3c2c12b46a8bef23d56bc
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/+/139280
Commit-Queue: Teagan Strickland <sstrickl@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2020-03-20 11:26:02 +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
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