diff --git a/Userland/Libraries/LibJS/Runtime/VM.cpp b/Userland/Libraries/LibJS/Runtime/VM.cpp index f0971404eb..951a589379 100644 --- a/Userland/Libraries/LibJS/Runtime/VM.cpp +++ b/Userland/Libraries/LibJS/Runtime/VM.cpp @@ -595,16 +595,6 @@ Value VM::get_new_target() return verify_cast(env).new_target(); } -// NOTE: This is only here because there's a million invocations of vm.call() - it used to be tied to the VM in weird ways. -// We should update all of those and then remove this, along with the call() template functions in VM.h, and use the standalone call() AO. -ThrowCompletionOr VM::call_internal(FunctionObject& function, Value this_value, Optional arguments) -{ - VERIFY(!exception()); - VERIFY(!this_value.is_empty()); - - return JS::call_impl(function.global_object(), &function, this_value, move(arguments)); -} - bool VM::in_strict_mode() const { if (execution_context_stack().is_empty()) diff --git a/Userland/Libraries/LibJS/Runtime/VM.h b/Userland/Libraries/LibJS/Runtime/VM.h index ddc590f44b..296c4afe91 100644 --- a/Userland/Libraries/LibJS/Runtime/VM.h +++ b/Userland/Libraries/LibJS/Runtime/VM.h @@ -200,18 +200,6 @@ public: Value get_new_target(); - template - [[nodiscard]] ALWAYS_INLINE ThrowCompletionOr call(FunctionObject& function, Value this_value, Args... args) - { - if constexpr (sizeof...(Args) > 0) { - MarkedValueList arguments_list { heap() }; - (..., arguments_list.append(move(args))); - return call(function, this_value, move(arguments_list)); - } - - return call(function, this_value); - } - CommonPropertyNames names; void run_queued_promise_jobs(); @@ -256,8 +244,6 @@ public: private: explicit VM(OwnPtr); - [[nodiscard]] ThrowCompletionOr call_internal(FunctionObject&, Value this_value, Optional arguments); - ThrowCompletionOr property_binding_initialization(BindingPattern const& binding, Value value, Environment* environment, GlobalObject& global_object); ThrowCompletionOr iterator_binding_initialization(BindingPattern const& binding, Iterator& iterator_record, Environment* environment, GlobalObject& global_object); @@ -310,15 +296,6 @@ private: OwnPtr m_custom_data; }; -template<> -[[nodiscard]] ALWAYS_INLINE ThrowCompletionOr VM::call(FunctionObject& function, Value this_value, MarkedValueList arguments) { return call_internal(function, this_value, move(arguments)); } - -template<> -[[nodiscard]] ALWAYS_INLINE ThrowCompletionOr VM::call(FunctionObject& function, Value this_value, Optional arguments) { return call_internal(function, this_value, move(arguments)); } - -template<> -[[nodiscard]] ALWAYS_INLINE ThrowCompletionOr VM::call(FunctionObject& function, Value this_value) { return call(function, this_value, Optional {}); } - ALWAYS_INLINE Heap& Cell::heap() const { return HeapBlock::from_cell(this)->heap();