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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
// Heap allocation audit (PR-9 V8 Gap Closure):
// Category A (NaN-boxed returns): 0 sites
// Category B (intermediate/consumed): 0 sites
// Category C (heap islands): 0 sites
// (GC module performs safepoint polling only, no allocations)
//!
//! GC integration FFI functions for JIT-compiled code
//!
//! Provides safepoint polling and root scanning for GC-enabled builds.
//! Without `gc` feature: no-ops that compile away.
use crateJITContext;
/// GC safepoint poll called from JIT code at loop headers.
///
/// This function is called at every loop back-edge in JIT-compiled code.
/// Fast path (no GC pending): checks a single byte and returns.
/// Slow path (GC requested): scans JITContext roots and participates in collection.
///
/// # Safety
/// `ctx` must point to a valid JITContext.
pub extern "C"
/// Scan JITContext roots for the garbage collector.
///
/// Traces all NaN-boxed values in locals and stack that may contain
/// heap pointers, allowing the GC to find all live objects reachable
/// from JIT-compiled code.
/// Write barrier for heap pointer overwrites in JIT-compiled code.
///
/// Called before overwriting a heap slot. `old_bits` is the NaN-boxed value
/// being replaced; `new_bits` is the value about to be written.
///
/// Without `gc` feature: unconditional no-op (compiles to a single `ret`).
/// With `gc` feature: enqueues the old reference into the SATB buffer if
/// an incremental marking cycle is active, and marks the card table dirty.
pub extern "C"