summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibJS/Runtime
diff options
context:
space:
mode:
authorLinus Groh <mail@linusgroh.de>2022-02-09 10:18:48 +0000
committerLinus Groh <mail@linusgroh.de>2022-02-09 12:25:27 +0000
commit7676b1b92533227f3b0d04b34702d654f7da73c6 (patch)
treead674d388b6c8477925466ed664499a14bb716fc /Userland/Libraries/LibJS/Runtime
parent6508ff5bbdd455330834c49eaccc58a7cf711e0c (diff)
downloadserenity-7676b1b92533227f3b0d04b34702d654f7da73c6.zip
LibJS: Remove MarkedValueList in favor of MarkedVector<Value> :^)
Diffstat (limited to 'Userland/Libraries/LibJS/Runtime')
-rw-r--r--Userland/Libraries/LibJS/Runtime/MarkedValueList.cpp51
-rw-r--r--Userland/Libraries/LibJS/Runtime/MarkedValueList.h37
2 files changed, 0 insertions, 88 deletions
diff --git a/Userland/Libraries/LibJS/Runtime/MarkedValueList.cpp b/Userland/Libraries/LibJS/Runtime/MarkedValueList.cpp
deleted file mode 100644
index 47ee03a4ce..0000000000
--- a/Userland/Libraries/LibJS/Runtime/MarkedValueList.cpp
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * Copyright (c) 2020, Andreas Kling <kling@serenityos.org>
- *
- * SPDX-License-Identifier: BSD-2-Clause
- */
-
-#include <LibJS/Heap/Heap.h>
-#include <LibJS/Heap/MarkedVector.h>
-
-namespace JS {
-
-MarkedValueList::MarkedValueList(Heap& heap)
- : m_heap(&heap)
-{
- m_heap->did_create_marked_value_list({}, *this);
-}
-
-MarkedValueList::MarkedValueList(MarkedValueList const& other)
- : Vector<Value, 32>(other)
- , m_heap(other.m_heap)
-{
- m_heap->did_create_marked_value_list({}, *this);
-}
-
-MarkedValueList::MarkedValueList(MarkedValueList&& other)
- : Vector<Value, 32>(move(static_cast<Vector<Value, 32>&>(other)))
- , m_heap(other.m_heap)
-{
- m_heap->did_create_marked_value_list({}, *this);
-}
-
-MarkedValueList::~MarkedValueList()
-{
- m_heap->did_destroy_marked_value_list({}, *this);
-}
-
-MarkedValueList& MarkedValueList::operator=(JS::MarkedValueList const& other)
-{
- Vector<Value, 32>::operator=(other);
-
- if (m_heap != other.m_heap) {
- m_heap = other.m_heap;
-
- // NOTE: IntrusiveList will remove this MarkedValueList from the old heap it was part of.
- m_heap->did_create_marked_value_list({}, *this);
- }
-
- return *this;
-}
-
-}
diff --git a/Userland/Libraries/LibJS/Runtime/MarkedValueList.h b/Userland/Libraries/LibJS/Runtime/MarkedValueList.h
deleted file mode 100644
index dbb5bdd49d..0000000000
--- a/Userland/Libraries/LibJS/Runtime/MarkedValueList.h
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * Copyright (c) 2020, Andreas Kling <kling@serenityos.org>
- *
- * SPDX-License-Identifier: BSD-2-Clause
- */
-
-#pragma once
-
-#include <AK/IntrusiveList.h>
-#include <AK/Noncopyable.h>
-#include <AK/Vector.h>
-#include <LibJS/Forward.h>
-#include <LibJS/Runtime/Value.h>
-
-namespace JS {
-
-class MarkedValueList : public Vector<Value, 32> {
-public:
- explicit MarkedValueList(Heap&);
- MarkedValueList(MarkedValueList const&);
- MarkedValueList(MarkedValueList&&);
- ~MarkedValueList();
-
- Vector<Value, 32>& values() { return *this; }
-
- MarkedValueList& operator=(JS::MarkedValueList const& other);
-
-private:
- Heap* m_heap;
-
- IntrusiveListNode<MarkedValueList> m_list_node;
-
-public:
- using List = IntrusiveList<&MarkedValueList::m_list_node>;
-};
-
-}