Commit bfe36a2e authored by Clemens Backes's avatar Clemens Backes Committed by V8 LUCI CQ

[liftoff] Pre-reserve some space for OOL code

The {AddOutOfLineTrap} method shows up with several percent of runtime
in performance profiles. The majority of that was spent copying entries
when growing the underlying vector.
Pre-reserving space in that vector removes most of that overhead.

R=thibaudm@chromium.org

Change-Id: I1befb75b070d4f803770c2afcc5c82ffb9bfb522
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3688511Reviewed-by: 's avatarThibaud Michaud <thibaudm@chromium.org>
Commit-Queue: Clemens Backes <clemensb@chromium.org>
Cr-Commit-Position: refs/heads/main@{#80943}
parent e51b03a0
......@@ -511,6 +511,11 @@ class LiftoffCompiler {
handlers_(compilation_zone),
max_steps_(options.max_steps),
nondeterminism_(options.nondeterminism) {
// We often see huge numbers of traps per function, so pre-reserve some
// space in that vector. 128 entries is enough for ~94% of functions on
// modern modules, as of 2022-06-03.
out_of_line_code_.reserve(128);
DCHECK(options.is_initialized());
// If there are no breakpoints, both pointers should be nullptr.
DCHECK_IMPLIES(
......
Markdown is supported
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