Commit Graph

2420 Commits

Author SHA1 Message Date
Ivan Inozemtsev e694eb261a [release] Bump version on main to 3.10
Change-Id: I502950fa3cf72958628512634ad0d62ca54f61cd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/434804
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Tess Strickland <sstrickl@google.com>
Commit-Queue: Ivan Inozemtsev <iinozemtsev@google.com>
2025-07-14 22:47:12 -07:00
Jens Johansen 84e279d279 [CFE] Remove ~19 mb of allocations caused by iterators etc
* Remove ~2.8mb of iterators in SourceMethodBuilder
* Remove ~0.7mb of iterators in calculateBounds
* Remove ~1.7 mb of iterators in ClassMembersNodeBuilder.build
* Remove ~1.9mb of iterators in BuilderFactory.computeBuildersByName
* Remove ~3mb of iterables and iterators in findRecordUseAnnotation
* Remove ~3mb of allocations from List.iterator in InferenceVisitorBase._inferInvocation
* Another ~6.3mb of iterables in various places in chunks of ~100-800kb.

Running a benchmark of the CFE compiling the CFE I get this:

```
msec task-clock:u: -5.9719% +/- 0.3845% (-342.77 +/- 22.07) (5739.61 -> 5396.84)
page-faults:u: -2.6307% +/- 0.0630% (-2951.12 +/- 70.63) (112178.18 -> 109227.06)
cycles:u: -6.1751% +/- 0.3921% (-1471343183.50 +/- 93434420.74) (23827045867.84 -> 22355702684.34)
instructions:u: -5.0116% +/- 0.0006% (-1385443477.90 +/- 176957.44) (27644543467.86 -> 26259099989.96)
branch-misses:u: -6.0357% +/- 1.7661% (-5562845.14 +/- 1627775.60) (92165665.40 -> 86602820.26)
seconds time elapsed: -5.9868% +/- 0.3830% (-0.34 +/- 0.02) (5.75 -> 5.40)
seconds user: -6.0365% +/- 0.4515% (-0.33 +/- 0.02) (5.47 -> 5.14)
seconds sys: -4.6542% +/- 3.6415% (-0.01 +/- 0.01) (0.27 -> 0.26)
Scavenge(   new space) goes from 64 to 63
MarkSweep(   promotion) goes from 9 to 8
Evacuate(store buffer) goes from 2 to 1
```

Worth noticing, though, is that the before numbers (e.g. 5739.61 ms
task-clock:u) is very close to the before numbers from
https://dart-review.googlesource.com/c/sdk/+/438681 (5767.31 ms) and not
the after numbers on that cl (5478.56 ms) --- so something weird is
going on here.

Change-Id: I67248bbde47900435ababcb1a2d5ecff2dde5c13
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/438722
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2025-07-04 05:59:12 -07:00
Chloe Stefantsova 7b541da59b [cfe] Use exhaustiveness in computing nullability of intersection
This is a follow-up for
https://dart-review.googlesource.com/c/sdk/+/436620/comment/cddbbd38_1d23184c/

Change-Id: Ib473db14c6088ceb99034a6762ec75edccb4b5c1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/438723
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Auto-Submit: Chloe Stefantsova <cstefantsova@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2025-07-04 05:19:14 -07:00
Jens Johansen c812abd7bf [kernel] Don't allocate contexts in BinaryPrinter._ensureCanonicalName
When compiling the cfe with an aot-compiled cfe this removes ~43 mb of context allocations in `BinaryPrinter._ensureCanonicalName` and has these changes when benchmarking:

```
msec task-clock:u: -5.0067% +/- 0.6053% (-288.75 +/- 34.91) (5767.31 -> 5478.56)
page-faults:u: 2.7077% +/- 0.1426% (2942.48 +/- 155.01) (108670.96 -> 111613.44)
cycles:u: -5.3274% +/- 0.6265% (-1278360098.44 +/- 150341087.36) (23995901283.80 -> 22717541185.36)
instructions:u: -4.3319% +/- 0.0009% (-1195734804.64 +/- 241700.46) (27602908367.64 -> 26407173563.00)
branch-misses:u: -3.4011% +/- 3.0065% (-3245774.08 +/- 2869267.25) (95434325.44 -> 92188551.36)
seconds time elapsed: -5.0025% +/- 0.6041% (-0.29 +/- 0.03) (5.77 -> 5.48)
seconds user: -5.3148% +/- 0.6838% (-0.29 +/- 0.04) (5.52 -> 5.22)
Scavenge(   new space) goes from 65 to 64
MarkSweep(   promotion) goes from 10 to 9
Evacuate(store buffer) goes from 2 to 1
```

although most of it is probably a happy accident with the GCs.

Compiling the analysis server only gives:

```

page-faults:u: 0.6385% +/- 0.1266% (1058.68 +/- 209.95) (165813.00 -> 166871.68)
instructions:u: -0.0158% +/- 0.0005% (-6794934.20 +/- 222091.71) (42904117069.28 -> 42897322135.08)
Scavenge(   new space) goes from 103 to 101
```
Change-Id: I85ceece0df699bb2393f3ab72fe6130134b49132
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/438681
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2025-07-03 03:39:14 -07:00
Chloe Stefantsova 433c0998d0 [cfe] Remove Nullability.legacy
TEST=existing

Change-Id: Id924e4ef64ddabc1986cb885f558382ff139b481
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/436620
Reviewed-by: Mayank Patke <fishythefish@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Chloe Stefantsova <cstefantsova@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
2025-07-02 23:50:12 -07:00
Chloe Stefantsova be5dc4fc18 [cfe] Remove obsolete nnbd_api.md
This document was created during the early stages of the NNBD
development. The goal was to aid the migration to the new model. The
document has served its purpose and is not maintained for some time
now, so it can be deleted.

Change-Id: I398331cc41a0070e28cf3d1f94da958dd2d3ecfa
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/436602
Commit-Queue: Chloe Stefantsova <cstefantsova@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2025-06-24 06:08:23 -07:00
Chloe Stefantsova 150e8cbe97 [cfe] Upate pre-Null Safe naming in the CFE
Change-Id: I45e8dc703ce7810e6df5a328b3829dc86a128792
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/436241
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Chloe Stefantsova <cstefantsova@google.com>
2025-06-23 03:17:42 -07:00
Johnni Winther a04c0d4221 [cfe] Include library of private names in ast-to-text
This adds the library reference of private names of other libraries in
the ast-to-text of member declarations. This prepares for a fix of the
library used for private constructor tear offs.

TEST=existing

Change-Id: I65a30f6446b6e2cd15291327babb7fcacb36c4ff
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/434640
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
2025-06-17 06:15:43 -07:00
Johnni Winther 0297cad118 [kernel] Avoid dereferencing unlinked nodes in ast-to-text
This uses [Reference] directly to avoid trying to dereference an unlinked
[Reference]. This is in preparation for
https://dart-review.googlesource.com/c/sdk/+/434640

Closes #50368

TEST=existing

Change-Id: Ic22349cfeb1a99d820f0a413522a647a1a375bfc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/435121
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
2025-06-17 06:14:10 -07:00
Chloe Stefantsova b5cb488278 [cfe] Remove IsSubtypeOf.onlyIfIgnoringNullabilities
Change-Id: I584e079c273e48a007590fd63575321fe49f4b6a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/434060
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Chloe Stefantsova <cstefantsova@google.com>
2025-06-13 02:02:54 -07:00
Chloe Stefantsova 39810ffbe4 [cfe] Cleanup interface of subtype queries
Under the hood, there is no difference between
`isSubtypeWhenUsingNullabilities` and
`isSubtypeWhenIgnoringNullabilities` by now. This CL makes the
corresponding renames and removals in the CFE and its clients.

TEST=existing

Change-Id: I22060c29834179c30ba62562aa254146b1d7530d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/433480
Reviewed-by: Ömer Ağacan <omersa@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Mayank Patke <fishythefish@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2025-06-13 02:02:54 -07:00
Jens Johansen 9202990946 [kernel] Scope calculator speedup
Running the test (once) goes from ~3:33 to ~1:59 on my machine.
Functionally it should be the same.

Change-Id: I84844cdac6948bd5ae0238681bc83bbf6bd48308
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/433721
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2025-06-12 02:23:17 -07:00
Jens Johansen fd26223f9b [kernel] Scope calculator filters out wildcard variables
Fixes https://github.com/dart-lang/sdk/issues/60841.

