Wire Sysio Wire Sysion 1.0.0
Loading...
Searching...
No Matches
sysio::chain::webassembly::eos_vm_runtime::eos_vm_runtime< Backend > Class Template Reference

#include <sys-vm.hpp>

Inheritance diagram for sysio::chain::webassembly::eos_vm_runtime::eos_vm_runtime< Backend >:
Collaboration diagram for sysio::chain::webassembly::eos_vm_runtime::eos_vm_runtime< Backend >:

Public Member Functions

 eos_vm_runtime ()
 
std::unique_ptr< wasm_instantiated_module_interfaceinstantiate_module (const char *code_bytes, size_t code_size, std::vector< uint8_t >, const digest_type &code_hash, const uint8_t &vm_type, const uint8_t &vm_version) override
 
void immediately_exit_currently_running_module () override
 
- Public Member Functions inherited from sysio::chain::wasm_runtime_interface
virtual ~wasm_runtime_interface ()
 

Friends

template<typename Impl >
class eos_vm_instantiated_module
 

Detailed Description

template<typename Backend>
class sysio::chain::webassembly::eos_vm_runtime::eos_vm_runtime< Backend >

Definition at line 43 of file sys-vm.hpp.

Constructor & Destructor Documentation

◆ eos_vm_runtime()

template<typename Impl >
sysio::chain::webassembly::eos_vm_runtime::eos_vm_runtime< Impl >::eos_vm_runtime ( )

Definition at line 234 of file sys-vm.cpp.

234{}

Member Function Documentation

◆ immediately_exit_currently_running_module()

template<typename Impl >
void sysio::chain::webassembly::eos_vm_runtime::eos_vm_runtime< Impl >::immediately_exit_currently_running_module ( )
overridevirtual

Implements sysio::chain::wasm_runtime_interface.

Definition at line 237 of file sys-vm.cpp.

237 {
238 throw wasm_exit{};
239}

◆ instantiate_module()

template<typename Impl >
std::unique_ptr< wasm_instantiated_module_interface > sysio::chain::webassembly::eos_vm_runtime::eos_vm_runtime< Impl >::instantiate_module ( const char * code_bytes,
size_t code_size,
std::vector< uint8_t > ,
const digest_type & code_hash,
const uint8_t & vm_type,
const uint8_t & vm_version )
overridevirtual

Implements sysio::chain::wasm_runtime_interface.

Definition at line 242 of file sys-vm.cpp.

243 {
244
246 try {
247 wasm_code_ptr code((uint8_t*)code_bytes, code_size);
248 apply_options options = { .max_pages = 65536,
249 .max_call_depth = 0 };
250 std::unique_ptr<backend_t> bkend = std::make_unique<backend_t>(code, code_size, nullptr, options);
252 return std::make_unique<eos_vm_instantiated_module<Impl>>(this, std::move(bkend));
253 } catch(sysio::vm::exception& e) {
254 FC_THROW_EXCEPTION(wasm_execution_error, "Error building sys-vm interp: ${e}", ("e", e.what()));
255 }
256}
module & get_module()
Definition backend.hpp:248
#define FC_THROW_EXCEPTION(EXCEPTION, FORMAT,...)
backend_t bkend(hello_wasm, ehm, &wa)
sysio::vm::backend< eos_vm_host_functions_t, Impl, webassembly::eos_vm_runtime::apply_options, vm::profile_instr_map > eos_vm_backend_t
Definition sys-vm.hpp:22
guarded_ptr< uint8_t > wasm_code_ptr
Definition types.hpp:148
unsigned char uint8_t
Definition stdint.h:124
virtual const char * what() const =0
Here is the call graph for this function:

Friends And Related Symbol Documentation

◆ eos_vm_instantiated_module

template<typename Backend >
template<typename Impl >
friend class eos_vm_instantiated_module
friend

Definition at line 58 of file sys-vm.hpp.


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