mutable
A Database System for Research and Fast Prototyping
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Private Member Functions | Private Attributes
MockInterface Struct Referencefinal
Inheritance diagram for MockInterface:
[legend]
Collaboration diagram for MockInterface:
[legend]

Public Types

using base_type = ::wasm::ModuleRunner::ExternalInterface
 

Public Member Functions

 MockInterface (const memory::AddressSpace &memory, ::wasm::GlobalValueSet imports={})
 
void importGlobals (::wasm::GlobalValueSet &globals, ::wasm::Module &) override
 
::wasm::Literals callImport (::wasm::Function *f, ::wasm::Literals &args) override
 
::wasm::Literals callTable (::wasm::Name, ::wasm::Index, ::wasm::HeapType, ::wasm::Literals &, ::wasm::Type, ::wasm::ModuleRunner &) override
 
bool growMemory (::wasm::Name, ::wasm::Address, ::wasm::Address) override
 
bool growTable (::wasm::Name, const ::wasm::Literal &, ::wasm::Index, ::wasm::Index) override
 
::wasm::Index tableSize (::wasm::Name) override
 
void trap (const char *) override
 
void hostLimit (const char *) override
 
void throwException (const ::wasm::WasmException &) override
 
 DECLARE_LOAD (8s, int8_t) DECLARE_LOAD(8u
 
uint8_t DECLARE_LOAD (16s, int16_t) DECLARE_LOAD(16u
 
uint8_t uint16_t DECLARE_LOAD (32s, int32_t) DECLARE_LOAD(32u
 
uint8_t uint16_t uint32_t DECLARE_LOAD (64s, int64_t) DECLARE_LOAD(64u
 
uint8_t uint16_t uint32_t uint64_t DECLARE_LOAD (128, std::array< M_COMMA(uint8_t) 16 >) DECLARE_STORE(8
 
uint8_t uint16_t uint32_t uint64_t int8_t DECLARE_STORE (16, int16_t) DECLARE_STORE(32
 
uint8_t uint16_t uint32_t uint64_t int8_t int32_t DECLARE_STORE (64, int64_t) DECLARE_STORE(128
 

Private Member Functions

template<typename T = void>
_load (::wasm::Address addr)
 
template<>
std::array< uint8_t, 16 > _load (::wasm::Address _addr)
 
template<typename T = void>
void _store (::wasm::Address addr, T value)
 
template<>
void _store (::wasm::Address addr, const std::array< uint8_t, 16 > &value)
 

Private Attributes

const memory::AddressSpacememory_
 

‍the underlying virtual address space used


 
::wasm::GlobalValueSet imports_
 

‍the given imports


 

Detailed Description

Definition at line 114 of file WasmDSL.cpp.

Member Typedef Documentation

◆ base_type

Definition at line 116 of file WasmDSL.cpp.

Constructor & Destructor Documentation

◆ MockInterface()

MockInterface::MockInterface ( const memory::AddressSpace memory,
::wasm::GlobalValueSet  imports = {} 
)
inline

Definition at line 125 of file WasmDSL.cpp.

Member Function Documentation

◆ _load() [1/2]

template<>
std::array< uint8_t, 16 > MockInterface::_load ( ::wasm::Address  _addr)
inlineprivate

Definition at line 157 of file WasmDSL.cpp.

◆ _load() [2/2]

template<typename T = void>
T MockInterface::_load ( ::wasm::Address  addr)
inlineprivate

◆ _store() [1/2]

template<>
void MockInterface::_store ( ::wasm::Address  addr,
const std::array< uint8_t, 16 > &  value 
)
inlineprivate

◆ _store() [2/2]

template<typename T = void>
void MockInterface::_store ( ::wasm::Address  addr,
value 
)
inlineprivate

◆ callImport()

::wasm::Literals MockInterface::callImport ( ::wasm::Function *  f,
::wasm::Literals &  args 
)
inlineoverride

Definition at line 133 of file WasmDSL.cpp.

References args, m::wasm::callback_functions, and M_unreachable.

◆ callTable()

::wasm::Literals MockInterface::callTable ( ::wasm::Name  ,
::wasm::Index  ,
::wasm::HeapType  ,
::wasm::Literals &  ,
::wasm::Type  ,
::wasm::ModuleRunner &   
)
inlineoverride

Definition at line 139 of file WasmDSL.cpp.

References M_unreachable.

◆ DECLARE_LOAD() [1/5]

uint8_t uint16_t uint32_t uint64_t MockInterface::DECLARE_LOAD ( 128  ,
std::array< M_COMMA(uint8_t) 16 >   
)

◆ DECLARE_LOAD() [2/5]

uint8_t MockInterface::DECLARE_LOAD ( 16s  ,
int16_t   
)

◆ DECLARE_LOAD() [3/5]

uint8_t uint16_t MockInterface::DECLARE_LOAD ( 32s  ,
int32_t   
)

◆ DECLARE_LOAD() [4/5]

uint8_t uint16_t uint32_t MockInterface::DECLARE_LOAD ( 64s  ,
int64_t   
)

◆ DECLARE_LOAD() [5/5]

MockInterface::DECLARE_LOAD ( 8s  ,
int8_t   
)

◆ DECLARE_STORE() [1/2]

uint8_t uint16_t uint32_t uint64_t int8_t MockInterface::DECLARE_STORE ( 16  ,
int16_t   
)

◆ DECLARE_STORE() [2/2]

uint8_t uint16_t uint32_t uint64_t int8_t int32_t MockInterface::DECLARE_STORE ( 64  ,
int64_t   
)

◆ growMemory()

bool MockInterface::growMemory ( ::wasm::Name  ,
::wasm::Address  ,
::wasm::Address   
)
inlineoverride

Definition at line 145 of file WasmDSL.cpp.

References M_unreachable.

◆ growTable()

bool MockInterface::growTable ( ::wasm::Name  ,
const ::wasm::Literal &  ,
::wasm::Index  ,
::wasm::Index   
)
inlineoverride

Definition at line 146 of file WasmDSL.cpp.

References M_unreachable.

◆ hostLimit()

void MockInterface::hostLimit ( const char *  )
inlineoverride

Definition at line 152 of file WasmDSL.cpp.

References M_unreachable.

◆ importGlobals()

void MockInterface::importGlobals ( ::wasm::GlobalValueSet &  globals,
::wasm::Module &   
)
inlineoverride

Definition at line 129 of file WasmDSL.cpp.

References M_insist.

◆ tableSize()

::wasm::Index MockInterface::tableSize ( ::wasm::Name  )
inlineoverride

Definition at line 150 of file WasmDSL.cpp.

References M_unreachable.

◆ throwException()

void MockInterface::throwException ( const ::wasm::WasmException &  )
inlineoverride

Definition at line 153 of file WasmDSL.cpp.

References M_unreachable.

◆ trap()

void MockInterface::trap ( const char *  )
inlineoverride

Definition at line 151 of file WasmDSL.cpp.

References M_unreachable.

Field Documentation

◆ imports_

::wasm::GlobalValueSet MockInterface::imports_
private

‍the given imports

Definition at line 122 of file WasmDSL.cpp.

◆ memory_

const memory::AddressSpace& MockInterface::memory_
private

‍the underlying virtual address space used

Definition at line 120 of file WasmDSL.cpp.


The documentation for this struct was generated from the following file: