Commit graph

82955 commits

Author SHA1 Message Date
Ryan Macnak 20f1a954fe [tsan] Force early ICU initialization to avoid spurious data race warnings.
TEST=isolate-stress
Bug: https://github.com/dart-lang/sdk/issues/46699
Bug: https://bugs.fuchsia.dev/p/fuchsia/issues/detail?id=83298
Change-Id: I0f3c9f5e2ffde7eb84638f52e7af9e285f5316f7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/221661
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2021-11-30 19:28:05 +00:00
Joshua Litt bebc692e93 [dart2js] Add 'shipped' state to feature options.
Change-Id: I2be91636f0e32d00c9dbc92cf7b514454040754f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/221020
Commit-Queue: Joshua Litt <joshualitt@google.com>
Reviewed-by: Mark Zhou <markzipan@google.com>
2021-11-30 18:03:39 +00:00
Danny Tuppeny 08db718290 [dds] Resolve dart: URIs to SDK file paths and back again in DAP
This fixes two issues:

1. When a user navigates into SDK sources using the analyzer (Go-to-Definition) and sets a breakpoint, we map it to a URI that the VM understands
2. When the VM breaks inside an SDK source, we map it back to a local file path (so that the user doesn't end up with two versions of the same file - one downloaded, and one the analyzer sent them to)

Change-Id: Ic1bdbed29196f98e612d81c383ad31ce241446b5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/221082
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2021-11-30 16:46:55 +00:00
Ben Konyi c39b243435 [ CLI ] Avoid awaiting on join() calls in test harness
Fixes #47750

Change-Id: I179a9e987cea157257d40d6e840e9f4ff5539877
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/221543
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: William Hesse <whesse@google.com>
2021-11-30 16:39:25 +00:00
Johnni Winther 1926ff8c67 [cfe] Add conditional import tests
Change-Id: If309f74ab7420e933c0942388780b57e8c3d63dc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/221622
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2021-11-30 13:06:45 +00:00
Johnni Winther aa5c2b3da6 [cfe] Handle field/getter/setter in ReferenceName equality
ReferenceName is used in equivalence testing to match reference
reguardless of whether the reference have associated nodes or
canonical names. The implementation didn't previously account for
fields, getters and setters with the same simple name, and would
wrongfully equate them.

Change-Id: Iacc8e0eb2c5c04a3cf11c3b5104a8f0441cf3ab6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/221621
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2021-11-30 12:37:55 +00:00
Clement Skau 7344e5e619 [test] Skip regress_47594_test in Product
Bug: https://github.com/dart-lang/sdk/issues/47811
Change-Id: I16af738c8d01c1b82052d6f1aaf55d1650143f11
Cq-Include-Trybots: luci.dart.try:vm-ffi-android-product-arm-try,app-kernel-linux-product-x64-try,vm-ffi-android-product-arm64c-try,vm-kernel-linux-product-x64-try,vm-kernel-mac-product-x64-try,vm-kernel-precomp-dwarf-linux-product-x64-try,vm-kernel-precomp-linux-product-x64-try,vm-kernel-win-product-x64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/221620
Auto-Submit: Clement Skau <cskau@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Daco Harkes <dacoharkes@google.com>
2021-11-30 11:11:04 +00:00
Johnni Winther 39533c285b [cfe] Pass tracked dill libraries through incremental compiler result
This avoids have tracked dill libraries as part of the incremental
compiler state, and avoids the need for public mutable state on the
incremental compiler.

Change-Id: Ia61f22499f619d7ead4eed23d3d1eb24b8caec9a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/221464
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
2021-11-30 11:07:34 +00:00
Johnni Winther f060f58c6e [cfe] Remove non-test access to targets on IncrementalCompiler
This is a move towards fully encapsulating the state of the incremental
compiler from outside usage.

Change-Id: I1243602aa6c4bcc3e6fbf8450bd8cdf7fa5ad5d8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/221327
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
2021-11-30 08:19:35 +00:00
Alexander Aprelev 8159c38d65 [vm/jit/unboxed] Remove heuristic that transitions unboxed fields back to boxed.
The heuristic was introduced in b870dafa4f, but gets in the way of maintaining Slot(extended with field guard information) immutable during compilation.

Existing set of benchmarks doesn't seem to show any reasonable regression with this heuristic removed.

Bug: https://github.com/dart-lang/sdk/issues/47722
Change-Id: Ie94050d96852b7ffef2dc81248cda23e84d41f4b
TEST=ci
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/221544
Reviewed-by: Slava Egorov <vegorov@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
2021-11-30 08:10:25 +00:00
Sam Rawlins bd57f9a837 analyzer: Explicitly return null in nullable return functions
Related to: https://github.com/dart-lang/sdk/issues/46656

Change-Id: I5c015e9827cc7b7ac26f198371709c124b6c28ea
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/221565
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2021-11-30 05:20:05 +00:00
Riley Porter fc560bab9e [package:js] Test optional default value arguments in extensions
Change-Id: Ia28d53bfca87dab143701ce0099a16580fdc14b3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/221560
Reviewed-by: Srujan Gaddam <srujzs@google.com>
Commit-Queue: Riley Porter <rileyporter@google.com>
2021-11-30 04:45:04 +00:00
Joshua Litt b735151bbc [dart2js] Restore test coverage for modular analysis.
Change-Id: Iedfc6c1779064db469c209545c361e047ee0318c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/221026
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Joshua Litt <joshualitt@google.com>
2021-11-30 01:02:34 +00:00
Konstantin Shcheglov 6091533c6e Issue 47804. Recompute invlaidated libraries after processing all changed files.
The issue has the discussion.

Bug: https://github.com/dart-lang/sdk/issues/47804
Change-Id: I301fe8fe44b0e8e7e3b413df0363fabc44061c7d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/221564
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-11-30 00:26:44 +00:00
Kenzie Schmoll 44b93338d9 Rev DevTools version to 2.9.1
Change-Id: I4cc6b0da6c482b5af8084a92b35a135bf5fb5848
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/221563
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Kenzie Schmoll <kenzieschmoll@google.com>
2021-11-29 23:24:05 +00:00
Sam Rawlins 976cffc4c2 Use strict-casts in js and dev_complier
strict-casts is mostly a drop-in replacement for the deprecated
`implicit-casts: false` option. One big difference, seen in this CL, is that
strict-casts will report a non-Iterable (or non-Stream) in a for-each loop.

Change-Id: Ibc463ae9c870b6a795483c5dea0d2b856e7fd883
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/221546
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2021-11-29 23:22:44 +00:00
Ryan Macnak ab0d8dc3b1 [vm] Emit timeline events around virtual memory allocation / deallocation.
TEST=ci
Change-Id: I0b29e2e6f7f530e29af0962f1243d708a1ca2225
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/220804
Reviewed-by: Dan Field <dnfield@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2021-11-29 23:06:34 +00:00
Clement Skau 034824f80e [test] Skip failing bots on regress_47594_test
- DartDev is not available on Android.
- DynamicLibrary.process() is not available on Windows.

Change-Id: I6606159168dd01e0fa0b9bc97b5316641123d42b
Cq-Include-Trybots: luci.dart.try:vm-kernel-precomp-android-release-arm_x64-try,vm-kernel-precomp-android-release-arm64c-try,vm-ffi-android-release-arm64c-try,vm-ffi-android-release-arm-try,vm-ffi-android-product-arm64c-try,vm-ffi-android-product-arm-try,vm-ffi-android-debug-arm64c-try,vm-ffi-android-debug-arm-try,vm-kernel-win-release-x64-try,vm-kernel-win-release-ia32-try,vm-kernel-win-product-x64-try,vm-kernel-win-debug-x64c-try,vm-kernel-win-debug-x64-try,vm-kernel-win-debug-ia32-try,vm-kernel-precomp-win-release-x64-try,vm-kernel-precomp-win-debug-x64c-try,vm-kernel-precomp-nnbd-win-release-x64-try,vm-kernel-nnbd-win-release-x64-try,vm-kernel-nnbd-win-release-ia32-try,vm-kernel-nnbd-win-debug-x64-try,pkg-win-release-try,dart-sdk-win-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/221500
Auto-Submit: Clement Skau <cskau@google.com>
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
2021-11-29 22:36:04 +00:00
Ben Konyi 9c8f51f538 [ VM / Service ] Fix crash when embedder service event is posted while
there is no current isolate

Fixes issue #46612

TEST=Existing tests, manual testing

Change-Id: I88e1f7185b0ccaa6dcd73ccae05935af074dcad4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/221562
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2021-11-29 21:45:04 +00:00
Nate Bosch 64ebe56f5f Add utf8 decoded context on ascii decode failures
Previously when a process emits unexpected content on `stdout` during startup
the `FormatException` was not useful, it would look something like:

```
FormatException: Invalid value in input: 226
dart:convert                                                 AsciiCodec.decode
package:dds/src/dap/protocol_stream_transformers.dart 91:28  PacketTransformer._parseHeaders
package:dds/src/dap/protocol_stream_transformers.dart 40:25  PacketTransformer.bind.<fn>.<fn>
```

When the failure comes form the ascii decode, give another attempt at
decoding with utf8 since that is a common character set for tool output.
Use that in the message for the exception to make it more useful for the
reader.

Now the failure will look like:

```
FormatException: Unable to decode headers with ascii. The stream has utf8 content:
Downloading package sky_engine...                                  472ms
Downloading flutter_patched_sdk tools...                           629ms
Downloading flutter_patched_sdk_product tools...                   615ms
Downloading linux-x64 tools...                                   1,782ms
Downloading linux-x64/font-subset tools...                         237ms
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Warning
──────────────────────────────────────────────────────────────────────────────
Your Flutter application is created using an older version of the Android
embedding. It is being deprecated in favor of Android embedding v2. Follow the
steps at

https://flutter.dev/go/android-project-migration

to migrate your project. You may also pass the --ignore-deprecation flag to
ignore this check and continue with the deprecated v1 embedding. However,
the v1 Android embedding will be removed in future versions of Flutter.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

Content-Length: 518
Content-Type: application/vscode-jsonrpc; charset=utf-8


package:dds/src/dap/protocol_stream_transformers.dart 95:7   PacketTransformer._parseHeaders
package:dds/src/dap/protocol_stream_transformers.dart 40:25  PacketTransformer.bind.<fn>.<fn>
```

Change-Id: I73dcd2e3de53c4af63ddfa0032a171f311be22d5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/221221
Auto-Submit: Nate Bosch <nbosch@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2021-11-29 21:27:04 +00:00
Konstantin Shcheglov 0eb9c34645 Prepare to publish analyzer 2.8.0 and _fe_analyzer_shared 31.0.0
Change-Id: I8abdd6050532b37e3c4d3c187fee61ff9eab8a3a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/221541
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-11-29 20:27:44 +00:00
Riley Porter d7a0cb74b1 [dart:html] Remove old scripts to generate docs.json
The scripts in tools/dom/docs were using Mirrors to
scrape the dart:html related libraries and generate
the docs.json file, which is also used for docs in
generating dart:html. With these scripts being out
of date and our general migration plans for dart:html,
we don't need these scripts anymore. We may still
generate our dart:html documentation in the future,
but it will involve a difference process.

No change to dart:html when running `go.sh`

Change-Id: Ie10af41b5dcff192be8961aa20c1ed493efa4593
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/221027
Reviewed-by: Srujan Gaddam <srujzs@google.com>
Commit-Queue: Riley Porter <rileyporter@google.com>
2021-11-29 20:13:54 +00:00
omerlevran46 35202a3c5f [fuchsia] use the binary tools in the fuchsia SDK
This commit moves from using the bash scripts to using the binary tools.

Closes https://github.com/dart-lang/sdk/pull/47749
https://github.com/dart-lang/sdk/pull/47749

GitOrigin-RevId: 4098a9c5d09e2c4e209edd8ac7490f2aacd1f85e
Change-Id: If4cdcb8472f15c4e8bb202828c4205b8859e9e69
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/221024
Reviewed-by: Liam Appelbe <liama@google.com>
Commit-Queue: Liam Appelbe <liama@google.com>
2021-11-29 19:53:14 +00:00
Gabriel Terwesten 02549a8bce [vm/ffi] Optimize Pointer<T>.asTypedList()
This change refactors `_asExternalTypedData` into multiple functions,
which are data type specific, e.g `_asExternalTypedDataInt8`.
These functions are implemented as recognized methods.
Argument checks have previously been performed in the removed
runtime entry implementation of `_asExternalTypedData.` These are
now handled in Dart.

TEST=tests/ffi/external_typed_data_test.dart

Closes https://github.com/dart-lang/sdk/issues/39843

Closes https://github.com/dart-lang/sdk/pull/47780
https://github.com/dart-lang/sdk/pull/47780

GitOrigin-RevId: 65763bddd06c633583b4adbf920c32c5a7a3720f
Change-Id: I703b350d89004ebe36e70eaa44dda1d9ebb050c7
Cq-Include-Trybots: luci.dart.try:vm-kernel-reload-rollback-linux-debug-x64-try,vm-kernel-reload-linux-debug-x64-try,vm-precomp-ffi-qemu-linux-release-arm-try,vm-ffi-android-debug-arm64c-try,vm-ffi-android-debug-arm-try,app-kernel-linux-debug-x64-try,vm-kernel-nnbd-linux-debug-x64-try,vm-kernel-win-debug-x64-try,vm-kernel-nnbd-mac-debug-x64-try,vm-kernel-linux-debug-ia32-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/221360
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
2021-11-29 17:38:04 +00:00
Tess Strickland 3670836588 [vm] Fix Instructions::Equals for the JIT.
As discovered by @blaugold on GitHub, Instructions::Equals can give a
false negative on the JIT if the GC flags in the object header are set
differently.

This CL changes Instructions::Equals to only compare the
Instructions-specific portion of the object, namely the size_and_flags_
field and the content bytes. If those match, then the important parts of
the object header match: the cid is always kInstructionsCid, as the
Equals method assumes non-null instances, and the size in the object
header is calculated using the content size from size_and_flags_.

TEST=Manually ran failing tests after cherry picking CL 221360 on top.

Bug: https://github.com/dart-lang/sdk/issues/39843
Change-Id: I25c25bbe6b1bf615d4cd923bfe871da7e929822a
Cq-Include-Trybots: luci.dart.try:vm-kernel-precomp-dwarf-linux-product-x64-try,vm-kernel-precomp-linux-product-x64-try,vm-kernel-precomp-linux-release-x64-try,vm-kernel-linux-product-x64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/221467
Commit-Queue: Tess Strickland <sstrickl@google.com>
Reviewed-by: Daco Harkes <dacoharkes@google.com>
2021-11-29 12:37:44 +00:00
Tess Strickland 6faa4b70c3 [vm/compiler] Resolve sentinel comparisons when possible.
For StrictCompare instructions where one side is the sentinel value and
the other side has a CompileType that cannot be the sentinel, propagate
a false (if EQ_STRICT) or true (if NE_STRICT) constant for that
comparison.

TEST=vm/cc/ConstantPropagator_StrictCompare

Change-Id: I96e4bde1a02fa841987964491c5fff176fdf82a6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/220769
Commit-Queue: Tess Strickland <sstrickl@google.com>
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2021-11-29 11:26:24 +00:00
Clement Skau bd4a27ff81 [vm/ffi] Adds transition information to FFI leaf calls.
This change sets `top_exit_frame_info` and `vmtag` on FFI leaf calls.
We have to set this info on the thread so that the stack walker can
interpret the frame correctly.
Without it, anyone trying to walk the stack during an FFI leaf call
- like the profiler - will misinterpret the top frame and cause
a segfault.

TEST=Added regression test.

Bug: https://github.com/dart-lang/sdk/issues/47594
Change-Id: If83aeab194aa0213aee82558bb9541cd7294a935
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/220360
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Clement Skau <cskau@google.com>
2021-11-29 10:12:36 +00:00
Vyacheslav Egorov 3d34ec1dbf Revert "[vm] When run under TSAN use longjmp() to skip over C++ frames before manually unwinding to the catch entry"
This reverts commit 20e6a4dc92.


Revert "[gardening] Fix Product TSAN build by fixing accidental ReleaseTSANX64 -> ProductTSANX64 issue"

This reverts commit e6c24f934e.

Reason for revert: to unblock Google3 roll.

TEST=revert

Change-Id: If22e17d514a81829a9eeb5585257fc477026ea63
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/221465
Auto-Submit: Slava Egorov <vegorov@google.com>
Commit-Queue: Slava Egorov <vegorov@google.com>
Reviewed-by: Emmanuel Pellereau <emmanuelp@google.com>
2021-11-29 09:34:23 +00:00
Martin Kustermann 89f744c4e4 [gardening] Remove corelib/regexp/capture-3_test from iso-stress runs
The test will cause a crash inside TSAN - most likely due to a overflow
in TSAN's shadow stack (which has a fixed size). These out-of-bound
writes will corrupt memory causing the failures.

The reduction of thist test:

  main() {
    final regexp = RegExp(('a*' * 200) + '\u0100*\\w');
    regexp.firstMatch('a');
  }

will cause a crash when running under TSAN:

  % out/ReleaseTSANX64/dart test.dart
  zsh: segmentation fault  out/ReleaseTSANX64/dart

inside TSAN. It happens in the RegExp frontend which - due to recursive
nature - has very large stack.

TEST=Fixes one false-positive that makes "iso-stress" builder red.

Change-Id: Icabe5b35f8724ef042325e1dfe821d9aba5ea28e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/221460
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2021-11-26 16:22:04 +00:00
Martin Kustermann a3fa6b4c52 [vm] Fix one race reported in DEBUG+TSAN mode
The SafepointHandler::IsOwnedByTheThread() is used in a few
ASSERT()/RELEASE_ASSERT() and accesses the [owner_] field
unsynchronized.

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

TEST=Fixes one race reported when building TSAN in DEBUG mode.

Change-Id: I64371265d60c9bb68c299d1c1e8abc2175b33bc8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/221331
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2021-11-26 15:52:53 +00:00
Jukka-Pekka Siitonen d7e55c4d1b Documentation update for SplayTreeMap and SplayTreeSet
Code examples added for SplayTreeMap and SplayTree set, minor text updates.

Closes https://github.com/dart-lang/sdk/pull/47721
https://github.com/dart-lang/sdk/pull/47721

GitOrigin-RevId: d043550a23da2699a84e360c20cf4915ae87d59f
Change-Id: I09dae91347ef66324056eaf12f26e4547b047817
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/220483
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Commit-Queue: Michael Thomsen <mit@google.com>
2021-11-26 15:41:16 +00:00
hacker1024 ede839fbf7 Mention Object.hashCode in the note about LinkedHashSet in the Set documentation
The note about `LinkedHashSet` in the `Set` documentation is a little misleading, and it can lead developers to implement `==` without `hashCode`, only to be confused when their set doesn't work correctly.

See this [StackOverflow question](https://stackoverflow.com/questions/69664073/dart-comparison-of-objects-within-a-list/69694646#69694646), for example.

This PR mentions `Object.hashCode` along with `Object.==` in the `Set` documentation explaining `LinkedHashSet`.

Closes https://github.com/dart-lang/sdk/pull/47537
https://github.com/dart-lang/sdk/pull/47537

GitOrigin-RevId: 110a2d8181d4cdce90a576a7d0b5de523f0da6e6
Change-Id: Ic141383d5fa9fa2f9f733611df714041f783e1d2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/217861
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Commit-Queue: Michael Thomsen <mit@google.com>
2021-11-26 14:29:23 +00:00
Martin Kustermann e6c24f934e [gardening] Fix Product TSAN build by fixing accidental ReleaseTSANX64 -> ProductTSANX64 issue
This is a follow-up to

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

TEST=ci

Change-Id: I823298b057750ffb49949a32f15dfc54c40b5ce4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/221330
Auto-Submit: Martin Kustermann <kustermann@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2021-11-26 14:23:24 +00:00
Chloe Stefantsova 8d80fbfa6c [cfe] Create RHS of typedefs in erroneous cases
Closes https://github.com/dart-lang/sdk/issues/47728

Bug: https://github.com/dart-lang/sdk/issues/47728
Change-Id: Iaa12f1e2f260141801b9b8ddafecba508dc6d3ac
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/220008
Commit-Queue: Chloe Stefantsova <cstefantsova@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Clement Skau <cskau@google.com>
2021-11-26 14:08:22 +00:00
Martin Kustermann 20e6a4dc92 [vm] When run under TSAN use longjmp() to skip over C++ frames before manually unwinding to the catch entry
TSAN instruments C++ code by adding prologue/epilogue code which
maintains a shadow stack. Using setjmp()/longjmp() is intercepted by
TSAN and correspondingly unwinds the shadow stack.

When Dart VM throws exceptions we call the JumpToFrame stub
from C++ which will directly reset the stack to the exception handler
catch entry. This leaves the TSAN shadow stack unchanged.

This means whenever an exception is thrown we leak frames in TSAN's
shadow stack. Due to using a fixed-size shadow stack, it will cause a
buffer-overflow in TSAN when too many such frame leaks happen. This can
cause arbitrary memory to be overriden, leading to awkward crashes.

This is especially an issue on the "iso-stres" builder because it
launches - in the same process - *many* small tests, more easily hitting
that limit.

This CL will workaround the TSAN issue by making runtime call save it's
state via setjmp() and make exception throughing process go via
longjmp() (which TSAN will intercept) before actually calling the
JumpToFrame stub.

=> This will ensure the TSAN shadow stack is correctly maintained.

The [jmp_buf]'s encoding of register state is non-trivial (e.g. it uses
XOR'ing of the actual saved state under certain glibc versions). So we
store any state we need to pass to the target of the `longjmp()` on the
[Thread] instead of overriding the [jmp_buf]s register state with the
arguments.

Issue https://github.com/dart-lang/sdk/issues/47472#issuecomment-948235479

TEST=vm/dart{,_2}/regress47472_test.dart

Change-Id: I4b6f0d4eacef85487c55999021d72a6d932facad
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/221083
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2021-11-26 12:57:04 +00:00
Johnni Winther e1c9640279 [cfe] Rename direct_parser_ast files to parser_ast
Change-Id: I10ef96413f7f91704d0ca29d12ded2b034dc0406
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/221326
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
2021-11-26 12:51:46 +00:00
Johnni Winther 9788371d7d [cfe] Rename DirectParserASTContent to ParserAstNode
+ remove DirectParserASTContent prefix from subclasses.

Change-Id: I766a426ae9f9f1d43919abc27728535ba6e71e8f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/221324
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2021-11-26 12:43:04 +00:00
Jonas Termansen 73d1ccb2af [infra] Rely on the default ACL when uploading release artifacts.
The dart-archive bucket default ACL has been changed to make all
uploaded objects public. Therefore, we no longer need to specify an ACL
on upload. This change enables the scripts to work with uniform bucket
ACLs.

The bucket cannot be switched to uniform ACLs until this change reaches
the stable branch or it won't be possible to release Dart.

This change removes the uses of the gsutil -a public-read option from
the release scripts.

Change-Id: I27a76b9849771ddc380576ffe962926ebfbf4fc6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/221341
Commit-Queue: Jonas Termansen <sortie@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
2021-11-26 11:34:04 +00:00
Alexander Thomas ef181bbc29 [test] Skip Language/Types/Interface_Types/subtype_t27
The test is causing frequent CQ failures right now.

Bug: https://github.com/dart-lang/sdk/issues/42641
Change-Id: I46727cab95eb8da5feec7de860426e94d5875314
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/221325
Auto-Submit: Alexander Thomas <athom@google.com>
Commit-Queue: Alexander Thomas <athom@google.com>
Reviewed-by: William Hesse <whesse@google.com>
2021-11-26 11:31:23 +00:00
Jens Johansen ad6ffaab95 [CFE] First stab at prototype for textually extracting outlines
Change-Id: Ib84b47f0acb553cee6d891d7bbcf865f4a57a65a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/221080
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2021-11-26 06:14:44 +00:00
Joshua Litt 4f6d813c3c [dart2js] Add '--no-summary' to compute_kernel.
Change-Id: Ie3493137794c95f5061ed7d2918568127c5e15ff
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/221220
Commit-Queue: Joshua Litt <joshualitt@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2021-11-25 23:39:24 +00:00
Stephen Adams 12dae45e5a [corelib] Properly check radix in BigInt.toRadixString.
Change-Id: Ieb1b541db3c35984f4a75b618f9df1c82f4d37da
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/221201
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2021-11-25 22:53:53 +00:00
Jukka-Pekka Siitonen a98368c250 Documentation update for LinkedHashMap
Added example code blocks for LinkedHashMap class and includes some minor textual updates to comments.

Closes https://github.com/dart-lang/sdk/pull/47706
https://github.com/dart-lang/sdk/pull/47706

GitOrigin-RevId: 86bded093f3304169aa97d7d6d0e64932ad184be
Change-Id: I8aa18dc04fb67498277c214916a3076428244a00
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/220301
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
2021-11-25 15:31:25 +00:00
Jukka-Pekka Siitonen 3875e69a79 Documentation update for LinkedHashSet
Example code added for LinkedHashSet and small text updates to file

Closes https://github.com/dart-lang/sdk/pull/47719
https://github.com/dart-lang/sdk/pull/47719

GitOrigin-RevId: 4adb1a8de63d3f8fbefa8f3deaa488608f781e87
Change-Id: I4a3054b3cafbeebce54bebbf95a7536cc7d43545
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/220521
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
2021-11-25 15:27:33 +00:00
Jukka-Pekka Siitonen a39c72c02e Documentation update for LinkedList
Example code added for LinkedList

Closes https://github.com/dart-lang/sdk/pull/47720
https://github.com/dart-lang/sdk/pull/47720

GitOrigin-RevId: 12abe1196e415eba4d04e4af664ce488e710a266
Change-Id: I00ae7d11ffbbe6d4efe746619794db456df7a4f4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/220522
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
2021-11-25 15:26:21 +00:00
Jukka-Pekka Siitonen e2a81d790d Documentation update for ListQueue and Queue
Code examples added for queue usage

Closes https://github.com/dart-lang/sdk/pull/47723
https://github.com/dart-lang/sdk/pull/47723

GitOrigin-RevId: 699fecc8d4f49755008d0e9e7aff59c5edec6642
Change-Id: Idc16e25fd19838e5d9c1c2b0917ba2776e8001c4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/220486
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
2021-11-25 15:26:05 +00:00
Jukka-Pekka Siitonen 7467e15c43 Documentation update for HashMap
Added example codes for HashMap - small updates to description text.

Closes https://github.com/dart-lang/sdk/pull/47716
https://github.com/dart-lang/sdk/pull/47716

GitOrigin-RevId: 807b2dd4b1d6d76089001105c2eb30149f59fa81
Change-Id: Iaf83fb38695e85663fe42035b64d0b4d82187ec5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/220500
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
2021-11-25 15:25:45 +00:00
Jukka-Pekka Siitonen 89e052ed2f Documentation update for HashSet
HashSet example code added, update to description of class and minor text updates

Closes https://github.com/dart-lang/sdk/pull/47717
https://github.com/dart-lang/sdk/pull/47717

GitOrigin-RevId: 4ce6de9451f837ec362265082bae80d0587b7167
Change-Id: I6d67a40e20c3ae7894593250649ad4f53907a235
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/220520
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
2021-11-25 15:25:18 +00:00
Johnni Winther 87c953bd0c [cfe] Pass class hierarchy and core types through IncrementalCompilerResult
TEST=existing

Change-Id: I78a61147998a630d88997e0cebccb3e815592822
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/221088
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
2021-11-25 11:27:29 +00:00
Michal Terepeta 7d39d2dd51 Revert "[ VM / Service ] Omit private fields from service responses by default"
This reverts commit 75abd86407.

Reason for revert: Breaks internal tests (http://b/207612278)

Original change's description:
> [ VM / Service ] Omit private fields from service responses by default
>
> Service responses and events previously could include "private"
> properties, which have names starting with "_". This change removes
> these properties from service objects unless explicitly requested via a
> private parameter.
>
> See go/smaller-dart-vm-service-responses for response size reduction
> data.
>
> TEST=Existing service suite
>
> Change-Id: Ia65b14872e798eaa843f7d180c57721b82371d0b
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/221143
> Commit-Queue: Ben Konyi <bkonyi@google.com>
> Reviewed-by: Ryan Macnak <rmacnak@google.com>

# Not skipping CQ checks because original CL landed > 1 day ago.

Change-Id: I0b015baadfcdf4211426efa9a92804b163f88649
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/221280
Reviewed-by: Michal Terepeta <michalt@google.com>
Reviewed-by: Clement Skau <cskau@google.com>
Commit-Queue: Michal Terepeta <michalt@google.com>
2021-11-25 10:28:33 +00:00