Commit graph

99835 commits

Author SHA1 Message Date
Polina Cherkasova 47f0541c99 Clean up code.
1. Add '_' to libs that are not exported.
2. Remove references from src to root libs.
3. Remove not used code.

No code changes.

Change-Id: Ie344fb7e41decb0ebf6e50d59dc843fb04ca683b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/350692
Commit-Queue: Polina Cherkasova <polinach@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2024-02-12 17:59:57 +00:00
Alexander Markov 632a8baac5 [vm] Avoid altering static types when removing redundant type casts
VM can use static type of receiver in order to omit parameter
type checks. Removing a redundant AsExpression node can incorrectly
change static type of a receiver and break parameter type checks.

So, instead of removing redundant AsExpression nodes they are now
marked as Unchecked. This turns them into a no-op when building
flow graph, but keeps static type unchanged.

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

Change-Id: Ic283158c9b7ba11cb5c140226a6d057e98c8ce77
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/351621
Reviewed-by: Tess Strickland <sstrickl@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2024-02-12 17:54:32 +00:00
Paul Berry 069e8d02ab Remove unused contextType parameters from ResolverVisitor methods.
Change-Id: Icc9aab866cf6596202e45300257af1c4b791a5d5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/352041
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2024-02-12 17:05:38 +00:00
kzrnm 72aceb7732 dart analyze --format=json print a machine readable output
`dart analyze --format=json` has extra output, which must be removed before it can be read by the machine.


R=dacoharkes@google.com, fishythefish@google.com, scheglov@google.com

Bug: https://github.com/dart-lang/sdk/issues/54877
Change-Id: I8047a987b65eb8309ef33603cdaf401a400d550b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/351840
Reviewed-by: Ben Konyi <bkonyi@google.com>
Auto-Submit: Kzrnm <gengesa@gmail.com>
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2024-02-12 17:03:31 +00:00
Jake Macdonald b17156df2c start adding some static error tests for the json macro
Change-Id: Id827bbdf4f93bba3cf511a7008626c82a45d8ffe
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/351760
Reviewed-by: Morgan :) <davidmorgan@google.com>
Commit-Queue: Jake Macdonald <jakemac@google.com>
2024-02-12 16:29:37 +00:00
Derek Xu 6d623f435d Make testee pause on exit in get_perfetto_cpu_samples_rpc_test
Since it currently seems like samples are being collected even after
`testeeDo` has finished, we can give this a try and see if it changes
anything.

Change-Id: Id6f95cfb457b033d17e5e32e3fe073a2f2b9a958
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/352080
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Derek Xu <derekx@google.com>
2024-02-12 16:14:12 +00:00
Parker Lougheed 78dbc184b1 [sdk/js_interop] Clean up and add a few minimal API docs
CoreLibraryReviewExempt: Only touches JS core library documentation.
Change-Id: I7d7f0a2b646f95de8340e9e77d8207cd99c9a1b0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/351940
Reviewed-by: Alexander Thomas <athom@google.com>
Commit-Queue: Alexander Thomas <athom@google.com>
Reviewed-by: Kevin Moore <kevmoo@google.com>
2024-02-12 14:44:54 +00:00
Martin Kustermann aadac65a2e [dart2wasm] Faster string equality
There should be no need to use polymorphic `.codeUnitAt()` calls in
the common case: comparing OneByteString with OneByteString, etc

This increases e.g. LongStringCompare.* benchmarks by 600+%

Change-Id: I1b7b2b53f35237d1ddc1c177c01728629a4acf40
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/352020
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2024-02-12 14:06:50 +00:00
Martin Kustermann 790297b812 [dart2wasm] Use WasmArray<>s for string interpolation expressions
* Use `WasmArray<>`s in string interoplation expressions
* Use `WasmArray<>`s in string buffer implementation
* Avoid making OneByteString+JSString imply TwoByteString

This also increases performance significantly, e.g.
JsonObjectRoundTrip & StringBuffer by 40% in -O4 and even more
speedup in -O2

Change-Id: I25485a6c532c3afed7d92943b6de4d1452930606
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/352000
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2024-02-12 14:01:12 +00:00
Jonas Termansen 45a0e4d9f3 [deps] Bump Chrome to 121.0.6167.85.
Bug: b/297175436
Change-Id: Ib0766cd3be8bc48476b7bf52ff1e73563e90c6fc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/352021
Commit-Queue: Jonas Termansen <sortie@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
2024-02-12 13:16:09 +00:00
Jonas Termansen df473e11cd [deps] Bump Firefox to 122.0.1.
Bug: b/297175436
Change-Id: I43ebc0b20c026cadabff0af591c370a967c6e196
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/352060
Reviewed-by: William Hesse <whesse@google.com>
Auto-Submit: Jonas Termansen <sortie@google.com>
Commit-Queue: William Hesse <whesse@google.com>
Commit-Queue: Jonas Termansen <sortie@google.com>
2024-02-12 13:15:25 +00:00
Martin Kustermann ab09f99638 [dart2wasm] Outline <obj> is/as <type> checks to shared helper functions
This reduces in Flute size of optimized wasm by

  * 1.5% in -O3
  * 0.7% in -O4

We rely on binaryen to inline small enough checks (e.g. `is` check
with a single cid-range)

Change-Id: I8f2c093daebe47d6e066b8681c1e285fa5fa0ea0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/351780
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2024-02-12 12:06:07 +00:00
Jens Johansen c906c3a1ed [CFE/kernel] Fix relink bug with ExtensionTypeDeclaration
Over the weekend the flutter-frontend bot started failing.
This was caused by an update on the flutter side, where a dependency
started using extension types, and revealed a bug with relinking on our
side.
This CL fixes the bug which should make the bot succeed again (as well
as, I think, fix a potential leak/failure if rejecting an advanced
invalidated incremental compilation.
I will add tests in an upcoming CL.

Change-Id: I1e73314b5ce5fe70819f921f9b176c7286b31f8a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/350801
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2024-02-12 11:08:22 +00:00
Jonas Termansen da512538e5 [deps] Bump d8 to 12.3.150.
Switch to the new secure cipd packages. Temporarily check out all of the
versions in their existing locations to ease this transition as a first
step.

Bug: b/324389547
Change-Id: I6b534da02c87b83bb742a8853d31bcaf796bc537
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/350924
Commit-Queue: Jonas Termansen <sortie@google.com>
Reviewed-by: William Hesse <whesse@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2024-02-12 10:25:32 +00:00
David Morgan b907893a59 [CFE] Exclude deleted files from presubmit checks.
Otherwise, explicit creation check tries to check moved file in old location and fails.

R=johnniwinther@google.com

Change-Id: I2edfa3f5230045458c2defb310abb475800037ba
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/351481
Auto-Submit: Morgan :) <davidmorgan@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2024-02-12 08:43:58 +00:00
Erik Ernst f9266472c0 Add extension types to the CHANGELOG.
Change-Id: Id3bf8bd8b0a366ce58eb9070f0e2fa15d55bf07d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/350002
Reviewed-by: Alexander Thomas <athom@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>
Commit-Queue: Alexander Thomas <athom@google.com>
Reviewed-by: Erik Ernst <eernst@google.com>
Auto-Submit: Bob Nystrom <rnystrom@google.com>
2024-02-12 08:20:47 +00:00
Danny Tuppeny 4c8ae57d93 [dap] Restore DAP readme
This was accidentally lost in https://dart-review.googlesource.com/c/sdk/+/344021 after the package moved from pkg to third_party/pkg.

Change-Id: I926c2c439b4015bb4cdb5b5aec12b47d6ecfe6a0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/350280
Reviewed-by: Alexander Thomas <athom@google.com>
Commit-Queue: Alexander Thomas <athom@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2024-02-12 07:54:09 +00:00
Matthew Berry 519799a8d8 Add missing closing quotes to examples
Closes https://github.com/dart-lang/sdk/pull/54850

GitOrigin-RevId: 95290859570ee03cb93e6ecace4f05cde1d55dbd
Change-Id: I041ba5b5862db58e19a7d4724222183fb3de803e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/350942
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2024-02-11 01:41:02 +00:00
Stephen Adams d8456b7cd8 [dart2js] Take more care generating read-modify-write expressions
Bug: #54823
Change-Id: I97ed64c6b487e989fd95704916af0b3aa4cc1e0e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/350407
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Nate Biggs <natebiggs@google.com>
2024-02-10 16:39:59 +00:00
Konstantin Shcheglov 23c232e0a3 Macro. Tests for 'typeParameters' in FunctionTypeAnnotation.
Some renames in implementation.

Change-Id: Ib8860d8574061c3d3681f4ff2b6676291a257138
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/351640
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2024-02-10 01:08:28 +00:00
Konstantin Shcheglov 2e7290a727 Macro. Report diagnostics for library directive macro applications.
Change-Id: I7b8e011b3bfd01cd6fb534708e832f834a913091
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/351660
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2024-02-10 01:07:39 +00:00
Konstantin Shcheglov 8780e559ec analyzer/test/src/summary/macro_test: Slow, Pass
Change-Id: Ic295fe3c12a7c78723fdc8c308777a6ee547ca68
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/351681
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2024-02-09 23:47:32 +00:00
Brian Wilkerson 2e2aaf0604 Revert "Preserve non-synthetic function types when resolving invocations of functions with type parameters"
This reverts commit 7ad5a57bf2.

Reason for revert:

This breaks tests in Flutter. In particular, it causes the lint `avoid_redundant_argument_values` to start producing diagnostics in places where it wasn't previously able to do so.

The failures can be seen at https://logs.chromium.org/logs/dart/buildbucket/cr-buildbucket/8756630800427013937/+/u/analyze_flutter_flutter/stdout.

In order to re-land this CL we will first need to verify that all of the new reports are valid (that there aren't any false positives), and then fixes will need to land in flutter. After that we can try re-landing this CL.

Original change's description:
> Preserve non-synthetic function types when resolving invocations of functions with type parameters
>
>
> Update existing tests to require existing parameter elements
>
>
> Add tests for staticParameterElement in generic functions
>
> R=leafp@google.com
>
> Bug: https://dartbug.com/54669
> Change-Id: Ie899f58df56ad1a6b49426ca4d7f4e611975b284
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/350920
> Auto-Submit: Mylo Fawcett <mylo.fawcett@gmail.com>
> Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
> Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
> Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>

Bug: https://dartbug.com/54669
Change-Id: I29cade78577eac8442eb53a7d9c38d384e7913c3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/351682
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
2024-02-09 23:42:39 +00:00
Konstantin Shcheglov 3125174cb1 Macro. Add 'correctionMessage' to MacroDiagnostic.
Note, that currently `correctionMessage` is a property of `ErrorCode`,
so we cannot forward from macro diagnostic. Something to discuss.

Change-Id: I6de86f4c16356bbf7bd61c483bad4d039ca67638
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/351620
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2024-02-09 23:12:10 +00:00
Ben Konyi 670b9ba9cf [ CLI ] Make dart {compile,build} error exit codes consistent on Windows
Setting an error code of -1 on macOS and Linux results in an error code
of 255 being set since negative error codes are subtracted from 256.
However, an error code of -1 on Windows is not converted in the same
way, resulting in a difference of behavior between OSes.

This change updates -1 error codes to be 255 so they're the same on all
OSes.

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

Change-Id: Idcfbfab30d3cc31a9e4ca630b8d94caa03ef07b4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/351500
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2024-02-09 22:47:39 +00:00
Konstantin Shcheglov adee0a2399 Extension type. Implement isIncompatibleWithAwait() predicate, report AWAIT_OF_INCOMPATIBLE_TYPE.
Change-Id: I8f562db3fb3399704369725fdfba49c52bb14ab8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/350986
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Keerti Parthasarathy <keertip@google.com>
2024-02-09 22:11:21 +00:00
Konstantin Shcheglov e7f79cad7c Macro. Report INVALID_MACRO_APPLICATION_TARGET.
Change-Id: I7597d81cb2c9db9488533d6d372b244b74ff97ba
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/350691
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2024-02-09 21:54:16 +00:00
Daco Harkes 6547ab18b1 [cfe/ffi] Reformat code
Reformats the code to use more newlines and less long lines.
Landing as a separate CL before refactoring to ease reviewing.

TEST=ffi suite

Change-Id: I018be8f27f19c312d36b112118291016b6be0ff4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/351145
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2024-02-09 21:27:29 +00:00
Daco Harkes ddfc00e773 [vm/ffi] Unify TypedDataBase wrappers
For getting the address of `Struct` fields and `Array` elements
it would be useful to access the `_typedDataBase` field in these
'wrappers' in a unified way.

This CL makes `Array` extend `_Compound`.
Since `Array` is not a `SizedNativeType`, the implements clauses
for `Struct` and `Union` are moved to these classes.

Moreover, any references to 'compound' which only apply to struct or
union are updated.

TEST=test/ffi

Bug: https://github.com/dart-lang/sdk/issues/44589
Bug: https://github.com/dart-lang/sdk/issues/54739
Bug: https://github.com/dart-lang/sdk/issues/41237

CoreLibraryReviewExempt: No API change, only refactoring.
Change-Id: Ib9d8bccd4872df04bcc67731e4052f826ab70af4
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-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-release-ia32-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/350960
Reviewed-by: Martin Kustermann <kustermann@google.com>
Reviewed-by: Liam Appelbe <liama@google.com>
2024-02-09 21:27:29 +00:00
Daco Harkes fbee607329 [vm/ffi] Cleanup tests
Address all warnings and errors in positive tests.

Move all static checks tests to tests/ffi/static_checks/ so it's
easier to ignore them in the analyzer.

Change-Id: I16ac2c00432a4e1b6750bffd9b03ac8a2e988fe6
Cq-Include-Trybots: luci.dart.try:vm-fuchsia-release-arm64-try,vm-fuchsia-release-x64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/351123
Reviewed-by: Liam Appelbe <liama@google.com>
2024-02-09 21:27:29 +00:00
Keerti Parthasarathy dc339962c3 Fix test on windows
Change-Id: Ie2cdd561636e24bc77a5126a159e6e031db5bed6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/351561
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Keerti Parthasarathy <keertip@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2024-02-09 19:33:32 +00:00
Dan Chevalier 29d709bf24 Roll Devtools version forwards to 1f208c84965e9edddea11485fb73b170dba1cd96
Change-Id: I72f4fad0cccfc61e4c7995ee2f81411d49c84807
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/351440
Commit-Queue: Dan Chevalier <danchevalier@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
Reviewed-by: Kenzie Davisson <kenzieschmoll@google.com>
2024-02-09 18:42:18 +00:00
Mayank Patke c556766395 [dart2js] Expose JS_TRUE and JS_FALSE via dart2js_runtime_metrics.
dart2js already had an external function in foreign_helper called
JS_FALSE. This function is completely opaque until it is lowered to the
constant value `false` in SSA, so one can write `if (JS_FALSE())` in
order to ensure that the guarded code is treated as live and compiled,
but eventually tree-shaken and omitted from SSA and codegen.

This CL adds a JS_TRUE counterpart for completeness, and exposes both
JS_TRUE and JS_FALSE through package:dart2js_runtime_metrics.

Change-Id: I9b375fa37ada1b65fb9183902bb295e05fa6b8c5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/349704
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Mayank Patke <fishythefish@google.com>
2024-02-09 18:38:55 +00:00
Mayank Patke 85037bf96d [dart2js, ddc] Clean up conditional imports in dart2js_runtime_metrics
This CL:
* adds empty dart:_dart2js_only and dart:_ddc_only libraries for use in
  conditional imports,
* updates pkg/dart2js_runtime_metrics to use the new libraries rather
  than dart:_dart2js_runtime_metrics and dart:js,
* and removes some unnecessary libraries, including VM-specific
  implementations in pkg/dart2js_runtime_metrics and the DDC
  implementation of dart:_dart2js_runtime_metrics.

Change-Id: I9500aa303fa5ad8aba0e1d413f69957c268f3f11
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/350681
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2024-02-09 18:38:55 +00:00
Nicholas Shahan 08f0ffeb60 Revert "[ddc] Fix running d8 with test.py"
This reverts commit 244f8cee87.

Reason for revert: Breaks windows builds.

Original change's description:
> [ddc] Fix running d8 with test.py
>
> - Add build targets to compile .dill outlines for common test 
>   dependencies using kernel_worker.dart.
> - Build ddc modules for common test dependencies and move amd versions
>   to a separate subdirectory.
>
> Change-Id: I126b5821f6aea00b753d83560c76f00c6c5edc61
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/350081
> Reviewed-by: Sigmund Cherem <sigmund@google.com>
> Commit-Queue: Nicholas Shahan <nshahan@google.com>

Change-Id: Ic5a17edc323b298eb8d60c82c755c6929e2cacc3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/351520
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Auto-Submit: Nicholas Shahan <nshahan@google.com>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
2024-02-09 18:25:56 +00:00
Nate Biggs 69e2b2473d [dart2js] Add closed world proto shaking to Dart2js.
Reachability of proto fields is based on the VM's TFA protobuf_handler:
https://github.com/dart-lang/sdk/blob/main/pkg/vm/lib/transformations/type_flow/protobuf_handler.dart

In summary:
Usages of messages' field accessors are detected and registered. If no accessors for a specific field are used then the field is considered unreachable. In this case the metadata initializer for the field is replaced with a placeholder. Any protobuf messages only reachable from erased metadata initializers are also considered unreachable and are erased.

Note: The protobuf library exposes some reflective accessors which this algorithm does not detect usages of. If a field is only accessed reflectively this algorithm will still erase it and therefore users of these reflective accessors should not enable this protobuf shaking.

Protobuf shaking is disabled by default so this change will have no immediate effect on compilations.

Change-Id: I5ddf749bac4ebdcaf364de1cc9a16395a0ad8050
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/349760
Reviewed-by: Mayank Patke <fishythefish@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Nate Biggs <natebiggs@google.com>
2024-02-09 17:43:09 +00:00
Paul Berry 6bd1df749c Remove contextType parameters from methods that don't use them.
All of these methods used to need a `contextType` parameter to pass to
the null safety migration tool. Now that the migration tool no longer
exists, they can be simplified.

Change-Id: Id6b15d88d8b0174022705c00fd524d17007a11e5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/351460
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2024-02-09 17:39:38 +00:00
Martin Kustermann 96f361f0fa Roll jsshell/jsc to newer versions
(The automated infra to create new D8 versions has some issues atm)

Change-Id: I5a43566f763eb3d9efeba0f0cab0357a802b33b3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/351061
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: William Hesse <whesse@google.com>
2024-02-09 16:40:53 +00:00
Martin Kustermann 045cb8a087 [gardening] Attempt to fix riscv64 sdk build after binaryen roll
The riscv64 sdk builders build with --no-clang, thereby issuing
different set of warnings from clang.

Change-Id: I8c9a222bd9ea03fb78b5779fc5c652c22afb0543
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/351085
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: William Hesse <whesse@google.com>
2024-02-09 16:18:54 +00:00
Sigmund Cherem 1be46a8ec5 [dart2js] only suggest to use the preamble in server-mode
This removes the logic that checks whether `dart:html` was
loaded in order to decide whether or not to show the message
suggesting to load the preamble file.

As described in https://github.com/dart-lang/sdk/issues/54596
this criteria is now obsolete, since we are shifting to use
package:web instead of dart:html in flutter web.

Going forward, the message is shown only when running the
compiler with the `--server-mode` flag.

We still track whether the preamble may be needed, but it may
not be worth doing all that effort in the future.
The alternative would be to show the message always
when using `--server-mode` or never (and rely instead
on documentation).

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

Change-Id: I177184590b4118be333ab93ddf5951e5b01afe7e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/351320
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
2024-02-09 16:08:38 +00:00
Alexander Markov 97164b3a01 [vm/jit] Disable field guards for late fields
Late field inialization stubs don't update field guard state which
causes incorrect optimizations when they rely on that state.
This change disables field guards for late fields in order to fix this
bug.

As an alternative, we could have added the code to update field guard
state from late field initialization stubs. However, it would require
duplicating and generalizing a lot of code used to implement
GuardFieldClass, GuardFieldLength and GuardFieldType instructions.
At the moment it is not clear if field guards provide sufficient
performance improvements to justify this.

Another possible approach would be to outline initializing field
stores from the stubs back to the application code
but that would cause either substantial increase in AOT code size
or an undesired discrenacy between JIT and AOT.

TEST=runtime/tests/vm/dart/regress_flutter142532_test.dart
Fixes https://github.com/flutter/flutter/issues/142532

Change-Id: I15e737aa5d1b73e71e0cb935580a3b9a2dcbb77a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/350985
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Slava Egorov <vegorov@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2024-02-09 14:59:40 +00:00
Martin Kustermann e7e681264a [dart2wasm] Roll to binaryen to same version as g3 (which is much newer)
Change-Id: I7517463aa311335932e0d8b304df852326798ce0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/350582
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2024-02-09 14:23:37 +00:00
Paul Berry 9d39c79471 Change packages analyzer and _fe_analyzer_shared to use language version 3.2.
This will allow these packages to take advantage of private field
promotion.

Change-Id: I35dc57ecd7a0c3afde4713cd60aca86b479393a3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/351162
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2024-02-09 14:19:30 +00:00
Vyacheslav Egorov 14f7622ef4 [vm] Remove bin/*_android{.cc,.h} and use Linux implementations.
Android is based on Linux, so most of the files were identical
sans some subtle discrepancies caused by drift over time.

This discrepancies were making code base harder to maintain and in fact
were hiding bugs. For example, on Android eventhandler's implementation
of timers which relied on passing timeout to `epoll_wait` contained
a bug which was not present on Linux which used `timerfd` instead.

TEST=ci and manual testing of Flutter app on Android device

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

Cq-Include-Trybots: luci.dart.try:vm-aot-android-release-arm64c-try,vm-aot-android-release-arm_x64-try,vm-ffi-android-debug-arm-try,vm-ffi-android-debug-arm64c-try,vm-ffi-android-product-arm-try,vm-ffi-android-product-arm64c-try,vm-ffi-android-release-arm-try,vm-ffi-android-release-arm64c-try
Bug: b/311165013
Change-Id: Ia166f69c14177ec34160805a0983eafee8ea65f6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/350923
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Slava Egorov <vegorov@google.com>
2024-02-09 14:10:49 +00:00
Chloe Stefantsova 2564dc0b89 [cfe] Add CloneProcedureWithoutBody.cloneProcedureWithParameters
Change-Id: I13b0aeede9221d9fdb03b6dc05d068a906c6851a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/350864
Commit-Queue: Chloe Stefantsova <cstefantsova@google.com>
Reviewed-by: Daco Harkes <dacoharkes@google.com>
2024-02-09 13:51:33 +00:00
Jonas Termansen 6dcd8f78df [infra] Document how to self service update javascript engines.
Bug: b/324389547
Change-Id: I2da77aa390d780b151f5b6fbbc8ef8b24fc34bad
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/351142
Reviewed-by: William Hesse <whesse@google.com>
Commit-Queue: Jonas Termansen <sortie@google.com>
2024-02-09 13:06:47 +00:00
Sergey G. Grekhov 36e4a5e69a [co19] Roll co19 to 80711f456b9a9ccaf345892098aa75d978cf6dc3
2024-02-08 sgrekhov22@gmail.com dart-lang/co19#2529. Remove tests with compile-time errors from core and html folders (dart-lang/co19#2530)
2024-02-08 sgrekhov22@gmail.com dart-lang/co19#2522. Move flow-analysis weak tests to TypeSystem dir (dart-lang/co19#2527)
2024-02-08 sgrekhov22@gmail.com Fix dart-lang/co19#2515. Remove strong-mode tests checking interaction with legacy (dart-lang/co19#2528)
2024-02-07 sgrekhov22@gmail.com dart-lang/co19#2522. Move type-normalization weak tests to TypeSystem dir (dart-lang/co19#2526)
2024-02-07 sgrekhov22@gmail.com dart-lang/co19#2522. Move subtyping tests to TypeSystem dir (dart-lang/co19#2525)
2024-02-07 sgrekhov22@gmail.com dart-lang/co19#2522. Move type-normalization tests to TypeSystem dir (dart-lang/co19#2524)
2024-02-06 sgrekhov22@gmail.com dart-lang/co19#2522. Move flow-analysis tests to TypeSystem dir (dart-lang/co19#2523)
2024-02-05 sgrekhov22@gmail.com Fix dart-lang/co19#2403. Add test for the new UP algorithm (dart-lang/co19#2520)
2024-02-05 sgrekhov22@gmail.com dart-lang/co19#2515. Fix const_evaluation_A10_t01.dart failure (dart-lang/co19#2519)

Change-Id: Ib6c00729b4a6aed3cb7ba2816eb46012ddef73a2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/350922
Reviewed-by: Erik Ernst <eernst@google.com>
Reviewed-by: William Hesse <whesse@google.com>
Commit-Queue: Erik Ernst <eernst@google.com>
2024-02-09 10:43:49 +00:00
Daco Harkes aa1a9c8cc2 Add OWNERS to pkg/front_end/testcases/
Changes to `dart:ffi` often lead to expect-file updates. VM engineers
should be able to review and approve these changes.

So, this CL adds the VM engineers as owners of the test cases.

Change-Id: I84609b1bc74e1c15964f00b473a2bd3eed1fdf50
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/351122
Auto-Submit: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
2024-02-09 08:36:00 +00:00
Jake Macdonald 22264a24c8 add TypeParameter interface, for function type parameters which are not Declarations
Bug: https://github.com/dart-lang/language/issues/3559
Change-Id: I98d20e9f3b84d89c985fddb10ed1dc5e7c651b7e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/346640
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Auto-Submit: Jake Macdonald <jakemac@google.com>
2024-02-09 08:35:28 +00:00
Sigmund Cherem d82be109a2 [jsinterop] fix lowering of callMethod unchecked calls.
The lowering for external calls works in multiple steps:
- we first expand it into a `js_util.callMethod` call (which uses .apply
  internally)
- which we later refine in to a `js_util._callMethodUncheckedN` call, if
  possible (which calls the member directly)

The second step only happens if we can statically verify the arity of
the method being called and that every argument passed doesn't need a
allow-interop check. The latter is bypassed if we know from the types
that it cannot be a Dart Function.

The new JS interop always satisfies the check, but the second step above
failed to regonize it because it didn't account for extension types. This
CL does the incremental fix to recognize it. Long term, we should
instead change the lowering to use directly the js_interop_unsafe
methods, and tailor the lowering to the new interop.

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

Change-Id: Ieee560e5cd6bd9b6921368477bf8212cae5a1faa
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/351221
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Srujan Gaddam <srujzs@google.com>
2024-02-09 01:59:46 +00:00