mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-29 04:09:13 +00:00
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:
parent
ce23efc5f6
commit
f87041bf3a
Notes:
github-actions[bot]
2024-11-15 13:50:17 +00:00
Author: https://github.com/shannonbooth
Commit: f87041bf3a
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/2345
1722 changed files with 9939 additions and 9906 deletions
|
@ -6,7 +6,7 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#include <LibJS/Heap/WeakContainer.h>
|
||||
#include <LibGC/WeakContainer.h>
|
||||
#include <LibJS/Runtime/GlobalObject.h>
|
||||
#include <LibJS/Runtime/Object.h>
|
||||
|
||||
|
@ -14,13 +14,13 @@ namespace JS {
|
|||
|
||||
class WeakRef final
|
||||
: public Object
|
||||
, public WeakContainer {
|
||||
, public GC::WeakContainer {
|
||||
JS_OBJECT(WeakRef, Object);
|
||||
JS_DECLARE_ALLOCATOR(WeakRef);
|
||||
GC_DECLARE_ALLOCATOR(WeakRef);
|
||||
|
||||
public:
|
||||
static NonnullGCPtr<WeakRef> create(Realm&, Object&);
|
||||
static NonnullGCPtr<WeakRef> create(Realm&, Symbol&);
|
||||
static GC::Ref<WeakRef> create(Realm&, Object&);
|
||||
static GC::Ref<WeakRef> create(Realm&, Symbol&);
|
||||
|
||||
virtual ~WeakRef() override = default;
|
||||
|
||||
|
@ -28,7 +28,7 @@ public:
|
|||
|
||||
void update_execution_generation() { m_last_execution_generation = vm().execution_generation(); }
|
||||
|
||||
virtual void remove_dead_cells(Badge<Heap>) override;
|
||||
virtual void remove_dead_cells(Badge<GC::Heap>) override;
|
||||
|
||||
private:
|
||||
explicit WeakRef(Object&, Object& prototype);
|
||||
|
@ -36,7 +36,7 @@ private:
|
|||
|
||||
virtual void visit_edges(Visitor&) override;
|
||||
|
||||
Variant<GCPtr<Object>, GCPtr<Symbol>, Empty> m_value;
|
||||
Variant<GC::Ptr<Object>, GC::Ptr<Symbol>, Empty> m_value;
|
||||
u32 m_last_execution_generation { 0 };
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue