Commit Graph

106233 Commits

Author SHA1 Message Date
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
Martin Kustermann 05fc6bd253 [dart2wasm] Use unchecked entry if an InstanceInvocation has isInvariant flag set
The CFE marks nodes as invariant if it's guaranteed the covariance
checks would succeed. It does so e.g. in this example

  final list = <int>[];
  list.add(1);

Change-Id: I2c9b0883e0c69e128c8014934a325ce8ef21a8d0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/416942
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Ömer Ağacan <omersa@google.com>
2025-03-20 04:14:28 -07:00
Tess Strickland acd16c6aa7 [pkg/vm] Add tool for generating DartEngine shims from entry points.
This is an initial cut of a tool for automatically creating shims for
C/C++ programs using the entry point annotations in Dart code. The tool
has two required arguments:

* the .dill file containing the kernel representation of the Dart code
* the base path of the header and implementation files to create

With a base path of 'dir/name', the header file is created as
'dir/name.h' and the implementation file is created as 'dir/name.cc'.
In addition, 'dir/name.h' is used as a basis for creating a
#ifndef/#define/#endif header guard around the header contents.


The created shims are specific to a single package, either

* a user-specified package, provided via '-p'/'--package', or
* the package of the main method

If the user does not specify a package and there is no main method
in the .dill file, the tool fails.


Each shim takes the following arguments in order when applicable:

* the isolate in which to perform the requested operation,
* the instantiated type of the generic class (for invoking, setting, or
  getting constructors, static methods, and static fields)
* the instance (for invoking, getting, or setting instance methods and
  fields)
* the type arguments (for retrieving nullable or non-nullable
  instantiated types of a generic class)
* the arguments (for invoking, setting, or getting constructors,
  methods, and fields)


The generated shims:

* cache the package library, types for non-generic classes, and
  types for generic classes instantiated with default type arguments.
  The cached persistent handles are cleared if any of the methods
  are called with a different isolate from the one used to populate
  the cache.
* automatically handle conversions between C int64_t <=> Dart int
  and C double <=> Dart double.


By default, shims are not created for allocation or initializing
uninitialized instances. To create such shims, use the '-u' command
line argument.


Currently, shims are not created for methods that take optional
or named arguments. To report an error if a shim cannot be created
for any entry points, use the '-e' command line argument.

TEST=tests/standalone/embedder_samples_test

Change-Id: Ibdf3b52d900ba98038528178485f295c5868ac9d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/410500
Reviewed-by: Ivan Inozemtsev <iinozemtsev@google.com>
Commit-Queue: Tess Strickland <sstrickl@google.com>
2025-03-20 03:53:10 -07:00
Johnni Winther 4aa7c8bca2 [cfe] Handle getter/setter patches through fragments
Change-Id: I93288a5518f2396df9783d45e9ebfadd80aaac51
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/416600
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2025-03-20 03:43:08 -07:00
Vyacheslav Egorov d1bfa65eb4 [vm] Regenerate perfetto protos
I am working on changes to perfetto output: implemented
interning of strings which significantly reduces the size
of generated packets.

As part of my changes I needed to add some fields back
to proto definitions (which were manually tree-shaken
to reduce the binary size). This means I will need to
regenerate protos - but to simplify review I am first
sending a CL which just regenerates proto code without
any changes.

This CL also updates the script to make it run on Mac.
Whatever build issue was present before is no longer
present and the tool just works.

TEST=ci

Change-Id: Ifa422cb4128d831b30a89478e58dfffa038d9488
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/416740
Reviewed-by: Derek Xu <derekx@google.com>
Commit-Queue: Slava Egorov <vegorov@google.com>
2025-03-20 03:34:19 -07:00
Daco Harkes aab2d4d4fa [deps] Roll dart-lang/native
Change-Id: I2e1b0d0440699ac82f3a1751c98767664855f985
Cq-Include-Trybots: luci.dart.try:pkg-linux-debug-try,pkg-linux-release-arm64-try,pkg-linux-release-try,pkg-mac-release-arm64-try,pkg-mac-release-try,pkg-win-release-arm64-try,pkg-win-release-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/416920
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Moritz Sümmermann <mosum@google.com>
2025-03-20 03:21:24 -07:00
Jens Johansen 5ba5934201 [scanner] Specialized scanner recovery for missing end curly brace
*TL;DR*

This improves scanner recovery for a missing `}` in certain situations,
reducing the risk of an in-body change causing a (temporary) outline
change (which in turn could result in the analyzer becoming unresponsive
for "no reason").

*Details*

The behavior of IntelliJ is that when typing `{` it only inserts a
matching end brace `}` when hitting enter.

Imagine you are typing an if: `if (1 + 1 == 2) {`, where you don't hit
enter quickly enough and you trigger a re-analysis at this point.

What happens then is that every method below where you are typing looks
to be local function declarations and thus the outline change. When the
outline change the analyzer has to do a lot of work: everything
(transitively) depending on the file has to be recompiled, and every
strongly connected component is compiled "in one go" where the analyzer
can't respond to queries. So if you have one or more large strongly
connected components depending on the file, or the file itself is part
of such a chain, you will (or at least might) experience that the
analyzer is slow to respond, and it will be extra puzzling because
logically you're just doing an in-body change.

For some code the user might not even naturally hit enter, e.g. `var foo
= {"I'm", "a", "set"};`.

The recovery in the scanner has always been that - upon reaching the end
of the file - it sees that we're missing a `}` and it inserts it at the
end. This CL instead tries to figure out a better place to insert it,
and if successful, will rerun the scanner, instructing it to insert it
at the better place and (hopefully) avoiding a subsequent outline
change.

It does this by looking at the indentation - which is new for recovery -
and under the assumption that the indentation was correct before, will
find the position where the start curly brace was inserted. Note that if
it finds a position it will always be between the start curly brace (the
one missing the end curly brace) and the end of file, and inserting the
missing curly end brace there can't really be "more wrong" than
inserting it at the end (if the new place is not correct it's just
"still wrong").

In the benchmark added we see how quickly we can get completion after
having typed `if (1+1==2) {`, then adding `\n ge\n}` and requesting
completion on the `ge` part, i.e. a simulation of typing

```
if (1+1==2) {
  ge
}
```

and asking for completion at the `ge`.

The change in this CL - on cycles of size 1024 - caused the time to
completion response to come in between ~5 times faster (going from ~10.2
to ~2.1 seconds) to ~18 times faster (going from ~10.3 seconds to ~0.56
seconds):

`CodeType.ImportExportCycle` goes from:

```
+------+-----------+------------+
| Size |  Initial  | Completion |
+------+-----------+------------+
|   16 |  2.019581 |    0.97504 |
|   32 |  3.028976 |   1.031008 |
|   64 |  4.422884 |   1.198383 |
|  128 |  7.612125 |   1.597091 |
|  256 | 12.860864 |   2.906553 |
|  512 | 24.391894 |   5.017093 |
| 1024 | 48.390993 |  10.243085 |
+------+-----------+------------+
```

to

```
+------+-----------+------------+
| Size |  Initial  | Completion |
+------+-----------+------------+
|   16 |  2.107213 |   0.661066 |
|   32 |  3.012952 |    0.70554 |
|   64 |  4.682508 |   0.731176 |
|  128 |  7.508434 |   0.745501 |
|  256 | 13.105477 |   0.852413 |
|  512 | 24.520184 |   1.278403 |
| 1024 | 48.804348 |    2.11903 |
+------+-----------+------------+
```

and `CodeType.ImportExportChain` goes from:

```
+------+-----------+------------+
| Size |  Initial  | Completion |
+------+-----------+------------+
|   16 |  2.059196 |   0.892082 |
|   32 |  3.080717 |    0.93232 |
|   64 |  4.647163 |   1.240303 |
|  128 |  7.377035 |   1.674859 |
|  256 | 12.939432 |   2.705483 |
|  512 | 24.529501 |    5.02689 |
| 1024 | 47.713553 |  10.385469 |
+------+-----------+------------+
```

to

