mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-06-15 06:41:50 +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
|
@ -11,9 +11,9 @@
|
|||
|
||||
namespace JS {
|
||||
|
||||
JS_DEFINE_ALLOCATOR(ArrayBuffer);
|
||||
GC_DEFINE_ALLOCATOR(ArrayBuffer);
|
||||
|
||||
ThrowCompletionOr<NonnullGCPtr<ArrayBuffer>> ArrayBuffer::create(Realm& realm, size_t byte_length)
|
||||
ThrowCompletionOr<GC::Ref<ArrayBuffer>> ArrayBuffer::create(Realm& realm, size_t byte_length)
|
||||
{
|
||||
auto buffer = ByteBuffer::create_zeroed(byte_length);
|
||||
if (buffer.is_error())
|
||||
|
@ -22,12 +22,12 @@ ThrowCompletionOr<NonnullGCPtr<ArrayBuffer>> ArrayBuffer::create(Realm& realm, s
|
|||
return realm.create<ArrayBuffer>(buffer.release_value(), realm.intrinsics().array_buffer_prototype());
|
||||
}
|
||||
|
||||
NonnullGCPtr<ArrayBuffer> ArrayBuffer::create(Realm& realm, ByteBuffer buffer)
|
||||
GC::Ref<ArrayBuffer> ArrayBuffer::create(Realm& realm, ByteBuffer buffer)
|
||||
{
|
||||
return realm.create<ArrayBuffer>(move(buffer), realm.intrinsics().array_buffer_prototype());
|
||||
}
|
||||
|
||||
NonnullGCPtr<ArrayBuffer> ArrayBuffer::create(Realm& realm, ByteBuffer* buffer)
|
||||
GC::Ref<ArrayBuffer> ArrayBuffer::create(Realm& realm, ByteBuffer* buffer)
|
||||
{
|
||||
return realm.create<ArrayBuffer>(buffer, realm.intrinsics().array_buffer_prototype());
|
||||
}
|
||||
|
@ -302,7 +302,7 @@ ThrowCompletionOr<Optional<size_t>> get_array_buffer_max_byte_length_option(VM&
|
|||
}
|
||||
|
||||
// 25.2.2.1 AllocateSharedArrayBuffer ( constructor, byteLength [ , maxByteLength ] ), https://tc39.es/ecma262/#sec-allocatesharedarraybuffer
|
||||
ThrowCompletionOr<NonnullGCPtr<ArrayBuffer>> allocate_shared_array_buffer(VM& vm, FunctionObject& constructor, size_t byte_length)
|
||||
ThrowCompletionOr<GC::Ref<ArrayBuffer>> allocate_shared_array_buffer(VM& vm, FunctionObject& constructor, size_t byte_length)
|
||||
{
|
||||
// 1. Let obj be ? OrdinaryCreateFromConstructor(constructor, "%SharedArrayBuffer.prototype%", « [[ArrayBufferData]], [[ArrayBufferByteLength]] »).
|
||||
auto obj = TRY(ordinary_create_from_constructor<ArrayBuffer>(vm, constructor, &Intrinsics::shared_array_buffer_prototype, nullptr));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue