CommonLibSSE NG
VirtualMachine.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include "RE/A/AttachedScript.h"
4 #include "RE/B/BSAtomic.h"
5 #include "RE/B/BSTArray.h"
6 #include "RE/B/BSTEvent.h"
7 #include "RE/B/BSTFreeList.h"
8 #include "RE/B/BSTHashMap.h"
9 #include "RE/B/BSTMessageQueue.h"
10 #include "RE/B/BSTSmartPointer.h"
11 #include "RE/F/FunctionMessage.h"
12 #include "RE/I/IVMDebugInterface.h"
15 #include "RE/I/IVirtualMachine.h"
16 #include "RE/L/LinkerProcessor.h"
17 #include "RE/S/SuspendedStack.h"
18 
19 namespace RE
20 {
21  namespace BSScript
22  {
23  class Array;
24  class ErrorLogger;
25  class IFreezeQuery;
26  class IProfilePolicy;
27  class ISavePatcherInterface;
28  class IStackCallbackFunctor;
29  class IStackCallbackSaveInterface;
30  class ObjectBindPolicy;
31  class Stack;
32  struct IMemoryPagePolicy;
33  struct IObjectHandlePolicy;
34  struct StatsEvent;
35 
36  namespace Internal
37  {
38  class CodeTasklet;
39 
41  public IVirtualMachine, // 0000
42  public IVMObjectBindInterface, // 0010
43  public IVMSaveLoadInterface, // 0018
44  public IVMDebugInterface, // 0020
45  public BSTEventSource<StatsEvent> // 0028
46  {
47  public:
48  inline static constexpr auto RTTI = RTTI_BSScript__Internal__VirtualMachine;
49  inline static constexpr auto VTABLE = VTABLE_BSScript__Internal__VirtualMachine;
50 
52  {
53  public:
54  // members
56  std::uint32_t refCount; // 08
57  std::uint32_t pad0C; // 0C
58  };
59  static_assert(sizeof(QueuedUnbindRefs) == 0x10);
60 
61  enum class FreezeState
62  {
63  kNotFrozen = 0,
64  kFreezing,
65  kFrozen
66  };
67 
68  ~VirtualMachine() override; // 00
69 
72 
73  // override (IVirtualMachine)
74  void SetLinkedCallback(ITypeLinkedCallback* a_callback) override; // 01
75  void TraceStack(const char* a_str, VMStackID a_stackID, Severity a_severity = Severity::kInfo) override; // 02
76  void FormatAndPostMessage(const char* a_message, Severity a_severity) override; // 03
77  void Update(float a_budget) override; // 04
78  void UpdateTasklets(float a_budget) override; // 05
79  void SetOverstressed(bool a_set) override; // 06 - { overstressed = a_set; }
80  bool IsCompletelyFrozen() const override; // 07
81  bool RegisterObjectType(VMTypeID a_typeID, const char* a_className) override; // 08
82  bool GetScriptObjectType1(const BSFixedString& a_className, BSTSmartPointer<ObjectTypeInfo>& a_outTypeInfoPtr) override; // 09
83  bool GetScriptObjectType2(VMTypeID a_typeID, BSTSmartPointer<ObjectTypeInfo>& a_outTypeInfoPtr) override; // 0A
84  bool GetScriptObjectTypeNoLoad1(const BSFixedString& a_className, BSTSmartPointer<ObjectTypeInfo>& a_typeInfoPtr) const override; // 0B
85  bool GetScriptObjectTypeNoLoad2(VMTypeID a_typeID, BSTSmartPointer<ObjectTypeInfo>& a_outTypeInfoPtr) const override; // 0C
86  bool GetTypeIDForScriptObject(const BSFixedString& a_className, VMTypeID& a_typeID) const override; // 0D
87  void GetScriptObjectsWithATypeID(BSScrapArray<BSFixedString>& a_results) const override; // 0E
88  bool GetParentNativeType(const BSFixedString& a_className, BSTSmartPointer<ObjectTypeInfo>& a_typeInfoPtr) override; // 0F
89  bool TypeIsValid(const BSFixedString& a_className) override; // 10
90  bool ReloadType(const char* a_className) override; // 11
91  void TasksToJobs(BSJobs::JobList& a_jobList) override; // 12
92  void CalculateFullReloadList(void) const override; // 13
93  bool CreateObject1(const BSFixedString& a_className, void* a_property, BSTSmartPointer<Object>& a_objPtr) override; // 14
94  bool CreateObject2(const BSFixedString& a_className, BSTSmartPointer<Object>& a_result) override; // 15
95  bool CreateArray1(const TypeInfo& a_typeInfo, std::uint32_t a_size, BSTSmartPointer<Array>& a_arrayPtr) override; // 16
96  bool CreateArray2(TypeInfo::RawType a_typeID, const BSFixedString& a_className, std::uint32_t a_size, BSTSmartPointer<Array>& a_arrayPtr) override; // 17
97  bool BindNativeMethod(IFunction* a_fn) override; // 18
98  void SetCallableFromTasklets1(const char* a_className, const char* a_stateName, const char* a_fnName, bool a_callable) override; // 19
99  void SetCallableFromTasklets2(const char* a_className, const char* a_fnName, bool a_callable) override; // 1A - { SetCallableFromTasklets1(a_className, 0, a_fnName, a_callable); }
100  // This is where the vtable differs between AE/SE and VR.
101 #if !defined(ENABLE_SKYRIM_AE) && !defined(ENABLE_SKYRIM_SE)
102  void New_1B(void) override;
103 #endif
104 #ifndef SKYRIM_CROSS_VR
105  void ForEachBoundObject(VMHandle a_handle, IForEachScriptObjectFunctor* a_functor) override; // 1B, 1C
106 #endif
107 #if !defined(ENABLE_SKYRIM_AE) && !defined(ENABLE_SKYRIM_SE)
108  void New_1D(void) override;
109 #endif
110 #ifndef SKYRIM_CROSS_VR
111  bool FindBoundObject(VMHandle a_handle, const char* a_className, BSTSmartPointer<Object>& a_result) const override; // 1C
112  void MoveBoundObjects(VMHandle a_from, VMHandle a_to) override; // 1D
113  void ResetAllBoundObjects(VMHandle a_handle) override; // 1E
114  bool CastObject(const BSTSmartPointer<Object>& a_fromObjPtr, const BSTSmartPointer<ObjectTypeInfo>& a_toTypeInfoPtr, BSTSmartPointer<Object>& a_toObjPtr) override; // 1F
115  bool SetPropertyValue(BSTSmartPointer<Object>& a_obj, const char* a_propertyName, Variable& a_setVal) override; // 20
116  bool GetPropertyValue(BSTSmartPointer<Object>& a_obj, const char* a_propertyName, Variable& a_getVal) override; // 21
117  bool GetVariableValue1(const BSTSmartPointer<Object>& a_objPtr, std::uint32_t a_index, Variable& a_out) const override; // 22
118  bool GetVariableValue2(VMHandle a_handle, const BSFixedString& a_className, std::int32_t a_variableIndex, Variable& a_out) const override; // 23
119  void SendEvent(VMHandle a_handle, const BSFixedString& a_eventName, IFunctionArguments* a_args) override; // 24
120  void SendEventAll(const BSFixedString& a_eventName, IFunctionArguments* a_args) override; // 25
121  bool DispatchStaticCall(const BSFixedString& a_className, const BSFixedString& a_fnName, IFunctionArguments* a_args, BSTSmartPointer<IStackCallbackFunctor>& a_result) override; // 26
123  bool DispatchMethodCall2(VMHandle a_handle, const BSFixedString& a_className, const BSFixedString& a_fnName, IFunctionArguments* a_args, BSTSmartPointer<IStackCallbackFunctor>& a_result) override; // 28
124  bool DispatchUnboundMethodCall(void) override; // 29
125  bool IsWaitingOnLatent(VMStackID a_stackID) const override; // 2A
126  void ReturnFromLatent(VMStackID a_stackID, const Variable& a_val) override; // 2B
127  ErrorLogger* GetErrorLogger() override; // 2C - { return errorLogger; }
128  IObjectHandlePolicy* GetObjectHandlePolicy1() override; // 2D - { return handlePolicy; }
129  const IObjectHandlePolicy* GetObjectHandlePolicy2() const override; // 2E - { return handlePolicy; }
130  ObjectBindPolicy* GetObjectBindPolicy1() override; // 2F - { return objectBindPolicy; }
131  const ObjectBindPolicy* GetObjectBindPolicy2() const override; // 30 - { return objectBindPolicy; }
132  ISavePatcherInterface* GetSavePatcherInterface() override; // 31 - { return savePatcherInterface; }
133  void RegisterForLogEvent(BSTEventSink<LogEvent>* a_sink) override; // 32
134  void UnregisterForLogEvent(BSTEventSink<LogEvent>* a_sink) override; // 33
135  void RegisterForStatsEvent(BSTEventSink<StatsEvent>* a_sink) override; // 34
136  void UnregisterForStatsEvent(BSTEventSink<StatsEvent>* a_sink) override; // 35
137 #endif
138 
139  // override (IVMObjectBindInterface)
140  VMHandle GetBoundHandle(const BSTSmartPointer<Object>& a_objPtr) const override; // 01
141  bool TypeCanBeBound(const BSFixedString& a_className, VMHandle a_handle) override; // 02
142  void BindObject(BSTSmartPointer<Object>& a_objPtr, VMHandle a_handle, bool a_conditional) override; // 03
143  void HandleLoadedBinding(BSTSmartPointer<Object>& a_objPtr, VMHandle a_handle, bool a_conditional) override; // 04
144  void RemoveAllBoundObjects(VMHandle a_handle) override; // 05
145  void RemoveAllDiskLoadedBoundObjects(VMHandle a_handle) override; // 06
146  void HandleCObjectDeletion(VMHandle a_handle) override; // 07
147  void UnbindObject(const BSTSmartPointer<Object>& a_objPtr) override; // 08
148  bool CreateObjectWithProperties(const BSFixedString& a_className, std::uint32_t a_numProperties, BSTSmartPointer<Object>& a_objPtr) override; // 09
149  bool InitObjectProperties(BSTSmartPointer<Object>& a_objPtr, void* a_property, bool a_arg3) override; // 0A
150 
151  // override (IVMSaveLoadInterface)
152  void SaveGame(SaveStorageWrapper* a_wrapper, SkyrimScript::SaveFileHandleReaderWriter* a_handle, bool unk) override; // 01
153  void LoadGame(LoadStorageWrapper* a_wrapper, SkyrimScript::SaveFileHandleReaderWriter* a_handle) override; // 02
154  void MarkSaveInvalid(BSStorage* a_storage) override; // 03
155  std::byte GetSaveGameVersion() override; // 04 - { return this->saveGameVersion; }
156  void CleanupSave() override; // 05
157  void Unk_06() override; // 06
158  void DropAllRunningData() override; // 07
159  void Unk_08(void* unk) override; // 08 - { return unk; }
160  void Unk_09(void) override; // 09 - { return 0; }
161  void Unk_0A(VMHandle a_handle, Object** a_out) override; // 0A
162  void Unk_0B(void* unk) override; // 0B - { return unk; }
163  void Unk_0C(void) override; // 0C - { return 0; }
164  void Unk_0D(VMHandle a_handle, Array** a_out) override; // 0D
165  void Unk_0E(LoadStorageWrapper* a_storage, void* unk) override; // 0E
166  bool GetStackByID(VMStackID a_stackID, Stack** a_out) override; // 0F
167  WritableStringTable GetWritableStringTable() override; // 10 - { return this->writableStringTable; }
168  const WritableStringTable GetWritableStringTable2() override; // 11 - { return this->writableStringTable; }
169  ReadableStringTable GetReadableStringTable() override; // 12 - { return this->readableStringTable; }
170  BSTHashMap<BSFixedString, BSTSmartPointer<ObjectTypeInfo>>* GetWritableTypeTable() override; // 13 - { return this->writableTypeTable; }
171  const BSTHashMap<BSFixedString, BSTSmartPointer<ObjectTypeInfo>>* GetWritableTypeTable2() override; // 14 - { return this->writableTypeTable; }
172  BSTHashMap<BSFixedString, BSTSmartPointer<ObjectTypeInfo>>* GetReadableTypeTable() override; // 15 - { return this->readableTypeTable; }
173  bool CreateEmptyTasklet(Stack* a_stack, Internal::CodeTasklet** a_out) override; // 16
174 
176 
177  // members
186  mutable BSSpinLock typeInfoLock; // 00C0
192  mutable BSSpinLock funcQueueLock; // 0200
197  std::uint32_t uiWaitingFunctionMessages; // 8278
198  bool overstressed; // 827C
199  bool initialized; // 827D
200  std::uint16_t pad827E; // 827E
205  mutable BSSpinLock suspendQueueLock; // 92F0
207  BSTArray<SuspendedStack>* stacksToResumeOverflow; // 9300 - ref to overflowSuspendArray2
209  BSTArray<SuspendedStack>* stacksToSuspendOverflow; // 9310 - ref to overflowSuspendArray1
210  mutable BSSpinLock runningStacksLock; // 9318
214  mutable BSSpinLock frozenStacksLock; // 9384
215  std::uint32_t pad938C; // 938C
217  std::uint32_t frozenStacksCount; // 9398
221  std::uint32_t unk93D8; // 93D8
222  std::uint32_t unk93DC; // 93DC
224  mutable BSSpinLock arraysLock; // 93F8
225  std::uint32_t nextArrayToClean; // 9400
226  std::uint32_t pad9404; // 9404
228  mutable BSSpinLock objectResetLock; // 9420
230  mutable BSSpinLock objectLock; // 9440 - Used for objectTable/arrayTable
231  BSTHashMap<VMHandle, BSTSmartPointer<Object>> objectTable; // 9448 - Used when loading a save
232  BSTHashMap<VMHandle, BSTSmartPointer<Array>> arrayTable; // 9478 - Used when loading a save
233  mutable BSSpinLock queuedUnbindLock; // 94A8
235  std::byte saveGameVersion; // 94C8 - Set when loading a save
236  std::uint32_t unk94CC; // 94CC
237  std::uint32_t unk94D0; // 94D0
238  WritableStringTable writableStringTable; // 94D8 - Created/Used only while saving
239  ReadableStringTable readableStringTable; // 94F0 - Created/Used only while loading a save
241  BSTHashMap<BSFixedString, BSTSmartPointer<ObjectTypeInfo>>* readableTypeTable; // 9510 - Created/Used only while loading a save
242  };
243  static_assert(sizeof(VirtualMachine) == 0x9518);
244  }
245  }
246 }
Definition: Array.h:13
Definition: ErrorLogger.h:13
Severity
Definition: ErrorLogger.h:18
Definition: IFreezeQuery.h:8
Definition: IFunctionArguments.h:12
Definition: IFunction.h:23
Definition: IProfilePolicy.h:18
Definition: ISavePatcherInterface.h:11
Definition: IStackCallbackSaveInterface.h:8
Definition: IVMDebugInterface.h:8
Definition: IVMSaveLoadInterface.h:47
Definition: IVirtualMachine.h:39
SKYRIM_REL_VR_VIRTUAL void SendEvent(VMHandle a_handle, const BSFixedString &a_eventName, IFunctionArguments *a_args)
Definition: CodeTasklet.h:18
Definition: VirtualMachine.h:46
void SendEvent(VMHandle a_handle, const BSFixedString &a_eventName, IFunctionArguments *a_args) override
bool InitObjectProperties(BSTSmartPointer< Object > &a_objPtr, void *a_property, bool a_arg3) override
BSScript::Stack * frozenStacks
Definition: VirtualMachine.h:216
std::uint32_t unk94D0
Definition: VirtualMachine.h:237
std::uint16_t pad827E
Definition: VirtualMachine.h:200
bool GetScriptObjectType2(VMTypeID a_typeID, BSTSmartPointer< ObjectTypeInfo > &a_outTypeInfoPtr) override
ReadableStringTable GetReadableStringTable() override
std::uint32_t frozenStacksCount
Definition: VirtualMachine.h:217
void RegisterForStatsEvent(BSTEventSink< StatsEvent > *a_sink) override
bool IsCompletelyFrozen() const override
void RemoveAllDiskLoadedBoundObjects(VMHandle a_handle) override
bool GetParentNativeType(const BSFixedString &a_className, BSTSmartPointer< ObjectTypeInfo > &a_typeInfoPtr) override
void BindObject(BSTSmartPointer< Object > &a_objPtr, VMHandle a_handle, bool a_conditional) override
ReadableStringTable readableStringTable
Definition: VirtualMachine.h:239
void TasksToJobs(BSJobs::JobList &a_jobList) override
static VirtualMachine * GetSingleton()
ISavePatcherInterface * savePatcherInterface
Definition: VirtualMachine.h:185
void Update(float a_budget) override
BSTHashMap< BSFixedString, BSTSmartPointer< ObjectTypeInfo > > * writeableTypeTable
Definition: VirtualMachine.h:240
BSTCommonLLMessageQueue< FunctionMessage > funcMsgQueue
Definition: VirtualMachine.h:194
BSTHashMap< VMHandle, BSTSmartPointer< Object > > objectTable
Definition: VirtualMachine.h:231
bool ReloadType(const char *a_className) override
BSSpinLock attachedScriptsLock
Definition: VirtualMachine.h:219
BSTArray< SuspendedStack > overflowSuspendArray2
Definition: VirtualMachine.h:204
void SetCallableFromTasklets1(const char *a_className, const char *a_stateName, const char *a_fnName, bool a_callable) override
void SaveGame(SaveStorageWrapper *a_wrapper, SkyrimScript::SaveFileHandleReaderWriter *a_handle, bool unk) override
std::uint32_t pad9404
Definition: VirtualMachine.h:226
bool initialized
Definition: VirtualMachine.h:199
void LoadGame(LoadStorageWrapper *a_wrapper, SkyrimScript::SaveFileHandleReaderWriter *a_handle) override
IObjectHandlePolicy * GetObjectHandlePolicy1() override
BSSpinLock typeInfoLock
Definition: VirtualMachine.h:186
std::byte saveGameVersion
Definition: VirtualMachine.h:235
ObjectBindPolicy * objectBindPolicy
Definition: VirtualMachine.h:181
const BSTHashMap< BSFixedString, BSTSmartPointer< ObjectTypeInfo > > * GetWritableTypeTable2() override
void UnregisterForStatsEvent(BSTEventSink< StatsEvent > *a_sink) override
void Unk_0A(VMHandle a_handle, Object **a_out) override
void SetOverstressed(bool a_set) override
BSTArray< FunctionMessage > overflowFuncMsgs
Definition: VirtualMachine.h:195
bool GetScriptObjectTypeNoLoad1(const BSFixedString &a_className, BSTSmartPointer< ObjectTypeInfo > &a_typeInfoPtr) const override
void MarkSaveInvalid(BSStorage *a_storage) override
BSTArray< BSTSmartPointer< ObjectTypeInfo > > typesToUnload
Definition: VirtualMachine.h:191
void Unk_0D(VMHandle a_handle, Array **a_out) override
std::uint32_t unk94CC
Definition: VirtualMachine.h:236
bool DispatchMethodCall1(BSTSmartPointer< Object > &a_obj, const BSFixedString &a_fnName, IFunctionArguments *a_args, BSTSmartPointer< IStackCallbackFunctor > &a_result) override
BSSpinLock frozenStacksLock
Definition: VirtualMachine.h:214
void CalculateFullReloadList(void) const override
std::uint32_t pad938C
Definition: VirtualMachine.h:215
BSSpinLock suspendQueueLock
Definition: VirtualMachine.h:205
BSTArray< QueuedUnbindRefs > queuedUnbinds
Definition: VirtualMachine.h:234
void UnregisterForLogEvent(BSTEventSink< LogEvent > *a_sink) override
bool overstressed
Definition: VirtualMachine.h:198
const WritableStringTable GetWritableStringTable2() override
void FormatAndPostMessage(const char *a_message, Severity a_severity) override
const ObjectBindPolicy * GetObjectBindPolicy2() const override
BSTHashMap< VMTypeID, BSFixedString > typeIDToObjectType
Definition: VirtualMachine.h:189
IFreezeQuery * freezeQuery
Definition: VirtualMachine.h:182
void ForEachBoundObject(VMHandle a_handle, IForEachScriptObjectFunctor *a_functor) override
bool CreateObject1(const BSFixedString &a_className, void *a_property, BSTSmartPointer< Object > &a_objPtr) override
void Unk_08(void *unk) override
VMStackID nextStackID
Definition: VirtualMachine.h:213
ErrorLogger * GetErrorLogger() override
void RemoveAllBoundObjects(VMHandle a_handle) override
BSSpinLock objectLock
Definition: VirtualMachine.h:230
ISavePatcherInterface * GetSavePatcherInterface() override
void TraceStack(const char *a_str, VMStackID a_stackID, Severity a_severity=Severity::kInfo) override
bool CreateArray2(TypeInfo::RawType a_typeID, const BSFixedString &a_className, std::uint32_t a_size, BSTSmartPointer< Array > &a_arrayPtr) override
BSSpinLock runningStacksLock
Definition: VirtualMachine.h:210
bool GetScriptObjectType1(const BSFixedString &a_className, BSTSmartPointer< ObjectTypeInfo > &a_outTypeInfoPtr) override
IObjectHandlePolicy * handlePolicy
Definition: VirtualMachine.h:180
BSTHashMap< BSFixedString, BSTSmartPointer< ObjectTypeInfo > > * GetWritableTypeTable() override
bool GetVariableValue1(const BSTSmartPointer< Object > &a_objPtr, std::uint32_t a_index, Variable &a_out) const override
bool CreateEmptyTasklet(Stack *a_stack, Internal::CodeTasklet **a_out) override
void Unk_0E(LoadStorageWrapper *a_storage, void *unk) override
std::uint32_t unk93DC
Definition: VirtualMachine.h:222
BSTHashMap< BSFixedString, BSTSmartPointer< ObjectTypeInfo > > objectTypeMap
Definition: VirtualMachine.h:188
void SetLinkedCallback(ITypeLinkedCallback *a_callback) override
BSTCommonStaticMessageQueue< SuspendedStack, 128 > * stacksToSuspend
Definition: VirtualMachine.h:208
BSTArray< SuspendedStack > * stacksToSuspendOverflow
Definition: VirtualMachine.h:209
FreezeState
Definition: VirtualMachine.h:62
std::byte GetSaveGameVersion() override
void SendEventAll(const BSFixedString &a_eventName, IFunctionArguments *a_args) override
bool BindNativeMethod(IFunction *a_fn) override
IStackCallbackSaveInterface * stackCallbackSaveInterface
Definition: VirtualMachine.h:183
bool GetPropertyValue(BSTSmartPointer< Object > &a_obj, const char *a_propertyName, Variable &a_getVal) override
BSTHashMap< VMStackID, BSTSmartPointer< Stack > > waitingLatentReturns
Definition: VirtualMachine.h:212
bool GetStackByID(VMStackID a_stackID, Stack **a_out) override
BSTArray< SuspendedStack > overflowSuspendArray1
Definition: VirtualMachine.h:203
bool DispatchUnboundMethodCall(void) override
void HandleLoadedBinding(BSTSmartPointer< Object > &a_objPtr, VMHandle a_handle, bool a_conditional) override
BSSpinLock funcQueueLock
Definition: VirtualMachine.h:192
ErrorLogger * errorLogger
Definition: VirtualMachine.h:178
BSSpinLock objectResetLock
Definition: VirtualMachine.h:228
BSTHashMap< BSFixedString, BSTSmartPointer< ObjectTypeInfo > > * readableTypeTable
Definition: VirtualMachine.h:241
void HandleCObjectDeletion(VMHandle a_handle) override
bool FindBoundObject(VMHandle a_handle, const char *a_className, BSTSmartPointer< Object > &a_result) const override
bool TypeIsValid(const BSFixedString &a_className) override
BSTHashMap< VMHandle, BSTSmartPointer< Array > > arrayTable
Definition: VirtualMachine.h:232
bool DispatchMethodCall2(VMHandle a_handle, const BSFixedString &a_className, const BSFixedString &a_fnName, IFunctionArguments *a_args, BSTSmartPointer< IStackCallbackFunctor > &a_result) override
bool CreateArray1(const TypeInfo &a_typeInfo, std::uint32_t a_size, BSTSmartPointer< Array > &a_arrayPtr) override
BSTCommonStaticMessageQueue< SuspendedStack, 128 > * stacksToResume
Definition: VirtualMachine.h:206
BSSpinLock queuedUnbindLock
Definition: VirtualMachine.h:233
BSTArray< BSTSmartPointer< Object > > objectsAwaitingCleanup
Definition: VirtualMachine.h:223
void MoveBoundObjects(VMHandle a_from, VMHandle a_to) override
void UpdateTasklets(float a_budget) override
void SetCallableFromTasklets2(const char *a_className, const char *a_fnName, bool a_callable) override
BSTCommonStaticMessageQueue< SuspendedStack, 128 > suspendQueue1
Definition: VirtualMachine.h:201
const IObjectHandlePolicy * GetObjectHandlePolicy2() const override
bool RegisterObjectType(VMTypeID a_typeID, const char *a_className) override
BSTHashMap< VMStackID, BSTSmartPointer< Stack > > allRunningStacks
Definition: VirtualMachine.h:211
LinkerProcessor linker
Definition: VirtualMachine.h:187
BSTArray< BSTSmartPointer< Array > > arrays
Definition: VirtualMachine.h:227
bool DispatchStaticCall(const BSFixedString &a_className, const BSFixedString &a_fnName, IFunctionArguments *a_args, BSTSmartPointer< IStackCallbackFunctor > &a_result) override
bool TypeCanBeBound(const BSFixedString &a_className, VMHandle a_handle) override
BSTArray< BSTSmartPointer< Object > > objectsAwaitingReset
Definition: VirtualMachine.h:229
void RegisterForLogEvent(BSTEventSink< LogEvent > *a_sink) override
VMHandle GetBoundHandle(const BSTSmartPointer< Object > &a_objPtr) const override
IProfilePolicy * profilePolicy
Definition: VirtualMachine.h:184
bool SetPropertyValue(BSTSmartPointer< Object > &a_obj, const char *a_propertyName, Variable &a_setVal) override
bool IsWaitingOnLatent(VMStackID a_stackID) const override
bool CreateObject2(const BSFixedString &a_className, BSTSmartPointer< Object > &a_result) override
std::uint32_t nextArrayToClean
Definition: VirtualMachine.h:225
bool GetScriptObjectTypeNoLoad2(VMTypeID a_typeID, BSTSmartPointer< ObjectTypeInfo > &a_outTypeInfoPtr) const override
BSTArray< CodeTasklet * > vmTasks
Definition: VirtualMachine.h:196
ObjectBindPolicy * GetObjectBindPolicy1() override
void Unk_0B(void *unk) override
IMemoryPagePolicy * memoryPagePolicy
Definition: VirtualMachine.h:179
void ResetAllBoundObjects(VMHandle a_handle) override
BSTHashMap< BSFixedString, VMTypeID > objectTypeToTypeID
Definition: VirtualMachine.h:190
void GetScriptObjectsWithATypeID(BSScrapArray< BSFixedString > &a_results) const override
std::uint32_t unk93D8
Definition: VirtualMachine.h:221
BSTArray< SuspendedStack > * stacksToResumeOverflow
Definition: VirtualMachine.h:207
bool CastObject(const BSTSmartPointer< Object > &a_fromObjPtr, const BSTSmartPointer< ObjectTypeInfo > &a_toTypeInfoPtr, BSTSmartPointer< Object > &a_toObjPtr) override
std::uint32_t uiWaitingFunctionMessages
Definition: VirtualMachine.h:197
static constexpr auto VTABLE
Definition: VirtualMachine.h:49
BSSpinLock arraysLock
Definition: VirtualMachine.h:224
WritableStringTable writableStringTable
Definition: VirtualMachine.h:238
bool GetTypeIDForScriptObject(const BSFixedString &a_className, VMTypeID &a_typeID) const override
BSTCommonStaticMessageQueue< SuspendedStack, 128 > suspendQueue2
Definition: VirtualMachine.h:202
void UnbindObject(const BSTSmartPointer< Object > &a_objPtr) override
stl::enumeration< FreezeState, std::uint32_t > freezeState
Definition: VirtualMachine.h:218
static constexpr auto RTTI
Definition: VirtualMachine.h:48
WritableStringTable GetWritableStringTable() override
bool CreateObjectWithProperties(const BSFixedString &a_className, std::uint32_t a_numProperties, BSTSmartPointer< Object > &a_objPtr) override
BSTHashMap< VMHandle, BSTSmallSharedArray< AttachedScript > > attachedScripts
Definition: VirtualMachine.h:220
BSTHashMap< BSFixedString, BSTSmartPointer< ObjectTypeInfo > > * GetReadableTypeTable() override
void ReturnFromLatent(VMStackID a_stackID, const Variable &a_val) override
bool GetVariableValue2(VMHandle a_handle, const BSFixedString &a_className, std::int32_t a_variableIndex, Variable &a_out) const override
BSTStaticFreeList< FunctionMessage, 1024 > funcMsgPool
Definition: VirtualMachine.h:193
Definition: LinkerProcessor.h:18
Definition: BSScriptObjectBindPolicy.h:16
Definition: Object.h:15
Definition: IVMSaveLoadInterface.h:18
Definition: Stack.h:25
Definition: TypeInfo.h:10
RawType
Definition: TypeInfo.h:13
Definition: Variable.h:15
Definition: IVMSaveLoadInterface.h:37
Definition: BSAtomic.h:51
Definition: BSStorage.h:14
Definition: BSTArray.h:377
Definition: BSTMessageQueue.h:63
Definition: BSTMessageQueue.h:81
Definition: BSTEvent.h:143
Definition: BSTEvent.h:19
Definition: BSTHashMap.h:21
Definition: BSTSmartPointer.h:36
Definition: BSTFreeList.h:28
Definition: LoadStorageWrapper.h:8
Definition: SaveStorageWrapper.h:8
Definition: SaveFileHandleReaderWriter.h:8
Definition: AbsorbEffect.h:6
constexpr REL::VariantID RTTI_BSScript__Internal__VirtualMachine(691844, 399888, 0x1f7cd28)
std::uint32_t VMTypeID
Definition: BSCoreTypes.h:9
std::uint32_t VMStackID
Definition: BSCoreTypes.h:8
std::uint64_t VMHandle
Definition: BSCoreTypes.h:7
constexpr std::array< REL::VariantID, 4 > VTABLE_BSScript__Internal__VirtualMachine
Definition: Offsets_VTABLE.h:7067
Definition: IMemoryPagePolicy.h:8
Definition: IObjectHandlePolicy.h:13
Definition: IVMObjectBindInterface.h:13
BSTSmartPointer< Object > obj
Definition: VirtualMachine.h:55
std::uint32_t pad0C
Definition: VirtualMachine.h:57
std::uint32_t refCount
Definition: VirtualMachine.h:56