mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-01 13:49:16 +00:00
LibJS/JIT: Compile the IteratorResultDone instruction
This commit is contained in:
parent
045a1386d8
commit
39deb365d2
Notes:
sideshowbarker
2024-07-17 08:59:18 +09:00
Author: https://github.com/skyrising
Commit: 39deb365d2
Pull-request: https://github.com/SerenityOS/serenity/pull/21677
2 changed files with 16 additions and 1 deletions
|
@ -1227,6 +1227,20 @@ void Compiler::compile_iterator_next(Bytecode::Op::IteratorNext const&)
|
|||
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()
|
||||
{
|
||||
m_assembler.jump(m_exit_label);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue