Commit Graph

20223 Commits

Author SHA1 Message Date
なつき ddc19f7f92 Suppress clang warning for musl libc inline
Closes https://github.com/dart-lang/sdk/pull/51191

GitOrigin-RevId: d7064c43adce0b115c79e818800e44ba4f60739e
Change-Id: Ie73e96c83294d43baf3be6772cb84705ba2d2712
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/280136
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Slava Egorov <vegorov@google.com>
2023-02-01 21:58:18 +00:00
Alexander Markov 6074b4ff0d [vm/compiler] Handle uninitialized late local variables at OSR entries
TEST=tests/language/nnbd/syntax/late_modifier_edge_cases_test.dart
(on vm-eager-optimization-linux-release-x64 configuration)

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

Change-Id: I8eea931722f665d6ee8e5fa2602ba6b08edb8a7d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/280052
Commit-Queue: Slava Egorov <vegorov@google.com>
Auto-Submit: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Slava Egorov <vegorov@google.com>
2023-02-01 09:15:49 +00:00
Derek Xu 5577eafdba [VM] Add OSThread::GetCurrentThreadName() method
Some fields of `OSThread` are initialized by retrieving information by
calling OS functions. For example, `trace_id_` is initialized by calling
`OSThread::GetCurrentThreadTraceId()`. Similarly, this CL adds the
`OSThread::GetCurrentThreadName()` method and uses it to initialize
`name_`.

TEST=CI

Change-Id: Iee121d71e660be01ff684a298144fa7d59e3b61d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/278662
Commit-Queue: Derek Xu <derekx@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2023-01-31 22:37:30 +00:00
Alexander Markov 9be13288b0 [vm] Support multiple local variables with the same name in the same scope
When lowering patterns, front-end can add multiple distinct local
variables with the same name into the same local scope.
Previously, VM identified local variables in a local scope by name.
However, this no longer works with patterns.

With this change, local variables are now identified by pair (name,
kernel offset). Name is still taken into account as compiler can add
extra variables which do not correspond to kernel variables,
such as 'this'.

TEST=runtime/tests/vm/dart/regress_51091_test.dart
Fixes https://github.com/dart-lang/sdk/issues/51091
Issue https://github.com/dart-lang/sdk/issues/49755

Change-Id: I0263769cb31f3f8d9652f5d6534800510ac882fb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/279650
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2023-01-31 18:47:46 +00:00
Brian Quinlan 252015b30b [io] Fix a bug where large reads would return partial data.
Bug: https://github.com/dart-lang/sdk/issues/51071
Change-Id: Ia64d803c9709b106e52a1c671c1c3288c051bd85
Tested: ci + new test
CoreLibraryReviewExempt: bug fix only for vm
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/279204
Reviewed-by: Alexander Aprelev <aam@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Brian Quinlan <bquinlan@google.com>
2023-01-31 18:41:39 +00:00
Ryan Macnak 0c87126ea2 [vm] Finish removing legacy restart mechanism.
Cf. a4adbffb50.

TEST=ci
Change-Id: I9d2517c6cb0b5630990d087812e9a54241f41bb8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/280043
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2023-01-31 18:28:59 +00:00
Roland McGrath 82664d0a26 [fuchsia] Fix zx_thread_state_general_regs_t type name
The public API is the zx_thread_state_general_regs_t typedef,
not the zx_thread_state_general_regs struct tag.

TEST=ci
Change-Id: I4ce2f3dd08b5873378326fe4d162add33317a9c3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/280047
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Auto-Submit: Roland McGrath <mcgrathr@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2023-01-31 18:16:39 +00:00
Alexander Aprelev 4443d2d561 [vm/isolate] Ensure that isolate can correctly resume and exit if paused on exit.
It could happen that an isolate gets stuck unable to exit if paused on exit when using Isolate.exit.

Fixes https://github.com/dart-lang/sdk/issues/51164
TEST=isolate_exit_resume_test

Change-Id: I114686ce0637434827e56988821932cb91238032
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/280044
Commit-Queue: Alexander Aprelev <aam@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2023-01-31 17:15:38 +00:00
Alexander Markov f2304f9ec0 [vm/compiler] Fix numbering of SSA values during inlining
When building SSA form for callee graph during inlining, numbering of
SSA values starts with the number of SSA values in the caller graph.
However, parameter stubs may contain constants which are already added
to the callee graph and occupy certain range of SSA numbers. If that
number is larger than number of SSA values in the caller graph, then
numbers, already assigned to constants, can be incorrectly reused
during SSA construction.

The fix is to adjust number of SSA values in the callee graph
before parameter stubs are created, and then use current number of
SSA values as a starting point when building SSA.

TEST=runtime/tests/vm/dart/regress_flutter119220_test.dart
Fixes https://github.com/flutter/flutter/issues/119220

Change-Id: I7efd52e626b63bf64fb47861ec210b291911ef28
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/280041
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2023-01-31 16:47:44 +00:00
Josh Soref 77978889eb Spelling
Closes https://github.com/dart-lang/sdk/pull/51143

GitOrigin-RevId: 9e21c99a222d588e4fc95980725a2f8c9784965c
Change-Id: If0870e8936c7649935dce7e23cd783d62aa5610c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/279916
Reviewed-by: Alexander Thomas <athom@google.com>
Commit-Queue: Alexander Thomas <athom@google.com>
2023-01-30 18:29:59 +00:00
Lasse R.H. Nielsen bee7ab2b32 Make record positional field getters start at $1.
An update for co19 is available at https://github.com/dart-lang/co19/pull/1759

TEST=Existing tests run after change, two new tests for edge cases.

Change-Id: I408e398d532ba2c2e8e60777bb4f7bd0057e27fe
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/278912
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
Reviewed-by: Aske Simon Christensen <askesc@google.com>
2023-01-30 08:14:28 +00:00
Ryan Macnak 92972ff5cf [vm, gc] Disable time-based components of the growth policy when running under --deterministic.
TEST=ci
Bug: https://github.com/dart-lang/sdk/issues/51125
Change-Id: Ic716a0cc917b9237a4d1b452714bfc4c54f6aae6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/279470
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2023-01-28 00:24:09 +00:00
Alexander Aprelev 7c409eaa42 [vm/gardening] Skip two failing tests on iso-stress-linux.
The tests were not included into non-nnbd testing.
BUG=https://github.com/dart-lang/sdk/issues/51148
TEST=ci

Change-Id: Ib838cd0d70ebffe83ba2c5f2482e403c18f55317
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/280060
Commit-Queue: Alexander Aprelev <aam@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2023-01-27 20:48:17 +00:00
Ryan Macnak 2b8ca6f2f5 [vm, gc] Set the idle duration to effectively infinite.
This applies only to isolates running on the VM's thread pool.

TEST=manually inspect timeline in program with very large heap
Bug: https://github.com/dart-lang/sdk/issues/51125
Change-Id: Ib70cee7c163231b7aef4d723f35d056d4cb1cbf7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/279477
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
2023-01-27 19:03:18 +00:00
Alexander Aprelev c09d4d1c3d [vm/reload] Reject failed compilation during isolate reload
This is needed so that the expression evaluation works correctly after attempt to reload to bad source code.

Bug: https://github.com/dart-lang/sdk/issues/45846
Change-Id: Ib9fccc54141433bc662cbca923037fd12616ccd2
TEST=bad_reload_test
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/278664
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
2023-01-27 17:47:38 +00:00
Martin Kustermann b15da0b0e9 [gardening] Build analyze_snapshot/gen_snapshot in both host & target toolchain
This should make vm/dart_2/analyze_snapshot_binary_test pass on
dartkp-linux-release-arm64 & dartk-linux-release-arm64

by ensuring arm64 `gen_snapshot` & `analyze_snapshot` binaries
are available on the device when running tests on arm64 HW.

Change-Id: Icd814ff6df22a33b651733e4c3dc99873cf56a58
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/279970
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2023-01-27 12:44:30 +00:00
Martin Kustermann 0a78aac714 [vm] Make iso-stress builder compile & run null safety tests
Change-Id: I2a85491ac63635b4bd1d1f531466a0760f54e9e0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/279969
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2023-01-27 10:31:14 +00:00
Martin Kustermann f12592b984 [vm] Make vm/dart/isolates/concurrency_stress_sanity_test compile iso-stress tests in sound-null safety mode
Change-Id: Id63e234353981100155530e592a95c993ffd8d77
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/279968
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Daco Harkes <dacoharkes@google.com>
2023-01-27 10:29:25 +00:00
Alexander Aprelev bb63927fed [vm/regexp] Follow-up to RegExp sharing change 438b81c4f2.
Avoid ZoneHandles unless needed, use field initializer, few more nits.

This is based on feedback on https://dart-review.googlesource.com/c/sdk/+/279747.
TEST=ci

Change-Id: I59b462ca70a912b270b089fb114d6029b7fa5856
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/279903
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
2023-01-27 00:43:59 +00:00
Ryan Macnak 5cbd424bdf [vm, gc] Use right flag to decide the idle period's duration.
Broken in e31c7ff591.

TEST=manually inspect timeline
Change-Id: I3067a986f4ffed4e83e414948b1498e4da44cb78
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/279476
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2023-01-27 00:36:08 +00:00
Ryan Macnak 18c9f52aaf [observatory] Fix NNBD damage to VM flags page.
TEST=view vm flags
Change-Id: Ifaa35bef21715962774e77524618fd1ac25b4b39
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/279906
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2023-01-27 00:04:28 +00:00
Alexander Aprelev f9fb896455 [vm/isolates] Fix isolate_send_function_types_test
The test has been quietly broken for a while now as it expected that function types can't be send(which is not the case).

TEST=isolate_send_function_types_test

Change-Id: I09b107ef7f6b6229a2a28ee5c3f94f3bc8d7751e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/279902
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
2023-01-26 23:10:01 +00:00
Ryan Macnak 3b57bac701 [vm] Use a weak set to represent dependent code.
Fixes a scaling limitation where compiling N functions using the same guarded field or CHA guarded interface will result in O(N^2) comparisons when registering the dependencies.

Don't use Instructions' address as the hash, as this gets relocated between the snapshot writer and reader.

TEST=ci
Bug: https://github.com/dart-lang/sdk/issues/51125
Change-Id: I9a13d57455e10865d9c5f7c12009d869a4ef0488
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/279753
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2023-01-26 22:56:48 +00:00
Oleh Prypin 74849bae46 Revert "Update HTTP Profiling ids to use Strings"
This reverts commit e7d8261f9a.

Reason for revert: will not be able to roll devtools_app (at least in google3) with this backwards-incompatible change

Original change's description:
> Update HTTP Profiling ids to use Strings
>
> The internal Dart Ids can be 64 bit integers, and are passed to Dev Tools as integers. This is causing errors fetching requests as the ids can overflow once they get to dev tools.
>
> Interaction between `getHttpProfile` and `getHttpProfileRequest` are already performed in https://dart-review.googlesource.com/c/sdk/+/279122/3/pkg/vm_service/test/get_http_profile_test.dart
>
> https://github.com/flutter/devtools/issues/2860
>
> TEST=The original tests test the surface of the RPCs that are updated here. Any tests that needed tweaking have also been fixed
> CoreLibraryReviewExempt: Changes are only to http profiling
> Change-Id: Ie560dde7629f91f4221c1fe18d153cd999691086
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/279122
> Reviewed-by: Sigmund Cherem <sigmund@google.com>
> Commit-Queue: Dan Chevalier <danchevalier@google.com>
> Reviewed-by: Siva Annamalai <asiva@google.com>
> Reviewed-by: Ben Konyi <bkonyi@google.com>

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

Change-Id: I9b6c9ec1cb00cca56816959fc83a70ec35ac9b21
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/279980
Reviewed-by: Alexander Thomas <athom@google.com>
Commit-Queue: Alexander Thomas <athom@google.com>
Auto-Submit: Oleh Prypin <oprypin@google.com>
2023-01-26 16:42:26 +00:00
Dan Chevalier e7d8261f9a Update HTTP Profiling ids to use Strings
The internal Dart Ids can be 64 bit integers, and are passed to Dev Tools as integers. This is causing errors fetching requests as the ids can overflow once they get to dev tools.

Interaction between `getHttpProfile` and `getHttpProfileRequest` are already performed in https://dart-review.googlesource.com/c/sdk/+/279122/3/pkg/vm_service/test/get_http_profile_test.dart

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

TEST=The original tests test the surface of the RPCs that are updated here. Any tests that needed tweaking have also been fixed
CoreLibraryReviewExempt: Changes are only to http profiling
Change-Id: Ie560dde7629f91f4221c1fe18d153cd999691086
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/279122
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Dan Chevalier <danchevalier@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2023-01-26 15:08:56 +00:00
Tess Strickland 2967b148ec [gardening] Fix genSnapshot detection in use_flag_test_helper.dart.
Previously handled cases:
- No cross compilation, gen_snapshot in same `buildDir` as rest.
- X64->SIMARM cross compilation, gen_snapshot in `${buildDir}_X64`.

Newly handled case:
- X64->ARM64 cross compilation, gen_snapshot in `${buildDir}/clang_x64`.

TEST=vm/dart{,_2}/analyze_snapshot_binary_test

Change-Id: I3d3a23be445496ab068926f7d76b56299e06d950
Cq-Include-Trybots: luci.dart.try:vm-kernel-precomp-linux-release-simarm_x64-try,vm-kernel-nnbd-linux-release-simarm64-try,vm-kernel-precomp-linux-release-x64-try,vm-kernel-precomp-android-release-arm64c-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/279880
Reviewed-by: Martin Kustermann <kustermann@google.com>
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Commit-Queue: Tess Strickland <sstrickl@google.com>
2023-01-26 13:42:29 +00:00
Vyacheslav Egorov 4482709d45 [vm] Mark ListMixin.iterator with prefer-inline
This helps to improve the code quality in for-in loops
where iterable has a known List type.

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

Tested: tests updated due to line number changes in list.dart
CoreLibraryReviewExempt: no public API changes
Cq-Include-Trybots: luci.dart.try:vm-kernel-precomp-linux-debug-x64-try,vm-kernel-precomp-linux-release-simarm-try,vm-kernel-precomp-linux-product-x64-try
Change-Id: Ia5d815009a699061961c331cf43e68d2c96fc58b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/279518
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Slava Egorov <vegorov@google.com>
2023-01-26 10:16:51 +00:00
Josh Soref 01b28894e7 Spelling pkg dev compiler
Closes https://github.com/dart-lang/sdk/pull/50861

GitOrigin-RevId: 71005e6f5bf5a151cb5c1aefb6a2a300fc40f592
Change-Id: Iadfafb5787a62e9a379437f6a3763d31f99ba7c6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/277743
Reviewed-by: Alexander Thomas <athom@google.com>
Commit-Queue: Alexander Thomas <athom@google.com>
2023-01-26 09:12:41 +00:00
Vyacheslav Egorov c3d8f46c5b [vm/compiler] Devirtualize calls while inlining.
Inlined functions might contain call-sites which can be devirtualized
in the context of the caller. To achieve that we add a pass which
calls canonicalization on all dynamic calls (and their data
dependencies) between rounds of inlining.

More specifically this helps cases which require interleaving
some redundancy elimination and inlining to remove the cost of
abstractions. The primary example is for-in loop with an array of
a known type which usually requires inlining `get:iterator` and
propagating iterable value through interator's fields to specialize
and inline `get:length` and `operator[]` on the `Iterable`.

See https://github.com/dart-lang/sdk/issues/48433 for example.

TEST=vm/dart/devirtualization_during_inlining_il_test

Cq-Include-Trybots: luci.dart.try:vm-kernel-precomp-linux-debug-x64-try,vm-kernel-precomp-linux-release-simarm-try,vm-kernel-precomp-linux-product-x64-try
Change-Id: I1fae50484a111f8c21c81bcf0c3d6a63a856338a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/279517
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Slava Egorov <vegorov@google.com>
2023-01-26 08:52:18 +00:00
Vyacheslav Egorov cc8877fcc7 [vm/compiler] Improve canonicalization rules
* Add rule forwarding stores to non-late final fields to
consequitive loads.
* Allow specialization of InstanceCall with an empty ICData in AOT
mode.

Additionally rewrite regression test for 836c04f using explicit
block building. The source based test was too fragile and sensitive
to various optimizations.

TEST=vm/cc/IL_Canonicalize_FinalFieldForwarding,vm/cc/IL_Canonicalize_InstanceCallWithNoICDataInAOT

Bug: https://github.com/dart-lang/sdk/issues/48433
Cq-Include-Trybots: luci.dart.try:vm-kernel-precomp-linux-debug-x64-try,vm-kernel-precomp-linux-release-simarm-try,vm-kernel-precomp-linux-product-x64-try
Change-Id: Icb766d48ebaed6626c8d010f528fa6d82c432930
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/279515
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Slava Egorov <vegorov@google.com>
2023-01-26 08:52:18 +00:00
Derek Xu 4e9370ae1d [VM/Service] Clean up exceptional GetVMTimeline cases
TEST=CI

Change-Id: Ic70f00ac6efde2cb32d541eb62b868a3e4645fc3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/279469
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Derek Xu <derekx@google.com>
2023-01-25 21:23:27 +00:00
Derek Xu 8766952c13 [VM/Service] Populate length property for PlainInstance Instances and InstanceRefs
TEST=CI

Change-Id: I0c112513849e4057a08d6068101927ee6aec6b25
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/279466
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Derek Xu <derekx@google.com>
2023-01-25 18:32:57 +00:00
Ben Konyi b1b1c3bf78 [ VM ] Ensure heap profiler state is updated on TLAB release due to scavenge
Also fixes some race conditions and flaky test behavior.

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

TEST=DartAPI_HeapSampling_* looped in GDB under load

Change-Id: I0c1f297ecb140575e28650837158b707b9dc4b41
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/279590
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2023-01-25 17:56:39 +00:00
Josh Soref ef42a0b110 Spelling pkg analyzer lib
Closes https://github.com/dart-lang/sdk/pull/50860

GitOrigin-RevId: b27066c37f93c8c6d1123d6ebd6a4c0afcf59844
Change-Id: I15fa4aea1dad45daf168e34d1c4450320ec9b40a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/277742
Commit-Queue: Alexander Thomas <athom@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
2023-01-25 14:08:27 +00:00
Martin Kustermann 9361e15353 Revert "[vm] Use a weak set to represent dependent code."
This reverts commit 391ce71a0f.

Reason for revert: This seems to be the root cause of test failures
on unrelated CLs. It also seems that this is one reason that can
make app-jit snapshots no longer deterministic.

More information will be posed on:
https://github.com/dart-lang/sdk/issues/51125

