Commit graph

87561 commits

Author SHA1 Message Date
Johnni Winther b7debf00f7 [cfe] Handle pattern events in BodyBuilder
This supports pattern listener events in the BodyBuilder without
crashing. Currently no AST is created and only dummy objects are put
on the stack.

Change-Id: I24a29073b578bb9aaa07e84d5177e51428074a94
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/262422
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2022-10-04 13:31:41 +00:00
Martin Kustermann 2932261f83 Allow tab-completion of exit/quit/help
TEST=runtime/tools/heapsnapshot/test/completion_test.dart

Change-Id: Ia3bffbdf2b115d15ad90c8cc68870af19e3c373e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/261822
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Tess Strickland <sstrickl@google.com>
2022-10-04 12:31:45 +00:00
Chloe Stefantsova 1d768f3c75 Reland "Reland "[cfe,corelib] Add class 'Record' to the core library""
This is a reland of commit 4b6a8f35b9

Original change's description:
> Reland "[cfe,corelib] Add class 'Record' to the core library"
>
> Part of https://github.com/dart-lang/sdk/issues/49713
>
> Change-Id: I56bfca49492d14bb561b32993fd9adfe775b7400
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/259583
> Reviewed-by: Johnni Winther <johnniwinther@google.com>
> Reviewed-by: Slava Egorov <vegorov@google.com>
> Commit-Queue: Chloe Stefantsova <cstefantsova@google.com>

Change-Id: Idaab98c028312ca36bd07f569374ca8b76151a02
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/260101
Reviewed-by: Slava Egorov <vegorov@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Chloe Stefantsova <cstefantsova@google.com>
2022-10-04 12:29:47 +00:00
Chloe Stefantsova 7e57f6e371 [cfe] Implement pointwise implicit downcasts for record literals
This CL implements the adjustment of the static semantics for records
as described in
d19f6d5644. The
adjustment is based on the discussion at
https://github.com/dart-lang/language/issues/2488.

Part of https://github.com/dart-lang/sdk/issues/49713

Change-Id: I7a9d456f702ad0fb14aa3bd121ba9d2bbd104414
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/262202
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Chloe Stefantsova <cstefantsova@google.com>
2022-10-04 11:41:45 +00:00
Ömer Sinan Ağacan d968be9021 [dart2wasm] Run finally blocks on break and continue
Fixes https://github.com/dart-lang/sdk/issues/50026

No new tests added: existing tests cover this. These tests now pass:

co19/Language/Statements/Break/execution_t01
co19/Language/Statements/Break/execution_t02
co19/Language/Statements/Break/execution_t04
co19/Language/Statements/Break/execution_t06
co19/Language/Statements/Break/execution_t07
co19/Language/Statements/Break/execution_t08
co19/Language/Statements/Break/execution_t09
co19/Language/Statements/Continue/control_transfer_t01
co19/Language/Statements/Continue/control_transfer_t02
co19/Language/Statements/Continue/control_transfer_t03
co19/Language/Statements/Continue/control_transfer_t04
co19/Language/Statements/Continue/control_transfer_t05
co19/Language/Statements/Continue/control_transfer_t07
co19/Language/Statements/Continue/control_transfer_t08
co19/Language/Statements/Continue/control_transfer_t09
language/exception/finally12_test
language/exception/finally3_test
language/exception/finally9_test
language/exception/try_catch4_test
language/exception/try_finally_regress_25654_test

