Commit graph

753 commits

Author SHA1 Message Date
Ryan Macnak 8f21c8ed2a [gardening] Don't attempt to measure RSS under sanitizers or with reload.
Bug: https://github.com/dart-lang/sdk/issues/52816
Change-Id: I4e50180a9285727cc2e275dd17dd6855f21a0b6e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/311926
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
2023-06-29 19:39:05 +00:00
Ryan Macnak ac77af1c07 Group the GC tests into a common directory.
The makes it possible to run just these tests with `test.py vm/gc/`.

Change-Id: Ied4aa0b2fb045c19b1aced68f58a1ef195a5df8a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/311145
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2023-06-29 17:27:48 +00:00
Slava Egorov 8b6e39696f [vm/io] Avoid leaking Handle::data_ready_ on Windows.
Handle::data_ready_ contains bytes which are ready to be sent to Dart
side. Not all code paths fully drain this buffer and delete it
before destroying the handle, for example directory watch implementation
was prone to leaking data_ready_ when subscription was cancelled.

This CL switches the code to use unique_ptr to hold on to data_ready_
which makes sure that it is deleted when Handle is destroyed.

The code would benefit from holding all OverlappedBuffer instances
through unique_ptr but that is a much larger refactoring which
we leave for a later date.

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

TEST=standalone{,_2}/regress_52715_test

Bug: 52715
Cq-Include-Trybots: luci.dart.try:vm-win-release-x64-try,vm-win-debug-x64-try,vm-aot-win-release-x64-try,analyzer-win-release-try
Change-Id: Ie8d728b823de7e8f9de1489898e270580c2af269
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/311841
Commit-Queue: Slava Egorov <vegorov@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Auto-Submit: Slava Egorov <vegorov@google.com>
2023-06-28 13:06:51 +00:00
Vyacheslav Egorov 71dd8b3d16 [vm/io] Fix standalone/io/client_socket_add_destroy_no_error_test
The test was written in a way that let GC collect (and shutdown)
receiving end leading to EPIPE.

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

Fixed: 52654
Change-Id: I2100fee1498e80c6af65d570179d3335310696a4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/308340
Reviewed-by: Tess Strickland <sstrickl@google.com>
Commit-Queue: Tess Strickland <sstrickl@google.com>
2023-06-09 18:14:53 +00:00
Tess Strickland 93aaf23d0a [tests] Remove standalone_2/io/regress_50904_test.
This test can't be used with Dart 2.9, because it uses libraries
that require a later min SDK version.

Change-Id: I8ed2e32fded0185adf3a72e9ab952edb9e981f4e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/308301
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Tess Strickland <sstrickl@google.com>
2023-06-09 13:34:28 +00:00
Ryan Macnak 884be01ec3 [vm, gc] Add option to madvise(DONTNEED) when sweeping.
- More expensive sweeping that will also slow down the mutator from more TLB invalidation
 - Might cause OOM sooner from PTE fragmentation
 - Won't decrease the Dart heap capacity stat
 - Unclear how often holes are at least page sized

TEST=ci
Bug: https://github.com/dart-lang/sdk/issues/52571
Change-Id: I54011e451bf0ad21859c11023d1c4123cc0fa435
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/306902
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2023-06-07 19:01:51 +00:00
Vyacheslav Egorov 74285a6e31 [io] Take pending writes into account in _SocketStreamConsumer
On Windows `_NativeSocket.nativeWrite` returning to caller does
not mean that the data was flushed into OS buffer. Overlapped
operation might still be in progress - and it will be cancelled
with data loss if we close the handle.

This means _SocketStreamConsumer should take such pending writes
into account and not issue `done` event until pending write
completes.

This change prevents data loss when communicating with
subprocesses on Windows. Previously even doing
`await process.stdin.flush()` would not guarantee data
delivery.

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

TEST=tests/standalone/io/regress_50904_test.dart

Cq-Include-Trybots: luci.dart.try:vm-win-release-x64-try,vm-win-debug-x64-try,pkg-win-release-try
Change-Id: I13ab2cc3ce45f1ff8cb3183884d26bbb2b72f7ac
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/307043
Reviewed-by: Brian Quinlan <bquinlan@google.com>
Commit-Queue: Slava Egorov <vegorov@google.com>
2023-06-07 09:49:35 +00:00
Brian Quinlan 95509b2b34 Add tests to ensure that \n is not translated to the platform line ending and document that behavior.
Change-Id: I52668a87507dfdc560fd7c1ec20e86114c1199b7
CoreLibraryReviewExempt: documentation and test-only change
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/303421
Commit-Queue: Brian Quinlan <bquinlan@google.com>
Reviewed-by: Lasse Nielsen <lrn@google.com>
2023-05-24 18:50:29 +00:00
Brian Quinlan a75e857df5 Add a Platform.lineTerminator static method
Bug: https://github.com/dart-lang/sdk/issues/52379
Change-Id: Ic3a7f06252f8a69dcfdb29c00f16557c34529652
CoreLibraryReviewExempt: Aske is on holiday
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/297260
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Brian Quinlan <bquinlan@google.com>
Reviewed-by: Lasse Nielsen <lrn@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2023-05-18 19:57:58 +00:00
Lasse R.H. Nielsen 066106d19a Make Uri.base see IOOverrides changes to current directory.
Fixes #39796.

Tested: Case added to `io_overrides_test.dart`.
Bug: https://dartbug.com/39796
Change-Id: Id72f75f972f59f4f9b7d17e79b4bcffd6d79f2c7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/304006
Commit-Queue: Lasse Nielsen <lrn@google.com>
Reviewed-by: Nate Bosch <nbosch@google.com>
2023-05-17 17:27:13 +00:00
Liam Appelbe 9d78eaf1ad [gardening] Fix dwarf_stack_trace_invisible_functions_test
https://dart-review.googlesource.com/c/sdk/+/300600 migrated some tests
to use a new TEST_COMPILATION_DIR flag, but this test was incorrectly
migrated. The test was failing on the legacy bots.

Change-Id: Iac6fa3e946dc29d840068813123359262fe59474
TEST=Local testing and CI
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/301220
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Liam Appelbe <liama@google.com>
2023-05-03 23:01:48 +00:00
Vyacheslav Egorov 19e56613cf [infra] Prevent VM AOT tests from poluting SDK source.
Extend test_runner VMOptions support with an ability to specify
paths relative to temporary compilation directory.

    // VMOptions=--foo=$TEST_COMPILATION_DIR/foo.file

The same directory will also be passed as an environment variable
to execution command.

Migrate most of the tests which used to write stuff into the SDK
root to use this feature. I am leaving vm/dart/causal/* tests
unmigrated because migrating requires time consuming manual
update of expectations (which encode raw line numbers). I have
a follow up CL which changes how these tests are written which
will make migration trivial.

Change-Id: Id53008be66de8ff18623efac27ff15750f407749
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/300600
Reviewed-by: William Hesse <whesse@google.com>
Commit-Queue: Slava Egorov <vegorov@google.com>
2023-05-03 13:24:39 +00:00
Sun Jiao f9ccf90c97 [http] support SameSite in Cookies.
Closes https://github.com/dart-lang/sdk/pull/51457

GitOrigin-RevId: 4e0bece11ae2c1b7b7eac5a43293ae43682e22d2
Change-Id: I0fe39aede037b713b5a3fdbf7950a4a44a02ea1d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/283984
Reviewed-by: Lasse Nielsen <lrn@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Brian Quinlan <bquinlan@google.com>
Commit-Queue: Brian Quinlan <bquinlan@google.com>
2023-05-02 23:51:22 +00:00
Valentin Hăloiu 9a5de8e2ea Fix HTTPS client certificate test
These tests have been broken (and disabled) for a while. This pull-request fixes the tests and re-enables them.

Bug: #47052
Change-Id: Ib8c83959e5f00a2a5dc29959f87adbaa963385fe
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/296863
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Daco Harkes <dacoharkes@google.com>
2023-04-26 06:45:20 +00:00
Valentin Hăloiu db766b37cb Fix SSL certificate check when hostname is an IP address
Closes https://github.com/dart-lang/sdk/pull/52118

GitOrigin-RevId: 7598354d2ad5baba2ed65177bdff521a637b5b65
Change-Id: I78246e423f6ee090030912576ab8202f0fa60509
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/296722
Reviewed-by: Brian Quinlan <bquinlan@google.com>
Commit-Queue: Brian Quinlan <bquinlan@google.com>
2023-04-25 16:06:12 +00:00
Robert Nystrom 105a0f30d6 Migrate standalone tests off @compile-error.
The "@compile-error" comment is an old not-great way of defining static
error tests.

Note that the behavior of the code under test here had changed
significantly, but the test didn't catch it at all because
"@compile-error" is too coarse-grained.

See: https://github.com/dart-lang/sdk/issues/45634
Change-Id: I4b6c4e1fd36770e13f7b5ca100b42b0b8b2983ae
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/296121
Commit-Queue: Jake Macdonald <jakemac@google.com>
Reviewed-by: Jake Macdonald <jakemac@google.com>
Auto-Submit: Bob Nystrom <rnystrom@google.com>
2023-04-19 14:17:39 +00:00
Ryan Macnak 5318269632 [test] Misc dart:io test fixes.
Bug: https://github.com/dart-lang/sdk/issues/51949
Change-Id: Ifbfd12bcc83c5536dae4f2d9689151159086a6ed
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/293780
Reviewed-by: Brian Quinlan <bquinlan@google.com>
2023-04-05 19:15:19 +00:00
Ryan Macnak 50b3d2d0bd [test] Avoid CFE spam in tests reading stderr.
Change-Id: Ibe71522962271da590046441e0157f5b25c59773
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/281302
Reviewed-by: Brian Quinlan <bquinlan@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2023-04-04 19:10:14 +00:00
Ryan Macnak 3d8424e9fc [test] Introduce status variable $simulator, and fix some cases missing simarm_x64.
TEST=ci
Change-Id: Ie2a8ac015b2d316527d648956c86d4c7cb319d26
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/292962
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
2023-04-04 03:10:26 +00:00
Brian Quinlan d884d1a76e [io] Do delayed IPv6 lookups on all platforms.
Bug: https://github.com/dart-lang/sdk/issues/50868
Change-Id: I5ad57f4634287b4299fbf74fde075d518154bf08
Tested: unit
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/288621
Commit-Queue: Brian Quinlan <bquinlan@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
2023-03-28 18:17:54 +00:00
Daco Harkes 92e5746494 Reland "[vm/ffi] Add class modifiers"
This is a reland of commit 1755f89092

Can land after (or with) the Flutter PR:
https://github.com/flutter/engine/pull/40434

Original change's description:
> [vm/ffi] Add class modifiers
>
> Adds class modifiers to `dart:ffi`.
>
> Migrates all user-defined subclasses of `Struct`, `Union`, `Opaque`,
> and `AbiSpecificInteger` to be `final class`es.
>
> Does not remove the manual error checking, so some errors will show up
> twice now in language version 3.0. In language version <3.0, only the
> FFI-specific error will show up.
>
> In a follow-up CL, we will try to make the language-errors to show up
> also <3.0 so that we can remove the FFI-specific errors.
>
> Examples of duplicated errors:
> pkg/analyzer/test/src/diagnostics/subtype_of_ffi_class_test.dart
>
> TEST=pkg/analyzer/test/ (for the analyzer)
> TEST=pkg/front_end/testcases/ (for the CFE)
> TEST=test/ffi/ (for the VM)
>
> CoreLibraryReviewExempt: No need for dart2js to review.
> Bug: https://github.com/dart-lang/sdk/issues/51683
> Change-Id: I2964ceccb7db59fbdaf6be5319f5e4ec2dabe0f3
> Cq-Include-Trybots: luci.dart.try:pkg-linux-debug-try,pkg-win-release-try,pkg-mac-release-try,vm-precomp-ffi-qemu-linux-release-riscv64-try,vm-precomp-ffi-qemu-linux-release-arm-try,vm-ffi-android-debug-arm64c-try,vm-ffi-android-debug-arm-try,vm-reload-rollback-linux-debug-x64-try,analyzer-analysis-server-linux-try,analyzer-linux-release-try
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/289223
> Reviewed-by: Johnni Winther <johnniwinther@google.com>
> Reviewed-by: Devon Carew <devoncarew@google.com>
> Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
> Reviewed-by: Jackson Gardner <jacksongardner@google.com>
> Reviewed-by: Lasse Nielsen <lrn@google.com>
> Commit-Queue: Daco Harkes <dacoharkes@google.com>

TEST=pkg/analyzer/test/ (for the analyzer)
TEST=pkg/front_end/testcases/ (for the CFE)
TEST=test/ffi/ (for the VM)
CoreLibraryReviewExempt: No need for dart2js to review.
Bug: https://github.com/dart-lang/sdk/issues/51683
Change-Id: I2ee3f0ac31d4162068a2346a06320029b2263ee2
Cq-Include-Trybots: luci.dart.try:pkg-linux-debug-try,pkg-win-release-try,pkg-mac-release-try,vm-precomp-ffi-qemu-linux-release-riscv64-try,vm-precomp-ffi-qemu-linux-release-arm-try,vm-ffi-android-debug-arm64c-try,vm-ffi-android-debug-arm-try,vm-reload-rollback-linux-debug-x64-try,analyzer-analysis-server-linux-try,analyzer-linux-release-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/289781
Reviewed-by: Devon Carew <devoncarew@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2023-03-21 15:25:10 +00:00
William Hesse 20449a1ebc Revert "Reland "[io] Improve the performance of the IOSink returned by openWrite by writing eagerly and accumulating small writes.""
This reverts commit e34165c543.
Also reverts commit 39ecf5f9d2

Reason for revert: breaks internal testing: b/274563167

Original change's description:
> Reland "[io] Improve the performance of the IOSink returned by `openWrite` by writing eagerly and accumulating small writes."
>
> This is a reland of commit c2bdda63f5
>
> Original change's description:
> > [io] Improve the performance of the IOSink returned by `openWrite` by writing eagerly and accumulating small writes.

Bug: b/274563167
Change-Id: I551c92a5fe121c85999f8a6ec513f83481ae2dbd
CoreLibraryReviewExempt: Revert
Tested: Revert
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/290064
Auto-Submit: William Hesse <whesse@google.com>
Reviewed-by: Emmanuel Pellereau <emmanuelp@google.com>
2023-03-21 09:53:02 +00:00
William Hesse 39ecf5f9d2 [io] Calling flush after close on File.open's IOSync should not throw an exception
The documentation of IOSync states that calling flush on a closed IOSink may have no effect:
https://github.com/dart-lang/sdk/blob/main/sdk/lib/io/io_sink.dart#L109
The future returned by close in the new implementation does not complete until after
a call to flush has completed.
The previous implementation of File.open did not throw when calling flush after close.

CoreLibraryReviewExempt: IO only, restoring previous semantics
Bug: b/274405250
Change-Id: I56bbe02e886085cc8156e60264f5b77593c8a075
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/289823
Reviewed-by: Emmanuel Pellereau <emmanuelp@google.com>
2023-03-20 15:33:04 +00:00
Zach Anderson 7471994270 Revert "[vm/ffi] Add class modifiers"
This reverts commit 1755f89092.

Reason for revert: This is a breaking change and is blocking the Dart -> Flutter roll. See https://ci.chromium.org/ui/p/flutter/builders/try/Mac%20Unopt/26896/overview.

Original change's description:
> [vm/ffi] Add class modifiers
>
> Adds class modifiers to `dart:ffi`.
>
> Migrates all user-defined subclasses of `Struct`, `Union`, `Opaque`,
> and `AbiSpecificInteger` to be `final class`es.
>
> Does not remove the manual error checking, so some errors will show up
> twice now in language version 3.0. In language version <3.0, only the
> FFI-specific error will show up.
>
> In a follow-up CL, we will try to make the language-errors to show up
> also <3.0 so that we can remove the FFI-specific errors.
>
> Examples of duplicated errors:
> pkg/analyzer/test/src/diagnostics/subtype_of_ffi_class_test.dart
>
> TEST=pkg/analyzer/test/ (for the analyzer)
> TEST=pkg/front_end/testcases/ (for the CFE)
> TEST=test/ffi/ (for the VM)
>
> CoreLibraryReviewExempt: No need for dart2js to review.
> Bug: https://github.com/dart-lang/sdk/issues/51683
> Change-Id: I2964ceccb7db59fbdaf6be5319f5e4ec2dabe0f3
> Cq-Include-Trybots: luci.dart.try:pkg-linux-debug-try,pkg-win-release-try,pkg-mac-release-try,vm-precomp-ffi-qemu-linux-release-riscv64-try,vm-precomp-ffi-qemu-linux-release-arm-try,vm-ffi-android-debug-arm64c-try,vm-ffi-android-debug-arm-try,vm-reload-rollback-linux-debug-x64-try,analyzer-analysis-server-linux-try,analyzer-linux-release-try
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/289223
> Reviewed-by: Johnni Winther <johnniwinther@google.com>
> Reviewed-by: Devon Carew <devoncarew@google.com>
> Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
> Reviewed-by: Jackson Gardner <jacksongardner@google.com>
> Reviewed-by: Lasse Nielsen <lrn@google.com>
> Commit-Queue: Daco Harkes <dacoharkes@google.com>

Bug: https://github.com/dart-lang/sdk/issues/51683
Change-Id: Ie5b8a08aea6d64b1991ace4814322b21ffb670c7
Cq-Include-Trybots: luci.dart.try:pkg-linux-debug-try,pkg-win-release-try,pkg-mac-release-try,vm-precomp-ffi-qemu-linux-release-riscv64-try,vm-precomp-ffi-qemu-linux-release-arm-try,vm-ffi-android-debug-arm64c-try,vm-ffi-android-debug-arm-try,vm-reload-rollback-linux-debug-x64-try,analyzer-analysis-server-linux-try,analyzer-linux-release-try
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/289640
Commit-Queue: Slava Egorov <vegorov@google.com>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Slava Egorov <vegorov@google.com>
2023-03-20 11:15:59 +00:00
Daco Harkes 1755f89092 [vm/ffi] Add class modifiers
Adds class modifiers to `dart:ffi`.

Migrates all user-defined subclasses of `Struct`, `Union`, `Opaque`,
and `AbiSpecificInteger` to be `final class`es.

Does not remove the manual error checking, so some errors will show up
twice now in language version 3.0. In language version <3.0, only the
FFI-specific error will show up.

In a follow-up CL, we will try to make the language-errors to show up
also <3.0 so that we can remove the FFI-specific errors.

Examples of duplicated errors:
pkg/analyzer/test/src/diagnostics/subtype_of_ffi_class_test.dart

TEST=pkg/analyzer/test/ (for the analyzer)
TEST=pkg/front_end/testcases/ (for the CFE)
TEST=test/ffi/ (for the VM)

CoreLibraryReviewExempt: No need for dart2js to review.
Bug: https://github.com/dart-lang/sdk/issues/51683
Change-Id: I2964ceccb7db59fbdaf6be5319f5e4ec2dabe0f3
Cq-Include-Trybots: luci.dart.try:pkg-linux-debug-try,pkg-win-release-try,pkg-mac-release-try,vm-precomp-ffi-qemu-linux-release-riscv64-try,vm-precomp-ffi-qemu-linux-release-arm-try,vm-ffi-android-debug-arm64c-try,vm-ffi-android-debug-arm-try,vm-reload-rollback-linux-debug-x64-try,analyzer-analysis-server-linux-try,analyzer-linux-release-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/289223
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Devon Carew <devoncarew@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Jackson Gardner <jacksongardner@google.com>
Reviewed-by: Lasse Nielsen <lrn@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
2023-03-17 19:29:41 +00:00
Brian Quinlan e34165c543 Reland "[io] Improve the performance of the IOSink returned by openWrite by writing eagerly and accumulating small writes."
This is a reland of commit c2bdda63f5

Original change's description:
> [io] Improve the performance of the IOSink returned by `openWrite` by writing eagerly and accumulating small writes.
>
> Benchmarks (benchmarks/FileIOSink/dart/FileIOSink.dart):
>
>  @before:
>
>   FileIOSink.Add.ManySmall(RunTime): 2341597.0 us.
>   FileIOSink.Add.OneLarge(RunTime): 111.06925927974774 us.
>   FileIOSink.Add.AlternatingAddSize(RunTime): 105.65958788898234 us.
>
>  @after
>
>   FileIOSink.Add.ManySmall(RunTime): 5007.1125 us.
>   FileIOSink.Add.OneLarge(RunTime): 98.23492468475541 us.
>   FileIOSink.Add.AlternatingAddSize(RunTime): 91.77411527720551 us.
>
> So the relative performance changes are:
>
>  FileIOSink.Add.ManySmall(RunTime): 0.00213x (MUCH faster)
>  FileIOSink.Add.OneLarge(RunTime): 0.884x (slight faster - noise?)
>  FileIOSink.Add.AlternatingAddSize(RunTime): 0.868x (slightly faster - noise?)
>
> https://golem.corp.goog/Revision?repository=dart&revision=102771&patch=17842
>
> Change-Id: Ic73f33299a570096dd05f254982f556767559966
> Bug:https://github.com/dart-lang/sdk/issues/32874
> Tested: unit tests
> CoreLibraryReviewExempt: Performance-only fix for file writes in the VM.
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/285420
> Commit-Queue: Brian Quinlan <bquinlan@google.com>
> Reviewed-by: Alexander Aprelev <aam@google.com>

Bug: https://github.com/dart-lang/sdk/issues/32874
Change-Id: I758f3159e85c837d6ec4a0f3e470b519825ee142
Tested: unit tests
CoreLibraryReviewExempt: Performance-only fix for file writes in the VM.
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/288545
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Brian Quinlan <bquinlan@google.com>
Reviewed-by: William Hesse <whesse@google.com>
2023-03-17 16:13:19 +00:00
Siva Annamalai c17e55a1de Revert "[io] Improve the performance of the IOSink returned by openWrite by writing eagerly and accumulating small writes."
This reverts commit c2bdda63f5.

Reason for revert: We are seeing some windows failures and also 
Bad state: /tmp/file_test_NOYTEV/foo is bound to a stream
** Note that stack traces are truncated. See http://go/dart-chain-stack-traces for information on how to view the full stack trace **
dart:io                                                          _RandomAccessFileIOSync.flush


Original change's description:
> [io] Improve the performance of the IOSink returned by `openWrite` by writing eagerly and accumulating small writes.
>
> Benchmarks (benchmarks/FileIOSink/dart/FileIOSink.dart):
>
>  @before:
>
>   FileIOSink.Add.ManySmall(RunTime): 2341597.0 us.
>   FileIOSink.Add.OneLarge(RunTime): 111.06925927974774 us.
>   FileIOSink.Add.AlternatingAddSize(RunTime): 105.65958788898234 us.
>
>  @after
>
>   FileIOSink.Add.ManySmall(RunTime): 5007.1125 us.
>   FileIOSink.Add.OneLarge(RunTime): 98.23492468475541 us.
>   FileIOSink.Add.AlternatingAddSize(RunTime): 91.77411527720551 us.
>
> So the relative performance changes are:
>
>  FileIOSink.Add.ManySmall(RunTime): 0.00213x (MUCH faster)
>  FileIOSink.Add.OneLarge(RunTime): 0.884x (slight faster - noise?)
>  FileIOSink.Add.AlternatingAddSize(RunTime): 0.868x (slightly faster - noise?)
>
> https://golem.corp.goog/Revision?repository=dart&revision=102771&patch=17842
>
> Change-Id: Ic73f33299a570096dd05f254982f556767559966
> Bug:https://github.com/dart-lang/sdk/issues/32874
> Tested: unit tests
> CoreLibraryReviewExempt: Performance-only fix for file writes in the VM.
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/285420
> Commit-Queue: Brian Quinlan <bquinlan@google.com>
> Reviewed-by: Alexander Aprelev <aam@google.com>

Bug: https://github.com/dart-lang/sdk/issues/32874
Change-Id: I6e16cfb460a9a6b16d7a63cb02d46fab9fc6244d
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/288606
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Commit-Queue: Siva Annamalai <asiva@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
2023-03-14 04:54:17 +00:00
Brian Quinlan c2bdda63f5 [io] Improve the performance of the IOSink returned by openWrite by writing eagerly and accumulating small writes.
Benchmarks (benchmarks/FileIOSink/dart/FileIOSink.dart):

 @before:

  FileIOSink.Add.ManySmall(RunTime): 2341597.0 us.
  FileIOSink.Add.OneLarge(RunTime): 111.06925927974774 us.
  FileIOSink.Add.AlternatingAddSize(RunTime): 105.65958788898234 us.

 @after

  FileIOSink.Add.ManySmall(RunTime): 5007.1125 us.
  FileIOSink.Add.OneLarge(RunTime): 98.23492468475541 us.
  FileIOSink.Add.AlternatingAddSize(RunTime): 91.77411527720551 us.

So the relative performance changes are:

 FileIOSink.Add.ManySmall(RunTime): 0.00213x (MUCH faster)
 FileIOSink.Add.OneLarge(RunTime): 0.884x (slight faster - noise?)
 FileIOSink.Add.AlternatingAddSize(RunTime): 0.868x (slightly faster - noise?)

https://golem.corp.goog/Revision?repository=dart&revision=102771&patch=17842

Change-Id: Ic73f33299a570096dd05f254982f556767559966
Bug:https://github.com/dart-lang/sdk/issues/32874
Tested: unit tests
CoreLibraryReviewExempt: Performance-only fix for file writes in the VM.
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/285420
Commit-Queue: Brian Quinlan <bquinlan@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
2023-03-13 22:39:13 +00:00
Nicholas Shahan de44a23dd1 [test_runner] Cleanup unused compiler names
"dartdevc" and "dartdevk" have been replaced with "ddc".

Change-Id: I823bc029a0bbe1295fd731efcc32961e61c6c175
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/282485
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
2023-03-07 02:09:16 +00:00
Brian Quinlan 11b39ee058 Fix unbalanced call to Dart_TypedDataAcquireData.
Tested: unit test
Change-Id: I63249c3af001e4f1a9b9622bf6179062023f8d2e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/282824
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Brian Quinlan <bquinlan@google.com>
2023-02-14 01:44:17 +00:00
Brian Quinlan 11f7a52b94 [io] Faster readIntoSync for UInt8List.
Adds a specialized code path to File_ReadInto which avoids a memory copy when writing to a UInt8List.

Benchmarks:
https://docs.google.com/spreadsheets/d/1AqT5bDCaRfxalK9WLqGlm_EfVpTmeQT7LEqaJ-Hyl1c/edit?usp=sharing&resourcekey=0-NivVhxs0J1GM4BHXHK5gAQ

Tested: unit tests
Change-Id: I7d6cb5257da1724e8c61412b0f84bee22da298ab
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/280560
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Brian Quinlan <bquinlan@google.com>
2023-02-13 21:23:01 +00:00
Nicholas Shahan 87d1806055 [test_runner] Add new name for ddc compiler
* The new compiler name "ddc" will be used for all configurations
  in an upcoming change.
* Aliases "dartdevc" and "dartdevk" will be removed in the future.

Change-Id: I2fa48e0ec043b1ba7fb70f883b39e40f338b6928
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/280862
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
2023-02-09 18:32:58 +00:00
Brian Quinlan 252015b30b [io] Fix a bug where large reads would return partial data.
Bug: https://github.com/dart-lang/sdk/issues/51071
Change-Id: Ia64d803c9709b106e52a1c671c1c3288c051bd85
Tested: ci + new test
CoreLibraryReviewExempt: bug fix only for vm
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/279204
Reviewed-by: Alexander Aprelev <aam@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Brian Quinlan <bquinlan@google.com>
2023-01-31 18:41:39 +00:00
Josh Soref ef42a0b110 Spelling pkg analyzer lib
Closes https://github.com/dart-lang/sdk/pull/50860

GitOrigin-RevId: b27066c37f93c8c6d1123d6ebd6a4c0afcf59844
Change-Id: I15fa4aea1dad45daf168e34d1c4450320ec9b40a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/277742
Commit-Queue: Alexander Thomas <athom@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
2023-01-25 14:08:27 +00:00
Josh Soref b3df0a4bd5 Spelling tests standalone
Closes https://github.com/dart-lang/sdk/pull/50863

GitOrigin-RevId: e514be37c7f3b48cbce1048c359df00be7d2b18a
Change-Id: I45ad308db60a5935f18a877f5480874acfef0efd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/277780
Reviewed-by: Alexander Thomas <athom@google.com>
2023-01-23 12:55:22 +00:00
Josh Soref ba15a61271 Spelling build
Closes https://github.com/dart-lang/sdk/pull/50859

GitOrigin-RevId: 7b056018c2925745701bdecdd7da325d9458204d
Change-Id: Iff037d773713bf73efde6951599becfd7297b921
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/277740
Reviewed-by: Alexander Thomas <athom@google.com>
2023-01-23 08:56:14 +00:00
Brian Quinlan 3571b97b24 [win/io] Fix a bug where RawDataSocket would send truncated data on Windows.
Bug:https://github.com/dart-lang/sdk/issues/31873
Change-Id: I8856bad941330f24671fc2c61af736fc54cd9459
Tested: unit tests
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/278981
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Brian Quinlan <bquinlan@google.com>
2023-01-13 20:36:55 +00:00
Kevin Moore 12355a5be2 test: fix testZLibDeflateInvalidLevel
Change-Id: I9e8a28a3f9994836bd026d90a49aed7371665092
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/270285
Commit-Queue: Kevin Moore <kevmoo@google.com>
Auto-Submit: Kevin Moore <kevmoo@google.com>
Reviewed-by: Lasse Nielsen <lrn@google.com>
2023-01-10 22:34:31 +00:00
Brian Quinlan b0009cd7a4 Fix http_requested_uri_test to not require a timeout.
Change-Id: I4886df99a529ced3cdba5c36acc348fb4081ddea
BUG: https://github.com/dart-lang/sdk/issues/50974
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/278802
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Brian Quinlan <bquinlan@google.com>
2023-01-10 20:54:19 +00:00
Brian Quinlan 266c90346c [io] Fix a where HttpClient was not correctly tracking pending
connections when an error occurs.

Bug:https://github.com/dart-lang/sdk/issues/50054
Change-Id: I940236a259f8826b790d9189789287981350659a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/278644
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Brian Quinlan <bquinlan@google.com>
2023-01-10 20:01:29 +00:00
Brian Quinlan f502427120 [io] Fix a bug with HttpRequest.requestedUri with absolute urls
Bug:https://github.com/dart-lang/sdk/issues/50704
Change-Id: I1139f3ab720960d4d2e4d350f0b00f6afd2ed2cd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/278481
Commit-Queue: Brian Quinlan <bquinlan@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
2023-01-09 22:11:29 +00:00
Brian Quinlan 9b2b9df09e [io] Remove incorrect docs that listSupport is not available on Android.
Bug:https://github.com/dart-lang/sdk/issues/47894
Change-Id: Id79a37f5ba6a8118a30d2297c95cff5a7ca1a03f
TEST=unit
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/276660
Commit-Queue: Brian Quinlan <bquinlan@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
2022-12-21 00:23:02 +00:00
Josh Soref df97aca1fa Spelling tests
Closes https://github.com/dart-lang/sdk/pull/50764

GitOrigin-RevId: ee2fe9a75d50e877f4ad2fe3743acdbc04f186ef
Change-Id: Ia73cd22da4e6ec95e84772aa4e1345ce2dbde215
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/276360
Reviewed-by: Erik Ernst <eernst@google.com>
Commit-Queue: Erik Ernst <eernst@google.com>
2022-12-19 12:56:47 +00:00
Michael Thomsen e4cc3c98e5 [3.0 alpha] Remove deprecated dart:core List() constructor.
TEST=ci

Bug: Contributes to https://github.com/dart-lang/sdk/issues/49529
Change-Id: Ic129ef2d89f625d9ec6a7a1c301cffddd60b2ff7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/258920
Reviewed-by: Lasse Nielsen <lrn@google.com>
Commit-Queue: Michael Thomsen <mit@google.com>
Reviewed-by: Slava Egorov <vegorov@google.com>
2022-12-15 11:36:22 +00:00
asiva 606a64a743 [3.0 alpha][VM/Runtime] - Flip flag to make strong null safety the default.
- Flip flag to make strong null safety the default
- Remove code that auto detects null safety mode from source files,
  it is necessary to specify --no-strong-null-safety to opt out.
- Retains sniffing of AOT/JIT snapshots and kernel files to determine
  null safety mode, the opt out has to be done when generating these
  file.

TEST=ci

Change-Id: If2c9608eedb7c46d9c3cd85e261ee9640e0d28eb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/261140
Reviewed-by: Alexander Thomas <athom@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Siva Annamalai <asiva@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2022-12-06 04:04:23 +00:00
Alexander Thomas 7e0d92d69d [3.0 alpha] Bump version to 3.0.0
Tested: Standard CQ.
Bug: https://github.com/dart-lang/sdk/issues/49529
Change-Id: I329b9940db7309c7e48f17eecd7a66d5b853a484
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/271922
Commit-Queue: Siva Annamalai <asiva@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2022-12-06 02:40:36 +00:00
Brian Quinlan 8df8bbf0de Add PathExistsException and PathAccessException FileSystemException subclasses.
Bug:https://github.com/dart-lang/sdk/issues/50436
Change-Id: Ie2954f162c01189cd0d817f58606529acdc13416
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/269240
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Brian Quinlan <bquinlan@google.com>
2022-11-30 04:54:52 +00:00
Ryan Macnak ae13d34299 [test] Avoid tests fighting over the default service port.
With no argument, --enable-vm-service and --observe default to port 8181. Passing 0 means to take any available port. If two tests try to use the default port at the same time, one will fail to bind that port.

TEST=ci
Change-Id: Ib7615911db9fb9ab037de1efdd4918b54f59d9e5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/268840
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2022-11-10 17:28:48 +00:00
Brian Quinlan b75f8aaaf5 [io/file] - add FileSystemNotFoundException
Thrown by when an operation fails because a file is not found.

TEST=updated unit tests
Issue: https://github.com/dart-lang/sdk/issues/12461
Change-Id: I2e6e3986f92d5bf9f3922f4e2c6bbba67cc102bc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/267280
Reviewed-by: Lasse Nielsen <lrn@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Brian Quinlan <bquinlan@google.com>
2022-11-08 19:26:19 +00:00
Alexander Thomas 0b26f4816b [testing] Remove --compiler=none from test.py
* Use dartk as the default compiler for runtime=vm.
* Status file entries for checking for the `none` compiler now either
  use dartk or are deleted.

Tested: Standard CQ and local testing.
Fixes: https://github.com/dart-lang/sdk/issues/50241
Change-Id: I7a08d3e491ae1c82a0348fb66ea7b557398f97e5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/264682
Reviewed-by: Siva Annamalai <asiva@google.com>
Reviewed-by: Lasse Nielsen <lrn@google.com>
Commit-Queue: Alexander Thomas <athom@google.com>
2022-10-19 08:09:58 +00:00