mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-23 04:55:15 +00:00
LibGC: Rename MarkedVector => RootVector
Let's try to make it a bit more clear that this is a Vector of GC roots.
This commit is contained in:
parent
ada36e5c0a
commit
3bfb0534be
Notes:
github-actions[bot]
2024-12-26 18:11:36 +00:00
Author: https://github.com/awesomekling Commit: https://github.com/LadybirdBrowser/ladybird/commit/3bfb0534be7 Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/3048
117 changed files with 281 additions and 281 deletions
|
@ -5,9 +5,9 @@ set(SOURCES
|
||||||
ConservativeVector.cpp
|
ConservativeVector.cpp
|
||||||
ForeignCell.cpp
|
ForeignCell.cpp
|
||||||
Root.cpp
|
Root.cpp
|
||||||
|
RootVector.cpp
|
||||||
Heap.cpp
|
Heap.cpp
|
||||||
HeapBlock.cpp
|
HeapBlock.cpp
|
||||||
MarkedVector.cpp
|
|
||||||
WeakContainer.cpp
|
WeakContainer.cpp
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -30,6 +30,6 @@ template<class T, size_t inline_capacity = 0>
|
||||||
class ConservativeVector;
|
class ConservativeVector;
|
||||||
|
|
||||||
template<class T, size_t inline_capacity = 0>
|
template<class T, size_t inline_capacity = 0>
|
||||||
class MarkedVector;
|
class RootVector;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -187,8 +187,8 @@ public:
|
||||||
case HeapRoot::Type::Root:
|
case HeapRoot::Type::Root:
|
||||||
node.set("root"sv, ByteString::formatted("Root {} {}:{}", location->function_name(), location->filename(), location->line_number()));
|
node.set("root"sv, ByteString::formatted("Root {} {}:{}", location->function_name(), location->filename(), location->line_number()));
|
||||||
break;
|
break;
|
||||||
case HeapRoot::Type::MarkedVector:
|
case HeapRoot::Type::RootVector:
|
||||||
node.set("root"sv, "MarkedVector");
|
node.set("root"sv, "RootVector");
|
||||||
break;
|
break;
|
||||||
case HeapRoot::Type::RegisterPointer:
|
case HeapRoot::Type::RegisterPointer:
|
||||||
node.set("root"sv, "RegisterPointer");
|
node.set("root"sv, "RegisterPointer");
|
||||||
|
|
|
@ -23,8 +23,8 @@
|
||||||
#include <LibGC/Forward.h>
|
#include <LibGC/Forward.h>
|
||||||
#include <LibGC/HeapRoot.h>
|
#include <LibGC/HeapRoot.h>
|
||||||
#include <LibGC/Internals.h>
|
#include <LibGC/Internals.h>
|
||||||
#include <LibGC/MarkedVector.h>
|
|
||||||
#include <LibGC/Root.h>
|
#include <LibGC/Root.h>
|
||||||
|
#include <LibGC/RootVector.h>
|
||||||
#include <LibGC/WeakContainer.h>
|
#include <LibGC/WeakContainer.h>
|
||||||
|
|
||||||
namespace GC {
|
namespace GC {
|
||||||
|
@ -61,8 +61,8 @@ public:
|
||||||
void did_create_root(Badge<RootImpl>, RootImpl&);
|
void did_create_root(Badge<RootImpl>, RootImpl&);
|
||||||
void did_destroy_root(Badge<RootImpl>, RootImpl&);
|
void did_destroy_root(Badge<RootImpl>, RootImpl&);
|
||||||
|
|
||||||
void did_create_marked_vector(Badge<MarkedVectorBase>, MarkedVectorBase&);
|
void did_create_marked_vector(Badge<RootVectorBase>, RootVectorBase&);
|
||||||
void did_destroy_marked_vector(Badge<MarkedVectorBase>, MarkedVectorBase&);
|
void did_destroy_marked_vector(Badge<RootVectorBase>, RootVectorBase&);
|
||||||
|
|
||||||
void did_create_conservative_vector(Badge<ConservativeVectorBase>, ConservativeVectorBase&);
|
void did_create_conservative_vector(Badge<ConservativeVectorBase>, ConservativeVectorBase&);
|
||||||
void did_destroy_conservative_vector(Badge<ConservativeVectorBase>, ConservativeVectorBase&);
|
void did_destroy_conservative_vector(Badge<ConservativeVectorBase>, ConservativeVectorBase&);
|
||||||
|
@ -139,7 +139,7 @@ private:
|
||||||
CellAllocator::List m_all_cell_allocators;
|
CellAllocator::List m_all_cell_allocators;
|
||||||
|
|
||||||
RootImpl::List m_roots;
|
RootImpl::List m_roots;
|
||||||
MarkedVectorBase::List m_marked_vectors;
|
RootVectorBase::List m_marked_vectors;
|
||||||
ConservativeVectorBase::List m_conservative_vectors;
|
ConservativeVectorBase::List m_conservative_vectors;
|
||||||
WeakContainer::List m_weak_containers;
|
WeakContainer::List m_weak_containers;
|
||||||
|
|
||||||
|
@ -165,13 +165,13 @@ inline void Heap::did_destroy_root(Badge<RootImpl>, RootImpl& impl)
|
||||||
m_roots.remove(impl);
|
m_roots.remove(impl);
|
||||||
}
|
}
|
||||||
|
|
||||||
inline void Heap::did_create_marked_vector(Badge<MarkedVectorBase>, MarkedVectorBase& vector)
|
inline void Heap::did_create_marked_vector(Badge<RootVectorBase>, RootVectorBase& vector)
|
||||||
{
|
{
|
||||||
VERIFY(!m_marked_vectors.contains(vector));
|
VERIFY(!m_marked_vectors.contains(vector));
|
||||||
m_marked_vectors.append(vector);
|
m_marked_vectors.append(vector);
|
||||||
}
|
}
|
||||||
|
|
||||||
inline void Heap::did_destroy_marked_vector(Badge<MarkedVectorBase>, MarkedVectorBase& vector)
|
inline void Heap::did_destroy_marked_vector(Badge<RootVectorBase>, RootVectorBase& vector)
|
||||||
{
|
{
|
||||||
VERIFY(m_marked_vectors.contains(vector));
|
VERIFY(m_marked_vectors.contains(vector));
|
||||||
m_marked_vectors.remove(vector);
|
m_marked_vectors.remove(vector);
|
||||||
|
|
|
@ -14,7 +14,7 @@ struct HeapRoot {
|
||||||
enum class Type {
|
enum class Type {
|
||||||
HeapFunctionCapturedPointer,
|
HeapFunctionCapturedPointer,
|
||||||
Root,
|
Root,
|
||||||
MarkedVector,
|
RootVector,
|
||||||
ConservativeVector,
|
ConservativeVector,
|
||||||
RegisterPointer,
|
RegisterPointer,
|
||||||
StackPointer,
|
StackPointer,
|
||||||
|
|
|
@ -6,27 +6,27 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <LibGC/Heap.h>
|
#include <LibGC/Heap.h>
|
||||||
#include <LibGC/MarkedVector.h>
|
#include <LibGC/RootVector.h>
|
||||||
|
|
||||||
namespace GC {
|
namespace GC {
|
||||||
|
|
||||||
MarkedVectorBase::MarkedVectorBase(Heap& heap)
|
RootVectorBase::RootVectorBase(Heap& heap)
|
||||||
: m_heap(&heap)
|
: m_heap(&heap)
|
||||||
{
|
{
|
||||||
m_heap->did_create_marked_vector({}, *this);
|
m_heap->did_create_marked_vector({}, *this);
|
||||||
}
|
}
|
||||||
|
|
||||||
MarkedVectorBase::~MarkedVectorBase()
|
RootVectorBase::~RootVectorBase()
|
||||||
{
|
{
|
||||||
m_heap->did_destroy_marked_vector({}, *this);
|
m_heap->did_destroy_marked_vector({}, *this);
|
||||||
}
|
}
|
||||||
|
|
||||||
MarkedVectorBase& MarkedVectorBase::operator=(MarkedVectorBase const& other)
|
RootVectorBase& RootVectorBase::operator=(RootVectorBase const& other)
|
||||||
{
|
{
|
||||||
if (m_heap != other.m_heap) {
|
if (m_heap != other.m_heap) {
|
||||||
m_heap = other.m_heap;
|
m_heap = other.m_heap;
|
||||||
|
|
||||||
// NOTE: IntrusiveList will remove this MarkedVectorBase from the old heap it was part of.
|
// NOTE: IntrusiveList will remove this RootVectorBase from the old heap it was part of.
|
||||||
m_heap->did_create_marked_vector({}, *this);
|
m_heap->did_create_marked_vector({}, *this);
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,52 +16,52 @@
|
||||||
|
|
||||||
namespace GC {
|
namespace GC {
|
||||||
|
|
||||||
class MarkedVectorBase {
|
class RootVectorBase {
|
||||||
public:
|
public:
|
||||||
virtual void gather_roots(HashMap<Cell*, GC::HeapRoot>&) const = 0;
|
virtual void gather_roots(HashMap<Cell*, GC::HeapRoot>&) const = 0;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
explicit MarkedVectorBase(Heap&);
|
explicit RootVectorBase(Heap&);
|
||||||
~MarkedVectorBase();
|
~RootVectorBase();
|
||||||
|
|
||||||
MarkedVectorBase& operator=(MarkedVectorBase const&);
|
RootVectorBase& operator=(RootVectorBase const&);
|
||||||
|
|
||||||
Heap* m_heap { nullptr };
|
Heap* m_heap { nullptr };
|
||||||
IntrusiveListNode<MarkedVectorBase> m_list_node;
|
IntrusiveListNode<RootVectorBase> m_list_node;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
using List = IntrusiveList<&MarkedVectorBase::m_list_node>;
|
using List = IntrusiveList<&RootVectorBase::m_list_node>;
|
||||||
};
|
};
|
||||||
|
|
||||||
template<typename T, size_t inline_capacity>
|
template<typename T, size_t inline_capacity>
|
||||||
class MarkedVector final
|
class RootVector final
|
||||||
: public MarkedVectorBase
|
: public RootVectorBase
|
||||||
, public Vector<T, inline_capacity> {
|
, public Vector<T, inline_capacity> {
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit MarkedVector(Heap& heap)
|
explicit RootVector(Heap& heap)
|
||||||
: MarkedVectorBase(heap)
|
: RootVectorBase(heap)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual ~MarkedVector() = default;
|
virtual ~RootVector() = default;
|
||||||
|
|
||||||
MarkedVector(MarkedVector const& other)
|
RootVector(RootVector const& other)
|
||||||
: MarkedVectorBase(*other.m_heap)
|
: RootVectorBase(*other.m_heap)
|
||||||
, Vector<T, inline_capacity>(other)
|
, Vector<T, inline_capacity>(other)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
MarkedVector(MarkedVector&& other)
|
RootVector(RootVector&& other)
|
||||||
: MarkedVectorBase(*other.m_heap)
|
: RootVectorBase(*other.m_heap)
|
||||||
, Vector<T, inline_capacity>(move(static_cast<Vector<T, inline_capacity>&>(other)))
|
, Vector<T, inline_capacity>(move(static_cast<Vector<T, inline_capacity>&>(other)))
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
MarkedVector& operator=(MarkedVector const& other)
|
RootVector& operator=(RootVector const& other)
|
||||||
{
|
{
|
||||||
Vector<T, inline_capacity>::operator=(other);
|
Vector<T, inline_capacity>::operator=(other);
|
||||||
MarkedVectorBase::operator=(other);
|
RootVectorBase::operator=(other);
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -70,9 +70,9 @@ public:
|
||||||
for (auto& value : *this) {
|
for (auto& value : *this) {
|
||||||
if constexpr (IsBaseOf<NanBoxedValue, T>) {
|
if constexpr (IsBaseOf<NanBoxedValue, T>) {
|
||||||
if (value.is_cell())
|
if (value.is_cell())
|
||||||
roots.set(&const_cast<T&>(value).as_cell(), HeapRoot { .type = HeapRoot::Type::MarkedVector });
|
roots.set(&const_cast<T&>(value).as_cell(), HeapRoot { .type = HeapRoot::Type::RootVector });
|
||||||
} else {
|
} else {
|
||||||
roots.set(value, HeapRoot { .type = HeapRoot::Type::MarkedVector });
|
roots.set(value, HeapRoot { .type = HeapRoot::Type::RootVector });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -32,8 +32,8 @@ static size_t get_function_shortest_length(FunctionType& function)
|
||||||
}
|
}
|
||||||
|
|
||||||
enum class SequenceStorageType {
|
enum class SequenceStorageType {
|
||||||
Vector, // Used to safely store non-JS values
|
Vector, // Used to safely store non-JS values
|
||||||
MarkedVector, // Used to safely store JS::Value and anything that inherits JS::Cell, e.g. JS::Object
|
RootVector, // Used to safely store JS::Value and anything that inherits JS::Cell, e.g. JS::Object
|
||||||
};
|
};
|
||||||
|
|
||||||
struct CppType {
|
struct CppType {
|
||||||
|
|
|
@ -14,7 +14,7 @@
|
||||||
#include <AK/TemporaryChange.h>
|
#include <AK/TemporaryChange.h>
|
||||||
#include <LibCrypto/BigInt/SignedBigInteger.h>
|
#include <LibCrypto/BigInt/SignedBigInteger.h>
|
||||||
#include <LibGC/ConservativeVector.h>
|
#include <LibGC/ConservativeVector.h>
|
||||||
#include <LibGC/MarkedVector.h>
|
#include <LibGC/RootVector.h>
|
||||||
#include <LibJS/AST.h>
|
#include <LibJS/AST.h>
|
||||||
#include <LibJS/Runtime/AbstractOperations.h>
|
#include <LibJS/Runtime/AbstractOperations.h>
|
||||||
#include <LibJS/Runtime/Accessor.h>
|
#include <LibJS/Runtime/Accessor.h>
|
||||||
|
|
|
@ -373,7 +373,7 @@ private:
|
||||||
NonnullOwnPtr<StringTable> m_string_table;
|
NonnullOwnPtr<StringTable> m_string_table;
|
||||||
NonnullOwnPtr<IdentifierTable> m_identifier_table;
|
NonnullOwnPtr<IdentifierTable> m_identifier_table;
|
||||||
NonnullOwnPtr<RegexTable> m_regex_table;
|
NonnullOwnPtr<RegexTable> m_regex_table;
|
||||||
GC::MarkedVector<Value> m_constants;
|
GC::RootVector<Value> m_constants;
|
||||||
|
|
||||||
mutable Optional<ScopedOperand> m_true_constant;
|
mutable Optional<ScopedOperand> m_true_constant;
|
||||||
mutable Optional<ScopedOperand> m_false_constant;
|
mutable Optional<ScopedOperand> m_false_constant;
|
||||||
|
|
|
@ -1458,13 +1458,13 @@ inline Value new_regexp(VM& vm, ParsedRegex const& parsed_regex, ByteString cons
|
||||||
}
|
}
|
||||||
|
|
||||||
// 13.3.8.1 https://tc39.es/ecma262/#sec-runtime-semantics-argumentlistevaluation
|
// 13.3.8.1 https://tc39.es/ecma262/#sec-runtime-semantics-argumentlistevaluation
|
||||||
inline GC::MarkedVector<Value> argument_list_evaluation(VM& vm, Value arguments)
|
inline GC::RootVector<Value> argument_list_evaluation(VM& vm, Value arguments)
|
||||||
{
|
{
|
||||||
// Note: Any spreading and actual evaluation is handled in preceding opcodes
|
// Note: Any spreading and actual evaluation is handled in preceding opcodes
|
||||||
// Note: The spec uses the concept of a list, while we create a temporary array
|
// Note: The spec uses the concept of a list, while we create a temporary array
|
||||||
// in the preceding opcodes, so we have to convert in a manner that is not
|
// in the preceding opcodes, so we have to convert in a manner that is not
|
||||||
// visible to the user
|
// visible to the user
|
||||||
GC::MarkedVector<Value> argument_values { vm.heap() };
|
GC::RootVector<Value> argument_values { vm.heap() };
|
||||||
|
|
||||||
auto& argument_array = arguments.as_array();
|
auto& argument_array = arguments.as_array();
|
||||||
auto array_length = argument_array.indexed_properties().array_like_size();
|
auto array_length = argument_array.indexed_properties().array_like_size();
|
||||||
|
@ -1541,7 +1541,7 @@ inline ThrowCompletionOr<GC::Ref<Object>> super_call_with_argument_array(VM& vm,
|
||||||
auto* func = get_super_constructor(vm);
|
auto* func = get_super_constructor(vm);
|
||||||
|
|
||||||
// 4. Let argList be ? ArgumentListEvaluation of Arguments.
|
// 4. Let argList be ? ArgumentListEvaluation of Arguments.
|
||||||
GC::MarkedVector<Value> arg_list { vm.heap() };
|
GC::RootVector<Value> arg_list { vm.heap() };
|
||||||
if (is_synthetic) {
|
if (is_synthetic) {
|
||||||
VERIFY(argument_array.is_object() && is<Array>(argument_array.as_object()));
|
VERIFY(argument_array.is_object() && is<Array>(argument_array.as_object()));
|
||||||
auto const& array_value = static_cast<Array const&>(argument_array.as_object());
|
auto const& array_value = static_cast<Array const&>(argument_array.as_object());
|
||||||
|
|
|
@ -51,7 +51,7 @@ ThrowCompletionOr<Value> Console::assert_()
|
||||||
auto message = PrimitiveString::create(vm, "Assertion failed"_string);
|
auto message = PrimitiveString::create(vm, "Assertion failed"_string);
|
||||||
|
|
||||||
// NOTE: Assemble `data` from the function arguments.
|
// NOTE: Assemble `data` from the function arguments.
|
||||||
GC::MarkedVector<Value> data { vm.heap() };
|
GC::RootVector<Value> data { vm.heap() };
|
||||||
if (vm.argument_count() > 1) {
|
if (vm.argument_count() > 1) {
|
||||||
data.ensure_capacity(vm.argument_count() - 1);
|
data.ensure_capacity(vm.argument_count() - 1);
|
||||||
for (size_t i = 1; i < vm.argument_count(); ++i) {
|
for (size_t i = 1; i < vm.argument_count(); ++i) {
|
||||||
|
@ -143,7 +143,7 @@ ThrowCompletionOr<Value> Console::log()
|
||||||
}
|
}
|
||||||
|
|
||||||
// To [create table row] given tabularDataItem, rowIndex, list finalColumns, and optional list properties, perform the following steps:
|
// To [create table row] given tabularDataItem, rowIndex, list finalColumns, and optional list properties, perform the following steps:
|
||||||
static ThrowCompletionOr<GC::Ref<Object>> create_table_row(Realm& realm, Value row_index, Value tabular_data_item, GC::MarkedVector<Value>& final_columns, HashMap<PropertyKey, bool>& visited_columns, HashMap<PropertyKey, bool>& properties)
|
static ThrowCompletionOr<GC::Ref<Object>> create_table_row(Realm& realm, Value row_index, Value tabular_data_item, GC::RootVector<Value>& final_columns, HashMap<PropertyKey, bool>& visited_columns, HashMap<PropertyKey, bool>& properties)
|
||||||
{
|
{
|
||||||
auto& vm = realm.vm();
|
auto& vm = realm.vm();
|
||||||
|
|
||||||
|
@ -264,10 +264,10 @@ ThrowCompletionOr<Value> Console::table()
|
||||||
}
|
}
|
||||||
|
|
||||||
// 1. Let `finalRows` be the new list, initially empty
|
// 1. Let `finalRows` be the new list, initially empty
|
||||||
GC::MarkedVector<Value> final_rows(vm.heap());
|
GC::RootVector<Value> final_rows(vm.heap());
|
||||||
|
|
||||||
// 2. Let `finalColumns` be the new list, initially empty
|
// 2. Let `finalColumns` be the new list, initially empty
|
||||||
GC::MarkedVector<Value> final_columns(vm.heap());
|
GC::RootVector<Value> final_columns(vm.heap());
|
||||||
|
|
||||||
HashMap<PropertyKey, bool> visited_columns;
|
HashMap<PropertyKey, bool> visited_columns;
|
||||||
|
|
||||||
|
@ -327,7 +327,7 @@ ThrowCompletionOr<Value> Console::table()
|
||||||
TRY(final_data->set(vm.names.columns, table_cols, Object::ShouldThrowExceptions::No));
|
TRY(final_data->set(vm.names.columns, table_cols, Object::ShouldThrowExceptions::No));
|
||||||
|
|
||||||
// 5.4. Perform `Printer("table", finalData)`
|
// 5.4. Perform `Printer("table", finalData)`
|
||||||
GC::MarkedVector<Value> args(vm.heap());
|
GC::RootVector<Value> args(vm.heap());
|
||||||
args.append(Value(final_data));
|
args.append(Value(final_data));
|
||||||
return m_client->printer(LogLevel::Table, args);
|
return m_client->printer(LogLevel::Table, args);
|
||||||
}
|
}
|
||||||
|
@ -389,7 +389,7 @@ ThrowCompletionOr<Value> Console::dir()
|
||||||
|
|
||||||
// 2. Perform Printer("dir", « object », options).
|
// 2. Perform Printer("dir", « object », options).
|
||||||
if (m_client) {
|
if (m_client) {
|
||||||
GC::MarkedVector<Value> printer_arguments { vm.heap() };
|
GC::RootVector<Value> printer_arguments { vm.heap() };
|
||||||
TRY_OR_THROW_OOM(vm, printer_arguments.try_append(object));
|
TRY_OR_THROW_OOM(vm, printer_arguments.try_append(object));
|
||||||
|
|
||||||
return m_client->printer(LogLevel::Dir, move(printer_arguments));
|
return m_client->printer(LogLevel::Dir, move(printer_arguments));
|
||||||
|
@ -429,7 +429,7 @@ ThrowCompletionOr<Value> Console::count()
|
||||||
auto concat = TRY_OR_THROW_OOM(vm, String::formatted("{}: {}", label, map.get(label).value()));
|
auto concat = TRY_OR_THROW_OOM(vm, String::formatted("{}: {}", label, map.get(label).value()));
|
||||||
|
|
||||||
// 5. Perform Logger("count", « concat »).
|
// 5. Perform Logger("count", « concat »).
|
||||||
GC::MarkedVector<Value> concat_as_vector { vm.heap() };
|
GC::RootVector<Value> concat_as_vector { vm.heap() };
|
||||||
concat_as_vector.append(PrimitiveString::create(vm, move(concat)));
|
concat_as_vector.append(PrimitiveString::create(vm, move(concat)));
|
||||||
if (m_client)
|
if (m_client)
|
||||||
TRY(m_client->logger(LogLevel::Count, concat_as_vector));
|
TRY(m_client->logger(LogLevel::Count, concat_as_vector));
|
||||||
|
@ -457,7 +457,7 @@ ThrowCompletionOr<Value> Console::count_reset()
|
||||||
// that the given label does not have an associated count.
|
// that the given label does not have an associated count.
|
||||||
auto message = TRY_OR_THROW_OOM(vm, String::formatted("\"{}\" doesn't have a count", label));
|
auto message = TRY_OR_THROW_OOM(vm, String::formatted("\"{}\" doesn't have a count", label));
|
||||||
// 2. Perform Logger("countReset", « message »);
|
// 2. Perform Logger("countReset", « message »);
|
||||||
GC::MarkedVector<Value> message_as_vector { vm.heap() };
|
GC::RootVector<Value> message_as_vector { vm.heap() };
|
||||||
message_as_vector.append(PrimitiveString::create(vm, move(message)));
|
message_as_vector.append(PrimitiveString::create(vm, move(message)));
|
||||||
if (m_client)
|
if (m_client)
|
||||||
TRY(m_client->logger(LogLevel::CountReset, message_as_vector));
|
TRY(m_client->logger(LogLevel::CountReset, message_as_vector));
|
||||||
|
@ -560,7 +560,7 @@ ThrowCompletionOr<Value> Console::time()
|
||||||
// a warning to the console indicating that a timer with label `label` has already been started.
|
// a warning to the console indicating that a timer with label `label` has already been started.
|
||||||
if (m_timer_table.contains(label)) {
|
if (m_timer_table.contains(label)) {
|
||||||
if (m_client) {
|
if (m_client) {
|
||||||
GC::MarkedVector<Value> timer_already_exists_warning_message_as_vector { vm.heap() };
|
GC::RootVector<Value> timer_already_exists_warning_message_as_vector { vm.heap() };
|
||||||
|
|
||||||
auto message = TRY_OR_THROW_OOM(vm, String::formatted("Timer '{}' already exists.", label));
|
auto message = TRY_OR_THROW_OOM(vm, String::formatted("Timer '{}' already exists.", label));
|
||||||
timer_already_exists_warning_message_as_vector.append(PrimitiveString::create(vm, move(message)));
|
timer_already_exists_warning_message_as_vector.append(PrimitiveString::create(vm, move(message)));
|
||||||
|
@ -591,7 +591,7 @@ ThrowCompletionOr<Value> Console::time_log()
|
||||||
// NOTE: Warn if the timer doesn't exist. Not part of the spec yet, but discussed here: https://github.com/whatwg/console/issues/134
|
// NOTE: Warn if the timer doesn't exist. Not part of the spec yet, but discussed here: https://github.com/whatwg/console/issues/134
|
||||||
if (maybe_start_time == m_timer_table.end()) {
|
if (maybe_start_time == m_timer_table.end()) {
|
||||||
if (m_client) {
|
if (m_client) {
|
||||||
GC::MarkedVector<Value> timer_does_not_exist_warning_message_as_vector { vm.heap() };
|
GC::RootVector<Value> timer_does_not_exist_warning_message_as_vector { vm.heap() };
|
||||||
|
|
||||||
auto message = TRY_OR_THROW_OOM(vm, String::formatted("Timer '{}' does not exist.", label));
|
auto message = TRY_OR_THROW_OOM(vm, String::formatted("Timer '{}' does not exist.", label));
|
||||||
timer_does_not_exist_warning_message_as_vector.append(PrimitiveString::create(vm, move(message)));
|
timer_does_not_exist_warning_message_as_vector.append(PrimitiveString::create(vm, move(message)));
|
||||||
|
@ -609,7 +609,7 @@ ThrowCompletionOr<Value> Console::time_log()
|
||||||
auto concat = TRY_OR_THROW_OOM(vm, String::formatted("{}: {}", label, duration));
|
auto concat = TRY_OR_THROW_OOM(vm, String::formatted("{}: {}", label, duration));
|
||||||
|
|
||||||
// 5. Prepend concat to data.
|
// 5. Prepend concat to data.
|
||||||
GC::MarkedVector<Value> data { vm.heap() };
|
GC::RootVector<Value> data { vm.heap() };
|
||||||
data.ensure_capacity(vm.argument_count());
|
data.ensure_capacity(vm.argument_count());
|
||||||
data.append(PrimitiveString::create(vm, move(concat)));
|
data.append(PrimitiveString::create(vm, move(concat)));
|
||||||
for (size_t i = 1; i < vm.argument_count(); ++i)
|
for (size_t i = 1; i < vm.argument_count(); ++i)
|
||||||
|
@ -637,7 +637,7 @@ ThrowCompletionOr<Value> Console::time_end()
|
||||||
// NOTE: Warn if the timer doesn't exist. Not part of the spec yet, but discussed here: https://github.com/whatwg/console/issues/134
|
// NOTE: Warn if the timer doesn't exist. Not part of the spec yet, but discussed here: https://github.com/whatwg/console/issues/134
|
||||||
if (maybe_start_time == m_timer_table.end()) {
|
if (maybe_start_time == m_timer_table.end()) {
|
||||||
if (m_client) {
|
if (m_client) {
|
||||||
GC::MarkedVector<Value> timer_does_not_exist_warning_message_as_vector { vm.heap() };
|
GC::RootVector<Value> timer_does_not_exist_warning_message_as_vector { vm.heap() };
|
||||||
|
|
||||||
auto message = TRY_OR_THROW_OOM(vm, String::formatted("Timer '{}' does not exist.", label));
|
auto message = TRY_OR_THROW_OOM(vm, String::formatted("Timer '{}' does not exist.", label));
|
||||||
timer_does_not_exist_warning_message_as_vector.append(PrimitiveString::create(vm, move(message)));
|
timer_does_not_exist_warning_message_as_vector.append(PrimitiveString::create(vm, move(message)));
|
||||||
|
@ -659,18 +659,18 @@ ThrowCompletionOr<Value> Console::time_end()
|
||||||
|
|
||||||
// 6. Perform Printer("timeEnd", « concat »).
|
// 6. Perform Printer("timeEnd", « concat »).
|
||||||
if (m_client) {
|
if (m_client) {
|
||||||
GC::MarkedVector<Value> concat_as_vector { vm.heap() };
|
GC::RootVector<Value> concat_as_vector { vm.heap() };
|
||||||
concat_as_vector.append(PrimitiveString::create(vm, move(concat)));
|
concat_as_vector.append(PrimitiveString::create(vm, move(concat)));
|
||||||
TRY(m_client->printer(LogLevel::TimeEnd, move(concat_as_vector)));
|
TRY(m_client->printer(LogLevel::TimeEnd, move(concat_as_vector)));
|
||||||
}
|
}
|
||||||
return js_undefined();
|
return js_undefined();
|
||||||
}
|
}
|
||||||
|
|
||||||
GC::MarkedVector<Value> Console::vm_arguments()
|
GC::RootVector<Value> Console::vm_arguments()
|
||||||
{
|
{
|
||||||
auto& vm = realm().vm();
|
auto& vm = realm().vm();
|
||||||
|
|
||||||
GC::MarkedVector<Value> arguments { vm.heap() };
|
GC::RootVector<Value> arguments { vm.heap() };
|
||||||
arguments.ensure_capacity(vm.argument_count());
|
arguments.ensure_capacity(vm.argument_count());
|
||||||
for (size_t i = 0; i < vm.argument_count(); ++i) {
|
for (size_t i = 0; i < vm.argument_count(); ++i) {
|
||||||
arguments.append(vm.argument(i));
|
arguments.append(vm.argument(i));
|
||||||
|
@ -708,7 +708,7 @@ void Console::report_exception(JS::Error const& exception, bool in_promise) cons
|
||||||
m_client->report_exception(exception, in_promise);
|
m_client->report_exception(exception, in_promise);
|
||||||
}
|
}
|
||||||
|
|
||||||
ThrowCompletionOr<String> Console::value_vector_to_string(GC::MarkedVector<Value> const& values)
|
ThrowCompletionOr<String> Console::value_vector_to_string(GC::RootVector<Value> const& values)
|
||||||
{
|
{
|
||||||
auto& vm = realm().vm();
|
auto& vm = realm().vm();
|
||||||
StringBuilder builder;
|
StringBuilder builder;
|
||||||
|
@ -737,7 +737,7 @@ void ConsoleClient::visit_edges(Visitor& visitor)
|
||||||
}
|
}
|
||||||
|
|
||||||
// 2.1. Logger(logLevel, args), https://console.spec.whatwg.org/#logger
|
// 2.1. Logger(logLevel, args), https://console.spec.whatwg.org/#logger
|
||||||
ThrowCompletionOr<Value> ConsoleClient::logger(Console::LogLevel log_level, GC::MarkedVector<Value> const& args)
|
ThrowCompletionOr<Value> ConsoleClient::logger(Console::LogLevel log_level, GC::RootVector<Value> const& args)
|
||||||
{
|
{
|
||||||
auto& vm = m_console->realm().vm();
|
auto& vm = m_console->realm().vm();
|
||||||
|
|
||||||
|
@ -753,7 +753,7 @@ ThrowCompletionOr<Value> ConsoleClient::logger(Console::LogLevel log_level, GC::
|
||||||
|
|
||||||
// 4. If rest is empty, perform Printer(logLevel, « first ») and return.
|
// 4. If rest is empty, perform Printer(logLevel, « first ») and return.
|
||||||
if (rest_size == 0) {
|
if (rest_size == 0) {
|
||||||
GC::MarkedVector<Value> first_as_vector { vm.heap() };
|
GC::RootVector<Value> first_as_vector { vm.heap() };
|
||||||
first_as_vector.append(first);
|
first_as_vector.append(first);
|
||||||
return printer(log_level, move(first_as_vector));
|
return printer(log_level, move(first_as_vector));
|
||||||
}
|
}
|
||||||
|
@ -769,7 +769,7 @@ ThrowCompletionOr<Value> ConsoleClient::logger(Console::LogLevel log_level, GC::
|
||||||
}
|
}
|
||||||
|
|
||||||
// 2.2. Formatter(args), https://console.spec.whatwg.org/#formatter
|
// 2.2. Formatter(args), https://console.spec.whatwg.org/#formatter
|
||||||
ThrowCompletionOr<GC::MarkedVector<Value>> ConsoleClient::formatter(GC::MarkedVector<Value> const& args)
|
ThrowCompletionOr<GC::RootVector<Value>> ConsoleClient::formatter(GC::RootVector<Value> const& args)
|
||||||
{
|
{
|
||||||
auto& realm = m_console->realm();
|
auto& realm = m_console->realm();
|
||||||
auto& vm = realm.vm();
|
auto& vm = realm.vm();
|
||||||
|
@ -871,7 +871,7 @@ ThrowCompletionOr<GC::MarkedVector<Value>> ConsoleClient::formatter(GC::MarkedVe
|
||||||
}
|
}
|
||||||
|
|
||||||
// 7. Let result be a list containing target together with the elements of args starting from the third onward.
|
// 7. Let result be a list containing target together with the elements of args starting from the third onward.
|
||||||
GC::MarkedVector<Value> result { vm.heap() };
|
GC::RootVector<Value> result { vm.heap() };
|
||||||
result.ensure_capacity(args.size() - 1);
|
result.ensure_capacity(args.size() - 1);
|
||||||
result.empend(PrimitiveString::create(vm, move(target)));
|
result.empend(PrimitiveString::create(vm, move(target)));
|
||||||
for (size_t i = 2; i < args.size(); ++i)
|
for (size_t i = 2; i < args.size(); ++i)
|
||||||
|
@ -881,7 +881,7 @@ ThrowCompletionOr<GC::MarkedVector<Value>> ConsoleClient::formatter(GC::MarkedVe
|
||||||
return formatter(result);
|
return formatter(result);
|
||||||
}
|
}
|
||||||
|
|
||||||
ThrowCompletionOr<String> ConsoleClient::generically_format_values(GC::MarkedVector<Value> const& values)
|
ThrowCompletionOr<String> ConsoleClient::generically_format_values(GC::RootVector<Value> const& values)
|
||||||
{
|
{
|
||||||
AllocatingMemoryStream stream;
|
AllocatingMemoryStream stream;
|
||||||
auto& vm = m_console->realm().vm();
|
auto& vm = m_console->realm().vm();
|
||||||
|
|
|
@ -63,7 +63,7 @@ public:
|
||||||
|
|
||||||
Realm& realm() const { return m_realm; }
|
Realm& realm() const { return m_realm; }
|
||||||
|
|
||||||
GC::MarkedVector<Value> vm_arguments();
|
GC::RootVector<Value> vm_arguments();
|
||||||
|
|
||||||
HashMap<String, unsigned>& counters() { return m_counters; }
|
HashMap<String, unsigned>& counters() { return m_counters; }
|
||||||
HashMap<String, unsigned> const& counters() const { return m_counters; }
|
HashMap<String, unsigned> const& counters() const { return m_counters; }
|
||||||
|
@ -95,7 +95,7 @@ private:
|
||||||
|
|
||||||
virtual void visit_edges(Visitor&) override;
|
virtual void visit_edges(Visitor&) override;
|
||||||
|
|
||||||
ThrowCompletionOr<String> value_vector_to_string(GC::MarkedVector<Value> const&);
|
ThrowCompletionOr<String> value_vector_to_string(GC::RootVector<Value> const&);
|
||||||
|
|
||||||
GC::Ref<Realm> m_realm;
|
GC::Ref<Realm> m_realm;
|
||||||
GC::Ptr<ConsoleClient> m_client;
|
GC::Ptr<ConsoleClient> m_client;
|
||||||
|
@ -110,10 +110,10 @@ class ConsoleClient : public Cell {
|
||||||
GC_DECLARE_ALLOCATOR(ConsoleClient);
|
GC_DECLARE_ALLOCATOR(ConsoleClient);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
using PrinterArguments = Variant<Console::Group, Console::Trace, GC::MarkedVector<Value>>;
|
using PrinterArguments = Variant<Console::Group, Console::Trace, GC::RootVector<Value>>;
|
||||||
|
|
||||||
ThrowCompletionOr<Value> logger(Console::LogLevel log_level, GC::MarkedVector<Value> const& args);
|
ThrowCompletionOr<Value> logger(Console::LogLevel log_level, GC::RootVector<Value> const& args);
|
||||||
ThrowCompletionOr<GC::MarkedVector<Value>> formatter(GC::MarkedVector<Value> const& args);
|
ThrowCompletionOr<GC::RootVector<Value>> formatter(GC::RootVector<Value> const& args);
|
||||||
virtual ThrowCompletionOr<Value> printer(Console::LogLevel log_level, PrinterArguments) = 0;
|
virtual ThrowCompletionOr<Value> printer(Console::LogLevel log_level, PrinterArguments) = 0;
|
||||||
|
|
||||||
virtual void add_css_style_to_current_message(StringView) { }
|
virtual void add_css_style_to_current_message(StringView) { }
|
||||||
|
@ -122,7 +122,7 @@ public:
|
||||||
virtual void clear() = 0;
|
virtual void clear() = 0;
|
||||||
virtual void end_group() = 0;
|
virtual void end_group() = 0;
|
||||||
|
|
||||||
ThrowCompletionOr<String> generically_format_values(GC::MarkedVector<Value> const&);
|
ThrowCompletionOr<String> generically_format_values(GC::RootVector<Value> const&);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
explicit ConsoleClient(Console&);
|
explicit ConsoleClient(Console&);
|
||||||
|
|
|
@ -97,7 +97,7 @@ ThrowCompletionOr<size_t> length_of_array_like(VM& vm, Object const& object)
|
||||||
}
|
}
|
||||||
|
|
||||||
// 7.3.20 CreateListFromArrayLike ( obj [ , elementTypes ] ), https://tc39.es/ecma262/#sec-createlistfromarraylike
|
// 7.3.20 CreateListFromArrayLike ( obj [ , elementTypes ] ), https://tc39.es/ecma262/#sec-createlistfromarraylike
|
||||||
ThrowCompletionOr<GC::MarkedVector<Value>> create_list_from_array_like(VM& vm, Value value, Function<ThrowCompletionOr<void>(Value)> check_value)
|
ThrowCompletionOr<GC::RootVector<Value>> create_list_from_array_like(VM& vm, Value value, Function<ThrowCompletionOr<void>(Value)> check_value)
|
||||||
{
|
{
|
||||||
// 1. If elementTypes is not present, set elementTypes to « Undefined, Null, Boolean, String, Symbol, Number, BigInt, Object ».
|
// 1. If elementTypes is not present, set elementTypes to « Undefined, Null, Boolean, String, Symbol, Number, BigInt, Object ».
|
||||||
|
|
||||||
|
@ -111,7 +111,7 @@ ThrowCompletionOr<GC::MarkedVector<Value>> create_list_from_array_like(VM& vm, V
|
||||||
auto length = TRY(length_of_array_like(vm, array_like));
|
auto length = TRY(length_of_array_like(vm, array_like));
|
||||||
|
|
||||||
// 4. Let list be a new empty List.
|
// 4. Let list be a new empty List.
|
||||||
auto list = GC::MarkedVector<Value> { vm.heap() };
|
auto list = GC::RootVector<Value> { vm.heap() };
|
||||||
list.ensure_capacity(length);
|
list.ensure_capacity(length);
|
||||||
|
|
||||||
// 5. Let index be 0.
|
// 5. Let index be 0.
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
#include <AK/Concepts.h>
|
#include <AK/Concepts.h>
|
||||||
#include <AK/Forward.h>
|
#include <AK/Forward.h>
|
||||||
#include <LibCrypto/Forward.h>
|
#include <LibCrypto/Forward.h>
|
||||||
#include <LibGC/MarkedVector.h>
|
#include <LibGC/RootVector.h>
|
||||||
#include <LibJS/Forward.h>
|
#include <LibJS/Forward.h>
|
||||||
#include <LibJS/Runtime/CanonicalIndex.h>
|
#include <LibJS/Runtime/CanonicalIndex.h>
|
||||||
#include <LibJS/Runtime/FunctionObject.h>
|
#include <LibJS/Runtime/FunctionObject.h>
|
||||||
|
@ -34,7 +34,7 @@ ThrowCompletionOr<Value> call_impl(VM&, Value function, Value this_value, Readon
|
||||||
ThrowCompletionOr<Value> call_impl(VM&, FunctionObject& function, Value this_value, ReadonlySpan<Value> arguments = {});
|
ThrowCompletionOr<Value> call_impl(VM&, FunctionObject& function, Value this_value, ReadonlySpan<Value> arguments = {});
|
||||||
ThrowCompletionOr<GC::Ref<Object>> construct_impl(VM&, FunctionObject&, ReadonlySpan<Value> arguments = {}, FunctionObject* new_target = nullptr);
|
ThrowCompletionOr<GC::Ref<Object>> construct_impl(VM&, FunctionObject&, ReadonlySpan<Value> arguments = {}, FunctionObject* new_target = nullptr);
|
||||||
ThrowCompletionOr<size_t> length_of_array_like(VM&, Object const&);
|
ThrowCompletionOr<size_t> length_of_array_like(VM&, Object const&);
|
||||||
ThrowCompletionOr<GC::MarkedVector<Value>> create_list_from_array_like(VM&, Value, Function<ThrowCompletionOr<void>(Value)> = {});
|
ThrowCompletionOr<GC::RootVector<Value>> create_list_from_array_like(VM&, Value, Function<ThrowCompletionOr<void>(Value)> = {});
|
||||||
ThrowCompletionOr<FunctionObject*> species_constructor(VM&, Object const&, FunctionObject& default_constructor);
|
ThrowCompletionOr<FunctionObject*> species_constructor(VM&, Object const&, FunctionObject& default_constructor);
|
||||||
ThrowCompletionOr<Realm*> get_function_realm(VM&, FunctionObject const&);
|
ThrowCompletionOr<Realm*> get_function_realm(VM&, FunctionObject const&);
|
||||||
ThrowCompletionOr<void> initialize_bound_name(VM&, DeprecatedFlyString const&, Value, Environment*);
|
ThrowCompletionOr<void> initialize_bound_name(VM&, DeprecatedFlyString const&, Value, Environment*);
|
||||||
|
@ -199,7 +199,7 @@ void add_value_to_keyed_group(VM& vm, GroupsType& groups, KeyType key, Value val
|
||||||
}
|
}
|
||||||
|
|
||||||
// 2. Let group be the Record { [[Key]]: key, [[Elements]]: « value » }.
|
// 2. Let group be the Record { [[Key]]: key, [[Elements]]: « value » }.
|
||||||
GC::MarkedVector<Value> new_elements { vm.heap() };
|
GC::RootVector<Value> new_elements { vm.heap() };
|
||||||
new_elements.append(value);
|
new_elements.append(value);
|
||||||
|
|
||||||
// 3. Append group as the last element of groups.
|
// 3. Append group as the last element of groups.
|
||||||
|
|
|
@ -161,10 +161,10 @@ ThrowCompletionOr<bool> Array::set_length(PropertyDescriptor const& property_des
|
||||||
}
|
}
|
||||||
|
|
||||||
// 23.1.3.30.1 SortIndexedProperties ( obj, len, SortCompare, holes ), https://tc39.es/ecma262/#sec-sortindexedproperties
|
// 23.1.3.30.1 SortIndexedProperties ( obj, len, SortCompare, holes ), https://tc39.es/ecma262/#sec-sortindexedproperties
|
||||||
ThrowCompletionOr<GC::MarkedVector<Value>> sort_indexed_properties(VM& vm, Object const& object, size_t length, Function<ThrowCompletionOr<double>(Value, Value)> const& sort_compare, Holes holes)
|
ThrowCompletionOr<GC::RootVector<Value>> sort_indexed_properties(VM& vm, Object const& object, size_t length, Function<ThrowCompletionOr<double>(Value, Value)> const& sort_compare, Holes holes)
|
||||||
{
|
{
|
||||||
// 1. Let items be a new empty List.
|
// 1. Let items be a new empty List.
|
||||||
auto items = GC::MarkedVector<Value> { vm.heap() };
|
auto items = GC::RootVector<Value> { vm.heap() };
|
||||||
|
|
||||||
// 2. Let k be 0.
|
// 2. Let k be 0.
|
||||||
// 3. Repeat, while k < len,
|
// 3. Repeat, while k < len,
|
||||||
|
@ -330,7 +330,7 @@ ThrowCompletionOr<bool> Array::internal_delete(PropertyKey const& property_key)
|
||||||
}
|
}
|
||||||
|
|
||||||
// NON-STANDARD: Used to inject the ephemeral length property's key
|
// NON-STANDARD: Used to inject the ephemeral length property's key
|
||||||
ThrowCompletionOr<GC::MarkedVector<Value>> Array::internal_own_property_keys() const
|
ThrowCompletionOr<GC::RootVector<Value>> Array::internal_own_property_keys() const
|
||||||
{
|
{
|
||||||
auto& vm = this->vm();
|
auto& vm = this->vm();
|
||||||
auto keys = TRY(Object::internal_own_property_keys());
|
auto keys = TRY(Object::internal_own_property_keys());
|
||||||
|
|
|
@ -37,7 +37,7 @@ public:
|
||||||
template<typename T>
|
template<typename T>
|
||||||
static GC::Ref<Array> create_from(Realm& realm, ReadonlySpan<T> elements, Function<Value(T const&)> map_fn)
|
static GC::Ref<Array> create_from(Realm& realm, ReadonlySpan<T> elements, Function<Value(T const&)> map_fn)
|
||||||
{
|
{
|
||||||
auto values = GC::MarkedVector<Value> { realm.heap() };
|
auto values = GC::RootVector<Value> { realm.heap() };
|
||||||
values.ensure_capacity(elements.size());
|
values.ensure_capacity(elements.size());
|
||||||
for (auto const& element : elements)
|
for (auto const& element : elements)
|
||||||
values.append(map_fn(element));
|
values.append(map_fn(element));
|
||||||
|
@ -50,7 +50,7 @@ public:
|
||||||
virtual ThrowCompletionOr<Optional<PropertyDescriptor>> internal_get_own_property(PropertyKey const&) const override final;
|
virtual ThrowCompletionOr<Optional<PropertyDescriptor>> internal_get_own_property(PropertyKey const&) const override final;
|
||||||
virtual ThrowCompletionOr<bool> internal_define_own_property(PropertyKey const&, PropertyDescriptor const&, Optional<PropertyDescriptor>* precomputed_get_own_property = nullptr) override final;
|
virtual ThrowCompletionOr<bool> internal_define_own_property(PropertyKey const&, PropertyDescriptor const&, Optional<PropertyDescriptor>* precomputed_get_own_property = nullptr) override final;
|
||||||
virtual ThrowCompletionOr<bool> internal_delete(PropertyKey const&) override;
|
virtual ThrowCompletionOr<bool> internal_delete(PropertyKey const&) override;
|
||||||
virtual ThrowCompletionOr<GC::MarkedVector<Value>> internal_own_property_keys() const override final;
|
virtual ThrowCompletionOr<GC::RootVector<Value>> internal_own_property_keys() const override final;
|
||||||
|
|
||||||
[[nodiscard]] bool length_is_writable() const { return m_length_writable; }
|
[[nodiscard]] bool length_is_writable() const { return m_length_writable; }
|
||||||
|
|
||||||
|
@ -68,7 +68,7 @@ enum class Holes {
|
||||||
ReadThroughHoles,
|
ReadThroughHoles,
|
||||||
};
|
};
|
||||||
|
|
||||||
ThrowCompletionOr<GC::MarkedVector<Value>> sort_indexed_properties(VM&, Object const&, size_t length, Function<ThrowCompletionOr<double>(Value, Value)> const& sort_compare, Holes holes);
|
ThrowCompletionOr<GC::RootVector<Value>> sort_indexed_properties(VM&, Object const&, size_t length, Function<ThrowCompletionOr<double>(Value, Value)> const& sort_compare, Holes holes);
|
||||||
ThrowCompletionOr<double> compare_array_elements(VM&, Value x, Value y, FunctionObject* comparefn);
|
ThrowCompletionOr<double> compare_array_elements(VM&, Value x, Value y, FunctionObject* comparefn);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1339,15 +1339,15 @@ JS_DEFINE_NATIVE_FUNCTION(ArrayPrototype::some)
|
||||||
return Value(false);
|
return Value(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
ThrowCompletionOr<void> array_merge_sort(VM& vm, Function<ThrowCompletionOr<double>(Value, Value)> const& compare_func, GC::MarkedVector<Value>& arr_to_sort)
|
ThrowCompletionOr<void> array_merge_sort(VM& vm, Function<ThrowCompletionOr<double>(Value, Value)> const& compare_func, GC::RootVector<Value>& arr_to_sort)
|
||||||
{
|
{
|
||||||
// FIXME: it would probably be better to switch to insertion sort for small arrays for
|
// FIXME: it would probably be better to switch to insertion sort for small arrays for
|
||||||
// better performance
|
// better performance
|
||||||
if (arr_to_sort.size() <= 1)
|
if (arr_to_sort.size() <= 1)
|
||||||
return {};
|
return {};
|
||||||
|
|
||||||
GC::MarkedVector<Value> left(vm.heap());
|
GC::RootVector<Value> left(vm.heap());
|
||||||
GC::MarkedVector<Value> right(vm.heap());
|
GC::RootVector<Value> right(vm.heap());
|
||||||
|
|
||||||
left.ensure_capacity(arr_to_sort.size() / 2);
|
left.ensure_capacity(arr_to_sort.size() / 2);
|
||||||
right.ensure_capacity(arr_to_sort.size() / 2 + (arr_to_sort.size() & 1));
|
right.ensure_capacity(arr_to_sort.size() / 2 + (arr_to_sort.size() & 1));
|
||||||
|
|
|
@ -64,6 +64,6 @@ private:
|
||||||
JS_DECLARE_NATIVE_FUNCTION(with);
|
JS_DECLARE_NATIVE_FUNCTION(with);
|
||||||
};
|
};
|
||||||
|
|
||||||
ThrowCompletionOr<void> array_merge_sort(VM&, Function<ThrowCompletionOr<double>(Value, Value)> const& compare_func, GC::MarkedVector<Value>& arr_to_sort);
|
ThrowCompletionOr<void> array_merge_sort(VM&, Function<ThrowCompletionOr<double>(Value, Value)> const& compare_func, GC::RootVector<Value>& arr_to_sort);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -83,7 +83,7 @@ ThrowCompletionOr<GC::Ref<Object>> BoundFunction::internal_construct(ReadonlySpa
|
||||||
auto& bound_args = m_bound_arguments;
|
auto& bound_args = m_bound_arguments;
|
||||||
|
|
||||||
// 4. Let args be the list-concatenation of boundArgs and argumentsList.
|
// 4. Let args be the list-concatenation of boundArgs and argumentsList.
|
||||||
auto args = GC::MarkedVector<Value> { heap() };
|
auto args = GC::RootVector<Value> { heap() };
|
||||||
args.extend(bound_args);
|
args.extend(bound_args);
|
||||||
args.append(arguments_list.data(), arguments_list.size());
|
args.append(arguments_list.data(), arguments_list.size());
|
||||||
|
|
||||||
|
|
|
@ -79,7 +79,7 @@ ThrowCompletionOr<void> FinalizationRegistry::cleanup(GC::Ptr<JobCallback> callb
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
// b. Remove cell from finalizationRegistry.[[Cells]].
|
// b. Remove cell from finalizationRegistry.[[Cells]].
|
||||||
GC::MarkedVector<Value> arguments(vm.heap());
|
GC::RootVector<Value> arguments(vm.heap());
|
||||||
arguments.append(it->held_value);
|
arguments.append(it->held_value);
|
||||||
it.remove(m_records);
|
it.remove(m_records);
|
||||||
|
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
#include <AK/Function.h>
|
#include <AK/Function.h>
|
||||||
#include <AK/StringBuilder.h>
|
#include <AK/StringBuilder.h>
|
||||||
#include <AK/TypeCasts.h>
|
#include <AK/TypeCasts.h>
|
||||||
#include <LibGC/MarkedVector.h>
|
#include <LibGC/RootVector.h>
|
||||||
#include <LibJS/Runtime/AbstractOperations.h>
|
#include <LibJS/Runtime/AbstractOperations.h>
|
||||||
#include <LibJS/Runtime/BoundFunction.h>
|
#include <LibJS/Runtime/BoundFunction.h>
|
||||||
#include <LibJS/Runtime/ECMAScriptFunctionObject.h>
|
#include <LibJS/Runtime/ECMAScriptFunctionObject.h>
|
||||||
|
|
|
@ -52,12 +52,12 @@ template<typename... Args>
|
||||||
[[nodiscard]] ALWAYS_INLINE ThrowCompletionOr<Value> Value::invoke(VM& vm, PropertyKey const& property_key, Args... args)
|
[[nodiscard]] ALWAYS_INLINE ThrowCompletionOr<Value> Value::invoke(VM& vm, PropertyKey const& property_key, Args... args)
|
||||||
{
|
{
|
||||||
if constexpr (sizeof...(Args) > 0) {
|
if constexpr (sizeof...(Args) > 0) {
|
||||||
GC::MarkedVector<Value> arglist { vm.heap() };
|
GC::RootVector<Value> arglist { vm.heap() };
|
||||||
(..., arglist.append(move(args)));
|
(..., arglist.append(move(args)));
|
||||||
return invoke_internal(vm, property_key, move(arglist));
|
return invoke_internal(vm, property_key, move(arglist));
|
||||||
}
|
}
|
||||||
|
|
||||||
return invoke_internal(vm, property_key, Optional<GC::MarkedVector<Value>> {});
|
return invoke_internal(vm, property_key, Optional<GC::RootVector<Value>> {});
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -72,7 +72,7 @@ JS_DEFINE_NATIVE_FUNCTION(Intl::get_canonical_locales)
|
||||||
// 1. Let ll be ? CanonicalizeLocaleList(locales).
|
// 1. Let ll be ? CanonicalizeLocaleList(locales).
|
||||||
auto locale_list = TRY(canonicalize_locale_list(vm, locales));
|
auto locale_list = TRY(canonicalize_locale_list(vm, locales));
|
||||||
|
|
||||||
GC::MarkedVector<Value> marked_locale_list { vm.heap() };
|
GC::RootVector<Value> marked_locale_list { vm.heap() };
|
||||||
marked_locale_list.ensure_capacity(locale_list.size());
|
marked_locale_list.ensure_capacity(locale_list.size());
|
||||||
|
|
||||||
for (auto& locale : locale_list)
|
for (auto& locale : locale_list)
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
* SPDX-License-Identifier: BSD-2-Clause
|
* SPDX-License-Identifier: BSD-2-Clause
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <LibGC/MarkedVector.h>
|
#include <LibGC/RootVector.h>
|
||||||
#include <LibJS/Runtime/Array.h>
|
#include <LibJS/Runtime/Array.h>
|
||||||
#include <LibJS/Runtime/GlobalObject.h>
|
#include <LibJS/Runtime/GlobalObject.h>
|
||||||
#include <LibJS/Runtime/Intl/PluralRulesPrototype.h>
|
#include <LibJS/Runtime/Intl/PluralRulesPrototype.h>
|
||||||
|
|
|
@ -345,10 +345,10 @@ GC::Ref<Object> create_iterator_result_object(VM& vm, Value value, bool done)
|
||||||
}
|
}
|
||||||
|
|
||||||
// 7.4.16 IteratorToList ( iteratorRecord ), https://tc39.es/ecma262/#sec-iteratortolist
|
// 7.4.16 IteratorToList ( iteratorRecord ), https://tc39.es/ecma262/#sec-iteratortolist
|
||||||
ThrowCompletionOr<GC::MarkedVector<Value>> iterator_to_list(VM& vm, IteratorRecord& iterator_record)
|
ThrowCompletionOr<GC::RootVector<Value>> iterator_to_list(VM& vm, IteratorRecord& iterator_record)
|
||||||
{
|
{
|
||||||
// 1. Let values be a new empty List.
|
// 1. Let values be a new empty List.
|
||||||
GC::MarkedVector<Value> values(vm.heap());
|
GC::RootVector<Value> values(vm.heap());
|
||||||
|
|
||||||
// 2. Repeat,
|
// 2. Repeat,
|
||||||
while (true) {
|
while (true) {
|
||||||
|
|
|
@ -82,7 +82,7 @@ ThrowCompletionOr<Optional<Value>> iterator_step_value(VM&, IteratorRecord&);
|
||||||
Completion iterator_close(VM&, IteratorRecord const&, Completion);
|
Completion iterator_close(VM&, IteratorRecord const&, Completion);
|
||||||
Completion async_iterator_close(VM&, IteratorRecord const&, Completion);
|
Completion async_iterator_close(VM&, IteratorRecord const&, Completion);
|
||||||
GC::Ref<Object> create_iterator_result_object(VM&, Value, bool done);
|
GC::Ref<Object> create_iterator_result_object(VM&, Value, bool done);
|
||||||
ThrowCompletionOr<GC::MarkedVector<Value>> iterator_to_list(VM&, IteratorRecord&);
|
ThrowCompletionOr<GC::RootVector<Value>> iterator_to_list(VM&, IteratorRecord&);
|
||||||
ThrowCompletionOr<void> setter_that_ignores_prototype_properties(VM&, Value this_, Object const& home, PropertyKey const& property, Value value);
|
ThrowCompletionOr<void> setter_that_ignores_prototype_properties(VM&, Value this_, Object const& home, PropertyKey const& property, Value value);
|
||||||
|
|
||||||
using IteratorValueCallback = Function<Optional<Completion>(Value)>;
|
using IteratorValueCallback = Function<Optional<Completion>(Value)>;
|
||||||
|
|
|
@ -717,7 +717,7 @@ JS_DEFINE_NATIVE_FUNCTION(IteratorPrototype::to_array)
|
||||||
auto iterated = TRY(get_iterator_direct(vm, object));
|
auto iterated = TRY(get_iterator_direct(vm, object));
|
||||||
|
|
||||||
// 4. Let items be a new empty List.
|
// 4. Let items be a new empty List.
|
||||||
GC::MarkedVector<Value> items(realm.heap());
|
GC::RootVector<Value> items(realm.heap());
|
||||||
|
|
||||||
// 5. Repeat,
|
// 5. Repeat,
|
||||||
while (true) {
|
while (true) {
|
||||||
|
|
|
@ -94,7 +94,7 @@ JS_DEFINE_NATIVE_FUNCTION(MapConstructor::group_by)
|
||||||
};
|
};
|
||||||
|
|
||||||
// 1. Let groups be ? GroupBy(items, callbackfn, zero).
|
// 1. Let groups be ? GroupBy(items, callbackfn, zero).
|
||||||
auto groups = TRY((JS::group_by<OrderedHashMap<GC::Root<Value>, GC::MarkedVector<Value>, KeyedGroupTraits>, void>(vm, items, callback_function)));
|
auto groups = TRY((JS::group_by<OrderedHashMap<GC::Root<Value>, GC::RootVector<Value>, KeyedGroupTraits>, void>(vm, items, callback_function)));
|
||||||
|
|
||||||
// 2. Let map be ! Construct(%Map%).
|
// 2. Let map be ! Construct(%Map%).
|
||||||
auto map = Map::create(realm);
|
auto map = Map::create(realm);
|
||||||
|
|
|
@ -210,11 +210,11 @@ ThrowCompletionOr<bool> ModuleNamespaceObject::internal_delete(PropertyKey const
|
||||||
}
|
}
|
||||||
|
|
||||||
// 10.4.6.11 [[OwnPropertyKeys]] ( ), https://tc39.es/ecma262/#sec-module-namespace-exotic-objects-ownpropertykeys
|
// 10.4.6.11 [[OwnPropertyKeys]] ( ), https://tc39.es/ecma262/#sec-module-namespace-exotic-objects-ownpropertykeys
|
||||||
ThrowCompletionOr<GC::MarkedVector<Value>> ModuleNamespaceObject::internal_own_property_keys() const
|
ThrowCompletionOr<GC::RootVector<Value>> ModuleNamespaceObject::internal_own_property_keys() const
|
||||||
{
|
{
|
||||||
// 1. Let exports be O.[[Exports]].
|
// 1. Let exports be O.[[Exports]].
|
||||||
// NOTE: We only add the exports after we know the size of symbolKeys
|
// NOTE: We only add the exports after we know the size of symbolKeys
|
||||||
GC::MarkedVector<Value> exports { vm().heap() };
|
GC::RootVector<Value> exports { vm().heap() };
|
||||||
|
|
||||||
// 2. Let symbolKeys be OrdinaryOwnPropertyKeys(O).
|
// 2. Let symbolKeys be OrdinaryOwnPropertyKeys(O).
|
||||||
auto symbol_keys = MUST(Object::internal_own_property_keys());
|
auto symbol_keys = MUST(Object::internal_own_property_keys());
|
||||||
|
|
|
@ -29,7 +29,7 @@ public:
|
||||||
virtual ThrowCompletionOr<Value> internal_get(PropertyKey const&, Value receiver, CacheablePropertyMetadata* = nullptr, PropertyLookupPhase = PropertyLookupPhase::OwnProperty) const override;
|
virtual ThrowCompletionOr<Value> internal_get(PropertyKey const&, Value receiver, CacheablePropertyMetadata* = nullptr, PropertyLookupPhase = PropertyLookupPhase::OwnProperty) const override;
|
||||||
virtual ThrowCompletionOr<bool> internal_set(PropertyKey const&, Value value, Value receiver, CacheablePropertyMetadata*) override;
|
virtual ThrowCompletionOr<bool> internal_set(PropertyKey const&, Value value, Value receiver, CacheablePropertyMetadata*) override;
|
||||||
virtual ThrowCompletionOr<bool> internal_delete(PropertyKey const&) override;
|
virtual ThrowCompletionOr<bool> internal_delete(PropertyKey const&) override;
|
||||||
virtual ThrowCompletionOr<GC::MarkedVector<Value>> internal_own_property_keys() const override;
|
virtual ThrowCompletionOr<GC::RootVector<Value>> internal_own_property_keys() const override;
|
||||||
virtual void initialize(Realm&) override;
|
virtual void initialize(Realm&) override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
|
@ -371,7 +371,7 @@ ThrowCompletionOr<bool> Object::test_integrity_level(IntegrityLevel level) const
|
||||||
}
|
}
|
||||||
|
|
||||||
// 7.3.24 EnumerableOwnPropertyNames ( O, kind ), https://tc39.es/ecma262/#sec-enumerableownpropertynames
|
// 7.3.24 EnumerableOwnPropertyNames ( O, kind ), https://tc39.es/ecma262/#sec-enumerableownpropertynames
|
||||||
ThrowCompletionOr<GC::MarkedVector<Value>> Object::enumerable_own_property_names(PropertyKind kind) const
|
ThrowCompletionOr<GC::RootVector<Value>> Object::enumerable_own_property_names(PropertyKind kind) const
|
||||||
{
|
{
|
||||||
// NOTE: This has been flattened for readability, so some `else` branches in the
|
// NOTE: This has been flattened for readability, so some `else` branches in the
|
||||||
// spec text have been replaced with `continue`s in the loop below.
|
// spec text have been replaced with `continue`s in the loop below.
|
||||||
|
@ -383,7 +383,7 @@ ThrowCompletionOr<GC::MarkedVector<Value>> Object::enumerable_own_property_names
|
||||||
auto own_keys = TRY(internal_own_property_keys());
|
auto own_keys = TRY(internal_own_property_keys());
|
||||||
|
|
||||||
// 2. Let properties be a new empty List.
|
// 2. Let properties be a new empty List.
|
||||||
auto properties = GC::MarkedVector<Value> { heap() };
|
auto properties = GC::RootVector<Value> { heap() };
|
||||||
|
|
||||||
// 3. For each element key of ownKeys, do
|
// 3. For each element key of ownKeys, do
|
||||||
for (auto& key : own_keys) {
|
for (auto& key : own_keys) {
|
||||||
|
@ -1070,12 +1070,12 @@ ThrowCompletionOr<bool> Object::internal_delete(PropertyKey const& property_key)
|
||||||
}
|
}
|
||||||
|
|
||||||
// 10.1.11 [[OwnPropertyKeys]] ( ), https://tc39.es/ecma262/#sec-ordinary-object-internal-methods-and-internal-slots-ownpropertykeys
|
// 10.1.11 [[OwnPropertyKeys]] ( ), https://tc39.es/ecma262/#sec-ordinary-object-internal-methods-and-internal-slots-ownpropertykeys
|
||||||
ThrowCompletionOr<GC::MarkedVector<Value>> Object::internal_own_property_keys() const
|
ThrowCompletionOr<GC::RootVector<Value>> Object::internal_own_property_keys() const
|
||||||
{
|
{
|
||||||
auto& vm = this->vm();
|
auto& vm = this->vm();
|
||||||
|
|
||||||
// 1. Let keys be a new empty List.
|
// 1. Let keys be a new empty List.
|
||||||
GC::MarkedVector<Value> keys { heap() };
|
GC::RootVector<Value> keys { heap() };
|
||||||
|
|
||||||
// 2. For each own property key P of O such that P is an array index, in ascending numeric index order, do
|
// 2. For each own property key P of O such that P is an array index, in ascending numeric index order, do
|
||||||
for (auto& entry : m_indexed_properties) {
|
for (auto& entry : m_indexed_properties) {
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
#include <AK/Badge.h>
|
#include <AK/Badge.h>
|
||||||
#include <AK/StringView.h>
|
#include <AK/StringView.h>
|
||||||
#include <LibGC/CellAllocator.h>
|
#include <LibGC/CellAllocator.h>
|
||||||
#include <LibGC/MarkedVector.h>
|
#include <LibGC/RootVector.h>
|
||||||
#include <LibJS/Forward.h>
|
#include <LibJS/Forward.h>
|
||||||
#include <LibJS/Heap/Cell.h>
|
#include <LibJS/Heap/Cell.h>
|
||||||
#include <LibJS/Runtime/Completion.h>
|
#include <LibJS/Runtime/Completion.h>
|
||||||
|
@ -118,7 +118,7 @@ public:
|
||||||
ThrowCompletionOr<bool> has_own_property(PropertyKey const&) const;
|
ThrowCompletionOr<bool> has_own_property(PropertyKey const&) const;
|
||||||
ThrowCompletionOr<bool> set_integrity_level(IntegrityLevel);
|
ThrowCompletionOr<bool> set_integrity_level(IntegrityLevel);
|
||||||
ThrowCompletionOr<bool> test_integrity_level(IntegrityLevel) const;
|
ThrowCompletionOr<bool> test_integrity_level(IntegrityLevel) const;
|
||||||
ThrowCompletionOr<GC::MarkedVector<Value>> enumerable_own_property_names(PropertyKind kind) const;
|
ThrowCompletionOr<GC::RootVector<Value>> enumerable_own_property_names(PropertyKind kind) const;
|
||||||
ThrowCompletionOr<void> copy_data_properties(VM&, Value source, HashTable<PropertyKey> const& excluded_keys, HashTable<JS::Value> const& excluded_values = {});
|
ThrowCompletionOr<void> copy_data_properties(VM&, Value source, HashTable<PropertyKey> const& excluded_keys, HashTable<JS::Value> const& excluded_values = {});
|
||||||
ThrowCompletionOr<GC::Ref<Object>> snapshot_own_properties(VM&, GC::Ptr<Object> prototype, HashTable<PropertyKey> const& excluded_keys = {}, HashTable<Value> const& excluded_values = {});
|
ThrowCompletionOr<GC::Ref<Object>> snapshot_own_properties(VM&, GC::Ptr<Object> prototype, HashTable<PropertyKey> const& excluded_keys = {}, HashTable<Value> const& excluded_values = {});
|
||||||
|
|
||||||
|
@ -146,7 +146,7 @@ public:
|
||||||
virtual ThrowCompletionOr<Value> internal_get(PropertyKey const&, Value receiver, CacheablePropertyMetadata* = nullptr, PropertyLookupPhase = PropertyLookupPhase::OwnProperty) const;
|
virtual ThrowCompletionOr<Value> internal_get(PropertyKey const&, Value receiver, CacheablePropertyMetadata* = nullptr, PropertyLookupPhase = PropertyLookupPhase::OwnProperty) const;
|
||||||
virtual ThrowCompletionOr<bool> internal_set(PropertyKey const&, Value value, Value receiver, CacheablePropertyMetadata* = nullptr);
|
virtual ThrowCompletionOr<bool> internal_set(PropertyKey const&, Value value, Value receiver, CacheablePropertyMetadata* = nullptr);
|
||||||
virtual ThrowCompletionOr<bool> internal_delete(PropertyKey const&);
|
virtual ThrowCompletionOr<bool> internal_delete(PropertyKey const&);
|
||||||
virtual ThrowCompletionOr<GC::MarkedVector<Value>> internal_own_property_keys() const;
|
virtual ThrowCompletionOr<GC::RootVector<Value>> internal_own_property_keys() const;
|
||||||
|
|
||||||
// NOTE: Any subclass of Object that overrides property access slots ([[Get]], [[Set]] etc)
|
// NOTE: Any subclass of Object that overrides property access slots ([[Get]], [[Set]] etc)
|
||||||
// to customize access to indexed properties (properties where the name is a positive integer)
|
// to customize access to indexed properties (properties where the name is a positive integer)
|
||||||
|
|
|
@ -93,7 +93,7 @@ enum class GetOwnPropertyKeysType {
|
||||||
};
|
};
|
||||||
|
|
||||||
// 20.1.2.11.1 GetOwnPropertyKeys ( O, type ), https://tc39.es/ecma262/#sec-getownpropertykeys
|
// 20.1.2.11.1 GetOwnPropertyKeys ( O, type ), https://tc39.es/ecma262/#sec-getownpropertykeys
|
||||||
static ThrowCompletionOr<GC::MarkedVector<Value>> get_own_property_keys(VM& vm, Value value, GetOwnPropertyKeysType type)
|
static ThrowCompletionOr<GC::RootVector<Value>> get_own_property_keys(VM& vm, Value value, GetOwnPropertyKeysType type)
|
||||||
{
|
{
|
||||||
// 1. Let obj be ? ToObject(O).
|
// 1. Let obj be ? ToObject(O).
|
||||||
auto object = TRY(value.to_object(vm));
|
auto object = TRY(value.to_object(vm));
|
||||||
|
@ -102,7 +102,7 @@ static ThrowCompletionOr<GC::MarkedVector<Value>> get_own_property_keys(VM& vm,
|
||||||
auto keys = TRY(object->internal_own_property_keys());
|
auto keys = TRY(object->internal_own_property_keys());
|
||||||
|
|
||||||
// 3. Let nameList be a new empty List.
|
// 3. Let nameList be a new empty List.
|
||||||
auto name_list = GC::MarkedVector<Value> { vm.heap() };
|
auto name_list = GC::RootVector<Value> { vm.heap() };
|
||||||
|
|
||||||
// 4. For each element nextKey of keys, do
|
// 4. For each element nextKey of keys, do
|
||||||
for (auto& next_key : keys) {
|
for (auto& next_key : keys) {
|
||||||
|
@ -382,7 +382,7 @@ JS_DEFINE_NATIVE_FUNCTION(ObjectConstructor::group_by)
|
||||||
auto callback_function = vm.argument(1);
|
auto callback_function = vm.argument(1);
|
||||||
|
|
||||||
// 1. Let groups be ? GroupBy(items, callbackfn, property).
|
// 1. Let groups be ? GroupBy(items, callbackfn, property).
|
||||||
auto groups = TRY((JS::group_by<OrderedHashMap<PropertyKey, GC::MarkedVector<Value>>, PropertyKey>(vm, items, callback_function)));
|
auto groups = TRY((JS::group_by<OrderedHashMap<PropertyKey, GC::RootVector<Value>>, PropertyKey>(vm, items, callback_function)));
|
||||||
|
|
||||||
// 2. Let obj be OrdinaryObjectCreate(null).
|
// 2. Let obj be OrdinaryObjectCreate(null).
|
||||||
auto object = Object::create(realm, nullptr);
|
auto object = Object::create(realm, nullptr);
|
||||||
|
|
|
@ -681,7 +681,7 @@ ThrowCompletionOr<bool> ProxyObject::internal_delete(PropertyKey const& property
|
||||||
}
|
}
|
||||||
|
|
||||||
// 10.5.11 [[OwnPropertyKeys]] ( ), https://tc39.es/ecma262/#sec-proxy-object-internal-methods-and-internal-slots-ownpropertykeys
|
// 10.5.11 [[OwnPropertyKeys]] ( ), https://tc39.es/ecma262/#sec-proxy-object-internal-methods-and-internal-slots-ownpropertykeys
|
||||||
ThrowCompletionOr<GC::MarkedVector<Value>> ProxyObject::internal_own_property_keys() const
|
ThrowCompletionOr<GC::RootVector<Value>> ProxyObject::internal_own_property_keys() const
|
||||||
{
|
{
|
||||||
LIMIT_PROXY_RECURSION_DEPTH();
|
LIMIT_PROXY_RECURSION_DEPTH();
|
||||||
|
|
||||||
|
@ -732,10 +732,10 @@ ThrowCompletionOr<GC::MarkedVector<Value>> ProxyObject::internal_own_property_ke
|
||||||
// 13. Assert: targetKeys contains no duplicate entries.
|
// 13. Assert: targetKeys contains no duplicate entries.
|
||||||
|
|
||||||
// 14. Let targetConfigurableKeys be a new empty List.
|
// 14. Let targetConfigurableKeys be a new empty List.
|
||||||
auto target_configurable_keys = GC::MarkedVector<Value> { heap() };
|
auto target_configurable_keys = GC::RootVector<Value> { heap() };
|
||||||
|
|
||||||
// 15. Let targetNonconfigurableKeys be a new empty List.
|
// 15. Let targetNonconfigurableKeys be a new empty List.
|
||||||
auto target_nonconfigurable_keys = GC::MarkedVector<Value> { heap() };
|
auto target_nonconfigurable_keys = GC::RootVector<Value> { heap() };
|
||||||
|
|
||||||
// 16. For each element key of targetKeys, do
|
// 16. For each element key of targetKeys, do
|
||||||
for (auto& key : target_keys) {
|
for (auto& key : target_keys) {
|
||||||
|
@ -763,7 +763,7 @@ ThrowCompletionOr<GC::MarkedVector<Value>> ProxyObject::internal_own_property_ke
|
||||||
}
|
}
|
||||||
|
|
||||||
// 18. Let uncheckedResultKeys be a List whose elements are the elements of trapResult.
|
// 18. Let uncheckedResultKeys be a List whose elements are the elements of trapResult.
|
||||||
auto unchecked_result_keys = GC::MarkedVector<Value> { heap() };
|
auto unchecked_result_keys = GC::RootVector<Value> { heap() };
|
||||||
unchecked_result_keys.extend(trap_result);
|
unchecked_result_keys.extend(trap_result);
|
||||||
|
|
||||||
// 19. For each element key of targetNonconfigurableKeys, do
|
// 19. For each element key of targetNonconfigurableKeys, do
|
||||||
|
|
|
@ -42,7 +42,7 @@ public:
|
||||||
virtual ThrowCompletionOr<Value> internal_get(PropertyKey const&, Value receiver, CacheablePropertyMetadata*, PropertyLookupPhase) const override;
|
virtual ThrowCompletionOr<Value> internal_get(PropertyKey const&, Value receiver, CacheablePropertyMetadata*, PropertyLookupPhase) const override;
|
||||||
virtual ThrowCompletionOr<bool> internal_set(PropertyKey const&, Value value, Value receiver, CacheablePropertyMetadata*) override;
|
virtual ThrowCompletionOr<bool> internal_set(PropertyKey const&, Value value, Value receiver, CacheablePropertyMetadata*) override;
|
||||||
virtual ThrowCompletionOr<bool> internal_delete(PropertyKey const&) override;
|
virtual ThrowCompletionOr<bool> internal_delete(PropertyKey const&) override;
|
||||||
virtual ThrowCompletionOr<GC::MarkedVector<Value>> internal_own_property_keys() const override;
|
virtual ThrowCompletionOr<GC::RootVector<Value>> internal_own_property_keys() const override;
|
||||||
virtual ThrowCompletionOr<Value> internal_call(Value this_argument, ReadonlySpan<Value> arguments_list) override;
|
virtual ThrowCompletionOr<Value> internal_call(Value this_argument, ReadonlySpan<Value> arguments_list) override;
|
||||||
virtual ThrowCompletionOr<GC::Ref<Object>> internal_construct(ReadonlySpan<Value> arguments_list, FunctionObject& new_target) override;
|
virtual ThrowCompletionOr<GC::Ref<Object>> internal_construct(ReadonlySpan<Value> arguments_list, FunctionObject& new_target) override;
|
||||||
|
|
||||||
|
|
|
@ -669,7 +669,7 @@ JS_DEFINE_NATIVE_FUNCTION(RegExpPrototype::symbol_replace)
|
||||||
}
|
}
|
||||||
|
|
||||||
// 10. Let results be a new empty List.
|
// 10. Let results be a new empty List.
|
||||||
GC::MarkedVector<Object*> results(vm.heap());
|
GC::RootVector<Object*> results(vm.heap());
|
||||||
|
|
||||||
// 11. Let done be false.
|
// 11. Let done be false.
|
||||||
// 12. Repeat, while done is false,
|
// 12. Repeat, while done is false,
|
||||||
|
@ -735,7 +735,7 @@ JS_DEFINE_NATIVE_FUNCTION(RegExpPrototype::symbol_replace)
|
||||||
position = clamp(position, static_cast<double>(0), static_cast<double>(string.length_in_code_units()));
|
position = clamp(position, static_cast<double>(0), static_cast<double>(string.length_in_code_units()));
|
||||||
|
|
||||||
// g. Let captures be a new empty List.
|
// g. Let captures be a new empty List.
|
||||||
GC::MarkedVector<Value> captures(vm.heap());
|
GC::RootVector<Value> captures(vm.heap());
|
||||||
|
|
||||||
// h. Let n be 1.
|
// h. Let n be 1.
|
||||||
// i. Repeat, while n ≤ nCaptures,
|
// i. Repeat, while n ≤ nCaptures,
|
||||||
|
@ -764,7 +764,7 @@ JS_DEFINE_NATIVE_FUNCTION(RegExpPrototype::symbol_replace)
|
||||||
// k. If functionalReplace is true, then
|
// k. If functionalReplace is true, then
|
||||||
if (replace_value.is_function()) {
|
if (replace_value.is_function()) {
|
||||||
// i. Let replacerArgs be the list-concatenation of « matched », captures, and « 𝔽(position), S ».
|
// i. Let replacerArgs be the list-concatenation of « matched », captures, and « 𝔽(position), S ».
|
||||||
GC::MarkedVector<Value> replacer_args(vm.heap());
|
GC::RootVector<Value> replacer_args(vm.heap());
|
||||||
replacer_args.append(PrimitiveString::create(vm, move(matched)));
|
replacer_args.append(PrimitiveString::create(vm, move(matched)));
|
||||||
replacer_args.extend(move(captures));
|
replacer_args.extend(move(captures));
|
||||||
replacer_args.append(Value(position));
|
replacer_args.append(Value(position));
|
||||||
|
|
|
@ -128,12 +128,12 @@ ThrowCompletionOr<bool> StringObject::internal_define_own_property(PropertyKey c
|
||||||
}
|
}
|
||||||
|
|
||||||
// 10.4.3.3 [[OwnPropertyKeys]] ( ), https://tc39.es/ecma262/#sec-string-exotic-objects-ownpropertykeys
|
// 10.4.3.3 [[OwnPropertyKeys]] ( ), https://tc39.es/ecma262/#sec-string-exotic-objects-ownpropertykeys
|
||||||
ThrowCompletionOr<GC::MarkedVector<Value>> StringObject::internal_own_property_keys() const
|
ThrowCompletionOr<GC::RootVector<Value>> StringObject::internal_own_property_keys() const
|
||||||
{
|
{
|
||||||
auto& vm = this->vm();
|
auto& vm = this->vm();
|
||||||
|
|
||||||
// 1. Let keys be a new empty List.
|
// 1. Let keys be a new empty List.
|
||||||
auto keys = GC::MarkedVector<Value> { heap() };
|
auto keys = GC::RootVector<Value> { heap() };
|
||||||
|
|
||||||
// 2. Let str be O.[[StringData]].
|
// 2. Let str be O.[[StringData]].
|
||||||
auto str = m_string->utf16_string_view();
|
auto str = m_string->utf16_string_view();
|
||||||
|
|
|
@ -29,7 +29,7 @@ protected:
|
||||||
private:
|
private:
|
||||||
virtual ThrowCompletionOr<Optional<PropertyDescriptor>> internal_get_own_property(PropertyKey const&) const override;
|
virtual ThrowCompletionOr<Optional<PropertyDescriptor>> internal_get_own_property(PropertyKey const&) const override;
|
||||||
virtual ThrowCompletionOr<bool> internal_define_own_property(PropertyKey const&, PropertyDescriptor const&, Optional<PropertyDescriptor>* precomputed_get_own_property = nullptr) override;
|
virtual ThrowCompletionOr<bool> internal_define_own_property(PropertyKey const&, PropertyDescriptor const&, Optional<PropertyDescriptor>* precomputed_get_own_property = nullptr) override;
|
||||||
virtual ThrowCompletionOr<GC::MarkedVector<Value>> internal_own_property_keys() const override;
|
virtual ThrowCompletionOr<GC::RootVector<Value>> internal_own_property_keys() const override;
|
||||||
|
|
||||||
virtual bool is_string_object() const final { return true; }
|
virtual bool is_string_object() const final { return true; }
|
||||||
virtual void visit_edges(Visitor&) override;
|
virtual void visit_edges(Visitor&) override;
|
||||||
|
|
|
@ -288,7 +288,7 @@ static ThrowCompletionOr<void> initialize_typed_array_from_array_like(VM& vm, Ty
|
||||||
|
|
||||||
// 23.2.5.1.4 InitializeTypedArrayFromList, https://tc39.es/ecma262/#sec-initializetypedarrayfromlist
|
// 23.2.5.1.4 InitializeTypedArrayFromList, https://tc39.es/ecma262/#sec-initializetypedarrayfromlist
|
||||||
template<typename T>
|
template<typename T>
|
||||||
static ThrowCompletionOr<void> initialize_typed_array_from_list(VM& vm, TypedArray<T>& typed_array, GC::MarkedVector<Value> const& list)
|
static ThrowCompletionOr<void> initialize_typed_array_from_list(VM& vm, TypedArray<T>& typed_array, GC::RootVector<Value> const& list)
|
||||||
{
|
{
|
||||||
// 1. Let len be the number of elements in values.
|
// 1. Let len be the number of elements in values.
|
||||||
auto length = list.size();
|
auto length = list.size();
|
||||||
|
@ -315,7 +315,7 @@ static ThrowCompletionOr<void> initialize_typed_array_from_list(VM& vm, TypedArr
|
||||||
}
|
}
|
||||||
|
|
||||||
// 23.2.4.2 TypedArrayCreate ( constructor, argumentList ), https://tc39.es/ecma262/#typedarray-create
|
// 23.2.4.2 TypedArrayCreate ( constructor, argumentList ), https://tc39.es/ecma262/#typedarray-create
|
||||||
ThrowCompletionOr<TypedArrayBase*> typed_array_create(VM& vm, FunctionObject& constructor, GC::MarkedVector<Value> arguments)
|
ThrowCompletionOr<TypedArrayBase*> typed_array_create(VM& vm, FunctionObject& constructor, GC::RootVector<Value> arguments)
|
||||||
{
|
{
|
||||||
Optional<double> first_argument;
|
Optional<double> first_argument;
|
||||||
if (arguments.size() == 1 && arguments[0].is_number())
|
if (arguments.size() == 1 && arguments[0].is_number())
|
||||||
|
@ -346,7 +346,7 @@ ThrowCompletionOr<TypedArrayBase*> typed_array_create(VM& vm, FunctionObject& co
|
||||||
}
|
}
|
||||||
|
|
||||||
// 23.2.4.3 TypedArrayCreateSameType ( exemplar, argumentList ), https://tc39.es/ecma262/#sec-typedarray-create-same-type
|
// 23.2.4.3 TypedArrayCreateSameType ( exemplar, argumentList ), https://tc39.es/ecma262/#sec-typedarray-create-same-type
|
||||||
ThrowCompletionOr<TypedArrayBase*> typed_array_create_same_type(VM& vm, TypedArrayBase const& exemplar, GC::MarkedVector<Value> arguments)
|
ThrowCompletionOr<TypedArrayBase*> typed_array_create_same_type(VM& vm, TypedArrayBase const& exemplar, GC::RootVector<Value> arguments)
|
||||||
{
|
{
|
||||||
auto& realm = *vm.current_realm();
|
auto& realm = *vm.current_realm();
|
||||||
|
|
||||||
|
|
|
@ -413,7 +413,7 @@ public:
|
||||||
}
|
}
|
||||||
|
|
||||||
// 10.4.5.8 [[OwnPropertyKeys]] ( ), https://tc39.es/ecma262/#sec-integer-indexed-exotic-objects-ownpropertykeys
|
// 10.4.5.8 [[OwnPropertyKeys]] ( ), https://tc39.es/ecma262/#sec-integer-indexed-exotic-objects-ownpropertykeys
|
||||||
virtual ThrowCompletionOr<GC::MarkedVector<Value>> internal_own_property_keys() const override
|
virtual ThrowCompletionOr<GC::RootVector<Value>> internal_own_property_keys() const override
|
||||||
{
|
{
|
||||||
auto& vm = this->vm();
|
auto& vm = this->vm();
|
||||||
|
|
||||||
|
@ -421,7 +421,7 @@ public:
|
||||||
auto typed_array_record = make_typed_array_with_buffer_witness_record(*this, ArrayBuffer::Order::SeqCst);
|
auto typed_array_record = make_typed_array_with_buffer_witness_record(*this, ArrayBuffer::Order::SeqCst);
|
||||||
|
|
||||||
// 2. Let keys be a new empty List.
|
// 2. Let keys be a new empty List.
|
||||||
auto keys = GC::MarkedVector<Value> { heap() };
|
auto keys = GC::RootVector<Value> { heap() };
|
||||||
|
|
||||||
// 3. If IsTypedArrayOutOfBounds(taRecord) is false, then
|
// 3. If IsTypedArrayOutOfBounds(taRecord) is false, then
|
||||||
if (!is_typed_array_out_of_bounds(typed_array_record)) {
|
if (!is_typed_array_out_of_bounds(typed_array_record)) {
|
||||||
|
@ -511,8 +511,8 @@ protected:
|
||||||
};
|
};
|
||||||
|
|
||||||
ThrowCompletionOr<TypedArrayBase*> typed_array_from(VM&, Value);
|
ThrowCompletionOr<TypedArrayBase*> typed_array_from(VM&, Value);
|
||||||
ThrowCompletionOr<TypedArrayBase*> typed_array_create(VM&, FunctionObject& constructor, GC::MarkedVector<Value> arguments);
|
ThrowCompletionOr<TypedArrayBase*> typed_array_create(VM&, FunctionObject& constructor, GC::RootVector<Value> arguments);
|
||||||
ThrowCompletionOr<TypedArrayBase*> typed_array_create_same_type(VM&, TypedArrayBase const& exemplar, GC::MarkedVector<Value> arguments);
|
ThrowCompletionOr<TypedArrayBase*> typed_array_create_same_type(VM&, TypedArrayBase const& exemplar, GC::RootVector<Value> arguments);
|
||||||
ThrowCompletionOr<TypedArrayWithBufferWitness> validate_typed_array(VM&, Object const&, ArrayBuffer::Order);
|
ThrowCompletionOr<TypedArrayWithBufferWitness> validate_typed_array(VM&, Object const&, ArrayBuffer::Order);
|
||||||
ThrowCompletionOr<double> compare_typed_array_elements(VM&, Value x, Value y, FunctionObject* comparefn);
|
ThrowCompletionOr<double> compare_typed_array_elements(VM&, Value x, Value y, FunctionObject* comparefn);
|
||||||
|
|
||||||
|
|
|
@ -92,7 +92,7 @@ JS_DEFINE_NATIVE_FUNCTION(TypedArrayConstructor::from)
|
||||||
auto length = values.size();
|
auto length = values.size();
|
||||||
|
|
||||||
// c. Let targetObj be ? TypedArrayCreate(C, « 𝔽(len) »).
|
// c. Let targetObj be ? TypedArrayCreate(C, « 𝔽(len) »).
|
||||||
GC::MarkedVector<Value> arguments(vm.heap());
|
GC::RootVector<Value> arguments(vm.heap());
|
||||||
arguments.empend(length);
|
arguments.empend(length);
|
||||||
auto* target_object = TRY(typed_array_create(vm, constructor.as_function(), move(arguments)));
|
auto* target_object = TRY(typed_array_create(vm, constructor.as_function(), move(arguments)));
|
||||||
|
|
||||||
|
@ -139,7 +139,7 @@ JS_DEFINE_NATIVE_FUNCTION(TypedArrayConstructor::from)
|
||||||
auto length = TRY(length_of_array_like(vm, array_like));
|
auto length = TRY(length_of_array_like(vm, array_like));
|
||||||
|
|
||||||
// 10. Let targetObj be ? TypedArrayCreate(C, « 𝔽(len) »).
|
// 10. Let targetObj be ? TypedArrayCreate(C, « 𝔽(len) »).
|
||||||
GC::MarkedVector<Value> arguments(vm.heap());
|
GC::RootVector<Value> arguments(vm.heap());
|
||||||
arguments.empend(length);
|
arguments.empend(length);
|
||||||
auto* target_object = TRY(typed_array_create(vm, constructor.as_function(), move(arguments)));
|
auto* target_object = TRY(typed_array_create(vm, constructor.as_function(), move(arguments)));
|
||||||
|
|
||||||
|
@ -188,7 +188,7 @@ JS_DEFINE_NATIVE_FUNCTION(TypedArrayConstructor::of)
|
||||||
return vm.throw_completion<TypeError>(ErrorType::NotAConstructor, constructor.to_string_without_side_effects());
|
return vm.throw_completion<TypeError>(ErrorType::NotAConstructor, constructor.to_string_without_side_effects());
|
||||||
|
|
||||||
// 4. Let newObj be ? TypedArrayCreate(C, « 𝔽(len) »).
|
// 4. Let newObj be ? TypedArrayCreate(C, « 𝔽(len) »).
|
||||||
GC::MarkedVector<Value> arguments(vm.heap());
|
GC::RootVector<Value> arguments(vm.heap());
|
||||||
arguments.append(Value(length));
|
arguments.append(Value(length));
|
||||||
auto* new_object = TRY(typed_array_create(vm, constructor.as_function(), move(arguments)));
|
auto* new_object = TRY(typed_array_create(vm, constructor.as_function(), move(arguments)));
|
||||||
|
|
||||||
|
|
|
@ -92,7 +92,7 @@ static ThrowCompletionOr<GC::Ref<FunctionObject>> callback_from_args(VM& vm, Str
|
||||||
}
|
}
|
||||||
|
|
||||||
// 23.2.4.1 TypedArraySpeciesCreate ( exemplar, argumentList ), https://tc39.es/ecma262/#typedarray-species-create
|
// 23.2.4.1 TypedArraySpeciesCreate ( exemplar, argumentList ), https://tc39.es/ecma262/#typedarray-species-create
|
||||||
static ThrowCompletionOr<TypedArrayBase*> typed_array_species_create(VM& vm, TypedArrayBase const& exemplar, GC::MarkedVector<Value> arguments)
|
static ThrowCompletionOr<TypedArrayBase*> typed_array_species_create(VM& vm, TypedArrayBase const& exemplar, GC::RootVector<Value> arguments)
|
||||||
{
|
{
|
||||||
auto& realm = *vm.current_realm();
|
auto& realm = *vm.current_realm();
|
||||||
|
|
||||||
|
@ -634,7 +634,7 @@ JS_DEFINE_NATIVE_FUNCTION(TypedArrayPrototype::filter)
|
||||||
auto callback_function = TRY(callback_from_args(vm, "filter"sv));
|
auto callback_function = TRY(callback_from_args(vm, "filter"sv));
|
||||||
|
|
||||||
// 5. Let kept be a new empty List.
|
// 5. Let kept be a new empty List.
|
||||||
GC::MarkedVector<Value> kept { vm.heap() };
|
GC::RootVector<Value> kept { vm.heap() };
|
||||||
|
|
||||||
// 6. Let captured be 0.
|
// 6. Let captured be 0.
|
||||||
size_t captured = 0;
|
size_t captured = 0;
|
||||||
|
@ -664,7 +664,7 @@ JS_DEFINE_NATIVE_FUNCTION(TypedArrayPrototype::filter)
|
||||||
}
|
}
|
||||||
|
|
||||||
// 9. Let A be ? TypedArraySpeciesCreate(O, « 𝔽(captured) »).
|
// 9. Let A be ? TypedArraySpeciesCreate(O, « 𝔽(captured) »).
|
||||||
GC::MarkedVector<Value> arguments(vm.heap());
|
GC::RootVector<Value> arguments(vm.heap());
|
||||||
arguments.empend(captured);
|
arguments.empend(captured);
|
||||||
auto* filter_array = TRY(typed_array_species_create(vm, *typed_array, move(arguments)));
|
auto* filter_array = TRY(typed_array_species_create(vm, *typed_array, move(arguments)));
|
||||||
|
|
||||||
|
@ -1186,7 +1186,7 @@ JS_DEFINE_NATIVE_FUNCTION(TypedArrayPrototype::map)
|
||||||
auto callback_function = TRY(callback_from_args(vm, "map"sv));
|
auto callback_function = TRY(callback_from_args(vm, "map"sv));
|
||||||
|
|
||||||
// 5. Let A be ? TypedArraySpeciesCreate(O, « 𝔽(len) »).
|
// 5. Let A be ? TypedArraySpeciesCreate(O, « 𝔽(len) »).
|
||||||
GC::MarkedVector<Value> arguments(vm.heap());
|
GC::RootVector<Value> arguments(vm.heap());
|
||||||
arguments.empend(length);
|
arguments.empend(length);
|
||||||
auto* array = TRY(typed_array_species_create(vm, *typed_array, move(arguments)));
|
auto* array = TRY(typed_array_species_create(vm, *typed_array, move(arguments)));
|
||||||
|
|
||||||
|
@ -1660,7 +1660,7 @@ JS_DEFINE_NATIVE_FUNCTION(TypedArrayPrototype::slice)
|
||||||
auto count = max(final - k, 0);
|
auto count = max(final - k, 0);
|
||||||
|
|
||||||
// 13. Let A be ? TypedArraySpeciesCreate(O, « 𝔽(count) »).
|
// 13. Let A be ? TypedArraySpeciesCreate(O, « 𝔽(count) »).
|
||||||
GC::MarkedVector<Value> arguments(vm.heap());
|
GC::RootVector<Value> arguments(vm.heap());
|
||||||
arguments.empend(count);
|
arguments.empend(count);
|
||||||
auto* array = TRY(typed_array_species_create(vm, *typed_array, move(arguments)));
|
auto* array = TRY(typed_array_species_create(vm, *typed_array, move(arguments)));
|
||||||
|
|
||||||
|
@ -1905,7 +1905,7 @@ JS_DEFINE_NATIVE_FUNCTION(TypedArrayPrototype::subarray)
|
||||||
return typed_array;
|
return typed_array;
|
||||||
}
|
}
|
||||||
|
|
||||||
GC::MarkedVector<Value> arguments(vm.heap());
|
GC::RootVector<Value> arguments(vm.heap());
|
||||||
|
|
||||||
// 15. If O.[[ArrayLength]] is auto and end is undefined, then
|
// 15. If O.[[ArrayLength]] is auto and end is undefined, then
|
||||||
if (typed_array->array_length().is_auto() && end.is_undefined()) {
|
if (typed_array->array_length().is_auto() && end.is_undefined()) {
|
||||||
|
@ -2013,7 +2013,7 @@ JS_DEFINE_NATIVE_FUNCTION(TypedArrayPrototype::to_reversed)
|
||||||
auto length = typed_array_length(typed_array_record);
|
auto length = typed_array_length(typed_array_record);
|
||||||
|
|
||||||
// 4. Let A be ? TypedArrayCreateSameType(O, « 𝔽(length) »).
|
// 4. Let A be ? TypedArrayCreateSameType(O, « 𝔽(length) »).
|
||||||
GC::MarkedVector<Value> arguments(vm.heap());
|
GC::RootVector<Value> arguments(vm.heap());
|
||||||
arguments.empend(length);
|
arguments.empend(length);
|
||||||
auto* array = TRY(typed_array_create_same_type(vm, *typed_array, move(arguments)));
|
auto* array = TRY(typed_array_create_same_type(vm, *typed_array, move(arguments)));
|
||||||
|
|
||||||
|
@ -2058,7 +2058,7 @@ JS_DEFINE_NATIVE_FUNCTION(TypedArrayPrototype::to_sorted)
|
||||||
auto length = typed_array_length(typed_array_record);
|
auto length = typed_array_length(typed_array_record);
|
||||||
|
|
||||||
// 5. Let A be ? TypedArrayCreateSameType(O, « 𝔽(len) »).
|
// 5. Let A be ? TypedArrayCreateSameType(O, « 𝔽(len) »).
|
||||||
GC::MarkedVector<Value> arguments(vm.heap());
|
GC::RootVector<Value> arguments(vm.heap());
|
||||||
arguments.empend(length);
|
arguments.empend(length);
|
||||||
auto* array = TRY(typed_array_create_same_type(vm, *typed_array, move(arguments)));
|
auto* array = TRY(typed_array_create_same_type(vm, *typed_array, move(arguments)));
|
||||||
|
|
||||||
|
@ -2138,7 +2138,7 @@ JS_DEFINE_NATIVE_FUNCTION(TypedArrayPrototype::with)
|
||||||
return vm.throw_completion<RangeError>(ErrorType::TypedArrayInvalidIntegerIndex, actual_index);
|
return vm.throw_completion<RangeError>(ErrorType::TypedArrayInvalidIntegerIndex, actual_index);
|
||||||
|
|
||||||
// 10. Let A be ? TypedArrayCreateSameType(O, « 𝔽(len) »).
|
// 10. Let A be ? TypedArrayCreateSameType(O, « 𝔽(len) »).
|
||||||
GC::MarkedVector<Value> arguments(vm.heap());
|
GC::RootVector<Value> arguments(vm.heap());
|
||||||
arguments.empend(length);
|
arguments.empend(length);
|
||||||
auto* array = TRY(typed_array_create_same_type(vm, *typed_array, move(arguments)));
|
auto* array = TRY(typed_array_create_same_type(vm, *typed_array, move(arguments)));
|
||||||
|
|
||||||
|
|
|
@ -18,7 +18,7 @@
|
||||||
#include <LibCrypto/Forward.h>
|
#include <LibCrypto/Forward.h>
|
||||||
#include <LibGC/Function.h>
|
#include <LibGC/Function.h>
|
||||||
#include <LibGC/Heap.h>
|
#include <LibGC/Heap.h>
|
||||||
#include <LibGC/MarkedVector.h>
|
#include <LibGC/RootVector.h>
|
||||||
#include <LibJS/CyclicModule.h>
|
#include <LibJS/CyclicModule.h>
|
||||||
#include <LibJS/ModuleLoading.h>
|
#include <LibJS/ModuleLoading.h>
|
||||||
#include <LibJS/Runtime/CommonPropertyNames.h>
|
#include <LibJS/Runtime/CommonPropertyNames.h>
|
||||||
|
|
|
@ -2493,7 +2493,7 @@ ThrowCompletionOr<TriState> is_less_than(VM& vm, Value lhs, Value rhs, bool left
|
||||||
}
|
}
|
||||||
|
|
||||||
// 7.3.21 Invoke ( V, P [ , argumentsList ] ), https://tc39.es/ecma262/#sec-invoke
|
// 7.3.21 Invoke ( V, P [ , argumentsList ] ), https://tc39.es/ecma262/#sec-invoke
|
||||||
ThrowCompletionOr<Value> Value::invoke_internal(VM& vm, PropertyKey const& property_key, Optional<GC::MarkedVector<Value>> arguments)
|
ThrowCompletionOr<Value> Value::invoke_internal(VM& vm, PropertyKey const& property_key, Optional<GC::RootVector<Value>> arguments)
|
||||||
{
|
{
|
||||||
// 1. If argumentsList is not present, set argumentsList to a new empty List.
|
// 1. If argumentsList is not present, set argumentsList to a new empty List.
|
||||||
|
|
||||||
|
|
|
@ -449,7 +449,7 @@ private:
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
[[nodiscard]] ThrowCompletionOr<Value> invoke_internal(VM&, PropertyKey const&, Optional<GC::MarkedVector<Value>> arguments);
|
[[nodiscard]] ThrowCompletionOr<Value> invoke_internal(VM&, PropertyKey const&, Optional<GC::RootVector<Value>> arguments);
|
||||||
|
|
||||||
ThrowCompletionOr<i32> to_i32_slow_case(VM&) const;
|
ThrowCompletionOr<i32> to_i32_slow_case(VM&) const;
|
||||||
|
|
||||||
|
|
|
@ -99,7 +99,7 @@ ThrowCompletionOr<Value> ordinary_wrapped_function_call(WrappedFunction const& f
|
||||||
auto* target_realm = TRY(get_function_realm(vm, target));
|
auto* target_realm = TRY(get_function_realm(vm, target));
|
||||||
|
|
||||||
// 6. Let wrappedArgs be a new empty List.
|
// 6. Let wrappedArgs be a new empty List.
|
||||||
auto wrapped_args = GC::MarkedVector<Value> { vm.heap() };
|
auto wrapped_args = GC::RootVector<Value> { vm.heap() };
|
||||||
wrapped_args.ensure_capacity(arguments_list.size());
|
wrapped_args.ensure_capacity(arguments_list.size());
|
||||||
|
|
||||||
// 7. For each element arg of argumentsList, do
|
// 7. For each element arg of argumentsList, do
|
||||||
|
|
|
@ -797,7 +797,7 @@ Optional<CSS::Selector::PseudoElement::Type> KeyframeEffect::pseudo_element_type
|
||||||
}
|
}
|
||||||
|
|
||||||
// https://www.w3.org/TR/web-animations-1/#dom-keyframeeffect-getkeyframes
|
// https://www.w3.org/TR/web-animations-1/#dom-keyframeeffect-getkeyframes
|
||||||
WebIDL::ExceptionOr<GC::MarkedVector<JS::Object*>> KeyframeEffect::get_keyframes()
|
WebIDL::ExceptionOr<GC::RootVector<JS::Object*>> KeyframeEffect::get_keyframes()
|
||||||
{
|
{
|
||||||
if (m_keyframe_objects.size() != m_keyframes.size()) {
|
if (m_keyframe_objects.size() != m_keyframes.size()) {
|
||||||
auto& vm = this->vm();
|
auto& vm = this->vm();
|
||||||
|
@ -832,7 +832,7 @@ WebIDL::ExceptionOr<GC::MarkedVector<JS::Object*>> KeyframeEffect::get_keyframes
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
GC::MarkedVector<JS::Object*> keyframes { heap() };
|
GC::RootVector<JS::Object*> keyframes { heap() };
|
||||||
for (auto const& keyframe : m_keyframe_objects)
|
for (auto const& keyframe : m_keyframe_objects)
|
||||||
keyframes.append(keyframe);
|
keyframes.append(keyframe);
|
||||||
return keyframes;
|
return keyframes;
|
||||||
|
|
|
@ -97,7 +97,7 @@ public:
|
||||||
Bindings::CompositeOperation composite() const { return m_composite; }
|
Bindings::CompositeOperation composite() const { return m_composite; }
|
||||||
void set_composite(Bindings::CompositeOperation value) { m_composite = value; }
|
void set_composite(Bindings::CompositeOperation value) { m_composite = value; }
|
||||||
|
|
||||||
WebIDL::ExceptionOr<GC::MarkedVector<JS::Object*>> get_keyframes();
|
WebIDL::ExceptionOr<GC::RootVector<JS::Object*>> get_keyframes();
|
||||||
WebIDL::ExceptionOr<void> set_keyframes(Optional<GC::Root<JS::Object>> const&);
|
WebIDL::ExceptionOr<void> set_keyframes(Optional<GC::Root<JS::Object>> const&);
|
||||||
|
|
||||||
KeyFrameSet const* key_frame_set() { return m_key_frame_set; }
|
KeyFrameSet const* key_frame_set() { return m_key_frame_set; }
|
||||||
|
|
|
@ -709,7 +709,7 @@ void queue_mutation_observer_microtask(DOM::Document const& document)
|
||||||
custom_data.mutation_observer_microtask_queued = false;
|
custom_data.mutation_observer_microtask_queued = false;
|
||||||
|
|
||||||
// 2. Let notifySet be a clone of the surrounding agent’s mutation observers.
|
// 2. Let notifySet be a clone of the surrounding agent’s mutation observers.
|
||||||
GC::MarkedVector<DOM::MutationObserver*> notify_set(heap);
|
GC::RootVector<DOM::MutationObserver*> notify_set(heap);
|
||||||
for (auto& observer : custom_data.mutation_observers)
|
for (auto& observer : custom_data.mutation_observers)
|
||||||
notify_set.append(observer);
|
notify_set.append(observer);
|
||||||
|
|
||||||
|
|
|
@ -400,7 +400,7 @@ JS::ThrowCompletionOr<bool> PlatformObject::internal_prevent_extensions()
|
||||||
}
|
}
|
||||||
|
|
||||||
// https://webidl.spec.whatwg.org/#legacy-platform-object-ownpropertykeys
|
// https://webidl.spec.whatwg.org/#legacy-platform-object-ownpropertykeys
|
||||||
JS::ThrowCompletionOr<GC::MarkedVector<JS::Value>> PlatformObject::internal_own_property_keys() const
|
JS::ThrowCompletionOr<GC::RootVector<JS::Value>> PlatformObject::internal_own_property_keys() const
|
||||||
{
|
{
|
||||||
if (!m_legacy_platform_object_flags.has_value() || m_legacy_platform_object_flags->has_global_interface_extended_attribute)
|
if (!m_legacy_platform_object_flags.has_value() || m_legacy_platform_object_flags->has_global_interface_extended_attribute)
|
||||||
return Base::internal_own_property_keys();
|
return Base::internal_own_property_keys();
|
||||||
|
@ -408,7 +408,7 @@ JS::ThrowCompletionOr<GC::MarkedVector<JS::Value>> PlatformObject::internal_own_
|
||||||
auto& vm = this->vm();
|
auto& vm = this->vm();
|
||||||
|
|
||||||
// 1. Let keys be a new empty list of ECMAScript String and Symbol values.
|
// 1. Let keys be a new empty list of ECMAScript String and Symbol values.
|
||||||
GC::MarkedVector<JS::Value> keys { heap() };
|
GC::RootVector<JS::Value> keys { heap() };
|
||||||
|
|
||||||
// 2. If O supports indexed properties, then for each index of O’s supported property indices, in ascending numerical order, append ! ToString(index) to keys.
|
// 2. If O supports indexed properties, then for each index of O’s supported property indices, in ascending numerical order, append ! ToString(index) to keys.
|
||||||
if (m_legacy_platform_object_flags->supports_indexed_properties) {
|
if (m_legacy_platform_object_flags->supports_indexed_properties) {
|
||||||
|
|
|
@ -40,7 +40,7 @@ public:
|
||||||
virtual JS::ThrowCompletionOr<bool> internal_define_own_property(JS::PropertyKey const&, JS::PropertyDescriptor const&, Optional<JS::PropertyDescriptor>* precomputed_get_own_property = nullptr) override;
|
virtual JS::ThrowCompletionOr<bool> internal_define_own_property(JS::PropertyKey const&, JS::PropertyDescriptor const&, Optional<JS::PropertyDescriptor>* precomputed_get_own_property = nullptr) override;
|
||||||
virtual JS::ThrowCompletionOr<bool> internal_delete(JS::PropertyKey const&) override;
|
virtual JS::ThrowCompletionOr<bool> internal_delete(JS::PropertyKey const&) override;
|
||||||
virtual JS::ThrowCompletionOr<bool> internal_prevent_extensions() override;
|
virtual JS::ThrowCompletionOr<bool> internal_prevent_extensions() override;
|
||||||
virtual JS::ThrowCompletionOr<GC::MarkedVector<JS::Value>> internal_own_property_keys() const override;
|
virtual JS::ThrowCompletionOr<GC::RootVector<JS::Value>> internal_own_property_keys() const override;
|
||||||
|
|
||||||
JS::ThrowCompletionOr<bool> is_named_property_exposed_on_object(JS::PropertyKey const&) const;
|
JS::ThrowCompletionOr<bool> is_named_property_exposed_on_object(JS::PropertyKey const&) const;
|
||||||
|
|
||||||
|
|
|
@ -21,7 +21,7 @@ namespace Web::CSS {
|
||||||
|
|
||||||
GC_DEFINE_ALLOCATOR(CSSRuleList);
|
GC_DEFINE_ALLOCATOR(CSSRuleList);
|
||||||
|
|
||||||
GC::Ref<CSSRuleList> CSSRuleList::create(JS::Realm& realm, GC::MarkedVector<CSSRule*> const& rules)
|
GC::Ref<CSSRuleList> CSSRuleList::create(JS::Realm& realm, GC::RootVector<CSSRule*> const& rules)
|
||||||
{
|
{
|
||||||
auto rule_list = realm.create<CSSRuleList>(realm);
|
auto rule_list = realm.create<CSSRuleList>(realm);
|
||||||
for (auto* rule : rules)
|
for (auto* rule : rules)
|
||||||
|
|
|
@ -25,7 +25,7 @@ class CSSRuleList : public Bindings::PlatformObject {
|
||||||
GC_DECLARE_ALLOCATOR(CSSRuleList);
|
GC_DECLARE_ALLOCATOR(CSSRuleList);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
[[nodiscard]] static GC::Ref<CSSRuleList> create(JS::Realm&, GC::MarkedVector<CSSRule*> const&);
|
[[nodiscard]] static GC::Ref<CSSRuleList> create(JS::Realm&, GC::RootVector<CSSRule*> const&);
|
||||||
[[nodiscard]] static GC::Ref<CSSRuleList> create_empty(JS::Realm&);
|
[[nodiscard]] static GC::Ref<CSSRuleList> create_empty(JS::Realm&);
|
||||||
|
|
||||||
~CSSRuleList() = default;
|
~CSSRuleList() = default;
|
||||||
|
|
|
@ -218,7 +218,7 @@ GC::Ref<WebIDL::Promise> CSSStyleSheet::replace(String text)
|
||||||
auto& rules = parsed_stylesheet->rules();
|
auto& rules = parsed_stylesheet->rules();
|
||||||
|
|
||||||
// 2. If rules contains one or more @import rules, remove those rules from rules.
|
// 2. If rules contains one or more @import rules, remove those rules from rules.
|
||||||
GC::MarkedVector<GC::Ref<CSSRule>> rules_without_import(realm.heap());
|
GC::RootVector<GC::Ref<CSSRule>> rules_without_import(realm.heap());
|
||||||
for (auto rule : rules) {
|
for (auto rule : rules) {
|
||||||
if (rule->type() != CSSRule::Type::Import)
|
if (rule->type() != CSSRule::Type::Import)
|
||||||
rules_without_import.append(rule);
|
rules_without_import.append(rule);
|
||||||
|
@ -252,7 +252,7 @@ WebIDL::ExceptionOr<void> CSSStyleSheet::replace_sync(StringView text)
|
||||||
auto& rules = parsed_stylesheet->rules();
|
auto& rules = parsed_stylesheet->rules();
|
||||||
|
|
||||||
// 3. If rules contains one or more @import rules, remove those rules from rules.
|
// 3. If rules contains one or more @import rules, remove those rules from rules.
|
||||||
GC::MarkedVector<GC::Ref<CSSRule>> rules_without_import(realm().heap());
|
GC::RootVector<GC::Ref<CSSRule>> rules_without_import(realm().heap());
|
||||||
for (auto rule : rules) {
|
for (auto rule : rules) {
|
||||||
if (rule->type() != CSSRule::Type::Import)
|
if (rule->type() != CSSRule::Type::Import)
|
||||||
rules_without_import.append(rule);
|
rules_without_import.append(rule);
|
||||||
|
|
|
@ -249,7 +249,7 @@ JS::ThrowCompletionOr<GC::Ref<WebIDL::Promise>> FontFaceSet::load(String const&
|
||||||
|
|
||||||
// 4. Queue a task to run the following steps synchronously:
|
// 4. Queue a task to run the following steps synchronously:
|
||||||
HTML::queue_a_task(HTML::Task::Source::FontLoading, nullptr, nullptr, GC::create_function(realm.heap(), [&realm, promise, matched_font_faces] {
|
HTML::queue_a_task(HTML::Task::Source::FontLoading, nullptr, nullptr, GC::create_function(realm.heap(), [&realm, promise, matched_font_faces] {
|
||||||
GC::MarkedVector<GC::Ref<WebIDL::Promise>> promises(realm.heap());
|
GC::RootVector<GC::Ref<WebIDL::Promise>> promises(realm.heap());
|
||||||
|
|
||||||
// 1. For all of the font faces in the font face list, call their load() method.
|
// 1. For all of the font faces in the font face list, call their load() method.
|
||||||
for (auto font_face_value : *matched_font_faces) {
|
for (auto font_face_value : *matched_font_faces) {
|
||||||
|
|
|
@ -624,7 +624,7 @@ GC::Ptr<CSSMediaRule> Parser::convert_to_media_rule(AtRule const& rule, Nested n
|
||||||
auto media_query_list = parse_a_media_query_list(media_query_tokens);
|
auto media_query_list = parse_a_media_query_list(media_query_tokens);
|
||||||
auto media_list = MediaList::create(m_context.realm(), move(media_query_list));
|
auto media_list = MediaList::create(m_context.realm(), move(media_query_list));
|
||||||
|
|
||||||
GC::MarkedVector<CSSRule*> child_rules { m_context.realm().heap() };
|
GC::RootVector<CSSRule*> child_rules { m_context.realm().heap() };
|
||||||
for (auto const& child : rule.child_rules_and_lists_of_declarations) {
|
for (auto const& child : rule.child_rules_and_lists_of_declarations) {
|
||||||
child.visit(
|
child.visit(
|
||||||
[&](Rule const& rule) {
|
[&](Rule const& rule) {
|
||||||
|
|
|
@ -158,7 +158,7 @@ CSSStyleSheet* Parser::parse_as_css_stylesheet(Optional<URL::URL> location)
|
||||||
auto const& style_sheet = parse_a_stylesheet(m_token_stream, {});
|
auto const& style_sheet = parse_a_stylesheet(m_token_stream, {});
|
||||||
|
|
||||||
// Interpret all of the resulting top-level qualified rules as style rules, defined below.
|
// Interpret all of the resulting top-level qualified rules as style rules, defined below.
|
||||||
GC::MarkedVector<CSSRule*> rules(m_context.realm().heap());
|
GC::RootVector<CSSRule*> rules(m_context.realm().heap());
|
||||||
for (auto const& raw_rule : style_sheet.rules) {
|
for (auto const& raw_rule : style_sheet.rules) {
|
||||||
auto rule = convert_to_rule(raw_rule, Nested::No);
|
auto rule = convert_to_rule(raw_rule, Nested::No);
|
||||||
// If any style rule is invalid, or any at-rule is not recognized or is invalid according to its grammar or context, it’s a parse error.
|
// If any style rule is invalid, or any at-rule is not recognized or is invalid according to its grammar or context, it’s a parse error.
|
||||||
|
|
|
@ -107,7 +107,7 @@ GC::Ptr<CSSStyleRule> Parser::convert_to_style_rule(QualifiedRule const& qualifi
|
||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
|
|
||||||
GC::MarkedVector<CSSRule*> child_rules { m_context.realm().heap() };
|
GC::RootVector<CSSRule*> child_rules { m_context.realm().heap() };
|
||||||
for (auto& child : qualified_rule.child_rules) {
|
for (auto& child : qualified_rule.child_rules) {
|
||||||
child.visit(
|
child.visit(
|
||||||
[&](Rule const& rule) {
|
[&](Rule const& rule) {
|
||||||
|
@ -246,7 +246,7 @@ GC::Ptr<CSSRule> Parser::convert_to_layer_rule(AtRule const& rule, Nested nested
|
||||||
}
|
}
|
||||||
|
|
||||||
// Then the rules
|
// Then the rules
|
||||||
GC::MarkedVector<CSSRule*> child_rules { m_context.realm().heap() };
|
GC::RootVector<CSSRule*> child_rules { m_context.realm().heap() };
|
||||||
for (auto const& child : rule.child_rules_and_lists_of_declarations) {
|
for (auto const& child : rule.child_rules_and_lists_of_declarations) {
|
||||||
child.visit(
|
child.visit(
|
||||||
[&](Rule const& rule) {
|
[&](Rule const& rule) {
|
||||||
|
@ -341,7 +341,7 @@ GC::Ptr<CSSKeyframesRule> Parser::convert_to_keyframes_rule(AtRule const& rule)
|
||||||
|
|
||||||
auto name = name_token.to_string();
|
auto name = name_token.to_string();
|
||||||
|
|
||||||
GC::MarkedVector<CSSRule*> keyframes(m_context.realm().heap());
|
GC::RootVector<CSSRule*> keyframes(m_context.realm().heap());
|
||||||
rule.for_each_as_qualified_rule_list([&](auto& qualified_rule) {
|
rule.for_each_as_qualified_rule_list([&](auto& qualified_rule) {
|
||||||
if (!qualified_rule.child_rules.is_empty()) {
|
if (!qualified_rule.child_rules.is_empty()) {
|
||||||
dbgln_if(CSS_PARSER_DEBUG, "CSSParser: @keyframes keyframe rule contains at-rules; discarding them.");
|
dbgln_if(CSS_PARSER_DEBUG, "CSSParser: @keyframes keyframe rule contains at-rules; discarding them.");
|
||||||
|
@ -468,7 +468,7 @@ GC::Ptr<CSSSupportsRule> Parser::convert_to_supports_rule(AtRule const& rule, Ne
|
||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
|
|
||||||
GC::MarkedVector<CSSRule*> child_rules { m_context.realm().heap() };
|
GC::RootVector<CSSRule*> child_rules { m_context.realm().heap() };
|
||||||
for (auto const& child : rule.child_rules_and_lists_of_declarations) {
|
for (auto const& child : rule.child_rules_and_lists_of_declarations) {
|
||||||
child.visit(
|
child.visit(
|
||||||
[&](Rule const& rule) {
|
[&](Rule const& rule) {
|
||||||
|
|
|
@ -106,7 +106,7 @@ void Attr::handle_attribute_changes(Element& element, Optional<String> const& ol
|
||||||
if (element.is_custom()) {
|
if (element.is_custom()) {
|
||||||
auto& vm = this->vm();
|
auto& vm = this->vm();
|
||||||
|
|
||||||
GC::MarkedVector<JS::Value> arguments { vm.heap() };
|
GC::RootVector<JS::Value> arguments { vm.heap() };
|
||||||
arguments.append(JS::PrimitiveString::create(vm, local_name()));
|
arguments.append(JS::PrimitiveString::create(vm, local_name()));
|
||||||
arguments.append(!old_value.has_value() ? JS::js_null() : JS::PrimitiveString::create(vm, old_value.value()));
|
arguments.append(!old_value.has_value() ? JS::js_null() : JS::PrimitiveString::create(vm, old_value.value()));
|
||||||
arguments.append(!new_value.has_value() ? JS::js_null() : JS::PrimitiveString::create(vm, new_value.value()));
|
arguments.append(!new_value.has_value() ? JS::js_null() : JS::PrimitiveString::create(vm, new_value.value()));
|
||||||
|
|
|
@ -15,7 +15,7 @@
|
||||||
#include <AK/StringBuilder.h>
|
#include <AK/StringBuilder.h>
|
||||||
#include <AK/Utf8View.h>
|
#include <AK/Utf8View.h>
|
||||||
#include <LibCore/Timer.h>
|
#include <LibCore/Timer.h>
|
||||||
#include <LibGC/MarkedVector.h>
|
#include <LibGC/RootVector.h>
|
||||||
#include <LibJS/Runtime/Array.h>
|
#include <LibJS/Runtime/Array.h>
|
||||||
#include <LibJS/Runtime/FunctionObject.h>
|
#include <LibJS/Runtime/FunctionObject.h>
|
||||||
#include <LibJS/Runtime/NativeFunction.h>
|
#include <LibJS/Runtime/NativeFunction.h>
|
||||||
|
@ -1973,7 +1973,7 @@ void Document::adopt_node(Node& node)
|
||||||
if (element.is_custom()) {
|
if (element.is_custom()) {
|
||||||
auto& vm = this->vm();
|
auto& vm = this->vm();
|
||||||
|
|
||||||
GC::MarkedVector<JS::Value> arguments { vm.heap() };
|
GC::RootVector<JS::Value> arguments { vm.heap() };
|
||||||
arguments.append(&old_document);
|
arguments.append(&old_document);
|
||||||
arguments.append(this);
|
arguments.append(this);
|
||||||
|
|
||||||
|
@ -4208,7 +4208,7 @@ void Document::run_the_update_intersection_observations_steps(HighResolutionTime
|
||||||
// 2. For each observer in observer list:
|
// 2. For each observer in observer list:
|
||||||
|
|
||||||
// NOTE: We make a copy of the intersection observers list to avoid modifying it while iterating.
|
// NOTE: We make a copy of the intersection observers list to avoid modifying it while iterating.
|
||||||
GC::MarkedVector<GC::Ref<IntersectionObserver::IntersectionObserver>> intersection_observers(heap());
|
GC::RootVector<GC::Ref<IntersectionObserver::IntersectionObserver>> intersection_observers(heap());
|
||||||
intersection_observers.ensure_capacity(m_intersection_observers.size());
|
intersection_observers.ensure_capacity(m_intersection_observers.size());
|
||||||
for (auto& observer : m_intersection_observers)
|
for (auto& observer : m_intersection_observers)
|
||||||
intersection_observers.append(observer);
|
intersection_observers.append(observer);
|
||||||
|
@ -5058,10 +5058,10 @@ Element const* Document::element_from_point(double x, double y)
|
||||||
}
|
}
|
||||||
|
|
||||||
// https://drafts.csswg.org/cssom-view/#dom-document-elementsfrompoint
|
// https://drafts.csswg.org/cssom-view/#dom-document-elementsfrompoint
|
||||||
GC::MarkedVector<GC::Ref<Element>> Document::elements_from_point(double x, double y)
|
GC::RootVector<GC::Ref<Element>> Document::elements_from_point(double x, double y)
|
||||||
{
|
{
|
||||||
// 1. Let sequence be a new empty sequence.
|
// 1. Let sequence be a new empty sequence.
|
||||||
GC::MarkedVector<GC::Ref<Element>> sequence(heap());
|
GC::RootVector<GC::Ref<Element>> sequence(heap());
|
||||||
|
|
||||||
// 2. If either argument is negative, x is greater than the viewport width excluding the size of a rendered scroll bar (if any),
|
// 2. If either argument is negative, x is greater than the viewport width excluding the size of a rendered scroll bar (if any),
|
||||||
// or y is greater than the viewport height excluding the size of a rendered scroll bar (if any),
|
// or y is greater than the viewport height excluding the size of a rendered scroll bar (if any),
|
||||||
|
@ -5288,7 +5288,7 @@ size_t Document::broadcast_active_resize_observations()
|
||||||
// 2. For each observer in document.[[resizeObservers]] run these steps:
|
// 2. For each observer in document.[[resizeObservers]] run these steps:
|
||||||
|
|
||||||
// NOTE: We make a copy of the resize observers list to avoid modifying it while iterating.
|
// NOTE: We make a copy of the resize observers list to avoid modifying it while iterating.
|
||||||
GC::MarkedVector<GC::Ref<ResizeObserver::ResizeObserver>> resize_observers(heap());
|
GC::RootVector<GC::Ref<ResizeObserver::ResizeObserver>> resize_observers(heap());
|
||||||
resize_observers.ensure_capacity(m_resize_observers.size());
|
resize_observers.ensure_capacity(m_resize_observers.size());
|
||||||
for (auto const& observer : m_resize_observers)
|
for (auto const& observer : m_resize_observers)
|
||||||
resize_observers.append(observer);
|
resize_observers.append(observer);
|
||||||
|
@ -5300,7 +5300,7 @@ size_t Document::broadcast_active_resize_observations()
|
||||||
}
|
}
|
||||||
|
|
||||||
// 2. Let entries be an empty list of ResizeObserverEntryies.
|
// 2. Let entries be an empty list of ResizeObserverEntryies.
|
||||||
GC::MarkedVector<GC::Ref<ResizeObserver::ResizeObserverEntry>> entries(heap());
|
GC::RootVector<GC::Ref<ResizeObserver::ResizeObserverEntry>> entries(heap());
|
||||||
|
|
||||||
// 3. For each observation in [[activeTargets]] perform these steps:
|
// 3. For each observation in [[activeTargets]] perform these steps:
|
||||||
for (auto const& observation : observer->active_targets()) {
|
for (auto const& observation : observer->active_targets()) {
|
||||||
|
|
|
@ -662,7 +662,7 @@ public:
|
||||||
WebIDL::ExceptionOr<void> set_design_mode(String const&);
|
WebIDL::ExceptionOr<void> set_design_mode(String const&);
|
||||||
|
|
||||||
Element const* element_from_point(double x, double y);
|
Element const* element_from_point(double x, double y);
|
||||||
GC::MarkedVector<GC::Ref<Element>> elements_from_point(double x, double y);
|
GC::RootVector<GC::Ref<Element>> elements_from_point(double x, double y);
|
||||||
GC::Ptr<Element const> scrolling_element() const;
|
GC::Ptr<Element const> scrolling_element() const;
|
||||||
|
|
||||||
void set_needs_to_resolve_paint_only_properties() { m_needs_to_resolve_paint_only_properties = true; }
|
void set_needs_to_resolve_paint_only_properties() { m_needs_to_resolve_paint_only_properties = true; }
|
||||||
|
|
|
@ -2107,7 +2107,7 @@ void Element::enqueue_a_custom_element_upgrade_reaction(HTML::CustomElementDefin
|
||||||
enqueue_an_element_on_the_appropriate_element_queue();
|
enqueue_an_element_on_the_appropriate_element_queue();
|
||||||
}
|
}
|
||||||
|
|
||||||
void Element::enqueue_a_custom_element_callback_reaction(FlyString const& callback_name, GC::MarkedVector<JS::Value> arguments)
|
void Element::enqueue_a_custom_element_callback_reaction(FlyString const& callback_name, GC::RootVector<JS::Value> arguments)
|
||||||
{
|
{
|
||||||
// 1. Let definition be element's custom element definition.
|
// 1. Let definition be element's custom element definition.
|
||||||
auto& definition = m_custom_element_definition;
|
auto& definition = m_custom_element_definition;
|
||||||
|
@ -2164,7 +2164,7 @@ JS::ThrowCompletionOr<void> Element::upgrade_element(GC::Ref<HTML::CustomElement
|
||||||
auto const* attribute = m_attributes->item(attribute_index);
|
auto const* attribute = m_attributes->item(attribute_index);
|
||||||
VERIFY(attribute);
|
VERIFY(attribute);
|
||||||
|
|
||||||
GC::MarkedVector<JS::Value> arguments { vm.heap() };
|
GC::RootVector<JS::Value> arguments { vm.heap() };
|
||||||
|
|
||||||
arguments.append(JS::PrimitiveString::create(vm, attribute->local_name()));
|
arguments.append(JS::PrimitiveString::create(vm, attribute->local_name()));
|
||||||
arguments.append(JS::js_null());
|
arguments.append(JS::js_null());
|
||||||
|
@ -2176,7 +2176,7 @@ JS::ThrowCompletionOr<void> Element::upgrade_element(GC::Ref<HTML::CustomElement
|
||||||
|
|
||||||
// 5. If element is connected, then enqueue a custom element callback reaction with element, callback name "connectedCallback", and « ».
|
// 5. If element is connected, then enqueue a custom element callback reaction with element, callback name "connectedCallback", and « ».
|
||||||
if (is_connected()) {
|
if (is_connected()) {
|
||||||
GC::MarkedVector<JS::Value> empty_arguments { vm.heap() };
|
GC::RootVector<JS::Value> empty_arguments { vm.heap() };
|
||||||
enqueue_a_custom_element_callback_reaction(HTML::CustomElementReactionNames::connectedCallback, move(empty_arguments));
|
enqueue_a_custom_element_callback_reaction(HTML::CustomElementReactionNames::connectedCallback, move(empty_arguments));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -72,7 +72,7 @@ struct CustomElementUpgradeReaction {
|
||||||
// A callback reaction, which will call a lifecycle callback, and contains a callback function as well as a list of arguments.
|
// A callback reaction, which will call a lifecycle callback, and contains a callback function as well as a list of arguments.
|
||||||
struct CustomElementCallbackReaction {
|
struct CustomElementCallbackReaction {
|
||||||
GC::Root<WebIDL::CallbackType> callback;
|
GC::Root<WebIDL::CallbackType> callback;
|
||||||
GC::MarkedVector<JS::Value> arguments;
|
GC::RootVector<JS::Value> arguments;
|
||||||
};
|
};
|
||||||
|
|
||||||
// https://dom.spec.whatwg.org/#concept-element-custom-element-state
|
// https://dom.spec.whatwg.org/#concept-element-custom-element-state
|
||||||
|
@ -306,7 +306,7 @@ public:
|
||||||
bool has_referenced_and_hidden_ancestor() const;
|
bool has_referenced_and_hidden_ancestor() const;
|
||||||
|
|
||||||
void enqueue_a_custom_element_upgrade_reaction(HTML::CustomElementDefinition& custom_element_definition);
|
void enqueue_a_custom_element_upgrade_reaction(HTML::CustomElementDefinition& custom_element_definition);
|
||||||
void enqueue_a_custom_element_callback_reaction(FlyString const& callback_name, GC::MarkedVector<JS::Value> arguments);
|
void enqueue_a_custom_element_callback_reaction(FlyString const& callback_name, GC::RootVector<JS::Value> arguments);
|
||||||
|
|
||||||
using CustomElementReactionQueue = Vector<Variant<CustomElementUpgradeReaction, CustomElementCallbackReaction>>;
|
using CustomElementReactionQueue = Vector<Variant<CustomElementUpgradeReaction, CustomElementCallbackReaction>>;
|
||||||
CustomElementReactionQueue* custom_element_reaction_queue() { return m_custom_element_reaction_queue; }
|
CustomElementReactionQueue* custom_element_reaction_queue() { return m_custom_element_reaction_queue; }
|
||||||
|
|
|
@ -98,10 +98,10 @@ void HTMLCollection::update_cache_if_needed() const
|
||||||
m_cached_dom_tree_version = root()->document().dom_tree_version();
|
m_cached_dom_tree_version = root()->document().dom_tree_version();
|
||||||
}
|
}
|
||||||
|
|
||||||
GC::MarkedVector<GC::Ref<Element>> HTMLCollection::collect_matching_elements() const
|
GC::RootVector<GC::Ref<Element>> HTMLCollection::collect_matching_elements() const
|
||||||
{
|
{
|
||||||
update_cache_if_needed();
|
update_cache_if_needed();
|
||||||
GC::MarkedVector<GC::Ref<Element>> elements(heap());
|
GC::RootVector<GC::Ref<Element>> elements(heap());
|
||||||
for (auto& element : m_cached_elements)
|
for (auto& element : m_cached_elements)
|
||||||
elements.append(element);
|
elements.append(element);
|
||||||
return elements;
|
return elements;
|
||||||
|
|
|
@ -38,7 +38,7 @@ public:
|
||||||
Element* item(size_t index) const;
|
Element* item(size_t index) const;
|
||||||
Element* named_item(FlyString const& key) const;
|
Element* named_item(FlyString const& key) const;
|
||||||
|
|
||||||
GC::MarkedVector<GC::Ref<Element>> collect_matching_elements() const;
|
GC::RootVector<GC::Ref<Element>> collect_matching_elements() const;
|
||||||
|
|
||||||
virtual Optional<JS::Value> item_value(size_t index) const override;
|
virtual Optional<JS::Value> item_value(size_t index) const override;
|
||||||
virtual JS::Value named_item_value(FlyString const& name) const override;
|
virtual JS::Value named_item_value(FlyString const& name) const override;
|
||||||
|
|
|
@ -35,9 +35,9 @@ void LiveNodeList::visit_edges(Cell::Visitor& visitor)
|
||||||
visitor.visit(m_root);
|
visitor.visit(m_root);
|
||||||
}
|
}
|
||||||
|
|
||||||
GC::MarkedVector<Node*> LiveNodeList::collection() const
|
GC::RootVector<Node*> LiveNodeList::collection() const
|
||||||
{
|
{
|
||||||
GC::MarkedVector<Node*> nodes(heap());
|
GC::RootVector<Node*> nodes(heap());
|
||||||
if (m_scope == Scope::Descendants) {
|
if (m_scope == Scope::Descendants) {
|
||||||
m_root->for_each_in_subtree([&](auto& node) {
|
m_root->for_each_in_subtree([&](auto& node) {
|
||||||
if (m_filter(node))
|
if (m_filter(node))
|
||||||
|
|
|
@ -38,7 +38,7 @@ protected:
|
||||||
private:
|
private:
|
||||||
virtual void visit_edges(Cell::Visitor&) override;
|
virtual void visit_edges(Cell::Visitor&) override;
|
||||||
|
|
||||||
GC::MarkedVector<Node*> collection() const;
|
GC::RootVector<Node*> collection() const;
|
||||||
|
|
||||||
GC::Ref<Node const> m_root;
|
GC::Ref<Node const> m_root;
|
||||||
Function<bool(Node const&)> m_filter;
|
Function<bool(Node const&)> m_filter;
|
||||||
|
|
|
@ -673,7 +673,7 @@ void Node::insert_before(GC::Ref<Node> node, GC::Ptr<Node> child, bool suppress_
|
||||||
// 1. If inclusiveDescendant is custom, then enqueue a custom element callback reaction with inclusiveDescendant,
|
// 1. If inclusiveDescendant is custom, then enqueue a custom element callback reaction with inclusiveDescendant,
|
||||||
// callback name "connectedCallback", and an empty argument list.
|
// callback name "connectedCallback", and an empty argument list.
|
||||||
if (element.is_custom()) {
|
if (element.is_custom()) {
|
||||||
GC::MarkedVector<JS::Value> empty_arguments { vm().heap() };
|
GC::RootVector<JS::Value> empty_arguments { vm().heap() };
|
||||||
element.enqueue_a_custom_element_callback_reaction(HTML::CustomElementReactionNames::connectedCallback, move(empty_arguments));
|
element.enqueue_a_custom_element_callback_reaction(HTML::CustomElementReactionNames::connectedCallback, move(empty_arguments));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -702,7 +702,7 @@ void Node::insert_before(GC::Ref<Node> node, GC::Ptr<Node> child, bool suppress_
|
||||||
// the post-connection steps while we’re traversing the node tree. This is because the post-connection
|
// the post-connection steps while we’re traversing the node tree. This is because the post-connection
|
||||||
// steps can modify the tree’s structure, making live traversal unsafe, possibly leading to the
|
// steps can modify the tree’s structure, making live traversal unsafe, possibly leading to the
|
||||||
// post-connection steps being called multiple times on the same node.
|
// post-connection steps being called multiple times on the same node.
|
||||||
GC::MarkedVector<GC::Ref<Node>> static_node_list(heap());
|
GC::RootVector<GC::Ref<Node>> static_node_list(heap());
|
||||||
|
|
||||||
// 11. For each node of nodes, in tree order:
|
// 11. For each node of nodes, in tree order:
|
||||||
for (auto& node : nodes) {
|
for (auto& node : nodes) {
|
||||||
|
@ -882,7 +882,7 @@ void Node::remove(bool suppress_observers)
|
||||||
auto& element = static_cast<DOM::Element&>(*this);
|
auto& element = static_cast<DOM::Element&>(*this);
|
||||||
|
|
||||||
if (element.is_custom() && is_parent_connected) {
|
if (element.is_custom() && is_parent_connected) {
|
||||||
GC::MarkedVector<JS::Value> empty_arguments { vm().heap() };
|
GC::RootVector<JS::Value> empty_arguments { vm().heap() };
|
||||||
element.enqueue_a_custom_element_callback_reaction(HTML::CustomElementReactionNames::disconnectedCallback, move(empty_arguments));
|
element.enqueue_a_custom_element_callback_reaction(HTML::CustomElementReactionNames::disconnectedCallback, move(empty_arguments));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -898,7 +898,7 @@ void Node::remove(bool suppress_observers)
|
||||||
auto& element = static_cast<DOM::Element&>(descendant);
|
auto& element = static_cast<DOM::Element&>(descendant);
|
||||||
|
|
||||||
if (element.is_custom() && is_parent_connected) {
|
if (element.is_custom() && is_parent_connected) {
|
||||||
GC::MarkedVector<JS::Value> empty_arguments { vm().heap() };
|
GC::RootVector<JS::Value> empty_arguments { vm().heap() };
|
||||||
element.enqueue_a_custom_element_callback_reaction(HTML::CustomElementReactionNames::disconnectedCallback, move(empty_arguments));
|
element.enqueue_a_custom_element_callback_reaction(HTML::CustomElementReactionNames::disconnectedCallback, move(empty_arguments));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1105,7 +1105,7 @@ WebIDL::ExceptionOr<void> Range::delete_contents()
|
||||||
}
|
}
|
||||||
|
|
||||||
// 4. Let nodes to remove be a list of all the nodes that are contained in this, in tree order, omitting any node whose parent is also contained in this.
|
// 4. Let nodes to remove be a list of all the nodes that are contained in this, in tree order, omitting any node whose parent is also contained in this.
|
||||||
GC::MarkedVector<Node*> nodes_to_remove(heap());
|
GC::RootVector<Node*> nodes_to_remove(heap());
|
||||||
for (GC::Ptr<Node> node = start_container(); node != end_container()->next_sibling(); node = node->next_in_pre_order()) {
|
for (GC::Ptr<Node> node = start_container(); node != end_container()->next_sibling(); node = node->next_in_pre_order()) {
|
||||||
if (contains_node(*node) && (!node->parent_node() || !contains_node(*node->parent_node())))
|
if (contains_node(*node) && (!node->parent_node() || !contains_node(*node->parent_node())))
|
||||||
nodes_to_remove.append(node);
|
nodes_to_remove.append(node);
|
||||||
|
|
|
@ -1645,7 +1645,7 @@ WebIDL::ExceptionOr<GC::Ref<PendingResponse>> http_network_or_cache_fetch(JS::Re
|
||||||
|
|
||||||
// 5. Let storedResponse be null.
|
// 5. Let storedResponse be null.
|
||||||
GC::Ptr<Infrastructure::Response> stored_response;
|
GC::Ptr<Infrastructure::Response> stored_response;
|
||||||
GC::MarkedVector<GC::Ptr<Infrastructure::Response>> initial_set_of_stored_responses(realm.heap());
|
GC::RootVector<GC::Ptr<Infrastructure::Response>> initial_set_of_stored_responses(realm.heap());
|
||||||
|
|
||||||
// 6. Let httpCache be null.
|
// 6. Let httpCache be null.
|
||||||
// (Typeless until we actually implement it, needed for checks below)
|
// (Typeless until we actually implement it, needed for checks below)
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
|
|
||||||
#include <AK/Badge.h>
|
#include <AK/Badge.h>
|
||||||
#include <AK/String.h>
|
#include <AK/String.h>
|
||||||
#include <LibGC/MarkedVector.h>
|
#include <LibGC/RootVector.h>
|
||||||
#include <LibWeb/DOM/EventTarget.h>
|
#include <LibWeb/DOM/EventTarget.h>
|
||||||
#include <LibWeb/HTML/AudioTrack.h>
|
#include <LibWeb/HTML/AudioTrack.h>
|
||||||
|
|
||||||
|
|
|
@ -121,7 +121,7 @@ WebIDL::ExceptionOr<void> BroadcastChannel::post_message(JS::Value message)
|
||||||
auto source_storage_key = Web::StorageAPI::obtain_a_storage_key_for_non_storage_purposes(relevant_settings_object(*this));
|
auto source_storage_key = Web::StorageAPI::obtain_a_storage_key_for_non_storage_purposes(relevant_settings_object(*this));
|
||||||
|
|
||||||
// 6. Let destinations be a list of BroadcastChannel objects that match the following criteria:
|
// 6. Let destinations be a list of BroadcastChannel objects that match the following criteria:
|
||||||
GC::MarkedVector<GC::Ref<BroadcastChannel>> destinations(vm.heap());
|
GC::RootVector<GC::Ref<BroadcastChannel>> destinations(vm.heap());
|
||||||
|
|
||||||
// * The result of running obtain a storage key for non-storage purposes with their relevant settings object equals sourceStorageKey.
|
// * The result of running obtain a storage key for non-storage purposes with their relevant settings object equals sourceStorageKey.
|
||||||
auto same_origin_broadcast_channels = s_broadcast_channel_repository.registered_channels_for_key(source_storage_key);
|
auto same_origin_broadcast_channels = s_broadcast_channel_repository.registered_channels_for_key(source_storage_key);
|
||||||
|
|
|
@ -31,7 +31,7 @@ void CloseWatcherManager::add(GC::Ref<CloseWatcher> close_watcher)
|
||||||
// If manager's groups's size is less than manager's allowed number of groups
|
// If manager's groups's size is less than manager's allowed number of groups
|
||||||
if (m_groups.size() < m_allowed_number_of_groups) {
|
if (m_groups.size() < m_allowed_number_of_groups) {
|
||||||
// then append « closeWatcher » to manager's groups.
|
// then append « closeWatcher » to manager's groups.
|
||||||
GC::MarkedVector<GC::Ref<CloseWatcher>> new_group(realm().heap());
|
GC::RootVector<GC::Ref<CloseWatcher>> new_group(realm().heap());
|
||||||
new_group.append(close_watcher);
|
new_group.append(close_watcher);
|
||||||
m_groups.append(move(new_group));
|
m_groups.append(move(new_group));
|
||||||
} else {
|
} else {
|
||||||
|
@ -68,7 +68,7 @@ bool CloseWatcherManager::process_close_watchers()
|
||||||
auto& group = m_groups.last();
|
auto& group = m_groups.last();
|
||||||
// Ambiguous spec wording. We copy the groups to avoid modifying the original while iterating.
|
// Ambiguous spec wording. We copy the groups to avoid modifying the original while iterating.
|
||||||
// See https://github.com/whatwg/html/issues/10240
|
// See https://github.com/whatwg/html/issues/10240
|
||||||
GC::MarkedVector<GC::Ref<CloseWatcher>> group_copy(realm().heap());
|
GC::RootVector<GC::Ref<CloseWatcher>> group_copy(realm().heap());
|
||||||
group_copy.ensure_capacity(group.size());
|
group_copy.ensure_capacity(group.size());
|
||||||
for (auto& close_watcher : group) {
|
for (auto& close_watcher : group) {
|
||||||
group_copy.append(close_watcher);
|
group_copy.append(close_watcher);
|
||||||
|
|
|
@ -237,13 +237,13 @@ JS::ThrowCompletionOr<bool> cross_origin_set(JS::VM& vm, JS::Object& object, JS:
|
||||||
}
|
}
|
||||||
|
|
||||||
// 7.2.3.7 CrossOriginOwnPropertyKeys ( O ), https://html.spec.whatwg.org/multipage/browsers.html#crossoriginownpropertykeys-(-o-)
|
// 7.2.3.7 CrossOriginOwnPropertyKeys ( O ), https://html.spec.whatwg.org/multipage/browsers.html#crossoriginownpropertykeys-(-o-)
|
||||||
GC::MarkedVector<JS::Value> cross_origin_own_property_keys(Variant<HTML::Location const*, HTML::Window const*> const& object)
|
GC::RootVector<JS::Value> cross_origin_own_property_keys(Variant<HTML::Location const*, HTML::Window const*> const& object)
|
||||||
{
|
{
|
||||||
auto& event_loop = HTML::main_thread_event_loop();
|
auto& event_loop = HTML::main_thread_event_loop();
|
||||||
auto& vm = event_loop.vm();
|
auto& vm = event_loop.vm();
|
||||||
|
|
||||||
// 1. Let keys be a new empty List.
|
// 1. Let keys be a new empty List.
|
||||||
auto keys = GC::MarkedVector<JS::Value> { vm.heap() };
|
auto keys = GC::RootVector<JS::Value> { vm.heap() };
|
||||||
|
|
||||||
// 2. For each e of CrossOriginProperties(O), append e.[[Property]] to keys.
|
// 2. For each e of CrossOriginProperties(O), append e.[[Property]] to keys.
|
||||||
for (auto& entry : cross_origin_properties(object))
|
for (auto& entry : cross_origin_properties(object))
|
||||||
|
|
|
@ -21,6 +21,6 @@ bool is_platform_object_same_origin(JS::Object const&);
|
||||||
Optional<JS::PropertyDescriptor> cross_origin_get_own_property_helper(Variant<HTML::Location*, HTML::Window*> const&, JS::PropertyKey const&);
|
Optional<JS::PropertyDescriptor> cross_origin_get_own_property_helper(Variant<HTML::Location*, HTML::Window*> const&, JS::PropertyKey const&);
|
||||||
JS::ThrowCompletionOr<JS::Value> cross_origin_get(JS::VM&, JS::Object const&, JS::PropertyKey const&, JS::Value receiver);
|
JS::ThrowCompletionOr<JS::Value> cross_origin_get(JS::VM&, JS::Object const&, JS::PropertyKey const&, JS::Value receiver);
|
||||||
JS::ThrowCompletionOr<bool> cross_origin_set(JS::VM&, JS::Object&, JS::PropertyKey const&, JS::Value, JS::Value receiver);
|
JS::ThrowCompletionOr<bool> cross_origin_set(JS::VM&, JS::Object&, JS::PropertyKey const&, JS::Value, JS::Value receiver);
|
||||||
GC::MarkedVector<JS::Value> cross_origin_own_property_keys(Variant<HTML::Location const*, HTML::Window const*> const&);
|
GC::RootVector<JS::Value> cross_origin_own_property_keys(Variant<HTML::Location const*, HTML::Window const*> const&);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
* SPDX-License-Identifier: BSD-2-Clause
|
* SPDX-License-Identifier: BSD-2-Clause
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <LibGC/MarkedVector.h>
|
#include <LibGC/RootVector.h>
|
||||||
#include <LibWeb/HTML/EventLoop/EventLoop.h>
|
#include <LibWeb/HTML/EventLoop/EventLoop.h>
|
||||||
#include <LibWeb/HTML/EventLoop/TaskQueue.h>
|
#include <LibWeb/HTML/EventLoop/TaskQueue.h>
|
||||||
|
|
||||||
|
@ -63,9 +63,9 @@ void TaskQueue::remove_tasks_matching(Function<bool(HTML::Task const&)> filter)
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
GC::MarkedVector<GC::Ref<Task>> TaskQueue::take_tasks_matching(Function<bool(HTML::Task const&)> filter)
|
GC::RootVector<GC::Ref<Task>> TaskQueue::take_tasks_matching(Function<bool(HTML::Task const&)> filter)
|
||||||
{
|
{
|
||||||
GC::MarkedVector<GC::Ref<Task>> matching_tasks(heap());
|
GC::RootVector<GC::Ref<Task>> matching_tasks(heap());
|
||||||
|
|
||||||
for (size_t i = 0; i < m_tasks.size();) {
|
for (size_t i = 0; i < m_tasks.size();) {
|
||||||
auto& task = m_tasks.at(i);
|
auto& task = m_tasks.at(i);
|
||||||
|
|
|
@ -37,7 +37,7 @@ public:
|
||||||
}
|
}
|
||||||
|
|
||||||
void remove_tasks_matching(Function<bool(HTML::Task const&)>);
|
void remove_tasks_matching(Function<bool(HTML::Task const&)>);
|
||||||
GC::MarkedVector<GC::Ref<Task>> take_tasks_matching(Function<bool(HTML::Task const&)>);
|
GC::RootVector<GC::Ref<Task>> take_tasks_matching(Function<bool(HTML::Task const&)>);
|
||||||
|
|
||||||
Task const* last_added_task() const;
|
Task const* last_added_task() const;
|
||||||
|
|
||||||
|
|
|
@ -84,9 +84,9 @@ static bool is_all_named_element(DOM::Element const& element)
|
||||||
|| is<HTML::HTMLTextAreaElement>(element);
|
|| is<HTML::HTMLTextAreaElement>(element);
|
||||||
}
|
}
|
||||||
|
|
||||||
GC::MarkedVector<GC::Ref<DOM::Element>> HTMLAllCollection::collect_matching_elements() const
|
GC::RootVector<GC::Ref<DOM::Element>> HTMLAllCollection::collect_matching_elements() const
|
||||||
{
|
{
|
||||||
GC::MarkedVector<GC::Ref<DOM::Element>> elements(m_root->heap());
|
GC::RootVector<GC::Ref<DOM::Element>> elements(m_root->heap());
|
||||||
if (m_scope == Scope::Descendants) {
|
if (m_scope == Scope::Descendants) {
|
||||||
m_root->for_each_in_subtree_of_type<DOM::Element>([&](auto& element) {
|
m_root->for_each_in_subtree_of_type<DOM::Element>([&](auto& element) {
|
||||||
if (m_filter(element))
|
if (m_filter(element))
|
||||||
|
|
|
@ -32,7 +32,7 @@ public:
|
||||||
Variant<GC::Ref<DOM::HTMLCollection>, GC::Ref<DOM::Element>, Empty> item(Optional<FlyString> const& name_or_index) const;
|
Variant<GC::Ref<DOM::HTMLCollection>, GC::Ref<DOM::Element>, Empty> item(Optional<FlyString> const& name_or_index) const;
|
||||||
Variant<GC::Ref<DOM::HTMLCollection>, GC::Ref<DOM::Element>, Empty> named_item(FlyString const& name) const;
|
Variant<GC::Ref<DOM::HTMLCollection>, GC::Ref<DOM::Element>, Empty> named_item(FlyString const& name) const;
|
||||||
|
|
||||||
GC::MarkedVector<GC::Ref<DOM::Element>> collect_matching_elements() const;
|
GC::RootVector<GC::Ref<DOM::Element>> collect_matching_elements() const;
|
||||||
|
|
||||||
virtual Optional<JS::Value> item_value(size_t index) const override;
|
virtual Optional<JS::Value> item_value(size_t index) const override;
|
||||||
virtual JS::Value named_item_value(FlyString const& name) const override;
|
virtual JS::Value named_item_value(FlyString const& name) const override;
|
||||||
|
|
|
@ -1037,7 +1037,7 @@ static void update_the_source_set(DOM::Element& element)
|
||||||
TODO();
|
TODO();
|
||||||
|
|
||||||
// 2. Let elements be « el ».
|
// 2. Let elements be « el ».
|
||||||
GC::MarkedVector<DOM::Element*> elements(element.heap());
|
GC::RootVector<DOM::Element*> elements(element.heap());
|
||||||
elements.append(&element);
|
elements.append(&element);
|
||||||
|
|
||||||
// 3. If el is an img element whose parent node is a picture element,
|
// 3. If el is an img element whose parent node is a picture element,
|
||||||
|
|
|
@ -1863,12 +1863,12 @@ void HTMLMediaElement::time_marches_on(TimeMarchesOnReason reason)
|
||||||
}
|
}
|
||||||
|
|
||||||
// https://html.spec.whatwg.org/multipage/media.html#take-pending-play-promises
|
// https://html.spec.whatwg.org/multipage/media.html#take-pending-play-promises
|
||||||
GC::MarkedVector<GC::Ref<WebIDL::Promise>> HTMLMediaElement::take_pending_play_promises()
|
GC::RootVector<GC::Ref<WebIDL::Promise>> HTMLMediaElement::take_pending_play_promises()
|
||||||
{
|
{
|
||||||
// 1. Let promises be an empty list of promises.
|
// 1. Let promises be an empty list of promises.
|
||||||
// 2. Copy the media element's list of pending play promises to promises.
|
// 2. Copy the media element's list of pending play promises to promises.
|
||||||
// 3. Clear the media element's list of pending play promises.
|
// 3. Clear the media element's list of pending play promises.
|
||||||
GC::MarkedVector<GC::Ref<WebIDL::Promise>> promises(heap());
|
GC::RootVector<GC::Ref<WebIDL::Promise>> promises(heap());
|
||||||
promises.extend(move(m_pending_play_promises));
|
promises.extend(move(m_pending_play_promises));
|
||||||
|
|
||||||
// 4. Return promises.
|
// 4. Return promises.
|
||||||
|
|
|
@ -11,7 +11,7 @@
|
||||||
#include <AK/Optional.h>
|
#include <AK/Optional.h>
|
||||||
#include <AK/Time.h>
|
#include <AK/Time.h>
|
||||||
#include <AK/Variant.h>
|
#include <AK/Variant.h>
|
||||||
#include <LibGC/MarkedVector.h>
|
#include <LibGC/RootVector.h>
|
||||||
#include <LibGfx/Rect.h>
|
#include <LibGfx/Rect.h>
|
||||||
#include <LibWeb/DOM/DocumentLoadEventDelayer.h>
|
#include <LibWeb/DOM/DocumentLoadEventDelayer.h>
|
||||||
#include <LibWeb/HTML/CORSSettingAttribute.h>
|
#include <LibWeb/HTML/CORSSettingAttribute.h>
|
||||||
|
@ -207,7 +207,7 @@ private:
|
||||||
};
|
};
|
||||||
void time_marches_on(TimeMarchesOnReason = TimeMarchesOnReason::NormalPlayback);
|
void time_marches_on(TimeMarchesOnReason = TimeMarchesOnReason::NormalPlayback);
|
||||||
|
|
||||||
GC::MarkedVector<GC::Ref<WebIDL::Promise>> take_pending_play_promises();
|
GC::RootVector<GC::Ref<WebIDL::Promise>> take_pending_play_promises();
|
||||||
void resolve_pending_play_promises(ReadonlySpan<GC::Ref<WebIDL::Promise>> promises);
|
void resolve_pending_play_promises(ReadonlySpan<GC::Ref<WebIDL::Promise>> promises);
|
||||||
void reject_pending_play_promises(ReadonlySpan<GC::Ref<WebIDL::Promise>> promises, GC::Ref<WebIDL::DOMException> error);
|
void reject_pending_play_promises(ReadonlySpan<GC::Ref<WebIDL::Promise>> promises, GC::Ref<WebIDL::DOMException> error);
|
||||||
|
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
|
|
||||||
#include <AK/String.h>
|
#include <AK/String.h>
|
||||||
#include <AK/StringBuilder.h>
|
#include <AK/StringBuilder.h>
|
||||||
#include <LibGC/MarkedVector.h>
|
#include <LibGC/RootVector.h>
|
||||||
#include <LibJS/Runtime/Completion.h>
|
#include <LibJS/Runtime/Completion.h>
|
||||||
#include <LibJS/Runtime/PropertyDescriptor.h>
|
#include <LibJS/Runtime/PropertyDescriptor.h>
|
||||||
#include <LibJS/Runtime/PropertyKey.h>
|
#include <LibJS/Runtime/PropertyKey.h>
|
||||||
|
@ -596,7 +596,7 @@ JS::ThrowCompletionOr<bool> Location::internal_delete(JS::PropertyKey const& pro
|
||||||
}
|
}
|
||||||
|
|
||||||
// 7.10.5.10 [[OwnPropertyKeys]] ( ), https://html.spec.whatwg.org/multipage/history.html#location-ownpropertykeys
|
// 7.10.5.10 [[OwnPropertyKeys]] ( ), https://html.spec.whatwg.org/multipage/history.html#location-ownpropertykeys
|
||||||
JS::ThrowCompletionOr<GC::MarkedVector<JS::Value>> Location::internal_own_property_keys() const
|
JS::ThrowCompletionOr<GC::RootVector<JS::Value>> Location::internal_own_property_keys() const
|
||||||
{
|
{
|
||||||
// 1. If IsPlatformObjectSameOrigin(this) is true, then return OrdinaryOwnPropertyKeys(this).
|
// 1. If IsPlatformObjectSameOrigin(this) is true, then return OrdinaryOwnPropertyKeys(this).
|
||||||
if (HTML::is_platform_object_same_origin(*this))
|
if (HTML::is_platform_object_same_origin(*this))
|
||||||
|
|
|
@ -63,7 +63,7 @@ public:
|
||||||
virtual JS::ThrowCompletionOr<JS::Value> internal_get(JS::PropertyKey const&, JS::Value receiver, JS::CacheablePropertyMetadata*, PropertyLookupPhase) const override;
|
virtual JS::ThrowCompletionOr<JS::Value> internal_get(JS::PropertyKey const&, JS::Value receiver, JS::CacheablePropertyMetadata*, PropertyLookupPhase) const override;
|
||||||
virtual JS::ThrowCompletionOr<bool> internal_set(JS::PropertyKey const&, JS::Value value, JS::Value receiver, JS::CacheablePropertyMetadata*) override;
|
virtual JS::ThrowCompletionOr<bool> internal_set(JS::PropertyKey const&, JS::Value value, JS::Value receiver, JS::CacheablePropertyMetadata*) override;
|
||||||
virtual JS::ThrowCompletionOr<bool> internal_delete(JS::PropertyKey const&) override;
|
virtual JS::ThrowCompletionOr<bool> internal_delete(JS::PropertyKey const&) override;
|
||||||
virtual JS::ThrowCompletionOr<GC::MarkedVector<JS::Value>> internal_own_property_keys() const override;
|
virtual JS::ThrowCompletionOr<GC::RootVector<JS::Value>> internal_own_property_keys() const override;
|
||||||
|
|
||||||
HTML::CrossOriginPropertyDescriptorMap const& cross_origin_property_descriptor_map() const { return m_cross_origin_property_descriptor_map; }
|
HTML::CrossOriginPropertyDescriptorMap const& cross_origin_property_descriptor_map() const { return m_cross_origin_property_descriptor_map; }
|
||||||
HTML::CrossOriginPropertyDescriptorMap& cross_origin_property_descriptor_map() { return m_cross_origin_property_descriptor_map; }
|
HTML::CrossOriginPropertyDescriptorMap& cross_origin_property_descriptor_map() { return m_cross_origin_property_descriptor_map; }
|
||||||
|
|
|
@ -66,7 +66,7 @@ Variant<GC::Root<WindowProxy>, GC::Root<MessagePort>, Empty> MessageEvent::sourc
|
||||||
GC::Ref<JS::Object> MessageEvent::ports() const
|
GC::Ref<JS::Object> MessageEvent::ports() const
|
||||||
{
|
{
|
||||||
if (!m_ports_array) {
|
if (!m_ports_array) {
|
||||||
GC::MarkedVector<JS::Value> port_vector(heap());
|
GC::RootVector<JS::Value> port_vector(heap());
|
||||||
for (auto const& port : m_ports)
|
for (auto const& port : m_ports)
|
||||||
port_vector.append(port);
|
port_vector.append(port);
|
||||||
|
|
||||||
|
|
|
@ -1131,7 +1131,7 @@ bool Navigation::inner_navigate_event_firing_algorithm(
|
||||||
// 33. If endResultIsSameDocument is true:
|
// 33. If endResultIsSameDocument is true:
|
||||||
if (end_result_is_same_document) {
|
if (end_result_is_same_document) {
|
||||||
// 1. Let promisesList be an empty list.
|
// 1. Let promisesList be an empty list.
|
||||||
GC::MarkedVector<GC::Ref<WebIDL::Promise>> promises_list(realm.heap());
|
GC::RootVector<GC::Ref<WebIDL::Promise>> promises_list(realm.heap());
|
||||||
|
|
||||||
// 2. For each handler of event's navigation handler list:
|
// 2. For each handler of event's navigation handler list:
|
||||||
for (auto const& handler : event->navigation_handler_list()) {
|
for (auto const& handler : event->navigation_handler_list()) {
|
||||||
|
|
|
@ -1040,7 +1040,7 @@ public:
|
||||||
private:
|
private:
|
||||||
JS::VM& m_vm;
|
JS::VM& m_vm;
|
||||||
ReadonlySpan<u32> m_serialized;
|
ReadonlySpan<u32> m_serialized;
|
||||||
GC::MarkedVector<JS::Value> m_memory; // Index -> JS value
|
GC::RootVector<JS::Value> m_memory; // Index -> JS value
|
||||||
size_t m_position { 0 };
|
size_t m_position { 0 };
|
||||||
|
|
||||||
static GC::Ref<Bindings::PlatformObject> create_serialized_type(StringView interface_name, JS::Realm& realm)
|
static GC::Ref<Bindings::PlatformObject> create_serialized_type(StringView interface_name, JS::Realm& realm)
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
|
|
||||||
namespace Web::HTML {
|
namespace Web::HTML {
|
||||||
|
|
||||||
using DeserializationMemory = GC::MarkedVector<JS::Value>;
|
using DeserializationMemory = GC::RootVector<JS::Value>;
|
||||||
using SerializationRecord = Vector<u32>;
|
using SerializationRecord = Vector<u32>;
|
||||||
using SerializationMemory = HashMap<GC::Root<JS::Value>, u32>;
|
using SerializationMemory = HashMap<GC::Root<JS::Value>, u32>;
|
||||||
|
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <LibGC/MarkedVector.h>
|
#include <LibGC/RootVector.h>
|
||||||
#include <LibWeb/DOM/EventTarget.h>
|
#include <LibWeb/DOM/EventTarget.h>
|
||||||
#include <LibWeb/HTML/TextTrack.h>
|
#include <LibWeb/HTML/TextTrack.h>
|
||||||
|
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <LibGC/MarkedVector.h>
|
#include <LibGC/RootVector.h>
|
||||||
#include <LibWeb/DOM/EventTarget.h>
|
#include <LibWeb/DOM/EventTarget.h>
|
||||||
#include <LibWeb/HTML/TextTrackCue.h>
|
#include <LibWeb/HTML/TextTrackCue.h>
|
||||||
|
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <LibGC/MarkedVector.h>
|
#include <LibGC/RootVector.h>
|
||||||
#include <LibWeb/DOM/EventTarget.h>
|
#include <LibWeb/DOM/EventTarget.h>
|
||||||
#include <LibWeb/HTML/TextTrack.h>
|
#include <LibWeb/HTML/TextTrack.h>
|
||||||
|
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
|
|
||||||
#include <AK/Badge.h>
|
#include <AK/Badge.h>
|
||||||
#include <AK/String.h>
|
#include <AK/String.h>
|
||||||
#include <LibGC/MarkedVector.h>
|
#include <LibGC/RootVector.h>
|
||||||
#include <LibWeb/DOM/EventTarget.h>
|
#include <LibWeb/DOM/EventTarget.h>
|
||||||
#include <LibWeb/HTML/VideoTrack.h>
|
#include <LibWeb/HTML/VideoTrack.h>
|
||||||
|
|
||||||
|
|
|
@ -526,7 +526,7 @@ void Window::consume_history_action_user_activation()
|
||||||
auto navigables = top->active_document()->inclusive_descendant_navigables();
|
auto navigables = top->active_document()->inclusive_descendant_navigables();
|
||||||
|
|
||||||
// 4. Let windows be the list of Window objects constructed by taking the active window of each item in navigables.
|
// 4. Let windows be the list of Window objects constructed by taking the active window of each item in navigables.
|
||||||
GC::MarkedVector<GC::Ptr<Window>> windows(heap());
|
GC::RootVector<GC::Ptr<Window>> windows(heap());
|
||||||
for (auto& n : navigables)
|
for (auto& n : navigables)
|
||||||
windows.append(n->active_window());
|
windows.append(n->active_window());
|
||||||
|
|
||||||
|
@ -551,7 +551,7 @@ void Window::consume_user_activation()
|
||||||
auto navigables = top->active_document()->inclusive_descendant_navigables();
|
auto navigables = top->active_document()->inclusive_descendant_navigables();
|
||||||
|
|
||||||
// 4. Let windows be the list of Window objects constructed by taking the active window of each item in navigables.
|
// 4. Let windows be the list of Window objects constructed by taking the active window of each item in navigables.
|
||||||
GC::MarkedVector<GC::Ptr<Window>> windows(heap());
|
GC::RootVector<GC::Ptr<Window>> windows(heap());
|
||||||
for (auto& n : navigables)
|
for (auto& n : navigables)
|
||||||
windows.append(n->active_window());
|
windows.append(n->active_window());
|
||||||
|
|
||||||
|
|
|
@ -218,13 +218,13 @@ GC::Ref<WebIDL::Promise> WindowOrWorkerGlobalScopeMixin::fetch(Fetch::RequestInf
|
||||||
}
|
}
|
||||||
|
|
||||||
// https://html.spec.whatwg.org/multipage/timers-and-user-prompts.html#dom-settimeout
|
// https://html.spec.whatwg.org/multipage/timers-and-user-prompts.html#dom-settimeout
|
||||||
i32 WindowOrWorkerGlobalScopeMixin::set_timeout(TimerHandler handler, i32 timeout, GC::MarkedVector<JS::Value> arguments)
|
i32 WindowOrWorkerGlobalScopeMixin::set_timeout(TimerHandler handler, i32 timeout, GC::RootVector<JS::Value> arguments)
|
||||||
{
|
{
|
||||||
return run_timer_initialization_steps(move(handler), timeout, move(arguments), Repeat::No);
|
return run_timer_initialization_steps(move(handler), timeout, move(arguments), Repeat::No);
|
||||||
}
|
}
|
||||||
|
|
||||||
// https://html.spec.whatwg.org/multipage/timers-and-user-prompts.html#dom-setinterval
|
// https://html.spec.whatwg.org/multipage/timers-and-user-prompts.html#dom-setinterval
|
||||||
i32 WindowOrWorkerGlobalScopeMixin::set_interval(TimerHandler handler, i32 timeout, GC::MarkedVector<JS::Value> arguments)
|
i32 WindowOrWorkerGlobalScopeMixin::set_interval(TimerHandler handler, i32 timeout, GC::RootVector<JS::Value> arguments)
|
||||||
{
|
{
|
||||||
return run_timer_initialization_steps(move(handler), timeout, move(arguments), Repeat::Yes);
|
return run_timer_initialization_steps(move(handler), timeout, move(arguments), Repeat::Yes);
|
||||||
}
|
}
|
||||||
|
@ -254,7 +254,7 @@ void WindowOrWorkerGlobalScopeMixin::clear_map_of_active_timers()
|
||||||
|
|
||||||
// https://html.spec.whatwg.org/multipage/timers-and-user-prompts.html#timer-initialisation-steps
|
// https://html.spec.whatwg.org/multipage/timers-and-user-prompts.html#timer-initialisation-steps
|
||||||
// With no active script fix from https://github.com/whatwg/html/pull/9712
|
// With no active script fix from https://github.com/whatwg/html/pull/9712
|
||||||
i32 WindowOrWorkerGlobalScopeMixin::run_timer_initialization_steps(TimerHandler handler, i32 timeout, GC::MarkedVector<JS::Value> arguments, Repeat repeat, Optional<i32> previous_id)
|
i32 WindowOrWorkerGlobalScopeMixin::run_timer_initialization_steps(TimerHandler handler, i32 timeout, GC::RootVector<JS::Value> arguments, Repeat repeat, Optional<i32> previous_id)
|
||||||
{
|
{
|
||||||
// 1. Let thisArg be global if that is a WorkerGlobalScope object; otherwise let thisArg be the WindowProxy that corresponds to global.
|
// 1. Let thisArg be global if that is a WorkerGlobalScope object; otherwise let thisArg be the WindowProxy that corresponds to global.
|
||||||
|
|
||||||
|
@ -697,7 +697,7 @@ GC::Ref<JS::Object> WindowOrWorkerGlobalScopeMixin::supported_entry_types() cons
|
||||||
auto& realm = this_impl().realm();
|
auto& realm = this_impl().realm();
|
||||||
|
|
||||||
if (!m_supported_entry_types_array) {
|
if (!m_supported_entry_types_array) {
|
||||||
GC::MarkedVector<JS::Value> supported_entry_types(vm.heap());
|
GC::RootVector<JS::Value> supported_entry_types(vm.heap());
|
||||||
|
|
||||||
#define __ENUMERATE_SUPPORTED_PERFORMANCE_ENTRY_TYPES(entry_type, cpp_class) \
|
#define __ENUMERATE_SUPPORTED_PERFORMANCE_ENTRY_TYPES(entry_type, cpp_class) \
|
||||||
supported_entry_types.append(JS::PrimitiveString::create(vm, entry_type));
|
supported_entry_types.append(JS::PrimitiveString::create(vm, entry_type));
|
||||||
|
|
|
@ -40,8 +40,8 @@ public:
|
||||||
GC::Ref<WebIDL::Promise> create_image_bitmap(ImageBitmapSource image, WebIDL::Long sx, WebIDL::Long sy, WebIDL::Long sw, WebIDL::Long sh, Optional<ImageBitmapOptions> options = {}) const;
|
GC::Ref<WebIDL::Promise> create_image_bitmap(ImageBitmapSource image, WebIDL::Long sx, WebIDL::Long sy, WebIDL::Long sw, WebIDL::Long sh, Optional<ImageBitmapOptions> options = {}) const;
|
||||||
GC::Ref<WebIDL::Promise> fetch(Fetch::RequestInfo const&, Fetch::RequestInit const&) const;
|
GC::Ref<WebIDL::Promise> fetch(Fetch::RequestInfo const&, Fetch::RequestInit const&) const;
|
||||||
|
|
||||||
i32 set_timeout(TimerHandler, i32 timeout, GC::MarkedVector<JS::Value> arguments);
|
i32 set_timeout(TimerHandler, i32 timeout, GC::RootVector<JS::Value> arguments);
|
||||||
i32 set_interval(TimerHandler, i32 timeout, GC::MarkedVector<JS::Value> arguments);
|
i32 set_interval(TimerHandler, i32 timeout, GC::RootVector<JS::Value> arguments);
|
||||||
void clear_timeout(i32);
|
void clear_timeout(i32);
|
||||||
void clear_interval(i32);
|
void clear_interval(i32);
|
||||||
void clear_map_of_active_timers();
|
void clear_map_of_active_timers();
|
||||||
|
@ -86,7 +86,7 @@ private:
|
||||||
Yes,
|
Yes,
|
||||||
No,
|
No,
|
||||||
};
|
};
|
||||||
i32 run_timer_initialization_steps(TimerHandler handler, i32 timeout, GC::MarkedVector<JS::Value> arguments, Repeat repeat, Optional<i32> previous_id = {});
|
i32 run_timer_initialization_steps(TimerHandler handler, i32 timeout, GC::RootVector<JS::Value> arguments, Repeat repeat, Optional<i32> previous_id = {});
|
||||||
void run_steps_after_a_timeout_impl(i32 timeout, Function<void()> completion_step, Optional<i32> timer_key = {});
|
void run_steps_after_a_timeout_impl(i32 timeout, Function<void()> completion_step, Optional<i32> timer_key = {});
|
||||||
|
|
||||||
GC::Ref<WebIDL::Promise> create_image_bitmap_impl(ImageBitmapSource& image, Optional<WebIDL::Long> sx, Optional<WebIDL::Long> sy, Optional<WebIDL::Long> sw, Optional<WebIDL::Long> sh, Optional<ImageBitmapOptions>& options) const;
|
GC::Ref<WebIDL::Promise> create_image_bitmap_impl(ImageBitmapSource& image, Optional<WebIDL::Long> sx, Optional<WebIDL::Long> sy, Optional<WebIDL::Long> sw, Optional<WebIDL::Long> sh, Optional<ImageBitmapOptions>& options) const;
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <AK/Optional.h>
|
#include <AK/Optional.h>
|
||||||
#include <LibGC/MarkedVector.h>
|
#include <LibGC/RootVector.h>
|
||||||
#include <LibJS/Runtime/Completion.h>
|
#include <LibJS/Runtime/Completion.h>
|
||||||
#include <LibJS/Runtime/GlobalObject.h>
|
#include <LibJS/Runtime/GlobalObject.h>
|
||||||
#include <LibJS/Runtime/PropertyDescriptor.h>
|
#include <LibJS/Runtime/PropertyDescriptor.h>
|
||||||
|
@ -228,7 +228,7 @@ JS::ThrowCompletionOr<bool> WindowProxy::internal_delete(JS::PropertyKey const&
|
||||||
}
|
}
|
||||||
|
|
||||||
// 7.4.10 [[OwnPropertyKeys]] ( ), https://html.spec.whatwg.org/multipage/window-object.html#windowproxy-ownpropertykeys
|
// 7.4.10 [[OwnPropertyKeys]] ( ), https://html.spec.whatwg.org/multipage/window-object.html#windowproxy-ownpropertykeys
|
||||||
JS::ThrowCompletionOr<GC::MarkedVector<JS::Value>> WindowProxy::internal_own_property_keys() const
|
JS::ThrowCompletionOr<GC::RootVector<JS::Value>> WindowProxy::internal_own_property_keys() const
|
||||||
{
|
{
|
||||||
auto& event_loop = main_thread_event_loop();
|
auto& event_loop = main_thread_event_loop();
|
||||||
auto& vm = event_loop.vm();
|
auto& vm = event_loop.vm();
|
||||||
|
@ -236,7 +236,7 @@ JS::ThrowCompletionOr<GC::MarkedVector<JS::Value>> WindowProxy::internal_own_pro
|
||||||
// 1. Let W be the value of the [[Window]] internal slot of this.
|
// 1. Let W be the value of the [[Window]] internal slot of this.
|
||||||
|
|
||||||
// 2. Let keys be a new empty List.
|
// 2. Let keys be a new empty List.
|
||||||
auto keys = GC::MarkedVector<JS::Value> { vm.heap() };
|
auto keys = GC::RootVector<JS::Value> { vm.heap() };
|
||||||
|
|
||||||
// 3. Let maxProperties be W's associated Document's document-tree child navigables's size.
|
// 3. Let maxProperties be W's associated Document's document-tree child navigables's size.
|
||||||
auto max_properties = m_window->associated_document().document_tree_child_navigables().size();
|
auto max_properties = m_window->associated_document().document_tree_child_navigables().size();
|
||||||
|
|
|
@ -30,7 +30,7 @@ public:
|
||||||
virtual JS::ThrowCompletionOr<JS::Value> internal_get(JS::PropertyKey const&, JS::Value receiver, JS::CacheablePropertyMetadata*, PropertyLookupPhase) const override;
|
virtual JS::ThrowCompletionOr<JS::Value> internal_get(JS::PropertyKey const&, JS::Value receiver, JS::CacheablePropertyMetadata*, PropertyLookupPhase) const override;
|
||||||
virtual JS::ThrowCompletionOr<bool> internal_set(JS::PropertyKey const&, JS::Value value, JS::Value receiver, JS::CacheablePropertyMetadata*) override;
|
virtual JS::ThrowCompletionOr<bool> internal_set(JS::PropertyKey const&, JS::Value value, JS::Value receiver, JS::CacheablePropertyMetadata*) override;
|
||||||
virtual JS::ThrowCompletionOr<bool> internal_delete(JS::PropertyKey const&) override;
|
virtual JS::ThrowCompletionOr<bool> internal_delete(JS::PropertyKey const&) override;
|
||||||
virtual JS::ThrowCompletionOr<GC::MarkedVector<JS::Value>> internal_own_property_keys() const override;
|
virtual JS::ThrowCompletionOr<GC::RootVector<JS::Value>> internal_own_property_keys() const override;
|
||||||
|
|
||||||
GC::Ptr<Window> window() const { return m_window; }
|
GC::Ptr<Window> window() const { return m_window; }
|
||||||
void set_window(GC::Ref<Window>);
|
void set_window(GC::Ref<Window>);
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <AK/StringBuilder.h>
|
#include <AK/StringBuilder.h>
|
||||||
#include <LibGC/MarkedVector.h>
|
#include <LibGC/RootVector.h>
|
||||||
#include <LibJS/Runtime/Completion.h>
|
#include <LibJS/Runtime/Completion.h>
|
||||||
#include <LibJS/Runtime/Realm.h>
|
#include <LibJS/Runtime/Realm.h>
|
||||||
#include <LibJS/Runtime/VM.h>
|
#include <LibJS/Runtime/VM.h>
|
||||||
|
@ -60,7 +60,7 @@ JS::ThrowCompletionOr<JS::Value> WorkerDebugConsoleClient::printer(JS::Console::
|
||||||
return JS::js_undefined();
|
return JS::js_undefined();
|
||||||
}
|
}
|
||||||
|
|
||||||
auto output = TRY(generically_format_values(arguments.get<GC::MarkedVector<JS::Value>>()));
|
auto output = TRY(generically_format_values(arguments.get<GC::RootVector<JS::Value>>()));
|
||||||
m_console->output_debug_message(log_level, output);
|
m_console->output_debug_message(log_level, output);
|
||||||
return JS::js_undefined();
|
return JS::js_undefined();
|
||||||
}
|
}
|
||||||
|
|
|
@ -76,7 +76,7 @@ void ResizeObserverEntry::visit_edges(JS::Cell::Visitor& visitor)
|
||||||
|
|
||||||
static GC::Ref<JS::Object> to_js_array(JS::Realm& realm, Vector<GC::Ref<ResizeObserverSize>> const& sizes)
|
static GC::Ref<JS::Object> to_js_array(JS::Realm& realm, Vector<GC::Ref<ResizeObserverSize>> const& sizes)
|
||||||
{
|
{
|
||||||
GC::MarkedVector<JS::Value> vector(realm.heap());
|
GC::RootVector<JS::Value> vector(realm.heap());
|
||||||
for (auto const& size : sizes)
|
for (auto const& size : sizes)
|
||||||
vector.append(JS::Value(size.ptr()));
|
vector.append(JS::Value(size.ptr()));
|
||||||
|
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Reference in a new issue