Change-Id: I7172d7dac9e58d37c2ecfbc1bde495d8d045fc74
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/262240
Reviewed-by: Joshua Litt <joshualitt@google.com>
Commit-Queue: Ömer Ağacan <omersa@google.com>
Reviewed-by: Aske Simon Christensen <askesc@google.com>
2022-10-04 11:23:24 +00:00
Ömer Sinan Ağacan 88539e58ea [dart2wasm] Update tracking issue for skipped async tests
Change-Id: I163c2125fb69438ff1339e1aa26eb590b8710e83
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/262426
Commit-Queue: Ömer Ağacan <omersa@google.com>
Reviewed-by: Aske Simon Christensen <askesc@google.com>
2022-10-04 10:39:49 +00:00
Sigurd Meldgaard 4f4f446e22 Bump pub to 28a2503d7f4806e6854e3ed0d783f065abfd1b5f
Changes:
```
> git log --format="%C(auto) %h %s" ec35d46..28a2503
 https://dart.googlesource.com/pub.git/+/28a2503d Bump analyzer from 4.7.0 to 5.1.0 (#3582)
 https://dart.googlesource.com/pub.git/+/8dba9574 Crc32c checksum validation and retry of archive downloads (#3546)
 https://dart.googlesource.com/pub.git/+/27da43ec Allow `dart pub add` with existing package, update constraint instead of adding (#3570)
 https://dart.googlesource.com/pub.git/+/2e9338e5  Do resolution before publishing. (#3565)
 https://dart.googlesource.com/pub.git/+/0a487534 Migrate removed command `pub` to `dart pub` in docs & messages (#3506)
 https://dart.googlesource.com/pub.git/+/e2720c27 Fail gracefully when run inside the pub-cache (#3471)
 https://dart.googlesource.com/pub.git/+/a76c1933 Upgrade `package:tar` to 0.5.6 (#3540)
 https://dart.googlesource.com/pub.git/+/c065e559 Remove unnecessary nullability (#3547)
 https://dart.googlesource.com/pub.git/+/8e306f33 Use pub.dev in writing (#3528)
 https://dart.googlesource.com/pub.git/+/08d71024 Use unicode (if available) when drawing file-lists (#3541)
 https://dart.googlesource.com/pub.git/+/a0ca4226 Don't be conservative in upgrade --major-versions without specific pa… (#3539)
 https://dart.googlesource.com/pub.git/+/a59d890e Show file size (#3509)
 https://dart.googlesource.com/pub.git/+/b0ba5cc6 Avoid packageGraph (and therefore getExecutableForCommand) depending on the lock-file (#3533)

```

Diff: https://dart.googlesource.com/pub.git/+/ec35d46261b610e558dfd0d8525ca3fc8387b4b7~..28a2503d7f4806e6854e3ed0d783f065abfd1b5f/
Change-Id: Ia366f75da16982fb9588a0d7aa18e109daea8f8c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/262346
Reviewed-by: Jonas Jensen <jonasfj@google.com>
Commit-Queue: Sigurd Meldgaard <sigurdm@google.com>
2022-10-04 10:11:57 +00:00
Martin Kustermann 756379442e Abstract out the used set implementation in heapsnapshot analysis tool.
Doing so will allow using a more efficient (both memory-wise
and perf-wise) set implementation.

TEST=ci

Change-Id: Ia64ad5785bab6dba668c5fc3e2dcfcaf482d8b83
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/262424
Commit-Queue: Tess Strickland <sstrickl@google.com>
Reviewed-by: Tess Strickland <sstrickl@google.com>
2022-10-04 09:58:19 +00:00
Johnni Winther 3931dc6b08 [cfe] Use reportIfNotEnabled in endRecordLiteral
Change-Id: I9a2bd53838a40419f9aa4779380488b547db5b39
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/262421
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
2022-10-04 09:30:07 +00:00
Tess Strickland 82897fdfde [vm] Split AbstractType::PrintName functionality across subclasses.
Since none of the subparts of the base method share any local state,
make the base method virtual and override it in all of the subclasses
with the subclass-specific functionality.

Also add an `ASSERT(IsNull());` check to all base implementations to
cause an error in DEBUG mode when forgetting to override in a subclass,
and then perform what should happen in the null case (if anything).
This way, in DEBUG mode, it's easier to distinguish an accidental null
slipping through vs. a lack of overriding.

TEST=Pure refactoring, so existing tests.

