Commit graph

19908 commits

Author SHA1 Message Date
Martin Kustermann 2932261f83 Allow tab-completion of exit/quit/help
TEST=runtime/tools/heapsnapshot/test/completion_test.dart

Change-Id: Ia3bffbdf2b115d15ad90c8cc68870af19e3c373e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/261822
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Tess Strickland <sstrickl@google.com>
2022-10-04 12:31:45 +00:00
Martin Kustermann 756379442e Abstract out the used set implementation in heapsnapshot analysis tool.
Doing so will allow using a more efficient (both memory-wise
and perf-wise) set implementation.

TEST=ci

Change-Id: Ia64ad5785bab6dba668c5fc3e2dcfcaf482d8b83
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/262424
Commit-Queue: Tess Strickland <sstrickl@google.com>
Reviewed-by: Tess Strickland <sstrickl@google.com>
2022-10-04 09:58:19 +00:00
Tess Strickland 82897fdfde [vm] Split AbstractType::PrintName functionality across subclasses.
Since none of the subparts of the base method share any local state,
make the base method virtual and override it in all of the subclasses
with the subclass-specific functionality.

Also add an `ASSERT(IsNull());` check to all base implementations to
cause an error in DEBUG mode when forgetting to override in a subclass,
and then perform what should happen in the null case (if anything).
This way, in DEBUG mode, it's easier to distinguish an accidental null
slipping through vs. a lack of overriding.

TEST=Pure refactoring, so existing tests.

Change-Id: I57a669e5eb34119443d84bf1208ce7232a0e4c6c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/262347
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Commit-Queue: Tess Strickland <sstrickl@google.com>
2022-10-04 08:51:00 +00:00
Alexander Markov b5061ffae1 [vm] Support dynamic access to record fields in JIT mode
TEST=language/records/simple/dynamic_field_access_test

Issue: https://github.com/dart-lang/sdk/issues/49719
Change-Id: I18df67e0bf97944c8e5ef8a71f075b5cd40fec29
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/262300
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2022-10-03 21:24:47 +00:00
Ryan Macnak d643bcf9c7 [vm, compiler] Remove unnecessary spill from IA32 write barrier.
TEST=ci
Change-Id: Ie501566662f7460b53c0f5277a610c9dbeec9693
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/262273
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2022-10-03 20:47:21 +00:00
Martin Kustermann aa4339a9f3 Allow tab-completion of commands, expression types and named sets
This CL extends the heapsnapshot analysis CLI with tab-completion support
for commands, options, filenames, expression types and named sets.

This makes it much more comfortable to use the tool.

TEST=runtime/tools/heapsnapshot/test/completion_test

Change-Id: Iea48b4bd12651a60add6206a92ce06823cbd754a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/262243
Reviewed-by: Tess Strickland <sstrickl@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2022-10-03 14:58:58 +00:00
Martin Kustermann f7808a1aeb [gardening] Ensure unboxed fields are considered non-nullable with concrete cid.
Closes https://github.com/dart-lang/sdk/issues/50110

TEST=vm/dart{,_2}/regression_50110_test

Change-Id: I2f0c06febf55dbf20ca96213a0c5941c2f3ef1a8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/262344
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2022-10-03 12:36:18 +00:00
Daco Harkes b113fffb65 Reland "[vm/ffi] Throw on returning Error in Handle"
Fix: Check handle contents for Smi.
Closes: https://github.com/flutter/flutter/issues/112726

Orignal CL description:

Makes `Dart_Handle` FFI returns behave as the following snippet:

```
Dart_Handle ExampleSnippet() {
  Dart_Handle result = ...;
  if (Dart_IsError(result)) {
    Dart_PropagateError(result);
  }
  return result;
}
```

Also makes FFI consistent with Dart_NativeFunctions, which will
automatically throw upon return if Dart_SetReturnValue set the result
to an error.

`UnhandledExceptions` cannot flow out into Dart generated code. So,
the implementation needs to be in `FfiCallInstr::EmitNativeCode`.

Using `Dart_IsError` is slow compared to a machine code class id
check. So, we should do the handle unwrapping and class id check in
machine code.

Unwrapping Handles in machine code is only safe when the GC is
guaranteed to not run: Either (1) in `kThreadInGenerated`, or (2) in
`kThreadInNative`, but only when transitioned into safepoint. So, the
handle cannot be unwrapped immediately after the FFI call in machine code. We first need to transition back to generated.

This means we need to transition again to native to do the actual
`Dart_PropagateError` call. We can do so without the stub in JIT
because we never return with normal control flow.

Performance impact of this change is within benchmark noise in both
JIT and AOT.
Size impact is 42 bytes on x64, which is 10% in AOT and 12% in JIT.

For more numbers see: go/dart-ffi-handle-error

TEST=runtime/bin/ffi_test/ffi_test_functions_vmspecific.cc
TEST=tests/ffi/vmspecific_handle_test.dart

