Commit graph

82279 commits

Author SHA1 Message Date
Daco Harkes e4ff34ceac [vm] Defer Field::RecordStore in Deserialization
Field::RecordStore inspects the object being pointed to. However,
it is not guaranteed that that objects has been initialized in
*DeserializationCluster::ReadEdges, that depends on the order of the
clusters.

In the reproduction, the TypedDataView cluster comes after the cluster
containing the instance. This leads to doing a field store while the
length field of the TypedDataView has not been read yet and is 0. This
causes a Field::RecordStore with value 0, which subsequently gets used
in compilation causing RangeErrors.

This CL delays the Field::RecordStore from ReadEdges to PostLoad so that
all objects are initialized before they are inspected by RecordStore.

TEST=tests/language/vm/regress_flutter_89584_test.dart

Fixes: https://github.com/flutter/flutter/issues/89584

Change-Id: I1d5fe25c4084d62d5e492446123987aee10200bb
Cq-Include-Trybots: luci.dart.try:vm-kernel-optcounter-threshold-linux-release-x64-try,vm-kernel-linux-debug-x64-try,vm-kernel-mac-debug-x64-try,vm-kernel-precomp-linux-debug-x64-try,vm-kernel-linux-debug-x64c-try,vm-kernel-reload-linux-debug-x64-try,vm-kernel-reload-rollback-linux-debug-x64-try,vm-kernel-nnbd-win-debug-x64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/216181
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2021-10-11 16:27:20 +00:00
Simon Binder 5f95f4d3bb [analysis_server] Fix LSP capabilities status page
The registration type has been changed from a Map to a Set, which can't
be encoded as JSON.
This broke the `/lsp_capabilities` diagnostics page.
Calling `.toList()` fixes the page by showing current registrations as
an array.

Change-Id: Ib20f422d55d29c4f10b52a09d0a9229a486b67b9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/216186
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Danny Tuppeny <danny@tuppeny.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2021-10-11 16:23:43 +00:00
Lasse R.H. Nielsen 2dcc064916 Add range-check to DateTime.fromMillisecondsSinceEpoch on VM.
The current constructor allowed large numbers which overflows
when multiplied by 1000 to get microseconds, which then hid the
fact that the original value was out of range.

Now checks directly in the `fromMillisecondsSinceEpoch` constructor,
before multiplying by 1000.

Fixes #46966

BUG= http://dartbug.com/46966
TEST= Regression test added to date_time_test.dart

Change-Id: I4c6448666a49d51c285bd538e05e51a141b3b0b2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/214641
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Nate Bosch <nbosch@google.com>
2021-10-11 14:31:37 +00:00
Erik Ernst 1c13f49159 Add enhanced enums support to Dart.g
Change-Id: Ie9b93497491dd44576f6e0e8c58499f98e7a74df
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/216021
Commit-Queue: Erik Ernst <eernst@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
2021-10-11 14:08:55 +00:00
Nate Bosch 393b97a69e Remove duplicated FileMode fixes
These were unnecessarily added twice when I finished out the rest of the
constant rename fixes, but had already been implemented as the proof of
concept for core library fixes.

Change-Id: I4c5bb018ad344ccb4c393c656fed47aae2df4d16
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/214066
Auto-Submit: Nate Bosch <nbosch@google.com>
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
2021-10-11 13:58:43 +00:00
Sigurd Meldgaard 504258356e Bump cli_util to 71ba36e2554f7b7717f3f12b5ddd33751a4e3ddd
Changes:
```
> git log --format="%C(auto) %h %s" c2dc871..71ba36e
 https://dart.googlesource.com/cli_util.git/+/71ba36e Make applicationConfigHome failures catchable (#68)
 https://dart.googlesource.com/cli_util.git/+/6872f39 Improve tests for applicationConfigHome (#67)

```

