LibJS: Make Executable ref-counted and let instruction iterator co-own it

This ensures that the instruction stream pointed at by the instruction
iterator remains valid as long as the iterator exists.
This commit is contained in:
Andreas Kling 2023-10-03 08:18:10 +02:00
commit c14db6ab12
Notes: sideshowbarker 2024-07-17 08:13:43 +09:00
9 changed files with 61 additions and 26 deletions

View file

@ -30,7 +30,7 @@ public:
Function,
Block,
};
static CodeGenerationErrorOr<NonnullOwnPtr<Executable>> generate(ASTNode const&, FunctionKind = FunctionKind::Normal);
static CodeGenerationErrorOr<NonnullRefPtr<Executable>> generate(ASTNode const&, FunctionKind = FunctionKind::Normal);
Register allocate_register();