| 
									
										
										
										
											2023-10-18 13:26:47 +02:00
										 |  |  | /*
 | 
					
						
							|  |  |  |  * Copyright (c) 2021-2023, Andreas Kling <kling@serenityos.org> | 
					
						
							|  |  |  |  * | 
					
						
							|  |  |  |  * SPDX-License-Identifier: BSD-2-Clause | 
					
						
							|  |  |  |  */ | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #pragma once
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #include <LibJS/Bytecode/IdentifierTable.h>
 | 
					
						
							| 
									
										
										
										
											2023-10-20 13:09:35 +02:00
										 |  |  | #include <LibJS/Bytecode/Op.h>
 | 
					
						
							| 
									
										
										
										
											2023-10-18 13:26:47 +02:00
										 |  |  | #include <LibJS/Runtime/Completion.h>
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | namespace JS::Bytecode { | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | ThrowCompletionOr<NonnullGCPtr<Object>> base_object_for_get(Bytecode::Interpreter&, Value base_value); | 
					
						
							|  |  |  | ThrowCompletionOr<Value> get_by_id(Bytecode::Interpreter&, IdentifierTableIndex, Value base_value, Value this_value, u32 cache_index); | 
					
						
							| 
									
										
										
										
											2023-10-20 12:38:43 +02:00
										 |  |  | ThrowCompletionOr<Value> get_by_value(Bytecode::Interpreter&, Value base_value, Value property_key_value); | 
					
						
							| 
									
										
										
										
											2023-10-20 12:56:12 +02:00
										 |  |  | ThrowCompletionOr<Value> get_global(Bytecode::Interpreter&, IdentifierTableIndex, u32 cache_index); | 
					
						
							| 
									
										
										
										
											2023-10-20 13:09:35 +02:00
										 |  |  | ThrowCompletionOr<void> put_by_property_key(VM&, Value base, Value this_value, Value value, PropertyKey name, Op::PropertyKind kind); | 
					
						
							| 
									
										
										
										
											2023-10-20 13:32:59 +02:00
										 |  |  | ThrowCompletionOr<Value> perform_call(Interpreter&, Value this_value, Op::CallType, Value callee, MarkedVector<Value> argument_values); | 
					
						
							| 
									
										
										
										
											2023-10-26 15:13:08 +02:00
										 |  |  | ThrowCompletionOr<void> throw_if_needed_for_call(Interpreter&, Value callee, Op::CallType, Optional<StringTableIndex> const& expression_string); | 
					
						
							| 
									
										
										
										
											2023-10-21 15:22:41 +02:00
										 |  |  | ThrowCompletionOr<Value> typeof_variable(VM&, DeprecatedFlyString const&); | 
					
						
							| 
									
										
										
										
											2023-10-21 15:30:39 +02:00
										 |  |  | ThrowCompletionOr<void> set_variable(VM&, DeprecatedFlyString const&, Value, Op::EnvironmentMode, Op::SetVariable::InitializationMode); | 
					
						
							| 
									
										
										
										
											2023-10-21 15:45:10 +02:00
										 |  |  | Value new_function(VM&, FunctionExpression const&, Optional<IdentifierTableIndex> const& lhs_name, Optional<Register> const& home_object); | 
					
						
							| 
									
										
										
										
											2023-10-21 15:55:02 +02:00
										 |  |  | ThrowCompletionOr<void> put_by_value(VM&, Value base, Value property_key_value, Value value, Op::PropertyKind); | 
					
						
							| 
									
										
										
										
											2023-10-27 13:37:29 +02:00
										 |  |  | ThrowCompletionOr<Value> get_variable(Bytecode::Interpreter&, DeprecatedFlyString const& name, u32 cache_index); | 
					
						
							| 
									
										
										
										
											2023-10-18 13:26:47 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-10-27 13:48:07 +02:00
										 |  |  | struct CalleeAndThis { | 
					
						
							|  |  |  |     Value callee; | 
					
						
							|  |  |  |     Value this_value; | 
					
						
							|  |  |  | }; | 
					
						
							|  |  |  | ThrowCompletionOr<CalleeAndThis> get_callee_and_this_from_environment(Bytecode::Interpreter&, DeprecatedFlyString const& name, u32 cache_index); | 
					
						
							| 
									
										
										
										
											2023-10-27 17:07:30 +02:00
										 |  |  | Value new_regexp(VM&, ParsedRegex const&, DeprecatedString const& pattern, DeprecatedString const& flags); | 
					
						
							| 
									
										
										
										
											2023-10-28 21:04:09 +03:00
										 |  |  | MarkedVector<Value> argument_list_evaluation(Bytecode::Interpreter&); | 
					
						
							| 
									
										
										
										
											2023-10-29 00:21:43 +02:00
										 |  |  | ThrowCompletionOr<void> create_variable(VM&, DeprecatedFlyString const& name, Op::EnvironmentMode, bool is_global, bool is_immutable, bool is_strict); | 
					
						
							| 
									
										
										
										
											2023-10-29 02:40:55 +02:00
										 |  |  | ThrowCompletionOr<ECMAScriptFunctionObject*> new_class(VM&, ClassExpression const&, Optional<IdentifierTableIndex> const& lhs_name); | 
					
						
							| 
									
										
										
										
											2023-10-29 15:25:28 +01:00
										 |  |  | ThrowCompletionOr<NonnullGCPtr<Object>> super_call_with_argument_array(VM&, Value argument_array, bool is_synthetic); | 
					
						
							| 
									
										
										
										
											2023-10-29 15:52:54 +01:00
										 |  |  | Object* iterator_to_object(VM&, IteratorRecord); | 
					
						
							| 
									
										
										
										
											2023-10-29 16:01:25 +01:00
										 |  |  | IteratorRecord object_to_iterator(VM&, Object&); | 
					
						
							| 
									
										
										
										
											2023-10-29 17:07:25 +01:00
										 |  |  | ThrowCompletionOr<NonnullGCPtr<Array>> iterator_to_array(VM&, Value iterator); | 
					
						
							| 
									
										
										
										
											2023-10-27 13:48:07 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-10-18 13:26:47 +02:00
										 |  |  | } |