Commit graph

99192 commits

Author SHA1 Message Date
Konstantin Shcheglov 904c8c2c39 Add completeAll() extension for List<Completer>.
Change-Id: I389091ec08749f0b61ce88d93cff240e05fb03bf
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/346900
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2024-01-17 19:40:29 +00:00
asiva 93f41eccf0 [VM/test] Skips test on Android as executable bit is not set for shell script.
TEST=fixes test.

Change-Id: I384aa695b3072c31dbd120cae17504a373a22275
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/345861
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Siva Annamalai <asiva@google.com>
2024-01-17 19:21:19 +00:00
asiva c539f57b00 [VM/vm_service] Fix for https://github.com/dart-lang/sdk/issues/54641
- Skip stdio_newline_test in AOT mode
- Fix capture_stdio_test and dds_stdout_stderr_history tests under the
  observatory directory to account for the new line fix.

TEST=ci

Bug:54641
Change-Id: Ic5403ab30a1367e4ec9e6798545837813f8f1060
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/346685
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Siva Annamalai <asiva@google.com>
2024-01-17 19:19:23 +00:00
Brian Quinlan b325bc6a43 [doc,io]: Document how errors with File.openRead are exposed
Bug:https://github.com/dart-lang/sdk/issues/53904
Change-Id: Ib457ceb62f6745753e047b5d8160bf6d50fa12cb
CoreLibraryReviewExempt: documentation-only change
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/346586
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Brian Quinlan <bquinlan@google.com>
2024-01-17 18:43:50 +00:00
Konstantin Shcheglov 5a6ed7a8db Macro. Support for macro generated files in getIndex().
Change-Id: I3eabefc1a1a2b0ac44e554b111fe6ebe06d0288a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/346684
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2024-01-17 18:20:28 +00:00
Ryan Macnak d5104d978d [vm, gc] Defer marking of SuspendState.
SuspendState changes shape on suspend and resume as new PCs change which StackMap is used to interpret the saved frame area. Shape changes are not compatible with concurrent marking because they can cause the concurrent marker to misinterpret a non-pointer as a pointer.

TEST=ci
Bug: https://github.com/dart-lang/sdk/issues/54410
Change-Id: I5ec35b812a4e94a2bae2628a8914f6d05116dbc6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/346620
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2024-01-17 17:36:08 +00:00
pq a754646dc1 cleanup file path conditional
Change-Id: I8c6c9949891bb87cfb9cd52397383a03d82c5ac8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/346587
Commit-Queue: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2024-01-17 17:12:20 +00:00
Konstantin Shcheglov ad9928cfde Macro. Tests for producing results for macro generated files. Part 1.
For addFile(), changeFile(), getResolvedLibrary(), getResolvedUnit()
These should cover the main need of DAS, and IDE integration.

Change-Id: Ie711ceaec7dd4fa4a5f8f8f51b9ddc3ff0b418d2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/346582
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
2024-01-17 16:40:49 +00:00
Konstantin Shcheglov 9835d42c60 Macro. Report introspection cycles, every time.
See https://github.com/dart-lang/language/pull/3551

Change-Id: I179be7ac04ecc1a1c3f4ee0cfbadfa27e079b6d9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/346382
Reviewed-by: Morgan :) <davidmorgan@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2024-01-17 16:39:40 +00:00
Tess Strickland 743c0c862c [vm] Revert caching of default type arguments within closure.
Since we already cache instantiation of type argument vectors to avoid
runtime calls as long as the cache has room, remove the default
type arguments field from Closure objects. Instead, just perform any
needed instantiation when the default type arguments are needed
using the instantiator and parent function type arguments stored
in the closure.

Also rename DefaultTypeArgumentsKind to InstantiationMode and
generalize the calculations to determine how to instantiate default
type arguments to an operation that can be performed on type arguments
in general.

TEST=ci

Fixes: https://github.com/dart-lang/sdk/issues/54589
Issue: https://github.com/dart-lang/sdk/issues/54564
Change-Id: I704ea4244fb10cbc08175629c8e92cf05b8aabea
Cq-Include-Trybots: luci.dart.try:vm-aot-linux-release-arm64-try,vm-aot-linux-release-x64-try,vm-aot-tsan-linux-release-x64-try,vm-tsan-linux-release-x64-try,vm-aot-linux-debug-x64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/346021
Commit-Queue: Tess Strickland <sstrickl@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2024-01-17 14:36:48 +00:00
Ryan Macnak 58bf203064 [VM] Add support for allocation tracing in AOT
TEST=Manual
Bug: https://github.com/dart-lang/sdk/issues/51234
Change-Id: I4ab75bb85898a41dfb091b38402711170fd3b972
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/271420
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2024-01-17 13:50:49 +00:00
Emmanuel Pellereau c111a1346e Revert "[vm/aot/tfa] Analyze function calls"
This reverts commit 66d3eedb33.

Reason for revert: breaks google3 (b/320642692)

Original change's description:
> [vm/aot/tfa] Analyze function calls
>
> This change adds analysis of function calls when closure target
> of a call can be inferred. Local functions are now analyzed separately
> from enclosing members. Inferred result type of function calls is now
> used in the AOT compiler.
>
> Time of AOT compilation step 2 (TFA) on a large Flutter application:
> Before: 59.448s
> After: 61.870s (+4%)
>
> Maintaining hierarchy of function types and analysis of all function
> calls is not feasible as it causes unbearable increase in AOT
> compilation time.
>
> TEST=existing
> Issue: https://github.com/dart-lang/sdk/issues/39692
>
> Change-Id: Ieb4d5dce23868b5ab5c87fa1e77e49b85fd656fe
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/345083
> Reviewed-by: Slava Egorov <vegorov@google.com>
> Reviewed-by: Martin Kustermann <kustermann@google.com>
> Commit-Queue: Alexander Markov <alexmarkov@google.com>

Issue: https://github.com/dart-lang/sdk/issues/39692
Change-Id: Ieb9104f4263e19ef9e5bd749e935f6c2dbec3046
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/346780
Reviewed-by: Martin Kustermann <kustermann@google.com>
Reviewed-by: Slava Egorov <vegorov@google.com>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Commit-Queue: Emmanuel Pellereau <emmanuelp@google.com>
2024-01-17 13:08:58 +00:00
Chloe Stefantsova 970885b879 [cfe] Use TypeParameter in DDCTypeEnvironment, TypeParameterFinder
This CL is a part of the clean up for
https://dart-review.googlesource.com/c/sdk/+/312264

Change-Id: If9d892496af5498943694ad266ee6eb151fdc3e1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/346401
Commit-Queue: Chloe Stefantsova <cstefantsova@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
2024-01-17 11:00:17 +00:00
pq f45c75655b display multiple options files in the diagnostics page
See https://github.com/dart-lang/sdk/issues/54074 for screenshots.

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



Change-Id: I4143a29c55857616b406be87f587e6231c7d90b4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/346682
Commit-Queue: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2024-01-17 02:52:40 +00:00
pq f68fd1f108 lift options analysis into analyzedFiles loop
See: https://github.com/dart-lang/sdk/issues/54312

Change-Id: Ide2314704ec7e233f40d0db98805c98820b81333
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/346585
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
2024-01-17 02:20:40 +00:00
Konstantin Shcheglov 12bba67bf5 Stop reporting MISSING_RETURN as unrecognized_error_code.
Bug: https://github.com/flutter/flutter/issues/141576
Change-Id: I1080ce65ebab70363fc49afc6798ccf9ddb532ec
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/346681
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2024-01-17 01:37:18 +00:00
Sam Rawlins 6c071d3148 linter: fix unn parentheses with nullable extended type
Fixes https://github.com/dart-lang/linter/issues/4846

Change-Id: I8efc93715edaa1d06f3849cca1c8fd51373b6900
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/346584
Commit-Queue: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Auto-Submit: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2024-01-17 00:10:28 +00:00
Konstantin Shcheglov dbc5ac3184 Legacy. Remove typeStringByNullability()
Change-Id: I6274bc6007b40d031d9787f4eb6329a42b6e0588
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/346583
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2024-01-17 00:06:36 +00:00
Konstantin Shcheglov b03a417932 Legacy. Remove expectedErrorsByNullability()
Change-Id: I23cf2c905134e009d6e371e46920242f23502b91
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/346680
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
2024-01-16 23:30:22 +00:00
pq a4bfeb1230 prefer options cached in FileStates
Fixes: https://github.com/dart-lang/sdk/issues/54124

Change-Id: Iafb517332fd78360b75687c912ed047ed8d0fd7e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/346623
Commit-Queue: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2024-01-16 23:07:08 +00:00
Konstantin Shcheglov 9d75cde944 Legacy. Remove WithoutNullSafetyMixin and its remaining usages.
Removes:
FIELD_INITIALIZER_IN_STRUCT
FIELD_IN_STRUCT_WITH_INITIALIZER

These are not reported anymore.

Change-Id: I0e96ad2804750d315e2ffd75205464b6f7751dca
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/345830
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
2024-01-16 22:51:27 +00:00
DEPS Autoroller 585b59afcd Roll gn from e4702d740906 to 5d76868385b8
If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/gn-dart-sdk
Please CC dart-ecosystem-gardener@grotations.appspotmail.com,dart-engprod@google.com on the revert to ensure that a human
is aware of the problem.

To file a bug in gn: https://bugs.chromium.org/p/gn/issues/list
To file a bug in Dart SDK: https://github.com/dart-lang/sdk/issues

To report a problem with the AutoRoller itself, please file a bug:
https://issues.skia.org/issues/new?component=1389291&template=1850622

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md

Cq-Include-Trybots: luci.dart.try:dart-sdk-linux-try;luci.dart.try:dart-sdk-mac-try;luci.dart.try:dart-sdk-mac-arm64-try;luci.dart.try:dart-sdk-win-try
Change-Id: I14ffdc6052d3852afbe06a3ece4956686187f4cb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/346500
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Liam Appelbe <liama@google.com>
2024-01-16 21:30:50 +00:00
Danny Tuppeny da07f7a3e2 [analysis_server] Prepare server for handling multiple URI schemes
This is a slight refactor that should not change any behaviour extracted to make a future CL smaller. It:

1. replaces the previous `dartFiles` filter that was specifically for the `file://` scheme with a `List` that can be added to in future.
2. wraps calls to pathContext.fromUri() and pathContext.toUri() in all LSP server to go through a new class (`ClientUriConverter`) that will be extended to support mapping between to custom URI schemes (instead of `file:///`) for generated files.

Change-Id: Ie8eadcca3cfd708e4dfde07c22d411101cc9ca0b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/346540
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
2024-01-16 21:28:29 +00:00
Konstantin Shcheglov 017749f2fe Macro. Support for FunctionType in element introspection.
Change-Id: I00cac601fa86554e529b9005630e36b1819ca1fb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/346181
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2024-01-16 21:19:08 +00:00
Konstantin Shcheglov 2a130837e6 Extension type. Issue 54601. Report clash between type parameters and container/members.
Bug: https://github.com/dart-lang/sdk/issues/54601
Change-Id: I4e95a41c8eeeb2ed0488a394fae3ace0aac3cb52
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/346162
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2024-01-16 20:53:11 +00:00
Konstantin Shcheglov 5b3c943382 Rename to flattenedToList2/flattenedToSet2
We might get it into package:collection
https://github.com/dart-lang/collection/pull/328

So, I rename it in the analyzer to prevent future conflict.

Change-Id: I8cee41e76cb0f3c7147eda2b7284cec9f57aea92
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/346163
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2024-01-16 20:50:32 +00:00
Konstantin Shcheglov e9983a51b2 Extension type. Issue 54593. Report ParserErrorCode.MEMBER_WITH_CLASS_NAME for the representation field.
Bug: https://github.com/dart-lang/sdk/issues/54593
Change-Id: Ia8f6d6b78f4a49d20c5573e8fa31115c5dbda415
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/345829
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2024-01-16 20:45:08 +00:00
Alexander Markov 66d3eedb33 [vm/aot/tfa] Analyze function calls
This change adds analysis of function calls when closure target
of a call can be inferred. Local functions are now analyzed separately
from enclosing members. Inferred result type of function calls is now
used in the AOT compiler.

Time of AOT compilation step 2 (TFA) on a large Flutter application:
Before: 59.448s
After: 61.870s (+4%)

