LibJS/Bytecode: Display local variable names in bytecode dumps

Instead of displaying locals as "locN", we now show them as "name~N".
This makes it a lot easier to follow bytecode dumps, especially in
longer functions.

Note that we keep displaying the local index, to avoid confusion in case
there are multiple separate locals with the same name in one executable.
This commit is contained in:
Andreas Kling 2024-06-13 21:19:06 +02:00 committed by Andreas Kling
commit 0aa8cb7dac
Notes: sideshowbarker 2024-07-17 02:29:45 +09:00
4 changed files with 16 additions and 9 deletions

View file

@ -82,6 +82,9 @@ public:
HashMap<size_t, SourceRecord> source_map;
Vector<DeprecatedFlyString> local_variable_names;
size_t local_index_base { 0 };
ByteString const& get_string(StringTableIndex index) const { return string_table->get(index); }
DeprecatedFlyString const& get_identifier(IdentifierTableIndex index) const { return identifier_table->get(index); }