1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-02 23:22:07 +00:00

LibJS/JIT: Compile the DeleteById instruction

This commit is contained in:
Jakub Berkop 2023-10-29 20:29:14 +01:00 committed by Andreas Kling
parent 0104225d9b
commit f5fcd4596c
6 changed files with 33 additions and 6 deletions

View file

@ -1336,6 +1336,22 @@ void Compiler::compile_append(Bytecode::Op::Append const& op)
check_exception();
}
static Value cxx_delete_by_id(VM& vm, Value base, Bytecode::IdentifierTableIndex property)
{
return TRY_OR_SET_EXCEPTION(Bytecode::delete_by_id(vm.bytecode_interpreter(), base, property));
}
void Compiler::compile_delete_by_id(Bytecode::Op::DeleteById const& op)
{
load_vm_register(ARG1, Bytecode::Register::accumulator());
m_assembler.mov(
Assembler::Operand::Register(ARG2),
Assembler::Operand::Imm(op.property().value()));
native_call((void*)cxx_delete_by_id);
store_vm_register(Bytecode::Register::accumulator(), RET);
check_exception();
}
void Compiler::jump_to_exit()
{
m_assembler.jump(m_exit_label);