Commit graph

97247 commits

Author SHA1 Message Date
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
Brian Wilkerson 044be2ae6e Allow dart:_wasm to be imported in appropriate packages
Change-Id: I606caf26e387b445662e8af9362e992f228d52c2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/326727
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2023-09-19 18:49:56 +00:00
Jens Johansen 807d1cf47b [analyzer] Don't cache completion data
TL;DR: This CL is shown to reduce memory usage by ~660MB when asking
for many completions.

Before this CL the analyzer cached `_ElementCompletionData` for every
element that have ever had it calculated. This itself contains new
strings, lists etc.

This was likely (although I'm guessing) done because it was asked for
it a lot: In my benchmarks, asking for at most 250 completions for each
of the first 200 files (twice) it was asked more than 113 million times.
Likely (extrapolating) it would take ~26 minutes creating these if not
cached.

In practise we don't need to ask for >113 million of them though.
Each request only wants at most, say, 100 results and likely fewer.
In the benchmark the `build` command was only run ~31% more times than
the number of caches. Building 100 results (again just using the
average) would take ~1.4 ms so hardly matters.

This CL removes the caching (including the field on many `Element`s),
and only calculates it when needed (i.e. on `build` as it's about to be
sent to the users IDE).

When asking for at most 250 completions in the first 1000 files in flutter/flutter (80+ contexts) we save ~669MB of heap usage, making
the heap usage decrease from ~8.34GB to ~7.69GB.

Details:

```
ExtensionElementImpl (package:analyzer/src/dart/element/element.dart) (bytes):
Difference at 95.0% confidence
   -1185728.00 +/- 413.05
   -8.36% +/- 0.00%

SimpleIdentifierImpl (package:analyzer/src/dart/ast/ast.dart) (bytes):
Difference at 95.0% confidence
   -1187104.00 +/- 133935.98
   -1.14% +/- 0.13%

_List (dart:core) (instances):
Difference at 95.0% confidence
   -1204916.00 +/- 5571.96
   -10.08% +/- 0.05%

ConstTopLevelVariableElementImpl (package:analyzer/src/dart/element/element.dart) (bytes):
Difference at 95.0% confidence
   -1301800.00 +/- 12081.85
   -7.93% +/- 0.07%

_OneByteString (dart:core) (instances):
Difference at 95.0% confidence
   -1825992.50 +/- 186205.44
   -28.49% +/- 2.91%

ConstructorElementImpl (package:analyzer/src/dart/element/element.dart) (bytes):
Difference at 95.0% confidence
   -5518400.00 +/- 135361.21
   -6.29% +/- 0.15%

ClassElementImpl (package:analyzer/src/dart/element/element.dart) (bytes):
Difference at 95.0% confidence
   -6820704.00 +/- 21606.00
   -6.34% +/- 0.02%

CompletionDefaultArgumentList (package:analysis_server/src/services/completion/dart/utilities.dart) (bytes):
Difference at 95.0% confidence
   -9054304.00 +/- 6195.82
   -100.00% +/- 0.07%

InterfaceTypeImpl (package:analyzer/src/dart/element/type.dart) (bytes):
Difference at 95.0% confidence
   -9941600.00 +/- 776821.86
   -2.32% +/- 0.18%

ElementLocationImpl (package:analyzer/src/dart/element/element.dart) (bytes):
Difference at 95.0% confidence
   -10401472.00 +/- 111022.97
   -46.19% +/- 0.49%

_TwoByteString (dart:core) (bytes):
Difference at 95.0% confidence
   -11262480.00 +/- 227076.11
   -11.77% +/- 0.24%

MethodElementImpl (package:analyzer/src/dart/element/element.dart) (bytes):
Difference at 95.0% confidence
   -13877752.00 +/- 351565.94
   -7.70% +/- 0.20%

_ElementDocumentation (package:analysis_server/src/services/completion/dart/suggestion_builder.dart) (bytes):
Difference at 95.0% confidence
   -18954304.00 +/- 202259.10
   -100.00% +/- 1.07%

_GrowableList (dart:core) (bytes):
Difference at 95.0% confidence
   -23003968.00 +/- 3135.17
   -25.12% +/- 0.00%

Location (package:analyzer_plugin/protocol/protocol_common.dart) (bytes):
Difference at 95.0% confidence
   -63403200.00 +/- 444171.45
   -99.68% +/- 0.70%

_List (dart:core) (bytes):
Difference at 95.0% confidence
   -71587648.00 +/- 2062003.75
   -5.54% +/- 0.16%

Element (package:analyzer_plugin/protocol/protocol_common.dart) (bytes):
Difference at 95.0% confidence
   -79254080.00 +/- 555214.31
   -100.00% +/- 0.70%

_ElementCompletionData (package:analysis_server/src/services/completion/dart/suggestion_builder.dart) (bytes):
Difference at 95.0% confidence
   -110955712.00 +/- 777300.03
   -100.00% +/- 0.70%

_OneByteString (dart:core) (bytes):
Difference at 95.0% confidence
   -258932360.00 +/- 9586397.08
   -35.00% +/- 1.30%

maxRSS:
Difference at 95.0% confidence
   -327434240.00 +/- 121326188.82
   -3.05% +/- 1.13%

currentRSS:
Difference at 95.0% confidence
   -551153664.00 +/- 121286389.20
   -5.34% +/- 1.18%

heapCapacity:
Difference at 95.0% confidence
   -555710464.00 +/- 164879781.95
   -5.75% +/- 1.71%

heapUsage:
Difference at 95.0% confidence
   -701868280.00 +/- 8054728.47
   -7.84% +/- 0.09%
```

Change-Id: I3b3631520d56ab36dabaee913e802aa1b7ebacfe
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/326822
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2023-09-19 18:40:30 +00:00
Kenzie Schmoll 0054a68cc3 Update DevTools rev to 2a1d1975d7ad8773a3e2590d10636432775f23a1
Change-Id: I5072fe1be9255f2eacda45db93dcc639ddfd8e42
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/326804
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Kenzie Davisson <kenzieschmoll@google.com>
2023-09-19 18:17:22 +00:00
Danny Tuppeny 55be7147eb [analysis_server] Migrate rename tests to use TestCode
No functional changes, just moving some more tests from old functions to the "new" TestCode class

Change-Id: If146725ec71460512988f7104d7d4ec77fa55f0d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/326823
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2023-09-19 18:07:56 +00:00
Danny Tuppeny 1f460143e9 [analysis_server] Migrate definition tests to use TestCode
No functional changes, just migrating a few more tests to Test Code.

Change-Id: Iae9ced80ddbfb2fceab080f32c899dfcbb5ed5df
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/326824
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2023-09-19 17:49:04 +00:00
Danny Tuppeny cc7dd80d51 [analysis_server] Don't include unnecessary parens when inlining locals
Fixes https://github.com/Dart-Code/Dart-Code/issues/4732

Change-Id: I5d0da808bea37b533a42b7aaf5443433826393f5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/326821
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2023-09-19 17:04:40 +00:00
Daco Harkes e36bc165c0 [vm/ffi] MSAN instrument StoreIndexedInstr x64
TEST=ffi/function_callbacks_structs_by_value_generated_test
TEST=ffi/function_callbacks_structs_by_value_native_callable_generated_test
TEST=ffi/regress_52399_test.dart

Bug: https://github.com/dart-lang/sdk/issues/52399
Change-Id: Id16ccea5645d9b14a8f2726cb896b99266bba5a2
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/+/303360
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2023-09-19 16:51:30 +00:00
Sam Rawlins 29f78ef98c linter: Move final use_build_context_synchronously tests
Most of the tests removed here already are covered in the new tests.

And also two test cases are added.

Change-Id: I3d6e15d2b9fde14a2b2249a3422ca1508a0d7572
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/326726
Auto-Submit: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
2023-09-19 16:34:59 +00:00
Sam Rawlins b72f968334 Move avoid_print tests
In this CL, I also add the foundation file, and move some existing
elements into it, and correct all of the necessary tests.

Change-Id: I772f76d6eaf64612667a445270f86741a4771ce8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/326684
Commit-Queue: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Auto-Submit: Samuel Rawlins <srawlins@google.com>
2023-09-19 15:56:48 +00:00
Ryan Macnak 2d99be9b5b [test] Split_literals_tests relies on no inlining across the loading units to check constant pools are also deferred.
Change-Id: I3989b7c923ecebf144eae44dc4897177fe4550be
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/326686
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2023-09-19 15:50:58 +00:00
Devon Carew 8507f557f0 [deps] rev ecosystem, http, native, tools, webdev
Revisions updated by `dart tools/rev_sdk_deps.dart`.

ecosystem (babf5d1..ed39318):
  ed39318  2023-09-14  Devon Carew  validate a prerelease setup-dart version (#169)
  b3dc96f  2023-09-14  Devon Carew  fix an issue rendering multi-line changelogs (#171)

http (e19094a..decefa6):
  decefa6  2023-09-15  Brian Quinlan  Remove invalid status line tests and replace them with valid status line tests (#1018)

native (4f4d7c3..a5d8809):
  a5d8809  2023-09-18  Daco Harkes  [native_toolchain_c] Bump version (#140)

tools (1512f3d..63d8267):
  63d8267  2023-09-18  Elias Yishak  Restrict surveys for certain tools (#161)
  5a1fc54  2023-09-14  Devon Carew  validate a pre-release setup-dart action (#160)

webdev (501ccc2..d7e0d1f):
  d7e0d1ff  2023-09-15  Devon Carew  test the latest setup-dart action (#2233)
  4e231bc3  2023-09-14  Elliott Brooks  Fix copying over `client.dart.js` to `client.js` when build DWDS  (#2232)

Change-Id: Iac8741aed14591402b1c8a3cd33dc00e4648ac0c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/326720
Commit-Queue: Devon Carew <devoncarew@google.com>
Auto-Submit: Devon Carew <devoncarew@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2023-09-19 15:41:39 +00:00
Parker Lougheed 304cdc951f [analyzer] Update INVALID_REFERENCE_TO_THIS docs to match spec
I tried my best to match terminology with other existing diagnostic docs.

Fixes https://github.com/dart-lang/site-www/issues/5172

Change-Id: I8c59bcdd6b0e9315dd35e120e3a9536d7a6c9930
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/325923
Reviewed-by: Marya Belanger <mbelanger@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2023-09-19 15:10:39 +00:00
Johnni Winther f0933ab69e [cfe] Copy const_finder visitor from Flutter SDK
This copies the const_finder visitor from the Flutter SDK to the
Dart SDK to avoid having source code dependency on package:kernel
in the Flutter repository.

Change-Id: I76f98453c1650e63623708a9f4860d80ab4b25aa
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/326645
Reviewed-by: Christopher Fujino <fujino@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: William Hesse <whesse@google.com>
2023-09-19 12:19:26 +00:00
Ömer Sinan Ağacan 3ee5bdfcf3 [dart2wasm] Add test configuration to test with wasm-opt
- Update dart2wasm script to accept a `-O` argument. When passed it also
  passed `--inlining-limit 10` to dart2wasm (unless it's already passed
  by the caller) and runs wasm-opt on the output, with the same
  arguments as `compile_benchmark`.

- Add new test configurations to run tests with optimized binaries.
  Example configuration: `dart2wasm-linux-optimized-d8`.

Change-Id: Ia7bd8d9c99d3a4baecb72b92b2ba38c0e92807c6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/326620
Commit-Queue: Ömer Ağacan <omersa@google.com>
Reviewed-by: Aske Simon Christensen <askesc@google.com>
2023-09-19 10:29:43 +00:00
Ömer Sinan Ağacan fc9a0549ac [dart2wasm] Simplify compile_benchmark script
wasm-opt can update a file in-place when input and output arguments are
the same. Do it and remove temp file and dirs.

Also remove `--enable-experiment` flags as they're no longer needed.

Change-Id: Ifd07e88b55a98ca9953aad1de8622249513f2f79
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/326302
Reviewed-by: Aske Simon Christensen <askesc@google.com>
Commit-Queue: Ömer Ağacan <omersa@google.com>
2023-09-19 09:50:48 +00:00
Samuel Rawlins c27d9d72ee Revert "observatory: Ignore new static Warning"
This reverts commit d3124b87e5.

Reason for revert: unknown code for now.

Original change's description:
> observatory: Ignore new static Warning
>
> There are two spots where a nullable value is passed to a non-nullable
> Future.value call, or a non-nullable Completer.complete call. In the
> interest of not making any functional change, I'm just ignoring this
> new code.
>
> ```
> warning - lib/src/service/object.dart:870:29 - 'Future<Isolate>.value' shouldn't be called with an argument of nullable type 'Isolate?'. Try passing a non-null argument. - nullable_argument_to_non_null_type
> warning - lib/src/service/object.dart:1559:29 - 'Future<Class>.value' shouldn't be called with an argument of nullable type 'Class?'. Try passing a non-null argument. - nullable_argument_to_non_null_type
> ```
>
> Related to https://github.com/dart-lang/sdk/issues/53253
>
> TEST=N/A
>
> Change-Id: I091990975a1f2b927e007564b6ca0658c6a34c20
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/324762
> Reviewed-by: Ben Konyi <bkonyi@google.com>
> Auto-Submit: Samuel Rawlins <srawlins@google.com>
> Commit-Queue: Samuel Rawlins <srawlins@google.com>

Change-Id: Id5d033ca8601ea2f18aa9d2c8f8aeee8a2ceaf0d
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/326725
Commit-Queue: Alexander Thomas <athom@google.com>
Auto-Submit: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
2023-09-19 07:51:37 +00:00
Ryan Macnak e478de7e38 [vm, compiler] Fix incorrect canonicalization of a load to an initializing where the load's receiver is the store's value instead of the store's receiver.
TEST=ci
Change-Id: I182b511f100a36419a29d3a5ac971961824421e7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/326682
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2023-09-18 23:11:22 +00:00
Alexander Aprelev 05274b2592 [benchmark] Add benchmark prefix to UiMatrix benchmark.
Change-Id: I208a06355a233ff1c07c9be494cc2676d8d485ea
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/326685
Reviewed-by: Jonas Termansen <sortie@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
2023-09-18 22:41:23 +00:00
Ryan Macnak dc445e4eec [vm, compiler] Fix incorrect reduction of identical(num, num?) to pointer equality.
TEST=ci
Change-Id: Ifd75fa074581cc9c5a67bcc035f0d594b2692158
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/326722
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2023-09-18 22:14:58 +00:00
Srujan Gaddam 39e8c57963 Reland "[dart2wasm] Fix nullable JS type and int parameters in JSFunction"
This is a reland of commit 54522db98f

Original change's description:
> [dart2wasm] Fix nullable JS type and int parameters in JSFunction
>
> When a callback is toJS'd with an int parameter, we should attempt
> a conversion to int if possible, similar to return values on
> external functions. Similarly, parameters where the expected type is
> a JS type should check to make the value isn't nullish before boxing,
> as JS null and undefined are converted to Dart null.
>
> Tests are added for conversion semantics of JSFunctions.
>
> Change-Id: I95566c2954d915b8cf31cdc55fed359c695404f2
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/323445
> Reviewed-by: Aske Simon Christensen <askesc@google.com>

Change-Id: I36ec7702b1e08fc9e4d6290952ae548b0e074ee3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/325971
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Srujan Gaddam <srujzs@google.com>
2023-09-18 21:21:55 +00:00
Sam Rawlins d3124b87e5 observatory: Ignore new static Warning
There are two spots where a nullable value is passed to a non-nullable
Future.value call, or a non-nullable Completer.complete call. In the
interest of not making any functional change, I'm just ignoring this
new code.

```
warning - lib/src/service/object.dart:870:29 - 'Future<Isolate>.value' shouldn't be called with an argument of nullable type 'Isolate?'. Try passing a non-null argument. - nullable_argument_to_non_null_type
warning - lib/src/service/object.dart:1559:29 - 'Future<Class>.value' shouldn't be called with an argument of nullable type 'Class?'. Try passing a non-null argument. - nullable_argument_to_non_null_type
```

Related to https://github.com/dart-lang/sdk/issues/53253

TEST=N/A

Change-Id: I091990975a1f2b927e007564b6ca0658c6a34c20
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/324762
Reviewed-by: Ben Konyi <bkonyi@google.com>
Auto-Submit: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2023-09-18 20:32:35 +00:00
Alexander Markov 20a7d7199f [vm/aot/tfa] Remove convariant parameter type checks when type argument is an extension type
This change improves handling of extension types when they are used in
the generic types involved in parameter type checks.
Instead of treating extension types as unknown opaque types, TFA now
uses their type erasures.

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

Fixes https://github.com/dart-lang/sdk/issues/53542
Issue https://github.com/dart-lang/sdk/issues/49737

Change-Id: I04bb8f1940c0983b6c09403df577b89f5de4a81d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/326681
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2023-09-18 20:15:49 +00:00
Srujan Gaddam 76193718d2 Reland "[dart:js_interop] Re-enable type checks on external APIs"
This is a reland of commit 2a669c571f.

External APIs when using dart:js_interop should only allow
primitives, JS types, and other static interop types. This
was previously checked in a more restrictive mode called
"strict mode" but is not checked everywhere where dart:js_interop
APIs exist.

Change-Id: I1a8d04071a519c4965b266eb2800bcc3c3bb8393
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/325961
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Srujan Gaddam <srujzs@google.com>
2023-09-18 19:53:40 +00:00
Paul Berry ef74475404 Create an enum to represent links used in "why not promoted" context messages.
This makes it easier to see at a glance which messages need to be
supported by the website.

I've included the new links that I intend to support as part of the
new "field promotion" feature.

Bug: https://github.com/dart-lang/sdk/issues/53102
Change-Id: I67ad47c5a00db9807a6c726677a06427cdbe02c2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/325803
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
2023-09-18 18:44:32 +00:00
Brian Wilkerson cc399708d3 Move more keyword completions
Change-Id: Ibdd1175731317acc91bff3e08ac57f706775bf56
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/326540
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2023-09-18 18:02:25 +00:00
Nicholas Shahan 34e1b89286 [ddc] Delete unused build targets
The last uses were removed in
b04c2a3783

Change-Id: I3eae2145ba5d5fdab8e9e13c20b466f5a0c9eb14
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/326248
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
2023-09-18 17:56:35 +00:00
Ryan Macnak 782611f29a [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>
2023-09-18 16:31:05 +00:00
Paul Berry f66254a0c5 Enable private field promotion in pkg/front_end
Change-Id: I71c8eb0e5783b2309efc2230cc1cc3ce59df4790
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/325449
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
2023-09-18 15:39:47 +00:00
Kevin Chisholm a744a03491 Update CHANGELOG.md to add release date to 3.1.0 release.
Change-Id: I17720269d12431e2ba705ee709414d77a6621d6c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/326660
Reviewed-by: William Hesse <whesse@google.com>
Commit-Queue: Kevin Chisholm <kevinjchisholm@google.com>
2023-09-18 14:14:09 +00:00
Daco Harkes 959f849d93 [deps] rev native
Bug: https://github.com/dart-lang/native/issues/133
Change-Id: Ic9aca93f8408fc27e7cfb8dfe0a91bfcd33474e9
Cq-Include-Trybots: luci.dart.try:pkg-linux-debug-try,pkg-linux-release-try,pkg-mac-release-arm64-try,pkg-mac-release-try,pkg-win-release-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/326640
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Hossein Yousefi <yousefi@google.com>
2023-09-18 12:53:18 +00:00