Closes: https://github.com/dart-lang/sdk/issues/49936
Change-Id: Id8edfd841a7d6246438386007d83747868a0a151
Cq-Include-Trybots: luci.dart.try:vm-canary-linux-debug-try,vm-ffi-android-debug-arm64c-try,vm-ffi-android-debug-arm-try,vm-kernel-gcc-linux-try,vm-kernel-linux-debug-x64-try,vm-kernel-linux-debug-x64c-try,vm-kernel-msvc-windows-try,vm-kernel-optcounter-threshold-linux-release-x64-try,vm-kernel-precomp-asan-linux-release-x64-try,vm-kernel-precomp-linux-debug-x64-try,vm-kernel-reload-linux-debug-x64-try,vm-kernel-reload-rollback-linux-debug-x64-try,vm-kernel-tsan-linux-release-x64-try,vm-kernel-win-debug-x64-try,vm-kernel-win-debug-ia32-try,vm-precomp-ffi-qemu-linux-release-arm-try,vm-precomp-ffi-qemu-linux-release-riscv64-try,vm-kernel-linux-debug-ia32-try,vm-kernel-mac-release-arm64-try,vm-kernel-precomp-win-debug-x64c-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/262342
Reviewed-by: Martin Kustermann <kustermann@google.com>
Auto-Submit: Daco Harkes <dacoharkes@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
2022-10-03 12:25:08 +00:00
Zach Anderson 2742d90033 Revert "[vm/ffi] Throw on returning Error in Handle"
This reverts commit d9c442bce8.

Reason for revert: https://github.com/flutter/flutter/issues/112726

Original change's description:
> [vm/ffi] Throw on returning `Error` in `Handle`
>
> Makes `Dart_Handle` FFI returns behave as the following snippet:
>
> ```
> Dart_Handle ExampleSnippet() {
>   Dart_Handle result;
>   if (Dart_IsError(result)) {
>     Dart_PropagateError(result);
>   }
>   return result;
> }
> ```
>
> Also makes FFI consistent with Dart_NativeFunctions, which will
> automatically throw upon return if Dart_SetReturnValue set the result
> to an error.
>
> `UnhandledExceptions` cannot flow out into Dart generated code. So,
> the implementation needs to be in `FfiCallInstr::EmitNativeCode`.
>
> Using `Dart_IsError` is slow compared to a machine code class id
> check. So, we should do the handle unwrapping and class id check in
> machine code.
>
> Unwrapping Handles in machine code is only safe when the GC is
> guaranteed to not run: Either (1) in `kThreadInGenerated`, or (2) in
> `kThreadInNative`, but only when transitioned into safepoint. So, the
> handle cannot be unwrapped immediately after the FFI call in machine code. We first need to transition back to generated.
>
> This means we need to transition again to native to do the actual
> `Dart_PropagateError` call. We can do so without the stub in JIT
> because we never return with normal control flow.
>
> Performance impact of this change is within benchmark noise in both
> JIT and AOT.
> Size impact is 42 bytes on x64, which is 10% in AOT and 12% in JIT.
>
> For more numbers see: go/dart-ffi-handle-error
>
> TEST=runtime/bin/ffi_test/ffi_test_functions_vmspecific.cc
> TEST=tests/ffi/vmspecific_handle_test.dart
>
> Closes: https://github.com/dart-lang/sdk/issues/49936
> Change-Id: Ie8fabeb6d53bc80689541bc4470cb37ee2200581
> Cq-Include-Trybots: luci.dart.try:vm-canary-linux-debug-try,vm-ffi-android-debug-arm64c-try,vm-ffi-android-debug-arm-try,vm-kernel-gcc-linux-try,vm-kernel-linux-debug-x64-try,vm-kernel-linux-debug-x64c-try,vm-kernel-msvc-windows-try,vm-kernel-optcounter-threshold-linux-release-x64-try,vm-kernel-precomp-asan-linux-release-x64-try,vm-kernel-precomp-linux-debug-x64-try,vm-kernel-reload-linux-debug-x64-try,vm-kernel-reload-rollback-linux-debug-x64-try,vm-kernel-tsan-linux-release-x64-try,vm-kernel-win-debug-x64-try,vm-kernel-win-debug-ia32-try,vm-precomp-ffi-qemu-linux-release-arm-try,vm-precomp-ffi-qemu-linux-release-riscv64-try,vm-kernel-linux-debug-ia32-try,vm-kernel-mac-release-arm64-try,vm-kernel-precomp-win-debug-x64c-try
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/261603
> Reviewed-by: Ryan Macnak <rmacnak@google.com>
> Reviewed-by: Martin Kustermann <kustermann@google.com>
> Commit-Queue: Daco Harkes <dacoharkes@google.com>

TBR=kustermann@google.com,rmacnak@google.com,dacoharkes@google.com,dart-scoped@luci-project-accounts.iam.gserviceaccount.com

Change-Id: I94cc63de16b54db2b0a4f92759c39a1e569b8e63
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Cq-Include-Trybots: luci.dart.try:vm-canary-linux-debug-try,vm-ffi-android-debug-arm64c-try,vm-ffi-android-debug-arm-try,vm-kernel-gcc-linux-try,vm-kernel-linux-debug-x64-try,vm-kernel-linux-debug-x64c-try,vm-kernel-msvc-windows-try,vm-kernel-optcounter-threshold-linux-release-x64-try,vm-kernel-precomp-asan-linux-release-x64-try,vm-kernel-precomp-linux-debug-x64-try,vm-kernel-reload-linux-debug-x64-try,vm-kernel-reload-rollback-linux-debug-x64-try,vm-kernel-tsan-linux-release-x64-try,vm-kernel-win-debug-x64-try,vm-kernel-win-debug-ia32-try,vm-precomp-ffi-qemu-linux-release-arm-try,vm-precomp-ffi-qemu-linux-release-riscv64-try,vm-kernel-linux-debug-ia32-try,vm-kernel-mac-release-arm64-try,vm-kernel-precomp-win-debug-x64c-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/262270
Reviewed-by: Zach Anderson <zra@google.com>
Reviewed-by: Liam Appelbe <liama@google.com>
Commit-Queue: Zach Anderson <zra@google.com>
2022-09-30 21:51:59 +00:00
Martin Kustermann ed5ad5c087 Add CLI tool for analyzing Dart VM heapsnapshots
This CL adds an interactive command line tool to analyze
heapsnapshots generated by the Dart VM.

