diff --git a/Userland/Libraries/LibJS/JIT/Compiler.cpp b/Userland/Libraries/LibJS/JIT/Compiler.cpp index af465187bf..8643b98ad4 100644 --- a/Userland/Libraries/LibJS/JIT/Compiler.cpp +++ b/Userland/Libraries/LibJS/JIT/Compiler.cpp @@ -1,5 +1,6 @@ /* * Copyright (c) 2023, Andreas Kling + * Copyright (c) 2023, Simon Wanner * * SPDX-License-Identifier: BSD-2-Clause */ @@ -1381,6 +1382,19 @@ void Compiler::compile_delete_by_value_with_this(Bytecode::Op::DeleteByValueWith check_exception(); } +static Value cxx_get_object_property_iterator(VM& vm, Value object) +{ + return TRY_OR_SET_EXCEPTION(Bytecode::get_object_property_iterator(vm, object)); +} + +void Compiler::compile_get_object_property_iterator(Bytecode::Op::GetObjectPropertyIterator const&) +{ + load_vm_register(ARG1, Bytecode::Register::accumulator()); + native_call((void*)cxx_get_object_property_iterator); + store_vm_register(Bytecode::Register::accumulator(), RET); + check_exception(); +} + void Compiler::jump_to_exit() { m_assembler.jump(m_exit_label); diff --git a/Userland/Libraries/LibJS/JIT/Compiler.h b/Userland/Libraries/LibJS/JIT/Compiler.h index f46980ace3..ef6c0010c2 100644 --- a/Userland/Libraries/LibJS/JIT/Compiler.h +++ b/Userland/Libraries/LibJS/JIT/Compiler.h @@ -1,5 +1,6 @@ /* * Copyright (c) 2023, Andreas Kling + * Copyright (c) 2023, Simon Wanner * * SPDX-License-Identifier: BSD-2-Clause */ @@ -117,7 +118,8 @@ private: O(Append, append) \ O(DeleteById, delete_by_id) \ O(DeleteByValue, delete_by_value) \ - O(DeleteByValueWithThis, delete_by_value_with_this) + O(DeleteByValueWithThis, delete_by_value_with_this) \ + O(GetObjectPropertyIterator, get_object_property_iterator) # define DECLARE_COMPILE_OP(OpTitleCase, op_snake_case) \ void compile_##op_snake_case(Bytecode::Op::OpTitleCase const&);