Commit graph

81576 commits

Author SHA1 Message Date
pq 281b0d3257 linter 1.11.0
Change-Id: I81870800408fe15fdbc0fedebbb5d4d8f8fd15ab
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/212480
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
2021-09-07 20:55:46 +00:00
Nate Bosch 193610d9f8 Update to the latest package:collection
Change-Id: I0d51668fa7279eea93478048ac3e07c65e3ebca1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/212626
Auto-Submit: Nate Bosch <nbosch@google.com>
Commit-Queue: Nate Bosch <nbosch@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2021-09-07 20:38:56 +00:00
Nate Bosch fd675c17e9 Update to the latest package:csslib
Change-Id: I08c6450e398c8d4b9a16ef484ef714280bd034a8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/212625
Auto-Submit: Nate Bosch <nbosch@google.com>
Commit-Queue: Nate Bosch <nbosch@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2021-09-07 20:29:02 +00:00
Alexander Thomas 6a68128a80 [sdk] Update checked-in SDKs to 2.15.0-82.0.dev
Change-Id: I0ee1fc41a110942fe1d54e63de49338650d3c3e5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/212591
Auto-Submit: Alexander Thomas <athom@google.com>
Commit-Queue: Alexander Thomas <athom@google.com>
Commit-Queue: William Hesse <whesse@google.com>
Reviewed-by: William Hesse <whesse@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2021-09-07 20:22:36 +00:00
Konstantin Shcheglov 3e6ece2bd6 Support for constructor tear-offs in rename refactoring.
Change-Id: Ia6b32e8ac24cfecbc915c008ce78f2a8b561c7a4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/212623
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-09-07 20:21:00 +00:00
pq 3e0456e70b fix cascade targeting for result use checking
Change-Id: I325eb2bc0bfbe199793c3724ff2894e9cc93e840
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/212624
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
2021-09-07 20:12:24 +00:00
Daco Harkes 2816eba69e [gardening] Skip complex_reload_test
Bug: https://github.com/dart-lang/sdk/issues/47130

TEST=disables failing/flaky test

Change-Id: Idf91a4a654ecd52dbeec3271750c61f18aafeab5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/212589
Auto-Submit: Daco Harkes <dacoharkes@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2021-09-07 20:05:14 +00:00
Alexander Markov 16e8dc257e [vm] Faster double.floor()/ceil()/truncate() in AOT mode (x64, arm64)
1) double.truncate() now simply calls toInt(), omitting
truncateToDouble() call.

2) double.floor() and ceil() are now intrinsified on arm64 and AOT/x64
and generated using DoubleToInteger instruction.

3) DoubleToInteger instruction is extended to support floor and ceil.
On arm64 DoubleToInteger is implemented using fcvtms and fcvtps
instructions. On x64 DoubleToInteger is implemented using roundsd
under a check if it is supported (with a fallback to a stub and a
runtime call).

AOT/x64:
Before: BenchFloor(RunTime): 318.82148549569655 us.
After:  BenchFloor(RunTime): 133.29430189936687 us.

TEST=ci
Closes https://github.com/dart-lang/sdk/issues/46876
Closes https://github.com/dart-lang/sdk/issues/46650

Change-Id: I16ca18faf97954f8e8e25f0b72a2bbfac5bdc672
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/212381
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Slava Egorov <vegorov@google.com>
2021-09-07 19:52:04 +00:00
Janice Collins 176a0f42f5 Update dartdoc to 3.0.0.
Release notes: https://github.com/dart-lang/dartdoc/releases/tag/v3.0.0

Change-Id: I70eb988e7912a1c1fb065f9ee06bcde770fd37e6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/212622
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Janice Collins <jcollins@google.com>
2021-09-07 19:49:54 +00:00
Ahmed Ashour ac840e5dc7 Fix grammar in quick_fix.md
Fixes #47129

Change-Id: I16ce124f43d661e59ede174fbdd346705b00a539
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/212583
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2021-09-07 18:58:54 +00:00
Sam Rawlins 956cdb63d6 Check function-typed type annotations in const ctor calls for type params
These checks have just been missing from analyzer since the small
features feature.

Change-Id: I38ceb4f9baf7289807efff63af9e6f97fd73ae5d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/212601
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2021-09-07 18:36:23 +00:00
Konstantin Shcheglov 06f0ecb8e8 Add more HighlightRegionType.xyz_TEAR_OFF
Change-Id: I357d621439c68b77545bdd01719310c60684e1f9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/212602
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-09-07 18:31:03 +00:00
Nate Bosch 68bbdf3718 Update to the latest package:yaml
Change-Id: I4552b3e241dda9d3b720e0da699ec70c14a70640
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/212620
Auto-Submit: Nate Bosch <nbosch@google.com>
Commit-Queue: Nate Bosch <nbosch@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2021-09-07 18:14:23 +00:00
Srujan Gaddam bda31c2c13 [dart:html] Update Trusted Types APIs
Closes b/195948578

Modifies Trusted Types APIs to be compliant with the spec in
https://w3c.github.io/webappsec-trusted-types/dist/spec/.

Change-Id: I65d52ace12342ce777ab596a9dd2e9a3f74b2f05
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/212270
Commit-Queue: Srujan Gaddam <srujzs@google.com>
Reviewed-by: Riley Porter <rileyporter@google.com>
2021-09-07 18:03:18 +00:00
pq b3cb952a69 fixed Linter CHANGELOG entry
Follow-up from:

https://dart-review.googlesource.com/c/sdk/+/210500/12/CHANGELOG.md
https://dart-review.googlesource.com/c/sdk/+/209765/3/CHANGELOG.md

Change-Id: I6524f93dc8d75331cf7a5910d01a9186d78f4911
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/212600
Commit-Queue: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
2021-09-07 17:14:33 +00:00
Alexander Markov 74dc879d25 [vm/compiler] Optimize 'double == int' in AOT
TEST=vm/cc/IRTest_DoubleEqualsSmi
Fixes https://github.com/dart-lang/sdk/issues/47031

Change-Id: I6395ae50806b238971872b375c495962cb868cb1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/212484
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2021-09-07 17:06:43 +00:00
Konstantin Shcheglov 74d2704382 Separate index/search kind for ConstructorReference.
When we just search, it is enough to know that there is just any
reference kind, however wheb I attempted to implemented rename
refactoring, I realized that we need to know if the reference is
from a ConstructorReference, so `.new` is required.

I think this change will let us do this, however I still have not
tried to actually wire it, so might still be wrong.

Change-Id: Ie97e23d391ea89d7f3695663368835e747cbeee5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/212546
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-09-07 16:52:32 +00:00
Ahmed Ashour 20a8d62cca Enable ADD_CONST for bulk
Fixes #47001

Change-Id: Ia42affb8f26e69f94e12192458e68bc29e848ed9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/211446
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2021-09-07 16:39:32 +00:00
Alexander Aprelev 78116e1d2c [vm/switchable_calls] Clean up assert in monomorphic miss jit handler.
The check for number of isolates was racy because isolates might be exiting, number of isolates in the group going down as we enter ic cache miss runtime handler.
This caused flaky failures on debug buildbots.

TEST=ci
Fixes https://github.com/dart-lang/sdk/issues/47132

Change-Id: Ie78a80fecb30d2cc40635acd465078cb0f22a234
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/212487
Commit-Queue: Alexander Aprelev <aam@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2021-09-07 16:24:24 +00:00
Konstantin Shcheglov 1957af707c Use CONSTRUCTOR_TEAR_OFF for ConstructorReference highlighting.
Change-Id: Iee9731ef6e273ae89bc5328d6941aa8ddd530562
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/212488
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-09-07 16:08:02 +00:00
Daco Harkes 40bbb6dcc2 [vm] Const map, remove invalid assert
Isolates are allowed to race each other to initialize _indexNullable,
the last isolate wins. See
https://dart-review.googlesource.com/c/sdk/+/210726 and
https://dart-review.googlesource.com/c/sdk/+/203765.

These asserts were wrong, because another isolate could have initialized
_indexNullable in between places calling _createIndex and _createIndex
itself.

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

Change-Id: I5d55b9715ef622737a6f70c0b57590076ece3225
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/212586
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
2021-09-07 15:47:22 +00:00
Johnni Winther bc1c71fd9b [cfe] Handle un-inlined fields/locals in eager instantiation constantification
Closes #47108

TEST=existing

Change-Id: I590939161cde1316eede7d828dff5fe6ac2790fd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/212577
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2021-09-07 15:14:36 +00:00
Daco Harkes 015c4e604a [vm] Bail out inlining on wrong optional arguments
TEST=runtime/tests/vm/dart/regress_flutter89482_test.dart

Before: assert (debug mode)
After:
  Closure Calls (1)
  => other (deopt count 0)
     Bailout: optional arg mismatch

Bug: https://github.com/flutter/flutter/issues/89482

Change-Id: I5b0a9b738465d12c47304e9309bfa8f701c5aae6
Cq-Include-Trybots: luci.dart.try:vm-kernel-precomp-linux-debug-x64c-try,vm-kernel-precomp-linux-debug-x64-try,vm-kernel-precomp-nnbd-linux-debug-x64-try,vm-kernel-precomp-nnbd-linux-debug-simarm_x64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/212570
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2021-09-07 14:32:22 +00:00
Martin Kustermann 6ac8ad9881 [vm/concurrency] Ensure unreachable new space objects use null filler objects instead of 0 Smis
The new space allocated objects created by transitive object copy are
themselves always GC safe. If an invalid object is encountered and the
copy is aborted, there will be unreachable, allocated new space objects
left, that the next scavenge will reclaim.

If an object in the heap is unreachable it shouldn't really be touched
(not even by GC). Only heap iterations can possibly look at them.

Turns out that hot reload performs heap iterations without collecting
all garbage first. That means it can encounter such an unreachable
object.

Hot reload assumes that it can (for instances of generic classes) always
get a valid TypeArguments vector (or null) - though it encountered 0
instead.

So there's several solutions:

  * Make Hot-Reload only work on actually alive objects.
  * Make the unreachable objects have null instead of 0 in them

We'll choose the latter and use the existing Object::InitializeObject()
helper method (although it will be slower than the existing
implementation).

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

TEST=Fixes vm/dart_2/isolates/closures_without_captured_variables_test in hot-reload test mode.

Change-Id: I15d48473f0ce4a856316fe24166e81ebc87ccdbd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/212585
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2021-09-07 14:16:52 +00:00
Martin Kustermann 258487cafd [vm] If isolate group spawning fails, we need to enter the IG in order to delete the api state
Fixes https://github.com/dart-lang/sdk/issues/47087

TEST=Fixes vm/dart_2/spawn_shutdown_test/1 test failure.

Change-Id: I416c4732d71eed9fe6fb26b8a5ce12ed5b122d4d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/212584
Commit-Queue: Martin Kustermann <kustermann@google.com>
Auto-Submit: Martin Kustermann <kustermann@google.com>
Reviewed-by: Daco Harkes <dacoharkes@google.com>
2021-09-07 14:08:32 +00:00
Danny Tuppeny e161187728 [dds] Refactor some DAP classes in preperation for "dart test" adapter
Change-Id: Ice48b45c0ad11a1981e8e4115bb8de6d009d7b5a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/212062
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2021-09-07 14:03:03 +00:00
Jens Johansen eb808b0e35 [CFE] Fix dependency pruning in regards to constant evaluation
Change-Id: I82226c433e28ada640b4fa102f9def506a2e8758
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/212466
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2021-09-07 10:53:42 +00:00
Dmitry Stefantsov 0a9d14a8e3 [cfe] Adjust computation of nullability in flatten
Closes #47057.

Bug: https://github.com/dart-lang/sdk/issues/47057
Change-Id: Iad719192d0ecbe97461bfed868899072a6dd52e2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/212467
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Dmitry Stefantsov <dmitryas@google.com>
2021-09-07 10:40:44 +00:00
Dmitry Stefantsov ab508bb2d1 [cfe] Add basic parsing support for extension show clause
Change-Id: I63847a06ff7370dd1b92fc6b4b706c684f15638e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/209909
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Dmitry Stefantsov <dmitryas@google.com>
2021-09-07 10:35:12 +00:00
Jens Johansen ccfe2d65a9 [CFE] Fix weak status entry for general/external_import
Change-Id: I6c28ccee258b470c4630f374f5b42cd3a63dc280
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/212581
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2021-09-07 10:32:42 +00:00
Alexander Thomas a6d840054d [co19] Roll co19 to 4aae571b0358e2f063ab68f2eb92857e31deb0b9
2021-09-06 sgrekhov@unipro.ru Assertion updated in constructor tear-off ambiguities tests
2021-09-06 sgrekhov@unipro.ru Fixes 1191. Generic instantiation of 'call' method is now allowed

Cq-Include-Trybots: dart/try:analyzer-nnbd-linux-release-try,dart2js-nnbd-linux-x64-chrome-try,ddc-nnbd-linux-release-chrome-try,front-end-nnbd-linux-release-x64-try,vm-kernel-nnbd-linux-release-x64-try,vm-kernel-precomp-nnbd-linux-release-x64-try
Change-Id: I071c79dec550970ed74f6cc3b3a4fc9a071b0387
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/212578
Reviewed-by: William Hesse <whesse@google.com>
2021-09-07 09:52:24 +00:00
Dmitry Stefantsov d120af39c6 [cfe] Fix crash on const constructor tear-off
Closes #46133.

Bug: https://github.com/dart-lang/sdk/issues/46133
Change-Id: I73035d2b27a2d8116fa7c31abdebfdd7299d6898
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/212572
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Dmitry Stefantsov <dmitryas@google.com>
2021-09-07 09:39:32 +00:00
Sergey G. Grekhov c14d66253c [co19] Re-enable fixed tests
This CL re-enables (except on platforms that don't support them):
Language/Libraries_and_Scripts/Scripts/top_level_main_t01
Language/Expressions/Numbers/syntax_t34

Cq-Include-Trybots: dart/try:analyzer-nnbd-linux-release-try,dart2js-nnbd-linux-x64-chrome-try,ddc-nnbd-linux-release-chrome-try,front-end-nnbd-linux-release-x64-try,vm-kernel-nnbd-linux-release-x64-try,vm-kernel-precomp-nnbd-linux-release-x64-try
Change-Id: I10a1b1c9abc125c000cc9e9ba7d749b8766e193d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/212563
Reviewed-by: William Hesse <whesse@google.com>
Commit-Queue: Alexander Thomas <athom@google.com>
2021-09-06 17:30:57 +00:00
Kevin Moore f42cc14c3c Fix link to native extensions deprecation issue
Follow-up to bda70c8489

Change-Id: I76f042a08a6d313bfdee297b078e01fd81784b97
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/212545
Auto-Submit: Kevin Moore <kevmoo@google.com>
Reviewed-by: Slava Egorov <vegorov@google.com>
2021-09-06 16:46:53 +00:00
Johnni Winther 8f270ea432 [cfe] Handle external extension instance fields
Change-Id: Ia6d397e2be3cc46f252b679007f6f7b45096420f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/212569
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2021-09-06 15:52:39 +00:00
Lasse R.H. Nielsen 2b41685519 Move the CHANGELOG entry for dart:cli deprecation to 2.15.0
Change-Id: I73bfdd310af6df6cc1d62311e155fc432b84165d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/212567
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Auto-Submit: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
2021-09-06 12:26:11 +00:00
Ahmed Ashour f1ded6af56 Remove import dart:core
Fixes #47092

TEST=existing

Change-Id: I3c5c0a1ec5e0426642a5dc70aa9a0391a143ed93
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/212298
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2021-09-06 11:57:40 +00:00
Daco Harkes 2b5adb7231 [vm] Implement constant Maps in the VM
This CL changes the frontend to emit map and set constants which are
then processed by the constant reader in the VM.

This CL also introduces support for sending the const maps and sets
in messages between isolates and saving it in snapshots.

TEST=tests/language/const/map_test.dart (et al, for lookups)
TEST=tests/lib/isolate/message3_test.dart (et al, for isolate messages)
TEST=tools/test.py -c dartkp (for consts from clustered snapshot)
TEST=tools/test.py -n app_jitk-linux-debug-x64 (for consts from app
     jit snapshots)
TEST=Building the SDK which uses const Maps in clustered snapshots.

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

Change-Id: I1f8150a8aba8298c4e64d2571dd147743526135a
Cq-Include-Trybots: luci.dart.try:analyzer-nnbd-linux-release-try,app-kernel-linux-debug-x64-try,dart-sdk-linux-try,front-end-nnbd-linux-release-x64-try,pkg-linux-debug-try,vm-canary-linux-debug-try,vm-kernel-asan-linux-release-x64-try,vm-kernel-checked-linux-release-x64-try,vm-kernel-linux-debug-x64c-try,vm-kernel-linux-debug-x64-try,vm-kernel-linux-debug-simarm64c-try,vm-kernel-nnbd-linux-release-simarm-try,vm-kernel-optcounter-threshold-linux-release-x64-try,vm-kernel-precomp-android-release-arm_x64-try,vm-kernel-precomp-linux-debug-x64-try,vm-kernel-precomp-linux-debug-x64c-try,vm-kernel-reload-linux-debug-x64-try,vm-kernel-reload-rollback-linux-debug-x64-try,vm-precomp-ffi-qemu-linux-release-arm-try,vm-kernel-precomp-linux-debug-simarm_x64-try,vm-kernel-precomp-linux-debug-x64-try,vm-kernel-precomp-tsan-linux-release-x64-try,vm-kernel-tsan-linux-release-x64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/203765
Reviewed-by: Martin Kustermann <kustermann@google.com>
2021-09-06 06:28:59 +00:00
Daco Harkes e8e9e1d152 [vm] Introduce immutable maps and sets in backend
This CL introduces immutable maps and sets in the VM backend but does
not yet target them from the frontend. The changes are tested by unit
tests constructing these immutable maps and sets.

This CL introduces immutable variants of the hash map and set in
compact_hash.dart and recognizes them in the VM. The immutable ones
use a different mixin with a different recognized method for accessing
members.
* Data list is an immutable list with a different cid. (Otherwise the
  optimizer notices that immutable and mutable lists cannot be equal.)
* Index is a nullable mutable typed data. (Otherwise optimizer removes
  necessary null checks.)
* Index should use a store-release barrier when written to.

Multiple isolates might lazily compute the index for const sets and
maps. This is fine because all identityHashCodes and hashCodes are
guaranteed to be race-free. The later isolates will override the index
pointer with an identical index.

This CL does not introduce support for using these immutable maps and
sets in AOT (clustered_snapshot) and in messages to other isolates
(message_snapshot) because that is harder to test with unit tests. That
will be added in the follow-up CL.

Design doc: go/dart-vm-const-maps

TEST=runtime/vm/object_test.cc

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

Change-Id: I4042179c15e8b37692d3255655351c01c7124991
Cq-Include-Trybots: luci.dart.try:analyzer-nnbd-linux-release-try,app-kernel-linux-debug-x64-try,dart-sdk-linux-try,front-end-nnbd-linux-release-x64-try,pkg-linux-debug-try,vm-canary-linux-debug-try,vm-kernel-asan-linux-release-x64-try,vm-kernel-checked-linux-release-x64-try,vm-kernel-linux-debug-x64c-try,vm-kernel-linux-debug-x64-try,vm-kernel-linux-debug-simarm64c-try,vm-kernel-nnbd-linux-release-simarm-try,vm-kernel-optcounter-threshold-linux-release-x64-try,vm-kernel-precomp-android-release-arm_x64-try,vm-kernel-precomp-linux-debug-x64-try,vm-kernel-precomp-linux-debug-x64c-try,vm-kernel-reload-linux-debug-x64-try,vm-kernel-reload-rollback-linux-debug-x64-try,vm-precomp-ffi-qemu-linux-release-arm-try,vm-kernel-precomp-linux-debug-simarm_x64-try,vm-kernel-precomp-linux-debug-x64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/210860
Reviewed-by: Martin Kustermann <kustermann@google.com>
2021-09-06 06:28:59 +00:00
Daco Harkes 32f6f94ab5 [vm] Add store release barrier option to StoreInstanceInstr
In dependent CL, const maps and sets can be shared between isolates in
the same isolate group before the index is lazily populated. To prevent
one isolate from seeing a non-null index pointer, while not all writes
to the index itself are visible to the isolate (the mutator thread of
that isolate), we use a store release barrier on arm architectures.

This CL adds a store release barrier option to the StoreInstanceField
instruction to be used in the dependent CL.

Even though there is no barrier on x64 and ia32, we still also use the
option on these architectures because on x64 we signal the barrier to
TSAN.

The stlr instruction on arm64 does not feature an address operand.
Therefore we need to branch in the assembler on whether we're using
a store-release before we construct an Address.

Design doc: go/dart-vm-const-maps

TEST=Dependent CL, split off for ease of reviewing.

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

Change-Id: I6563aa3c813319a23e815b862ca5caabb805dc9e
Cq-Include-Trybots: luci.dart.try:analyzer-nnbd-linux-release-try,app-kernel-linux-debug-x64-try,dart-sdk-linux-try,front-end-nnbd-linux-release-x64-try,pkg-linux-debug-try,vm-canary-linux-debug-try,vm-kernel-asan-linux-release-x64-try,vm-kernel-checked-linux-release-x64-try,vm-kernel-linux-debug-x64c-try,vm-kernel-linux-debug-x64-try,vm-kernel-linux-debug-simarm64c-try,vm-kernel-nnbd-linux-release-simarm-try,vm-kernel-optcounter-threshold-linux-release-x64-try,vm-kernel-precomp-android-release-arm_x64-try,vm-kernel-precomp-linux-debug-x64-try,vm-kernel-precomp-linux-debug-x64c-try,vm-kernel-reload-linux-debug-x64-try,vm-kernel-reload-rollback-linux-debug-x64-try,vm-precomp-ffi-qemu-linux-release-arm-try,vm-kernel-precomp-linux-debug-simarm_x64-try,vm-kernel-precomp-linux-debug-x64-try,vm-kernel-precomp-tsan-linux-release-x64-try,vm-kernel-tsan-linux-release-x64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/210726
Reviewed-by: Martin Kustermann <kustermann@google.com>
Reviewed-by: Tess Strickland <sstrickl@google.com>
2021-09-06 06:28:59 +00:00
Daco Harkes f21b7cafbc [vm/ffi] Adds param number in trampoline null error
Before: `NoSuchMethodError: The method 'FfiTrampoline' was called on
null.`
After: `Invalid argument(s): argument value for ':ffi_param2' is null`.

Makes the ArgumentNullError RTE lookup the name of the argument in the
code source map when reporting a null argument.

Makes the FFI call arguments and FFI callbacks use kArgumentError
instead of the default kNoSuchMethod so that we target this RTE instead.

This changes the Error type from `NoSuchMethodError` to `ArgumentError`.
Because `Error`s should not be caught [1], this is fine.

Since FFI trampolines are created from type arguments, the arguments do
not have names. The arguments are assigned names programmatically. See
the related bug.

Also, this CL cleans up the SourcePosition of the `CheckNullOptimized`,
it was never passed.

[1] https://dart.dev/guides/language/effective-dart/usage#dont-explicitly-catch-error-or-types-that-implement-it

TEST=tests/ffi/function_test.dart

Closes: https://github.com/dart-lang/sdk/issues/47094
Bug: https://github.com/dart-lang/sdk/issues/36780

Change-Id: I15e7de4d026e034bde0eda3ba7fe3785f0da5057
Cq-Include-Trybots: luci.dart.try:vm-precomp-ffi-qemu-linux-release-arm-try,vm-ffi-android-debug-arm-try,vm-kernel-precomp-dwarf-linux-product-x64-try,vm-kernel-precomp-linux-debug-x64-try,app-kernel-linux-debug-x64-try,vm-kernel-reload-rollback-linux-debug-x64-try,vm-kernel-reload-linux-debug-x64-try,vm-ffi-android-debug-arm64-try,vm-kernel-nnbd-mac-debug-x64-try,vm-kernel-precomp-nnbd-linux-debug-x64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/212462
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Clement Skau <cskau@google.com>
Reviewed-by: Tess Strickland <sstrickl@google.com>
2021-09-04 07:22:03 +00:00
Konstantin Shcheglov 01c4999b31 Test search with constructor tear-offs.
Change-Id: I9f5e2c8a8f6da737f8a3c81abf964d7e93493895
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/212520
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-09-03 23:52:48 +00:00
Alexander Aprelev 21298ee884 Reland "[vm/concurrency] Enable isolate groups by-default in all modes"
This reverts commit d0a3daffb7 that
reverted the initial land.

The fix for the problem that required the revert landed in
https://dart.googlesource.com/sdk/+/5ccf97a5a950ef70f41d84f186dad550d4acda01

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

TEST=ci

Change-Id: Ie92074059319e046809169d9e16d459ce1c2848f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/212481
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
2021-09-03 23:29:08 +00:00
Sam Rawlins 535a9bef95 analyzer: Report bad accesses to member named 'new'
Fixes https://github.com/dart-lang/sdk/issues/47077

Change-Id: Ib344204b28adbaf7a9dfa92e2ddb157930cc6547
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/212500
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2021-09-03 22:48:47 +00:00
Alexander Aprelev 7495184e2f [vm/gardening] Fix static_function_test to accommodate closure passing.
TEST=lib/isolate/static_function_test

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

Change-Id: I4ad552c35297230123574dee5451ab83b731f406
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/212489
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
2021-09-03 22:44:28 +00:00
Srujan Gaddam 07aa93a532 [dart:html] Add js_util import to dart:html
Part of https://dart-review.googlesource.com/c/sdk/+/210100

As classes get migrated to js_util, this import is needed.

Change-Id: Ib455257883257af2e145c222ab903488b22f13f9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/211540
Auto-Submit: Srujan Gaddam <srujzs@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
2021-09-03 21:53:27 +00:00
Konstantin Shcheglov 9b3a91a515 Add constructor references to ConstructorElement indexing tests.
Change-Id: I0d62d43eb0663e6c65adb08e7c5f8bda49790b9d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/212486
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-09-03 21:27:18 +00:00
Konstantin Shcheglov d0935c2c85 Tests for FunctionReference in navigation.
Change-Id: I677197f6a27c3d20589fe612c4f5c84c5c5e2637
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/212485
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-09-03 20:14:49 +00:00
Konstantin Shcheglov 21cbe332fd Issue 47097. Handle the case when a folder symbolic link target does not exist.
Bug: https://github.com/dart-lang/sdk/issues/47097
Change-Id: Ia32f742adf3ef24c67ec3e75cfa7dee969ff4afc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/212483
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2021-09-03 19:24:27 +00:00
Joshua Litt 2cd38d1f5a [dart2js] Add support for 'or' nodes in program split constraints.
Change-Id: I6de8240082e9b2f0f219e3641cf702054d2334a9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/208001
Commit-Queue: Joshua Litt <joshualitt@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2021-09-03 19:19:48 +00:00