Commit graph

101902 commits

Author SHA1 Message Date
Brian Wilkerson b22b78d481 Enhance CandidateSuggestions to have more data for relevance computations
I believe that we're computing the same values as we were before, but
the tests won't prove that. I couldn't think of any way to test this.
If you have any concerns and/or can think of a way to test it, do let me
know.

Change-Id: I489a2642b9b0345ad40fdc4afa9283eba5f65b3a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/373581
Reviewed-by: Keerti Parthasarathy <keertip@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2024-06-28 17:14:29 +00:00
Jens Johansen db50ebf837 [CFE] Auto-add coverage-ignore comments
This pushes coverage to 100%.

Change-Id: I0d5656698fffa4da4cb097b207e786ae997c21a9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/373662
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2024-06-28 13:01:39 +00:00
Sergey G. Grekhov c2fb6fc707 [co19] Roll co19 to 7b457e8d8c10361424beb7b432347f668c974439
2024-06-26 sgrekhov22@gmail.com dart-lang/co19#2694. Add experimental flag (dart-lang/co19#2725)
2024-06-21 sgrekhov22@gmail.com dart-lang/co19#2559. Add more tests for `augmented` expression in functions (dart-lang/co19#2711)
2024-06-21 sgrekhov22@gmail.com dart-lang/co19#2694. Add syntax tests for different expressions. Part 5 (dart-lang/co19#2721)

Change-Id: Ie201946b8e2a983bea393760192dc0af953f756f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/373660
Reviewed-by: Alexander Thomas <athom@google.com>
Reviewed-by: Erik Ernst <eernst@google.com>
2024-06-28 12:47:23 +00:00
Johnni Winther dec32c413e [cfe] Remove SourceCompilationUnit.sourceLibraryBuilder
Change-Id: I8ea290f03c2a15884b0f47e89ab7941d56b80b45
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/373463
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
2024-06-28 11:18:49 +00:00
Chloe Stefantsova a4c94716ba [analyzer][cfe] Introduce parsing for null-aware elements
Part of https://github.com/dart-lang/sdk/issues/55949
Closes https://github.com/dart-lang/sdk/issues/55954

Change-Id: I885772f292f6d70425d6eba15bad8b0c6dc86a1f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/370240
Reviewed-by: Keerti Parthasarathy <keertip@google.com>
Commit-Queue: Chloe Stefantsova <cstefantsova@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2024-06-28 09:49:30 +00:00
Daco Harkes 4a8b3c74f2 [deps] Roll dart-lang/native
Change-Id: I2f3b2fd7d27e468520c4736597b2b44f98b00cda
Cq-Include-Trybots: luci.dart.try:pkg-linux-debug-try,pkg-linux-release-arm64-try,pkg-linux-release-try,pkg-mac-release-arm64-try,pkg-mac-release-try,pkg-win-release-arm64-try,pkg-win-release-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/373464
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Moritz Sümmermann <mosum@google.com>
2024-06-28 09:05:18 +00:00
Jens Johansen 27985ef6cf [CFE] Wrap some things in curly braces
Preparing for auto-comments for coverage.

Change-Id: I50d3ff705d284050c0a3aa28e68596dcd4f2f597
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/373680
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2024-06-28 07:53:09 +00:00
Ömer Sinan Ağacan 0b027bc1ba [wasm_builder] Avoid generating unreachable instructions
After an instruction like `unreachable` or `throw`, stop generating
instructions until the end of the block.

This doesn't change wasm-opt output, but helps when debugging.

jsc test failures are probably because of
https://dart-review.googlesource.com/c/sdk/+/373240.

Closes #56082.

Change-Id: Iaa86c4eff3e1d5769667d9cdaa6de68f89c099ba
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/373280
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Ömer Ağacan <omersa@google.com>
2024-06-28 07:51:26 +00:00
Johnni Winther 325fd5a9fb [cfe] Use SourceCompilationUnit more in SourceLoader._createSourceLibraryBuilder
Change-Id: Ie1eef1344812dfe33918da0319ea853f0efbeca3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/373461
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2024-06-28 07:31:50 +00:00
Sam Rawlins 60eb656ee6 analyzer: Use docImport scope in library declarations
Work towards https://github.com/dart-lang/sdk/issues/56100

I also add a few other test cases that seemed to be missing.

Cq-Include-Trybots: luci.dart.try:flutter-analyze-try,analyzer-win-release-try,pkg-win-release-try
Change-Id: I6fdf8eae5bc68f51ec2908cbe108f73d56a65ff8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/373620
Auto-Submit: Sam Rawlins <srawlins@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2024-06-27 23:25:01 +00:00
Ben Konyi 44d4451476 Reapply "[ Service ] Start DDS and serve DevTools when the VM service is started via dart:developer"
In the previous version of this change, if the user had 'dart' on their
PATH and invoked 'dart compile js' (which spawns the VM service after
compilation completes), the VM service would attempt to spawn DDS using
'./dart' as the executable path instead of 'dart'. This would result in
DDS failing to start, causing the VM to print an error and hang.

This updated change checks to see if the parent directory of
`Platform.executable` is '.' and then verifies if './dart' exists or
not. If it doesn't, 'dart' is likely on the user's PATH and should be
used directly as the executable path.

See https://github.com/dart-lang/sdk/issues/56087 for details.

This reverts commit 4b88698e48.

TEST=pkg/dds/test/control_web_server_starts_dds_with_dart_on_path_test.dart

Change-Id: Id0f1dadd01d9202cbf7717f31393b43171cf3968
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/373561
Auto-Submit: Ben Konyi <bkonyi@google.com>
Reviewed-by: Derek Xu <derekx@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2024-06-27 22:47:46 +00:00
Konstantin Shcheglov 8dbe35d5f6 Augment. Updates for CONFLICTING_FIELD_AND_METHOD.
Change-Id: I66e9b00b0062a4f5ba260b32dd1b10061fbfe011
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/373600
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
2024-06-27 22:38:09 +00:00
Vyacheslav Egorov eb88654084 [vm] Avoid GetBlock in EliminateEnvironments and DelayAllocations
GetBlock has linear time complexity, so calling repetetively
might lead to quadratic complexity in pathological cases.

This avoids `GetBlock` in two places in the compiler:

- In EliminateEnvironments we were asking `current->GetBlock()`
  while iterating instructions inside a known `block`. This
  can obviously be short-circuited to just use that `block` directly.
- DelayAllocations we were calling `def->GetBlock()` and
  `use->GetBlock()`
  - `def->GetBlock()` is known because `def` is an instruction
    inside the block which were currently iterating, which means we
    can just use that block directly;
  - `use->GetBlock()` can be computed by `DominantUse(...)` which
    computes the `use` by iterating backwards from each use: during
    this iteration we will either hit
      a. a block entry - thus computing `use->GetBlock()`;
      b. `def` - thus establishing that `use` is in the same
         block as `def`; or
      c. another use - which means this is not dominant use.

R=alexmarkov@google.com

Fixes https://github.com/flutter/flutter/issues/150182

TEST=ci

Cq-Include-Trybots: luci.dart.try:vm-aot-linux-debug-x64-try,vm-aot-dwarf-linux-product-x64-try,vm-aot-linux-release-arm64-try
Change-Id: If7dcd74c01236d3bca9499883b51d273764e739c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/373502
Commit-Queue: Slava Egorov <vegorov@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2024-06-27 21:58:57 +00:00
Konstantin Shcheglov b13bd5b891 Augment. Report EXTENDS_DISALLOWED_CLASS and friends.
Change-Id: Icb6cfeb4ece0b5f33d252b60c2ecc24bb309355d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/373420
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2024-06-27 21:54:00 +00:00
Konstantin Shcheglov 3819e97f9d Augment. Compute augmented.interfaces for ExtensionTypeElement.
Change-Id: Ibf0abdaef6a9005b663e966417c7a5267913b108
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/373580
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2024-06-27 21:16:41 +00:00
Brian Wilkerson 9d28b1eb9f Add code to sort and truncate the candidate suggestions
This code isn't being called anywhere yet, but needs to be available in
order to allow us to convert the handlers over to using
`computeCandidateSuggestions` directly.

I've started wondering whether we want to rename `SuggestionCollector`
to something like `CompletionResult` to reflect the additional
information that it's starting to have and work that it's starting to
do.

