22#include <unordered_map>
39 using namespace std::string_literals;
53 explicit VM(
State& state)
noexcept;
55 [[deprecated(
"Use VM(State&) instead of VM(State*)")]]
explicit VM(
State* state) noexcept :
72 Value& operator[](const std::
string& name) noexcept;
82 template <typename... Args>
83 Value call(const std::
string& name, Args&&... args);
97 template <typename... Args>
105 void exit(
int code) noexcept;
112 void setUserPointer(
void* ptr) noexcept;
119 void* getUserPointer() noexcept;
130 std::
size_t m_until_frame_count;
137 void* m_user_pointer;
147 int safeRun(internal::
ExecutionContext& context, std::
size_t untilFrameCount = 0);
153 void init() noexcept;
265 uint16_t findNearestVariableIdWithValue(const
Value& value, internal::
ExecutionContext& context) const noexcept;
272 void throwVMError(const std::
string& message);
290#include "inline/VM.inl"
Host the declaration of all the ArkScript builtins.
Keeping track of the internal data needed by the VM.
Loads .dll/.so/.dynlib files.
The virtual machine scope system.
State used by the virtual machine: it loads the bytecode, can compile it if needed,...
Ark state to handle the dirty job of loading and compiling ArkScript code.
The ArkScript virtual machine, executing ArkScript bytecode.
VM(State *state) noexcept
Handling a shared library as an ArkScript plugin.
const Value False
ArkScript False value.
const Value True
ArkScript True value.
const Value Nil
ArkScript Nil value.