Original change's description:
> [vm] Use a weak set to represent dependent code.
>
> Fixes a scaling limitation where compiling N functions using the same guarded field or CHA guarded interface will result in O(N^2) comparisons when registering the dependencies.
>
> TEST=ci
> Change-Id: Ic48f29fa0ce8f43a6f60bc00fa95a60763d333a0
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/278943
> Commit-Queue: Ryan Macnak <rmacnak@google.com>
> Reviewed-by: Alexander Aprelev <aam@google.com>

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

Change-Id: I823365b2c30906c40f77c6ef186b636b7fdc5691
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/279760
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2023-01-25 13:15:14 +00:00
Derek Xu 0031f67ba0 [VM/Service] Populate length property for Record InstanceRefs and Instances
TEST=CI

Issue: https://github.com/dart-lang/sdk/issues/51104
Change-Id: I4fa812c22f2ea0bdf5cc472a9e7198bf64442e6c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/279465
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Derek Xu <derekx@google.com>
2023-01-25 00:17:21 +00:00
Ryan Macnak 06e9ff6edc [vm] Use the right size in vm/cc/StoreHalfWordUnaligned.
Fixes clobbering whatever happens to be after the test's buffer.

TEST=ci
Bug: https://github.com/dart-lang/sdk/issues/51110
Change-Id: I661b643cf5f7d6a1a7781683f43ef02c4279f1e7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/279720
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
2023-01-24 21:22:15 +00:00
Josh Soref f7a2ea5e06 Spelling
Closes https://github.com/dart-lang/sdk/pull/50922

GitOrigin-RevId: 58fd7cfd5ef470a65a52ea28e0407244d853c917
Change-Id: I2e5a5ed991cb05270170a18b8f0169daa9eabdb7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/278537
Reviewed-by: Alexander Thomas <athom@google.com>
Commit-Queue: Alexander Thomas <athom@google.com>
2023-01-24 18:00:25 +00:00
Ryan Macnak da57d8a308 [vm] Remove giant initialized data from run_vm_tests.
out/ReleaseXRISCV64/exe.stripped/run_vm_tests 75MB -> 42MB

TEST=ci
Change-Id: I29f644e8b12c442a87f926cb644198ad8e3e9b34
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/279561
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2023-01-24 17:28:19 +00:00
Ryan Macnak b77866340c [vm] Do not allocate handles during RawCast.
RawCast is sometimes used in contexts that might not have a zone (idle GC), might have a long lived zone (the former interpreter), or otherwise should not allocate handles (the GC should not create handles after any phase that needs to visit them all).

TEST=ci
Bug: https://github.com/dart-lang/sdk/issues/51099
Change-Id: I0a8a6e4dfa600d5b78fadc5c558ac2e7245ff4bf
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/279620
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2023-01-24 17:26:37 +00:00
Derek Xu 899d9074a8 [VM] Factor out a base class for timeline event file recorders
TEST=I recorded a trace with the file recorder and made sure its contents were correct.

Change-Id: Id899083866b6d98260d4c6ef4c5016b43422db4a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/278482
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Derek Xu <derekx@google.com>
2023-01-24 15:26:08 +00:00
Chris Evans 0b8ab17feb Fix analyze_snapshot tests and build configuration
Updated strictness on build configuration for analyze_snapshot
Will run only under Linux/Android 64 bit arm, arm64c, simarm64,
simarm64c and x64 architectures.

analyze_snapshot just has a single target that links into product precompiled programatically

Testing suite updated to comply with null-safety requirements and
fix for simulated platform failing to use gen_snapshot with assembly.
TEST=ci
Change-Id: I3d58400db2e26a441a40fe7197b22510a52732b6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/279391
Reviewed-by: Slava Egorov <vegorov@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Chris Evans <cmevans@google.com>
2023-01-24 14:07:26 +00:00
Ryan Macnak 1aa7f17b56 [build] Default to -O2 instead of -O3.
This moderately reduces code size without large regressions on Golem. Going further to -Os still produces noticeable regressions.

TEST=ci
Bug: https://github.com/dart-lang/sdk/issues/38647
Change-Id: I8409908ca37d4a2b18cb989d9748e35a15072df6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/217504
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2023-01-24 00:54:29 +00:00
Derek Xu d81b48c6b1 [VM/Service] Add private _getImplementationFields procedure
TEST=CI

Change-Id: I4e4871ac4df74cb4daca7ef42a66489b2afbdc64
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/270260
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Derek Xu <derekx@google.com>
2023-01-23 21:07:23 +00:00
Sam Rawlins 4baa99e932 [observatory] Fix 'unused_catch_clause' issues
This is required in order to migrate Hints to Warnings This CL migrates
this code: https://dart-review.googlesource.com/c/sdk/+/279443

TESTED=presubmit

Bug: https://github.com/dart-lang/sdk/issues/50796
Change-Id: I1e0c360e6ed366b6452474338679acc8b1e1399c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/279458
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2023-01-23 19:51:48 +00:00
Vyacheslav Egorov d0887dc524 [cpplint] Disable runtime/references lint
Google Style Guide now prefers references to pointers because references
are non-nullable.

See https://google.github.io/styleguide/cppguide.html#Inputs_and_Outputs which now says:

> Non-optional input parameters should usually be values or const references, while non-optional
> output and input/output parameters should usually be references (which cannot be null).

This means runtime/references lint is outdated and can be disabled.

R=kustermann@google.com

Change-Id: Idec650603982387c000671aad7d77727a008f5cd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/279388
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Slava Egorov <vegorov@google.com>
2023-01-23 18:21:48 +00:00
Josh Soref b3df0a4bd5 Spelling tests standalone
Closes https://github.com/dart-lang/sdk/pull/50863

GitOrigin-RevId: e514be37c7f3b48cbce1048c359df00be7d2b18a
Change-Id: I45ad308db60a5935f18a877f5480874acfef0efd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/277780
Reviewed-by: Alexander Thomas <athom@google.com>
2023-01-23 12:55:22 +00:00
Martin Kustermann 2ffbc88fc6 Make package:heapsnapshot prefer to mmap files over reading them.
Change-Id: I23de18aac05beae8005e471335b72a2ed22d1eb5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/279349
Reviewed-by: Jens Johansen <jensj@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2023-01-23 10:22:41 +00:00
Josh Soref ba15a61271 Spelling build
Closes https://github.com/dart-lang/sdk/pull/50859

GitOrigin-RevId: 7b056018c2925745701bdecdd7da325d9458204d
Change-Id: Iff037d773713bf73efde6951599becfd7297b921
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/277740
Reviewed-by: Alexander Thomas <athom@google.com>
2023-01-23 08:56:14 +00:00
Daco Harkes 17f4198cfe [vm/ffi] Native assets Windows fixes
Some artifacts are .exe instead of .bat.

Library uris with file schemes use the Uri.path (using forward slashes
on Windows), so the tests emitting native asset mappings should use
Uri.path as well. (Not Uri.toFilePath() which uses backwards slashes.)
The paths of the dynamic libraries in the assets should use the
toFilePath(), as these are passed to the system API which expects
correct paths.

The Platform.script Uri has a path with file:///C: and back slashes.
The uri RFC does not support back slashes, and our ResolveUri does
neither. So for Windows we replace backslashes with forward slashes.

TEST=tests/ffi/native_assets/

Bug: https://github.com/dart-lang/sdk/issues/51066
Bug: https://github.com/dart-lang/sdk/issues/51067
Change-Id: I2e168e0549fe80d9a5366d636c6f1ef971942130
Cq-Include-Trybots: luci.dart.try:vm-kernel-precomp-nnbd-win-release-x64-try,vm-kernel-nnbd-win-debug-x64-try,vm-kernel-nnbd-win-release-x64-try,vm-kernel-nnbd-win-release-ia32-try,vm-kernel-msvc-windows-try,dart-sdk-win-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/279356
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
2023-01-20 18:20:17 +00:00