Commit b81af94a authored by Igor Sheludko's avatar Igor Sheludko Committed by V8 LUCI CQ

Revert "[arm64] Increase code alignment to 64"

This reverts commit 319e747a.

Reason for revert: it brought unexpected performance regressions.

Original change's description:
> [arm64] Increase code alignment to 64
>
> This should fix unexpected regressions which occur after builtins
> modifications.
>
> This CL affects alignment of embedded builtins on all configurations
> and Code header size only for non-pointer compression configuration.
>
> Bug: v8:11708
> Change-Id: I8058197c5b768a699e7f52446424013e86203b57
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3700392
> Commit-Queue: Igor Sheludko <ishell@chromium.org>
> Reviewed-by: Leszek Swirski <leszeks@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#81113}

Bug: v8:11708
Change-Id: I238e799284d59e80dee244b240fe2a72c33e83b0
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3716485
Auto-Submit: Igor Sheludko <ishell@chromium.org>
Reviewed-by: 's avatarToon Verwaest <verwaest@chromium.org>
Commit-Queue: Toon Verwaest <verwaest@chromium.org>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Cr-Commit-Position: refs/heads/main@{#81292}
parent 9076fce8
......@@ -649,7 +649,7 @@ constexpr intptr_t kDoubleAlignmentMask = kDoubleAlignment - 1;
// Desired alignment for generated code is 64 bytes on x64 (to allow 64-bytes
// loop header alignment) and 32 bytes (to improve cache line utilization) on
// other architectures.
#if V8_TARGET_ARCH_X64 || V8_TARGET_ARCH_ARM64
#if V8_TARGET_ARCH_X64
constexpr int kCodeAlignmentBits = 6;
#elif V8_TARGET_ARCH_PPC64
// 64 byte alignment is needed on ppc64 to make sure p10 prefixed instructions
......
......@@ -668,7 +668,7 @@ class Code : public HeapObject {
// due to padding for code alignment.
#if V8_TARGET_ARCH_ARM64
static constexpr int kHeaderPaddingSize =
V8_EXTERNAL_CODE_SPACE_BOOL ? 4 : (COMPRESS_POINTERS_BOOL ? 8 : 52);
V8_EXTERNAL_CODE_SPACE_BOOL ? 4 : (COMPRESS_POINTERS_BOOL ? 8 : 20);
#elif V8_TARGET_ARCH_MIPS64
static constexpr int kHeaderPaddingSize = 20;
#elif V8_TARGET_ARCH_LOONG64
......
......@@ -53,7 +53,7 @@ void PlatformEmbeddedFileWriterAIX::DeclareSymbolGlobal(const char* name) {
}
void PlatformEmbeddedFileWriterAIX::AlignToCodeAlignment() {
#if V8_TARGET_ARCH_X64 || V8_TARGET_ARCH_ARM64
#if V8_TARGET_ARCH_X64
// On x64 use 64-bytes code alignment to allow 64-bytes loop header alignment.
static_assert((1 << 6) >= kCodeAlignment);
fprintf(fp_, ".align 6\n");
......
......@@ -67,7 +67,7 @@ void PlatformEmbeddedFileWriterGeneric::AlignToCodeAlignment() {
// On these architectures and platforms, we remap the builtins, so need these
// to be aligned on a page boundary.
fprintf(fp_, ".balign 4096\n");
#elif V8_TARGET_ARCH_X64 || V8_TARGET_ARCH_ARM64
#elif V8_TARGET_ARCH_X64
// On x64 use 64-bytes code alignment to allow 64-bytes loop header alignment.
static_assert(64 >= kCodeAlignment);
fprintf(fp_, ".balign 64\n");
......
......@@ -609,7 +609,7 @@ void PlatformEmbeddedFileWriterWin::DeclareSymbolGlobal(const char* name) {
}
void PlatformEmbeddedFileWriterWin::AlignToCodeAlignment() {
#if V8_TARGET_ARCH_X64 || V8_TARGET_ARCH_ARM64
#if V8_TARGET_ARCH_X64
// On x64 use 64-bytes code alignment to allow 64-bytes loop header alignment.
static_assert(64 >= kCodeAlignment);
fprintf(fp_, ".balign 64\n");
......
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