Commit graph

92563 commits

Author SHA1 Message Date
dependabot[bot] 99c9408188 Bump ossf/scorecard-action from 2.1.3 to 2.2.0
Closes https://github.com/dart-lang/sdk/pull/52783

GitOrigin-RevId: 8fb776aa1f2a3b63e8c4d810bfea185aa1c79aa8
Change-Id: I447561e3ccccce9cef6abc7138f134d1a058d601
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/311360
Reviewed-by: Alexander Thomas <athom@google.com>
Commit-Queue: Alexander Thomas <athom@google.com>
2023-07-10 10:03:28 +00:00
Chloe Stefantsova b36fbaef2c [cfe] Update both sides of intersection types in GUB
In computation of GUB both the left-hand and the right-hand sides of
the intersection should be updated as nullable when the other operator
to GUB is Null.

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

Change-Id: I4b616a94a3e7bf149205ba1b90732453c19ace47
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/311845
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Chloe Stefantsova <cstefantsova@google.com>
2023-07-10 09:51:56 +00:00
Vyacheslav Egorov 44230dce94 [vm/compiler] Remove assertion from inliner
This assertion hits flakily due to races between compilers
(e.g. mutator vs background compiler or multiple mutators racing
with itself).

The discovered races are benign, so we just going to remove
the assertion.

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

TEST=ci
R=kustermann@google.com

Change-Id: I8c4202bd76acea0fbf3724f19dbbc69958937afc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/312903
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Slava Egorov <vegorov@google.com>
2023-07-10 09:50:54 +00:00
Liam Appelbe f4eb5392e5 Refactor vmspecific_static_checks_test
Bug: https://github.com/dart-lang/sdk/issues/52754
Change-Id: I13d729f0caf61fa0ef261ffd1c382177a4115d8f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/312342
Commit-Queue: Liam Appelbe <liama@google.com>
Reviewed-by: Daco Harkes <dacoharkes@google.com>
2023-07-10 00:07:28 +00:00
Konstantin Shcheglov 4d4eefa956 Compute 'mixins' and 'interfaces' for ClassElement.augmented
Change-Id: I7514576ada4a5dcd048a2c399d5bfe11169f3394
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/312887
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2023-07-07 21:39:41 +00:00
Alexander Aprelev e800d945c7 Revert "[gardening] Populate legacy patched_class_ link."
This reverts commit 83616c9b56 as it was
not needed for flutter roll, which landed anyway.

TEST=ci
Change-Id: I38a85ab117cabd98420bc88e698a481b094d7345
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/312886
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
Auto-Submit: Alexander Aprelev <aam@google.com>
2023-07-07 21:27:56 +00:00
Konstantin Shcheglov 884116a83b Move 'constructors' getter into NamedInstanceOrAugmentationElementMixin.
Remove extra looping detection.

Change-Id: Ifdd7f4729930b3022a8b04f8143d714298acf8dc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/312884
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2023-07-07 20:34:39 +00:00
Martin Kustermann 2cb0882a2d [vm] Unblock dart->g3 roll
The adjustments to g3 build rules that allow running non-TSAN
gen_snapshot targeting TSAN AOT runtime aren't quite fleshed out yet.

So we temporarily let `gen_snapshot` detect whether to target TSAN by
whether it is itself compiled in TSAN (instead of via
`-DTARGET_USES_THREAD_SANITIZER`)

TEST=ci
Issue b/287638965

Change-Id: I2cd744f959d8302ba81cb1feceedee2756e02656
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/312901
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
2023-07-07 19:28:58 +00:00
Konstantin Shcheglov aad361b31e Link augmentations and targets during building.
We walk augmentations in the right order, so can update update
necessary data structures as we go.

Change-Id: Ibf3409658009b82a960caaacd538fcd6c779b007
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/312883
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2023-07-07 19:14:25 +00:00
Konstantin Shcheglov 553c804eb5 Don't use LinkedData type parameter.
Change-Id: I2afa126856f05072cb5e796b4f47d64e61284b96
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/312882
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2023-07-07 18:29:37 +00:00
Konstantin Shcheglov ac0fc3c11c Print augmentation libraries after the defining unit.
So, we can read it more naturally, first the declaration, then its
augmentations.

Change-Id: I21805969bff6874660500d4477b39ce5aba7484a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/312880
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2023-07-07 17:08:54 +00:00
pq ff8963d1be fix make_final to properly update for loop patterns
Fixes: https://github.com/dart-lang/sdk/issues/52820

Change-Id: If94b56f034bc8c28087251aada59433578ed7a2f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/312702
Commit-Queue: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2023-07-07 16:23:59 +00:00
Danny Tuppeny 201fb68e64 [analysis_server] Update remaining CodeActions tests to use new expectation format
This is a continuation of a previous change that stops tests from verifying only individual files modified via a `WorkspaceEdit`. All verifications of these edits are done via a single string that includes all changes, with annotations for creates/deletes/renames.

Additionally, it migrates some additional tests to use TestCode instead of the old markers, and removes some extra indenting these tests had.

It also starts changing how capabilities are set for tests from having to nest function calls in `initialize()` calls to instead calling simple helpers prior to initialization.

Change-Id: I35d16a296c2125ab830685437e14eb3b29ea4704
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/312841
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2023-07-07 16:15:24 +00:00
pq b05282a1e9 @useResult support for pattern variable declarations
Fixes: https://github.com/dart-lang/sdk/issues/52841

Change-Id: I0ce4e8bc7771808fcaacfbfc2b591ab805c74ff4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/312711
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
2023-07-07 15:56:28 +00:00
Konstantin Shcheglov fc0e656868 Build ClassAugmentationElementImpl, basic linking.
Change-Id: I18bd3d97ad9fe661d14e3d3d006219ffceedcfc4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/312349
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2023-07-07 14:55:38 +00:00
Martin Kustermann 9d876d12b2 [vm] Rename kUsingThreadSanitizer->kTargetUsesThreadSanitizer, include tsan in snapshot flags
TEST=ci
Issue b/287638965

Change-Id: I649b28ac0181761d0927e80b8eff7c8af5fe305a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/312840
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Slava Egorov <vegorov@google.com>
2023-07-07 14:42:22 +00:00
Tess Strickland 1bdbafff49 [pkg/vm_snapshot_analysis] Allow old 'patched_class_' field.
While in more recent SDK versions the 'patched_class_' field has
been replaced with 'wrapped_class_', this package can still be
used with the earlier SDK versions if we fall back to checking it.

Issue: https://github.com/flutter/flutter/issues/130009
Change-Id: Ifb1250393b72e58bbdc0764c7e2ce96269e659ea
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/312802
Commit-Queue: Tess Strickland <sstrickl@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2023-07-07 11:36:59 +00:00
Tess Strickland 1133598168 [pkg/vm_snapshot_analysis] Don't assume Code objects have an owner.
For regular stubs, the owner will be null.

Issue: https://github.com/flutter/flutter/issues/130009
Change-Id: I8c85e3130128af79c596f381869d61631221cf9e
Cq-Include-Trybots: luci.dart.try:pkg-mac-release-try,pkg-mac-release-arm64-try,pkg-linux-release-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/312660
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Tess Strickland <sstrickl@google.com>
2023-07-07 09:52:50 +00:00
Martin Kustermann 82577191ec [vm] Allow build rules to pass TARGET_USES_THREAD_SANITIZER in any configuration
This may simplify some g3 build rules as it allows passing this define
whenever we compile under TSAN - instead currently it can only be passed
if DART_PRECOPMILER is also passed.

TEST=ci

