Commit graph

20109 commits

Author SHA1 Message Date
Siva Annamalai dcaf392d34 Revert "[3.0 alpha][VM/Service] Update VM Service spec to v4.0"
This reverts commit c21f7c847c.

Reason for revert: Appears to cause issues when flutter app is launched with VSCode or Android Studio, please see https://github.com/flutter/flutter/issues/117526

Original change's description:
> [3.0 alpha][VM/Service] Update VM Service spec to v4.0
>
> This CL updates the VM Service spec to version 4.0 in order to add
> support for records. Some deprecated procedures and properties will also
> be removed in v4.0.
>
> As described in service.md's changelog, this CL:
> Adds `Record` and `RecordType` `InstanceKind`s, adds a deprecation
> notice to the `decl` property of `BoundField`, adds `name` property to
> `BoundField`, adds a deprecation notice to the `parentListIndex`
> property of `InboundReference`, changes the type of the `parentField`
> property of `InboundReference` from `@Field` to `@Field|string|int`,
> adds a deprecation notice to the `parentListIndex` property of
> `RetainingObject`, changes the type of the `parentField` property of
> `RetainingObject` from `string` to `string|int`, removes the deprecated
> `setExceptionPauseMode` procedure, removes the deprecated `timeSpan`
> property from `CpuSamples`, and removes the deprecated `timeSpan`
> property from `CpuSamplesEvent.
>
> TEST=CI
>
> Issue: https://github.com/dart-lang/sdk/issues/49725
> Change-Id: I7bf61c1ba11a0c7fd95a10c9c02c14282062b802
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/268521
> Commit-Queue: Derek Xu <derekx@google.com>
> Reviewed-by: Ben Konyi <bkonyi@google.com>

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

Issue: https://github.com/dart-lang/sdk/issues/49725
Change-Id: Ieb2a09653192e165ea8cf68965647e346e3a318b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/277181
Reviewed-by: Derek Xu <derekx@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
Auto-Submit: Siva Annamalai <asiva@google.com>
Commit-Queue: Siva Annamalai <asiva@google.com>
2022-12-22 20:19:00 +00:00
Alexander Aprelev 8e7b1119b3 [vm/reload] Ensure FileModifiedCallback can handle uris on Windows.
Bug: https://github.com/dart-lang/sdk/issues/49634
Change-Id: I65b5c2a0559fdc51c003ffa6e955008850137a1c
TEST=bad_reload_test on Windows
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/277044
Commit-Queue: Alexander Aprelev <aam@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
2022-12-21 23:11:30 +00:00
Alexander Aprelev 1071e3e068 [vm/isolate] Avoid isolate scan when exiting known isolate.
IsolateFibonacci before 3291867, after 3061103

Fixes https://github.com/dart-lang/sdk/issues/50789
TEST=benchmark/IsolateFibonacci

Change-Id: I667838c4ae089b9ac8889ae3eb3d773115437397
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/276760
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
2022-12-21 18:07:58 +00:00
Alexander Markov 81f0959372 [vm] Fix record instance layout with compressed pointers
After record shape representation changed in https://dart-review.googlesource.com/c/sdk/+/276201,
clang started to insert an extra alignment padding
between 'shape' and 'data' fields in record instances
in compressed pointers mode. This padding is not initialized
in the allocation stubs, but GC scans it as it falls between
'from' (shape) and 'to' (end of data). This change adjusts
layout of UntaggedRecord in compressed pointers mode to avoid
the implicit padding and GC visiting garbage.

TEST=Manual run of language/records/simple tests and
RecordCollections benchmark on x64c and simarm64c architectures.

Issue: https://github.com/dart-lang/sdk/issues/49719
Change-Id: I4b8a5b36c3ff757ccbbdb46c20d9ed8d12c53f96
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/276775
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
2022-12-21 16:07:03 +00:00
Brian Quinlan 9b2b9df09e [io] Remove incorrect docs that listSupport is not available on Android.
Bug:https://github.com/dart-lang/sdk/issues/47894
Change-Id: Id79a37f5ba6a8118a30d2297c95cff5a7ca1a03f
TEST=unit
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/276660
Commit-Queue: Brian Quinlan <bquinlan@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
2022-12-21 00:23:02 +00:00
Alexander Markov 51d672e77d [dartfuzz] Regenerate API and types tables
DartFuzz tables were regenerated to pick up the latest core library
additions and removals.

Change-Id: I549715aa5dd36bed7c04ee78e5908c923f1538be
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/276767
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2022-12-20 23:09:58 +00:00
Alexander Markov 3675fd25f4 [vm] Packed representation of record shape
The representation of record shape in record instances and record
types is changed from a pair

  int num_fields
  Array field_names

to a single integer - packed bitfield

  int num_fields(16)
  int field_names_index(kSmiBits-16)

where field names index is an index in the array available from
ObjectStore.

With the new representation of record shapes:
1) Size of record instances is reduced.
2) Number of comparisons for a shape test reduced from 2 to 1
(shape test is used during type checks).
3) A few operations removed from Record.hashCode.
4) Type testing stubs (TTS) are now supported for record types with
named fields. Previously it was not possible to check shape of records
with named fields in TTS as TTS cannot access object pool and cannot
load field names array).

TEST=existing

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

Change-Id: I7cdcbb53938aba5d561cd24dc99530395dbbea7e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/276201
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2022-12-20 20:11:48 +00:00
Josh Soref 1aeece5e31 Spelling runtime vm compiler
Closes https://github.com/dart-lang/sdk/pull/50784

Co-authored-by: Josh Soref 2119212+jsoref@users.noreply.github.com

TEST=ci
GitOrigin-RevId: dbb20e7ee532a3490e86a633b5164ebab54bd38d
Change-Id: I9bd29543c4417efd4f338ff1c0e45c4ddbcc044d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/276622
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Erik Ernst <eernst@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2022-12-20 17:01:52 +00:00
Alexander Aprelev 438b81c4f2 [vm/regexp] Share RegExp objects between isolates, keep isolate-specific state in static members.
Revert "[vm/regexp] Copy, rather than share RegExp objects between isolates." is in patchset 1.

Isolate RegEx-sharing benchmarks show 24-100x improvements.

Bug: https://github.com/dart-lang/sdk/issues/50639
TEST=ci
Change-Id: I87943c9b9928869f7a20052cb0dc71d24ad36087
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/276240
Commit-Queue: Alexander Aprelev <aam@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2022-12-20 02:28:04 +00:00
Derek Xu c21f7c847c [3.0 alpha][VM/Service] Update VM Service spec to v4.0
This CL updates the VM Service spec to version 4.0 in order to add
support for records. Some deprecated procedures and properties will also
be removed in v4.0.

As described in service.md's changelog, this CL:
Adds `Record` and `RecordType` `InstanceKind`s, adds a deprecation
notice to the `decl` property of `BoundField`, adds `name` property to
`BoundField`, adds a deprecation notice to the `parentListIndex`
property of `InboundReference`, changes the type of the `parentField`
property of `InboundReference` from `@Field` to `@Field|string|int`,
adds a deprecation notice to the `parentListIndex` property of
`RetainingObject`, changes the type of the `parentField` property of
`RetainingObject` from `string` to `string|int`, removes the deprecated
`setExceptionPauseMode` procedure, removes the deprecated `timeSpan`
property from `CpuSamples`, and removes the deprecated `timeSpan`
property from `CpuSamplesEvent.

TEST=CI

Issue: https://github.com/dart-lang/sdk/issues/49725
Change-Id: I7bf61c1ba11a0c7fd95a10c9c02c14282062b802
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/268521
Commit-Queue: Derek Xu <derekx@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2022-12-19 19:41:41 +00:00
Kallen Tu 7bd4aee94a [cfe] Add mixin class flag to dill and binary.
Additionally, make class flags a uint because there are now more than 8 flags.

TEST=pkg/front_end/testcases/mixin_class/*

Change-Id: I4fe7babfa9911df0821cc73528e6b10b2ea3b92d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/275402
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Kallen Tu <kallentu@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2022-12-16 19:12:59 +00:00
Nicholas Shahan 352ba74453 [3.0 alpha][core] Delete NullThrownError
TESTED=Ran CQ dryrun and approved failures for co19 tests that will be updated soon.

Change-Id: Ic0dc5fc084b1d0f3fce80dd88062f879abd7b556
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/275840
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Vijay Menon <vsm@google.com>
2022-12-16 17:46:48 +00:00
Daco Harkes 2435f0b398 [vm/ffi] Make elementAt an extension method
The CFE rewrite for structs, unions, and abi-specific integers is now
done on the extension methods.
The other native types are implemented in the extension methods
directly.

TEST=test/ffi

Closes: https://github.com/dart-lang/sdk/issues/50714
Change-Id: I578325733e3cd66200e80949d47ff12a13115b99
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/276102
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
2022-12-16 16:33:12 +00:00
Ryan Macnak 6d41f47d45 [vm, compiler] Decide how many Q registers are available based on target OS.
TEST=ci
Change-Id: Ieefb6d56a4110a9277c5f217a800c3297de8964e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/238383
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2022-12-15 18:05:31 +00:00
Nate Bosch f065dca391 Avoid permanently paused isolates
These tests have some exceptions caused by missing fields on the
dynamic variable. The exceptions cause the `isolate.resume()` call to
not run, which also cause the test body to not complete.

Currently this is masked by the test runner, which immediately ignores
the test body once the first error occurs. That behavior is changing,
and a failure will not immediately end a test when the body is still
running. https://github.com/dart-lang/test/pull/1815

Some of these tests are currently are expected to fail, but not to
timeout. Fix the test implementations to more reliably complete the test
body, even when the test had an error. This does not fix the tests
themselves, it maintains the current pattern of failure, even after
updating the test runner.

- Use `Stream.firstWhere` over cancelling the stream subscription after
  the first breakpoint.
- Use `Future.whenComplete` to ensure the isolate is always unpaused,
  including after an exception in the expectations.

Tested: Passes with updated test runner in https://dart-review.googlesource.com/c/sdk/+/275401/4
Change-Id: If5a7f0264c580cb38bcc1bd95c035aaf5644124b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/275787
Auto-Submit: Nate Bosch <nbosch@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Nate Bosch <nbosch@google.com>
2022-12-15 17:37:13 +00:00
Ryan Macnak f181b50249 [build] Address warnings in gcc 11 and 12.
TEST=local builds
Bug: https://github.com/dart-lang/sdk/issues/50645
Change-Id: If6cd26620feff06abd449be0f7d1dd1e620b8411
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/275841
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2022-12-15 17:36:39 +00:00
Alexander Aprelev ff2d661d5b [vm/compiler] Choose correct unboxed float representation for phi instructions.
BUG=https://github.com/dart-lang/sdk/issues/50622
TEST=FlowGraph_UnboxedFloatPhi

Change-Id: Ie7bfbb6c4028907a18243d44be8128999c1efcae
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/275180
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
2022-12-15 15:24:12 +00:00
Vyacheslav Egorov d02e1de5b1 [vm] Add Dart_SetDwarfStackTraceFootnoteCallback
This API allows embedder to append arbitrary footers to DWARF stack
traces. For example, embedder can append a link to a symbolizer
service, which could be used to symbolize the stack-trace.

TEST=manually tested, hard to create automatic tests because vm/cc tests  only support JIT, not AOT.

Bug: b/255741575
Change-Id: Id034b9b3194f7b91a8405574ea771c4a06fda2c2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/275700
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Slava Egorov <vegorov@google.com>
2022-12-15 13:45:10 +00:00
Jens Johansen dde72f78a2 [vm] Heap snapshot tool can load file from arguments
This CL allows the heap snapshot tool to load a file as it is launched
via a command like
```
../../../out/ReleaseX64/dart bin/explore.dart my_snapshot.heapsnapshot
```

Change-Id: I4eca4ec18daef4d3361c754018d234045e725ef5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/275860
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2022-12-15 12:31:45 +00:00
Michael Thomsen e4cc3c98e5 [3.0 alpha] Remove deprecated dart:core List() constructor.
TEST=ci

Bug: Contributes to https://github.com/dart-lang/sdk/issues/49529
Change-Id: Ic129ef2d89f625d9ec6a7a1c301cffddd60b2ff7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/258920
Reviewed-by: Lasse Nielsen <lrn@google.com>
Commit-Queue: Michael Thomsen <mit@google.com>
Reviewed-by: Slava Egorov <vegorov@google.com>
2022-12-15 11:36:22 +00:00
Alexander Markov 7ebd4dd61c [3.0 alpha] Remove deprecated public class CyclicInitializationError
This deprecated class cannot be removed just yet because
we still need to throw something in case of cyclic initialization
in Dart legacy libraries (which are still supported).

Class CyclicInitializationError is copied for each implementation
(VM, dart2js and DDC) and made private. Each implementation now has
an independent private class which can be removed separately.

TEST=ci
Issue: https://github.com/dart-lang/sdk/issues/49529
Change-Id: I8100bbe16636c12c4cbabbb5fe770f4c648c4249
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/275120
Commit-Queue: Michael Thomsen <mit@google.com>
Reviewed-by: Lasse Nielsen <lrn@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2022-12-15 11:20:58 +00:00
Ryan Macnak 78732b243e [vm] Fail describing errno if mmap fails for any reason except ENOMEM.
Avoids the VM later failing with a misleading "Out of Memory" message when allocation fails for lack of permission, etc.

TEST=ci
Bug: https://github.com/dart-lang/sdk/issues/50719
Change-Id: I52b2478092a5e5b59680f31d37ab3c6d6d816ba0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/275783
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2022-12-15 00:52:58 +00:00
Ryan Macnak 98af4110ad [vm] Increase supported range of TypeParameters to 16 bits.
TypeParameter::set_index was already asserting for 16 bits but silently truncating to 8 bits. The size of TypeParameter does not increase due to allocation rounding.

Add explicit range check to class finalization.

TEST=ci
Change-Id: Id4017f74b7dba47b00d64e77e787712c70290dac
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/275560
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2022-12-14 23:34:18 +00:00
Alexander Markov 987775d6fb [vm] Type testing stubs for record types
Benchmarks improved by:
JIT:
RecordCollections.ListAddPoly.Record ~9.6 times
RecordCollections.ListSetIndexed.Record ~8.3 times
RecordCollections.ListSetIndexedPoly.Record ~16.1 times
RecordCollections.MapAdd.RecordKey ~3.6 times
RecordCollections.MapAdd.RecordValue ~4.4 times
RecordCollections.SetAdd.Record ~4.1 times
AOT:
RecordCollections.ListAdd.Record ~8.7 times
RecordCollections.ListAddPoly.Record ~8.8 times
RecordCollections.ListSetIndexed.Record ~19.5 times
RecordCollections.ListSetIndexedPoly.Record ~18.3 times
RecordCollections.MapAdd.RecordKey ~7.1 times
RecordCollections.MapAdd.RecordValue ~8.8 times
RecordCollections.SetAdd.Record ~8.9 times

TEST=vm/cc/TTS_RecordSubtypeRangeCheck

Issue: https://github.com/dart-lang/sdk/issues/49719
Change-Id: I96e4c6a40a897a72b3570b59e014c8af77a9ef99
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/275082
Reviewed-by: Tess Strickland <sstrickl@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2022-12-14 22:33:38 +00:00
Ryan Macnak 8a37b70a53 [vm, compiler] More consistently support large load/store offsets.
TEST=ci
Change-Id: I7691808679c57c6f16f3859641cf52b9e606e304
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/275381
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2022-12-14 22:17:35 +00:00
Ryan Macnak 4baa958d08 [vm] Remove overly-narrow NoSafepointScopes.
These NoSafepointScopes are active for only one load/store where there is little need to guard against someone adding an allocation. They have been observed to take up to 15% of program execution in debug builds.

TEST=ci
Change-Id: I923baa28a3a72decacbfcdec3331ce9c7c620b67
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/275540
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2022-12-14 20:55:29 +00:00
Johnni Winther 81845864ca [kernel] Rename View* to Inline*
TEST=existing

Change-Id: I8726c936261ceb770b489f264d14fff02a1b4998
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/275243
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2022-12-14 08:36:57 +00:00
Ryan Macnak 138a69a150 [vm, compiler] Conditionally use RV-B instructions.
TEST=ci, local qemu
Change-Id: I3321264b524d52e5a63a32f70b62f27182ebc247
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/273833
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2022-12-13 23:43:18 +00:00
Vyacheslav Egorov 2f117ba43c [vm/aot] Fix ProgramElementKeyValueTrait::Hash.
It was returning library's index which is an unstable
value. This instability could cause `Precompiler::HasApiUse`
to stop returning `true` after `Precompiler::DropLibraries` even
if library was added to the `api_uses_` set. This in turn could cause
`Precompiler::PruneDictionaries` to drop library entries it should
not have dropped.

TEST=added assertion that verifies stability of the set

Cq-Include-Trybots: luci.dart.try:vm-kernel-precomp-linux-debug-x64-try
Change-Id: I0685bd75562f83e2b9d8b3a03fa410ba218df2ea
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/275241
Reviewed-by: Tess Strickland <sstrickl@google.com>
Auto-Submit: Slava Egorov <vegorov@google.com>
Commit-Queue: Slava Egorov <vegorov@google.com>
2022-12-13 19:46:41 +00:00
Ryan Macnak fa2e1c70ca [vm] Fix various scaling limitations.
- Quadratic behavior recording field guards
 - Quadratic behavior looking up dynamic invocation forwarders
 - Incorrect limit generating allocation stubs

TEST=class with 64k fields
Change-Id: I7a9aba617e71eff9b28711e99c689cb04be0dde7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/273285
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2022-12-13 19:28:37 +00:00
Dan Chevalier fd6fa010ec [ VM Service / DDS ] Add custom service stream support (Revised)
NOTES:
Original CL: https://dart-review.googlesource.com/c/sdk/+/274061
Revert CL: https://dart-review.googlesource.com/c/sdk/+/274802

Regression tests that failed after merging Original CL:
- https://ci.chromium.org/ui/p/dart/builders/ci.sandbox/pkg-mac-release/24046/overview
- https://ci.chromium.org/ui/p/dart/builders/ci.sandbox/pkg-mac-release-arm64/5999/overview

----------
DESCRIPTION:
Setting the `stream` parameter on `developer.postEvent` will now forward those events to a custom stream inside DDS.


The first use of this will be for widget inspection. A navigation event will be posted to a custom stream. Our IDE DAP can listen for the Event and react to it by navigating to the desired location in the code.

TEST=Made sure that regression from original PR could be reproduced, and then resolved by applying this change. Updated observatory tests. Created new developer test to check assertions. Added DDS tests for new custom stream behaviour. Manually tested the postEvent and StreamListen with multiple clients

https://github.com/flutter/devtools/issues/4533

Change-Id: I2b04a84b4daf11dd9d72f899928b5e1f62a5ae02
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/275121
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2022-12-13 16:31:37 +00:00
Derek Xu 53d859f6b9 Revert "[VM/CLI] Remove dartdev.dill"
This reverts commit c09f790d37.

Reason for revert: CI failures

Original change's description:
> [VM/CLI] Remove dartdev.dill
>
> Incompatible VM flags will no longer break the CLI when running from an
> AppJIT snapshot, so the fallback logic is no longer required. This CL
> thus removes dartdev.dill and the fallback logic.
>
> Relevant past CLs: https://dart-review.googlesource.com/c/sdk/+/157601
> and https://dart-review.googlesource.com/c/sdk/+/178300
>
> Fixes https://github.com/dart-lang/sdk/issues/50504
>
> TEST=I tried running `out/ReleaseX64/dart --observe --sound-null-safety test.dart`
> and `out/ReleaseX64/dart --observe --no-sound-null-safety test.dart` and
> both worked.
>
> Change-Id: I5cdcfbccf71ec557964014fdb80733b4a7c76b4d
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/274520
> Reviewed-by: Ben Konyi <bkonyi@google.com>
> Commit-Queue: Derek Xu <derekx@google.com>

TBR=bkonyi@google.com,derekx@google.com,dart-scoped@luci-project-accounts.iam.gserviceaccount.com

Change-Id: I5117f990dfabf93f5a9bae56098831280845e84e
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/275181
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Derek Xu <derekx@google.com>
2022-12-13 15:28:19 +00:00
Ryan Macnak de310a0c7b [vm, compiler] Fix address encoding limit when loading type arguments.
TEST=ci
Bug: https://github.com/dart-lang/sdk/issues/50671
Change-Id: I3a5ab9492d74fa770efd8e4c7cf90002a3793b9a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/275081
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2022-12-12 23:23:53 +00:00
Derek Xu c09f790d37 [VM/CLI] Remove dartdev.dill
Incompatible VM flags will no longer break the CLI when running from an
AppJIT snapshot, so the fallback logic is no longer required. This CL
thus removes dartdev.dill and the fallback logic.

Relevant past CLs: https://dart-review.googlesource.com/c/sdk/+/157601
and https://dart-review.googlesource.com/c/sdk/+/178300

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

TEST=I tried running `out/ReleaseX64/dart --observe --sound-null-safety test.dart`
and `out/ReleaseX64/dart --observe --no-sound-null-safety test.dart` and
both worked.

Change-Id: I5cdcfbccf71ec557964014fdb80733b4a7c76b4d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/274520
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Derek Xu <derekx@google.com>
2022-12-12 18:02:47 +00:00
Daco Harkes e3e355e16a [vm/ffi] Fix FfiTrampolineData GC bug
This lets the GC visit FfiTrampolineData::c_signature again.

https://dart-review.googlesource.com/c/sdk/+/272201 stopped adding
FfiTrampolineData::c_signature to snapshots. However, instead of
skipping it manually in app_shapshot.cc, we skipped it in
raw_object.h, which also caused the GC to skip it.
This CL adds it back in as we need it in JIT snapshots. This way we
keep it consistent between AOT/JIT snapshots.

TEST=tests/ffi/regress_b_261224444_test.dart

The c signatures of FFI trampolines were not properly traced in the
precompiler, causing us to hit an assert when the classes mentioned in
those types where only referenced from a signature and not retained
for any other reason.

TEST=tests/ffi/native_assets/process_test.dart (dartkp)

Closes: https://github.com/dart-lang/sdk/issues/50678
Bug: b/261224444
Change-Id: I84fc880744c2045ea3e2ef4f37df454b80b2faeb
Cq-Include-Trybots: luci.dart.try:vm-precomp-ffi-qemu-linux-release-arm-try,vm-ffi-android-debug-arm-try,vm-ffi-android-debug-arm64c-try,vm-kernel-reload-rollback-linux-debug-x64-try,vm-kernel-reload-linux-debug-x64-try,app-kernel-linux-debug-x64-try,vm-kernel-precomp-linux-debug-x64c-try,vm-kernel-precomp-linux-debug-x64-try,vm-kernel-nnbd-linux-debug-x64-try,vm-kernel-linux-debug-x64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/274387
Reviewed-by: Martin Kustermann <kustermann@google.com>
Auto-Submit: Daco Harkes <dacoharkes@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
2022-12-12 15:46:33 +00:00
Martin Kustermann 14508968f0 [vm] Ensure platform/globals.h is included before using defines
Defines may be defined/modified/cleared in `platform/globals.h`. All VM
sources should directly or indirectly include `platform/globals.h`
before using defines.

TEST=ci

Change-Id: Icf67eddd94a18775d4247259049906c9cc6014cd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/275020
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2022-12-12 15:38:30 +00:00
Lasse R.H. Nielsen 767049139a [3.0 alpha] Remove deprecated dart:core apis
- Remove `proxy` and `Provisional` annotations.
  - Remove `Deprecated.expires` getter.

Change-Id: I4521b48bb92e5f8420c778686f4efa9c6426cebb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/258004
Commit-Queue: Lasse Nielsen <lrn@google.com>
Reviewed-by: Brian Quinlan <bquinlan@google.com>
Reviewed-by: Michael Thomsen <mit@google.com>
Reviewed-by: Nate Bosch <nbosch@google.com>
2022-12-12 11:46:58 +00:00
Dan Chevalier 3ed65601b0 Revert "[ VM Service / DDS ] Add custom service stream support"
This reverts commit 4981cbffe2.

Reason for revert: Mac regression test failed.

Original change's description:
> [ VM Service / DDS ] Add custom service stream support
>
> Setting the `stream` parameter on `developer.postEvent` will now forward those events to a custom stream inside DDS.
>
>
> The first use of this will be for widget inspection. A navigation event will be posted to a custom stream. Our IDE DAP can listen for the Event and react to it by navigating to the desired location in the code.
>
> TEST=Updated observatory tests. Created new developer test to check assertions. Added DDS tests for new custom stream behaviour. Manually tested the postEvent and StreamListen with multiple clients
>
> https://github.com/flutter/devtools/issues/4533
>
> Change-Id: I870dc634c9a9a7d2ee3a6605319c2a18517ad197
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/274061
> Reviewed-by: Ben Konyi <bkonyi@google.com>
> Commit-Queue: Dan Chevalier <danchevalier@google.com>

TBR=bkonyi@google.com,dart-scoped@luci-project-accounts.iam.gserviceaccount.com,danchevalier@google.com

Change-Id: Ia1dce25444a6329c0553c931c9a6dbbec65ee583
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/274802
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Dan Chevalier <danchevalier@google.com>
2022-12-12 11:24:37 +00:00
Michael Thomsen b3304af17d [3.0 alpha] Remove deprecated onError API on int.parse, double.parse, and num.parse
Change-Id: I9ed24c380bf716cb893b99ba228e34f4671cc8fd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/259042
Reviewed-by: Lasse Nielsen <lrn@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2022-12-12 09:54:54 +00:00
Alexander Aprelev e07321ec9d [vm] Factor StringEqual out of platform-specific intrinsifiers into single asm_intrinsifier.
TEST=ci
Change-Id: Iaab92c4a4c5a04355778c17ce564672c1e97814c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/272349
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
2022-12-11 02:49:28 +00:00
Ryan Macnak a429d2ff91 [vm, gc] Remove dead code from weak handle visitors.
TEST=ci
Change-Id: I10619b7970de19047c9af77fc82dc9d3009f34f2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/274801
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
2022-12-09 22:22:28 +00:00
Dan Chevalier 4981cbffe2 [ VM Service / DDS ] Add custom service stream support
Setting the `stream` parameter on `developer.postEvent` will now forward those events to a custom stream inside DDS.


The first use of this will be for widget inspection. A navigation event will be posted to a custom stream. Our IDE DAP can listen for the Event and react to it by navigating to the desired location in the code.

TEST=Updated observatory tests. Created new developer test to check assertions. Added DDS tests for new custom stream behaviour. Manually tested the postEvent and StreamListen with multiple clients

https://github.com/flutter/devtools/issues/4533

Change-Id: I870dc634c9a9a7d2ee3a6605319c2a18517ad197
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/274061
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Dan Chevalier <danchevalier@google.com>
2022-12-09 20:18:30 +00:00
Ben Konyi 0971185695 [ VM ] Remove unnecessary condition check
TEST=N/A

Change-Id: I4c738a9be1aee9fab636ee2cbdb796f0ed226a86
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/274060
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2022-12-09 19:27:27 +00:00
Michael Thomsen 9f2a622d79 [3.0 alpha] Update CFE messages for Dart 3 sound null safety by-default
Fixes https://github.com/dart-lang/sdk/issues/50638

Change-Id: I511c5337099ae9576377ac8a82ef1bb78f6d34b1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/273844
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Michael Thomsen <mit@google.com>
2022-12-09 16:55:03 +00:00
Daco Harkes 56e581aa34 [3.0 alpha] Move AbstractClassInstantiationError to dart:mirrors
Split off https://dart-review.googlesource.com/c/sdk/+/259041 so that
the VM changes can be landed separately.

TEST=tests/lib/mirrors/instantiate_abstract_class_test.dart

Bug: https://github.com/dart-lang/sdk/issues/49529
Change-Id: Ic06dee0dfeaea64d9d9ffd9511ec66d9d0837e7e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/274383
Reviewed-by: Michael Thomsen <mit@google.com>
Reviewed-by: Tess Strickland <sstrickl@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2022-12-09 12:53:28 +00:00
Alexander Aprelev fb22336c28 [vm/sse41] Fix use of pextrd when sse41 is not available.
BUG=https://github.com/dart-lang/sdk/issues/50640
TEST=ci

Change-Id: Ief12c270cb59dace99e3a2845cb44ed5085dbdaf
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/274081
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
2022-12-08 23:29:14 +00:00
Ryan Macnak 15c8dad750 [vm] Reorder fields on Thread to reduce code size on X64.
dart2js.jit.x64 48139536 -> 47867344 (-0.57%)
dart2js.aot.x64 27077952 -> 26799256 (-1.03%)

TEST=ci
Bug: https://github.com/dart-lang/sdk/issues/48182
Change-Id: Ibc7d2ae7473936530307eadfcb4aeb83a9fdb873
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/274282
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2022-12-08 18:24:19 +00:00
Ryan Macnak 0150cddace [vm] Fix call-through-getter runtime handling.
This should look for `dyn:call` instead of `call`. If it was a non-dynamic call, we would hit an invoke-field-dispatcher instead.

TEST=ci
Bug: https://github.com/flutter/flutter/issues/116405
Change-Id: I98c441fec2eb53ab23ac1dd52db3aa4eaa5cbc6d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/274265
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2022-12-08 17:48:49 +00:00
Daco Harkes 1d567c888f [vm] Remove use of CastError
`CastError` is replaced by `TypeError`.

Also makes the fields of TypeError nullable. See:
https://github.com/dart-lang/sdk/issues/49279

TEST=build SDK and run default suites.

Bug: https://github.com/dart-lang/sdk/issues/49529
Change-Id: I7e880ff2d8b18c4bffdd7a942efd743244a12734
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/274381
Reviewed-by: Tess Strickland <sstrickl@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
2022-12-08 17:07:33 +00:00
Tess Strickland a43d3cb993 [vm/compiler] Use CombineHashes/FinalizeHash methods in intrinsifier.
AsmIntrinsifier::OneByteString_getHashCode now uses the CombineHashes
and FinalizeHash Assembler methods introduced in 49f998dc31.

To avoid having to check for 0 again after masking the result of
FinalizeHash to fit the desired bit size, we create a more general
FinalizeHashForSize that also takes the desired bit size of the result.

The intrinsified versions for ARM/ARM64/RISCV are also modified to
remove the special casing for the empty string, and instead just check
the size of the string against the loop counter at the start of the
loop, similarly to X64/IA32. This is less efficient for the empty
string case, but avoids the need to create a version of FinalizeHash
that elides the zero check.

TEST=ci

Cq-Include-Trybots: luci.dart.try:vm-kernel-precomp-dwarf-linux-product-x64-try,vm-kernel-precomp-linux-product-x64-try,vm-kernel-precomp-linux-release-x64-try,vm-kernel-precomp-nnbd-mac-release-arm64-try,vm-kernel-precomp-nnbd-linux-release-simarm_x64-try,vm-kernel-precomp-linux-release-simarm-try,vm-kernel-precomp-nnbd-linux-release-x64-try,vm-kernel-precomp-nnbd-linux-release-simarm64-try,vm-kernel-precomp-nnbd-linux-debug-simriscv64-try,vm-kernel-precomp-linux-debug-x64c-try,vm-kernel-nnbd-linux-debug-simriscv64-try,vm-kernel-linux-release-simarm-try,vm-kernel-linux-release-simarm64-try,vm-kernel-linux-release-ia32-try,vm-kernel-nnbd-linux-release-simarm-try,vm-kernel-nnbd-linux-release-simarm64-try,vm-kernel-nnbd-linux-release-ia32-try,vm-kernel-nnbd-mac-release-arm64-try,vm-kernel-linux-debug-x64c-try
Change-Id: I53db731acb8bf35d16efb55fa2c5a79d8302399f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/272800
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Commit-Queue: Tess Strickland <sstrickl@google.com>
2022-12-08 12:58:28 +00:00