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

LibJS/JIT: Annotate disassembly with bytecode information

This commit is contained in:
Simon Wanner 2023-10-30 20:14:37 +01:00 committed by Andreas Kling
parent 9f78e56823
commit 112eadc863
3 changed files with 86 additions and 4 deletions

View file

@ -19,6 +19,7 @@ struct BytecodeMapping {
// Special block index for labels outside any blocks.
static constexpr auto EXECUTABLE = NumericLimits<size_t>::max();
static constexpr auto EXECUTABLE_LABELS = AK::Array { "entry"sv, "common_exit"sv };
};
class NativeExecutable {
@ -30,7 +31,10 @@ public:
~NativeExecutable();
void run(VM&) const;
void dump_disassembly() const;
void dump_disassembly(Bytecode::Executable const& executable) const;
BytecodeMapping const& find_mapping_entry(size_t native_offset) const;
ReadonlyBytes code_bytes() const { return { m_code, m_size }; }
private:
void* m_code { nullptr };