Commit Graph

52074 Commits

Author SHA1 Message Date
Nate Biggs e3e82c95cb [dart2wasm] Skip constructor entrypoints of dynamic callable anonymous mixins constructors.
These mixin constructors are now marked callable by the dynamic interface annotator: https://dart-review.googlesource.com/c/sdk/+/430002

However, they are not directly invokeable and trying to compile the constructor entrypoints causes dart2wasm to crash. So we explicitly skip them when considering dynamic callable constructors.

Note: This is blocking internal rolls as code patterns like this show up in our internal codebase.

Change-Id: I76383aec07bc53a0dbd1581c0577cba370d956f9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/430801
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Nate Biggs <natebiggs@google.com>
Auto-Submit: Nate Biggs <natebiggs@google.com>
2025-05-23 15:37:33 -07:00
Keerti Parthasarathy eb9cc6f5c9 Remove duplicate logic in KeywordHelper
Change-Id: I32e7643f785228b99961e50bc2380bdcdffca1d2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/430881
Commit-Queue: Keerti Parthasarathy <keertip@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2025-05-23 13:32:00 -07:00
Sam Rawlins b0b74b2810 Rename some loose ends w.r.t. "errorSeverity"
Change-Id: Id68fcd8bbbe45a95a294fd557ee4556c2af5c4c2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/430548
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2025-05-23 10:36:28 -07:00
Konstantin Shcheglov 19e911349f Fine. Fix for requirements on instance/interface elements with missing names.
Change-Id: Ide320ccc1bd146aba60a0d2bced405fc2612a027
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/430880
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2025-05-23 10:28:24 -07:00
Brian Wilkerson 2545c3eb31 Remove three more uses of NodeLocator2
Change-Id: I3e8fba0516bb0988ca0794991e980157dacb7231
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/430860
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
2025-05-23 10:22:17 -07:00
Konstantin Shcheglov d5e914ad09 Elements. Fix InstanceElementImpl2.name3, return firstFragment.name2, nullable.
Change-Id: Idd7239c1be692219f1f1ba735f475fe0141c0c6c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/430821
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2025-05-23 10:20:20 -07:00
Sam Rawlins 823b6668f6 analyzer: Rename ErrorSeverityTest to DiagnosticSeverityTest
Work towards https://github.com/dart-lang/sdk/issues/60635

Change-Id: I1361a28834cb95a8b7ad9f131132b7b77e888483
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/430547
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2025-05-23 10:14:14 -07:00
Sam Rawlins 43e01310a4 analyzer_testing: Rename PubPackageResolutionTest.ignoredErrorCodes to ignoredDiagnosticCodes
Change-Id: I0a951ecbf8aa74d1c00df99e0f5bdab84bb00dde
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/430542
Reviewed-by: Keerti Parthasarathy <keertip@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2025-05-23 10:12:18 -07:00
Kallen Tu 448c8aed6a [analyzer] Dot shorthands: Additional unit test for AMBIGUOUS_IMPORT.
Added a small unit test to make sure AMBIGUOUS_IMPORT with dot shorthands still produces the expected errors.

Bug: https://github.com/dart-lang/sdk/issues/59835
Change-Id: Ife115bfb1fd34f396c5b3d00cb4f4d75e933e963
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/430562
Commit-Queue: Kallen Tu <kallentu@google.com>
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
2025-05-23 09:32:50 -07:00
Alexander Aprelev 24211892c8 [gardening] Mark pkg/test_runner/test/update_error_cmdline_test Slow.
Fixes https://github.com/dart-lang/sdk/issues/60534
TEST=ci

Change-Id: Ia6786e83111250c627d95e901902a045cc548fe1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/430820
Commit-Queue: Alexander Aprelev <aam@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
2025-05-23 09:16:26 -07:00
Nate Biggs cd3f2fb270 [dart2wasm] Add dynamic modules subtyping test.
Tests that types defined fully with dynamic modules type check correctly.

In WASM this ensures that the class ID ranges used for the type checks are correct.

Change-Id: I22aa528599eb918062e198b878ba2b4cdc901a06
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/430620
Auto-Submit: Nate Biggs <natebiggs@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Nate Biggs <natebiggs@google.com>
2025-05-23 08:28:51 -07:00
Konstantin Shcheglov 88e2419b0f Elements. Convert FunctionTypeImpl.parameters to List<FormalParameterElementMixin>.
Change-Id: Idfba32254b458c68f75618d276b824ad734e13ac
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/430601
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2025-05-23 08:15:11 -07:00
Martin Kustermann 94a36d59ff [dart2wasm] Mark Closure.context as final
We also use the same variable to represent the type of the
context slot instead of repeating that type in several places.

Change-Id: Ia4d10db4781dfd78617d40279d37335eedeb7408
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/430760
Reviewed-by: Ömer Ağacan <omersa@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2025-05-23 06:02:14 -07:00
Martin Kustermann 26da655ddf [dart2wasm] Remove duplicate code to call references
Change-Id: I304729f6ed19a75de16ddced15b3f47f894e9c49
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/430740
Reviewed-by: Ömer Ağacan <omersa@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2025-05-23 05:38:08 -07:00
Jens Johansen 3deffabce1 [CFE] Update flutter_gallery_leak_tester to use flutter/dev/integration_tests/new_gallery
For a few months the "original" flutter gallery has had compile errors
and the weekly bot has been a lot slower (and doesn't really test the
default "advanced invalidation").

This updates the compile target to the one in
flutter/dev/integration_tests/new_gallery which doesn't have compile
time errors.

Change-Id: I59aa701700bc6b3530d73d9c0474dbff525288c5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/430700
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2025-05-23 04:50:30 -07:00
Ömer Ağacan 91374ffb12 [dart2wasm] Minify more errors
Transform front-end generated `throw` expressions (as indicated by the
kernel node's `forErrorHandling` flag) to error throwing functions that,
in minify mode, throw without details.

ACX demo sizes: (`-O2 --minify`)

- Before: 12,841,863 bytes
- After: 12,396,399 bytes
- Diff: -445,464 bytes, -3.46%

Issue: https://github.com/dart-lang/sdk/issues/60432
Change-Id: I3c0bfebd5a9cb460af312dafb63b5a0c9aeda22e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/430380
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Ömer Ağacan <omersa@google.com>
2025-05-23 03:31:36 -07:00
Chloe Stefantsova 561f2a3cff [model] Update DEPS to use new benchmark data for CFE subtype checks
Change-Id: Id428e294952f810ece7f83e8afad23db1c0f0d5a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/429981
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Chloe Stefantsova <cstefantsova@google.com>
2025-05-23 01:57:10 -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
Johnni Winther 27354572b4 [cfe] Add _createPropertyBuilder
This combines the creation SourcePropertyBuilder for fields, getters,
setters, enum elements and primary constructor fields through the same
method.

This prepares for combining getter/setter and final field/setter
pairs in the same SourcePropertyBuilder.

Change-Id: I664ccded46c79235281cbd0799f9567bfb451eb2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/430440
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
2025-05-23 01:26:42 -07:00
Martin Kustermann 226a667ef9 [dart2wasm] Add const bool.fromEnvironment('dart.tool.dart2wasm.minify')
We add the `dart.tool.dart2wasm.minify` environment define (analogous to
how dart2js exposes `dart.tool.dart2js.minify`).

We make `package:expect/variations.dart` then expose to tests what
guarantees they can assume, namely

   * `readableTypeStrings`
   * `preciseErrorsWithDetails`

Change-Id: I43da09ed924ca9137721f4d70b7a494e01bf36e4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/430680
Reviewed-by: Ömer Ağacan <omersa@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2025-05-23 01:26:38 -07:00
Stephen Adams 29d5395c49 [dart2js] Fix side-effects bugs
Make the `HInstruction.sideEffects` field final.  The instruction owns
the mutable SideEffects objects so it would be dangerous to make the
field reference a shared SideEffects object.

Update the side effects of an interface call when the target becomes
known. We were essentially missing any benefit of inferred
side-effects for instance members.

Change-Id: I46da1d87e166864cd7fa4cee01f209bcc19986af
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/430546
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Nate Biggs <natebiggs@google.com>
2025-05-22 19:49:10 -07:00
Brian Wilkerson 816b974c15 Report the number and sizes of library cycles
Reported in the report created by the diagnostic pages.

Change-Id: I44de39b8388101d8ef5c5d0ecd5d50c1a1f559cb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/430600
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2025-05-22 17:27:20 -07:00
Sam Rawlins 2dc94ee84a analyzer: Rename DiagnosticCode.errorSeverity to DiagnosticCode.severity
Change-Id: I244a96a940f82902a20e817fd13fe32026607ce3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/430581
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2025-05-22 17:25:01 -07:00
Nate Biggs 7d199f2171 [dart2wasm] Enable compiler asserts for dynamic module tests.
Fixes several asserts that were throwing when running with dynamic modules enabled.

Bug: https://github.com/dart-lang/sdk/issues/60743
Change-Id: I6bcd3723ecdee784b3d1603e1c87a47e3703a7f3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/423261
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Nate Biggs <natebiggs@google.com>
2025-05-22 16:48:22 -07:00
Nate Biggs 63ee73a2ed [dart2wasm] Fix dynamic modules bugs.
- For direct calls in selector branch, ensure 'if' branches have correct inputs.

- For overrideable selectors, the receiver type cannot be known in the main module so use 'top' type. Technically we could do better if selectors tracked interfaces they targeted. Then we could take the LUB of all those classes. But this would be a significant refactor for a small benefit.

- Type checks on classes defined in the main module should use the class ID ranges from the main module rather than those from the dynamic submodule. This only applies to non-dynamic module extendable types (otherwise we'd use the RTT checks). So we know the class can only exist in one of the range sets, not both.

I discovered (1) from running Flutter which led me to create this test which uncovered (2) and (3).

Change-Id: I80f39835f66aa7cf0cff527341e3f4a948a7a0cb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/430360
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Nate Biggs <natebiggs@google.com>
2025-05-22 16:15:58 -07:00
Konstantin Shcheglov 4e2569294e Fine. Rename recording methods in RequirementsManifest.
Change-Id: I3402e9b641978cd3004cc5d2be4b8b303fddf8a7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/430541
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2025-05-22 14:55:02 -07:00
Brian Wilkerson b55b2bb092 Refactor the performance reporting support
This CL contains no functional differences; it just reorganizes the code.

I expect to be adding data to the collected report, and I decided that
it would be better to break the massive method up before doing so in
order to improve overall readability.

I also wondered whether we might want to structure the data in a similar
way. For example, the top-level map could have entries corresponding to
each of these methods, each of which has a value that is a map
containing the data collected by that method. I don't know whether this
would make the output easier to read or whether the current form is
depended on anywhere, but it's something to consider for the future.

Change-Id: Id0ef3c2f64b00ea58069c496e7c485c7b3f163c9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/430560
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
2025-05-22 14:06:00 -07:00
Kenzie Davisson 10dd59c039 Add a DTD method to get all registered services.
This CL contains breaking changes for package:dtd and prepares both package:dart_service_protocol_shared and package:dtd for publish.

This CL also fixes https://github.com/dart-lang/sdk/issues/60757 so that DTD-registered services are sent over the `Service` stream upon initial subscription like what is done for client-registered services.

Change-Id: I619af816e64af01864c7ed9b98743c6691bf7e0b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/429161
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Kenzie Davisson <kenzieschmoll@google.com>
2025-05-22 13:52:54 -07:00
Nicholas Shahan f4c87f2ae8 [ddc] Add hot reload checks to instance getter accesses
Checks the compile and current hot reload generations. If they are not
equal the value is checked to have a getter of the expected name and
if so it gets called. If not, `.noSuchMethod` is invoked instead.

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

Change-Id: Ib80582b45f87f2ab41b943e0f263167b38601e0a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/429066
Reviewed-by: Srujan Gaddam <srujzs@google.com>
Reviewed-by: Nate Biggs <natebiggs@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
2025-05-22 13:27:31 -07:00
Sam Rawlins ef300f558c analyzer: allow LintCode instances to set their own severity
Work towards https://github.com/dart-lang/sdk/issues/53402

Letting plugin authors set the default severity of a lint code is a
top request. Users can still customize severities with analysis
options.

Change-Id: Id0a360f4a96ca9627f00d63d3487bfde554b74e8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/430260
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2025-05-22 12:51:30 -07:00
Konstantin Shcheglov b37171cf10 Fine. Support for type aliases.
Change-Id: I7907ba6b4041bd3723d37a652b883cea6dfc617f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/430540
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2025-05-22 12:50:21 -07:00
Konstantin Shcheglov 24ebc7a125 Fine. Support for extensions.
Change-Id: I3ebae3c6228b1b2c95e224e2e6624e46212d3b2f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/430461
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2025-05-22 11:36:34 -07:00
Stephen Adams f14ce9eec0 [dart2js] Remove unused Map/Set literal helper functions
These functions have not been used since we switched to the new Rti.

In modern Dart it is not worth special-casing `<dynamic,dynamic>{}` and
`<dynamic>{}`.

Bug: #37715
Change-Id: I535bc67055a7dc02016b14d1a0ae43ca1f850e79
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/430320
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Mayank Patke <fishythefish@google.com>
2025-05-22 11:31:14 -07:00
Sam Rawlins 612c9f6834 analyzer: rename AnalysisRule 'errorCode' parameters
Work towards https://github.com/dart-lang/sdk/issues/50986

Change-Id: I3d5a55f6638b18e2941a574a71c89fc142f0c206
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/430060
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2025-05-22 11:27:21 -07:00
Konstantin Shcheglov f637435eb6 Fine. Support for extension types.
Change-Id: I82bcaafd877b1192806343ea46e2c6a5594f131a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/430520
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2025-05-22 11:14:23 -07:00
Sam Rawlins f2d416b866 analyzer: simplify PackageConfigFileBuilder.toContent
This API did not exist (was not public) in analyzer 7.4.x, so is safe
to change in 8.0.0.

Change-Id: Ib4a06008b1cdf1be4f33dcb9036ea87b6d258067
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/430041
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2025-05-22 10:58:49 -07:00
Konstantin Shcheglov 058641a563 Fine. Support for TypeLiteral.
Change-Id: I2ee92b0be99cbeea39cbd9d07166e073fc230846
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/430322
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2025-05-22 10:14:35 -07:00
Sam Rawlins 87f5185577 analyzer: Rename NodeLintRegistry to RuleVisitorRegistry, provide alias
Work towards https://github.com/dart-lang/sdk/issues/50986

Change-Id: Id0053b4721ca0517e315d5118ae48839dfaa3027
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/429465
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2025-05-22 10:03:19 -07:00
Daco Harkes 66a2833aa0 [native assets] Avoid library name clash
TEST=tests/lib/mirrors/bad_argument_types_test.dart

Closes: https://github.com/dart-lang/sdk/issues/60778
Change-Id: I9d3e7b0ea70c65489a6b6dd1263e4b2ca72c61d3
Cq-Include-Trybots: luci.dart.try:vm-linux-release-x64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/430480
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Auto-Submit: Daco Harkes <dacoharkes@google.com>
2025-05-22 09:56:25 -07:00
Sam Rawlins e4810025ad Remove RuleState type hierarchy with an enum and condensed constructors
Change-Id: I07ee606b00467b8113f1722dba21b8c16cfe85b3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/429900
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2025-05-22 09:53:18 -07:00
Sam Rawlins 9d2df84973 analyzer_testing: add more default-ignored codes
UNUSED_ELEMENT and UNUSED_FIELD were added to the "ignore list" for
the tests of a dozen lint rules. I think it is pretty harmless to ignore
them by default, and save plugin authors some `// ignore:` comments, or
hand-wringing about how to get rid of an "unused" field in a test which
is needed in order to test an analysis rule.

Change-Id: Ic35fead8a44d8d3341f9e32e92b53610b517edf5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/430121
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Keerti Parthasarathy <keertip@google.com>
2025-05-22 09:23:50 -07:00
Daco Harkes 7397c1e1aa [ffi/anayzer] Docs error messages
Change-Id: I790ebffb2f2b868fcea85703e25cbe7a48bea2cd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/430181
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Auto-Submit: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2025-05-22 09:09:49 -07:00
Ben Konyi d7cef28bee [ Observatory ] Create fork of runtime/observatory at pkg/observatory
This change further prepares for the removal of Observatory from the
shipped Dart SDK by creating a fork to be used by the remaining
Observatory users.

This is basically a straight copy of the contents from
runtime/observatory with the exception of two new scripts:

- `bin/observatory.dart`, a utility to launch Observatory
- `bin/activate.dart`, which globally activates `bin/observatory.dart`
  as `observatory`

This change also updates the presubmits to ensure that
`runtime/observatory` is effectively placed in read-only mode to prevent
any divergences with the fork.

Work towards https://github.com/dart-lang/sdk/issues/50233

Change-Id: Iff3a7512058f36afa2a96d45d94a1dff424401d6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/429800
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2025-05-22 07:19:03 -07:00
Alexander Markov b083c9ac87 [dyn_modules] Handle implicit uses from const constructors and field initializers of const classes
When const constructor is exposed through a dynamic interface,
dynamic module can create constants with that const constructor and
it can reference everything used in that constructor including default
values of parameters and field initializers. So dynamic interface
annotator should visit bodies of const constructors and add all
references to implicit uses.

Annotator should also visit initializers of instance fields of
classes which can be used in a constant (as they participate in
the constant evaluation too). Kernel trim tool should not remove such
field initializers.

TEST=pkg/dynamic_modules/test/data/const_constructor
Fixes b/418928636

Change-Id: Ie216f3a4257fe5a905b83af8c60dfe8a5b774ecf
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/430002
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Slava Egorov <vegorov@google.com>
2025-05-22 06:39:25 -07:00
Ivan Inozemtsev 4cdb3f2c3a Shims generation improvement
- When return type is not directly supported and just a Dart_Handle,
  automatically create persistent handles
- Change `Dart_LoadLibrary` to `Dart_LookupLibrary`
- switch from iostream to cstdio, I have no idea why, but it doesn't
  work for me in emulators and it's not a big difference.

TEST=ci,manual
Change-Id: I9b6539c7f16e81af9e8a9ab3995d6040bac64a1d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/429962
Reviewed-by: Tess Strickland <sstrickl@google.com>
Commit-Queue: Ivan Inozemtsev <iinozemtsev@google.com>
2025-05-22 04:33:22 -07:00
Johnni Winther 2b492a8d24 [cfe] Add UriOffsetLength
This adds a UriOffsetLength that passes uri, offset and length of a source locations. This is used to support
field/getter/setterUriOffset to prepare for getter/setter and final
field/setter pairs to be contained in the same builder object, while
still allowing messaging to point to the specific aspect.

UriOffsetLength is furthermore used on ClassMember which improves the
precision of messages from hierarchy checks.

Change-Id: I0776c8b66177164e326d3fb61e32a7620955f4c7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/429961
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2025-05-22 01:52:32 -07:00
Stephen Adams b00c777f79 [dart2js] allow-cse and allow-dce annotations
Add `@pragma('dart2js:allow-cse')` and `@pragma('dart2js:allow-dce')`.

These annotations allow the compiler to do common subexpression
elimination and dead code elimination on calls to getters and methods.

Change-Id: Ie4091466e4782a4d28a7f9bfbfdb60a5de45a384
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/426360
Reviewed-by: Nate Biggs <natebiggs@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2025-05-21 23:02:06 -07:00
Nate Biggs e688981385 [ddc] Fix capture issue with temp names within async scopes.
`needsCapture` will ensure that any variables used within an async scope get included in the 'asyncScope' object that's created for that scope.

The variables used to lower Dart late variables in particular get emitted separately. But they can still be used across async scopes so they need the special capture logic as well.

Bug: https://github.com/dart-lang/sdk/issues/60748
Change-Id: I2486fce41f88f186fd799029c2cc59635f7ad8f5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/429780
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Nate Biggs <natebiggs@google.com>
2025-05-21 17:49:22 -07:00
Sam Rawlins 7a4c651eb3 analyzer: Rename 'errorCode' parameters in ErrorReporter
Work towards https://github.com/dart-lang/sdk/issues/60635

Change-Id: I4a3d320585967a4d2e8cbed430d2a67aa3f905fb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/430040
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2025-05-21 16:12:59 -07:00
Konstantin Shcheglov efa2870f43 Fine. Fix for checking requirements of re-exports.
Change-Id: I1a2e8302e5534fe8d77d3f8d7964d0626835e727
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/430124
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2025-05-21 14:48:40 -07:00