mutable
A Database System for Research and Fast Prototyping
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Data Fields | Private Attributes
m::WasmEngine::WasmContext Struct Reference

A WasmContext holds associated information of a WebAssembly module instance. More...

#include <WebAssembly.hpp>

Collaboration diagram for m::WasmEngine::WasmContext:
[legend]

Public Types

enum  config_t : uint64_t { TRAP_GUARD_PAGES = 0b1 }
 

Public Member Functions

 WasmContext (uint32_t id, const MatchBase &plan, config_t configuration, std::size_t size)
 
bool config (config_t cfg) const
 
uint32_t map_table (const Table &table)
 Maps a table at the current start of heap and advances heap past the mapped region.
 
void install_guard_page ()
 Installs a guard page at the current heap and increments heap to the next page.
 
std::size_t add_index (const idx::IndexBase &index)
 Adds an index to the WasmContext and returns its position in the vector as id.
 

Data Fields

unsigned id
 a unique ID
 
const MatchBaseplan
 current plan
 
std::unique_ptr< const storage::DataLayoutFactoryresult_set_factory
 

‍factory used to create the result set data layout


 
memory::AddressSpace vm
 WebAssembly module instance's virtual address space aka. linear memory
 
uint32_t heap = 0
 beginning of the heap, encoded as offset from the beginning of the virtual address space
 
std::vector< std::reference_wrapper< const idx::IndexBase > > indexes
 the indexes used in the query
 

Private Attributes

config_t config_
 

Detailed Description

A WasmContext holds associated information of a WebAssembly module instance.

Definition at line 26 of file WebAssembly.hpp.

Member Enumeration Documentation

◆ config_t

Enumerator
TRAP_GUARD_PAGES 

map guard pages with PROT_NONE to trap any accesses

Definition at line 28 of file WebAssembly.hpp.

Constructor & Destructor Documentation

◆ WasmContext()

M_LCOV_EXCL_STOP WasmEngine::WasmContext::WasmContext ( uint32_t  id,
const MatchBase plan,
config_t  configuration,
std::size_t  size 
)

Definition at line 56 of file WebAssembly.cpp.

References install_guard_page(), M_insist, and m::WasmEngine::WASM_MAX_MEMORY.

Member Function Documentation

◆ add_index()

std::size_t m::WasmEngine::WasmContext::add_index ( const idx::IndexBase index)
inline

Adds an index to the WasmContext and returns its position in the vector as id.

Definition at line 59 of file WebAssembly.hpp.

References indexes.

◆ config()

bool m::WasmEngine::WasmContext::config ( config_t  cfg) const
inline

Definition at line 47 of file WebAssembly.hpp.

References config_.

◆ install_guard_page()

void WasmEngine::WasmContext::install_guard_page ( )

Installs a guard page at the current heap and increments heap to the next page.

Acknowledges TRAP_GUARD_PAGES.

Definition at line 90 of file WebAssembly.cpp.

References m::get_pagesize(), m::Is_Page_Aligned(), M_DISCARD, and M_insist.

Referenced by WasmContext().

◆ map_table()

uint32_t WasmEngine::WasmContext::map_table ( const Table table)

Maps a table at the current start of heap and advances heap past the mapped region.

Returns the address (in linear memory) of the mapped table. Installs guard pages after each mapping. Acknowledges TRAP_GUARD_PAGES.

Definition at line 67 of file WebAssembly.cpp.

References m::Ceil_To_Next_Page(), m::storage::DataLayout::child(), m::Is_Page_Aligned(), m::Table::layout(), M_insist, m::memory::Memory::map(), m::Store::memory(), m::Store::num_rows(), m::storage::DataLayout::Node::num_tuples(), m::Table::store(), and m::storage::DataLayout::stride_in_bits().

Field Documentation

◆ config_

config_t m::WasmEngine::WasmContext::config_
private

Definition at line 34 of file WebAssembly.hpp.

Referenced by config().

◆ heap

uint32_t m::WasmEngine::WasmContext::heap = 0

beginning of the heap, encoded as offset from the beginning of the virtual address space

Definition at line 42 of file WebAssembly.hpp.

◆ id

unsigned m::WasmEngine::WasmContext::id

a unique ID

Definition at line 37 of file WebAssembly.hpp.

Referenced by m::wasm::detail::create_js_debug_script(), and m::WasmEngine::Dispose_Wasm_Context().

◆ indexes

std::vector<std::reference_wrapper<const idx::IndexBase> > m::WasmEngine::WasmContext::indexes

the indexes used in the query

Definition at line 43 of file WebAssembly.hpp.

Referenced by add_index().

◆ plan

const MatchBase& m::WasmEngine::WasmContext::plan

current plan

Definition at line 38 of file WebAssembly.hpp.

◆ result_set_factory

std::unique_ptr<const storage::DataLayoutFactory> m::WasmEngine::WasmContext::result_set_factory

‍factory used to create the result set data layout

Definition at line 40 of file WebAssembly.hpp.

◆ vm

memory::AddressSpace m::WasmEngine::WasmContext::vm

WebAssembly module instance's virtual address space aka. linear memory

Definition at line 41 of file WebAssembly.hpp.

Referenced by m::wasm::Module::Memory().


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