Commit graph

82170 commits

Author SHA1 Message Date
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
Sam Rawlins
5e5f29d98a Support Never as a type in potentially const expressions
Additionally, I see that _deferred types_ are not constant, and make
great examples of non-const function references, constructor references,
and type literals.

Fixes language/const/constant_type_variable_test

Bug: https://github.com/dart-lang/sdk/issues/46020,
     https://github.com/dart-lang/sdk/issues/47302
Change-Id: I9df3a9eb758d058888f7d374b76756ec1443c8d6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/215860
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2021-10-06 20:36:42 +00:00
Srujan Gaddam
7990144bad [pkg:js] Disable @staticInterop until ready
Erasure and subtyping need to be handled before we're ready to
expose static interop classes.

Change-Id: Idf939ef196845e4e068276c326d3bfbec54fdd38
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/215012
Commit-Queue: Srujan Gaddam <srujzs@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2021-10-06 19:04:02 +00:00
Srujan Gaddam
2a903ace47 [pkg:js] Add tests for @staticInterop annotation
Tests that static interop classes cannot contain instance members
and cannot have non-static supertypes.

Change-Id: Idd4b280144f29162de6179b1bd51bed1f8c20017
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/215011
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2021-10-06 19:04:02 +00:00
Srujan Gaddam
67be663490 [pkg:js] Add @staticInterop annotation to package:js
Adds @staticInterop annotation to allow users to declare static interop
classes. Also adds errors for erroneous usage of static interop
classes, like including instance members or using a non-static
supertype.

Change-Id: I21abafbf6ea6c2eb7cd0425f0a54c1ba35d6ec6c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/215010
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2021-10-06 19:04:02 +00:00
Konstantin Shcheglov
d3b0aa2670 Test that completion works in TypeArgumentList in FunctionReference.
Change-Id: Ie031c5259239b7f55459dc2103a98cf866df0dda
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/215841
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-10-06 18:52:24 +00:00
Konstantin Shcheglov
7862bb6863 Test for getHover() and constructor/function references.
Change-Id: Ibe0d812815e087e04933526841614f535a86d2f4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/215820
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-10-06 18:52:23 +00:00
Ryan Macnak
3e122ec473 [observatory] Add diffing for process snapshots.
These are the same diffing visualization used by heap snapshots.

TEST=examine "process memory" in Observatory
Change-Id: I927291fe5901589314504a0fe3f945b22b9a7e96
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/215641
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2021-10-06 17:52:49 +00:00
Ryan Macnak
88d7f53359 [standalone] Truncate names passed to pthread_setname_np.
pthread_setname_np ignores names that are too long rather than truncating. This was causing most dart:io threads to remain unnamed.

Cf. eec49f34c4.

TEST="thread info" in gdb
Change-Id: I12f47b06b81f1204f742d829e14784d792a4fb96
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/215800
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
2021-10-06 17:46:29 +00:00
Sam Rawlins
2369d59b19 Support constructor references, function references, and type literals as potentially constant
Fixes https://github.com/dart-lang/sdk/issues/47153

Change-Id: Ia86464e1b460a30540c3314e2d6fbf477a9285b6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/215685
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2021-10-06 16:58:09 +00:00