Skip to main content

Module conversion

Module conversion 

Source
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 proven NativeKind::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 is open/closed and len is the current queue length. Dispatched when the operand kind is proven NativeKind::Ptr(HeapKind::Channel).
jit_print_char
Print a char codepoint to stdout with a newline.
jit_print_deque
Print an Arc<DequeData>-shaped slot as Deque[elem1, elem2, ...] front-to-back. Dispatched when the operand kind is proven NativeKind::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 canonical HeapValue Display dispatch). Dispatched when the operand kind is proven NativeKind::Ptr(HeapKind::HashMap).
jit_print_hashset
Print an Arc<HashSetData>-shaped slot as {"a", "b", ...}. Dispatched when the operand kind is proven NativeKind::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 per printing.rs:430-439). Dispatched when the operand kind is proven NativeKind::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 proven NativeKind::Ptr(HeapKind::Lazy).
jit_print_mutex
Print an Arc<MutexData>-shaped slot as <mutex>. Dispatched when the operand kind is proven NativeKind::Ptr(HeapKind::Mutex).
jit_print_option
Print an Arc<OptionData>-shaped slot as Some(<inner>) / None. Dispatched when the operand kind is proven NativeKind::Ptr(HeapKind::Option). The inner payload’s kind comes from OptionData.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 as PriorityQueue[v1, v2, ...] in heap-array order (NOT sorted). Dispatched when the operand kind is proven NativeKind::Ptr(HeapKind::PriorityQueue).
jit_print_range
Print an Arc<RangeData>-shaped slot as start..end (exclusive) or start..=end (inclusive). Dispatched when the operand kind is proven NativeKind::Ptr(HeapKind::Range).
jit_print_result
Print an Arc<ResultData>-shaped slot as Ok(<inner>) / Err(<inner>). Dispatched when the operand kind is proven NativeKind::Ptr(HeapKind::Result). Mirrors jit_print_option — inner payload kind comes from ResultData.payload.kind.
jit_print_str
Print a heap Arc<String>-shaped slot. Dispatched when the operand kind is proven NativeKind::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 proven NativeKind::Ptr(HeapKind::TypedArray) by the MIR-time concrete_type_to_native_kind arm for ConcreteType:: Array(_).
jit_print_typed_object
Print a heap Arc<TypedObjectStorage>-shaped slot. Dispatched when the operand kind is proven NativeKind::Ptr(HeapKind::TypedObject). The schema registry resolves field names from storage.schema_id; when the JIT runs without an ExecutionContext (test harness) the fallback empty registry renders positional placeholders (_0, _1, …) per format_typed_object’s documented schema-less render path.
jit_print_u64
Print a raw native u64 to 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 for BinOp::Add when either operand has NativeKind::String (the compile_string_concat site in mir_compiler/rvalues.rs), which covers str + str directly and the f-string interpolation chain emitted by lower_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