Commit graph

1733 commits

Author SHA1 Message Date
Devon Carew 1f8aea0c81 Bump lints to a97011b4b031b1df94765dbacd7d92b0b765c8b9
Changes:
```
> git log --format="%C(auto) %h %s" af68bf0..a97011b
 https://dart.googlesource.com/lints.git/+/a97011b add unintended_html_in_doc_comment; rev to 5.1.0 (211)

```

Diff: https://dart.googlesource.com/lints.git/+/af68bf0cbad88002a2ae19ee8db37b64eb120c32..a97011b4b031b1df94765dbacd7d92b0b765c8b9/
Change-Id: I998d73f5f72e94d5f2922b0751d31620a837555e
Tested: analysis only change
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/387601
Reviewed-by: Nate Bosch <nbosch@google.com>
Commit-Queue: Devon Carew <devoncarew@google.com>
2024-09-30 21:48:03 +00:00
Ben Konyi 12d9f40961 Reapply "[ CLI ] Don't disable DDS when --disable-dart-dev is provided"
This reverts commit 9f5246e8c6.

TEST=Existing tests

Change-Id: I658290f248d8b26c05f24b7125c3ba71de318bf9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/385121
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2024-09-26 15:29:05 +00:00
Jens Johansen 3dce89fbe0 [scanner] Don't give the Utf8 scanner a 0-terminated byte sequence
Not having to do the read-allocate-copy dance for files to add a 0-byte
at the end results in these changes when using the CFE to compile
(a fixed version of) the CFE:

```
msec task-clock:u: -1.7356% +/- 0.2164% (-73.16 +/- 9.12)
page-faults:u: -2.6957% +/- 0.0111% (-2914.83 +/- 12.00)
cycles:u: -1.7128% +/- 0.2223% (-297927979.70 +/- 38660477.01)
instructions:u: -1.6814% +/- 0.0002% (-361315766.86 +/- 36853.71)
branch-misses:u: -3.3289% +/- 0.9669% (-2153126.00 +/- 625370.97)
seconds time elapsed: -1.7372% +/- 0.2154% (-0.07 +/- 0.01)
seconds user: -1.5998% +/- 0.2740% (-0.06 +/- 0.01)
seconds sys: -4.1451% +/- 2.9801% (-0.01 +/- 0.01)
Scavenge(   new space) goes from 62 to 61
```

TEST=Existing test coverage.

Change-Id: I8e182bcee39839f6ed1e658c30c85c40ecf0b259
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/385722
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Morgan :) <davidmorgan@google.com>
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Srujan Gaddam <srujzs@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Mayank Patke <fishythefish@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2024-09-25 08:33:48 +00:00
asiva 351e103416 [kernel-service] Do not truncate errors generated by CFE
The errorString method was truncating the errors generated by CFE.

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

TEST=ci

Change-Id: I968f6dd481184a5e0f4a13bab85297e2fcc9b525
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/385360
Commit-Queue: Siva Annamalai <asiva@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2024-09-13 23:08:47 +00:00
Moritz 7222c2963d Add recording of constant instances to record_use
TESTED=pkg/vm/test/transformations/record_use_test.dart

Change-Id: I73ee5b7f1478286252664c53397270906ead549b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/384280
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Moritz Sümmermann <mosum@google.com>
2024-09-13 09:07:02 +00:00
Aravind 8f89bbe1a9 [vm/ffi] Not preventing the transformation for InvalidExpression in ffi
Currently, we just "removed" the actual expression by transforming to
`InvalidExpression('Invalid Type')` if a expression is Invalid. But this  could cascade `.address` position errors (i.e transformer no longer able to walk `.address.abc` if the expression is just replaced with empty expression). So unwrapping actual expression from `InvalidExpression` and trying to transforming that actual expression through a recursive call.

TEST=tests/ffi/static_checks/address_position_cascade_test.dart
Bug: https://github.com/dart-lang/sdk/issues/56613
Change-Id: Ib1ba1d5021797b645c29ac296752d844d0935964
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/384080
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Slava Egorov <vegorov@google.com>
2024-09-13 06:59:39 +00:00
Moritz 81daf8e563 Use package:record_use
- Rename resource identifiers in the VM to usage recordings.
- Use package:record_use for serialization.
- Rename and use the experimental flag for this feature.
- Recognize tear-offs and top-level methods as well.