```
+------+-----------+------------+
| Size |  Initial  | Completion |
+------+-----------+------------+
|   16 |  2.020809 |   0.709643 |
|   32 |  3.106856 |   0.648818 |
|   64 |  4.503067 |   0.593152 |
|  128 |   7.45692 |   0.622423 |
|  256 | 13.140592 |   0.606948 |
|  512 | 24.933216 |   0.612687 |
| 1024 | 50.167541 |   0.567544 |
+------+-----------+------------+
```

Change-Id: I8dbefe215162d00a209206ae3db83b2b17505853
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/415581
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
2025-03-20 01:58:45 -07:00
FMorschel f276d3c65b [cq] Using TestCode and normalizeSource for quick-fix tests
This change introduces `TestCode` and `normalizeSource` into the tests for quick fixes. The goal is to add these capabilities to `AbstractSingleUnitTest`, allowing a future update to replace offsets in tests with markers.

Bug: https://github.com/dart-lang/sdk/issues/60234
Change-Id: I760e6b5fb13b37d4e35278073a78f4d755deda64
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/415260
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Auto-Submit: Felipe Morschel <git@fmorschel.dev>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
2025-03-19 17:35:20 -07:00
Danny Tuppeny f6cf08b898 [analysis_server] Use a static identifier for plugin-supplied fixes/assists
Change-Id: Ifc6310aabe60a8c5671203b66b11fe98e0c5cbbe
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/416800
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2025-03-19 16:17:56 -07:00
FMorschel 77961aec08 [DAS] Adds fix for multiple_combinators warning
Bug: https://github.com/dart-lang/sdk/issues/56879
Fixes: https://github.com/dart-lang/sdk/issues/60309

Change-Id: Ifac77bbcb0d22c96cc01ea12fba1af86721809e2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/414800
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Auto-Submit: Felipe Morschel <git@fmorschel.dev>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2025-03-19 14:17:01 -07:00
Konstantin Shcheglov df120f14ec Elements. Require MethodElementImpl for MethodMember.
Change-Id: I5daca9f7fe0464279bd67414532bb070406ba5e7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/416822
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2025-03-19 14:10:21 -07:00
Konstantin Shcheglov 8fa11b0fca CQ. Simplify BufferedSink.
I don't believe that there are performance changes.

These are mostly stylistic changes, and removing things like passing
sink.

Change-Id: I360f476407885694296d6c7693edc26492cf7e18
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/416820
Reviewed-by: Paul Berry <paulberry@google.com>
2025-03-19 14:09:53 -07:00
Sam Rawlins 331c700f33 DAS plugins: Move Assist code to analysis_server_plugin package
The PluginServer class needs access to AssistProcessor in order to
compute assists. That class needs access to a few other classes, which
then must also be moved:

* assist_core.dart - the Assist class
* assist_dart.dart - the DartAssistContext class
* assist_generators.dart - the registeredAssistGenerators variable
* assist_performance.dart - the AssistPerformance and
  GetAssistsPerformance classes
* assist_processor.dart - the AssistProcessor class with it's
  singular API, `compute()`
* performance.dart - the ProducerRequestPerformance class
* the `addCaretAtOffset` helper function, refactored into a
  `withCaretAt` extension method

This change is functionally a no-op.

Change-Id: Ic883d21e9cc8c3db1f6093f830f01ec6eb9a0976
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/416680
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
2025-03-19 13:44:51 -07:00
Ryan Macnak 0f2c6d7302 [vm] Make vm/cc/SafepointOperation_SafepointPointTest robust to unfavorable scheduling.
TEST=ci
Change-Id: Icb03a30cbcbf181fa07c939b606524b29ac70747
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/416400
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
2025-03-19 12:38:14 -07:00
Alexander Markov 1b6f89d284 [vm, tfa] Fix tree-shaking of late final fields with initializers
TFA tree shaker removes initializers of fields which cannot be accessed
but retained due to an entry point pragma / dynamic interface.

For late final fields with initializers that changes semantics as
late final fields without initializers have an implicit setter.
Such setter is not accounted in the kernel AST
(Field.setterReference == null and Field.hasSetter == false) and
it doesn't get an assigned selector id, which causes a crash in
dispatch table generator.

The change fixes this bug by retaining initializers for late final
fields. The initializer code is still replaced with
throw "Attempt to execute code removed by Dart AOT compiler (TFA)".

