Executable.h 594 B

123456789101112131415161718192021222324252627
  1. /*
  2. * Copyright (c) 2021, Andreas Kling <kling@serenityos.org>
  3. *
  4. * SPDX-License-Identifier: BSD-2-Clause
  5. */
  6. #pragma once
  7. #include <AK/FlyString.h>
  8. #include <AK/NonnullOwnPtrVector.h>
  9. #include <LibJS/Bytecode/BasicBlock.h>
  10. #include <LibJS/Bytecode/StringTable.h>
  11. namespace JS::Bytecode {
  12. struct Executable {
  13. FlyString name;
  14. NonnullOwnPtrVector<BasicBlock> basic_blocks;
  15. NonnullOwnPtr<StringTable> string_table;
  16. size_t number_of_registers { 0 };
  17. String const& get_string(StringTableIndex index) const { return string_table->get(index); }
  18. void dump() const;
  19. };
  20. }