Commit graph

90403 commits

Author SHA1 Message Date
Jake Macdonald 41bc0b4d07 opt assignable_expression_test into 2.19
opt switch related tests back to 2.19
opt map/set hashCode override tests back to 2.19

Change-Id: Ib5c44fc17de43eaf9bcad71d7a326c5fcbff02bf
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/285800
Auto-Submit: Jake Macdonald <jakemac@google.com>
Reviewed-by: Bob Nystrom <rnystrom@google.com>
Commit-Queue: Jake Macdonald <jakemac@google.com>
2023-02-27 22:48:51 +00:00
Konstantin Shcheglov a4687a0e2b Issue 50502. Fix a couple of analyzer unit tests.
Bug: https://github.com/dart-lang/sdk/issues/50502
Change-Id: I1299a4fadaffae9b319ca0db1d2629a27a4775b7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/285702
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2023-02-27 22:45:40 +00:00
Ryan Macnak 854dc20416 [vm, compiler] Use ARMv8.1 AMOs in the write barrier stub on Mac.
Cf. 1af37bd92a.

TEST=ci
Change-Id: I61186646ef2aab69d8ffac36073829d5cc865408
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/284547
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2023-02-27 22:26:36 +00:00
Konstantin Shcheglov 4487154430 Use better helpers to find elements in SearchTest.
Change-Id: I5b0be691462465dc93a297592f4b6d0049298b1b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/285101
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2023-02-27 22:15:09 +00:00
Danny Tuppeny ae47cbfb5d [analysis_server] Support patterns in element references search
Change-Id: I303260c865c70691e0c7723b92c2ee7f09038310
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/282664
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2023-02-27 22:14:46 +00:00
Konstantin Shcheglov 8c72cb409b Remove assert() from convertPatternToSpace()
It fails in analyzer tests that cover invalid code.

Change-Id: Iae7d2cab6ee8a86eaf8bc861b38f0e1924dda9d1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/285820
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2023-02-27 21:59:37 +00:00
Danny Tuppeny eb038ce4a4 [analysis_server] Match VS Code behaviour when sorting/applying LSP edits in tests
Change-Id: If246069eee11eb8ed17fe21910840e4bd35a631a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/285740
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2023-02-27 21:54:51 +00:00
Derek Xu 14af4fac49 [VM] Implement GetCurrentThreadName() on Android
TEST=I recorded a trace using the Perfetto recorder on an Android device and ensured that the "DartDev Runner" track name was correct.

Change-Id: I87ef31ff5b4d7817e77536430cf474cf34c22678
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/279200
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Derek Xu <derekx@google.com>
2023-02-27 21:24:47 +00:00
Derek Xu 67f3e1f4a0 [VM/Service] Add support for class modifiers
TEST=CI

Fixes https://github.com/dart-lang/sdk/issues/50742
Fixes https://github.com/dart-lang/sdk/issues/50743
Fixes https://github.com/dart-lang/sdk/issues/51296
Fixes https://github.com/dart-lang/sdk/issues/51297
Change-Id: I52de34219883ca8680b1a8968ac9f4183fc5e970
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/285360
Commit-Queue: Derek Xu <derekx@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2023-02-27 21:07:41 +00:00
Devon Carew cf60e70356 [deps] rev cli_util, crypto, test, vector_math, webdev
Revisions updated by `dart tools/rev_sdk_deps.dart`.

cli_util (fd38b5f..3851652):
  3851652  2023-02-24  Kevin Moore  Move to dart_flutter_team_lints, require Dart 2.19 (#77)
  705bb29  2023-02-24  Kevin Moore  blast_repo fixes (#76)

crypto (03eb2c9..9efb888):
  9efb888  2023-02-23  Kevin Moore  move to pkg:dart_flutter_team_lints, require Dart 2.19 (#141)

test (2cc4144..1307cc5):
  1307cc59  2023-02-23  Nate Bosch  Add ComparableChecks extension (#1960)
  66f2985c  2023-02-24  Pascal Welsch  Fix isNotEmpty rejection (#1959)
  cf10dc5b  2023-02-23  Nate Bosch  Condition must have dynamic generic in deepEquals (#1958)
  6fc48d03  2023-02-23  Nate Bosch  Fix timeouts when a predicate throws instead (#1957)

vector_math (920e9b6..1e4d000):
  1e4d000  2023-02-23  Kevin Moore  Move to latest team lints, require Dart 2.19 (#281)

webdev (1e7f9b7..deb801b):
  deb801b  2023-02-24  Devon Carew  contribute issue templates and pull request labeling (#1979)
  74a6520  2023-02-24  Elliott Brooks (she/her)  [MV3 Debug Extension] Use new Dart Debug Extension bug template (#1992)
  c1f325c  2023-02-24  Elliott Brooks (she/her)  [MV3 Debug Extension] Bolt debugging: can reload the page and continue to debug (#1991)
  057f598  2023-02-23  Elliott Brooks (she/her)  [MV3 Debug Extension] Small fixes for building the extension (#1990)
  28a090e  2023-02-23  Anna Gringauze  Run dwds tests in a copy of the sdk directory (#1989)
  b58d3eb  2023-02-23  Anna Gringauze  Run webdev tests in a copy of the sdk directory (#1987)

Change-Id: Iaad67eec68cf3cfeba832abbeb42728043e15b22
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/285760
Auto-Submit: Devon Carew <devoncarew@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2023-02-27 21:07:29 +00:00
Ryan Macnak 1d0146984c [infra] Add configurations to migrate Linux ARM64 to NNBD.
Change-Id: Iafe32528a4516817d6770e5e87686c97bd58da8e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/285160
Reviewed-by: Alexander Thomas <athom@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2023-02-27 18:40:28 +00:00
Derek Xu 7424295ce9 [VM] Begin supporting Perfetto file recorder
This CL adds the `TimelineEventPerfettoFileRecorder` class, which is a
timeline recorder that writes a trace to file in Perfetto's proto
format. This CL supports the recording of all types of timeline events
except flow events. Support for flow events will be added in a future
CL.

TEST=Recorded traces with the Perfetto file recorder and explored them
in Perfetto's trace viewer, CI

Change-Id: Iaa2051e536589a473c5e15f9de9bb9c251f13d38
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/278942
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Derek Xu <derekx@google.com>
2023-02-27 18:37:48 +00:00
Jake Macdonald 0ac2d98e29 prep dart_fuzz for Dart 3.0
see https://github.com/dart-lang/language/blob/master/accepted/future-releases/0546-patterns/feature-specification.md#breaking-existing-switches

Change-Id: I008c280e0b2c453d704dfad7db4c18d39af745f8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/285720
Auto-Submit: Jake Macdonald <jakemac@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Jake Macdonald <jakemac@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
2023-02-27 18:19:28 +00:00
Ryan Macnak 7c0a694668 [vm] Avoid a second map lookup when dispatching isolate messages.
- Use the currently-unused ReceivePort.handler field instead of a second map.
 - Recognize ReceivePort's fields instead of using natives.

This also has the effect that if one discovers that a port handler is holding onto a large amount of memory via its context, the receive port along with its debug name will appear in the retaining path.

TEST=ci
Change-Id: I4b8d0764a41729a3b397b85bc4603e4d6b0ca9a7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/285403
Reviewed-by: Liam Appelbe <liama@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2023-02-27 18:08:25 +00:00
Paul Berry 7e5297e5f8 Enable the fallback exhaustiveness algorithm (with improvements).
This change improves the fallback exhaustiveness algorithm so that it
also takes advantage of the old, pre-patterns exhaustiveness logic for
enums.  This ensures that the fallback exhaustiveness algorithm won't
seem like a regression to users who are used to the old pre-patterns
behaviour.  This required extending the old algorithm to handle
new-style switch statements (which have a different representation
from classic switch statements in the CFE) as well as switch
expressions.

We also turn on the fallback exhaustiveness algorithm by default.
Unit tests can still disable it by temporarily setting the global
variable `useFallbackExhaustivenessAlgorithm` to `false`.

The hope is that this algorithm will be short-lived; we are just using
it so that if we decide to enable pattern support in the near future,
users will experience something that is sound.  That is, it may
require `default` or `_` cases more often than is strictly necessary,
but it shouldn't ever allow a non-exhaustive switch in a place where
an exhaustive switch is required.

Change-Id: I4a8b7f996b109c4ee8832f286c3b3bf3b216fe8b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/284840
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2023-02-27 17:36:02 +00:00
Paul Berry c9d4861104 dev_compiler: prep for enabling patterns feature.
Change-Id: I08f2cc23ffd518e23cf8d395884c5e51db26a811
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/285340
Reviewed-by: Bob Nystrom <rnystrom@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
2023-02-27 17:17:42 +00:00
Derek Xu 9a6c8ed50b [VM/Service] Fix accessors of fields of simple types in generated Java classes
TEST=Modified VmServiceTest.java locally to make it exercise
BoundField.getName()

Fixes https://github.com/dart-lang/sdk/issues/51514
Change-Id: I232d98a2efffbaf82a0101a20405f48fe4ba03d9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/285700
Commit-Queue: Derek Xu <derekx@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2023-02-27 16:51:26 +00:00
Daco Harkes ba2baa5e55 [vm/kernel_service] Fix native_assets.yaml discovery
Before this CL, the kernel_service was recursing one level up to find
a `.dart_tool/native_assets.yaml` due to a typo.

This tests adds a unit test to cover the discovery.
TEST=pkg/vm/test/kernel_service_test.dart

This CL also undoes a spurious change in another test.

Change-Id: Ie7440a2768f8cd6c1195cf31863c8a7fff29e394
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/285681
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
2023-02-27 16:49:25 +00:00
Danny Tuppeny 88d277a534 [analysis_server] Split InlayHints up for type arguments
This allows each type to be hovered (to see dartdocs) or used for navigation individually.

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

Change-Id: I93f520a49e05eb59074215dd9c0773cd50415cfe
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/285625
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2023-02-27 16:27:15 +00:00
Alexander Markov b285115893 [tests] Fix expectations in language/async_star/async_star_await_for_test
According to the language specification:
1) When 'break' is executed in the 'await for' loop (in 'main'),
the underlying stream subscription is canceled.
2) When async* function ('consume') has stopped at 'yield' or 'yield*',
and the stream is canceled, the 'yield' / 'yield*' statement returns
without an object. It also means that code in 'consume()' after
the loop is not executed and it doesn't append ")" to the log.
So the test expectations are fixed to avoid expecting trailing ")"
at the log when there is a 'break' out of the 'await for' loop.

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

Change-Id: Ia59e87ef84dcb8a0c06a47f497cc97d4c6635d27
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/285343
Reviewed-by: Lasse Nielsen <lrn@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2023-02-27 16:25:50 +00:00
Johnni Winther 3c4ca52b2f [_fe_shared_analyzer] Handle remaining patterns in exhaustiveness
This adds explicit handling of the remaining patterns in exhaustiveness.
All these patterns are handled trivially but with TODOs for where we might
want to improve handling.

Asserts are added to flag if a pattern is unhandled.

Change-Id: I82bfccda396316c718685b4d810f259c25771f00
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/285321
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2023-02-27 14:51:50 +00:00
Johnni Winther b38b33681b [_fe_analyzer_shared] Support null check pattern in exhaustiveness
Change-Id: I6e50510f046d8df8f1c987d44dd33c0e4db39d7e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/285300
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2023-02-27 11:41:56 +00:00
Johnni Winther 5e8fd90520 [_fe_analyzer_shared] Support unions in exhaustiveness algorithm
This adds support for union directly in the exhaustiveness algorithm
meaning that we can support deeply nested or-patterns without having
to eagerly expand the patterns.

For instance, without support for unions,

  case (true || false, true || false):

would have to be expanded to

  case (true, true):
  case (true, false):
  case (false, true):
  case (false, false):

before performing exhaustiveness.

Now, we instead perform the expansion in-place and only we need to.
That is, when filtering by subtype `true` of `bool`, we only consider
the row

  (true, true || false)

as remaining, because the row

  (false, true || false)

won't match anyway.

Change-Id: I1a6402bd21b81bf40924ac0048b683936ce9f608
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/285263
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2023-02-27 09:28:33 +00:00
Johnni Winther 3c7fe84e05 [cfe] Add MapPatternRestEntry
This replaces the `restMapPatternEntry` sentinel value.

Change-Id: I46b05a62125e95c732f7f6ecfd3f2c1ed8292af3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/285620
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
2023-02-27 09:14:37 +00:00
Chloe Stefantsova 574e12d0f5 [cfe] Support pattern entry-to-element conversion in type inference
Part of https://github.com/dart-lang/sdk/issues/49749

Change-Id: I5a227763225eda6a8154591fa35aa7cc66c0050a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/285320
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Chloe Stefantsova <cstefantsova@google.com>
2023-02-26 22:15:38 +00:00
Chloe Stefantsova c8f07e6387 [cfe] Remove outdated null check to allow for-in pattern entries
Part of https://github.com/dart-lang/sdk/issues/49749

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

Change-Id: I1e598f8742a271e63023f95122d8166204721aeb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/284920
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Chloe Stefantsova <cstefantsova@google.com>
2023-02-26 19:13:08 +00:00
Slava Egorov e5ea38a757 Revert "[vm/compiler] Split ParallelMove codegen into scheduling and emission"
This reverts commit 32b093379b.

Reason for revert: various test failures across the board.

Original change's description:
> [vm/compiler] Split ParallelMove codegen into scheduling and emission
>
> This CL does not contain any changes to behaviour, but simply moves
> ParallelMoveResolver to a separate file. Additionally instead of
> immediately generating code we produce a move schedule which is
> attached to the ParallelMoveInstr and later converted to the
> native code.
>
> This refactoring prepares the code for subsequent improvements, e.g.
> we want to rework how temporaries used by move resolution are
> allocated: instead of pushing/poping them around every move that needs
> them we will allocate space for them in spill area.
>
> Having ParallelMove scheduling separated from code emission also
> allows to unit test it.
>
> TEST=ci
>
> Change-Id: If3f7a88836037a9812a85c1cfc2ef21a7fe15747
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/284222
> Commit-Queue: Slava Egorov <vegorov@google.com>
> Reviewed-by: Alexander Markov <alexmarkov@google.com>
> Reviewed-by: Martin Kustermann <kustermann@google.com>

Change-Id: I82952d024816327ca5f084a2185fa1ab566cfa82
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/285560
Auto-Submit: Slava Egorov <vegorov@google.com>
Commit-Queue: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
2023-02-25 22:03:08 +00:00
Danny Tuppeny 12b606e9e9 [analysis_server] Fix ordering of edits that include multiple inserts at the same location
While testing "Move to File" I found the file header was being inserted at the bottom of the document in VS Code, despite the tests working correctly.

This turned out to be because we were sending edits in the same order as server generates (which are designed to be applied sequentially, so they are essentially reversed) on the assumption that order doesn't matter to LSP. This is not correct for inserts with the same offset - those are expected to appear in-order.

Because our tests also just applied the edits in reverse-order, they passed but didn't match the behaviour in VS Code.

This change reverses the order of edits when mapping to LSP (so same-offset inserts are back in "forwards order") and also updates the tests to re-sort in an order that matches VS Code's behaviour.

Change-Id: I40d6be6899e4f13dbff52f39fefb3bbd2caa3521
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/285500
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2023-02-25 18:48:30 +00:00
Vyacheslav Egorov 32b093379b [vm/compiler] Split ParallelMove codegen into scheduling and emission
This CL does not contain any changes to behaviour, but simply moves
ParallelMoveResolver to a separate file. Additionally instead of
immediately generating code we produce a move schedule which is
attached to the ParallelMoveInstr and later converted to the
native code.

This refactoring prepares the code for subsequent improvements, e.g.
we want to rework how temporaries used by move resolution are
allocated: instead of pushing/poping them around every move that needs
them we will allocate space for them in spill area.

Having ParallelMove scheduling separated from code emission also
allows to unit test it.

TEST=ci

Change-Id: If3f7a88836037a9812a85c1cfc2ef21a7fe15747
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/284222
Commit-Queue: Slava Egorov <vegorov@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2023-02-25 16:54:05 +00:00
asiva ba1d8bdbc0 [Runtime/VM] - Fix reachability test issues
- Skip test in product mode as the feature is not
		 supported
	       - Account for GCType::kEvacuate by moving state to
		 Heap::kSecondScavenge

TEST=ci

Change-Id: Iee3a07121d8c3121cdac4521958048c662ab5b5b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/285421
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Siva Annamalai <asiva@google.com>
2023-02-25 01:08:48 +00:00
Ryan Macnak 9b080cfddd [vm, compiler] Access spill slots on RISC-V using SP instead of FP.
SP-based loads and stores have compressed instructions for more source/destination registers and offsets than FP-based loads and stores.

dart2js.aot.rv64 27835216 -> 27311240 (-1.88%)
dart2js.aot.rv32 26917472 -> 26344120 (-2.13%)

TEST=ci
Change-Id: I2aa9c30eead5737dd36b831d287fac778fc2eced
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/242922
Reviewed-by: Slava Egorov <vegorov@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2023-02-25 00:53:54 +00:00
asiva a346af7b7a [VM/Runtime] - Fix ubsan warning.
TEST=ci

Change-Id: I9881db82771c51a1df8fe930fe2216ddf87f5746
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/285345
Commit-Queue: Siva Annamalai <asiva@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2023-02-24 23:01:28 +00:00
Konstantin Shcheglov c90821350e Issue 50672. Update flatten()
Bug: https://github.com/dart-lang/sdk/issues/50672
Change-Id: I2747b9c071aa0074f2b26cea33b8d0f11ac61e33
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/274734
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
2023-02-24 22:55:17 +00:00
Stephen Adams fd9e7cbbdb [js_runtime] Preambles: ensure self.window exists
This change makes `self.window` refer to `self` if undefined.
This makes @JS-interop access to properties of `window` work as expected for benchmarks derived from web apps.

To make feature-detection for the timer easier, a new property, `self.dartUseDateNowForTicks` can be set to force the runtime to use Date.now() over performance.now().

Change-Id: Ie3d68d466ccad6e8804014ee8099cea235b173c7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/285220
Reviewed-by: Joshua Litt <joshualitt@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2023-02-24 22:01:24 +00:00
Daco Harkes 579d964406 [test/ffi] Beef up @Native testing
We only tested a handful of native signatures for `@Native`s and
`@FfiNative`s. This CL duplicates the generated FFI call tests which
cover a lot of signatures to also run for `@Native`s.

Bug: https://github.com/dart-lang/sdk/issues/47625
Change-Id: I475f028c79e13470c2ea4e24040209a915631779
Cq-Include-Trybots: luci.dart.try:vm-kernel-precomp-nnbd-win-release-x64-try,vm-kernel-nnbd-win-debug-x64-try,vm-kernel-nnbd-mac-debug-x64-try,vm-kernel-nnbd-linux-debug-x64-try,vm-kernel-precomp-nnbd-mac-release-arm64-try,vm-kernel-precomp-nnbd-linux-debug-x64-try,vm-ffi-android-debug-arm-try,vm-ffi-android-debug-arm64c-try,vm-precomp-ffi-qemu-linux-release-riscv64-try,vm-precomp-ffi-qemu-linux-release-arm-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/284901
Reviewed-by: Martin Kustermann <kustermann@google.com>
2023-02-24 21:16:50 +00:00
Ahmed Ashour 39e1edfbcd [analysis_server] DataDriven replacedBy to replace an instance getter with a method
Fixes #50699

Change-Id: Ib0bfb1f3ce70f66fe4b2a46c3112ce8bf9fcd891
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/276060
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2023-02-24 20:59:30 +00:00
Srujan Gaddam 49f85335d5 Revert "[dart:js_interop] Add literal constructors for inline classes"
This reverts commit 1f6d4ae1a8.

Reason for revert: Broke Flutter with dart2wasm

Original change's description:
> [dart:js_interop] Add literal constructors for inline classes
>
> Adds @ObjectLiteral annotation to denote object literal constructors,
> and implements it in all the backends. For dart2js, this involves
> modifying the SSA and for dart2wasm, we create a one-per-shape
> forwarding procedure to a specialized JS method that returns the
> literal. This also modifies @anonymous semantics in dart2wasm to
> be consistent with the other backends.
>
> CoreLibraryReviewExempt: Backend-specific, just adding annotation.
> Change-Id: I4d7a9ea9ed097f4f378709b40f8bd74f02e26b23
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/283922
> Commit-Queue: Srujan Gaddam <srujzs@google.com>
> Reviewed-by: Joshua Litt <joshualitt@google.com>

Change-Id: Ifce611e1150d8aa275f9e312743bded56a572176
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/285342
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Reviewed-by: Joshua Litt <joshualitt@google.com>
Commit-Queue: Srujan Gaddam <srujzs@google.com>
2023-02-24 20:42:14 +00:00
Ryan Macnak 4b1efeb7aa [vm, compiler] Make more use of sh{1,2,3}add.
Cf. 138a69a150.

TEST=ci, local qemu
Change-Id: Ibb3de443058e6e935b536aa328d9e143d75350b6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/285102
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2023-02-24 20:33:08 +00:00
Ben Konyi a569f4a540 [ CLI ] Lockdown --no-sound-null-safety in dart compile subcommands
Related to https://github.com/dart-lang/sdk/issues/51513

Change-Id: Ie798af562133b933a76351b9e7244870ea49e6dd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/285380
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
2023-02-24 20:27:03 +00:00
Derek Xu 35e9a34c3f [VM/Service] Fix SERVICE_PROTOCOL_MINOR_VERSION
TEST=CI

Change-Id: I1e67c0a8f4148aac0f70f777eb8211cbb64044b1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/285401
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Derek Xu <derekx@google.com>
2023-02-24 19:05:01 +00:00
Ahmed Ashour d6ceee805e [observatory] remove dead code
Bug: #51401

TEST=ci

Change-Id: Idc680edc71bc0e6842f4539a9de2ed283ce7f0ef
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/283362
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2023-02-24 18:42:30 +00:00
Sam Rawlins 5a207ea99a [analyzer] Move 3 more HintCodes to be WarningCodes, UNUSED_LABEL, UNUSED_RESULT*
Bug: https://github.com/dart-lang/sdk/issues/50796
Change-Id: I2018fbff99bdc787402df01e54b7ef3d1018220d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/284740
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2023-02-24 15:52:27 +00:00
Sergey G. Grekhov 27cfabdac0 [co19] Roll co19 to 7b4f3e723211011878e185db6fa57fbafabd6bb7
2023-02-23 sgrekhov22@gmail.com Fixes dart-lang/co19#1878. Fix type inference in type_inference_A26_t01.dart (dart-lang/co19#1892)
2023-02-23 sgrekhov22@gmail.com dart-lang/co19#1401. Patterns execution. Assignment and switch statement tests (dart-lang/co19#1857)
2023-02-23 sgrekhov22@gmail.com dart-lang/co19#1401. Test for relational pattern with nullable type added (dart-lang/co19#1887)
2023-02-23 sgrekhov22@gmail.com Fixes dart-lang/co19#1890. Fix collection in scope_A02_t04.dart (dart-lang/co19#1891)
2023-02-23 sgrekhov22@gmail.com Fixes dart-lang/co19#1877. No compile-time error if type-test is failed in a refutable context (dart-lang/co19#1886)

Change-Id: I25d5fc2113bc1284bc5d90bd91874b77f541c472
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/285260
Reviewed-by: Alexander Thomas <athom@google.com>
2023-02-24 09:51:28 +00:00
Slava Egorov 0c32c7fc62 Revert "[vm] Remove quadratic-time Script::FindLibrary."
This reverts commit 262efd84fd.

Reason for revert: AOT builds in flutter-profile mode are failing with: 

    Unexpected object (Class with illegal cid, full-aot): 0x7f0f0426d321 Library:'package:flutter/src/widgets/overflow_bar.dart' Class: :: 

Original change's description:
> [vm] Remove quadratic-time Script::FindLibrary.
>
> TEST=ci
> Change-Id: Ic54c6ed65ceeca7af797a70cd68f495aa6b105c4
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/284548
> Commit-Queue: Ryan Macnak <rmacnak@google.com>
> Reviewed-by: Ben Konyi <bkonyi@google.com>

Change-Id: I2a1e824fbe31a2c9053e556a63e07c66aa3face1
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/285261
Commit-Queue: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Auto-Submit: Slava Egorov <vegorov@google.com>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
2023-02-24 07:45:06 +00:00
Ryan Macnak 262efd84fd [vm] Remove quadratic-time Script::FindLibrary.
TEST=ci
Change-Id: Ic54c6ed65ceeca7af797a70cd68f495aa6b105c4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/284548
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2023-02-24 04:09:12 +00:00
Ryan Macnak 8949974caf [vm] Remove unnecessary check for compaction from the profiler.
The PC marker slots are transiently invalid during a compaction, but the profiler's stack walker no longer uses them, as they are completely absent in bare instructions mode.

TEST=ci
Change-Id: I3dba373ccccaba48e6dcc2b01d48e5e75620a4db
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/284744
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2023-02-24 03:39:05 +00:00
Ryan Macnak 789a5061ac [vm] Remove redundant register check.
This was once necessary because we did not reliably discover the stack bounds.

TEST=ci
Change-Id: I56e81b5854f6b7313384363647a94340d7f904fc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/284743
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2023-02-24 00:02:26 +00:00
Kallen Tu cef1fab383 [tests] Avoid running backend tests on mixin_class_generative_constructor_error_test.
Change-Id: If1eaca1705f27f6a5df199e292a27d610e09495b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/285021
Commit-Queue: Kallen Tu <kallentu@google.com>
Reviewed-by: Bob Nystrom <rnystrom@google.com>
2023-02-23 22:53:18 +00:00
pq 188a4215a9 quick fix for one element record types missing trailing commas
Fixes: https://github.com/dart-lang/sdk/issues/51508

Change-Id: I11c1ce8b83143ff550481318ebf0a17a9781529f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/285100
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
2023-02-23 22:00:45 +00:00
Kallen Tu fe10dec12b [analysis_server] Avoid suggesting modified classes and mixins in contexts that don't make sense.
Change-Id: I0a5ebc1812998358d20a579d496ac3a26dec17fd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/284488
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Kallen Tu <kallentu@google.com>
2023-02-23 21:44:19 +00:00