Change-Id: I57a669e5eb34119443d84bf1208ce7232a0e4c6c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/262347
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Commit-Queue: Tess Strickland <sstrickl@google.com>
2022-10-04 08:51:00 +00:00
Johnni Winther b16e2aea54 [cfe] Ensure Crash.trace is printed when Crash is created directly
The Crash class was used for to conflicting purposes: 1) To encapsulate
a captured crash in the CFE, in which case the trace was printed
directly, and 2) To propagate a crash in the CFE together with the
context in which it crash, in which case the trace was not printed but
just included in the Crash object.

This CL adds a `_hasBeenReported` field to ensure that 1) is rethrown
as intended and 2) is printed and a Crash object of type 1) is returned.

Change-Id: I6efc752414158aad60867b5dbb8d799d5b08036a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/262420
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2022-10-04 07:20:18 +00:00
Konstantin Shcheglov 2a43b37898 Replace ExtractorPattern.typeName/typeArguments with 'NamedType get type'.
Change-Id: Iaa19aef8f2cb8727879b0eea41c6f8220205f226
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/262501
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2022-10-04 00:35:51 +00:00
Devon Carew 2cf13806b2 [deps] rev dartdoc, html, markdown, and test_process
Change-Id: I2470f7ce7b8ae1f3598d5556bd65de4aad0a0216
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/262505
Reviewed-by: Kevin Moore <kevmoo@google.com>
Commit-Queue: Kevin Moore <kevmoo@google.com>
Auto-Submit: Devon Carew <devoncarew@google.com>
2022-10-03 23:32:10 +00:00
Ahmed Ashour 6da33ae60f [analyzer] add HintCode.DUPLICATE_EXPORT
Fixes #49439

Change-Id: I511205c6b0960f6b19a2ac45211bc1348568f52c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/260703
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2022-10-03 23:22:18 +00:00
Konstantin Shcheglov bcd9da806b Use assertParsedNodeText() for PatternsTest.
Change-Id: Ib0e301d6b5b5c51fe16db13cc27ed900dffb89a8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/262440
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2022-10-03 22:01:49 +00:00
Alexander Markov b5061ffae1 [vm] Support dynamic access to record fields in JIT mode
TEST=language/records/simple/dynamic_field_access_test

Issue: https://github.com/dart-lang/sdk/issues/49719
Change-Id: I18df67e0bf97944c8e5ef8a71f075b5cd40fec29
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/262300
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2022-10-03 21:24:47 +00:00
Konstantin Shcheglov 8a5725ad38 Deprecate 'Directive.element2', use 'element' instead.
Change-Id: I2326b43381d1d3f84d74f69409bc688516f6a0d8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/262500
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2022-10-03 21:10:58 +00:00
Ryan Macnak d643bcf9c7 [vm, compiler] Remove unnecessary spill from IA32 write barrier.
TEST=ci
Change-Id: Ie501566662f7460b53c0f5277a610c9dbeec9693
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/262273
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2022-10-03 20:47:21 +00:00
Nicholas Shahan da79baa962 [ddc] Fix bug in FutureOr type normalization
The correct normalization should only normalize FutureOr<Never>
when Never is non-nullable.

Change-Id: I592f3a4856c219b33a8f1ac8377567a956e1148c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/261000
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Mayank Patke <fishythefish@google.com>
Reviewed-by: Erik Ernst <eernst@google.com>
2022-10-03 20:09:38 +00:00
Paul Berry 118f628ecf Patterns: add support for parsing constant patterns
Bug: https://github.com/dart-lang/sdk/issues/50035
Change-Id: I601248bc206d9b19521b020fadb2eccd048e0ec7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/261701
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2022-10-03 19:46:16 +00:00
zmtzawqlp 2702e807f2 fix HideElementCombinatorImpl toString error
Closes https://github.com/dart-lang/sdk/pull/49984

GitOrigin-RevId: 96ec38ee2c93be22039d09f23f986e5904db4d08
Change-Id: I340083b0d5b32ecc78790dbe9feeefe684672a24
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/259681
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2022-10-03 19:34:39 +00:00
Konstantin Shcheglov 572c0c3cee Issue 50104. Report when a const Set element or Map key have non-primitive '=='.
Bug: https://github.com/dart-lang/sdk/issues/50104
Change-Id: Ia60fde7873c3cce27cbb46d45087b0e57b42d42f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/262127
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2022-10-03 19:07:15 +00:00
dependabot[bot] 23b0ac68b2 Bump ossf/scorecard-action from 2.0.3 to 2.0.4
Closes https://github.com/dart-lang/sdk/pull/50109

GitOrigin-RevId: d6b888ae5ea3c3bfaa0491cfba1e8c5c64869ee6
Change-Id: Idd12a8e20b928d6cbe5613983d82875a7b5205b8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/262380
Reviewed-by: Alexander Thomas <athom@google.com>
2022-10-03 18:34:57 +00:00
dependabot[bot] 285ea50bd1 Bump github/codeql-action from 2.1.24 to 2.1.26
Closes https://github.com/dart-lang/sdk/pull/50108

GitOrigin-RevId: b0fe550215a883a10f9423e9be856e6d38fee5fe
Change-Id: I680c4e2aa417c75a5d91e73f50fb5c199e055e64
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/262362
Reviewed-by: Alexander Thomas <athom@google.com>
2022-10-03 18:34:06 +00:00
Sigmund Cherem 5828f1be7f [dart2js] prepare no_such_method_registry.dart
Change-Id: I9f217a257e4a2ed6d16b98b4b85f41c216c6e1ff
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/262279
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Nate Biggs <natebiggs@google.com>
2022-10-03 17:49:56 +00:00
Sigmund Cherem c41cec8f50 [dart2js] migrate world.dart
Change-Id: Ib0bc169bc58675e9202a35fd232cf24f1dfac1e7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/262278
Reviewed-by: Nate Biggs <natebiggs@google.com>
2022-10-03 17:49:56 +00:00
Sigmund Cherem 9768f74c59 [dart2js] migrate resolution_listener.dart
Change-Id: I4fcb759ce8b65a59952506ff83462b92859c13eb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/262275
Reviewed-by: Nate Biggs <natebiggs@google.com>
2022-10-03 17:49:56 +00:00
Sigmund Cherem 7ab05daa4b [dart2js] prepare resolution_listener.dart
Change-Id: Ic69113e3640985283dc5ba292b060b9bdbe229d5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/262274
Reviewed-by: Nate Biggs <natebiggs@google.com>
2022-10-03 17:49:56 +00:00
Konstantin Shcheglov b861b0c1e1 Issue 50096. Use Glob with the parent Folder.
Bug: https://github.com/dart-lang/sdk/issues/50096
Change-Id: I777364acd34e0ad248d4d99a31f45315487557e3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/262269
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2022-10-03 16:37:18 +00:00
Konstantin Shcheglov 998daf1fc1 Issue 50103. Report equal record typed const Set elements, Map keys.
Bug: https://github.com/dart-lang/sdk/issues/50103
Change-Id: Id8c709ca2cccadb517932097dec0d4224085f597
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/262361
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2022-10-03 16:27:13 +00:00
Johnni Winther 00f85bbb6c [vm,wasm] Share patch libraries
This shares patch libraries between vm and wasm.

The shared libraries are those previously shared as parts, except
the libraries that need private access to other patch libraries.

Change-Id: I69598a0d2ede5138e9ce33fb59dfa46c987eb38a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/262320
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Aske Simon Christensen <askesc@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2022-10-03 15:50:19 +00:00
Dan Chevalier 003ea967a5 Bump DevTools DEP to 2.18.0
Change-Id: I2982ddd363d46fcb1bbb3f8137f89a0cb83178f1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/262400
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2022-10-03 15:33:04 +00:00
Danny Tuppeny 8941837fb7 [analysis_server] Prevent "Extract Method" refactor showing up for function declarations
Fixes https://github.com/Dart-Code/Dart-Code/issues/4165.

Change-Id: I799220fffabfa39af1b2fd3039cb2de903f90c72
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/262348
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2022-10-03 15:08:48 +00:00
Martin Kustermann aa4339a9f3 Allow tab-completion of commands, expression types and named sets
This CL extends the heapsnapshot analysis CLI with tab-completion support
for commands, options, filenames, expression types and named sets.

This makes it much more comfortable to use the tool.

TEST=runtime/tools/heapsnapshot/test/completion_test

Change-Id: Iea48b4bd12651a60add6206a92ce06823cbd754a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/262243
Reviewed-by: Tess Strickland <sstrickl@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2022-10-03 14:58:58 +00:00
Martin Kustermann f7808a1aeb [gardening] Ensure unboxed fields are considered non-nullable with concrete cid.
Closes https://github.com/dart-lang/sdk/issues/50110

TEST=vm/dart{,_2}/regression_50110_test

Change-Id: I2f0c06febf55dbf20ca96213a0c5941c2f3ef1a8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/262344
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2022-10-03 12:36:18 +00:00
Daco Harkes b113fffb65 Reland "[vm/ffi] Throw on returning Error in Handle"
Fix: Check handle contents for Smi.
Closes: https://github.com/flutter/flutter/issues/112726

Orignal CL description:

Makes `Dart_Handle` FFI returns behave as the following snippet:

```
Dart_Handle ExampleSnippet() {
  Dart_Handle result = ...;
  if (Dart_IsError(result)) {
    Dart_PropagateError(result);
  }
  return result;
}
```

Also makes FFI consistent with Dart_NativeFunctions, which will
automatically throw upon return if Dart_SetReturnValue set the result
to an error.

`UnhandledExceptions` cannot flow out into Dart generated code. So,
the implementation needs to be in `FfiCallInstr::EmitNativeCode`.

Using `Dart_IsError` is slow compared to a machine code class id
check. So, we should do the handle unwrapping and class id check in
machine code.

Unwrapping Handles in machine code is only safe when the GC is
guaranteed to not run: Either (1) in `kThreadInGenerated`, or (2) in
`kThreadInNative`, but only when transitioned into safepoint. So, the
handle cannot be unwrapped immediately after the FFI call in machine code. We first need to transition back to generated.

This means we need to transition again to native to do the actual
`Dart_PropagateError` call. We can do so without the stub in JIT
because we never return with normal control flow.

Performance impact of this change is within benchmark noise in both
JIT and AOT.
Size impact is 42 bytes on x64, which is 10% in AOT and 12% in JIT.

For more numbers see: go/dart-ffi-handle-error

TEST=runtime/bin/ffi_test/ffi_test_functions_vmspecific.cc
TEST=tests/ffi/vmspecific_handle_test.dart

Closes: https://github.com/dart-lang/sdk/issues/49936
Change-Id: Id8edfd841a7d6246438386007d83747868a0a151
Cq-Include-Trybots: luci.dart.try:vm-canary-linux-debug-try,vm-ffi-android-debug-arm64c-try,vm-ffi-android-debug-arm-try,vm-kernel-gcc-linux-try,vm-kernel-linux-debug-x64-try,vm-kernel-linux-debug-x64c-try,vm-kernel-msvc-windows-try,vm-kernel-optcounter-threshold-linux-release-x64-try,vm-kernel-precomp-asan-linux-release-x64-try,vm-kernel-precomp-linux-debug-x64-try,vm-kernel-reload-linux-debug-x64-try,vm-kernel-reload-rollback-linux-debug-x64-try,vm-kernel-tsan-linux-release-x64-try,vm-kernel-win-debug-x64-try,vm-kernel-win-debug-ia32-try,vm-precomp-ffi-qemu-linux-release-arm-try,vm-precomp-ffi-qemu-linux-release-riscv64-try,vm-kernel-linux-debug-ia32-try,vm-kernel-mac-release-arm64-try,vm-kernel-precomp-win-debug-x64c-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/262342
Reviewed-by: Martin Kustermann <kustermann@google.com>
Auto-Submit: Daco Harkes <dacoharkes@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
2022-10-03 12:25:08 +00:00
Johnni Winther 2c3b2e2c45 [cfe] Pass --no-sound-null-safety explicitly
This prepares for changing sound null safety default.

Closes https://github.com/dart-lang/sdk/issues/50102

Change-Id: I88aa7994dd5542895c829d7777dd42d3b9438a29
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/262321
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
2022-10-03 11:52:58 +00:00
Jens Johansen 92b97fe6fb [parser] Field formal parameter with explicit record type
Fixes https://github.com/dart-lang/sdk/issues/50007

Change-Id: I4cce2fd49db9a71b344d5d3e3ea1e0a941a434ca
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/262200
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2022-10-03 07:14:26 +00:00
Paul Berry 06847c34fb Adjust patterns parsing tests to follow analyzer conventions
See test naming conventions here:
https://github.com/dart-lang/sdk/blob/main/pkg/analyzer/doc/implementation/tests.md

This is a rename-only change; this is not clear from the diff due to
sort order changes.

Change-Id: Ia84ca7b188f4bb21f8cfce60e037be792adcdc87
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/262022
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2022-10-02 16:38:50 +00:00
Zach Anderson 2742d90033 Revert "[vm/ffi] Throw on returning Error in Handle"
This reverts commit d9c442bce8.

Reason for revert: https://github.com/flutter/flutter/issues/112726

Original change's description:
> [vm/ffi] Throw on returning `Error` in `Handle`
>
> Makes `Dart_Handle` FFI returns behave as the following snippet:
>
> ```
> Dart_Handle ExampleSnippet() {
>   Dart_Handle result;
>   if (Dart_IsError(result)) {
>     Dart_PropagateError(result);
>   }
>   return result;
> }
> ```
>
> Also makes FFI consistent with Dart_NativeFunctions, which will
> automatically throw upon return if Dart_SetReturnValue set the result
> to an error.
>
> `UnhandledExceptions` cannot flow out into Dart generated code. So,
> the implementation needs to be in `FfiCallInstr::EmitNativeCode`.
>
> Using `Dart_IsError` is slow compared to a machine code class id
> check. So, we should do the handle unwrapping and class id check in
> machine code.
>
> Unwrapping Handles in machine code is only safe when the GC is
> guaranteed to not run: Either (1) in `kThreadInGenerated`, or (2) in
> `kThreadInNative`, but only when transitioned into safepoint. So, the
> handle cannot be unwrapped immediately after the FFI call in machine code. We first need to transition back to generated.
>
> This means we need to transition again to native to do the actual
> `Dart_PropagateError` call. We can do so without the stub in JIT
> because we never return with normal control flow.
>
> Performance impact of this change is within benchmark noise in both
> JIT and AOT.
> Size impact is 42 bytes on x64, which is 10% in AOT and 12% in JIT.
>
> For more numbers see: go/dart-ffi-handle-error
>
> TEST=runtime/bin/ffi_test/ffi_test_functions_vmspecific.cc
> TEST=tests/ffi/vmspecific_handle_test.dart
>
> Closes: https://github.com/dart-lang/sdk/issues/49936
> Change-Id: Ie8fabeb6d53bc80689541bc4470cb37ee2200581
> Cq-Include-Trybots: luci.dart.try:vm-canary-linux-debug-try,vm-ffi-android-debug-arm64c-try,vm-ffi-android-debug-arm-try,vm-kernel-gcc-linux-try,vm-kernel-linux-debug-x64-try,vm-kernel-linux-debug-x64c-try,vm-kernel-msvc-windows-try,vm-kernel-optcounter-threshold-linux-release-x64-try,vm-kernel-precomp-asan-linux-release-x64-try,vm-kernel-precomp-linux-debug-x64-try,vm-kernel-reload-linux-debug-x64-try,vm-kernel-reload-rollback-linux-debug-x64-try,vm-kernel-tsan-linux-release-x64-try,vm-kernel-win-debug-x64-try,vm-kernel-win-debug-ia32-try,vm-precomp-ffi-qemu-linux-release-arm-try,vm-precomp-ffi-qemu-linux-release-riscv64-try,vm-kernel-linux-debug-ia32-try,vm-kernel-mac-release-arm64-try,vm-kernel-precomp-win-debug-x64c-try
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/261603
> Reviewed-by: Ryan Macnak <rmacnak@google.com>
> Reviewed-by: Martin Kustermann <kustermann@google.com>
> Commit-Queue: Daco Harkes <dacoharkes@google.com>