Maintaining hierarchy of function types and analysis of all function
calls is not feasible as it causes unbearable increase in AOT
compilation time.

TEST=existing
Issue: https://github.com/dart-lang/sdk/issues/39692

Change-Id: Ieb4d5dce23868b5ab5c87fa1e77e49b85fd656fe
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/345083
Reviewed-by: Slava Egorov <vegorov@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2024-01-16 20:42:29 +00:00
Ryan Macnak 4cdfc63aa7 [test] Shrink async GC stress test to avoid timeouts on the slowest bots.
TEST=ci
Bug: https://github.com/dart-lang/sdk/issues/54590
Change-Id: Ib444f831e966fc980848cdd6495a5d0a343d439d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/346581
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2024-01-16 19:17:13 +00:00
Konstantin Shcheglov 637ec97e42 AnalysisDriver. Produce results for all files of a library. #2
#1: https://dart-review.googlesource.com/c/sdk/+/345363
#1R: https://dart-review.googlesource.com/c/sdk/+/345780

Change-Id: I4fe2b4cb879aee6cdccef0ff233ac86e8d0765ec
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/345827
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2024-01-16 18:58:28 +00:00
asiva 82c385f73a [VM/Service] Include newline in the stdout service event.
TEST=new test added

Bug:54582
Change-Id: I5e8d3aab19c37353a12e3a0a65edbb954d52bb4b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/346084
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Siva Annamalai <asiva@google.com>
2024-01-16 18:41:23 +00:00
Daco Harkes 8758f1f954 [vm] Bump service protocol to 4.14 and hide implementation
Follow up of https://dart-review.googlesource.com/c/sdk/+/346403.

TEST=pkg/vm_service/test/get_object_rpc_test.dart

Change-Id: I7c1d0fb565f8a128334844f7eec44eb4a4679c08
Cq-Include-Trybots: luci.dart.try:vm-linux-debug-ia32-try,vm-linux-debug-x64-try,vm-mac-debug-arm64-try,vm-win-debug-x64-try,vm-win-release-ia32-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/346600
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2024-01-16 18:25:18 +00:00
Alexander Aprelev 82520abfb1 [vm/debugger] Ensure setting breakpoints is lock-safe.
Acquire reload opreation scope when deoptimizing the world to ensure locks can be acquired for compilation.
Set up scope for operations that can be run while the world is deoptimized and stopped to avoid races.
Ensure code stays unoptizimed when single stepping, prevent other isolates to reoptimize it.

TEST=DeoptimizeFramesWhenSettingBreakpoint
BUG=https://github.com/flutter/flutter/issues/140878

Change-Id: Id4c891bd585d42365fd3a60cfb9a4869892c2b03
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/345743
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
2024-01-16 18:10:00 +00:00
Parker Lougheed 9bcb4a024b [linter] Don't trigger unnecessary_lambdas on deferred constructors
I didn't add this exception to the documentation as it's pretty niche and I'm afraid it might detract from the goal of the lint. Happy to add something if you think it's worth while though :)

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

Change-Id: I977be945208aee285f7bb44f73f7953b0646dc14
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/346100
Commit-Queue: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Auto-Submit: Parker Lougheed <parlough@gmail.com>
2024-01-16 15:29:49 +00:00
Jens Johansen 0fabbeb467 Remove unused options from package:testing (batch 1)
Change-Id: I5b214a9661c00cb1817f51bb76c7ad9b2407cc26
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/346521
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2024-01-16 13:18:57 +00:00
Jens Johansen 9985bad4ea [CFE] Remove unused fasta/sdk_test.dart
Also remove 'onlyCrashes' option which was only used there.

Change-Id: Iba1486058d561284d71aabf13431f302e7c5b9b0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/346520
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2024-01-16 13:18:57 +00:00
Tess Strickland 3feab3655c [vm/compiler] Fix ARM7 regression after 1827fcbf68.
The refactoring in https://dart-review.googlesource.com/c/sdk/+/345002
erroneously assumed that if the caller to
Assembler::AddressCanHoldConstantIndex didn't pass an out parameter to
detect whether a base register was needed, that that case shouldn't be
considered.

