abla/runtime/self

Generated from source.

Import with import "abla/runtime/self".

Source: abla/runtime/self/entry.ab

__ablaRuntimeUseBulkObjectZero (fun)

@inline
trusted fun __ablaRuntimeUseBulkObjectZero(): bool

Portable bootstrap/interpreter fallback. The LLVM emitter folds this reserved runtime hook per target/profile before building the module.

ablaRuntimeStoreI32 (extern)

trusted noescape extern:"intrinsic" fun ablaRuntimeStoreI32(
    address: int,
    value: int
): void

Stores the low 32 bits of a value at a writable native address.

ablaRuntimeStoreI64 (extern)

trusted noescape extern:"intrinsic" fun ablaRuntimeStoreI64(
    address: int,
    value: int
): void

Stores a 64-bit word at a writable native address.

ablaRuntimeLoadU8 (extern)

trusted noescape extern:"intrinsic" fun ablaRuntimeLoadU8(address: int): int

Returns the unsigned byte at a readable native address.

ablaRuntimeLoadSlotI32 (fun)

@inline
trusted fun ablaRuntimeLoadSlotI32(address: int): int

A declared field's slot, read and written only by the typed field accessors below (and through them only). The backend tags the access inside each of these as a field slot's, which no abla/unsafe load or store reaches (bootstrapLlvmTagAccess), so a column's raw stores don't make LLVM reload the fields it read. They stay functions, not intrinsics, so a compiler that doesn't know them still builds this runtime.

ablaRuntimeLoadSlotI64 (fun)

@inline
trusted fun ablaRuntimeLoadSlotI64(address: int): int

Returns the 64-bit word stored in a valid typed field slot.

ablaRuntimeStoreSlotI32 (fun)

@inline
trusted fun ablaRuntimeStoreSlotI32(address: int, value: int): void

Stores the low 32 bits in a valid writable typed field slot.

ablaRuntimeStoreSlotI64 (fun)

@inline
trusted fun ablaRuntimeStoreSlotI64(address: int, value: int): void

Stores a 64-bit word in a valid writable typed field slot.

ablaRuntimeLoadSlotU8 (fun)

@inline
trusted fun ablaRuntimeLoadSlotU8(address: int): int

Returns the unsigned byte stored in a valid typed field slot.

ablaRuntimeStoreSlotU8 (fun)

@inline
trusted fun ablaRuntimeStoreSlotU8(address: int, value: int): void

Stores the low eight bits in a valid writable typed field slot.

ablaRuntimeFence (extern)

trusted noescape extern:"intrinsic" fun ablaRuntimeFence(): void

A sequentially consistent fence (orders a rope's flat copy with its children across threads).

ablaRuntimeAtomicLoadI64 (extern)

trusted noescape extern:"intrinsic" fun ablaRuntimeAtomicLoadI64(address: int): int

The transactional memory's atomics on 64-bit words: an acquire load, a release store, and a sequentially consistent compare-and-swap (returning the word seen) and fetch-add (returning the word before); acquire and release fences.

ablaRuntimeAtomicStoreI64 (extern)

trusted noescape extern:"intrinsic" fun ablaRuntimeAtomicStoreI64(
    address: int,
    value: int
): void

Stores a 64-bit word atomically with release ordering at a valid aligned address.

ablaRuntimeAtomicCompareExchangeI64 (extern)

trusted noescape extern:"intrinsic" fun ablaRuntimeAtomicCompareExchangeI64(
    address: int,
    expected: int,
    replacement: int
): int

Returns the observed word and atomically stores the replacement if that word matches the expected value.

ablaRuntimeAtomicFetchAddI64 (extern)

trusted noescape extern:"intrinsic" fun ablaRuntimeAtomicFetchAddI64(
    address: int,
    delta: int
): int

Atomically adds the delta and returns the previous 64-bit word.

ablaRuntimeFenceAcquire (extern)

trusted noescape extern:"intrinsic" fun ablaRuntimeFenceAcquire(): void

Applies an acquire memory ordering fence.

ablaRuntimeFenceRelease (extern)

trusted noescape extern:"intrinsic" fun ablaRuntimeFenceRelease(): void

Applies a release memory ordering fence.

ablaRuntimeStoreU8 (extern)

trusted noescape extern:"intrinsic" fun ablaRuntimeStoreU8(
    address: int,
    value: int
): void

Stores the low eight bits at a writable native address.

ablaRuntimePointerAddress (extern)

trusted noescape extern:"intrinsic" fun ablaRuntimePointerAddress(
    pointer: i64*
): int

Returns a native pointer represented as an integer address.

ablaRuntimePointerFromAddress (extern)

trusted noescape extern:"intrinsic" fun ablaRuntimePointerFromAddress(
    address: int
): i64*

Returns the native pointer representation of the supplied integer without dereferencing it.

__ablaRuntimeAllocate (fun)

@inline
trusted fun __ablaRuntimeAllocate(size: int): int

Returns the address allocated by the platform runtime for the requested size.

__ablaRuntimeAllocateLayout (fun)

@inline
trusted fun __ablaRuntimeAllocateLayout(size: int, layout: int): int

Returns the address of a runtime allocation tagged with its collector layout.

__ablaRuntimeFree (fun)

trusted fun __ablaRuntimeFree(address: int): void

Releases the allocation at a valid runtime-owned address.

abla_llvm_call_indirect (extern)

trusted noescape extern:"c" fun abla_llvm_call_indirect(
    output: i64*,
    closure: i64*,
    arguments: i64*,
    count: int
): void

These dispatchers are generated in the same LLVM module. Declaring their C ABI here lets ordinary Abla runtime code invoke a closure without embedding closure semantics in the backend or a C runtime.

abla_llvm_release_closure (extern)

trusted noescape extern:"c" fun abla_llvm_release_closure(
    closure: i64*
): void

Releases the capture storage for a closure using the generated runtime dispatcher.

abla_llvm_call_dispatch (extern)

trusted noescape extern:"c" fun abla_llvm_call_dispatch(
    dispatch: i64*,
    output: i64*,
    closure: i64*,
    arguments: i64*,
    count: int
): void

Calls dispatch, a dispatcher of abla_llvm_call_indirect's signature (a generator's own step entry), with the rest.

abla_llvm_drop_closure (extern)

trusted noescape extern:"c" fun abla_llvm_drop_closure(
    closure: i64*
): void

Drops a closure through the destructor dispatch generated by the compiler.

__ablaRuntimeValueAt (fun)

@inline
trusted fun __ablaRuntimeValueAt(address: int): any

Returns a boxed value copied from a readable runtime value slot.

__ablaRuntimeCopyValue (fun)

trusted fun __ablaRuntimeCopyValue(value: any, destination: int): void

Copies the boxed representation into a writable runtime value slot.

__ablaRuntimeWord1 (fun)

@inline
trusted fun __ablaRuntimeWord1(value: any): int

Returns the second payload word of a boxed value.

__ablaRuntimeAuxiliary (fun)

@inline
trusted fun __ablaRuntimeAuxiliary(value: any): int

Returns the auxiliary header word of a boxed value.

__ablaRuntimeStringStatic (fun)

@inline
trusted fun __ablaRuntimeStringStatic(data: int, length: int): any

Returns a string value backed by the supplied live storage, trapping for a null address with nonzero length.

__ablaRuntimeVectorBox (fun)

trusted fun __ablaRuntimeVectorBox(size: int): any

A boxed vector: a string of its bytes, which the backend writes (docs/simd.md).

__ablaRuntimeFunction (fun)

trusted fun __ablaRuntimeFunction(function: int): any

Returns a function value with the supplied identifier and empty captures.

__ablaRuntimeClosure (fun)

trusted fun __ablaRuntimeClosure(
    function: int,
    captures: int,
    count: int
): any

Returns a closure with copied capture slots, trapping for a negative capture count.

__ablaRuntimeAsFunction (fun)

trusted fun __ablaRuntimeAsFunction(value: any): int

Returns the function identifier and traps if the boxed value has another tag.

ablaRuntimeFunctionId (fun)

trusted fun ablaRuntimeFunctionId(value: any): int

A function value's id: the function it calls, as the compiler numbers functions (0 for a value that isn't a function). Unlike the value's words it exposes no memory, so any code may call it.

