Commit graph

98636 commits

Author SHA1 Message Date
Srujan Gaddam e6a313568c [dart:js_interop] Add generics to JSArray and JSPromise
In order to support this, adds necessary changes to conversion
functions (including cast-lists) and makes JSArrayImpl a generic
type.

CoreLibraryReviewExempt: Backend-specific library changes.
Change-Id: I58bcfb67ef21c90be5e25735757d780aac52dc23
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/337923
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Srujan Gaddam <srujzs@google.com>
2023-12-12 04:50:13 +00:00
Srujan Gaddam c1ba3cf699 [dart2wasm] Fix handling of generic callbacks in trampoline
Closes https://github.com/dart-lang/sdk/issues/54192

Callbacks were being casted to their static type before being
called. With generic callbacks, we do not know their exact type
at compile time, therefore cannot make that cast. Similarly, a
null check was being done if the static type of the parameter
was potentially non-nullable, whereas it should be done if it's
*not* potentially nullable.

Change-Id: I3d30e901f1ff2ae4c17887564f15368244baeb24
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/340390
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2023-12-12 04:50:13 +00:00
pq 60c640fe4d fix accidental var introductions
Follow-up from https://dart-review.googlesource.com/c/sdk/+/341084 where I accidentally went w/ a `var` style despite surrounding use of `final`.

Change-Id: I60202b032ee867989f876b8746effe83ec202bfd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/341104
Commit-Queue: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2023-12-12 03:45:47 +00:00
Sam Rawlins 9ea048bc89 Do not allow void results in record literals
I also privatize all of the "repor"t methods, so the sort makes for a
big diff.

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

Change-Id: I0e7b2602e27ffe2eeab7688787d38ed039895b15
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/341163
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2023-12-12 03:44:47 +00:00
Alexander Markov 804a306895 [vm] Preserve pragma annotations on hot reload
TEST=vm/cc/IsolateReload_KeepPragma{1,2,3}

Change-Id: Ib698b918a27382e3573b5d3f0670d9f4e13c8064
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/341100
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2023-12-12 02:09:27 +00:00
Ryan Macnak a3b7c323b0 [vm, gc] Mark through new-space.
- Initial and final marking no longer visit all of new-space, reducing the STW pause for major GC.
 - A scavenge during concurrent marking must forward / filter objects in the marking worklist that are moved / collected, increasing the STW pause for minor GC.
 - Unreachable intergenerational cycles and weak references are collected in the next mark-sweep instead of first requiring enough scavenges to promote the whole cycle or weak target into old-space.
 - Artificial minor GCs are no longer needed to avoid memory leaks from back-to-back major GCs.
 - reachabilityBarrier is now just a count of major GCs.

TEST=ci
Change-Id: Ic7754e8d972763654eae2b7faa8670735d9cda3f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/340644
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2023-12-12 01:56:15 +00:00
Konstantin Shcheglov 89d7197b89 Macro. Distinguish named and named required formal parameters in Code.
Change-Id: I18a9a868371ad783bb780faba2be01819112b6e9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/341161
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2023-12-12 01:34:48 +00:00
Sam Rawlins a2151474a5 linter: UBCS: require checking the correct 'mounted' property
Fixes https://github.com/dart-lang/linter/issues/4777

Change-Id: I0c50ab1a04b8f9c704a0cf787fcf414688cd61a6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/330561
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2023-12-12 01:34:11 +00:00
Brian Wilkerson d45080d365 Remove support for the older legacy completion protocol
This does not remove the computation of available declarations. This CL
seemed big enough without that, so I (or someone else) can get that in
the next CL.

Change-Id: I67ab49b75c8a415ccfaef16c4e49a00026a6091f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/341160
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2023-12-12 00:54:48 +00:00
Konstantin Shcheglov d156344a08 Macro. Implement inferOmittedType()
Change-Id: I0e2b3ee2eefb7da99b604d552a7909bca1dc9737
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/341102
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2023-12-12 00:54:28 +00:00
Brian Quinlan f494e771a2 [doc/io] Add a strong caution against using HttpClient and HttpRequest directly.
CoreLibraryReviewExempt: documentation-only change
Bug:https://github.com/dart-lang/sdk/issues/52023
Change-Id: I9d4b4bde676f2c85acb95e872fdaf7b5a92c6de5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/340283
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Brian Quinlan <bquinlan@google.com>
2023-12-12 00:45:45 +00:00
pq 12598e6b0f deprecate analysis options sdkVersionConstraint getter
Noteworthy:

* deprecates the `sdkVersionConstraint` getter and updates uses
* migrates tests for sdk contstraints in the absence of a pubspec from context_builder_test to analysis_context_collection_test
* makes `pubPackages` getter broadly visible

Next step: remove the code that sets the `sdkVersionConstraint` in the analysis options object and remove the getter.


Change-Id: I443cdd15ec8d28ac6fa6786e06c1e4b027eee747
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/341084
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Keerti Parthasarathy <keertip@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
2023-12-12 00:20:50 +00:00
Daco Harkes 40094c8cfd [vm/ffi] Unwrap typed data in FFI calls
Enables passing inner pointers to typed data in FFI leaf calls.

This works for typed data's in the Dart heap, external typed datas
(constructed from `Pointer.asTypedList`), and typed data views.

Notable implementation details:
1. The Dart signature is used in the Marshaller now. This means it
   needs to keep track of whether there's a pointer argument in the
   signature (`asFunction`) or not (`@Native`).
2. Unwrapping is done in `FfiCallInstr::EmitNativeCode` before moving
   the arguments to their native location. This ensures we can use
   the assembler logic to load the `TypedDataBase::data` field.
3. The `XXXList` user visible classes don't have predefined cids.
   So the implementation uses symbols for comparison.
4. The type checking logic takes `isLeaf` as input to reject typed
   data. This leads to an error message about the type not accepted.
   Alternatively, we could consider adding an error message that
   specifically says the function should be leaf.
5. To cover all calling convention variants, tests are generated with
   up to 20 arguments.

TEST=pkg/analyzer/test/src/diagnostics/ffi_unwrap_typed_data_test.dart
TEST=tests/ffi/unwrap_typeddata_generated_native_test.dart
TEST=tests/ffi/unwrap_typeddata_generated_test.dart
TEST=tests/ffi/vmspecific_static_checks_typeddata_test.dart

Closes: https://github.com/dart-lang/sdk/issues/44589
Change-Id: Ia78f18bf3238d42ac6882929b441f6dc432fcefe
Cq-Include-Trybots: luci.dart.try:vm-aot-android-release-arm64c-try,vm-aot-android-release-arm_x64-try,vm-aot-linux-debug-x64-try,vm-aot-linux-debug-x64c-try,vm-aot-mac-release-arm64-try,vm-aot-mac-release-x64-try,vm-aot-obfuscate-linux-release-x64-try,vm-aot-optimization-level-linux-release-x64-try,vm-aot-win-debug-arm64-try,vm-aot-win-debug-x64c-try,vm-aot-win-release-x64-try,vm-appjit-linux-debug-x64-try,vm-asan-linux-release-x64-try,vm-checked-mac-release-arm64-try,vm-eager-optimization-linux-release-ia32-try,vm-eager-optimization-linux-release-x64-try,vm-ffi-android-debug-arm-try,vm-ffi-android-debug-arm64c-try,vm-ffi-qemu-linux-release-arm-try,vm-ffi-qemu-linux-release-riscv64-try,vm-fuchsia-release-x64-try,vm-kernel-linux-debug-x64-try,vm-kernel-precomp-linux-release-x64-try,vm-linux-debug-ia32-try,vm-linux-debug-x64-try,vm-linux-debug-x64c-try,vm-mac-debug-arm64-try,vm-mac-debug-x64-try,vm-msan-linux-release-x64-try,vm-reload-linux-debug-x64-try,vm-reload-rollback-linux-debug-x64-try,vm-ubsan-linux-release-x64-try,vm-win-debug-arm64-try,vm-win-debug-x64-try,vm-win-debug-x64c-try,vm-win-release-ia32-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/338620
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2023-12-12 00:05:02 +00:00
Danny Tuppeny 367b8fdc16 [analysis_server] Add inlay hints for for-in and for elements
Fixes https://github.com/Dart-Code/Dart-Code/issues/4891

