When uploading to the App Store, the program must contain an
LC_ENCRYPTION_INFO segment in the Mach-O header so the App Store
can appropriately modify it for its purposes without changing the
header size and/or offsets/addresses in the rest of the shared object.
By default, the load command is only added to iOS snapshots, but
it can be added to any Mach-O snapshot using the --macho-encryptable
command line option.
TEST=vm/dart/use_macho_options_test
Cq-Include-Trybots: luci.dart.try:vm-aot-mac-debug-x64-try,vm-aot-mac-debug-arm64-try,vm-aot-linux-debug-x64-try
Change-Id: I4e79fd9cfb9ba9d49707ec209eca3fee1cefc28c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/475040
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Tess Strickland <sstrickl@google.com>
Tests from language/vm were moved to vm/dart/language, so move the
related lines from the status files.
Also fix the list of tests for the stress test trybot.
TEST=ci on vm-aot-dwarf-linux-product-x64
vm-aot-obfuscate-linux-release-x64
vm-appjit-linux-debug-x64
vm-appjit-linux-product-x64
vm-appjit-linux-release-x64
Cq-Include-Trybots: luci.dart.try:vm-appjit-linux-release-x64-try,vm-appjit-linux-product-x64-try,vm-appjit-linux-debug-x64-try,vm-aot-dwarf-linux-product-x64-try,vm-aot-obfuscate-linux-release-x64-try
Change-Id: I48eb25207551c0a9ba637023d36497f184c4a4b7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/474700
Reviewed-by: Erik Ernst <eernst@google.com>
Commit-Queue: Tess Strickland <sstrickl@google.com>
Closures going into shared variables in particular have to be confirmed to capture appropriate values.
BUG=https://github.com/dart-lang/sdk/issues/62179
TEST=run_isolate_group_run_test
Cq-Include-Trybots: luci.dart.try:vm-dyn-linux-debug-x64-try,vm-dyn-mac-debug-arm64-try,vm-aot-dyn-linux-debug-x64-try
Change-Id: I27416773fd77077018739ea4dbcc6e4695e67be8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/469103
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
Inform ASAN and MSAN about reads and writes through FFI pointers or external typed data. Previously we only informed MSAN about writes, which was enough to prevent false positives in foreign code, but gave false negatives for Dart code. This mostly uses the same machinery used for TSAN, and replaces some of the existing MSAN unpoison calls.
Also fixes some marshalling of compounds by value that generate loads extending past the end of the compound.
TEST=ci
Bug: https://github.com/dart-lang/sdk/issues/62221
Change-Id: Ia3573edb5a0aec32b6a57035a63e8f323a655ecc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/467401
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
TSAN's vector clocks become more expensive as the number of threads that touch a variable increases. The Mac/Windows/Fuchsia profilers will sample threads by suspending it and accessing it from another thread.
Cf. 13507d2594.
Change-Id: Ib303e09f04ecfdcd3b78906f850ddc2033e7b27e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/466900
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
The code for inheriting stdio handles was not taking into account that
some of the stdio handles might be the same causing them to be
duplicated in the list of inherited handles. However passing duplicate
handles in PROC_THREAD_ATTRIBUTE_HANDLE_LIST causes CreateProcess to
return E_INVALIDARG.
This CL fixes the code to avoid duplicate handles.
We also fix printing of errors, which was broken when Process::Exec
was used without Dart scope causing it to print (null) instead of
actual error message.
Fixes https://github.com/dart-lang/sdk/issues/61981
TEST=vm/dart/regress_61981
Fixed: 61981
Change-Id: I93a6b56476f5020de9ebf894614cee51586b6751
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/464382
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Slava Egorov <vegorov@google.com>
Since the only captured variable in the context for an implicit
instance closure is this, the allocation of a context object is
elided and instead the instance is stored directly as the "context".
In the debugger, create the elided context object for implicit instance
closures when retrieving the saved context from an implicit instance
closure activation frame.
Without this, any attempt to GetSavedCurrentContext() on an
ActivationFrame for an implicit instance closure (e.g., when
--trace-debugger-stacktrace is enabled) breaks due to the assert
in debug mode, and returns a null context (which isn't correct either)
in non-debug modes.
TEST=vm/dart/regress_cl_463021
Change-Id: I2ba22407695f432a30d23d342f33dfe2a00ba308
Cq-Include-Trybots: luci.dart.try:vm-dyn-linux-debug-x64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/463021
Commit-Queue: Tess Strickland <sstrickl@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Technically dsymutil may be available, but for most simulated
architectures we don't support emitting a Mach-O relocatable object,
and the ones where we do are already tested by the real architectures.
TEST=vm/dart/use_dwarf_stack_traces_flag and
vm/dart/use_macho_reduce_padding_flag on AOT simulators.
Cq-Include-Trybots: luci.dart.try:vm-aot-win-release-x64-try,vm-aot-linux-release-simarm_x64-try
Change-Id: I648f1e4f5f7ccf5886752368995b7300952e5af2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/463360
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Auto-Submit: Tess Strickland <sstrickl@google.com>
This allows analyze_snapshot to analyze Mach-O snapshots as well, and
also removes the restriction on only building analyze_snapshot for
Linux and Android.
TEST=vm/dart/analyze_snapshot_binary_test
Change-Id: I82797db2f20a4a80cdc52922aeebc789f45bf9bb
Cq-Include-Trybots: luci.dart.try:vm-aot-mac-release-arm64-try,vm-aot-win-release-x64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/461482
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Tess Strickland <sstrickl@google.com>
In order to appropriately generate .dSYMs for a snapshot and allow
the strip tool to be used on the snapshot afterwards, add a mode that
not only outputs the snapshot (sans DWARF information) but also
an associated relocatable object file that contains the program's DWARF
information. That allows dsymutil to retrieve the DWARF information
from the relocatable object when run on the snapshot prior to stripping.
To specify that the relocatable object file should be output, use
the new --macho-object command line argument to gen_snapshot
to specify where the object file should be written.
This CL also adds an additional command line argument,
--macho-reduce-padding, which reduces the alignment used for segments
and the text/const sections in Mach-O outputs from 16KB to 64 bytes.
The larger padding is needed for some uses, like non-native loading
of Mach-O objects, but can be elided for other uses like Flutter builds.
TEST=vm/dart/use_dwarf_stack_traces_flag_test
vm/dart/use_macho_reduce_padding_flag_test
Change-Id: I2bf4bacb70c41299b8b6fdb7635c2374acf7a07d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/457420
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Tess Strickland <sstrickl@google.com>
I want to do some refactoring, and it's easier to manage if everything
isn't in one big file.
No change to functionality in this CL, only moving declarations.
CoreLibraryReviewExempt: No code change, only moved to new part files.
Change-Id: I4b5e244172302b52a04387372738c46a07807a31
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/462100
Commit-Queue: Lasse Nielsen <lrn@google.com>
Reviewed-by: Brian Quinlan <bquinlan@google.com>
Rework register allocator to assign safepoints eagerly
as live ranges are being built and safepoint instruction
is being visited instead of doing it post-factum when
each range is being finalized.
Fixes https://github.com/flutter/flutter/issues/176619
TEST=ci, manually tested equivalence of safepoint lists
Cq-Include-Trybots: luci.dart.try:vm-aot-linux-release-x64-try,vm-aot-mac-debug-x64-try,vm-aot-mac-debug-arm64-try,vm-aot-mac-product-arm64-try,vm-aot-mac-release-arm64-try,vm-aot-linux-debug-x64-try
Change-Id: Ieebda2796c2397a701b9184f6b8675fe6a6a6964
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/460100
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Slava Egorov <vegorov@google.com>
This API allows to programmatically generate timeline information
including profiling samples if timeline format supports it.
This change also includes Perfetto timeline writer and profiler
into non-mobile PRODUCT builds. The size of Mac OS X dartaotruntime
has increased by 34352 bytes (0.7%).
This relands commit 553887bc56 with fixes
for Android builds.
TEST=vm/dart/stream_timeline_to_test
CoreLibraryReviewExempt: VM specific dart:developer API.
Cq-Include-Trybots: luci.dart.try:vm-ffi-android-product-arm-try,vm-ffi-android-release-arm-try,vm-aot-android-release-arm64c-try
Change-Id: Ifb7c66982fe9d17d2f5c9acb163a94c56a6a6964
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/457301
Commit-Queue: Slava Egorov <vegorov@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
This reverts commit 553887bc56.
Reason for revert: Broken android builds
Original change's description:
> [vm] Add NativeRuntime.streamTimelineTo
>
> This API allows to programmatically generate timeline information
> including profiling samples if timeline format supports it.
>
> This change also includes Perfetto timeline writer and profiler
> into non-mobile PRODUCT builds. The size of Mac OS X dartaotruntime
> has increased by 34352 bytes (0.7%).
>
> TEST=vm/dart/stream_timeline_to_test
>
> CoreLibraryReviewExempt: VM specific dart:developer API.
> Change-Id: I326f5fd29ee82a503160f5f5a2a857a7c55330ec
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/426220
> Reviewed-by: Ryan Macnak <rmacnak@google.com>
> Commit-Queue: Slava Egorov <vegorov@google.com>
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Change-Id: I583ad74b850514fb47054149da464a07874fc2f6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/457000
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Slava Egorov <vegorov@google.com>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
This API allows to programmatically generate timeline information
including profiling samples if timeline format supports it.
This change also includes Perfetto timeline writer and profiler
into non-mobile PRODUCT builds. The size of Mac OS X dartaotruntime
has increased by 34352 bytes (0.7%).
TEST=vm/dart/stream_timeline_to_test
CoreLibraryReviewExempt: VM specific dart:developer API.
Change-Id: I326f5fd29ee82a503160f5f5a2a857a7c55330ec
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/426220
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Slava Egorov <vegorov@google.com>
For some reason unboxing information was not generated for unreachable
fields. However, unreachable field can be used as an interface target,
and unboxing info contains a flag indicating if register calling
convention should be used which affects how the call via this field
as an interface target is going to be performed.
So it is incorrect to omit such unboxing info and this change fixes
this bug.
TEST=vm/dart/regress_b_450678575_test
Bug: b/450678575
Change-Id: Ic1f299d9c0b09005c8bbfd95d1a409c113630263
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/454681
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Slava Egorov <vegorov@google.com>
This change leans on VMs ability to provide a awaiter stack traces (if
the code is written using async syntax sugar or properly annotated with
@pragma('vm:awaiter-link').
Currently doing
await Stream.fromIterable([]).first;
would result in an empty stack trace. However after this change
we actually get a meaningful stack trace when running on the VM.
Fixes https://github.com/dart-lang/sdk/issues/51025
TEST=vm/dart/awaiter_stacks/stream_methods
CoreLibraryReviewExempt: No functional or API changes. Just better error messages on exceptional code paths.
Change-Id: Ifc3e446c00121cc97f2f870c3e3f5bf56a6a6964
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/453940
Reviewed-by: Lasse Nielsen <lrn@google.com>
Commit-Queue: Slava Egorov <vegorov@google.com>