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>
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>
- 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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
`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>
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>