Commit graph

97138 commits

Author SHA1 Message Date
Alexander Aprelev bc5008a023 [benchmark] Add uimatrix benchmark.
https://github.com/yjbanov/uimatrix is WIP, but already proved useful to highlight areas for some performance improvement.

Change-Id: I8f86163e91e276ee4195b7d5c635ffbf3dbaa075
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/325320
Commit-Queue: Alexander Aprelev <aam@google.com>
Reviewed-by: Jonas Termansen <sortie@google.com>
2023-09-13 15:27:37 +00:00
Ryan Macnak 578f95ad2e Roll double-conversion to 032fa6a7d2c319b20d3928f5d762648fa4029acf.
Bug: https://github.com/dart-lang/sdk/issues/47835
Change-Id: I5c2a278071f3c8e704754cc27fdd33a108eaf7dc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/325543
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Daco Harkes <dacoharkes@google.com>
2023-09-13 14:54:27 +00:00
Johnni Winther 36b93f6b08 [cfe] Make ConstantVisitor(1) a pure interface
This splits ConstantVisitor(1) into a pure interface and a
ConstantVisitor(1)DefaultMixin with the base implementation. This is
a step towards avoid having an accidental default implementation where
a static error would have been preferable.

Also removes BodyVisitor1 which was unused.

TEST=existing

Change-Id: I265754e13e0ebcce5c154b16c7ee36854f4ce9fe
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/325400
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Mayank Patke <fishythefish@google.com>
Reviewed-by: Ömer Ağacan <omersa@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2023-09-13 14:02:28 +00:00
Johnni Winther 79ad624ef0 [cfe] Handle extension type constructors and instance methods with the same name
These are supported but there synthesized names conflicted.

TEST=pkg/front_end/testcases/constructor_tearoffs/lowering/constructor_member_conflict.dart

Change-Id: I952907eb83d7e496eb7d53f5c6b67d8f1e87308b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/324680
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
2023-09-13 13:15:20 +00:00
Alexander Thomas b555e71ecd [infra] Bump checked-in SDKs to 3.2.0-150.0.dev
Fixes: https://github.com/dart-lang/sdk/issues/53505
Change-Id: I8c3b83919ad2cbc97e92f1d626c6f9105802d2a7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/325700
Reviewed-by: William Hesse <whesse@google.com>
Commit-Queue: Alexander Thomas <athom@google.com>
2023-09-13 11:42:51 +00:00
Ryan Macnak ea9656ba38 [test] XCode's nm not available on shards that haven't yet run main task.
Change-Id: Ib438cac3acf1842afb4d55a203d1f7a0c91f5918
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/325451
Commit-Queue: Tess Strickland <sstrickl@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
2023-09-13 10:27:59 +00:00
Martin Kustermann 781a8ef9c0 [vm] Mark external methods used in Pointer.asTypedList() with resulting type
It allows the compiler to propagate this information in TFA - which
may be beneficial for cases when those methods aren't inlined.

TEST=ci

Change-Id: I55711806800e2a56e83a42cd51be705b68c3a4f3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/324701
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Tess Strickland <sstrickl@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2023-09-13 09:48:56 +00:00
Nate Biggs 655687db77 [dart2js] Cache deferred JS AST bodies during printing and source map generation.
There was a bug in source map generation introduced by this deferring. A map from JS Nodes to source map info is being shared between these two operations and in order to look up nodes in the map, the Node objects must be the same.

This gives up some but not all of the gains from deferring these function bodies. I'm working on a more long term fix that combines these two passes of the AST.

Bugs: https://github.com/dart-lang/sdk/issues/53466
Change-Id: If25d1b24dd32456155e8802725d480454c71d2b6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/325600
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Nate Biggs <natebiggs@google.com>
2023-09-13 02:35:01 +00:00
Robert Nystrom b35c645302 Roll the latest dart_style into the SDK.
There are a couple of small format changes, but they are minimal
enough that we might not need to land a pre-built SDK with this.

Change-Id: I1d258c8a782e5db24c2048f407a8b7cf7b948eef
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/325580
Auto-Submit: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>
Reviewed-by: Bob Nystrom <rnystrom@google.com>
Commit-Queue: Bob Nystrom <rnystrom@google.com>
2023-09-13 01:44:57 +00:00
pq 293848fd52 fix literal checks for extension type primary constructors
Change-Id: I6d2406b23bdca0639408166129eefacc4fad30a9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/325640
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
2023-09-13 00:18:51 +00:00
Srujan Gaddam 4efb33e128 [dart:js_interop_unsafe] Rename extensions and make []/[]= take String properties
Strings are the most likely use case of getting and setting
properties, and therefore we should make that easier to use.
This CL also renames the extensions in dart:js_interop_unsafe
to a more relevant name and to avoid conflicts in dart:js_interop.

CoreLibraryReviewExempt: Backend-specific library.
Change-Id: Ia8ce6593167c648f9710b47cfe27f80c854be407
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/324572
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Srujan Gaddam <srujzs@google.com>
2023-09-12 23:11:55 +00:00
Ryan Macnak 3a5a7106ee [build] Define DART_SHARED_LIB for elf_loader.cc.
This makes elf_loader.cc consistent with the other compilation units containing Dart_* functions. Addresses a Mac linker warning that these functions match the export glob but have hidden visibility.

TEST=build
Change-Id: I868c9940a7027c466c1173aa2db2fbeff6fe8999
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/325362
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Daco Harkes <dacoharkes@google.com>
2023-09-12 22:42:38 +00:00
Vyacheslav Egorov 5c320a108a [vm/compiler] Improve flow sensitivity of CP
Before running CP find all branches of form `Branch(v eq C)`,
where `eq` is one of `===`, `==`, `!==` or `!=` and `C` is
a constant and insert a redefinition of `v` in the true
successor which captures the information that `v` is equal
to `C` guaranteed by the branch.

SCCP algorithm can then use this information when propagating
constants. After SCCP all redefinitions inserted are removed
again.

We don't actually replace `v` with `C` in the dominated code
because this might lead to issues later, for example
it might result in redundant phis `phi(C, v)` (`C` flowing
from a predecessor where `v == C`) which are complicated
to eliminate again.

TEST=vm/dart/comparison_canonicalization_il_test

Cq-Include-Trybots: luci.dart.try:vm-aot-linux-release-x64-try,vm-aot-linux-debug-simarm_x64-try,vm-aot-linux-debug-x64-try,vm-aot-android-release-arm64c-try
Change-Id: I388dddb97b5e35f09d9904000c585864f27400f6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/324980
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Slava Egorov <vegorov@google.com>
2023-09-12 22:39:25 +00:00
DEPS Autoroller 16cc32f0ec Roll gn from e3978de3e8da to 991530ce394e
If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/gn-dart-sdk
Please CC dart-ecosystem-gardener@grotations.appspotmail.com,dart-engprod@google.com on the revert to ensure that a human
is aware of the problem.

To file a bug in gn: https://bugs.chromium.org/p/gn/issues/list
To file a bug in Dart SDK: https://github.com/dart-lang/sdk/issues

To report a problem with the AutoRoller itself, please file a bug:
https://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md

Cq-Include-Trybots: luci.dart.try:dart-sdk-linux-try;luci.dart.try:dart-sdk-mac-try;luci.dart.try:dart-sdk-mac-arm64-try;luci.dart.try:dart-sdk-win-try
Change-Id: If061efacb379bc27e1dd246036f2174e42425646
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/325462
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Brian Quinlan <bquinlan@google.com>
2023-09-12 22:24:55 +00:00
Sam Rawlins 10da52b016 linter: Move sized_box_shrink_expand tests
Change-Id: I8fccc19af7ed2895b710e00feae3145e6ff8e401
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/325480
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Auto-Submit: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
2023-09-12 22:16:59 +00:00
Konstantin Shcheglov eeebd36a42 Augment. Use AugmentableElement<T> to share implementation.
Change-Id: Iccd84409eb198995e1a0e014cfb3d706fba99675
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/325542
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2023-09-12 22:16:52 +00:00
pq 3a24a90cdd add a primaryConstructor getter to ExtensionTypeElements
Change-Id: Ib77fb3caebe2039062063ad75f56947f07487fa8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/325446
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
2023-09-12 21:47:33 +00:00
Devon Carew 4722e4deca [deps] rev dartdoc, ecosystem, http, native, test, tools, webdev
Revisions updated by `dart tools/rev_sdk_deps.dart`.

dartdoc (f5750f5..dd28f4c):
  dd28f4ce  2023-09-11  dependabot[bot]  Bump actions/cache from 3.3.1 to 3.3.2 (#3497)
  2ac7e323  2023-09-11  dependabot[bot]  Bump actions/upload-artifact from 3.1.2 to 3.1.3 (#3496)

ecosystem (2e6c3ec..e96fbdb):
  e96fbdb  2023-09-12  Moritz  Try a fix for the health check socket issues (#164)
  4cc5005  2023-09-11  Alexander Thomas  Add missing license header to license.dart (#166)
  3fbab6c  2023-09-10  Moritz  Fix boolean condition in `publish.yaml` (#163)

http (7fb6fd6..de19214):
  de19214  2023-09-12  Sam Rawlins  Avoid passing a nullable value to Completer<nn-type>.complete (#1015)

native (a2dfedc..5177659):
  5177659  2023-09-12  Daco Harkes  [native_assets_builder] Speedup builds for 0 or 1 packages with native assets (#129)
  7f30f4b  2023-09-12  Daco Harkes  [native_assets_builder] Take packageLayout for build and dryRun (#127)
  a7cd31e  2023-09-12  Daco Harkes  `PackageLayout` constructor for already parsed `PackageConfig` (#126)
  9f24b64  2023-09-11  Daco Harkes  [native_toolchain_c] Fix MSVC x86 toolchain resolution (#124)
  07e1de5  2023-09-06  Daco Harkes  Reenable example on CI + roll dep (#122)
  387f894  2023-09-06  Gabriel Terwesten  [native_toolchain_c] Default handling for PIC/PIE compiler flags (#121)
  0a4e5f8  2023-09-06  Gabriel Terwesten  Add support for defines to `CBuilder` (#120)

test (27dcae1..6449495):
  64494959  2023-09-11  Jacob MacDonald  skip failing wasm tests (#2091)
  83ae0d9f  2023-09-07  Jacob MacDonald  Fix running browser tests that use deferred loading (#2090)

tools (2c8cbd6..fa01f9b):
  fa01f9b  2023-09-11  Elias Yishak  `--disable-telemetry` --> `--disable-analytics` (#145)

webdev (9487a45..6b21ecf):
  6b21ecf0  2023-09-11  dependabot[bot]  Bump actions/labeler from 4.2.0 to 4.3.0 (#2177)
  78a5fece  2023-09-11  Sam Rawlins  Avoid passing a nullable value to Future<nn-type>.value or Completer<nn-type>.completer. (#2205)
  6f282432  2023-09-11  Parker Lougheed  [webdev] Hide `--null-safety` option (#2206)
  1c5a7bc7  2023-09-11  Parker Lougheed  Replace deprecated lints (#2208)
  f0656b4a  2023-09-11  Parker Lougheed  Fix a few minor spelling mistakes (#2209)
  158223b2  2023-09-11  Parker Lougheed  Update old dartlang.org links to new .dev equivalents (#2210)
  a8d114c5  2023-09-11  Elliott Brooks  Update the comment for lookupResolvedPackageUris
  76e050c6  2023-09-11  Elliott Brooks  Clear the map of relative URIs on DartUri.clear()
  38a17ced  2023-09-11  dependabot[bot]  Bump dart-lang/setup-dart from 1.3.0 to 1.5.0 (#2212)
  cca9e56d  2023-09-11  Elliott Brooks  Reset Webdev after release (#2227)
  824dcef7  2023-09-11  Elliott Brooks  Reset DWDS after release (#2225)
  45c09a80  2023-09-08  Elliott Brooks  Prepare Webdev for release to 3.0.8 (#2224)
  805d3b7e  2023-09-08  dependabot[bot]  Bump actions/cache from 3.2.2 to 3.3.2 (#2223)
  85d4e760  2023-09-08  Elliott Brooks  Prepare DWDS for release to version 21.0.0 (#2221)
  a3757f06  2023-09-08  Anna Gringauze  Run monorepo generate (#2222)
  c991e85a  2023-09-07  dependabot[bot]  Bump actions/checkout from 3.2.0 to 4.0.0 (#2219)
  9851c23c  2023-09-07  Parker Lougheed  Update SDK constraints for Dart 3.0 and 3.1 stable releases (#2207)

Change-Id: I0caf74af171916d30eb8ee2ab78c15acaebaa229
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/325560
Auto-Submit: Devon Carew <devoncarew@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Devon Carew <devoncarew@google.com>
2023-09-12 20:27:57 +00:00
Alexander Markov 3ec9cc86c8 [pkg/vm] Bump language version to 3.0 and cleanup experimental flags
Minimum SDK version is increased in order to be able to use Dart 3.0
language features in pkg/vm.

TEST=ci

Change-Id: I4ef1139b2f8ba8acc7dbcf9bc0fe77f663cc427d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/325541
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2023-09-12 20:18:59 +00:00
Jackson Gardner 67f0d4daf0 Revert "[dart2wasm] Replace struct.new_default with struct.new for object"
This reverts commit 5a4b252252.

Reason for revert: Causing Flutter engine unit test failures, see https://github.com/dart-lang/sdk/issues/53506

Original change's description:
> [dart2wasm] Replace `struct.new_default` with `struct.new` for object
> allocation.
>
> When using the `struct.new_default` instruction for object allocation,
> fields are always nullable and mutable. By using the `struct.new`
> instruction instead, class fields can now have the same mutability and
> nullability in Wasm as declared in Dart. In addition, the class ID and
> type parameters (which are also stored in an object's struct), can now
> be immutable and nonnullable as well.
>
> To do this, object construction is now split into three functions:
> (1) Initializer: evaluates initializers for instance fields and
> constructor initializers (this constructor before super constructor).
> (2) Constructor body: executes the constructor body (super constructor
> before this constructor), with `this` pointed to the constructed object.
> (3) Constructor allocator: which calls (1), allocates the object using
> `struct.new`, then calls (2).
>
> Because fields now have the correct mutability and nullability in Wasm,
> this removes unnecessary null checks for nonnullable fields, and may
> allow for better optimisations by Binaryen.
>
> Fixes https://github.com/dart-lang/sdk/issues/51492
>
> Change-Id: Ib26046686f772a70509a870301217e9b1c91b77e
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/315820
> Commit-Queue: Jess Lally <jessicalally@google.com>
> Reviewed-by: Aske Simon Christensen <askesc@google.com>

Change-Id: I034d3acf3715abadc6811a7393ba780bee974329
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/325445
Commit-Queue: Martin Kustermann <kustermann@google.com>
Commit-Queue: Jackson Gardner <jacksongardner@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2023-09-12 20:16:56 +00:00
Sam Rawlins 45930e3d62 linter: Mark use_build_context_synchronously stable
Fixes https://github.com/dart-lang/linter/issues/3915



Change-Id: I4909b6440859174852f85084fef4c847f0f46a94
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/325365
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2023-09-12 19:50:09 +00:00
Sam Rawlins cdf016c6ab analyzer: Support animation doc directive; refactor classes
Work towards https://github.com/dart-lang/sdk/issues/52705

Change-Id: Idc77bf866beace85b40b30d464ff4c7c62e19735
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/325360
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2023-09-12 19:40:38 +00:00
pq ba70bed261 @literal support for extension types
See: https://github.com/dart-lang/sdk/issues/53434

Change-Id: I2668b74e2037176d0ac6e6da22300be29ba14d8d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/325444
Commit-Queue: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2023-09-12 19:04:19 +00:00
Kenzie Schmoll 83b27b8bcf Add a retry to the DevTools handler for static files
Change-Id: Iced8093f894afd5574e3ae898e07f237e02002bf
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/325323
Reviewed-by: Derek Xu <derekx@google.com>
Commit-Queue: Kenzie Davisson <kenzieschmoll@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
2023-09-12 18:52:01 +00:00
Brian Quinlan f0632629c3 [io/doc]: Provide more references to SocketOption.tcpNoDelay.
Bug: https://github.com/dart-lang/sdk/issues/52102
Change-Id: I759735acfb0a67a3c0e359d6cf4c0ecab97c6c2a
CoreLibraryReviewExempt: doc-only change
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/325443
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Brian Quinlan <bquinlan@google.com>
2023-09-12 18:15:08 +00:00
Sam Rawlins 252bfcb27a Move UNIGNORABLE_IGNORE from HintCode to WarningCode
Work towards https://github.com/dart-lang/sdk/issues/50796

Change-Id: Idb8d04eb07beeb4f201ca69d0543d85305d62ea8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/325127
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Auto-Submit: Samuel Rawlins <srawlins@google.com>
2023-09-12 17:26:29 +00:00
Ryan Macnak df54b81dd1 [vm] Remove dead ARMv5 code.
TEST=build
Change-Id: I44b41bb783b5f5cad221d4508fee18ff0a23afe7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/325144
Reviewed-by: Zach Anderson <zra@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Reviewed-by: William Hesse <whesse@google.com>
2023-09-12 16:22:19 +00:00
Johnni Winther df89d602ee [cfe] Make TypeDeclarationBuilder and DeclarationBuilder sealed
Change-Id: I4f61e6ff41bb7505b22c3449f92088ca9f353e41
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/324060
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2023-09-12 12:23:33 +00:00
Vyacheslav Egorov 1a0e5dea69 [vm/service] Handle raw types in CollectStringifiedType
This function did not handle raw types correctly: it assumed that
TAV is always non-null, but VM replaces TAVs of form
`<dynamic, ..., dynamic>` with `null`. We needed to handle
this case specially.

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

TEST=service/evaluate_variable_of_raw_type_test

Change-Id: If0a2669fd722fb0e0871138a68814a751888f4b0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/325420
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Commit-Queue: Slava Egorov <vegorov@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Auto-Submit: Slava Egorov <vegorov@google.com>
2023-09-12 12:09:06 +00:00
Lasse R.H. Nielsen c15f054809 Hide the existence of EfficientLengthIterable better.
The `EfficientLengthIterable` is an internal marker interface
that allows the SDK to more efficiently check, effectively,
`v is List || v is Set || v is Queue`, and some other
known internal types, which allows it to assume that `.length`
is efficient and doesn't iterate the iterable.

It's not intended for external use, but the current design
both has the name mentioned specifically in the declaration
of the public types `List`, `Set` and `Queue`,
and possibly allows the type to leak through the
least-upper-bound algorithm.

This change moves the mention of `EfficientLengthIterable`
from the public types to an anonymously named private type,
and ensures that the private type is never the result of
a least-upper-bound computation, by adding another
interface with the same depth that all the public
types implementing `EfficientLengthIterable` also implement.

(A longer term solution to `EfficientLengthIterable` looking
like it's a public name could be combining the collection-
related code from `dart:collection`, `dart:core` and
`dart:_internal` into a single `dart:_collection_impl`,
and exporting the relevant types from there. Then
we could make the interface be `_EfficientLengthIterable`
again.)

Change-Id: I717743f0ca253782162be0ad9ff05036fdf57159
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/322320
Reviewed-by: Nate Bosch <nbosch@google.com>
Reviewed-by: Slava Egorov <vegorov@google.com>
Reviewed-by: Aske Simon Christensen <askesc@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Lasse Nielsen <lrn@google.com>
2023-09-12 11:08:42 +00:00
Johnni Winther f7090efca0 [analyzer] Ensure converted errors are reported
This adds an assert to `FastaErrorReport.reportByCode` to help avoid
missing errors because the parser error was accidentically ignored.

Special-casing is added for the messages currently skipped but
reported elsewhere.

Change-Id: I3944569bb858a1956b91c3343a4e982882afb803
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/323180
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2023-09-12 09:17:57 +00:00
Sergey G. Grekhov 05d04c79f9 [co19] Roll co19 to 5b9b08fb3210ee83a92ab4afe2268326761dd9a9
2023-09-08 sgrekhov22@gmail.com Fixes dart-lang/co19#970. Don't use Process.kill() to exit a process (dart-lang/co19#2266)
2023-09-08 sgrekhov22@gmail.com dart-lang/co19#2258. Reapply review changes (dart-lang/co19#2267)
2023-09-08 sgrekhov22@gmail.com dart-lang/co19#2258. Update private fields promotion tests according to the new spec. Part 1 (dart-lang/co19#2263)
2023-09-08 sgrekhov22@gmail.com dart-lang/co19#1400. Add late instance variable test (dart-lang/co19#2264)
2023-09-06 sgrekhov22@gmail.com dart-lang/co19#1400. Add promotion of a representation variable test (dart-lang/co19#2262)
2023-09-05 sgrekhov22@gmail.com dart-lang/co19#2258. Rename and reorder private fields promotion tests (dart-lang/co19#2260)
2023-09-05 sgrekhov22@gmail.com dart-lang/co19#2258. Update assertions of private fields promotion tests. Add new ones (dart-lang/co19#2259)

Change-Id: I905f37237a432fa5a6488dbfc4bdddd45cf6c91b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/325220
Reviewed-by: Alexander Thomas <athom@google.com>
2023-09-12 08:44:26 +00:00
Vyacheslav Egorov 7ff975c2e5 [vm/compiler] Fix InferredTypeMetadata::IsTrivial
`IsTrivial` is supposed to return true iff `ToCompileType` would
produce a trivial (dynamic) type. However `IsTrivial` was taking
some of the irrevant parts of the `InferredTypeMetadata` into
account - meaning that it returned `false` where it should have
returned `true`.

This lead us to assign useless `dynamic` result type to various `StaticCall`, some of these calls can later be lowered to
`LoadIndexed` instructions, which will then also get the `dynamic`
result type. This useless type will then take priority over more
precise element type which could be inferred by
`LoadIndexedInstr::ComputeType`

TEST=vm/dart/load_indexed_trivial_type_il_test

Cq-Include-Trybots: luci.dart.try:vm-aot-linux-release-x64-try,vm-aot-linux-debug-simarm_x64-try,vm-aot-linux-debug-x64-try,vm-aot-android-release-arm64c-try
Change-Id: I69ee965ba0d0ac85ede3989680371f0dda19d8a9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/325302
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Slava Egorov <vegorov@google.com>
2023-09-12 08:13:12 +00:00
Jens Johansen cef9865586 [CFE/DDC] Fix leak caused by cached diagnosticReporter
In 8f4e5c8194 the `DiagnosticReporter` was cached in
`DevCompilerTarget` which introduced a memory leak.
Unfortunately our weekly bot that looks for leaks has been out of
commission, but is now coming back online.

This CL fixes the leak by overwriting the field every time, meaing we
don't save a reference to the first one (which is a leak).
Maybe ideally we shouldn't save it as a field at all, but that's a
potential for another day.

Change-Id: Ic740a212c436c475688a1de73c55a2344301e688
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/325260
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2023-09-12 06:11:28 +00:00
Zijie He 5282f6e33f [Fuchsia] Create CFv2 support
This change created a CFv2 build target and provided two
implementations of the FuchsiaEmulator, so that I can continually work
on both CFv2 build and test script integration independently.

The v2 target can be built with
```
tools/build.py --os fuchsia --mode release fuchsia_ffi_test_package_cfv2
```
And v2 FuchsiaEmulator implementation can be triggered with
FUCHSIA_CFV2 environment variable.

Bug: #38752
Change-Id: I31936a2ca967fbfeb2bc5628e2f005aef6762687
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/322583
Reviewed-by: Alexander Thomas <athom@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Zijie He <zijiehe@google.com>
2023-09-12 01:40:52 +00:00
Sam Rawlins 6f5606d442 Bump dartdoc to f5750f502fdbb887c93cd29aca1e573a92342c53
Change-Id: Iea45fb207114d9284fdba65857cea23f877c3b4d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/325321
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2023-09-12 00:31:40 +00:00
Sam Rawlins 84655ea85d analyzer: Move FileSystemEntity methods to FileSystemEntity
Change-Id: I029203dbca21e96e5e57d2b347b9577223d32b84
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/325324
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Auto-Submit: Samuel Rawlins <srawlins@google.com>
2023-09-11 23:54:30 +00:00
Kallen Tu f2e11bdeee [analyzer] Allow spreads between const lists and sets in the const evaluator
The change allows const lists to be in the spread of a const set and vice-versa. It also reports the correct error if we use a map in a list/set (and vice-versa) which is necessary when we combine all the error reporting in the `ConstantVisitor` to one location.

Adds some additional tests to make sure the behaviour we want is still working.

Change-Id: I0f64d58c857bd905ac8521346cd34a113b6d4a40
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/323780
Commit-Queue: Kallen Tu <kallentu@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2023-09-11 23:39:30 +00:00
Keerti Parthasarathy 4a04ec3201 Wire up use of deprecated export.
Bug:48997
Change-Id: I440fb8ebfe63ae785571f7927c5cdab625eee0cb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/325363
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Commit-Queue: Keerti Parthasarathy <keertip@google.com>
2023-09-11 23:24:19 +00:00
Sam Rawlins 02dba4189f linter: Move prefer_foreach tests
Change-Id: I0a6beae9d4983c8bef3445b569fc163c41f66faa
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/325361
Commit-Queue: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Auto-Submit: Samuel Rawlins <srawlins@google.com>
2023-09-11 23:17:30 +00:00
pq 2f90ee8cf1 validate @visibleForOverriding extension type targets
See: https://github.com/dart-lang/sdk/issues/53434

Change-Id: I931a7cdff990ca19f6ec3267340031ca5fa7b814
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/325322
Commit-Queue: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2023-09-11 23:16:10 +00:00
Liam Appelbe d5555377ed Add changelog entry for NativeCallable
Bug: https://github.com/dart-lang/sdk/issues/53322
Change-Id: I458ea1a920f68e3de23008649748a24602bb5e0e
Fixes: https://github.com/dart-lang/sdk/issues/53322
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/324180
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Liam Appelbe <liama@google.com>
Auto-Submit: Liam Appelbe <liama@google.com>
2023-09-11 22:25:06 +00:00
Tess Strickland 3f53d22d43 [vm/compiler] Create leaf runtime entry for memmove.
Instead of making a StaticCall to _TypedListBase.nativeSetRange
inside _memMoveN, make a CCall to the memmove leaf runtime entry.

Rename _TypedListBase._nativeSetRange to _setClampedRange, since
it's now only used when per-element clamping is necessary.

Fix the load optimizer so that loads of unboxed fields from freshly
allocated objects do not have the tagged null value forwarded
as their initial post-allocation value.

TEST=co19{,_2}/LibTest/typed_data lib{,_2}/typed_data
     corelib{,_2}/list_test
     vm/cc/LoadOptimizer_LoadDataFieldOfNewTypedData

Issue: https://github.com/dart-lang/sdk/issues/42072
Change-Id: Ib82e24a5b3287fa53099fffd3b563a27d777507e
Cq-Include-Trybots: luci.dart.try:vm-aot-linux-debug-simarm_x64-try,vm-aot-linux-debug-x64-try,vm-aot-linux-debug-x64c-try,vm-kernel-linux-debug-x64-try,vm-kernel-precomp-linux-debug-x64-try,vm-linux-debug-x64-try,vm-linux-debug-x64c-try,vm-mac-debug-arm64-try,vm-aot-linux-release-simarm_x64-try,vm-aot-linux-release-x64-try,vm-aot-mac-release-arm64-try,vm-aot-msan-linux-release-x64-try,vm-msan-linux-release-x64-try,vm-aot-tsan-linux-release-x64-try,vm-tsan-linux-release-x64-try,vm-linux-release-x64-try,vm-mac-release-arm64-try,vm-kernel-precomp-linux-release-x64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/324080
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Tess Strickland <sstrickl@google.com>
2023-09-11 21:25:09 +00:00
Brian Quinlan 8a91749e42 Fix parsing of folded header field values.
Bug: https://github.com/dart-lang/sdk/issues/53227
Bug: https://github.com/dart-lang/sdk/issues/53185
Change-Id: Ibbdbdf9c8f2875e8f687244982810fffee20e69c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/320920
Commit-Queue: Brian Quinlan <bquinlan@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
2023-09-11 21:13:58 +00:00
Ryan Macnak a4381f127c [vm, lib] Fix out-of-bounds access in BigInt.>>.
The library code and the intrisic code disagreed about the capacity of the result digits array. Compare similar adjustment for <<.

TEST=ci
Change-Id: I81395a242965d53de3a30f87637a6f1588300969
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/325122
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
2023-09-11 21:05:38 +00:00
Nicholas Shahan 1cce9b8052 [ddc] Avoid adding raw type parameters to type table
There is no need to add a single type parameter to the type table
because it is already represented as a local variable in the scope
where it appears.

Change-Id: I4553d54304a2e3b82e856b8511fdce81cda0653e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/324901
Reviewed-by: Mark Zhou <markzipan@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
2023-09-11 21:00:47 +00:00
Jackson Gardner db214e8c81 Revert "[dart:js_interop] Re-enable type checks on external APIs"
This reverts commit 2a669c571f.

Reason for revert: Failing dart -> Flutter Engine roller. We need to make some changes on the engine side to prepare for re-enabling these checks.

Original change's description:
> [dart:js_interop] Re-enable type checks on external APIs
>
> External APIs when using dart:js_interop should only allow
> primitives, JS types, and other static interop types. This
> was previously checked in a more restrictive mode called
> "strict mode" but is not checked everywhere where dart:js_interop
> APIs exist.
>
> Change-Id: Ic82a3ec0bf6062c25d7f8933e503820a21bc191f
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/316867
> Reviewed-by: Sigmund Cherem <sigmund@google.com>
> Commit-Queue: Srujan Gaddam <srujzs@google.com>

Change-Id: I54caf06976e215b2b576cedfc0013ee79c6682f6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/324902
Commit-Queue: Srujan Gaddam <srujzs@google.com>
Reviewed-by: Srujan Gaddam <srujzs@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
2023-09-11 19:31:20 +00:00
Konstantin Shcheglov c47f1b02ab Augmentation. Support for top-level functions.
Change-Id: I5fff9739c8159678b63a393d5d4c00f55b45a007
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/325125
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2023-09-11 19:08:12 +00:00
Nicholas Shahan 20c8756bc8 [ddc] Bump pubspec SDK constraint to 3.0.0
Update abstract classes into proper mixins since that how they are
used.

Change-Id: I8ce43f873a2aacab48d859de633f531f091e58e6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/325143
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Mayank Patke <fishythefish@google.com>
2023-09-11 19:07:02 +00:00
Danny Tuppeny ccbc3d95dc [analysis_server] Add additional tests for file delete/create with overlays
Change-Id: Iec6a158f394611a84bce6e4bf107039fbf82241e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/325340
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2023-09-11 18:26:15 +00:00