Wire Sysio Wire Sysion 1.0.0
Loading...
Searching...
No Matches
sys-vm-oc.cpp
Go to the documentation of this file.
7
8#include <vector>
9#include <iterator>
10
11namespace sysio { namespace chain { namespace webassembly { namespace eosvmoc {
12
14 public:
15 eosvmoc_instantiated_module(const digest_type& code_hash, const uint8_t& vm_version, eosvmoc_runtime& wr) :
16 _code_hash(code_hash),
17 _vm_version(vm_version),
19 {
20
21 }
22
26
27 void apply(apply_context& context) override {
29 SYS_ASSERT(cd, wasm_execution_error, "SYS VM OC instantiation failed");
30
32 }
33
37};
38
39eosvmoc_runtime::eosvmoc_runtime(const boost::filesystem::path data_dir, const eosvmoc::config& eosvmoc_config, const chainbase::database& db)
40 : cc(data_dir, eosvmoc_config, db), exec(cc), mem(wasm_constraints::maximum_linear_memory/wasm_constraints::wasm_page_size) {
41}
42
45
46std::unique_ptr<wasm_instantiated_module_interface> eosvmoc_runtime::instantiate_module(const char* code_bytes, size_t code_size, std::vector<uint8_t> initial_memory,
47 const digest_type& code_hash, const uint8_t& vm_type, const uint8_t& vm_version) {
48
49 return std::make_unique<eosvmoc_instantiated_module>(code_hash, vm_type, *this);
50}
51
52//never called. SYS VM OC overrides sysio_exit to its own implementation
54
55}}}}
#define SYS_ASSERT(expr, exc_type, FORMAT,...)
Definition exceptions.hpp:7
void free_code(const digest_type &code_id, const uint8_t &vm_version)
const code_descriptor *const get_descriptor_for_code_sync(const digest_type &code_id, const uint8_t &vm_version)
void execute(const code_descriptor &code, memory &mem, apply_context &context)
Definition executor.cpp:152
eosvmoc_instantiated_module(const digest_type &code_hash, const uint8_t &vm_version, eosvmoc_runtime &wr)
Definition sys-vm-oc.cpp:15
eosvmoc_runtime(const boost::filesystem::path data_dir, const eosvmoc::config &eosvmoc_config, const chainbase::database &db)
Definition sys-vm-oc.cpp:39
std::unique_ptr< wasm_instantiated_module_interface > instantiate_module(const char *code_bytes, size_t code_size, std::vector< uint8_t > initial_memory, const digest_type &code_hash, const uint8_t &vm_type, const uint8_t &vm_version) override
Definition sys-vm-oc.cpp:46
unsigned char uint8_t
Definition stdint.h:124