Expand description
Type Conversion FFI Functions for JIT
Functions for type checking and conversion in JIT-compiled code.
Functions§
- jit_
print_ atomic - Print an
Arc<AtomicData>-shaped slot as<atomic:N>where N is the current atomic value. Dispatched when the operand kind is provenNativeKind::Ptr(HeapKind::Atomic). - jit_
print_ bool - Print a raw native bool to stdout with a newline.
- jit_
print_ channel - Print an
Arc<ChannelData>-shaped slot as<channel:state:len>where state isopen/closedand len is the current queue length. Dispatched when the operand kind is provenNativeKind::Ptr(HeapKind::Channel). - jit_
print_ char - Print a
charcodepoint to stdout with a newline. - jit_
print_ deque - Print an
Arc<DequeData>-shaped slot asDeque[elem1, elem2, ...]front-to-back. Dispatched when the operand kind is provenNativeKind::Ptr(HeapKind::Deque). - jit_
print_ f64 - Print a raw native f64 to stdout with a newline.
- jit_
print_ hashmap - Print an
Arc<HashMapKindedRef>-shaped slot as{"k1": v1, "k2": v2, ...}with per-V value rendering (POD scalars rendered directly, heap-payload values rendered via the canonicalHeapValueDisplay dispatch). Dispatched when the operand kind is provenNativeKind::Ptr(HeapKind::HashMap). - jit_
print_ hashset - Print an
Arc<HashSetData>-shaped slot as{"a", "b", ...}. Dispatched when the operand kind is provenNativeKind::Ptr(HeapKind::HashSet). - jit_
print_ i64 - Print a raw native i64 to stdout with a newline.
- jit_
print_ iterator - Print an
Arc<IteratorState>-shaped slot as the opaque tag<iterator>(lazy iterators have no user-facing print form; a terminal operation must materialize the values perprinting.rs:430-439). Dispatched when the operand kind is provenNativeKind::Ptr(HeapKind::Iterator). - jit_
print_ lazy - Print an
Arc<LazyData>-shaped slot as<lazy:initialized>/<lazy:pending>depending on whether the cached value has been populated. Dispatched when the operand kind is provenNativeKind::Ptr(HeapKind::Lazy). - jit_
print_ mutex - Print an
Arc<MutexData>-shaped slot as<mutex>. Dispatched when the operand kind is provenNativeKind::Ptr(HeapKind::Mutex). - jit_
print_ option - Print an
Arc<OptionData>-shaped slot asSome(<inner>)/None. Dispatched when the operand kind is provenNativeKind::Ptr(HeapKind::Option). The inner payload’s kind comes fromOptionData.payload.kind(the §2.7.17 carrier-internal kind label, stamped at producer construction); the recursive formatter pass dispatches on that kind without any tag-bit decode. - jit_
print_ priority_ queue - Print an
Arc<PriorityQueueData>-shaped slot asPriorityQueue[v1, v2, ...]in heap-array order (NOT sorted). Dispatched when the operand kind is provenNativeKind::Ptr(HeapKind::PriorityQueue). - jit_
print_ range - Print an
Arc<RangeData>-shaped slot asstart..end(exclusive) orstart..=end(inclusive). Dispatched when the operand kind is provenNativeKind::Ptr(HeapKind::Range). - jit_
print_ result - Print an
Arc<ResultData>-shaped slot asOk(<inner>)/Err(<inner>). Dispatched when the operand kind is provenNativeKind::Ptr(HeapKind::Result). Mirrorsjit_print_option— inner payload kind comes fromResultData.payload.kind. - jit_
print_ str - Print a heap
Arc<String>-shaped slot. Dispatched when the operand kind is provenNativeKind::String(the §2.7.5 string carrier). - jit_
print_ typed_ array - Print a
*mut TypedArray<T>-shaped slot as[v1, v2, ...]. Dispatched when the operand kind is provenNativeKind::Ptr(HeapKind::TypedArray)by the MIR-timeconcrete_type_to_native_kindarm forConcreteType:: Array(_). - jit_
print_ typed_ object - Print a heap
Arc<TypedObjectStorage>-shaped slot. Dispatched when the operand kind is provenNativeKind::Ptr(HeapKind::TypedObject). The schema registry resolves field names fromstorage.schema_id; when the JIT runs without anExecutionContext(test harness) the fallback empty registry renders positional placeholders (_0,_1, …) performat_typed_object’s documented schema-less render path. - jit_
print_ u64 - Print a raw native
u64to stdout with a newline — UNSIGNED render. - jit_
string_ concat - Concatenate two operand values into a freshly allocated
Arc<String>carrier. Used by the MIR-lowering path forBinOp::Addwhen either operand hasNativeKind::String(thecompile_string_concatsite inmir_compiler/rvalues.rs), which coversstr + strdirectly and the f-string interpolation chain emitted bylower_formatted_string(crates/shape-vm/src/mir/lowering/expr.rs:720). - jit_
to_ number - Convert value to number
- jit_
to_ string - Convert value to string
- jit_
type_ check - Check if a value matches a type (returns TAG_BOOL_TRUE or TAG_BOOL_FALSE) type_name_bits should be a boxed string pointer with encoded type info
- jit_
typeof - Get typeof a value as a string