Commit graph

100493 commits

Author SHA1 Message Date
Jonas Termansen e445389862 [infra] Remove Goma support.
Bug: b/296994239
Change-Id: Ic96571d2c16d7c252cb41673e8bdb16cdb4de754
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/360507
Commit-Queue: Jonas Termansen <sortie@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
Reviewed-by: William Hesse <whesse@google.com>
2024-04-02 22:54:19 +00:00
Derek Xu c490c4bd4c [CLI] Make passing --resident a prerequisite for passing --resident-compiler-info-file
TEST=test case added to
pkg/dartdev/test/commands/compilation_server_test.dart

Issue: https://github.com/dart-lang/sdk/issues/54245
Change-Id: I3d982a8d85b63fed8510144bade71e2c95ced121
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/359581
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Derek Xu <derekx@google.com>
2024-04-02 22:07:47 +00:00
Derek Xu 1ea64da84b [CLI] Replace --resident-server-info-file option with --resident-compiler-info-file option
For backwards compatibility reasons, the arg parser will still understand --resident-server-info-file, but it will not print a help message for it.

TEST=pkg/dartdev/test/commands/compilation_server_test.dart and
pkg/dartdev/test/commands/compilation_server_test.dart

Issue: https://github.com/dart-lang/sdk/issues/54245
Change-Id: I59a1a7c495194ff3c48de7fb65255de5d9f150f4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/359660
Reviewed-by: Ben Konyi <bkonyi@google.com>
2024-04-02 22:07:47 +00:00
Derek Xu ea1170426c [CLI] Improve documentation of dart run --resident and dart compilation-server
TEST=CI

Issue: https://github.com/dart-lang/sdk/issues/54245
Change-Id: I1806e1ef62e17d626e1bc37a10f67e6e8b402a0a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/358741
Reviewed-by: Ben Konyi <bkonyi@google.com>
2024-04-02 22:07:47 +00:00
Nicholas Shahan 37e86575c4 [ddc] Refactor visitDynamicGet
Stop passing `null` as the member parameter of `_emitPropertyGet`.

Avoids the use of one method with multiple code paths and returns
to handle any situation because it becomes very hard to reason
about what original source code leads to each path.

Issue: https://github.com/dart-lang/sdk/issues/54463
Change-Id: Iab15890541150cfc8c230c209adec245da025762
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/357206
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Srujan Gaddam <srujzs@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2024-04-02 21:50:42 +00:00
Kallen Tu cd4b418628 [linter] Add unintended_html_in_doc_comment lint.
This CL adds a lint that reports when a user uses a pair of angled brackets which are not in a code block, nor a code span, and is not an autolink.

Updated the `rules.json` for the new lint as well.

Bug: https://github.com/dart-lang/linter/issues/4793
Change-Id: I1ca762b5e62678b8c6fba60206f3465154696b6c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/359900
Reviewed-by: Morgan :) <davidmorgan@google.com>
Commit-Queue: Kallen Tu <kallentu@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2024-04-02 21:09:51 +00:00
Sam Rawlins e1a5b44144 DAS: Move some CorrectionUtils.prepare methods to DartFileEditBuilder.
Primarily this moves `prepareNewFieldLocation` and
`prepareNewGetterLocation` to DartFileEditBuilder, as
`addFieldInsertion` and `addGetterInsertion`. Where
`prepareNewFieldLocation` was previously used in conjunction with
`addInsertion`, a correction producer now just needs to call
`addFieldInsertion`. This new method determines the insertion offset,
and and prefix String and suffix String (just newlines and indents),
and handles the prefix and suffix, surrounding use of the `buildEdit`
callback.

These form a nice new API for correction producers like create_field,
create_getter, and create_setter.

The implementation is a little hairy; the DartFileEditBuilder does not
have access to things like `eol` and `getIndent`; those are made
available in DartEditBuilder, so it does that work in
`addCompilationUnitMemberInsertion`, _inside_ the call to
`addInsertion`, where that builder is available.

Though the implementation is a bit hairy, I think it is a much tidier
API for correction producers. The prior API was a little awkward in
that a correction producer would have to ask CorrectionUtils for this
odd data object that contained an offset, and a prefix and suffix
String. Rather than using these objects in any meaningful way, the
correction producer just gave it back to one or another builder. It
felt opaque to me.

The rest of the `CorrectionUtils.prepare*` methods will follow.

Change-Id: I32f23336c873cee4158a4ac6797961a40d86c25a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/360302
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2024-04-02 20:47:32 +00:00
Alexander Markov 0af6dde79d Reland "[vm] Replace array GetIndexed graph intrinsics with flow graph builder implementation"
This is a reland of commit d24b5d1f5e

On top of the original change, the following is fixed and improved:

1) Flow graph builder (FGB) body is now also applied to
   dynamic invocation forwarders (similarly to graph
   intrinsics).

2) Frame can be omitted for functions which have a
   call on a shared slow path. This is needed to make
   FGB implementation of GetIndexed frameless, as it has
   GenericCheckBound which calls on shared slow path.
   (Graph intrinsics are frameless).

