Commit Graph

88859 Commits

Author SHA1 Message Date
Johnni Winther fe3f2188ff [CFE] Widget tracking for extension method widget factories
This CL extends the widget tracking frontend kernel transformer to
support tracking the callsites of extension methods that act as widget
factories as the creation location of widgets.

To enable this support extension methods have to be annotated.

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

Originally created by gabriel@terwesten.net in
https://dart-review.googlesource.com/c/sdk/+/263380

Change-Id: I6efe8f081263e58659b9c6374542ad8f04361136
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/275901
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2022-12-19 09:13:04 +00:00
Michael Thomsen cebaa403c1 Update changelog with a few missing API removals
Change-Id: Ic519e646fde654da8ab64ec0971436a751f67dd3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/276084
Reviewed-by: Lasse Nielsen <lrn@google.com>
2022-12-19 08:29:29 +00:00
Jens Johansen fa88e0c91f [analyzer] Add benchmarks of running dart analyze
This CL:
  * Adds a benchmark of running `dart analyze` on a single small file.
  * Adds a benchmark of running `dart analyze` on a single project.
  * Adds a benchmark of running `dart analyze` on several projects.
  * Adds a hidden flag to `dart analyze` so it reports ram usage:
    run via `dart analyze --format=json --memory` and the memory
    usage will be reported in the json output.

All the bencmarks run without and with cache for speed testing, and
without and with cache when measuring memory usage.

The idea of running this via `dart analyze` instead of running either
the script or the snapshot is to measure the "real world" speed which
could be different (although in practise it _does_ just run the
snapshot).

Future CL(s) should also add benchmarks for queries using the
language server.

Change-Id: Iad6d6d72c1a2ed18ab51d056b4914f8b6eb963e4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/276100
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2022-12-19 08:22:32 +00:00
Stephen Adams fdeb41d111 [dart2js] Fix #50755
Bug: 50755
Change-Id: Icfd9349e2373c995255d3651c1f0c8f26c462cc6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/276203
Auto-Submit: Stephen Adams <sra@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
2022-12-17 03:27:58 +00:00
Sam Rawlins caa14a5eea Filter out ignored diagnostics in analyzer_cli when JSON reporter is used.
Fixes https://github.com/dart-lang/sdk/issues/50757

Change-Id: I76a7452d6c2f5977c64765c49f0ec949f1f9fadb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/276182
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2022-12-17 03:02:28 +00:00
Riley Porter b6388f2ea0 [JS interop] Expose more JavaScript operators in js_util
Exposes helper functions in js_util to access the JavaScript operators
`delete`, `||`, `&&`, `!`, `!!`, and `typeof`.
Change-Id: I0676b143aa004c7b4ed1c6b695b8d1e78a60778d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/276028
Commit-Queue: Riley Porter <rileyporter@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Srujan Gaddam <srujzs@google.com>
2022-12-17 00:31:27 +00:00
Ahmed Ashour 0c4c372d5e [analysis_server] associate RemoveNameFromDeclarationClause with various diagnostics
Bug #50753

Change-Id: I3520a1ce3af3bfc651df582505835468705bdda2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/276061
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2022-12-16 22:03:50 +00:00
Paul Berry f835846705 Flow analysis: add support for promotion of cached values.
Implement the necessary flow analysis bookkeeping so that in a pattern
of the form `P1 && P2`, any type checks performed by `P1` will be
reflected in the matched value type used by `P2`.  To accomplish this,
we allocate a promotion key to represent the "cached value" matched by
every pattern and subpattern (so that `P1 && P2` promotes properly
even when in a subpattern of another pattern).  This promotion key is
stored (in the form of a `ReferenceWithType<Type>`) in the
`_PatternContext` class.

Also, move `_scrutineeReference` and `_scrutineeType` into
`_FlowAnalysisImpl`; this preserves the existing behaviour of
promoting the scrutinee expression, but with less bookkeeping (since
we don't need to pass it along from one context to the next).  And add
`_FlowAnalysisImpl._scrutineeSsaReference` so that if the scrutinee is
modified during execution of the switch statement, it won't be
erroneously promoted by patterns that follow.

Finally, implement some preliminary logic for `||` patterns to avoid
breaking existing tests.  I will fill this out (and test it
thoroughly) in a follow-up CL.

Bug: https://github.com/dart-lang/sdk/issues/50419
Change-Id: I0d934e706ad5b19cda46a198afb2fb7a4309829b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/275788
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2022-12-16 21:11:25 +00:00
Srujan Gaddam f4bcada00d [pkg:js] Prep 0.6.6 release
Change-Id: I6d5861b1548eaa120fb86345f39af567b3f8316f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/276200
Reviewed-by: Riley Porter <rileyporter@google.com>
Commit-Queue: Srujan Gaddam <srujzs@google.com>
2022-12-16 20:14:23 +00:00
Brian Wilkerson e845949df6 Add documentation on semantic highlighting
Change-Id: Ie836c01d167ec17df9d762a365da278499076e11
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/276181
Reviewed-by: Kallen Tu <kallentu@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2022-12-16 19:17:32 +00:00
Kallen Tu 7bd4aee94a [cfe] Add mixin class flag to dill and binary.
Additionally, make class flags a uint because there are now more than 8 flags.

TEST=pkg/front_end/testcases/mixin_class/*

Change-Id: I4fe7babfa9911df0821cc73528e6b10b2ea3b92d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/275402
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Kallen Tu <kallentu@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2022-12-16 19:12:59 +00:00
Nicholas Shahan 352ba74453 [3.0 alpha][core] Delete NullThrownError
TESTED=Ran CQ dryrun and approved failures for co19 tests that will be updated soon.

Change-Id: Ic0dc5fc084b1d0f3fce80dd88062f879abd7b556
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/275840
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Vijay Menon <vsm@google.com>
2022-12-16 17:46:48 +00:00
Ahmed Ashour f12f1ad664 [analysis_server] ReplaceWithNullAware to handle IndexExpression
Fixes #50691

Change-Id: I9bc6e1f72ff71623139ce94b3f3e94eba8ed4fd1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/275941
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2022-12-16 17:29:38 +00:00
Daco Harkes 2435f0b398 [vm/ffi] Make elementAt an extension method
The CFE rewrite for structs, unions, and abi-specific integers is now
done on the extension methods.
The other native types are implemented in the extension methods
directly.

TEST=test/ffi

Closes: https://github.com/dart-lang/sdk/issues/50714
Change-Id: I578325733e3cd66200e80949d47ff12a13115b99
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/276102
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
2022-12-16 16:33:12 +00:00
Chloe Stefantsova 3d3fdc7b46 [cfe] Allow 'Record' in legacy libraries if experiment flag is set
Closes https://github.com/dart-lang/sdk/issues/50511

Change-Id: Ib9a1922cab3ada271beb6958f73342d52d837257
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/275701
Commit-Queue: Chloe Stefantsova <cstefantsova@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2022-12-16 12:52:29 +00:00
Sergey G. Grekhov 6446fada54 [co19] Roll co19 to be8f8ae44d3f5222713ab1c51e7dbf2296db0719
2022-12-14 sgrekhov22@gmail.com Fixes dart-lang/co19#1589. Fix wrong expectation in relational tests (dart-lang/co19#1594)
2022-12-14 sgrekhov22@gmail.com Fixes dart-lang/co19#1588. Fix testing of 'logical-and' subpattern (dart-lang/co19#1593)
2022-12-14 sgrekhov22@gmail.com dart-lang/co19#1587. Fix testing of 'logical-or' subpattern (dart-lang/co19#1592)
2022-12-14 sgrekhov22@gmail.com dart-lang/co19#1540. Tests error expectations updated (dart-lang/co19#1543)
2022-12-14 sgrekhov22@gmail.com dart-lang/co19#1596. Remove CyclicInitializationError from co19 tests (dart-lang/co19#1590)
2022-12-13 sgrekhov22@gmail.com dart-lang/co19#1401. [Patterns] Switch expressions fixed according to the new syntax (dart-lang/co19#1583)
2022-12-13 sgrekhov22@gmail.com dart-lang/co19#1401. [Patterns] Record pattern tests added (dart-lang/co19#1580)
2022-12-13 sgrekhov22@gmail.com dart-lang/co19#1581. Remove use of Deprecated.expires (dart-lang/co19#1584)
2022-12-13 49699333+dependabot[bot]@users.noreply.github.com Bump actions/setup-java from 3.6.0 to 3.8.0 (dart-lang/co19#1582)

Change-Id: I57f679a9cf6dc9063d5fdfcc630831a2a29abba0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/275920
Commit-Queue: Erik Ernst <eernst@google.com>
Reviewed-by: Erik Ernst <eernst@google.com>
2022-12-16 10:44:40 +00:00
Sergey G. Grekhov aac2b2e211 [co19] Roll co19_2 to f691647f1c2cc4f1019fb619932c52d0a1adbf2c
2022-12-15 sgrekhov22@gmail.com Fixes dart-lang/co19#1595. Expect TypeError in place of NullThrownError in co19_2 tests (dart-lang/co19#1597)
2022-12-14 sgrekhov22@gmail.com dart-lang/co19#1586. Remove CyclicInitializationError from co19_2 tests (dart-lang/co19#1591)
2022-12-13 sgrekhov22@gmail.com dart-lang/co19#1581. Remove use of Deprecated.expires (dart-lang/co19#1585)

Change-Id: Icbf31546935281067815d59957ed2ddc7e262546
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/275921
Commit-Queue: Erik Ernst <eernst@google.com>
Reviewed-by: Erik Ernst <eernst@google.com>
2022-12-16 09:07:49 +00:00
Josh Soref f9806280de [dart2js] Correct comment
Closes https://github.com/dart-lang/sdk/pull/50752

GitOrigin-RevId: 3a3b147a51994827fdee293a42661bde02a35ec6
Change-Id: I2633abdb469ae666820447af21a1bbe78f7466ab
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/275985
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Slava Egorov <vegorov@google.com>
2022-12-16 09:04:59 +00:00
Sam Rawlins 94f20d7731 Revert "Remove all support for all strong-mode analysis options"
This reverts ea120b5d44

Change-Id: I97a1bf6ced06bf8bcab50a2fdb41732f13182a84
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/276026
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2022-12-16 00:47:49 +00:00
Nicholas Shahan d0d2e2591f [3.0 alpha][test] Remove use of NullThrownError
Change-Id: Ia28b44a9acdcb9a38ebb101029dc50b58d272b23
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/275786
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
2022-12-15 23:33:18 +00:00
Samuel Rawlins 6d05f249ff Revert "Remove preview-dart-2 option in analysis options"
This reverts commit f30e5de558.

Reason for revert: https://dart-review.googlesource.com/c/sdk/+/274921 broke customer test, and this CL sits right on top of it.

Original change's description:
> Remove preview-dart-2 option in analysis options
>
> Fixes https://github.com/dart-lang/sdk/issues/50680
>
> AnalysisOptionsHintCode is moved from generated `option_codes.g.dart` to `option_codes.dart`, for non-generated diagnostics:
>
> * AnalysisOptionsHintCode.DEPRECATED_LINT_HINT and
> * AnalysisOptionsHintCode.DUPLICATE_RULE_HINT
>
> Change-Id: I131fb2901fca26ff971b6c9c519ab2f0b983a65c
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/275500
> Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
> Commit-Queue: Samuel Rawlins <srawlins@google.com>
> Reviewed-by: Konstantin Shcheglov <scheglov@google.com>

# Not skipping CQ checks because original CL landed > 1 day ago.

Change-Id: Ia417aa5edc5b279a5fced43154de4cd5c9d3be2c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/276023
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2022-12-15 22:54:51 +00:00
pq ea1473e6cd linter 1.32.0
See: https://github.com/dart-lang/linter/issues/3848

Change-Id: I73469ce43d52c1755875a39067b267f216ebd490
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/275044
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
2022-12-15 22:51:28 +00:00
Ahmed Ashour a6f4fbe17b [analysis_server] ConvertToMapLiteral to handle types with typedef
Fixes #50581

Change-Id: Ieeb4c6730036e112bcf37353a18535f342fd28a5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/275900
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2022-12-15 22:09:46 +00:00
Nicholas Shahan c39ac36ed3 [3.0 alpha][dart2js] Remove use of NullThrownError
It is being removed in Dart 3.0 and a `TypeError` should be used
instead. This is true in legacy code as well and all test
expectations will be updated.

Change-Id: I021fa4ecb1a9bbc404598113c65349e17926cd91
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/275782
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2022-12-15 21:36:56 +00:00
Ömer Sinan Ağacan 0a1e05acab [dart2wasm] Tweak setRange error checking
Error checking copied from VM.

New passing test: corelib/list_set_range_test

Change-Id: Iaac3be44037bac5646498a733828ee1f71f0eeb6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/275861
Reviewed-by: Aske Simon Christensen <askesc@google.com>
Commit-Queue: Ömer Ağacan <omersa@google.com>
2022-12-15 21:36:22 +00:00
Ahmed Ashour f652c7962b [analysis_server] fix AddNullCheck with null-aware operators
Fixes #50506

Change-Id: I8f7564ec7aaaf32888e9979254e450cd2633e307
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/274442
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2022-12-15 21:13:41 +00:00
Ryan Macnak 933d2cf4e7 Change the default architecture in test.py from x64 to host.
This brings test.py into agreement with build.py, and makes development on arm64 hosts nicer.

Change-Id: Ic544b4eee0e27d9f395328297ed6108d4e4689f7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/257800
Reviewed-by: Jonas Termansen <sortie@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2022-12-15 20:41:33 +00:00
Kallen Tu 8e1162cb72 [analyzer] Add mixin classes to ClassElementImpl
Change-Id: I41cbbf218a9c8d7c26fa8f32e3b8022c51b42789
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/275521
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Kallen Tu <kallentu@google.com>
2022-12-15 19:20:06 +00:00
Ryan Macnak 6d41f47d45 [vm, compiler] Decide how many Q registers are available based on target OS.
TEST=ci
Change-Id: Ieefb6d56a4110a9277c5f217a800c3297de8964e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/238383
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2022-12-15 18:05:31 +00:00
Nate Bosch 70dd0044dd Bump test to 89a8b12bc7998b01e801cbeed82b3f64f49d1ef9
Changes:
```
> git log --format="%C(auto) %h %s" 09fb067..89a8b12
 https://dart.googlesource.com/test.git/+/89a8b12b Don't ignore outstanding work on failure (1815)

```

Diff: https://dart.googlesource.com/test.git/+/09fb067979684dbd0918f664ec4d178975c84283~..89a8b12bc7998b01e801cbeed82b3f64f49d1ef9/
Change-Id: I75433f0180295c0d8aa716e39e219989b67f5527
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/275401
Commit-Queue: Nate Bosch <nbosch@google.com>
Reviewed-by: Devon Carew <devoncarew@google.com>
2022-12-15 17:48:11 +00:00
Nate Bosch f065dca391 Avoid permanently paused isolates
These tests have some exceptions caused by missing fields on the
dynamic variable. The exceptions cause the `isolate.resume()` call to
not run, which also cause the test body to not complete.

Currently this is masked by the test runner, which immediately ignores
the test body once the first error occurs. That behavior is changing,
and a failure will not immediately end a test when the body is still
running. https://github.com/dart-lang/test/pull/1815

Some of these tests are currently are expected to fail, but not to
timeout. Fix the test implementations to more reliably complete the test
body, even when the test had an error. This does not fix the tests
themselves, it maintains the current pattern of failure, even after
updating the test runner.

- Use `Stream.firstWhere` over cancelling the stream subscription after
  the first breakpoint.
- Use `Future.whenComplete` to ensure the isolate is always unpaused,
  including after an exception in the expectations.

Tested: Passes with updated test runner in https://dart-review.googlesource.com/c/sdk/+/275401/4
Change-Id: If5a7f0264c580cb38bcc1bd95c035aaf5644124b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/275787
Auto-Submit: Nate Bosch <nbosch@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Nate Bosch <nbosch@google.com>
2022-12-15 17:37:13 +00:00
Ryan Macnak f181b50249 [build] Address warnings in gcc 11 and 12.
TEST=local builds
Bug: https://github.com/dart-lang/sdk/issues/50645
Change-Id: If6cd26620feff06abd449be0f7d1dd1e620b8411
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/275841
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2022-12-15 17:36:39 +00:00
Alexander Aprelev ff2d661d5b [vm/compiler] Choose correct unboxed float representation for phi instructions.
BUG=https://github.com/dart-lang/sdk/issues/50622
TEST=FlowGraph_UnboxedFloatPhi

Change-Id: Ie7bfbb6c4028907a18243d44be8128999c1efcae
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/275180
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
2022-12-15 15:24:12 +00:00
Nate Bosch ca03588d2b Run extension handlers in the registering zone
Towards https://github.com/flutter/flutter/issues/93676

Flutter uses an extension for hot reloads, and the app ends up running
in the root zone after a hot reload because that is the zone that the
handler gets called in.

Always run extension handler callbacks in the zone from which they were
registered for more predictable behavior.

Change-Id: Ia921489a6ada802c8e53a0ccc650a8bce218ba01
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/275842
Commit-Queue: Ben Konyi <bkonyi@google.com>
Auto-Submit: Nate Bosch <nbosch@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2022-12-15 15:05:17 +00:00
Vyacheslav Egorov d02e1de5b1 [vm] Add Dart_SetDwarfStackTraceFootnoteCallback
This API allows embedder to append arbitrary footers to DWARF stack
traces. For example, embedder can append a link to a symbolizer
service, which could be used to symbolize the stack-trace.

TEST=manually tested, hard to create automatic tests because vm/cc tests  only support JIT, not AOT.

Bug: b/255741575
Change-Id: Id034b9b3194f7b91a8405574ea771c4a06fda2c2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/275700
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Slava Egorov <vegorov@google.com>
2022-12-15 13:45:10 +00:00
Michael Thomsen bcbf24ec3d [3.0 alpha] Remove deprecated CastError and FallThroughError dart:core errors
TEST=ci

Bug: https://github.com/dart-lang/sdk/issues/49529
Change-Id: I52495d3e5319f0555714f4f8247149afc06128a1
Cq-Include-Trybots: luci.dart.try:vm-kernel-reload-rollback-linux-debug-x64-try,vm-kernel-reload-linux-debug-x64-try,dart-sdk-mac-arm64-try,dart-sdk-mac-try,vm-kernel-nnbd-mac-debug-arm64-try,vm-kernel-nnbd-mac-debug-x64-try,vm-kernel-precomp-nnbd-linux-debug-x64-try,dart-sdk-linux-arm64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/259041
Commit-Queue: Michael Thomsen <mit@google.com>
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Lasse Nielsen <lrn@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2022-12-15 13:38:47 +00:00
Lasse R.H. Nielsen 2274ce9b05 Retire experiment flags introduced in 2.18.
Change-Id: I660bbf09c758f88589a10b0334ddd34c0620460d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/275244
Commit-Queue: Lasse Nielsen <lrn@google.com>
Reviewed-by: Michael Thomsen <mit@google.com>
2022-12-15 13:18:50 +00:00
Jens Johansen dde72f78a2 [vm] Heap snapshot tool can load file from arguments
This CL allows the heap snapshot tool to load a file as it is launched
via a command like
```
../../../out/ReleaseX64/dart bin/explore.dart my_snapshot.heapsnapshot
```

Change-Id: I4eca4ec18daef4d3361c754018d234045e725ef5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/275860
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2022-12-15 12:31:45 +00:00
Michael Thomsen e4cc3c98e5 [3.0 alpha] Remove deprecated dart:core List() constructor.
TEST=ci

Bug: Contributes to https://github.com/dart-lang/sdk/issues/49529
Change-Id: Ic129ef2d89f625d9ec6a7a1c301cffddd60b2ff7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/258920
Reviewed-by: Lasse Nielsen <lrn@google.com>
Commit-Queue: Michael Thomsen <mit@google.com>
Reviewed-by: Slava Egorov <vegorov@google.com>
2022-12-15 11:36:22 +00:00
Alexander Markov 7ebd4dd61c [3.0 alpha] Remove deprecated public class CyclicInitializationError
This deprecated class cannot be removed just yet because
we still need to throw something in case of cyclic initialization
in Dart legacy libraries (which are still supported).

Class CyclicInitializationError is copied for each implementation
(VM, dart2js and DDC) and made private. Each implementation now has
an independent private class which can be removed separately.

TEST=ci
Issue: https://github.com/dart-lang/sdk/issues/49529
Change-Id: I8100bbe16636c12c4cbabbb5fe770f4c648c4249
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/275120
Commit-Queue: Michael Thomsen <mit@google.com>
Reviewed-by: Lasse Nielsen <lrn@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2022-12-15 11:20:58 +00:00
Ilya Yanok 822d15e7cc nnbd_migration: fix crash on mixin override
Migration tool currently crashes if a class overrides
some methods it got by adding a mixin.

Added a test for that and fixed the crash, the fix
boils down to casting to just `InterfaceElement` instead
of `ClassElement`.

Tested: added a new test
Change-Id: Iab5ddb26c4930ed2020d6f3caa0710e55f24d8c2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/275721
Commit-Queue: Ilya Yanok <yanok@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2022-12-15 09:19:38 +00:00
Ömer Sinan Ağacan 6cda72d39e [dart2wasm] Add special case for const adjacent strings
Language specification (section 17.2) says two strings are identical
when they're both constants and equal.

It doesn't mention adjacent strings, but looking at the tests, it seems
like juxtaposition of constant strings are expected to be constants as
well.

This adds a special case in string juxtaposition compiler to handle the
case where parts of the adjacent strings are all constants.

New passing tests:

- co19/Language/Expressions/Instance_Creation/Const/canonicalized_t05
- co19/Language/Expressions/Strings/adjacent_strings_t02
- language/const/string_test

Change-Id: Ib46582be492ba20c417546cbfb4e67b2d90e3ba3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/275200
Commit-Queue: Ömer Ağacan <omersa@google.com>
Reviewed-by: Aske Simon Christensen <askesc@google.com>
2022-12-15 07:45:47 +00:00
Ryan Macnak 78732b243e [vm] Fail describing errno if mmap fails for any reason except ENOMEM.
Avoids the VM later failing with a misleading "Out of Memory" message when allocation fails for lack of permission, etc.

TEST=ci
Bug: https://github.com/dart-lang/sdk/issues/50719
Change-Id: I52b2478092a5e5b59680f31d37ab3c6d6d816ba0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/275783
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2022-12-15 00:52:58 +00:00
Nicholas Shahan 022ca53db3 [ddc] Remove use of NullThrownError
Throw a `TypeError` with the same message, 'Throw of null.'
instead of a `NullThrownError`.

Fixes: https://github.com/dart-lang/sdk/issues/50598
Change-Id: Ic13d6bc29a49c405ef3d3d0eb4f7fd781aefbc6b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/273281
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>
2022-12-15 00:10:59 +00:00
Devon Carew cabf333606 [deps] rev browser_launcher, dartdoc, intl, mime, mockito, sse, webdev
Revisions updated by `dart tools/rev_sdk_deps.dart`.

browser_launcher (https://github.com/dart-lang/browser_launcher/compare/5fa0bd6..2712dda):
  2712dda  2022-12-13  Anna Gringauze  Fix internal CI test failures (#35)

dartdoc (https://github.com/dart-lang/dartdoc/compare/eb90a44..1f42216):
  1f422163  2022-12-13  Sam Rawlins  Bump to 6.1.5 (#3274)

intl (https://github.com/dart-lang/intl/compare/234b291..6fb07f2):
  6fb07f2  2022-12-14  Copybara-Service  Merge pull request #520 from dart-lang:revto18
  1f9815c  2022-12-14  Moritz  Rev version in preparation for publish of 0.18.0
  1d37c42  2022-12-13  Googler  Internal change
  708b85c  2022-12-13  Copybara-Service  Merge pull request #498 from dart-lang:remove_intl_stream
  2d9eca9  2022-09-28  moritz  sort imports
  08a35bd  2022-09-28  moritz  Merge branch 'master' into remove_intl_stream
  0fc6ab9  2022-09-28  moritz  Changes as per review
  4680742  2022-09-27  moritz  rename to stack
  f687c72  2022-09-27  moritz  changes as per review
  ef36013  2022-09-26  moritz  add reference to benchmark
  117c0cf  2022-09-26  moritz  separate read and pop
  434378a  2022-09-26  moritz  move method
  e98c4aa  2022-09-26  moritz  fix typo
  9234540  2022-09-26  moritz  rename file
  024cffc  2022-09-26  moritz  make it a tad faster
  c6f7b6a  2022-09-26  moritz  some renaming
  443c9e0  2022-09-26  moritz  Remove StringIterator
  1953002  2022-09-23  Nate Bosch  Inline the extension
  4dfdc1b  2022-09-22  Nate Bosch  Simplify the IntlStream class

mime (https://github.com/dart-lang/mime/compare/c0c4c47..273d454):
  273d454  2022-12-13  tomk9  Add .dcm to extension map (#74)
  aacec32  2022-12-12  Kevin Moore  Update to latest lints, bump min SDK to 2.18 (#77)
  536db4f  2022-12-12  Kevin Moore  blast_repo fixes (#79)
  2343229  2022-12-12  Kevin Moore  Add .msj (and change .js) to text/javascript (#76)

mockito (https://github.com/dart-lang/mockito/compare/347d3e4..942dd03):
  942dd03  2022-12-12  yanok  Override `SmartFake.toString` to be super-verbose
  5f97a43  2022-12-09  Sam Rawlins  Stop using deprecated analyzer APIs
  0660e61  2022-12-06  yanok  Generate method overrides even then source lib is not null-safe
  cf7d851  2022-12-06  yanok  Add override for `Object.operator==` in `SmartFake`
  6b89e99  2022-12-02  yanok  Automated g4 rollback of changelist 492410078.
  d11d010  2022-12-02  yanok  Generate method overrides even then source lib is not null-safe

sse (https://github.com/dart-lang/sse/compare/d396145..cfa93b1):
  cfa93b1  2022-12-14  Elliott Brooks (she/her)  Add `package:js` to dependencies (#71)
  00335e4  2022-12-13  Elliott Brooks (she/her)  Update `package:sse` to `4.1.2`(#70)

webdev (https://github.com/dart-lang/webdev/compare/3e2364e..317288a):
  317288a  2022-12-14  Derek Xu  Remove ChromeProxyService.setExceptionPauseMode() (#1820)
  bbe7143  2022-12-14  Elliott Brooks (she/her)  Migrate `events_test.dart` to null-safety (#1819)
  1d1c98f  2022-12-14  Elliott Brooks (she/her)  Settings page, Dart Debugger panel, and Flutter Inspector panel match DevTools styles (#1815)
  a9b8887  2022-12-13  Elliott Brooks (she/her)  Update tests that are incompatible with `3.0.0` (#1817)

Change-Id: I08e555dc22e5577740fe43e91ff31e4601ac15f0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/275781
Commit-Queue: Nate Bosch <nbosch@google.com>
Auto-Submit: Devon Carew <devoncarew@google.com>
Reviewed-by: Nate Bosch <nbosch@google.com>
2022-12-14 23:49:42 +00:00
Ryan Macnak 98af4110ad [vm] Increase supported range of TypeParameters to 16 bits.
TypeParameter::set_index was already asserting for 16 bits but silently truncating to 8 bits. The size of TypeParameter does not increase due to allocation rounding.

Add explicit range check to class finalization.

TEST=ci
Change-Id: Id4017f74b7dba47b00d64e77e787712c70290dac
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/275560
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2022-12-14 23:34:18 +00:00
Alexander Markov 987775d6fb [vm] Type testing stubs for record types
Benchmarks improved by:
JIT:
RecordCollections.ListAddPoly.Record ~9.6 times
RecordCollections.ListSetIndexed.Record ~8.3 times
RecordCollections.ListSetIndexedPoly.Record ~16.1 times
RecordCollections.MapAdd.RecordKey ~3.6 times
RecordCollections.MapAdd.RecordValue ~4.4 times
RecordCollections.SetAdd.Record ~4.1 times
AOT:
RecordCollections.ListAdd.Record ~8.7 times
RecordCollections.ListAddPoly.Record ~8.8 times
RecordCollections.ListSetIndexed.Record ~19.5 times
RecordCollections.ListSetIndexedPoly.Record ~18.3 times
RecordCollections.MapAdd.RecordKey ~7.1 times
RecordCollections.MapAdd.RecordValue ~8.8 times
RecordCollections.SetAdd.Record ~8.9 times

TEST=vm/cc/TTS_RecordSubtypeRangeCheck

Issue: https://github.com/dart-lang/sdk/issues/49719
Change-Id: I96e4c6a40a897a72b3570b59e014c8af77a9ef99
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/275082
Reviewed-by: Tess Strickland <sstrickl@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2022-12-14 22:33:38 +00:00
Ryan Macnak 8a37b70a53 [vm, compiler] More consistently support large load/store offsets.
TEST=ci
Change-Id: I7691808679c57c6f16f3859641cf52b9e606e304
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/275381
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2022-12-14 22:17:35 +00:00
Nicholas Shahan faf8027465 [tests] Update expectation to TypeError
TypeError is now expected in the place of NullThrownError which is
being removed in Dart 3.0.

Change-Id: Ibb7188d993216067650d4b994a303f2bcd1d2298
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/275742
Reviewed-by: Leaf Petersen <leafp@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
2022-12-14 21:37:27 +00:00
Sam Rawlins f30e5de558 Remove preview-dart-2 option in analysis options
Fixes https://github.com/dart-lang/sdk/issues/50680

AnalysisOptionsHintCode is moved from generated `option_codes.g.dart` to `option_codes.dart`, for non-generated diagnostics:

* AnalysisOptionsHintCode.DEPRECATED_LINT_HINT and
* AnalysisOptionsHintCode.DUPLICATE_RULE_HINT

Change-Id: I131fb2901fca26ff971b6c9c519ab2f0b983a65c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/275500
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2022-12-14 21:04:29 +00:00