/src/WasmEdge/include/llvm/jit.h
Line | Count | Source (jump to first uncovered line) |
1 | | // SPDX-License-Identifier: Apache-2.0 |
2 | | // SPDX-FileCopyrightText: 2019-2024 Second State INC |
3 | | |
4 | | //===-- wasmedge/llvm/jit.h - JIT Engine class definition -----------------===// |
5 | | // |
6 | | // Part of the WasmEdge Project. |
7 | | // |
8 | | //===----------------------------------------------------------------------===// |
9 | | /// |
10 | | /// \file |
11 | | /// This file is the definition class of JIT engine class. |
12 | | /// |
13 | | //===----------------------------------------------------------------------===// |
14 | | #pragma once |
15 | | |
16 | | #include "ast/module.h" |
17 | | #include "common/configure.h" |
18 | | #include "common/errcode.h" |
19 | | #include "llvm/data.h" |
20 | | #include <vector> |
21 | | |
22 | | namespace WasmEdge::LLVM { |
23 | | class OrcLLJIT; |
24 | | |
25 | | class JITLibrary : public Executable { |
26 | | public: |
27 | | JITLibrary(OrcLLJIT JIT) noexcept; |
28 | | ~JITLibrary() noexcept override; |
29 | | |
30 | | Symbol<const IntrinsicsTable *> getIntrinsics() noexcept override; |
31 | | |
32 | | std::vector<Symbol<Wrapper>> getTypes(size_t Size) noexcept override; |
33 | | |
34 | | std::vector<Symbol<void>> getCodes(size_t Offset, |
35 | | size_t Size) noexcept override; |
36 | | |
37 | | private: |
38 | | OrcLLJIT *J; |
39 | | }; |
40 | | |
41 | | class JIT { |
42 | | public: |
43 | 0 | JIT(const Configure &Conf) noexcept : Conf(Conf) {} |
44 | | Expect<std::shared_ptr<Executable>> load(Data D) noexcept; |
45 | | |
46 | | private: |
47 | | const Configure Conf; |
48 | | }; |
49 | | |
50 | | } // namespace WasmEdge::LLVM |