mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2026-06-25 10:42:14 +00:00
LibJS: Remove obsolete bytecode dump formatting helpers
The Rust bytecode dumper now formats exception handler labels, raw operands, builtins, labels, and registers. Remove the C++ dump-only formatters and flatten Operand to expose only the runtime value-array layout that C++ still observes.
This commit is contained in:
parent
7a6af95db3
commit
984d3033e9
Notes:
github-actions[bot]
2026-06-15 00:43:05 +00:00
Author: https://github.com/awesomekling
Commit: 984d3033e9
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/10103
9 changed files with 23 additions and 195 deletions
|
|
@ -12,7 +12,6 @@
|
|||
#include <LibGC/Heap.h>
|
||||
#include <LibGC/HeapBlock.h>
|
||||
#include <LibJS/Bytecode/Executable.h>
|
||||
#include <LibJS/Bytecode/FormatOperand.h>
|
||||
#include <LibJS/Bytecode/Instruction.h>
|
||||
#include <LibJS/Bytecode/Op.h>
|
||||
#include <LibJS/Bytecode/RegexTable.h>
|
||||
|
|
@ -500,15 +499,6 @@ void Executable::dump() const
|
|||
output.append('\n');
|
||||
RustIntegration::dump_bytecode(output, *this);
|
||||
|
||||
if (!exception_handlers.is_empty()) {
|
||||
output.append("\nException handlers:\n"sv);
|
||||
for (auto const& handler : exception_handlers) {
|
||||
output.appendff(" [{:4x} .. {:4x}] => handler ", handler.start_offset, handler.end_offset);
|
||||
Label handler_label(static_cast<u32>(handler.handler_offset));
|
||||
output.appendff("{}\n", format_label(""sv, handler_label, *this));
|
||||
}
|
||||
}
|
||||
|
||||
output.append('\n');
|
||||
warnln("{}", output.string_view());
|
||||
}
|
||||
|
|
@ -693,16 +683,4 @@ SourceRange const& Executable::get_source_range(u32 program_counter)
|
|||
});
|
||||
}
|
||||
|
||||
Operand Executable::original_operand_from_raw(u32 raw) const
|
||||
{
|
||||
// NB: Layout is [registers | locals | constants | arguments]
|
||||
if (raw < number_of_registers)
|
||||
return Operand { Operand::Type::Register, raw };
|
||||
if (raw < registers_and_locals_count)
|
||||
return Operand { Operand::Type::Local, raw - local_index_base };
|
||||
if (raw < argument_index_base)
|
||||
return Operand { Operand::Type::Constant, raw - registers_and_locals_count };
|
||||
return Operand { Operand::Type::Argument, raw - argument_index_base };
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue