[JSC] `%TypedArray%.prototype.buffer` intrinsic across IC/DFG/FTL
Component: JavaScriptCore JIT | c8dd799
Source/JavaScriptCore/dfg/DFGByteCodeParser.cpp
Source/JavaScriptCore/bytecode/InlineCacheCompiler.cpp
A typed array view points at an ArrayBuffer, the refcounted C++ backing store, whose JS-visible JSArrayBuffer wrapper is created lazily and cached weakly in ArrayBuffer::m_wrapper. A view created with new Uint8Array(n) may have no ArrayBuffer until .buffer is first read, and that read can move the storage. This commit adds TypedArrayBufferIntrinsic with a new DFG node GetTypedArrayBuffer, FTL lowering, and an IC intrinsic getter. All three tiers load the wrapper inline when the ArrayBuffer exists and the wrapper is live, and call operationGetTypedArrayBuffer otherwise.
Significance
The commit reports about 3.8x on a pure .buffer microbenchmark and about 1.18x on new DataView(bytes.buffer, ...). It also adds a new DFG node and new GC and heap-effect invariants to the typed array path.
Audit directions
An inline JIT load of a weakly held GC object across three tiers means the same invariants must hold in three implementations. Compare TypedArrayController::isWrapperCachedInArrayBuffer against the checks loadTypedArrayBufferWrapper emits, so a dead-but-uncleared or concurrently collected wrapper cannot be returned, and confirm no barrier is needed. In the DFG, check that clobberize (which reads MiscFields), doesGC and safeToExecute cover the slow path's allocation and storage move; a wrong answer yields classic CSE, LICM or safepoint miscompiles. The FTL adds Mutable B3 heaps (ArrayBuffer_wrapper, WeakImpl_jsValue, WeakImpl_weakHandleOwner) that must agree with the DFG model. JIT code caching a data pointer or length across this node is suspect, because the slow path can convert inline storage to an ArrayBuffer. Resizable, shared, detached and cross-realm buffers are combinations to extend beyond the stress test. Finally, IntrinsicGetterAccessCase::doesCalls now returns true unconditionally for this intrinsic and must match what the stub actually emits.