Wire Sysio Wire Sysion 1.0.0
Loading...
Searching...
No Matches
Runtime Namespace Reference

Classes

struct  Exception
 
struct  FunctionInstance
 
struct  GCGlobals
 
struct  GCObject
 
struct  GlobalInstance
 
struct  ImportBindings
 
struct  IntrinsicResolver
 
struct  LazyResolver
 
struct  LinkResult
 
struct  MemoryInstance
 
struct  ModuleExportResolver
 
struct  ModuleInstance
 
struct  NullResolver
 
struct  ObjectInstance
 
struct  Resolver
 
struct  Result
 
struct  TableInstance
 
struct  UntaggedValue
 
struct  Value
 

Functions

RUNTIME_API LinkResult linkModule (const IR::Module &module, Resolver &resolver)
 
RUNTIME_API void init ()
 
const char * describeExceptionCause (Exception::Cause cause)
 
RUNTIME_API void causeException (Exception::Cause cause)
 
RUNTIME_API bool isA (ObjectInstance *object, const IR::ObjectType &type)
 
FunctionInstanceasFunction (ObjectInstance *object)
 
TableInstanceasTable (ObjectInstance *object)
 
MemoryInstanceasMemory (ObjectInstance *object)
 
GlobalInstanceasGlobal (ObjectInstance *object)
 
ModuleInstanceasModule (ObjectInstance *object)
 
template<typename Instance >
Instance * as (ObjectInstance *object)
 
template<>
FunctionInstanceas< FunctionInstance > (ObjectInstance *object)
 
template<>
TableInstanceas< TableInstance > (ObjectInstance *object)
 
template<>
MemoryInstanceas< MemoryInstance > (ObjectInstance *object)
 
template<>
GlobalInstanceas< GlobalInstance > (ObjectInstance *object)
 
template<>
ModuleInstanceas< ModuleInstance > (ObjectInstance *object)
 
ObjectInstanceasObject (FunctionInstance *function)
 
ObjectInstanceasObject (TableInstance *table)
 
ObjectInstanceasObject (MemoryInstance *memory)
 
ObjectInstanceasObject (GlobalInstance *global)
 
ObjectInstanceasObject (ModuleInstance *module)
 
FunctionInstanceasFunctionNullable (ObjectInstance *object)
 
TableInstanceasTableNullable (ObjectInstance *object)
 
MemoryInstanceasMemoryNullable (ObjectInstance *object)
 
GlobalInstanceasGlobalNullable (ObjectInstance *object)
 
ModuleInstanceasModuleNullable (ObjectInstance *object)
 
RUNTIME_API void freeUnreferencedObjects (std::vector< ObjectInstance * > &&rootObjectReferences)
 
RUNTIME_API Result invokeFunction (FunctionInstance *function, const std::vector< Value > &parameters)
 
RUNTIME_API const IR::FunctionTypegetFunctionType (FunctionInstance *function)
 
RUNTIME_API TableInstancecreateTable (IR::TableType type)
 
RUNTIME_API ObjectInstancegetTableElement (TableInstance *table, Uptr index)
 
RUNTIME_API ObjectInstancesetTableElement (TableInstance *table, Uptr index, ObjectInstance *newValue)
 
RUNTIME_API Uptr getTableNumElements (TableInstance *table)
 
RUNTIME_API Uptr getTableMaxElements (TableInstance *table)
 
RUNTIME_API Iptr growTable (TableInstance *table, Uptr numElements)
 
RUNTIME_API Iptr shrinkTable (TableInstance *table, Uptr numElements)
 
RUNTIME_API MemoryInstancecreateMemory (IR::MemoryType type)
 
RUNTIME_API U8getMemoryBaseAddress (MemoryInstance *memory)
 
RUNTIME_API Uptr getMemoryNumPages (MemoryInstance *memory)
 
RUNTIME_API Uptr getMemoryMaxPages (MemoryInstance *memory)
 
RUNTIME_API Iptr growMemory (MemoryInstance *memory, Uptr numPages)
 
RUNTIME_API Iptr shrinkMemory (MemoryInstance *memory, Uptr numPages)
 
