Wire Sysio Wire Sysion 1.0.0
Loading...
Searching...
No Matches
sysio::vm::execution_interface Struct Reference

#include <execution_interface.hpp>

Collaboration diagram for sysio::vm::execution_interface:

Public Member Functions

 execution_interface (char *memory, operand_stack *os)
 
void * get_memory () const
 
void trim_operands (std::size_t amt)
 
template<typename T >
void push_operand (T &&op)
 
auto pop_operand ()
 
const auto & operand_from_back (std::size_t index) const
 
template<typename T >
void * validate_pointer (wasm_ptr_t ptr, wasm_size_t len) const
 
template<typename T >
void validate_pointer (const void *ptr, wasm_size_t len) const
 
void * validate_null_terminated_pointer (wasm_ptr_t ptr) const
 
void validate_null_terminated_pointer (const void *ptr) const
 
 execution_interface (char *memory, operand_stack *os)
 
void * get_memory () const
 
void trim_operands (std::size_t amt)
 
template<typename T >
void push_operand (T &&op)
 
auto pop_operand ()
 
const auto & operand_from_back (std::size_t index) const
 
template<typename T >
void * validate_pointer (wasm_ptr_t ptr, wasm_size_t len) const
 
template<typename T >
void validate_pointer (const void *ptr, wasm_size_t len) const
 
void * validate_null_terminated_pointer (wasm_ptr_t ptr) const
 
void validate_null_terminated_pointer (const void *ptr) const
 

Public Attributes

char * memory
 
operand_stackos
 

Detailed Description

Definition at line 13 of file execution_interface.hpp.

Constructor & Destructor Documentation

◆ execution_interface() [1/2]

sysio::vm::execution_interface::execution_interface ( char * memory,
operand_stack * os )
inline

◆ execution_interface() [2/2]

sysio::vm::execution_interface::execution_interface ( char * memory,
operand_stack * os )
inline

Definition at line 14 of file execution_interface.hpp.

14: memory(memory), os(os) {}

Member Function Documentation

◆ get_memory() [1/2]

void * sysio::vm::execution_interface::get_memory ( ) const
inline

Definition at line 15 of file execution_interface.hpp.

15{ return memory; }

◆ get_memory() [2/2]

void * sysio::vm::execution_interface::get_memory ( ) const
inline

Definition at line 15 of file execution_interface.hpp.

15{ return memory; }

◆ operand_from_back() [1/2]

const auto & sysio::vm::execution_interface::operand_from_back ( std::size_t index) const
inline

Definition at line 21 of file execution_interface.hpp.

21{ return os->get_back(index); }
ElemT & get_back(size_t i)
Here is the call graph for this function:

◆ operand_from_back() [2/2]

const auto & sysio::vm::execution_interface::operand_from_back ( std::size_t index) const
inline

Definition at line 21 of file execution_interface.hpp.

21{ return os->get_back(index); }
Here is the call graph for this function:

◆ pop_operand() [1/2]

auto sysio::vm::execution_interface::pop_operand ( )
inline

Definition at line 20 of file execution_interface.hpp.

20{ return os->pop(); }
Here is the call graph for this function:

◆ pop_operand() [2/2]

auto sysio::vm::execution_interface::pop_operand ( )
inline

Definition at line 20 of file execution_interface.hpp.

20{ return os->pop(); }
Here is the call graph for this function:

◆ push_operand() [1/2]

template<typename T >
void sysio::vm::execution_interface::push_operand ( T && op)
inline

Definition at line 19 of file execution_interface.hpp.

19{ os->push(std::forward<T>(op)); }
void push(ElemT &&e)
Here is the call graph for this function:

◆ push_operand() [2/2]

template<typename T >
void sysio::vm::execution_interface::push_operand ( T && op)
inline

Definition at line 19 of file execution_interface.hpp.

19{ os->push(std::forward<T>(op)); }
Here is the call graph for this function:

◆ trim_operands() [1/2]

void sysio::vm::execution_interface::trim_operands ( std::size_t amt)
inline

Definition at line 16 of file execution_interface.hpp.

16{ os->trim(amt); }
void trim(size_t amt)
Here is the call graph for this function:

◆ trim_operands() [2/2]

