LibJS: Add a debug_position helper to the Bytecode Interpreter

This also changes argument_list_evaluation's dbgln to use it.
This commit is contained in:
Hendiadyoin1 2022-11-08 19:41:23 +01:00 committed by Ali Mohammad Pur
parent b86f1c2fe7
commit 8c4717fc6e
Notes: sideshowbarker 2024-07-17 03:47:01 +09:00
2 changed files with 5 additions and 2 deletions

View file

@ -68,6 +68,10 @@ public:
Executable const& current_executable() { return *m_current_executable; }
BasicBlock const& current_block() const { return *m_current_block; }
size_t pc() const { return m_pc ? m_pc->offset() : 0; }
String debug_position()
{
return String::formatted("{}:{:2}:{:4x}", m_current_executable->name, m_current_block->name(), pc());
}
enum class OptimizationLevel {
None,