The tool works by operating on sets of objects. It supports operations
like users, transitive closure, union, ...

An example usage that loads snapshot, finds all live objects, finds
the empty lists in them and prints retainers of the empty lists:

    ```
    % dart bin/explore.dart

    (hsa) load foo.heapsnapshot

    (hsa) all = closure roots
    (hsa) stat all
          size       count     class
      --------   --------  --------
       43861 kb    8371    _Uint8List dart:typed_data
         ...
      --------   --------  --------
      108904 kb  400745

    (hsa) empty-lists = dfilter (filter all _List) ==0
    (hsa) empty-growable-lists = filter (users empty-lists) _GrowableList

    (hsa) retain empty-growable-lists
    There are 5632 retaining paths of
    _GrowableList (dart:core)
    ⮑ ・UnlinkedLibraryImportDirective.configurations (package:analyzer/src/dart/analysis/unlinked_data.dart)
        ⮑ ﹢_List (dart:core)
            ⮑ ・...
    ```

For now the tool lives only in dart-lang/sdk.

TEST=pkg/heapsnapshot/test/*_test.dart

Change-Id: I671c2e3ca770e1a5aa3e590e850a5694070b4c3a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/261100
Reviewed-by: Tess Strickland <sstrickl@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2022-09-30 14:15:01 +00:00
Daco Harkes d9c442bce8 [vm/ffi] Throw on returning Error in Handle
Makes `Dart_Handle` FFI returns behave as the following snippet:

```
Dart_Handle ExampleSnippet() {
  Dart_Handle result;
  if (Dart_IsError(result)) {
    Dart_PropagateError(result);
  }
  return result;
}
```

Also makes FFI consistent with Dart_NativeFunctions, which will
automatically throw upon return if Dart_SetReturnValue set the result
to an error.

`UnhandledExceptions` cannot flow out into Dart generated code. So,
the implementation needs to be in `FfiCallInstr::EmitNativeCode`.

Using `Dart_IsError` is slow compared to a machine code class id
check. So, we should do the handle unwrapping and class id check in
machine code.

Unwrapping Handles in machine code is only safe when the GC is
guaranteed to not run: Either (1) in `kThreadInGenerated`, or (2) in
`kThreadInNative`, but only when transitioned into safepoint. So, the
handle cannot be unwrapped immediately after the FFI call in machine code. We first need to transition back to generated.

This means we need to transition again to native to do the actual
`Dart_PropagateError` call. We can do so without the stub in JIT
because we never return with normal control flow.

Performance impact of this change is within benchmark noise in both
JIT and AOT.
Size impact is 42 bytes on x64, which is 10% in AOT and 12% in JIT.

For more numbers see: go/dart-ffi-handle-error

TEST=runtime/bin/ffi_test/ffi_test_functions_vmspecific.cc
TEST=tests/ffi/vmspecific_handle_test.dart

Closes: https://github.com/dart-lang/sdk/issues/49936
Change-Id: Ie8fabeb6d53bc80689541bc4470cb37ee2200581
Cq-Include-Trybots: luci.dart.try:vm-canary-linux-debug-try,vm-ffi-android-debug-arm64c-try,vm-ffi-android-debug-arm-try,vm-kernel-gcc-linux-try,vm-kernel-linux-debug-x64-try,vm-kernel-linux-debug-x64c-try,vm-kernel-msvc-windows-try,vm-kernel-optcounter-threshold-linux-release-x64-try,vm-kernel-precomp-asan-linux-release-x64-try,vm-kernel-precomp-linux-debug-x64-try,vm-kernel-reload-linux-debug-x64-try,vm-kernel-reload-rollback-linux-debug-x64-try,vm-kernel-tsan-linux-release-x64-try,vm-kernel-win-debug-x64-try,vm-kernel-win-debug-ia32-try,vm-precomp-ffi-qemu-linux-release-arm-try,vm-precomp-ffi-qemu-linux-release-riscv64-try,vm-kernel-linux-debug-ia32-try,vm-kernel-mac-release-arm64-try,vm-kernel-precomp-win-debug-x64c-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/261603
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
2022-09-30 13:29:51 +00:00
Tess Strickland fef905cbe2 [build] Remove linker flags to create empty section in AOT runtime.
These linker flags are causing issues with the Dart->Flutter roll,
and so I'm removing them for now until we can figure out how to
reintroduce them later.

To avoid overwriting section contents, even at a much reduced
amount, I also reland the clang DEPS revert in CL 256208.

TEST=pkg/dartdev/test/commands/compile_test

Bug: https://github.com/flutter/flutter/issues/112687
Change-Id: I35d3ff6a2a0a46e2f589469fb47bca5f9ca6df1d
Cq-Include-Trybots: luci.dart.try:analyzer-mac-release-try,dart-sdk-mac-arm64-try,dart-sdk-mac-try,pkg-mac-release-arm64-try,pkg-mac-release-try,vm-kernel-precomp-mac-product-x64-try,vm-kernel-precomp-nnbd-mac-release-arm64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/262161
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Tess Strickland <sstrickl@google.com>
2022-09-30 12:48:59 +00:00
Alexander Markov 2ab5130eb5 [vm] Relax assertion for empty record type
TEST=co19/LanguageFeatures/Records/upper_and_lower_bounds_A04_t01
(Tested manualy by applying 4b6a8f35b9 and running
"tools/test.py -n dartk-strong-linux-debug-x64 co19/LanguageFeatures/Records/upper_and_lower_bounds_A04_t01").

Issue: https://github.com/dart-lang/sdk/issues/49719
Change-Id: Ib5658ac776a75913e617095f8861baba25f13de3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/261800
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Auto-Submit: Alexander Markov <alexmarkov@google.com>
2022-09-29 16:48:00 +00:00
Daco Harkes f70ca8ee11 [vm] Make RangeCheck reusable
Moves `RangeCheck` from the intrinsifier to the assembler.

Also, unifies the signature and semantics and adds documentation.

TEST=refactor

Change-Id: I274e5e46fde6a6e8baf30d8b732932f4f46d5855
Cq-Include-Trybots: luci.dart.try:vm-kernel-linux-debug-simriscv64-try,vm-kernel-precomp-linux-debug-simriscv64-try,vm-kernel-linux-release-simarm64-try,vm-kernel-linux-release-simarm-try,vm-kernel-precomp-linux-release-simarm64-try,vm-kernel-precomp-linux-release-simarm-try,vm-precomp-ffi-qemu-linux-release-riscv64-try,vm-precomp-ffi-qemu-linux-release-arm-try,vm-kernel-linux-debug-ia32-try,vm-kernel-linux-debug-x64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/261681
Reviewed-by: Tess Strickland <sstrickl@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
2022-09-29 15:07:27 +00:00
Tess Strickland ef53c1929d [vm/test] Fix assumption about dynamic symbol table.
The original code assumed that only the initial symbol in the
dynamic symbol table had an empty name, and so any symbol with an
empty name was checked as if it was the initial symbol.

However, it turns out that in at least one case on our testing
infrastructure, the assembler generates a dynamic symbol with an
empty name.

Thus, we change the test to check the initial symbol separately
from the rest of the symbols in the symbol table.

TEST=vm/dart{,_2}/use_add_readonly_data_symbols_flag

Bug: https://github.com/dart-lang/sdk/issues/50071
Change-Id: Ie5d443ee2a45f8fb3400955d8bdfb3e726ab028a
Fixed: 50071
Cq-Include-Trybots: luci.dart.try:vm-kernel-precomp-linux-release-x64-try,vm-kernel-precomp-linux-product-x64-try,vm-kernel-precomp-nnbd-linux-release-x64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/261820
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Commit-Queue: Tess Strickland <sstrickl@google.com>
2022-09-29 09:36:37 +00:00
Tess Strickland b0c4ddf919 [pkg/dart2native] Avoid overwriting section contents in MachO files.
To create a Dart standalone executable on MacOS, we modify the
dartaotruntime executable to add the snapshot contents, and the
VM looks into the executable on disk to find the snapshot to load.

Previously, we did this by adding a new 64-bit segment load command
with a single section, where the section's file offset and size
describes the inserted snapshot. This meant the Mach-O header size increased by 152 bytes.

Originally, this wasn't an issue as there was plenty of padding, but
later clang updates removed most of this padding, and so writing the
new header actually overwrote the initial contents of the first section
in the file, which happens to be the __text section. In addition, since
the first section's offset was now declared to be within the header,
utilities that strictly validated the Mach-O format, like codesign,
would report errors.

This CL changes it so that we actually reserve space in the
dartaotruntime header using the -add_empty_section flag to the linker.
In addition, we change from using a segment load command to using a
(40 byte) note load command. This is because a segment load command
specifies that the contents should be loaded in memory, but we don't
use that loaded version. Instead, the VM reloads it from the executable
on disk so it can appropriately mmap the different parts of the
snapshot. A note section instead just declares a section of the
executable as arbitrary data that the owner can read from the file
and use as desired, which is semantically closer to our current usage.

This CL also adds a test to pkg/dartdev/test/commands/compile_test to
ensure that corrupting a random part of the snapshot in the executable
causes signature verification to fail.

This CL also reverts CL 256208, thus relanding the clang changes
starting from June that originally raised awareness of the issue by
greatly reduced the amount of padding after the load commands.

TEST=pkg/dartdev/test/commands/compile_test

Bug: https://github.com/dart-lang/sdk/issues/49783
Change-Id: Iee554d87b0eabaecd7a534ca4e4facfefbce6385
Cq-Include-Trybots: luci.dart.try:analyzer-mac-release-try,dart-sdk-mac-arm64-try,dart-sdk-mac-try,pkg-mac-release-arm64-try,pkg-mac-release-try,vm-kernel-precomp-mac-product-x64-try,vm-kernel-precomp-nnbd-mac-release-arm64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/260108
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Commit-Queue: Tess Strickland <sstrickl@google.com>
2022-09-29 08:32:47 +00:00
Alexander Markov b48846c1ea [vm] Fix data race during TypeRef canonicalization
TEST=vm/dart/regress_50065_test
TEST=tools/test.py --repeat 100 -n dartk-tsan-linux-release-x64 vm/dart_2/regress_50065_test

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

Change-Id: I974d8c9c0a291d64318f3a96ba73148707fd4b68
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/261740
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2022-09-28 22:03:26 +00:00
Ryan Macnak 4100cafb19 [vm, gc] Remove non-assert use of Contains during scavenging.
The scavenger should assume it visits pointers exactly once. This Contains was probably covering up a double visit that was probably fixed with the introduction of the compactor.

TEST=ci
Change-Id: I975cb27e1fedf9fbc0b0d46d33dd374204907037
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/261780
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
2022-09-28 21:53:06 +00:00
Alexander Markov 9c3e52aaf3 [vm] Support record types in special cases of type testing stubs for generic types
TEST=language/records/simple/type_checks2_test

Issue: https://github.com/dart-lang/sdk/issues/49719
Change-Id: I9117331d8e985675a8adba1aaa4d50a6b17758f4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/261182
Reviewed-by: Tess Strickland <sstrickl@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2022-09-28 19:01:11 +00:00
Alexander Markov b860d9ee36 [vm] Support record types and record constants in IL serialization
TEST=language/records/simple/constants_and_field_access_test

Issue: https://github.com/dart-lang/sdk/issues/49719
Change-Id: I47b1c300195249d0e07e2adfdeeba0c4e44f5de7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/261480
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2022-09-28 16:41:56 +00:00
Tess Strickland be4bb8ec4b [vm/test] Skip heap_snapshot_referrers_test on reload bots.
Change-Id: Ia9719f4009a02e26d134fcfbfba9823719fb8484
Fixed: 50072
Cq-Include-Trybots: luci.dart.try:vm-kernel-reload-linux-release-x64-try,vm-kernel-reload-rollback-linux-release-x64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/261641
Commit-Queue: Tess Strickland <sstrickl@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2022-09-28 13:37:06 +00:00
Tess Strickland a54a21b230 [vm/test] Don't attempt assembly tests on simulated archs.
TEST=vm/dart{,_2}/use_add_readonly_data_symbols_flag

Bug: https://github.com/dart-lang/sdk/issues/50071
Change-Id: Ia20b3d781f87ca902555d5d54fa6f42855cace49
Cq-Include-Trybots: luci.dart.try:vm-kernel-precomp-nnbd-linux-release-simarm64-try,vm-kernel-precomp-nnbd-linux-debug-simarm_x64-try,vm-kernel-precomp-nnbd-linux-release-simarm_x64-try,vm-kernel-precomp-linux-debug-simriscv64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/261640
Commit-Queue: Tess Strickland <sstrickl@google.com>
Reviewed-by: Daco Harkes <dacoharkes@google.com>
2022-09-28 13:01:13 +00:00
Vyacheslav Egorov 9158353b5d [vm] Make it easier to get IL / disassembly out
Make `dart compile exe -v` forward gen_snapshot output in
verbose mode.

Fix --write_code_comments_as_synthetic_source_to=... flag. There
was a change to Dwarf writer API which broke it.

Motivated by https://github.com/dart-lang/sdk/issues/50059

TEST=manually

Change-Id: I0431925f724a9b24e938bdb9d7ae1019143da83a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/261360
Commit-Queue: Slava Egorov <vegorov@google.com>
Reviewed-by: Tess Strickland <sstrickl@google.com>
2022-09-28 12:21:36 +00:00
Vyacheslav Egorov 7fd49802db [vm] Default timeline recorder to nop in PRODUCT
Using ring (or other similar types) of recorders in PRODUCT
does not make sense because you can't extract the information
they record without vm-service. Additionally "ring" (default
recorder type) preallocates ~4Mb of memory to store the data.

This CL adds a "none" recorder which simply drops all data
and has no memory overhead and makes this default recorder
in PRODUCT.

We also change code to only allow none, callback, systrace
and file recorders in PRODUCT.

TEST=manually

Bug: b/237989929
Change-Id: I52d6ff8bf766e8fa0969eab0bf2adc45dd9a57c3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/261320
Commit-Queue: Slava Egorov <vegorov@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2022-09-28 12:17:46 +00:00
Ryan Macnak efbf68f306 [vm, gc] Common page structure for both generations.
- Prep work for non-moving promotion.
 - The generations still have different alignment offsets.
 - Old-space pages now participate in the page cache.
 - Fix boolean/null bit tricks to assert the right requirements on the alignment of a page's first object.

TEST=ci
Change-Id: I4369d8c6af73228e162c226d411914868bafed33
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/260401
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2022-09-27 21:34:05 +00:00
Alexander Markov d592882f49 [vm] Unify nullability and type state among all types
This change moves 'nullability' and 'type_state' from all kinds of
types to AbstractType base class. This removes a lot of code
duplication and allows uniform access to nullability and type state
for all kinds of types.

TEST=ci
Fixes https://github.com/dart-lang/sdk/issues/47034

Change-Id: I1f0dc7fda78426db83fec6a20ebebcd632ad6d99
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/260662
Reviewed-by: Tess Strickland <sstrickl@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2022-09-27 17:30:03 +00:00
Ryan Macnak f04984b432 [vm] Mark assembly produced by the VM as not requiring an executable stack.
Cf. 32715d1d5b

TEST=readelf
Change-Id: I27e2404f49e500adf82329e3a969e91d8c0dc51f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/260963
Reviewed-by: Tess Strickland <sstrickl@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2022-09-27 17:28:16 +00:00
Martin Kustermann 05cf1c3218 [gardening] Disable heap snapshot referrers test on simulators
The test takes long time to run and is too slow on simulators. So we
disable it there.

We also rename the test to reflect that an object's users are called now
`referrers` and not `referencees`.

Closes https://github.com/dart-lang/sdk/issues/50040

TEST=ci

Change-Id: Ic092db05a4930c33a9e6e4e0b2bbdb817936f97f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/261363
Reviewed-by: Tess Strickland <sstrickl@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2022-09-27 17:00:23 +00:00
Tess Strickland 1d081c8bdd [vm] Add symbol size and type information to the assembly output.
Add symbol size and type information to the assembly output when
compiling for Linux-based platforms, so that the symbol tables in the
assembled output include that information.

Since symbol tables in Mach-O files do not include symbol size
information, we don't output either currently for MacOS or iOS targets.

TEST=vm/dart{,_2}/use_add_readonly_data_symbols_flag

Change-Id: I4219b898249153dc84214565e85ac9d3cf802538
Cq-Include-Trybots: luci.dart.try:vm-kernel-precomp-dwarf-linux-product-x64-try,vm-kernel-precomp-linux-product-x64-try,vm-kernel-precomp-nnbd-linux-release-x64-try,vm-kernel-precomp-obfuscate-linux-release-x64-try,vm-kernel-gcc-linux-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/260820
Reviewed-by: Slava Egorov <vegorov@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Tess Strickland <sstrickl@google.com>
2022-09-27 16:45:53 +00:00
Tess Strickland 823934f1c5 Reland "[vm/compiler] Add symbols for read-only data when requested."
This is a reland of commit 286326f834

Checking into https://github.com/flutter/flutter/issues/108378, it
looks like the stripped snapshot indeed is unchanged, but the .ipa
being benchmarked includes .dSYMs, which is why there was a size
regression in adding this extra debugging information.

If that changes, we can remove the flag, but for now, I've added the
flag back so these symbols are not added by default.

TEST=vm/dart{,_2}/readonly_data_symbols

Original change's description:
> [vm/compiler] Add symbols for read-only data when requested.
>
> Symbols for non-clustered objects in the read-only data section are
now added to the static symbol tables for unstripped snapshots and
separate debugging information.
>
> In DEBUG mode, the name for a non-String read-only data object also
includes the name of the parent object.
>
> TEST=vm/dart{,_2}/readonly_data_symbols
>
> Change-Id: I623b023138aeca0580bc76392882eac5686f8f50
> Cq-Include-Trybots: luci.dart.try:vm-kernel-precomp-dwarf-linux-product-x64-try,vm-kernel-precomp-linux-product-x64-try,vm-kernel-precomp-linux-debug-x64-try,vm-kernel-precomp-linux-release-x64-try,vm-kernel-precomp-nnbd-linux-release-x64-try,vm-kernel-precomp-nnbd-mac-release-arm64-try
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/251104
> Reviewed-by: Ryan Macnak <rmacnak@google.com>
> Commit-Queue: Tess Strickland <sstrickl@google.com>

Cq-Include-Trybots: luci.dart.try:vm-kernel-precomp-dwarf-linux-product-x64-try,vm-kernel-precomp-linux-product-x64-try,vm-kernel-precomp-linux-debug-x64-try,vm-kernel-precomp-linux-release-x64-try,vm-kernel-precomp-nnbd-linux-release-x64-try,vm-kernel-precomp-nnbd-mac-release-arm64-try
Change-Id: I41be1c494c4324f1f3fae648d9832772c45bfbaf
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/260522
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2022-09-27 16:45:53 +00:00
Martin Kustermann d42d7429b9 [gardening] Fix VM zone allocator assertion and size accounting
When reallocating a piece of memory that was just allocated one can
re-allocate to larger or smaller new size.

The latter was disallowed by an assertion, which seems like a bug.

Closes https://github.com/dart-lang/sdk/issues/50060

TEST=vm/cc/ZoneRealloc

Change-Id: Iee9f72fead285fb8150ba8639b6de655afc515ba
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/261340
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2022-09-27 12:55:43 +00:00
Alexander Thomas e87f2d895c [build] Switch builds to the ninja in DEPS
Note: this "upgrades" ninja to 1.11.1.

Change-Id: Idca0f8a2a67cf5d5dbe75661bb14de174012580f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/261101
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Alexander Thomas <athom@google.com>
2022-09-27 11:24:03 +00:00
Daco Harkes c04673f44b [vm/ffi] Support DynamicLibrary.process() on Windows
Support looking up a symbol in the process on Windows by using the
Windows Process Status API to iterate over all loaded Modules.

TEST=tests/ffi/has_symbol_test.dart
TEST=tests/ffi/vmspecific_dynamic_library_test.dart

Change-Id: I1029f1c7dae9a193b662d942388affb681842c90
Cq-Include-Trybots: luci.dart.try:vm-kernel-win-debug-x64c-try,vm-kernel-win-debug-x64-try,vm-kernel-nnbd-win-debug-x64-try,vm-kernel-precomp-win-debug-x64c-try,dart-sdk-win-try,vm-kernel-win-release-x64-try,vm-kernel-win-release-ia32-try,vm-kernel-precomp-win-product-x64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/260760
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Tess Strickland <sstrickl@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2022-09-27 08:42:03 +00:00
Ryan Macnak 353dc891c8 [vm] Allocate old after isolate messages reach a certain size.
This avoids expensive promotion of large messages.

Cf. 04659de9f05af63d5fe4b8d67d70bb3cdf1c9a7a

TEST=ci
Change-Id: I89d5e560063f7d0c1f791ef299bb74c971f3dccf
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/257801
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2022-09-26 23:45:07 +00:00
Liam Appelbe 875922a88f [vm]: Rewrite library_filters in source_report
When library_filters were given, we used to prefill the script_table_,
then just assume that any scripts not in the script_table_ must have
been filtered out. We wrote it this way to avoid checking the filters
in every GetScriptIndex call. But in some cases (eg mixins),
lib.LoadedScripts() can miss some scripts, so they'd be incorrectly
omitted from the table.

The new implementation lazy loads the scripts, the same way it works
when there are no library_filters. Skipped scripts are still placed in
the script_table_, but given an index of -1, and omitted from
script_table_entries_.

Bug: https://github.com/dart-lang/sdk/issues/49887
Change-Id: Ide938ddfa9a3750c72c615e296b1a23875e46ab8
TEST=CI (also manually tested that the bug is fixed, but it's a really fiddly setup and I'm not sure how to put it in a unit test. See bug for details)
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/260076
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Liam Appelbe <liama@google.com>
2022-09-26 23:03:18 +00:00
Ryan Macnak cba1a09e5c [vm, compiler] Inform MSan about parameters coming from FFI.
- Mark the outgoing arguments stack area as initialized.
 - Mark the trampoline's incoming parameter slots as initialized in case they are used as local handles.
 - Mark the outgoing register arguments as initialized.

TEST=msan
Bug: https://github.com/dart-lang/sdk/issues/42314
Bug: https://github.com/dart-lang/sdk/issues/49298
Bug: https://github.com/dart-lang/sdk/issues/49957
Change-Id: Ifa978e1b905a424ec9f64b89879cea6e82f70d12
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/259102
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2022-09-23 21:31:14 +00:00
Jens Johansen 9cfa8e457e [VM] Set gc_root_type when visiting frames
I ran into an "unknown" root when trying to debug something, turned
out to be via frames. This CL marks the root as such.

TEST=Existing tests.

Change-Id: I48f1176d036f5b888e88a5fc8b3796af8d86f301
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/260880
Reviewed-by: Ben Konyi <bkonyi@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2022-09-23 16:58:57 +00:00
Martin Kustermann 6b1e9bbdfe Extend HeapSnapshotGraph API to support incoming references in package:vm_service
Currently the HeapSnapshotGraph represents the objects in the Dart VM
heap and how they relate to each other. They effectively form a directed
graph with a specific root node.

The API does allow traversing the graph by following an object's
outgoing references.

Though in certain situations it can be very useful to know the set of
objects referencing a given object (i.e. incoming references).

This CL adds such support, thereby allowing traversing edges in both
directions: Finding what an object references and who references an
object.

When loading a snapshot we therefore have to also compute the reverse
edges and store them. To offset any additional computation time and
memory consumption, we optimize the existing implementation by not using
growable List<int> objects for outgoing edges but rather typed-data
views into the existing Uint32List of edges.

Due to this optimization we make loading of snapshot faster and smaller,
in a simple benchmark we seem to get:

  * JIT: 10% faster, 40% less RAM
  * AOT: 30% faster, 40% less RAM

despite the additional compute & data structures of this API.

TEST=vm/dart{,_2}/heap_snapshot_referencees_test

Change-Id: Ief30bfb58c70364744eeb7f69967dd1f72ece807
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/260524
Reviewed-by: Tess Strickland <sstrickl@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2022-09-23 10:11:41 +00:00
Alexander Markov ed593585cc [vm] Record operator== and hashCode
TEST=language/records/simple/equals_and_hashcode_test
TEST=co19/LanguageFeatures/Records/equality_*

Issue: https://github.com/dart-lang/sdk/issues/49719
Change-Id: I63842f980389d63650d00638f1cb1501db88b025
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/260442
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2022-09-22 21:24:58 +00:00
Alexander Markov 241e70669b [vm] Fixes for gcc build
This change fixes the following build errors when building Dart VM with
gcc:

../../runtime/vm/compiler/assembler/assembler_arm64.h: In member function ‘uint32_t dart::compiler::Address::encoding(dart::compiler::OperandSize) const’:
../../runtime/vm/compiler/assembler/assembler_arm64.h:355:3: error: control reaches end of non-void function [-Werror=return-type]
  355 |   }

../../runtime/vm/compiler/assembler/assembler_arm64.cc: In member function ‘void dart::compiler::Assembler::PopNativeCalleeSavedRegisters()’:
../../runtime/vm/compiler/assembler/assembler_arm64.cc:2380:52: error: bitwise comparison always evaluates to false [-Werror=tautological-compare]
 2380 |   bool pop_single = (kAbiPreservedFpuRegCount & 1) == 1;
      |                     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^~ ~
../../runtime/vm/compiler/assembler/assembler_arm64.cc:2400:47: error: bitwise comparison always evaluates to false [-Werror=tautological-compare]
 2400 |   pop_single = (kAbiPreservedCpuRegCount & 1) == 1;
      |                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^~ ~

TEST=ci

Change-Id: Ib44790dbe99288f569a26e4df28f61ef2aa40ea3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/260640
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2022-09-22 19:33:19 +00:00
Alexander Aprelev 46bc947e75 [gardening] Fix gen_snapshot crash on msvc.
Revert change to StringRAII which used to take reference, but was changed to take pointer in 2ead86ab9d

Fixes https://github.com/dart-lang/sdk/issues/49978
TEST=ci

Change-Id: I8d8b18e6e9ae3cd07427ee1b37df404d11dcb26e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/260402
Commit-Queue: Alexander Aprelev <aam@google.com>
Reviewed-by: Liam Appelbe <liama@google.com>
2022-09-21 18:16:56 +00:00
Ryan Macnak 1bbb01211d [vm] Fix -Werror=use-after-free in isolate shutdown.
TEST=gcc 12
Change-Id: Ia4aba7b35ee12677799a9aa289a250ae7035ba6d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/259140
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2022-09-21 17:52:01 +00:00
Alexander Markov f9355b1bf2 [vm] Make Address/FieldAddress independent of operand size on arm64
The operand size is dropped from Address/FieldAddress constructors on
arm64. This makes code using Address/FieldAddress less fragile, avoids
repeating size both in the Address/FieldAddress and load/store
instructions, and better aligns arm64 Address/FieldAddress with other
architectures.

TEST=ci

Change-Id: I92d7c5c8f0239333f022deebc0472136018bb0fa
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/260072
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2022-09-21 17:12:36 +00:00
Alexander Markov 7f40a291ae [vm] Fix debug/arm64c build
On arm64 Address can assume certain load/store size depending on the
value (alignment) of the offset. This may cause assertion failure

  "runtime/vm/compiler/assembler/assembler_arm64.h: 2750: error: expected: a.log2sz_ == -1 || a.log2sz_ == size".

This change fixes build on arm64c in debug mode by using an unaligned
offset. This is a follow-up to https://dart-review.googlesource.com/c/sdk/+/259920.

TEST=Build on the vm-ffi-android-debug-arm64c bot.

Issue: https://github.com/dart-lang/sdk/issues/49719
Change-Id: I2fef8c8b397e85b9092244ae701a5f7b24b8f6eb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/260062
Auto-Submit: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2022-09-20 18:06:15 +00:00
Vyacheslav Egorov 83ab5d5ca3 [vm] Remove dynamic field unboxing in JIT
Instead apply the same approach as we do in AOT: unbox based on the
static type information. There are no TFA results available in JIT,
but we could still unbox fields when running in sound null-safety.

TEST=ci

Cq-Include-Trybots: luci.dart.try:vm-kernel-reload-linux-release-x64-try,vm-kernel-reload-linux-debug-x64-try,vm-kernel-reload-rollback-linux-debug-x64-try,vm-kernel-reload-rollback-linux-release-x64-try,vm-kernel-precomp-linux-debug-x64-try,vm-kernel-precomp-linux-product-x64-try,vm-kernel-precomp-linux-release-x64-try,vm-kernel-precomp-nnbd-linux-release-simarm64-try,vm-kernel-linux-debug-simriscv64-try,vm-kernel-precomp-linux-debug-simriscv64-try,vm-kernel-nnbd-linux-release-ia32-try,vm-kernel-nnbd-linux-debug-x64-try,vm-kernel-nnbd-linux-debug-ia32-try,vm-kernel-nnbd-linux-release-simarm-try,vm-kernel-nnbd-linux-release-simarm64-try
Change-Id: Ide2e78c6659261ef8d245a4586cf699ea0fbb459
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/256211
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Slava Egorov <vegorov@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2022-09-20 13:42:45 +00:00
Vyacheslav Egorov da26deb0b4 [vm] Allow enabling timeline in PRODUCT via DART_ENABLE_TIMELINE define
R=kustermann@google.com

TEST=not-needed

Bug: b/245563515
Change-Id: I91d118c4bbe39cc9642dc07567f2fde812f6fe4a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/260103
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Slava Egorov <vegorov@google.com>
2022-09-20 10:58:25 +00:00
Alexander Markov ae2cebcee9 [vm] runtimeType for record instances and record type equality
TEST=language/records/simple/runtime_type_test

Issue: https://github.com/dart-lang/sdk/issues/49719
Change-Id: I031dff68241dfc62ebc3b6350b10ba7d352bab37
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/259621
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2022-09-19 22:05:04 +00:00
Alexander Markov 947ab596b2 [vm] Null-initialize new record objects
TEST=co19/LanguageFeatures/Subtyping/dynamic/generated/records_arguments_binding_A03_t03
Issue: https://github.com/dart-lang/sdk/issues/49719
Change-Id: I5528a428f4dd49768732b1a8c440423f472e8923
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/259920
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2022-09-19 20:58:01 +00:00
Derek Xu 99546781f4 [VM] Factor out helper functions related to isolate IDs
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>
2022-09-19 19:46:01 +00:00
Alexander Markov d6b3b8a6be [vm] Initial vm-service support for records
TEST=ci

Issue: https://github.com/dart-lang/sdk/issues/49724
Change-Id: I8012390db004d3b9dd52a460a04bce79af3df365
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/259881
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2022-09-19 19:28:02 +00:00