LibJS: Create static unwind mappings for BasicBlocks

This is currently only used in the bytecode dump to annotate to where
unwinds lead per block, but will be hooked up to the virtual machine in
the next commit.
This commit is contained in:
Hendiadyoin1 2023-10-19 23:18:54 +02:00 committed by Andreas Kling
parent 647f0ccd3f
commit 73f347b75c
Notes: sideshowbarker 2024-07-17 14:36:19 +09:00
6 changed files with 92 additions and 6 deletions

View file

@ -33,8 +33,18 @@ BasicBlock::~BasicBlock()
void BasicBlock::dump(Bytecode::Executable const& executable) const
{
Bytecode::InstructionStreamIterator it(instruction_stream());
if (!m_name.is_empty())
warnln("{}:", m_name);
warn("{}", m_name);
if (m_handler || m_finalizer) {
warn(" [");
if (m_handler)
warn(" Handler: {}", Label { *m_handler });
if (m_finalizer)
warn(" Finalizer: {}", Label { *m_finalizer });
warn(" ]");
}
warnln(":");
while (!it.at_end()) {
warnln("[{:4x}] {}", it.offset(), (*it).to_deprecated_string(executable));
++it;