Executable.h 873 B

12345678910111213141516171819202122232425262728293031
  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/DeprecatedFlyString.h>
  8. #include <AK/NonnullOwnPtr.h>
  9. #include <LibJS/Bytecode/BasicBlock.h>
  10. #include <LibJS/Bytecode/IdentifierTable.h>
  11. #include <LibJS/Bytecode/StringTable.h>
  12. namespace JS::Bytecode {
  13. struct Executable {
  14. DeprecatedFlyString name;
  15. Vector<NonnullOwnPtr<BasicBlock>> basic_blocks;
  16. NonnullOwnPtr<StringTable> string_table;
  17. NonnullOwnPtr<IdentifierTable> identifier_table;
  18. size_t number_of_registers { 0 };
  19. bool is_strict_mode { false };
  20. DeprecatedString const& get_string(StringTableIndex index) const { return string_table->get(index); }
  21. DeprecatedFlyString const& get_identifier(IdentifierTableIndex index) const { return identifier_table->get(index); }
  22. void dump() const;
  23. };
  24. }