1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 03:37:45 +00:00

LibJS: Add source location for Handle nodes in GC graph dumper output

With this change JS::Handle root nodes will contain source location
where they were constructed like:
```
    "94675029575744": {
        "root": "Handle activate_event_handler \
           serenity/Userland/Libraries/LibWeb/DOM/EventTarget.cpp:564",
        "class_name": "HTMLButtonElement",
        "edges": [
            "94675025955904",
            "94675026899520",
            "94675030831168",
```
This commit is contained in:
Aliaksandr Kalenik 2023-09-22 02:04:16 +02:00 committed by Andreas Kling
parent 4b06cef93a
commit 719a00df3a
9 changed files with 129 additions and 121 deletions

View file

@ -0,0 +1,28 @@
/*
* Copyright (c) 2023, Aliaksandr Kalenik <kalenik.aliaksandr@gmail.com>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#pragma once
#include <AK/SourceLocation.h>
namespace JS {
struct HeapRoot {
enum class Type {
HeapFunctionCapturedPointer,
Handle,
MarkedVector,
RegisterPointer,
SafeFunction,
StackPointer,
VM,
};
Type type;
SourceLocation const* location { nullptr };
};
}