Commit graph

87586 commits

Author SHA1 Message Date
Greg Spencer 73bb76184f Fix Windows tests, return absolute paths from example navigation
Fixes failing post-submit Windows tests,
and causes the examples/api IDE navigation results to return absolute paths.

Change-Id: If6d1ca9848644b78ff6f8e9549b84df7139b7ffc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/261801
Auto-Submit: Greg Spencer <gspencer@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2022-09-29 16:58:51 +00:00
Konstantin Shcheglov 4693daea8a Resolve BinaryPattern.
Change-Id: Ia37f1d0fe9d5a5368c1035732ff6a217ff4e24bd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/261784
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2022-09-29 16:56:03 +00:00
Konstantin Shcheglov 1ed03b3707 Replace assertFunctionExpressionInvocation() with textual dumps.
Change-Id: I4f9d4da934a128c6413880a4bd5a8e3adf3678f7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/261783
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
2022-09-29 16:48:22 +00:00
Alexander Markov 2ab5130eb5 [vm] Relax assertion for empty record type
TEST=co19/LanguageFeatures/Records/upper_and_lower_bounds_A04_t01
(Tested manualy by applying 4b6a8f35b9 and running
"tools/test.py -n dartk-strong-linux-debug-x64 co19/LanguageFeatures/Records/upper_and_lower_bounds_A04_t01").

Issue: https://github.com/dart-lang/sdk/issues/49719
Change-Id: Ib5658ac776a75913e617095f8861baba25f13de3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/261800
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Auto-Submit: Alexander Markov <alexmarkov@google.com>
2022-09-29 16:48:00 +00:00
Danny Tuppeny 604bf2fe3b [analysis_server] Don't overlap folding regions when lineFoldingOnly
+ convert LSP folding tests to use TestCode parser.

A change in VS Code means two folding regions are no longer allowed to end/start on the same line (the second range is silently dropped). This truncates folding regions if they end on the same line that another starts to end on the line before (but only if a client only supports line-folding mode).

Fixes https://github.com/Dart-Code/Dart-Code/issues/4121.

Change-Id: Ic26f58f84c44a01ae5157c336ed0f207d1c0eeb8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/261900
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2022-09-29 16:34:07 +00:00
Daco Harkes f70ca8ee11 [vm] Make RangeCheck reusable
Moves `RangeCheck` from the intrinsifier to the assembler.

Also, unifies the signature and semantics and adds documentation.

TEST=refactor

Change-Id: I274e5e46fde6a6e8baf30d8b732932f4f46d5855
Cq-Include-Trybots: luci.dart.try:vm-kernel-linux-debug-simriscv64-try,vm-kernel-precomp-linux-debug-simriscv64-try,vm-kernel-linux-release-simarm64-try,vm-kernel-linux-release-simarm-try,vm-kernel-precomp-linux-release-simarm64-try,vm-kernel-precomp-linux-release-simarm-try,vm-precomp-ffi-qemu-linux-release-riscv64-try,vm-precomp-ffi-qemu-linux-release-arm-try,vm-kernel-linux-debug-ia32-try,vm-kernel-linux-debug-x64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/261681
Reviewed-by: Tess Strickland <sstrickl@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
2022-09-29 15:07:27 +00:00
Johnni Winther 90dd21e5d0 [cfe] Use distinct import uri on patch libraries
This CL changes the import uri of a patch library builder to be its
file uri. This makes patch libraries more like regular libraries,
preparing for full support for patch parts.

Change-Id: I1fa4c10998f17945d6607e1307337b5f66992c3a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/224947
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
2022-09-29 14:28:57 +00:00
Alexander Markov 824028f96f [vm] Move _Record class to record_patch.dart
TEST=ci

Issue: https://github.com/dart-lang/sdk/issues/49719
Change-Id: Ibf818df1f57afa93051123d0c9493913e7f9ab76
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/260641
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2022-09-29 14:12:57 +00:00
Ömer Sinan Ağacan c427299b1c [kernel] Add an example and a note in kernel BreakStatement docs
Change-Id: Ic0153a084950d2eea53e9fd8a0ee0332de5e2ae3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/261841
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
Commit-Queue: Ömer Ağacan <omersa@google.com>
2022-09-29 12:29:47 +00:00
Paul Berry cba19c0de0 Remove bogus comment from parseLiteralSetOrMapSuffix
This comment was relevant in a previous revision of the patterns
parsing logic and I neglected to revert it.

Bug: https://github.com/dart-lang/sdk/issues/50035
Change-Id: Ia4034d66c3cc354e2ea6f2e1485380bccf7333dd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/261700
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2022-09-29 12:24:47 +00:00
Johnni Winther 3cfca8e38c Make internal/patch.part a part of dart:_internal
`internal/patch.dart` is changed to be an actual part of
`dart:_internal` and backends are changed to all use the `patch`
constant from `dart:_internal` in `@patch` annotations.

This is done in preparation for changing the import uri of a
patch library builder to be its file uri, with which the
`internal/patch.dart` part can no longer declare itself as
`part of 'dart:_internal';` through a patch library.

Change-Id: I884e939d4a56782e64fb527cdf900769c2b2fcfd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/224946
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2022-09-29 11:52:37 +00:00
Tess Strickland ef53c1929d [vm/test] Fix assumption about dynamic symbol table.
The original code assumed that only the initial symbol in the
dynamic symbol table had an empty name, and so any symbol with an
empty name was checked as if it was the initial symbol.

However, it turns out that in at least one case on our testing
infrastructure, the assembler generates a dynamic symbol with an
empty name.

Thus, we change the test to check the initial symbol separately
from the rest of the symbols in the symbol table.

TEST=vm/dart{,_2}/use_add_readonly_data_symbols_flag

Bug: https://github.com/dart-lang/sdk/issues/50071
Change-Id: Ie5d443ee2a45f8fb3400955d8bdfb3e726ab028a
Fixed: 50071
Cq-Include-Trybots: luci.dart.try:vm-kernel-precomp-linux-release-x64-try,vm-kernel-precomp-linux-product-x64-try,vm-kernel-precomp-nnbd-linux-release-x64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/261820
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Commit-Queue: Tess Strickland <sstrickl@google.com>
2022-09-29 09:36:37 +00:00
Johnni Winther dc7df3218e [cfe] Add parser tests for patterns
These tests are copied from
pkg/analyzer/test/generated/patterns_parser_test.dart

Change-Id: Ib5fd7ca8c22dd24bf5334ac87140d961bc80838a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/261660
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
2022-09-29 09:08:57 +00:00
Chloe Stefantsova f1927345a6 [cfe] Pass offset as constructor parameter in new internal ast nodes
Change-Id: Ie69f6a7fc11225e7010d91a146ca20160986e050
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/261081
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Chloe Stefantsova <cstefantsova@google.com>
2022-09-29 08:51:27 +00:00
Tess Strickland b0c4ddf919 [pkg/dart2native] Avoid overwriting section contents in MachO files.
To create a Dart standalone executable on MacOS, we modify the
dartaotruntime executable to add the snapshot contents, and the
VM looks into the executable on disk to find the snapshot to load.

Previously, we did this by adding a new 64-bit segment load command
with a single section, where the section's file offset and size
describes the inserted snapshot. This meant the Mach-O header size increased by 152 bytes.

Originally, this wasn't an issue as there was plenty of padding, but
later clang updates removed most of this padding, and so writing the
new header actually overwrote the initial contents of the first section
in the file, which happens to be the __text section. In addition, since
the first section's offset was now declared to be within the header,
utilities that strictly validated the Mach-O format, like codesign,
would report errors.

This CL changes it so that we actually reserve space in the
dartaotruntime header using the -add_empty_section flag to the linker.
In addition, we change from using a segment load command to using a
(40 byte) note load command. This is because a segment load command
specifies that the contents should be loaded in memory, but we don't
use that loaded version. Instead, the VM reloads it from the executable
on disk so it can appropriately mmap the different parts of the
snapshot. A note section instead just declares a section of the
executable as arbitrary data that the owner can read from the file
and use as desired, which is semantically closer to our current usage.

This CL also adds a test to pkg/dartdev/test/commands/compile_test to
ensure that corrupting a random part of the snapshot in the executable
causes signature verification to fail.

This CL also reverts CL 256208, thus relanding the clang changes
starting from June that originally raised awareness of the issue by
greatly reduced the amount of padding after the load commands.

TEST=pkg/dartdev/test/commands/compile_test

Bug: https://github.com/dart-lang/sdk/issues/49783
Change-Id: Iee554d87b0eabaecd7a534ca4e4facfefbce6385
Cq-Include-Trybots: luci.dart.try:analyzer-mac-release-try,dart-sdk-mac-arm64-try,dart-sdk-mac-try,pkg-mac-release-arm64-try,pkg-mac-release-try,vm-kernel-precomp-mac-product-x64-try,vm-kernel-precomp-nnbd-mac-release-arm64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/260108
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Commit-Queue: Tess Strickland <sstrickl@google.com>
2022-09-29 08:32:47 +00:00
Jens Johansen a2466e26c5 [parser] Parse nested generics with records
Fixes https://github.com/dart-lang/sdk/issues/50005
Fixes https://github.com/dart-lang/sdk/issues/50057

Change-Id: I6c84f20093b27c4d2f51e7058295257b5d82288e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/261642
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2022-09-29 07:28:47 +00:00
Jens Johansen f9e508a0cc [parser] Parse typedef with record return type
Fixes https://github.com/dart-lang/sdk/issues/49994

Change-Id: I5212b780bdd4e28c7c3afcabc72c9e65f7caecfc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/261604
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2022-09-29 06:28:36 +00:00
Sigmund Cherem efb509c114 [dart2js] stop using the deprecated NoSuchMethod consturctor
This change is a small incremental step, but should allow us to delete
the public NoSuchMethod constructor in dart:core. The change simply creates
a private constructor in the dart2js patch file and uses that instead.

https://github.com/dart-lang/sdk/issues/49529

Change-Id: I51cb2ec3b7f169a6cb831e753a3e5e9bf0752dbd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/260940
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
2022-09-29 01:58:56 +00:00
Konstantin Shcheglov e1b5cbd266 Resolve VariablePattern.
Change-Id: Ibfd32610e86aa3396495b3ba7210612a17756fc4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/261782
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2022-09-28 22:09:07 +00:00
Alexander Markov b48846c1ea [vm] Fix data race during TypeRef canonicalization
TEST=vm/dart/regress_50065_test
TEST=tools/test.py --repeat 100 -n dartk-tsan-linux-release-x64 vm/dart_2/regress_50065_test

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

Change-Id: I974d8c9c0a291d64318f3a96ba73148707fd4b68
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/261740
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2022-09-28 22:03:26 +00:00
Ryan Macnak 4100cafb19 [vm, gc] Remove non-assert use of Contains during scavenging.
The scavenger should assume it visits pointers exactly once. This Contains was probably covering up a double visit that was probably fixed with the introduction of the compactor.

TEST=ci
Change-Id: I975cb27e1fedf9fbc0b0d46d33dd374204907037
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/261780
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
2022-09-28 21:53:06 +00:00
Konstantin Shcheglov 5c812e911c Resolve PostfixPattern.
Change-Id: I6368cc7aec27eed2e428d69ec0d7b0096010dc1e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/261762
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2022-09-28 20:15:49 +00:00
Konstantin Shcheglov 28bf0be9d6 Resolve ParenthesizedPattern.
Change-Id: I112384c11fbe1b9f5b9a3811b759c4e53dca0544
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/261761
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2022-09-28 20:07:57 +00:00
Konstantin Shcheglov b0b4178e3f Resolve IfStatement.caseClause
Change-Id: I0d10995e5660a00935602c5bf592aeb63c3567d1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/261760
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2022-09-28 20:07:46 +00:00
Danny Tuppeny dd12cfd073 [analysis_server] Filter "see code in" navigation regions to requested range
This fixes one of the issues noted in https://github.com/Dart-Code/Dart-Code/issues/4181, where all example regions would be returned for a code block instead of only those that matched the requested region.