Next steps:

- Add constant instance recording.
- Expose API in package:native_assets_cli's link callback.

TEST=pkg/vm/test/transformations/record_use_test.dart

Change-Id: I8af3625165f78925ae943711245af93a239d1012
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/383040
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Moritz Sümmermann <mosum@google.com>
2024-09-12 08:47:53 +00:00
Ben Konyi 9f5246e8c6 Revert "[ CLI ] Don't disable DDS when --disable-dart-dev is provided"
This reverts commit 81b9957bdd.

Reason for revert: Breaking multiple configurations.

Original change's description:
> [ CLI ] Don't disable DDS when --disable-dart-dev is provided
>
> Fixes https://github.com/dart-lang/sdk/issues/56605
> Fixes https://github.com/dart-lang/sdk/issues/54841
>
> TEST=N/A
>
> Change-Id: I6a13afe5f51fe67d2366c6d87ae74473651e24c8
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/383780
> Commit-Queue: Ben Konyi <bkonyi@google.com>
> Auto-Submit: Ben Konyi <bkonyi@google.com>
> Reviewed-by: Johnni Winther <johnniwinther@google.com>
> Reviewed-by: Phil Quitslund <pquitslund@google.com>

Change-Id: I5c6cb302d8160f19bad437341cdcd80bcc08d921
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/384881
Reviewed-by: Siva Annamalai <asiva@google.com>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Reviewed-by: Derek Xu <derekx@google.com>
Auto-Submit: Ben Konyi <bkonyi@google.com>
Commit-Queue: Siva Annamalai <asiva@google.com>
2024-09-12 01:15:27 +00:00
Ben Konyi 81b9957bdd [ CLI ] Don't disable DDS when --disable-dart-dev is provided
Fixes https://github.com/dart-lang/sdk/issues/56605
Fixes https://github.com/dart-lang/sdk/issues/54841

TEST=N/A

Change-Id: I6a13afe5f51fe67d2366c6d87ae74473651e24c8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/383780
Commit-Queue: Ben Konyi <bkonyi@google.com>
Auto-Submit: Ben Konyi <bkonyi@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
2024-09-11 18:01:25 +00:00
Alexander Markov ad94d963ed [dart2bytecode] Remove the requirement for dynamic module to have 'main'
TEST=DART_CONFIGURATION=DebugX64 out/DebugX64/dart-sdk/bin/dart pkg/dynamic_modules/test/runner/main.dart -r aot --verbose

Change-Id: I8647822982b051b4846dfe4ed7e51a19ef466cf9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/384311
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2024-09-10 14:37:00 +00:00
Sigmund Cherem 25bc18c3b3 Add support for AOT in dynamic_modules tests
* Introduce steps to execute tests in AOT (using gen-kernel,
  dart2bytecode, and aot compiler)
* Accept using filesystem-scheme to provide dynamic_interfaces.yaml input
* Accept empty dynamic_interfaces.yaml
* Make temporary test changes to get them running:
   * include core types in dynamic_interfaces that we may want to have
     by default
   * rename entrypoint to `main`

Most existing test pass, the two tests that validate that a library
cannot be defined twice fail (expectation is to throw, bytecode ignores
the second definition).

To run locally:
```
./tool/build.py -m release --dart-dynamic-modules create_sdk
DART_CONFIGURATION=ReleaseX64 out/ReleaseX64/dart-sdk/bin/dart pkg/dynamic_modules/test/runner/main.dart -r aot
```

Tested: CL adds additional test coverage, currently ran manually, integrated in CI in child CL
Change-Id: I4868e765855d9951bff160c18b846aa628f5e0b4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/383928
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
2024-09-10 04:09:21 +00:00
Vyacheslav Egorov af82cadcec [vm] Force inlining of various Struct helpers
Specifically apply prefer-inline to:

* All generated accessors. In general we almost always seem to
select them for inlining through small-accessor heuristic,
but sometimes it does not hit. Marking with pragma ensures
that we are not dependent on specific heuristics to produce
good code.
* Various helpers involved in creating struct instances from
typed data. These we *not* hit by normal heuristics and
consequently not inlined prior to this change. Inlining them
opens possibilities to fully eliminate allocations associated
with `Struct.create(...)` if Struct does not escape.
* Array creation helpers and accessors. They were also not inlined
which meant we were producing unnecessary temporary objects
when reading from inline arrays.

TEST=/vm/dart/ffi_structs_optimizations_il_test

CoreLibraryReviewExempt: no API or behavioral changes
Cq-Include-Trybots: luci.dart.try:vm-aot-linux-product-x64-try,vm-aot-linux-release-x64-try
Change-Id: I1650023200446bd5289118777365627ca19d3e5b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/384261
Commit-Queue: Slava Egorov <vegorov@google.com>
Reviewed-by: Daco Harkes <dacoharkes@google.com>
2024-09-09 15:03:09 +00:00
Deepak Aravind 9c906ddfb7 [cfe/ffi]: Removing .address invalid expression in leaf call to prevent errors
Closes https://github.com/dart-lang/sdk/pull/56594

GitOrigin-RevId: e673d9b13aa00a263632bb25b1ae30b143bdc9fe
Change-Id: If7f9dd27846c0cddb19b3e89acd9fb3cd25dc77f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/382681
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
2024-08-30 20:15:09 +00:00
Alexander Markov 71efc19cc7 [vm/aot,tfa] Remove support for legacy types from TFA
In addition, with sound null safety there is no difference in subtyping
semantic between 'is' and 'as' type checks, so SubtypeTestKind is also
removed.

TEST=ci

Change-Id: Id75ef6a93b115c44b844ef0a32dc8dca5cc61861
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/382900
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2024-08-30 13:55:34 +00:00
Aravind b5928642ff [vm/ffi] Supporting .address.cast() expression in ffi leaf calls
Closes https://github.com/dart-lang/sdk/pull/56357

GitOrigin-RevId: 605e7d3fa5
Change-Id: I79524b443326a161afe221d0a2afb6bed5866e59
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/378221
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Daco Harkes <dacoharkes@google.com>
2024-08-28 06:34:09 +00:00
Alexander Markov 365346f4a5 [vm, tfa] Handle all entry point and dynamic module pragmas on a node
Previously, TFA only handled the first pragma on a class/member
and ignored the rest.

TEST=language tests in vm-aot-dyn-linux-debug-x64 configuration

Change-Id: Ib5c7133cef653a7b60799a3205d5a182844ac40c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/382200
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Slava Egorov <vegorov@google.com>
2024-08-27 15:57:00 +00:00
Vyacheslav Egorov 196f6c90c2 [vm] Create dart:_compact_hash library.
This opens possibility for other core libraries to access implementation
details of compact hash maps/sets and call special "core-library-only"
methods.

TEST=ci

CoreLibraryReviewExempt: VM only library change
Change-Id: I1d7524932c34e6fbe2428853dd547d58bef2d061
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/379840
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Slava Egorov <vegorov@google.com>
Reviewed-by: Lasse Nielsen <lrn@google.com>
2024-08-13 09:20:05 +00:00
Daco Harkes 965234ccbe [vm/ffi] Variable length inline arrays
Adds a new `@Array.variable()` to specify that the last element of
structs is a variable length inline array.

This CL does not add any checks for passing structs with variable
length inline arrays by value or directly calling them with
`AllocatorAlloc.call`. Instead, the implementation defaults to what
C does, allocate as if there are 0 elements in the variable length
inline array.

