Commit graph

97277 commits

Author SHA1 Message Date
Sam Rawlins
d48592f22a analysis_server: Indent pattern examples to be code blocks
As `{@link` is not a doc directive, it should not be written like it
is a doc directive.

Change-Id: Iebdc34175372ce1933b02c482499acf52ddd2324
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/327285
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2023-09-24 18:01:22 +00:00
Srujan Gaddam
74c407da2f [dart:js_interop] Add/fix some js_interop helpers
Minus all the operator-related functionalities, members that
can be worked around using static interop e.g. getPrototypeOf,
and createDartExport/createStaticInteropMock, this bridges the
gap of js_util.

Adds:
- instanceOfString from js_util as an extension methods
- JSObject constructor to replace js_util.newObject
- Unnamed factory constructor to JSAny so users can't extend it

Fixes:
- JSArray.withLength to take an int
- typeofEquals to take a String and return a bool
- instanceof to return a bool

CoreLibraryReviewExempt: Backend-specific library.
Change-Id: I7db1651f641a4fc84392957dfa7ad64904f110e8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/326691
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Srujan Gaddam <srujzs@google.com>
2023-09-23 18:32:59 +00:00
Srujan Gaddam
e130bb36ce [dart:js_interop] Make isUndefined and isNull throw on dart2wasm
null and undefined cannot be distinguished on dart2wasm in its
current state, so these helpers should only work on the JS
compilers. Some comments are updated to reflect the current state
of this internalization. Also fixes a pending TODO in isNull and
isUndefined on the JS backends.

CoreLibraryReviewExempt: Backend-specific library.
Change-Id: Ic56e8aa346af99cb99d01fe3c7ac5e37e965db23
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/326690
Commit-Queue: Srujan Gaddam <srujzs@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2023-09-23 01:46:50 +00:00
Srujan Gaddam
e3852368b5 [dart:js_interop] Add Future.toJS and add some helpers
Adds Future.toJS that creates a Promise using a Dart callback.
Resolving is simple as we just pass the value (if any). Rejection
boxes the error and stack trace and sets them as properties of
a JSObject, which is then passed to the reject function.

Also adds:
- JSPromise constructor
- JSFunction.callAsFunction helper

CoreLibraryReviewExempt: Backend-specific library.
Change-Id: If2ce8018a2c8b3c4dc5d5af710c9bb4c2f688f87
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/326689
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Srujan Gaddam <srujzs@google.com>
2023-09-23 00:52:48 +00:00
Siva Annamalai
e854243a3d Revert "[dartdev] Use an AOT snapshot for dds"
This reverts commit 5f33a9ab80.

Reason for revert: There is speculation that this CL might have caused some errors invoking the analysis server from dartdev, leading to the error "dartdev: Error: Error when reading 'dartdev': No such file or directory"

TEST=ci

Original change's description:
> [dartdev] Use an AOT snapshot for dds
>
> This change enables use of an AOT snapshot for dds execution.
>
> TEST=ci
>
> Change-Id: I500be544e168bd487745ee1232fd925d5ef546b8
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/327140
> Reviewed-by: Ben Konyi <bkonyi@google.com>
> Reviewed-by: Derek Xu <derekx@google.com>
> Commit-Queue: Siva Annamalai <asiva@google.com>

Change-Id: I33a53a17f53714d3df5aba539870574a631cd416
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/327523
Reviewed-by: Ben Konyi <bkonyi@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Commit-Queue: Siva Annamalai <asiva@google.com>
2023-09-22 23:09:25 +00:00
Danny Tuppeny
a780653606 [dds/dap] Use function locations if frame has no location itself
Some functions when debugging tests have tokenPos=-1 which results in the debugger jumping to the top of the file. If the function has a location, this seems to be more appropriate to use.

Fixes https://github.com/Dart-Code/Dart-Code/issues/4692

