8caeaf7a6c
This CL introduces new embedding APIs for supporting heap sample profiling. A registered sampling callback is invoked approximately every N bytes based on an exponential distribution, providing information about the isolate group the allocation occurred in, the user visible name of the allocated object type, a weak persistent handle to the allocated object, and the size of the allocation. Sampling is triggered using artificial TLAB boundaries to cause allocations to be sampled to take the allocation slow path where the registered callback can be invoked with the allocation information. Only new space allocations are currently traced, with old space allocation support to be added in a future CL. TEST=Dart_HeapSampling Change-Id: I22bcdeec6e823bc1ab44898d4c596fbed7169fa1 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/264520 Commit-Queue: Ben Konyi <bkonyi@google.com> Reviewed-by: Siva Annamalai <asiva@google.com> Reviewed-by: Ryan Macnak <rmacnak@google.com>