From cf27eef583d1e7b49788cc3a39418ef8ba0795cd Mon Sep 17 00:00:00 2001 From: Shannon Booth Date: Tue, 12 Nov 2024 05:14:50 +1300 Subject: [PATCH] LibJS: Move WeakContainer into the Heap folder While this is used in the implementation of Runtime objects itself, Heap seems like a more appropriate home. This will also help in factoring out the GC implementation into it's own library as the heap explicitly has knowledge of WeakContainer. --- Libraries/LibJS/CMakeLists.txt | 2 +- Libraries/LibJS/Heap/Heap.h | 2 +- Libraries/LibJS/{Runtime => Heap}/WeakContainer.cpp | 2 +- Libraries/LibJS/{Runtime => Heap}/WeakContainer.h | 0 Libraries/LibJS/Runtime/FinalizationRegistry.h | 2 +- Libraries/LibJS/Runtime/WeakMap.h | 2 +- Libraries/LibJS/Runtime/WeakRef.h | 2 +- Libraries/LibJS/Runtime/WeakSet.h | 2 +- 8 files changed, 7 insertions(+), 7 deletions(-) rename Libraries/LibJS/{Runtime => Heap}/WeakContainer.cpp (92%) rename Libraries/LibJS/{Runtime => Heap}/WeakContainer.h (100%) diff --git a/Libraries/LibJS/CMakeLists.txt b/Libraries/LibJS/CMakeLists.txt index bc7ef9dac06..86d710e49dc 100644 --- a/Libraries/LibJS/CMakeLists.txt +++ b/Libraries/LibJS/CMakeLists.txt @@ -27,6 +27,7 @@ set(SOURCES Heap/Heap.cpp Heap/HeapBlock.cpp Heap/MarkedVector.cpp + Heap/WeakContainer.cpp Lexer.cpp MarkupGenerator.cpp Module.cpp @@ -253,7 +254,6 @@ set(SOURCES Runtime/Utf16String.cpp Runtime/Value.cpp Runtime/VM.cpp - Runtime/WeakContainer.cpp Runtime/WeakMap.cpp Runtime/WeakMapConstructor.cpp Runtime/WeakMapPrototype.cpp diff --git a/Libraries/LibJS/Heap/Heap.h b/Libraries/LibJS/Heap/Heap.h index 9d848e8ed44..21f7873e3d6 100644 --- a/Libraries/LibJS/Heap/Heap.h +++ b/Libraries/LibJS/Heap/Heap.h @@ -22,7 +22,7 @@ #include #include #include -#include +#include namespace JS { diff --git a/Libraries/LibJS/Runtime/WeakContainer.cpp b/Libraries/LibJS/Heap/WeakContainer.cpp similarity index 92% rename from Libraries/LibJS/Runtime/WeakContainer.cpp rename to Libraries/LibJS/Heap/WeakContainer.cpp index 387cbea5cc5..b84cdf39713 100644 --- a/Libraries/LibJS/Runtime/WeakContainer.cpp +++ b/Libraries/LibJS/Heap/WeakContainer.cpp @@ -5,7 +5,7 @@ */ #include -#include +#include namespace JS { diff --git a/Libraries/LibJS/Runtime/WeakContainer.h b/Libraries/LibJS/Heap/WeakContainer.h similarity index 100% rename from Libraries/LibJS/Runtime/WeakContainer.h rename to Libraries/LibJS/Heap/WeakContainer.h diff --git a/Libraries/LibJS/Runtime/FinalizationRegistry.h b/Libraries/LibJS/Runtime/FinalizationRegistry.h index e4f548ead18..5f3527456ce 100644 --- a/Libraries/LibJS/Runtime/FinalizationRegistry.h +++ b/Libraries/LibJS/Runtime/FinalizationRegistry.h @@ -8,12 +8,12 @@ #include #include +#include #include #include #include #include #include -#include namespace JS { diff --git a/Libraries/LibJS/Runtime/WeakMap.h b/Libraries/LibJS/Runtime/WeakMap.h index 3f1a79a4c43..4f02b4bd5bc 100644 --- a/Libraries/LibJS/Runtime/WeakMap.h +++ b/Libraries/LibJS/Runtime/WeakMap.h @@ -7,9 +7,9 @@ #pragma once #include +#include #include #include -#include namespace JS { diff --git a/Libraries/LibJS/Runtime/WeakRef.h b/Libraries/LibJS/Runtime/WeakRef.h index 9b054e5bacb..9fcf0d0324a 100644 --- a/Libraries/LibJS/Runtime/WeakRef.h +++ b/Libraries/LibJS/Runtime/WeakRef.h @@ -6,9 +6,9 @@ #pragma once +#include #include #include -#include namespace JS { diff --git a/Libraries/LibJS/Runtime/WeakSet.h b/Libraries/LibJS/Runtime/WeakSet.h index 1dd80833146..4b038035e7f 100644 --- a/Libraries/LibJS/Runtime/WeakSet.h +++ b/Libraries/LibJS/Runtime/WeakSet.h @@ -7,9 +7,9 @@ #pragma once #include +#include #include #include -#include namespace JS {