Commit graph

92672 commits

Author SHA1 Message Date
Nate Biggs acd2ad41b6 [dart2js] Union old and new type when refining in type inference.
This change doesn't seem to have a significant impact on most compilation results:
- Golem results show no significant difference in microbenchmarks.
- For a medium and large app tested, while we see a small change in the actual inference results, the generated code is identical before/after this change.
- Timing and memory usage on internal compilations seem comparable before/after this change.

Note: This replaces the need for any notion of "invalid" refines so I will clean up that code in a follow up change.

Change-Id: I2a293eacd944fc17ee2dab97d3d947c042b4038f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/313720
Commit-Queue: Nate Biggs <natebiggs@google.com>
Reviewed-by: Mayank Patke <fishythefish@google.com>
2023-07-14 20:46:17 +00:00
eliasyishak 34f0e26d45 Swapping NoopAnalytics for noop from package:unified_analytics
Change-Id: I3419a128830ae434fa37bd10a1fc8a3da146fd89
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/313880
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Elias Yishak <eliasyishak@google.com>
2023-07-14 19:15:20 +00:00
Paul Berry 6233cede64 Simplify the "mini-ast" for shared flow analysis and type analysis tests.
When using the "mini-ast" pseudo-language to write unit tests for the
flow analysis and type analysis logic in the `_fe_analyzer_shared`, it
is no longer necessary to use `.stmt` to turn an expression into an
expression statement; this now happens automatically. The way this
works under the hood is that both the `Statement` and `Expression`
classes mix in the `ProtoStatement` mixin; constructs that expect
statements are declared with input parameters of type
`ProtoStatement`, and they automatically convert expressions to
statements when necessary.

Also, the functions `checkNotPromoted`, `checkPromoted`,
`checkReachable`, `localFunction` now have a return type of
`Expression` rather than `Statement`. This allows them to be used
either where an expression is exprected or where a statement is
expected, which should give us the ability to write some tests that
are not possible (or very difficult) to write today.

Change-Id: I9f7ad5b15bcf8ccfccafc6985e0163b550c5ad1c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/313680
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2023-07-14 19:03:47 +00:00
Konstantin Shcheglov d4a70c8423 Support for always-false IfStatement(s) in RemoveComparison.
Change-Id: I14a8dedd6770081fc7fe9ee5c4e53c28e029ac3e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/313740
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2023-07-14 18:39:33 +00:00
Konstantin Shcheglov d1a75901c4 Link augmented methods and augmentations, fill 'augmented.methods'
Change-Id: Ic7e979c46fc646e436bafa18b5c5b01622ab209b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/313544
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
2023-07-14 18:32:10 +00:00
Marya Belanger 7918525a6b Writing review 3.0 diagnostics
Minor changes to last few 3.0 diagnostic message changes (late follow up). Mostly just a practice CL for me, after setting my sdk environment up for the first time.

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

Change-Id: I8f6871a270089627538928dd95bcbf38a29b74e7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/309780
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Marya Belanger <mbelanger@google.com>
2023-07-14 18:31:31 +00:00
Danny Tuppeny 77799f6d6c [analysis_server] Use current path context for path<->uri conversions
This allows changing the in-process tests to use Windows-style paths on macOS for convenience.

Change-Id: I0e85a4f8e831471925b8308ad348f75b6867a53b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/313385
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2023-07-14 17:30:30 +00:00
Joshua Litt 98431c6506 [js|dart2wasm] Add JSArrayImpl subtype of List<JSAny?>.
Change-Id: I1464250b045feb48d1a7882288d6859e9ac87709
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/311824
Commit-Queue: Joshua Litt <joshualitt@google.com>
Reviewed-by: Srujan Gaddam <srujzs@google.com>
Reviewed-by: Ömer Ağacan <omersa@google.com>
2023-07-14 17:12:01 +00:00
Jonas Termansen f9b8917e30 Balance VM JIT and AOT shards.
Add test.py --default-suites that includes all the default suites in
addition to the ones explicitly requested, so the test matrix can run
co19 together with the default suites in one sharded test step.

Bug: b/290617138
Change-Id: I5dd5d1aaf3b1ee38adf88c6e9ee6ec13d97fe1ce
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/313567
Reviewed-by: William Hesse <whesse@google.com>
2023-07-14 16:01:09 +00:00
Jake Macdonald 4f8061da63 Add MetadataAnnotation class and metadata fields to relevant objects
Bug: https://github.com/dart-lang/language/issues/1930
Change-Id: I3ba6facd4c0487b0af18108c8d1db21ee6d5a498
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/313640
Auto-Submit: Jake Macdonald <jakemac@google.com>
Reviewed-by: Bob Nystrom <rnystrom@google.com>
Commit-Queue: Jake Macdonald <jakemac@google.com>
2023-07-14 15:55:20 +00:00
Jonas Termansen 2a302a96ac Balance ddc-linux-chrome-unsound shards.
Bug: b/290617138
Change-Id: I6f60f1d7ba96832cda96f34f436f593717460709
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/313820
Reviewed-by: William Hesse <whesse@google.com>
2023-07-14 15:52:48 +00:00
Jonas Termansen ab4ab9b52e Balance ddc-linux-chrome shards.
Bug: b/290617138
Change-Id: I7ac3f0136e059bdbea3d72c3a3f64611472b2c96
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/313564
Reviewed-by: William Hesse <whesse@google.com>
2023-07-14 15:52:11 +00:00
Jonas Termansen 26a94439c6 Balance dart2js-unit-linux-x64-release shards.
The non-sharded tests takes 10 minutes and each of the sharded tests
takes 14 minutes. It's faster to shard immediately (costing one bot
more) and concurrently run the local tests.

Fix end to end dart2js test that times out when sharded and run outside
a directory called sdk.

Bug: b/290617138
Change-Id: If71f0d301edf565c9f15847098320106ca383635
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/312983
Reviewed-by: William Hesse <whesse@google.com>
2023-07-14 15:38:29 +00:00
Jonas Termansen f7a138417c Balance dart2wasm-linux-chrome shards.
The try builder is among the fastest commonly used builders at 21
minutes average, which is less than the current 25 minute best case
goal. Free up 2 of 10 shards to be available for other work during peak
load, which will slow it down by 2 or 3 minutes and finish at the same
time as the other try builders, resulting in an overall faster commit
queue experience.

Bug: b/290617138
Change-Id: Iea2ba71248fa0d3c21f1d80b540b55ce810d96af
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/313565
Reviewed-by: William Hesse <whesse@google.com>
2023-07-14 13:39:26 +00:00
Jonas Termansen 4ac58f4df4 Optimize benchmark-linux-try.
Bug: b/290617138
Change-Id: I898ab9d7b441c58cec4b9604860ee4fcdfcbc994
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/313783
Reviewed-by: William Hesse <whesse@google.com>
2023-07-14 11:35:36 +00:00
Chloe Stefantsova 7a232bb3e2 [cfe] Preserve the required flag in synthesized mixin constructors
Closes https://github.com/dart-lang/sdk/issues/52872

Change-Id: I9089683f4fb2027211c96ad2065044c8181a282f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/313781
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Chloe Stefantsova <cstefantsova@google.com>
2023-07-14 11:33:45 +00:00
Martin Kustermann 0ae3368fb6 [vm] Refactor handling of kernel data in compiler frontend
a) Remove 2 fields in our object representation:

  * PatchClass::library_data_
  * Library::kernel_data_

=> This saves O(#libraries + #patch-classes) which can amount up to
  10+ MB for big apps, as we save not just the slots but the
  [ExternalTypedData] objects they used to reference.

Instead we'll compute the KernelLibraryData when we need it by making a
[TypedDataView] of sub parts of the component.

b) We make a kernel binary be represented by a single [ExternalTypedData].

Whenever we need a sub-part of a kernel binary (e.g. one for each
component for concatinated kernels, or one for a library inside a
component) we use proper [TypedDataView]s for that.

c) As we sometimes need to create a view of only a particular library
within a component we need to find start/end of a library based on
index.

=> We store the library index instead of the library offset on
Library/PatchClass.
=> We can easily derive the start/end of a library from it's index by
looking at the kernel component encoding.

