1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 09:48:11 +00:00

LibJS: Make Bytecode::Executable GC-allocated

This is a step towards making ExecutionContext easier to allocate.
This commit is contained in:
Andreas Kling 2023-11-27 13:23:59 +01:00
parent ece961f882
commit ecfcc9aef3
13 changed files with 34 additions and 19 deletions

View file

@ -15,6 +15,8 @@
#include <LibJS/Bytecode/Label.h>
#include <LibJS/Bytecode/StringTable.h>
#include <LibJS/Forward.h>
#include <LibJS/Heap/Cell.h>
#include <LibJS/Heap/CellAllocator.h>
#include <LibJS/Runtime/EnvironmentCoordinate.h>
namespace JS::JIT {
@ -46,7 +48,10 @@ struct SourceRecord {
u32 source_end_offset {};
};
class Executable final : public RefCounted<Executable> {
class Executable final : public Cell {
JS_CELL(Executable, Cell);
JS_DECLARE_ALLOCATOR(Executable);
public:
Executable(
NonnullOwnPtr<IdentifierTable>,
@ -60,7 +65,7 @@ public:
Vector<NonnullOwnPtr<BasicBlock>>,
bool is_strict_mode);
~Executable();
virtual ~Executable() override;
DeprecatedFlyString name;
Vector<PropertyLookupCache> property_lookup_caches;