While it's true that LoadIndexedInstr::MakeLocationSummary originally
ignored the value stored in the out parameter, it did that because it
can use TMP to store the array base, unlike the code for
StoreIndexedInstr which must have a temporary register allocated during
register allocation.

Thus, fix Assembler::AddressCanHoldConstantIndex to always require
the out parameter, and add a comment in LoadIndexedInstr as to why
we ignore the out parameter in this case instead of allocating an
additional temporary register.

TEST=vm/cc/Assembler_Regress54621

Fixes: https://github.com/dart-lang/sdk/issues/54621
Change-Id: I0af557565faf657a87641457884334446e9b7cc5
Cq-Include-Trybots: luci.dart.try:vm-ffi-qemu-linux-release-arm-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/346201
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Tess Strickland <sstrickl@google.com>
2024-01-16 12:13:41 +00:00
Chloe Stefantsova c5cc9aeb6a [cfe] Thread OperationsCfe through and use it in constraint gatherer
This is the CFE counterpart to the similar update in the Analyzer:
https://dart-review.googlesource.com/c/sdk/+/343781

Change-Id: Ie0c177958d1e6cad9367456017aaf8848c4f1d29
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/346360
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Chloe Stefantsova <cstefantsova@google.com>
2024-01-16 12:09:26 +00:00
Chloe Stefantsova fd18f218ef [cfe] Clean up name clash error reporting
This is a follow-up to
https://dart-review.googlesource.com/c/sdk/+/346043

Change-Id: I90a6d0010f63b34b7cdba92e3460f1a290ca71d3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/346480
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Auto-Submit: Chloe Stefantsova <cstefantsova@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2024-01-16 12:05:38 +00:00
Daco Harkes 964e983f15 [vm/ffi] Initialize Library::ffi_native_resolver_ on deserializing snapshots
TEST=tests/ffi/native_assets/asset_process_test.dart

Closes: https://github.com/dart-lang/sdk/issues/54607
Change-Id: Id4e787a66f18db98473008b7da690dd2ca79a88e
Cq-Include-Trybots: luci.dart.try:vm-aot-linux-debug-x64-try,vm-aot-linux-debug-x64c-try,vm-aot-mac-release-arm64-try,vm-aot-mac-release-x64-try,vm-aot-obfuscate-linux-release-x64-try,vm-aot-optimization-level-linux-release-x64-try,vm-aot-win-debug-arm64-try,vm-aot-win-debug-x64-try,vm-aot-win-debug-x64c-try,vm-kernel-precomp-linux-release-x64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/346321
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
2024-01-16 11:58:48 +00:00
Daco Harkes f944ef16ab [vm] Fix g3 build
The file doesn't seem to have field promotion enabled in g3.

Change-Id: I1eafd191064fa24e62f60b7d29bb7468f55cfceb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/346460
Reviewed-by: Emmanuel Pellereau <emmanuelp@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
2024-01-16 09:48:40 +00:00
Johnni Winther 70d3adade2 [cfe] Move hoisted variables after variable caches
This moves the hoisted declaration of pattern variables till after the
variable cache declarations, such that any use of variables in the
matched expression, shadowed by the pattern variables, occurs before the
declaration of the shadowing variables.

Closes #54559

Change-Id: Id8ca8e7a499b9d71a50cd9987808d159f26bbd24
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/345942
Reviewed-by: Erik Ernst <eernst@google.com>
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2024-01-16 09:09:29 +00:00
Sam Rawlins 3f91beb64f analyzer: Separate FixProcessor from built-in fix producer mappings
In order for CorrectionProducers to be used in analyzer plugins, we
need to access DartFixContributor which needs to compute fixes via
FixProcessor. So both DartFixContributor and FixProcessor need to be
moved into analyzer_plugin (eventually). For now, to support
prototyping, I am moving FixProcessor to its own library, and
separating all of the built in mappings (from diagnostic to producer
generators).

I think this separation actually stands on its own as being tidier,
simplifying fix_internal.dart, and separating code from data, as it
were.

Work towards https://github.com/dart-lang/sdk/issues/53402

Cq-Include-Trybots: luci.dart.try:flutter-analyze-try,analyzer-win-release-try
Change-Id: I3b4fadc7ed94c23597d72bef7dcd832380d34e9a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/345561
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2024-01-15 23:41:29 +00:00
Daco Harkes 7ba473f32b [vm] Support Finalizers in the debugger
TEST=pkg/vm_service/test/get_object_rpc_test.dart

Closes: https://github.com/dart-lang/sdk/issues/54615
Change-Id: I5262d756af63eb5d1677894f6a2e151cd0d65fc1
Cq-Include-Trybots: luci.dart.try:vm-linux-debug-ia32-try,vm-linux-debug-x64-try,vm-mac-debug-arm64-try,vm-win-debug-x64-try,vm-win-release-ia32-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/346403
Reviewed-by: Ben Konyi <bkonyi@google.com>
Auto-Submit: Daco Harkes <dacoharkes@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
2024-01-15 23:14:56 +00:00
Paul Berry 598bc1639f Clean up mini-ast handling of lub and promoteToNonNull.
`lub` was implemented twice (once as `lub` and once as `_lub`), with
some behaviors implemented in each, and other behaviors not
implemented. This was good enough to make unit tests pass, but for
long term maintainability, it's better to have a single unified
implementation.

The unified implementation makes use of `promoteToNonNull`, which had
a subtle bug: it interpreted the unknown type `?` as a nullable type
and tried to convert it to ``. That bug has now been fixed.

Change-Id: If257a446e46f916843fe0ff95b6bc48c6c820d93
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/346421
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2024-01-15 20:02:50 +00:00
Paul Berry 15c0239344 Fix context type for == and != patterns.
According to the patterns spec
(https://github.com/dart-lang/language/blob/main/accepted/3.0/patterns/feature-specification.md),
if `A` is the type of the formal parameter of the operator
declaration, then operand should be type checked with context type
`A?` when op is `==` or `!=`, and with context type `A` otherwise.

Prior to this commit, context type `A` was always used.

There should be no observable behavior difference, because the operand
of a relational operator is required to be a constant expression, and
there is no constant expression that behaves differently when its
context is `A?` vs `A`.

However, we are contemplating some possible future language changes
that *would* make the difference observable (e.g.,
https://github.com/dart-lang/language/issues/3471), so it seems
prudent to fix the behavior to match the spec.

Change-Id: Ib3a1c82de45c65a851cbd613899ba1f72c215fbe
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/346420
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2024-01-15 18:17:08 +00:00
Tien Do Nam 5ad284b1a4 feat: add missing generic type to Stream.close
Closes https://github.com/dart-lang/sdk/pull/53958

GitOrigin-RevId: d551aad6994bcd8cc4f441818c82d13021d25e81
Change-Id: Ie0cec357ceb243d408eddcface4c919da774ebaf
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/334121
Reviewed-by: Lasse Nielsen <lrn@google.com>
Commit-Queue: Lasse Nielsen <lrn@google.com>
2024-01-15 17:00:43 +00:00
Daco Harkes cdb6d48dd3 Add owners file to pkg/mmap
Follow up of:
https://dart-review.googlesource.com/c/sdk/+/338121

Change-Id: I8b0c7d3cb1374b4de659c9e7b1a30ee3804a59f5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/346402
Auto-Submit: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Moritz Sümmermann <mosum@google.com>
Commit-Queue: Moritz Sümmermann <mosum@google.com>
2024-01-15 16:28:57 +00:00
Tess Strickland fd1ac98359 [tools] Pass through offsets extractor arguments to tools/build.py.
Allows the builds to be run with non-default arguments, for example:

dart tools/run_offsets_extractor.dart --no-rbe

Change-Id: I1299b156a40baab27db890c0b0ae5f2f945c4259
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/346361
Reviewed-by: Jonas Termansen <sortie@google.com>
Commit-Queue: Tess Strickland <sstrickl@google.com>
2024-01-15 15:36:17 +00:00
Chloe Stefantsova 35dd27c28b [cfe] Use a better message for extension types implementing nullable
Additionally, fix the textual representation of nullable named type
builders without type arguments. Before the fix the nullability marker
was skipped on them.

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

Change-Id: I137d60ec3325be6fc9b6371ec0d6af2c5c956239
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/346300
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Chloe Stefantsova <cstefantsova@google.com>
2024-01-15 13:51:12 +00:00