/* * Copyright (c) 2021, Andreas Kling * * SPDX-License-Identifier: BSD-2-Clause */ #pragma once #include #include #include namespace JS::Bytecode { class Block { public: static NonnullOwnPtr create(); ~Block(); NonnullOwnPtrVector const& instructions() const { return m_instructions; } void dump() const; size_t register_count() const { return m_register_count; } void append(Badge, NonnullOwnPtr); void set_register_count(Badge, size_t count) { m_register_count = count; } private: Block(); size_t m_register_count { 0 }; NonnullOwnPtrVector m_instructions; }; }