|
@@ -47,13 +47,14 @@ class BasicBlock {
|
|
AK_MAKE_NONCOPYABLE(BasicBlock);
|
|
AK_MAKE_NONCOPYABLE(BasicBlock);
|
|
|
|
|
|
public:
|
|
public:
|
|
- static NonnullOwnPtr<BasicBlock> create(String name);
|
|
|
|
|
|
+ static NonnullOwnPtr<BasicBlock> create(String name, size_t size = 4 * KiB);
|
|
~BasicBlock();
|
|
~BasicBlock();
|
|
|
|
|
|
void seal();
|
|
void seal();
|
|
|
|
|
|
void dump(Executable const&) const;
|
|
void dump(Executable const&) const;
|
|
ReadonlyBytes instruction_stream() const { return ReadonlyBytes { m_buffer, m_buffer_size }; }
|
|
ReadonlyBytes instruction_stream() const { return ReadonlyBytes { m_buffer, m_buffer_size }; }
|
|
|
|
+ size_t size() const { return m_buffer_size; }
|
|
|
|
|
|
void* next_slot() { return m_buffer + m_buffer_size; }
|
|
void* next_slot() { return m_buffer + m_buffer_size; }
|
|
bool can_grow(size_t additional_size) const { return m_buffer_size + additional_size <= m_buffer_capacity; }
|
|
bool can_grow(size_t additional_size) const { return m_buffer_size + additional_size <= m_buffer_capacity; }
|
|
@@ -65,7 +66,7 @@ public:
|
|
String const& name() const { return m_name; }
|
|
String const& name() const { return m_name; }
|
|
|
|
|
|
private:
|
|
private:
|
|
- BasicBlock(String name);
|
|
|
|
|
|
+ BasicBlock(String name, size_t size);
|
|
|
|
|
|
u8* m_buffer { nullptr };
|
|
u8* m_buffer { nullptr };
|
|
size_t m_buffer_capacity { 0 };
|
|
size_t m_buffer_capacity { 0 };
|