Change-Id: I788008bca06f98b4308c897d41b2dc034579c6a6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/340880
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Keerti Parthasarathy <keertip@google.com>
Reviewed-by: Keerti Parthasarathy <keertip@google.com>
2023-12-11 22:48:27 +00:00
Ömer Sinan Ağacan 3873c04638 [dart2wasm] ParamInfo documentation and minor refactoring
Change-Id: I73cdec947c3d7c5b0d1a5d2955b97273c11e1ec5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/340920
Commit-Queue: Ömer Ağacan <omersa@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2023-12-11 22:21:27 +00:00
Keerti Parthasarathy 208c99fca3 Revert changes to support multiple packages in PubWorkspace.
The changes caused a regression, caught in https://golem.corp.goog/Revision?repository=dart&revision=107434.

Change-Id: If867769fc9c64765ba967f778e5de10e52a11c42
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/341081
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Keerti Parthasarathy <keertip@google.com>
2023-12-11 22:17:19 +00:00
Konstantin Shcheglov 45f2fff8e5 Macro. Add more types to resolveType(), use in isExact().
Change-Id: I7953ee15be8a756fec53ee140df09dad95d9ad65
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/341082
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2023-12-11 21:46:38 +00:00
Konstantin Shcheglov 4d7938dfc2 Fix CONVERT_TO_SWITCH_STATEMENT for 'is NotInterfaceType'.
Change-Id: Ic5308541f279e5f23d8e90bee095bf8aa8aec3e2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/341083
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
2023-12-11 21:46:13 +00:00
Ahmed Ashour d9962e5053 [analyzer] UNNECESSARY_SET_LITERAL to handle multiple expressions
Bug: https://github.com/dart-lang/sdk/issues/50900
Change-Id: Id09e102c2cc12c9043d3f6c22b3af3babf18920e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/284021
Reviewed-by: Nate Biggs <natebiggs@google.com>
Reviewed-by: Oleh Prypin <oprypin@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Oleh Prypin <oprypin@google.com>
2023-12-11 21:24:59 +00:00
John McCutchan 33ad2086c1 Expose Dart_Null_DL from dart_api_dl.h
R=dacoharkes@google.com

https://github.com/dart-lang/sdk/issues/54296

TEST=tests/ffi/vmspecific_handle_dynamically_linked_test.dart

Change-Id: Ibcf6a387a4b6385b17c13ed4b3ce6422291a5f78
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/341061
Auto-Submit: John McCutchan <johnmccutchan@google.com>
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Commit-Queue: John McCutchan <johnmccutchan@google.com>
2023-12-11 21:06:37 +00:00
Srujan Gaddam 4f44d2eb22 [dart:js_interop] Fix checking of type parameters in interop APIs
Addresses some comments in https://github.com/dart-lang/sdk/issues/54192

- With the addition of `nonTypeVariableBound`, we no longer need a
recursive checker.
- We also should account for `StructuralParameterTypes`.
- The current checks did not check type parameters for functions
converted via `toJS`, so that is handled as well.
- Functions that declare type parameters cannot be called in JS
correctly, so an error is added when users try to convert them.
- Some errors are reworded/modified.

Change-Id: Ic05220883ec4ad8653963acd901d339426cba6c6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/339346
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Srujan Gaddam <srujzs@google.com>
2023-12-11 21:03:01 +00:00
Devon Carew 034c6d71fc [deps] rev ecosystem, fixnum, http_parser, leak_tracker, mockito, path, protobuf, sync_http, test, tools, web, webdev
Revisions updated by `dart tools/rev_sdk_deps.dart`.

