Commit graph

87586 commits

Author SHA1 Message Date
Daco Harkes ce4973b3cd [tools] generate_idefiles.py support for Windows
Three improvements to the generated compile_commands.json on Windows.

1. Prevent the use of .rsp files by using `ninja -t compdb -x`.
   Start using the ninja from DEPS that supports the `-x` flag.
2. Remove the `ninja -t msvc` part of the the build commands. Clangd
   does not understand it.
3. Add the windows sysroots (which are set with `-e environment.x64`
   in the build).
   Currently, these are hardcoded to the ones shipped in depot_tools
   because the `environment.x64` is non-trivial to parse.

Bug: https://github.com/dart-lang/sdk/issues/50032
Change-Id: I897ded9e7c97abdf4dde738c275db36536e0b0c4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/260701
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
2022-09-26 12:30:17 +00:00
Johnni Winther 008190bf11 [cfe] Ensure constructor type in type alias invocation
Closes #49985

Change-Id: I0fdf1a1cc984a5ab9e10f9df794864bbeaf44579
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/260705
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2022-09-26 10:52:47 +00:00
Alexander Thomas d8cf2a5cbf [release] Add changelog for 2.18.2
Change-Id: I47ae13f80780c57419e252431c429fbb040db599
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/260104
Reviewed-by: Michael Thomsen <mit@google.com>
2022-09-26 10:06:44 +00:00
Konstantin Shcheglov cfddeee68e Use shared positionalFieldIndex() to check for INVALID_FIELD_NAME_POSITIONAL.
Change-Id: I368a49b8304304f09e835c690e3f91b84dd1a688
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/260962
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2022-09-24 19:22:46 +00:00
Nate Biggs 94507d6502 [dart2js] Migrate node_tracer.dart
Change-Id: I2b0f7ad80477da638ed70fdfd0d0a20acdbc097c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/260801
Commit-Queue: Nate Biggs <natebiggs@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2022-09-24 00:24:00 +00:00
Nate Biggs c0b449667a [dart2js] Migrate other abstract value domains
Change-Id: I7ede2113f8520ade4713f2bd64266a6090060255
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/260800
Reviewed-by: Mayank Patke <fishythefish@google.com>
2022-09-24 00:24:00 +00:00
Simon Binder eb1f864540 analyzer_plugin: Support latest analyzer in pubspec
Related to https://github.com/dart-lang/sdk/issues/50043

Change-Id: I6e0a93f647e4017bfb320abf29992745908f466e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/260704
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2022-09-23 21:57:49 +00:00
Ryan Macnak cba1a09e5c [vm, compiler] Inform MSan about parameters coming from FFI.
- Mark the outgoing arguments stack area as initialized.
 - Mark the trampoline's incoming parameter slots as initialized in case they are used as local handles.
 - Mark the outgoing register arguments as initialized.

TEST=msan
Bug: https://github.com/dart-lang/sdk/issues/42314
Bug: https://github.com/dart-lang/sdk/issues/49298
Bug: https://github.com/dart-lang/sdk/issues/49957
Change-Id: Ifa978e1b905a424ec9f64b89879cea6e82f70d12
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/259102
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2022-09-23 21:31:14 +00:00
Brian Wilkerson 025a55e354 Replace uses of colon as a default value separator in tests
Change-Id: I19a9ccc55e889e3519ff656f39d188592a0dd8ad
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/260960
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2022-09-23 20:28:49 +00:00
Konstantin Shcheglov 44316060f1 Deprecate 'get declaredElement2', use 'get declaredElement' instead.
Change-Id: Ida7a9c2ac35943aed2d75f81f98ce7056b616aee
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/260741
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2022-09-23 20:05:29 +00:00
Ahmed Ashour 4f42058b4f [analyzer] use preferred quote-style for edit.importElements
Bug: #49559
Change-Id: Ic9c272c78f15599c5f3c985466f815cec82ad62b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/260520
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2022-09-23 19:59:59 +00:00
Lasse R.H. Nielsen 2fcf9d8803 Update Future.timeout documentation.
Makes it clear that the original future can still complete,
it's just the new future which doesn't wait for it any longer.

Fixes #42318