This was because the code that handles comments didn't go through helpers in `_DartNavigationCollector` that does the filtering.

Change-Id: I58931c02f0e4f538c246dc8fc0c3e57895cad5fb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/261365
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2022-09-28 19:33:36 +00:00
Paul Berry f388946354 Fix test to account for obfuscation
This change generalizes no_such_method_restriction_stack_trace_test so
that it recognizes all circumstances where there is stack obfuscation
(not just Javascript builds).

Fixes test failures on `vm-kernel-precomp-obfuscate-linux-release-x64` bot.
Fixes #50074

Bug: https://github.com/dart-lang/sdk/issues/50074
Change-Id: I53f3eaa6ae3cf3585b3d4c492d80dd1e72ca216b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/261621
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2022-09-28 19:24:26 +00:00
Alexander Markov 9c3e52aaf3 [vm] Support record types in special cases of type testing stubs for generic types
TEST=language/records/simple/type_checks2_test

Issue: https://github.com/dart-lang/sdk/issues/49719
Change-Id: I9117331d8e985675a8adba1aaa4d50a6b17758f4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/261182
Reviewed-by: Tess Strickland <sstrickl@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2022-09-28 19:01:11 +00:00
Lasse R.H. Nielsen 72f574507e Update the documentation of Function to mention function types.
And all the other things it didn't mention.
And update the `==` documentation too.

Change-Id: Iccd4b046b0632db788e44b02799d1f8d5541d766
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/260881
Reviewed-by: Nate Bosch <nbosch@google.com>
Commit-Queue: Lasse Nielsen <lrn@google.com>
2022-09-28 17:36:56 +00:00
Danny Tuppeny d97c3e8702 [analysis_server] Fix updating of selections in change builder when additional edits are made
This fixes a few minor issues:

- Setting a new selection position did not remove a previously set selection range (which could result in a mismatched offset/length due to how the resulting change merges the position/range)
- Setting a new selection range did not update a previously set selection position
- Inserting new changes before a change that sets a selection range only updated the selection position, not selection range
- Setting a selection range/position after another change that inserts only updated the selection position to compensate and not the selection range

These issues led to cases where selection ranges could be incorrect, or even overlap with linked edit groups that could cause errors that caused code action requests to fail.

Fixes https://github.com/Dart-Code/Dart-Code/issues/4184

Change-Id: I43e2a8361c97b2eccb2d6b426a75eda5cc811e06
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/261682
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2022-09-28 17:32:24 +00:00
Danny Tuppeny 9c0b575fa5 [analysis_server] Include filters in saveUri parameters, rename type -> kind
Change-Id: I815a86a57fbb15d4d851d368a3b4eeffefa39ed8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/261605
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2022-09-28 17:25:56 +00:00
Danny Tuppeny 67e1f3f527 [analysis_server] Fix refactor test on Windows
Change-Id: I182596db3f7446879579a47de5aa60956aee0f2a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/261601
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2022-09-28 17:22:49 +00:00
Aske Simon Christensen 985c0ccc46 [dart2wasm] Throw UnimplementedError instead of constructor tear-offs
Change-Id: Icff981119ba0d0f3c5a7c498a16d7a22074105d3
Cq-Include-Trybots: luci.dart.try:dart2wasm-linux-x64-d8-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/261680
Commit-Queue: Joshua Litt <joshualitt@google.com>
Reviewed-by: Joshua Litt <joshualitt@google.com>
Auto-Submit: Aske Simon Christensen <askesc@google.com>
2022-09-28 17:17:12 +00:00
Danny Tuppeny 55004eaa80 [analyzer] Improve findNode.formalParameterList for NodeLocator changes
Change-Id: I8b79330c86115a0952f6a31444a9efd0a8c8b728
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/261600
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2022-09-28 17:14:46 +00:00
Devon Carew 7c81ac07fd Bump intl to 5464b3b95635e97f67e29d71bdbe85a5d4126971
Changes:
```
> git log --format="%C(auto) %h %s" 6806ab0..5464b3b
 https://dart.googlesource.com/intl.git/+/5464b3b Remove an unnecessary sort (#496)

```

Diff: https://dart.googlesource.com/intl.git/+/6806ab06fa6145f30dbcd5cbfeb3aeaadd21ea8e~..5464b3b95635e97f67e29d71bdbe85a5d4126971/
Change-Id: Ic32c31be41deb11a60b2d0fd8de38117ad248ab1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/261201
Reviewed-by: Moritz Sümmermann <mosum@google.com>
Commit-Queue: Moritz Sümmermann <mosum@google.com>
Auto-Submit: Devon Carew <devoncarew@google.com>
2022-09-28 17:09:06 +00:00
Alexander Markov b860d9ee36 [vm] Support record types and record constants in IL serialization
TEST=language/records/simple/constants_and_field_access_test

Issue: https://github.com/dart-lang/sdk/issues/49719
Change-Id: I47b1c300195249d0e07e2adfdeeba0c4e44f5de7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/261480
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2022-09-28 16:41:56 +00:00
Greg Spencer ae7e3517c8 Add a test for examples/api navigation, and fix it
This adds a test for the dartdoc "See code in examples/api..." navigation in the analysis_plugin, and changes things so that it doesn't walk the directory tree to find the examples directory more than once per compilation unit.

Change-Id: I1938396b160ca2d21b08214f79fb1c7ddbf6a388
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/261281
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Auto-Submit: Greg Spencer <gspencer@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2022-09-28 16:31:26 +00:00
Konstantin Shcheglov 12b75222ab Resolve CastPattern and ConstantPattern.
Change-Id: Iff025fb1f1f07a06f62d99a5a8667dabcc91776f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/261580
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2022-09-28 15:54:27 +00:00
Brian Wilkerson bf1797e450 Add a test to show that split_variable_declaration works with record types
Change-Id: I30cc2a9910b590b66c2e02575bfc3b3bc0ec5de0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/261501
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2022-09-28 15:49:46 +00:00
Aske Simon Christensen e08c94a651 [dart2wasm] Partially lazy constants
Make a constant lazy if it involves creating a list that is too long
for the `array.new_fixed` instruction, or, for composite constants, if
one or more of its sub-constants are lazy.

Also read lazy string constants directly from a data segment instead
of writing them to linear memory first.

Change-Id: Iea26460580e6134cd3e26eaaa84cb0dde09016dd
Cq-Include-Trybots: luci.dart.try:dart2wasm-linux-x64-d8-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/261402
Reviewed-by: Joshua Litt <joshualitt@google.com>
Commit-Queue: Aske Simon Christensen <askesc@google.com>
2022-09-28 15:20:46 +00:00
Brian Wilkerson ffe7d55ea8 Implement more ToSourceVisitor tests
Change-Id: Ie63f18fec8754a342eee3c93401d9319d2d12421
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/261500
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2022-09-28 15:17:46 +00:00
Ömer Sinan Ağacan 6cf5999c32 [vm] Fix IL/disassembly output generation with -v
https://dart-review.googlesource.com/c/sdk/+/261360 had a typo and
checked kernel result instead of snapshot result.

Example invocation:

    dart compile exe \
        --extra-gen-snapshot-options=--disassemble,--print-flow-graph,--print-flow-graph-filter=<function name> \
        -v <Dart file>

Change-Id: Ic5e540825874f44105579382b2b05dd710791206
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/261643
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Slava Egorov <vegorov@google.com>
2022-09-28 14:17:30 +00:00
Danny Tuppeny e2d63974a7 [dds/dap] Fix flaky test
We shouldn't fail ("Future already completed") if the timing allows multiple errors from the bad input to arrive during the test run.

Change-Id: I358b8401b865c22d5808c22e463dea0e6416f6ab
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/261602
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2022-09-28 13:47:46 +00:00
Jens Johansen 59f895b4ed [parser] Don't pretend like record types doesn't exist in on clause parsing
Fixes https://github.com/dart-lang/sdk/issues/49980

