[wasm] Make stack growing cheap to call

The method to grow the capacity for the value stack is rarely called.
Make it preserve most registers. This makes callers slimmer and faster.

R=dlehmann@chromium.org

Bug: v8:13565
Change-Id: If4bb8cbd7a61852af1d07b83d0881110c5e91528
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4136714
Commit-Queue: Clemens Backes <clemensb@chromium.org>
Reviewed-by: Daniel Lehmann <dlehmann@chromium.org>
Cr-Commit-Position: refs/heads/main@{#85285}
This commit is contained in:
Clemens Backes 2023-01-12 12:38:15 +01:00 committed by V8 LUCI CQ
parent d7d5049cfa
commit 249d11e8ab

View File

@ -1261,7 +1261,7 @@ class FastZoneVector {
} }
private: private:
V8_NOINLINE void Grow(int slots_needed, Zone* zone) { V8_NOINLINE V8_PRESERVE_MOST void Grow(int slots_needed, Zone* zone) {
size_t new_capacity = std::max( size_t new_capacity = std::max(
size_t{8}, base::bits::RoundUpToPowerOfTwo(size() + slots_needed)); size_t{8}, base::bits::RoundUpToPowerOfTwo(size() + slots_needed));
CHECK_GE(kMaxUInt32, new_capacity); CHECK_GE(kMaxUInt32, new_capacity);