5#include <sysio/vm/host_function.hpp>
6#include <sysio/vm/argument_proxy.hpp>
7#include <sysio/vm/span.hpp>
8#include <sysio/vm/types.hpp>
10namespace sysio {
namespace chain {
namespace webassembly {
16#define SYSIO_INJECTED_MODULE_NAME "sysio_injection"
18namespace sysio {
namespace chain {
21 class transaction_context;
25 template <
typename T, std::
size_t Extent = sysio::vm::dynamic_extent>
28 template <
typename T, std::
size_t Align = alignof(T)>
31 template <
typename T, std::
size_t Align = alignof(T)>
59 template<
typename Interface>
72 return {
d,
s, size };
78 return {
l,
r, size };
84 return {
d, val, size };
89 -> std::enable_if_t< std::is_pointer_v<T>,
97 -> std::enable_if_t< vm::is_argument_proxy_type_v<T> &&
98 std::is_pointer_v<typename T::proxy_type>,
T> {
99 if constexpr(T::is_legacy()) {
100 SYS_ASSERT(ptr != 0, wasm_execution_error,
"references cannot be created for null pointers");
108 return {
static_cast<const char*
>(
p)};
#define SYS_ASSERT(expr, exc_type, FORMAT,...)
#define SYSIO_INJECTED_MODULE_NAME
basic_type_converter< sysio::vm::execution_interface > type_converter
sysio::vm::wasm_size_t wasm_size_t
std::uint32_t wasm_size_t
#define T(meth, val, expected)
unsigned __int64 uint64_t
SYS_VM_FROM_WASM(float32_t,(float f))
SYS_VM_FROM_WASM(null_terminated_ptr,(vm::wasm_ptr_t ptr))
SYS_VM_FROM_WASM(bool,(uint32_t value))
auto from_wasm(vm::wasm_ptr_t ptr, vm::tag< T >={}) const -> std::enable_if_t< vm::is_argument_proxy_type_v< T > &&std::is_pointer_v< typename T::proxy_type >, T >
SYS_VM_FROM_WASM(memset_params,(vm::wasm_ptr_t dst, int32_t val, vm::wasm_size_t size))
auto from_wasm(vm::wasm_ptr_t ptr) const -> std::enable_if_t< std::is_pointer_v< T >, vm::argument_proxy< T > >
SYS_VM_FROM_WASM(name,(uint64_t e))
uint64_t to_wasm(name &&n)
SYS_VM_FROM_WASM(memcmp_params,(vm::wasm_ptr_t lhs, vm::wasm_ptr_t rhs, vm::wasm_size_t size))
SYS_VM_FROM_WASM(memcpy_params,(vm::wasm_ptr_t dst, vm::wasm_ptr_t src, vm::wasm_size_t size))
SYS_VM_FROM_WASM(float64_t,(double f))
Immutable except for fc::from_variant.
null_terminated_ptr(const char *ptr)
const char * data() const
auto validate_null_terminated_pointer(T ptr) const
auto validate_pointer(U ptr, wasm_size_t len) const
uint32_t to_wasm(bool &&value)
auto from_wasm(wasm_ptr_t ptr, wasm_size_t len, tag< T >={}) const -> std::enable_if_t< is_span_type_v< T >, T >