mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-29 12:19:54 +00:00
LibJS/JIT: Compile the DeleteVariable instruction
This commit is contained in:
parent
cd18bc9d55
commit
06ea4cfc4f
Notes:
sideshowbarker
2024-07-18 22:57:59 +09:00
Author: https://github.com/skyrising
Commit: 06ea4cfc4f
Pull-request: https://github.com/SerenityOS/serenity/pull/21686
2 changed files with 18 additions and 1 deletions
|
@ -1552,6 +1552,22 @@ void Compiler::compile_get_import_meta(Bytecode::Op::GetImportMeta const&)
|
|||
store_vm_register(Bytecode::Register::accumulator(), RET);
|
||||
}
|
||||
|
||||
static Value cxx_delete_variable(VM& vm, DeprecatedFlyString const& identifier)
|
||||
{
|
||||
auto reference = TRY_OR_SET_EXCEPTION(vm.resolve_binding(identifier));
|
||||
return Value(TRY_OR_SET_EXCEPTION(reference.delete_(vm)));
|
||||
}
|
||||
|
||||
void Compiler::compile_delete_variable(Bytecode::Op::DeleteVariable const& op)
|
||||
{
|
||||
m_assembler.mov(
|
||||
Assembler::Operand::Register(ARG1),
|
||||
Assembler::Operand::Imm(bit_cast<u64>(&m_bytecode_executable.get_identifier(op.identifier().value()))));
|
||||
native_call((void*)cxx_delete_variable);
|
||||
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