Diff: https://dart.googlesource.com/cli_util.git/+/c2dc871784b59720e6cf5794dee1a20735df3feb~..71ba36e2554f7b7717f3f12b5ddd33751a4e3ddd/
Change-Id: Ia9705eb0d323d08a3ab201a3677c5cea81f8dbd4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/216183
Reviewed-by: Jonas Jensen <jonasfj@google.com>
Commit-Queue: Sigurd Meldgaard <sigurdm@google.com>
2021-10-11 11:29:24 +00:00
Martin Kustermann b7909e132a [vm/concurrency] Allow StackTrace objects to be shared
The existing lib/isolate/stacktrace_message_test was failing and also
incorrectly written due to "!" in front of the expected stringification
of the stacktrace.

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

TEST=vm/dart{,_2}/isolates/fast_object_copy2_test, lib{,_2}/isolate/stacktrace_message_test

Change-Id: I169d8fd7a7c3cb3b8c57e00287565e3a5c622acf
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/216041
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2021-10-11 09:01:44 +00:00
Konstantin Shcheglov 9c10d2b7ff Issue 47422. Fix crash in constant evaluation when the number of positional arguments is less the the number of required positional parameters.
Bug: https://github.com/dart-lang/sdk/issues/47422
Change-Id: I3d45b12a131c3cb4d7f08680fc906d6f33d056c2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/216140
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-10-11 04:59:02 +00:00
Brian Wilkerson 12f7507af2 Improve the message for empty_struct
Change-Id: I17b1fb652234016bbdb94f7c813e24ea8890cd85
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/216120
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2021-10-11 04:49:14 +00:00
Nicholas Shahan 50fb0c6e61 [dart2js] Migrate dart2js_tools to null safety
Change-Id: I43186c26521eca6405d0ab8b3a50b545a91b5cc2
Issue: https://github.com/dart-lang/sdk/issues/46617
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/215013
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
2021-10-08 23:54:54 +00:00
Nicholas Shahan 52c0a7bfd1 [ddc] Refactor _isFunctionSubtype
Move the method body out of one giant JS foreign function and into
Dart code with small JS foreign function calls inside.

* Removes the confusion around what it actually means when we use
  Dart String interpolation within the JS function template.
* Highlights the operations that actually need the JS foreign
  function.
* Allows for syntax highlighting and automatic formatting of this
  code.
* Allows for IDE "jump to definition" for class members that were
  previously inside the template.

These changes were developed by diffing the compiled output to
ensure the changes were as minimal and inconsequential as possible.
Intentional diffs include:
* Add local variables for `args1Length`, `args2Length`,
  `optionals1Length` and `optionals2Length`.

The only other diff was the loop variable incrementing:
`++i` -> `i = i + 1`

Change-Id: I92c6857580e0653578ceec4bd76a8e74231085cd
Issue: https://github.com/dart-lang/sdk/issues/46002
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/215246
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Srujan Gaddam <srujzs@google.com>
2021-10-08 22:33:48 +00:00
Sam Rawlins e6cdbf0b7c Support removing imports via quick fix reported as unnecessary imports
Change-Id: Ie2d21415a7b6a6bcb817d07a4100c47b14eb33cd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/216060
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2021-10-08 21:58:19 +00:00
Kevin Moore 1c1f6bd971 Remove pkg:resource from .packages
Follow-up to a6fb77f02e

Change-Id: I44f43a65ccec601990beef3a910590045df3ddc0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/215988
Auto-Submit: Kevin Moore <kevmoo@google.com>
Commit-Queue: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Bob Nystrom <rnystrom@google.com>
2021-10-08 21:01:38 +00:00
Nicholas Shahan 1345eb8baa [ddc] Fix list literal control flow optimization
Restore the behavior originally added in
https://dart-review.googlesource.com/c/sdk/+/172082 to call `.push()`
on Javascript Arrays directly when it is safe.

After some experimenting this optimization no longer appears to be
as effective for lists of native types (the type check is little
overhead) but is still observable for lists of user defined
interface types.

Change-Id: I034666a512a7886e5022498e2d6bd3f8aaceebbd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/215483
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
2021-10-08 20:41:37 +00:00
Brian Wilkerson a25f41f605 Reorganize the range factory tests in preparation for some bug fixes
No tests were added or removed. I split the original class into three,
and renamed the test methods in the two new classes because the class
name now includes part of the information previously in the method
names. Nothing else changed.

Change-Id: Ie2b980906026b79c0ec24024e14fe328662e4900
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/216063
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2021-10-08 20:37:28 +00:00
Alexander Aprelev e270bbe95c [io/unix-domain-sockets] Ensure runtime-looked up entry points are marked as such.
This is needed to ensure that entry points looked from native code are preserved, not tree-shaken.

This is follow-up to https://dart.googlesource.com/sdk/+/935ee25f3b72e7fe81047220cadae1f61c505da4

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

TEST=unix_socket_test on dartkp bots

Change-Id: I5cf3071507947b1c24b2808e46dc92186e4b9476
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/216062
Commit-Queue: Alexander Aprelev <aam@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2021-10-08 20:22:28 +00:00
Alexander Aprelev 47f9067cad [io/unix-domain-sockets] Ensure that receiver closes received socket.
Leaving socket unclosed results in server still running, test timing out.

This is follow-up to https://dart.googlesource.com/sdk/+/935ee25f3b72e7fe81047220cadae1f61c505da4

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

TEST=unix_socket_test on dartk bots

Change-Id: Ic99cd382059b42b36c84bc1bce3441cc2fd3bd46
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/216061
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
2021-10-08 18:48:18 +00:00
Paul Berry 3cb2d38723 Coalesce two more analyzer errors with their front end counterparts.
Change-Id: Iec2e6e67a4c3af1309ee208007008ca595059bd2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/216001
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2021-10-08 18:30:28 +00:00
Alexander Aprelev 5893a301a1 [io/unix-domain-sockets] Use runZonedGuard in test to catch unhandled exceptions.
This is follow-up to https://dart.googlesource.com/sdk/+/935ee25f3b72e7fe81047220cadae1f61c505da4

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

TEST=unix_socket_test

Change-Id: I5ace25c22086db23d36eb32e08fed9f089f273ea
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/215989
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
2021-10-08 17:40:38 +00:00
Alexander Aprelev 935ee25f3b [io/unix_domain_socket] Add support for sending/receiving open files, sockets, std streams via sockets.
This adds [sendMessage] and [receiveMessage] methods to [RawSocket] class. They are only supported on Linux at the moment as they require connection opened as unix domain socket connection.

This introduces [SocketControlMessage] class that represents a message sent via socket and also introduces [ResourceHandle] class that wraps [RandomAccessFile], [Socket]/[RawSocket]/[RawDatagramSocket], [Stdin]/[Stdout] for
marshalling/unmarshalling purposes.

Underlying OS implementation supports various kinds of control messages that can be passed via sockets, this CL only adds support for sending/receiving opened file description handles.
When receiving a message recipient can attempt to extract handles out of it via [tryExtractHandles]. It returns [null] if message has no handles to extract.

This is continuation of the work started on https://dart-review.googlesource.com/c/sdk/+/205067.

Bug: https://github.com/dart-lang/sdk/issues/46328
TEST=unix_socket_test

Change-Id: Ic9125b51dc80b677452e454366bae4118c298081
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/212036
Commit-Queue: Alexander Aprelev <aam@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Zach Anderson <zra@google.com>
2021-10-08 15:46:23 +00:00
Jake Macdonald e0c7693b74 - Fix how the manage_deps tool checks for existing branches
- Bump async to 80886150a5e6c58006c8ae5a6c2aa7108638e2a9

Changes:
```
> git log --format="%C(auto) %h %s" c642203..8088615
 https://dart.googlesource.com/async.git/+/8088615 update some StreamController apis to Future<void> from Future<dynamic> (#198)
 https://dart.googlesource.com/async.git/+/e660b9c Let `firstOrNull` extension method wait for `cancel` to complete. (#196)

```

Diff: https://dart.googlesource.com/async.git/+/c64220396e0fa2f7b380590abfedbd25635cd7a0~..80886150a5e6c58006c8ae5a6c2aa7108638e2a9/
Change-Id: I29e47e87f57a1a9b3b94da837edc71c305c90365
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/215461
Auto-Submit: Jake Macdonald <jakemac@google.com>
Commit-Queue: Jake Macdonald <jakemac@google.com>
Reviewed-by: Sigurd Meldgaard <sigurdm@google.com>
2021-10-08 15:01:03 +00:00
Alexander Markov 3aaad7817b [vm/aot/tfa] Build cache of dispatch targets in TFA instead of using ClosedWorldClassHierarchy from CFE
Previously, TFA used ClosedWorldClassHierarchy from CFE to look for
dispatch targets of invocations, and cached those lookups. However,
doing lookups via ClosedWorldClassHierarchy for the first time is still
slow. Now TFA builds maps of dispatch targets from AST and no longer
uses ClosedWorldClassHierarchy for the lookup.

Improves time of AOT compilation step 2 (TFA) on a large
Flutter application 170s -> 152s (-10.5%).

TEST=ci

Issue: https://github.com/dart-lang/sdk/issues/42442
Change-Id: I1a22d298e5b2c0ead57c38ddfbf5ebbd1876732f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/215985
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Slava Egorov <vegorov@google.com>
2021-10-08 11:02:16 +00:00
Kevin Moore ff37b52cf1 tools/manage_deps: use a more reliable way to check for a local branch
Change-Id: Ie23662f9301f7b9d11dcc3acc94c1537f3710b0c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/215242
Auto-Submit: Kevin Moore <kevmoo@google.com>
Commit-Queue: Sigurd Meldgaard <sigurdm@google.com>
Reviewed-by: Sigurd Meldgaard <sigurdm@google.com>
2021-10-08 10:12:33 +00:00
Sigurd Meldgaard 5940451173 Bump pub to 0764437088fd58eb7af779ecef66bab40dfcf2e9
Changes:
```
> git log --format="%C(auto) %h %s" 37d0592..0764437
 https://dart.googlesource.com/pub.git/+/07644370 Make gitignore validator use gitignores from repo-root and down. (#3169)
 https://dart.googlesource.com/pub.git/+/205ea58c Handle build-versions when reformatting ranges (#3170)
 https://dart.googlesource.com/pub.git/+/8f7bfb8c migrate 3 leaf files to null-safety (#3168)
 https://dart.googlesource.com/pub.git/+/df5db1f1 Extract some parts of pubspec parsing to a null-safe library. (#3160)

```

Diff: https://dart.googlesource.com/pub.git/+/37d05928939b3100e7e55c3dff922651db1de1e1~..0764437088fd58eb7af779ecef66bab40dfcf2e9/
Change-Id: I8d938dbf6c3fba3c3f4d98bbaa5835acfaf132a7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/216020
Reviewed-by: Sarah Zakarias <zarah@google.com>
Commit-Queue: Sigurd Meldgaard <sigurdm@google.com>
2021-10-08 09:13:20 +00:00
Brian Quinlan de45656da1 Fix a bug where calling _WindowsCodePageEncoder.convert would call an abort on non-Windows platforms.
TEST=issue_4636_test.dart

Bug: 46436,47402
Change-Id: I11579428f1d3c791ed64b7d5e6f75f41aef8c6c8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/215981
Commit-Queue: Brian Quinlan <bquinlan@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
2021-10-08 00:22:12 +00:00
Nicholas Shahan c7e127635f [web] Bump source_maps dep to v0.10.10
The current version points to a commit for v0.11.0-nullsafety.
It looks like a 0.11.0 release was never actually published. A
null safe version of the package was actually published as v0.10.10.

This also makes the version number in the package:dart2js_tools
pubspec match the version in the deps file.

Change-Id: Ibf495ed5e7388370b5cf950ed3559bf7749f42b9
Issue: https://github.com/dart-lang/sdk/issues/46617
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/215982
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
2021-10-07 22:31:38 +00:00
Ryan Macnak 2532d954c8 [vm, gc] Aggregate marker statistics and delete visitors on the main thread.
This makes parallel marking more like parallel scavenge and is preparation for allowing marking/scavenging to complete even if some workers haven't started.

Also improve work stealing of weak processing by processing the worker-local weak properties first.

TEST=ci
Change-Id: I73bfb930129e2d9848a3bbcf378303a51bd65a5d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/215681
Reviewed-by: Liam Appelbe <liama@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2021-10-07 18:44:32 +00:00
Konstantin Shcheglov 0d41847a86 Store SimpleIdentifier.tearOffTypeArgumentTypes into summaries.
Change-Id: I7abf28a2e98efe33a1cff50ec6dd743c798ea9e4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/216000
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-10-07 18:43:53 +00:00
Joshua Litt 2e0bc4f308 [dart2js] Properly attribute class types in dump_info.
Change-Id: I86d87dfae1bd9a887d0ab123a83d7275a05bb967
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/213722
Commit-Queue: Joshua Litt <joshualitt@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
2021-10-07 17:53:43 +00:00
Ryan Macnak 17a830d043 [vm] Fix warning in gcc-10.
TEST=build
Change-Id: I33f93ed93699899ed3a1bea727522d268190da58
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/215882
Reviewed-by: Liam Appelbe <liama@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2021-10-07 17:13:12 +00:00
Devon Carew a1e2432679 support specifying templates when verifying docs
Change-Id: I76800141e8bac1b0c3953ec6012ee84c192070ef
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/215280
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Devon Carew <devoncarew@google.com>
2021-10-07 16:45:43 +00:00
Konstantin Shcheglov 7b77cd643d Deprecate ResultState and AnalysisResult.state
Change-Id: I55ff1659aaf48a606c32a207f6730d559c0ca1f0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/215961
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-10-07 16:45:23 +00:00
Konstantin Shcheglov 89435cac6e Remove AnalysisDriver.resetUriResolution(), just create new contexts.
Change-Id: I51a1950f83e2aa351374a2f16069ca441ea81d2c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/215881
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Michal Terepeta <michalt@google.com>
2021-10-07 16:26:02 +00:00
Alexander Aprelev 7c5b019fdf [build] Fix zero-build of few common targets on Windows.
Fixes https://github.com/dart-lang/sdk/issues/47392

TEST=zero-build on windows

Change-Id: I2b37b48b7acc8c5139e989159250c361317e4ea5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/215940
Commit-Queue: Alexander Aprelev <aam@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2021-10-07 16:23:42 +00:00
Brian Quinlan bb407edfa0 Revert "Fix a bug where calling _WindowsCodePageEncoder.convert would call an abort on non-Windows platforms."
This reverts commit bfbf75a1f6.

Reason for revert: Broken some tests e.g. dartkp-strong-linux-release-x64:standalone/io/issue_46436_test

Original change's description:
> Fix a bug where calling _WindowsCodePageEncoder.convert would call an abort on non-Windows platforms.
>
> TEST=issue_4636_test.dart
>
> Bug: 46436
> Change-Id: Ib48673d3339617ca2944b3a1f7af4a3b298bb5ba
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/215801
> Commit-Queue: Brian Quinlan <bquinlan@google.com>
> Reviewed-by: Alexander Aprelev <aam@google.com>

TBR=aam@google.com,bquinlan@google.com

Change-Id: I720d9e38e48013438bd9c4821f05e95fa484cfd4
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 46436
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/215962
Reviewed-by: Brian Quinlan <bquinlan@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Brian Quinlan <bquinlan@google.com>
2021-10-07 16:17:04 +00:00
Nicholas Shahan 1d20986629 [dart2js] Skip dump_info unit test that times out
Skipping pkg/compiler/test/end_to_end/dump_info_test

Change-Id: I61622a7be69d4e14ac338716c5db8d1689fb0b6a
Issue: https://github.com/dart-lang/sdk/issues/47401
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/215944
Reviewed-by: Joshua Litt <joshualitt@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
2021-10-07 15:40:42 +00:00
Alexander Aprelev 9f9834c08e [vm/isolates] Ensure that only closure's context is inspected when closure is sent out.
Fixes https://github.com/dart-lang/sdk/issues/47381

TEST=sendandexit_test on Windows

Change-Id: I4fe298ccbcf79131994619a11aeac4b11dbdfec8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/215686
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
2021-10-07 15:27:43 +00:00
Konstantin Shcheglov 9703d19636 Deprecate ResultState.NOT_A_FILE, make the result VALID.
It duplicates `get exists`, and there are no other states.
All other states are presented by various InvalidResult(s).

We could have NotExistingFileResult and return it instead of a
ResolvedUnitResult, but ResolvedLibraryResult uses
List<ResolvedUnitResult> as `units`.

So, instead we say that it is valid, just does not exist,
and its content is empty.

Change-Id: I435555595590299df55d0016451a1e037934750d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/215900
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-10-07 15:16:22 +00:00
Johnni Winther 9603871cfd [cfe] Report error on 'new' used invalidly as selector
Part of https://github.com/dart-lang/sdk/issues/46232

Closes #47075

Change-Id: I6aece2236d6f45ec50bda3622b133c16761dd990
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/215764
Reviewed-by: Chloe Stefantsova <dmitryas@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2021-10-07 13:24:33 +00:00
Paul Berry c52a4261c0 Modify analyzer documentation handling tools to read from messages.yaml.
Previously, `pkg/analyzer/test/verify_diagnostics_test.dart` and
`pkg/analyzer/tool/diagnostics/generate.dart` extracted documentation
from the code of the analyzer error classes.  However, since this code
is generated from `messages.yaml`, it's much cleaner to just extract
the documentation directly from the YAML.

Change-Id: I7dc3eb73abbf5d72f203abbf04e43856b60d2a89
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/215648
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2021-10-07 13:17:13 +00:00
Chloe Stefantsova ca9e1e9801 [cfe] Retain parenthesized expressions until inference
Closes https://github.com/dart-lang/sdk/issues/47338.

Bug: https://github.com/dart-lang/sdk/issues/47338
Change-Id: I9520699286864919948e1400ad430a7c64681d50
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/215549
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Chloe Stefantsova <dmitryas@google.com>
2021-10-07 10:52:02 +00:00
Tess Strickland b9b1ea6b5d [vm] Refactor hash maps with T* keys where T <: Object.
Rename PointerKeyValueTrait<T>, which is used to create sets of pointers
to T instances where T <: Object and T has appropriate Hash and Equals
instance methods, to the more specific name PointerSetKeyValueTrait.

Create a PointerSet<T> alias for using this trait with
DirectChainedHashMap and use that alias in other code as a shorthand.

Remove PointerSetKeyValueTrait<const char> as a superclass of
CStringKeyValueTrait, as the only reuse from the former are the two
methods KeyOf and ValueOf which just return their argument, and having
this relationship is odd since const char is not a subtype of Object.

TEST=Renaming/refactoring, so existing tests.

Change-Id: I0274b16cb9fcb3939a28fb109fb8626c1ac8c0e9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/215761
Commit-Queue: Tess Strickland <sstrickl@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2021-10-07 06:43:53 +00:00
Konstantin Shcheglov 0aeaa80a6d Rename TypeNameImpl to NamedTypeImpl.
Change-Id: I97a0ffe8ba7271aa51355abb27294b13450cb917
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/215946
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-10-07 04:15:44 +00:00
Konstantin Shcheglov 85bfe9aca0 Issue 45430. Remove debug output.
Bug: https://github.com/dart-lang/sdk/issues/45430
Change-Id: Ife36ccc6dd55909662e05b3a2ab837d832f7e1a5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/215920
Reviewed-by: Keerti Parthasarathy <keertip@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-10-07 04:15:23 +00:00
Sigmund Cherem 24a7318725 [analyzer] - remove the missing_js_lib_annotation hint
The web compilers now accept `@JS` annotations on classes and members
directly and no longer requires an additional `@JS` library annotation at the
library level. As a result, we no longer need the
`missing_js_lib_annotation` hint.

Support for this landed a few months ago in
0845ebaad8
and was released in Dart 2.12.0.


Change-Id: I39acbf6149499e561f18f909dd09f2d2499f5054
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/215684
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
2021-10-07 00:22:32 +00:00
Alexander Markov ff0e760ac2 [vm/compiler] Replace debug prints with assertions
This change replaces debug prints introduced in
https://dart-review.googlesource.com/c/sdk/+/215152
with assertions. We no longer need the printed information because
root cause of the flaky crashes is found.

TEST=ci

Issue: https://github.com/dart-lang/sdk/issues/47314
Change-Id: I2c37fa640bc64cf5295f8acd0fbfb2b63ec7cddf
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/215883
Auto-Submit: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Siva Annamalai <asiva@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
2021-10-07 00:04:02 +00:00
Ryan Macnak 472e2bce17 Revert "[vm] Streamline Zones."
This reverts commit b5922e6db4.

Reason for revert: vm/cc/AllocateZone fails on Mac

Original change's description:
> [vm] Streamline Zones.
>
>  - Don't put a HANDLESCOPE right after a StackZone, as there's no state worth restoring
>  - Remove remaining zone bookkeeping dead since e3a9d70591.
>  - Remove unnecessary resetting of handle blocks before zone deletion.
>  - Shrink initial chunk size to make Zone's overall size fit in a faster malloc size class.
>
> TEST=ci
> Change-Id: I920e12f5af93aa71fb876435764c60df485215f9
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/212261
> Reviewed-by: Siva Annamalai <asiva@google.com>
> Commit-Queue: Ryan Macnak <rmacnak@google.com>

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

Change-Id: Id23dcebb781791616e48e54d2dcd7e58159178bc
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/215943
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2021-10-06 23:44:33 +00:00
Brian Quinlan bfbf75a1f6 Fix a bug where calling _WindowsCodePageEncoder.convert would call an abort on non-Windows platforms.
TEST=issue_4636_test.dart

Bug: 46436
Change-Id: Ib48673d3339617ca2944b3a1f7af4a3b298bb5ba
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/215801
Commit-Queue: Brian Quinlan <bquinlan@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
2021-10-06 22:35:52 +00:00
Ryan Macnak b5922e6db4 [vm] Streamline Zones.
- Don't put a HANDLESCOPE right after a StackZone, as there's no state worth restoring
 - Remove remaining zone bookkeeping dead since e3a9d70591.
 - Remove unnecessary resetting of handle blocks before zone deletion.
 - Shrink initial chunk size to make Zone's overall size fit in a faster malloc size class.

TEST=ci
Change-Id: I920e12f5af93aa71fb876435764c60df485215f9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/212261
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2021-10-06 22:22:32 +00:00
Alexander Markov cc3908748c [gardening] Disarm fork bomb in co19_2 tests in AOT configurations
Issue: https://github.com/dart-lang/co19/issues/1211
Issue: https://github.com/dart-lang/sdk/issues/47394
Change-Id: I6845684cc697555a12b61717254cdf4851fd4c43
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/215880
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2021-10-06 21:10:22 +00:00