dart-sdk/runtime
Martin Kustermann 0ae3368fb6 [vm] Refactor handling of kernel data in compiler frontend
a) Remove 2 fields in our object representation:

  * PatchClass::library_data_
  * Library::kernel_data_

=> This saves O(#libraries + #patch-classes) which can amount up to
  10+ MB for big apps, as we save not just the slots but the
  [ExternalTypedData] objects they used to reference.

Instead we'll compute the KernelLibraryData when we need it by making a
[TypedDataView] of sub parts of the component.

b) We make a kernel binary be represented by a single [ExternalTypedData].

Whenever we need a sub-part of a kernel binary (e.g. one for each
component for concatinated kernels, or one for a library inside a
component) we use proper [TypedDataView]s for that.

c) As we sometimes need to create a view of only a particular library
within a component we need to find start/end of a library based on
index.

=> We store the library index instead of the library offset on
Library/PatchClass.
=> We can easily derive the start/end of a library from it's index by
looking at the kernel component encoding.

d) We make the [Reader] object work purely based on a pointer - instead
of making it have if/else when reading bytes (either from pointer or
from a view).

e) We make the [KernelProgramInfo] store the kernel_component and
various TD views into it.

TEST=ci

Change-Id: Ibe160881ff48635e834c3d647a977a144b5d0565
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/313561
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Slava Egorov <vegorov@google.com>
2023-07-14 10:15:06 +00:00
..
bin [vm] Avoid embedding sources in CFE compilations if we AppJit 2023-07-14 09:47:38 +00:00
docs [vm] Rework awaiter stack unwinding. 2023-06-30 14:03:03 +00:00
include Expand collection of object instances. 2023-07-03 12:29:15 +00:00
lib [vm] Rework awaiter stack unwinding. 2023-06-30 14:03:03 +00:00
observatory [vm] Avoid embedding sources in CFE compilations if we AppJit 2023-07-14 09:47:38 +00:00
observatory_2 [Status Files] Update status files to account for the following 2023-07-10 17:42:04 +00:00
platform [vm] Allow non-TSAN gen_snapshot target TSAN AOT runtime 2023-07-10 11:53:58 +00:00
tests [test] Skip chunked_binary_trees tests on slower configurations. 2023-07-13 21:49:08 +00:00
third_party
tools [vm] Enable clang-tidy for arm, arm64, riscv64, product, release, precompiler. 2023-07-11 15:13:58 +00:00
vm [vm] Refactor handling of kernel data in compiler frontend 2023-07-14 10:15:06 +00:00
.clang-tidy
.gitignore
BUILD.gn [vm] Make AOT compiler use TARGET_USES_THREAD_SANITIZER 2023-07-06 08:44:33 +00:00
codereview.settings
configs.gni [Runtime] Add extra_product_deps and extra_nonproduct_deps params to "library_for_all_configs_with_compiler" template 2023-04-14 19:51:40 +00:00
CPPLINT.cfg
OWNERS
PRESUBMIT.py Reland "Reland "[VM] Begin supporting Perfetto file recorder"" 2023-04-18 19:39:05 +00:00
runtime_args.gni [build] Decide in one place between using app-jit and kernel for the SDK snapshots. 2023-06-01 15:20:58 +00:00