Commit Graph

108019 Commits

Author SHA1 Message Date
MarkZ 2b1cbb0c88 [ddc] Adding test for cross module private symbols as function default values.
Change-Id: I54e29a3883b2e444945574d3d5e03f741c1e8716
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/436020
Reviewed-by: Nicholas Shahan <nshahan@google.com>
2025-06-20 14:40:47 -07:00
Fedor Shcheglov 842ed5606c Deprecate/rename primaryConstructor2 and representation2 from ExtensionTypeElement.
Change-Id: I3699157f4b8d640449e2dba307d2bf587b243e60
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/435900
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2025-06-20 14:36:32 -07:00
Keerti Parthasarathy 307b2644c6 [Completion]Add a few more checks when suggesting keywords.
Change-Id: I23a3984673ae64cedb1bd5cc24cdb60c57ff620e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/436000
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Keerti Parthasarathy <keertip@google.com>
2025-06-20 14:04:20 -07:00
Brian Wilkerson a1ea2b589b Ensure that the scheduler flushes the event queue
There was only one place that wasn't using a future with a zero length
duration, but that's now been fixed. I haven't been able to observe any
performance improvement from this change, but it does have the benefit
that the code is now consistent.

Change-Id: I232728ef2ef9a1000938d0117f611a96c17e9f38
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/435662
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Keerti Parthasarathy <keertip@google.com>
2025-06-20 11:03:33 -07:00
Paul Berry e10267cb0c [flow analysis] Actually remove skipDuplicateCheck.
In https://dart-review.googlesource.com/c/sdk/+/434261, I removed the
last call site that was passing a `true` value to the optional
parameter `skipDuplicateCheck` of `FlowAnalysis.declare`.

I that same CL, I intended to remove parameter itself, but I
forgot. This CL finishes the (now unused) parameter.

Change-Id: I97dc3c7959d58b58e4b3bbaf7116123899b8ea8b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/435980
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2025-06-20 10:19:38 -07:00
Konstantin Shcheglov 183d0ad872 Elements. Remove a few v1 methods from InheritanceManager3.
Replace `getInheritedMap()` with v2 version.
Remove `getMember()`, operations should go thought elements, not types.
Remove `getMember2()`.
Rename v2 `getMember4()` into `getMember()`.

A few internal methods are duplicated for now, will be de-duplicated
when migration of InheritanceManager3 is finished. For now I'd like to
do smaller steps than migrating it fully.

Change-Id: Ib5d9d28e91d77330e41480fcb7176f93d867728a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/435663
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2025-06-20 10:18:04 -07:00
Konstantin Shcheglov c6abc1efbd Elements. Rename _writeReference2() to _writeReference(), and fix
the nullability of `_indexOfReference()` formal parameter. It turns out that no code paths
ever pass null to it.

Also reuse _writeVariableGetterSetterLinking() for top-level variables.

Change-Id: Ia031ca5097fadaa28ea52a47fb18ebbc06d76c4e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/435722
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2025-06-20 10:11:35 -07:00
Konstantin Shcheglov 38ac87f64d Elements. Pull implementations out of ConstructorElementMixin, leave only declarations.
ConstructorMember uses baseElement to implement, as every other method.

Change-Id: I3d6e5f16e83e6c601691cfdd0c254b861ffd9a68
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/435960
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2025-06-20 10:10:00 -07:00
Fedor Shcheglov 1dc17b9a22 Deprecate Element.nonSynthetic2, use nonSynthetic instead.
Change-Id: Ie47d5f1e1fbaa7473747c5b43333a9c0cd689f74
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/435664
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2025-06-20 08:57:19 -07:00
Martin Kustermann e5ec2d6f9d [dart2wasm] Maintain types of Errors being thrown
Strictly speaking we do not promise the specific subtypes of
`Error` being thrown in the core libraries. The subtypes of
`Error` are there for better messages & debugging purposes.

Though some apps may rely on specific subtypes being thrown via
`try { ... } on IndexError {}`. So this CL changes our errors in
optimized mode to use the same `Error` subtype as in development
mode.

Though we do not expose details on the errors. Fields that expose
details will either return `null` or throw.

This makes various tests running under dart2wasm-minified mode
pass.

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