Change-Id: Ib989b6649da2228c257fdc0e63f7013769fa2685
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/373323
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Keerti Parthasarathy <keertip@google.com>
2024-06-27 20:35:13 +00:00
Sam Rawlins 2d252d5c49 analyzer: split URI_DOES_NOT_EXIST for doc imports
Work towards supporting https://github.com/dart-lang/sdk/issues/50702
in google3. Related to the work attempted in
https://github.com/flutter/flutter/pull/150798.

Change-Id: I36fb1c47c94d5b965529db910fbd0e347bfba645
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/373442
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Sam Rawlins <srawlins@google.com>
2024-06-27 19:51:32 +00:00
pq b7530a9284 [wilcards] DUPLICATE_FIELD_FORMAL_PARAMETER tests
Fixes: https://github.com/dart-lang/sdk/issues/56092

Change-Id: Iba8a273f5ddf47bd39916a7f19b6cd214dd57583
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/373540
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
2024-06-27 19:45:28 +00:00
Kallen Tu 6fcfa93008 [wildcard-variables][test] Fix wildcard language tests.
This CL fixes some bugs in a few tests and removes unnamed optional default tests.

Bug: https://github.com/dart-lang/sdk/issues/55652
Change-Id: I41be6eb2f45598803eaeddd99375aa9cdb3fa990
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/373324
Commit-Queue: Kallen Tu <kallentu@google.com>
Reviewed-by: Lasse Nielsen <lrn@google.com>
2024-06-27 19:40:48 +00:00
Mayank Patke b64c64012f [dart2js] Remove asserts in ConstConditionalSimplifier
Fixes: b/349652368
Change-Id: I0d5cad6a55cba6b31d8a352d278daf844db95efb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/373328
Reviewed-by: Nate Biggs <natebiggs@google.com>
Commit-Queue: Mayank Patke <fishythefish@google.com>
2024-06-27 19:12:02 +00:00
Mayank Patke a868b8d9d6 Update ConstConditionalSimplifier's removal sentinel handling for
assertions

This matches the code pattern used elsewhere in this class as well as
the documentation for RemovingTransformer and brings it more in line
with the VM's unreachable code elimination.

Change-Id: Ica47f717be2bf72d84a7fbb2b78ad9cab1954407
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/373440
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2024-06-27 19:12:02 +00:00
Daco Harkes 7958fe1a15 [test] isVmAotConfiguration in custom configurations take 2
https://dart-review.googlesource.com/c/sdk/+/372260 fixed `dartkp`
invocations, but did not fix `dartk` due to conflicts with the
`dart2analyzer` compiler. (Patchset 3 of that CL.)

Try to land the same heuristic but guarded on if `compiler` is null.

Closes: https://github.com/dart-lang/sdk/issues/56041
Change-Id: Ieba182d74cb0d1d846a3073f1a02ee9f958ef36d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/372360
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Bob Nystrom <rnystrom@google.com>
2024-06-27 18:31:35 +00:00
Alexander Markov 00eac588c2 [vm] Remove transition_sentinel and detection of cyclic initialization of legacy static fields
Since null safety, all static fields with initializers are implicitly
late. This change cleans up transition_sentinel which was used in
the detection of cyclic initialization of legacy static fields.

TEST=ci

Change-Id: I6a990dc8ba030f5bd40eb0b86706cbfb0f725e33
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/373520
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2024-06-27 18:29:58 +00:00
pq caffef2942 [wildcards] DUPLICATE_DEFINITION support
Fixes: https://github.com/dart-lang/sdk/issues/56089

I'll follow-up with more tests for `DUPLICATE_FIELD_FORMAL_PARAMETER`s in another CL (see: https://github.com/dart-lang/sdk/issues/56092).

Change-Id: I23b13e697df6d16f856fef54b0fcf2a5db47bb22
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/373404
Commit-Queue: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2024-06-27 18:22:42 +00:00
pq d45b528711 [wildcards] UNUSED_FIELD tests
Since `_` fields are binding, I think we want to treat `_`s like any other private field and report `UNUSED_FIELD`s accordingly.

These tests confirm that our current implementation is WAI.

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

