mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-02 06:09:08 +00:00
LibJS/JIT: Compile the PutByIdWithThis instruction
This commit is contained in:
parent
38d5d7979b
commit
81697549b7
Notes:
sideshowbarker
2024-07-17 22:01:16 +09:00
Author: https://github.com/skyrising
Commit: 81697549b7
Pull-request: https://github.com/SerenityOS/serenity/pull/21682
3 changed files with 28 additions and 1 deletions
|
@ -1486,6 +1486,27 @@ void Compiler::compile_delete_by_id_with_this(Bytecode::Op::DeleteByIdWithThis c
|
|||
store_vm_register(Bytecode::Register::accumulator(), RET);
|
||||
}
|
||||
|
||||
static Value cxx_put_by_id_with_this(VM& vm, Value base, Value value, DeprecatedFlyString const& name, Value this_value, Bytecode::Op::PropertyKind kind)
|
||||
{
|
||||
TRY_OR_SET_EXCEPTION(Bytecode::put_by_property_key(vm, base, this_value, value, name, kind));
|
||||
return {};
|
||||
}
|
||||
|
||||
void Compiler::compile_put_by_id_with_this(Bytecode::Op::PutByIdWithThis const& op)
|
||||
{
|
||||
load_vm_register(ARG1, op.base());
|
||||
load_vm_register(ARG2, Bytecode::Register::accumulator());
|
||||
m_assembler.mov(
|
||||
Assembler::Operand::Register(ARG3),
|
||||
Assembler::Operand::Imm(bit_cast<u64>(&m_bytecode_executable.get_identifier(op.property()))));
|
||||
load_vm_register(ARG4, op.this_value());
|
||||
m_assembler.mov(
|
||||
Assembler::Operand::Register(ARG5),
|
||||
Assembler::Operand::Imm(to_underlying(op.kind())));
|
||||
native_call((void*)cxx_put_by_id_with_this);
|
||||
check_exception();
|
||||
}
|
||||
|
||||
void Compiler::jump_to_exit()
|
||||
{
|
||||
m_assembler.jump(m_exit_label);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue