1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 04:17:35 +00:00

LibJS/JIT: Support alternative entry point blocks

If Interpreter::run_and_return_frame is called with a specific entry
point we now map that to a native instruction address, which the JIT
code jumps to after the function prologue.
This commit is contained in:
Simon Wanner 2023-11-02 21:52:20 +01:00 committed by Andreas Kling
parent 38f3b78a1d
commit e400682fb1
4 changed files with 46 additions and 5 deletions

View file

@ -31,7 +31,7 @@ public:
NativeExecutable(void* code, size_t size, Vector<BytecodeMapping>);
~NativeExecutable();
void run(VM&) const;
void run(VM&, size_t entry_point) const;
void dump_disassembly(Bytecode::Executable const& executable) const;
BytecodeMapping const& find_mapping_entry(size_t native_offset) const;
Optional<UnrealizedSourceRange> get_source_range(Bytecode::Executable const& executable, FlatPtr address) const;
@ -42,6 +42,7 @@ private:
void* m_code { nullptr };
size_t m_size { 0 };
Vector<BytecodeMapping> m_mapping;
Vector<FlatPtr> m_block_entry_points;
mutable OwnPtr<Bytecode::InstructionStreamIterator> m_instruction_stream_iterator;
};