TEST=tests/ffi/*

CoreLibraryReviewExempt: VM only
Closes: https://github.com/dart-lang/sdk/issues/55964
Change-Id: I524d8a1d710b1a744b392e05fa884908c3ff1f12
Cq-Include-Trybots: dart/try:vm-aot-android-release-arm64c-try,vm-aot-android-release-arm_x64-try,vm-aot-asan-linux-release-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-msan-linux-release-x64-try,vm-aot-obfuscate-linux-release-x64-try,vm-aot-optimization-level-linux-release-x64-try,vm-aot-tsan-linux-release-x64-try,vm-aot-ubsan-linux-release-x64-try,vm-aot-win-debug-arm64-try,vm-aot-win-debug-x64-try,vm-aot-win-debug-x64c-try,vm-appjit-linux-debug-x64-try,vm-asan-linux-release-arm64-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-arm64-try,vm-fuchsia-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-arm64-try,vm-msan-linux-release-x64-try,vm-reload-linux-debug-x64-try,vm-reload-rollback-linux-debug-x64-try,vm-tsan-linux-release-arm64-try,vm-tsan-linux-release-x64-try,vm-ubsan-linux-release-arm64-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/+/371960
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Lasse Nielsen <lrn@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2024-08-06 07:50:49 +00:00
Alexander Markov 4e0b69fbd9 [vm/aot] Improve dynamic interface annotator
Dynamic interface annotator now automatically annotates classes and
members which are used implicitly:

* Targets of redirecting factories.
* Classes and members used in constants.
* Instance fields of classes used in instance constants or
  having a callable const constructor.
* Everything used in the bodies of extendable mixin declarations and
  mixin classes.
* Possible dispatch targets of instance calls
  (overrides/implementations).

Front-end server now also exposes '--dynamic-interface' option,
similar to gen_kernel tool.

Also, this change includes a couple of minor fixes:
* Typo in ast.dart.
* In the front-end server, additional dill file specified with
  '--import-dill' option is not ignored when '--link-platform' is
  also used.

TEST=pkg/vm/testcases/transformations/dynamic_interface_annotator

Change-Id: I705b64efb1834dec6e0bdc5873025607f3472139
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/377761
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2024-07-30 16:24:51 +00:00
Stephen Adams 175dc05db3 [dart2js, pkg/vm] Recognize more BuilderInfo methods.
An upcomming change to protobufs adds a few more BuilderInfo methods
that 'define' fields.

TEST=existing

Change-Id: I78be355ea1458a6a0f2619c63e3ff5838b527533
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/377742
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Nate Biggs <natebiggs@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2024-07-29 20:54:38 +00:00
Daco Harkes 4730365bde [native_assets] Don't tree-shake vm:ffi:native-assets library
Adds a `pragma('vm:entry-point')` to the synthesized library and makes
the tree-shakers respect that pragma on `library`s.

TEST=tests/ffi/native_assets/asset_relative_test.dart

Bug: Found in g3.
Change-Id: I1bc63b42ab867a5f1d2e7f9da4842de59f3d5c1d
Cq-Include-Trybots: dart/try:vm-aot-asan-linux-release-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-msan-linux-release-x64-try,vm-aot-obfuscate-linux-release-x64-try,vm-aot-optimization-level-linux-release-x64-try,vm-aot-tsan-linux-release-x64-try,vm-aot-ubsan-linux-release-x64-try,vm-aot-win-debug-arm64-try,vm-aot-win-debug-x64-try,vm-aot-win-debug-x64c-try,vm-asan-linux-release-arm64-try,vm-msan-linux-release-arm64-try,vm-tsan-linux-release-arm64-try,vm-ubsan-linux-release-arm64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/377442
Auto-Submit: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
2024-07-29 10:29:29 +00:00
Johnni Winther c4368b3cd7 [cfe] Stop passing local scope on the stack
This a LocalStack extension type for using a list as a typed stack and
uses this for local scopes in the body builder, instead of passing the
local scopes through the listener stack.

This also removes the need for LocalScope.parent

TEST=existing

Change-Id: I536c63258e4196a1582e9a1d73489adcfdaa6698
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/376400
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
2024-07-19 14:41:26 +00:00
Jason Simmons e6078ad383 Add dart:concurrent to the list of core libraries used by the Fuchsia flutter_runner
See https://github.com/flutter/flutter/issues/151587

TEST=Flutter CI

Bug: https://github.com/flutter/flutter/issues/151587
Change-Id: Id1eb6410ea34ae164badaed6e94fed6147344a1e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/375440
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Jason Simmons <jsimmons@google.com>
2024-07-11 20:43:12 +00:00
Jason Simmons 7042d5aa5e Add dart:concurrent to the Fuchsia Dart runner's list of core libraries
See https://github.com/flutter/flutter/issues/151587

TEST=local builds of Flutter targeting Fuchsia
Change-Id: I712ecb28661496f0e4be5091b1ad97d1e3cd28f4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/375360
Commit-Queue: Jason Simmons <jsimmons@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
2024-07-11 16:07:40 +00:00
Alexander Aprelev d2bc055651 [vm/shared] Add 'dart:concurrent' core library.
This brings Mutex and ConditionVariable classes to guard access to shared variables.

TEST=shared_test, shared_primitives_test
BUG=https://github.com/dart-lang/sdk/issues/55991
CoreLibraryReviewExempt: dart:concurrent library is experimental, restricted to main/dev channels, vm-only at this point.
Change-Id: I64ca7a0434cbe0079976133ccbf9de2dd4c0d7b1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/372181
Commit-Queue: Alexander Aprelev <aam@google.com>
Reviewed-by: Slava Egorov <vegorov@google.com>
2024-07-10 19:45:29 +00:00
Johnni Winther c17e9c116e [cfe] Clean up backend imports
This updates backend imports to use reexports from api_prototype
or api_unstable.

TEST=existing

Change-Id: I8d9d1c76ef72c709c578acac5497064710ee5579
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/373462
Reviewed-by: Jens Johansen <jensj@google.com>
Reviewed-by: Srujan Gaddam <srujzs@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Ömer Ağacan <omersa@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2024-07-08 11:32:30 +00:00
Jens Johansen 11e1c32467 [CFE] Make file tracking more explicit; step towards hopefully getting rid of CompilerContext.current
TEST=Existing tests.

Change-Id: Ic403670fd0de954fe8827a54c61f7f02ab08fa85
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/373742
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2024-07-08 10:46:13 +00:00
Ömer Sinan Ağacan cc44c910eb [dart2wasm] Move boxed double and int types to their own libs
This allows injecting internally public members int and double members
to the libraries and it's consistent with how we've been restructuring
the dart2wasm standard libraries.

Tested: existing tests
Change-Id: I5261f3ab78667de93b4d7583d99bb9ae151a6cb8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/373241
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Ömer Ağacan <omersa@google.com>
2024-07-05 11:34:34 +00:00
Alexander Markov efab897725 [vm,aot] Fix type check in implicit setter of a covariant field
Inferred type of a covariant field should not be used as
an argument type of an implicit setter, as setter of a covariant
field performs a type check before assigning value to the field.

Correct such uses of covariant field types in unboxing
and AOT type propagation in order to avoid incorrect removal of
a type check in the implicit setter of a covariant field.

TEST=runtime/tests/vm/dart/regress_56051_test.dart
Fixes https://github.com/dart-lang/sdk/issues/56051

Change-Id: I55bfedfd96e918aac9597706c6eab1b81e1202ee
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/372721
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2024-06-25 14:34:20 +00:00
Johnni Winther 8df57398c9 [cfe] Move src/fasta/ subfolders to src/
Part of removing uses of 'fasta'.

TEST=existing

Change-Id: Ice027678e11b7da8c1a7e756a1e1c8c8284722bf
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/372623
Reviewed-by: Jens Johansen <jensj@google.com>
Reviewed-by: Mayank Patke <fishythefish@google.com>
Reviewed-by: Ömer Ağacan <omersa@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2024-06-25 10:05:21 +00:00
Ömer Sinan Ağacan 844ced8016 [dart2wasm] Move list implementations to their own library
This WasmArray-backed list classes to `dart:_list`, similar to
`dart:_string` and `dart:_typed_data`

This will allow having internally-public list members like unchecked
getters and setters that we will use in the rest of the standard
library.

This CL doesn't add anything new, just renames things.

- `dart.core._ListBase` -> `dart._list.WasmListBase`

  This is to avoid confusion with `dart.core.ListBase` (defined by Dart
  standard library), and also to be consistent with `WasmTypedDataBase`
  and `WasmStringBase`.

- `dart.core._List` -> `dart._list.ModifiableFixedLengthList`

  Similar to the above, to avoid confusion with `dart.core.List`.

- `GrowableList.ofOther` -> `GrowableList.fromIterable`

  `ofOther` sounds like it should make a growable list from another
  growable list, but the type is more general than that. To reflect what
  it actually does we call it `fromIterable`.

Tested: Existing tests.
Change-Id: I24398765e1b0d549fc70b03ba94161479c5fc54c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/372622
Commit-Queue: Ömer Ağacan <omersa@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2024-06-21 14:46:58 +00:00
Alexander Markov 6ca015ab20 [vm] Cleanup obsolete pragma vm:non-nullable-result-type
Since sound null safety, 'vm:non-nullable-result-type' pragma is
no longer useful as the same information is conveyed by a non-nullable
return type.

TEST=ci

Change-Id: Ie6a61aca38cfea47cb005b12ca7f0d7631791024
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/372200
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Slava Egorov <vegorov@google.com>
2024-06-20 20:24:44 +00:00
Johnni Winther e40cad30a3 [cfe] Move fasta/codes/ to src/ and rename to cfe_codes*
Part of removing uses of 'fasta'.

TEST=existing

Change-Id: Ibf144a126d8ff4ba15b6cfd2c4fb898e9a499362
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/371685
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Srujan Gaddam <srujzs@google.com>
2024-06-20 09:36:39 +00:00
Devon Carew 3279b0f67d [deps] rev async, dartdoc, http_parser, shelf
Revisions updated by `dart tools/rev_sdk_deps.dart`.

async (a004370..d7c0cd5):
  d7c0cd5  2024-06-17  Kevin Moore  Drop use of pkg:collection whereNotNull() (dart-lang/async#278)

dartdoc (14d33d3..818d1f5):
  818d1f52  2024-06-17  Sam Rawlins  Minor improvement to the 'documentedWhere' comment (dart-lang/dartdoc#3789)
  39591df5  2024-06-17  Sam Rawlins  Pipe the '--stats' flag through for the 'doc sdk' task (dart-lang/dartdoc#3791)
  6b2ee570  2024-06-17  Sam Rawlins  Use 'named' extension in tests (dart-lang/dartdoc#3790)
  fabc394b  2024-06-17  Sam Rawlins  Add more information to various asserts. (dart-lang/dartdoc#3787)
  64982f89  2024-06-17  Parker Lougheed  Update to package:lints v4 (dart-lang/dartdoc#3785)

http_parser (71b4c2c..9bf7bd9):
  9bf7bd9  2024-06-17  Kevin Moore  Prepare release v4.1.0 (dart-lang/http_parser#100)

shelf (4c54af6..2536c15):
  2536c15  2024-06-17  Graciliano Monteiro Passos  `Headers.fromEntries`: using `CaseInsensitiveMap.fromEntries` (dart-lang/shelf#437)

Change-Id: Iff49c7356534f950147b2c0c087e59414a6fc393
Tested: pkg/vm changes are updating test expectations
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/372101
Commit-Queue: Devon Carew <devoncarew@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Auto-Submit: Devon Carew <devoncarew@google.com>
2024-06-18 19:48:38 +00:00
Alexander Markov 0c9067c626 [vm,aot] Preliminary support for dynamic interface in AOT
TEST=runtime/tests/vm/dart/dynamic_module_pragmas_il_test.dart

Change-Id: I6efd24f55726db858711d5f77beabf5659e288a4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/371563
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2024-06-18 14:31:24 +00:00
asiva 7a068fae7d [pkg/kernel-service] Fix invalid index used in expression
TEST=ci
Bug: 55951
Change-Id: I58d3bd361666324f33a0e4b25f5b1e85ffa71440
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/371182
Commit-Queue: Siva Annamalai <asiva@google.com>
Reviewed-by: Derek Xu <derekx@google.com>
2024-06-12 22:13:29 +00:00
Alexander Markov 6ab01427bd [pkg/vm] Consolidate kernel compilation options to an object
TEST=ci

Change-Id: Ic9a8801bff140b1393decde61917e8c61ab1945d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/370721
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Slava Egorov <vegorov@google.com>
2024-06-10 22:56:50 +00:00
Alexander Markov 9a3ca8ffd4 [vm,dart2wasm,tfa] Support dynamic interface in TFA
TEST=pkg/vm/testcases/transformations/type_flow/transformer/dynamic_module_extendable.dart

Change-Id: I6ef43053d86b1a12259f1cb4d0b542c9519591f8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/370143
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2024-06-10 17:28:10 +00:00
Alexander Markov 17e12879fc Dynamic interface yaml file
TEST=pkg/vm/test/transformations/dynamic_interface_annotator_test.dart

Change-Id: Ib620a98b19067c51d913b499274bfed9aaa576f4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/370065
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2024-06-10 16:09:54 +00:00
Johnni Winther 5d8d7941ac [cfe] Remove unnecessary use of Nullability.legacy
TEST=existing

Change-Id: I53b749c53e5f742d778c07571aafb7aff6325c9b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/368560
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Slava Egorov <vegorov@google.com>
2024-05-30 08:10:29 +00:00
Vyacheslav Egorov a4dd314c9e [tools] Allow precompiling gen_kernel and compile_platform
When iterating on core library changes or changes in the AOT compiler
many seconds are wasted waiting on gen_kernel/compile_platform to
parse Dart code. This happens because we are running these tools
from sources on prebuilt Dart SDK.

This CL allows SDK developer to opt-in into AOT compiling these
tools by adding `precompile_tools=true` to their DART_GN_ARGS.

AOT compilation is performed using prebuilt SDK - so these
executables do not need to be recompiled if core libraries or
VM changes reducing iteration cycles.

pkg/vm/tool/precompiler2 is tweaked to detect when DART_GN_ARGS
contains `precompile_tools=true` and use precompiled
gen_kernel.exe instead of running it from source.

Using precompiled compile_platform takes vm_platform_strong.dill
build from 20 seconds to 3 seconds.

Using precompiled gen_kernel takes small benchmark build from
~10 seconds to 2 seconds.

This relands 5cda2a871c with fixes
for Flutter build.

TEST=manually tested

Change-Id: I552861c80c152890655e41baaf6ea3fb3b03a57e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/367961
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Slava Egorov <vegorov@google.com>
2024-05-24 09:40:39 +00:00
Alexander Markov 345b437179 [vm, dart2wasm, tfa] Do not infer nullable return type when static type is non-nullable
With sound null safety, implicit "return null" at the end of function
should be taken into account only if return type is nullable.

TEST=pkg/vm/testcases/transformations/type_flow/transformer/regress_flutter148617.dart

Issue: https://github.com/flutter/flutter/issues/148617
Change-Id: I209fc9a3b10639fd4024d4b1807591498349e1f0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/367980
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2024-05-23 18:19:40 +00:00
Slava Egorov a17d709a1d Revert "[tools] Allow precompiling gen_kernel and compile_platform"
This reverts commit 5cda2a871c.

Reason for revert: broke Flutter build. 

Original change's description:
> [tools] Allow precompiling gen_kernel and compile_platform
>
> When iterating on core library changes or changes in the AOT compiler
> many seconds are wasted waiting on gen_kernel/compile_platform to
> parse Dart code. This happens because we are running these tools
> from sources on prebuilt Dart SDK.
>
> This CL allows SDK developer to opt-in into AOT compiling these
> tools by adding `precompile_tools=true` to their DART_GN_ARGS.
>
> AOT compilation is performed using prebuilt SDK - so these
> executables do not need to be recompiled if core libraries or
> VM changes reducing iteration cycles.
>
> pkg/vm/tool/precompiler2 is tweaked to detect when DART_GN_ARGS
> contains `precompile_tools=true` and use precompiled
> gen_kernel.exe instead of running it from source.
>
> Using precompiled compile_platform takes vm_platform_strong.dill
> build from 20 seconds to 3 seconds.
>
> Using precompiled gen_kernel takes small benchmark build from
> ~10 seconds to 2 seconds.
>
> TEST=manually tested
>
> Change-Id: Ieec6ad4e1081023d140eb744f0a3cd0c754414ca
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/367940
> Commit-Queue: Slava Egorov <vegorov@google.com>
> Reviewed-by: Martin Kustermann <kustermann@google.com>

Change-Id: Id3e4eb44d33516f31c165d9a1e55911e8d356e7f
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/367960
Commit-Queue: Slava Egorov <vegorov@google.com>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2024-05-23 13:52:58 +00:00
Vyacheslav Egorov 945153584c [dartdev] Add --depfile option to dart compile
I would like to add an option to our BUILD
files to precompile gen_kernel and
compile_platform to speedup iteration cycles
when working on core library changes.

To make this robust I would like to use
depfile to track dependencies and know
when compile_platform should be
recompiled.

TEST=pkg/dartdev/test/commands/compile_test.dart
R=kustermann@google.com

Change-Id: Id674f7353342c8275a8a0c4a70e3f5eaeb7f05d5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/367023
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Slava Egorov <vegorov@google.com>
2024-05-23 12:58:29 +00:00
Vyacheslav Egorov 5cda2a871c [tools] Allow precompiling gen_kernel and compile_platform
When iterating on core library changes or changes in the AOT compiler
many seconds are wasted waiting on gen_kernel/compile_platform to
parse Dart code. This happens because we are running these tools
from sources on prebuilt Dart SDK.

This CL allows SDK developer to opt-in into AOT compiling these
tools by adding `precompile_tools=true` to their DART_GN_ARGS.

AOT compilation is performed using prebuilt SDK - so these
executables do not need to be recompiled if core libraries or
VM changes reducing iteration cycles.

pkg/vm/tool/precompiler2 is tweaked to detect when DART_GN_ARGS
contains `precompile_tools=true` and use precompiled
gen_kernel.exe instead of running it from source.

Using precompiled compile_platform takes vm_platform_strong.dill
build from 20 seconds to 3 seconds.

Using precompiled gen_kernel takes small benchmark build from
~10 seconds to 2 seconds.

TEST=manually tested

Change-Id: Ieec6ad4e1081023d140eb744f0a3cd0c754414ca
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/367940
Commit-Queue: Slava Egorov <vegorov@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2024-05-23 12:35:21 +00:00
Martin Kustermann d63a5f2a04 [dart2wasm]/[vm] Use inferred return types of methods in dart2wasm
* Make TFA annotate members with inferred return types
  => We introduce new `vm.inferred-return-type.metadata`
* Make dart2wasm use inferred return types for wasm signatures

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

TEST=Updated expectation files.

Change-Id: If2478255c2bb2633348f475b157f28581481578f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/366540
Reviewed-by: Ömer Ağacan <omersa@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2024-05-17 10:30:31 +00:00
Martin Kustermann 05df51c962 [vm] Use newer language version in package:vm which removes some unnecessary casts
TEST=ci

Change-Id: Ic1218bddf1879054f1d35ac550224a294d03cda8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/366664
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Slava Egorov <vegorov@google.com>
2024-05-16 08:57:40 +00:00
Johnni Winther ae03b57cbb [cfe] Remove .isNonNullableByDefault from package:kernel
This removes the .isNonNullableByDefault properties and similar from
the AST nodes in package:kernel. NNBD is now always enabled so these
properties are trivial.

TEST=existing

Change-Id: I75ca0551ac4b5910ea63530dd0c9c2e68bd01aff
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/366320
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2024-05-15 08:31:38 +00:00
Johnni Winther 310775bd43 [cfe] Remove isNonNullableByDefault argument from messages
Legacy libraries are no longer supported so nullabilities are always
shown in messages.

TEST=existing

Change-Id: Ic1a444c3f5d98baff70a60a2ad0d316d487ea250
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/365824
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
Reviewed-by: Srujan Gaddam <srujzs@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2024-05-14 09:32:01 +00:00
Vyacheslav Egorov 04cc5098ab [vm] Enable test pattern (a&b == 0) fusion in AOT on X64/ARM64
Previously we would only fuse this pattern for Smi operations
which (almost) never happens in AOT. This CL enables fusion
for Int64 operations as well.

The implementation is limited to X64 and ARM64 for now
because implementing it on 32-bit platforms is somewhat
cumbersome.

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

R=alexmarkov@google.com
TEST=vm/cc/IL_TestIntInstr,vm/dart/test_int_pattern_il_test

Cq-Include-Trybots: luci.dart.try:vm-linux-release-simarm-try,vm-aot-linux-release-simarm_x64-try,vm-aot-linux-debug-simarm_x64-try,dart-sdk-linux-riscv64-try,vm-aot-linux-debug-simriscv64-try,vm-ffi-qemu-linux-release-riscv64-try,vm-linux-debug-simriscv64-try,vm-linux-release-ia32-try
Change-Id: I62a482640db45befac6b0b78850f23a8cc624c75
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/365463
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Slava Egorov <vegorov@google.com>
2024-05-11 08:53:29 +00:00