TEST=pkg/vm/testcases/transformations/type_flow/transformer/regress_b404559785.dart

Bug: b/404559785
Change-Id: Id998a715ea75a4768414997ce66bcdd1d4f19189
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/416720
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Slava Egorov <vegorov@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2025-03-19 12:31:02 -07:00
Brian Wilkerson 42bdd6071f Add support for a zero-length marker in test code
Change-Id: I44642ecbb09d8fc2c3b86400f5d388c74d6fb3d4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/416521
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2025-03-19 12:18:40 -07:00
Nate Biggs c3f6e4f591 [dart2js] Allow for consistent CLI flags for staged compilations.
Issue: https://github.com/dart-lang/sdk/issues/60353
Change-Id: I58f9f17b6916fec0d6279e1659618950aa695f81
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/416327
Reviewed-by: Mayank Patke <fishythefish@google.com>
Commit-Queue: Nate Biggs <natebiggs@google.com>
2025-03-19 12:02:39 -07:00
Mayank Patke 3a3dfcbb7d [dart2js] Remove references to new-rti/old-rti.
The "new" rti library has been standard for years now and no one should
be passing `--experiment-new-rti` or `--use-old-rti`. We can now clean
up any references to different versions of rtis.

Change-Id: I4421b8943fe5034ed4d259477e8112b25ba0c763
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/416326
Reviewed-by: Nate Biggs <natebiggs@google.com>
Commit-Queue: Mayank Patke <fishythefish@google.com>
2025-03-19 11:54:57 -07:00
Mayank Patke 30f2914e74 [dart2js] Remove SNS checks flag.
Change-Id: Idb2163a47e7c6ad4f2482bc24aecfc3483c7023b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/416342
Reviewed-by: Nate Biggs <natebiggs@google.com>
2025-03-19 11:54:57 -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
Konstantin Shcheglov 9d3a55077d Elements. Do not add extra substitution to Member.
Change-Id: I447bdea0092fafd1465cf8621442d6403ef5d588
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/416761
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2025-03-19 11:03:58 -07:00
Ömer Ağacan e319a6ce80 [ddc] Fix batch mode argument parsing on Windows
This bug was introduced with
https://dart-review.googlesource.com/c/sdk/+/415280.

Fixes #60346.

Change-Id: I677145bcbf30b2c56eb061998be8ffd56f392dcd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/416700
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Ömer Ağacan <omersa@google.com>
2025-03-19 11:02:59 -07:00
MarkZ e958560965 [ddc] Adding error messages for illegal enum conversions after a hot reload.
Fixes: #60102, #60104
Change-Id: I5b89edffc3aa753d0882c2b9fd6aefd9bfef7175
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/416080
Reviewed-by: Nate Biggs <natebiggs@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Mark Zhou <markzipan@google.com>
2025-03-19 10:36:59 -07:00
Ryan Macnak 55fb750877 [vm] Fix race in vm/cc/SafepointOperation_SafepointOpBlockedWhileDeoptSafepointOp.
LongDeoptTask: MarkAndNotify(kFinishedDeoptOperation)
         main: MarkAndNotify(kPleaseExit)

If main wins, LongDeoptTask will override the state and wait for a kPleaseExit that will never come.

TEST=ci
Change-Id: I2f29da2fca980ca8f2b3c42477c4e793d7379af4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/416381
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
2025-03-19 09:40:42 -07:00
Kallen Tu 9b116d047b [cfe] Dot shorthands - Const constructors
Parse and build dot shorthand invocations that are constant.
Added a new listener to handle and store the const-ness. It didn't feel right re-using any of the other `beginConstPattern` methods.

Added an error message if invoking a non-const constructor where we expected a const constructor.

Bug: https://github.com/dart-lang/sdk/issues/59758
Change-Id: I8551e3b8f71e89a69d090510bb64694d5e09247d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/414660
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Kallen Tu <kallentu@google.com>
2025-03-19 08:52:23 -07:00
Ömer Ağacan cf9f45f1d4 [dart2wasm] Copy VM's map and set factory transformers
Transform factory calls to default map and set classes to the
constructor calls to the classes to improve kernel.