Change-Id: Id1fd9300ad241af879ca7dfff3e4bf61125af852
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/433720
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2025-06-12 02:17:07 -07:00
Chloe Stefantsova c542a1e82f [model] Remove support for subtype checks ignoring nullability
Change-Id: I4a43e09094d79c7b5e59eb03cbe7eb676808a5f2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/426121
Commit-Queue: Chloe Stefantsova <cstefantsova@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2025-06-04 06:52:57 -07:00
Chloe Stefantsova 1117dce94d [model] Mark erroneously initialized optional parameters as such
This adds the flag isErroneouslyInitialized to the VariableDeclaration
AST node in Kernel. The flag is set to true whenever it is concluded
during compilation that the initializer contains errors is erroneous
for the parameter in any other way, for exaple, due to a type mismatch.

Change-Id: I1b3c9c662974fb9537ab4f89b58dd004979feebe
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/431862
Commit-Queue: Chloe Stefantsova <cstefantsova@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2025-06-02 02:14:27 -07:00
Chloe Stefantsova 00acecdfbe [model] Upate bench maker and parser for recent type system changes
This CL includes changes to BenchMaker and test type parser that
include recent developments in the DartType system, such as extension
types and record types, outstanding existing features, such as
typedefs, and recent changes in the CFE type model, such as structural
parameters.

Change-Id: I16ca13273e83de7942abad67b8a2b67146fb24bf
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/430661
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2025-05-23 01:57:10 -07:00
Chloe Stefantsova e535e812be [model] Update instructions for generating benchmark data in CFE
Change-Id: I505390321f8ca26391503dd4645b56a208108fc7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/429661
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Chloe Stefantsova <cstefantsova@google.com>
2025-05-21 01:45:11 -07:00
Johnni Winther 94c9dff1c5 [cfe] Add isInternalImplementation to Extension(Type)MemberDescriptor
This adds a flag to the member descriptors that allow us to skip these when building the name space for extensions and extension types from dill.

The late lowering of fields in dart2js is fixed to support lookup from dill.

Change-Id: Iacbd6451ac234767036dfe8f818c3ecbb693ced8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/427720
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
Reviewed-by: Mayank Patke <fishythefish@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2025-05-12 00:26:25 -07:00
Chloe Stefantsova d2ad38a49a [model] Mention Constructor.isErroneous in binary.md
It wasn't added by oversite. Similar flags for Field and Procedure are
already included in binary.md.

Change-Id: I3f12f170734489bbc72e03f9d7dcfdeef28daa8a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/427760
Commit-Queue: Chloe Stefantsova <cstefantsova@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2025-05-09 05:12:11 -07:00
Chloe Stefantsova c11186b47d [model] Recognize erroneous program encodings in the CFE verifier
For some erroneous programs the CFE produces the code that's not
type-safe or valid from the standpoint of a correct program. That
should not trigger the verifier warnings though.

Change-Id: I78b51ccffb0a74658926728e1a7ee3bf56934fe6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/426500
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Chloe Stefantsova <cstefantsova@google.com>
2025-05-07 01:03:13 -07:00
Chloe Stefantsova 40d52d54af [model] Enable checks in redirecting factories of extension types
This CL enables the same checks in the redirecting factories of
extension types as in redirecting factories of classes. Additionally,
this CL marks all of those erroneous constructors, in classes and in
extension type declarations, as erroneous.

Change-Id: Ic270324f05b6a8424c1ab9fbe9fe4f1d0b22a3fc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/425860
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Chloe Stefantsova <cstefantsova@google.com>
2025-05-01 06:05:34 -07:00
Chloe Stefantsova f749040450 [model] Keep Let expressions intact in the verifier
Prior to this CL the CFE verifier would update the type of the
variable in Let expressions from `dynamic` to the computed static type
of the initializer. This CL removes the type update, making the
.expect files reflect the CFE output more accurately. Additionally, a
verification check is added to make sure the static type of the
initializer is assignable to the type of the Let variable.

Change-Id: I0b7b8f175bcb319678c323eb6440d93f1f384a85
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/425500
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Chloe Stefantsova <cstefantsova@google.com>
2025-04-30 03:25:50 -07:00
Chloe Stefantsova b7aaf90246 [model] Mark erroneous constructors as such in the CFE
This allows to skip some apriori failing checks and avoid cascading
errors. Aditionally it instructs the verifier to not check the
erroneous constructors.

Change-Id: Ie96bbe84d02a96567b3deab65e15e0780a625d19
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/424820
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Chloe Stefantsova <cstefantsova@google.com>
2025-04-26 07:38:44 -07:00
Chloe Stefantsova 669bcef1a6 [model] Introduce isErroneous flag on Members in Kernel
The flag is used to signal known issues with members, so that the
verifier could skip on checking assumptions for well-formed programs.

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

TEST=existing

Change-Id: I7cf1983035d26105ccfe2e7a844a9ba3108bfda2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/420760
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Chloe Stefantsova <cstefantsova@google.com>
2025-04-23 01:15:43 -07:00
Johnni Winther a3953f12c7 [cfe] Include Procedure.isSynthetic in ast-to-text
In preparation for fixing #60490

TEST=existing

Change-Id: Iad3448a30de91e62f0d60bbaa9c425bc4706c799
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/421100
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2025-04-10 00:59:49 -07:00
Nate Biggs 1377e868d9 [kernel] Read constant table before deserializing metadata in BinaryBuilder.
Change-Id: Icf5d22e32eefb371c4b60d4039ab0455181450b5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/421360
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Nate Biggs <natebiggs@google.com>
2025-04-09 08:31:13 -07:00
Ivan Inozemtsev 24120c84d0 [release] Bump version on main to 3.9
Change-Id: Id694e90aad9e0ca50e4e09e40c2795f210c60e3d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/419700
Commit-Queue: Ivan Inozemtsev <iinozemtsev@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
Auto-Submit: Ivan Inozemtsev <iinozemtsev@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Alexander Thomas <athom@google.com>
2025-04-08 11:16:58 -07:00
Johnni Winther 0dde212150 [cfe] Add LookupResult
This replaces the individual lookups of getables and setables in LookupScope and NameSpace with single lookup that returns a LookupResult holding both the getable and the setable. This prepares for having getter/setter pairs in the same SourcePropertyBuilder and avoids the need for AccessErrorBuilder for handling lookups of getters where only setters exist and vice versa.

Change-Id: I2b1e2477ed43506d9f94c48acd4b44277b490540
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/420080
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
Reviewed-by: Erik Ernst <eernst@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2025-04-08 03:49:31 -07:00
Jens Johansen 6ad56c68dc [kernel] Remove NNBD compilation mode dummy from kernel binary
Also clean up some of the magic constants around this.

TEST=CI

Change-Id: Ie02df874cb30761d5ea08ae52c1507cf25318280
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/416940
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2025-03-21 06:15:41 -07:00
Sigurd Meldgaard 2fe05bd568 Reland "Migrate to use pub workspace"
This is a reland of commit b9b77058a9

Original change's description:
> Migrate to use pub workspace
>
> Use `pub get` to generate `.dart_tool/package_config.json` on gclient sync.
>
> All pkg/ (and a few third_party) packages that are developed inside the sdk repo are included in the workspace from the root `pubspec.yaml`.
>
> All dependencies that are pulled in via DEPS are added as path dependencies via `dependency_overrides` in the root `pubspec.yaml`.
>
> Bug: https://github.com/dart-lang/sdk/issues/56220
> Change-Id: I38c12b608c68da54c57821116cf9aa6696936746
> Tested: relies on CQ of existing tests. Should have no effect on functionality
> CoreLibraryReviewExempt: only core library change is adding a `// ignore:` comment. Should have no influence on functionality
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/397164
> Commit-Queue: Sigurd Meldgaard <sigurdm@google.com>
> Reviewed-by: Alexander Thomas <athom@google.com>

Bug: https://github.com/dart-lang/sdk/issues/56220
Change-Id: I29afabade2d2447dea05121cb87ff50bb21a4b76
Cq-Include-Trybots: luci.dart.try:flutter-linux-try,flutter-web-try
Tested: relies on CQ of existing tests. Should have no effect on functionality
CoreLibraryReviewExempt: only core library change is adding a `//
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/415561
Commit-Queue: Sigurd Meldgaard <sigurdm@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
2025-03-20 06:19:16 -07:00
Paul Berry c67a80f3f5 Stop using NullabilitySuffix in fe/analyzer shared code.
The getter `SharedType.nullabilitySuffix` is replaced by
`SharedType.isQuestionType`, which returns a boolean.

The method `TypeAnalyzerOperations.withNullabilitySuffixInternal` is
replaced by `SharedType.setNullabilitySuffix`, which accepts a
boolean.

Support for `*` types has been removed from `mini_types.dart`.

A few test cases in `flow_analysis_test.dart` previously used `*`
types as a way of exercising corner cases involving types that were
mutual subtypes of each other. These tests have been changed to take
advantage of the fact that `dynamic` and `Object?` are mutual
subtypes.

Change-Id: Id9904f9570fc738b388192db8536848204af03e9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/414581
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2025-03-19 11:24:21 -07:00
Johnni Winther 06d938046f [kernel] Remove NonNullableByDefaultCompiledMode
and TargetFlags.soundNullSafety

TEST=existing

Change-Id: I5e28d3d187b0f84fa23130c042fd3c55b89c687c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/413460
Reviewed-by: Ömer Ağacan <omersa@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Nate Biggs <natebiggs@google.com>
2025-03-19 01:37:07 -07:00
Sigurd Meldgaard 6c4de1ab7e Revert "Migrate to use pub workspace"
This reverts commit b9b77058a9.


Revert "Add missing sample pubspec to workspace"

This reverts commit 892ea15ac7.


These seem to break the engine.

Change-Id: Ieee26deb7928c3869a1b6265326c3ce568ffe731
Tested: this is a revert.
CoreLibraryReviewExempt: this is a revert
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/415582
Commit-Queue: Sigurd Meldgaard <sigurdm@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
2025-03-14 09:08:20 -07:00
Lasse R.H. Nielsen 7fd5108794 Remove .packages from .gitignore files.
The `.packages` file is no longer a special Dart file,
so any existing file lying around is garbage to be cleaned up.
We shouldn't be hiding it.

Change-Id: I269099bd66e392d630d5b23f4617a705a66a0800
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/414101
Commit-Queue: Lasse Nielsen <lrn@google.com>
Reviewed-by: Kevin Moore <kevmoo@google.com>
Reviewed-by: Brian Quinlan <bquinlan@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2025-03-14 07:08:55 -07:00
Sigurd Meldgaard b9b77058a9 Migrate to use pub workspace
Use `pub get` to generate `.dart_tool/package_config.json` on gclient sync.

All pkg/ (and a few third_party) packages that are developed inside the sdk repo are included in the workspace from the root `pubspec.yaml`.

All dependencies that are pulled in via DEPS are added as path dependencies via `dependency_overrides` in the root `pubspec.yaml`.

Bug: https://github.com/dart-lang/sdk/issues/56220
Change-Id: I38c12b608c68da54c57821116cf9aa6696936746
Tested: relies on CQ of existing tests. Should have no effect on functionality
CoreLibraryReviewExempt: only core library change is adding a `// ignore:` comment. Should have no influence on functionality
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/397164
Commit-Queue: Sigurd Meldgaard <sigurdm@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
2025-03-14 05:21:40 -07:00
Johnni Winther b5821f9c96 [cfe] Support constructor patches through fragments
Change-Id: I71ebf5bf95728e2960415589327b64313cbdf1e8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/415200
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2025-03-14 01:55:21 -07:00
Johnni Winther 1ebf3df920 [kernel] Add tool for checking AST equivalence
Change-Id: Ie06776203080e91346582534af2d56c24581bd54
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/413200
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2025-03-04 03:54:48 -08:00
Johnni Winther 0060b0f665 [cfe] Remove nnbd mode
TEST=existing

Change-Id: I30bbadb74e81c7f4aaa444d1e2f6f5ffc2005d4a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/412881
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2025-03-04 01:46:51 -08:00
Chloe Stefantsova d8c48032bb [cfe] Remove legacy raw types from CoreTypes
Change-Id: I9d920cc00ce22900429fd38b6c452483438f94d6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/397161
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Mayank Patke <fishythefish@google.com>
Commit-Queue: Chloe Stefantsova <cstefantsova@google.com>
Reviewed-by: Nate Biggs <natebiggs@google.com>
2025-02-28 00:50:40 -08:00
Mayank Patke 0c55c7e573 Remove unsound web configurations from test matrix.
This CL also removes references to unsound .dill files from the test
matrix and other build scripts and disables some of the option handling
that would lead to requiring unsound .dill files.

Change-Id: I89f701f8f5e1168bf974b5b44bfbafd5a39954fb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/412401
Reviewed-by: Nate Biggs <natebiggs@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
Commit-Queue: Mayank Patke <fishythefish@google.com>
2025-02-26 15:57:55 -08:00
Paul Berry a864586f3c Remove OWNERS file for the CFE team.
The code that was previously owned by the CFE team (OWNERS_CFE) is now
owned by the Dart Model team (OWNERS_MODEL). Accordingly, we don't
need OWNERS_CFE anymore.

Change-Id: I1ede4fbf5a0d29c5d328cc870c75c8a5ec7f217c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/410620
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Kevin Moore <kevmoo@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2025-02-19 09:33:31 -08:00
Paul Berry ca2d428f99 Add an OWNERS file for the new Dart Model team
Moving forward, the Dart Model team will own the following packages:
- _fe_analyzer_shared
- analyzer
- analyzer_cli
- analyzer_utilities
- front_end
- frontend_server
- kernel
- testing

In follow-up CLs I will create an OWNERS file for the developer
experience team, and then remove the OWNERS files for the old analyzer
and CFE teams.

Change-Id: Id7cf38ea41a6d3f9ca44f43fae1f310426a31e29
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/409841
Reviewed-by: Kevin Moore <kevmoo@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2025-02-14 15:51:17 -08:00
Nate Biggs a4a4ca8a41 [dart2wasm] Dynamic modules
Missing from this implementation:
- Closure/dynamic calls with differing signatures
- Overrides with extra optional parameters
- Records with same shape defined in different dynamic modules
- Avoiding running TFA on dynamic module.
- Recompilation of only updateable functions from main module.
- Persist wasm def types from main module.

Testing is currently done locally via the dynamic_modules package test suite:
dart pkg/dynamic_modules/test/runner/main.dart --runtime=dart2wasm

Immediately after this lands we can introduce a new step to one of the wasm test matrix configurations that runs the above test suite (the VM has a similar configuration).

Change-Id: I3386d84be11b773842d45f4268a62a54c47e352b
Tested: Tested via new tests in dynamic_modules package. Tests run locally but will add to existing config.
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/397721
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Nate Biggs <natebiggs@google.com>
2025-02-11 13:59:46 -08:00
Chloe Stefantsova 014cda46e0 [cfe] Remove more nullability-based reasoning from shape checks
Closes https://github.com/dart-lang/sdk/issues/60076

Change-Id: Ia32f12be5399ae1a04243fb69a28541df98ede5b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/408800
Reviewed-by: Mayank Patke <fishythefish@google.com>
Commit-Queue: Chloe Stefantsova <cstefantsova@google.com>
2025-02-11 04:26:25 -08:00
Chloe Stefantsova e0b0c33937 [cfe] Remove nullaiblity requirement from shape sufficiency checks
Closes https://github.com/dart-lang/sdk/issues/60076

Change-Id: I294056317cb4d6102d53efc95cadd4992f017339
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/408520
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Chloe Stefantsova <cstefantsova@google.com>
2025-02-07 04:52:02 -08:00
Sigurd Meldgaard 358ae88ba6 Move pkg/kernel to language version 3.6
This is in preparation for https://dart-review.googlesource.com/c/sdk/+/397164
as packages in a workspace need a recent language version.

Change-Id: If1926192209353fab934efe702391ea10ed3573c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/404581
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Sigurd Meldgaard <sigurdm@google.com>
2025-01-21 02:52:22 -08:00
Chloe Stefantsova dcd410efd4 [analyzer][cfe] Remove TypeStructure variable from shared classes
Part of https://github.com/dart-lang/sdk/issues/54902

Change-Id: Ia70f2afd321e9b4a4762b6ed860611dee1399d87
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/404622
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Chloe Stefantsova <cstefantsova@google.com>
2025-01-20 01:58:43 -08:00
Ömer Sinan Ağacan 78ce85a7fe [dart2wasm,tfa] Don't infer class of string values in comparisons
In dart2wasm, when a comparison like `x == "hello"` is true, we can't
assume that the class of `x` is the same as the class of `"hello"`:

- If `x` is received from JS, it will be `JSStringImpl`.
- If it's a substring of a `TwoByteString`, it will be `TwoByteString`.
- Otherwise it will be `OneByteString`.

Update `Target` with the new method

```
bool get canInferStringClassAfterEqualityComparison => true;
```

to allow TFA to *not* infer classes of string values after comparisons.

Override the method to return `false` in dart2wasm's `Target`
implementation.

Fixes #59901.
Tested: web/wasm/issue_59901_test
Change-Id: I1a6c8deaf27c54240dd4e821dbd8160914502ad7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/404562
Reviewed-by: Martin Kustermann <kustermann@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Ömer Ağacan <omersa@google.com>
2025-01-16 03:24:39 -08:00
Alexander Thomas b59c3e22ef [release] Bump version on main to 3.8
Change-Id: Ia56ca5673096bd59423b808f585902af42dc2e5d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/404620
Reviewed-by: Martin Kustermann <kustermann@google.com>
Auto-Submit: Alexander Thomas <athom@google.com>
2025-01-16 02:56:26 -08:00
Paul Berry 9a472930e5 [_fe_analyzer_shared] Renames to prepare for analyzer refactoring.
The following shared getters are renamed so that their names are
distinct from the corresponding getters in the analyzer:

- `SharedFunctionTypeStructure.positionalParameterTypes` is renamed to
  `positionalParameterTypesShared` to be distinct from the analyzer's
  public getter `FunctionType.positionalParameterTypes`.*

- `SharedFunctionTypeStructure.returnType` is renamed to
  `returnTypeShared` to be distinct from the analyzer's public getter
  `FunctionType.returnType`.

- `SharedNamedFunctionParameterStructure.type` is renamed to
  `typeShared` to be distinct from the analyzer's public getter
  `FormalParameterElement.type`.

- `SharedNamedTypeStructure.type` is renamed to `typeShared` to be
  distinct from the analyzer's public getter
  `RecordTypeNamedField.type`.

- `SharedRecordTypeStructure.positionalTypes` is renamed to
  `positionalTypesShared` to be distinct from the analyzer's public
  getter `RecordType.positionalTypes`.*

- `SharedRecordTypeStructure.sortedNamedTypes` is renamed to
  `sortedNamedTypesShared` to be distinct from the analyzer's public
  getter `RecordType.sortedNamedTypes`.

- `SharedTypeParameterStructure.bound` is renamed to `boundShared` to
  be distinct from the analyzer's public getter
  `TypeParameterElement2.bound`.

*Note that `FunctionType.positionalParameterTypes`,
 `RecordType.positionalTypes`, and `RecordType.sortedNamedTypes` were
 unintentionally exposed as part of the analyzer's public API. In a
 previous CL I marked them as deprecated.

These renames pave the way for changing the analyzer's `DartType`
class so that it implements `SharedTypeStructure<TypeImpl>` rather
than `SharedTypeStructure<DartType>` (without the renames, the public
getters mentioned above would all have to be changed to have type
`TypeImpl`, and that in turn would expose `TypeImpl` through the
analyzer public API, which we don't want to do).

Once `DartType` implements `SharedTypeStructure<TypeImpl>`, that will
allow all the other uses of `SharedTypeStructure<DartType>` in the
analyzer to be gradually migrated to
`SharedTypeStructure<TypeImpl>`. Once that is done, `DartType` can be
changed so that it no longer implements
`SharedTypeStructure<TypeImpl>` at all (`TypeImpl` will implement
`SharedTypeStructure<TypeImpl> instead). This will free us up to make
future changes to the `SharedTypeStructure` base class without
inadvertently exposing those changes through the analyzer public API.

This is part of a larger arc of work to change the analyzer's use of
the shared code so that the type parameters it supplies are not part
of the analyzer public API. See
https://github.com/dart-lang/sdk/issues/59763.

Change-Id: I0686fdeae304f8948484516f0249841b79e7da6c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/403625
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2025-01-10 14:32:47 -08:00