LibGC+Everywhere: Factor out a LibGC from LibJS

Resulting in a massive rename across almost everywhere! Alongside the
namespace change, we now have the following names:

 * JS::NonnullGCPtr -> GC::Ref
 * JS::GCPtr -> GC::Ptr
 * JS::HeapFunction -> GC::Function
 * JS::CellImpl -> GC::Cell
 * JS::Handle -> GC::Root
This commit is contained in:
Shannon Booth 2024-11-15 04:01:23 +13:00 committed by Andreas Kling
parent ce23efc5f6
commit f87041bf3a
Notes: github-actions[bot] 2024-11-15 13:50:17 +00:00
1722 changed files with 9939 additions and 9906 deletions

View file

@ -5,7 +5,7 @@
*/
#include <AK/Optional.h>
#include <LibJS/Heap/MarkedVector.h>
#include <LibGC/MarkedVector.h>
#include <LibJS/Runtime/Completion.h>
#include <LibJS/Runtime/GlobalObject.h>
#include <LibJS/Runtime/PropertyDescriptor.h>
@ -20,7 +20,7 @@
namespace Web::HTML {
JS_DEFINE_ALLOCATOR(WindowProxy);
GC_DEFINE_ALLOCATOR(WindowProxy);
// 7.4 The WindowProxy exotic object, https://html.spec.whatwg.org/multipage/window-object.html#the-windowproxy-exotic-object
WindowProxy::WindowProxy(JS::Realm& realm)
@ -228,7 +228,7 @@ JS::ThrowCompletionOr<bool> WindowProxy::internal_delete(JS::PropertyKey const&
}
// 7.4.10 [[OwnPropertyKeys]] ( ), https://html.spec.whatwg.org/multipage/window-object.html#windowproxy-ownpropertykeys
JS::ThrowCompletionOr<JS::MarkedVector<JS::Value>> WindowProxy::internal_own_property_keys() const
JS::ThrowCompletionOr<GC::MarkedVector<JS::Value>> WindowProxy::internal_own_property_keys() const
{
auto& event_loop = main_thread_event_loop();
auto& vm = event_loop.vm();
@ -236,7 +236,7 @@ JS::ThrowCompletionOr<JS::MarkedVector<JS::Value>> WindowProxy::internal_own_pro
// 1. Let W be the value of the [[Window]] internal slot of this.
// 2. Let keys be a new empty List.
auto keys = JS::MarkedVector<JS::Value> { vm.heap() };
auto keys = GC::MarkedVector<JS::Value> { vm.heap() };
// 3. Let maxProperties be W's associated Document's document-tree child navigables's size.
auto max_properties = m_window->associated_document().document_tree_child_navigables().size();
@ -267,12 +267,12 @@ void WindowProxy::visit_edges(JS::Cell::Visitor& visitor)
visitor.visit(m_window);
}
void WindowProxy::set_window(JS::NonnullGCPtr<Window> window)
void WindowProxy::set_window(GC::Ref<Window> window)
{
m_window = move(window);
}
JS::NonnullGCPtr<BrowsingContext> WindowProxy::associated_browsing_context() const
GC::Ref<BrowsingContext> WindowProxy::associated_browsing_context() const
{
return *m_window->associated_document().browsing_context();
}