Change-Id: I7a800de4f9ce94deb5d35919cab658dee881d439
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/324522
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
Reviewed-by: Helin Shiah <helinx@google.com>
2023-09-22 21:33:39 +00:00
Konstantin Shcheglov
c239df6e23 Macro. Run types phase multiple times, merge results.
Change-Id: Id46288a4be2a8799da9a993f5f17b0048929fc44
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/327283
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2023-09-22 21:03:19 +00:00
asiva
0f8069d9d0 [dartdev] Convert gen_kernel.dart.snapshot into an AOT snapshot
Convert gen_kernel to use an AOT snapshot in the
dart compile exe
command.

TEST=ci

Change-Id: I6e338525dabb4e84dc1edff8f0bbac803223e74d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/327520
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Siva Annamalai <asiva@google.com>
2023-09-22 20:03:29 +00:00
Ryan Macnak
bc4235b94a [vm, compiler] Consistently use OriginalDefinition in range analysis for GenericCheckBound.
TEST=vm/dart/regress_53295_test
Bug: https://github.com/dart-lang/sdk/issues/53295
Change-Id: Ie186a8ed988486e2f49eef48d07ebf63f6c534d3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/327320
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2023-09-22 17:48:12 +00:00
Danny Tuppeny
c08aeec581 [analysis_server] Explicitly check for switch expression instead of parens in inline_local
A tweak to the fix made for https://github.com/Dart-Code/Dart-Code/issues/4732.

Change-Id: I5f0d8f97ec693cb538df94a42128e0325b6ef929
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/327200
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2023-09-22 17:31:48 +00:00
Kallen Tu
742ba5c20d [analyzer] Change the const evaluation result of variables to be Constant.
We rely on the result of the `ConstantVisitor` to indicate whether we have an error or a valid constant value.

This CL changes `evaluationResult` to be a `Constant` and changes error reporting to occur at a POE for evaluating a constant.

Last few chunks of cleaning up the constant evaluator, woo!

Change-Id: Icd41a4fcbab0626df36c6a83cd60ecbb59c2dcf0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/324573
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Lasse Nielsen <lrn@google.com>
Commit-Queue: Kallen Tu <kallentu@google.com>
2023-09-22 16:13:10 +00:00
asiva
5f33a9ab80 [dartdev] Use an AOT snapshot for dds
This change enables use of an AOT snapshot for dds execution.

TEST=ci

Change-Id: I500be544e168bd487745ee1232fd925d5ef546b8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/327140
Reviewed-by: Ben Konyi <bkonyi@google.com>
Reviewed-by: Derek Xu <derekx@google.com>
Commit-Queue: Siva Annamalai <asiva@google.com>
2023-09-22 15:50:50 +00:00
Daco Harkes
b8fb4a537c [vm] MSAN instrument MemoryCopyInstr on x64
TEST=ffi/function_structs_by_value_generated_ret_arg_native_test
TEST=MSAN SDK build, exercises this instruction a lot.

Bug: https://github.com/dart-lang/sdk/issues/52399
Change-Id: Id65a6c4e5500afd2a155d609f8e0144a157aa3b0
Cq-Include-Trybots: luci.dart.try:vm-msan-linux-release-x64-try,vm-aot-msan-linux-release-x64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/327201
Reviewed-by: Tess Strickland <sstrickl@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
2023-09-22 10:56:04 +00:00
Liam Appelbe
18d0afdce1 Revert "[ffi] NativeCallable.listener example."
This reverts commit 5354df624a.

Reason for revert: Broke debian-x64-main bot
https://logs.chromium.org/logs/dart-internal/buildbucket/cr-buildbucket/8769282695204884177/+/u/build/stdout

Original change's description:
> [ffi] NativeCallable.listener example.
>
> Add an example to the NativeCallable.listener documentation.
>
> Bug: https://github.com/dart-lang/sdk/issues/53435
> Change-Id: I4b664b14ca1dbc474913a9e191e38ca6f290350f
> Fixes: https://github.com/dart-lang/sdk/issues/53435
> CoreLibraryReviewExempt: The FFI package is VM-only
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/326580
> Reviewed-by: Daco Harkes <dacoharkes@google.com>
> Commit-Queue: Liam Appelbe <liama@google.com>

Bug: https://github.com/dart-lang/sdk/issues/53435
Change-Id: Id959500df51d0eaa9bd452d3d9d0a8b21191de1c
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/327420
Reviewed-by: Alexander Aprelev <aam@google.com>
Reviewed-by: Liam Appelbe <liama@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
Auto-Submit: Liam Appelbe <liama@google.com>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
2023-09-22 05:15:18 +00:00
Liam Appelbe
5354df624a [ffi] NativeCallable.listener example.
Add an example to the NativeCallable.listener documentation.

Bug: https://github.com/dart-lang/sdk/issues/53435
Change-Id: I4b664b14ca1dbc474913a9e191e38ca6f290350f
Fixes: https://github.com/dart-lang/sdk/issues/53435
CoreLibraryReviewExempt: The FFI package is VM-only
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/326580
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Commit-Queue: Liam Appelbe <liama@google.com>
2023-09-22 04:02:20 +00:00
Srujan Gaddam
d54f0acd02 [dart2wasm] Fix null rejection exception and add tests for conversions
Then callbacks should accept and return a JSAny?. Some JS types tests
were incomplete as well.

Change-Id: Id46e2a53f8f83ce17247fbd23d5be82f3f986f30
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/326688
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Srujan Gaddam <srujzs@google.com>
2023-09-21 21:41:39 +00:00
Srujan Gaddam
94e4a4dfb5 [dart:js_interop] Modify some documentation around arrays/lists
Just some clarifications around what to expect when using these
conversion functions.

CoreLibraryReviewExempt: Documentation change.
Change-Id: I7fcd26a0fb14ac48bf80df1f9252584a730cb47f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/326687
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2023-09-21 21:41:39 +00:00
Devon Carew
042f2a1806 [deps] rev ecosystem, http, mockito, shelf, test, tools
Revisions updated by `dart tools/rev_sdk_deps.dart`.

