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

@ -11,7 +11,7 @@
namespace JS {
JS_DEFINE_ALLOCATOR(ErrorConstructor);
GC_DEFINE_ALLOCATOR(ErrorConstructor);
ErrorConstructor::ErrorConstructor(Realm& realm)
: NativeFunction(realm.vm().names.Error.as_string(), realm.intrinsics().function_prototype())
@ -40,7 +40,7 @@ ThrowCompletionOr<Value> ErrorConstructor::call()
}
// 20.5.1.1 Error ( message [ , options ] ), https://tc39.es/ecma262/#sec-error-message
ThrowCompletionOr<NonnullGCPtr<Object>> ErrorConstructor::construct(FunctionObject& new_target)
ThrowCompletionOr<GC::Ref<Object>> ErrorConstructor::construct(FunctionObject& new_target)
{
auto& vm = this->vm();
@ -67,7 +67,7 @@ ThrowCompletionOr<NonnullGCPtr<Object>> ErrorConstructor::construct(FunctionObje
}
#define __JS_ENUMERATE(ClassName, snake_name, PrototypeName, ConstructorName, ArrayType) \
JS_DEFINE_ALLOCATOR(ConstructorName); \
GC_DEFINE_ALLOCATOR(ConstructorName); \
ConstructorName::ConstructorName(Realm& realm) \
: NativeFunction(realm.vm().names.ClassName.as_string(), realm.intrinsics().error_constructor()) \
{ \
@ -94,7 +94,7 @@ ThrowCompletionOr<NonnullGCPtr<Object>> ErrorConstructor::construct(FunctionObje
} \
\
/* 20.5.6.1.1 NativeError ( message [ , options ] ), https://tc39.es/ecma262/#sec-nativeerror */ \
ThrowCompletionOr<NonnullGCPtr<Object>> ConstructorName::construct(FunctionObject& new_target) \
ThrowCompletionOr<GC::Ref<Object>> ConstructorName::construct(FunctionObject& new_target) \
{ \
auto& vm = this->vm(); \
\