Commit graph

1810 commits

Author SHA1 Message Date
Alexander Aprelev 3a3433fd38 [gardening] Skip test that requires aot on ia32.
TEST=vm/dart/isolates/regress_54528_test

Change-Id: I31c26a4f61ed45128dacf94fff46ffc08f010a55
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/349624
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
2024-02-01 16:07:49 +00:00
asiva eabfad1158 [VM/Runtime] Report error when an AOT snapshot is used in spawnUri while
running in the JIT VM

TEST=new test added

Bug:54528
Change-Id: Ifa0176ee453e5af4e45bb0b74cf9ac9ba23fb93e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/346060
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Siva Annamalai <asiva@google.com>
2024-01-31 21:43:27 +00:00
Ryan Macnak 4cdfc63aa7 [test] Shrink async GC stress test to avoid timeouts on the slowest bots.
TEST=ci
Bug: https://github.com/dart-lang/sdk/issues/54590
Change-Id: Ib444f831e966fc980848cdd6495a5d0a343d439d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/346581
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2024-01-16 19:17:13 +00:00
Tess Strickland df72359786 [vm/compiler] Convert _TypedList get and set methods to normal methods.
Previously, they were implemented as native methods with special
replacements in the inliner.

Instead, create force-compiled versions of the original inliner
replacements and use those instead of native methods, unless the
flow graph compiler doesn't support unboxing the requested element type.
In that case, the force-compiled version just calls a native method,
and we only keep the native methods that might be needed (that is,
for double/SIMD element access).

Also, revert the change in 26911a6176, since now the _getX/_setX
methods are appropriately inlined instead of failing to inline due
to being native methods.

TEST=vm/dart/typed_list_index_checkbound_il_test

Cq-Include-Trybots: luci.dart.try:vm-aot-linux-debug-x64-try,vm-aot-linux-release-x64-try,vm-linux-debug-x64-try,vm-aot-linux-release-simarm_x64-try,vm-linux-release-simarm-try,vm-ffi-qemu-linux-release-arm-try
Change-Id: I4840883d1fc12b36a450803da339406bec149044
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/330786
Commit-Queue: Tess Strickland <sstrickl@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2024-01-12 10:29:09 +00:00
Ryan Macnak a6edfb5904 [vm] Add tests for missing write barriers in SuspendState suspend and clone.
Bug: https://github.com/dart-lang/sdk/issues/54410
Change-Id: I86f105fcba7ab95f4d526ab0b468822f50b4e62b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/345568
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2024-01-11 18:57:20 +00:00
Alexander Aprelev c8c7f8a2a1 [gardening] Clean up deleted tests from stress test list.
Follow-up to 154cf8c52b

TEST=ci

Change-Id: I27262b41d319297c41092a52b00ee06139945cc9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/345563
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
2024-01-10 21:43:09 +00:00
Vyacheslav Egorov 3e0ae6da5f [vm] Remove dual mapping of code
We are no longer using Dart VM in a setting where this
matters as a security measure and it just complicates
portability for no benefit.

There is an indication that it is causing problems when
running Linux build of Dart VM under Docker on Mac OS X.

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

TEST=ci

Cq-Include-Trybots: luci.dart.try:vm-fuchsia-release-arm64-try,vm-fuchsia-release-x64-try
Change-Id: I11bdaa8faebaca1df6fd59097049bdaea9cb8e12
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/344581
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Slava Egorov <vegorov@google.com>
2024-01-09 12:36:55 +00:00
Tess Strickland 1827fcbf68 [vm/compiler] Fix uses of constant indexes in LoadIndexed/StoreIndexed.
Previously, CanBeImmediateIndex calculated the scaling factor for the
index using Instance::ElementSizeFor. However, the LoadIndexed and
StoreIndexed instructions which use this function have an index_scale_
field that is not necessarily the same as the element size for the
class id. This means the displacement calculated within
CanBeImmediateIndex can differ from the actual displacement calculated
within ElementAddressForIntIndex, causing the bug seen by the fuzzer.

This CL moves the check in CanBeImmediateIndex to a new static
method Assembler::AddressCanHoldConstantIndex. In addition to the
original arguments to CanBeImmediateIndex, the new static method takes
an index_scale argument, so the field value can be passed appropriately.

It also adds an is_external argument on X64 and IA32 to match the other
architectures, since assuming a non-external typed data object could
cause a register to be used in cases where it isn't necessary.

TEST=vm/dart/regress_54486

Fixes: https://github.com/dart-lang/sdk/issues/54486
Change-Id: Ia553fb7da0500113b35f8d9af91a52df55437a3c
Cq-Include-Trybots: luci.dart.try:vm-aot-linux-debug-x64-try,vm-linux-debug-ia32-try,vm-aot-linux-debug-simarm_x64-try,vm-aot-linux-debug-simriscv64-try,vm-aot-mac-release-arm64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/345002
Reviewed-by: Daco Harkes <dacoharkes@google.com>
2024-01-08 15:46:01 +00:00
Tess Strickland 6672353e0f [vm] Fix instantiation of default type args in closure functions.
Previously, the default type arguments for closure functions were
instantiated in the same way as other types of functions, where the
instantiator and function type arguments of the call were used. However,
the defaults for closure functions should be instantiated with the
instantiator and parent function type arguments stored within the
closure itself.

Since the instantiation of the default type arguments only depends on
the instantiator and parent function type arguments, which are shared
between partial instantiations of the same generic closure, the VM
performs this instantiation once at closure creation and caches it in
the closure object, so it can be retrieved when the default type
arguments are needed and copied to new partial instantiations of the
same closure without need for recalculation.

As a side effect, this should speed up dynamic invocation of generic
closures, since the invoke field dispatcher that implements them
previously performed this instantiation when needed on every invocation,
but now it just retrieves the cached version instead.

TEST=language/closure/type_arguments vm/dart/regress_54426

Fixes: https://github.com/dart-lang/sdk/issues/54426
Change-Id: I9baad807befa0323f3c5b66196b9664e4d78af0a
Cq-Include-Trybots: luci.dart.try:vm-aot-linux-release-x64-try,vm-reload-linux-release-x64-try,vm-reload-rollback-linux-release-x64-try,vm-tsan-linux-release-x64-try,vm-aot-tsan-linux-release-x64-try,vm-aot-msan-linux-release-x64-try,vm-msan-linux-release-x64-try,vm-aot-linux-release-arm64-try,vm-aot-dwarf-linux-product-x64-try,vm-aot-mac-product-arm64-try,vm-aot-obfuscate-linux-release-x64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/344700
Reviewed-by: Daco Harkes <dacoharkes@google.com>
2024-01-08 13:07:16 +00:00
asiva 01ac55d5f0 [VM/tests] Temporarily remove language/closure/type_arguments_test
from the isolate stress test list as it is failing

