/* * Copyright (c) 2021-2023, Andreas Kling * * SPDX-License-Identifier: BSD-2-Clause */ #pragma once #include #include #include namespace JS::Bytecode { ThrowCompletionOr> base_object_for_get(VM&, Value base_value); ThrowCompletionOr get_by_id(VM&, DeprecatedFlyString const& property, Value base_value, Value this_value, PropertyLookupCache&); ThrowCompletionOr get_by_value(VM&, Value base_value, Value property_key_value); ThrowCompletionOr get_global(Bytecode::Interpreter&, DeprecatedFlyString const& identifier, GlobalVariableCache&); ThrowCompletionOr put_by_property_key(VM&, Value base, Value this_value, Value value, PropertyKey name, Op::PropertyKind kind, PropertyLookupCache* = nullptr); ThrowCompletionOr perform_call(Interpreter&, Value this_value, Op::CallType, Value callee, MarkedVector argument_values); ThrowCompletionOr throw_if_needed_for_call(Interpreter&, Value callee, Op::CallType, Optional const& expression_string); ThrowCompletionOr typeof_variable(VM&, DeprecatedFlyString const&); ThrowCompletionOr set_variable(VM&, DeprecatedFlyString const&, Value, Op::EnvironmentMode, Op::SetVariable::InitializationMode); Value new_function(VM&, FunctionExpression const&, Optional const& lhs_name, Optional const& home_object); ThrowCompletionOr put_by_value(VM&, Value base, Value property_key_value, Value value, Op::PropertyKind); ThrowCompletionOr get_variable(Bytecode::Interpreter&, DeprecatedFlyString const& name, EnvironmentVariableCache&); struct CalleeAndThis { Value callee; Value this_value; }; ThrowCompletionOr get_callee_and_this_from_environment(Bytecode::Interpreter&, DeprecatedFlyString const& name, EnvironmentVariableCache&); Value new_regexp(VM&, ParsedRegex const&, DeprecatedString const& pattern, DeprecatedString const& flags); MarkedVector argument_list_evaluation(VM&, Value arguments); ThrowCompletionOr create_variable(VM&, DeprecatedFlyString const& name, Op::EnvironmentMode, bool is_global, bool is_immutable, bool is_strict); ThrowCompletionOr new_class(VM&, Value super_class, ClassExpression const&, Optional const& lhs_name); ThrowCompletionOr> super_call_with_argument_array(VM&, Value argument_array, bool is_synthetic); Object* iterator_to_object(VM&, IteratorRecord); IteratorRecord object_to_iterator(VM&, Object&); ThrowCompletionOr> iterator_to_array(VM&, Value iterator); ThrowCompletionOr append(VM& vm, Value lhs, Value rhs, bool is_spread); ThrowCompletionOr delete_by_id(Bytecode::Interpreter&, Value base, IdentifierTableIndex identifier); ThrowCompletionOr delete_by_value(Bytecode::Interpreter&, Value base, Value property_key_value); ThrowCompletionOr delete_by_value_with_this(Bytecode::Interpreter&, Value base, Value property_key_value, Value this_value); ThrowCompletionOr get_object_property_iterator(VM&, Value); }