From b985e8d83bf326c46704741791252daebbe8e1a8 Mon Sep 17 00:00:00 2001 From: Leszek Swirski Date: Mon, 9 Jan 2023 15:10:46 +0000 Subject: [PATCH] Revert "[x64] Make {Assembler::GrowBuffer} preserve most registers" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 8fe57bf6415748d35567db47a338458374be7bb6. Reason for revert: Looks like preserve_most is too experimental after all: https://ci.chromium.org/ui/p/v8/builders/ci/V8%20Linux64%20-%20shared/24208/overview Original change's description: > [x64] Make {Assembler::GrowBuffer} preserve most registers > > This makes many callers of {GrowBuffer} a lot slimmer, by avoiding the > need to push and pop all values in otherwise caller-saved registers. > E.g. {emit_mov(Register, Operand)} was measured to be ~2x faster (from > 2.3% of Liftoff compilation time to 1.2%). > > R=​bikineev@chromium.org > CC=​dlehmann@chromium.org > > Bug: v8:13565 > Change-Id: I681747a491548adf1374187cd9f37520c153ef1a > Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4127230 > Reviewed-by: Leszek Swirski > Commit-Queue: Clemens Backes > Reviewed-by: Anton Bikineev > Cr-Commit-Position: refs/heads/main@{#85147} Bug: v8:13565 Change-Id: I80207ab3cc84958c3c453e63cc4062a408e05a27 No-Presubmit: true No-Tree-Checks: true No-Try: true Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4147787 Commit-Queue: Rubber Stamper Auto-Submit: Leszek Swirski Bot-Commit: Rubber Stamper Cr-Commit-Position: refs/heads/main@{#85149} --- include/v8config.h | 16 ---------------- src/codegen/x64/assembler-x64.h | 2 +- 2 files changed, 1 insertion(+), 17 deletions(-) diff --git a/include/v8config.h b/include/v8config.h index 5d11af0292..c79cd04e0f 100644 --- a/include/v8config.h +++ b/include/v8config.h @@ -346,7 +346,6 @@ path. Add it with -I to the command line # define V8_HAS_ATTRIBUTE_NONNULL (__has_attribute(nonnull)) # define V8_HAS_ATTRIBUTE_NOINLINE (__has_attribute(noinline)) # define V8_HAS_ATTRIBUTE_UNUSED (__has_attribute(unused)) -# define V8_HAS_ATTRIBUTE_PRESERVE_MOST (__has_attribute(preserve_most)) # define V8_HAS_ATTRIBUTE_VISIBILITY (__has_attribute(visibility)) # define V8_HAS_ATTRIBUTE_WARN_UNUSED_RESULT \ (__has_attribute(warn_unused_result)) @@ -505,21 +504,6 @@ path. Add it with -I to the command line #endif -// A macro used to change the calling conventions to preserve all registers (no -// caller-saved registers). Use this for cold functions called from hot -// functions. -// Note: The attribute is considered experimental, so apply with care. Also, -// "preserve_most" is currently not handling the return value correctly, so only -// use it for functions returning void (see https://reviews.llvm.org/D141020). -// Use like: -// V8_NOINLINE V8_PRESERVE_MOST void UnlikelyMethod(); -#if V8_HAS_ATTRIBUTE_PRESERVE_MOST -# define V8_PRESERVE_MOST __attribute__((preserve_most)) -#else -# define V8_PRESERVE_MOST /* NOT SUPPORTED */ -#endif - - // A macro (V8_DEPRECATED) to mark classes or functions as deprecated. #if defined(V8_DEPRECATION_WARNINGS) # define V8_DEPRECATED(message) [[deprecated(message)]] diff --git a/src/codegen/x64/assembler-x64.h b/src/codegen/x64/assembler-x64.h index 1b34ae073a..afc5798482 100644 --- a/src/codegen/x64/assembler-x64.h +++ b/src/codegen/x64/assembler-x64.h @@ -2131,7 +2131,7 @@ class V8_EXPORT_PRIVATE Assembler : public AssemblerBase { } // Code emission. - V8_NOINLINE V8_PRESERVE_MOST void GrowBuffer(); + void GrowBuffer(); template static uint8_t* emit(uint8_t* __restrict pc, T t) {