Commit graph

90044 commits

Author SHA1 Message Date
Daco Harkes ab876cfd5e [samples/ffi] Update sqlite-tutorial
Closes: https://github.com/dart-lang/sdk/issues/51460
Change-Id: Iacf2216fcdb599267f02bd2b51287d644e7fbd33
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/284361
Auto-Submit: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Slava Egorov <vegorov@google.com>
2023-02-21 21:23:43 +00:00
Alexander Markov 967f583e41 [vm/test] Make sure argument is unboxed both with and without sound null safety
Without sound null safety result of int.parse is inferred as nullable,
making the IL test vm/dart/records_allocation_sinking_il_test dependent on
the sound null safety mode.

The test is changed so the argument 'x' of 'test' is always non-nullable
and always unboxed.

Follow-up to the unboxing fix
85d1a7752e

TEST=vm/dart/records_allocation_sinking_il_test

Cq-Include-Trybots: luci.dart.try:vm-kernel-precomp-nnbd-linux-release-x64-try
Change-Id: I9c532a644d03e0fdb7b70875c323fcbbb5238948
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/284382
Auto-Submit: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Slava Egorov <vegorov@google.com>
Reviewed-by: Slava Egorov <vegorov@google.com>
2023-02-21 20:36:22 +00:00
Stephen Adams 19ac93da32 [dart2js] Allow constant record Types to be named
Change-Id: Ib1ba362ea3f91329f2b2357597bc0e874a2c4d04
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/284280
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Mayank Patke <fishythefish@google.com>
2023-02-21 20:01:50 +00:00
Kallen Tu 16b1c12619 [analyzer] Disallow classes to be used as mixins even inside the library.
Change-Id: I62aaf972a16cdd678f5711a41dc1652b89d0be37
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/283131
Commit-Queue: Kallen Tu <kallentu@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2023-02-21 19:32:44 +00:00
Kallen Tu 57107ae59b [analysis_server] Add code completion for class modifiers at the beginning of a declaration.
Change-Id: I9dc1d80264d052c8f2ac75978e64280bd271f8d7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/282440
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Kallen Tu <kallentu@google.com>
2023-02-21 19:31:55 +00:00
Ryan Macnak 347c49354e [vm] Lock-free management of the profiler's sample blocks.
Add asserts against using mutexes or monitors during the signal handler or suspended thread scopes. Poison use of Thread::Current during these scopes.

TEST=ci
Bug: https://github.com/dart-lang/sdk/issues/51124
Change-Id: If1df06520114105b2b4d8c81b4650bdb4efeaf50
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/283703
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2023-02-21 19:07:57 +00:00
Ryan Macnak f56c45eb37 [vm] Speed up JSON encoding.
TEST=ci
Change-Id: I8bfe00472f3a5e4e6680de631072cea0dacc3f55
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/283980
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2023-02-21 18:58:42 +00:00
Ömer Sinan Ağacan 004b400dfb [dart2wasm] Implement type parameter bound checks
New passing tests:

- language/generic_methods/bounds_test/02
- language/covariant/subtyping_test
- language/covariant/type_parameter_test
- language/records/simple/type_checks_test

Fixes #51358

Change-Id: I6854f71cbfc47106f685a00c36a64330cc0a57f3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/282660
Commit-Queue: Ömer Ağacan <omersa@google.com>
Reviewed-by: Aske Simon Christensen <askesc@google.com>
2023-02-21 18:56:16 +00:00
Devon Carew 2d15cad9e5 [pkg/dds] use package:lints/recommended.yaml
Change-Id: I05eb1af5dd985ee9f752b8ea409cabc785740472
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/283964
Commit-Queue: Devon Carew <devoncarew@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2023-02-21 18:30:23 +00:00
Danny Tuppeny bc91549aea [analysis_server] Use the more specific "refactor.move" for Move Class to File
VS Code refactors based on kind and shows some well-known kinds in a specific order. One new group is "refactor.move".

It's not yet in the LSP spec/code-gen, so is added to our custom enum in the meantime.

Fixes https://github.com/Dart-Code/Dart-Code/issues/4354.

Change-Id: I5577ef67a81667652258b873125dc491d96ce597
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/284144
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2023-02-21 17:27:27 +00:00
Derek Xu 41be8d54b5 [VM/Service] Make _getInstancesAsArray public
This CL updates the VM Service spec to v4.2 and adds the
`getInstancesAsList` service procedure.

This CL also adds `pkg/vm_service/test/get_instances_as_list_rpc_test.dart`
which was based on
`runtime/observatory/tests/service/get_instances_as_array_rpc_test.dart`
and `pkg/vm_service/test/get_instances_as_list_rpc_expression_evaluation_on_internal_test.dart`
which was based on
`runtime/observatory/tests/service/get_instances_as_array_rpc_expression_evaluation_on_internal_test.dart`

TEST=CI

Fixes https://github.com/dart-lang/sdk/issues/51393
Fixes https://github.com/dart-lang/sdk/issues/51003
Change-Id: I0faae80553ec397a1e89be0a714aab30e7854fec
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/283380
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Derek Xu <derekx@google.com>
2023-02-21 17:26:52 +00:00
Danny Tuppeny e8a8e10bcd [analysis_server] Include Type inlay hints for inferred type arguments + literals
Fixes https://github.com/Dart-Code/Dart-Code/issues/4366.

Change-Id: I92b28869961a6098031a21ca1cf0d34f4decd16c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/284143
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2023-02-21 17:07:25 +00:00
Konstantin Shcheglov a70386bfd6 Report CONSTANT_PATTERN_NEVER_MATCHES_VALUE_TYPE
Change-Id: I782bcf984e47162340baf96245dab8792fa3cbe0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/284241
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2023-02-21 17:01:32 +00:00
Chloe Stefantsova 3f6636dfb4 [cfe] Adjust scope of pattern variables in collection if-elements
Part of https://github.com/dart-lang/sdk/issues/49749

Change-Id: I78a9f1cc2a5fdc483bb0c5a62c4260be7a5366ab
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/284360
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Chloe Stefantsova <cstefantsova@google.com>
2023-02-21 16:34:17 +00:00
Danny Tuppeny 43e26f18cc [dds/dap] Add support for showing inspect() variables in the debug console
This adds functionality that exists in the legacy VS Code DAP but was not reproduced here.

Calling `inspect(var)` (from `dart:developer`) would print the inspected variable to the Debug Console where the user can expand and review it (similar to using the Watch window).

Fixes https://github.com/Dart-Code/Dart-Code/issues/4330.

Change-Id: Ic63e6b6eb9f149dc8d80c4efdf622fb1c05bd580
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/284183
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2023-02-21 15:57:28 +00:00
Danny Tuppeny 9356df41a0 [dds/dap] Ensure variable evaluateNames are stored for all lists/fields/getters
"evaluateNames" are returned to the client along with any variables, so the client can provide the user an expression that evaluates to that variable (used by "copy expression" or "add to watch".

DAP doesn't round-trip these as you expand variables, so we have to track them ourselves, but we were only doing so for map values. This fixes that to handle lists, getters, fields correctly too.

Fixes https://github.com/Dart-Code/Dart-Code/issues/4352.

Change-Id: Id57e46a1cecf8bd22473911340b649ac05da65fc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/284223
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2023-02-21 15:56:58 +00:00
Jens Johansen 39b8f7bef4 [kernel] Shift up specialized kernel tags
Before this CL kernel tags had specialized tags that was marked by the
single high bit, then using the three lowest bits for a value:

128 + value = 0b10000xxx
136 + value = 0b10001xxx
144 + value = 0b10010xxx

So the numbers from 128 to 151 is taken by this scheme, but because of
the high bit marking stuff being special we can't really use 152-256.

This CL shifts the specialized tags up so it instead uses the 3 highest
bits as a marker while still using the lower 3 bits for the value:

224 + value = 0b11100xxx
232 + value = 0b11101xxx
240 + value = 0b11110xxx

This takes up 224-247 and leave 248-255 unused. It would let us use
128-223 though.
(If we eventually need more we can probably remove one of the
specialized ranges (SpecializedVariableSet isn't used very much in
previously sampled dill files) and use 4 bits for tagging).

Additionally, a tool to print free tags has been added (via binary.md),
and the "binary version is in sync with VM" test has been prepared
for version > 99.

TEST=Existing tests.

Change-Id: If77b12cee6fc3801628dd67dc40afbb018ec8a61
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/284302
Reviewed-by: Martin Kustermann <kustermann@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2023-02-21 15:21:38 +00:00
Ömer Sinan Ağacan 4d07dc0199 [dart2wasm] Fix overriding stack traces of re-thrown errors
New passing tests:

- language/stack_trace/rethrow_error_test/none
- language/stack_trace/rethrow_error_test/withtraceparameter

Change-Id: I446bce3a37846157d6b3e056e20a4b89ab03acf1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/284181
Commit-Queue: Ömer Ağacan <omersa@google.com>
Reviewed-by: Aske Simon Christensen <askesc@google.com>
2023-02-21 14:36:04 +00:00
Ömer Sinan Ağacan 0892c0f93c [dart2wasm] Check array length in _allocateData
New passing tests:

- co19/LibTest/collection/ListBase/ListBase_class_A01_t01
- co19/LibTest/collection/ListMixin/ListMixin_class_A01_t01
- co19/LibTest/core/List/List_all_t01

Change-Id: I5ee455714e82c4f70df42037db11414832e4f9fa
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/284160
Commit-Queue: Ömer Ağacan <omersa@google.com>
Reviewed-by: Aske Simon Christensen <askesc@google.com>
2023-02-21 14:28:27 +00:00
Ömer Sinan Ağacan ff9fd9a2bd [dart2wasm] Fix representation types of classes
When computing representation of a class with implementers, use the
representation of implementers, rather than implementer classes.

New passing test: lib/math/implement_rectangle_test

Fixes #51406

Change-Id: I495353a00e3379e04123a77c270374b82c97a90a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/284301
Reviewed-by: Aske Simon Christensen <askesc@google.com>
Commit-Queue: Ömer Ağacan <omersa@google.com>
2023-02-21 14:08:31 +00:00
Martin Kustermann d71a37af18 Support external typed data in heapsnapshot analysis tool
TEST=runtime/tools/heapsnapshot/test/cli_test.dart

Change-Id: I684bfb344f079d9d29bc910b5f2fdda99257821e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/284303
Reviewed-by: Tess Strickland <sstrickl@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2023-02-21 12:58:34 +00:00
Lasse R.H. Nielsen 164f8588d6 Optimize LineSplitter.
Avoid quadratic behavior when multiple chunks fail to
have a line break, and the carry-over string gets repeatedly extended.

In the original chunked conversion code, the chunk handling code retained the trailing, non-line-terminated text of the previous chunk, then eagerly concatenated it with the next chunk in order to continue looking for lines. That's moderately effective when lines are shorter than chunks, and neither are too large.
However, a very long line spread across many chunks would perform repeated string concatenation with quadratic time complexity.

This change gives `LineSplitter` the option of using a `StringBuffer` to collect multiple carry-over line parts.
The buffer is needed whenever a chunk does not contain a line break, and needs to be combined with a previous chunk's carry-over. This avoids ever directly concatenating any more than two strings.
The `StringBuffer` is not allocated until it's first needed, so if lines are generally shorter than chunks, the buffer won't be used. Once allocated, the buffer is retained in case a buffer will be needed again, but cleared when its contents are used.

The code optimizes for the simple case of each chunk having a line break.

Fixes #51167

Bug: https://github.com/dart-lang/sdk/issues/51167
Change-Id: I600a011e02aa9f1ad6f88e45764df5b2e8eccfa3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/280100
Reviewed-by: Leaf Petersen <leafp@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Lasse Nielsen <lrn@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
Reviewed-by: Aske Simon Christensen <askesc@google.com>
Reviewed-by: Nate Bosch <nbosch@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2023-02-21 11:33:24 +00:00
Chloe Stefantsova 3ab2dfaaaa [cfe] Add support for c-style pattern-for elements in lists
Part of https://github.com/dart-lang/sdk/issues/49749

Change-Id: Iafc0239535dd89d0ff4bfa99bd10cdb3978b42ea
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/284224
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Chloe Stefantsova <cstefantsova@google.com>
2023-02-21 10:26:23 +00:00
Sergey G. Grekhov 3424cc8db7 [co19] Roll co19 to f91e5d74f9f0444495ca961fa5dafacac9a6922a
2023-02-17 sgrekhov22@gmail.com dart-lang/co19#1399. [Records] Allow legacy libraries that don't support records to still be able to see the Record class in "dart:core" (dart-lang/co19#1571)
2023-02-17 sgrekhov22@gmail.com dart-lang/co19#1860. Fix type_inference_A12_t01.dart. Don't expect warning (dart-lang/co19#1862)
2023-02-17 sgrekhov22@gmail.com Fixes dart-lang/co19#1860. Fix roll failures (dart-lang/co19#1861)
2023-02-16 sgrekhov22@gmail.com dart-lang/co19#1401. Calculating the static type of the pattern tests added (dart-lang/co19#1847)
2023-02-16 sgrekhov22@gmail.com dart-lang/co19#1401. Shared case scope test with labels and default case added (dart-lang/co19#1858)
2023-02-15 sgrekhov22@gmail.com Fixes dart-lang/co19#1837. Add additional unnecessary null-ckeck warnings (dart-lang/co19#1842)

Change-Id: I3a1f5deafd4f2868574f085495417ed37fe845b9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/284080
Reviewed-by: Alexander Thomas <athom@google.com>
2023-02-21 08:58:26 +00:00
Daco Harkes 40787d84fc [frontend_server] Add support for @Native assets
The VM can read native asset mappings from kernel.

Previous CLs already added support to embed native asset mappings for
one-shot compilation.
This CL adds support for adding native assets mappings to kernel files
created by the frontend_server with the incremental compiler.

The frontend_server accepts a `--native-assets=<uri>` at startup and
accepts a `native-assets <uri>` message on stdin as compilation
command.

The frontend_server caches the compiled native assets library.

When a `reset` command is sent to request a full dill from the
incremental compiler, the native assets mapping is taken from the
cache and added to the final dill file.

Split of DartSDK & flutter_tools prototype to land separately.

TEST=pkg/frontend_server/test/native_assets_test.dart

Bug: https://github.com/dart-lang/sdk/issues/49803
Bug: https://github.com/dart-lang/sdk/issues/50565
Change-Id: I6e15f177564b8a962e81261815e951e7c9525513
Cq-Include-Trybots: luci.dart.try:pkg-linux-debug-try,pkg-linux-release-try,pkg-mac-release-arm64-try,pkg-mac-release-try,pkg-win-release-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/282101
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
2023-02-21 07:29:29 +00:00
Devon Carew 9bc32f1914 [deps] rev args, characters, dartdoc, ffi, http, markdown, mockito, path, pool, source_maps, test, tools, webdev
Revisions updated by `dart tools/rev_sdk_deps.dart`.

args (b08471e..9305d5a):
  9305d5a  2023-02-15  Naoto Kaneko  Update README.md (#236)

characters (29f3a3e..3281cc7):
  3281cc7  2023-02-16  Devon Carew  blast_repo fixes (#75)

dartdoc (3931595..dba6f94):
  dba6f946  2023-02-16  Janice Collins  Preserve type aliases for records in output (#3340)
  96e61903  2023-02-16  Sam Rawlins  Remove unused additionalOptions parameter, other little refactorings (#3339)
  f64290e1  2023-02-13  Devon Carew  remove an unused css attribute (#3335)
  c055526a  2023-02-13  Devon Carew  fix an issue where we created a temporary directory when performing a dry run (#3334)
  1f6c8db5  2023-02-13  dependabot[bot]  Bump github/codeql-action from 2.2.1 to 2.2.4 (#3337)
  f1fa0efc  2023-02-13  dependabot[bot]  Bump actions/cache from 3.2.4 to 3.2.5 (#3338)

ffi (69d7596..32f5eef):
  32f5eef  2023-02-20  Daco Harkes  Bump SDK constraint to 4.0.0 (#185)

http (f4b365e..c13a3f8):
  c13a3f8  2023-02-17  Alex Li   Add Cronet embedded tool (#853)

markdown (f51c24c..4befe66):
  4befe66  2023-02-16  Zhiguang Chen  Do not generate heading IDs for headings with no content in `HeaderWithIdSyntax` (#522)
  cae08af  2023-02-15  Kevin Moore  Prepare to release v7.0.1 (#520)
  bdbaf76  2023-02-15  Zhiguang Chen  Remove lookarounds from autolink extension patterns (#519)
  eb09fac  2023-02-14  Kevin Moore  Move to pkg:dart_flutter_team_lints (#518)
  51a6389  2023-02-15  Zhiguang Chen  Add line endings to HTML blocks (#512)
  a4cd7a0  2023-02-14  Kevin Moore  Label tests that only run on the VM: allows running tests with browser (#516)
  6788042  2023-02-14  Kevin Moore  CI: add publish and response workflows (#517)

mockito (d2a8df1..ed5bd84):
  ed5bd84  2023-01-09  Ross Wang  Relax mixin criteria
  781752c  2023-02-13  Sam Rawlins  Change `void` to `dynamic` when overriding method arguments
  71e41b9  2023-02-10  Sam Rawlins  Add `ignore_for_file: use_of_void_result`
  d5a25f8  2023-02-08  Sam Rawlins  Fix violations of `unnecessary_parenthesis` lint

path (a95f1e9..24b58a2):
  24b58a2  2023-02-20  Kevin Moore  Move to team lints, require Dart 2.19 (#138)
  8ec8ca0  2023-02-18  Kevin Moore  blast_repo fixes (#137)

pool (51f1131..694cfd8):
  694cfd8  2023-02-20  Kevin Moore  move to package:dart_flutter_team_lints, require Dart 2.19 (#65)
  40bf2af  2023-02-20  Kevin Moore  blast_repo fixes (#64)

source_maps (cf44db3..a112e98):
  a112e98  2023-02-16  Devon Carew  configure publishing automation (#74)

test (b5e70db..e56c643):
  e56c6439  2023-02-17  Jacob MacDonald  Add exe compiler, supports running tests compiled to native executables (#1941)
  f80dfa00  2023-02-16  Nate Bosch  Add note about why we are replacing matcher (#1940)
  732ae1de  2023-02-15  Nate Bosch  Add `because` usage in examples (#1939)
  f6df9756  2023-02-15  Jacob MacDonald  Fix typo in readme (#1937)
  aca53419  2023-02-14  Nate Bosch  Add a caret constraint for matcher (#1927)
  f7f3a019  2023-02-14  Jacob MacDonald  use test_api/backend.dart instead of test_core/backend.dart (#1936)
  de40c1c0  2023-02-14  Jacob MacDonald  Add support for `--compiler` flag (#1903)
  1f42db8c  2023-02-13  Devon Carew  updates to package:checks docs (#1933)

tools (48a544b..a53933c):
  a53933c  2023-02-17  Elias Yishak  [package:dash_analytics] Tests for conforming to GA4 Measurement Protocol limitations (#9)
  c54430b  2023-02-17  Devon Carew  add some clarification to the top-level readme (#8)

webdev (0bae2be..ae7eb80):
  ae7eb80  2023-02-17  Anna Gringauze  Add tests for object inspection (#1973)
  7d80a2c  2023-02-17  Elliott Brooks (she/her)  Ignore offset / count if an instance has no `length`  (#1972)
  cd66172  2023-02-17  Elliott Brooks (she/her)  [MV3 Debug Extension] User can reload app and continue to debug (#1968)
  8b7f9d3  2023-02-16  Anna Gringauze  Re-enable weak webdev tests (#1960)
  83d8e47  2023-02-16  Elliott Brooks (she/her)  [MV3 Debug Extension] Variables in panel.dart should be private (#1969)
  4e85e74  2023-02-16  Elliott Brooks (she/her)  [MV3 Debug Extension] The new debug extension can be run on Manifest V3 or Manifest V2 (#1966)
  3982f5f  2023-02-15  Elliott Brooks (she/her)  [MV3 Debug Extension] Clean up tests in preparation for supporting compiling to MV2  (#1964)
  3ad544e  2023-02-15  Elliott Brooks (she/her)  [MV3 Debug Extension] Remove isMV3Extension field from DevtoolsRequest (#1963)
  c77043e  2023-02-14  Elliott Brooks (she/her)  [MV3 Debug Extension] Fix isDevMode getter (#1962)
  a761125  2023-02-14  Elliott Brooks (she/her)  [MV3 Debug Extension] Print `console` messages on test failure (#1961)
  41e92be  2023-02-14  Anna Gringauze  Create test_common package (#1945)
  443f820  2023-02-14  Anna Gringauze  Re-enable skipped reload test (#1958)
  a7bc3fc  2023-02-14  Anna Gringauze  Make dart-uri-file-uri test use sound null safety (#1959)
  464a8eb  2023-02-14  Elliott Brooks (she/her)  [MV3 Debug Extension] Compile extension with Dart instead of shell script (#1954)
  7cf8fe2  2023-02-13  Anna Gringauze  Fix asset handler tests (#1956)
  c371ad7  2023-02-13  Anna Gringauze  Fix chrome_proxy_service tests broken after switch to null safety by default (#1957)
  d6ec127  2023-02-13  Anna Gringauze  Move test-only code from the SdkLayout (#1955)
  35fa34b  2023-02-13  Elliott Brooks (she/her)  [MV3 Debug Extension] Update Chrome APIs to be backwards compatible with MV2 (#1951)

Change-Id: I4250594d0fa775d07cb3a0f8594e634552de452b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/284240
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Auto-Submit: Devon Carew <devoncarew@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2023-02-20 20:09:45 +00:00
Jaime Wren abaf24e10d Avoid calling ByteStore.release() with an empty set
Change-Id: I5ca8b8acc5074d34dba3d01c0841f4c755634518
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/283965
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Auto-Submit: Jaime Wren <jwren@google.com>
2023-02-20 19:59:36 +00:00
Vyacheslav Egorov f193356735 [vm/compiler] Remove unused variable to fix RISC-V build
Follow up of https://dart-review.googlesource.com/c/sdk/+/284184.

TEST=RISC-V build

Cq-Include-Trybots: luci.dart.try:dart-sdk-linux-riscv64-try
Change-Id: I493f6533b19a1dc75307fff99a4ed0fc115ffc37
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/284221
Auto-Submit: Slava Egorov <vegorov@google.com>
Commit-Queue: Slava Egorov <vegorov@google.com>
Reviewed-by: Daco Harkes <dacoharkes@google.com>
2023-02-20 19:28:28 +00:00
Ilya Yanok 029e0cec71 Revert "Enforce current library restrictions."
This reverts commit 0c05e33836.

Reason for revert: breaks ~10% of G3 smoke suite.

Original change's description:
> Enforce current library restrictions.
>
> Mark all currently unimplementable types as `final`, or `sealed` for `num` and `final` for `Function`.
> Mark all current classes intended as mixins as `mixin class`.
>
> More additions and cleanup will follow,
> but this change should make everything keep working as today
> if we flip the switch.
>
> TEST= No new tests, very little actual change, covered by existing tests with few changes. Will add more tests when adding more modifiers.
>
> Change-Id: I40e724f823e7f88cdef186d2f73874df256e2f43
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/281683
> Reviewed-by: Siva Annamalai <asiva@google.com>
> Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
> Reviewed-by: Aske Simon Christensen <askesc@google.com>
> Reviewed-by: Slava Egorov <vegorov@google.com>
> Commit-Queue: Lasse Nielsen <lrn@google.com>
> Reviewed-by: Sigmund Cherem <sigmund@google.com>
> Reviewed-by: Johnni Winther <johnniwinther@google.com>
> Reviewed-by: Kallen Tu <kallentu@google.com>

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

Change-Id: Ib0cb5b7ec1a8c392bbf9bf4af8dc3efc0b27991d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/284187
Reviewed-by: Slava Egorov <vegorov@google.com>
Reviewed-by: Ilya Yanok <yanok@google.com>
Commit-Queue: Slava Egorov <vegorov@google.com>
2023-02-20 15:29:41 +00:00
Chloe Stefantsova 459010fc3f [cfe] Ajust scoping for pattern variables in pattern-for statements
Part of https://github.com/dart-lang/sdk/issues/49749

Change-Id: Ia5551f14b73b6ce50e8e7390f3b7995aaf5fda3b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/284140
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Chloe Stefantsova <cstefantsova@google.com>
2023-02-20 15:02:26 +00:00
Vyacheslav Egorov 93e73bf93a [vm/compiler] Rename PushArgument to MoveArgument
This is follow up to 65f4a733bb,
which switched optimized code to use fixed frame for outgoing
arguments.

Change Kernel to IL translation to handle null-checks in
invocations differently: this code used to duplicate receiver on
the stack to accomodate for PushArgument in unoptimized code, but
PushArgument has not been inserted since f4e61eacfd,
which means duplication of the receiver is no longer necessary.

TEST=ci

Cq-Include-Trybots: luci.dart.try:vm-kernel-precomp-linux-debug-x64-try,vm-kernel-precomp-dwarf-linux-product-x64-try,vm-kernel-precomp-linux-release-simarm-try,vm-kernel-precomp-linux-release-x64-try,vm-kernel-precomp-nnbd-linux-debug-simarm_x64-try,vm-kernel-precomp-nnbd-linux-release-simarm64-try
Change-Id: I6c1f1e8c354f9ea92424b6602b83b9e9ebce8b69
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/284184
Commit-Queue: Slava Egorov <vegorov@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2023-02-20 14:57:57 +00:00
Martin Kustermann 354e8068a4 [kernel] Make package:kernel`s text printer end map constants with matching "}"
This makes it easier to navigate around in editors that can go to
matching braces/parenthesis (e.g. jump from end of constant section to
start).

TEST=Fixes kernel text printer & updates tests.

Change-Id: I6cbf34f5a62e11454e5de4d5fc9a313e0c6cf36c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/283641
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2023-02-20 14:10:09 +00:00
Martin Kustermann 15ecb9b39f [gardening] Fix vm/cc/IsolateReload_{TypedefToNotTypeDef,NotTypedefToTypeDef} tests
With introduction to Dart 2.0 and Kernel as intermediate format, the VM
consumes kernel. The kernel is produced by CFE which lowers named
function type definitions to function types.

We therefore no longer have name classes between typedefs and classes
and the corresponding vm/cc/IsolateReload_* can be updated to no longer
expect an error.

Issue https://github.com/dart-lang/sdk/issues/50521
Issue https://github.com/dart-lang/sdk/issues/32190

TEST=Fixes vm/cc/IsolateReload_*Typedef* tests

Change-Id: Ic0697c5de03ef28e6cca104f5fbcb214e99d3fd8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/284182
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Slava Egorov <vegorov@google.com>
2023-02-20 13:54:29 +00:00
Ilya Yanok b74f4e1818 Count comparisons to null literal as a nullability signal
This breaks a good deal of tests and overall feels like preventing
a whole bunch of "make it non-nullable" stuff from working.

On the other hand, in cases where not the whole program is migrated
at once, and pieces of it keep being legacy and the whole thing
running in mixed mode, we would like to keep it on the conservative
side, so treat comparisons to `null` as a nullability signal.

I deleted some tests while updating others, I think a good deal of
updated tests probably should be deleted instead, but I kept them
for review, as these diffs show what exactly this change breaks.

Change-Id: I3d29dd446aefb7cfeb6219cffd9060ca8f57e50d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/283681
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Ilya Yanok <yanok@google.com>
2023-02-20 12:58:37 +00:00
Daco Harkes 14e4a52657 [vm] Fix Dart_CObject_Type breaking change
https://dart-review.googlesource.com/c/sdk/+/257925 added a new entry
in the middle of the `Dart_CObject_Type` enum, which changed the
value of the entries below. However, this enum is part of
`dart_api_dl.h` and versioned by `dart_version.h`.

New entries to `Dart_CObject_Type` should be added at the end of the
enum to avoid making breaking changes to the type.

TEST=tests/ffi/vmspecific_handle_dynamically_linked_test.dart

Bug: https://github.com/dart-lang/sdk/issues/51459

Change-Id: I367b54f62e59ddf925e255bb56c0f8660be7c227
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/284161
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
2023-02-20 11:59:19 +00:00
Martin Kustermann 789971863e [gardening] Fix pkg/vm/test/unlinked_ast_to_text_test & ensure it runs on bots
The pkg/vm/test/unlinked_ast_to_text_test test is run on bots like this

  tools/test.py -n unittest-asserts-release-linux \
        pkg/vm/test/unlinked_ast_to_text_test

This uses the dart binary from the just-built dart-sdk instead of normal
out/ReleaseX64/ folder. This led to the test return early without
testing anything.

Running locally `test.py` in other configurations on pkg shows that the
test is actually failing.

We fix the test and also ensure it runs on the only config that CI runs
(namely 'unittest-asserts-release-linux').

TEST=Fixes pkg/vm/test/unlinked_ast_to_text_test

Change-Id: If675e7ae1d9276f321234e0ce90d61724b64a5c4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/284180
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2023-02-20 11:28:58 +00:00
Ömer Sinan Ağacan cb9f1c5805 [kernel] Remove old TODOs
Change-Id: Ic3bd2fa65647b5f2ecca4001d725c6807cd23fa3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/284162
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Ömer Ağacan <omersa@google.com>
2023-02-20 11:11:55 +00:00
Joshua Litt 4a2438bdeb [dart2wasm] Minor fix for stopwatch patch.
Bug-Id: #51429
Change-Id: I1b01a7d2e83e2c4808ef01ebfe8212390cd54c03
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/283500
Reviewed-by: Ömer Ağacan <omersa@google.com>
Commit-Queue: Ömer Ağacan <omersa@google.com>
Auto-Submit: Joshua Litt <joshualitt@google.com>
2023-02-20 08:31:41 +00:00
Brian Wilkerson 392c2d6413 Add more tests for pattern variables
Change-Id: I44cab7deebf8e3be15890427055e833c00c5d322
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/283963
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2023-02-20 01:23:28 +00:00
Johnni Winther 9bef75c6af [cfe] Call late setter in patterns lowering
Closes #51449

Change-Id: I91b34205768234bece460555bfcd781e38e61ffa
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/284020
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
2023-02-19 23:33:15 +00:00
Chloe Stefantsova 89639ba268 [cfe] Add support for set/map disambiguation for pattern elements
Part of https://github.com/dart-lang/sdk/issues/49749

Change-Id: Idb7f8e4bd1537abbe4133e69d2e51ae6b1e96a0d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/283862
Commit-Queue: Chloe Stefantsova <cstefantsova@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2023-02-19 21:07:36 +00:00
Lasse R.H. Nielsen 0c05e33836 Enforce current library restrictions.
Mark all currently unimplementable types as `final`, or `sealed` for `num` and `final` for `Function`.
Mark all current classes intended as mixins as `mixin class`.

More additions and cleanup will follow,
but this change should make everything keep working as today
if we flip the switch.

TEST= No new tests, very little actual change, covered by existing tests with few changes. Will add more tests when adding more modifiers.

Change-Id: I40e724f823e7f88cdef186d2f73874df256e2f43
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/281683
Reviewed-by: Siva Annamalai <asiva@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Aske Simon Christensen <askesc@google.com>
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Lasse Nielsen <lrn@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Kallen Tu <kallentu@google.com>
2023-02-18 12:37:40 +00:00
Lasse R.H. Nielsen 61a4fb4f9e Update Future.onError extension method.
Now works better with futures that have been up-cast.

CoreLibraryReviewExempt: Rewrite of existing pure Dart function.
Change-Id: Iefd05b9cfd8ff0cc3e27fc1122a670030e0901ff
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/283680
Reviewed-by: Nate Bosch <nbosch@google.com>
Commit-Queue: Lasse Nielsen <lrn@google.com>
2023-02-18 12:01:45 +00:00
Ömer Ağacan 7c6423cb32 Revert "[kernel] Remove unused RecursiveVisitor type parameter"
This reverts commit a329e05684.

Reason for revert: Broke internal projects

Original change's description:
> [kernel] Remove unused RecursiveVisitor type parameter
>
> TEST=ci
>
> Change-Id: I523282e933b955389c950c1942253d2d66a51f3f
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/283821
> Reviewed-by: Johnni Winther <johnniwinther@google.com>
> Commit-Queue: Ömer Ağacan <omersa@google.com>

TBR=johnniwinther@google.com,omersa@google.com,dart-scoped@luci-project-accounts.iam.gserviceaccount.com

Change-Id: Iad30e34ce0a491711b0daa1991c69de1796f8846
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/284023
Commit-Queue: Ömer Ağacan <omersa@google.com>
Reviewed-by: Ömer Ağacan <omersa@google.com>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
2023-02-18 10:52:39 +00:00
Ömer Sinan Ağacan a329e05684 [kernel] Remove unused RecursiveVisitor type parameter
TEST=ci

Change-Id: I523282e933b955389c950c1942253d2d66a51f3f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/283821
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Ömer Ağacan <omersa@google.com>
2023-02-18 07:31:18 +00:00
Konstantin Shcheglov 3f288db57e Issue 51046. Implement primitive equality.
Bug: https://github.com/dart-lang/sdk/issues/51046
Change-Id: I2190b9e36753cc5f4708597ae0b515430d2f7bf2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/283440
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2023-02-18 06:22:04 +00:00
Mayank Patke e53188ae52 [dart2js] Make UnevaluatedConstantFinder extend
ComputeOnceConstantVisitor.

This ensures that sub-constants are visited only once, avoiding
an exponential number of visits in the worst case.

Change-Id: I6a96a787d09bd0db6909cc78f32b21576369719c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/283962
Reviewed-by: Nate Biggs <natebiggs@google.com>
Commit-Queue: Mayank Patke <fishythefish@google.com>
2023-02-17 23:30:29 +00:00
Mayank Patke bfcaa60b6a [dart2js] Remove replaceImplicitConstant.
This option is unused, and it was slow/error-prone anyway.

Change-Id: Ic351227bd8bb52ee8f7eed5f17e51c0e299faedd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/283961
Reviewed-by: Nate Biggs <natebiggs@google.com>
2023-02-17 23:30:29 +00:00
Mayank Patke 2860ba107c [dart2js] Remove exception handling from Dart2jsConstantEvaluator.
The CFE constant evaluator was rewritten to no longer throw if constant
evaluation fails, so we can get rid of the try/catch. Internally, the
CFE constant evaluator returns an AbortConstant, which is processed by
`evaluate` into an UnevaluatedConstant containing an InvalidExpression,
which is why our existing handling is sufficient.

Change-Id: I1ddc3b7dce3081b37177dd3384c5fc19c9b28be6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/283960
Reviewed-by: Nate Biggs <natebiggs@google.com>
2023-02-17 23:30:29 +00:00
Kallen Tu f385641fd4 [cfe] Disallow classes to be used as mixins even inside the library.
Change-Id: I388a4fabb4ba6267c2ed6f276ef796d9c90dc14d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/283130
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Kallen Tu <kallentu@google.com>
2023-02-17 20:41:39 +00:00