mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 01:17:34 +00:00
LibJS/JIT: Compile the SuperCallWithArgumentArray instruction
This commit is contained in:
parent
1eee110575
commit
d247744a3e
3 changed files with 21 additions and 1 deletions
|
@ -989,6 +989,8 @@ public:
|
||||||
ThrowCompletionOr<void> execute_impl(Bytecode::Interpreter&) const;
|
ThrowCompletionOr<void> execute_impl(Bytecode::Interpreter&) const;
|
||||||
DeprecatedString to_deprecated_string_impl(Bytecode::Executable const&) const;
|
DeprecatedString to_deprecated_string_impl(Bytecode::Executable const&) const;
|
||||||
|
|
||||||
|
bool is_synthetic() const { return m_is_synthetic; }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
bool m_is_synthetic;
|
bool m_is_synthetic;
|
||||||
};
|
};
|
||||||
|
|
|
@ -1178,6 +1178,23 @@ void Compiler::compile_block_declaration_instantiation(Bytecode::Op::BlockDeclar
|
||||||
native_call((void*)cxx_block_declaration_instantiation);
|
native_call((void*)cxx_block_declaration_instantiation);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static Value cxx_super_call_with_argument_array(VM& vm, Value argument_array, bool is_synthetic)
|
||||||
|
{
|
||||||
|
TRY_OR_SET_EXCEPTION(Bytecode::super_call_with_argument_array(vm, argument_array, is_synthetic));
|
||||||
|
return {};
|
||||||
|
}
|
||||||
|
|
||||||
|
void Compiler::compile_super_call_with_argument_array(Bytecode::Op::SuperCallWithArgumentArray const& op)
|
||||||
|
{
|
||||||
|
load_vm_register(ARG1, Bytecode::Register::accumulator());
|
||||||
|
m_assembler.mov(
|
||||||
|
Assembler::Operand::Register(ARG2),
|
||||||
|
Assembler::Operand::Imm(static_cast<u64>(op.is_synthetic())));
|
||||||
|
native_call((void*)cxx_super_call_with_argument_array);
|
||||||
|
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);
|
||||||
|
|
|
@ -104,7 +104,8 @@ private:
|
||||||
O(SetVariable, set_variable) \
|
O(SetVariable, set_variable) \
|
||||||
O(ContinuePendingUnwind, continue_pending_unwind) \
|
O(ContinuePendingUnwind, continue_pending_unwind) \
|
||||||
O(ConcatString, concat_string) \
|
O(ConcatString, concat_string) \
|
||||||
O(BlockDeclarationInstantiation, block_declaration_instantiation)
|
O(BlockDeclarationInstantiation, block_declaration_instantiation) \
|
||||||
|
O(SuperCallWithArgumentArray, super_call_with_argument_array)
|
||||||
|
|
||||||
# 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