Unverified Commit 26f2a6e8 authored by Teddy Katz's avatar Teddy Katz
Browse files

util: avoid out-of-bounds arguments index access

This updates util.inspect() to avoid accessing out-of-range indices of
the `arguments` object, which is known to cause optimization bailout.

Based on an average of 10 runs of the benchmark in
`benchmark/util/inspect.js`, this change improves the performance of
`util.inspect` by about 10%.

Relates to https://github.com/nodejs/node/issues/10323

PR-URL: https://github.com/nodejs/node/pull/10569


Reviewed-By: default avatarColin Ihrig <cjihrig@gmail.com>
Reviewed-By: default avatarEvan Lucas <evanlucas@me.com>
Reviewed-By: default avatarBrian White <mscdex@mscdex.net>
Reviewed-By: default avatarJackson Tian <shyvo1987@gmail.com>
Reviewed-By: default avatarJeremiah Senkpiel <fishrock123@rocketmail.com>
Reviewed-By: default avatarJames M Snell <jasnell@gmail.com>
parent 398229ac
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment