From cfdb4e07911801f1426f8c793a3022830d1f5c36 Mon Sep 17 00:00:00 2001 From: Clemens Backes Date: Fri, 13 Jan 2023 17:49:26 +0100 Subject: [PATCH] Reland "Use preserve_most calling conventions for Zone::Expand" This is a reland of commit 48fee7d232184d8ad8cadea2a5e59e0c20407d3b. We now use the "COMPONENT_BUILD" macro to disable preserve_all, which covers more uses (like building libbase or libplatform, where we would otherwise have to check for BUILDING_V8_BASE_SHARED or BUILDING_V8_PLATFORM_SHARED). Original change's description: > Use preserve_most calling conventions for Zone::NewExpand > > The zone uses bump allocation in the fast-path, and falls back to > allocating a new segment if there is not enough space. > Since this is rarely executed and zone allocations happen a lot, we > should mark `Zone::NewExpand` as "preserve_most" to make > `Zone::Allocate` as fast and slim as possible. > > R=bikineev@chromium.org, leszeks@chromium.org > > Change-Id: I0d592a35440bc3d61ca04425fc2f98c8a8bbbaae > Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4146436 > Reviewed-by: Leszek Swirski > Reviewed-by: Anton Bikineev > Commit-Queue: Clemens Backes > Cr-Commit-Position: refs/heads/main@{#85258} Change-Id: I1413d47d84f384a724850a6f5b60adf75bba84f8 Cq-Include-Trybots: luci.v8.try:v8_win64_dbg Cq-Include-Trybots: luci.v8.try:v8_win_compile_rel Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4162931 Reviewed-by: Leszek Swirski Commit-Queue: Clemens Backes Reviewed-by: Anton Bikineev Cr-Commit-Position: refs/heads/main@{#85310} --- include/v8config.h | 2 +- src/zone/zone.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/include/v8config.h b/include/v8config.h index 5ea6740f61..a967d92c39 100644 --- a/include/v8config.h +++ b/include/v8config.h @@ -351,7 +351,7 @@ path. Add it with -I to the command line // for now. #if (defined(_M_X64) || defined(__x86_64__) || defined(__AARCH64EL__) || \ defined(_M_ARM64)) /* x64 or arm64 */ \ - && !defined(BUILDING_V8_SHARED) && !defined(USING_V8_SHARED) + && !defined(COMPONENT_BUILD) # define V8_HAS_ATTRIBUTE_PRESERVE_MOST (__has_attribute(preserve_most)) #endif # define V8_HAS_ATTRIBUTE_VISIBILITY (__has_attribute(visibility)) diff --git a/src/zone/zone.h b/src/zone/zone.h index eac6cc0a47..3ddda6b2df 100644 --- a/src/zone/zone.h +++ b/src/zone/zone.h @@ -235,7 +235,7 @@ class V8_EXPORT_PRIVATE Zone final { // Expand the Zone to hold at least 'size' more bytes. // Should only be called if there is not enough room in the Zone already. - V8_NOINLINE void Expand(size_t size); + V8_NOINLINE V8_PRESERVE_MOST void Expand(size_t size); // The free region in the current (front) segment is represented as // the half-open interval [position, limit). The 'position' variable