3 #pragma warning(disable : 4100)
4 #include "AsmJit/AsmJit.h"
5 #pragma warning(default : 4100)
6 #include "../Include/Macro.h"
17 : disp_ofst(
sizeof(
size_t) )
22 UNREFERENCED_PARAMETER( baseval );
31 BLACKBONE_API asmjit::host::Mem
AllocVar( intptr_t size )
34 size = Align( size,
sizeof(
size_t) );
37 auto val = asmjit::host::Mem( asmjit::host::zsp, static_cast<int32_t>(disp_ofst), static_cast<int32_t>(size) );
39 auto val = asmjit::host::Mem( asmjit::host::zbp, -disp_ofst - size, size );
52 BLACKBONE_API
bool AllocArray( asmjit::host::Mem arr[],
int count, intptr_t size )
54 for (
int i = 0; i < count; i++)
57 arr[i] = asmjit::host::Mem( asmjit::host::zsp, static_cast<int32_t>(disp_ofst), static_cast<int32_t>(size) );
59 arr[i] = asmjit::host::Mem( asmjit::host::zbp, -disp_ofst - size, size );
71 BLACKBONE_API
inline intptr_t
getTotalSize()
const {
return disp_ofst; };
80 #define ALLOC_STACK_VAR(worker, name, type) asmjit::host::Mem name( worker.AllocVar( sizeof(type) ) );
81 #define ALLOC_STACK_VAR_S(worker, name, size) asmjit::host::Mem name( worker.AllocVar( size ) );
83 #define ALLOC_STACK_ARRAY(worker, name, type, count) \
84 asmjit::host::Mem name[count]; \
85 worker.AllocArray( name, count, sizeof(type) );
Definition: AsmStack.hpp:13
BLACKBONE_API asmjit::host::Mem AllocVar(intptr_t size)
Allocate stack variable
Definition: AsmStack.hpp:31
BLACKBONE_API bool AllocArray(asmjit::host::Mem arr[], int count, intptr_t size)
Allocate array of stack variables
Definition: AsmStack.hpp:52
BLACKBONE_API intptr_t getTotalSize() const
Get total size of all stack variables
Definition: AsmStack.hpp:71
Definition: AsmHelper32.cpp:6