NativeExecutable.h 559 B

12345678910111213141516171819202122232425262728293031
  1. /*
  2. * Copyright (c) 2023, Andreas Kling <kling@serenityos.org>
  3. *
  4. * SPDX-License-Identifier: BSD-2-Clause
  5. */
  6. #pragma once
  7. #include <AK/Noncopyable.h>
  8. #include <AK/Types.h>
  9. #include <LibJS/Runtime/Completion.h>
  10. namespace JS::JIT {
  11. class NativeExecutable {
  12. AK_MAKE_NONCOPYABLE(NativeExecutable);
  13. AK_MAKE_NONMOVABLE(NativeExecutable);
  14. public:
  15. NativeExecutable(void* code, size_t size);
  16. ~NativeExecutable();
  17. void run(VM&) const;
  18. void dump_disassembly() const;
  19. private:
  20. void* m_code { nullptr };
  21. size_t m_size { 0 };
  22. };
  23. }