1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 20:17:44 +00:00

LibJS: Remove VM::call()

This commit is contained in:
mjz19910 2022-01-23 02:12:56 -07:00 committed by Linus Groh
parent 1ef633472b
commit 61cf1c066e
2 changed files with 0 additions and 33 deletions

View file

@ -595,16 +595,6 @@ Value VM::get_new_target()
return verify_cast<FunctionEnvironment>(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<Value> VM::call_internal(FunctionObject& function, Value this_value, Optional<MarkedValueList> 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())

View file

@ -200,18 +200,6 @@ public:
Value get_new_target();
template<typename... Args>
[[nodiscard]] ALWAYS_INLINE ThrowCompletionOr<Value> 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<CustomData>);
[[nodiscard]] ThrowCompletionOr<Value> call_internal(FunctionObject&, Value this_value, Optional<MarkedValueList> arguments);
ThrowCompletionOr<void> property_binding_initialization(BindingPattern const& binding, Value value, Environment* environment, GlobalObject& global_object);
ThrowCompletionOr<void> iterator_binding_initialization(BindingPattern const& binding, Iterator& iterator_record, Environment* environment, GlobalObject& global_object);
@ -310,15 +296,6 @@ private:
OwnPtr<CustomData> m_custom_data;
};
template<>
[[nodiscard]] ALWAYS_INLINE ThrowCompletionOr<Value> VM::call(FunctionObject& function, Value this_value, MarkedValueList arguments) { return call_internal(function, this_value, move(arguments)); }
template<>
[[nodiscard]] ALWAYS_INLINE ThrowCompletionOr<Value> VM::call(FunctionObject& function, Value this_value, Optional<MarkedValueList> arguments) { return call_internal(function, this_value, move(arguments)); }
template<>
[[nodiscard]] ALWAYS_INLINE ThrowCompletionOr<Value> VM::call(FunctionObject& function, Value this_value) { return call(function, this_value, Optional<MarkedValueList> {}); }
ALWAYS_INLINE Heap& Cell::heap() const
{
return HeapBlock::from_cell(this)->heap();