__ablaRuntimeFunctionCaptureCount (fun)

trusted fun __ablaRuntimeFunctionCaptureCount(value: any): int

Returns the number of captures and traps if the boxed value is not a function.

__ablaRuntimeFunctionCapturePointer (fun)

trusted fun __ablaRuntimeFunctionCapturePointer(value: any): int

Returns the address of the function's capture storage and traps for a non-function value.

__ablaRuntimeFunctionCapture (fun)

trusted fun __ablaRuntimeFunctionCapture(value: any, index: int): any

Returns the indexed captured value and traps for a non-function or out-of-range index.

__ablaRuntimeClosureRelease (fun)

trusted fun __ablaRuntimeClosureRelease(value: any): int

A closure that does not escape its frame keeps its captures there, after a header whose last word, the one before them, is -1 (the backend's frame closures); a heap block has its layout in that word. Only the heap's are freed.

__ablaRuntimeCellCreate (fun)

trusted fun __ablaRuntimeCellCreate(value: any): any

Returns a boxed mutable cell initialized with a copy of the value.

__ablaRuntimeCellAddress (fun)

trusted fun __ablaRuntimeCellAddress(value: any): int

Returns the address of the cell's value slot and traps for a non-cell value.

__ablaRuntimeCellGet (fun)

trusted fun __ablaRuntimeCellGet(value: any): any

Returns the value currently stored in the supplied cell.

__ablaRuntimeCellSet (fun)

trusted fun __ablaRuntimeCellSet(cell: any, value: any): any

Stores and returns the value, trapping when the first argument is not a cell.

__ablaRuntimeMapPart (fun)

@inline
trusted fun __ablaRuntimeMapPart(map: any, part: int): any

Map<K, V> (K string or int) is an ordinary array the collector already traces: [keys, values, slots, live count]. Entries keep insertion order in keys/values; a removed entry's key becomes null. slots (a dense int array holding two 32-bit slots to an element; a power of two of them, at most half used) holds entry index + 1 per occupied slot, under bits of the hash's upper half, so most other keys in the way aren't read; slots are found by linear probing from the key's hash.

__ablaRuntimeMapEmpty (fun)

trusted fun __ablaRuntimeMapEmpty(capacity: int): any

Returns a fresh empty map with initial storage sized from the requested capacity.

__ablaRuntimeMapCreate (fun)

trusted fun __ablaRuntimeMapCreate(): any

Returns a fresh empty map with default initial storage.

__ablaRuntimeMapHash (fun)

@inline
trusted fun __ablaRuntimeMapHash(key: any): int

FNV-1a over a string's bytes; an int (or bool) through splitmix64's finalizer.

__ablaRuntimeMapKeyEqual (fun)

@inline
trusted fun __ablaRuntimeMapKeyEqual(left: any, right: any): bool

Returns whether two supported map keys compare equal.

__ablaRuntimeMapSlotBase (fun)

@inline
trusted fun __ablaRuntimeMapSlotBase(slots: any): int

Slots are 32-bit words, two to an i64 element: 0 is free, else entry + 1 in the bits of the mask and the hash's upper bits above them.

__ablaRuntimeMapEntryKeyEqual (fun)

@inline
trusted fun __ablaRuntimeMapEntryKeyEqual(array: int, index: int, key: any, tag: int): bool

Whether the key array's element index (an entry's key, in bounds) equals key, whose tag is tag: read in place, whether the array is boxed or dense. Map keys are strings or ints, so a dense key array is the int kind (kind + 1 == tag 2).

__ablaRuntimeMapEntry (fun)

trusted fun __ablaRuntimeMapEntry(map: any, key: any): int

The entry index of key, or -1.

__ablaRuntimeMapEntryHashed (fun)

@inline
trusted fun __ablaRuntimeMapEntryHashed(map: any, key: any, hash: int): int

hash is the key's __ablaRuntimeMapHash.

__ablaRuntimeMapPlace (fun)

trusted fun __ablaRuntimeMapPlace(slots: any, hash: int, entry: int): int

Points the first free slot for a key of hash hash at entry entry.

__ablaRuntimeMapRehash (fun)

trusted fun __ablaRuntimeMapRehash(map: any, extra: int): int

Rebuilds the map from its live entries with room for extra more.

__ablaRuntimeMapGet (fun)

@inline
trusted fun __ablaRuntimeMapGet(map: any, key: any): any

Returns the stored value for the key or a boxed null if it is absent.

__ablaRuntimeMapHas (fun)

trusted fun __ablaRuntimeMapHas(map: any, key: any): any

Returns a boxed boolean indicating whether the map contains the key.

__ablaRuntimeMapAppend (fun)

@inline
trusted fun __ablaRuntimeMapAppend(value: any, element: any): void

ArrayAppend's in-place case inline, for a map's entry arrays.

__ablaRuntimeMapStore (fun)

@inline
trusted fun __ablaRuntimeMapStore(value: any, index: int, element: any): void

ArraySet's in-place case inline, for an entry (in bounds) of a map's value array.

__ablaRuntimeMapBumpLive (fun)

@inline
trusted fun __ablaRuntimeMapBumpLive(map: any, delta: int): void

The live count is element 3 of the map array (a boxed int, always there): change it in place instead of reading it back and storing a new boxed int through ArraySet.

__ablaRuntimeMapSet (fun)

trusted fun __ablaRuntimeMapSet(map: any, key: any, value: any): any

Inserts or replaces the value for a key and returns boxed void.

__ablaRuntimeMapRemove (fun)

trusted fun __ablaRuntimeMapRemove(map: any, key: any): any

Removes the entry and returns a boxed boolean indicating whether the key was present.

__ablaRuntimeMapTake (fun)

trusted fun __ablaRuntimeMapTake(map: any, key: any): any

Removes key's entry and returns its value (null when there is none).

__ablaRuntimeMapSize (fun)

trusted fun __ablaRuntimeMapSize(map: any): any

Returns the map's live entry count as a boxed integer.

__ablaRuntimeMapEntries (fun)

trusted fun __ablaRuntimeMapEntries(map: any, part: int): any

The live keys (part 0) or values (part 1), in insertion order.

__ablaRuntimeMapKeys (fun)

trusted fun __ablaRuntimeMapKeys(map: any): any

Returns an array of live keys in insertion order.

__ablaRuntimeMapValues (fun)

trusted fun __ablaRuntimeMapValues(map: any): any

Returns an array of live values in insertion order.

__ablaRuntimeMapClear (fun)

trusted fun __ablaRuntimeMapClear(map: any): any

Clears every map entry and returns boxed void.

__ablaRuntimeSharedPayloadMutex (fun)

@inline
trusted fun __ablaRuntimeSharedPayloadMutex(): int

Shared/Weak control blocks are ordinary Abla-owned memory. Two platform mutexes keep reference counts and user mutation independent: the platform supplies scheduling primitives, while ownership semantics remain here. Shared/Weak/Mutex control block: strong count (0), weak count (8), payload value (16..40), count mutex (48), payload mutex (48 + one mutex slot). The slots were a fixed 40 bytes, Linux's pthread_mutex_t; Darwin's is 64, so the two mutexes overlapped and the second ran past the block. Functions, not globals: runtime code can run before global initialization.

__ablaRuntimeSharedControlBytes (fun)

@inline
trusted fun __ablaRuntimeSharedControlBytes(): int

Returns the size of the shared ownership control block in bytes.

__ablaRuntimeSharedControl (fun)

trusted fun __ablaRuntimeSharedControl(value: any, tag: int): int

Returns the reference-counted control address or traps if the runtime tag does not match.

__ablaRuntimeSharedCountLock (fun)

trusted fun __ablaRuntimeSharedCountLock(control: int): void

Locks the reference counts in a valid shared control block.

__ablaRuntimeSharedCountUnlock (fun)

trusted fun __ablaRuntimeSharedCountUnlock(control: int): void

Unlocks the reference counts in a valid shared control block.

__ablaRuntimeSharedCreate (fun)

trusted fun __ablaRuntimeSharedCreate(value: any): any

Returns a new strong shared reference with an initialized control block and payload.

__ablaRuntimeSharedClone (fun)

trusted fun __ablaRuntimeSharedClone(value: any): any

Returns another strong reference and traps if the count is invalid or would overflow.

__ablaRuntimeSharedGet (fun)

trusted fun __ablaRuntimeSharedGet(value: any): any

Returns the current payload of a strong shared reference.

__ablaRuntimeSharedLock (fun)

trusted fun __ablaRuntimeSharedLock(value: any): any

Locks the strong shared reference's payload and returns the current value.

__ablaRuntimeSharedUnlock (fun)

trusted fun __ablaRuntimeSharedUnlock(value: any): int

Releases the lock on a valid shared payload and returns zero.

__ablaRuntimeSharedRelease (fun)

trusted fun __ablaRuntimeSharedRelease(value: any): any

Drops one strong reference and returns the payload only when the last strong reference is released, or boxed null otherwise.

__ablaRuntimeWeakCreate (fun)

trusted fun __ablaRuntimeWeakCreate(value: any): any

Returns a weak handle to a strong reference and traps on a count overflow.

__ablaRuntimeWeakClone (fun)

trusted fun __ablaRuntimeWeakClone(value: any): any

Retains and returns a weak handle, trapping if its count is invalid or would overflow.

__ablaRuntimeWeakUpgrade (fun)

trusted fun __ablaRuntimeWeakUpgrade(value: any): any

Returns a retained strong handle, or null once the payload is gone, and traps on a strong-count overflow.

__ablaRuntimeWeakAlive (fun)

trusted fun __ablaRuntimeWeakAlive(value: any): any

Returns a boxed boolean indicating whether the weak handle still has a live payload.

__ablaRuntimeWeakRelease (fun)

trusted fun __ablaRuntimeWeakRelease(value: any): any

Releases a weak handle and returns boxed null, freeing the control block when the final weak handle is released.

__ablaRuntimeCurrentGenerator (var)

var __ablaRuntimeCurrentGenerator: int

Holds the active generator control address or zero outside a generator step.

__ablaRuntimeDispatchClosure (fun)

trusted fun __ablaRuntimeDispatchClosure(
    closure: int,
    output: int
): void

Calls the closure without arguments and writes its boxed result to the output address.

__ablaRuntimeReleaseClosure (fun)

trusted fun __ablaRuntimeReleaseClosure(closure: int): void

Releases captured values owned by the closure at the given address.

__ablaRuntimeDropClosure (fun)

trusted fun __ablaRuntimeDropClosure(closure: int): void

Runs the generated drop operation for the closure at the given address.

__ablaRuntimeGeneratorCreate (fun)

trusted fun __ablaRuntimeGeneratorCreate(
    closure: any,
    dispatch: int,
    release: int,
    drop: int
): any

A generator's control block (four value slots, two words): its step function, the value it last yielded, the step's argument and result, then its status (0 suspended, 1 finished, 2 running) and the dispatcher that runs its step, in words the collector skips. The step function runs to the next yield (true) or the end (false); given true it closes the generator instead, running pending defers and dropping what the generator holds.

__ablaRuntimeGeneratorStep (fun)

trusted fun __ablaRuntimeGeneratorStep(control: int, closing: bool): bool

Runs a generator step, restores the previous current generator and returns whether the generator can continue.

__ablaRuntimeGeneratorNext (fun)

trusted fun __ablaRuntimeGeneratorNext(handle: any): any

Returns whether the generator yielded another value and traps on reentrant iteration.

__ablaRuntimeGeneratorValue (fun)

trusted fun __ablaRuntimeGeneratorValue(handle: any): any

Returns the generator's most recently yielded value.

__ablaRuntimeGeneratorYield (fun)

trusted fun __ablaRuntimeGeneratorYield(value: any): any

Stores the yielded value and returns boxed true, trapping if no generator is running.

__ablaRuntimeGeneratorClose (fun)

trusted fun __ablaRuntimeGeneratorClose(handle: any): any

Closes a pending generator and returns boxed void, trapping if the generator is already running.

__ablaRuntimeGeneratorDrop (fun)

trusted fun __ablaRuntimeGeneratorDrop(handle: any): any

Closes a generator, frees its control block and returns boxed void.

__ablaRuntimeTaskCreate (fun)

trusted fun __ablaRuntimeTaskCreate(
    closure: any,
    dispatch: int,
    release: int,
    drop: int
): any

Returns a task handle for a closure whose result will be computed when awaited.

__ablaRuntimeTaskDrop (fun)

trusted fun __ablaRuntimeTaskDrop(handle: any): any

Drops the unrun task's closure, frees its control block and returns boxed void.

__ablaRuntimeThreadEndHook (var)

var __ablaRuntimeThreadEndHook: int

A function the runtime calls (no arguments) as the very last thing a thread of the program does: the owner of other per-thread storage the runtime does not know (abla/runtime/emutls: the emulated thread-locals of the compiler's own image and of the programs it JIT-compiles) frees it there. 0: none. Set once, before the threads it concerns.

__ablaRuntimeThreadEntry (fun)

trusted fun __ablaRuntimeThreadEntry(control: int): int

Runs the thread closure, records its result, releases thread resources and returns zero.

__ablaRuntimeSetThreadEndHook (fun)

trusted fun __ablaRuntimeSetThreadEndHook(address: int): void

Installs the callback address run when a thread ends, or clears it with zero.

__ablaRuntimeThreadCreate (fun)

trusted fun __ablaRuntimeThreadCreate(
    closure: any,
    dispatch: int,
    release: int,
    drop: int,
    entry: int
): any

Starts the thread and returns its handle, panicking if the platform cannot start it.

__ablaRuntimeThreadJoin (fun)

trusted fun __ablaRuntimeThreadJoin(control: int): void

Waits for the thread once and traps if the platform join fails.

__ablaRuntimeThreadDrop (fun)

trusted fun __ablaRuntimeThreadDrop(handle: any): any

Joins the thread, frees its control block and returns boxed void.

__ablaRuntimeAwait (fun)

trusted fun __ablaRuntimeAwait(operation: any): any

Returns a task or thread result and consumes the operation handle, trapping for any other value.

__ablaRuntimeNegate (fun)

trusted fun __ablaRuntimeNegate(value: any): any

Returns the boxed integer's additive inverse with signed 64-bit wrapping.

__ablaRuntimeNot (fun)

trusted fun __ablaRuntimeNot(value: any): any

Returns the logical negation of a boxed boolean.

__ablaRuntimeAdd (fun)

trusted fun __ablaRuntimeAdd(left: any, right: any): any

Returns the boxed sum of two integers with signed 64-bit wrapping.

__ablaRuntimeSubtract (fun)

trusted fun __ablaRuntimeSubtract(left: any, right: any): any

Returns the boxed difference of two integers with signed 64-bit wrapping.

__ablaRuntimeMultiply (fun)

trusted fun __ablaRuntimeMultiply(left: any, right: any): any

Returns the boxed product of two integers with signed 64-bit wrapping.

__ablaRuntimeDivide (fun)

trusted fun __ablaRuntimeDivide(left: any, right: any): any

The scalar / and % below panic on a zero divisor and wrap MIN / -1.

__ablaRuntimeRemainder (fun)

trusted fun __ablaRuntimeRemainder(left: any, right: any): any

Returns the boxed signed remainder, trapping for noninteger operands and panicking for a zero divisor.

__ablaRuntimePanic (fun)

@noinline
trusted fun __ablaRuntimePanic(message: string): never

Ends the program with a runtime panic (see __ablaRuntimePlatformPanic). The panics below take only integers and never return (cold and noreturn in LLVM), so a check inlined at an access adds its compare and branch and a call, never the message's formatting.

__ablaRuntimePanicArrayIndex (fun)

@noinline
trusted fun __ablaRuntimePanicArrayIndex(index: int, size: int): never

The panics of an index outside an array or a string. The messages are the ones compile-time evaluation reports.

__ablaRuntimePanicStringIndex (fun)

@noinline
trusted fun __ablaRuntimePanicStringIndex(index: int, size: int): never

Panics with the index and byte length of the string that was indexed out of bounds.

__ablaRuntimeBitNot (fun)

trusted fun __ablaRuntimeBitNot(value: any): any

Returns the boxed integer with each bit inverted.

__ablaRuntimeBitAnd (fun)

trusted fun __ablaRuntimeBitAnd(left: any, right: any): any

Returns the boxed bitwise AND of two integers.

__ablaRuntimeBitOr (fun)

trusted fun __ablaRuntimeBitOr(left: any, right: any): any

Returns the boxed bitwise OR of two integers.

__ablaRuntimeBitXor (fun)

trusted fun __ablaRuntimeBitXor(left: any, right: any): any

Returns the boxed bitwise exclusive OR of two integers.

__ablaRuntimeBitShiftLeft (fun)

trusted fun __ablaRuntimeBitShiftLeft(left: any, right: any): any

Returns the boxed integer shifted left by the boxed count.

__ablaRuntimeBitShiftRight (fun)

trusted fun __ablaRuntimeBitShiftRight(left: any, right: any): any

Returns the boxed integer shifted right with sign extension.

__ablaRuntimeBitShiftRightUnsigned (fun)

trusted fun __ablaRuntimeBitShiftRightUnsigned(
    left: any,
    right: any
): any

Returns the boxed integer shifted right with zero fill.

__ablaRuntimeStringBytesEqual (fun)

@noinline
trusted fun __ablaRuntimeStringBytesEqual(
    leftDirect: int,
    leftRope: int,
    rightDirect: int,
    rightRope: int,
    length: int
): bool

Lengths decide most comparisons inline; the bytes are compared out of line (one entry, one body), since == on strings is everywhere in a program. Pass their two words rather than boxed values: the inline caller need not materialize two 24-byte argument copies. The bytes of two strings of length (not zero) are equal. Where words are safe, flat strings, nearly always, run the body in the entry itself, which then calls nothing on that path and saves no registers (checked in the disassembly: no pushes before the flat comparison); a rope on either side jumps to __ablaRuntimeRopeBytesEqual, which flattens it first.

__ablaRuntimeRopeBytesEqual (fun)

@noinline
trusted fun __ablaRuntimeRopeBytesEqual(
    leftDirect: int,
    leftRope: int,
    rightDirect: int,
    rightRope: int,
    length: int
): bool

Flattens rope operands as needed and compares the given number of bytes.

__ablaRuntimeFlatBytesEqual (fun)

@inline
trusted fun __ablaRuntimeFlatBytesEqual(leftData: int, rightData: int, length: int): bool

Returns whether two contiguous readable memory regions have the same bytes.

__ablaRuntimeStringEqualBool (fun)

@inline
trusted fun __ablaRuntimeStringEqualBool(left: any, right: any): bool

Returns an unboxed boolean comparing two strings byte for byte.

__ablaRuntimeFloatBitsEqual (fun)

@inline
trusted fun __ablaRuntimeFloatBitsEqual(left: int, right: int, kind: int): bool

Two erased floats of one kind (kind 1 for f32, whose bits are the payload's low 32, or 2 for f64) compare as their typed == does: a NaN equals nothing, and 0.0 equals -0.0.

__ablaRuntimeEqualFloatKinds (fun)

trusted fun __ablaRuntimeEqualFloatKinds(): bool

Whether == through any compares two erased floats as typed == does. True, except in a whole program that erases no float to any: there the backend folds this to false (bootstrapLlvmRuntimePolicy) and the branch, with the float comparison it carries, leaves the module (on WebAssembly, where every call of this function is inlined, it cost every program that compares any values).

__ablaRuntimeEqual (fun)

trusted fun __ablaRuntimeEqual(left: any, right: any): any

Returns boxed equality according to the runtime value tags and payloads.

__ablaRuntimeNotEqual (fun)

trusted fun __ablaRuntimeNotEqual(left: any, right: any): any

Returns the boxed negation of runtime value equality.

__ablaRuntimeStringNotEqualBool (fun)

trusted fun __ablaRuntimeStringNotEqualBool(left: any, right: any): bool

Returns whether the strings differ in byte length or content.

__ablaRuntimeStringEqual (fun)

trusted fun __ablaRuntimeStringEqual(left: any, right: any): any

Returns a boxed boolean comparing two strings byte for byte.

__ablaRuntimeStringNotEqual (fun)

trusted fun __ablaRuntimeStringNotEqual(left: any, right: any): any

Returns a boxed boolean indicating whether the strings differ.

__ablaRuntimeStringCompare (fun)

trusted fun __ablaRuntimeStringCompare(left: any, right: any): int

Two strings in byte-wise lexicographic order: negative when left comes first, 0 when they are equal, positive when right does. A string that is a prefix of the other comes first.

__ablaRuntimeOrder (fun)

@inline
trusted fun __ablaRuntimeOrder(left: any, right: any): int

The ordering operators on boxed values: strings by their bytes, integers by value.

__ablaRuntimeLess (fun)

@inline
trusted fun __ablaRuntimeLess(left: any, right: any): any

Returns boxed true if the left operand sorts before the right by string bytes or signed integer value.

__ablaRuntimeLessEqual (fun)

@inline
trusted fun __ablaRuntimeLessEqual(left: any, right: any): any

Returns boxed true if the left operand sorts no later than the right by string bytes or signed integer value.

__ablaRuntimeGreater (fun)

@inline
trusted fun __ablaRuntimeGreater(left: any, right: any): any

Returns boxed true if the left operand sorts after the right by string bytes or signed integer value.

__ablaRuntimeGreaterEqual (fun)

@inline
trusted fun __ablaRuntimeGreaterEqual(left: any, right: any): any

Returns boxed true if the left operand sorts no earlier than the right by string bytes or signed integer value.

__ablaRuntimeStringLengthValue (fun)

trusted fun __ablaRuntimeStringLengthValue(value: any): int

Returns the byte length from a flat string's payload or a rope header.

__ablaRuntimeCopyString (fun)

@noinline
trusted fun __ablaRuntimeCopyString(
    value: any,
    destination: int,
    offset: int
): int

Out of line, as its caller StringDataSlow: a rope's walk is the slow path of reading a string, and inlined it grew each place that reads one.

__ablaRuntimeRopeFlat (fun)

@inline
trusted fun __ablaRuntimeRopeFlat(rope: int): int

A rope node's flat copy (+40), or 0. Once threads run, another thread may have just published it: the fence orders the copy's bytes after it.

__ablaRuntimeRopeChildrenCleared (fun)

@inline
trusted fun __ablaRuntimeRopeChildrenCleared(rope: int): int

Called after a reader loaded a rope node's four child words, which it found no flat copy for: the node's flat copy if another thread published it meanwhile (and so may have cleared some of the children just read), else 0. Flattening stores +40 before it clears the children and the reader loads +40 again after them, each across a fence, so a reader that saw a cleared child sees the copy here.

__ablaRuntimeStringDataSlow (fun)

@noinline
trusted fun __ablaRuntimeStringDataSlow(rope: int): int

Only a rope reaches this path. Reconstruct its string here, so every inline reader passes one word rather than keeping a boxed argument for this rare call.

__ablaRuntimeStringData (fun)

@inline
trusted fun __ablaRuntimeStringData(value: any): int

Keep the overwhelmingly common flat/static path small enough to inline. Rope flattening remains an ordinary out-of-line Abla function so callers do not duplicate allocation and recursive-copy machinery.

__ablaRuntimeStringWriteVectors (fun)

trusted fun __ablaRuntimeStringWriteVectors(
    value: any,
    vectors: int,
    pending: int,
    maximum: int,
    offset: int
): int

Fill native iovec pairs from a flat or rope-backed string without flattening it. The Linux networking layer owns the two fixed-capacity buffers and performs the platform syscall; string layout and traversal stay here with the rest of the all-Abla value runtime.

__ablaRuntimeOwnedBytesFromValue (fun)

trusted fun __ablaRuntimeOwnedBytesFromValue(value: any): int

Foreign-owned copies are outside the traced heap. The length prefix and bytes live in one allocation, released exactly once by the C caller.

__ablaRuntimeOwnedBytesData (fun)

trusted fun __ablaRuntimeOwnedBytesData(handle: int): int

Returns the owned byte buffer's payload address, or zero for a zero handle.

__ablaRuntimeOwnedBytesLength (fun)

trusted fun __ablaRuntimeOwnedBytesLength(handle: int): int

Returns the owned byte buffer's length, or zero for a zero handle.

__ablaRuntimeOwnedBytesRelease (fun)

trusted fun __ablaRuntimeOwnedBytesRelease(handle: int): void

Releases the native allocation for an owned byte buffer.

__ablaRuntimeAsCString (fun)

trusted fun __ablaRuntimeAsCString(value: any): int

Returns the address of a newly allocated NUL-terminated copy of the string bytes.

__ablaRuntimeSmallNumbers (fun)

@inline
trusted fun __ablaRuntimeSmallNumbers(): any

A number below 100 is a window of this text ("00" to "99"), so its string takes no allocation (nothing reads past a string's length, and a C string is a copy).

__ablaRuntimeSmallNumber (fun)

@inline
trusted fun __ablaRuntimeSmallNumber(value: any): bool

Returns whether the boxed integer is in the cached decimal range from 0 through 99.

__ablaRuntimeSmallNumberText (fun)

@noinline
trusted fun __ablaRuntimeSmallNumberText(number: int): any

Returns a boxed decimal view into the static table for an integer from 0 through 99.

__ablaRuntimeToString (fun)

trusted fun __ablaRuntimeToString(value: any): any

Returns the runtime text of a boxed null, boolean, number or other value.

__ablaRuntimeStringFlatLimit (fun)

@inline
trusted fun __ablaRuntimeStringFlatLimit(): int

A concatenation of at most this many bytes is copied into one flat buffer rather than joined by a rope node. A node costs 48 bytes before its header and keeps both pieces alive (a string built by += kept every piece); a short copy keeps only itself, and reading it takes the flat path. Longer results stay ropes, so building a large string piece by piece stays linear.

__ablaRuntimeCopyStringBytes (fun)

@noinline
trusted fun __ablaRuntimeCopyStringBytes(value: any, destination: int): void

Copies into concatenation's fresh destination: a flat string directly, a rope through CopyString. Source strings can alias one another, but none can overlap the new output. Keep the shared helper out of each template site.

__ablaRuntimeAllocateOutOfLine (fun)

@noinline
trusted fun __ablaRuntimeAllocateOutOfLine(size: int, layout: int): int

An allocation outside the hot paths that inline the allocator (objects, array literals, number text, closures, cells): concatenation's flat bytes and terminator (layout 1) or rope (6), a rope's flat copy and the stack that walks it (0), a C string, an array's growth and boxing, Base64, joined chunks. Out of line: inlined, the allocator is most of a kilobyte in each of those functions.

__ablaRuntimePanicStringTooLong (fun)

@noinline
trusted fun __ablaRuntimePanicStringTooLong(left: int, right: int): never

Panics when a concatenation would be longer than a string can be. A rope names a length without holding the bytes, so doubling a string 62 times makes one of 2^62 bytes with no allocation; a longer length would wrap the sum, and the flat path would then copy the whole rope into a buffer sized by the wrapped (negative or tiny) total.

__ablaRuntimeStringMaxLength (fun)

@inline
trusted fun __ablaRuntimeStringMaxLength(): int

The longest string (2^62 bytes: no allocation holds one that long, and the sum of two such lengths still fits).

__ablaRuntimeStringConcat (fun)

trusted fun __ablaRuntimeStringConcat(left: any, right: any): any

Returns the concatenated byte strings, choosing flat storage or a rope based on the result length.

__ablaRuntimeStringConcat4 (fun)

@noinline
trusted fun __ablaRuntimeStringConcat4(first: any, second: any, third: any, fourth: any): any

Four parts of a string template at once (bootstrapLowerStringTemplate): their flat result is allocated and written once, where a chain of __ablaRuntimeStringConcat allocates and copies the text so far at each part. A longer result, or one with at most one part not empty, is that chain's. Out of line: inlined, its four copies made every template site (the runtime's panic messages included) larger.

__ablaRuntimeStringLengthI64 (fun)

trusted fun __ablaRuntimeStringLengthI64(value: any): int

Returns the string's byte length as an unboxed integer.

__ablaRuntimeStringLength (fun)

trusted fun __ablaRuntimeStringLength(value: any): any

Returns the string's byte length as a boxed integer.

__ablaRuntimeStringGetI64 (fun)

@inline
trusted fun __ablaRuntimeStringGetI64(value: any, index: int): int

Returns the byte at the index as an integer and panics if the index is out of bounds.

__ablaRuntimePanicSlice (fun)

@noinline
trusted fun __ablaRuntimePanicSlice(begin: int, end: int, size: int): never

Panics with the invalid byte bounds and the size of the string.

__ablaRuntimeStringGet (fun)

trusted fun __ablaRuntimeStringGet(value: any, index: any): any

Returns the byte at the boxed index as a boxed integer and panics if it is out of bounds.

__ablaRuntimeStringSlice (fun)

@inline
trusted fun __ablaRuntimeStringSlice(
    value: any,
    beginValue: any,
    endValue: any
): any

Returns a boxed view of a half-open byte range and panics if the bounds are invalid.

__ablaRuntimeByteEncode (fun)

trusted fun __ablaRuntimeByteEncode(value: int): any

Returns a one-byte string for a value from 0 through 255, or the empty string otherwise.

__ablaRuntimeBase64Digit (fun)

@inline
trusted fun __ablaRuntimeBase64Digit(value: int): int

Returns the ASCII Base64 character for an index from 0 through 63.

__ablaRuntimeBase64Encode (fun)

trusted fun __ablaRuntimeBase64Encode(value: string): any

Base64 is emitted directly into one owned string allocation. Keeping this implementation in Abla avoids the tiny-slice and rope churn of the portable staged algorithm without introducing a C/runtime-library dependency.

__ablaRuntimeBase64DecodeDigit (fun)

@inline
trusted fun __ablaRuntimeBase64DecodeDigit(value: int): int

Returns the value of an ASCII Base64 digit, or -1 for another character.

__ablaRuntimeBase64Decode (fun)

trusted fun __ablaRuntimeBase64Decode(value: string): any

Returns the decoded bytes of standard Base64 or the empty string for invalid input.

__ablaRuntimeByteChunksJoin (fun)

trusted fun __ablaRuntimeByteChunksJoin(
    chunks: array<string>,
    byteCount: int
): any

Flatten immutable byte chunks into exactly one owned allocation. ByteBuffer remains an ordinary phase-safe Abla class; only the final contiguous storage operation lives at the raw-memory runtime boundary.

__ablaRuntimeUtf8EncodeScalar (fun)

trusted fun __ablaRuntimeUtf8EncodeScalar(value: int): any

Returns the UTF-8 bytes for a Unicode scalar value or the empty string for an invalid scalar.

__ablaRuntimeArrayKind (fun)

@inline
trusted fun __ablaRuntimeArrayKind(array: int): int

Arrays use the native 64-bit header layout on every target: length, capacity, and values pointer. This makes the runtime ABI deterministic and keeps the same optimized layout used by native Abla Web services.

The capacity word's top byte says how the elements are stored: 0 as boxed 24-byte values, 1 as dense 8-byte words (numbers: tag 2), 2 as dense bools (tag 3). An array whose elements are all numbers or all bools is dense, a third of the memory; storing any other value boxes it first.

__ablaRuntimeArrayCapacity (fun)

@inline
trusted fun __ablaRuntimeArrayCapacity(array: int): int

Returns the number of slots available in the array buffer.

__ablaRuntimeArraySetCapacity (fun)

@inline
trusted fun __ablaRuntimeArraySetCapacity(
    array: int,
    kind: int,
    capacity: int
): void

Stores the array's storage kind and capacity in its packed header word.

__ablaRuntimeDenseKind (fun)

@inline
trusted fun __ablaRuntimeDenseKind(address: int): int

The dense kind the value at address can be stored as, or 0.

__ablaRuntimeArrayBlock (fun)

@noinline
trusted fun __ablaRuntimeArrayBlock(size: int): int

Apart from what inlines the create: the allocator is most of its code.

__ablaRuntimeArrayCreate (fun)

trusted fun __ablaRuntimeArrayCreate(values: int, count: int): any

Copies boxed inputs into a new array and traps for a negative element count.

__ablaRuntimePanicFilledSize (fun)

@noinline
trusted fun __ablaRuntimePanicFilledSize(count: int): never

Panics when an array is filled with a negative count.

__ablaRuntimePanicFilledTooLarge (fun)

@noinline
trusted fun __ablaRuntimePanicFilledTooLarge(count: int): never

Panics when a filled array would need more bytes than an address space holds. The byte size is 24 + count * width (width up to 24): from 2^61 elements it wraps to a small allocation that the fill loop then writes past.

__ablaRuntimePanicTruncateSize (fun)

@noinline
trusted fun __ablaRuntimePanicTruncateSize(requested: int): never

Panics when the requested truncation length is negative.

__ablaRuntimeArrayFilled (fun)

trusted fun __ablaRuntimeArrayFilled(countValue: any, element: any): any

count copies of element in one allocation, laid out like a literal.

__ablaRuntimeArrayAddress (fun)

@inline
trusted fun __ablaRuntimeArrayAddress(value: any): int

Returns the array's header address and traps for a zero address.

__ablaRuntimeArrayLengthI64 (fun)

@inline
trusted fun __ablaRuntimeArrayLengthI64(value: any): int

Returns the array length as an unboxed integer and traps for a zero header address.

__ablaRuntimeArrayLength (fun)

trusted fun __ablaRuntimeArrayLength(value: any): any

Returns the boxed array length and traps for a zero header address.

__ablaRuntimeArrayIndex (fun)

trusted fun __ablaRuntimeArrayIndex(array: int, index: int): int

index after checking it is within the array.

__ablaRuntimeArrayDenseWords (fun)

@inline
trusted fun __ablaRuntimeArrayDenseWords(value: any): int

Internal SIMD fast path. A caller may use the backing words only after bounding every index, with no allocation or mutation before the loads.

__ablaRuntimeArrayBox (fun)

@noinline
trusted fun __ablaRuntimeArrayBox(array: int): void

Rewrites a dense array's elements as boxed values, in place of its buffer.

__ablaRuntimeArrayAppend (fun)

trusted fun __ablaRuntimeArrayAppend(value: any, element: any): any

Appends an element, growing or changing storage as needed, and returns boxed void.

__ablaRuntimeArrayAppendGrowing (fun)

@noinline
trusted fun __ablaRuntimeArrayAppendGrowing(array: int, element: any): void

Append when the array must grow or change its storage first: a fresh array takes the storage of its first element; a dense one is boxed before it stores anything else.

__ablaRuntimeArrayTruncate (fun)

trusted fun __ablaRuntimeArrayTruncate(value: any, countValue: any): any

Keeps the first count elements (all of them when count is at least the size); the slots past them are zeroed so they hold nothing, and the capacity stays for later appends.

__ablaRuntimeArrayTakeShift (fun)

@noinline
trusted fun __ablaRuntimeArrayTakeShift(array: int, index: int, width: int): void

Only middle removals shift. This helper never allocates or invokes a drop.

__ablaRuntimeArrayTake (fun)

@inline
trusted fun __ablaRuntimeArrayTake(value: any, indexValue: any): any

Move out a value without a drop. The checked last-slot path is O(1).

__ablaRuntimeArrayTakeWord (fun)

@inline
trusted fun __ablaRuntimeArrayTakeWord(value: any, index: int, tag: int): int

Typed word moves mirror the scalar getters, avoiding a boxed result in loops.

__ablaRuntimeArrayTakeWordOther (fun)

@noinline
trusted fun __ablaRuntimeArrayTakeWordOther(value: any, index: int, tag: int): int

Removes and returns the element's payload word after checking its tag and index.

__ablaRuntimeArrayTakeI64 (fun)

@inline
trusted fun __ablaRuntimeArrayTakeI64(value: any, index: int): int

Removes and returns an integer element, trapping for a wrong tag or panicking for an invalid index.

__ablaRuntimeArrayTakeBool (fun)

@inline
trusted fun __ablaRuntimeArrayTakeBool(value: any, index: int): bool

Removes and returns a boolean element, trapping for a wrong tag or panicking for an invalid index.

__ablaRuntimeArrayLoadI64 (fun)

@inline
trusted fun __ablaRuntimeArrayLoadI64(address: int): int

These loads address only the storage of an array checked by ArrayGet. The LLVM backend separates them from class field stores, so the shape and element lookup can stay live across updates to an object in the array.

__ablaRuntimeArrayLoadI32 (fun)

@inline
trusted fun __ablaRuntimeArrayLoadI32(address: int): int

Loads a signed 32-bit word from a readable address in array storage.

__ablaRuntimeArrayGet (fun)

@inline
trusted fun __ablaRuntimeArrayGet(value: any, indexValue: any): any

Readers: the common case (in bounds, the storage the caller expects) stays small where it is inlined; the rest is one shared call.

__ablaRuntimeArrayGetI64 (fun)

@inline
trusted fun __ablaRuntimeArrayGetI64(value: any, index: int): int

Returns a checked integer element, trapping for the wrong tag or panicking for an invalid index.

__ablaRuntimeArrayGetBool (fun)

@inline
trusted fun __ablaRuntimeArrayGetBool(value: any, index: int): bool

Returns a checked boolean element, trapping for the wrong tag or panicking for an invalid index.

__ablaRuntimeArrayGetWordOther (fun)

@noinline
trusted fun __ablaRuntimeArrayGetWordOther(array: int, index: int, tag: int): int

A boxed array's element index as a word of type tag (trapping on another tag or out of bounds).

__ablaRuntimeIndexGet (fun)

trusted fun __ablaRuntimeIndexGet(value: any, index: any): any

Returns a boxed string byte or array element, trapping for other tags and panicking for an invalid index.

__ablaRuntimeFloatArrayIndexGet (fun)

trusted fun __ablaRuntimeFloatArrayIndexGet(value: any, index: any): any

Returns a checked array element with its erased floating-point kind restored when present.

__ablaRuntimeArraySet (fun)

trusted fun __ablaRuntimeArraySet(
    value: any,
    indexValue: any,
    element: any
): int

Stores a boxed array element and returns zero, panicking if the index is out of bounds.

__ablaRuntimeArraySetWord (fun)

@inline
trusted fun __ablaRuntimeArraySetWord(
    array: int, index: int, word: int, kind: int
): void

A typed scalar store carries only the array address and native words. The common packed case needs no temporary value or dense-kind rediscovery. Floats use their bits as an integer word; bool uses kind 2 and word 0 or 1.

__ablaRuntimeArraySetOther (fun)

@noinline
trusted fun __ablaRuntimeArraySetOther(array: int, index: int, element: any): void

Stores into a boxed array, boxing a dense one first when the value needs it.

__ablaRuntimeObjectDescriptor (fun)

@inline
trusted fun __ablaRuntimeObjectDescriptor(object: int): int

An instance: a header (+0 its class's descriptor + 2^62, +8 its overflow or 0), then its declared fields, each stored by its kind at the offset the compiler gave it (ir.ab's bootstrapIrClassLayout): 0 a boxed value, 24 bytes; 1 a word, 8 bytes (an int, f64, f32 or raw pointer: tag 2); 2 a bool, 1 byte (tag 3); 3 a string, 16 bytes (tag 4: its two words); 4 a reference, 8 bytes (the one word of a value whose tag the type fixes); 5 a nullable reference, 8 bytes (0 is null). Typed accesses carry the field's place: its offset (bits 0-31), kind (32-39), tag (40-47) and bit 48 set (what told it from the index an older layout's code passed). An instance starts zeroed; construction then stores every declared field (object.create through __ablaRuntimeFieldInitialize, the compile-time lift by name).

A class's descriptor is a constant the compiler emits (each module its own copy): +0 the class's symbol (i32), +4 how many declared fields (i32), +8 an instance's size (i32), +12 how many of them the collector traces (i32), then a 16-byte entry per field in declaration order (+0 its symbol, +4 its offset, +8 its kind, +12 its tag, each i32), then an 8-byte entry per traced field (a boxed, string or reference one: +0 offset, +4 kind).

Any other field set by name (an extension field) goes to the overflow, so nothing may assume where an extension field lives: lookups go by symbol, declared fields first.

The overflow is a managed array of 32-byte slots (a symbol word, then a value). Its first slot is a header (+16 how many slots after it hold a field, +24 how many it has room for) tagged as an int, so the collector's walk over 32-byte slots reads it as one; its unused slots are zero. Growing it copies it: the new array is published only once whole, and the old one is left to the collector, since another thread may still read it.

__ablaRuntimeDescriptorSymbol (fun)

@inline
trusted fun __ablaRuntimeDescriptorSymbol(descriptor: int): int

Returns the class symbol stored at the descriptor address.

__ablaRuntimeDescriptorFields (fun)

@inline
trusted fun __ablaRuntimeDescriptorFields(descriptor: int): int

Returns the number of declared fields stored in the class descriptor.

__ablaRuntimeDescriptorPlace (fun)

@inline
trusted fun __ablaRuntimeDescriptorPlace(descriptor: int, index: int): int

Field index's place (as typed accesses carry it) in descriptor.

__ablaRuntimeObjectSymbol (fun)

@inline
trusted fun __ablaRuntimeObjectSymbol(object: int): int

The symbol of the class object is an instance of.

__ablaRuntimeOverflowWord (fun)

@inline
trusted fun __ablaRuntimeOverflowWord(object: int): int

The address of the word holding object's overflow.

__ablaRuntimeObjectCreate (fun)

trusted fun __ablaRuntimeObjectCreate(encoded: int, marked: int): any

The compiler emits the size and the descriptor from the same class layout. The high bit of the i32 argument identifies a size. Bootstrap compilers pass the class symbol. The instance's first word holds the descriptor + 2^62.

__ablaRuntimeObjectBlock (fun)

@noinline
trusted fun __ablaRuntimeObjectBlock(size: int): int

An instance's zeroed storage.

__ablaRuntimeFieldLoad (fun)

trusted fun __ablaRuntimeFieldLoad(object: int, place: int): any

The field at place of object, as a value.

__ablaRuntimeFieldLoadFloat (fun)

trusted fun __ablaRuntimeFieldLoadFloat(object: int, place: int): any

Loads a field from its encoded location and restores any erased float kind.

__ablaRuntimeFieldStore (fun)

trusted fun __ablaRuntimeFieldStore(object: int, place: int, fieldValue: any): void

Stores fieldValue into the field at place of object. A value the kind can't hold (another tag than the type fixes) stops the program; null (or void) is stored as zero: 0, false, the empty string, a null reference.

__ablaRuntimeFieldPlace (fun)

trusted fun __ablaRuntimeFieldPlace(object: int, symbol: int): int

The place of object's declared field symbol, or -1.

__ablaRuntimeFieldSlot (fun)

trusted fun __ablaRuntimeFieldSlot(object: int, symbol: int): int

The address of object's overflow slot holding symbol, or 0.

__ablaRuntimeOverflowAdd (fun)

@noinline
trusted fun __ablaRuntimeOverflowAdd(object: int, symbol: int, fieldValue: any): void

Adds symbol with fieldValue to object's overflow, growing it first when it is full.

__ablaRuntimeFieldHas (fun)

@noinline
trusted fun __ablaRuntimeFieldHas(value: any, symbol: int): bool

Whether value holds the field symbol (one set by name, or declared).

__ablaRuntimeObjectIs (fun)

@inline
trusted fun __ablaRuntimeObjectIs(value: any, symbol: int): bool

Whether value is an instance of the class whose symbol is symbol (an interface value's as? and its dispatch, which compare the instance's class).

__ablaRuntimeInterfaceNoWitness (fun)

@noinline
trusted fun __ablaRuntimeInterfaceNoWitness(value: any, interfaceName: string): never

An interface call on an instance of a class with no witness for it: the one fallback of every dispatch. No class is missing one today (a value becomes an interface value only from a class that conforms); a conformance added at run time would be looked up here.

__ablaRuntimeOverflowCount (fun)

trusted fun __ablaRuntimeOverflowCount(value: any): int

The fields in value's overflow, in the order they were set: how many, and the index-th one's symbol and value. A drop walks them backwards.

__ablaRuntimeOverflowSlot (fun)

trusted fun __ablaRuntimeOverflowSlot(value: any, index: int): int

Returns the address of an extension-field slot and traps if the slot is absent or out of bounds.

__ablaRuntimeOverflowSymbol (fun)

trusted fun __ablaRuntimeOverflowSymbol(value: any, index: int): int

Returns the symbol in the extension-field slot and traps if its index is invalid.

__ablaRuntimeOverflowValue (fun)

trusted fun __ablaRuntimeOverflowValue(value: any, index: int): any

Returns the boxed value in the extension-field slot and traps if its index is invalid.

__ablaRuntimeFieldDefault (fun)

@noinline
trusted fun __ablaRuntimeFieldDefault(value: any, symbol: int): any

What a field never set on value reads: the default of the extension field symbol names. Until extension fields are declared, there is none: null.

__ablaRuntimeObjectAddress (fun)

trusted fun __ablaRuntimeObjectAddress(value: any): int

Returns the address held by a boxed object after validating its runtime tag.

__ablaRuntimeFieldGet (fun)

@noinline
trusted fun __ablaRuntimeFieldGet(value: any, symbol: int): any

Not inlined: generated drops read their resource fields by name, in many places, and none of those reads is hot.

__ablaRuntimeFieldAddressIndexed (fun)

@inline
trusted fun __ablaRuntimeFieldAddressIndexed(value: any, place: int): int

Typed IR supplies the field's place (its offset, kind and tag) for a class's declared fields. Such fields cannot move or be added dynamically, so do not look up their symbols on every cursor/count/flag access. Nor check a scalar field's kind: every field is a constructor parameter, stored (and lifted, and set) only from a value of its declared type.

__ablaRuntimeFieldGetIndexed (fun)

trusted fun __ablaRuntimeFieldGetIndexed(value: any, symbol: int, place: int): any

Returns a boxed field from its encoded location and traps for a missing object or invalid location.

__ablaRuntimeFieldGetString (fun)

trusted fun __ablaRuntimeFieldGetString(value: any, symbol: int, place: int): any

A declared string field (kind 3) and a declared reference field (kind 4 or 5): their own accessors, so an unoptimized build reads one without the general one's choice of kind.

__ablaRuntimeFieldGetReference (fun)

trusted fun __ablaRuntimeFieldGetReference(value: any, symbol: int, place: int): any

Loads a reference field as a boxed reference or null and traps for a missing object or invalid location.

__ablaRuntimeFieldSetString (fun)

trusted fun __ablaRuntimeFieldSetString(
    value: any,
    symbol: int,
    place: int,
    fieldValue: any
): int

Writes the boxed string or empty payload into a string field, returning zero and trapping for an invalid location or tag.

__ablaRuntimeFieldSetReference (fun)

trusted fun __ablaRuntimeFieldSetReference(
    value: any,
    symbol: int,
    place: int,
    fieldValue: any
): int

Writes a compatible reference or clears the slot, returning zero and trapping for an invalid location or tag.

__ablaRuntimeFieldGetIndexedI64 (fun)

trusted fun __ablaRuntimeFieldGetIndexedI64(value: any, symbol: int, place: int): int

Reads an unboxed integer field from the given location and traps for a missing object or invalid location.

__ablaRuntimeFieldGetIndexedBool (fun)

trusted fun __ablaRuntimeFieldGetIndexedBool(value: any, symbol: int, place: int): bool

Reads an unboxed boolean field from the given location and traps for a missing object or invalid location.

__ablaRuntimeFieldInitialize (fun)

@noinline
trusted fun __ablaRuntimeFieldInitialize(value: any, place: int, fieldValue: any): int

Not inlined: inlined, it would let LLVM follow every constructor's stores into later reads of the same instance; a game's client grew by 47 KB of wasm (+1.3 KB with brotli) for no measurable speed. A native program inlines it all the same (bootstrapLlvmNativeRuntimeInline).

__ablaRuntimeFieldSet (fun)

trusted fun __ablaRuntimeFieldSet(value: any, symbol: int, fieldValue: any): int

Updates a declared field or extension slot by symbol and returns zero.

__ablaRuntimeFieldSetIndexed (fun)

trusted fun __ablaRuntimeFieldSetIndexed(
    value: any,
    symbol: int,
    place: int,
    fieldValue: any
): int

Stores a boxed field at its encoded location and returns zero, trapping for a missing object or invalid location.

__ablaRuntimeFieldSetIndexedI64 (fun)

trusted fun __ablaRuntimeFieldSetIndexedI64(
    value: any,
    symbol: int,
    place: int,
    fieldValue: int
): int

Stores an integer field and returns zero, trapping for a missing object or invalid location.

__ablaRuntimeFieldSetIndexedBool (fun)

trusted fun __ablaRuntimeFieldSetIndexedBool(
    value: any,
    symbol: int,
    place: int,
    fieldValue: bool
): int

Stores a boolean field and returns zero, trapping for a missing object or invalid location.

__ablaRuntimeMemoryCensusWords (fun)

@inline
trusted fun __ablaRuntimeMemoryCensusWords(): int

A heap census (abla/memory's memoryCensus), as 49 words a platform fills from its walk over the tracked allocations: 0-15 how many allocations have each layout, 16-31 their payload bytes, 32-47 how many of the instances' declared fields hold a value of each tag, and 48 the bytes the allocations cost past their payloads (headers, the allocator's own, as far as the platform knows them).

__ablaRuntimeMemoryCensusClear (fun)

trusted fun __ablaRuntimeMemoryCensusClear(census: int): void

Sets every word in the allocation census to zero.

__ablaRuntimeMemoryCensusAddOverhead (fun)

trusted fun __ablaRuntimeMemoryCensusAddOverhead(census: int, bytes: int): void

Adds bytes to the allocation census's overhead counter.

__ablaRuntimeMemoryCensusIncrement (fun)

@inline
trusted fun __ablaRuntimeMemoryCensusIncrement(address: int, amount: int): void

Adds an amount to the 64-bit counter at the given writable address.

__ablaRuntimeMemoryCensusCount (fun)

trusted fun __ablaRuntimeMemoryCensusCount(census: int, payload: int, size: int, layout: int, overhead: int): void

Counts a tracked allocation with the given payload, size, layout and overhead.

__ablaRuntimeJsonAsciiWordPlain (fun)

@inline
trusted fun __ablaRuntimeJsonAsciiWordPlain(word: int): bool

Every byte must be ordinary ASCII: no control, quote, backslash or high bit. The repeated-byte masks are endian-independent. A failed word test only selects the original scalar path, which retains exact UTF-8 handling. Cross-byte borrows may conservatively flag another byte; they never skip an exceptional byte and only cause the scalar fallback to run sooner.

__ablaRuntimeJsonAsciiPrefixEnd (fun)

@noinline
trusted fun __ablaRuntimeJsonAsciiPrefixEnd(data: int, begin: int, end: int): int

Skip a printable ASCII prefix; retain the original scalar loop for the first exceptional word and the rest of the string. Callers use this only for longer ranges, so short keys keep their original per-byte loop.

__ablaRuntimeJsonStringIsPlain (fun)

trusted fun __ablaRuntimeJsonStringIsPlain(value: string): bool

Returns whether the bytes are valid UTF-8 and need no JSON string escaping.

__ablaRuntimeJsonFindPlainStringEnd (fun)

trusted fun __ablaRuntimeJsonFindPlainStringEnd(
    value: string,
    begin: int,
    end: int
): int

Returns the closing quote offset for unescaped JSON string contents or -1 if the range or contents are invalid.

__ablaRuntimeJsonMatchCompactObjectField (fun)

trusted fun __ablaRuntimeJsonMatchCompactObjectField(
    value: string,
    offset: int,
    name: string,
    comma: bool
): int

Returns the byte offset after a matching compact key and colon or -1 if the field does not match.

__ablaRuntimeJsonCompactArrayNext (fun)

trusted fun __ablaRuntimeJsonCompactArrayNext(
    value: string,
    offset: int,
    first: bool
): int

Fast state transition for a compact JSON array. Positive results encode the next value offset plus one; negative results encode the offset after an empty-array closing bracket. Zero asks the checked whitespace-aware reader to preserve its full diagnostics.

__ablaRuntimeJsonAvailableIntegerEnd (fun)

trusted fun __ablaRuntimeJsonAvailableIntegerEnd(
    value: string,
    begin: int
): int

Returns the available end offset of a complete representable JSON integer, or -1 if it is invalid or incomplete.

__ablaRuntimeJsonIntegerValueAt (fun)

trusted fun __ablaRuntimeJsonIntegerValueAt(
    value: string,
    begin: int,
    end: int
): int

Returns the signed value of a validated JSON integer span, or zero if the bounds are invalid.

__ablaRuntimeJsonWhitespaceEnd (fun)

trusted fun __ablaRuntimeJsonWhitespaceEnd(
    value: string,
    begin: int
): int

Returns the first offset after JSON whitespace, or the original offset if it is outside the string.

__ablaRuntimeCharText (fun)

trusted fun __ablaRuntimeCharText(value: char): any

The text of a char (string interpolation): its one byte.

__ablaRuntimeU64Text (fun)

fun __ablaRuntimeU64Text(value: u64): string

The decimal text of a u64 (string interpolation): one above i64's range is written as its tenth and its last digit.

__ablaRuntimeTextFindSequence (fun)

trusted fun __ablaRuntimeTextFindSequence(
    text: string,
    sequence: string,
    begin: int,
    end: int
): int

Returns the first matching byte sequence offset in the half-open range, or -1 for no match or invalid bounds.

__ablaRuntimeTextFindByte (fun)

trusted fun __ablaRuntimeTextFindByte(
    text: string,
    byte: int,
    begin: int,
    end: int
): int

Returns the first matching byte offset in the half-open range, or -1 for no match or invalid input.

__ablaRuntimeAsciiByteEqualInsensitive (fun)

@inline
trusted fun __ablaRuntimeAsciiByteEqualInsensitive(left: int, right: int): bool

Returns whether the bytes match with ASCII letter case ignored.

__ablaRuntimeTextAsciiEqualInsensitive (fun)

trusted fun __ablaRuntimeTextAsciiEqualInsensitive(
    left: string,
    right: string
): bool

Returns whether two strings match byte for byte when ASCII letter case is ignored.

__ablaRuntimeTextReadU32LittleEndian (fun)

trusted fun __ablaRuntimeTextReadU32LittleEndian(
    text: string,
    offset: int
): int

Returns four bytes as an unsigned little-endian value, or -1 if the read is out of bounds.

__ablaRuntimeTextIsValidUtf8 (fun)

trusted fun __ablaRuntimeTextIsValidUtf8(text: string): bool

Returns whether the string is a well-formed UTF-8 byte sequence.

__ablaRuntimeFrozenCreate (fun)

trusted fun __ablaRuntimeFrozenCreate(value: any): any

abla/runtime/memory's Frozen: the instance is the frozen value itself (docs/design/frozen-heap.md).

__ablaRuntimeFrozenGet (fun)

@inline
trusted fun __ablaRuntimeFrozenGet(frozen: any): any

Returns the boxed value held by the frozen wrapper.

__ablaRuntimeStringBuildReserve (fun)

@noinline
trusted fun __ablaRuntimeStringBuildReserve(cell: any, first: int, limit: int, width: int): void

The lowerer keeps this cell private to a loop. Its value is a string whose auxiliary word stores capacity; previous visible strings have no capacity and are copied before the builder writes anything. Reserves space for a proven fixed-width append loop. Leaves the builder alone if the range is empty, starts below zero, or exceeds the builder's capacity limit.

__ablaRuntimeStringBuildAppend (fun)

trusted fun __ablaRuntimeStringBuildAppend(cell: any, piece: any): any

Appends the piece's bytes to a private builder and returns the boxed void value. An empty piece has no effect. Growth can fail if memory is exhausted.

__ablaRuntimeStringBuildFinish (fun)

trusted fun __ablaRuntimeStringBuildFinish(cell: any): any

Clears the builder cell and returns its final string as a flat runtime value.

Built from Abla v0.2.79 source ba5d6b7d. Examples and generated signatures follow that source revision.