ecosystem (79a1bc5..ce707fb):
  ce707fb  2023-12-06  Moritz  Use Flutter in `health.yaml` (#206)

fixnum (6b0888c..3e08c0d):
  3e08c0d  2023-12-04  Kevin Moore  drop outdated lints (#123)

http_parser (1cf5b7c..224c1a9):
  224c1a9  2023-12-04  Kevin Moore  drop outdated lints (#82)

leak_tracker (a618a55..8644f8b):
  8644f8b  2023-12-11  Lucas.Xu  chore: bump leak_tracking_flutter_testing version to 1.0.12-wip (#192)
  cac195d  2023-12-11  Binni Goel  Fix. typos in leak_tracker (#189)
  9fd7932  2023-12-11  Lucas.Xu  fix: add missing on leak callback (#190)
  1ab3140  2023-12-08  Lucas.Xu  chore: refactor code style (#186)

mockito (fb8a2b5..57a7c82):
  57a7c82  2023-12-06  Copybara-Service  Merge pull request #721 from Sese-Schneider:master
  c5de658  2023-12-06  Sese Schneider  Apply suggestions from code review
  1a652b8  2023-11-21  Sebastian Schneider  Use `posix` style for local imports

path (18ec71f..115ea2a):
  115ea2a  2023-12-05  Devon Carew  rev the version of lints used; prep for publishing (#155)

protobuf (bb19774..20ec685):
  20ec685  2023-12-05  Ömer Sinan Ağacan  Small PbList improvements (#906)

sync_http (d8e9f3d..f96db95):
  f96db95  2023-12-05  Kevin Moore  Latest lints, require Dart 3.0, use mini-libraries (#42)

test (9fffb48..43ff5bf):
  43ff5bf9  2023-12-11  Ömer Sinan Ağacan  Fix Dart2Wasm spelling (#2155)
  7d61eef9  2023-12-08  Derek Xu  Update frontend_server_client constraint to allow version 4.0.0 (#2153)
  001c5381  2023-12-07  Jacob MacDonald  fix precompiled vm tests loaded from a package: uri (#2152)
  fb3b5725  2023-12-05  Nate Bosch  Use package: URIs for imports when possible (#2148)
  03cc56ec  2023-12-05  Jacob MacDonald  mark flaky windows test as skipped (#2151)
  6e7e4fa8  2023-12-05  Jacob MacDonald  Add regression test for relative imports in tests under `lib` (#2147)
  84c366a7  2023-12-05  Jacob MacDonald  fix broken tests (#2149)
  e49ae54b  2023-12-05  Jacob MacDonald  Promote dart2wasm compiler support to the stable browser platform. (#2144)

tools (c63dcb5..ed81684):
  ed81684  2023-12-06  Elias Yishak  Fix consent message formatting (#215)
  c4d515a  2023-12-05  Elias Yishak  Enum + event added for `commandUsageValues` (#211)

web (865aeaf..acf0beb):
  acf0beb  2023-12-07  Devon Carew  fixes to the return types of several Node helper extension methods (#121)
  9d7b33e  2023-12-06  Srujan Gaddam  Handle Dart SDK change to extension types (#116)
  0ae45ec  2023-12-05  Devon Carew  Update README.md (#117)
  34b3618  2023-12-05  Devon Carew  have web.dart export the helpers; deprecate helpers.dart (#115)

webdev (63e09e5..8375cd6):
  8375cd66  2023-12-08  Elliott Brooks  Add popup for copying the app ID (#2299)

Change-Id: Ibf5f5eca74c56bf31d50bddabbe9da2a2e6fd716
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/341021
Commit-Queue: Devon Carew <devoncarew@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2023-12-11 20:55:25 +00:00
Ryan Macnak e4849d852c [build] Handle riscv64 hosts in utils.py.
Bug: https://github.com/dart-lang/sdk/issues/48545
Change-Id: I7439b644ab4ff2fcbc5e22553392b93ebcfc6435
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/340645
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2023-12-11 19:12:50 +00:00
Ben Konyi a6b6a61349 [ package:vm_service ] Mark some tests as slow
The following tests are flakily timing out and probably just need some
more execution time:

- get_cpu_samples_rpc_test
- get_perfetto_cpu_samples_rpc_test
- valid_source_locations_test

Change-Id: I3274927b23069ef3ce4e1af7bb2a9fab23967e5b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/341041
Auto-Submit: Ben Konyi <bkonyi@google.com>
Commit-Queue: Derek Xu <derekx@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Derek Xu <derekx@google.com>
2023-12-11 18:52:27 +00:00
Ben Konyi 7b25ff461d [ CLI ] Disable analytics collection on bots
Change-Id: Ifc038d08cd2c427ba3541ef8eed39b97481766e7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/341040
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Elias Yishak <eliasyishak@google.com>
2023-12-11 18:47:32 +00:00
Konstantin Shcheglov 2803bf6275 Macro. Remove declarationsPhaseInterface formal parameter.
We don't need it with the new free introspect and cycle detection.

Change-Id: I847eac6b62699f55165fb7ec987272d104ecc819
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/340800
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
2023-12-11 18:14:11 +00:00
Konstantin Shcheglov 3ab16cf2ce Use FileState to get file properties, include URI to output.
No need to re-discover WorkspacePackage.

Change-Id: I68a343ec1c18d9f13cf8fbc7c7dce967a3acb6f3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/340741
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2023-12-11 17:55:24 +00:00
yamichonghe 1ddafec2d3 [ssl/win] Always free the X509 certificates after use, fix leak.
R=aam@google.com, asiva@google.com

Bug: https://github.com/dart-lang/sdk/issues/54251
TEST=manually on win
Change-Id: Ia8ce28e69d91606e2b7fe2af8335abd815b0e7d0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/340720
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Auto-Submit: yami yami <yaminet1024@gmail.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
2023-12-11 17:49:58 +00:00
Konstantin Shcheglov 8371eb481f Macro. Introspect top-level functions.
Change-Id: Ida8e7768efb3072870fd32bb48d0905d235ad343
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/340740
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2023-12-11 17:36:21 +00:00
Konstantin Shcheglov c31dfad2df Macro. Implement StaticType.isExactly()
Partial tests, only interface types, and nullable.
More in future CLs, as resolution into other `StaticType`s implemented.

Change-Id: Ibab214a0a4625ce26c6090f95d056cfd42a25754
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/340820
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2023-12-11 17:04:38 +00:00
Martin Kustermann 72f6db9261 Use WasmObjectArray instead of List in RTT metadata
This reduces flute's complex.dart slightly

  complex.wasm 1596131 -> 1563506 (-2%)
  complex.wasm.unopt 3562573 -> 3535797 (-0.7%)

And makes the code probably slightly faster

Change-Id: Id35f2b156d39b6e77b62240a83f78914999bb744
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/340565
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Ömer Ağacan <omersa@google.com>
2023-12-11 12:24:04 +00:00
Johnni Winther 17f4344336 [cfe,analyzer] Handle extension types in exhaustiveness checking
This adds support for extension types in exhaustiveness checking by
performing extension type erasure on the type before computing the
corresponding static type/space.

Change-Id: Ie75c903aec52a7c34410695787a9bea6008d637d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/340442
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2023-12-11 11:10:07 +00:00
Sergey G. Grekhov 8763ece3be [co19] Roll co19 to ea5e476b3af94f74f6996e4b4319bf03f9248c1c
2023-12-07 sgrekhov22@gmail.com Fixes dart-lang/co19#2413. Add missing expected compile-time errors for CFE (dart-lang/co19#2418)
2023-12-07 sgrekhov22@gmail.com dart-lang/co19#2119. Run dart formatter on LibTest/async tests (dart-lang/co19#2417)
2023-12-06 sgrekhov22@gmail.com dart-lang/co19#2398. Make asyncStart/End() safe in LibTest/async (dart-lang/co19#2416)
2023-12-06 sgrekhov22@gmail.com Fixes dart-lang/co19#2355. Add more typed_date.setRange() tests (dart-lang/co19#2412)
2023-12-06 sgrekhov22@gmail.com dart-lang/co19#2404. Small code-style improvements and description update (dart-lang/co19#2414)
2023-12-04 sgrekhov22@gmail.com dart-lang/co19#2004. Add deferred libraries tests according to the changed spec (dart-lang/co19#2411)
2023-12-04 sgrekhov22@gmail.com Fixes dart-lang/co19#2383. Add more constant evaluation tests (dart-lang/co19#2396)

Change-Id: I15e0d681538fa0f2a311f74d1930fad7270b81a0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/340561
Commit-Queue: Alexander Thomas <athom@google.com>
Reviewed-by: Erik Ernst <eernst@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
2023-12-11 09:55:05 +00:00
Ömer Sinan Ağacan 41ee6a5a94 [dart2wasm] Handle JS exceptions in await exprs, finally blocks
Fixes #54024.

Change-Id: I5c92f12a453a550ce76b340116f57b329ffa97f7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/335740
Reviewed-by: Jackson Gardner <jacksongardner@google.com>
Commit-Queue: Ömer Ağacan <omersa@google.com>
2023-12-11 09:34:28 +00:00
Erik Ernst f9d64593ff Adjust UP to move the intersection type rules up
This CL implements the spec change in https://github.com/dart-lang/language/pull/3435. It changes the implementation of UP in the CFE and in the analyzer such that it matches the updated specification in language PR dart-lang/language#3435.

Change-Id: I2fb56c11e671e6917baffb89f9fb231072d22a0a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/333922
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Erik Ernst <eernst@google.com>
2023-12-11 08:31:10 +00:00
Gihwan Oh 9410b314ab [analyzer] fix typo
Closes https://github.com/dart-lang/sdk/pull/54297

GitOrigin-RevId: 9d83b9899030a5a202b38e9fc4d6cb9f69358a81
Change-Id: Ie334df73b321bc7f4fe32f00e4aa996d0c9508de
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/340760
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2023-12-10 20:47:39 +00:00
Parker Lougheed 8f1b8fa1c9 [analyzer] Properly close analyzer WATCHLISTS entry
I didn't adjust this when removing nnbd_migration in https://dart-review.googlesource.com/c/sdk/+/340160.

Change-Id: I21829c3052be1671a2407f219a332a7a62197ce5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/340361
Reviewed-by: Alexander Thomas <athom@google.com>
Auto-Submit: Parker Lougheed <parlough@gmail.com>
Commit-Queue: Alexander Thomas <athom@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
2023-12-10 18:02:25 +00:00
Ömer Sinan Ağacan 2f1506822c [dart2wasm] Skip synthetic mixin class names in type name list
Reduces optimized binary size (with names section) of devtools from
10,322,431 to 10,153,197 bytes (-1.6%).

Change-Id: Ife9f803846a054cfbe3910008dc62d51d7a2c7bd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/340564
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Ömer Ağacan <omersa@google.com>
2023-12-09 09:44:44 +00:00
Ben Konyi 6b42951a94 [ Service ] Fix flaky debugging_inlined_finally_test
Change-Id: Ie1abc1485789729204f278561de5b63a7d6e588b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/340660
Reviewed-by: Kenzie Davisson <kenzieschmoll@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2023-12-08 23:26:18 +00:00
Konstantin Shcheglov 9facf4d60f Macro. Run declarations phase also when introspecting fields and constructors.
Use DeclareInType() instead of specialized new macros.

Change-Id: I66764ca956c42477dfb6b89162a2904666d54504
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/340642
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2023-12-08 22:58:00 +00:00
Brian Wilkerson 14a836f6f6 Move the generation of imported elements to the in-scope completion pass
Sorry for the long CL; once again I couldn't find a reasonable way to
split it up into smaller pieces.

This CL causes all of the elements from imports to be generated by the
new approach.

It does contain a new flag that is used to preserve the current
semantics when computing completions for Cider. I hope to be able to
make the new approach efficient enough that we can remove this flag,
but I can't realistically do that until more of the approach is
implemented.

I'm also not fond of the way it fails to handle conflicts in the import
scope. There's a TODO marking the places that would need to be changed,
but the current behavior is that if the same name N is imported from
two or more imports and they refer to different elements, the first one
found will be suggested and others won't. I don't think we want to
suggest any of them unless we also fix the imports so that the name
won't be conflicting. I'm not sure how we want to do that, but it needs
to work with whatever optimization approach we choose.

I think the changes to the tests are all positive, but please double
check that I haven't missed a good reason for the previous behavior.

Change-Id: I70d4514a67988f654984ac20f33b2d7a3cfc78e2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/340282
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Keerti Parthasarathy <keertip@google.com>
2023-12-08 22:17:38 +00:00
Nate Biggs f057c39255 [dart2js] Add dartDeferredLibraryMultiLoader API to js_helper.
This will allow users who are implementing their own deferred loading mechanism
to batch all the loads for a specific library. Today in order to do batching users have to gather the URIs passed to the `dartDeferedLibraryLoader` hook in a list and schedule (e.g. via setTimeout) a load for some future task.

The need to schedule a task has been shown to cause delays in IPL. But loading each part file individually can also be very expensive. So this allows for a compromise where bundling can be done synchronously per loaded library.

Adds ~8kB to unminified main files and ~2.5kB to minified main files.

Bug: https://github.com/dart-lang/sdk/issues/54202
Change-Id: I623643b03920988cda8b0f8b297944be35ffa606
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/340480
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Nate Biggs <natebiggs@google.com>
2023-12-08 21:10:48 +00:00
Konstantin Shcheglov d2e2ff9b4b Macro. Introspection of type methods during declarations phase runs the target type macros.
Change-Id: Ibaccebe04463481b9f1db2fbb68f5e513fa1c6df
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/340641
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2023-12-08 20:59:02 +00:00
Alexander Aprelev 7850a1cf99 [vm/win] Redirect warn/error/assert informaion into stderr.
Currently crt warn/error/asserts will disappear, so redirecting them to stderr sounds like a better approach.

TEST=manual win run

Change-Id: Iee0a2effd93fbe104dbeab77abebc54beaecb5dc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/340583
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
2023-12-08 20:20:10 +00:00
Alexander Aprelev 229e8ef687 [gardening] Use RecordType::New() instead of thread-unsafe Object::Clone() in RecordType::ToNullability.
Fixes https://github.com/dart-lang/sdk/issues/54123

TEST=tsan ci

Change-Id: Ie5e326e9400286360c1152c870539cbfd179c8f6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/340288
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
2023-12-08 20:13:38 +00:00
Brian Wilkerson 9b26f56309 Register a deprecated lint
Change-Id: Ic42c145df751386134caf4067e537198f8631056
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/340582
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
2023-12-08 19:28:22 +00:00
Martin Kustermann e0485a4fc0 Make _FunctionType fields use WasmObjectArray instead of List
This reduces flute's complex.dart slightly

  complex.wasm: 1601793  -> 1596131 (-0.35%)
  complex.wasm.unopt: 3570856 -> 3562573 (-0.23%)

And makes the code probably slightly faster

Change-Id: I5b5cb8f95509930ce23c7d4bc0385740ad9f429b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/340562
Reviewed-by: Ömer Ağacan <omersa@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2023-12-08 18:48:00 +00:00
Sam Rawlins 9d949a2498 analyzer: Remove pre-NNBD code from strong_mode_test; default to NNBD in ResolutionTest
`isNullSafetyEnabled` is now flipped to true in ResolutionTest, and only
overridden to false in WithoutNullSafetyMixin.

Change-Id: If10a5ba852eada2f719450118683a6d42c1002e9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/340640
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2023-12-08 18:27:21 +00:00
Alexander Aprelev 087278428e [vm/win] Ensure no message boxes for crashes on windows debug builds.
Follow-up to https://dart.googlesource.com/sdk/+/543dbdd708de6da4a461e15147940e08231bba9d

TEST=manually on windows
BUG=https://github.com/dart-lang/sdk/issues/54275

Change-Id: Iec70cb37ab6b6133ce7599fead3ffabc5ba92312
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/340388
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
2023-12-08 17:24:59 +00:00
Erik Ernst 270ef81125 Adjust Dart.g such that initializerExpression matches implementation
The specification grammar has a rule for `initializerExpression` that
derives only `cascade` and `conditionalExpression`, whereas the
implementations allow throw expressions and assignments as well.

This CL broadens the grammar rule for `initializerExpression` such
that it derives the missing terms as well.

Change-Id: Iba3bb11623e07ac81cf9763228ae3e1b7b5204e3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/340620
Reviewed-by: William Hesse <whesse@google.com>
Commit-Queue: Erik Ernst <eernst@google.com>
2023-12-08 15:59:09 +00:00