Also remove some redundant null checks in VM's transformer.

`source_map_simple_optimized_test.dart` is updated: with improved kernel
wasm-opt now eliminates the `testMain` function, so the stack trace
doesn't mention it.

Fixes https://github.com/dart-lang/sdk/issues/60343.
Tested: minor refactoring in VM doesn't need testing. Wasm tested with
existing tests.
Change-Id: Ie448d1374ff0e1b278859f22bc250899e0e4cfd0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/416640
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Ömer Ağacan <omersa@google.com>
2025-03-19 08:10:16 -07:00
Danny Tuppeny 29c350dfe9 [dds/dap] Ensure DAP always sends resume on PausePostRequest
The change at https://dart-review.googlesource.com/c/sdk/+/410760 to fix a race incorrectly assumed that once we had handled startup for a thread, we would never need to send an automatic resume again. However this was not the case - after a hot reload, we need to resume the thread even though we had technically already handled startup.

This is essentially a partial revert of 84e6ed0784, with a test to verify we trigger readyToResume on PausePostRequest.

Change-Id: I1e171043f04f38dd6f52e1692d9257d34e5248be
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/416580
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
Reviewed-by: Derek Xu <derekx@google.com>
2025-03-19 07:32:19 -07:00
Sam Rawlins 5c1b9086c0 linter: Document and test more specifically what the rule does
In preparation for the `@awaitNotRequired` annotation, I looked into
the implementation of this rule, and changed the documentation to be
more specific about the very specific situations in which lints are
reported (there are only three). This should alleviate issues like
https://github.com/dart-lang/sdk/issues/60006.

I also added some test cases that will be useful in exploring what the
new annotation will be able to suppress.

Change-Id: Iea3a90b6c79df4b8eee7c33063780b3cf0298109
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/415780
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
2025-03-19 07:20:45 -07:00
Johnni Winther 47f7972a2f [cfe] Add GetterDeclaration and SetterDeclaration
In preparation for handling getter/setter patches through fragments

Change-Id: I25778f96df35856f84654949eb9dc8ce65a37bac
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/416560
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2025-03-19 07:04:14 -07:00
Alexander Markov 2ac7957077 [vm, dynamic_modules] Support extensions and extension types in dynamic interface annotator
TEST=pkg/vm/test/transformations/dynamic_interface_annotator_test.dart

Bug: b/404399018
Change-Id: I9b4baafc0c75b62f4fe15cb1191f0e31669a8538
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/416340
Reviewed-by: Nate Biggs <natebiggs@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2025-03-19 06:30:48 -07:00
Ömer Ağacan 55d57541cb [dart2wasm] Fix --extra-compiler-option parsing
Don't split the `--extra-compiler-option` values by commas, to allow
passing `-D`/`--define` flags like `-DFOO=a, b` as one argument.

Fixes the dart2wasm failure in #60346.

Change-Id: I9c621f93d4bcd4e35926e495735c8d15a3bac212
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/416581
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Ömer Ağacan <omersa@google.com>
2025-03-19 05:36:17 -07:00
Mudit Somani e5bdab7271 [doc] update dart tui project proposal
Closes https://github.com/dart-lang/sdk/pull/60356

GitOrigin-RevId: bff081f25b30d65058cbedb56f154df76238f511
Change-Id: I9b4c168cb9fb6c882498481243bc98a6532f1b61
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/416520
Commit-Queue: Jonas Jensen <jonasfj@google.com>
Reviewed-by: Jonas Jensen <jonasfj@google.com>
2025-03-19 03:20:10 -07:00
Ömer Sinan Ağacan bb0184365d [dart2wasm, infra] Add dart2wasm minify test configuration
Change-Id: I4639bcad207b7832c6eb2f77a1751ebb03a84bbf
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/415583
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Ömer Ağacan <omersa@google.com>
2025-03-19 02:43:18 -07:00
Johnni Winther 4daa40bf42 [cfe] Remove NnbdModeMismatch
Change-Id: I27d1f63050f1e4ab4b7f57e25e6287ab27f49f09
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/416480
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Auto-Submit: Johnni Winther <johnniwinther@google.com>
2025-03-19 02:41:12 -07:00
Jens Johansen d3bbacfa9d [analyzer] Faster export scope calculation in bad cases
With the `big_chain_benchmark` for ImportExportCycle and
ImportCycleExportChain it scales a lot better. The other ones
(ImportCycle, ImportChain, ImportExportChain) doesn't change.