d) We make the [Reader] object work purely based on a pointer - instead
of making it have if/else when reading bytes (either from pointer or
from a view).

e) We make the [KernelProgramInfo] store the kernel_component and
various TD views into it.

TEST=ci

Change-Id: Ibe160881ff48635e834c3d647a977a144b5d0565
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/313561
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Slava Egorov <vegorov@google.com>
2023-07-14 10:15:06 +00:00
Jonas Termansen 006b3a8780 Balance front-end-linux-release-x64 shards.
Bug: b/290617138
Change-Id: I9747fe4d5ec995bd17ccf3781036a52af9c2de19
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/313506
Reviewed-by: William Hesse <whesse@google.com>
2023-07-14 09:54:39 +00:00
Martin Kustermann 8d802dd78a [vm] Avoid embedding sources in CFE compilations if we AppJit
Creation of AppJit snapshot will not include the source of [Script]
objects (see `UntaggedScript::snapshot_to`). As a result there's no
point in letting the CFE embed the sources into the kernel if we
only use it to create an AppJit snapshot.

This is also in line with build rules for our dart-sdk, where we do the
kernel compilation separately, see utils/application_snapshot.gni:

```
  template("application_snapshot") {
    ...
    # Build the kernel file using the prebuilt VM to speed up the
    # debug and simulator builds.
    prebuilt_dart_action(target_name + "_dill") {
      ...

      args = [
        ...
        "--no-embed-sources",
        ...
      ]
      [[[
    }
    ...
  }
```

TEST=ci

Change-Id: I4e17e49dc21af6102d62c2278dbd6ebbe387f7e8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/313560
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2023-07-14 09:47:38 +00:00
Sergey G. Grekhov 7f42498d66 [co19] Roll co19 to 7e4ba229fecce1affe8284b166744329182feb3e
2023-07-14 sgrekhov22@gmail.com Fixes dart-lang/co19#2132. Fix roll failures, add issue numbers (dart-lang/co19#2134)
2023-07-13 sgrekhov22@gmail.com Fixes dart-lang/co19#2130. Fix roll failures, add issues numbers (dart-lang/co19#2131)
2023-07-13 sgrekhov22@gmail.com Fixes dart-lang/co19#2125. Add more external functions tests (dart-lang/co19#2128)
2023-07-13 sgrekhov22@gmail.com Fixes dart-lang/co19#2087. Reorder covariance tests to make maintenance easier (dart-lang/co19#2129)
2023-07-12 sgrekhov22@gmail.com dart-lang/co19#2087. Add tests for parameters covariant-by-declaration (dart-lang/co19#2121)
2023-07-12 sgrekhov22@gmail.com Fixes dart-lang/co19#2117. Update assertions, add tests for external members (dart-lang/co19#2126)
2023-07-12 sgrekhov22@gmail.com Fixes dart-lang/co19#2123. Update Superclasses tests. (dart-lang/co19#2124)
2023-07-11 sgrekhov22@gmail.com dart-lang/co19#2117. Update accessible_instance_member_t* tests (dart-lang/co19#2122)
2023-07-10 sgrekhov22@gmail.com Fixes dart-lang/co19#2099. Add subtyping tests for function type with required named arguments (dart-lang/co19#2100)
2023-07-10 sgrekhov22@gmail.com dart-lang/co19#2112. Add missing tests for mixins. Part 2 (dart-lang/co19#2118)
2023-07-07 sgrekhov22@gmail.com dart-lang/co19#2119. Minor wording changes (dart-lang/co19#2120)

Change-Id: I310f2e0a660ac55a242bb9b2ed9a2f1917555d0f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/313562
Reviewed-by: Alexander Thomas <athom@google.com>
2023-07-14 09:29:50 +00:00
Martin Kustermann 017a09f9fd Update checked-in Dart SDK to 3.1.0-298.0.dev
Change-Id: I34ec850052f9f03b154e0b528de733de733611d5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/313780
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Daco Harkes <dacoharkes@google.com>
2023-07-14 08:07:01 +00:00
Tess Strickland 0a1c797b5a [vm] Revert 3fcf660e with the correct fix for --no-sound-null-safety.
Insert CheckNull instructions if in AOT mode prior to checking the
index for being within the bounds in inlined indexing operations.
If we're in --sound-null-safety mode, they'll be canonicalized away
since the indices won't be nullable anyway.

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

TEST=corelib{,_2}/list_removeat_test and
  co19_2/LibTest/core/String/codeUnitAt_A03_t01 on
  vm-kernel-precomp-linux-release-x64-try

Cq-Include-Trybots: luci.dart.try:vm-kernel-precomp-linux-debug-x64-try,vm-kernel-precomp-linux-release-x64-try
Change-Id: I37212e94c7c5032c75709e3f0bb91734cbc705cd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/313507
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Commit-Queue: Tess Strickland <sstrickl@google.com>
2023-07-14 07:06:41 +00:00
asiva e4f1a10431 [VM/Runtime] Ensure an isolate exists before calling Dart_ShutdownIsolate()
Fixes https://github.com/dart-lang/sdk/issues/52892
TEST=ci

Change-Id: I4f0aa64642d4ba8416ef353dfca7371adc7e6bba
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/313543
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Siva Annamalai <asiva@google.com>
2023-07-14 01:31:38 +00:00
Nate Biggs 25a1d01084 [dart2js] Remove need for individual closures in Deferrable serialized data.
This new approach uses static tear-offs where possible to avoid allocating a new Closure for each Deferrable.

Note: This doesn't scale to every case but as of today the one case not covered is a singleton and so only 1 closure should be allocated there regardless.

Data from a fairly large app:
Before:
Total => 3.8GB
Closures => 85.6MB
Closure Context => 71.0MB

After:
Total => 3.7GB
Closures => 28.9MB
Closure Context => 49.8MB

Diff:
Closures => 56.7MB
Closure Context => 21.2MB

Change-Id: If233f958df2822708b51c0d14c7439b5d3a5a07b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/313340
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Nate Biggs <natebiggs@google.com>
2023-07-14 01:29:36 +00:00
Sigmund Cherem 72f1c288bc [dart2js] Bailout tracing when hitting return values of async members.
When tracing closures, we accidentally ignored the fact that returning from a non-async
function allows the value to flow in other ways (e.g. through the completion of a future).

This changes the node tracer to always consider the async marker when looking at values
that flow into 'MemberInformation' information nodes, which are the nodes we use
to represent the returned value of a method.

Fixes #52825

Change-Id: I3322e105dc9612f47a516a17f9465bf1002a9f87
Fixed: 52825
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/312708
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
Reviewed-by: Nate Biggs <natebiggs@google.com>
2023-07-14 00:24:07 +00:00
Sam Rawlins d3233115c8 Bump linter to aed089e45c35221ce2b82f3757132031f0344b8b
Sync compare URI implementation with linter

Change-Id: I23e14459ac55fef4cec1c0c41341fe6f51b781b6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/313285
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Oleh Prypin <oprypin@google.com>
2023-07-13 23:43:40 +00:00
Devon Carew dc38d30836 [deps] rev dartdoc, ecosystem, http, leak_tracker, markdown, mockito, native, protobuf, test, tools
Revisions updated by `dart tools/rev_sdk_deps.dart`.

dartdoc (2522559..d716fa3):
  d716fa36  2023-07-13  Sam Rawlins  Migrate the try-publish and build-pub-package tasks to args commands (#3460)
  33b44d2d  2023-07-11  Sam Rawlins  Migrate doc-related tasks to package:args commands (#3459)

ecosystem (b34db4f..db9d71d):
  db9d71d  2023-07-12  Devon Carew  upgrade to the latest stable action version (#133)
  3f4b8d1  2023-07-12  Moritz  Switch coverage computation (#132)
  5a9f06b  2023-07-10  Jacob MacDonald  add environment input to support github deployment environments (#131)
  f3b10c9  2023-07-10  Kevin Moore  blast_repo:auto-publish - add permissions by default (#129)

http (c148a3a..b206771):
  b206771  2023-07-11  Brian Quinlan  Make native bindings pass `dart analysis` (#985)

leak_tracker (85bd7fb..5675231):
  5675231  2023-07-13  Polina Cherkasova  Add disconnection from service to free up references. (#91)
  9b97f84  2023-07-11  Parker Lougheed  Remove mentions to deprecated strong_mode options (#85)
  a21e90e  2023-07-11  Polina Cherkasova  Protect from identityHashCode equal to 0. (#90)
  8e3aa07  2023-07-11  Polina Cherkasova  Create troubleshooting helpers. (#89)

markdown (b4bdde2..ee4e1b3):
  ee4e1b3  2023-07-13  Sam Rawlins  Bump to 7.1.1 (#550)

mockito (451f756..ffbbb4c):
  ffbbb4c  2023-07-12  Ilya Yanok  Second attempt to fix "not found" error for type vars in bounds

native (1e89ed9..acad396):
  acad396  2023-07-11  Daco Harkes  [infra] Remove the last path dependencies (#88)

protobuf (a912f76..d9e8a31):
  d9e8a31  2023-07-12  Kevin Moore  Compiler: generate doc comments (#860)

test (3429712..a92b5bb):
  a92b5bb3  2023-07-12  Nate Bosch  Remove "compiling" messages (#2063)
  4e023035  2023-07-12  Nate Bosch  More loosely handle error message from SDK (#2064)

tools (af38b2b..765701d):
  765701d  2023-07-13  Elias Yishak  Enhance log file stats (#117)

Change-Id: Ib89e80f8f8963433c4abef953924830634352d86
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/313541
Auto-Submit: Devon Carew <devoncarew@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2023-07-13 21:52:48 +00:00
Ryan Macnak 327d425a32 [test] Skip chunked_binary_trees tests on slower configurations.
Bug: https://github.com/dart-lang/sdk/issues/52924
Change-Id: Iece24184411f1fdbc63903d893654c74aed3de55
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/313289
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2023-07-13 21:49:08 +00:00
Srujan Gaddam 2767fca6fe Revert "[dart:js_interop] Remove Object.toJS and JSNumber.toDart"
This reverts commit 16fcfe7eae.

Reason for revert: Flutter changes haven't landed to google3 yet.

Original change's description:
> [dart:js_interop] Remove Object.toJS and JSNumber.toDart
>
> Modifies JSBoxedDartObject reified type on JS backends and also
> modifies JSBoxedDartObject.toDart now that a proper box is introduced.
> Also uses a JS symbol in JSBoxedDartObject.toDart for a property
> check so that different Dart apps don't accidentally share Dart
> objects. It's now an error to call this function on non-boxed objects.
>
> Fixes a type issue where creating a new object literal with the JS
> foreign function was resulting in dart2js thinking toJSBox would
> always throw. Changing the typeDescription to PlainJavaScriptObject
> instead of =Object fixes that issue.
>
> CoreLibraryReviewExempt: Backend-specific library.
> Change-Id: I5cfb1f32ff4328fafdf9831b0d8da806c39391d9
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/309082
> Reviewed-by: Joshua Litt <joshualitt@google.com>
> Commit-Queue: Srujan Gaddam <srujzs@google.com>

Change-Id: I469ad04db7b49ffef47a46ccac97e909e4865719
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/313580
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Reviewed-by: Joshua Litt <joshualitt@google.com>
Commit-Queue: Srujan Gaddam <srujzs@google.com>
2023-07-13 21:06:05 +00:00
Srujan Gaddam 16fcfe7eae [dart:js_interop] Remove Object.toJS and JSNumber.toDart
Modifies JSBoxedDartObject reified type on JS backends and also
modifies JSBoxedDartObject.toDart now that a proper box is introduced.
Also uses a JS symbol in JSBoxedDartObject.toDart for a property
check so that different Dart apps don't accidentally share Dart
objects. It's now an error to call this function on non-boxed objects.

Fixes a type issue where creating a new object literal with the JS
foreign function was resulting in dart2js thinking toJSBox would
always throw. Changing the typeDescription to PlainJavaScriptObject
instead of =Object fixes that issue.

CoreLibraryReviewExempt: Backend-specific library.
Change-Id: I5cfb1f32ff4328fafdf9831b0d8da806c39391d9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/309082
Reviewed-by: Joshua Litt <joshualitt@google.com>
Commit-Queue: Srujan Gaddam <srujzs@google.com>
2023-07-13 20:38:11 +00:00
Konstantin Shcheglov 1cf1cf3215 Issue 52918. Report -TYPE_PARAMETER_REFERENCED_BY_STATIC for extension.
Bug: https://github.com/dart-lang/sdk/issues/52918
Change-Id: I2c21239c34bf852a1770296491f30d81dd5eb66c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/313520
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2023-07-13 17:53:38 +00:00
Konstantin Shcheglov b4cdba66e2 Remove support for getters that are instances of macros.
https://github.com/dart-lang/language/issues/1890#issuecomment-1625587927
https://github.com/dart-lang/language/pull/3205

Change-Id: I20a181a01eab4fef9a8bf6e568745eb2b8e86d6d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/312881
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
2023-07-13 17:32:49 +00:00
Sam Rawlins dea256c9fc Mark private classes which are annotated with @JS as used
Work towards https://github.com/dart-lang/sdk/issues/52835

Change-Id: I300928dbfcfd819e4a9f20030cb46e2048f504e7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/313287
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2023-07-13 16:06:12 +00:00
Jonas Termansen 185aa1f36f Balance dart2js-linux-chrome shards.
Bug: b/290617138
Change-Id: If6217e2774dd7a6fe2834e64d3a9daf10eebda0d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/313486
Reviewed-by: William Hesse <whesse@google.com>
2023-07-13 16:04:24 +00:00
Jonas Termansen 073ffa0ca9 Balance dart2js-hostasserts-linux-d8 shards.
Bug: b/290617138
Change-Id: Icef886185e300f4555207463d90ac5ae8f24baf1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/313485
Reviewed-by: William Hesse <whesse@google.com>
2023-07-13 16:00:54 +00:00
Danny Tuppeny 4d34d7aa24 [analysis_server] Remove unused parameters and related TODOs
Change-Id: I5b3fac0efa23c9e535635651a8e8b09398770a40
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/313504
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2023-07-13 15:57:47 +00:00
Jonas Termansen 21c18eb046 Balance analyzer-linux-release shards.
Bug: b/290617138
Change-Id: Icd9fef5b7462fcebe92a6ff4af946b225be889e8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/313484
Reviewed-by: William Hesse <whesse@google.com>
2023-07-13 15:51:41 +00:00
Joshua Litt 465d35fac9 [dart2wasm|js] Add support for JS backed subtypes of 64 bit typed data.
Change-Id: I534e946ffdfa6708af0c0ffdecb345adbc9561aa
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/313286
Commit-Queue: Joshua Litt <joshualitt@google.com>
Reviewed-by: Srujan Gaddam <srujzs@google.com>
2023-07-13 15:29:37 +00:00
Jonas Termansen 172f76ce8c Balance front-end-nnbd-linux-release-x64 shards.
Bug: b/290617138
Change-Id: Ief19c6f377ad35f4cc8a681a7f471ddc0075ff2b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/313502
Reviewed-by: William Hesse <whesse@google.com>
2023-07-13 14:12:56 +00:00
Daco Harkes a08e829ff2 [tool] Bisection tool
A basic bisection script.

Currently only supports substring matching for detecting the error.
This was enough for three use cases today:

* https://github.com/dart-lang/sdk/issues/52910
* https://github.com/dart-lang/sdk/issues/52911
* https://github.com/dart-lang/sdk/issues/52912

Produces a concise output on standard out, and a very detailed log
with all process invocation results in `.dart_tool/bisect_dart`.

Usage: tools/bisect.dart -Dstart=23f41452 -Dend=2c97bd78 -Dtest_command="tools/test.py --build -n dartk-linux-debug-x64 lib_2/isolate/package_resolve_test" -Dfailure_string="Error: The argument type 'String' can't be assigned to the parameter type 'Uri'." -Dsdk_path=/usr/local/google/home/dacoharkes/dart-sdk/sdk/ -Dname=20230712_package_resolve_test

This script starts a bisection in the provided SDK path.

It will write logs to .dart_tool/bisect_dart/.

start          : The commit has at the start of the commit range.
end            : The commit has at the end of the commit range.
test_command   : The invocation of test.py.
                 This should include `--build`.
                 This should be within quotes when passed in terminal because of spaces.
failure_string : A string from the failing output.
                 Regexes are not yet supported.
                 This should be within quotes when passed in terminal when containing spaces.
sdk_path       : The SDK path is optional.
                 The SDK path defaults to the current working directory.
name           : The name is optional.
                 The name defaults to the current date and the recognized test name.
                 The name is used for distinguishing logs.

Change-Id: Ib071a5305d4992cf189e35eb3dcc50c83101503e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/313384
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2023-07-13 13:22:26 +00:00
Jonas Termansen 84e8babf23 Balance dart2js-hostasserts-linux-unsound shards.
The test steps with the same configurations have been unified and
the shard number balanced so each step finishes as closely to each
other as possible.

Bug: b/290617138
Change-Id: I6616fb78e5cd6db36153db0d9e2b45131eef25fd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/312984
Reviewed-by: William Hesse <whesse@google.com>
2023-07-13 13:09:37 +00:00
Erik Ernst ca71bbb0ea Change formal parameter syntax to require "=" (and not ":")
A named optional parameter could previously be equipped with a default
value using ':' or '=' (as in `void f({int i : 1})` or `... i = 1 ...`).
The language has now (Dart 3.0) been updated to eliminate the form
using ':' (it has been deprecated for a long time).

This CL updates the spec_parser accordingly.

Change-Id: I28f9ec605699a9ffb2f7349a6a4b698fa709247b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/313482
Commit-Queue: Erik Ernst <eernst@google.com>
Auto-Submit: Erik Ernst <eernst@google.com>
Reviewed-by: William Hesse <whesse@google.com>
Commit-Queue: William Hesse <whesse@google.com>
2023-07-13 12:41:46 +00:00
Tess Strickland 3fcf660ed1 [vm] For now, initialize the contents of null with its address.
When running with `--no-sound-null-safety` turned on, it turns out null
is unboxed as an Mint in some cases without checking for null first.
Before, tests would fail because unboxing it would give a really
large int that was unlikely to be acceptable to subsequent range
checks and the like.

However, since 2f63ace, that memory is now zero-initialized, and zero is
more likely to be an acceptable value, so tests either fail for
unexpected reasons or, worse, unexpectedly succeed.

As a stopgap until the appropriate checks are emitted, we initialize
the contents of null with its address as an ObjectPtr like we used to.

TEST=corelib{,_2}/list_removeat_test on dartkp-* configurations.

Issue: https://github.com/dart-lang/sdk/issues/52910
Change-Id: If456d503c86202616f4f566a402118e9c41194ba
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/313500
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Commit-Queue: Tess Strickland <sstrickl@google.com>
2023-07-13 09:19:57 +00:00
Tess Strickland db2e318b5d [vm] Fix build on debug IA32.
set_pointer_offsets_length() sets a part of the state_bits bitfield,
so we need to move this check before it's called.

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

TEST=vm-linux-debug-ia32 builds

Cq-Include-Trybots: luci.dart.try:vm-linux-debug-ia32-try
Change-Id: I9f4ec78b03a6b7b2d45f13e9cc277411dcc90493
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/313480
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Commit-Queue: Tess Strickland <sstrickl@google.com>
2023-07-13 08:59:36 +00:00
Martin Kustermann 148af29811 [vm] Disentagle dependencies in the frontend & compiler
** KernelProgramInfo

The VM can load multiple kernel files into an isolate. Each kernel file
is represented as a [KernelProgramInfo] object. Loading a kernel blob
will result in a tree of objects

  Library
   - TopLevelClass
     + Field
     + Function
   + Class
     + Field
     + Function
       + ... closure functions ...

The entire tree belongs to one [KernelProgramInfo] object. There are
two exceptions
* after a hot-reload we inject [PatchClass]es (as owners of
old [Field]/[Function] objects) that identify the old kernel data
* expression evaluation functions will get a special data array with
information about the expression evaluation kernel data

=> We attach the [KernelProgramInfo] to the root of the tree, namely
  the [Library]

=> We introduce `{Field,Function,Class,Library}::KernelProgramInfo()`
  that will get that object - by walking up the chain.

=> We introduce `UntaggedPatchClass::kernel_program_info_` field that
  allows saving the old [KernelProgramInfo] (on which the old
  [Field]/[Function] objects are based upon) in the [PatchClass].

=> We include the [KernelProgramInfo] in the expression evaluation
  data array.

** Scripts

A [Script] object should represent a .dart source file. It contains the
source, line offsets, etc. of that dart source file. The contents of a
dart source file may be used by many classes/libraries or even many
kernel blobs (e.g. via our copying mixin application).

When we build a tree like above, we'll attach a reference to a
[Script] object to [Class] objects. But members of a class may come from
a different script, in which case we inject an intermediary [PatchClass]
that references that other script.

When the compiler frontend loads kernel, builds flow graph, etc we walk
down the kernel binary (the tree above) - all belonging to the same
[KernelProgramInfo] object, but sub-parts may belong to different
[Script]s.

=> We use the existing [ActiveClass] class that keeps track of the
current class & member inside the class we're operating on.
=> Whenever we need the script we get it from the active member
function/class.

** Misc

We make kernel related classes (e.g. [KernelReaderHelper]) independent
of [Script].

We make the [Script] objects hold on to the [KernelProgramInfo] they are
based upon (e.g. for lazy source reading). But since a given [Script]
doesn't belong to a particular kernel blob (multiple kernel blobs may
contain information about the same script) we don't expose this in the
public API.

=> In the future we could have a unique [Script] object per url (instead
of having several as we do now)

TEST=ci

Change-Id: I7bd698f497b0bd8ab8e546540bb1dad5b5a6dd48
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/313381
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Slava Egorov <vegorov@google.com>
2023-07-13 08:17:38 +00:00
Johnni Winther 6d56a75dca [cfe] Ensure default value on super parameter tear-off
Closes #52763

Change-Id: I765c80d9889315a32832e0f881dba1fc41400fad
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/313124
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2023-07-13 08:05:50 +00:00
Konstantin Shcheglov 150587d2b5 Merge MethodElement(s) into augmented.
Change-Id: I4965554d33f4345053c2b5abc05ba463a362b641
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/313301
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2023-07-13 05:11:57 +00:00
Samuel Rawlins e718a97882 Revert "Tweaks for mixin inference."
This reverts commit fb9d0e6dc3.

Reason for revert: Performance regression https://github.com/dart-lang/sdk/issues/52922

Original change's description:
> Tweaks for mixin inference.
>
> I started initially with the idea to move 'mixinInferenceCallback'
> to `ClassElementImpl`, but then realized that we do it for enums too.
> So, it should stay in `InterfaceElementImpl`.
>
> I left with code that I think slightly modernized, so decided to
> send it for review.
>
> Change-Id: Ib990392dc4985a71ffba1f4080237872d9a65ad2
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/312521
> Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
> Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>

Change-Id: I33098d8509319e9d6e62d7f5174cae2c05977436
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/313440
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Auto-Submit: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Jaime Wren <jwren@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2023-07-12 22:20:27 +00:00
Ryan Macnak 2051bcf619 [infra] Reduce the suites run by Windows ARM64 to fit under the timeout.
Change-Id: I37070079ddbdc86fb0e5144842690877abb1b031
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/313283
Reviewed-by: Alexander Thomas <athom@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2023-07-12 21:06:27 +00:00
Kallen Tu c7187d3150 [analyzer] Consolidate more helpers in evaluation_test.
Added helpers `_field` and `_localVar` to allow tests to test their final fields and local const variables in the const tests.

The rest of the CL moves away from `_evaluateConstant` helpers (to avoid recomputing constants), to `_topLevelVar` or equivalent helpers which grabs the existing evaluation result.

This CL adds to the goal making all constant tests consistent and to avoid unnecessary const computations in the tests.

Change-Id: I508483714a51e5d060286256657ae460b65787c7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/312889
Reviewed-by: Nate Bosch <nbosch@google.com>
Commit-Queue: Kallen Tu <kallentu@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2023-07-12 20:02:11 +00:00