ecosystem (ed39318..dcf5c4f):
  dcf5c4f  2023-09-20  Parker Lougheed  Simplify dart_flutter_team_lints install instructions (#172)

http (decefa6..1251619):
  1251619  2023-09-19  Brian Quinlan  Add the ability to control the URL cache. (#1020)

mockito (412c0be..097e563):
  097e563  2023-09-19  Ilya Yanok  Add a missing dummy `bool` value

shelf (e2a02b7..4851978):
  4851978  2023-09-20  Kevin Moore  shelf_router_generator: prepare to release v1.1.0 (#380)

test (6449495..8191a35):
  8191a355  2023-09-20  Nate Bosch  Drop a TODO about running browser after compile (#2094)
  d8e9d87d  2023-09-18  Nate Bosch  Add a silent reporter (#2093)

tools (70d778d..3c248df):
  3c248df  2023-09-21  Devon Carew  misc infra updates for dart-lang/tools (#165)

Change-Id: I436a34847db75f45a20b8c18996419f88214485f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/327280
Auto-Submit: Devon Carew <devoncarew@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2023-09-21 19:43:52 +00:00
Brian Wilkerson
4c73e0ab49 Convert one more KeywordContributor method
Change-Id: Ic58d7a4cd2878981f77221b85b0566a7a0f5b732
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/327240
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2023-09-21 19:21:39 +00:00
Sam Rawlins
4ac121722b Bump dartdoc to 0e1a6d94a6cb5dd487a19ebb68980e34ac6154ba
Change-Id: I82584fe7f6ad146a1bf87f48c5773337080e3169
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/326866
Commit-Queue: Keerti Parthasarathy <keertip@google.com>
Auto-Submit: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Keerti Parthasarathy <keertip@google.com>
2023-09-21 17:11:13 +00:00
Ryan Macnak
8d7fa35c88 [vm, service] Adjust GetProcessMemoryUsage and scavenger stats to avoid races.
TEST=tsan, ubsan
Bug: https://github.com/dart-lang/sdk/issues/52862
Change-Id: I7b89ab6f9101ec397068e50e996dee36a1479527
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/327043
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2023-09-21 17:04:21 +00:00
Nicholas Shahan
3a0f4d63bc [ddc] Avoid implicit downcast from dynamic
Defensively save and restore the value of the global counter used
when performing a type check. This value was being accidentally
reset to zero because of the implicit type check being performed
during another type check.

Change-Id: I51484456734e258a354fe2246d957ad3512ae340
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/327102
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Srujan Gaddam <srujzs@google.com>
2023-09-21 16:48:59 +00:00
Konstantin Shcheglov
058ca618bd Macro. Test state after macros, add macro generate file when loading bundle.
Change-Id: I8b88f607c18b0700f558b7f75c101a2a59b5409a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/327044
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2023-09-21 15:43:27 +00:00
Ryan Macnak
14d2789f18 [infra] Define an AOT eager optimization configuration.
Change-Id: I1098392c67da82d97c95b16490eb3beb31601896
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/326760
Reviewed-by: Alexander Thomas <athom@google.com>
Commit-Queue: Alexander Thomas <athom@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2023-09-21 15:24:32 +00:00
Ryan Macnak
8e6191c7f9 [build] Include FPESAN in UBSAN.
TEST=ubsan
Bug: b/301044910
Change-Id: I608dd742a243bc1ab620c92da46e48270d6b060f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/327041
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2023-09-21 15:16:39 +00:00
William Hesse
2502e4e385 Move flute benchmark to third_party
The flute benchmark should be in third_party, not third_party/pkg,
as it is not a package we want as an SDK dependency.
The flute benchmark was added as an optional dependency in
https://dart-review.googlesource.com/c/sdk/+/322921

Bug: b/274424008
Change-Id: Ic7e075ffa913c77aaf8d4136f619b6497ad7d4ba
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/327202
Reviewed-by: Aske Simon Christensen <askesc@google.com>
2023-09-21 12:34:24 +00:00
Aske Simon Christensen
a2c47adfba Update Binaryen to a51bd6df919a5b79574f0996a760cc20cb05697e
This version fixes an issue with optimizing tuple-valued blocks, which
would arise when inlining functions with multiple return values.

Use the newly added `--type-unfinalizing` and `--type-finalizing`
options to improve the effectiveness of the TypeSSA and TypeMerging
passes.

https://github.com/WebAssembly/binaryen/issues/5923
https://github.com/WebAssembly/binaryen/issues/5933

Change-Id: I1d5bc1052a355bf404f81a420a2352270030fd4c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/327000
Reviewed-by: William Hesse <whesse@google.com>
Auto-Submit: Aske Simon Christensen <askesc@google.com>
Commit-Queue: Aske Simon Christensen <askesc@google.com>
2023-09-21 11:47:59 +00:00
Sigurd Meldgaard
04fe6d62fc Un-vendor package:oauth2 and package:tar in pub
Adds package tar as a dependency:

Bump pub to 1e38c837e4eee40c6d5c5b088e8ed1b512e02980

Changes:
```
> git log --format="%C(auto) %h %s" be6868b..1e38c83
 https://dart.googlesource.com/pub.git/+/1e38c837 Un-vendor tar (4012)
 https://dart.googlesource.com/pub.git/+/588ff5d3 Inline needed parts of package oauth2 (4009)

```

Diff: https://dart.googlesource.com/pub.git/+/be6868ba132c782d9835b1638a634ecb73428579..1e38c837e4eee40c6d5c5b088e8ed1b512e02980/
Bug: b/260732061
Change-Id: I6baa882eff8efaa1f45dd3e8648f794cafb06734
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/326981
Commit-Queue: Sigurd Meldgaard <sigurdm@google.com>
Reviewed-by: Sarah Zakarias <zarah@google.com>
2023-09-21 08:33:59 +00:00
Sam Rawlins
b09ecc45bf analyzer: Block doc directives
In this CL, we shake things up a bit to separate the idea of a "doc
directive" and a "doc directive tag". The doc comments have been
updated to reflect the change. We have to recognize and support end-
tags, and recover when an end-tag is missing, a start-tag is missing,
or end-tags are out-of-order.

I also introduce a notion of doc directive nesting, in a way that
should not be computationally expensive, nor memory expensive.

Take this text as an example:

/// {@template foo}
/// Text.
/// {@inject-html}
/// <p>Some HTML.</p>
/// {@end-inject-html}
/// {@youtube ... }
/// {@endtemplate}

Notice the doc directives nested in the following way:

* template directive:
  * text: "Text."
  * inject-html directive:
    * text: "<p>Some HTML.</p>"
    * youtube directive

I want to avoid storing any blocks of text on the DocDirective nodes,
to avoid what could be very excessive memory usage. And if I want to
avoid storing the text, I think there is little benefit in storing the
data for these directives in a tree structure. In this CL, the data
is stored in one List, `docDirectives` on the CommentImpl:

* [0] - template directive, with data about its opening tag and
        closing tag.
* [1] - inject-html directive, with data about its opening tag and
        closing tag.
* [2] - youtube tag, with data about its singular tag.

For syntax highlighting purposes, there is no benefit to understanding
the nesting. And dartdoc currently gets all of the comment text from
the AST (or maybe from offsets in the actual text???) so I think there
is currently no downside to not capturing the nesting structure in
the CommentImpl instance.

But I can see in the future it might be better for dartdoc to consume
an API with the nesting structure, and that nesting structure does not
necessarily need to contain a copy of any text; it could contain some
sort of 'Text' data, with offsets of text contained in block doc
directives.

Change-Id: Ib58ab68fe80eea76ee7fa912d00fc69cc74f72d3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/326883
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2023-09-20 21:56:50 +00:00
Sam Rawlins
e28faa2462 linter: use_build_context_synchronously: fix or
This PR fixes the case demonstrated in the new test, where
a mounted check occurs on the right side of an or-binary
expression.

Fixes https://github.com/dart-lang/linter/issues/4753

Change-Id: I3c4ac8a42f7f87502fb217763506fa5294f6b017
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/326864
Auto-Submit: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
2023-09-20 21:49:54 +00:00
pq
cb56c1f3e7 verify DEPRECATED_MEMBER_USE is reported on unannotated constructors
See: https://github.com/dart-lang/linter/issues/4752

Change-Id: I3b0a8235eab72251d6962bd80e7ecaa1c26e7602
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/327042
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
2023-09-20 21:46:28 +00:00
Sam Rawlins
83c145aec4 linter: Move avoid_catching_errors tests
Change-Id: I60f8e15cb5e2e647d63094cc61cb0594cddb2321
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/326867
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
Auto-Submit: Samuel Rawlins <srawlins@google.com>
2023-09-20 21:41:51 +00:00
pq
bf26e5985a update w/ latest package:lints lint sets
Fixes failure here: https://dart-ci.appspot.com/log/any/unittest-asserts-release-linux/24229/pkg/linter/test/verify_machine_json_test

Change-Id: Ifda4654e1a80a0003bada8b33e9ebd5878173421
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/327023
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Devon Carew <devoncarew@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
2023-09-20 21:04:07 +00:00
Elliott Brooks
c7d9d99670 Update Webdev pin
Pins DWDS to 3078f48fb5 which is necessary to unblock Dart SDK rollsdue to this change to the VM service interface: https://dart-review.googlesource.com/c/sdk/+/321660

Excludes d2dae560d4 which is a breaking change to DWDS.

Bug: https://github.com/dart-lang/webdev/issues/2236
Change-Id: I3be3450901023dc5078f3aee1339ecf175908577
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/327022
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2023-09-20 20:16:51 +00:00
Mayank Patke
c047b76439 [dart2js] Remove IE11 polyfill from StackTrace.current
Change-Id: Id0eb8a75e1d555dcef6c2451b3d363baf141ddd6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/326863
Commit-Queue: Mayank Patke <fishythefish@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2023-09-20 19:32:42 +00:00
Ryan Macnak
1de2110b6a Revert "[vm, service] Adjust GetProcessMemoryUsage and scavenger stats to avoid races."
This reverts commit 782611f29a.

Reason for revert: divide by zero in ExpectedGarbageFraction

Original change's description:
> [vm, service] Adjust GetProcessMemoryUsage and scavenger stats to avoid races.
>
> TEST=tsan
> Bug: https://github.com/dart-lang/sdk/issues/52862
> Change-Id: I90d31ff28e2517ddd2b1e7b387fa38152144f45c
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/324766
> Reviewed-by: Ben Konyi <bkonyi@google.com>
> Commit-Queue: Ryan Macnak <rmacnak@google.com>

Bug: https://github.com/dart-lang/sdk/issues/52862
Change-Id: I8e0502087f64fa470000690a6d31e7be6b01b3fe
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/326865
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2023-09-20 18:39:25 +00:00
Ryan Macnak
c811560d64 [vm] Fix safepointing bug in the native call wrappers.
It is not valid to access either the NativeArguments slots (quasi handles) or the result's CID/header during the execution state kThreadInNative. During such a state, GC can be running on another thread and object headers and handles might contain forwarding pointers.

TEST=no
Bug: b/301044910
Change-Id: If3de5e9d7d3708d44a2939225a7c314c2c4d13c0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/326903
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
2023-09-20 16:08:51 +00:00
Konstantin Shcheglov
784b9d70e6 Macro. Build macro augmentation using the existing method.
The method is _buildAugmentationImport(), used for any other augmentation.

To do this, we create a FileState instance that corresponds to the
augmentation library. This way, we keep its content there, so that
later we will able resolve it.

For now, this allows reusing existing support for imports, and write
a macro that references a type identifier from a library, that later
is generated into a library import, and a prefixed referenced in code.

Change-Id: I5affeaa07253f2464b1da255c6218c3d46a3d887
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/326882
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2023-09-20 15:50:53 +00:00
Tess Strickland
c562719814 [vm/test] Add IL matching of abstract instructions.
Also marks CheckBoundBase as an abstract instruction, instead of it
being treated specially.

Now when matching IL graphs that use bounds check instructions, which
differ in JIT vs. AOT, the matcher can match the abstract base
instruction (CheckBoundBase) instead of having to separately match the
concrete subclasses on JIT (CheckArrayBound) and AOT
(GenericCheckBound).

TEST=ci

Change-Id: I73dd6bf6711a99cc2c52a69cf31f22ba4850f2b3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/327001
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Tess Strickland <sstrickl@google.com>
2023-09-20 14:37:05 +00:00
Paul Berry
f5208f5d59 Flow analysis: prepare for rework of promotionInfo data structure.
`FlowModel.promotionInfo` is currently a map from integer promotion
keys to PromotionModel data structures. This is inefficient because
FlowModel is an immutable data structure, so whenever the promotion
state of a variable changes, the map must be duplicated. In a
follow-up CL I will be changing `FlowModel.promotionInfo` to a much
more efficient data structure. However, that data structure will
require some extra plumbing. For ease in code review, I'm doing the
extra plumbing first, as its own CL.

This CL makes the following changes:

- Removes unnecessary null checks from the `FlowModel.withInfo`
  constructor. These null checks are no longer needed because all the
  clients of flow analysis are now fully null safe. This change is not
  strictly necessary; it's just a long-overdue clean-up.

- Adds a `helper` argument (of type `FlowAnalysisHelper`) to
  `FlowModel.conservativeJoin`, `FlowModel.declare`, and
  `FlowModel.infoFor`, `FlowModel.inheritTested`, and
  `FlowModel._updatePromotionInfo`. This is needed because these
  methods will need access to `FlowAnalysisHelper` in order to read
  and update the new data structure.

- Removes the `typeOperations` argument of `FlowModel.inheritTested`,
  since it can be easily obtained from the new `helper` argument.

- Changes `FlowModel._updatePromotionInfo` to a public method
  annotated with `@visibleForTesting`. This will be needed by flow
  analysis unit tests to create the new data structure.

Note that this change causes a small regression in the performance of
CFE compilation, due to the extra `helper` arguments:

    instructions:u: 0.0693% +/- 0.0008% (13413234.33 +/- 155671.09)
    branches:u: 0.0886% +/- 0.0012% (3502620.67 +/- 45724.97)

The follow-up CL that switches to a more efficient data structure will
result in a performance improvement roughly an order of magnitude
larger.

Change-Id: I21c13fb817f05281b558f0473119473a26ea0fb8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/326860
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2023-09-20 12:29:50 +00:00
Aske Simon Christensen
bbbed58d43 Update d8 to 11.9.79
This is the last version before the (breaking) switch to the final
WasmGC instruction encoding.

Change-Id: I5664dbcde897ab2b32c8b34e1328d82bdc9445be
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/326820
Commit-Queue: Aske Simon Christensen <askesc@google.com>
Auto-Submit: Aske Simon Christensen <askesc@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
2023-09-20 08:16:54 +00:00
pq
88b07ba64e annotate_redeclares since info
Change-Id: I7bae3816d72b64f3cb3a4520c90491aefa5d6437
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/326901
Commit-Queue: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2023-09-19 21:57:39 +00:00
Liam Appelbe
2fcc9bd9c6 [ VM / Service ] Add librariesAlreadyCompiled to getSourceReport RPC
The goal is to have the flutter test framework skip compilation of
libraries it's already seen. See option 3 from this doc:
https://docs.google.com/document/d/193DKN1DmbHdphhbC8RngdkSafHQGF2QEmf-qDxqSIrk/edit#heading=h.fn9090oeqrk3

Change-Id: Ia76bbb35df22dee6e9f8b32f90bbf2ef2fa18913
TEST=source_report_libraries_already_compiled_test.dart
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/321660
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Liam Appelbe <liama@google.com>
2023-09-19 21:53:41 +00:00
Nicholas Shahan
685af7552d [ddc] Unskip tests on canary configs
Now that the canary configurations are more reliable we can start
running these tests again. They were originally skipped when the
async implementation in the new type system was not working correctly.

The `web/async_stacktrace_test` has actually been timing out in the
stable configs as well. The timeout is consistent and reproducible
locally so I'm filing a new issue and skipping it on all DDC configs
for now.

Fixes: https://github.com/dart-lang/sdk/issues/50666
Issue: https://github.com/dart-lang/sdk/issues/53555
Change-Id: I7306ba66afe595fb213f06c0ad884d376240addc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/326721
Reviewed-by: Mark Zhou <markzipan@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
2023-09-19 20:59:33 +00:00
Sam Rawlins
42516e3c6e linter: Move close_sinks tests
Work towards https://github.com/dart-lang/linter/issues/3535

Change-Id: I5c2b076d5d01037aa50b829d29a899834e105181
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/326861
Commit-Queue: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Auto-Submit: Samuel Rawlins <srawlins@google.com>
2023-09-19 20:17:13 +00:00
eliasyishak
83cfcf9cac Updating for unified analytics v4
Change-Id: I76e43f6cf75ac4b5b7ed4c9aadb048d54dbdf3b1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/326842
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Elias Yishak <eliasyishak@google.com>
2023-09-19 20:11:46 +00:00
Sam Rawlins
66d220935b linter: Remove mock_packages
Change-Id: I3c964a6e92138605f80ef7a9a71304044877a3c8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/326881
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Auto-Submit: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
2023-09-19 20:09:08 +00:00
Danny Tuppeny
bf13d89902 [analysis_server] Ensure variables declared in patterns are recorded in navigation data
Previously the pattern would only be recorded as a reference to the getter. If there was a reference to the declared variable elsewhere in the visited code, it would then record the variable declaration (via the reference).

In LSP, we locate declarations by only looking at the node at the cursor, so we can't rely on the declaration being recorded by some other reference (if one even exists) so this ensure it is recorded explicitly.

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

Change-Id: I8983d0637f2d89a427fb1fa11293eec8e06fede8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/326700
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2023-09-19 19:39:31 +00:00
Brian Quinlan
5b7b8aab40 [docs/io]: Clarify the semantics of FileSystemEntity.rename(Sync).
CoreLibraryReviewExempt: Documentation-only change
Bug: https://github.com/dart-lang/sdk/issues/53274
Change-Id: Ifa3e94c6d8503790d3f6d29e9a99700e83d511d2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/326862
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Brian Quinlan <bquinlan@google.com>
2023-09-19 19:29:07 +00:00
pq
30dc427ef9 STRICT_RAW_TYPE tests for extension types
See: https://github.com/dart-lang/sdk/issues/53434

Change-Id: I3a94046dff920a05fd6e617c6f234c001fab6781
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/326880
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
2023-09-19 18:57:43 +00:00