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
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,14 +15,14 @@ namespace JS {
class ShadowRealm final : public Object {
JS_OBJECT(ShadowRealm, Object);
JS_DECLARE_ALLOCATOR(ShadowRealm);
GC_DECLARE_ALLOCATOR(ShadowRealm);
public:
virtual ~ShadowRealm() override = default;
[[nodiscard]] Realm const& shadow_realm() const { return *m_shadow_realm; }
[[nodiscard]] Realm& shadow_realm() { return *m_shadow_realm; }
void set_shadow_realm(NonnullGCPtr<Realm> realm) { m_shadow_realm = realm; }
void set_shadow_realm(GC::Ref<Realm> realm) { m_shadow_realm = realm; }
private:
ShadowRealm(Object& prototype);
@ -30,7 +30,7 @@ private:
virtual void visit_edges(Visitor&) override;
// 3.5 Properties of ShadowRealm Instances, https://tc39.es/proposal-shadowrealm/#sec-properties-of-shadowrealm-instances
GCPtr<Realm> m_shadow_realm; // [[ShadowRealm]]
GC::Ptr<Realm> m_shadow_realm; // [[ShadowRealm]]
};
ThrowCompletionOr<void> copy_name_and_length(VM&, FunctionObject& function, FunctionObject& target, Optional<StringView> prefix = {}, Optional<unsigned> arg_count = {});