Package com.dylibso.chicory.runtime
Class Store
java.lang.Object
com.dylibso.chicory.runtime.Store
The runtime storage for all function, global, memory, table instances.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddFunction(ImportFunction... function) Add a function to the store.addGlobal(ImportGlobal... global) Add a global to the store.addImportValues(ImportValues importValues) Add the contents of aImportValuesinstance to the store.addMemory(ImportMemory... memory) Add a memory to the store.addTable(ImportTable... table) Add a table to the store.Add a tag to the store.instantiate(String name, WasmModule m) A shorthand for instantiating a module and registering it in the store.instantiate(String name, Function<ImportValues, Instance> instanceFactory) Creates an instance with the given factory and registers the result in the store.Register an instance in the store with the given name.Convert the contents of a store to aImportValuesinstance.
-
Constructor Details
-
Store
public Store()
-
-
Method Details
-
addFunction
Add a function to the store. -
addGlobal
Add a global to the store. -
addMemory
Add a memory to the store. -
addTable
Add a table to the store. -
addTag
Add a tag to the store. -
addImportValues
Add the contents of aImportValuesinstance to the store. -
toImportValues
Convert the contents of a store to aImportValuesinstance. -
register
Register an instance in the store with the given name. All the exported functions, globals, memories, and tables are added to the store with the given name. For instance, if a module named "myModule" exports a function named "myFunction", the function will be added to the store with the name "myFunction.myModule". -
instantiate
A shorthand for instantiating a module and registering it in the store. -
instantiate
Creates an instance with the given factory and registers the result in the store.
-