Bug: http://dartbug.com/42318
Change-Id: I16c25e4e4588d444bd99796d25bdb92bea1467f0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/260582
Commit-Queue: Nate Bosch <nbosch@google.com>
Auto-Submit: Lasse Nielsen <lrn@google.com>
Reviewed-by: Nate Bosch <nbosch@google.com>
2022-09-23 19:22:40 +00:00
Alexander Markov 15af1d2c55 [core library] Extract vm_common set of core libraries in libraries.yaml
"vm_common" set of core libraries is shared between various Dart VM
embedders: standalone VM, Flutter, Fuchsia Dart runner and Fuchsia
Flutter runner.

This change would simplify future changes of core library patch
files and will remove the need for additional changes in Flutter
engine when patch file is added or removed.

TEST=ci

Change-Id: Id9fb9dc369504fd4d7dab44de3799dbef594b12d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/260900
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2022-09-23 19:06:14 +00:00
Siva Annamalai 29cf22fa10 Revert "[VM/Library] - Adjust next probe to be a quadratic probe in _HashBase"
This reverts commit 959854769c.

Reason for revert: This CL appears to cause some performance regressions in Flutter hot reload, please see https://github.com/flutter/flutter/issues/112177
In addition the recently added benchmark IntegerSetLookup.DefaultHashSet also shows regressions.

Original change's description:
> [VM/Library] - Adjust next probe to be a quadratic probe in _HashBase
>
> Adjust next probe to a quadratic probe so that it matches up with the internal VM hash map implementation.This avoids some issues with hash code clustering and uses the probing strategy in the VM's HashTable.
>
> Change-Id: I6af560b971c2e6fa745e3b3414e2d8a9075e7ff5
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/239004
> Reviewed-by: Ryan Macnak <rmacnak@google.com>
> Commit-Queue: Siva Annamalai <asiva@google.com>

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

Change-Id: I27955a4eb239cf9afcbd40989d570467b9eea063
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/260747
Reviewed-by: Siva Annamalai <asiva@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Siva Annamalai <asiva@google.com>
2022-09-23 19:01:39 +00:00
Ahmed Ashour 59032020ef [analysis_server] data driven fix to support dart_fix folder
Fixes #47941

Change-Id: I8f2a648ab67822d4032f10e30b6ac3560621245b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/260581
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2022-09-23 18:58:12 +00:00
Brian Wilkerson 58addcf2e6 Fix reporting of invalid names for fields in record literals and record types
Change-Id: I1dadfcd98f743d95e8acdb53e1f3623d3192cb19
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/260682
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2022-09-23 17:16:50 +00:00
Ahmed Ashour eea352fa4b [analyzer] use preferred quote-style for AddMissingRequiredArgument
Bug: #49559
Change-Id: Iec3eea9915e0f4093aad8caa3fc8635081f3f9db
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/260523
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2022-09-23 17:04:39 +00:00
Jens Johansen 9cfa8e457e [VM] Set gc_root_type when visiting frames
I ran into an "unknown" root when trying to debug something, turned
out to be via frames. This CL marks the root as such.

TEST=Existing tests.

Change-Id: I48f1176d036f5b888e88a5fc8b3796af8d86f301
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/260880
Reviewed-by: Ben Konyi <bkonyi@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2022-09-23 16:58:57 +00:00
asiva 1a8335b42b Migrate frontend_server_test to be null safe.
Change-Id: If31640eaa2de3ac91df377f4e9e4195e2b5cd641
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/260744
Commit-Queue: Siva Annamalai <asiva@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2022-09-23 15:57:39 +00:00
Jens Johansen 7bfacba429 [CFE] Reproduce issue 49968
Reproduction of https://github.com/dart-lang/sdk/issues/49968
in that we upon recompilation (of another library) include a reference
to a constructor in a library which we do not include.

Change-Id: I6f0e0b44b95ccf4d059a7641cdc8f97dc5f6e451
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/260542
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2022-09-23 13:46:39 +00:00
Alexander Thomas 2f07144a31 [infra] Add ninja to the SDK DEPS
This will allow us to gradually migrate from depot_tools ninja to our
own. See also https://crbug.com/1340825.

Bug: https://github.com/dart-lang/sdk/issues/50032
Change-Id: I5118c98abcb4399ec5d952c5a3e240f8e3803475
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/260762
Reviewed-by: William Hesse <whesse@google.com>
Reviewed-by: Daco Harkes <dacoharkes@google.com>
2022-09-23 11:14:16 +00:00
Sergey G. Grekhov 10038767ed [co19] Roll co19 to 5f1506d4bc923342791d7e7b747a9b9c598fefe1
2022-09-21 sgrekhov22@gmail.com Fixes dart-lang/co19#1449. Use precise record type, not Record class (dart-lang/co19#1463)
2022-09-21 sgrekhov22@gmail.com Fixesdart-lang/co19#195. Fix RawDatagramSocket tests (dart-lang/co19#1431)
2022-09-20 sgrekhov22@gmail.com Fixes dart-lang/co19#1455. In constant record expression specify collection type (dart-lang/co19#1464)
2022-09-20 sgrekhov22@gmail.com Fixes dart-lang/co19#1456. It's an error to use `void` in a record expression (dart-lang/co19#1460)
2022-09-20 sgrekhov22@gmail.com Fixes dart-lang/co19#1442. Fix Records tests for the case when there is an extension with the same member as record's field (dart-lang/co19#1462)
2022-09-20 sgrekhov22@gmail.com Fixes dart-lang/co19#1451. Typo fixed (dart-lang/co19#1458)
2022-09-20 sgrekhov22@gmail.com Fixes dart-lang/co19#1454. Typo in a records_A02.dart fixed (dart-lang/co19#1461)
2022-09-20 sgrekhov22@gmail.com Fixes dart-lang/co19#1453. Use more precise record type, not Record class (dart-lang/co19#1459)
2022-09-20 sgrekhov22@gmail.com Fixes dart-lang/co19#1450. Missed experimental flag for Records tests added (dart-lang/co19#1457)
2022-09-19 sgrekhov22@gmail.com Fixes dart-lang/co19#1443. Fix wrong syntax in Records tests (dart-lang/co19#1445)
2022-09-19 sgrekhov22@gmail.com Fixes dart-lang/co19#1444. Missed function argument name added (dart-lang/co19#1448)

Change-Id: I5fcb4b8b51666c3e00d0c8e29e4599e174575654
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/260702
Reviewed-by: Alexander Thomas <athom@google.com>
2022-09-23 10:40:07 +00:00
Martin Kustermann 6b1e9bbdfe Extend HeapSnapshotGraph API to support incoming references in package:vm_service
Currently the HeapSnapshotGraph represents the objects in the Dart VM
heap and how they relate to each other. They effectively form a directed
graph with a specific root node.

The API does allow traversing the graph by following an object's
outgoing references.

Though in certain situations it can be very useful to know the set of
objects referencing a given object (i.e. incoming references).

This CL adds such support, thereby allowing traversing edges in both
directions: Finding what an object references and who references an
object.

When loading a snapshot we therefore have to also compute the reverse
edges and store them. To offset any additional computation time and
memory consumption, we optimize the existing implementation by not using
growable List<int> objects for outgoing edges but rather typed-data
views into the existing Uint32List of edges.

Due to this optimization we make loading of snapshot faster and smaller,
in a simple benchmark we seem to get:

  * JIT: 10% faster, 40% less RAM
  * AOT: 30% faster, 40% less RAM

despite the additional compute & data structures of this API.

TEST=vm/dart{,_2}/heap_snapshot_referencees_test

Change-Id: Ief30bfb58c70364744eeb7f69967dd1f72ece807
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/260524
Reviewed-by: Tess Strickland <sstrickl@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2022-09-23 10:11:41 +00:00
Ömer Sinan Ağacan affc3392a0 [dart2wasm] Implement Wasm FfiNative support
This CL introduces a new kernel-to-kernel pass in Wasm backend to
compile `FfiNative`-annotated external functions to external functions
with `wasm:import` pragmas.

The new pass `WasmFfiNativeTransformer` extends `FfiNativeTransformer`.
Some `FfiNativeTransformer` methods made public to allow reuse in the
pass.

The conversion works like this: when we see a member like:

    @FfiNative<Int8 Function(Int8, Int8)>("ffi.addInt8")
    external int addInt8(int a, int b);

We generate a Wasm import using Wasm ABI types according to emscripten
calling conventions:

    @pragma('wasm:import', 'ffi.addInt8')
    external static WasmI32 addInt8_$import(WasmI32 a, WasmI32 b);

and convert the original member (`addInt8()`) to a wrapper function that
calls the Wasm import, converting the arguments and return values to
Dart types:

    static int addInt8(int a, int b) {
      return WasmI32.toIntSigned(
        addInt8_$import(
            WasmI32::int8FromInt(a),
            WasmI32::int8FromInt(b),
        ));
    }

Build, test, and CI changes:

- Test runner now uses `// SharedObjects=...` lines in dart2wasm tests
  to pass extra Wasm modules to d8 command used to run the tests.

  Support for `// SharedObjects=...` lines were already used in
  native/AOT FFI tests, not added in this CL. We just start to use those
  lines in dart2wasm tests.

