Bug 1842773 - Part 23: Add TypedArrayLengthZeroOnOutOfBounds. r=sfink,jandem
commita8179a9d2d833d22d002339a561fcce06488de96
authorAndré Bargull <andre.bargull@gmail.com>
Mon, 29 Jan 2024 10:44:28 +0000 (29 10:44 +0000)
committerAndré Bargull <andre.bargull@gmail.com>
Mon, 29 Jan 2024 10:44:28 +0000 (29 10:44 +0000)
treecb5552260ea39e2e5bc81b19a2090a88dcff69bb
parent24fe75a43a713d0f1b1bec5a45a01e7f75480b0c
Bug 1842773 - Part 23: Add TypedArrayLengthZeroOnOutOfBounds. r=sfink,jandem

Part 21 changed the `TypedArrayLength` to throw for out-of-bounds typed arrays,
but in a handful of cases we actually need to read the typed array length
without throwing an error for out-of-bounds.

Add a separate intrinsic for these cases and update the relevant self-hosted
functions to call `TypedArrayLengthZeroOnOutOfBounds`.

Differential Revision: https://phabricator.services.mozilla.com/D183340
js/src/builtin/TypedArray.js
js/src/jit/CacheIR.cpp
js/src/jit/CacheIRGenerator.h
js/src/jit/InlinableNatives.cpp
js/src/jit/InlinableNatives.h
js/src/vm/SelfHosting.cpp