Change-Id: I74c734a64f4c0d4bd6ad79f231411352f6b170c8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/261362
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2022-09-28 13:41:56 +00:00
Tess Strickland be4bb8ec4b [vm/test] Skip heap_snapshot_referrers_test on reload bots.
Change-Id: Ia9719f4009a02e26d134fcfbfba9823719fb8484
Fixed: 50072
Cq-Include-Trybots: luci.dart.try:vm-kernel-reload-linux-release-x64-try,vm-kernel-reload-rollback-linux-release-x64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/261641
Commit-Queue: Tess Strickland <sstrickl@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2022-09-28 13:37:06 +00:00
Tess Strickland a54a21b230 [vm/test] Don't attempt assembly tests on simulated archs.
TEST=vm/dart{,_2}/use_add_readonly_data_symbols_flag

Bug: https://github.com/dart-lang/sdk/issues/50071
Change-Id: Ia20b3d781f87ca902555d5d54fa6f42855cace49
Cq-Include-Trybots: luci.dart.try:vm-kernel-precomp-nnbd-linux-release-simarm64-try,vm-kernel-precomp-nnbd-linux-debug-simarm_x64-try,vm-kernel-precomp-nnbd-linux-release-simarm_x64-try,vm-kernel-precomp-linux-debug-simriscv64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/261640
Commit-Queue: Tess Strickland <sstrickl@google.com>
Reviewed-by: Daco Harkes <dacoharkes@google.com>
2022-09-28 13:01:13 +00:00
Paul Berry 9eb5544ec1 Parser: split some pattern/expression parsing logic.
This change restores `parseParenthesizedExpressionOrRecordLiteral`,
`parseArguments`, and `parseArgumentsRest` to the way they looked
prior to adding parser support, and instead adds new methods
`parseParenthesizedPatternOrRecordPattern` and
`parseExtractorPatternRest` that are specialized for patterns parsing.

Bug: https://github.com/dart-lang/sdk/issues/50035
Change-Id: I104e031a796ef7f217cd427e1a9ae94a04dafa7b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/261620
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
2022-09-28 12:50:56 +00:00
Vyacheslav Egorov 9158353b5d [vm] Make it easier to get IL / disassembly out
Make `dart compile exe -v` forward gen_snapshot output in
verbose mode.

Fix --write_code_comments_as_synthetic_source_to=... flag. There
was a change to Dwarf writer API which broke it.

Motivated by https://github.com/dart-lang/sdk/issues/50059

TEST=manually

Change-Id: I0431925f724a9b24e938bdb9d7ae1019143da83a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/261360
Commit-Queue: Slava Egorov <vegorov@google.com>
Reviewed-by: Tess Strickland <sstrickl@google.com>
2022-09-28 12:21:36 +00:00
Vyacheslav Egorov 7fd49802db [vm] Default timeline recorder to nop in PRODUCT
Using ring (or other similar types) of recorders in PRODUCT
does not make sense because you can't extract the information
they record without vm-service. Additionally "ring" (default
recorder type) preallocates ~4Mb of memory to store the data.

This CL adds a "none" recorder which simply drops all data
and has no memory overhead and makes this default recorder
in PRODUCT.

We also change code to only allow none, callback, systrace
and file recorders in PRODUCT.

TEST=manually

Bug: b/237989929
Change-Id: I52d6ff8bf766e8fa0969eab0bf2adc45dd9a57c3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/261320
Commit-Queue: Slava Egorov <vegorov@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2022-09-28 12:17:46 +00:00
Nate Biggs 0ec921e8c3 [dart2js] Fix node tracer migration
Change-Id: Id49719ca21471370e9428224a231d285d3c84551
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/261560
Commit-Queue: Nate Biggs <natebiggs@google.com>
Auto-Submit: Nate Biggs <natebiggs@google.com>
Commit-Queue: Mayank Patke <fishythefish@google.com>
Reviewed-by: Mayank Patke <fishythefish@google.com>
2022-09-28 00:46:35 +00:00
Konstantin Shcheglov 1ad9306ad2 Extract pattern tests into resolution tests.
Change-Id: Ia4b61dc5e8dae0a4f4fb3afebff88b74c3fd867c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/261443
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2022-09-27 23:35:25 +00:00