Package-level declarations

Types

Link copied to clipboard
class BitOps
Link copied to clipboard

Represents the linear memory in the Wasm program. Can be shared reference b/w the host and the guest.

Link copied to clipboard

Represents the linear memory in the Wasm program. Can be shared reference b/w the host and the guest.

Link copied to clipboard
Link copied to clipboard
class CtrlFrame(val opCode: OpCode, val startValues: Int, val endValues: Int, val height: Int, val pc: Int = 0)
Link copied to clipboard
Link copied to clipboard
data class ExecutionBackendAvailability(val available: Boolean, val reason: String? = null)
Link copied to clipboard

Signals successful completion of execution (used by WASI proc_exit with code 0).

Link copied to clipboard
fun interface ExportFunction

This represents an Exported function from the Wasm module.

Link copied to clipboard
open class GlobalInstance(var valueLow: Long, var valueHigh: Long, val type: ValType, val mutabilityType: MutabilityType)
Link copied to clipboard

A HostFunction is an ExternalFunction that has been defined by the host.

Link copied to clipboard
Link copied to clipboard
open class ImportGlobal(module: String, name: String, instance: GlobalInstance) : ImportValue
Link copied to clipboard
open class ImportMemory(module: String, name: String, memory: Memory?) : ImportValue
Link copied to clipboard
open class ImportTable(module: String, name: String, table: TableInstance) : ImportValue
Link copied to clipboard
open class ImportTag(module: String, name: String, tag: TagInstance) : ImportValue
Link copied to clipboard
interface ImportValue

An external value is the runtime representation of an entity that can be imported. It is an address denoting either a function instance, table instance, memory instance, or global instances in the shared store.

Link copied to clipboard
Link copied to clipboard

A live WebAssembly instance.

Link copied to clipboard
interface Memory
Link copied to clipboard

Runtime feature checks for the host JavaScript WebAssembly implementation.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Native browser WebAssembly execution path for Kotlin/Wasm browser builds.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
@Target(allowedTargets = [AnnotationTarget.FUNCTION])
annotation class OpCodeIdentifier(val value: OpCode)
Link copied to clipboard
object OpcodeOps

Common opcode helper logic shared by constant evaluation and host import glue.

Link copied to clipboard

Execution surface used by host-backed engines selected through ExecutionBackend.

Link copied to clipboard

Portable, non-shared linear memory implementation for Kotlin targets without a specialized memory backend.

Link copied to clipboard

Supplies a platform binding for ExecutionBackend.PULLEY.

Link copied to clipboard
Link copied to clipboard
@Target(allowedTargets = [AnnotationTarget.FUNCTION])
expect annotation class RuntimeJvmStatic
Link copied to clipboard
class Store

The runtime storage for all function, global, memory, table instances.

Link copied to clipboard
open class TableInstance(table: Table, initialValue: Int)
Link copied to clipboard
open class TagInstance(tag: TagType)
Link copied to clipboard

Wasm spec: runtime trap during execution (unreachable, OOB access, null ref, etc.).

Link copied to clipboard

Runtime representation of a WasmGC array instance.

Link copied to clipboard
open class WasmException(instance: Instance, tagIdx: Int, args: LongArray) : RuntimeException
Link copied to clipboard
sealed interface WasmExecutionPolicy

Selects one complete WebAssembly execution strategy for an Instance.

Link copied to clipboard
class WasmExternRef(valueValue: Long) : WasmGcRef

Wrapper for externref values converted to anyref via any.convert_extern. Prevents GC ref ID collisions between extern values and native GC objects.

Link copied to clipboard
fun interface WasmFunctionHandle

Represents a function that can be called from Wasm.

Link copied to clipboard
fun interface WasmGcRef

Marker interface for WasmGC heap objects (structs and arrays).

Link copied to clipboard
class WasmI31Ref(value: Int) : WasmGcRef

Boxed representation of an i31ref value for storage in int-typed containers (tables, globals). On the stack, i31 values use an efficient tagged-long encoding (see uk.shusek.krwa.wasm.types.Value.encodeI31). This class is only used when i31 values need to pass through int-typed storage where the tag would be lost.

Link copied to clipboard

Thrown when the host interrupts a running Wasm execution.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
class WasmJsTag
Link copied to clipboard
data class WasmMemoryPolicy(val maxBytesPerMemory: Long = 256L * 1024L * 1024L, val maxTotalBytes: Long = 512L * 1024L * 1024L, val maxMemories: Int = 16)

Bounds every WebAssembly memory owned by one instance.

Link copied to clipboard

Engine-specific runtime error in compiled code paths (e.g., OOB memory access).

Link copied to clipboard
class WasmStruct(typeIdxValue: Int, fields: LongArray) : WasmGcRef

