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

@ -15,10 +15,10 @@ namespace JS {
class Set : public Object {
JS_OBJECT(Set, Object);
JS_DECLARE_ALLOCATOR(Set);
GC_DECLARE_ALLOCATOR(Set);
public:
static NonnullGCPtr<Set> create(Realm&);
static GC::Ref<Set> create(Realm&);
virtual void initialize(Realm&) override;
virtual ~Set() override = default;
@ -37,25 +37,25 @@ public:
auto begin() { return m_values->begin(); }
auto end() const { return m_values->end(); }
NonnullGCPtr<Set> copy() const;
GC::Ref<Set> copy() const;
private:
explicit Set(Object& prototype);
virtual void visit_edges(Visitor& visitor) override;
GCPtr<Map> m_values;
GC::Ptr<Map> m_values;
};
// 24.2.1.1 Set Records, https://tc39.es/ecma262/#sec-set-records
struct SetRecord {
NonnullGCPtr<Object const> set_object; // [[SetObject]]
double size { 0 }; // [[Size]
NonnullGCPtr<FunctionObject> has; // [[Has]]
NonnullGCPtr<FunctionObject> keys; // [[Keys]]
GC::Ref<Object const> set_object; // [[SetObject]]
double size { 0 }; // [[Size]
GC::Ref<FunctionObject> has; // [[Has]]
GC::Ref<FunctionObject> keys; // [[Keys]]
};
ThrowCompletionOr<SetRecord> get_set_record(VM&, Value);
bool set_data_has(NonnullGCPtr<Set>, Value);
bool set_data_has(GC::Ref<Set>, Value);
}