LibJS: Optimize array destructuring assignment for builtin iterators

...by avoiding `{ value, done }` iterator result value allocation. This
change applies the same otimization 81b6a11 added for `for..in` and
`for..of`.

Makes following micro benchmark go 22% faster on my computer:
```js
function f() {
    const arr = [];
    for (let i = 0; i < 10_000_000; i++) {
        arr.push([i]);
    }
    let sum = 0;
    for (let [i] of arr) {
        sum += i;
    }
}

f();
```
This commit is contained in:
Aliaksandr Kalenik 2025-05-01 16:05:24 +03:00 committed by Alexander Kalenik
commit 60bd5012fe
Notes: github-actions[bot] 2025-05-01 13:58:54 +00:00
4 changed files with 11 additions and 15 deletions

View file

@ -51,7 +51,6 @@
O(EnterObjectEnvironment) \
O(EnterUnwindContext) \
O(Exp) \
O(ForOfNext) \
O(GetById) \
O(GetByIdWithThis) \
O(GetByValue) \
@ -81,6 +80,7 @@
O(InstanceOf) \
O(IteratorClose) \
O(IteratorNext) \
O(IteratorNextUnpack) \
O(IteratorToArray) \
O(Jump) \
O(JumpFalse) \