-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathVM.h
39 lines (34 loc) · 737 Bytes
/
VM.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#pragma once
#include <array>
#include <cstdint>
#include <stack>
#include <functional>
#include <unordered_map>
#include <string>
#include <string_view>
#include "Value.h"
#include "Object.h"
#include "Utils.h"
#include "Chunk.h"
#include "Allocator.h"
#ifdef COMPUTEDUCK_BUILD_WITH_LLVM
#include "Jit.h"
#endif
class COMPUTE_DUCK_API VM
{
public:
VM() = default;
~VM();
void Run(FunctionObject *fn);
private:
void Execute();
#ifdef COMPUTEDUCK_BUILD_WITH_LLVM
void RunJit(const struct CallFrame& frame);
template<typename T>
void ExecuteJitFunction(const CallFrame& frame,const std::string& fnName);
class Jit *m_Jit{ nullptr };
#endif
};
#ifdef COMPUTEDUCK_BUILD_WITH_LLVM
#include "VM.inl"
#endif