1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
//! Reference FFI Functions for JIT — `&array[index] = value` lowering.
//!
//! ## Status: SURFACE (ADR-006 §2.7.4 / W10 jit-playbook §5)
//!
//! Pre-strict-typing this module mutated an `unified_array::UnifiedArray`
//! through `JitArray::from_heap_bits_mut`, decoded the index via
//! `unbox_number` (a `tag_bits` decode hidden inside the deleted ValueWord
//! API), and wrote raw `u64` element bits via `arr.set_boxed`. Both ends
//! are W-series defection-attractor pipeline (CLAUDE.md "Forbidden
//! Patterns": "Runtime tag_bits dispatch" + the deleted UnifiedArray heap
//! layout — see `jit_array.rs` SURFACE comment for the layout-deletion
//! audit).
//!
//! The strict-typing rebuild target reads the array directly as
//! `Arc<TypedArrayData>` per-element-kind arm (§2.7.6/Q8) and writes
//! through the matching `TypedArray<T>::set` instantiation, with the
//! element kind sourced from the JIT-stamped call signature per §2.7.5
//! (no decode of the receiver bits, no fabricated element kind).
//!
//! Until the kinded array-FFI rebuild lands (W11 / deeper Phase-2c),
//! the entry point below routes to `todo!()` so consumers fail loudly
//! at the JIT-emitted `call jit_set_index_ref` site.
/// Set an array element through a reference pointer.
///
/// SURFACE (W10 jit-playbook §5 / ADR-006 §2.7.4): the deleted
/// `JitArray::from_heap_bits_mut` walked the deleted `UnifiedArray`
/// layout. The kinded rebuild reads `Arc<TypedArrayData>` per the
/// receiver's stamped `NativeKind::Ptr(HeapKind::TypedArray)` companion
/// and dispatches to the per-element `TypedArray<T>::set` instantiation.
pub extern "C"