Commit graph

98990 commits

Author SHA1 Message Date
Nate Biggs ef75007c2f [dart2js] Fix as-check type registration.
We would expect failing as checks to throw in all modes (unless --omit-as-casts is provided). However, the new test program fails in production mode. This is because we are not registering the type usage of the function's type parameter. This leads us to drop the as check completely later on.

We should be doing subtype checks with nullability if we want to consider an as test omitted.

Golem patch results: https://golem.corp.goog/Comparison?repository=dart#targetA%3Ddart2js%3BmachineTypeA%3Dlinux-x64%3BrevisionA%3D107840%3BpatchA%3Dnatebiggs--dart2js--Fix-as-check-type-registration.-7%3BtargetB%3Ddart2js%3BmachineTypeB%3Dlinux-x64%3BrevisionB%3D107839%3BpatchB%3DNone

Fixed: https://github.com/dart-lang/sdk/issues/54419
Change-Id: If93f78a939a690f05f5398c1a5ca971df1fc9243
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/343821
Reviewed-by: Mayank Patke <fishythefish@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Nate Biggs <natebiggs@google.com>
2024-01-09 00:04:50 +00:00
Ryan Macnak 49aef32322 [infra] Add configuration for vm-aot-win-debug-x64.
Bug: https://github.com/dart-lang/sdk/issues/54206
Change-Id: I8d4f2e9cc1aebd747cf35e63dc72c4bf9aa80297
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/340060
Reviewed-by: Alexander Thomas <athom@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2024-01-08 23:26:19 +00:00
Ömer Sinan Ağacan 604b6cda13 [dart2wasm] Refactor variable initializer usage
Previously `VariableDeclaration.initializer` was sometimes not null even
when a function parameter is required.

[1] fixes this, which breaks dart2wasm. This CL prepares `initializer`
usage in prep for [1].

[1]: https://dart-review.googlesource.com/c/sdk/+/345240/1

Change-Id: Ie16156d01eb3659719f004996adce7acc3511b12
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/345300
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2024-01-08 21:46:32 +00:00
Konstantin Shcheglov 0a1e59738d Simplify ResolutionTest.assertParsedNodeText()
Change-Id: Icdc7f5edd9a133d95083995860732815085471ee
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/345343
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2024-01-08 21:39:52 +00:00
Konstantin Shcheglov 5391dda614 Remove old AnalysisDriverTest, and BaseAnalysisDriverTest.
They existed for 7+ years, but now its time to remove them :-)

The remaining tests were covering not AnalysisDriver specific cases,
mostly constants, type inference, and resolution. These are already
covered by specific test classes.