RUNTIME_API U8getValidatedMemoryOffsetRange (MemoryInstance *memory, Uptr offset, Uptr numBytes)
 
template<typename Value >
ValuememoryRef (MemoryInstance *memory, U32 offset)
 
template<typename Value >
ValuememoryArrayPtr (MemoryInstance *memory, U32 offset, U32 numElements)
 
RUNTIME_API GlobalInstancecreateGlobal (IR::GlobalType type, Value initialValue)
 
RUNTIME_API Value getGlobalValue (GlobalInstance *global)
 
RUNTIME_API Value setGlobalValue (GlobalInstance *global, Value newValue)
 
RUNTIME_API ModuleInstanceinstantiateModule (const IR::Module &module, ImportBindings &&imports)
 
RUNTIME_API MemoryInstancegetDefaultMemory (ModuleInstance *moduleInstance)
 
RUNTIME_API uint64_t getDefaultMemorySize (ModuleInstance *moduleInstance)
 
RUNTIME_API TableInstancegetDefaultTable (ModuleInstance *moduleInstance)
 
RUNTIME_API void runInstanceStartFunc (ModuleInstance *moduleInstance)
 
RUNTIME_API void resetGlobalInstances (ModuleInstance *moduleInstance)
 
RUNTIME_API void resetMemory (MemoryInstance *memory, IR::MemoryType &newMemoryType)
 
RUNTIME_API ObjectInstancegetInstanceExport (ModuleInstance *moduleInstance, const std::string &name)
 
bool areBitsEqual (IR::ResultType type, UntaggedValue a, UntaggedValue b)
 
bool areBitsEqual (const Value &a, const Value &b)
 
bool areBitsEqual (const Result &a, const Result &b)
 
bool areBitsEqual (const Result &a, const Value &b)
 
bool areBitsEqual (const Value &a, const Result &b)
 
const FunctionTyperesolveImportType (const IR::Module &module, IndexedFunctionType type)
 
TableType resolveImportType (const IR::Module &module, TableType type)
 
MemoryType resolveImportType (const IR::Module &module, MemoryType type)
 
GlobalType resolveImportType (const IR::Module &module, GlobalType type)
 
template<typename Instance , typename Type >
void linkImport (const IR::Module &module, const Import< Type > &import, Resolver &resolver, LinkResult &linkResult, std::vector< Instance * > &resolvedImports)
 
void getThreadGCRoots (std::vector< ObjectInstance * > &outGCRoots)
 

Function Documentation

◆ areBitsEqual() [1/5]

bool Runtime::areBitsEqual ( const Result & a,
const Result & b )
inline

Definition at line 127 of file TaggedValue.h.

127{ return a.type == b.type && areBitsEqual(a.type,a,b); }
bool areBitsEqual(IR::ResultType type, UntaggedValue a, UntaggedValue b)
const GenericPointer< typename T::ValueType > T2 T::AllocatorType & a
Definition pointer.h:1181
IR::ResultType type
Definition TaggedValue.h:76
Here is the call graph for this function:

◆ areBitsEqual() [2/5]

bool Runtime::areBitsEqual ( const Result & a,
const Value & b )
inline

Definition at line 128 of file TaggedValue.h.

128{ return a.type == asResultType(b.type) && areBitsEqual(a.type,a,b); }
ResultType asResultType(ValueType type)
Definition Types.h:186
IR::ValueType type
Definition TaggedValue.h:43
Here is the call graph for this function:

◆ areBitsEqual() [3/5]

bool Runtime::areBitsEqual ( const Value & a,
const Result & b )
inline

Definition at line 129 of file TaggedValue.h.

129{ return asResultType(a.type) == b.type && areBitsEqual(b.type,a,b); }
Here is the call graph for this function:

◆ areBitsEqual() [4/5]

bool Runtime::areBitsEqual ( const Value & a,
const Value & b )
inline

Definition at line 126 of file TaggedValue.h.

126{ return a.type == b.type && areBitsEqual(asResultType(a.type),a,b); }
Here is the call graph for this function:

◆ areBitsEqual() [5/5]

bool Runtime::areBitsEqual ( IR::ResultType type,
UntaggedValue a,
UntaggedValue b )
inline

Definition at line 109 of file TaggedValue.h.

110 {
111 switch(type)
112 {
114 case IR::ResultType::f32: return a.i32 == b.i32;
116 case IR::ResultType::f64: return a.i64 == b.i64;
117 #if ENABLE_SIMD_PROTOTYPE
118 case IR::ResultType::v128: return a.v128.u64[0] == b.v128.u64[0] && a.v128.u64[1] == b.v128.u64[1];
119 #endif
120 case IR::ResultType::none: return true;
121 default: Errors::unreachable();
122 };
123 }
void unreachable()
Definition Errors.h:22
Here is the call graph for this function:
Here is the caller graph for this function:

◆ as()

template<typename Instance >
Instance * Runtime::as ( ObjectInstance * object)
Here is the caller graph for this function:

◆ as< FunctionInstance >()

template<>
FunctionInstance * Runtime::as< FunctionInstance > ( ObjectInstance * object)
inline

Definition at line 97 of file Runtime.h.

97{ return asFunction(object); }
FunctionInstance * asFunction(ObjectInstance *object)
Definition Runtime.h:90
Here is the call graph for this function:

◆ as< GlobalInstance >()

template<>
GlobalInstance * Runtime::as< GlobalInstance > ( ObjectInstance * object)
inline

Definition at line 100 of file Runtime.h.

100{ return asGlobal(object); }
GlobalInstance * asGlobal(ObjectInstance *object)
Definition Runtime.h:93
Here is the call graph for this function:

◆ as< MemoryInstance >()

template<>
MemoryInstance * Runtime::as< MemoryInstance > ( ObjectInstance * object)
inline

Definition at line 99 of file Runtime.h.

99{ return asMemory(object); }
MemoryInstance * asMemory(ObjectInstance *object)
Definition Runtime.h:92
Here is the call graph for this function:

◆ as< ModuleInstance >()

template<>
ModuleInstance * Runtime::as< ModuleInstance > ( ObjectInstance * object)
inline

Definition at line 101 of file Runtime.h.

101{ return asModule(object); }
ModuleInstance * asModule(ObjectInstance *object)
Definition Runtime.h:94
Here is the call graph for this function:

◆ as< TableInstance >()

template<>
TableInstance * Runtime::as< TableInstance > ( ObjectInstance * object)
inline

Definition at line 98 of file Runtime.h.

98{ return asTable(object); }
TableInstance * asTable(ObjectInstance *object)
Definition Runtime.h:91
Here is the call graph for this function:

◆ asFunction()

FunctionInstance * Runtime::asFunction ( ObjectInstance * object)
inline

Definition at line 90 of file Runtime.h.

#define WAVM_ASSERT_THROW(cond)
Definition Errors.h:29
yh_object_descriptor object
Here is the caller graph for this function:

◆ asFunctionNullable()

FunctionInstance * Runtime::asFunctionNullable ( ObjectInstance * object)
inline

Definition at line 110 of file Runtime.h.

110{ return object && object->kind == IR::ObjectKind::function ? (FunctionInstance*)object : nullptr; }

◆ asGlobal()

GlobalInstance * Runtime::asGlobal ( ObjectInstance * object)
inline

Definition at line 93 of file Runtime.h.

Here is the caller graph for this function:

◆ asGlobalNullable()

GlobalInstance * Runtime::asGlobalNullable ( ObjectInstance * object)
inline

Definition at line 113 of file Runtime.h.

113{ return object && object->kind == IR::ObjectKind::global ? (GlobalInstance*)object : nullptr; }

◆ asMemory()

MemoryInstance * Runtime::asMemory ( ObjectInstance * object)
inline

Definition at line 92 of file Runtime.h.

Here is the caller graph for this function:

◆ asMemoryNullable()

MemoryInstance * Runtime::asMemoryNullable ( ObjectInstance * object)
inline

Definition at line 112 of file Runtime.h.

112{ return object && object->kind == IR::ObjectKind::memory ? (MemoryInstance*)object : nullptr; }

