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

@ -343,7 +343,7 @@ public:
private:
VM& m_vm;
static CodeGenerationErrorOr<NonnullGCPtr<Executable>> compile(VM&, ASTNode const&, FunctionKind, GCPtr<ECMAScriptFunctionObject const>, MustPropagateCompletion = MustPropagateCompletion::Yes);
static CodeGenerationErrorOr<NonnullGCPtr<Executable>> compile(VM&, ASTNode const&, FunctionKind, GCPtr<ECMAScriptFunctionObject const>, MustPropagateCompletion, Vector<DeprecatedFlyString> local_variable_names);
enum class JumpType {
Continue,