Commit 4570ce14 authored by Michael Lippautz's avatar Michael Lippautz Committed by Commit Bot

heap: Introduce EmbedderHeapTracer::kForced

The flag is used by V8 to propagate information on whether this GC was
somehow forced.

This allows the embedder using EmbedderHeapTracer to easily figure out
whether a GC was forced based on a local flag without depending on GC
prologue/epilogue callbacks.

Bug: chromium:1074061
Change-Id: Ic04c93ae58da854e54c6da1ca4aac03b5ab49897
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2182473Reviewed-by: 's avatarUlan Degenbaev <ulan@chromium.org>
Commit-Queue: Michael Lippautz <mlippautz@chromium.org>
Cr-Commit-Position: refs/heads/master@{#67567}
parent 961c21b1
......@@ -7842,6 +7842,7 @@ class V8_EXPORT EmbedderHeapTracer {
enum TraceFlags : uint64_t {
kNoFlags = 0,
kReduceMemory = 1 << 0,
kForced = 1 << 2,
};
// Indicator for the stack state of the embedder.
......
......@@ -5464,8 +5464,11 @@ EmbedderHeapTracer* Heap::GetEmbedderHeapTracer() const {
}
EmbedderHeapTracer::TraceFlags Heap::flags_for_embedder_tracer() const {
if (ShouldReduceMemory())
if (is_current_gc_forced()) {
return EmbedderHeapTracer::TraceFlags::kForced;
} else if (ShouldReduceMemory()) {
return EmbedderHeapTracer::TraceFlags::kReduceMemory;
}
return EmbedderHeapTracer::TraceFlags::kNoFlags;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment