Class Store

java.lang.Object
com.dylibso.chicory.runtime.Store

public class Store extends Object
The runtime storage for all function, global, memory, table instances.
  • Constructor Details

    • Store

      public Store()
  • Method Details

    • addFunction

      public Store addFunction(ImportFunction... function)
      Add a function to the store.
    • addGlobal

      public Store addGlobal(ImportGlobal... global)
      Add a global to the store.
    • addMemory

      public Store addMemory(ImportMemory... memory)
      Add a memory to the store.
    • addTable

      public Store addTable(ImportTable... table)
      Add a table to the store.
    • addTag

      public Store addTag(ImportTag... tag)
      Add a tag to the store.
    • addImportValues

      public Store addImportValues(ImportValues importValues)
      Add the contents of a ImportValues instance to the store.
    • toImportValues

      public ImportValues toImportValues()
      Convert the contents of a store to a ImportValues instance.
    • register

      public Store register(String name, Instance instance)
      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

      public Instance instantiate(String name, WasmModule m)
      A shorthand for instantiating a module and registering it in the store.
    • instantiate

      public Instance instantiate(String name, Function<ImportValues,Instance> instanceFactory)
      Creates an instance with the given factory and registers the result in the store.