Commit graph

100417 commits

Author SHA1 Message Date
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
Danny Tuppeny df0b1f74f7 [analysis_server] Tidy up LSP tests failTestOnAnyErrorNotification to be implied when using expectErrorNotification
This is a small tidy up that changes `failTestOnAnyErrorNotification` to be automatically set when using `expectErrorNotification` so there's slightly less noise in tests.

Change-Id: I44056a23aca872b8e96109be4d4ba4356b8af53d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/359221
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2024-03-22 16:06:58 +00:00
Konstantin Shcheglov 219f8a9013 Completion. Issue 55167. Suggest type names for DeclaredVariablePattern.
Bug: https://github.com/dart-lang/sdk/issues/55167
Change-Id: I3fad2f2559bf8677afbe893d8d147a0d443e441a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/359121
Reviewed-by: Keerti Parthasarathy <keertip@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2024-03-22 15:48:49 +00:00
Chloe Stefantsova 4d9aeda9a8 [cfe] Use StructuralParameters in TypedefTearOff and TypedefTearOffConstant
Change-Id: I6b221f36065b78c985c8a216b1ac43f9e518bb3e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/358905
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Chloe Stefantsova <cstefantsova@google.com>
2024-03-22 13:01:05 +00:00
Jonas Termansen e8ed498902 [infra] Remove --no-goma from test matrix.
Goma is off by default, and RBE is only enabled where it is known to
work, so there is no need to disable RBE instead. Some of these builders
additionally disable RBE in their infra/config definitions and there is
no need to duplicate that information here.

Bug: b/296994239
Change-Id: I9f9733ba5189b53b899289a23d68126f7c6adcc5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/357610
Commit-Queue: Jonas Termansen <sortie@google.com>
Reviewed-by: William Hesse <whesse@google.com>
2024-03-22 12:21:39 +00:00
Tess Strickland 1cebdcb2da [vm/ffi] Use untagged pointer representations for FFI pointers.
Previously, the FFI used unboxed integers as a native representation
for pointers in FFI code, as the compiler only handled very specific
uses of untagged pointers flowing between instructions. Since then,
this restriction has been removed for untagged pointers that do not
point to memory managed by the GC, like FFI pointers, so now they can
have a more precise representation.

By being precise about when untagged (untagged pointers to freshly
allocated Handles and the contents of Pointer data fields) and tagged
(TypedData objects constructed to hold the byte representation of
compound data) values are expected, we can remove the need to have
untagged pointers to GC-movable objects and/or having untagged
pointers escape as unboxed integers in the generated IL.

This CL also renames kUnboxedFfiIntPtr -> kUnboxedAddress and limits
its uses specifically to where the unboxed integer represents the
numeric representation of an untagged pointer.

This CL changes CCall to take Representations for the arguments and
return value instead of what looks like an arbitrary
NativeCallingConvention. However, the serializer and deserializers for
CCall, used in IL tests, originally assumed that the argument and return
representations were kUnboxedFfiIntPtr, so providing an arbitrary
NativeCallingConvention which didn't match that assumption would cause
failures during IL tests. That assumption came from the fact that
the only creator of CCall instructions was in kernel_to_il.cc, and there
that was the case.

Now CCall builds the native calling convention during construction
and deserialization from the argument and return representations and
stores both the representations and built native calling convention
internally. In the future, if we want to create CCall instructions with
more arbitrary native calling conventions, then we'll need to handle
serialization/deserialization of arbitrary native calling conventions,
and also add consistency checks that the provided representations
appropriately match the native calling convention.

TEST=ffi vm/dart/regress_306327173_il vm/dart/address_local_pointer_il

Issue: https://github.com/dart-lang/sdk/issues/54710
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-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-release-ia32-try
Change-Id: I34effe8fbdc80288b703e0152d5ba67ce2343400
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/353101
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Commit-Queue: Tess Strickland <sstrickl@google.com>
2024-03-22 10:20:48 +00:00
Tess Strickland a6a3434404 [vm/compiler] Use temps instead of writable registers in MemoryCopy.
This keeps the array registers unchanged across the instruction,
which can save instructions if there are unused registers to allocate
for the temporaries and the source or destination registers are live
after the copy (e.g., if the destination array is then used in a
LoadIndexed instruction post-copy).

On IA32, we still use writable registers due to register pressure.

TEST=ci

Change-Id: Ia955f8db39e4aba0f01b9d06ea50992a7375a492
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-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-release-ia32-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/357901
Commit-Queue: Tess Strickland <sstrickl@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2024-03-22 10:17:11 +00:00