Change-Id: I2c8486a3b9e55d22c53989d74de974334477ec33
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/373405
Commit-Queue: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2024-06-27 18:00:49 +00:00
Sam Rawlins 8ed1ce9f6e svg: do not rename inherited ListMixin.length= parameter
The docs are currently broken because the inherited docs contain
references to the parameter, `newLength`, but in the overridden
setters, there is no such parameter:

https://api.dart.dev/stable/3.4.4/dart-svg/NumberList/length.html

CoreLibraryReviewExempt: No-op.
Change-Id: I27388847109adeef66cdc1ef2e4faedeac5390d9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/372522
Commit-Queue: Sam Rawlins <srawlins@google.com>
Auto-Submit: Sam Rawlins <srawlins@google.com>
Reviewed-by: Srujan Gaddam <srujzs@google.com>
2024-06-27 17:07:20 +00:00
Devon Carew 42a1d6df4f [deps] rev dartdoc, ecosystem, html, http, json_rpc_2, mime, mockito, source_span, stream_channel, term_glyph, tools, vector_math, watcher, webdev, yaml_edit
Revisions updated by `dart tools/rev_sdk_deps.dart`.

dartdoc (88df88c..7e5da60):
  7e5da609  2024-06-26  Sam Rawlins  Simplify some end2end tests into smaller tests (dart-lang/dartdoc#3795)
  36f1fc74  2024-06-26  Sam Rawlins  Store comment reference data on ModelNode (dart-lang/dartdoc#3797)
  7ed6ef80  2024-06-24  Sam Rawlins  Hide constructors that cannot be called or referenced by user code (dart-lang/dartdoc#3796)

ecosystem (31148cd..54ca01a):
  54ca01a  2024-06-25  Devon Carew  improvements for transferred issues (dart-lang/ecosystem#274)

html (3bc803d..f6c2c71):
  f6c2c71  2024-06-24  Kevin Moore  update lints (dart-lang/html#249)

http (4d8e7ef..bf96551):
  bf96551  2024-06-26  Nate Bosch  Call out more limitations of runWithClient (dart-lang/http#1248)
  eb189e1  2024-06-26  Brian Quinlan  [cupertino_http] Fix a bug where content-length was not set for multipart messages (dart-lang/http#1247)
  0bbd166  2024-06-25  Hossein Yousefi  [cronet_http] Upgrade jni and jnigen to 0.9.3 (dart-lang/http#1246)
  dce17c6  2024-06-24  Kevin Moore  misc: add missing packages to root readme (dart-lang/http#1245)
  0b40397  2024-06-24  Kevin Moore  update lints (dart-lang/http#1244)
  2971f32  2024-06-24  Kevin Moore  Update lints (dart-lang/http#1243)
  497bc15  2024-06-24  Parker Lougheed  Update various flutter.dev and dart.dev links (dart-lang/http#1238)
  5f6fcae  2024-06-24  Parker Lougheed  Fix some minor spelling and grammar mistakes (dart-lang/http#1239)
  b7ec613  2024-06-24  Anikate De  pkgs/ok_http: DevTools Networking Support. (dart-lang/http#1242)

json_rpc_2 (5b1cbd6..616937f):
  616937f  2024-06-26  Kevin Moore  Update lints, test JS & Wasm (dart-lang/json_rpc_2#116)

mime (4ca2f5e..fd7010b):
  fd7010b  2024-06-24  Kevin Moore  bump lints (dart-lang/mime#127)
  99e9855  2024-06-24  Jonas Finnemann Jensen  Add `topics` to `pubspec.yaml` (dart-lang/mime#121)

mockito (2302814..9deddcf):
  9deddcf  2024-06-25  Sam Rawlins  Fix lint in examples.
  e99ba54  2024-06-24  Sam Rawlins  Properly generate code for parameter default value Strings.

source_span (59a3903..89520f3):
  89520f3  2024-06-24  Kevin Moore  bump lints (dart-lang/source_span#114)

stream_channel (b41ff7a..dc620d2):
  dc620d2  2024-06-24  Kevin Moore  bump lints (dart-lang/stream_channel#108)

term_glyph (c86e817..6c2a977):
  6c2a977  2024-06-24  Kevin Moore  bump lints (dart-lang/term_glyph#54)

tools (e660a68..4c60686):
  4c60686  2024-06-24  Christopher Fujino  delete old log file if it exceeds kMaxLogFileSize of 25MiB (dart-lang/tools#277)
  7a231e5  2024-06-24  Parker Lougheed  [unified_analytics] Add lints to consistently use final (dart-lang/tools#278)

vector_math (e7b11a2..a4304d1):
  a4304d1  2024-06-24  Kevin Moore  Update and fix lints, require Dart 3.1 (google/vector_math.dart#328)
  253f69b  2024-06-24  Kevin Moore  blast_repo fixes (google/vector_math.dart#327)

watcher (c00fc2a..f312f1f):
  f312f1f  2024-06-24  Kevin Moore  update lints (dart-lang/watcher#169)

webdev (c566112..75417c0):
  75417c09  2024-06-26  Ben Konyi  Remove remaining MV2 logic (dart-lang/webdev#2453)

yaml_edit (08a146e..ad3292c):
  ad3292c  2024-06-27  Kavisi  Fix line folding (dart-lang/yaml_edit#87)

Change-Id: Ie2f914dcf97e10cc5a8501c926ddd7e254a0d151
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/373443
Auto-Submit: Devon Carew <devoncarew@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2024-06-27 17:05:49 +00:00
Parker Lougheed 747100ed60 [test_runner/vm] Provide some troubleshooting info when missing vm test runner
TEST=ci and locally with missing runner

Change-Id: Ia96829097dc05bea6a683dbefba36d1d6fa96ebb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/373325
Reviewed-by: Nate Bosch <nbosch@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2024-06-27 16:42:49 +00:00
Srujan Gaddam f9cd24327f Put expected value first in importModule tests
Change-Id: I1e1cb720c6bcc6991ab10def235dc3b97977c6c7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/373402
Commit-Queue: Lasse Nielsen <lrn@google.com>
Reviewed-by: Lasse Nielsen <lrn@google.com>
Auto-Submit: Srujan Gaddam <srujzs@google.com>
2024-06-27 13:58:53 +00:00
Jens Johansen 37b6a8cb1c [CFE] Fix timeout on crash in dartdoctest
The test uses the incremental compiler, and saves the previous one to
avoid compiling more than it has to. If a compile crashes though, the
incremental compiler will be left in a state where it thinks it's
currently compiling, and will have to wait for the previous compile to
finish. As it had crashed it won't, and we'll thus get a timeout on the
bot.
Here it's fixed by only saving it for next time once we're done.

Change-Id: I20a5ab20438a125487a95147e7a092f2129796a4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/373501
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2024-06-27 13:21:21 +00:00
Johnni Winther 217cabd706 [cfe] Add BuilderFactory interface to use in OutlineBuilder
This moves SourceCompilationUnit methods only used in the OutlineBuilder
to a separate BuilderFactory interface.

Change-Id: I6bb270404c3c0e19856513674608c5d493f38924
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/373500
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
2024-06-27 12:34:38 +00:00
Johnni Winther 56bb810be2 [cfe] Remove SourceCompilationUnit.libraryTypeParameterScopeBuilder
+ remove LibraryBuilder argument to computeTypeVariableBuilderVariance

Change-Id: Id1ba657725372a071d50d2403dabdb90fc0fdf48
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/373300
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2024-06-27 09:44:02 +00:00
Jens Johansen cde1d567e1 [CFE] Coverage tool handles comments ignoring coverage
Allow comments to ignore some coverage block.
This is a step towards being able to (fake) push everything to 100%
covered, making a regression be nicely marked.

Also running `pkg/front_end/tool/coverage_merger.dart` with `--comment`
will add ignore comments.

Change-Id: I798dc2673eb71247af16356a7bd28d6629285a16
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/372501
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2024-06-27 09:14:37 +00:00
Johnni Winther b48d4f224f [cfe] Cleanup imports
Change-Id: I60891b46119d6451810adf2846a05a66050bacd0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/373246
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2024-06-27 08:54:39 +00:00
Johnni Winther 543bc03de8 [cfe] Move /fasta/ content into /base/
These files should be further reorganized but that is for a
future CL.

Part of removing uses of 'fasta'.

Change-Id: I5010789b5901ba51c58d98fe26f13177b13c81b3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/373080
Reviewed-by: Jens Johansen <jensj@google.com>
Reviewed-by: Srujan Gaddam <srujzs@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2024-06-27 07:54:23 +00:00
Johnni Winther 990879dac3 [cfe] Move addBuilder to SourceCompilationUnit
Change-Id: I3835ef4c479494aa0ad8a46d0c1c75bf179e33ef
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/373281
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
2024-06-27 07:22:19 +00:00
Jens Johansen 5359af23a3 [parser] Add endToken on endSwitchExpressionCase, beginToken on endSwitchExpressionCase
Change-Id: I53c6bae47feb2d4570471a3b91c8e371838fcff5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/373245
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2024-06-27 05:47:18 +00:00
Srujan Gaddam 1c534e5fd5 [dart2wasm/ddc/dart2js] Lower Function.toJS and JSExportedDartFunction.toDart
Lowers these extension methods to some helper functions instead of
allowInterop to improve performance and get consistent semantics.

Specifically:
- Function.toJS no longer gives you the same JSFunction when calling
toJS on the same function multiple times in the JS compilers.
- Adds fast calling syntax for functions with 0-5 args in the JS
compilers.
- Allows additional args to be passed to converted functions that
are omitted in the JS compilers.
- The static type now determines the number of args that can be
passed to the JS function in the JS compilers.
- Fixes an issue in dart2wasm where if too few arguments are
passed, the call may succeed due to conversion of undefined to
null.
- Adds throws when a user tries to wrap a JS function that
returned from Function.toJS in the JS compilers.

Closes https://github.com/dart-lang/sdk/issues/55515
Addresses https://github.com/dart-lang/sdk/issues/48186

CoreLibraryReviewExempt: Changes to docs only in API surface.
Change-Id: I41d864dc5e02b597d9f1c16c88e3c04872f28225
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/368065
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Srujan Gaddam <srujzs@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2024-06-26 23:06:36 +00:00
Ben Konyi 4b88698e48 Revert "[ Service ] Start DDS and serve DevTools when the VM service is started via dart:developer"
This reverts commit 64d4689a78.

Reason for revert: Platform.executable doesn't return a path, just an executable name, which can cause breakages.

TEST=ci

Original change's description:
> [ Service ] Start DDS and serve DevTools when the VM service is started via dart:developer
>
> TEST=pkg/dds/test/control_web_server_starts_dds_test.dart
>
> Change-Id: I2e51783592912e5a719685f2ab5e7537b7a59586
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/366560
> Commit-Queue: Ben Konyi <bkonyi@google.com>
> Reviewed-by: Derek Xu <derekx@google.com>

Change-Id: I4ceaee4b5ca8f5557e90cd914ee69fe9aa5f85a7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/373381
Reviewed-by: Siva Annamalai <asiva@google.com>
Reviewed-by: Derek Xu <derekx@google.com>
Commit-Queue: Siva Annamalai <asiva@google.com>
2024-06-26 22:36:09 +00:00
pq 7d22d99b9b quick fixes for EXPECTED_BODY diagnostics
* `EXPECTED_CATCH_CLAUSE_BODY`
* `EXPECTED_CLASS_BODY`
* `EXPECTED_EXTENSION_BODY`
* `EXPECTED_EXTENSION_TYPE_BODY`
* `EXPECTED_FINALLY_CLAUSE_BODY`
* `EXPECTED_MIXIN_BODY`
* `EXPECTED_SWITCH_EXPRESSION_BODY`
* `EXPECTED_SWITCH_STATEMENT_BODY`
* `EXPECTED_TRY_STATEMENT_BODY`
* `MISSING_ENUM_BODY`

See: https://github.com/dart-lang/sdk/issues/55917


Change-Id: If33df1e9b3e93c7aaff30565f6d61dc56c24e491
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/373400
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
2024-06-26 22:21:11 +00:00
Srujan Gaddam b8402f5c27 [dart:js_interop] Make ExternalDartReference generic
Closes https://github.com/dart-lang/sdk/issues/55342
Closes https://github.com/dart-lang/sdk/issues/55536
Closes https://github.com/dart-lang/sdk/issues/56015

- Adds a type parameter T that extends Object? to
ExternalDartReference to capture the type of the value
that was externalized.
-- In the JS compilers, the representation type of
ExternalDartReference is now T.
-- In dart2wasm, the representation type is now JSValue?.
- ExternalDartReference no longer implements Object.
- Return type of toDartObject is now T.
- ObjectToExternalDartReference and
ExternalDartReferenceToObject both now are on a T that is
bound to Object?.
- Internal patches for WeakReference and Finalizer are
updated.

Change-Id: Ic2dc834b17ec6a4eb2122cba3c495a6e0a1eae6e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/370663
Commit-Queue: Srujan Gaddam <srujzs@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Lasse Nielsen <lrn@google.com>
2024-06-26 21:53:53 +00:00
Konstantin Shcheglov 2653075ac8 Macro. Issue 55931. Add new classes first, as AugmentationLibraryBuilder does for code.
Bug: https://github.com/dart-lang/sdk/issues/55931
Change-Id: Ice846b41ad4a8b08393346ef973b8ca5410b21ba
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/373401
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2024-06-26 21:49:09 +00:00
Konstantin Shcheglov c64cd5f394 Macro. Add more operation performance details.
Bug: https://github.com/dart-lang/sdk/issues/55784
Change-Id: Ibe83b4eee8bbf47ee79193244f9233cdb1b6aece
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/373161
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
2024-06-26 20:37:47 +00:00
Konstantin Shcheglov aea99e79ae Augment. Report AUGMENTATION_TYPE_PARAMETER_NAME
Change-Id: Icd455e26ec11f2daa9907e996df2706bd8f7d9f0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/373321
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2024-06-26 20:05:29 +00:00
Parker Lougheed 8e4c2d6cee [vm] Fix link to learn more about missing main function
The previous link no longer lead to a relevant destination. While I can add a client-side redirect on dart.dev, this CL updates the link to a redirect we can better guarantee as up to date in the long term.

TEST=vm/cc/DartAPI_RootLibraryMissingMain

Change-Id: I1e9dbf7a32c1468c308e9cf00d96575ba3c24695
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/373322
Reviewed-by: Slava Egorov <vegorov@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2024-06-26 19:58:11 +00:00
DEPS Autoroller d06fb0c54e Roll gn from f284b6b47039 to b2afae122eeb
If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/gn-dart-sdk
Please CC dart-ecosystem-gardener@grotations.appspotmail.com,dart-engprod@google.com on the revert to ensure that a human
is aware of the problem.

To file a bug in gn: https://bugs.chromium.org/p/gn/issues/list
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://issues.skia.org/issues/new?component=1389291&template=1850622

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

Cq-Include-Trybots: luci.dart.try:dart-sdk-linux-try;luci.dart.try:dart-sdk-mac-try;luci.dart.try:dart-sdk-mac-arm64-try;luci.dart.try:dart-sdk-win-try
Change-Id: I80361ebd889b1843beb71d59132cffd8508f5d31
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/373060
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
2024-06-26 19:52:52 +00:00
Ben Konyi 4abd615d32 [ CLI ] Update checkArtifactExists check to allow for Links in addition to Files
Related issue: https://github.com/dart-lang/sdk/issues/56080

Change-Id: I9b630ea3488e3f030cd92c593a4ee3bb4d718dd7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/373380
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Auto-Submit: Ben Konyi <bkonyi@google.com>
2024-06-26 17:18:17 +00:00
Konstantin Shcheglov 18a90180de Augment. Report AUGMENTATION_TYPE_PARAMETER_BOUND
Change-Id: Ie6c4e223f0fa85dadf0c3fe7902db67a55021b75
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/373163
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2024-06-26 17:11:48 +00:00
Keerti Parthasarathy c5ef526828 Test case with workaround for data driven fixes on extensions
Change-Id: I3e6d13ab110b84bd3f87c3bbd84ccb44d9ea5bc3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/373160
Commit-Queue: Keerti Parthasarathy <keertip@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2024-06-26 16:20:18 +00:00
Ömer Sinan Ağacan d33c948e1c [dart2wasm] Use unsafeCast in a few places
If a `String` is not a `StringBase` it must be a `JSStringImpl`.

Using `unsafeCast` instead of `as` improves generated code as it avoids
calling the "as" function for casting to `JSStringImpl`.

Change-Id: Idba4f44fc44b7715c4433262dd0eab25d062d2d0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/373244
Commit-Queue: Ömer Ağacan <omersa@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2024-06-26 13:37:42 +00:00