For ImportExportCycle, in AOT mode, before we got:

```
+------+-----------+------------+------------+
| Size |  Initial  | Completion | Fully done |
+------+-----------+------------+------------+
|   16 |   0.46673 |   0.169486 |   0.406448 |
|   32 |  0.875871 |   0.242876 |    0.85543 |
|   64 |  1.583077 |   0.465915 |   1.506953 |
|  128 |  3.198071 |   0.903894 |    3.09165 |
|  256 |  6.786677 |   2.149489 |   6.779569 |
|  512 | 17.346131 |    8.92149 |  17.971033 |
| 1024 | 63.358453 |  46.152089 |  65.401559 |
+------+-----------+------------+------------+
```


now instead we get:

```
+------+-----------+------------+------------+
| Size |  Initial  | Completion | Fully done |
+------+-----------+------------+------------+
|   16 |  0.474942 |   0.166857 |   0.411457 |
|   32 |  0.834925 |   0.243397 |    0.76843 |
|   64 |  1.608813 |   0.439885 |    1.53438 |
|  128 |  3.198453 |   0.805756 |   3.302559 |
|  256 |  6.347211 |   1.712426 |   6.165624 |
|  512 | 12.874747 |   3.551489 |    13.1461 |
| 1024 |  27.14403 |   7.844261 |   27.32785 |
+------+-----------+------------+------------+
```

An almost 6x improvement for completion and 2x+ improvement for both
initial analysis and analysing after the change.


For ImportCycleExportChain, in AOT mode, before we got:

```
+------+-----------+------------+------------+
| Size |  Initial  | Completion | Fully done |
+------+-----------+------------+------------+
|   16 |  0.454349 |   0.152505 |   0.400889 |
|   32 |  0.892146 |   0.302407 |    0.81263 |
|   64 |   1.67604 |   0.439954 |   1.517379 |
|  128 |  3.335087 |   0.907002 |   3.262481 |
|  256 |  6.378526 |   1.943725 |   6.292922 |
|  512 | 15.477861 |   6.461358 |  15.560008 |
| 1024 | 50.671197 |   33.14349 |  51.689455 |
+------+-----------+------------+------------+
```


now instead we get:

```
+------+-----------+------------+------------+
| Size |  Initial  | Completion | Fully done |
+------+-----------+------------+------------+
|   16 |  0.548357 |   0.166257 |   0.415632 |
|   32 |  0.906483 |   0.296618 |   0.910544 |
|   64 |  1.623723 |   0.464061 |   1.527888 |
|  128 |  3.067769 |   0.801507 |   2.927981 |
|  256 |  6.224551 |   1.596711 |   6.098531 |
|  512 | 12.941757 |   3.277487 |  12.345753 |
| 1024 | 25.870713 |   7.020787 |  25.760605 |
+------+-----------+------------+------------+
```

A ~4.7x improvement on completion and ~2x improvement for both initial
analysis and analysing after the change.

Change-Id: I052879c1695ad5f0aa63c2d96013a1e3eae96428
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/413421
Reviewed-by: Lasse Nielsen <lrn@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2025-03-19 02:11:16 -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
Johnni Winther 4884112185 [cfe] Handle patch factories through fragments
Change-Id: I11a5b2e113d854ae159a823359ddbdd8e796f6db
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/415281
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
2025-03-19 01:32:14 -07:00
Mayank Patke 107660616e [dart2js] Remove all uses of useLegacySubtyping.
Bug: #60327
Fixes: #41960
Change-Id: Idc766a1cccd008aa7262c79effe25daa240850bf
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/416180
Reviewed-by: Nate Biggs <natebiggs@google.com>
Commit-Queue: Mayank Patke <fishythefish@google.com>
2025-03-18 19:09:54 -07:00
Mayank Patke 77cd774d08 [dart2js] Remove legacy type test specializations.
Bug: #60327
Change-Id: Ie9b1b86c0f7695e0b9d377004a082f56f44bd57f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/416160
Reviewed-by: Stephen Adams <sra@google.com>
Reviewed-by: Nate Biggs <natebiggs@google.com>
2025-03-18 19:09:54 -07:00
Mayank Patke 549639dc6c [dart2js, ddc] Remove LEGACY support from rti.
- Remove support for `JS_GET_FLAG('LEGACY')` from backends
- Remove `kindStar` Rtis
- Remove `Recipe.wrapStar`

Bug: #60327
Change-Id: I2ec9b0afc9f3cd99fc6167600e6d908c9771af1d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/416101
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
Reviewed-by: Nate Biggs <natebiggs@google.com>
2025-03-18 19:09:54 -07:00
Mayank Patke 6a2e567859 [dart2js, ddc] Remove PRINT_LEGACY_STARS.
Bug: #60327
Change-Id: I32a9f078e4c2ae5fc3b79b4f549a4357a08818d9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/416043
Reviewed-by: Stephen Adams <sra@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Nate Biggs <natebiggs@google.com>
2025-03-18 19:09:54 -07:00
Mayank Patke 13b5b8ab37 [dart2js, ddc] Remove support for SNS checks.
Bug: #60327
Change-Id: I38f04fea4e51dcd0fd43dc93ecc7007a0a816f29
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/416120
Reviewed-by: Nate Biggs <natebiggs@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
2025-03-18 19:09:54 -07:00
Mayank Patke 38ef3748c3 [dart2js] Remove LegacyType.
Bug: #60327
Change-Id: Ia236d1674ba8030da3b91e88ac869e99fe5b8399
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/416024
Reviewed-by: Nate Biggs <natebiggs@google.com>
2025-03-18 19:09:54 -07:00
Mayank Patke 1f8ab5f53b [dart2js, ddc] Remove LEGACY_TYPE_REF.
Bug: #60327
Change-Id: I30017acd7087227e646b230078066208fb27e398
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/416060
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Nate Biggs <natebiggs@google.com>
2025-03-18 19:09:54 -07:00
Konstantin Shcheglov 5543581416 CQ. Use named formal parameters for Member(s). #2
Change-Id: I146c18173fa0662df8457f95f12122dab00c2b24
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/416325
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2025-03-18 16:32:26 -07:00
Alexander Markov bbdb840023 [vm, dynamic_modules] Handle native stack overflow in the interpreter
TEST=corelib/error_stack_trace2_test

Change-Id: I337c15eecddccbe770158fa493bf296c171f9f08
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/415940
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2025-03-18 15:57:16 -07:00
Ryan Macnak 49bf6449d0 [vm] Fix race between Page::Deallocate during isolate group shutdown and Page::Cleanup during Dart_Cleanup.
Dart_Cleanup waited only for the isolate group to be unregistered, which happens before the group's heap is deleted.

TEST=tsan
Change-Id: I20046516635adbcbf63eae460d7b09e7e26169d8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/416283
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2025-03-18 14:53:50 -07:00
Ryan Macnak b591571935 [vm] Fix symbol creation during DeoptSafepointOperationScope.
TEST=reload stress mode
Bug: https://github.com/dart-lang/sdk/issues/60337
Change-Id: Ieb85a832b72f0940155b6c3480abb91d5c803805
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/416042
Reviewed-by: Alexander Aprelev <aam@google.com>
2025-03-18 14:52:18 -07:00
Alexander Markov 18a44b3095 [vm, dynamic_modules] Support required named parameters in function types
TEST=language/nnbd/subtyping/function_type_required_params_test

Change-Id: I050f8fdd331985512f204b265d81c7deec0d67fe
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/415640
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Slava Egorov <vegorov@google.com>
2025-03-18 14:50:45 -07:00
Sam Rawlins fe5086d4e6 CHANGELOG: add entries for substantial features in analyzer
Change-Id: I09e3ef3dd763cd7108a934e5d8f2a431fe4ade3c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/416321
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2025-03-18 14:34:28 -07:00