diff options
Diffstat (limited to 'js/src/jit-test/tests/ion/inlining/typedarray-length-inlining-neuter.js')
-rw-r--r-- | js/src/jit-test/tests/ion/inlining/typedarray-length-inlining-neuter.js | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/js/src/jit-test/tests/ion/inlining/typedarray-length-inlining-neuter.js b/js/src/jit-test/tests/ion/inlining/typedarray-length-inlining-neuter.js new file mode 100644 index 000000000..520dd1a38 --- /dev/null +++ b/js/src/jit-test/tests/ion/inlining/typedarray-length-inlining-neuter.js @@ -0,0 +1,22 @@ +var INLINE_INT8_AMOUNT = 4; +var OUT_OF_LINE_INT8_AMOUNT = 237; + +// Small and inline + +var ab1 = new ArrayBuffer(INLINE_INT8_AMOUNT); +var ta1 = new Int8Array(ab1); +function q1() { return ta1.length; } +q1(); +q1(); +detachArrayBuffer(ab1); +assertEq(q1(), 0); + +// Large and out-of-line + +var ab2 = new ArrayBuffer(OUT_OF_LINE_INT8_AMOUNT); +var ta2 = new Int8Array(ab2); +function q2() { return ta2.length; } +q2(); +q2(); +detachArrayBuffer(ab2); +assertEq(q2(), 0); |