Commit d628f3a
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 #10323
PR-URL: #10569
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Evan Lucas <evanlucas@me.com>
Reviewed-By: Brian White <mscdex@mscdex.net>
Reviewed-By: Jackson Tian <shyvo1987@gmail.com>
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>1 parent b2d0c44 commit d628f3aCopy full SHA for d628f3a
File tree
Expand file treeCollapse file tree
1 file changed
+6
-2
lines changedOpen diff view settings
Filter options
- lib
Expand file treeCollapse file tree
1 file changed
+6
-2
lines changedOpen diff view settings
Collapse file
+6-2Lines changed: 6 additions & 2 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
173 | 173 | |
174 | 174 | |
175 | 175 | |
176 | | - |
177 | | - |
| 176 | + |
| 177 | + |
| 178 | + |
| 179 | + |
| 180 | + |
| 181 | + |
178 | 182 | |
179 | 183 | |
180 | 184 | |
|
0 commit comments