Change-Id: Ie203c5358ee63e59b6aea3381c58a25e2a5ebcb8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/345342
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
2024-01-08 21:32:28 +00:00
Konstantin Shcheglov f620836be2 Extension type. Issue 54293. Don't refine binary operation type if the invoked method is from ExtensionTypeElement.
Bug: https://github.com/dart-lang/sdk/issues/54293
Change-Id: Ib23cfe2ff150ef34ad47b78444406d86bc4ddb0c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/345360
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2024-01-08 21:31:49 +00:00
pq f5de72732d Remove deprecated updateAnalysisOptions
Change-Id: I104f2f5ecc8e902a085f6e7830bb256949d98e32
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/344920
Commit-Queue: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2024-01-08 21:05:29 +00:00
Devon Carew 315f78efe1 [deps] rev matcher, mockito, test
matcher (fcbd361..d9cf4f6):
  d9cf4f6  2024-01-01  dependabot[bot]  Bump actions/stale from 8.0.0 to 9.0.0 (#240)
  7ea9047  2023-12-13  Kevin Moore  Update test_api dependency, bump & fix lints, prepare release (#237)
  050fdda  2023-12-13  Kevin Moore  blast_repo fixes (#238)

mockito (57a7c82..e15e000):
  e15e000  2023-12-14  Sam Rawlins  Bump mockito to 5.4.4
  a2a6566  2023-12-14  Copybara-Service  Merge pull request #726 from provokateurin:chore/deps/test_api-0.7
  bda332c  2023-12-14  jld3103  chore(deps): Allow test_api 0.7
  9bd6fb0  2023-12-12  Paul Berry  Remove mockito pre-null-safety tests.

test (43ff5bf..846d73e):
  846d73ee  2024-01-01  dependabot[bot]  Bump actions/upload-artifact from 3.1.3 to 4.0.0 (#2165)
  0ab56790  2024-01-01  dependabot[bot]  Bump actions/stale from 8.0.0 to 9.0.0 (#2167)
  3b960c3e  2024-01-01  dependabot[bot]  Bump github/codeql-action from 2.22.8 to 3.22.12 (#2166)
  30543cae  2023-12-19  Nate Bosch  Add more logging around iframe startup (#2160)
  e56a5e22  2023-12-13  Jacob MacDonald  small cleanup in catch (#2159)
  15b39372  2023-12-13  Jacob MacDonald  handle missing package config files (#2158)
  9667cca8  2023-12-13  Jacob MacDonald  release test_api 7.0.0, test_core 6.0.0, and test 1.25.0 (#2156)
  b3fb1486  2023-12-13  Nate Bosch  Remove support for Internet Explorer (#2114)
  48a2bc3d  2023-12-13  Derek Xu  Update the package:vm_service constraint to allow version 14.x (#2157)

Change-Id: I386444652c47cd14a61665599d86dc3a7669a2fc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/345341
Reviewed-by: Nate Bosch <nbosch@google.com>
Commit-Queue: Devon Carew <devoncarew@google.com>
2024-01-08 19:48:49 +00:00
Devon Carew cc8ebc636a Bump leak_tracker to 3d4c0d6db7d56af5fe52d6729ef373a3ec4de65b
Changes:
```
> git log --format="%C(auto) %h %s" 8644f8b..3d4c0d6
 https://dart.googlesource.com/leak_tracker.git/+/3d4c0d6 Fix `labeler.yml` (202)
 https://dart.googlesource.com/leak_tracker.git/+/4efea69 Bump actions/labeler from 4.3.0 to 5.0.0 (200)
 https://dart.googlesource.com/leak_tracker.git/+/e52329c Add global enabler to LeakTesting. (197)
 https://dart.googlesource.com/leak_tracker.git/+/c71a905 Standardize lints to dart_flutter_team_lints (198)
 https://dart.googlesource.com/leak_tracker.git/+/8393a23 Cleanup leak_tracker. (195)
 https://dart.googlesource.com/leak_tracker.git/+/f88cb6a Remove declaration of testWidgetsWithLeakTracking. (194)
 https://dart.googlesource.com/leak_tracker.git/+/f361ed8 Update `vm_service` dependency to `>=11.0.0 <15.0.0` (193)
 https://dart.googlesource.com/leak_tracker.git/+/106bd2b Add API to integrate with testWidgets. (188)
 https://dart.googlesource.com/leak_tracker.git/+/a9966d2 Increase delay to fix flakiness of integration test related to memory snapshotting. (191)

```

Diff: https://dart.googlesource.com/leak_tracker.git/+/8644f8b1c78009e9149e08e0c349d06c304110a9..3d4c0d6db7d56af5fe52d6729ef373a3ec4de65b/
Change-Id: Iddb323c4c45062393ccb170f01a03b48742d4280
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/344541
Reviewed-by: Polina Cherkasova <polinach@google.com>
Auto-Submit: Devon Carew <devoncarew@google.com>
Commit-Queue: Polina Cherkasova <polinach@google.com>
2024-01-08 19:34:52 +00:00
pq 3224637bb1 Reland "options map support scaffolding in driver" (with a re-introduced optional analysisOptions param)
This is a reland of commit 717ce7a69c with a slight modification to `AnalysisDriver` to allow Google3 clients to pass an analysisOptions object in.

The logic to accommodate this is only temporary and will go away as soon as I can update clients to use an options map instead.




Original change's description:
> options map support scaffolding in driver
>
> Konstantin and I chatted a bit about this so at least some of it shouldn't be too surprising to him but please do feel free to grab me to chat.
>
> That said a few pointers would be handy. Notably, this change:
>
> * introduces a new `SharedOptionsOptionsMap` for use in SDK drivers (and preserve current semantics)
>   * this is currently public but will be private once driver is more evolved to accommodate multiple options files
> * removes the shared `_analysisOptions` from the analysis driver with a baby step to using the one shared in SharedOptionsOptionsMap
> * removes context_builder and collection v2 experiments (and tests)
>   * I'll harvest some more functionality from these in future changes but for now they're distracting and hard to maintain
>
> This work is all to setup moving analysis options awareness into file state objects which will allow us to remove `sdkVersionConstraint` info from options (finally) and a host of other good stuff (see https://github.com/dart-lang/sdk/issues/54124).
>
>
>
> Change-Id: Ic4278184016d1018b4b5b1c6ac5ba9e2546927a5
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/344860
> Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
> Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
> Commit-Queue: Phil Quitslund <pquitslund@google.com>

Change-Id: Iac9c4eb1aa448f2ca44e32dfb6cdf7cf765b6027
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/344944
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
2024-01-08 19:31:21 +00:00
Konstantin Shcheglov cee5fac576 Make 'hasFilesToAnalyze' private, remove tests.
It is used only internally by the scheduler, and we observe its effect
by seeing results and/or transitions to analyzing/idle.

Change-Id: If79f2e3e36b48f66c1f1fb5e94db46bad3bb815b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/345340
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2024-01-08 19:26:49 +00:00
Konstantin Shcheglov 50cb67023f Extension type. Use 'extensionTypeErasure' for relational pattern argument check.
This should make these tests to pass.
co19/LanguageFeatures/Extension-types/exhaustiveness_relational_A01_t01
co19/LanguageFeatures/Extension-types/exhaustiveness_relational_A01_t03

Change-Id: Ic7550131a69636b8d58613f96be06e8b87fc473f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/345082
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2024-01-08 19:23:18 +00:00
Konstantin Shcheglov 8d3b6ce54c Use flattenedToList/flattenedToSet instead of generic expand().
It is faster.

[expand: 102]
[flattened: 131]
[flattened2: 37]

import 'package:collection/collection.dart';

main() {
  const outerLength = 100;
  const innerLength = 10;
  final listOfLists = List.generate(outerLength, (i) {
    return List.generate(innerLength, (j) => i * innerLength + j);
  });

  for (var i = 0; i < 10; i++) {
    f(listOfLists);
  }
}

void f(List<List<int>> listOfLists) {
  const repeatCount = 10000;

  {
    final timer = Stopwatch()..start();
    for (var i = 0; i < repeatCount; i++) {
      listOfLists.expand((e) => e).toList();
    }
    print('[expand: ${timer.elapsedMilliseconds}]');
  }

  {
    final timer = Stopwatch()..start();
    for (var i = 0; i < repeatCount; i++) {
      listOfLists.flattened.toList();
    }
    print('[flattened: ${timer.elapsedMilliseconds}]');
  }

  {
    final timer = Stopwatch()..start();
    for (var i = 0; i < repeatCount; i++) {
      listOfLists.flattened2.toList();
    }
    print('[flattened2: ${timer.elapsedMilliseconds}]');
  }
}

extension ListListExtensions<T> on List<List<T>> {
  Iterable<T> get flattened2 {
    return [
      for (final elements in this) ...elements,
    ];
  }
}

Change-Id: I0bf9dc0c8735fe62aab69cbce276254e2db110f9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/345202
Reviewed-by: Jacob Richman <jacobr@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2024-01-08 18:55:48 +00:00
Zijie He 882e883be2 [Fuchsia] Remove product.experimental
The SDK version is way ahead of https://fxrev.dev/841540 and the config
is not necessary anymore.

https://github.com/dart-lang/sdk/issues/38752
Change-Id: Ic8de02bdbb7b2c88ce742d39bce686c00fd97d8e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/344440
Reviewed-by: Alexander Thomas <athom@google.com>
Commit-Queue: Zijie He <zijiehe@google.com>
2024-01-08 18:54:43 +00:00
Konstantin Shcheglov b5b4cf872f Move more AnalysisDriver tests to DriverEventCollector.
Change-Id: I52715322580c36090104f295276cd071733d6e6a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/344945
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2024-01-08 17:38:39 +00:00
Nate Biggs 5229eabddf Update tests to pass in web/production mode.
Change-Id: Ibea6022fcdd0eff53c6be9a5f7c0eeb0fbf20635
CoreLibraryReviewExempt: Updating tests to pass for web production backend.
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/343822
Reviewed-by: Mayank Patke <fishythefish@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Nate Biggs <natebiggs@google.com>
2024-01-08 17:21:29 +00:00
Ben Konyi 3c42222b7e [ CLI ] Add tooling-daemon command to support launching the Dart Tooling Daemon (DTD)
This change includes the following:
 - A new `tooling-daemon` CLI command to launch DTD
 - Minor refactoring of package:dtd_impl to better match expected
   Dart package structure
 - Updated build rules to create dart_tooling_daemon.dart.snapshot

Change-Id: Idd91bc4ce64ce790db5bad323a50d9cf65523dc2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/344800
Reviewed-by: Dan Chevalier <danchevalier@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2024-01-08 17:07:55 +00:00
Tess Strickland 1827fcbf68 [vm/compiler] Fix uses of constant indexes in LoadIndexed/StoreIndexed.
Previously, CanBeImmediateIndex calculated the scaling factor for the
index using Instance::ElementSizeFor. However, the LoadIndexed and
StoreIndexed instructions which use this function have an index_scale_
field that is not necessarily the same as the element size for the
class id. This means the displacement calculated within
CanBeImmediateIndex can differ from the actual displacement calculated
within ElementAddressForIntIndex, causing the bug seen by the fuzzer.

This CL moves the check in CanBeImmediateIndex to a new static
method Assembler::AddressCanHoldConstantIndex. In addition to the
original arguments to CanBeImmediateIndex, the new static method takes
an index_scale argument, so the field value can be passed appropriately.

It also adds an is_external argument on X64 and IA32 to match the other
architectures, since assuming a non-external typed data object could
cause a register to be used in cases where it isn't necessary.

TEST=vm/dart/regress_54486

Fixes: https://github.com/dart-lang/sdk/issues/54486
Change-Id: Ia553fb7da0500113b35f8d9af91a52df55437a3c
Cq-Include-Trybots: luci.dart.try:vm-aot-linux-debug-x64-try,vm-linux-debug-ia32-try,vm-aot-linux-debug-simarm_x64-try,vm-aot-linux-debug-simriscv64-try,vm-aot-mac-release-arm64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/345002
Reviewed-by: Daco Harkes <dacoharkes@google.com>
2024-01-08 15:46:01 +00:00
Jens Johansen b52dc18ff8 [CFE] Textual outline suite doesn't format pre-nnbd sources
Fixes https://github.com/dart-lang/sdk/issues/54328

Change-Id: I6d52d9241f245865d3aba775ea6fe19da4ba7f30
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/345220
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2024-01-08 15:01:26 +00:00
Johnni Winther fa8e34e835 [cfe] Handle erroneous enum constant values in exhaustiveness
Closes #54267

Change-Id: Ic8e86a352725bd35985fbd4685b1c4d446875949
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/345063
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2024-01-08 13:20:01 +00:00
Jens Johansen 01a27372e2 [CFE] Textual outline suite doesn't remove empty lines before formatting
Change-Id: I8b7d9fdb5e2562914b66ccd748a8f417895658a4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/344705
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2024-01-08 13:11:52 +00:00
Tess Strickland 6672353e0f [vm] Fix instantiation of default type args in closure functions.
Previously, the default type arguments for closure functions were
instantiated in the same way as other types of functions, where the
instantiator and function type arguments of the call were used. However,
the defaults for closure functions should be instantiated with the
instantiator and parent function type arguments stored within the
closure itself.

Since the instantiation of the default type arguments only depends on
the instantiator and parent function type arguments, which are shared
between partial instantiations of the same generic closure, the VM
performs this instantiation once at closure creation and caches it in
the closure object, so it can be retrieved when the default type
arguments are needed and copied to new partial instantiations of the
same closure without need for recalculation.

As a side effect, this should speed up dynamic invocation of generic
closures, since the invoke field dispatcher that implements them
previously performed this instantiation when needed on every invocation,
but now it just retrieves the cached version instead.

TEST=language/closure/type_arguments vm/dart/regress_54426

Fixes: https://github.com/dart-lang/sdk/issues/54426
Change-Id: I9baad807befa0323f3c5b66196b9664e4d78af0a
Cq-Include-Trybots: luci.dart.try:vm-aot-linux-release-x64-try,vm-reload-linux-release-x64-try,vm-reload-rollback-linux-release-x64-try,vm-tsan-linux-release-x64-try,vm-aot-tsan-linux-release-x64-try,vm-aot-msan-linux-release-x64-try,vm-msan-linux-release-x64-try,vm-aot-linux-release-arm64-try,vm-aot-dwarf-linux-product-x64-try,vm-aot-mac-product-arm64-try,vm-aot-obfuscate-linux-release-x64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/344700
Reviewed-by: Daco Harkes <dacoharkes@google.com>
2024-01-08 13:07:16 +00:00
Ömer Sinan Ağacan f23abcd593 [dart2wasm] Implement wrapping awaited values with Future.value
Fixes tests:

- language/async/await_flatten_test
- language/async/await_type_check_test
- language/await_type_test

Change-Id: I42344073864c4927d07b951048a6425fd116a4b6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/344720
Commit-Queue: Ömer Ağacan <omersa@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2024-01-08 12:19:30 +00:00
Chloe Stefantsova 04e8677d59 [cfe] Infer mixins by directly solving for equality
The direct algorithm for solving for equality replaces the more
general constraint solving algorithm. It reduces complexity and
removes the requirement on the constraint gathering and solving engine
to be applicable at the earlier stages of compilation.

Change-Id: I73dfa39bb1534803c6985578708ecab198c26e25
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/343920
Reviewed-by: Erik Ernst <eernst@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Chloe Stefantsova <cstefantsova@google.com>
2024-01-08 11:42:39 +00:00
Chloe Stefantsova 8f0729aa57 [cfe] Canonicalize bool const results of |, &, ^ to the cached value
Closes https://github.com/dart-lang/sdk/issues/54489

Change-Id: I8eceb0316383e98027f8531c50de1a3079985913
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/344721
Reviewed-by: Lasse Nielsen <lrn@google.com>
Commit-Queue: Chloe Stefantsova <cstefantsova@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2024-01-08 11:36:45 +00:00
Parker Lougheed 5592a0fd5f [dartdev] Roll pub to a3689f03168c896dd1cb0db8a60c568b38ee16bf
It's been a few months since pub was updated and there are some good enhancements that would benefit from larger testing. Happy to close this if pub hasn't been updated in a while on purpose though!

Diff: 1779628b38...a3689f0316/
Change-Id: I69ee1fcf8df8ed61fffa7729c36a214cb1871230
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/345101
Auto-Submit: Parker Lougheed <parlough@gmail.com>
Commit-Queue: Sigurd Meldgaard <sigurdm@google.com>
Reviewed-by: Sigurd Meldgaard <sigurdm@google.com>
Reviewed-by: Sarah Zakarias <zarah@google.com>
2024-01-08 10:40:37 +00:00
Ömer Sinan Ağacan 611a092a5f [dart2wasm] Simplify _AsyncCompleter type parameter computation
Similar to 4d3895a and 72fd1e0, use `FunctionNode.emittedValueType` to
get the yielded element type.

Change-Id: Ib7b3d37e8c84c1b40c38fc8b4143fd0e2b77a463
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/344704
Commit-Queue: Ömer Ağacan <omersa@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2024-01-08 10:14:16 +00:00
Ömer Sinan Ağacan 9ebe37f55c [dart2wasm] Remove rednudant ref.as_non_nulls
With 3c4d4ad we use non-nullable Wasm field types for non-nullable Dart
fields, so the `ref.as_non_null`s for getting async completer from a
async suspend state can be dropped.

Change-Id: I7857d9996f3415c42b83e4b8961f629e0dd070a7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/345180
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
Auto-Submit: Ömer Ağacan <omersa@google.com>
2024-01-08 09:37:09 +00:00
David Morgan 5cb4351c76 [macros] Fix class definition augmentation test.
Resolve constructors, fields and methods correctly.

Tweaks to test and support code so they're closer to passing.

R=jakemac@google.com, scheglov@google.com

Bug: https://github.com/dart-lang/sdk/issues/54404
Change-Id: I5ccd5e0c3843dc32fb7838a4bc78b65f982f3ce9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/343161
Commit-Queue: Morgan :) <davidmorgan@google.com>
Reviewed-by: Jake Macdonald <jakemac@google.com>
Auto-Submit: Morgan :) <davidmorgan@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2024-01-08 08:14:58 +00:00
Srujan Gaddam 4a2cd36a3d [dart:js_interop(_unsafe)] Add changelog entries for importModule and has
Change-Id: I4ccc48f9acca6796f46db73bb48dd3b1adeb4bbe
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/345141
Commit-Queue: Srujan Gaddam <srujzs@google.com>
Reviewed-by: Kevin Moore <kevmoo@google.com>
2024-01-06 01:03:28 +00:00
Parker Lougheed 2da2375bcf [js_runtime/js_dev_runtime] Don't consider running on Windows when compiled for web
This bool is used to check if certain Uri functions should default to Windows behavior on Node. If running on the web, these checks will always be false though, so add a check to enable tree shaking to remove unused Windows functionality.

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

Change-Id: I1ef830f7b14af928a16a875d50cf6ab0db727dfc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/345100
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Nate Bosch <nbosch@google.com>
Reviewed-by: Mayank Patke <fishythefish@google.com>
Commit-Queue: Mayank Patke <fishythefish@google.com>
Auto-Submit: Parker Lougheed <parlough@gmail.com>
2024-01-05 23:58:56 +00:00
Samuel Rawlins aa6b6470e3 Revert "analyzer: Do not overwrite an original exception when a plugin crashes"
This reverts commit 7784cf3f94.

Reason for revert: broke windows bot

Original change's description:
> analyzer: Do not overwrite an original exception when a plugin crashes
>
> Maybe related to https://github.com/dart-lang/sdk/issues/38629. These tests have been skipped for so long, enabling them took some work, to migrate them from '.packages' files to package config files.
>
> Some other tidying in the test file:
>
> * inline `byteStorePath`, only used once.
> * simplify `_packagesFileContent` and `_getPackagesFileContent`
>   into a static getter.
> * simplify `_defaultPluginContent` into a const String, so it can
>   be used as a function parameter default value
>
> The diff is way bigger than the functional changes, because we sort
> elements.
>
> Change-Id: I193316316750e80268b684fdc1abe558a77994fe
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/344601
> Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
> Commit-Queue: Samuel Rawlins <srawlins@google.com>

Change-Id: Ibeb761afebad4fb4166cec756743dbb35d323e7d
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/345143
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2024-01-05 23:49:57 +00:00
Eli Geller e6d1333f93 Fix typo unawaited_futures.dart
Closes https://github.com/dart-lang/sdk/pull/54533

GitOrigin-RevId: c7b652b265f0e2723dd9f23c9107754f2c44405f
Change-Id: I99a7effa1f4bba921642a390590bc947d6c0a78e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/345142
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2024-01-05 22:48:09 +00:00
Brian Wilkerson e5cbde13b9 Add documentation for core lints
Change-Id: I3aa040df18982447ec1e3da074547d28838acae9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/344280
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Marya Belanger <mbelanger@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2024-01-05 21:36:10 +00:00
Srujan Gaddam 121d54f1e0 [pkg:js] Update changelog to better comment breaking change in 0.7.0
Change-Id: Ib949f1b08a4e147258364d7ab9660a8dc6a88f23
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/345140
Commit-Queue: Jake Macdonald <jakemac@google.com>
Commit-Queue: Srujan Gaddam <srujzs@google.com>
Reviewed-by: Jake Macdonald <jakemac@google.com>
Auto-Submit: Srujan Gaddam <srujzs@google.com>
2024-01-05 21:16:11 +00:00
Stephen Adams 7933cd741d [dart2js] Prevent type expressions being hoisted above guards
Use a pinned HTypeKnown on the receiver of the HInstanceEnvironment to
pin the type expression. When the the receiver has a wider type that
is legal for the type expression, this keeps the type expression at a
location where it is valid. Type expressions can still be hoisted if
the HTypeKnown is redundant and optimized away.

Bug: #54329
Change-Id: Iae378f9d517e3e22deca198195cad9811cf37772
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/344841
Reviewed-by: Mayank Patke <fishythefish@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2024-01-05 19:03:29 +00:00
Konstantin Shcheglov 3e53f3e141 Issue 54485. Report error when external constructor has a field formal parameter, optional.
Finishes https://dart-review.googlesource.com/c/sdk/+/344180

Bug: https://github.com/dart-lang/sdk/issues/54485
Change-Id: Ib743495b4b5a03c017ccca22f8efd1055fd919aa
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/345081
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2024-01-05 18:24:50 +00:00
Konstantin Shcheglov 421a4dca1f Add File based methods to AnalysisDriver, and use them in new tests.
Change-Id: I12ccf1d18cdd3161d08adeeb441b214c164b3d74
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/344943
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2024-01-05 17:58:38 +00:00
Konstantin Shcheglov e5df638539 Use DriverEventCollector for assertDriverEventsText()
So, we can move `pumpEventQueue()` into shared code.
And don't repeat `take()` in test methods.

And use the shared `IdProvider` of the collector.
This let us see as new instances of results are created at different
execution points of a single method, with multiple asserts.

Change-Id: I14a871adceae8c8bd8ee6dcbce8893e1daa62a13
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/344941
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2024-01-05 16:51:49 +00:00
Martin Kustermann cbe0e6443d [dart2wasm] Use [WasmArray]s for type arguments in dynamic calls
This avoids allocating lists in dynamic calls for type
arguments.

So far the closure shape checking functionality also
- as a side-effect of shape checking - added default type arguments
to a growable list. We now cleanly separate the logic to use
default type arguments vs shape checking.

=> Doing so allows removing the remaining usages of [List] in the RTT.
=> Probably also results in smaller & faster dynamic calls.

The list allocation is now pushed to the slow path where we
create [Invocation] object that is then used for NoSuchMethod
handling.

Change-Id: I4823cda0aa9b5f1f137813bc5848c365665da5fd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/344822
Reviewed-by: Ömer Ağacan <omersa@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2024-01-05 15:40:40 +00:00
Martin Kustermann 3343b7a841 [dart2wasm] Use [WasmArray]s for positional/named arguments in dynamic calls
This avoids allocating lists in dynamic calls for positional/named
arguments.

=> Doing so allows removing more usages of [List] in the RTT.
=> Also results in up to 50% faster dynamic calls.
=> Probably also results in smaller code.

The list allocation is now pushed to the slow path where we
create [Invocation] object that is then used for NoSuchMethod
handling.

Change-Id: If578fb044a6cf7f31bd409c177b361181ba68a01
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/344821
Reviewed-by: Ömer Ağacan <omersa@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2024-01-05 15:00:19 +00:00
Ömer Sinan Ağacan 5a4b438ddb [dart2wasm] Implement null checking when calling super ==
Fixes tests:

- co19/Language/Expressions/Equality/evaluation_super_t02
- language/nnbd/static_errors/super_equals_allows_null_test

Change-Id: Icbbbede51bc1ade5d5039cdcc91fda279e6898f2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/345020
Commit-Queue: Ömer Ağacan <omersa@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2024-01-05 14:58:28 +00:00
Parker Lougheed 6e8b466d95 [pkg/vm] Use correct method to relativize URIs in resource files
The previous method I used didn't account for Windows drive letters or host names, and ended up using a bunch of '..' to go back to the root unnecessarily.


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

TEST=pkg/vm/test/transformations/resource_identifier_test

Cq-Include-Trybots: luci.dart.try:pkg-win-release-arm64-try,pkg-win-release-try,pkg-linux-release-try
Change-Id: Ida627148c178137cb3684eb23d0b30c16791308b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/344762
Reviewed-by: Moritz Sümmermann <mosum@google.com>
Commit-Queue: Moritz Sümmermann <mosum@google.com>
Auto-Submit: Parker Lougheed <parlough@gmail.com>
Reviewed-by: Daco Harkes <dacoharkes@google.com>
2024-01-05 13:56:58 +00:00
Daco Harkes ce1af47fa9 [vm/ffi] Check Array<T extends AbiSpecificInt> bounds [] and []=
TEST=tests/ffi/inline_array_test.dart

Closes: https://github.com/dart-lang/sdk/issues/54379
Change-Id: I89a637dce0af9520d29d18ec595d868cd0b1604c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/345061
Reviewed-by: Tess Strickland <sstrickl@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
2024-01-05 12:35:49 +00:00
Daco Harkes cd9eaef675 [vm/ffi] Check Array<T extends Struct> bounds on []
TEST=tests/ffi/inline_array_test.dart

Bug: https://github.com/dart-lang/sdk/issues/54379
Change-Id: I2799056ce48fa8cfa590512b241fe72f61a07dbf
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/345060
Reviewed-by: Tess Strickland <sstrickl@google.com>
2024-01-05 12:35:49 +00:00
Daco Harkes d4f8f24dc8 [vm/ffi] Array fixes
`_checkIndex` was returning dynamic.

And it was missing for `PointerArray`.
Bug: https://github.com/dart-lang/sdk/issues/54379

TEST=tests/ffi/inline_array_test.dart

Change-Id: I148545e50463e89fb3a884757ef92444addefc61
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/345000
Reviewed-by: Tess Strickland <sstrickl@google.com>
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
2024-01-05 12:35:49 +00:00
sgrekhov 6cf1148b5b [co19] Roll co19 to cd23849a5bf84a73466b5107e23bb04cf3d9b38a
2024-01-05 sgrekhov22@gmail.com Fixes dart-lang/co19#2465. Fix roll failures (dart-lang/co19#2466)
2024-01-04 sgrekhov22@gmail.com dart-lang/co19#2420. Add object-pattern exhaustiveness tests (dart-lang/co19#2454)
2024-01-04 sgrekhov22@gmail.com dart-lang/co19#2420. Add relational pattern exhaustiveness tests (dart-lang/co19#2463)
2024-01-03 sgrekhov22@gmail.com dart-lang/co19#2420. Add missed experimental flags (dart-lang/co19#2462)
2024-01-03 sgrekhov22@gmail.com Fixes dart-lang/co19#2436. Add test for external constructors with initializers (dart-lang/co19#2461)
2024-01-02 sgrekhov22@gmail.com dart-lang/co19#2420. Add more dynamic semantics extension type tests (dart-lang/co19#2459)
2024-01-02 sgrekhov22@gmail.com Fixes dart-lang/co19#2436. Add tests for external and redirecting constructors with initializing formals (dart-lang/co19#2460)
2023-12-29 sgrekhov22@gmail.com dart-lang/co19#1400. Add object pattern tests for extension types (dart-lang/co19#2456)
2023-12-29 sgrekhov22@gmail.com dart-lang/co19#1400. Add type inference tests for extension types (dart-lang/co19#2455)
2023-12-29 sgrekhov22@gmail.com dart-lang/co19#2420. Add switch statement check to the existing exhaustiveness tests (dart-lang/co19#2452)

Change-Id: Iee0668f14a35bb3c47aa67b35b1e5c6d8abe8021
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/345040
Reviewed-by: William Hesse <whesse@google.com>
Commit-Queue: Erik Ernst <eernst@google.com>
Reviewed-by: Erik Ernst <eernst@google.com>
2024-01-05 11:13:26 +00:00
Phil Quitslund 3e319ba752 Revert "options map support scaffolding in driver"
This reverts commit 717ce7a69c.

Reason for revert: breaking Google3

Original change's description:
> options map support scaffolding in driver
>
> Konstantin and I chatted a bit about this so at least some of it shouldn't be too surprising to him but please do feel free to grab me to chat.
>
> That said a few pointers would be handy. Notably, this change:
>
> * introduces a new `SharedOptionsOptionsMap` for use in SDK drivers (and preserve current semantics)
>   * this is currently public but will be private once driver is more evolved to accommodate multiple options files
> * removes the shared `_analysisOptions` from the analysis driver with a baby step to using the one shared in SharedOptionsOptionsMap
> * removes context_builder and collection v2 experiments (and tests)
>   * I'll harvest some more functionality from these in future changes but for now they're distracting and hard to maintain
>
> This work is all to setup moving analysis options awareness into file state objects which will allow us to remove `sdkVersionConstraint` info from options (finally) and a host of other good stuff (see https://github.com/dart-lang/sdk/issues/54124).
>
>
>
> Change-Id: Ic4278184016d1018b4b5b1c6ac5ba9e2546927a5
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/344860
> Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
> Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
> Commit-Queue: Phil Quitslund <pquitslund@google.com>

Change-Id: Ia988c5c9cd328d0adce3d8e6ff019e389819a957
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/344960
Auto-Submit: Phil Quitslund <pquitslund@google.com>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2024-01-05 05:07:10 +00:00
Konstantin Shcheglov 437767f4ae Move more AnalysisDriver tests to DriverEventCollector.
Change-Id: If54cf494313fb21a2cb6e6b985f816581333cccf
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/344843
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2024-01-05 01:41:29 +00:00
Konstantin Shcheglov fafa97a9a4 Remove AnalysisDriverGeneric.
The Angular plugin does not exist anymore.
I don't see any use of this class in google3.
So, probably we can remove it.

Change-Id: Ied6b81d4d467e21be22c11fc53ecedd7f1c5b6a9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/344901
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2024-01-05 00:51:07 +00:00