mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-05-10 17:12:41 +02:00
This adds a stack trace to the JSON output from GC graph dumps which is shown in a default-collapsed tray on the right side of the graph explorer. When a stack pointer root is selected, the stack frame it originated from is highlighted in the tray.
34 lines
609 B
C++
34 lines
609 B
C++
/*
|
|
* Copyright (c) 2023-2025, Aliaksandr Kalenik <kalenik.aliaksandr@gmail.com>
|
|
*
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include <AK/Optional.h>
|
|
#include <AK/SourceLocation.h>
|
|
#include <LibGC/Export.h>
|
|
|
|
namespace GC {
|
|
|
|
struct GC_API HeapRoot {
|
|
enum class Type {
|
|
ConservativeVector,
|
|
HeapFunctionCapturedPointer,
|
|
MustSurviveGC,
|
|
RegisterPointer,
|
|
Root,
|
|
RootHashMap,
|
|
RootVector,
|
|
StackPointer,
|
|
VM,
|
|
};
|
|
|
|
Type type;
|
|
SourceLocation const* location { nullptr };
|
|
Optional<u32> stack_frame_index {};
|
|
};
|
|
|
|
}
|