3) Range analysis is enabled for force-optimized functions,
   so more efficient code can be generated for boxing
   instructions. Range analysis is fixed to avoid crashes
   and correctly intersect ranges with constant boundaries
   (needed for some force-optimized FFI functions).

4) EliminateStackOverflowChecks pass is enabled for
   force-optimized functions so CheckStackOverflow can be
   eliminated.

Original change's description:
> [vm] Replace array GetIndexed graph intrinsics with flow graph builder implementation
>
> _Array, _GrowableList, internal and external typed data 'operator []'
> are now implemented in the flow graph builder.
>
> Unlike graph intrinsics, flow graph created in the flow graph builder
> can be used by the inliner. Corresponding graph intrinsics and native
> methods are removed.
>
> Also, this change adds missing external typed data indexing operations.
>
> TEST=ci
>
> Change-Id: Ic19784481feadf54c096a587413e67b4e18353dc
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/359940
> Reviewed-by: Ryan Macnak <rmacnak@google.com>
> Commit-Queue: Alexander Markov <alexmarkov@google.com>

TEST=ci

Change-Id: I04ef008a04238d432683d7543cd047e35bad17c3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/360560
Reviewed-by: Tess Strickland <sstrickl@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2024-04-02 20:41:19 +00:00
Brian Wilkerson df1361dded Update the style of the AST API docs, part 1
I mostly left the documentation for the classes unchanged in this CL. I
intend to improve the class docs in a second CL, but I thought it would
be too much to try to do it all in one.

As it is, I appologize for the size of the diff. I can break it up if
it's too much to look at. Most of it is simple style updates, formatting
changes, and deletion of duplicated docs on the Impl classes,  but there
are some places where I made more substantive changes.

Change-Id: I5e92dbce8d39bd9c0bf1f804cded1b00526eb082
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/360562
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
2024-04-02 20:31:33 +00:00
Ben Konyi db3dda17e3 Roll webdev to 4067462c8d605266a23c3725948a0314102c95f9
Change-Id: Ifcb8fc330a0ef72bb73241994cfcafb47bb5db14
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/360140
Reviewed-by: Dan Chevalier <danchevalier@google.com>
Reviewed-by: Elliott Brooks <elliottbrooks@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
Auto-Submit: Ben Konyi <bkonyi@google.com>
2024-04-02 20:23:37 +00:00
Nicholas Shahan c5218f2d4e [ddc] Refactor visitFunctionTearOff
Stop passing `null` as the member parameter of `_emitPropertyGet`.

Avoids the use of one method with multiple code paths and returns
to handle any situation because it becomes very hard to reason
about what original source code leads to each path.

Issue: https://github.com/dart-lang/sdk/issues/54463
Change-Id: I1255817c7cf76578b256650789f6530b456b2f03
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/357207
Reviewed-by: Srujan Gaddam <srujzs@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Bob Nystrom <rnystrom@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
2024-04-02 19:57:25 +00:00
Nate Biggs 1e8ea8a7da Wrap field initializers copied by TFA in a FileUriExpression.
Before TFA runs, MixinFullResolution will clone a mixin's fields into the application classes for that mixin. The cloned Field on the application class will have a fileUri that refers to the original mixin file.

However, TFA then copies those fields into FieldInitializers which don't have a fileUri context and so the fileUri for the surrounding Constructor is used. This leaves expressions in the initializer with offsets relative to the mixin's file but in the context of the mixin application's file.

To fix this, we can wrap the initializer in a FileUriExpression referring to the original mixin class. We only do this if the field the initializer is copied from refers to a different file than the target constructor.

Also add handlers for FileUriExpressions to several visitors that don't already support this new AST node.

Change-Id: I47b0d48dfe87303949130a40216b199949cfa1d9
Tested: Existing test suite.
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/360420
Commit-Queue: Nate Biggs <natebiggs@google.com>
Reviewed-by: Ömer Ağacan <omersa@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2024-04-02 19:55:19 +00:00
Nate Biggs f54eb08177 [dart2js] Update Dart2jsStage definitions and CLI surface area.
Today to invoke Dart2js with sequential actions there are 2 ways to specify the stage from the command line. By specifying a `write-<stage-data>=<some-uri>` or by using `stage=<some-stage>`. Internally we use the former via a similar (but separate) concept to Dart2jsStage. The goal here is to consolidate all these different entry points.

The new CLI works as follows:
- To run the compiler in full you can:
  - Pass no additional flags as before
  - Specify 'stage=all'
  - 'dump-info-all' runs the full compilation from scratch but includes
    dump info.
- To run the compiler in sequential mode you specify a stage:
  - Each stage has its own name passed to the '--stage' flag.
  - All the intermediate data URIs can be passed to every stage and only
    the relevant ones are used for any given stage. If no URI is passed
    then a default URI is used.
  - 'dump-info' is now its own stage. Partial dump info data is
    always included in the emit-js and codegen-emit-js steps.
  - 'cfe-only' flag is maintained for compatibility with Flutter CLI.


Change-Id: I67965d7708688a85c866d8abef3716bee23a083f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/358740
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Nate Biggs <natebiggs@google.com>
2024-04-02 19:46:11 +00:00
eliasyishak 4ea4eec023 Update DEPS
R=jacobr@google.com

Change-Id: I70dbe194f519d50f6a0cb244b1f80bd6c1fa9186
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/360540
Commit-Queue: Elias Yishak <eliasyishak@google.com>
Reviewed-by: Jacob Richman <jacobr@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2024-04-02 19:32:22 +00:00
Konstantin Shcheglov 919d405617 Augment. Parse 'augment' for extension declaration.
Change-Id: I66bff906ed990a84b4c48bd1c32ef6ac7f1c21b3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/360121
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2024-04-02 17:47:22 +00:00
Sam Rawlins c9474ebaaa meta: Introduce TargetKind.directive
Fixes https://github.com/dart-lang/sdk/issues/52274

Change-Id: I67884caf86502d4edd848eb32a30097488e09db9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/360480
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2024-04-02 17:29:29 +00:00
Nicholas Shahan add2f411e6 [web] Add static js interop .call() tests
These tests should help:
 - avoid regressions in the existing behavior
 - highlight incremental improvements towards implementing the
   desired behavior (with corresponding changes to the expectations)
 - identify the differences between the JavaScript and wasm compilers

Change-Id: Ie95233868a13b7ffffc2688ab7c973dcd14ed721
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/359246
Reviewed-by: Srujan Gaddam <srujzs@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Bob Nystrom <rnystrom@google.com>
2024-04-02 17:03:12 +00:00
Konstantin Shcheglov c5f876b7aa Augment. Use ExtensionOnClause in ExtensionDeclaration, make it optional.
Change-Id: I696ffd0b8e8f3bf9017b583d480313ec7c7753f7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/360561
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2024-04-02 16:12:00 +00:00
Danny Tuppeny 046f3117b6 [analysis_server] Fix navigation on augmentation directives
Change-Id: I0972d6c9aa93f1bac180504da96e63ed9f04e63e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/360260
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2024-04-02 16:09:26 +00:00
Devon Carew 14e2bf8ce8 [deps] rev async, boolean_selector, browser_launcher, cli_util, clock, convert, crypto, csslib, fixnum, html, http, lints, logging, markdown, matcher, mime, path, pool, shelf, source_map_stack_trace, sse, stack_trace, stream_channel, string_scanner, term_glyph, test, test_descriptor, test_process, test_reflective_loader, typed_data, watcher, web, web_socket_channel, webdriver, yaml, yaml_edit
Revisions updated by `dart tools/rev_sdk_deps.dart`.

