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

@ -21,7 +21,7 @@
namespace JS::Test262 {
JS_DEFINE_ALLOCATOR($262Object);
GC_DEFINE_ALLOCATOR($262Object);
$262Object::$262Object(Realm& realm)
: Object(Object::ConstructWithoutPrototypeTag::Tag, realm)
@ -62,7 +62,7 @@ JS_DEFINE_NATIVE_FUNCTION($262Object::clear_kept_objects)
JS_DEFINE_NATIVE_FUNCTION($262Object::create_realm)
{
JS::GCPtr<JS::Test262::GlobalObject> global_object;
GC::Ptr<JS::Test262::GlobalObject> global_object;
auto root_execution_context = MUST(JS::Realm::initialize_host_defined_realm(
vm,
[&](JS::Realm& realm) -> JS::GlobalObject* {

View file

@ -15,7 +15,7 @@ namespace JS::Test262 {
class $262Object final : public Object {
JS_OBJECT($262Object, Object);
JS_DECLARE_ALLOCATOR($262Object);
GC_DECLARE_ALLOCATOR($262Object);
public:
virtual void initialize(Realm&) override;
@ -26,8 +26,8 @@ private:
virtual void visit_edges(Visitor&) override;
GCPtr<AgentObject> m_agent;
GCPtr<IsHTMLDDA> m_is_htmldda;
GC::Ptr<AgentObject> m_agent;
GC::Ptr<IsHTMLDDA> m_is_htmldda;
JS_DECLARE_NATIVE_FUNCTION(clear_kept_objects);
JS_DECLARE_NATIVE_FUNCTION(create_realm);

View file

@ -12,7 +12,7 @@
namespace JS::Test262 {
JS_DEFINE_ALLOCATOR(AgentObject);
GC_DEFINE_ALLOCATOR(AgentObject);
AgentObject::AgentObject(Realm& realm)
: Object(Object::ConstructWithoutPrototypeTag::Tag, realm)

View file

@ -13,7 +13,7 @@ namespace JS::Test262 {
class AgentObject final : public Object {
JS_OBJECT(AgentObject, Object);
JS_DECLARE_ALLOCATOR(AgentObject);
GC_DECLARE_ALLOCATOR(AgentObject);
public:
virtual void initialize(Realm&) override;

View file

@ -14,7 +14,7 @@
namespace JS::Test262 {
JS_DEFINE_ALLOCATOR(GlobalObject);
GC_DEFINE_ALLOCATOR(GlobalObject);
void GlobalObject::initialize(Realm& realm)
{

View file

@ -13,7 +13,7 @@ namespace JS::Test262 {
class GlobalObject final : public JS::GlobalObject {
JS_OBJECT(GlobalObject, JS::GlobalObject);
JS_DECLARE_ALLOCATOR(GlobalObject);
GC_DECLARE_ALLOCATOR(GlobalObject);
public:
virtual void initialize(Realm&) override;
@ -29,7 +29,7 @@ private:
virtual void visit_edges(Visitor&) override;
GCPtr<$262Object> m_$262;
GC::Ptr<$262Object> m_$262;
JS_DECLARE_NATIVE_FUNCTION(print);
};

View file

@ -9,7 +9,7 @@
namespace JS::Test262 {
JS_DEFINE_ALLOCATOR(IsHTMLDDA);
GC_DEFINE_ALLOCATOR(IsHTMLDDA);
IsHTMLDDA::IsHTMLDDA(Realm& realm)
// NativeFunction without prototype is currently not possible (only due to the lack of a ctor that supports it)

View file

@ -12,7 +12,7 @@ namespace JS::Test262 {
class IsHTMLDDA final : public NativeFunction {
JS_OBJECT(IsHTMLDDA, NativeFunction);
JS_DECLARE_ALLOCATOR(IsHTMLDDA);
GC_DECLARE_ALLOCATOR(IsHTMLDDA);
public:
virtual ~IsHTMLDDA() override = default;