(see https://github.com/dart-lang/sdk/issues/54426)

Change-Id: I7f5df7faa2cdc633901e54829ff9a7ccd824f5a9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/344461
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Siva Annamalai <asiva@google.com>
2024-01-03 01:20:09 +00:00
Alexander Aprelev 544a564859 [gardening] Clean up stress test list post tests removal.
Follow-up to e95b3ed417

TEST=ci

Change-Id: I6d836d504e98aa29c6f835a5e8265310ced862e8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/343691
Commit-Queue: Alexander Aprelev <aam@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
2023-12-28 18:30:51 +00:00
Jonas Termansen 6eaec1ec42 [test] Check platform in exported_symbols_test.
llvm-nm for Linux and macOS needs to be for the right operating system
if the local checkout contains clang toolchains for other operating
systems.

Change-Id: I8de702474a6fa14f06b48e3e60756b3f414272f8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/342940
Commit-Queue: Jonas Termansen <sortie@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
2023-12-21 14:00:34 +00:00
Daco Harkes 562f66b313 [gardening][vm] Adjust timeouts inside test
Also removes the status file entry. This test is not slow, it hangs.
So don't give it more time to hang.

Bug: https://github.com/dart-lang/sdk/issues/53878
Change-Id: Ifa5112f25edb16cffd8f26fb71917d1672eed34d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/343140
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
2023-12-21 09:37:03 +00:00
Jonas Termansen 669060f8c7 [build] Omit SDK and Git hashes on RBE.
Bug: b/296994239
Change-Id: I70c10fddc3bd01fef5ed5182e1d28d0797c431e3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/342421
Commit-Queue: Jonas Termansen <sortie@google.com>
Reviewed-by: Slava Egorov <vegorov@google.com>
2023-12-20 12:23:56 +00:00
Ryan Macnak 09a1fa143c [test] Shrink write barrier elimination stress tests.
TEST=ci
Bug: https://github.com/dart-lang/sdk/issues/54167
Change-Id: Ic707b1dc039f65a8f5367c5e679594e1b4aafd6d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/341622
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
2023-12-14 20:49:07 +00:00
Alexander Aprelev 087278428e [vm/win] Ensure no message boxes for crashes on windows debug builds.
Follow-up to https://dart.googlesource.com/sdk/+/543dbdd708de6da4a461e15147940e08231bba9d

TEST=manually on windows
BUG=https://github.com/dart-lang/sdk/issues/54275

Change-Id: Iec70cb37ab6b6133ce7599fead3ffabc5ba92312
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/340388
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
2023-12-08 17:24:59 +00:00
Alexander Aprelev 87c791ed9a [gardening] Fix stress_test_list for a test that just got renamed.
Follow-up to 004f564f40

TEST=ci

Change-Id: Ice18a92cef283042bcaa81594e31356c35eb850d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/340389
Commit-Queue: Alexander Aprelev <aam@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
Auto-Submit: Alexander Aprelev <aam@google.com>
2023-12-08 01:48:32 +00:00
Alexander Aprelev 543dbdd708 [gardening] Skip vm/dart/in_memory_elf_test on windows debug aot bots - it's flaky and too slow.
Fixes https://github.com/dart-lang/sdk/issues/54275
TEST=ci

Change-Id: I344598f1305ac1df5e604aa72b1c80edace5e4ff
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/340287
Commit-Queue: Alexander Aprelev <aam@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2023-12-08 00:44:02 +00:00
Ryan Macnak ea57365feb [standalone] Fix finding symbols when argv[0] is not an absolute path or relative to CWD.
TEST=vm/dart/symbolized_crash_test
Change-Id: I941045db6ab78b24bd529e775380be80c1d71121
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/339782
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2023-12-05 17:25:39 +00:00
Ryan Macnak 719a0b7587 [test] Remove use of waitFor from isolate stress tests.
Change-Id: Icaaadc63f661a4a531c232a52ca9230bf93f2f00
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/339700
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
2023-12-04 21:26:59 +00:00
Tess Strickland 7ffb8574ee [vm] Ensure element type is checked for typed data setRange calls.
In c93f924c82, the separate setRange definitions in _TypedIntListMixin,
_TypedDoubleListMixin, _Float32x4ListMixin, _Float64x2ListMixin, and
_Int32x4ListMixin were replaced with a single definition in
_TypedListBase. In doing so, the signature was changed: now the `from`
argument is just an Iterable, instead of the more specific
Iterable<int>/Iterable<double>/etc in the original definitions.

setRange calls two helper methods, _fastSetRange, when from is also a
_TypedListBase whose elements are the same size, and _slowSetRange, for
all other cases.

In _slowSetRange, various casts and checks ensure that the setRange
method was called with a compatible element type, but _fastSetRange only
checks the _size_ of the element type, not the element type itself,
before doing a memory move between the two _TypedListBase objects. That
means via upcasting, elements can be copied from an argument with an
incompatible element type to the receiver, which would have resulted in
a TypeError being thrown before.

Change the unified setRange definition to _setRange and recreate the old
separate setRange definitions with the more specific signatures, with
the separate definitions delegating to _setRange.

TEST=vm/dart/regress_53945

Fixes: https://github.com/dart-lang/sdk/issues/53945
Cq-Include-Trybots: luci.dart.try:vm-aot-linux-debug-x64-try,vm-aot-linux-release-x64-try
Change-Id: If7eef0b2e07c63aaf776de7b26b1c2cc8c57607d
Fixed: 53945
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/334201
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Commit-Queue: Tess Strickland <sstrickl@google.com>
2023-12-04 16:20:50 +00:00
Alexander Markov 6dc6ebf2b0 [vm] Fix type arguments vector used in bounds check when instantiating a closure
When doing type parameter bounds check during instantation of a closure
function type arguments vector should be constructed both from
closure funtion type arguments (parent type arguments) and checked
type arguments (which correspond to own type parameters of a closure).

TEST=runtime/tests/vm/dart/regress_54210_test.dart
Fixes https://github.com/dart-lang/sdk/issues/54210

Change-Id: I1ac223c4a05d9e773ce491e34825f3a3d6fe5dbf
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/339228
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2023-12-01 23:15:58 +00:00
Alexander Markov 422b66a7e8 [vm/compiler] Relax flow graph checker for environment uses
Conditional constant propagation doesn't update environments and may
also replace redefinition instructions with constants
without updating environment uses of their original definitions.

This causes discrepancy between arguments of a call and its environment.
It is harmless and corresponding check in the flow graph checker can be
relaxed.

TEST=runtime/tests/vm/dart/regress_54128_test.dart
Fixes https://github.com/dart-lang/sdk/issues/54128

Change-Id: I6e68e0525b7f110400435ac071934dd9a02eebd4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/338941
Auto-Submit: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Slava Egorov <vegorov@google.com>
2023-11-29 20:07:37 +00:00
Alexander Aprelev 4418b62694 [gardening] Remove gc tests, clean up failing tests in stress test suite.
This is to prevent oom tsan bot failures.
Remove test broken by https://dart.googlesource.com/sdk/+/8eaeb87500b2ae9a127be915b073cf0a3de44c51

Change-Id: I0419260dc6e2e0dc2916bc4b11c5a1a4b207db89
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/337826
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
2023-11-27 19:02:16 +00:00
Alexander Aprelev 72be727857 [gardening] Remove tests from stress_test_list that fail on the bot.
Change-Id: I2f17952836770dfe2b118bffc38b56b760eed29a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/337616
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
2023-11-22 17:44:57 +00:00
Alexander Aprelev 2b596a77ae [gardening] Clean up isolate stress tests list.
This removes tests that don't work well in isolate stress testing environment.

Change-Id: Ifddb53dd17408848522649aa68123cb0b60d5c20
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/337600
Commit-Queue: Alexander Aprelev <aam@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2023-11-21 18:22:53 +00:00
Tess Strickland 26911a6176 [vm/compiler] On 32-bit archs, no specific inline for index checks.
Replacing index checks with a single GenericCheckBound instruction
currently causes performance regressions on 32-bit ARM. Undo that
optimization there for now, instead inlining the original Dart code
into the indexing operations.

TEST=ci

Issue: https://github.com/flutter/flutter/issues/138689
Change-Id: I7e67966b576a9d1b5f510e17b44f853f23c98a91
Cq-Include-Trybots: luci.dart.try:vm-linux-release-simarm-try,vm-ffi-qemu-linux-release-arm-try,vm-aot-linux-release-simarm_x64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/337480
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Commit-Queue: Tess Strickland <sstrickl@google.com>
2023-11-21 11:40:01 +00:00
Alexander Aprelev e1d53cebb2 [gardening] Clean up list of stress tests.
Remove accidently added test file added in https://dart.googlesource.com/sdk/+/327d7df4689b0531f2ee1ff24019d62ba7534418

Change-Id: I8ef6df14d5380c3e8ee4d62ea6682f15f66c5ddf
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/337288
Reviewed-by: Liam Appelbe <liama@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
2023-11-21 03:43:49 +00:00
Alexander Aprelev 327d7df468 [vm/gardening] Update stress_test_list.json for iso-stress-linux bot
Updated by running generate_stress_test_list.dart - this is to pick up the tests that were added since the last time the list was refreshed.

Change-Id: I88f8c85888e508b72702dd0f05884799fa6c96ad
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/337380
Commit-Queue: Alexander Aprelev <aam@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
2023-11-20 21:34:53 +00:00
Alexander Aprelev 831ad5580d [vm/stress] Clean up legacy tests from isolate stress trest runs.
This is follow-up to 2ee771a4f6 to fix iso_stress_linux bot.

TEST=ci

Change-Id: Ic6840481287b5af943252bef9854e0be4049553b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/337003
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
2023-11-20 18:25:11 +00:00
Ryan Macnak 1845b5af75 [test] Run GC stress tests with multiple isolates.
Change-Id: I2524260703c39ca63cca49ae88620a1b70ff6d72
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/336622
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2023-11-17 23:35:13 +00:00
Robert Nystrom 2ee771a4f6 Remove the legacy "_2" tests. \o/
I also cleaned up a bunch of places that referred to them.

Change-Id: I45f68818c892f8620ea04257885ffa3763374bb5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/335863
Auto-Submit: Bob Nystrom <rnystrom@google.com>
Commit-Queue: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
2023-11-17 20:17:23 +00:00
Alexander Aprelev 02c1493288 [io/win] Ensure isDST is correctly determined for pre-1970 dates on Windows.
Bug: https://github.com/dart-lang/sdk/issues/44656
Change-Id: Icf4925986430a1a6d149f362679bc68d01ea8746
TEST=ci
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/336803
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
2023-11-17 19:11:57 +00:00
Tess Strickland 904354f108 [vm/compiler] Convert index checks in TypedData methods to CheckBound.
Create a _typedDataIndexCheck abstraction for the conditional throwing
of IndexError in TypedData indexing operations. Recognize that
abstraction in the inliner and replace it with the equivalent CheckBound
instruction.

Do the same for byte offset checking in ByteData operations.

TEST=vm/dart/typed_list_index_checkbound

Change-Id: Ia6c4a3b7ae4667af69aa5bf214d4f187557dac06
Cq-Include-Trybots: luci.dart.try:vm-aot-linux-debug-x64-try,vm-aot-linux-release-x64-try,vm-linux-debug-x64-try,vm-eager-optimization-linux-release-x64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/330800
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Tess Strickland <sstrickl@google.com>
2023-11-17 15:35:42 +00:00
Lasse R.H. Nielsen 5543293a16 Reland "Expire 3.0.0 experiment flags."
This is a reland of commit 6f29e7fce4

Original change's description:
> Expire 3.0.0 experiment flags.
>
> TEST=Existing tests covers.
> Change-Id: I161eefdc28c74f63ba1ee926800a01eea03d9930
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/331960
> Commit-Queue: Lasse Nielsen <lrn@google.com>
> Reviewed-by: Alexander Thomas <athom@google.com>

TEST=Existing tests covers.
Change-Id: I384e77744c74774a250be413358a7fa176117167
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/332684
Reviewed-by: Alexander Thomas <athom@google.com>
Commit-Queue: Lasse Nielsen <lrn@google.com>
2023-11-17 13:10:01 +00:00
asiva 267b05ba16 [VM/tests] Remove the one test in runtime/tests/vm/dart_2 that seems to
have been added back after the deletion of all tests in runtime/tests/vm/dart_2

TEST=ci

Change-Id: I519f30d558cc8adee27297deeb1f809231f4e18a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/336242
Commit-Queue: Siva Annamalai <asiva@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2023-11-15 00:11:31 +00:00
asiva 1d3d819ecf [vm] Ensure 'print' is atomic between printing the string and '\n'
Should fix https://github.com/dart-lang/sdk/issues/53471

TEST=ci

Change-Id: I76da5776bb95f8297ef63aa4c8754c940e1d4e71
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/330999
Commit-Queue: Siva Annamalai <asiva@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2023-11-03 20:02:45 +00:00
Ryan Macnak 27a2c2e461 [test] More systematically mark GC stress tests as slow.
Bug: https://github.com/dart-lang/sdk/issues/52924
Bug: https://github.com/dart-lang/sdk/issues/53551
Change-Id: Ic6470294a6f9f57b8c9e653cda1bc371d4902c88
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/333055
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2023-11-01 22:57:09 +00:00
Tess Strickland 1afa57fc48 [vm/compiler] Canonicalize int ops with a singleton range.
If range analysis has determined that a integer operation cannot throw
or deoptimize and can only result in a single possible value that
matches the operation's representation, replace the operation with that
constant value.

Be more precise about when a BinaryInt64OpInstr can throw. Previously
any MOD or TRUNCDIV operation was marked as possibly throwing, but now
in those cases we only mark it as possibly throwing if the right hand
side can be 0.

TEST=vm/dart/unsigned_truncated_division

Change-Id: I0f4fd754199240715606b90a6a423dbeb268c90d
Cq-Include-Trybots: luci.dart.try:vm-aot-linux-debug-simarm_x64-try,vm-aot-linux-release-x64-try,vm-aot-linux-debug-x64c-try,vm-linux-release-simarm-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/331283
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Tess Strickland <sstrickl@google.com>
2023-11-01 15:06:43 +00:00
Tess Strickland 0dc86856ca Reland "[vm/compiler] Consistently use PointerBase.data values as FFiIntPtr."
This is a reland of commit 60d1a40462

Original change's description:
> Reland "[vm/compiler] Consistently use PointerBase.data values as FFiIntPtr."
>
> This is a reland of commit 5c4fd50667
>
> The range analysis change was replaced with a different change,
> on which this CL is based. In addition, another preceding CL
> unified a few methods on subclasses of UnboxIntegerOpInstr, because
> the inconsistencies between UnboxInt32OpInstr and UnboxUint32OpInstr
> and how unboxed int32 vs. uint32 constants were handled caused the
> issue seen after landing the original CL.
>
> Thus, this CL is purely changes of kUnboxedIntPtr to kUnboxedFfiIntPtr
> when appropriate plus test changes.
>
> TEST=vm/dart/regress_306327173_il_test
>      vm/dart/address_local_pointer_il_test
>
> Original change's description:
> > [vm/compiler] Consistently use PointerBase.data values as FFiIntPtr.
> >
> > Also if converting an unboxed int with only non-negative values
> > that fit in 32 bits to a uint32, then keep the range from the value.
> >
> > TEST=regress_306327173_il_test
> >
> > Cq-Include-Trybots: luci.dart.try:vm-aot-linux-debug-simarm_x64-try,vm-aot-linux-release-x64-try,vm-aot-linux-debug-x64-try,vm-aot-linux-debug-x64c-try
> > Change-Id: Id9e7c2d5f477e560822a02574739c57d77b5a6d1
> > Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/332202
> > Reviewed-by: Daco Harkes <dacoharkes@google.com>
> > Reviewed-by: Slava Egorov <vegorov@google.com>
> > Commit-Queue: Tess Strickland <sstrickl@google.com>
>
> Change-Id: I1f66bc9d1ca7569c913f02b611b4a27f189605ac
> Cq-Include-Trybots: luci.dart.try:vm-aot-linux-debug-simarm_x64-try,vm-aot-linux-release-x64-try,vm-aot-linux-debug-x64-try,vm-aot-linux-debug-x64c-try,vm-ffi-qemu-linux-release-arm-try,vm-ffi-android-release-arm-try
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/332340
> Reviewed-by: Daco Harkes <dacoharkes@google.com>
> Commit-Queue: Tess Strickland <sstrickl@google.com>

TEST=vm/dart/regress_306327173_il_test
     vm/dart/address_local_pointer_il_test

Change-Id: I8f789847670c66a823cbbc6dca5b74a8b7a2cd88
Cq-Include-Trybots: luci.dart.try:vm-aot-linux-debug-simarm_x64-try,vm-aot-linux-release-x64-try,vm-aot-linux-debug-x64-try,vm-aot-linux-debug-x64c-try,vm-ffi-qemu-linux-release-arm-try,vm-ffi-android-release-arm-try,vm-linux-release-simarm-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/333002
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Commit-Queue: Tess Strickland <sstrickl@google.com>
2023-11-01 12:47:59 +00:00
Alexander Aprelev daaa8f495c [vm/isolates] Allow typed data types in aruments for spawnUri isolates
Fixes https://github.com/dart-lang/sdk/issues/53890
TEST=isolates/send_list_typed_data_spawn_uri_test

Change-Id: Iaf1c2757897c61d0d0da2463bfea398cdcb67959
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/332743
Commit-Queue: Alexander Aprelev <aam@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2023-10-31 16:32:59 +00:00
Tess Strickland cbe6cb8e2c Revert "Reland "[vm/compiler] Consistently use PointerBase.data ..."
Revert submission 332340

Reason for revert: Failures on SIMARM (not SIMARM_X64 though).

Reverted changes: /q/submissionid:332340

Change-Id: I71399598b5efda7ade5ca1346bd25840c1cf0418
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/333080
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Commit-Queue: Tess Strickland <sstrickl@google.com>
2023-10-31 16:18:42 +00:00
Tess Strickland 60d1a40462 Reland "[vm/compiler] Consistently use PointerBase.data values as FFiIntPtr."
This is a reland of commit 5c4fd50667

The range analysis change was replaced with a different change,
on which this CL is based. In addition, another preceding CL
unified a few methods on subclasses of UnboxIntegerOpInstr, because
the inconsistencies between UnboxInt32OpInstr and UnboxUint32OpInstr
and how unboxed int32 vs. uint32 constants were handled caused the
issue seen after landing the original CL.

Thus, this CL is purely changes of kUnboxedIntPtr to kUnboxedFfiIntPtr
when appropriate plus test changes.

TEST=vm/dart/regress_306327173_il_test
     vm/dart/address_local_pointer_il_test

Original change's description:
> [vm/compiler] Consistently use PointerBase.data values as FFiIntPtr.
>
> Also if converting an unboxed int with only non-negative values
> that fit in 32 bits to a uint32, then keep the range from the value.
>
> TEST=regress_306327173_il_test
>
> Cq-Include-Trybots: luci.dart.try:vm-aot-linux-debug-simarm_x64-try,vm-aot-linux-release-x64-try,vm-aot-linux-debug-x64-try,vm-aot-linux-debug-x64c-try
> Change-Id: Id9e7c2d5f477e560822a02574739c57d77b5a6d1
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/332202
> Reviewed-by: Daco Harkes <dacoharkes@google.com>
> Reviewed-by: Slava Egorov <vegorov@google.com>
> Commit-Queue: Tess Strickland <sstrickl@google.com>

Change-Id: I1f66bc9d1ca7569c913f02b611b4a27f189605ac
Cq-Include-Trybots: luci.dart.try:vm-aot-linux-debug-simarm_x64-try,vm-aot-linux-release-x64-try,vm-aot-linux-debug-x64-try,vm-aot-linux-debug-x64c-try,vm-ffi-qemu-linux-release-arm-try,vm-ffi-android-release-arm-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/332340
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Commit-Queue: Tess Strickland <sstrickl@google.com>
2023-10-31 14:19:41 +00:00
Daco Harkes acad65713c [vm] Mark NativeFieldWrapperClasses as base
TEST=build SDK (modified patch files)
TEST=tests/ffi/*
TEST=runtime/vm/*_test.cc
TEST=runtime/tests/vm/dart/*

Closes: https://github.com/dart-lang/sdk/issues/51896
CoreLibraryReviewExempt: VM only.
Change-Id: I349849001adf8f3a62f3d4f94d4bdd295c36ef4d
Cq-Include-Trybots: luci.dart.try:flutter-linux-try,vm-aot-linux-debug-x64c-try,vm-ffi-android-debug-arm-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/291761
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
2023-10-31 10:23:12 +00:00
Alexander Aprelev 6a464c9dee Revert "Expire 3.0.0 experiment flags."
This reverts commit 6f29e7fce4.

Reason for revert: broke g3 bot

Original change's description:
> Expire 3.0.0 experiment flags.
>
> TEST=Existing tests covers.
> Change-Id: I161eefdc28c74f63ba1ee926800a01eea03d9930
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/331960
> Commit-Queue: Lasse Nielsen <lrn@google.com>
> Reviewed-by: Alexander Thomas <athom@google.com>

Change-Id: Ied6f612dc922824ffdadc4660898f3b859922ff5
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/332582
Reviewed-by: Lasse Nielsen <lrn@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
Commit-Queue: Alexander Thomas <athom@google.com>
Auto-Submit: Alexander Aprelev <aam@google.com>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
2023-10-27 16:50:09 +00:00
Lasse R.H. Nielsen 6f29e7fce4 Expire 3.0.0 experiment flags.
TEST=Existing tests covers.
Change-Id: I161eefdc28c74f63ba1ee926800a01eea03d9930
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/331960
Commit-Queue: Lasse Nielsen <lrn@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
2023-10-27 13:57:00 +00:00
Tess Strickland 437223150c [vm/tests] Fix using clause in vm/dart/regress_306327173_il_test.
TEST=vm/dart/regress_306327173_il_test

Cq-Include-Trybots: luci.dart.try:vm-aot-linux-release-x64-try
Change-Id: Id88bf718b40cd77d733de194eb3cbf73f6578415
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/332422
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Tess Strickland <sstrickl@google.com>
2023-10-27 09:25:42 +00:00
Daco Harkes 0cd55a18c1 [vm] Introduce cachable idempotent calls
Adds a `CachableIdempotentCallInstr` that can be invoked via
`@pragma('vm:cachable-idempotent')` if the call-sites is force
optimized.

The object pool is not visited by the scavenger. So, we store the
results as unboxed integers. Consequently, only dart functions that
return integers can be cached.

Cachable idempotent calls should never be inlined. After the first
call the function not be called again.

The call itself is on a slow path to avoid register spilling on the
fast path.

TEST=vm/cc/IRTest_CachableIdempotentCall
TEST=runtime/tests/vm/dart/cachable_idempotent_test.dart

Bug: https://github.com/dart-lang/sdk/issues/51618
Change-Id: I612e896f27add76f57796c060157e14cc687a0fd
Cq-Include-Trybots: luci.dart.try:vm-aot-android-release-arm64c-try,vm-aot-android-release-arm_x64-try,vm-aot-asan-linux-release-x64-try,vm-aot-linux-debug-simarm_x64-try,vm-aot-linux-debug-simriscv64-try,vm-aot-mac-release-arm64-try,vm-aot-mac-release-x64-try,vm-aot-msan-linux-release-x64-try,vm-aot-obfuscate-linux-release-x64-try,vm-aot-tsan-linux-release-x64-try,vm-aot-ubsan-linux-release-x64-try,vm-aot-win-debug-arm64-try,vm-aot-win-debug-x64c-try,vm-aot-win-release-x64-try,vm-appjit-linux-debug-x64-try,vm-asan-linux-release-x64-try,vm-checked-mac-release-arm64-try,vm-eager-optimization-linux-release-ia32-try,vm-eager-optimization-linux-release-x64-try,vm-kernel-linux-debug-x64-try,vm-kernel-precomp-linux-release-x64-try,vm-linux-debug-ia32-try,vm-linux-debug-simriscv64-try,vm-linux-debug-x64-try,vm-mac-debug-arm64-try,vm-mac-debug-x64-try,vm-msan-linux-release-x64-try,vm-reload-linux-debug-x64-try,vm-reload-rollback-linux-debug-x64-try,vm-tsan-linux-release-x64-try,vm-ubsan-linux-release-x64-try,vm-win-debug-arm64-try,vm-win-debug-x64-try,vm-win-debug-x64c-try,vm-win-release-ia32-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/301601
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2023-10-27 07:55:47 +00:00
Tess Strickland 56a17a3e85 [vm/tests] Fix vm/dart/regress_306327173_il_test for ASAN.
TEST=vm/dart/regress_306327173_il_test

Fixes: https://github.com/dart-lang/sdk/issues/53870
Cq-Include-Trybots: luci.dart.try:vm-asan-linux-release-x64-try,vm-aot-asan-linux-release-x64-try
Change-Id: I0f507175ad48c88294b626285b5025763c235b17
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/332420
Auto-Submit: Tess Strickland <sstrickl@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Daco Harkes <dacoharkes@google.com>
2023-10-26 17:03:18 +00:00
Vyacheslav Egorov ac32223cea [vm/compiler] Improve CreateArray compile type
If we have constant type arguments include them
into the type.

This CL also expands IL tests framework with the
capability to match CompileTypes.

TEST=vm/dart/regress_53817_il_test

Bug: https://github.com/dart-lang/sdk/issues/53817
Cq-Include-Trybots: luci.dart.try:vm-aot-linux-product-x64-try,vm-aot-linux-release-arm64-try,vm-aot-linux-release-simarm_x64-try,vm-aot-obfuscate-linux-release-x64-try
Change-Id: I48722b002d9cd436dbc8ca3c9afbefa124f18996
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/331900
Commit-Queue: Slava Egorov <vegorov@google.com>
Reviewed-by: Daco Harkes <dacoharkes@google.com>
2023-10-26 12:40:02 +00:00