Change-Id: Ie7be448b101473b18c2782457175ea163e71d5f6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/435783
Reviewed-by: Ömer Ağacan <omersa@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2025-06-20 05:01:59 -07:00
Vyacheslav Egorov c111f693c7 [vm] Fix freelist interaction with dual mapping
Freelist implementation was trying to mark pages executable (RX)
which does not respect possibility that it is working with RW mapping
which can't be directly marked as executable. It needed to use RO
permission instead if dual mapping is enabled.

This CL consolidates all code mentioning RX permission in one place:
VirtualMemory::WriteProtectCode so that we avoid this mistake in the future.

R=kustermann@google.com
TEST=tested by doing large reloads which cause more churn in code space

Change-Id: If99692cac3ce3ff54b907e4c43d7f26bae7439ff
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/435860
Commit-Queue: Martin Kustermann <kustermann@google.com>
Auto-Submit: Slava Egorov <vegorov@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2025-06-20 03:29:19 -07:00
Johnni Winther faf1baf9b2 [cfe] Rename BuilderFactory* to FragmentFactory*
Change-Id: I6b6206378594019f3f54f62e028dd0e4134ea840
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/435862
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
2025-06-20 03:09:12 -07:00
Jens Johansen dc7c6cadea [analyzer] Fix analysis_context_collection_test on Windows (2nd try)
This fixes some randomeness caused by HashSet which seemingly triggered
different sorting on Windows than in Linux.

Change-Id: I54fffdbd2e056ec87958533aeafc327164808046
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/435861
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2025-06-20 01:09:49 -07:00
Srujan Gaddam a76f343704 [dart:js_interop] Clean up documentation on static vs runtime guarantees
- Make clear that you shouldn't do equality checks between a
Dart and JS value.
- Make clear you shouldn't use `is` with JS types.
- Remove mention of `as`, as that *may* be okay but is also the
only way to properly cast.

CoreLibraryReviewExempt: Doc-only change.
Change-Id: Ie4a8f22f9c44d740ddeddab55981475f0168d25e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/434760
Reviewed-by: Ömer Ağacan <omersa@google.com>
Commit-Queue: Srujan Gaddam <srujzs@google.com>
2025-06-19 11:46:26 -07:00
Paul Berry 5fc5f3678a [analyzer] Simplify and clean up duplicate declaration checking.
This change reworks
`MemberDuplicateDefinitionVerifier._checkConflictingConstructorAndStatic`
and `MemberDuplicateDefinitionVerifier._checkDuplicateIdentifier` into
a form that is easier to reason about and has slightly faster
performance (measured by instruction count).

In the previous design, two maps were maintained for each scope in
which getters and setters might appear:

- one called `getterScope`, which (confusingly) held getters, setters,
  and method declarations,

- and one called `setterScope` which only held setters.

This was difficult to reason about. In particular, it had a
longstanding bug that was only recently fixed (see
https://dart-review.googlesource.com/c/sdk/+/434061): if a setter was
encountered first, it was stored in `getterScope`, but if a getter was
encountered next, it was necessary to move the setter to `setterScope`
in order to store the getter in `getterScope`.

It was also inefficient, since in many cases, two map lookups were
needed in order to check for both getter and setter conflicts.

In the new design, there is a single map, whose values point to either
a `_ScopeEntryFragment` (in the case where just one declaration of the
given name has been seen) or a `_ScopeEntryGetterSetterPair` (in the
case where both a getter and a setter have been seen).

The new design has modestly better performance when measured by
front_end/tool/benchmarker.dart:

     Comparing snapshot #1 (before.aot) with snapshot #2 (after.aot)
     instructions:u: -0.0192% +/- 0.0131% (-6291379.67 +/- 4292101.91) (32692292436.33 -> 32686001056.67)

Change-Id: Ia6675fa4d3579779e6066db3760d2cc38a2c859e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/435602
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2025-06-19 11:13:27 -07:00
Ben Konyi 2ae193dfde [ DDS ] Prepare for 5.0.4 release
Change-Id: I04f4b78464e8cdfd6f61cbe57c6d5f0597a1fad0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/435880
Reviewed-by: Kenzie Davisson <kenzieschmoll@google.com>
Auto-Submit: Ben Konyi <bkonyi@google.com>
Commit-Queue: Kenzie Davisson <kenzieschmoll@google.com>
2025-06-19 10:55:53 -07:00
Jens Johansen 6d6da849ba [analyzer] Fix analysis_context_collection_test on Windows
https://dart-review.googlesource.com/c/sdk/+/434802
(0677fcac83) introduced a few new tests
that didn't work on Windows.

Change-Id: I841cb479b6782a83d8472ee4c074ef2b3b51709a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/435820
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2025-06-19 06:13:05 -07:00
Johnni Winther 3ef349cca1 [cfe] Update documentation for *References objects
Change-Id: Ib74446de255dc5572783a8945025d9e55881f704
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/435800
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
2025-06-19 03:11:28 -07:00
Johnni Winther c0b6ec4de5 [cfe] Cleanup constructor and factory builder properties
This removes properties from the builders that belong to the declarations.

Change-Id: If576f6b62b64bf57b1e629eb6caf0ab4db522980
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/435125
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
2025-06-19 03:11:28 -07:00
Jens Johansen 0677fcac83 [analyze] When opening several folders with "resolution: workspace" try to merge them by workspace root
Use-case: I have 20+ folders from the sdk that I have open
(front_end, _fe_analyzer_shared, vm, analyzer, analysis_server etc) and
before this CL that meant I had 20+ contexts, despite them having
`resolution: workspace` and being specified in the roots pubspec.yaml
under `workspace`. Opening, for instance, `pkg` directly would
successfully give me only 1 context, but also include lots of stuff I
don't want to clutter neither my screen nor my mind.

This CL merges such folders as possible meaning I with this CL only have
1 context.

* If not using the workspace resolution this should change nothing.
* If opening only the root of a workspace this should change nothing.
* If opening a sub folder that itself isn't a package (say `pkg` in the
  sdk) this should change nothing.

Change-Id: Ia38fa6636b02fa95ed274ebf72d424cae7d4da66
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/434802
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2025-06-19 02:49:24 -07:00
Vyacheslav Egorov 20dc41763a [vm] Fix implementation of IsAtLeastIOS<X>
It was hardcoding the wrong constant.

R=kustermann@google.com
TEST=manually

Change-Id: Ice17fa7aed7a6c68c0c9ac31a3258aa33ede0e08
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/435780
Commit-Queue: Slava Egorov <vegorov@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2025-06-19 01:46:18 -07:00
Vyacheslav Egorov da92cb4cb2 [dartdev] Tweak compile exe depfile name
Use output name verbatim if provided, because that's what build-systems
like ninja expect.

R=kustermann@google.com

Change-Id: Ia14add25cf200d7225852c1d10409230f2545a82
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/435681
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Slava Egorov <vegorov@google.com>
2025-06-19 01:44:54 -07:00
Johnni Winther 62d85a617b [cfe] Add FactoryReferences and FactoryEncodingStrategy
The prepares for creating constructor/factory builders through
declarations rather than fragments.

Change-Id: Ia66bce40ec16af4f360c469b6d89a2ecb13d844c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/435124
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2025-06-19 01:16:04 -07:00
Stephen Adams 3f5314fb2f Reapply "[dart2js,rti] Add direct methods for as JSObject"
This reverts commit 43b5c1432e.

This time, fall back on code that works for mocks and fakes.

Issue: #60746

Change-Id: Iecb822486729f8b10377c94bf87d06406bb0f5bc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/434920
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Mayank Patke <fishythefish@google.com>
2025-06-18 19:21:22 -07:00
asiva 111f9798d2 Add QEMU_LD_PREFIX environment variables so tests that spawn new processes also get the library path setup correctly.
Change-Id: I1232925b037f897ff1fa38503cbe4e32d07cb388
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/435661
Commit-Queue: Siva Annamalai <asiva@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2025-06-18 16:54:25 -07:00
Konstantin Shcheglov b37d8c2093 Elements. Simplify FieldFragmentImpl creation.
Change-Id: Ic69ded5b9edf747b0bfcb5b90d093fbb85113b8d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/435721
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2025-06-18 16:05:31 -07:00
FMorschel 91a3c73e87 [DAS] Fixes type completion for switch expression, function declaration and async function body
Fixes: https://github.com/dart-lang/sdk/issues/60808
Change-Id: Ia6cc2cbad3206f62c9149a5e326dc8333aca556f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/434124
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Auto-Submit: Felipe Morschel <git@fmorschel.dev>
2025-06-18 15:41:54 -07:00
FMorschel 2175df077f [DAS] Adds new create operator fix
Fixes: https://github.com/dart-lang/sdk/issues/60954
Change-Id: I933e45ddd950b798e87595f4de8a5cadabddf898
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/435660
Auto-Submit: Felipe Morschel <git@fmorschel.dev>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
2025-06-18 15:24:03 -07:00
Ryan Macnak af7397b1f9 [vm] Disable simulator when we detect we can JIT.
TEST=local Flutter engine build
Bug: https://github.com/flutter/flutter/issues/163984
Change-Id: Id16e75dada9571636b1ee3ef3988825beb67707b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/435640
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2025-06-18 15:10:59 -07:00
FMorschel 27ff4116cc [DAS] Removes Create Class fix at instance method invocation
Fixes: https://github.com/dart-lang/sdk/issues/60955
Change-Id: I1be7564e71edb919c56c6c1fbc282f901f96bab4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/435560
Auto-Submit: Felipe Morschel <git@fmorschel.dev>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2025-06-18 15:03:16 -07:00
Konstantin Shcheglov 6321756124 Elements. Rename Reference.element2 to element.
Change-Id: I613e48e8df803ceed19871e2724dccbe5ea34859
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/435720
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2025-06-18 14:20:45 -07:00
Konstantin Shcheglov 98a1b63b11 Elements. Consistently use addTopFragment().
Change-Id: I23bcbd31de28e7c9478fc63406b8f1c13c6cdbae
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/435701
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2025-06-18 14:06:15 -07:00
Konstantin Shcheglov fcddbffbc1 Elements. Remove Reference.element (misnomer now), now FragmentImpl cannot have reference.
Change-Id: I928abfe136bda2bc49884f9ec79a8bcae772ac13
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/435446
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2025-06-18 13:17:10 -07:00
Konstantin Shcheglov c58e180287 Elements. Remove FragmentImpl.reference
Change-Id: If586b6f365770c752b7e6c3bd2ae39cd8bf394f7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/435601
Reviewed-by: Paul Berry <paulberry@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2025-06-18 13:15:49 -07:00
Ryan Macnak 7973eacdd0 [vm] Rename USING_SIMULATOR to DART_INCLUDE_SIMULATOR.
We now have a mode where the simulator is available but not always used.

TEST=ci
Change-Id: If271f334150e2a125a014a4baa2e03d726300d35
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/435562
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Slava Egorov <vegorov@google.com>
2025-06-18 13:07:22 -07:00
Danny Tuppeny 7466f6e1ff [analysis_server] Fix preservation of strings when indenting code
When code indentation is replaced, strings should not be updated. This loop had inverted logic which meant that after processing a string before the current line, we would then exit early and not look at the subsequent string ranges (which we might be a match for).

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

Change-Id: I1a94ca05e968bb7f2193544779b2634b784f8aee
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/435580
Commit-Queue: Keerti Parthasarathy <keertip@google.com>
Reviewed-by: Keerti Parthasarathy <keertip@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2025-06-18 12:21:32 -07:00
Sam Rawlins 712d77637f analyzer: Deprecate AnalysisResultWithErrors in favor of AnalysisResultWithDiagnostics
Change-Id: Iddad83a42a22cef32c0e36d01a9232b71862cb98
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/435360
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2025-06-18 11:45:20 -07:00
DEPS Autoroller 60fecac3d1 Roll Fuchsia Test Scripts from DG11ez0PRGu8loi2m... to IfPORaYjQ2zP4bcq-...
If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/fuchsia-test-scripts-dart-sdk
Please CC fuchsia-3p-engprod@google.com on the revert to ensure that a human
is aware of the problem.

To file a bug in Fuchsia Test Scripts: https://bugs.fuchsia.dev/p/fuchsia/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:vm-fuchsia-release-x64-try;luci.dart.try:vm-fuchsia-release-arm64-try
Change-Id: If7bfd4d958fbb55f1ba23bacf1eaa820bf9e947c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/435080
Reviewed-by: Derek Xu <derekx@google.com>
Reviewed-by: Zijie He <zijiehe@google.com>
Commit-Queue: Zijie He <zijiehe@google.com>
2025-06-18 11:25:29 -07:00
DEPS Autoroller 2464aed0b1 Roll Fuchsia SDK from 28.20250613.3.1 to 28.20250616.4.1
If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/fuchsia-sdk-dart-sdk
Please CC fuchsia-3p-engprod@google.com on the revert to ensure that a human
is aware of the problem.

To file a bug in Fuchsia SDK: https://bugs.fuchsia.dev/p/fuchsia/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:vm-fuchsia-release-x64-try;luci.dart.try:vm-fuchsia-release-arm64-try
Change-Id: I411665aead911dc705a78680ab96122a22770a0b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/434882
Reviewed-by: Derek Xu <derekx@google.com>
Commit-Queue: Zijie He <zijiehe@google.com>
Reviewed-by: Zijie He <zijiehe@google.com>
2025-06-18 11:19:25 -07:00
Konstantin Shcheglov c0bca2c210 Elements. Build all fragments first, then build elements.
Main changes:

1. Separating `FragmentBuilder` and `ElementBuilder`. I removed
`augmentation.dart` and its builders, because now it is implemented in
the new `ElementBuilder`.

2. Fragments are not given actual `Reference` objects anymore, there
might be some in the current state, but I will go over this in the
future and remove them completely.

3. Writing and reading elements also happens in two stages: first
fragments, then elements. Each fragment in the summary is given unique
ID, and during writing / reading elements we use these ID to locate
fragments and create elements around them.

4. Lazy loading of `ClassElement` members is simplified and generalized,
could be potentially applied to any `InstanceElement`. Maybe use also in
mixins, which are used somewhat often in Flutter.

5. There are slight changes to tests, mostly to the better, sometime a
bit reordering, a couple of new tests.

There is some dirty code added, especially around patching types for
getters, setters, and their fragments. I plan to clean this in future
CLs as I move toward better implementation, and from using fragments
where this is wrong.

Change-Id: I1e4bf2a3b7ff45f1dba133797e85cd70aa729c11
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/433180
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2025-06-18 11:16:28 -07:00
Konstantin Shcheglov eff3522827 CQ. Remove not useful _ParsedFileStateCache.
It was used to support macros, so is not useful anymore.

Change-Id: I12b98ed75125bc59473c9048a9f35554b5f33eae
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/435561
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2025-06-18 10:53:59 -07:00
Ryan Macnak f5eaefd5b6 [vm] Runtime option to not use the simulator for simarm64_arm64.
TEST=ci
Cq-Include-Trybots: luci.dart.try:vm-ffi-mac-debug-simarm64_arm64-try,vm-ffi-mac-release-simarm64_arm64-try
Change-Id: Id98d337ce16ba4b434b5c69016f01eec9b85f9d2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/434982
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2025-06-18 10:45:05 -07:00
Ryan Macnak 69b99822de Revert "[build] Also duplicate platform files under root_out_dir temporarily for Golem."
This reverts commit 0d40669d4d.

Reason for revert: Golem has been patched

Change-Id: I5ce3a2d1fcedc0870b6900f53bee25ab062050b0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/435444
Reviewed-by: Derek Xu <derekx@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2025-06-18 10:36:57 -07:00
Ryan Macnak 88df3fe713 [vm] Fix host-mac target-linux build.
TEST=ci
Cq-Include-Trybots: luci.dart.try:dart-sdk-mac-arm64-try,dart-sdk-mac-try,pkg-mac-release-arm64-try,pkg-mac-release-try
Change-Id: I8d827b5ee0ef9a0c25c9d09c2ea989dbb18fa2ea
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/435443
Reviewed-by: Derek Xu <derekx@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2025-06-18 10:09:35 -07:00
Brian Wilkerson f36297e552 Fix an exception in a lint rule
Fixes https://github.com/dart-lang/sdk/issues/60927

Change-Id: I042adc05b7ff237aa7316f4cd101e0ffb5f33fb4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/435244
Reviewed-by: Keerti Parthasarathy <keertip@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2025-06-18 09:16:31 -07:00
Kallen Tu 0bb629e708 [analysis_server] Dot shorthands: Update prefer_const_constructors lint.
Now that `DotShorthandsConstructorInvocation`'s `canBeConst` is updated, we can also update the `prefer_const_constructors` lint.

We skip the lint when we have the `@literal` metadata on the constructor since it's already reporting a warning here: https://dart-review.googlesource.com/c/sdk/+/434881. Similar to instance creation expressions, we also skip reporting a lint if we're instantiating the `Object` class.

Otherwise, if the constructor we're calling with the shorthand is const and we can const-ify it, we report this lint.

Added unit tests.

Fixes: https://github.com/dart-lang/sdk/issues/60911
Bug: https://github.com/dart-lang/sdk/issues/60893
Change-Id: Ib4bcba629f60e0dbff110080918adfacfb1ba5d2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/434981
Commit-Queue: Kallen Tu <kallentu@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
2025-06-18 08:25:38 -07:00
Derek Xu b3c579d3ee Revert "Reland "[VM/Service] Shut down the VM immediately after the VM Service fails to start during VM initialization""
This reverts commit c2095cb347.

