Commit graph

87351 commits

Author SHA1 Message Date
Konstantin Shcheglov 8f70d95df0 Use TypeAliasElement.aliasedType instead of aliasedElement in analysis_server/..
Change-Id: Ib7c144b12c59a09be98f3a461bd50b5e0a663fa9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/258861
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
2022-09-12 19:38:19 +00:00
Konstantin Shcheglov daada3e35d Prepare to publish analyzer 5.0.0 and _fe_analyzer_shared 48.0.0
Change-Id: Ib9f0cab59a6791ed077ed78395cc24d1bf3d482c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/258860
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
2022-09-12 19:37:09 +00:00
Devon Carew 5389fd41ed [deps] rev dartdoc, matcher, and webdev
Change-Id: Ie7a41a5ab1094e136550c4c5f549c1cb62371fea
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/258862
Commit-Queue: Nate Bosch <nbosch@google.com>
Auto-Submit: Devon Carew <devoncarew@google.com>
Commit-Queue: Devon Carew <devoncarew@google.com>
Reviewed-by: Nate Bosch <nbosch@google.com>
2022-09-12 18:36:56 +00:00
Danny Tuppeny 8e2dbc1cdc [analysis_server] Add support for showing inferred types via inlayHints
Change-Id: I075871df3e6bec89f03f55e1387d479a48123713
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/258807
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2022-09-12 18:26:07 +00:00
Paul Berry 466494f5be Shared type analysis: API adjustments for analyzer and CFE
I've begun prototyping what it might look like to integrate the
current shared type analysis functionality with the analyzer and CFE,
and I've discovered some API improvements that are needed:

- The shared logic now handles the possibility that switch cases that
  share a body have been merged prior to type analysis (because the
  CFE merges them during parsing), in addition to the pre-existing
  functionality which assumed that switch case merging had to be done
  in the shared logic.

- The shared logic now returns several pieces of information as the
  result of a call to `analyzeSwitchStatement`: whether the switch
  statement had a `default` clause, whether it was exhaustive, whether
  the last case body terminates, and the type of the scrutinee.  These
  are all needed by the CFE.

- The shared logic now allows `TypeAnalyzer.errors` to be `null`,
  indicating that no errors should be reported.  This reflects how
  errors are suppressed during top level inference in the CFE.

- If a switch case lacks a `when` clause, this is reported by calling
  `handleNoWhen` rather than passing a boolean to `handleCaseHead`.

- The shared logic now reports the appropriate error when a case
  constant doesn't properly match the scrutinee's static type.

- Information about case labels is now delivered to flow analysis via
  `switchStatement_endAlternatives` rather than
  `switchStatement_beginCase`.  This made it possible to rewrite the
  shared `analyzeSwitchStatement` method in a way that requires less
  bookkeeping, because it no longer has to peek ahead to look for
  labels associated with a given case body.

- `TypeAnalyzer.analyzeExpression` is now responsible for
  understanding that "no context" and a context of `dynamic` should
  both be coalesced to `?`.  The analyzer does this (although it's not
  100% why), and it's definitely "business logic" that eventually
  belongs in the shared type analyzer.

- `TypeAnalyzer.analyzeSwitchExpression` and
  `TypeAnalyzer.analyzeSwitchStatement` no longer receive a list of
  ExpressionCaseInfo / StatementCaseInfo objects describing the cases;
  instead they query for them using a callback.  This reduces the
  lifetime of the ExpressionCaseInfo / StatementCaseInfo objects.  In
  the future, when we have record support, we could replace these
  objects with records, which would then be passed on the stack,
  avoiding any allocations.

- A new hook, `handleSwitchScrutinee`, is called right after visiting
  the "scrutinee" expression of a switch expression or switch
  statement.  This hook is needed by the analyzer to compute
  exhaustiveness.  In a future CL, I hope to move exhaustiveness
  analysis into the shared code as well, which should make this hook
  unnecessary.

- `TypeAnalyzer.analyzeSwitchStatement` now reports an error if a
  switch case completes normally and pattern support is not enabled.

- The test class `_MiniAstTypeAnalyzer` no longer overrides
  `analyzeExpression` to provide a default context type; instead,
  every call to `analyzeExpression` that didn't previously provide a
  context now provides a context of `?`.  Note that not all of these
  are correct, but they are close enough for the unit tests we have
  today.  I plan to fix them in future CLs as I replace this logic
  with shared logic.

- The hook `handleVariablePattern` is now always provided with a
  static type.  Previously, it was only provided with a static type if
  this was the first time the variable was bound in the pattern.

Change-Id: I70e3c5468312a9329fcf4ad2e13749a32d2418e7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/257487
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2022-09-12 13:55:37 +00:00
Sergey G. Grekhov 272a10853d [co19] Roll co19 to 3c9ba02a1e4bfc416ff3cd05df512d63deacd885
2022-09-02 sgrekhov22@gmail.com dart-lang/co19#1399. on clause tests added (dart-lang/co19#1416)
2022-09-02 sgrekhov22@gmail.com dart-lang/co19#1399. [Records] Type annotations and record expressions tests updated (dart-lang/co19#1415)
2022-09-01 sgrekhov22@gmail.com Fixes dart-lang/co19#1398. Fix tests that use unreachable code after `Never` (dart-lang/co19#1402)
2022-08-31 sgrekhov22@gmail.com dart-lang/co19#1399. [Records] Typos in subtyping tests description fixed (dart-lang/co19#1414)
2022-08-31 sgrekhov22@gmail.com dart-lang/co19#1399. [Records] Subtyping tests for records added (dart-lang/co19#1412)
2022-08-31 asashour@yahoo.com Fix typo (dart-lang/co19#1413)
2022-08-30 sgrekhov22@gmail.com dart-lang/co19#1405. BytesBuilder tests moved from dart:io to dart:typed_data (dart-lang/co19#1410)
2022-08-30 sgrekhov22@gmail.com dart-lang/co19#1399. Tests for record types. Part 1 (dart-lang/co19#1395)
2022-08-24 sgrekhov22@gmail.com dart-lang/co19#1405. Don't use deprecated API in co19 tests. Update generated files (dart-lang/co19#1407)
2022-08-24 sgrekhov22@gmail.com dart-lang/co19#1405. Don't use deprecated API in co19 tests (dart-lang/co19#1406)
2022-08-23 sgrekhov22@gmail.com Fixes dart-lang/co19#1361. Private fields promotion tests added (dart-lang/co19#1391)
2022-08-23 sgrekhov22@gmail.com Fixes dart-lang/co19#1394. Add missing compile-error (dart-lang/co19#1396)
2022-08-23 sgrekhov22@gmail.com Fixes dart-lang/co19#1403. Added test that `super` cannot be used as an expression (dart-lang/co19#1404)
2022-08-15 sgrekhov22@gmail.com dart-lang/co19#1388. FFI tests fixed for 32-bit systems (dart-lang/co19#1392)
2022-08-11 sgrekhov22@gmail.com dart-lang/co19#1388. FFI test failures fixed (dart-lang/co19#1389)

Change-Id: I2eee6c193eed1ce8a511f3ef5667ded947fbfad8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/257700
Reviewed-by: Alexander Thomas <athom@google.com>
2022-09-12 13:00:30 +00:00
Vyacheslav Egorov 912577baec [vm] Follow up to 4a4eedd860
* Avoid calling memmove(dst, nullptr, 0) as this is flagged by UBSAN.
* Avoid hitting a bug[1] in the linker: LLD's identical code folding
(ICF) happens to replace RecordCoverageInstr::DebugName() with
DispatchTable::LargestSmallOffset() because they happen to contain
the same machine code, ICF fails to accomodate that DebugName also
contains a relocation to constant string. To avoid this we simply
eliminate LargestSmallOffset and replace it with a constant. Same for
OriginElement.

TEST=manually tested previously failing tests

[1]: reported https://github.com/llvm/llvm-project/issues/57693

Change-Id: I38637df6475c7670081b7af0a2de75ca37f6f07c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/258801
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Commit-Queue: Slava Egorov <vegorov@google.com>
2022-09-12 12:33:57 +00:00
Emmanuel Pellereau 727e792e77 Revert "[ddc] Add non-null assertions when setting fields"
This reverts commit 27099c121c.

Reason for revert: Breaks google3 (b/246251728)
Original change's description:
> [ddc] Add non-null assertions when setting fields
>
> Fixes: https://github.com/dart-lang/sdk/issues/49918
> Change-Id: I6dddda878afa504bebebb00a80855bac636f8efd
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/258220
> Reviewed-by: Sigmund Cherem <sigmund@google.com>
> Commit-Queue: Nicholas Shahan <nshahan@google.com>

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

Change-Id: I5e3fb1c151a85e11025135b8fc95c65192b33791
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/258780
Commit-Queue: Emmanuel Pellereau <emmanuelp@google.com>
Reviewed-by: Emmanuel Pellereau <emmanuelp@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
2022-09-12 11:21:06 +00:00
Johnni Winther 96d52d4e35 [cfe] Handle multiple named record fields in constants
This bypasses the hoisting of record elements in constant record literals.
The created let variables would otherwise interfere with the constant
evaluation.

Closes #49915

Change-Id: Ia70387a0f0c435373dc5fcf5cdd526104db8f394
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/258363
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2022-09-12 10:16:16 +00:00
Aske Simon Christensen 51c4e03928 [dart2wasm] Type parameters and optional parameters for closures
Changes the representation of closures to include a vtable with entry
points for the various ways in which the function can be called.

For each combination of type parameter count and positional parameter
count, the names of named parameters occurring together with that
combination are partitioned into clusters such that any combination of
names that occurs together is contained within a single cluster.

Each combination of type parameter count and positional parameter
count gets a vtable layout for signatures without named parameters,
plus one for each cluster of parameter names belonging to the
combination.

Each vtable layout will have an entry for each number of positional
arguments from 0 up to the maximum number for the signature, followed
by an entry for each (non-empty) combination of argument names from
its cluster that occurs in a function call in the program.

This layout scheme is consistent with function subtyping in the sense
that if signature B is a subtype of signature A, then the Wasm struct
for the vtable layout corresponding to B is a subtype of the Wasm struct for the vtable layout corresponding to A, i.e. the fields in the layout
for A is a prefix of the fields in the layout for B.

Change-Id: I36569be5251cc0cca4373b08c48d37c214478c3c
Cq-Include-Trybots: luci.dart.try:dart2wasm-linux-x64-d8-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/256822
Commit-Queue: Aske Simon Christensen <askesc@google.com>
Reviewed-by: Joshua Litt <joshualitt@google.com>
2022-09-12 10:04:46 +00:00
Aske Simon Christensen 0cb91b9824 [dart2wasm] Produce wrapper functions for closures
Instead of using top types for the parameters and return of the
implementation function for a function expression or local function,
use precise types and generate a wrapper function with top types that
casts the parameters and calls the implementation function.

This unifies the wrapper function generation with tear-offs, setting
the stage for the upcoming generalization to support type parameters
and optional parameters.

The change also brings some benefits in its own right:
- Arguments to closures are converted once instead of at every use
- Direct calls to local functions avoid the conversion of arguments

Also add source location to closure function names and generally avoid
parentheses in function names, as they are confusing in stack traces.

Change-Id: If83073bb2e2dd17554ffa03fa2596e79d730fb67
Cq-Include-Trybots: luci.dart.try:dart2wasm-linux-x64-d8-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/256665
Reviewed-by: Joshua Litt <joshualitt@google.com>
2022-09-12 10:04:46 +00:00
Aske Simon Christensen 25b1bfe7a6 [dart2wasm] Print source location on exception during code generation
Change-Id: I870ee48707f6c353e2bd2c64505474d1d0e90130
Cq-Include-Trybots: luci.dart.try:dart2wasm-linux-x64-d8-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/257344
Reviewed-by: Jackson Gardner <jacksongardner@google.com>
2022-09-12 10:04:46 +00:00
Aske Simon Christensen 82f163fa4f [dart2wasm] Trivial test for subtype of Object
Saves some 27k code size (and redundant computation) on barista3.

Change-Id: I2c917ca54c356e754eaf555c93f05f008770654f
Cq-Include-Trybots: luci.dart.try:dart2wasm-linux-x64-d8-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/258543
Commit-Queue: Aske Simon Christensen <askesc@google.com>
Reviewed-by: Joshua Litt <joshualitt@google.com>
2022-09-12 09:28:26 +00:00
Parker Lougheed 13f9258511 [analyzer] Fix minor diagnostic message spelling mistakes
Change-Id: I37bb816d814fa804ab35716b6f75f08782ef00e0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/258720
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2022-09-11 17:54:26 +00:00
Konstantin Shcheglov f513115097 Use named parameters for a few AST implementations.
Change-Id: Id6a5f4f547d9e7ef98925168cc8caa9ebc67cab4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/258514
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2022-09-10 23:00:05 +00:00
Brian Wilkerson 41611a8d87 Change the type of the condition for if statements and if elements
Change-Id: Ia2a708682657527d579048a7b8a85a814e8ba1ac
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/258661
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2022-09-10 16:32:45 +00:00
Vyacheslav Egorov 4a4eedd860 [vm] Clean up ClassTable
* Merge ClassTable and SharedClassTable back together;
* Simplify handling of multiple arrays growing in sync;
* Refactor how reload deals with ClassTable.

The last change is the most important because it makes it
much easier to reason about the code. We move away from
copying bits and pieces of the class table and shared
class table into reload contexts.

Having two class table fields in the isolate group makes
it easier to reason about. One field contains program
class table (one modified by kernel loader and accessed
by various program structure cid lookups) and heap
walk class table (used by GC visitors). Normally these
two fields point to the same class table, but during
hot reload we temporary split them apart: original
class table is kept as a heap walk class table, while
program class table is replaced by a clone and updated
by reload.

If reload succeeds we drop original class table and
set program class table as heap walk one.

If reload fails we drop the program class table and
restore original one from heap walk table.

TEST=ci

Cq-Include-Trybots: luci.dart.try:vm-kernel-reload-linux-release-x64-try,vm-kernel-reload-linux-debug-x64-try,vm-kernel-reload-rollback-linux-debug-x64-try,vm-kernel-reload-rollback-linux-release-x64-try,vm-kernel-linux-debug-x64-try,vm-kernel-precomp-tsan-linux-release-x64-try,vm-kernel-tsan-linux-release-x64-try,vm-kernel-precomp-asan-linux-release-x64-try,vm-kernel-asan-linux-release-x64-try
Change-Id: I8b66259fcc474dea7dd2af063e4772df99be06c4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/258361
Commit-Queue: Slava Egorov <vegorov@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2022-09-10 15:12:35 +00:00
Brian Wilkerson b9052f85d6 Add documentation on adding new AST nodes
Change-Id: I13d7e7298c4094c3b85de931034c2d09da95d883
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/258508
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2022-09-10 05:02:55 +00:00
Srujan Gaddam e7b2038f8f [wasm] Change transitive JS imports to be a set
Avoid duplicates from the transitive import lists.

Change-Id: I681b3c25f74ac15ef48e909f93de8bc9cd2a869e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/258662
Commit-Queue: Joshua Litt <joshualitt@google.com>
Auto-Submit: Srujan Gaddam <srujzs@google.com>
Reviewed-by: Joshua Litt <joshualitt@google.com>
2022-09-10 04:25:24 +00:00
DEPS Autoroller 571f9cc390 Roll Dart Documentation Generator from aba679e24310 to 401a7e8adfa2 (1 revision)
https://dart.googlesource.com/dartdoc/+log/aba679e24310..401a7e8adfa2

2022-09-09 srawlins@google.com Improve assertion message in typedef issue with flutter (#3148)

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/dart-doc-dart-sdk
Please CC dart-ecosystem-gardener@grotations.appspotmail.com on the revert to ensure that a human
is aware of the problem.

To file a bug in Dart Documentation Generator: https://github.com/dart-lang/dartdoc/issues
To file a bug in Dart SDK: https://github.com/dart-lang/sdk/issues

To report a problem with the AutoRoller itself, please file a bug:
https://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md

Tbr: dart-ecosystem-gardener@grotations.appspotmail.com
Change-Id: I1ce79666bdee12f63f131d66a7f5796ee0a95814
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/258620
Commit-Queue: DEPS Autoroller <dart-autoroll@skia-public.iam.gserviceaccount.com>
Reviewed-by: Nate Bosch <nbosch@google.com>
Commit-Queue: Nate Bosch <nbosch@google.com>
2022-09-09 22:44:14 +00:00
Brian Wilkerson 00e9dc8644 Add documentation on adding new diagnostics
Change-Id: Ice38a93e009cc9c07638ddce96e8960d986fa3c1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/258509
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2022-09-09 21:53:36 +00:00
Brian Wilkerson d6ff1193c5 Partial implementation of record types in DartEditBuilder
While the work is incomplete (see the TODOs), this fixes an exception
that I saw this morning and is, I believe, a step in the right direction.

Change-Id: I6adc0e0df4ea9b64ea0c5d1dcd42a078d30c4a9b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/258507
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2022-09-09 21:48:25 +00:00
Konstantin Shcheglov 168e7444dc Add pumpEventQueue() to getTestCodeSuggestions(), try to fix race.
Change-Id: I8d8c30b014a8bd2770fa4f62131d05944a5d186a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/258511
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
2022-09-09 21:32:54 +00:00
Joshua Litt 6c36674dd8 [dart2wasm] Support returning ints from JS via static interop.
Change-Id: I20e08d9afcd567edf34de0cd9b9ad95a3e2663d7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/258501
Commit-Queue: Joshua Litt <joshualitt@google.com>
Reviewed-by: Srujan Gaddam <srujzs@google.com>
2022-09-09 21:21:34 +00:00
Nicholas Shahan 27099c121c [ddc] Add non-null assertions when setting fields
Fixes: https://github.com/dart-lang/sdk/issues/49918
Change-Id: I6dddda878afa504bebebb00a80855bac636f8efd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/258220
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
2022-09-09 21:05:25 +00:00
Joshua Litt 014818bf8e [dart2wasm] Implement js_util.instanceof.
Also fixes performanceNow for Chrome.

Change-Id: I1b70610a8a1a44c0f0e3ce7b166f32f9915324c3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/258504
Reviewed-by: Srujan Gaddam <srujzs@google.com>
Commit-Queue: Joshua Litt <joshualitt@google.com>
2022-09-09 20:40:34 +00:00
Aske Simon Christensen 9af959c167 [dart2wasm] Coerce types on imports/exports to externref or funcref
Change-Id: Id7fe0775e14b7ed16c925819ffc9c41dea863e4d
Cq-Include-Trybots: luci.dart.try:dart2wasm-linux-x64-d8-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/258001
Auto-Submit: Aske Simon Christensen <askesc@google.com>
Reviewed-by: Joshua Litt <joshualitt@google.com>
Commit-Queue: Joshua Litt <joshualitt@google.com>
2022-09-09 18:10:34 +00:00
Kallen Tu 7055da30a7 Remove dynamic invocations from io file classes.
Change-Id: Iaf556ca462b9d962557b627c59220101f384ae51
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/258380
Commit-Queue: Kallen Tu <kallentu@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>
2022-09-09 17:45:45 +00:00
Joshua Litt b04641f37d [dart2wasm] Fix @JS name parsing for factory constructors.
Change-Id: Iad6886a794b6ed5395177a3e45f69f10484fc703
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/258382
Reviewed-by: Srujan Gaddam <srujzs@google.com>
Commit-Queue: Joshua Litt <joshualitt@google.com>
2022-09-09 17:29:47 +00:00
Ryan Macnak 79afcf9c7d [vm] Add Dart_SetTimelineRecorderCallback.
TEST=ci
Bug: b/245563515
Change-Id: I5f8ada1854be9de5bf08f4492c3166826722dbf3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/258180
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2022-09-09 17:21:44 +00:00
Konstantin Shcheglov f58e9abf12 Use named parameters for a few AST implementations.
Change-Id: I4dcc9dc48c7c4718dff16f01a582f2865a655307
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/258502
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2022-09-09 16:59:44 +00:00
Brian Wilkerson 1e4d26b977 Add visitor support for pattern nodes
Change-Id: Ifaef899d0b34e3d72796afbe09a1e49306dd1038
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/258506
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2022-09-09 16:58:05 +00:00
Konstantin Shcheglov 20095b844a Use textual dumps for more completion tests.
Change-Id: If1160950c9f851cdb311ca1d35f02493ebc2d76c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/258505
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2022-09-09 16:41:24 +00:00
Alexander Markov 438e0ebb35 [vm] Throw error from external functions even if they have a body
TEST=language/constructor/external_constructor_test
Fixes https://github.com/dart-lang/sdk/issues/49912
Fixes https://github.com/dart-lang/sdk/issues/28565

Change-Id: If01fd39c3195afe059da46bf26ab5bcf158933a3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/258281
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2022-09-09 14:18:34 +00:00
Aske Simon Christensen cded056cf1 Move cast and toSet on immutable sets to implementation classes
These methods create new sets, whose implementation must match the
target platform. Thus, they should be specialized for the VM and
dart2wasm instead of being implemented in the shared mixin.

Change-Id: I102a45686e3eb373463f2fcdf84ee861e202ecc0
Cq-Include-Trybots: luci.dart.try:dart2wasm-linux-x64-d8-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/258362
Commit-Queue: Aske Simon Christensen <askesc@google.com>
Reviewed-by: Lasse Nielsen <lrn@google.com>
2022-09-09 14:04:34 +00:00
Aske Simon Christensen f2bc59738c Rename the VM's internal hash set classes
Rename `_CompactLinkedHashSet` to `_InternalLinkedHashSet` and
`_CompactImmutableLinkedHashSet` to `_InternalImmutableLinkedHashSet`
to make the names consistent with the corresponding `Map` class names
and to distinguish them from the non-VM-specific hash maps and sets,
which are generally named starting with `_Compact`.

Tested: ci
Change-Id: Ic1ebc44ba8beba34ceab382a4edddc6624fe3fb3
Cq-Include-Trybots: luci.dart.try:vm-kernel-precomp-linux-debug-x64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/258002
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
Reviewed-by: Daco Harkes <dacoharkes@google.com>
2022-09-09 14:04:34 +00:00
Lasse R.H. Nielsen 5179f5ae94 Make presubmit on Dart files check for default value separator.
This should prevent new code using old syntax.

Change-Id: I0620369a34b3838fb4555f5264c93bccf92acc42
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/256213
Reviewed-by: Alexander Thomas <athom@google.com>
Commit-Queue: Lasse Nielsen <lrn@google.com>
2022-09-09 12:34:34 +00:00
Aske Simon Christensen bab5cfbe74 Add more types to the VM's internal compact hash structures.
This gets rid of some occurrences of `dynamic` and makes the
associated implicit conversions explicit.

Based on https://dart-review.googlesource.com/c/sdk/+/237582

Tested: ci
Change-Id: I7faeffab395c916800b29ea7e56bd3f7d15aac54
Cq-Include-Trybots: luci.dart.try:dart2wasm-linux-x64-d8-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/258242
Commit-Queue: Aske Simon Christensen <askesc@google.com>
Reviewed-by: Lasse Nielsen <lrn@google.com>
2022-09-09 08:38:36 +00:00
Konstantin Shcheglov 680a23c534 Use named parameters in 'for' related nodes.
Change-Id: Id3ae04f383da65780157065278a692b2a654bddd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/258500
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2022-09-09 00:36:57 +00:00
Konstantin Shcheglov f31547fecd Use textual dumps in completion/dart/declaration tests.
Change-Id: I935031644543fbc9c8b8811669e41acff880018f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/258402
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2022-09-09 00:30:23 +00:00
Konstantin Shcheglov ee57ecbedb Use textual dumps for a few tests in completion/dart/location
Change-Id: I5fdec2ab84a59a2af5b31583c8a6dbf3aad53a0b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/258460
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2022-09-08 23:45:33 +00:00
Alexander Aprelev 51a8c5ccd9 [vm/redundant_stores] Clean up liveness update for MayThrow and HasSideEffects instructions.
Ensure that instructions that may throw and also have unknown side effects still load from all places.
Also since this optimization concerns AOT only, instructions that don't deopt but may throw(and don't have unknown side effects), still only load escaping stores.

Follow-up to 88fc8b65d2.
TEST=ci

Bug: https://github.com/dart-lang/sdk/issues/49657
Change-Id: I55b1347badcd74b4c334bb7b37571e91ebb310a2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/258440
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
2022-09-08 22:34:53 +00:00
Ryan Macnak e5fc6d652b [vm] Don't pass and copy unused category string when recording timeline events.
TEST=ci
Change-Id: I53b60a977c2b33d29a0ca685120044ba208d3ae4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/258321
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2022-09-08 22:02:46 +00:00
Konstantin Shcheglov ace52d922b Semantic highlighting for record type annotations and literals.
Change-Id: I16fb395a721f4fdd63cbf23b931551ea0f5c8682
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/258323
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2022-09-08 21:55:53 +00:00
Brian Wilkerson 0f51055083 Add implementation classes for pattern AST nodes
Visitor support is underway.

Change-Id: If4e54515650d21a202635973e2ce63b686bb98f5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/258400
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2022-09-08 21:54:43 +00:00
Kallen Tu 7e13c388fe Clean up - unused typedef and lint ignore for html.
Change-Id: I50f89a2d59478c8e2a63a81d106e0943b496ad46
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/257427
Commit-Queue: Kallen Tu <kallentu@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>
2022-09-08 20:59:24 +00:00
Devon Carew 2dddeeec99 [deps] rev http, intl, protobuf, shelf, test, webdev
Change-Id: I270c6fa43f53cda0816dfb63f2379302c2cfda0b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/258322
Reviewed-by: Kevin Moore <kevmoo@google.com>
Commit-Queue: Kevin Moore <kevmoo@google.com>
Auto-Submit: Devon Carew <devoncarew@google.com>
2022-09-08 19:54:33 +00:00
Mayank Patke 581db69c7a [dart2js] Avoid adding empty type rules.
The fragment emitter already tries to skip the call to `addRules` if the
ruleset is empty, but this occurs too early. The ruleset encoder strips
tautologies like `T <: T` and `InterfaceType <: Object`, but this occurs
after the empty check.

This CL removes the preprocessing from the encoder and instead performs
checks when entries are added to the ruleset, fixing the issue.

Change-Id: I62f937e0ff6abac12973f82b2c89d8ea6f3162b4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/258040
Reviewed-by: Joshua Litt <joshualitt@google.com>
Commit-Queue: Mayank Patke <fishythefish@google.com>
2022-09-08 19:25:43 +00:00
Ahmed Ashour 3584073fbc [analysis_server] AddReturnType to handle operator
Fixes #49913

Change-Id: If7fb8b47d1211f11242f4c58365537ba3ead08b4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/258241
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2022-09-08 18:57:03 +00:00
Danny Tuppeny 292ba46112 [analysis_server] Add some initial docs about running/debugging server from source in VS Code
Change-Id: I1218b3b583bc61d45a9568016ca825460717c12c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/258360
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2022-09-08 18:55:53 +00:00