async (1556660..4796804):
  4796804  2024-04-01  dependabot[bot]  Bump actions/checkout from 4.1.1 to 4.1.2 (dart-lang/async#270)

boolean_selector (be88351..24635df):
  24635df  2024-04-01  dependabot[bot]  Bump actions/checkout from 4.1.1 to 4.1.2 (dart-lang/boolean_selector#57)

browser_launcher (7956230..c4b2c81):
  c4b2c81  2024-04-01  dependabot[bot]  Bump actions/checkout from 4.1.1 to 4.1.2 (dart-lang/browser_launcher#56)

cli_util (ffeb5d2..12cd216):
  12cd216  2024-04-01  dependabot[bot]  Bump actions/checkout from 4.1.1 to 4.1.2 (dart-lang/cli_util#98)

clock (daf0fad..a732a09):
  a732a09  2024-04-01  dependabot[bot]  Bump actions/checkout from 4.1.1 to 4.1.2 (dart-lang/clock#61)

convert (d4d6368..186ac22):
  186ac22  2024-04-01  dependabot[bot]  Bump actions/checkout from 4.1.1 to 4.1.2 (dart-lang/convert#102)

crypto (69d13c9..1c7fbad):
  1c7fbad  2024-04-01  dependabot[bot]  Bump actions/checkout from 4.1.1 to 4.1.2 (dart-lang/crypto#166)

csslib (4216525..171ed48):
  171ed48  2024-04-01  dependabot[bot]  Bump actions/checkout from 4.1.1 to 4.1.2 (dart-lang/csslib#198)

fixnum (570b28a..dec16eb):
  dec16eb  2024-04-01  dependabot[bot]  Bump actions/checkout from 4.1.1 to 4.1.2 (dart-lang/fixnum#125)

html (327e37a..5b99b43):
  5b99b43  2024-04-01  dependabot[bot]  Bump actions/checkout from 4.1.1 to 4.1.2 (dart-lang/html#239)

http (280d361..5214f76):
  5214f76  2024-04-01  dependabot[bot]  Bump actions/setup-java from 4.1.0 to 4.2.1 (dart-lang/http#1171)
  f89813e  2024-04-01  dependabot[bot]  Bump actions/cache from 4.0.1 to 4.0.2 (dart-lang/http#1169)
  c14e440  2024-03-28  Brian Quinlan  Make `test` a dev_dependency (dart-lang/http#1166)
  a283716  2024-03-28  Brian Quinlan  Add eq, toString and hash methods to HttpProfileRedirectData (dart-lang/http#1165)
  70cf298  2024-03-28  Brian Quinlan  Ignore errors added to `bodySink`s (dart-lang/http#1164)

lints (ead7708..df9bcbf):
  df9bcbf  2024-04-01  dependabot[bot]  Bump actions/checkout from 4.1.1 to 4.1.2 (dart-lang/lints#182)

logging (7a7bd5e..dcaf249):
  dcaf249  2024-04-01  dependabot[bot]  Bump actions/checkout from 4.1.1 to 4.1.2 (dart-lang/logging#160)

markdown (8d07abc..782b180):
  782b180  2024-04-01  dependabot[bot]  Bump subosito/flutter-action from 2.12.0 to 2.15.0 (dart-lang/markdown#603)
  8a480f3  2024-04-01  dependabot[bot]  Bump actions/checkout from 4.1.1 to 4.1.2 (dart-lang/markdown#604)

matcher (d954c8d..54c2798):
  54c2798  2024-04-01  dependabot[bot]  Bump actions/checkout from 4.1.1 to 4.1.2 (dart-lang/matcher#244)

mime (9a16871..0a32241):
  0a32241  2024-04-01  dependabot[bot]  Bump actions/checkout from 4.1.1 to 4.1.2 (dart-lang/mime#117)

path (a7b6960..a7284b9):
  a7284b9  2024-04-01  dependabot[bot]  Bump actions/checkout from 4.1.1 to 4.1.2 (dart-lang/path#160)

pool (c118f69..8055cbb):
  8055cbb  2024-04-01  dependabot[bot]  Bump actions/checkout from 4.1.1 to 4.1.2 (dart-lang/pool#82)

shelf (1acbc67..68cb864):
  68cb864  2024-04-01  dependabot[bot]  Bump actions/cache from 4.0.1 to 4.0.2 (dart-lang/shelf#422)
  4c55675  2024-04-01  dependabot[bot]  Bump actions/checkout from 4.1.1 to 4.1.2 (dart-lang/shelf#421)

source_map_stack_trace (c756496..d03fd9b):
  d03fd9b  2024-04-01  dependabot[bot]  Bump actions/checkout from 4.1.1 to 4.1.2 (dart-lang/source_map_stack_trace#47)

sse (b53ba14..1ab266a):
  1ab266a  2024-04-01  dependabot[bot]  Bump actions/checkout from 4.1.1 to 4.1.2 (dart-lang/sse#106)

stack_trace (155f12c..c39ae6e):
  c39ae6e  2024-04-01  dependabot[bot]  Bump actions/checkout from 4.1.1 to 4.1.2 (dart-lang/stack_trace#150)

stream_channel (e02a5dd..5f72035):
  5f72035  2024-04-01  dependabot[bot]  Bump actions/checkout from 4.1.1 to 4.1.2 (dart-lang/stream_channel#102)

string_scanner (a2bcdb5..8dbfddf):
  8dbfddf  2024-04-01  dependabot[bot]  Bump actions/checkout from 4.1.1 to 4.1.2 (dart-lang/string_scanner#70)

term_glyph (85a4aa6..2ad48ce):
  2ad48ce  2024-04-01  dependabot[bot]  Bump actions/checkout from 4.1.1 to 4.1.2 (dart-lang/term_glyph#48)

test (6a4e75a..ce3c8ca):
  ce3c8cac  2024-04-01  dependabot[bot]  Bump actions/checkout from 4.1.1 to 4.1.2 (dart-lang/test#2199)
  e70c291e  2024-04-01  dependabot[bot]  Bump github/codeql-action from 3.24.6 to 3.24.9 (dart-lang/test#2201)
  cb8c7a6f  2024-04-01  dependabot[bot]  Bump actions/cache from 4.0.1 to 4.0.2 (dart-lang/test#2200)

test_descriptor (35f97af..b61cfb4):
  b61cfb4  2024-04-01  dependabot[bot]  Bump actions/checkout from 4.1.1 to 4.1.2 (dart-lang/test_descriptor#62)

test_process (7fe39af..94ee46d):
  94ee46d  2024-04-01  dependabot[bot]  Bump actions/checkout from 4.1.1 to 4.1.2 (dart-lang/test_process#54)

test_reflective_loader (9862703..d7167a2):
  d7167a2  2024-04-01  dependabot[bot]  Bump actions/checkout from 4.1.1 to 4.1.2 (dart-lang/test_reflective_loader#58)

typed_data (375efaa..8c7393c):
  8c7393c  2024-04-01  dependabot[bot]  Bump actions/checkout from 4.1.1 to 4.1.2 (dart-lang/typed_data#83)

watcher (21858a4..1bd2f20):
  1bd2f20  2024-04-01  dependabot[bot]  Bump actions/checkout from 4.1.1 to 4.1.2 (dart-lang/watcher#163)

web (c522718..e773de9):
  e773de9  2024-04-01  dependabot[bot]  Bump actions/checkout from 4.1.1 to 4.1.2 (dart-lang/web#218)

web_socket_channel (3db86bc..19d82db):
  19d82db  2024-04-01  dependabot[bot]  Bump actions/checkout from 4.1.1 to 4.1.2 (dart-lang/web_socket_channel#338)

webdriver (73a7ac8..c80e01e):
  c80e01e  2024-04-01  dependabot[bot]  Bump actions/checkout from 4.1.1 to 4.1.2 (google/webdriver.dart#295)

yaml (e598443..5a1c4be):
  5a1c4be  2024-04-01  dependabot[bot]  Bump actions/checkout from 4.1.1 to 4.1.2 (dart-lang/yaml#160)

yaml_edit (54884db..f5a92b3):
  f5a92b3  2024-04-01  dependabot[bot]  Bump actions/checkout from 4.1.1 to 4.1.2 (dart-lang/yaml_edit#70)

Change-Id: I26b63038b94c9f9b0420256e3f567d10a40f9582
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/360502
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Devon Carew <devoncarew@google.com>
2024-04-02 15:23:57 +00:00
Tess Strickland 9fc280a7f6 [vm/compiler] Add all Compressed Assembler methods to AssemblerBase.
Remove CompareWithCompressedFieldFromOffset, which has no uses.

Rename the LoadFromOffset and StoreFromOffset methods that took
Addresses to Load and Store, respectively. This makes the names
of the Assembler methods more uniform:

  * Takes an address: Load, Store, LoadField, LoadCompressedField,
    StoreIntoObject, StoreCompressedIntoObject, LoadSmi,
    LoadCompressedSmi, etc.
  * Takes a base register and an offset: LoadFromOffset, StoreToOffset,
    LoadFieldFromOffset, LoadCompressedFieldFromOffset,
    StoreIntoObjectOffset, StoreCompressedIntoObjectOffset,
    LoadSmiFromOffset, LoadCompressedSmiFromOffset, etc.

Create AssemblerBase methods for loading and storing compressed
pointers that weren't already there, as well as the corresponding
methods for loading and storing uncompressed values.

Make non-virtual methods that load and store uncompressed fields
that call the corresponding method for loading from and storing to
memory regions, adjusting the address or offset accordingly. This
avoids needing per-architecture overrides for these.

Make non-virtual methods that load compressed fields, calling the
corresponding method for loading a compressed value from a memory
region. (Since compressed pointers are only stored in Dart objects,
and stores into a Dart object may require a barrier, there is no
method for storing a compressed value into an arbitrary memory region.)

Create pure virtual methods for loading from or storing to an Address
or any method that does not have both an Address-taking and a
base register and offset pair-taking version (e.g., LoadAcquire).

Create methods for loading from or storing to a base register
and an offset. The base implementation takes the base register and
offset and creates an Address from it, then calls the Address-taking
equivalent. These methods are non-virtual when the implementation is
the same on all architectures and virtual to allow overriding when
necessary.

Make a non-virtual method for loading uncompressed Smis, since all
architectures have the same code for this, including the DEBUG check.

If compressed pointers are not being used, all the methods for
compressed pointers are non-virtual methods that call the
corresponding method for uncompressed values.

If compressed pointers are being used:

* Install pure virtual methods for loading compressed values from
  and storing compressed values to an Address or any method that does
  not have both an Address-taking and a base register and offset
  pair-taking version (e.g., LoadAcquireCompressed).

* Install virtual methods for loading compressed values from and
  storing compressed values to a base register and offset. Like the
  uncompressed implementation, the base implementation of these
  create an Address and call the Address-taking equivalent, and these
  implementations are overridden on ARM64.

* Install a non-virtual method for loading compressed Smis, since the
  only difference is that it loads a zero-extended 32-bit value, which
  AssemblerBase can do.

TEST=ci (refactoring only)

Change-Id: I934791d26a6e2cdaa6ac5f188b0fd89dbdc491d1
Cq-Include-Trybots: luci.dart.try:vm-aot-android-release-arm64c-try,vm-aot-android-release-arm_x64-try,vm-aot-linux-debug-x64-try,vm-aot-linux-debug-x64c-try,vm-aot-mac-release-arm64-try,vm-aot-mac-release-x64-try,vm-aot-obfuscate-linux-release-x64-try,vm-aot-optimization-level-linux-release-x64-try,vm-aot-win-debug-arm64-try,vm-appjit-linux-debug-x64-try,vm-asan-linux-release-x64-try,vm-checked-mac-release-arm64-try,vm-eager-optimization-linux-release-ia32-try,vm-eager-optimization-linux-release-x64-try,vm-ffi-android-debug-arm-try,vm-ffi-android-debug-arm64c-try,vm-ffi-qemu-linux-release-arm-try,vm-ffi-qemu-linux-release-riscv64-try,vm-linux-debug-ia32-try,vm-linux-debug-x64c-try,vm-mac-debug-arm64-try,vm-mac-debug-x64-try,vm-msan-linux-release-x64-try,vm-reload-linux-debug-x64-try,vm-reload-rollback-linux-debug-x64-try,vm-ubsan-linux-release-x64-try,vm-win-debug-arm64-try,vm-win-debug-x64-try,vm-win-release-ia32-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/359861
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Commit-Queue: Tess Strickland <sstrickl@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2024-04-02 14:54:13 +00:00
Keerti Parthasarathy 8dcb212010 Issue 53669: Remove duplicate await when inlining methods.
Fixes https://github.com/dart-lang/sdk/issues/53669

Change-Id: I64eb73d5eef4a8a8ab5184b3e67bb2303faed5e7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/360580
Commit-Queue: Keerti Parthasarathy <keertip@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2024-04-02 14:47:02 +00:00
David Morgan b2d31da59e [CFE] Surface diagnostics from nested macro build.
R=johnniwinther@google.com

Change-Id: Ia8558bbc7ff92699266eb865a0eb4bf3b98b7a4c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/356520
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Morgan :) <davidmorgan@google.com>
2024-04-02 14:07:39 +00:00
Matan Lurey a7c57c327c Initial implementation and tests of @doNotSubmit.
This is my first time contributing something like this, so I mostly went with my gut and tried to refer to similar annotations and diagnostics.

Happy to make adjustments.

R=pquitslund@google.com,brianwilkerson@google.com
CC=​yjbanov@google.com

Bug: https://github.com/dart-lang/sdk/issues/28113
Change-Id: I628311ed99f62b04c37bd1e0ec82ae0b1652d7f9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/360481
Commit-Queue: Matan Lurey <matanl@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
2024-04-02 05:09:31 +00:00
Nicholas Shahan 8ca97716cc [dart2js,ddc] Add package:js .call() tests
Some expectations in these tests do not match the language 
specification or are undefined.

These tests should help:
 - avoid regressions in the existing behavior
 - highlight incremental improvements towards implementing the 
   desired behavior (with corresponding changes to the expectations)
 - identify the differences between the JavaScript compilers

Change-Id: Icaa7371b3cf8c4221e4348176f712b3d03196720
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/359245
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Srujan Gaddam <srujzs@google.com>
Reviewed-by: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2024-04-02 00:41:23 +00:00
Nicholas Shahan 235b84418f [dart2js,ddc] Add .call() tests
Some expectations in these tests do not match the language 
specification.

These tests should help:
 - avoid regressions in the existing behavior
 - highlight incremental improvements towards implementing the 
   desired behavior (with corresponding changes to the expectations)
 - identify the differences between the JavaScript compilers

Change-Id: If7710d0559f5a481e0daf25b5a6a67b0f2082ccc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/359244
Reviewed-by: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2024-04-02 00:41:23 +00:00
Konstantin Shcheglov aced0523a4 Augment. Fixes for navigation for constructor annotations.
...and for import prefixes in augmentations.

Change-Id: I4c2f358d5bd1819c8691990a0b86a37d04449213
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/360505
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2024-04-01 23:06:19 +00:00
Konstantin Shcheglov 71e5a6b6d0 Augment. Issue 55324. Recover from missing ';' in 'import augment'.
Bug: https://github.com/dart-lang/sdk/issues/55324
Change-Id: I7365a45718455d69985a968c683bcf6dd74f9505
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/360504
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2024-04-01 20:17:05 +00:00
Sigmund Cherem dc26b30fdd [ddc] reduce flakiness of asset_file_system_test.
In the refactor to speed up this test, we removed most retry logic
(except for the "unreliable tests" that now apply retries in a
predictable manner).

The "noisy" tests have a similar behavior but for different reasons.
These put a lot of timing presure by serving hundreds of very large
files. The default response timeout of 5s trips this sometimes.

We could try to make this more predictable by providing a larger timeout
upfront, but I believe part of the intent with these tests was also to
incorporate retries for reasons like response timeouts. So instead, I've
added a retry, which will use by default a larger timeout on the second
attempt. This will hopefully be sufficient to remove this source of
flakiness.

Change-Id: I8eb5e9dceed5e7af36f6db45147c2d961247f6e2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/360503
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
2024-04-01 19:53:50 +00:00
Brian Wilkerson acb94a7da4 Move the mock package support to analyzer_utilities
Change-Id: I9d0a2d9e3e85d147ce7c7d0c14ea6c179c6f70de
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/359740
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Devon Carew <devoncarew@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2024-04-01 17:04:06 +00:00
Stephen Adams cc3b3f4976 [dart2js] Reduce x - 0.
25 hits in FluteComplex.
Many come from APIs with `[start, end)` range arguments that are unused so `length = end - start` is now optimized to `end`.

Change-Id: I59527f85323bed717d62249f0c1d69b477645ec2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/360444
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Nate Biggs <natebiggs@google.com>
2024-04-01 09:23:19 +00:00
Brian Quinlan 9b2b0ac848 [docs,io] Clarify that isDirectory is not meaningful for FileSystemDeleteEvent.
Bug: https://github.com/dart-lang/sdk/issues/55130
Change-Id: I43c95218cd9f6b87ab242affa8cc2b9d42df7d96
CoreLibraryReviewExempt: documentation-only change
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/357663
Reviewed-by: Lasse Nielsen <lrn@google.com>
Reviewed-by: Brian Quinlan <bquinlan@google.com>
Commit-Queue: Brian Quinlan <bquinlan@google.com>
2024-03-30 01:03:08 +00:00
Nate Biggs 50360c51ce [dart2js] Add retry to dart2js deferred loading multi loader hook.
In some cases the code downloaded through this hook is corrupted and one or more part files don't get registered correctly. The implementer of this hook just gets a 'download success' event and calls the success callback. It's not until dart2js itself checks if the part file as registered that we know it failed. In this case we should retry the load request with only the failed part files.

This matches the retry logic from the non-multi deferred load hook.

Change-Id: I655acd9f519cba1837d5cb367365a7be7254df03
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/360380
Reviewed-by: Mayank Patke <fishythefish@google.com>
Commit-Queue: Nate Biggs <natebiggs@google.com>
2024-03-29 23:47:13 +00:00
Sam Rawlins cd90f27317 meta: Introduce TargetKind.constructor
Fixes https://github.com/dart-lang/sdk/issues/47421

Doc nits while I was looking:

* wrap CHANGELOG to 80 characters
* correct docs on field, getter, method, parameter, setter, typedef,
  type parameter,

Change-Id: I97476e08b6773be53dbce190007443f22626d498
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/360124
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2024-03-29 19:15:40 +00:00
Konstantin Shcheglov 833277f806 Completion. Remove includedElementKinds/Names.
We don't use them anymore, for some time now.

Change-Id: Ieae70d6936a72dcaac296c967ad3bac78fd4d25c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/360442
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2024-03-29 19:10:39 +00:00
Sigmund Cherem 4e0ece2722 [ddc] fix flaky for-loop test.
This test was flaky about 3% of the time in linux bots due to a race
condition.  Details are shared in
https://github.com/dart-lang/sdk/issues/55299. TLDR, when one test case
completes and it's execution is resumed (program 1),  the test driver
sets up a breakpoint for a new test case concurrently and schedules to
run main again (program 2). Depending on when the breakpoint is set, it
could be hit by either program 1 or program 2.  If both programs are in
the same state when they hit the breakpoint, then it doesn't matter
which program we use to validate the test expectations (a benign race
condition).  However, this is problematic when the state is different,
which can happen when test 1 and test 2 both are using the same
breakpoint in a loop. This is what happened for the `forLoopTestBP` in
this CL.

To workaround this data race between two test cases, I decided to simply
combine them into a single test case. A different alternative is to copy
the test function and use a different breakpoint, but that didn't seem
worthwhile in this case.


Change-Id: I561c2a25d33d56a8543fe061342cab9cceafd4e4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/359721
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
2024-03-29 18:50:50 +00:00
Alexander Markov a33270dc0a Revert "[vm] Replace array GetIndexed graph intrinsics with flow graph builder implementation"
This reverts commit d24b5d1f5e.

Reason for revert: performance regression
(Graph intrinsics are applied to dynamic invocation forwarders,
but flow graph builder implementation isn't.)

Original change's description:
> [vm] Replace array GetIndexed graph intrinsics with flow graph builder implementation
>
> _Array, _GrowableList, internal and external typed data 'operator []'
> are now implemented in the flow graph builder.
>
> Unlike graph intrinsics, flow graph created in the flow graph builder
> can be used by the inliner. Corresponding graph intrinsics and native
> methods are removed.
>
> Also, this change adds missing external typed data indexing operations.
>
> TEST=ci
>
> Change-Id: Ic19784481feadf54c096a587413e67b4e18353dc
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/359940
> Reviewed-by: Ryan Macnak <rmacnak@google.com>
> Commit-Queue: Alexander Markov <alexmarkov@google.com>

Change-Id: I2b31b06edaa4b8a09d256f25f923d4489e28518b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/360305
Auto-Submit: Alexander Markov <alexmarkov@google.com>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
2024-03-29 17:27:50 +00:00
Konstantin Shcheglov 15d310a851 Completion. Migrate LibraryMemberContributor.
We migrate all pre-existing contributors into the new schema, `InScopeCompletionPass`.

Change-Id: Ifa2834d79525f9efefff783900e83fd4d5843b35
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/358684
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Keerti Parthasarathy <keertip@google.com>
2024-03-29 17:11:22 +00:00
Sam Rawlins f0c4243e6c linter: avoid_dynamic_calls: don't report proper cascade usage
Fixes https://github.com/dart-lang/linter/issues/3897

Change-Id: Ifdbbb1df0f8bce4f9616883fc159cbc251e8628c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/360303
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2024-03-29 16:32:21 +00:00
Sam Rawlins fe05845b45 linter: allow unnecessary parens in spreads
Fixes https://github.com/dart-lang/linter/issues/3816

Change-Id: I3e5928e939de18b95cb27d2214a16b045c9aabc0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/360400
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2024-03-29 16:30:53 +00:00
Konstantin Shcheglov 6e0978be76 Completion. Migrate RecordLiteralContributor.
Change-Id: I0cf393c121f714f596dac41bdd853d2dc3422f39
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/358781
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Keerti Parthasarathy <keertip@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2024-03-29 16:19:27 +00:00
Keerti Parthasarathy 690598221b Migrate ExtesnionMemberContributor.
The ExtensionMemberContributor is used in the NotImportedContributor, so cannot be deleted until that has that has also been migrated.

Change-Id: I272532e68b7c7038469d3898f93ea78b754ce67f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/360223
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Keerti Parthasarathy <keertip@google.com>
2024-03-29 16:04:48 +00:00
Sam Rawlins a70ee07cc2 Add TargetKind.typeParameter
Fixes https://github.com/dart-lang/sdk/issues/49796

Change-Id: I434c3bba20cbcf26177db4f0dc199bb696ab04de
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/360122
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2024-03-29 06:40:43 +00:00
Alexander Markov d24b5d1f5e [vm] Replace array GetIndexed graph intrinsics with flow graph builder implementation
_Array, _GrowableList, internal and external typed data 'operator []'
are now implemented in the flow graph builder.

Unlike graph intrinsics, flow graph created in the flow graph builder
can be used by the inliner. Corresponding graph intrinsics and native
methods are removed.

Also, this change adds missing external typed data indexing operations.

TEST=ci

Change-Id: Ic19784481feadf54c096a587413e67b4e18353dc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/359940
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2024-03-28 20:43:59 +00:00
Elliott Brooks 0667799664 Roll DevTools 2.34.1 into the Dart SDK [for cherrypick into beta]
Follow up to https://dart-review.googlesource.com/c/sdk/+/360181 but with the correct DevTools version: https://github.com/flutter/devtools/pull/7490

Bug: https://github.com/flutter/devtools/issues/7483
Change-Id: Ie64f72bbc473230b182f348e1f53291a1c771b34
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/360281
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Elliott Brooks <elliottbrooks@google.com>
Reviewed-by: Kenzie Davisson <kenzieschmoll@google.com>
2024-03-28 20:24:28 +00:00
Kallen Tu b6ac281270 [linter] Update missing_code_block_language_in_doc_comment to avoid linting indented code blocks.
After trying to add the lint to flutter (https://github.com/flutter/flutter/pull/145354), I noticed that we lint on indented code blocks, which we should not be doing.

This CL uses the new code block type in https://dart-review.googlesource.com/c/sdk/+/358326 to make sure we only lint on fenced code blocks.

Change-Id: Ic13596dd3c95ce4ff64deeffe02da0fdb7a298e0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/359981
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Kallen Tu <kallentu@google.com>
2024-03-28 20:13:29 +00:00
Keerti Parthasarathy b6137f7cee Issue 54893: Add a test for sorting imports that span 2 lines.
Change-Id: I9ed0a1b754d3f201d760813dafa4c1049b7124f1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/360280
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Keerti Parthasarathy <keertip@google.com>
2024-03-28 17:54:51 +00:00
Devon Carew 3b23ffe53f [deps] rev dartdoc, http
Revisions updated by `dart tools/rev_sdk_deps.dart`.

dartdoc (79c1675..bf6080c):
  bf6080c8  2024-03-27  Sam Rawlins  Remove unnecessary EnclosedElement mixin (dart-lang/dartdoc#3736)
  c5bb9066  2024-03-26  Sam Rawlins  Bump to 8.0.8; fix changelog wrapping (dart-lang/dartdoc#3735)
  4e096f84  2024-03-26  Sam Rawlins  Format parameters better (dart-lang/dartdoc#3731)

http (7949d6f..280d361):
  280d361  2024-03-27  Derek Xu  [package:http_profile] Expand README.md (dart-lang/http#1162)
  9fddb1c  2024-03-27  Brian Quinlan  Fix the connectionInfo getter (dart-lang/http#1163)
  9f47439  2024-03-27  Derek Xu  [package:http_profile] Make connectionInfo a top-level field of HttpClientRequestProfile (dart-lang/http#1160)

Change-Id: Ib50584ef7d7914ab262bb01eeb087e44c34e4dc7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/360240
Auto-Submit: Devon Carew <devoncarew@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2024-03-28 16:58:18 +00:00
Ryan Macnak b776196f0b Roll Fuchsia SDK to 19.20240327.2.1.
Fixes -Werror,-Wextra-qualification with newer Clang.

Cq-Include-Trybots: luci.dart.try:vm-fuchsia-release-arm64-try,vm-fuchsia-release-x64-try
Change-Id: I6bf5e662fd850930d7db0cf331e99e5b1a2b30be
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/360180
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2024-03-28 16:47:49 +00:00
Sam Rawlins 80d16cf9e5 DAS: Inline prepareNewStatementLocation into add_call_super
This was the only caller, and it always passed in `true` for `first`.

Inlining the function is the same number of lines as calling the function and using it's output.

Change-Id: Ifee204e68f2b7d168fe6078ac7f8ec66261ff76b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/360080
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2024-03-28 16:27:51 +00:00