Adds the helper functions HasIsolateId(), HasIsolateGroupId(),
GetFormattedIsolateId(), and GetFormattedIsolateGroupId() to
timeline.h
The Perfetto recorder that will be added in a future CL will make use of
these.
TEST=ci
Change-Id: I50e234d9c2cc551ae9fbad7e92fc6e019213e264
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/259220
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Derek Xu <derekx@google.com>
TEST=docs only
Change-Id: I40561595ecc8075f2f50b7c3dcc32f081d8ac85b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/256649
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
This foregoes the optimization of removing CheckWritable if the unmodifiable views are not used from Dart code.
TEST=ci
Bug: https://github.com/dart-lang/sdk/issues/49784
Change-Id: I18f3c36437ef136daf875358278caca4e3e0faa0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/255816
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
- format fixes for readme and build descriptions
- added pretty print option for tool
- changed parsing of class_table to discover library objects
- JSON output format changes
- defines to accurately mirror platform compatibility
- other small fixes
TEST=ci
Change-Id: I3f27f6fa48ce6111d94c5a88d57fa7bf7abc210c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/252661
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Chris Evans <cmevans@google.com>
Closes https://github.com/dart-lang/sdk/pull/49478
TEST=Manual
GitOrigin-RevId: f4c9c6869dfe73639295e86574a021523b3d374d
Change-Id: I134a97caed4eec59d70e9cbca16b7e9a472cf2c1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/251902
Reviewed-by: Michael Thomsen <mit@google.com>
Commit-Queue: Alexander Thomas <athom@google.com>
Reviewed-by: Aske Simon Christensen <askesc@google.com>
Reviewed-by: Kevin Chisholm <kevinjchisholm@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
Fixes#49241
TEST=ci
Change-Id: I6117bf816fc8c4613cce66927f952fef75632725
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/248120
Reviewed-by: Alexander Thomas <athom@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Alexander Thomas <athom@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@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>
For symmetry with Dart_ThreadExitCallback. Can be used by an embedder to change thread priority or attach native resources to the thread.
TEST=ci
Change-Id: Ic8eaba7204d0be42db26523b62cbfac3ecb7151f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/227661
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Uses of this API were replaced with explicit disposal.
TEST=ci
Change-Id: Id6c391c74d77e6a6c6b5b70e446a8abe92294b7a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/228081
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
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>
Branch coverage can't be enabled by a simple global flag, because this
causes problems when functions in an app-jit snapshot that didn't have
the flag enabled are compiled by a VM that has the flag enabled. In
particular, the coverage array will see a different set of token
positions, causing some important asserts to fail.
Change-Id: I35227252b5d271f20b01de99466c06708ec83ed8
TEST=CI
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/223360
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Liam Appelbe <liama@google.com>
Makes runtime/include/** respect -Wstrict-prototypes.
Closes: https://github.com/dart-lang/sdk/issues/47729
TEST=ci (FFI has tests that build against the API).
TEST=manually verified in Xcode we have no more warnings.
Change-Id: I035640ae93e942946f5171dd30776b072a235990
Cq-Include-Trybots: luci.dart.try:dart-sdk-linux-try,dart-sdk-mac-try,vm-kernel-gcc-linux-try,vm-kernel-linux-debug-x64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/220761
Reviewed-by: Slava Egorov <vegorov@google.com>
This allows the embedder to control the degree of parallelism and thread priorities.
TEST=engine
Bug: https://github.com/dart-lang/sdk/issues/44228
Change-Id: I4e8430749fcfbcbfc221c3733ee27ccbe6bcc1ae
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/215941
Reviewed-by: Kaushik Iska <kaushikiska@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Remove Dart_SetNativeServiceStreamCallback which is not in use by
any embedder.
TEST=cq
Change-Id: Ic6ecadb80d94b14cd2f89b5297d65c3ab7de75e5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/220131
Reviewed-by: Clement Skau <cskau@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Siva Annamalai <asiva@google.com>
Add Dart C API Function Dart_EnableTimelineCategory that enables
toggling of timeline categories at runtime.
https://github.com/dart-lang/sdk/issues/47601
TEST=Dart C API tests added
Change-Id: Ib38c8ab0a8d43c9180e9cb9ade107f8bad5f5e63
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/219943
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Siva Annamalai <asiva@google.com>
Add Dart C API Function Dart_EnableTimelineCategory that enables
toggling of timeline categories at runtime.
https://github.com/dart-lang/sdk/issues/47601
TEST=Dart C API tests added
Change-Id: I679e755d69d1375552e3a02e887ac00f828553d0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/219860
Commit-Queue: Siva Annamalai <asiva@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
This region is mostly unused after loading, but it may be accessed again if
- Isolate.spawn is invoke with isolate groups disabled
- A secondary snapshot produced by splitting is loaded
- An external typed data in the snapshot is accessed (usually a kernel file)
- Likely other cases
Even if these cases did not exist, the region is often part of a shared library and so unable to be released independently.
madvise(DONT_NEED) on this region will cause the OS to release the memory in this region but keep the address space reservation and mapping. If it is touched again, it will be brought back in from the file. If it is not backed by a file, such as malloc memory, it will be brought back in as zeros and the program will likely fail.
TEST=ci
Bug: https://github.com/dart-lang/sdk/issues/44019
Bug: https://github.com/flutter/flutter/issues/92120
Change-Id: I315a049b0f7d440e181d0a5e87fa6770a2fd4f79
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/216580
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
`DART_EXTERN` in `dart_api_dl.h` was missing `__declspec(dllexport)` on
Windows, causing `Dart_InitializeApiDL` to not be visible.
Using `DART_EXPORT` instead doesn't work because the definitions added
by `DART_API_ALL_DL_SYMBOLS` do not support having a 'used' attribute.
Instead, define a `DART_EXPORT_DL` for these which is identical but
without the 'used' attribute.
Note that the precompiler `DART_SHARED_LIB` macro must be defined for
`__declspec(dllexport)` to be part of `DART_EXPORT`/`DART_EXPORT_DL`.
Also fixes `#define DART_EXTERN_C` to be `extern` in C. Without this,
the linker will see duplicate symbols for things `DART_EXPORT`ed when
the `dart_api_dl.h` is included in C files.
TEST=SDK build on all OSes
Change-Id: I0af1d46d22409599203d9be310d54bd16c6a5b59
Cq-Include-Trybots: luci.dart.try:dart-sdk-linux-try,dart-sdk-mac-arm64-try,dart-sdk-mac-try,dart-sdk-win-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/215550
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
This makes it more closely mirror the Dart_NativeEntryResolver,
and acts as an extra sanity check that signatures (roughly)
align between the FfiNative decl. and the native function.
TEST=Updated runtime/vm/dart_api_impl_test.cc
Change-Id: I40799dc583ec14db14dc453afed4e2d1eb06fced
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/212566
Commit-Queue: Clement Skau <cskau@google.com>
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Per breaking change #45451 we are removing support for dart-ext:
style native extensions from the Dart VM.
This CL removes the associated VM code, tests and samples. It also ports
a single test which used dart-ext: import to use FFI instead.
TEST=ci
Bug: https://github.com/dart-lang/sdk/issues/45451
Change-Id: Iae984bce32baf29a950b5de1323939006a217b94
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/212050
Commit-Queue: Slava Egorov <vegorov@google.com>
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
communicate with the kernel isolate while accepting compilation results
during a hot reload.
TEST=reload bot tests.
Change-Id: I55f983cc8461c89e91bf1bef84f39dcda61e8142
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/210942
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Siva Annamalai <asiva@google.com>
The 'File' object created in the async file open method is leaked
if the operation is not completed when the isolate shuts down
with an unhandled exception.
This change adds a finalizable state for the 'File' object so that
the message deletion that happens when ports are closed could run
the callback to clean up the 'File' object.
TEST=new tests added
Change-Id: I64c18a7905261b0fc7bf9f220086791478232d0d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/211340
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Siva Annamalai <asiva@google.com>
This reverts commit b67f45f955.
Reason for revert: This seems to cause a crash on ARMv7 aot compiled code.
Original change's description:
> [VM/Runtime] Fix 'File' object leak in async file open operation
>
> The 'File' object created in the async file open method is leaked
> if the operation is not completed when the isolate shuts down
> with an unhandled exception.
> This change adds a finalizable state for the 'File' object so that
> the message deletion that happens when ports are closed could run
> the callback to clean up the 'File' object.
>
> TEST=new tests added
>
> Change-Id: I4a3cb28370d27306c795c1914aeb5c18a1d85e2b
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/210761
> Reviewed-by: Alexander Aprelev <aam@google.com>
> Commit-Queue: Siva Annamalai <asiva@google.com>
TBR=aam@google.com,rmacnak@google.com,asiva@google.com
Change-Id: Ie91aadd318ef19a0bb4d7f769c9e876e76d719d8
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/211021
Reviewed-by: William Hesse <whesse@google.com>
Commit-Queue: William Hesse <whesse@google.com>
The 'File' object created in the async file open method is leaked
if the operation is not completed when the isolate shuts down
with an unhandled exception.
This change adds a finalizable state for the 'File' object so that
the message deletion that happens when ports are closed could run
the callback to clean up the 'File' object.
TEST=new tests added
Change-Id: I4a3cb28370d27306c795c1914aeb5c18a1d85e2b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/210761
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Siva Annamalai <asiva@google.com>
not used anywhere
Enabling of the timeline streams is done using command line flags
during initialization and no embedder uses this API function
(It was added when Mojo was supported).
TEST=ci
Change-Id: Ide9205b9ecd703e2ccdab7a85e8a79c48d98f180
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/209850
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Siva Annamalai <asiva@google.com>
This brings the native port deserializer into agreement with the native port serializer and the interpretation of TypedData::length_.
TEST=ci
Change-Id: I52eb28af7292fc15b0ad4779dc4d4e723f6e128b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/208283
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Add Dart_TimelineGetTicks and Dart_TImelineGetTicksFrequency to the
dart_api.h per the request made in
https://github.com/dart-lang/sdk/issues/46665
TEST=added new unit test in dart_api_impl_test.cc
Change-Id: Ib37ec2088d2e61f56e61026e431c3777608cd9a7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/207900
Commit-Queue: Zach Anderson <zra@google.com>
Reviewed-by: Zach Anderson <zra@google.com>
This is needed for the Flutter Engine to use a prebuilt Dart SDK as in
https://github.com/flutter/engine/pull/26931. When using a prebuilt
Dart SDK, the rules producing the built SDK are directed to a
different location so that GN doesn't warn about multiple rules that
produce the same file.
TEST=locally with a flutter/engine checkout
Change-Id: I4095f379c772c63f93a1c88c7f4e44804f3a6fc7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/204760
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Zach Anderson <zra@google.com>