SpiderMonkey-backed API compatibility layer replacing bun_jsc.
bun_sm provides the same public API surface as the phantom bun_jsc crate,
but backed by SpiderMonkey via bao_engine + mozjs. When bun_runtime
changes pub use bun_jsc::* to pub use bun_sm::*, all 8,500+ JSC
references resolve to SM-backed implementations.
Architecture
JSC types map to SM equivalents:
JSGlobalObject→*mut JSContext(SM's JSContext owns the heap)JSValue→ newtype overbun_sm::value::JsValueCallFrame→ wrapper over SMCallArgsVirtualMachine→ TLS singleton wrappingBaoEventLoopJSPromise→ ZST wrapping*mut JSObject
ABI difference
JSC: unsafe extern "C" fn(*mut JSGlobalObject, *mut CallFrame) -> JSValue
SM: unsafe extern "C" fn(*mut JSContext, argc: u32, vp: *mut JSVal) -> bool