TBR=kustermann@google.com,rmacnak@google.com,dacoharkes@google.com,dart-scoped@luci-project-accounts.iam.gserviceaccount.com

Change-Id: I94cc63de16b54db2b0a4f92759c39a1e569b8e63
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Cq-Include-Trybots: luci.dart.try:vm-canary-linux-debug-try,vm-ffi-android-debug-arm64c-try,vm-ffi-android-debug-arm-try,vm-kernel-gcc-linux-try,vm-kernel-linux-debug-x64-try,vm-kernel-linux-debug-x64c-try,vm-kernel-msvc-windows-try,vm-kernel-optcounter-threshold-linux-release-x64-try,vm-kernel-precomp-asan-linux-release-x64-try,vm-kernel-precomp-linux-debug-x64-try,vm-kernel-reload-linux-debug-x64-try,vm-kernel-reload-rollback-linux-debug-x64-try,vm-kernel-tsan-linux-release-x64-try,vm-kernel-win-debug-x64-try,vm-kernel-win-debug-ia32-try,vm-precomp-ffi-qemu-linux-release-arm-try,vm-precomp-ffi-qemu-linux-release-riscv64-try,vm-kernel-linux-debug-ia32-try,vm-kernel-mac-release-arm64-try,vm-kernel-precomp-win-debug-x64c-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/262270
Reviewed-by: Zach Anderson <zra@google.com>
Reviewed-by: Liam Appelbe <liama@google.com>
Commit-Queue: Zach Anderson <zra@google.com>
2022-09-30 21:51:59 +00:00
Sergey G. Grekhov cb45aa8a93 [co19] Roll co19_2 to bb3d5399f6335011231cd57b127748bee81f2b40
2022-09-30 sgrekhov22@gmail.com Fixes dart-lang/co19#1478. Failures of the new co19_2 roll fixed. (dart-lang/co19#1480)
2022-09-28 sgrekhov22@gmail.com dart-lang/co19#195. RawDatagramSocket tests fixed (dart-lang/co19#1465)
2022-08-31 sgrekhov22@gmail.com dart-lang/co19#1405. Don't use deprecated API in co19_2 tests (dart-lang/co19#1409)
2022-08-31 sgrekhov22@gmail.com dart-lang/co19#1405. co19_2. BytesBuilder tests moved from dart:io to dart:typed_data (dart-lang/co19#1411)
2022-08-23 sgrekhov22@gmail.com dart-lang/co19#1394. Add missing compile-error (dart-lang/co19#1397)
2022-08-03 sgrekhov22@gmail.com dart-lang/co19#1129. In case of DIRECT connection don't expect any proxy routine called (dart-lang/co19#1385)
2022-07-29 sgrekhov22@gmail.com dart-lang/co19#673. IFrame tests that don't actually test IFrame removed (dart-lang/co19#1381)
2022-07-27 sgrekhov22@gmail.com Fixes dart-lang/co19#1376. Broken co19_2 test fixed (dart-lang/co19#1377)
2022-07-12 sgrekhov22@gmail.com Fixes dart-lang/co19#1356. Add analyzer errors on references to not included library parts (dart-lang/co19#1359)
2022-07-05 sgrekhov22@gmail.com Fixes dart-lang/co19#1309. Update error expectations according to the current behavior (dart-lang/co19#1351)
2022-07-04 sgrekhov22@gmail.com Fixes dart-lang/co19#1343. Use correct 'part' and 'part of' directives (dart-lang/co19#1350)
2022-07-01 sgrekhov22@gmail.com Fixes dart-lang/co19#1313. Pre-nnbd tests for focus_A01_t01 and blur_A01_t01 updated to their version in master (dart-lang/co19#1345)

