No need to repeat predefined native fields in
IsRecognizedMethodForFlowGraph.
TEST=CQ, this is a simple refactoring.
Change-Id: I8079f1f08aaa67fbf09cf312608fa34d750a0abc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/233800
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
The IL body various recognized methods is identical (ignoring slot):
* 19 native field getters
* 5 native field setters with store barrier
* 3 native field setters without store barrier
Also, some recognized methods target the same slot (they share a base
class in raw_object.h but not in Dart).
This prevents us from making the slot name identical to the recognized
method name.
These irregularities prevents us just defining a slot list as per
https://dart-review.googlesource.com/c/sdk/+/229544/15/runtime/vm/compiler/frontend/kernel_to_il.cc#1355
However, this CL still makes kernel_to_il.cc more succinct.
TEST=This only moves some code. CQ should cover this.
Change-Id: I1f4eb2f76d89b5d4342d58624475aee7e12c5de6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/233566
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
This changes the hash of existing recognized methods. So its better to
land this separately from the CL that starts recognizing more methods in
`dart:_internal`:
https://dart-review.googlesource.com/c/sdk/+/229544
All private names are mangled, and the index of the library depends on
the order the libraries are registered.
TEST=SDK build, which checks the hashes.
Change-Id: I61b34859bb74e788f0828b164c637a2efd492901
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/233565
Reviewed-by: Martin Kustermann <kustermann@google.com>
These helpers will allow building a graph, modifying it and runnign more
compiler passes on them as well as easily building assembly stubs for
testing purposes.
TEST=Adds test helpers
Change-Id: I3bfef21e1370a7c99c9bbbe4f123211f6d9fe964
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/233781
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
_GrowableList._withData constructor can be implemented in flow graph and
inlined, instead of having an asm intrinsic implementation.
This change also adds a specialized allocation stub for _GrowableList
class to offset slower general-purpose allocation stub.
TEST=ci
Fixes https://github.com/dart-lang/sdk/issues/48255
Change-Id: Ice0ca9156d7a504960cce1718ffd9aca24a9a3d1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/231527
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
This CL
* Makes :async_op only have two parameters: We take advantage
of the fact that errors not only have exception != null but
also stacktrace != null.
* Makes :async_op have no optional parameters. This reduces
code size significantly.
* Removes unused parameter in _awaitHelper calls
* Wrap the then callback instead of the error callback. (needed
to make optional parameters required)
This results in 2% code savings on a big g3 app.
The size of :async_op shrinks on average by 11%
TEST=ci
Change-Id: I38d5fba4ebebc780b48dac5aa6a250d2c7952bfd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/233362
Reviewed-by: Slava Egorov <vegorov@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
Class Assembler defines its second parameter as:
` intptr_t far_branch_level = 0`
So the previous code would implicit pass 0 or 1 from the bool
`use_far_branches`.
This is a clang-tidy presubmit error.
The error was introduced when the Assembler class was changed in:
https://dart-review.googlesource.com/c/sdk/+/217289
TEST=None
Change-Id: I69d71b4d57bdaab7be5200a6d06a751d3935e10d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/233560
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Commit-Queue: Clement Skau <cskau@google.com>
The pragma can be used to annotate functions which should not appear in
stack traces unless --show-invisible-frames is passed to the VM.
TEST=vm/dart{,_2}/invisible_function_pragma_test
Change-Id: I807359146f16b67913697f07416fbe8ce9aaa6e1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/233381
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
The new space tests were evacuating new space, letting the scavenger
promote everything and then immediately running the marker.
This did not test the state right after running only the scavenge.
TEST=runtime/vm/object_test.cc
Change-Id: I3272f62a38ff5d38e76c83c831c3742e4951aa56
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/233280
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
This is a reland of 19e5749308
TEST=runtime/tests/vm/dart/analyze_snapshot_binary_test.dart
Original change's description:
> [vm] Add analyze_snapshot tool for AOT snapshot inspection
>
> Current skeleton to allow for instrumentation snapshots that can be
> built alongside Dart compilation artifacts and easily referenced for
> specific versions between Snapshot hash <-> DartSDK <-> Flutter Engine
>
> TEST=runtime/tests/vm/dart/analyze_snapshot_binary_test.dart
>
> Change-Id: Ie3757a265bbf457506c72fb62a625fea7bedcb68
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/221087
> Reviewed-by: Slava Egorov <vegorov@google.com>
> Commit-Queue: Slava Egorov <vegorov@google.com>
Change-Id: Ia1ea0071d30818440ae48484ff6c406236af5a4e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/224526
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Slava Egorov <vegorov@google.com>
The --enable-assertions flag is not avaiable in PRODUCT mode, so we skip
this negative subtest.
TEST=Fixes dartkp-product on a newly added test for vm/dart{,_2}/spawn_uri_aot_test
Change-Id: Ie7be219b6eb2a2ac53ea5048a844fafeb488ba54
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/232941
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
Right now the implementation of `Isolate.spawnUri(<uri>, ...)` in
the standalone embedder is to ignore `<uri>` and make the spawnned
isolate from the same AOT snapshot as the main isolate.
This is very confusing and very incorrect.
Instead `Isolate.spawnUri()` should work if-and-only-if the given
`<uri>` points to a valid and compatible AOT snapshot. If not, it should
throw an appropriate exception.
Fixes https://github.com/dart-lang/sdk/issues/48375
Fixes https://github.com/dart-lang/sdk/issues/48326
TEST=vm/dart{,_2}/spawn_uri_aot_test
Change-Id: I279ace08ac1b9a9eed3ae03ebe5d9e2336c1e5c9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/232603
Reviewed-by: Tess Strickland <sstrickl@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
* Add team "groups" in tools/OWNERS_<group name>.
* Add top-level OWNERS as a fallback.
* Add OWNERS for all top-level directories.
* Add OWNERS to all packages.
For additional background information see go/dart-sdk-owners.
TEST=No op until code-owners is enabled.
Bug: b/200915407
Change-Id: I7fe6116cc599c749cd50ca16151d6d6a801d99d7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/229147
Reviewed-by: Jonas Termansen <sortie@google.com>
The test is flakily failing with low propabililty due to a race on
executing a copy of `process_test` and having this file opened for
writing mode (so it seems).
This issue is not related to isolates and we'll therefore remove it from
the "iso-stress" builder.
TEST=Removes flakiness from "iso-stress" builder.
Closes https://github.com/dart-lang/sdk/issues/48193
Change-Id: I1f817aed9b014b8cdd7a646f35003d40d4712d0a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/232624
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
This test was modified (in [0]) to use `dart:mirrors` which doesn't
work in AOT mode. Only tests that work in AOT are considered for
the iso-stress builder.
[0] https://dart-review.googlesource.com/c/sdk/+/230600
TEST=Fixes "iso-stress" builder failure to compile.
Change-Id: I354784a33550d816332611747c4d41b53d44b2a4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/232621
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
This CL implements `WeakReference` in the VM.
* This reduces the size of weak references from 2 objects using 8 words
to 1 object using 4 words.
* This makes loads of weak reference targets a single load instead of
two.
* This avoids the fix-point in the GC and message object copying for
weak references. (N.b. Weak references need to be processed _after_
the fix-point for weak properties.)
The semantics of weak references in messages is that their target gets
set to `null` if the target is not included in the message by a strong
reference.
The tests take particular care to exercise the case where a weak
reference's target is only kept alive because a weak property key is
alive and it refers to the target in its value. This exercises the fact
that weak references need to be processed last.
Does not add support for weak references in the app snapshot. It would
be dead code until we start using weak references in for example the
CFE.
This CL does not try to unify weak references and weak properties in
the GC or messaging (as proposed in go/dart-vm-weakreference), because
their semantics differ enough.
Closes: https://github.com/dart-lang/sdk/issues/48162
TEST=runtime/tests/vm/dart/finalizer/weak_reference_run_gc_test.dart
TEST=runtime/tests/vm/dart/isolates/fast_object_copy_test.dart
TEST=runtime/vm/object_test.cc
TEST=tests/lib/isolate/weak_reference_message_1_test.dart
TEST=tests/lib/isolate/weak_reference_message_2_test.dart
Change-Id: I3810e919a5866f3ae8a95bd9aa23a880a0b0921c
Cq-Include-Trybots: luci.dart.try:app-kernel-linux-debug-x64-try,dart-sdk-mac-arm64-try,vm-canary-linux-debug-try,vm-fuchsia-release-x64-try,vm-kernel-gcc-linux-try,vm-kernel-asan-linux-release-x64-try,vm-kernel-linux-debug-x64c-try,vm-kernel-linux-debug-x64-try,vm-kernel-linux-debug-simriscv64-try,vm-kernel-mac-debug-x64-try,vm-kernel-nnbd-linux-debug-x64-try,vm-kernel-nnbd-linux-release-ia32-try,vm-kernel-nnbd-linux-release-simarm64-try,vm-kernel-nnbd-linux-release-simarm-try,vm-kernel-nnbd-mac-debug-arm64-try,vm-kernel-nnbd-mac-debug-x64-try,vm-kernel-nnbd-win-release-ia32-try,vm-kernel-nnbd-win-release-x64-try,vm-kernel-optcounter-threshold-linux-release-x64-try,vm-kernel-precomp-android-release-arm_x64-try,vm-kernel-precomp-linux-debug-x64-try,vm-kernel-precomp-linux-debug-x64c-try,vm-kernel-precomp-win-debug-x64c-try,vm-kernel-reload-rollback-linux-debug-x64-try,vm-kernel-reload-linux-debug-x64-try,vm-kernel-win-debug-ia32-try,vm-kernel-win-debug-x64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/232087
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
The serial scavenger was expecting the typed_data field of views.
Fast object copy leaves a null there temporarily.
Closes: https://github.com/dart-lang/sdk/issues/48360
TEST=runtime/tests/vm/dart/isolates/fast_object_copy_test.dart
Change-Id: I72a2785cd9708e72593d35179536a831193d2a44
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/232260
Reviewed-by: Martin Kustermann <kustermann@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Fixes cases with passing floats, passing aggregates by value, passing scalars requiring alignment.
The remaining failing tests look like some kind of corruption or register reuse when passing very large numbers of arguments.
TEST=ci
Bug: https://github.com/dart-lang/sdk/issues/48164
Change-Id: Ibac32d4f291255e1c2eb8fd1b196b3e2f006f610
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/231282
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Use `hasScheme` in place of comparing against the empty string, and
`isScheme` to compare against all other schemes.
TEST=No behavior changes.
Change-Id: Ifc9fd13c6cf37933ebd4a754c4b500dedbcb291b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/231185
Reviewed-by: Kevin Moore <kevmoo@google.com>
Commit-Queue: Nate Bosch <nbosch@google.com>
The real token position is required in case debugger stopped on
an exception thrown from AssertAssignable and trying to evaluate
an expression which uses receiver. Without token position all local
variables (including receiver) are considered out of scope
(as frame's token position is out of range).
TEST=runtime/observatory/tests/service/regress_48279_test.dart
Fixes https://github.com/dart-lang/sdk/issues/48279
Change-Id: Idb6a8e12185367ceac2034269b8f046272384006
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/231748
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Previously all arrays were excluded from WB elimination pass
to avoid invariant restoration code creating excessive work
for the GC and to avoid dealing with card marking in the
invariant restoration code.
It seems reasonable to enable this for small arrays of up to 8
elements. The cut of point of 8 elements was chosen based on the
cut of point for literal<N> specialisations provided by the
core library for creating small literal arrays.
TEST=vm/cc/IRTest_WriteBarrierElimination_Arrays
Cq-Include-Trybots: luci.dart.try:vm-kernel-precomp-dwarf-linux-product-x64-try,vm-kernel-precomp-linux-debug-simarm_x64-try,vm-kernel-precomp-linux-debug-x64-try,vm-kernel-precomp-linux-debug-x64c-try,vm-kernel-precomp-linux-product-x64-try,vm-kernel-precomp-linux-release-simarm-try,vm-kernel-precomp-linux-release-simarm64-try,vm-kernel-precomp-linux-release-simarm_x64-try,vm-kernel-precomp-linux-release-x64-try
Change-Id: I2b3169865f07c3ff95820c1bc6718943e96bd33b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/229903
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Slava Egorov <vegorov@google.com>
In general any async function can return X or Future<X>. Though the
future implementation has to do different things depending on which case
we're in. It does so by using a `<obj> is Future<T>` test. This test is very
expensive if many different classes flow into `<obj>`.
Though most functions do not return `Future` objects from async
functions. We can determine that statically by looking if any returned
expression could be a future. If not, we can bypass the `is Future<T>`
test entirely.
Issue https://github.com/dart-lang/sdk/issues/48226
Issue https://github.com/dart-lang/sdk/issues/48235
TEST=pkg/front_end/testcases/general/async_function_returns_future_or.dart
Change-Id: If655bdbdddc214dd7b12be9905b3c788252547d0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/230662
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Lasse Nielsen <lrn@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
This reverts commit e32d98cd06.
Reason for revert: Dart rolls into the engine are failing because there are references to run_binary_size_analysis in the "Upload artifacts android-arm64-release" step of the build
Original change's description:
> [tools] Replace the Chromium binary size tool, which no longer works.
>
> Change-Id: Id84717e21a129a392d3bc4e9b4cce84dfb4771e1
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/231066
> Reviewed-by: Ben Konyi <bkonyi@google.com>
# Not skipping CQ checks because original CL landed > 1 day ago.
Change-Id: Ibfbdf1e0a970ad7fae9ec1d39d24722647b38730
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/231600
Reviewed-by: Siva Annamalai <asiva@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Siva Annamalai <asiva@google.com>