Runtime representation of a WasmGC struct instance. Fields are stored as raw long values (same encoding as stack values).

Link copied to clipboard
data class WasmtimeExecutionConfig(val target: String = WasmtimeAutomaticTarget, val precompiledModuleBytes: ByteArray? = null, val maxMemoryBytes: Long = DefaultWasmtimeMaxMemoryBytes, val maxWasmStackBytes: Long = DefaultWasmtimeMaxWasmStackBytes, val maxTableElements: Long = WasmtimeUnlimitedResourceLimit, val maxInstances: Long = DefaultWasmtimeCoreMaxInstances, val maxTables: Long = DefaultWasmtimeCoreMaxTables, val maxMemories: Long = DefaultWasmtimeCoreMaxMemories, val maxFuel: Long = WasmtimeUnlimitedResourceLimit)
Link copied to clipboard
Native Image registrations required by the JVM Wasmtime backend.
Link copied to clipboard
data class WasmtimePreview3ComponentConfig(val target: String = WasmtimeAutomaticTarget, val precompiledComponentBytes: ByteArray, val preopens: List<WasmtimePreview3Preopen>, val arguments: List<String> = emptyList(), val environment: Map<String, String> = emptyMap(), val networkPolicy: WasmtimePreview3NetworkPolicy = WasmtimePreview3NetworkPolicy(), val maxMemoryBytes: Long = DefaultWasmtimeMaxMemoryBytes, val executionTimeoutMillis: Long = 0, val maxWasmStackBytes: Long = DefaultWasmtimeMaxWasmStackBytes, val maxTableElements: Long = WasmtimeUnlimitedResourceLimit, val maxInstances: Long = WasmtimeUnlimitedResourceLimit, val maxTables: Long = WasmtimeUnlimitedResourceLimit, val maxMemories: Long = WasmtimeUnlimitedResourceLimit, val maxFuel: Long = WasmtimeUnlimitedResourceLimit)
Link copied to clipboard
class WasmtimePreview3ExecutionCancellation : <ERROR CLASS> ERROR CLASS: Symbol not found for AutoCloseable
Link copied to clipboard
data class WasmtimePreview3HttpEndpoint(val protocol: WasmtimePreview3HttpProtocol, val host: String, val port: Int)
Link copied to clipboard
data class WasmtimePreview3NetworkPolicy(val httpEndpoints: List<WasmtimePreview3HttpEndpoint> = emptyList())
Link copied to clipboard
data class WasmtimePreview3Preopen(val hostRoot: String, val guestRoot: String = "/", val writable: Boolean = true)

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Selects the safest supported Wasmtime target for the current platform.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Functions

Link copied to clipboard
fun WasmFunctionHandle.apply(instance: Instance, vararg args: Long): LongArray?
Link copied to clipboard

Validates and canonicalizes one exact ASCII DNS name, IPv4 literal, or IPv6 literal.

Link copied to clipboard
fun iosWasmtimeCompileModuleToCwasm(moduleBytes: ByteArray, target: String = WasmtimePulleyTarget, maxWasmStackBytes: Long = DefaultWasmtimeMaxWasmStackBytes): ByteArray
Link copied to clipboard
fun iosWasmtimeModuleCompilerIdentity(target: String = WasmtimePulleyTarget, maxWasmStackBytes: Long = DefaultWasmtimeMaxWasmStackBytes): String?
fun iosWasmtimeModuleCompilerUnavailableReason(target: String = WasmtimePulleyTarget, maxWasmStackBytes: Long = DefaultWasmtimeMaxWasmStackBytes): String?
Link copied to clipboard
Link copied to clipboard
fun Memory.readCString(addr: Int, charSet: Charset): String
Link copied to clipboard
fun Memory.readString(addr: Int, len: Int, charSet: Charset): String
expect fun wasmtimePreview3ComponentCallS32UnavailableReason(config: WasmtimePreview3ComponentConfig, exportName: String, argument: Int, expectedResult: Int): String?
actual fun wasmtimePreview3ComponentCallS32UnavailableReason(config: WasmtimePreview3ComponentConfig, exportName: String, argument: Int, expectedResult: Int): String?
actual fun wasmtimePreview3ComponentCallS32UnavailableReason(config: WasmtimePreview3ComponentConfig, exportName: String, argument: Int, expectedResult: Int): String?
actual fun wasmtimePreview3ComponentCallS32UnavailableReason(config: WasmtimePreview3ComponentConfig, exportName: String, argument: Int, expectedResult: Int): String?
Link copied to clipboard
Link copied to clipboard
fun Memory.writeCString(offset: Int, str: String, charSet: Charset)
Link copied to clipboard
fun Memory.writeString(offset: Int, data: String, charSet: Charset)