- dart2wasm gn file updated with a target "test_wasm_modules" that
  builds FFI test Wasm modules to Wasm using emcc (emscripten C
  compiler).

- CI dart2wasm_hostasserts configuration updated to copy the Wasm files
  generated by the "test_wasm_modules" target to the shards.

TEST=tests/web/wasm/ffi_native_test

Change-Id: I6527fe4e2ca2b582e16d84fee244e9cbe6dee307
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/252822
Reviewed-by: Alexander Thomas <athom@google.com>
Commit-Queue: Ömer Ağacan <omersa@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Aske Simon Christensen <askesc@google.com>
2022-09-23 09:41:22 +00:00
Johnni Winther d43aa20afa [cfe] Support current uri for crashes during top level inference
+ avoid printing the stack trace twice on crash

Change-Id: Iac220117b77c30bc03212b2727efe88036819357
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/260700
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
2022-09-23 08:32:49 +00:00
Sam Rawlins 51114fca8a Unnamed libraries
Fixes https://github.com/dart-lang/language/issues/1073

Spec: https://github.com/dart-lang/language/blob/master/accepted/future-releases/unnamed-libraries/feature-specification.md

This work allows library directives without a name. Every single one would look like this:

```
library;
```

:) it was a little anti-climactic implementing a non-feature like this, but there it is.

The affordance for a library directive without a name is guarded by an experiment flag, `--unnamed-libraries`.

Change-Id: I8612238359e88d6082f7e89d0d0fc624fdb45273
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/257490
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Kevin Moore <kevmoo@google.com>
2022-09-23 05:37:39 +00:00
DEPS Autoroller 948eb70c02 Roll Dart Documentation Generator from d4c344d41ee3 to c22e5e77de29 (2 revisions)
https://dart.googlesource.com/dartdoc/+log/d4c344d41ee3..c22e5e77de29

2022-09-23 parlough@gmail.com Fix slash focusing search (#3183)
2022-09-22 andre.lipke@gmail.com Add GitHub light/dark mode image syntax (#3182)

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

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

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

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

Tbr: dart-ecosystem-gardener@grotations.appspotmail.com
Change-Id: Ie7984593db0611b219e32734fa4aceacdd42d150
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/260781
Reviewed-by: Kevin Moore <kevmoo@google.com>
Commit-Queue: Kevin Moore <kevmoo@google.com>
2022-09-23 04:46:18 +00:00
Sigmund Cherem 8bff8336a4 [dart2js] migrate source_file_provider
This reapplies f740b500e2

The change is not that different from the original, except that a
few changes have landed in between to address the failure
encountered by the SDK roll last time. Namely, the map lookup on
`resolvedUri` is normalized, so that the lookup will always match
how the store operation is done, and hence will succeed when copying
cache entries between resolvedUri and uri (see also
https://dart-review.googlesource.com/c/sdk/+/250440).


Change-Id: Ic3ad778a3e9ea465b515de9800f296c71683970c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/260081
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
2022-09-23 01:41:18 +00:00
Nicholas Shahan 76a4d351b8 [ddc] Add non-null assertions when setting fields
!!! NOTE to Google3 rollers:
If this change causes test failures in google3 you can temporarily
set `null_safety_asserts = False` on the failing
`dart_browser_binary` targets until we can fix the mistyped code.
That should allow the test to pass with this change.

Of course feel free to revert this change again if the number of
failures is too high.

Re-land previously reverted change:
https://dart-review.googlesource.com/c/sdk/+/258780

Adds additional tests and more checks to ensure assertions are only
added in libraries that have been migrated to null safety.

Issue: https://github.com/dart-lang/sdk/issues/49918
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/259120
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Change-Id: Idcab0fe49a8dd98cdd73192eabae4439aebe2013
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/260070
2022-09-23 01:22:11 +00:00
Sigmund Cherem 2f1a6c9993 [dart2js] migrate js_backend/field_analysis.dart
Change-Id: Id554181edeca0e144e49ab747f764193a23a96cc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/260303
Reviewed-by: Mayank Patke <fishythefish@google.com>
Reviewed-by: Nate Biggs <natebiggs@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
2022-09-23 00:28:58 +00:00
Sigmund Cherem 2511f38bb1 [dart2js] migrate phase/modular_analysis.dart
Change-Id: I788e3952352fdd8c8d6bdce14ac57c437e583f2c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/260302
Reviewed-by: Mayank Patke <fishythefish@google.com>
Reviewed-by: Nate Biggs <natebiggs@google.com>
2022-09-23 00:28:58 +00:00
Sigmund Cherem 5fbd406929 [dart2js] migrate kernel/native_basic_data.dart and kernel/no_such_method_resolver.dart
Change-Id: Idb789679871b0702b02cfc840456702708970f6e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/260301
Reviewed-by: Nate Biggs <natebiggs@google.com>
2022-09-23 00:28:58 +00:00
Sigmund Cherem 9d8ea01862 [dart2js] migrate ir/modular.dart
Change-Id: Ica0332ccd9aebfa32ded6a4c17dd49f9573633b4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/260300
Reviewed-by: Nate Biggs <natebiggs@google.com>
Reviewed-by: Mayank Patke <fishythefish@google.com>
2022-09-23 00:28:58 +00:00
Sigmund Cherem bba48857a6 [dart2js] migrate kernel/element_map.dart
Change-Id: I64d3cfa518ec4226c8008c3e9cab3d2f631e8934
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/260286
Reviewed-by: Mayank Patke <fishythefish@google.com>
Reviewed-by: Nate Biggs <natebiggs@google.com>
2022-09-23 00:28:58 +00:00
Sigmund Cherem 8b49851cb8 [dart2js] migrate kernel/element_map_impl to null safety
Change-Id: I34ca5b75240944d39dc88d5031fdac195563b67d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/260285
Reviewed-by: Mayank Patke <fishythefish@google.com>
Reviewed-by: Nate Biggs <natebiggs@google.com>
2022-09-23 00:28:58 +00:00
Sigmund Cherem 01f3d27c1e [dart2js] prepare element_map_impl for migration
Change-Id: I7faec717a427638fc04194fac2c0c63f21f1d07c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/260284
Reviewed-by: Nate Biggs <natebiggs@google.com>
Reviewed-by: Mayank Patke <fishythefish@google.com>
2022-09-23 00:28:58 +00:00
Sigmund Cherem 0ee953d7c2 [dart2js] migrate kernel/env.dart to null safety
Change-Id: I0913b133a39f72d29b5332ae38ad7a7a5dba48af
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/260078
Reviewed-by: Mayank Patke <fishythefish@google.com>
Reviewed-by: Nate Biggs <natebiggs@google.com>
2022-09-23 00:28:58 +00:00
Paul Berry 8da75ede06 Shared type analysis: simplify handling of patterns.
Patterns may need to be visited twice during analysis: once to
determine a type schema, and a second type to resolve the pattern
match.  Previously, the shared TypeAnalyzer had just a single
`dispatchPattern` method, so it had to create temporary objects to
record the structure of the patterns between the two visits.  Now,
there are two dispatch methods: `dispatchPatternSchema` and
`dispatchPattern`.  This avoids the creation of a bunch of temporary
objects and makes the design much simpler.

(Based on an idea from Brian Wilkerson)

Change-Id: If10b6b7fb578594c3f660baa55d7e28123652638
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/260282
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2022-09-22 22:41:32 +00:00
Alexander Markov 1139ed3373 [vm] Record toString()
TEST=language/records/simple/to_string_test

Issue: https://github.com/dart-lang/sdk/issues/49719
Change-Id: I7e55a2486b1d964b24a287ffcf87c40c20f9cfe9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/260480
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2022-09-22 21:49:08 +00:00
Paul Berry b0ea39bfa1 Bump AnalysisDriver.DATA_VERSION after adding patterns experiment flag
This version bump was intended to happen as part of
https://dart-review.googlesource.com/c/sdk/+/260500, but it looks like
it got lost in the rebase between patchsets 3 and 4.

Change-Id: I382da03694e60809e137b676c8c99ce5019ff198
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/260740
Auto-Submit: Paul Berry <paulberry@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2022-09-22 21:40:09 +00:00
Alexander Markov ed593585cc [vm] Record operator== and hashCode
TEST=language/records/simple/equals_and_hashcode_test
TEST=co19/LanguageFeatures/Records/equality_*

Issue: https://github.com/dart-lang/sdk/issues/49719
Change-Id: I63842f980389d63650d00638f1cb1501db88b025
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/260442
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2022-09-22 21:24:58 +00:00
Paul Berry 4f87eacc5e Add an experiment flag for patterns.
Change-Id: I175e4680a0949e52ae05f46c2051c701b55a99cd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/260500
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Devon Carew <devoncarew@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2022-09-22 19:56:38 +00:00
DEPS Autoroller 8aded3449e Roll Dart Documentation Generator from e9b16fcbfd17 to d4c344d41ee3 (1 revision)
https://dart.googlesource.com/dartdoc/+log/e9b16fcbfd17..d4c344d41ee3

2022-09-22 srawlins@google.com Overhaul search results style (#3181)

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

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

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

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

Tbr: dart-ecosystem-gardener@grotations.appspotmail.com
Change-Id: I57193eb495e10f003d73ac0dfcb7930972bdede3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/260720
Commit-Queue: Kevin Moore <kevmoo@google.com>
Commit-Queue: DEPS Autoroller <dart-autoroll@skia-public.iam.gserviceaccount.com>
Reviewed-by: Kevin Moore <kevmoo@google.com>
2022-09-22 19:52:09 +00:00
Alexander Markov 241e70669b [vm] Fixes for gcc build
This change fixes the following build errors when building Dart VM with
gcc:

../../runtime/vm/compiler/assembler/assembler_arm64.h: In member function ‘uint32_t dart::compiler::Address::encoding(dart::compiler::OperandSize) const’:
../../runtime/vm/compiler/assembler/assembler_arm64.h:355:3: error: control reaches end of non-void function [-Werror=return-type]
  355 |   }

../../runtime/vm/compiler/assembler/assembler_arm64.cc: In member function ‘void dart::compiler::Assembler::PopNativeCalleeSavedRegisters()’:
../../runtime/vm/compiler/assembler/assembler_arm64.cc:2380:52: error: bitwise comparison always evaluates to false [-Werror=tautological-compare]
 2380 |   bool pop_single = (kAbiPreservedFpuRegCount & 1) == 1;
      |                     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^~ ~
../../runtime/vm/compiler/assembler/assembler_arm64.cc:2400:47: error: bitwise comparison always evaluates to false [-Werror=tautological-compare]
 2400 |   pop_single = (kAbiPreservedCpuRegCount & 1) == 1;
      |                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^~ ~

TEST=ci

Change-Id: Ib44790dbe99288f569a26e4df28f61ef2aa40ea3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/260640
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2022-09-22 19:33:19 +00:00
Sam Rawlins c1e43135ad Add a Queue stub in mock_sdk for use in linter
This is needed in order to test
https://github.com/dart-lang/linter/pull/3692

Bug: https://github.com/dart-lang/linter/pull/3692
Change-Id: I8be22ca319647fba0e6ff9a462571bd972e383c5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/260501
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2022-09-22 18:39:28 +00:00
Danny Tuppeny 3e9a99df6a [analysis_server] Handle prefixed Flutter widget creation expressions for assists
Fixes https://github.com/Dart-Code/Dart-Code/issues/4169.

Change-Id: I3b462c69520593cbb9db2dc30ae19b8c93deed20
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/260601
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2022-09-22 18:28:28 +00:00
Joshua Litt eb17780ef1 [dart2wasm] Fix dartify check for WasmGC struct.
Change-Id: I86a31a542ddd5b8a85249b80d9ad9235561b3ae2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/260000
Reviewed-by: Aske Simon Christensen <askesc@google.com>
Commit-Queue: Joshua Litt <joshualitt@google.com>
2022-09-22 17:40:38 +00:00
Paul Berry b8eede8c9f Flow analysis: make propertyGet's wholeExpression argument nullable.
This is needed for CFE integration of field type promotion, since it
allows the CFE to call propertyGet in circumstances where there's no
expression corresponding to the property get, such as during an
invocation of a field that's been parsed as a method call.

Change-Id: I1856705c080315e87e283af217be331021ef8aee
Bug: https://github.com/dart-lang/language/issues/2020
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/260452
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2022-09-22 17:30:29 +00:00
asiva 24b6b94637 Migrate tests to not use the mockito package for testing.
Change-Id: Id927ef41e528d5c11776ab66b29e1e9670a528af
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/260001
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Siva Annamalai <asiva@google.com>
2022-09-22 16:54:49 +00:00
Danny Tuppeny 4e63cd37eb [analysis_server] Migrate remaining FoldingRegion tests to use TestCode.parse()
+ split large annotations test up

Change-Id: I5071f4310ea3bf784e40ae1bcd1f9e497551e912
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/260540
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2022-09-22 16:33:18 +00:00