◆ asModule()

ModuleInstance * Runtime::asModule ( ObjectInstance * object)
inline

Definition at line 94 of file Runtime.h.

Here is the caller graph for this function:

◆ asModuleNullable()

ModuleInstance * Runtime::asModuleNullable ( ObjectInstance * object)
inline

Definition at line 114 of file Runtime.h.

114{ return object && object->kind == IR::ObjectKind::module ? (ModuleInstance*)object : nullptr; }

◆ asObject() [1/5]

ObjectInstance * Runtime::asObject ( FunctionInstance * function)
inline

Definition at line 103 of file Runtime.h.

103{ return (ObjectInstance*)function; }

◆ asObject() [2/5]

ObjectInstance * Runtime::asObject ( GlobalInstance * global)
inline

Definition at line 106 of file Runtime.h.

106{ return (ObjectInstance*)global; }

◆ asObject() [3/5]

ObjectInstance * Runtime::asObject ( MemoryInstance * memory)
inline

Definition at line 105 of file Runtime.h.

105{ return (ObjectInstance*)memory; }

◆ asObject() [4/5]

ObjectInstance * Runtime::asObject ( ModuleInstance * module)
inline

Definition at line 107 of file Runtime.h.

107{ return (ObjectInstance*)module; }

◆ asObject() [5/5]

ObjectInstance * Runtime::asObject ( TableInstance * table)
inline

Definition at line 104 of file Runtime.h.

104{ return (ObjectInstance*)table; }

◆ asTable()

TableInstance * Runtime::asTable ( ObjectInstance * object)
inline

Definition at line 91 of file Runtime.h.

Here is the caller graph for this function:

◆ asTableNullable()

TableInstance * Runtime::asTableNullable ( ObjectInstance * object)
inline

Definition at line 111 of file Runtime.h.

111{ return object && object->kind == IR::ObjectKind::table ? (TableInstance*)object : nullptr; }

◆ causeException()

RUNTIME_API void Runtime::causeException ( Exception::Cause cause)

◆ createGlobal()

RUNTIME_API GlobalInstance * Runtime::createGlobal ( IR::GlobalType type,
Value initialValue )

◆ createMemory()

RUNTIME_API MemoryInstance * Runtime::createMemory ( IR::MemoryType type)

◆ createTable()

RUNTIME_API TableInstance * Runtime::createTable ( IR::TableType type)

◆ describeExceptionCause()

const char * Runtime::describeExceptionCause ( Exception::Cause cause)
inline

Definition at line 45 of file Runtime.h.

46 {
47 switch(cause)
48 {
49 case Exception::Cause::accessViolation: return "access violation";
50 case Exception::Cause::stackOverflow: return "stack overflow";
51 case Exception::Cause::integerDivideByZeroOrIntegerOverflow: return "integer divide by zero or signed integer overflow";
52 case Exception::Cause::invalidFloatOperation: return "invalid floating point operation";
53 case Exception::Cause::invokeSignatureMismatch: return "invoke signature mismatch";
54 case Exception::Cause::reachedUnreachable: return "reached unreachable code";
55 case Exception::Cause::indirectCallSignatureMismatch: return "call_indirect to function with wrong signature";
56 case Exception::Cause::undefinedTableElement: return "undefined function table element";
57 case Exception::Cause::calledAbort: return "called abort";
58 case Exception::Cause::calledUnimplementedIntrinsic: return "called unimplemented intrinsic";
59 case Exception::Cause::outOfMemory: return "out of memory";
60 case Exception::Cause::invalidSegmentOffset: return "invalid segment offset";
61 case Exception::Cause::misalignedAtomicMemoryAccess: return "misaligned atomic memory access";
62 default: return "unknown";
63 }
64 }

◆ freeUnreferencedObjects()

void Runtime::freeUnreferencedObjects ( std::vector< ObjectInstance * > && rootObjectReferences)

Definition at line 38 of file ObjectGC.cpp.

39 {
40 std::set<ObjectInstance*> referencedObjects;
41 std::vector<ObjectInstance*> pendingScanObjects;
42
43 // Initialize the referencedObjects set from the rootObjectReferences and intrinsic objects.
44 for(auto object : rootObjectReferences)
45 {
46 if(object && !referencedObjects.count(object))
47 {
48 referencedObjects.insert(object);
49 pendingScanObjects.push_back(object);
50 }
51 }
52
53 const std::vector<ObjectInstance*> intrinsicObjects = Intrinsics::getAllIntrinsicObjects();
54 for(auto object : intrinsicObjects)
55 {
56 if(object && !referencedObjects.count(object))
57 {
58 referencedObjects.insert(object);
59 pendingScanObjects.push_back(object);
60 }
61 }
62
63 // Scan the objects added to the referenced set so far: gather their child references and recurse.
64 while(pendingScanObjects.size())
65 {
66 ObjectInstance* scanObject = pendingScanObjects.back();
67 pendingScanObjects.pop_back();
68
69 // Gather the child references for this object based on its kind.
70 std::vector<ObjectInstance*> childReferences;
71 switch(scanObject->kind)
72 {
73 case ObjectKind::function:
74 {
75 FunctionInstance* function = asFunction(scanObject);
76 childReferences.push_back(function->moduleInstance);
77 break;
78 }
79 case ObjectKind::module:
80 {
81 ModuleInstance* moduleInstance = asModule(scanObject);
82 childReferences.insert(childReferences.begin(),moduleInstance->functionDefs.begin(),moduleInstance->functionDefs.end());
83 childReferences.insert(childReferences.begin(),moduleInstance->functions.begin(),moduleInstance->functions.end());
84 childReferences.insert(childReferences.begin(),moduleInstance->tables.begin(),moduleInstance->tables.end());
85 childReferences.insert(childReferences.begin(),moduleInstance->memories.begin(),moduleInstance->memories.end());
86 childReferences.insert(childReferences.begin(),moduleInstance->globals.begin(),moduleInstance->globals.end());
87 childReferences.push_back(moduleInstance->defaultMemory);
88 childReferences.push_back(moduleInstance->defaultTable);
89 break;
90 }
91 case ObjectKind::table:
92 {
93 TableInstance* table = asTable(scanObject);
94 childReferences.insert(childReferences.end(),table->elements.begin(),table->elements.end());
95 break;
96 }
97 case ObjectKind::memory:
98 case ObjectKind::global: break;
99 default: Errors::unreachable();
100 };
101
102 // Add the object's child references to the referenced set, and enqueue them for scanning.
103 for(auto reference : childReferences)
104 {
105 if(reference && !referencedObjects.count(reference))
106 {
107 referencedObjects.insert(reference);
108 pendingScanObjects.push_back(reference);
109 }
110 }
111 };
112
113 // Iterate over all objects, and delete objects that weren't referenced directly or indirectly by the root set.
114 GCGlobals& gcGlobals = GCGlobals::get();
115 auto objectIt = gcGlobals.allObjects.begin();
116 while(objectIt != gcGlobals.allObjects.end())
117 {
118 if(referencedObjects.count(*objectIt)) { ++objectIt; }
119 else
120 {
121 ObjectInstance* object = *objectIt;
122 objectIt = gcGlobals.allObjects.erase(objectIt);
123 delete object;
124 }
125 }
126 }
RUNTIME_API std::vector< Runtime::ObjectInstance * > getAllIntrinsicObjects()
Here is the call graph for this function:

◆ getDefaultMemory()

RUNTIME_API MemoryInstance * Runtime::getDefaultMemory ( ModuleInstance * moduleInstance)

◆ getDefaultMemorySize()

RUNTIME_API uint64_t Runtime::getDefaultMemorySize ( ModuleInstance * moduleInstance)

◆ getDefaultTable()

RUNTIME_API TableInstance * Runtime::getDefaultTable ( ModuleInstance * moduleInstance)

◆ getFunctionType()

RUNTIME_API const IR::FunctionType * Runtime::getFunctionType ( FunctionInstance * function)

◆ getGlobalValue()

RUNTIME_API Value Runtime::getGlobalValue ( GlobalInstance * global)

◆ getInstanceExport()

RUNTIME_API ObjectInstance * Runtime::getInstanceExport ( ModuleInstance * moduleInstance,
const std::string & name )

◆ getMemoryBaseAddress()

RUNTIME_API U8 * Runtime::getMemoryBaseAddress ( MemoryInstance * memory)

◆ getMemoryMaxPages()

RUNTIME_API Uptr Runtime::getMemoryMaxPages ( MemoryInstance * memory)

◆ getMemoryNumPages()

RUNTIME_API Uptr Runtime::getMemoryNumPages ( MemoryInstance * memory)

◆ getTableElement()

RUNTIME_API ObjectInstance * Runtime::getTableElement ( TableInstance * table,
Uptr index )

◆ getTableMaxElements()

RUNTIME_API Uptr Runtime::getTableMaxElements ( TableInstance * table)

◆ getTableNumElements()

RUNTIME_API Uptr Runtime::getTableNumElements ( TableInstance * table)

◆ getThreadGCRoots()

void Runtime::getThreadGCRoots ( std::vector< ObjectInstance * > & outGCRoots)

◆ getValidatedMemoryOffsetRange()

RUNTIME_API U8 * Runtime::getValidatedMemoryOffsetRange ( MemoryInstance * memory,
Uptr offset,
Uptr numBytes )
Here is the caller graph for this function:

◆ growMemory()

RUNTIME_API Iptr Runtime::growMemory ( MemoryInstance * memory,
Uptr numPages )

◆ growTable()

RUNTIME_API Iptr Runtime::growTable ( TableInstance * table,
Uptr numElements )

◆ init()

RUNTIME_API void Runtime::init ( )

◆ instantiateModule()

RUNTIME_API ModuleInstance * Runtime::instantiateModule ( const IR::Module & module,
ImportBindings && imports )

◆ invokeFunction()

RUNTIME_API Result Runtime::invokeFunction ( FunctionInstance * function,
const std::vector< Value > & parameters )

◆ isA()

bool Runtime::isA ( ObjectInstance * object,
const IR::ObjectType & type )

Definition at line 15 of file Linker.cpp.

16 {
17 if(type.kind != object->kind) { return false; }
18
19 switch(type.kind)
20 {
21 case ObjectKind::function: return asFunctionType(type) == asFunction(object)->type;
22 case ObjectKind::global: return asGlobalType(type) == asGlobal(object)->type;
23 case ObjectKind::table: return isSubset(asTableType(type),asTable(object)->type);
24 case ObjectKind::memory: return isSubset(asMemoryType(type),asMemory(object)->type);
25 default: Errors::unreachable();
26 }
27 }
const FunctionType * type
Here is the call graph for this function:
Here is the caller graph for this function:

◆ linkImport()

template<typename Instance , typename Type >
void Runtime::linkImport ( const IR::Module & module,
const Import< Type > & import,
Resolver & resolver,
LinkResult & linkResult,
std::vector< Instance * > & resolvedImports )

Definition at line 47 of file Linker.cpp.

48 {
49 // Ask the resolver for a value for this import.
50 ObjectInstance* importValue;
51 if(resolver.resolve(import.moduleName,import.exportName,resolveImportType(module,import.type),importValue))
52 {
53 // Sanity check that the resolver returned an object of the right type.
54 WAVM_ASSERT_THROW(isA(importValue,resolveImportType(module,import.type)));
55 resolvedImports.push_back(as<Instance>(importValue));
56 }
57 else { linkResult.missingImports.push_back({import.moduleName,import.exportName,resolveImportType(module,import.type)}); }
58 }
RUNTIME_API bool isA(ObjectInstance *object, const IR::ObjectType &type)
Definition Linker.cpp:15
const FunctionType * resolveImportType(const IR::Module &module, IndexedFunctionType type)
Definition Linker.cpp:38
virtual bool resolve(const std::string &moduleName, const std::string &exportName, IR::ObjectType type, ObjectInstance *&outObject)=0
Here is the call graph for this function:
Here is the caller graph for this function:

◆ linkModule()

LinkResult Runtime::linkModule ( const IR::Module & module,
Resolver & resolver )

Definition at line 60 of file Linker.cpp.

61 {
62 LinkResult linkResult;
63 for(const auto& import : module.functions.imports)
64 {
65 linkImport(module,import,resolver,linkResult,linkResult.resolvedImports.functions);
66 }
67 for(const auto& import : module.tables.imports)
68 {
69 linkImport(module,import,resolver,linkResult,linkResult.resolvedImports.tables);
70 }
71 for(const auto& import : module.memories.imports)
72 {
73 linkImport(module,import,resolver,linkResult,linkResult.resolvedImports.memories);
74 }
75 for(const auto& import : module.globals.imports)
76 {
77 linkImport(module,import,resolver,linkResult,linkResult.resolvedImports.globals);
78 }
79
80 linkResult.success = linkResult.missingImports.size() == 0;
81 return linkResult;
82 }
void linkImport(const IR::Module &module, const Import< Type > &import, Resolver &resolver, LinkResult &linkResult, std::vector< Instance * > &resolvedImports)
Definition Linker.cpp:47
std::vector< FunctionInstance * > functions
Definition Runtime.h:199
std::vector< MemoryInstance * > memories
Definition Runtime.h:201
std::vector< GlobalInstance * > globals
Definition Runtime.h:202
std::vector< TableInstance * > tables
Definition Runtime.h:200
Here is the call graph for this function:

◆ memoryArrayPtr()

template<typename Value >
Value * Runtime::memoryArrayPtr ( MemoryInstance * memory,
U32 offset,
U32 numElements )

Definition at line 177 of file Runtime.h.

178 { return (Value*)getValidatedMemoryOffsetRange(memory,offset,numElements * sizeof(Value)); }
RUNTIME_API U8 * getValidatedMemoryOffsetRange(MemoryInstance *memory, Uptr offset, Uptr numBytes)
Here is the call graph for this function:

◆ memoryRef()

template<typename Value >
Value & Runtime::memoryRef ( MemoryInstance * memory,
U32 offset )

Definition at line 173 of file Runtime.h.

174 { return *(Value*)getValidatedMemoryOffsetRange(memory,offset,sizeof(Value)); }
Here is the call graph for this function:

◆ resetGlobalInstances()

RUNTIME_API void Runtime::resetGlobalInstances ( ModuleInstance * moduleInstance)

◆ resetMemory()

RUNTIME_API void Runtime::resetMemory ( MemoryInstance * memory,
IR::MemoryType & newMemoryType )

◆ resolveImportType() [1/4]

GlobalType Runtime::resolveImportType ( const IR::Module & module,
GlobalType type )

Definition at line 44 of file Linker.cpp.

44{ return type; }
yh_object_type type
Definition yubihsm.h:672

◆ resolveImportType() [2/4]

const FunctionType * Runtime::resolveImportType ( const IR::Module & module,
IndexedFunctionType type )

Definition at line 38 of file Linker.cpp.

39 {
40 return module.types[type.index];
41 }
Here is the caller graph for this function:

◆ resolveImportType() [3/4]

MemoryType Runtime::resolveImportType ( const IR::Module & module,
MemoryType type )

Definition at line 43 of file Linker.cpp.

43{ return type; }

◆ resolveImportType() [4/4]

TableType Runtime::resolveImportType ( const IR::Module & module,
TableType type )

Definition at line 42 of file Linker.cpp.

42{ return type; }

◆ runInstanceStartFunc()

RUNTIME_API void Runtime::runInstanceStartFunc ( ModuleInstance * moduleInstance)

◆ setGlobalValue()

RUNTIME_API Value Runtime::setGlobalValue ( GlobalInstance * global,
Value newValue )

◆ setTableElement()

RUNTIME_API ObjectInstance * Runtime::setTableElement ( TableInstance * table,
Uptr index,
ObjectInstance * newValue )

◆ shrinkMemory()

RUNTIME_API Iptr Runtime::shrinkMemory ( MemoryInstance * memory,
Uptr numPages )

◆ shrinkTable()

RUNTIME_API Iptr Runtime::shrinkTable ( TableInstance * table,
Uptr numElements )