Commit graph

100423 commits

Author SHA1 Message Date
Ryan Macnak 8da86ee19e Roll zlib to 24c07df5033183efad8607cba62e746bea7180bf.
Note that Chromium's copy of zlib now has a dependency on the cpu_features library.

Change-Id: I0f2c306aa7eb0e1deb8fa4c45e4a04f1fee8bb83
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/359600
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2024-03-26 19:55:45 +00:00
Jake Macdonald 631939e109 Prep to release package:macros
- update SDK dependency to ensure it supports SDK vendored packages
- sync pubspec/changelog versions

Change-Id: Ib79244bec43fc94bf12340241f6eab4001e4b21c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/359920
Commit-Queue: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Bob Nystrom <rnystrom@google.com>
Commit-Queue: Jake Macdonald <jakemac@google.com>
Auto-Submit: Jake Macdonald <jakemac@google.com>
2024-03-26 19:51:01 +00:00
Devon Carew 571ec4e2bd [deps] rev crypto, csslib, dartdoc, http, markdown, web
Revisions updated by `dart tools/rev_sdk_deps.dart`.

crypto (f059196..69d13c9):
  69d13c9  2024-03-21  Kevin Moore  Switch sha512 to use fastpath with wasm (dart-lang/crypto#165)

csslib (b58e487..4216525):
  4216525  2024-03-21  Devon Carew  prep for publishing 1.0.1 (dart-lang/csslib#197)

dartdoc (7be9e24..79c1675):
  79c16759  2024-03-25  Parker Lougheed  Migrate client code to package:web (dart-lang/dartdoc#3610)
  0b1c7fa4  2024-03-25  dependabot[bot]  Bump actions/cache from 4.0.1 to 4.0.2 (dart-lang/dartdoc#3734)
  9fe35ec5  2024-03-20  Sam Rawlins  mustachio: Separate out the context stack LUB type calculation (dart-lang/dartdoc#3730)

http (5dfea72..7949d6f):
  7949d6f  2024-03-25  Brian Quinlan  cupertino_http: upgrade ffigen version (dart-lang/http#1159)
  051482a  2024-03-22  Brian Quinlan  Ready cupertino_http for release with WebSocket support (dart-lang/http#1158)
  988b4d4  2024-03-20  Brian Quinlan  Prepare package:cronet_http 1.2 for release (dart-lang/http#1157)
  69f4eff  2024-03-20  Hossein Yousefi  [cronet_http] Upgrade jni to 0.7.3 (dart-lang/http#1156)
  d8b1a9e  2024-03-19  Brian Quinlan  Release `package:web_socket` 0.1.0 (dart-lang/http#1155)
  cfbc191  2024-03-19  Brian Quinlan  Add a WebSocket implementation to package:cupertino_http (dart-lang/http#1153)

markdown (9c6b1af..8d07abc):
  8d07abc  2024-03-19  MJ Studio  Link uri encoding, URL-escaping should be left alone inside the destination (dart-lang/markdown#598)

web (4af904f..c522718):
  c522718  2024-03-20  Kevin Moore  Update MDN documentation (dart-lang/web#213)
  f80dcab  2024-03-15  Srujan Gaddam  Update pubspec description to be consistent with README (dart-lang/web#210)
  27936c4  2024-03-15  Devon Carew  Generate api docs for getters (dart-lang/web#207)
  2f13cd5  2024-03-12  Devon Carew  fix unresolved dartdoc links (dart-lang/web#200)
  686827a  2024-03-12  Srujan Gaddam  Remove reference to static interop and point to dart.dev page for JS interop (dart-lang/web#206)
  9b7e29d  2024-03-12  Devon Carew  Add a 'sourced from mdn docs' line to the MDN sourced dartdoc (dart-lang/web#198)
  51e594b  2024-03-05  Srujan Gaddam  Fix dictionary constructors to accept supertype members and create an empty object when there are no fields (dart-lang/web#197)

Change-Id: Ic90c6f5a7e7d701746276031a8028cdfe76bc27a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/359880
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Devon Carew <devoncarew@google.com>
2024-03-26 19:47:42 +00:00
Konstantin Shcheglov 36c0788137 add package:_macros (SDK vendored) and package:macros (pub published)
add sdk_packages.yaml file (describes SDK vendored package locations)

delete old macro code in _fe_analyzer_shared, move tests/benchmarks

adds a top level `pkg` directory to the Dart SDK, which is where vendored packages live

BUG: https://github.com/dart-lang/sdk/issues/54976
Change-Id: Ib3503a27fb5644fa8a39ab5a3e5b568df330cfd6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/359040
Auto-Submit: Jake Macdonald <jakemac@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Jonas Termansen <sortie@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Bob Nystrom <rnystrom@google.com>
Commit-Queue: Jake Macdonald <jakemac@google.com>
Reviewed-by: Devon Carew <devoncarew@google.com>
2024-03-26 18:40:00 +00:00
Daco Harkes 0bcb0c934d [vm/ffi] Add _Compound _offsetInBytes field
This CL changes compounds (structs, unions, and arrays) to be backed
by a TypedDataBase and an int offset.

Before this CL, the compounds where only backed by a TypedDataBase.
This leads to the following issues:

1. Access to nested structs required code for allocating new typed data
   views or pointers, which the optimizer then had to prevent from
   being allocated after inlining.
2. Runtime branching on whether the TypedDataBase was a Pointer or
   TypedData increased code size and prevented inlining.
   https://github.com/dart-lang/sdk/issues/54892
   This could not be properly optimized if in AOT both typed
   data and pointer were flowing into the same compound.
3. Constructing TypedData views required calculating the length of the
   view.

After this CL, accessing nested compounds will lead to accesses on the
original TypedDataBase with an extra offset.

This removes the polymorphism on TypedData vs Pointer, because the
final int/float/Pointer accesses in nested compounds operate on
TypedDataBase.

Also, it simplifies creating an `offsetBy` accessor, because it will
no longer have to be polymorphic in typed data vs pointer, nor will it
have to calculate the length of the field.

Implementation details:

* The changes in the CFE and patch files are straightforward.
* VM: Struct-by-value returns (or callback params) are initialized
  with an offsetInBytes of 0.
* VM: Struct-by-value arguments (and callback return) need to read out
  the offsetInBytes. Before this CL we were passing in the TypedData
  as tagged value. With this CL we are passing the TypedData as tagged
  value and the offset as unboxed int, from 1 IL input to 2 IL
  inputs. (The alternative would have been to take the compound as
  a tagged value, but that would have prevented optimizations from not
  allocating the compound object in the optimizer.
  The FfiCallInstr is updated to have two definitions for the case
  where we were passing in the TypedData previously.
  The NativeReturnInstr is refactored to be able to take two inputs
  instead of 1. (Note that we don't have VariadicInstr only
  VariadicDefinition in the code base. So the instruction is _not_
  implemented as variadic, rather as having a fixed length of 2.)
* dart2wasm does no longer support nested compounds due to the
  compound implementation only storing a pointer address.
  https://github.com/dart-lang/sdk/issues/55083

Intending to land this after
https://dart-review.googlesource.com/c/sdk/+/353101.

TEST=test/ffi

CoreLibraryReviewExempt: VM and WASM-only implementation change.
Closes: https://github.com/dart-lang/sdk/issues/54892
Bug: https://github.com/dart-lang/sdk/issues/44589
Change-Id: I8749e21094bf8fa2d5ff1e48b6b002c375232eb5
Cq-Include-Trybots: dart-internal/g3.dart-internal.try:g3-cbuild-try
Cq-Include-Trybots: 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-aot-win-debug-x64c-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-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/+/354226
Reviewed-by: Tess Strickland <sstrickl@google.com>
2024-03-26 17:14:13 +00:00
Jake Macdonald 8df8de82b3 Ensure that the pubspecs of both _macros and macros packages are updated whenever the lib/ dir of _macros is edited.
Related to https://dart-review.googlesource.com/c/sdk/+/359040

Change-Id: Iab3cfa89e0492282c348c6a72f3032191fa4998f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/359580
Auto-Submit: Jake Macdonald <jakemac@google.com>
Commit-Queue: Jake Macdonald <jakemac@google.com>
Reviewed-by: Bob Nystrom <rnystrom@google.com>
2024-03-26 16:49:16 +00:00
Srujan Gaddam d1a949a8e5 Add static tests for external extension members on extension types
We have tests for whether external extension members are allowed
on certain classes, but not extension types.

Also rewords the error to be more accurate.

Change-Id: I61c1fa4c101971986b6c8e7cc778aca94908816a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/358380
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Srujan Gaddam <srujzs@google.com>
2024-03-26 15:43:19 +00:00
Srujan Gaddam 1232260158 [dart:js_interop] Add ExternalDartReference
Closes https://github.com/dart-lang/sdk/issues/55187

Adds a faster way for users to pass opaque Dart values to
JS without the need for boxing like in JSBoxedDartObject.
This does mean, however, that this new type can't be a JS type,
and therefore cannot have interop members declared on it.
Refactors existing code to handle that distinction.

CoreLibraryReviewExempt: Backend-specific library that's been reviewed by both dart2wasm and JS compiler teams.
Change-Id: Ia86f1fe3476512fc0e5f382e05739713b687f092
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/358224
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2024-03-26 15:43:19 +00:00
Sam Rawlins bcf64bdfeb linter: Adjust require_trailing_commas reported token, and description
Fixes https://github.com/dart-lang/linter/issues/4918

I migrated relevant tests.

Description fixes:

* Don't use "function calls" or "declarations". First, I don't think
  we use the term "function call" much, I could be wrong. Second, it's
  not about function calls or declarations. It's about parameter lists
  and argument lists.
* Remove more mixing up of parameters and arguments. E.g. A "final
  parameter" cannot be a list literal.
* Fix naming of "literal array" to "list literal" and a few others.

Change-Id: I15844f4a34dc4fe08f15dc00bce2592ec12ce5c7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/359841
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2024-03-26 15:38:49 +00:00
Jonas Termansen d7ee76326d Clarify risk and multiple channel CLs in cherry-pick request template.
Clarify the same CP request can be used for both beta and stable and
make more room for doing so, as well as including a whole list of
changelists to be cherry-picked for complicated cases. Clarify distinct
gerrit CLs are needed for beta and stable.

Replace the informationless risk field that everyone says is low with a
mandatory question to explain the actual risk involved.

Fixes: b/329611671
Change-Id: Ibfb81d89722c237e4b8a531bcac2d475798369b7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/357603
Commit-Queue: Jonas Termansen <sortie@google.com>
Reviewed-by: Kevin Chisholm <kevinjchisholm@google.com>
2024-03-26 15:29:23 +00:00
Alexander Markov 3545100e32 [vm] Fix build
Fix the build failure after revert landed on top of
ReturnInstr -> DartReturnInstr rename.

TEST=local build

Change-Id: Ic0c7208485b9b3d1e6525cb8f31e3113765fd317
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/359843
Commit-Queue: Siva Annamalai <asiva@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
Auto-Submit: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2024-03-26 14:38:51 +00:00
Alexander Markov 28258e54fd Revert "[vm/compiler] Move handling of recognized methods from inliner to call specializer"
This reverts commit eebc219bab.

Reason for revert: performance regressions

Original change's description:
> [vm/compiler] Move handling of recognized methods from inliner to call specializer
>
> This refactoring reduces number of places where recognized methods are
> handled and cleans up general-purpose inliner pass.
>
> The code is mostly moved as is to simplify reviewing, with a notable
> exception: in a few places handling of recognized method calls is
> removed as it duplicates handling performed during call specialization
> passes (ApplyClassIds and ApplyICData) which run both before and after
> inlining.
>
> TEST=ci
>
> Change-Id: I8d53d23587beb09e6edf64ee95524f6ad3e060de
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/358221
> Reviewed-by: Slava Egorov <vegorov@google.com>
> Commit-Queue: Alexander Markov <alexmarkov@google.com>

Change-Id: I9576bc4b385b5d0e0b728556defedb4962ec0a8a
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/359842
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Auto-Submit: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Siva Annamalai <asiva@google.com>
2024-03-26 14:25:38 +00:00
Daco Harkes 77d10f2ed9 [vm] Split DartReturnInstr and NativeReturnInstr
Renames `ReturnInstr` to `DartReturnInstr`, and introduces a new
`ReturnBaseInstr` to be the common parent of `DartReturnInstr` and
`NativeReturnInstr`. (Before this CL, `NativeReturnInstr` was a
subtype of `ReturnInstr`.)

In a follow up CL, the `NativeReturnInstr` will get up to two inputs.
https://dart-review.googlesource.com/c/sdk/+/354226
Therefore, the `ReturnBaseInstr` does not inherit from `TemplateInstr`
with 1 input, but instead only inherits from `Instruction`.

TEST=SDK build
TEST=*_il_test.dart

Change-Id: I017eb7802ae6c902b64f1cda20edf4a11408dbe1
Cq-Include-Trybots: luci.dart.try:vm-aot-linux-debug-x64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/358904
Reviewed-by: Tess Strickland <sstrickl@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
2024-03-26 11:12:38 +00:00
Jonas Termansen 05936f4d0b [infra] Fail hard if starting RBE fails.
The build isn't going to go through anyway and the slow 3 minute default
timeout is just confusing and annoying when this happens. There isn't
any additional useful context being output like the comment suggested.

Bug: b/331346866
Change-Id: I0475002469c372fefe3a54d104b54692c89ca9f5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/359800
Commit-Queue: Jonas Termansen <sortie@google.com>
Reviewed-by: Daco Harkes <dacoharkes@google.com>
2024-03-26 11:10:48 +00:00
Daco Harkes 2b2c6ec267 [wasm] Update owners
Make dart2wasm self-administrated.

Jackson as dart2wasm contributor.
Add self as `dart:ffi` maintainer.

Change-Id: Ie339aab443e120dfd00a94d0c4130b47984bf0db
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/359060
Reviewed-by: Jonas Termansen <sortie@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
2024-03-26 10:01:22 +00:00
Kallen Tu 93d2d44b26 Add code block type to MdCodeBlock.
Adds a code block type to `MdCodeBlock` which will allow us to differentiate between fenced code blocks and indented code blocks with the `missing_code_block_language_in_doc_comment` lint (since only fenced code blocks care about a missing info/language string).

Updated tests and added it to the AST printer as well.

Change-Id: Ibffc4edc7708fdc0394b24db8da7c282ffe92eba
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/358326
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Kallen Tu <kallentu@google.com>
Reviewed-by: Bob Nystrom <rnystrom@google.com>
2024-03-26 06:57:47 +00:00
Sigmund Cherem 34b7df107f [ddc] do not fail during cleanup of expression_compiler tests.
Currently our end-2-end tests create a temporary folder and delete
it after the suite has completed. Only one folder is created for the
entire test run, so the deletion only gets scheduled when the entire
suite has completed.

On windows bots, the cleanup very often fails causing up to 40%
flakiness on some tests.

This CL keeps the cleanup logic as is, but will now deem tests as
passing even when we can't do the proper cleanup.

Change-Id: I8e2e2d39d1bbdaf48c138c0a05a9a2540345fc28
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/359760
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
2024-03-26 00:58:58 +00:00
MarkZ b3aa031eb4 [reload_test] Adding scaffolding for additional runtime platforms.
Change-Id: Id4271567c078ca04d6ee17c41fa25e69587e4f92
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/358661
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Mark Zhou <markzipan@google.com>
2024-03-25 23:58:32 +00:00
MarkZ d30283f0a1 [ddc] Adding tests for pkg:reload_test and enabling reload tests in test bots.
* Adds tests for the memory filesystem
* Enables hot restart/reload tests
* Adds flags to the hot reload suite
* Makes path resolution logic windows-friendly
* Adds test-reporting logic for trybots to hot reload tests

Change-Id: Ic51a0b8a3c6f8b6de20b58b2ac185dacf444cf47
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/353788
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Nate Bosch <nbosch@google.com>
Commit-Queue: Mark Zhou <markzipan@google.com>
2024-03-25 23:58:26 +00:00
Danny Tuppeny 8e1751f4ce [analysis_server] Add LSP CodeLenses for "Go to Augmented" and "Go to Augmentation"
These are on by default but can be toggled in the client with the "dart.codeLens" setting, either by disabling entirely:

```
"dart.codeLens": false
```

Or individually

```
"dart.codeLens": {
  "augmented": false,
  "augmentation": false,
}
```

They require a client-provided command to handle the navigation, so this also adds a "commands" section to the client capabilities (in "experimental", because that's the extension point for non-standard LSP) that allows the client to inform the server that it handles such a command (which is documented in the readme and implemented in Dart-Code in ebe029c3f9).

Change-Id: I91791c9f4aa5957c4ab4b9c0c5bb4fcf8ebeb717
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/359640
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2024-03-25 22:32:24 +00:00
Danny Tuppeny 734621fe74 [analysis_server] Fail LSP tests by default if the test code produces diagnostics
This will make it harder to accidentally create tests with incorrect code or forget to update them if syntax changes (such as "library augment" vs "augment library"). Tests deliberately using invalid code can set the `failTestOnErrorDiagnostic` flag to disable this behaviour.

Change-Id: Ibc993fdc925f1434edc8f6ae7a8bd2a671700689
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/358701
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2024-03-25 22:17:58 +00:00
Ryan Macnak a6dff920eb [vm, compiler] Remove dead branch from ARM64 large offset generation.
This looks like it started as a copy of the MIPS code or LoadImmediate.

TEST=ci
Bug: https://github.com/dart-lang/sdk/issues/55191
Change-Id: I3bd78a45d6de5efbbed52d3a7d1e7cd5ca19ddb8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/359701
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2024-03-25 22:07:13 +00:00
Brian Quinlan 97d8445e5f Revert "[io] Fix a bug where Process.stdin.add exceptions could not be caught"
This reverts commit 9967075787.

Reason for revert: Ignoring `done` is asymmetrical with other IOSinks.

Original change's description:
> [io] Fix a bug where Process.stdin.add exceptions could not be caught
>
> Change-Id: I2383a74bfa6950ab8f8934087fb68218f06dd681
> Bug:https://github.com/dart-lang/sdk/issues/48501
> Tested: Unit test
> CoreLibraryReviewExempt: dart:io only
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/351380
> Reviewed-by: Alexander Aprelev <aam@google.com>
> Commit-Queue: Brian Quinlan <bquinlan@google.com>

Bug: https://github.com/dart-lang/sdk/issues/48501
Change-Id: Ib5356c640d4dddc30e561b9d60d93f794a935103
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/359680
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Brian Quinlan <bquinlan@google.com>
2024-03-25 21:03:12 +00:00
Alexander Markov eebc219bab [vm/compiler] Move handling of recognized methods from inliner to call specializer
This refactoring reduces number of places where recognized methods are
handled and cleans up general-purpose inliner pass.

The code is mostly moved as is to simplify reviewing, with a notable
exception: in a few places handling of recognized method calls is
removed as it duplicates handling performed during call specialization
passes (ApplyClassIds and ApplyICData) which run both before and after
inlining.

TEST=ci

Change-Id: I8d53d23587beb09e6edf64ee95524f6ad3e060de
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/358221
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2024-03-25 20:58:15 +00:00
Danny Tuppeny 403040c2f7 [analysis_server] Fix many LSP tests that produce diagnostics
I'm working towards having LSP tests fail by default if error diagnostics are produced. This updates a bunch of tests that currently do, but are not required to.

In many cases these are minor bugs in the test code and non-null variables without values. Some are where we create multiple files after the server is started (which is not atomic) which are generally updated to just create the files before starting up the server instead (as long as the test was not specifically testing open files).

Change-Id: Ia3adfd413d22b2d3d04d6aba9453b919e0aa46dc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/359224
Commit-Queue: Oleh Prypin <oprypin@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2024-03-25 20:55:06 +00:00
Alexander Markov b771c6f45d [vm/corelib] Remove intermediate _getIndexed/_setIndexed methods from typed data
This change aligns all typed data implementations with Int8 typed data
and allows compiler to recognized and replace typed data access
operations earlier, before method inlining. Consequently, this increases
chances for [] and []= to be inlined. In JIT, this also prevents
non-inlined calls to _getIndexed/_setIndexed as [] and []= are graph
intrinsics which bypass calls to _getIndexed/_setIndexed.

TEST=ci

Change-Id: I95a85963da07fd1c04c06e0af09f76eb15f93353
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/359520
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2024-03-25 20:06:40 +00:00
Kenzie Schmoll cfe3217378 Add getProjectRoots API to DTD
Bug: https://github.com/flutter/devtools/issues/7366
Change-Id: If0631f387306312655bdcbefe961692b00a7b4dc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/359320
Commit-Queue: Kenzie Davisson <kenzieschmoll@google.com>
Reviewed-by: Dan Chevalier <danchevalier@google.com>
Reviewed-by: Polina Cherkasova <polinach@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2024-03-25 19:52:21 +00:00
pq 6a9c709afd don't lint unnecessary lib names pre unnamedLibraries
Related to: https://github.com/dart-lang/lints/issues/181

Change-Id: I4a247fa93c6659d5082d2cb6047aedc6a13a4209
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/359321
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
2024-03-25 18:48:16 +00:00
Konstantin Shcheglov 19decc4270 QAF. Updates for SplitMultipleDeclarations.
Use all tokens of the declaration, otherwise static fields don't work.
Tests for fields.
Updates to the implementation.

After https://dart-review.googlesource.com/c/sdk/+/359280

Change-Id: Ibebe035ae664ca46b789fe80474ef041a9f8dea1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/359340
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2024-03-25 17:35:05 +00:00
Alexander Aprelev 2bc1ace7fc [vm/compiler] Let SIMD values become constants.
Reland of bdacbb8dec

Patchset 2 has fixes for tests failing in the reland.

TEST=ci

Change-Id: I1053ef653d4112d3998070cc4fc098d19d8ff264
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/357440
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
2024-03-25 17:33:01 +00:00
Srujan Gaddam 47f08fb143 [dart:js_interop] Change several operators back to JSBoolean
Related issues:
https://github.com/dart-lang/sdk/issues/55024
https://github.com/dart-lang/sdk/issues/55267

These operators were initially broken in 3.3 and were exposed
as returning JSBoolean but implemented as returning bool. They
were fixed to return bool in the public API, but we should
prefer to have them return JS types as they're likely to be used
in cases where implicit conversions are not useful.

CoreLibraryReviewExempt: Fixing type mismatch in backend-specific library.
Change-Id: I3b0e60550dcac78918f8399d11238dcfa34982cd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/359180
Commit-Queue: Srujan Gaddam <srujzs@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2024-03-25 17:05:36 +00:00
Jonas Termansen 7c51a86267 [infra] Remove .packages OWNERS rule.
Fixes: b/331161789
Change-Id: Ib94b84ce89f7b70ab1af41e36fd2e1a44f5f4ae5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/359460
Auto-Submit: Jonas Termansen <sortie@google.com>
Reviewed-by: Devon Carew <devoncarew@google.com>
Commit-Queue: Devon Carew <devoncarew@google.com>
2024-03-25 15:43:48 +00:00
Sigurd Meldgaard 63c507642f Bump pub to 3f0df78417f7c112b933fbcdc1c5c87bde680cb1
Changes:
```
> git log --format="%C(auto) %h %s" 4a0cd04..3f0df78
 https://dart.googlesource.com/pub.git/+/3f0df784 Close the global http client after `ensurePubspecResolved` (4199)
 https://dart.googlesource.com/pub.git/+/9532f0a8 Let add and remove act upon the work pubspec (4196)
 https://dart.googlesource.com/pub.git/+/2ce3da14 Remove stray lockfiles and packageconfigs from workspace (4194)
 https://dart.googlesource.com/pub.git/+/a44e2e51 Tests of workspace error handling (4195)
 https://dart.googlesource.com/pub.git/+/2179b765 Resolve workspace root and workPackage when invoking pub from any sub-directory (4186)
 https://dart.googlesource.com/pub.git/+/7a668d12 Update repository specification with info about the 'pub_display_url' field (4193)
 https://dart.googlesource.com/pub.git/+/cf9ba6c5 Use local pub in binstubs when testing (4192)
 https://dart.googlesource.com/pub.git/+/0b8a261e Import package:path `as p` everywhere (4187)
 https://dart.googlesource.com/pub.git/+/2a7c0e92 Update repository specification with info about the 'affected[].versions' fields in advisories (4191)

```

Diff: https://dart.googlesource.com/pub.git/+/4a0cd0403f70382feca9e17ae8854ffbef0fee98..3f0df78417f7c112b933fbcdc1c5c87bde680cb1/
Bug: https://github.com/dart-lang/sdk/issues/55289
Change-Id: Ifc2e6280cfbb83b463dd197b463d6841f0528e3e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/359480
Reviewed-by: Jonas Jensen <jonasfj@google.com>
Commit-Queue: Sigurd Meldgaard <sigurdm@google.com>
2024-03-25 15:19:58 +00:00
Chloe Stefantsova 5b0bf46bd2 [cfe] Implement sufficiency checks for the rest of type shapes
Part of https://github.com/dart-lang/sdk/issues/54998

Change-Id: Ib33391d56208e66dba0396da712ca05d21faece0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/358453
Commit-Queue: Chloe Stefantsova <cstefantsova@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2024-03-25 14:45:52 +00:00
David Morgan 2d7af14120 [macros] Find platform from resolvedExecutable then from target dill.
`resolvedExecutable` is always running on the host, so this makes much
more sense than starting from the target which may be a different
platform. Still try from the target dill if that doesn't work: if the
running tool is a third party tool using the CFE as a library then
that might be the best we have to go on.

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

Change-Id: If73dc49e8ee4eb2bc729d9713fa50ddd4ccbccf8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/359062
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
Auto-Submit: Morgan :) <davidmorgan@google.com>
Commit-Queue: Morgan :) <davidmorgan@google.com>
2024-03-25 11:06:17 +00:00
Jonas Termansen 54cd684549 Remove additional --no-goma options since it's the new default.
Bug: b/296994239
Tested: Commit queue
Change-Id: I04f61149c1466db965866e95ffc6dccc457460d9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/359065
Reviewed-by: Alexander Thomas <athom@google.com>
Commit-Queue: Jonas Termansen <sortie@google.com>
Auto-Submit: Jonas Termansen <sortie@google.com>
2024-03-25 10:35:49 +00:00
Alexander Markov 35d8630176 [vm] Make String.codeUnitAt monomorphic
The new implementation of String.codeUnitAt is always inlined and
doesn't depend on the polymorphic inlining of recognized methods.

String.codeUnitAt now has a custom body in the flow graph builder
which  performs non-speculative bounds check and then branches between
OneByteString and TwoByteString. Corresponding graph intrinsic and
native method are removed.

This change also fixes passing of unboxed arguments to runtime
in the slow path of GenericCheckBound instruction in JIT mode
(when shared stubs are not used).

TEST=ci

Change-Id: Iab2805fc752df84c37089165f828e31aca5f043f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/359000
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2024-03-24 14:50:17 +00:00
Konstantin Shcheglov c61aecda75 Completion. Issue 55167. Suggest type names for DeclaredVariablePattern, in SwitchPatternCase.
Bug: https://github.com/dart-lang/sdk/issues/55167
Change-Id: I1f00fd0ea589786767443d97e7c74b7f482ba4be
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/359243
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2024-03-23 17:01:30 +00:00
Lasse R.H. Nielsen 5acb2132f8 Constant evaluator won't assume all dart.library.x entries exist.
The existing implementation assumed, hardcoded, that the compilation
environment had an entry for any string of the form `dart.library.`+X,
with a value of either `"true"` or `""`.
This did not match the runtime behavior of the standalone VM,
which allows non-constant access to the compilation environment.

Changed to only have entries with value `"true"` for libraries
which exist.
This changes the value of `bool.hasEnvironment` or a
`String.fromEnvironment` or `bool.fromEnvironment` with a
non-default `defaultValue`.
The existing behavior was that `bool.hasEnvironment` was always true,
and that the other constructors ignored the `defaultValue`,
so most likely such tests or `defaultValues` aren't used anyway.

Fixes #53815

Bug: https://dartbug.com/53815
Change-Id: I995bb34b5ab04b39a8a588d6a59c0027a0fe855c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/331261
Commit-Queue: Lasse Nielsen <lrn@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2024-03-23 11:18:46 +00:00
Nate Biggs 6bc1b01241 [dart2js] Eagerly serialize generated impacts so that they can be GCed immediately.
When dump info data is being serialized as part of the codegen + emitter joint phase, all the impacts are considered "generated" and so they must all be serialized with the dump info data. If we wait to serialize them until the end of the phase as we usually do, these impacts cannot be GCed right away. This leads to a much higher memory footprint. By serializing them eagerly we can GC the object and just maintain the much leaner serialized data.

Change-Id: I11606f7291fe8d86af1f72724bd8c68e9666a00a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/359300
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Nate Biggs <natebiggs@google.com>
2024-03-23 03:58:52 +00:00
pq 19665111e5 remove unnecessary library names
Fixes generated using `dart fix --code=unnecessary_library_name --apply`

See conversation in https://github.com/dart-lang/lints/issues/181

Change-Id: Id2b975e4aa27348d8883f1aea22e00dd9f4fc493
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/359322
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
2024-03-22 23:45:30 +00:00
pq a19c07ffd4 guard against empty entity lists
Unable to repro the reported issue, but this will at least protect against the exception.

Fixes: https://dart-review.googlesource.com/c/sdk/+/359280

Change-Id: I712f9b92879ca6b80b2f1004206e4f77a3178a47
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/359280
Reviewed-by: Keerti Parthasarathy <keertip@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
2024-03-22 23:02:33 +00:00
pq 970582ec20 fix options map sorting
Fixes: https://github.com/dart-lang/sdk/issues/55252

Change-Id: I2dbd0513039903ed95265d4546163f68236d88e9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/359241
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
2024-03-22 21:24:50 +00:00
pq 4145eeba06 don't replace is{Not}Empty for nullable targets
Fixes: https://github.com/dart-lang/sdk/issues/55250

Change-Id: Iae692c0f6a36e7fc89028acd1934580d1648c937
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/359262
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
2024-03-22 21:24:41 +00:00
Keerti Parthasarathy ef3eb6b301 Modify completion test to address comments.
Change-Id: Ib5d1237e9008a9ec1b68558894c3cc15d17347ec
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/359242
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Keerti Parthasarathy <keertip@google.com>
2024-03-22 19:17:29 +00:00
Konstantin Shcheglov 5a65760042 Completion. Rework KeywordSuggestion to better constructors.
As requested in https://dart-review.googlesource.com/c/sdk/+/359240

Change-Id: I5047afaddfd74310303001669177f725aac9c02c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/359261
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2024-03-22 19:04:39 +00:00
Tess Strickland 291051e02d [vm/compiler] Add an instruction to adjust unsafe untagged addresses.
ComputeElementAddress takes a base untagged address, an index, an index
scale, and an offset and returns base + (index * scale) + offset as an
untagged address.

This removes the last conversions between untagged and unboxed integers
for untagged GC-movable pointers. The only remaining conversions are
the following cases, which all involve non-GC-movable pointers:

1. Calls to the FFI resolver (on IA32 only).
2. Returning nullptr when a pointer to memory is expected in
   exceptional returns from FFI callbacks.
3. Converting user-provided integers to FFI pointer objects and back.

In addition, we no longer add the data field to materializations of
typed data views, but instead recompute the data field in
DeferredObject::Fill(). This removes the last source of unsafe untagged
pointers that may have arbitrary lifetimes in the flow graph.

Thus, we can now verify in the FlowGraphChecker that there are no
GC-triggering instructions between the creation of an untagged
GC-movable pointer and its use (including the use itself). To do this,
this CL adds a predicate MayCreateUnsafeUntaggedPointer to definitions,
which by default returns true for kUntagged results, false otherwise,
and should only be overwritten in cases where the result can be proven
to not be a untagged GC-movable pointer.

TEST=vm/dart/regress_54710_il_test
     vm/cc/AllocationSinking_NoViewDataMaterialization

Fixes: https://github.com/dart-lang/sdk/issues/54710
Cq-Include-Trybots: luci.dart.try:vm-aot-android-release-arm64c-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-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-linux-debug-ia32-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-release-ia32-try
Change-Id: Ie172a8bd0330a728a4f151478664a530f8d9b38a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/354862
Commit-Queue: Tess Strickland <sstrickl@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2024-03-22 19:03:31 +00:00
Konstantin Shcheglov 2447f1a973 Completion. Issue 55275. Suggest expressions in AssertStatement condition and message.
Bug: https://github.com/dart-lang/sdk/issues/55275
Change-Id: Icda00b5f472db29bfba8b58bd1a022bf43525221
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/359260
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2024-03-22 17:19:05 +00:00
Danny Tuppeny 683917ddd7 [analysis_server] Change flag for enabling LSP virtual document support
This accepts the flag without a suffix because I'm fairly confident we can ship this support without breaking changes to the API.

For a short period, the old flag is still supported so that Dart-Code + SDK don't need to be updated at the same time to avoid the support disappearing. I will remove the old flag in a few weeks (after a beta SDK branch and a stable Dart-Code release).

Change-Id: I246a33f37a5d5fc5c05c15daab7d87d4cc4fd9e3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/359064
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2024-03-22 17:01:40 +00:00
Konstantin Shcheglov f1a064cd8a Completion. Issue 55276. Suggest 'part of' and URI completion in it.
Bug: https://github.com/dart-lang/sdk/issues/55276
Change-Id: I7cc4bb94a06115899de941d2e72aa5efeb8831b4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/359240
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2024-03-22 16:24:31 +00:00