Change-Id: I73e51243716373cdeca7559b344408bb206e22ba
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/312801
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2023-07-07 09:02:32 +00:00
Sergey G. Grekhov e0493a5467 [co19] Roll co19 to 48d7f551cbc64b452c625351ab212180d3a2721c
2023-07-06 sgrekhov22@gmail.com Fixes dart-lang/co19#2115. Fix roll failures (mixin tests) (dart-lang/co19#2116)
2023-07-06 sgrekhov22@gmail.com dart-lang/co19#2112. Add missing tests for mixins. Part 1 (dart-lang/co19#2114)
2023-07-04 sgrekhov22@gmail.com dart-lang/co19#1400. Add test for implementing an inline class from another library (dart-lang/co19#2113)
2023-07-04 sgrekhov22@gmail.com dart-lang/co19#2094. Move and rename mixin tests to follow the current spec structure (dart-lang/co19#2108)
2023-07-03 sgrekhov22@gmail.com dart-lang/co19#1361. Add SDK issue numbers to the failing tests (dart-lang/co19#2110)
2023-07-03 sgrekhov22@gmail.com Fixes dart-lang/co19#2109. Add tests checking type parameters scope (dart-lang/co19#2111)
2023-07-01 49699333+dependabot[bot]@users.noreply.github.com Bump actions/checkout from 3.5.2 to 3.5.3 (dart-lang/co19#2107)
2023-07-01 sgrekhov22@gmail.com Fixes dart-lang/co19#2105. Add missed error expectation (dart-lang/co19#2106)
2023-06-30 sgrekhov22@gmail.com dart-lang/co19#2094. Remove mixin-related TODO and @dart=2.19 (dart-lang/co19#2104)
2023-06-29 sgrekhov22@gmail.com dart-lang/co19#2094. Remove TODO, update assertions in Language/Mixin tests (dart-lang/co19#2103)
2023-06-28 sgrekhov22@gmail.com Fixes dart-lang/co19#2073. Add combined member signature tests (dart-lang/co19#2101)

Change-Id: If6dd674f5e3cba8be232cb1e06da434b7277acbf
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/312620
Reviewed-by: Alexander Thomas <athom@google.com>
2023-07-07 08:30:31 +00:00
Nicholas Shahan 5ca83258ef [ddc] Fix default type args signature on native classes
- They should match the calling convention and use the "dartx" symbol.
- Skip adding signatures for static methods since they can't be
  called dynamically anyway.

Issue: https://github.com/dart-lang/sdk/issues/48585
Issue: https://github.com/dart-lang/sdk/issues/52867
Change-Id: If5a76f52163b2267129880dbfe8d145a3fd93408
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/312204
Reviewed-by: Mark Zhou <markzipan@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
2023-07-06 23:34:20 +00:00
Alexander Aprelev e62748f3e1 [gardening] Make info_macos_test resilient to snapshots running.
Align info_macos_test with info_linux_test in this regard: fix is similar to how https://github.com/dart-lang/sdk/issues/50583 was addressed.

BUG=https://github.com/dart-lang/sdk/issues/52658
BUG=https://github.com/dart-lang/sdk/issues/52402

TEST=ci

Change-Id: If7ab54990069c86eb5c0348e20086254818da839
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/312705
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
2023-07-06 22:57:13 +00:00
Nicholas Shahan 8515c4a428 [ddc] Fix check for required named args in new type system
Issue: https://github.com/dart-lang/sdk/issues/48585
Change-Id: I119c0d649461ddfd3879f75ef232ee8010ebf787
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/312203
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Mark Zhou <markzipan@google.com>
2023-07-06 22:39:13 +00:00
Kallen Tu a2cdf8e96d [analyzer] Refactor const evaluator visitBinaryExpression and tests.
Made more of the tests consistent in `evaluation_test` (slowly, but surely).

Change-Id: I515c4d6d81cedcc1d8d20080e231ac1e0afb5ec7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/312200
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Kallen Tu <kallentu@google.com>
2023-07-06 21:48:07 +00:00
Konstantin Shcheglov 98e6322086 Fix another TODO in elements printer, use 'name'.
Change-Id: I6696a4b559072b064ee16d22b8aad528b52eb6a0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/312704
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2023-07-06 21:47:21 +00:00
Jake Macdonald 658de58b4f move the majority of the client bootstrap code into a real library to make it more maintainable
Change-Id: Id84981b236176c7831cece61692ec895ba2ac1e2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/312723
Reviewed-by: Bob Nystrom <rnystrom@google.com>
Commit-Queue: Jake Macdonald <jakemac@google.com>
Auto-Submit: Jake Macdonald <jakemac@google.com>
2023-07-06 21:12:58 +00:00
asiva f84cf9413f [vm/runtime] - Fix RegExp exception messages (issue 52691)
TEST=new test added

Fixed: 52691
Change-Id: Ibc8865f8e9b1e908be80d4fbe8b8931eda448df8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/312348
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Siva Annamalai <asiva@google.com>
2023-07-06 21:10:28 +00:00
Brian Wilkerson a510e60dbf Simplify the keyword contributor to make it easier to port to the new framework
Change-Id: I29d0bdc2d798adc3b39718fabba893456495dce9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/312703
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2023-07-06 21:03:37 +00:00
Alexander Aprelev 83616c9b56 [gardening] Populate legacy patched_class_ link.
99db606bab renamed patched_class_ to wrapped_class_, but old vm_snapshot_analysis(pre 0.7.4) expects older name.

Addresses https://github.com/flutter/flutter/issues/130009
TEST=ci

Change-Id: Ic73e665171f7c25ae67230fa6dd790fdc94cc2a7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/312640
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
2023-07-06 20:31:50 +00:00
Nicholas Shahan 420b551d54 [ddc] Fix missing type tags in new type system
The types implemented transitively through mixins were missing from
the tags we manually attach. 

Issue: https://github.com/dart-lang/sdk/issues/48585
Change-Id: I7fa00fd79963914cd25c2f87f52d8acc76c9c359
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/312202
Reviewed-by: Mark Zhou <markzipan@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
2023-07-06 20:27:24 +00:00
Sigmund Cherem 8171191413 [dart2js] Add regression test for #52825
I still haven't found yet the fix for this, but might as well add the regression
test for it.

Change-Id: I84821f6615a26faf95e6f7c498aa3670f5d48a54
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/312701
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
2023-07-06 20:18:24 +00:00
Nicholas Shahan 1199dc09b7 [ddc] Support extractTypeArguments in new types
Inline calls to the extract function directly with the type arguments
inserted as extractions from the instance.

Issue: https://github.com/dart-lang/sdk/issues/48585
Change-Id: I6b791c59478c2e609df30163835e3fd0863a2d94
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/307514
Reviewed-by: Mark Zhou <markzipan@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
2023-07-06 19:24:54 +00:00
Konstantin Shcheglov 4169196834 Use NodeTextExpectationsCollector to collect and update element expectations.
This code was older, and was a prototype of NodeTextExpectationsCollector,
but we have it now, it is better, and we can de-duplicate.

Change-Id: I428abb04687f2e3ff5142907a71fcf80e460b830
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/312700
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2023-07-06 17:50:59 +00:00
Tess Strickland dd3707f2d5 [vm] Initialize FfiTrampolineData::callback_kind_ to a set value.
Not all methods that create FfiTrampoline functions set this, and if not
set, it'll default to a byte from the address of Object::null() due to
Object::InitializeObject, which can break the determinism of the build.

Fixes b/290012924.

TEST=ci

Change-Id: I71ee2eb937b288ec3c6e6a0534e9d870511cf968
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/312266
Commit-Queue: Tess Strickland <sstrickl@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Auto-Submit: Tess Strickland <sstrickl@google.com>
2023-07-06 17:01:00 +00:00
Nicholas Shahan be6a560ca1 [kernel] Fix record type equivalence
- Increment index to avoid infinite loop when the first named elements
  in the two record types are equivalent.
- Add some test cases for record types.

Fixes: https://github.com/dart-lang/sdk/issues/52817
Change-Id: Ifbf3505c74a1f130c9c90ddbb6b1d96d9641e51e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/311929
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
2023-07-06 16:37:49 +00:00
Srujan Gaddam b859e00908 Reland "[dart:html] Throw exception if Window.open opens null window" and
"[dart:html] Move NullWindowException to implementation"

This is a revert of bd3e6fa1a3 and
2b250992f9.

This adds some small code change to avoid a null-assertion being emitted
that would lead to a browser SecurityError.

CoreLibraryReviewExempt: Reland.
Change-Id: Iab52bb728b14fd0b2378b8923b0e1ea8ea930b12
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/311922
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Srujan Gaddam <srujzs@google.com>
2023-07-06 15:50:48 +00:00
Konstantin Shcheglov eaed1fbaff Fix a couple TODOs in the element model printer.
We can use ElementPrinter now for printing elements as references.

Change-Id: Ie75dc96940cf3a1e60f87e34801494f55145901f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/312350
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2023-07-06 15:45:57 +00:00
Ben Konyi ea1a6a66b8 [ DDS ] Set minimum SDK bound to 3.0.0
Allows for use of new language features.

Change-Id: Ic66cb6d2e8bfbf5ff505cc72c0a23deb32026bbc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/312601
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Derek Xu <derekx@google.com>
2023-07-06 15:39:35 +00:00
Danny Tuppeny 7c2ee2222f [dds/dap] Improve stack frame rendering + fix bad paths in tests
This fixes a bug where we'd produce the wrong absolute path for stack frames that had absolute paths (because `package:stack_trace` uses `path.absolute()` on them).

It also adds support for making stack frames in printed stack traces faded if they are not part of the users own code. This is something the legacy DAPs did. I've also made it possible to perform this stack parsing on non-error events because I'd like to use it on Flutter structured errors (again, something we supported in legacy adapters and was missing here).

Fixes https://github.com/Dart-Code/Dart-Code/issues/4573,

Change-Id: I6c1c3ab69915eca9a1eeef5dcba7f1eb558086de
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/311842
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2023-07-06 15:01:21 +00:00
Derek Xu f360a09842 [VM/Service] Give StreamInfo::include_private_members_ an atomic type
TEST=Ran reload_many_isolates_live_and_die_test with TSAN

Fixes: https://github.com/dart-lang/sdk/issues/52551
Change-Id: I1fabdcea908987b0dea79bdb776c35c77cbd056e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/312600
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Derek Xu <derekx@google.com>
2023-07-06 14:51:23 +00:00
Danny Tuppeny c81b2bac1b [analysis_server] Enable calling LSP handlers over the legacy protocol
This currently only allows "textDocument/hover". Handlers may need some tweaks to remove any dependencies on LspAnalysisServer before they can be enabled.

Capabilities and config are hard-coded to a very basic set (which I suspect will expand as new handlers are added). Reverse requests and notifications are not currently supported (I suspect these will be added when there are more concrete use cases for them because they may need to be conditional based on real client capabilities/needs).

Change-Id: I8a096f9530ad1518ac5ee876aea2560d269a27ae
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/312303
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2023-07-06 14:15:16 +00:00
Danny Tuppeny 0d3e76c8e6 [analysis_server] Modify code action/refactor tests to verify whole set of edits
The goal here is to ensure tests can't accidentally check only a subset of edits made during the command execution.

Not all tests have been migrated (only refactorings and a few that happened to use some of the same methods for verification).

Change-Id: I5589e8e667e957aee3ea55f741b1b49a3859d6bd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/312304
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2023-07-06 14:05:09 +00:00
Sergey G. Grekhov fab753ea27 [co19] Roll co19_2 to 11de2759f391faa183b1aa47d854e8fb2c55f4ae
2023-06-28 sgrekhov22@gmail.com Fixes dart-lang/co19#1095. Wait for entryPoint is invoked before doing the test (dart-lang/co19#2102)

Change-Id: I91e3fd3a76c09ecf17dc39930fd03a380de91fda
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/312260
Reviewed-by: William Hesse <whesse@google.com>
Commit-Queue: William Hesse <whesse@google.com>
2023-07-06 11:44:28 +00:00
Martin Kustermann 2287c76724 [vm] Make AOT compiler use TARGET_USES_THREAD_SANITIZER
The VM has two parts related to TSAN: compiler & runtime.

So far both parts used self-detection whether running with TSAN. This
implies that if AOT runtime runs under TSAN that the AOT compiler then
also has to run under TSAN (which is slow).

We separate the two by making the compiler use
`TARGET_USES_THREAD_SANITIZER`. It will be auto-detected by-default
except when `DART_PRECOPMILER` is set. In the precompiler case we
require the build rules to pass in whether the target runs under
TSAN or not.

Issue b/287638965

TEST=ci

Change-Id: Ib333a8a69ed2d7bdca7596014a0d25b103af25b6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/312480
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Slava Egorov <vegorov@google.com>
2023-07-06 08:44:33 +00:00
Tess Strickland d9f15ef891 [vm] Tweak handling of rare types with non-null instance type arguments.
The CFE may return super-bounded types (types that are a strict
supertype of the rare type) for certain type positions like the right
hand sides of `is` and `as` checks, so we can't assume that all types
involving a given class is a subtype of its rare type. Note that this is
only for uses that do not involve instantiation, as all instances of a
class must have runtime types that are a subtype of its rare type.

Keeping this in mind, here are the changes being made in this CL.

-----

In the flow graph builder when producting unoptimized code, we
previously assumed that if the checked type is not equal to the rare
type, then the code can't use _simpleInstanceOf, which only performs
class ID checks.  However, if the checked type is a supertype of the
rare type, we can, because any instance is guaranteed to be a subtype of
the checked type.

Note that this didn't cause incorrect behavior, just more work than
needed in some cases.

-----

In the generation of optimized type testing stubs, we assumed that the
null type argument vector (TAV) is a possible instance TAV for any
instance. However, if the rare type for a class has a non-null TAV, then
no instance of that class can have a null TAV and we can skip the null
check. (We keep it in the DEBUG case, but just to immediately trigger
a breakpoint if seen.)

Again, no incorrect behavior caused here previously, just an unnecessary
check that we now remove in some cases.

------

Also when generating optimized type testing stubs, when checking for the
null TAV prior to instance type argument checks, the code assumed that
it was possible to have to check type arguments if the checked type was
a super type of the rare type for the instance's class.  However, that's
backwards: if the checked type is a super type, then the runtime type of
any instance of the class is guaranteed to be a subtype and we shouldn't
be checking type arguments at all.

Thus, add an ASSERT that checks this, and instead only generate the code
that goes to the runtime if the null TAV is seen, as the runtime type of
the instance is the rare type and the rare type is guaranteed to not be
a subtype of the checked type.

Again, the previous version of this wouldn't have caused incorrect
behavior either, because the VM should never generate type arguments
checking in the type testing stub if the checked type is a supertype of
the class's rare type. Thus, that branch in the code generation was
just dead code.

-----

TEST=vm/cc/TTS, ci (especially DEBUG bots)

Issue: https://github.com/dart-lang/sdk/issues/52848
Cq-Include-Trybots: luci.dart.try:vm-aot-linux-debug-x64-try,vm-linux-debug-x64-try
Change-Id: I86d159693d6218f88dd1f04dd34cba702744b4d2
Fixed: 52848
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/312500
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Tess Strickland <sstrickl@google.com>
2023-07-06 08:16:47 +00:00
Nate Biggs 924a33c0f5 [dart2js] Fix valid/invalid refinement logic.
The issue here was that isInMask does not hold inversely. The key is that we want to verify which refinements to skip, therefore we want to calculate *in*valid refinements. We want to skip refines where the new type is a Union AND the old tpye is a supertype of the new type. after.isInMask(before) gives us that but !before.isInMask(after) does not.

I've renamed isValidRefinement to isInvalidRefinement to more accurately capture this distinction.

Change-Id: I0d99479357a140095a5d0dfb7e2f987556097891
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/312160
Commit-Queue: Nate Biggs <natebiggs@google.com>
Reviewed-by: Mayank Patke <fishythefish@google.com>
2023-07-05 20:56:28 +00:00
Konstantin Shcheglov ec893a4d8f Rework ElementImpl and AugmentationElementImpl hierarchies to use XyzOrAugmentationElementMixin(s).
Add ClassAugmentationElementImpl, no any tests yet because it
required parsing, AST, etc. And it is also not ready yet.

Change-Id: I601141545e9bf0638771f28bb9498be9de664659
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/312345
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2023-07-05 20:03:47 +00:00
Konstantin Shcheglov c4cbc7042f Add ClassAugmentationDeclarationImpl, parse into it.
Change-Id: I2461cffa76f31079e52f9877b9fe35668811191b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/312346
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2023-07-05 20:03:37 +00:00
Jake Macdonald f254c8a4ba Add library macro definitions and support for executing them.
These are intended to be applied by annotating a library directive.

Note that some parameter types had to be widened since `Library` is not a subtype of `Declaration`. Ultimately I think that is fine though.

Bug:https://github.com/dart-lang/language/issues/2839
Change-Id: Ia1311c8aea729f2bd8b76173ce4c7595a6a37a42
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/312140
Reviewed-by: Bob Nystrom <rnystrom@google.com>
Auto-Submit: Jake Macdonald <jakemac@google.com>
Commit-Queue: Jake Macdonald <jakemac@google.com>
2023-07-05 18:56:53 +00:00
Danny Tuppeny 1c4ad79985 [analyzer] Include trailing commas in display strings for single-positional-field records
See https://github.com/Dart-Code/Dart-Code/issues/4624

Change-Id: Iac2f061c11ffdb95917329465307abc8e92b6ba3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/312421
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2023-07-05 18:56:36 +00:00