void sysio::vm::execution_interface::trim_operands ( std::size_t amt)
inline

Definition at line 16 of file execution_interface.hpp.

16{ os->trim(amt); }
Here is the call graph for this function:

◆ validate_null_terminated_pointer() [1/4]

void sysio::vm::execution_interface::validate_null_terminated_pointer ( const void * ptr) const
inline

Definition at line 43 of file execution_interface.hpp.

43 {
44 volatile auto check_addr = std::strlen(static_cast<const char*>(ptr));
46 }
void ignore_unused_variable_warning(T &...)
Definition utils.hpp:101
Here is the call graph for this function:

◆ validate_null_terminated_pointer() [2/4]

void sysio::vm::execution_interface::validate_null_terminated_pointer ( const void * ptr) const
inline

Definition at line 43 of file execution_interface.hpp.

43 {
44 volatile auto check_addr = std::strlen(static_cast<const char*>(ptr));
46 }
Here is the call graph for this function:

◆ validate_null_terminated_pointer() [3/4]

void * sysio::vm::execution_interface::validate_null_terminated_pointer ( wasm_ptr_t ptr) const
inline

Definition at line 37 of file execution_interface.hpp.

37 {
38 auto result = memory + ptr;
40 return result;
41 }
void * validate_null_terminated_pointer(wasm_ptr_t ptr) const
Here is the call graph for this function:
Here is the caller graph for this function:

◆ validate_null_terminated_pointer() [4/4]

void * sysio::vm::execution_interface::validate_null_terminated_pointer ( wasm_ptr_t ptr) const
inline

Definition at line 37 of file execution_interface.hpp.

37 {
38 auto result = memory + ptr;
40 return result;
41 }
Here is the call graph for this function:

◆ validate_pointer() [1/4]

template<typename T >
void sysio::vm::execution_interface::validate_pointer ( const void * ptr,
wasm_size_t len ) const
inline

Definition at line 31 of file execution_interface.hpp.

31 {
32 SYS_VM_ASSERT( len <= std::numeric_limits<wasm_size_t>::max() / (wasm_size_t)sizeof(T), wasm_interpreter_exception, "length will overflow" );
33 volatile auto check_addr = *(reinterpret_cast<const char*>(ptr) + (len * sizeof(T)) - 1);
35 }
std::uint32_t wasm_size_t
Definition types.hpp:150
#define T(meth, val, expected)
#define SYS_VM_ASSERT(expr, exc_type, msg)
Definition exceptions.hpp:8
size_t len
Here is the call graph for this function:

◆ validate_pointer() [2/4]

template<typename T >
void sysio::vm::execution_interface::validate_pointer ( const void * ptr,
wasm_size_t len ) const
inline

Definition at line 31 of file execution_interface.hpp.

31 {
32 SYS_VM_ASSERT( len <= std::numeric_limits<wasm_size_t>::max() / (wasm_size_t)sizeof(T), wasm_interpreter_exception, "length will overflow" );
33 volatile auto check_addr = *(reinterpret_cast<const char*>(ptr) + (len * sizeof(T)) - 1);
35 }
Here is the call graph for this function:

◆ validate_pointer() [3/4]

template<typename T >
void * sysio::vm::execution_interface::validate_pointer ( wasm_ptr_t ptr,
wasm_size_t len ) const
inline

Definition at line 24 of file execution_interface.hpp.

24 {
25 auto result = memory + ptr;
26 validate_pointer<T>(result, len);
27 return result;
28 }
void * validate_pointer(wasm_ptr_t ptr, wasm_size_t len) const
Here is the call graph for this function:
Here is the caller graph for this function:

◆ validate_pointer() [4/4]

template<typename T >
void * sysio::vm::execution_interface::validate_pointer ( wasm_ptr_t ptr,
wasm_size_t len ) const
inline

Definition at line 24 of file execution_interface.hpp.

24 {
25 auto result = memory + ptr;
26 validate_pointer<T>(result, len);
27 return result;
28 }
Here is the call graph for this function:

Member Data Documentation

◆ memory

char * sysio::vm::execution_interface::memory

Definition at line 47 of file execution_interface.hpp.

◆ os

operand_stack * sysio::vm::execution_interface::os

Definition at line 48 of file execution_interface.hpp.


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