Commit graph

101518 commits

Author SHA1 Message Date
Sam Rawlins e04c53d5ac meta: add TargetKind to @factory
Cq-Include-Trybots: luci.dart.try:flutter-analyze-try,analyzer-win-release-try,pkg-win-release-try
Change-Id: I5c0608637f2feb9986e890f3c83cf02884bef7f9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/369789
Commit-Queue: Sam Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2024-06-06 15:39:56 +00:00
pq 3f47c93b8c quick fix for EXTERNAL_TYPEDEF
See: https://github.com/dart-lang/sdk/issues/55917

Change-Id: I3826969b5f20b2140fb522ab1882e5f2330cab5e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/369881
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Auto-Submit: Phil Quitslund <pquitslund@google.com>
2024-06-06 14:45:58 +00:00
Chloe Stefantsova d31d0f9618 [cfe] Account for compilation stage in invocations post-processing
Closes https://github.com/dart-lang/sdk/issues/55849
Closes https://github.com/dart-lang/sdk/issues/55755

Change-Id: I471830cafed76ec5c503fe726ade857c007ed712
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/369063
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Chloe Stefantsova <cstefantsova@google.com>
2024-06-06 11:58:30 +00:00
Johnni Winther c5cd8ff349 [cfe] Remove agnostic mode
The agnostic mode was added to allow the platform dill embedded in
the VM to support both weak and strong mode. Since weak mode is no
longer supported in the VM, the agnostic mode can new be deleted.

All uses of the agnostic in Dart and Flutter have been removed prior
to this change.

Change-Id: Iff0f69d9cd64e887e01cd7e7d336a97761bd6d4b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/366801
Reviewed-by: Alexander Thomas <athom@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
2024-06-06 11:02:37 +00:00
Tess Strickland d06d627c79 [vm] Remove --[no-]lazy-dispatchers flag.
No client of the VM uses this flag, only tests, and this flag was always
set to false in AOT mode. Thus, remove uses of this flag and instead
always lazily create dispatchers as needed when resolving method names
in JIT mode.

Remove the implicit value of `allow_add` for some Resolver
static methods. For callers that previously depended on the implicit
`true` value (which includes the AOT precompilier), pass `true` for
uses in the compiler and pass `!FLAG_precompiled_mode` for uses in the
runtime. Assert that `allow_add` is false when these methods are invoked
from the precompiled runtime.

Remove Resolver static methods that are no longer used.

TEST=ci

Change-Id: Ib6a7354f7a859e86743c381513a4129c14895753
Cq-Include-Trybots: luci.dart.try:vm-linux-debug-x64-try,vm-linux-release-x64-try,vm-aot-linux-debug-x64-try,vm-aot-linux-release-x64-try,vm-aot-mac-release-arm64-try,vm-mac-debug-arm64-try,vm-mac-release-arm64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/366668
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Tess Strickland <sstrickl@google.com>
2024-06-06 10:56:12 +00:00
Tess Strickland d7e6e0e8c3 [vm/compiler] Fix dart fuzzer CalculateElementAddress crash on X64C.
In the backend, handle the following cases that were assumed not to
happen before:
* If the index and offset are both 0, then the operation is a no-op
  and so the output register should be the same as the first input.
  (Should only happen if the instruction is used in a non-optimizing
  context, as otherwise it is removed by canonicalization.)
* If the scaled index can be used as an instruction immediate and the
  offset is 0, then emit the appropriate instruction(s).
* If the scaled index and offset can both be used as immediates to
  instructions, but their sum (the total offset in bytes) cannot, then
  allocate a register for the index and fall back to the non-constant
  index case.

CalculateElementAddress::Canonicalize now only performs removal of
no-op instructions.

This CL also fixes a switch on the instruction tag in
FlowGraph::RenameRecursive to appropriately convert UnboxedConstant
instructions to initial definitions of the FlowGraph as it already does
for Constant instructions.

TEST=vm/dart/regress_55877

Issue: https://github.com/dart-lang/sdk/issues/55877
Cq-Include-Trybots: luci.dart.try:vm-aot-linux-debug-simarm_x64-try,vm-aot-linux-debug-simriscv64-try,vm-aot-linux-debug-x64-try,vm-aot-linux-debug-x64c-try,vm-linux-debug-ia32-try,vm-linux-debug-x64-try,vm-linux-debug-x64c-try,vm-linux-debug-simriscv64-try,vm-mac-debug-arm64-try,vm-aot-mac-release-arm64-try
Change-Id: I613d6c8770fe02facf6bbdb3d2b11f842b51540d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/369642
Commit-Queue: Tess Strickland <sstrickl@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2024-06-06 09:14:18 +00:00
pq d91f05c1c7 quick fix for EXTERNAL_ENUM
See: https://github.com/dart-lang/sdk/issues/55917

Change-Id: I0f60078bfcb3ae5ab6d559a9e2314abe209726bf
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/369880
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
Auto-Submit: Phil Quitslund <pquitslund@google.com>
2024-06-06 03:42:03 +00:00
Konstantin Shcheglov 46ea7ade07 Extract TypeAnnotationLocationWriter / Reader into separate library.
I plan using it to implement serialization of MacroExecutionResult(s).

Bug: https://github.com/dart-lang/language/issues/3877
Change-Id: I34d95ab6fd2c335ceb2a957c9222947b85e986a1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/369841
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2024-06-06 00:20:27 +00:00
Ryan Macnak 42270748b5 [vm, io] Remove dead Windows 7 code.
TEST=ci
Bug: https://github.com/dart-lang/sdk/issues/54509
Change-Id: I488f01e43faccf6f9f2dd58fcd55ca33a7f1f55d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/369860
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2024-06-05 23:08:15 +00:00
Parker Lougheed 83135245b2 [linter] Publish new linter diagnostic messages
This CL doesn't set up the analyzer to surface links to these destinations, just includes the new format in the diagnostic messages file.

Change-Id: I6c227448b42a5abac53d5c6a863e599c7e8809da
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/368081
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Commit-Queue: Marya Belanger <mbelanger@google.com>
2024-06-05 22:07:03 +00:00
Keerti Parthasarathy d9ff61bd87 [Refactor]: Move relevance computation out of SuggestionBuilder.
- use the new RelevanceComputer to compute relevance for CandidateSuggestion's before calling into the SuggestionBuilder, as
part of the new flow for completions.
- reuse the RelevanceComputer where possible in SuggestionBuilder.

Change-Id: I8fdfaee81e68bc66f726c40a76ab6c81099a2cc6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/369840
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Keerti Parthasarathy <keertip@google.com>
2024-06-05 21:37:03 +00:00
Nicholas Shahan e7b1bca707 [ddc] Rename variable used to store late value
Late local variables are lowered by the CFE into a local:
* backing store variable
* get method
* set method
* isSet local variable (optionally when the type is nullable)

This change updates the name in JavaScript used for the backing store
variable to match the name for the late variable from the original
source. It also updates the scope information passed for expression
evaluation to remove the lowered name and replace it with the original
so evaluations will work as well.

The name change avoids the hiding performed by the debugger on
recognized temporary names so it appears in the list of local variables.

b/343405209
Issue: See https://github.com/dart-lang/sdk/issues/55918

Change-Id: I6b65a62baf6f26f6e9cfee9f14667d021e16645e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/369506
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
2024-06-05 20:50:49 +00:00
Sam Rawlins 8029fdf79a meta: Add a TargetKind for _Sealed
Cq-Include-Trybots: luci.dart.try:flutter-analyze-try,analyzer-win-release-try,pkg-win-release-try
Change-Id: Ibac1f71f6cbb9432150b49b8565bf740efa1be32
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/369765
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Sam Rawlins <srawlins@google.com>
2024-06-05 20:28:57 +00:00
Konstantin Shcheglov 6c480c548d Move writeMap() / readMap() to lower level.
Change-Id: I072040358238361fd9babd92ba55ba8538eeb105
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/369786
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2024-06-05 19:08:46 +00:00
Srujan Gaddam 4707d77226 Update package:web dep to latest
Change-Id: I76da2d0caf8e357d139e504f4dd865e9e92e2b65
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/369523
Reviewed-by: Devon Carew <devoncarew@google.com>
Commit-Queue: Srujan Gaddam <srujzs@google.com>
2024-06-05 18:51:42 +00:00
pq 4ecea4b40a quick fix for EXTERNAL_CLASS
See: https://github.com/dart-lang/sdk/issues/55917

Change-Id: I330f1c571de0ecc4b2cef390ee98dd008dec9afc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/369785
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
Auto-Submit: Phil Quitslund <pquitslund@google.com>
2024-06-05 18:45:32 +00:00
Parker Lougheed 8716461eaf [docs] Misc minor cleanup to migrated wiki docs
Fixes a few minor issues relating to outdated links, spelling, Markdown formatting, word choice, etc.

Bug: https://github.com/dart-lang/sdk/issues/54066
Change-Id: Ic7b9b33b27d2ce2c30f9b1fe17b0bc91873ecfb7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/369764
Reviewed-by: Nate Bosch <nbosch@google.com>
Reviewed-by: Devon Carew <devoncarew@google.com>
Commit-Queue: Devon Carew <devoncarew@google.com>
2024-06-05 18:43:39 +00:00
Sam Rawlins 82a3006220 macros: replace unsupported [this] comment references with this.
Work towards https://github.com/dart-lang/dartdoc/issues/3761

Sibling CL to https://dart-review.googlesource.com/c/sdk/+/365204

The analyzer has never recognized `[this]` as a valid doc comment
reference (and the `comment_references` lint rule has similarly
reported such reference attempts). dartdoc has its own algorithms
for resolving comment references, which we are dismantling in favor
of a single resolution, provided by the analyzer.

We've also decided against adding support in the analyzer (see
https://github.com/dart-lang/linter/issues/2079), so these
reference attempts should be re-written.

Change-Id: I872c215a574dc3d04f0708387408d22fdfd14c14
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/366882
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Jake Macdonald <jakemac@google.com>
2024-06-05 18:37:46 +00:00
Danny Tuppeny adabc902ca [dap] Update the repo URL in pkg:dap pubspec
This package was moved to third_party but the URL here was not updated so the link on Pub is a 404.

This will need a new Pub release before it updates, but I'm not sure it's worth doing until there are some changes.

Change-Id: Ibd1e4ba0208f13f27e1e04ba141e8a78155bd2bf
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/369700
Reviewed-by: Ben Konyi <bkonyi@google.com>
Reviewed-by: Helin Shiah <helinx@google.com>
Commit-Queue: Elliott Brooks <elliottbrooks@google.com>
2024-06-05 18:19:19 +00:00
pq ad759d306c quick fix for COVARIANT_MEMBER
See: https://github.com/dart-lang/sdk/issues/55917

Change-Id: Id6f749fe0f7cb51403b0952abb2e2ba8a24d3120
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/369767
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Auto-Submit: Phil Quitslund <pquitslund@google.com>
2024-06-05 18:04:19 +00:00
Martin Kustermann 290d7406ae [dart2wasm] Avoid WasmArray<_Type> allocations in interface subtype checking
Issue https://github.com/dart-lang/sdk/issues/55516

Change-Id: I2cddd95211f3d831965a1bba45774ad8d72847a9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/369621
Reviewed-by: Srujan Gaddam <srujzs@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2024-06-05 17:57:49 +00:00
Ryan Macnak b11c932a29 [vm, gc] Work-steal the store buffer during scavenging.
TEST=ci
Bug: https://github.com/dart-lang/sdk/issues/55713
Change-Id: Ie198a94c43f6ba8048695204eb716049bf8b23e2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/369740
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2024-06-05 17:45:19 +00:00
Sam Rawlins a75691fe7d linter: Remove unused fields in Group
Well, to be honest, remove all instances of Group. Instead, "groups"
are Strings. Because there was only one field left, a Group is just
a... name of a group.

Also, LintRule is no longer Comparable because that does not seem to
have served a purpose...

Cq-Include-Trybots: luci.dart.try:flutter-analyze-try,analyzer-win-release-try,pkg-win-release-try
Change-Id: I6e058139631dc1b06a4072a2549f156d1622c673
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/369782
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2024-06-05 17:43:19 +00:00
Kenzie Schmoll 0b6aff760b Add headers to the DevTools server to enable serving DevTools with wasm.
Bug: https://github.com/flutter/devtools/issues/7856
Change-Id: I854fbaad9c1e477c3218bd159cd1a6db1aae8e74
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/369100
Reviewed-by: Kevin Moore <kevmoo@google.com>
Commit-Queue: Kenzie Davisson <kenzieschmoll@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2024-06-05 17:26:23 +00:00
Konstantin Shcheglov a4aac1781b Move writeEnum() / readEnum() to lower level.
Change-Id: If20f6421845a427adbace262ee674fcaec7a3721
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/369783
Reviewed-by: Samuel Rawlins <srawlins@google.com>
2024-06-05 16:57:03 +00:00
Sam Rawlins 8e1ea1f114 linter: move always_put_required_named_parameters_first tests
Cq-Include-Trybots: luci.dart.try:flutter-analyze-try,analyzer-win-release-try,pkg-win-release-try
Change-Id: I5cdd56f3da7a70fdea2701f9a15f8dcd545f2462
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/369766
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2024-06-05 16:28:20 +00:00
Vyacheslav Egorov e0710a5cc6 [vm/compiler] Support SIMD arrays in TypedDataSpecializer
TEST=vm/cc/IRTest_TypedDataAOT_FunctionalGetSet

Cq-Include-Trybots: luci.dart.try:vm-aot-linux-debug-x64-try,vm-aot-linux-release-arm64-try,vm-aot-linux-release-simarm_x64-try
Change-Id: I64a050acffaec5228828876b6da998687b5e432b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/369762
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Slava Egorov <vegorov@google.com>
2024-06-05 15:08:10 +00:00
Sam Rawlins 149fc77208 linter: Remove a number of unused classes
* Remove unused LinterException, Reporter, PrintingReporter.
* Mark Hyperlink as visible-for-testing, and make 3 fields private.
* Make the LinterConstantEvaluationResult constructor private.
* Make LinterContextParsedImpl.package a getter

Cq-Include-Trybots: luci.dart.try:flutter-analyze-try,analyzer-win-release-try,pkg-win-release-try
Change-Id: Ib403fb7744e9454742d6555c8cdb8764ab4377be
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/369781
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2024-06-05 14:56:48 +00:00
pq 1e6bc6697a quick fix for FACTORY_TOP_LEVEL_DECLARATION
Change-Id: I77fad91ead543c7be5d532d0c2f5240ec5146635
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/369763
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Auto-Submit: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2024-06-05 14:32:19 +00:00
dependabot[bot] 1c692c7b71 Bump github/codeql-action from 3.25.6 to 3.25.7
Closes https://github.com/dart-lang/sdk/pull/55909

GitOrigin-RevId: e021d00ac125e88d381255d2a413a333c7804cde
Change-Id: I151ab4f05eaa6334207e7ca72aed1884c2ec994b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/369440
Reviewed-by: Alexander Thomas <athom@google.com>
Commit-Queue: Alexander Thomas <athom@google.com>
2024-06-05 05:44:37 +00:00
Sam Rawlins 07fe01bf50 linter: Remove NodeLintRule from the hierarchy
Cq-Include-Trybots: luci.dart.try:flutter-analyze-try,analyzer-win-release-try,pkg-win-release-try
Change-Id: Id3c495ecd4b929114ee65be8e920cd5277d5291d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/369524
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
2024-06-05 04:18:58 +00:00
pq 476c404798 quick fix for CONST_METHOD
See: https://github.com/dart-lang/sdk/issues/55917

Change-Id: I2eab04ad9d2947c387b382809808165e1501c7b3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/369741
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Auto-Submit: Phil Quitslund <pquitslund@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
2024-06-04 21:21:40 +00:00
Paul Berry ace5ab2944 Add repro instructions to coverage test output.
Also update the coverage test so that it prints detailed results to
standard output, so that the repro instructions will produce a useful
result.

In my experiments, I've found that the number supplied for the
`--tasks` argument can have a small effect on coverage numbers (though
I'm not sure why), so I've included it in the repro instructions.

Change-Id: Ic347a9e5e3c2da0f73ceefbaa9322a60295735d6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/368920
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2024-06-04 21:05:40 +00:00
Elliott Brooks 150c24f332 [DAP] Add field showToUser to DebugAdapterException
Bug: https://github.com/dart-lang/sdk/issues/55789
Change-Id: I204672f8e4cf2d073e7640665eaaaa9c8028efe7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/369720
Commit-Queue: Helin Shiah <helinx@google.com>
Reviewed-by: Helin Shiah <helinx@google.com>
2024-06-04 21:03:23 +00:00
Paul Berry 2fe6c5d532 Reorganize analysis server's "new language feature" list and add descriptive text.
Based on discussions for the analysis server implementation of the
wildcards feature (https://github.com/dart-lang/sdk/issues/55681).

Bug: https://github.com/dart-lang/sdk/issues/55681
Change-Id: I8a161ead687ffb71cf18fb573323fbb7c36bf0a3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/369501
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Kallen Tu <kallentu@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2024-06-04 20:51:02 +00:00
Alexander Markov 43ba8eb388 [vm] Add index checks to Array handle class
Index checks in debug mode are useful to catch bugs earlier.

Also remove stale declaration of PcDescriptors::PrintHeaderString.

TEST=ci

Change-Id: I4a149c3516a6627b3d4d254b9b7eed403f8aea1e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/369721
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Auto-Submit: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2024-06-04 20:21:26 +00:00
pq ffa9812d74 fix backwards reporting of generated code counts
Change-Id: I08ced5bfe65fcc55f70bbfd7d53de42d60e741f2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/368960
Auto-Submit: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2024-06-04 18:22:01 +00:00
Sam Rawlins a451edf978 meta: Use TargetKind.overridableMember on MustBeOverridden
Change-Id: I6f19eeac5efac2c56eabecd32bc6e2032d1ba764
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/369526
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2024-06-04 17:29:09 +00:00
Sam Rawlins cf9a8bb532 analyzer: Move DartLinter to linter package's 'test_utilities'
And rename it to TestLinter.

We also get to remove `LintRule._locationInfo`,which was _only_ used
for testing pubspec-oriented rules.

This DartLinter class is only used in tests and tools of the linter
package, so it's good to move it out of analyzer lib/.

In order to remove `LintRule._locationInfo`, we move the singular
package_names test case to be a reflective test.

Cq-Include-Trybots: luci.dart.try:flutter-analyze-try,analyzer-win-release-try,pkg-win-release-try
Change-Id: I97b5e79daa07eb3942f5444502473a4ec1e9daf0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/369562
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2024-06-04 17:13:49 +00:00
Devon Carew 117e214360 Update External-Package-Maintenance.md
Closes https://github.com/dart-lang/sdk/pull/55919

GitOrigin-RevId: 13384fff2e890f826177ddf8ea664ec8d1c8f931
Change-Id: I218c5f2ed2e3e0aa13fc235031e3241c07cb1b86
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/369525
Reviewed-by: Nate Bosch <nbosch@google.com>
Commit-Queue: Devon Carew <devoncarew@google.com>
2024-06-04 17:04:25 +00:00
Konstantin Shcheglov 617f99700a Issue 52363. Check that the current name scope is LocalScope.
PatternAssignment is a strange expression that syntactcally can have
declared variables inside.

Bug: https://github.com/dart-lang/sdk/issues/52363
Change-Id: Id6132be26581112941b7b4828c8e232143ed59b4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/369505
Commit-Queue: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
2024-06-04 16:47:14 +00:00
pq 7ad7c92338 [cleanup] remove wildcard variable test classes
As discussed, remove dedicated wildcard experiment test classes in favor of language versioning exceptions.

Change-Id: I415485b42b6c356d6beec9203dcb7d838e341399
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/369509
Auto-Submit: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
2024-06-04 16:21:42 +00:00
Derek Xu 30b0796c8c [VM/Debugger] Fix bug where breakpoints set in compiled field initializers do not resolve immediately
TEST=verified that
pkg/vm_service/test/breakpoint_resolves_immediately_in_compiled_field_initializer_test.dart
fails without the changes in this CL and passes with them, verified that
none of the existing debugger tests got broken by this CL

Change-Id: I6acb5576a80e5d633b012c866fe90bf13d2c1ba6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/369162
Commit-Queue: Derek Xu <derekx@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
2024-06-04 15:06:28 +00:00
pq 4eaefacaaa quick fix for INTERFACE_MIXIN_CLASS
Change-Id: I43c57f27f17a0867beaa16db3f74bb20d2579629
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/369508
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Auto-Submit: Phil Quitslund <pquitslund@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2024-06-04 14:29:48 +00:00
Martin Kustermann 320f367378 [dart2wasm] Lower type constants to instance constants
Instead of hand-written assembly to instantiate various different kinds
of type constants, we simply lower type constants to `InstanceConstant`s
for which we already have code generation.

This lowering also means that types that are considered to be different
on the kernel `DartType` level may end up being lowered to the same
`InstanceConstant`.
=> We canonicalize them now where we didn't before
=> We reduce code size.

An example where this happens the `TypeParameterType`: On the kernel
level two such types are different if they refer to a different class.
But in the RTT data structure we do not care about what class they refer
to, only the index is important (as RTT knows which class it belongs
to).

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

Change-Id: I7ebd68b2c48c752f6d074a7981da75fbbfbcf00f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/369480
Reviewed-by: Srujan Gaddam <srujzs@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2024-06-04 10:01:06 +00:00
Martin Kustermann 23657ac772 [dart2wasm] Remove dispatch table call in type check implementation if not needed
When checking against a destination type that isn't generic, we can
safely ignore the type arguments of the concrete class (as we only care
whether the object's class has the destination type in its transitive
super type hierarchy).

=> Avoid calling `Object._getTypeArguments(o)` if dst type is non-generic.

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

Change-Id: Ie9c6a3ab2d99acc07546f9d28ca71ac740c4aad5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/369462
Reviewed-by: Srujan Gaddam <srujzs@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2024-06-04 08:34:48 +00:00
Jens Johansen 81f5879ca0 [parser] Rename firstToken to beginToken in beginSwitchCase/endSwitchCases
This makes it more consistent with other listener calls.

Change-Id: Iae98ae4c37078c15ea785faef1cb21b2ea85bb48
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/369060
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2024-06-04 08:23:36 +00:00
Martin Kustermann ed409e53ff [dart2wasm] Avoid optaining substitutions if dst type is not generic
If we do a type check against a class that isn't generic, then we can
safely ignore all the type arguments - because irrespective of their
values - either the class we test against is in the transitive super
hierarchy of an object's class or not.

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

Change-Id: Ibf6950492d4c33d7eaf55d6ce8389ebfac201b00
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/369461
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Srujan Gaddam <srujzs@google.com>
2024-06-04 06:35:59 +00:00
pq a35de7937c quick fix for FINAL_MIXIN_CLASS
Change-Id: Ief41674c064116a6152f413bf42a2d23b404eda2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/369504
Auto-Submit: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2024-06-04 00:44:41 +00:00
Sam Rawlins feea19e376 Remove old UpdateSdkConstraints fixes
Cq-Include-Trybots: luci.dart.try:flutter-analyze-try,analyzer-win-release-try,pkg-win-release-try
Change-Id: I01acce254064c667ec641114ffd8d7247d11a0e8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/369542
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Auto-Submit: Samuel Rawlins <srawlins@google.com>
2024-06-03 23:18:18 +00:00