Class PanamaEngine
java.lang.Object
ai.tegmentum.wasmtime4j.panama.PanamaEngine
- All Implemented Interfaces:
ai.tegmentum.wasmtime4j.Engine,Closeable,AutoCloseable
Panama FFI implementation of WebAssembly Engine.
- Since:
- 1.0.0
-
Constructor Summary
ConstructorsConstructorDescriptionCreates a new Panama engine with default configuration.PanamaEngine(ai.tegmentum.wasmtime4j.config.EngineConfig config) Creates a new Panama engine with specified configuration.PanamaEngine(ai.tegmentum.wasmtime4j.config.EngineConfig config, ai.tegmentum.wasmtime4j.WasmRuntime runtime) Creates a new Panama engine with specified configuration and runtime reference. -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()ai.tegmentum.wasmtime4j.CodeBuilderai.tegmentum.wasmtime4j.ModulecompileFromFile(Path path) ai.tegmentum.wasmtime4j.ModulecompileFromStream(InputStream stream) ai.tegmentum.wasmtime4j.ModulecompileModule(byte[] wasmBytes) ai.tegmentum.wasmtime4j.ModulecompileModuleWithDwarf(byte[] wasmBytes, byte[] dwarfPackage) ai.tegmentum.wasmtime4j.ModulecompileWat(String wat) ai.tegmentum.wasmtime4j.debug.GuestProfilercreateComponentGuestProfiler(String componentName, Duration interval, ai.tegmentum.wasmtime4j.component.Component component, Map<String, ai.tegmentum.wasmtime4j.Module> extraModules) ai.tegmentum.wasmtime4j.debug.GuestProfilercreateGuestProfiler(String moduleName, Duration interval, Map<String, ai.tegmentum.wasmtime4j.Module> modules) ai.tegmentum.wasmtime4j.WasmMemorycreateSharedMemory(int initialPages, int maxPages) ai.tegmentum.wasmtime4j.Storeai.tegmentum.wasmtime4j.StorecreateStore(Object data) detectHostFeature(String feature) ai.tegmentum.wasmtime4j.PrecompileddetectPrecompiled(byte[] bytes) ai.tegmentum.wasmtime4j.config.EngineConfiglonggetId()Gets the unique identifier for this engine.Gets the native engine pointer.ai.tegmentum.wasmtime4j.pool.PoolStatisticsai.tegmentum.wasmtime4j.WasmRuntimelongvoidbooleanisAsync()booleanbooleanbooleanbooleanisPulley()booleanbooleanbooleanisValid()byte[]byte[]precompileComponent(byte[] wasmBytes) byte[]precompileModule(byte[] wasmBytes) booleansame(ai.tegmentum.wasmtime4j.Engine other) booleansupportsFeature(ai.tegmentum.wasmtime4j.WasmFeature feature) voidai.tegmentum.wasmtime4j.WeakEngineweak()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface ai.tegmentum.wasmtime4j.Engine
detectPrecompiledFile, detectWasmType
-
Constructor Details
-
PanamaEngine
public PanamaEngine() throws ai.tegmentum.wasmtime4j.exception.WasmExceptionCreates a new Panama engine with default configuration.This constructor is intended for unit tests. Production code should use
PanamaEngine(EngineConfig, WasmRuntime).- Throws:
ai.tegmentum.wasmtime4j.exception.WasmException- if engine creation fails
-
PanamaEngine
public PanamaEngine(ai.tegmentum.wasmtime4j.config.EngineConfig config) throws ai.tegmentum.wasmtime4j.exception.WasmException Creates a new Panama engine with specified configuration.This constructor is intended for unit tests. Production code should use
PanamaEngine(EngineConfig, WasmRuntime).- Parameters:
config- the engine configuration- Throws:
ai.tegmentum.wasmtime4j.exception.WasmException- if engine creation fails
-
PanamaEngine
public PanamaEngine(ai.tegmentum.wasmtime4j.config.EngineConfig config, ai.tegmentum.wasmtime4j.WasmRuntime runtime) throws ai.tegmentum.wasmtime4j.exception.WasmException Creates a new Panama engine with specified configuration and runtime reference.- Parameters:
config- the engine configurationruntime- the runtime that owns this engine- Throws:
ai.tegmentum.wasmtime4j.exception.WasmException- if engine creation fails
-
-
Method Details
-
createStore
public ai.tegmentum.wasmtime4j.Store createStore() throws ai.tegmentum.wasmtime4j.exception.WasmException- Specified by:
createStorein interfaceai.tegmentum.wasmtime4j.Engine- Throws:
ai.tegmentum.wasmtime4j.exception.WasmException
-
createStore
public ai.tegmentum.wasmtime4j.Store createStore(Object data) throws ai.tegmentum.wasmtime4j.exception.WasmException - Specified by:
createStorein interfaceai.tegmentum.wasmtime4j.Engine- Throws:
ai.tegmentum.wasmtime4j.exception.WasmException
-
getRuntime
public ai.tegmentum.wasmtime4j.WasmRuntime getRuntime()- Specified by:
getRuntimein interfaceai.tegmentum.wasmtime4j.Engine
-
compileModule
public ai.tegmentum.wasmtime4j.Module compileModule(byte[] wasmBytes) throws ai.tegmentum.wasmtime4j.exception.WasmException - Specified by:
compileModulein interfaceai.tegmentum.wasmtime4j.Engine- Throws:
ai.tegmentum.wasmtime4j.exception.WasmException
-
compileModuleWithDwarf
public ai.tegmentum.wasmtime4j.Module compileModuleWithDwarf(byte[] wasmBytes, byte[] dwarfPackage) throws ai.tegmentum.wasmtime4j.exception.WasmException - Specified by:
compileModuleWithDwarfin interfaceai.tegmentum.wasmtime4j.Engine- Throws:
ai.tegmentum.wasmtime4j.exception.WasmException
-
compileWat
public ai.tegmentum.wasmtime4j.Module compileWat(String wat) throws ai.tegmentum.wasmtime4j.exception.WasmException - Specified by:
compileWatin interfaceai.tegmentum.wasmtime4j.Engine- Throws:
ai.tegmentum.wasmtime4j.exception.WasmException
-
precompileModule
public byte[] precompileModule(byte[] wasmBytes) throws ai.tegmentum.wasmtime4j.exception.WasmException - Specified by:
precompileModulein interfaceai.tegmentum.wasmtime4j.Engine- Throws:
ai.tegmentum.wasmtime4j.exception.WasmException
-
codeBuilder
public ai.tegmentum.wasmtime4j.CodeBuilder codeBuilder() throws ai.tegmentum.wasmtime4j.exception.WasmException- Specified by:
codeBuilderin interfaceai.tegmentum.wasmtime4j.Engine- Throws:
ai.tegmentum.wasmtime4j.exception.WasmException
-
precompileComponent
public byte[] precompileComponent(byte[] wasmBytes) throws ai.tegmentum.wasmtime4j.exception.WasmException - Specified by:
precompileComponentin interfaceai.tegmentum.wasmtime4j.Engine- Throws:
ai.tegmentum.wasmtime4j.exception.WasmException
-
getPoolingAllocatorMetrics
public ai.tegmentum.wasmtime4j.pool.PoolStatistics getPoolingAllocatorMetrics()- Specified by:
getPoolingAllocatorMetricsin interfaceai.tegmentum.wasmtime4j.Engine
-
compileFromStream
public ai.tegmentum.wasmtime4j.Module compileFromStream(InputStream stream) throws ai.tegmentum.wasmtime4j.exception.WasmException, IOException - Specified by:
compileFromStreamin interfaceai.tegmentum.wasmtime4j.Engine- Throws:
ai.tegmentum.wasmtime4j.exception.WasmExceptionIOException
-
compileFromFile
public ai.tegmentum.wasmtime4j.Module compileFromFile(Path path) throws ai.tegmentum.wasmtime4j.exception.WasmException - Specified by:
compileFromFilein interfaceai.tegmentum.wasmtime4j.Engine- Throws:
ai.tegmentum.wasmtime4j.exception.WasmException
-
getConfig
public ai.tegmentum.wasmtime4j.config.EngineConfig getConfig()- Specified by:
getConfigin interfaceai.tegmentum.wasmtime4j.Engine
-
isValid
public boolean isValid()- Specified by:
isValidin interfaceai.tegmentum.wasmtime4j.Engine
-
supportsFeature
public boolean supportsFeature(ai.tegmentum.wasmtime4j.WasmFeature feature) - Specified by:
supportsFeaturein interfaceai.tegmentum.wasmtime4j.Engine
-
detectHostFeature
-
getStackSizeLimit
public long getStackSizeLimit()- Specified by:
getStackSizeLimitin interfaceai.tegmentum.wasmtime4j.Engine
-
isFuelEnabled
public boolean isFuelEnabled()- Specified by:
isFuelEnabledin interfaceai.tegmentum.wasmtime4j.Engine
-
isEpochInterruptionEnabled
public boolean isEpochInterruptionEnabled()- Specified by:
isEpochInterruptionEnabledin interfaceai.tegmentum.wasmtime4j.Engine
-
isCoredumpOnTrapEnabled
public boolean isCoredumpOnTrapEnabled()- Specified by:
isCoredumpOnTrapEnabledin interfaceai.tegmentum.wasmtime4j.Engine
-
incrementEpoch
public void incrementEpoch()- Specified by:
incrementEpochin interfaceai.tegmentum.wasmtime4j.Engine
-
unloadProcessHandlers
public void unloadProcessHandlers() throws ai.tegmentum.wasmtime4j.exception.WasmException- Specified by:
unloadProcessHandlersin interfaceai.tegmentum.wasmtime4j.Engine- Throws:
ai.tegmentum.wasmtime4j.exception.WasmException
-
close
public void close()- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Specified by:
closein interfaceai.tegmentum.wasmtime4j.Engine
-
getNativeEngine
Gets the native engine pointer.- Returns:
- native engine memory segment
- Throws:
IllegalStateException- if the engine has been closed
-
getId
public long getId()Gets the unique identifier for this engine.- Returns:
- the engine ID
-
isPulley
public boolean isPulley()- Specified by:
isPulleyin interfaceai.tegmentum.wasmtime4j.Engine
-
precompileCompatibilityHash
public byte[] precompileCompatibilityHash()- Specified by:
precompileCompatibilityHashin interfaceai.tegmentum.wasmtime4j.Engine
-
detectPrecompiled
public ai.tegmentum.wasmtime4j.Precompiled detectPrecompiled(byte[] bytes) - Specified by:
detectPrecompiledin interfaceai.tegmentum.wasmtime4j.Engine
-
same
public boolean same(ai.tegmentum.wasmtime4j.Engine other) - Specified by:
samein interfaceai.tegmentum.wasmtime4j.Engine
-
isAsync
public boolean isAsync()- Specified by:
isAsyncin interfaceai.tegmentum.wasmtime4j.Engine
-
isRecording
public boolean isRecording()- Specified by:
isRecordingin interfaceai.tegmentum.wasmtime4j.Engine
-
isReplaying
public boolean isReplaying()- Specified by:
isReplayingin interfaceai.tegmentum.wasmtime4j.Engine
-
createGuestProfiler
public ai.tegmentum.wasmtime4j.debug.GuestProfiler createGuestProfiler(String moduleName, Duration interval, Map<String, ai.tegmentum.wasmtime4j.Module> modules) throws ai.tegmentum.wasmtime4j.exception.WasmException- Specified by:
createGuestProfilerin interfaceai.tegmentum.wasmtime4j.Engine- Throws:
ai.tegmentum.wasmtime4j.exception.WasmException
-
createComponentGuestProfiler
public ai.tegmentum.wasmtime4j.debug.GuestProfiler createComponentGuestProfiler(String componentName, Duration interval, ai.tegmentum.wasmtime4j.component.Component component, Map<String, ai.tegmentum.wasmtime4j.Module> extraModules) throws ai.tegmentum.wasmtime4j.exception.WasmException- Specified by:
createComponentGuestProfilerin interfaceai.tegmentum.wasmtime4j.Engine- Throws:
ai.tegmentum.wasmtime4j.exception.WasmException
-
weak
public ai.tegmentum.wasmtime4j.WeakEngine weak()- Specified by:
weakin interfaceai.tegmentum.wasmtime4j.Engine
-