mirror of
https://github.com/RGBCube/serenity
synced 2025-07-24 12:37:43 +00:00
LibJS/JIT: Compile the IteratorResultDone instruction
This commit is contained in:
parent
045a1386d8
commit
39deb365d2
2 changed files with 16 additions and 1 deletions
|
@ -1227,6 +1227,20 @@ void Compiler::compile_iterator_next(Bytecode::Op::IteratorNext const&)
|
||||||
check_exception();
|
check_exception();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static Value cxx_iterator_result_done(VM& vm, Value iterator)
|
||||||
|
{
|
||||||
|
auto iterator_result = TRY_OR_SET_EXCEPTION(iterator.to_object(vm));
|
||||||
|
return Value(TRY_OR_SET_EXCEPTION(iterator_complete(vm, iterator_result)));
|
||||||
|
}
|
||||||
|
|
||||||
|
void Compiler::compile_iterator_result_done(Bytecode::Op::IteratorResultDone const&)
|
||||||
|
{
|
||||||
|
load_vm_register(ARG1, Bytecode::Register::accumulator());
|
||||||
|
native_call((void*)cxx_iterator_result_done);
|
||||||
|
store_vm_register(Bytecode::Register::accumulator(), RET);
|
||||||
|
check_exception();
|
||||||
|
}
|
||||||
|
|
||||||
void Compiler::jump_to_exit()
|
void Compiler::jump_to_exit()
|
||||||
{
|
{
|
||||||
m_assembler.jump(m_exit_label);
|
m_assembler.jump(m_exit_label);
|
||||||
|
|
|
@ -107,7 +107,8 @@ private:
|
||||||
O(BlockDeclarationInstantiation, block_declaration_instantiation) \
|
O(BlockDeclarationInstantiation, block_declaration_instantiation) \
|
||||||
O(SuperCallWithArgumentArray, super_call_with_argument_array) \
|
O(SuperCallWithArgumentArray, super_call_with_argument_array) \
|
||||||
O(GetIterator, get_iterator) \
|
O(GetIterator, get_iterator) \
|
||||||
O(IteratorNext, iterator_next)
|
O(IteratorNext, iterator_next) \
|
||||||
|
O(IteratorResultDone, iterator_result_done)
|
||||||
|
|
||||||
# define DECLARE_COMPILE_OP(OpTitleCase, op_snake_case) \
|
# define DECLARE_COMPILE_OP(OpTitleCase, op_snake_case) \
|
||||||
void compile_##op_snake_case(Bytecode::Op::OpTitleCase const&);
|
void compile_##op_snake_case(Bytecode::Op::OpTitleCase const&);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue