Make unwinding follow the awaiter link attached to the timeout handler,
which allows it to continue past the asynchronous gap into the
corresponding listeners. This significantly improves the stack trace:
for example a timing out `await Socket.connect()` now produces:
SocketException: Connection timed out, ...
_NativeSocket.connect.<anonymous closure>.<anonymous closure>
_RootZone.run (dart:async/zone.dart:1655:54)
Future.timeout.<anonymous closure>
<asynchronous suspension>
_RawSocket.connect.<anonymous closure>
<asynchronous suspension>
Socket._connect.<anonymous closure>
<asynchronous suspension>
main
<asynchronous suspension>
Where without this change it produced:
SocketException: Connection timed out, ...
_NativeSocket.connect.<anonymous closure>.<anonymous closure>
_RootZone.run
Future.timeout.<anonymous closure>
Timer._createTimer.<anonymous closure>
_Timer._runTimers
_Timer._handleMessage
_RawReceivePort._handleMessage
Which is much less informative.
TEST=vm/dart/awaiter_stacks
Fixes https://github.com/dart-lang/sdk/issues/56431
Change-Id: If4798e9e216ed88480a2b2b91ad6fa13dcb14ca4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/380982
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Slava Egorov <vegorov@google.com>
Reviewed-by: Lasse Nielsen <lrn@google.com>
Avoid adding environments on control flow instructions (block entries,
branches and gotos) when inserting conditional dispatch table calls.
UseTableDispatch pass is performed after EliminateEnvironments pass
which removes most environments including environments on those
instructions, so these environments are unnecessary and would have
been removed by EliminateEnvironments if it was run again.
Also, these environments confuse register allocation and cause
"unreachable code" crash in FindCover (called from ResolveControlFlow).
TEST=vm/dart/dynamic_module_pragmas_il_test
Change-Id: Ifb4b268e4cade2c71304798b4e0dfeacf1f8089b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/377842
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Slava Egorov <vegorov@google.com>
Both the regular and deferred versions of this test contain
up to six different test cases:
All platforms:
* ELF snapshot, using DWARF from the snapshot
* ELF snapshot, using DWARF from the separate debugging information
For platforms where the test can assemble snapshots:
* assembled snapshot, using DWARF from the snapshot or
the separate .dSYM package on MacOS
* assembled snapshot, using DWARF from the separate debugging
information
For MacOS only:
* creating a single-architecture universal binary from the
separate .dSYM package and extracting DWARF information from it
* creating a multi-architecture universal binary from the
separate .dSYM package and extracting DWARF information from it
Originally the tests were written using package:expect, performing
program compilation and execution separately before each test and
lazily reading DWARF information within the test itself. Since tests
using package:expect stop the program immediately on a failure,
a failing expectation keeps other independent test cases from being
checked. However, it's useful to know if the failure is limited to
only a subset of the test cases, since that helps point at which code
is to blame for the test failure(s).
Now the tests are refactored to first set up the tests by performing
all program compilation and execution first, collecting all outputs and
DWARF information as test state. Then the test cases are defined over
the collected test state using package:test instead of package:expect.
This way, as long as there is not a failure in the initial setup, all
of the applicable test cases are run even if one or more of them fail.
-----
In pkg/native_stack_traces, changes the return types of the reader
retrieval methods in the DwarfContainer class and
DwarfSnapshot.fromDwarfContainer to be nullable. If the shared object
does not contain the expected DWARF information, these methods now
return null instead of causing null check exceptions to be thrown.
Issue: https://github.com/dart-lang/sdk/issues/55612
Change-Id: I253965a95894f455e51d021e32dbf2703d8b99cf
Cq-Include-Trybots: luci.dart.try:vm-aot-dwarf-linux-product-x64-try,vm-aot-linux-debug-x64-try,vm-aot-mac-release-arm64-try,vm-aot-mac-product-arm64-try,vm-aot-mac-release-x64-try,vm-aot-win-debug-arm64-try,vm-aot-win-debug-x64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/375240
Commit-Queue: Tess Strickland <sstrickl@google.com>
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Inferred type of a covariant field should not be used as
an argument type of an implicit setter, as setter of a covariant
field performs a type check before assigning value to the field.
Correct such uses of covariant field types in unboxing
and AOT type propagation in order to avoid incorrect removal of
a type check in the implicit setter of a covariant field.
TEST=runtime/tests/vm/dart/regress_56051_test.dart
Fixes https://github.com/dart-lang/sdk/issues/56051
Change-Id: I55bfedfd96e918aac9597706c6eab1b81e1202ee
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/372721
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Decorating a field with 'vm:shared' pragma makes values in this field accessible to all isolates in an isolate group.
Introduce `channel` to the `Version` class so that the pragma can only be enabled on main and dev channels.
TEST=shared_test, shared_fail_without_flag_test
BUG=https://github.com/dart-lang/sdk/issues/55991
Change-Id: I843c9f0d2ffc9f2ced7ddc4006bb6f9ca4e2ddf4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/370064
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
This CL moves native assets resolution to the embedder.
The Dart VM looks up the asset path (for example
`['relative', 'foo.so']`) with the asset id. The embedder defines
callbacks for asset loading, and returns a handle to the dylib.
Then the VM calls the embedder again with `dlsym` to lookup the symbol.
The Dart VM & kernel compiler are responsible for the asset id to
asset path mapping. The kernel compiler compiles it into the snapshot
and the VM looks it up in the snapshot.
Relative paths are resolved relative to the isolate script uri (kernel
snapshot, jit snapshot, aot snapshot, or `dart compile exe` result).
The embedder is responsible for remembering the script uri it set when
spawning the isolate group.
This CL does not add `dlclose` or `dladdr` embedder callbacks yet.
Bug: https://github.com/dart-lang/sdk/issues/55521
Bug: https://github.com/dart-lang/sdk/issues/55966
TEST=pkg/dartdev/test/native_assets/build_test.dart
TEST=tests/ffi/native_assets/asset_relative_test.dart
Bug: https://github.com/dart-lang/sdk/issues/55410
Bug: https://github.com/dart-lang/sdk/issues/55523
Bug: https://github.com/dart-lang/sdk/issues/55207
Change-Id: I75ec4a368c5fb3d2f76b03771e796ff56bcac941
Cq-Include-Trybots: dart/try:vm-aot-linux-debug-x64-try,vm-aot-linux-debug-x64c-try,vm-aot-mac-release-arm64-try,vm-aot-mac-release-x64-try,vm-aot-obfuscate-linux-release-x64-try,vm-aot-optimization-level-linux-release-x64-try,vm-aot-win-debug-arm64-try,vm-aot-win-debug-x64-try,vm-aot-win-debug-x64c-try,pkg-linux-debug-try,pkg-linux-release-arm64-try,pkg-mac-release-try,pkg-mac-release-arm64-try,pkg-win-release-try,pkg-win-release-arm64-try,vm-aot-asan-linux-release-x64-try,vm-asan-linux-release-x64-try,vm-aot-msan-linux-release-x64-try,vm-msan-linux-release-x64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/361881
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
This will enable the standalone embedder to resolve uris in a follow
up CL:
https://dart-review.googlesource.com/c/sdk/+/361881
The implementation was using zones for allocation, this CL switches
that to using `malloc`. The caller is responsible for freeing the
memory if resolving succeeds.
This CL removes `Dart_DefaultCanonicalizeUrl`.
We don't have a run_platform_tests, so this CL keeps the tests in
run_vm_tests.
TEST=vm/cc/ParseUri
TEST=vm/cc/ResolveUri
TEST=tests/ffi/native_assets/asset_relative_test.dart
Bug: https://github.com/dart-lang/sdk/issues/55523
Change-Id: Ifb300d8164eb50506f22ce619fad0811f74ef34c
Cq-Include-Trybots: luci.dart.try:vm-aot-asan-linux-release-x64-try,vm-aot-msan-linux-release-x64-try,vm-asan-linux-release-arm64-try,vm-asan-linux-release-x64-try,vm-msan-linux-release-arm64-try,vm-msan-linux-release-x64-try,pkg-linux-debug-try,pkg-linux-release-arm64-try,pkg-linux-release-try,pkg-mac-release-try,pkg-mac-release-arm64-try,pkg-win-release-arm64-try,pkg-win-release-try,vm-aot-linux-debug-x64-try,vm-linux-debug-x64-try,vm-reload-linux-debug-x64-try,vm-reload-rollback-linux-debug-x64-try,vm-aot-win-debug-x64-try,vm-win-debug-arm64-try,vm-mac-debug-x64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/368423
Reviewed-by: Martin Kustermann <kustermann@google.com>
Make tool (by default) give error when test entry specified in status
file does not exist. Make -w (by default) remove such entries.
Cleanup most status files, fixing a few entries containing `.dart` and
removing obsolete entries (i.e. entries pointing to nonexisting tests).
This should for instance have given an error in
https://dart-review.googlesource.com/c/sdk/+/370600 saying that the file
I specified didn't exist (in that I shouldn't have specified the `.dart`
part).
TEST=No tests, this is status file maintenance.
Change-Id: Ie977bf15dea2e3dad8d771fd3e99917317e975f6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/370886
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
No client of the VM uses this flag, only tests, and this flag was always
set to false in AOT mode. Thus, remove uses of this flag and instead
always lazily create dispatchers as needed when resolving method names
in JIT mode.
Remove the implicit value of `allow_add` for some Resolver
static methods. For callers that previously depended on the implicit
`true` value (which includes the AOT precompilier), pass `true` for
uses in the compiler and pass `!FLAG_precompiled_mode` for uses in the
runtime. Assert that `allow_add` is false when these methods are invoked
from the precompiled runtime.
Remove Resolver static methods that are no longer used.
TEST=ci
Change-Id: Ib6a7354f7a859e86743c381513a4129c14895753
Cq-Include-Trybots: luci.dart.try:vm-linux-debug-x64-try,vm-linux-release-x64-try,vm-aot-linux-debug-x64-try,vm-aot-linux-release-x64-try,vm-aot-mac-release-arm64-try,vm-mac-debug-arm64-try,vm-mac-release-arm64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/366668
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Tess Strickland <sstrickl@google.com>
In the backend, handle the following cases that were assumed not to
happen before:
* If the index and offset are both 0, then the operation is a no-op
and so the output register should be the same as the first input.
(Should only happen if the instruction is used in a non-optimizing
context, as otherwise it is removed by canonicalization.)
* If the scaled index can be used as an instruction immediate and the
offset is 0, then emit the appropriate instruction(s).
* If the scaled index and offset can both be used as immediates to
instructions, but their sum (the total offset in bytes) cannot, then
allocate a register for the index and fall back to the non-constant
index case.
CalculateElementAddress::Canonicalize now only performs removal of
no-op instructions.
This CL also fixes a switch on the instruction tag in
FlowGraph::RenameRecursive to appropriately convert UnboxedConstant
instructions to initial definitions of the FlowGraph as it already does
for Constant instructions.
TEST=vm/dart/regress_55877
Issue: https://github.com/dart-lang/sdk/issues/55877
Cq-Include-Trybots: luci.dart.try:vm-aot-linux-debug-simarm_x64-try,vm-aot-linux-debug-simriscv64-try,vm-aot-linux-debug-x64-try,vm-aot-linux-debug-x64c-try,vm-linux-debug-ia32-try,vm-linux-debug-x64-try,vm-linux-debug-x64c-try,vm-linux-debug-simriscv64-try,vm-mac-debug-arm64-try,vm-aot-mac-release-arm64-try
Change-Id: I613d6c8770fe02facf6bbdb3d2b11f842b51540d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/369642
Commit-Queue: Tess Strickland <sstrickl@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
The ASSERT checks that there will be no overflow in computing the byte
offset from the index. However, any instruction that uses this method is
preceded by a bounds check of the index, and an index that would cause
the byte offset calculation to overflow is guaranteed to fail the bounds
check. Thus, this is dead code that will never be executed at runtime
and it is okay to emit code to perform the erroneous offset calculation.
TEST=vm/dart/regress_55864
Fixes: https://github.com/dart-lang/sdk/issues/55864
Change-Id: If4126e412368b8307be3c787ccb6bd451764c73f
Cq-Include-Trybots: luci.dart.try:vm-aot-linux-debug-simarm_x64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/368563
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Tess Strickland <sstrickl@google.com>
Previously we would only fuse this pattern for Smi operations
which (almost) never happens in AOT. This CL enables fusion
for Int64 operations as well.
The implementation is limited to X64 and ARM64 for now
because implementing it on 32-bit platforms is somewhat
cumbersome.
Issue https://github.com/dart-lang/sdk/issues/55522R=alexmarkov@google.com
TEST=vm/cc/IL_TestIntInstr,vm/dart/test_int_pattern_il_test
Cq-Include-Trybots: luci.dart.try:vm-linux-release-simarm-try,vm-aot-linux-release-simarm_x64-try,vm-aot-linux-debug-simarm_x64-try,dart-sdk-linux-riscv64-try,vm-aot-linux-debug-simriscv64-try,vm-ffi-qemu-linux-release-riscv64-try,vm-linux-debug-simriscv64-try,vm-linux-release-ia32-try
Change-Id: I62a482640db45befac6b0b78850f23a8cc624c75
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/365463
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Slava Egorov <vegorov@google.com>
Dead Store Elimination (DSE) propagates "dead store" state backwards
across basic blocks to predecessors. If place is defined in a loop
(either its instance or index are defined in a loop), propagating
"dead store" state across backedge of the loop is incorrect, as each
loop iteration effectively has its own place.
This bug is fixed by disabling propagation of "dead store"
state beyond defining blocks of instance and index of a place.
This is done by setting bits in "live_in" of the blocks corresponding
to the instance and index definitions of a place.
TEST=runtime/tests/vm/dart/regress_55607_test.dart
Fixes https://github.com/dart-lang/sdk/issues/55607
Change-Id: I223ff433daa3d7bcafefc9d91360b16c9554964e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/365302
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Slava Egorov <vegorov@google.com>
This reverts commit cd2c566bcf.
Reason for revert: Updating to not remove field used by Flutter engine.
Original change's description:
> Revert "Tweak `expect.dart` library."
>
> This reverts commit ff5f391c0a.
>
> Reason for revert: The expect library is used by Flutter engine, and some of its tests use assertStatementsEnabled. There should be a migration path that doesn't require an atomic change, like adding the replacement api before removing the old one.
>
> Original change's description:
> > Tweak `expect.dart` library.
> >
> > Make API more consistent for a few methods.
> > Reduce the number of language features used in tests:
> > * Never iterating an iterable, always converting it
> > using `.toList()` first and iterating using indices
> > (fx `setEquals`).
> > Also require a `List` in places where an `Iterable`
> > wasn't necessary.
> > * Avoid doing complicated computations that are also
> > used for the error message. Do simple check first,
> > then recompute to get better error messages
> > (fx `allDistinct`).
> >
> > Renamed some rarely used members for consistency
> > (`stringContainsInOrder`->`containsInOrder`,
> > where other string-contains functions just start
> > with `contains`, and `containsOneOf` -> `containsAny`
> > to match `Iterable.any` phrasing, and also it accepts
> > if containing at least one, not precisely one.)
> >
> > Removed a function that wasn't used anywhere.
> >
> > Moved `assertStatementsEnabled` to `variations.dart` as `asserts`.
> > Removed `typeAssertionsEnabled` and `checkedModeEnabled`. The former used in one place, where it was replaced with `checkedImplicitDowncasts` from `variations.dart`, the latter wasn't used anywhere.
> >
> > Deprecates `package:expect/minitest.dart`. It was never intended
> > to be used for new tests, only as a help to convert existing tests
> > written against `package:unit_test`.
> > All existing imports marked as `// ignore: deprecated_member_use`.
> >
> > Change-Id: I07e21d4c0f3ccf11b82ee34af2668fdbb22264d2
> > Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/352360
> > Reviewed-by: Slava Egorov <vegorov@google.com>
> > Reviewed-by: Ömer Ağacan <omersa@google.com>
> > Reviewed-by: Nate Bosch <nbosch@google.com>
> > Reviewed-by: Stephen Adams <sra@google.com>
> > Commit-Queue: Lasse Nielsen <lrn@google.com>
>
> Change-Id: I360b4347470a0bb2b63c3108e2b83ee2a771bf3f
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/362020
> Reviewed-by: Nate Bosch <nbosch@google.com>
> Reviewed-by: Ömer Ağacan <omersa@google.com>
> Reviewed-by: Stephen Adams <sra@google.com>
> Reviewed-by: Leaf Petersen <leafp@google.com>
> Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
> Commit-Queue: William Hesse <whesse@google.com>
CoreLibraryReviewExempt: Reland
Change-Id: I53db40edc0733842a008839c3913d51c885e39ab
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/362502
Reviewed-by: Alexander Thomas <athom@google.com>
Reviewed-by: Nate Bosch <nbosch@google.com>
Reviewed-by: Ömer Ağacan <omersa@google.com>
Reviewed-by: Slava Egorov <vegorov@google.com>
Reviewed-by: William Hesse <whesse@google.com>
Commit-Queue: Lasse Nielsen <lrn@google.com>
This pragma forces compiler to align loop headers within the
function by architecture specific boundary: 32 bytes on X64
and ARM64 (with the exception of Apple Silicon, which explicitly
discourages aligning branch targets in the optimization manual).
Current implementation is rather naive and does not do any
attempt to decide whether aligning is actually profitable
based on loop body itself.
I have found this pragma to be helpful both to stabilize
benchmark results and achieve better performance
for tight loops on Intel hardware.
Issue https://github.com/dart-lang/sdk/issues/55522
TEST=vm/dart/align_loops_test
Cq-Include-Trybots: luci.dart.try:vm-aot-linux-product-x64-try,vm-aot-linux-debug-x64c-try,vm-aot-linux-debug-x64-try,vm-aot-linux-release-arm64-try,vm-aot-linux-release-simarm_x64-try,vm-aot-linux-release-x64-try,vm-aot-mac-product-arm64-try,vm-aot-mac-release-arm64-try,vm-aot-mac-release-x64-try,vm-aot-obfuscate-linux-release-x64-try,vm-aot-optimization-level-linux-release-x64-try,vm-aot-win-release-x64-try,vm-aot-win-debug-arm64-try,vm-aot-win-debug-x64-try,vm-aot-win-debug-x64c-try,vm-aot-win-product-x64-try,vm-aot-win-release-arm64-try,vm-aot-linux-debug-simarm_x64-try,vm-aot-linux-debug-simriscv64-try,vm-aot-dwarf-linux-product-x64-try,vm-aot-android-release-arm64c-try,vm-aot-android-release-arm_x64-try
Change-Id: Ic22fb90d85e7fdebeeaa3908a43328c59436ab58
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/364121
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Slava Egorov <vegorov@google.com>
There's no reason for this test, which itself spawns subprocesses and
reloads them via vm-service API to be running as part of iso-stress
builder.
(It causes flaky `Bad state: WebSocket is closed` failures on iso-stress
atm)
Change-Id: I3df7198defb42bd830b1b96ee4083ce61f6b67d4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/364102
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Previously, Internal_randomInstructionsOffsetInsideAllocateObjectStub
assumed the entry point is at the start of the instructions payload when
choosing a random offset into the instructions payload. However, most
of our architectures have non-zero entry point offsets.
Instead, replace it with two methods, one that returns the start
(inclusive) and one that returns the end (exclusive) of the
AllocateObject stub instructions payload and have the test choose
points inside and outside of that range to test.
TEST=vm/dart/use_dwarf_stack_traces_flag_test
Fixes: https://github.com/dart-lang/sdk/issues/50286
Cq-Include-Trybots: luci.dart.try:vm-aot-dwarf-linux-product-x64-try,vm-aot-linux-release-x64-try,vm-aot-linux-debug-x64-try,vm-aot-mac-release-arm64-try,vm-aot-mac-product-arm64-try
Change-Id: Ia8965c72fbc6f6d2c178778a32f8083923a8b243
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/363080
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Auto-Submit: Tess Strickland <sstrickl@google.com>
Commit-Queue: Tess Strickland <sstrickl@google.com>
Dart VM changes:
Note that the following changes are backwards compatible in the
case that a Dart program has no deferred loading units (i.e., the
Dart program is contained in a single shared object snapshot).
When there are non-root loading units, the non-symbol stack trace
header now includes information about loading units as follows:
loading_unit: N, build_id: S, dso_base: A, instructions: A
where N is an integer, S is a string of hex digits (0-9a-f), and A
is a word-sized address printed as a hex string (without prefix).
In addition, all non-symbolic stack frames for isolate instructions
include a unit field, including those for the root loading unit, e.g.,
#NN abs <address> unit <id> virt <address> <symbol>+<offset>
If there are no non-root loading units, then the non-symbolic stack
trace is unchanged from its previous format.
Adds a build ID to split deferred loading unit snapshots.
Fixes: https://github.com/dart-lang/sdk/issues/43516
If separate debugging information is requested, the loading unit
manifest includes a 'debugPath' field for each loading unit,
which contains the path to its separate debugging information.
Removes the attempt to store the relocated address of the instructions
section when running from an assembled snapshot in the initialized BSS.
Adds OS::GetAppDSOBase, which takes a pointer to the instructions
section and returns a pointer to its loaded shared object in memory.
For compiled-to-ELF snapshots, it does this using the relocated address
of the instructions in the Image, and for assembled snapshots, it
delegates to NativeSymbolResolver::LookupSharedObject.
-----
Changes to package:native_stack_traces:
PCOffset now has two new fields:
* int? unitId: the unit ID of the loading unit, when available.
* String? buildId: the build ID of the loading unit, when available.
For PCOffsets in the VM section, the unitId and buildId are those of
the root loading unit.
The constructor for the DwarfStackTraceDecoder now takes two
additional optional named arguments:
* Map<int, Dwarf>? dwarfByUnitId: A map associating loading unit IDs
with the appropriate Dwarf object. May or may not contain an entry
for the root loading unit.
* Iterable<Dwarf>? unitDwarfs: An iterable container holding Dwarf
objects. May or may not contain an entry for the root loading unit.
The Dwarf object that is passed to the DwarfStackTraceDecoder as a
positional argument is used for all lookups within the root loading
unit. If the dwarfByUnitId or unitDwarfs arguments contain an entry
for the root loading unit, it should be the same as the positional
argument.
When decoding a non-symbolic stack frame with a non-root loading unit
id, the decoder first looks in the map for the appropriate Dwarf object.
If one is not found, the decoder uses the build ID for the loading unit
to find the appropriate Dwarf object in the iterable container. If an
appropriate Dwarf object cannot be found in either manner, the
non-symbolic stack frame is emitted without change.
The native_stack_traces:decode executable now takes two additional
multi-options for the translate command:
* -u, --unit_debug: Takes a path to the associated DWARF information.
* --unit_id_debug: Takes N=FILE, where N is the loading unit ID and
FILE is a path to the associated DWARF information.
The arguments to -u are collected into an iterable container to be
passed as the unitDwarfs argument to the DwarfStackTraceDecoder, and
the arguments to --unit-id-debug are collected into a map to be passed
as the dwarfByUnitId argument.
TEST=vm/dart/use_dwarf_stack_traces_flag_deferred
Issue: https://github.com/dart-lang/sdk/issues/53902
Change-Id: I210d4f69e4ae9fd37275a96beb1aac55c5e9d080
Cq-Include-Trybots: luci.dart.try:vm-aot-dwarf-linux-product-x64-try,vm-aot-linux-release-x64-try,vm-aot-linux-debug-x64-try,vm-aot-mac-release-arm64-try,vm-aot-mac-product-arm64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/362380
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Tess Strickland <sstrickl@google.com>
Parameters of catch block entry corresponding to the exception and
stack trace are live only after catch block entry, and they should not be
scanned by GC if it occurs at catch block entry PC before control is
transferred to the catch block.
TEST=runtime/tests/vm/dart/regress_55442_test.dart
Fixes https://github.com/dart-lang/sdk/issues/55442
Change-Id: I09b8152544eb14187ad62a11902e080d41722bf4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/363423
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
This is a reland of commit a7e2dce0cc
Fixes the crash during code generation when typed data view
LoadIndexed was used on an internal typed data array
(in the unreachable code path) without loading its payload.
TEST=runtime/tests/vm/dart/regress_b_334128316_test.dart
TEST=manually verified repro from b/334128316
Original change's description:
> [vm] Implement typed data view GetIndexed in flow graph builder
>
> Typed data view 'operator []' is now implemented in the flow
> graph builder. This unifies all typed data GetIndexed operations
> and removes unnecessary address calculations.
>
> TEST=ci
>
> Change-Id: I8d2ca6e7c7bf18b2590536a643f92cad5beb6d95
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/361283
> Reviewed-by: Tess Strickland <sstrickl@google.com>
> Commit-Queue: Alexander Markov <alexmarkov@google.com>
> Reviewed-by: Slava Egorov <vegorov@google.com>
Change-Id: I3786fa17e971f8ba6cd01a57f1a68504bf24bc47
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/362821
Reviewed-by: Tess Strickland <sstrickl@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Slava Egorov <vegorov@google.com>
Typed data view 'operator []' is now implemented in the flow
graph builder. This unifies all typed data GetIndexed operations
and removes unnecessary address calculations.
TEST=ci
Change-Id: I8d2ca6e7c7bf18b2590536a643f92cad5beb6d95
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/361283
Reviewed-by: Tess Strickland <sstrickl@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Slava Egorov <vegorov@google.com>
This flag only makes sense without sound null safety. VM no longer
supports unsound mode, so it can be removed.
In sound mode this flag is always true.
TEST=ci
Change-Id: I4a5fa60d9b351b6281efab9462ef2dd2c5565a7c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/362182
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>