Change-Id: Iec8355f25b2c87b3dd83d84d2bab95812bbd0686
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/262204
Reviewed-by: Alexander Thomas <athom@google.com>
Commit-Queue: Alexander Thomas <athom@google.com>
2022-09-30 21:12:33 +00:00
Joshua Litt 29de68d38e [dart2wasm] Correctly handle null when jsifying maps.
Change-Id: Ibda04bf6012447dcab86079da8d4d41771e8e9bc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/262102
Commit-Queue: Joshua Litt <joshualitt@google.com>
Reviewed-by: Srujan Gaddam <srujzs@google.com>
2022-09-30 21:09:29 +00:00
Konstantin Shcheglov 577e34df43 Report MISSING_VARIABLE_PATTERN for SwitchStatement with SwitchPatternCase(s).
Change-Id: Iefec21f16fc85467ba2c8ad7b34cbe7438c3d025
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/262264
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2022-09-30 20:53:29 +00:00
Brian Wilkerson 578e350fd4 Reduce the use of streams in data-driven fixes
In addition to making the code cleaner, I expect that this will also
improve performance. Unfortunately, we don't have anything in place to
measure or monitor the performance of correction producers, so I can't
prove that.

Change-Id: Iac640c57ccafe68ef522fd3fe807abc4f66f6a86
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/262263
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2022-09-30 19:31:48 +00:00
Kallen Tu 646886c968 Type Socket in _HttpConnection to avoid dynamic invocations.
Change-Id: I55b4312dcf6f2af79f183f21b8d2722f62f0aece
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/258515
Reviewed-by: Nate Bosch <nbosch@google.com>
Commit-Queue: Kallen Tu <kallentu@google.com>
2022-09-30 19:29:56 +00:00
Konstantin Shcheglov c73228abaf Report an error when a variable pattern binds in one branch of logical-or, but not in another.
Only check for if-case is implements for now.

Change-Id: I57d1b8b33fbe2bf7adc848b5d607ff99b878b479
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/262101
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
2022-09-30 18:53:26 +00:00
Brian Wilkerson 74a5cf758f Enhance create-local-variable to work with records
Change-Id: Iedbcdebe79b3c4ef2ce1205fb7605c1106ac852d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/262262
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2022-09-30 18:24:16 +00:00
Joshua Litt c6b141e9e5 [dart2wasm] Fix bug in dartify.
Change-Id: Ia922d3ac6e3849db13877259c65c7d8d884c5828
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/262100
Commit-Queue: Joshua Litt <joshualitt@google.com>
Reviewed-by: Srujan Gaddam <srujzs@google.com>
2022-09-30 18:14:07 +00:00
Brian Wilkerson 53447c990f Enhance add-type-annotation to handle record types
Change-Id: I684820c9368f282039a93f34571afb014fb476a1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/262260
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2022-09-30 17:04:46 +00:00
Brian Wilkerson 06c5592b9c Enhance change-type-annotation to support record types
Change-Id: Ib5bbdec16c88858cda4f1739ad92a4c68e598a6d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/262261
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2022-09-30 17:04:16 +00:00