Reason for revert: These changes are blocking the Dart SDK -> Flutter roll because they cause some Fuchsia tests to fail.

Original change's description:
> Reland "[VM/Service] Shut down the VM immediately after the VM Service fails to start during VM initialization"
>
> This reverts commit d510876d9e.
>
> Reason for revert: g3 and Golem have been made compatible with this CL.
> See b/409535026 and
> https://chrome-internal-review.googlesource.com/c/golem/+/8345341.
>
> TEST=pkg/vm_service/test/failure_to_start_vm_service_after_vm_is_initialized_test,
> pkg/vm_service/test/failure_to_start_vm_service_during_vm_initialization_test
>
> Original change's description:
> > Revert "[VM/Service] Shut down the VM immediately after the VM Service fails to start during VM initialization"
> >
> > This reverts commit 56ccf437e6.
> >
> > Reason for revert: b/409535026
> >
> > TEST=ci
> >
> > Original change's description:
> > > [VM/Service] Shut down the VM immediately after the VM Service fails to start during VM initialization
> > >
> > > TEST=pkg/vm_service/test/failure_to_start_vm_service_after_vm_is_initialized_test,
> > > pkg/vm_service/test/failure_to_start_vm_service_during_vm_initialization_test
> > >
> > > Fixes: https://github.com/dart-lang/sdk/issues/60256
> > > Change-Id: I0543ab26e5721a4048136f27e8f4429bef04920f
> > > Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/416300
> > > Commit-Queue: Derek Xu <derekx@google.com>
> > > Reviewed-by: Ben Konyi <bkonyi@google.com>
> >
> > Change-Id: I61eb42f0f00ad97e95e3ebf19990fe75d2d416aa
> > Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/421622
> > Reviewed-by: Derek Xu <derekx@google.com>
> > Commit-Queue: Ivan Inozemtsev <iinozemtsev@google.com>
> > Reviewed-by: Ben Konyi <bkonyi@google.com>
>
> Change-Id: Ieba880b7b298e491055c3f6049bab6772b1f8aa3
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/434960
> Reviewed-by: Ben Konyi <bkonyi@google.com>
> Commit-Queue: Derek Xu <derekx@google.com>

No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Change-Id: I03b2371728de91e4e20008a879280c1ccab4d07c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/435540
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Commit-Queue: Derek Xu <derekx@google.com>
2025-06-18 08:21:15 -07:00
Vyacheslav Egorov b0f933facc [gn] Fix precompile_tools=true
gn_dart_compile_exe.py wrapper stopped working because we rearranged
something in the prebuilt SDK. However we no longer need it because
we can ask `compile exe` itself to produce the depfile.

TEST=manually
R=kustermann@google.com

Change-Id: If5e64ede08b4e146a7bf033e7ef2d1809f40de1f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/435500
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Slava Egorov <vegorov@google.com>
2025-06-18 07:18:22 -07:00
Vyacheslav Egorov dc0567c02c [vm] Rework RX workarounds
* Disable RX workarounds on simulators: they cause host OS to crash;
* Remove Mac OS test for RX workarounds: it can cause host OS to crash;
* Remove old outdated code paths for OS versions that don't
need workarounds.
* Add code which detects whether workaround worked or not by intercepting EXC_BAD_ACCESS.
* Avoid using vm_remap in FFI callbacks when JITing, it does not work.
Instead restore old logic which manually copies page content, but adjust
FFI callbacks implementation to respect possible dual mapping.

This reworks changes done in commit
d194fcecaf after additional testing on a
wider range of hardware.

TEST=manually on physical devices and simulators

Change-Id: I339379386183c532fec25e88fa436ff0b970c2cf
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/435120
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Slava Egorov <vegorov@google.com>
2025-06-18 06:09:14 -07:00
Johnni Winther 807e7d3290 [cfe] Add ConstructorEncodingStrategy
This adds [ConstructorEncodingStrategy] similar to
[PropertyEncodingStrategy] which allows for separating
[ConstructorDeclaration] from [ConstructorEncoding] such that we don't
need special [ConstructorDeclaration]s for extension (types).

Change-Id: I1c7f17e1759d47abae4af97d84455a37cbb70c17
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/435460
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
2025-06-18 04:45:22 -07:00