2023-09-21 21:04:16 -03:00
|
|
|
/*
|
2025-12-27 13:07:11 -03:00
|
|
|
* Copyright (c) 2023-2025, Aliaksandr Kalenik <kalenik.aliaksandr@gmail.com>
|
2023-09-21 21:04:16 -03:00
|
|
|
*
|
|
|
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
2026-02-28 04:42:54 -03:00
|
|
|
#include <AK/Optional.h>
|
2023-09-21 21:04:16 -03:00
|
|
|
#include <AK/SourceLocation.h>
|
2026-01-11 18:17:30 -03:00
|
|
|
#include <LibGC/Export.h>
|
2023-09-21 21:04:16 -03:00
|
|
|
|
2024-11-14 12:01:23 -03:00
|
|
|
namespace GC {
|
2023-09-21 21:04:16 -03:00
|
|
|
|
2025-06-28 05:34:31 -03:00
|
|
|
struct GC_API HeapRoot {
|
2023-09-21 21:04:16 -03:00
|
|
|
enum class Type {
|
2026-04-09 12:33:01 -03:00
|
|
|
ConservativeHashMap,
|
2026-04-09 10:59:02 -03:00
|
|
|
ConservativeHashTable,
|
2025-12-27 13:07:11 -03:00
|
|
|
ConservativeVector,
|
2026-06-13 08:18:54 -03:00
|
|
|
CrossHeapMember,
|
2023-09-21 21:04:16 -03:00
|
|
|
HeapFunctionCapturedPointer,
|
2025-12-27 13:07:11 -03:00
|
|
|
MustSurviveGC,
|
|
|
|
|
RegisterPointer,
|
2024-11-14 12:01:23 -03:00
|
|
|
Root,
|
2025-05-03 06:59:17 -03:00
|
|
|
RootHashMap,
|
2026-04-09 10:33:59 -03:00
|
|
|
RootHashTable,
|
2025-12-27 13:07:11 -03:00
|
|
|
RootVector,
|
2023-09-21 21:04:16 -03:00
|
|
|
StackPointer,
|
|
|
|
|
VM,
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
Type type;
|
|
|
|
|
SourceLocation const* location { nullptr };
|
2026-02-28 04:42:54 -03:00
|
|
|
Optional<u32> stack_frame_index {};
|
2023-09-21 21:04:16 -03:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
}
|