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

[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: 's avatarLeszek Swirski <leszeks@chromium.org>
Cr-Commit-Position: refs/heads/main@{#81113}
parent 1ce039e1
......@@ -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
#if V8_TARGET_ARCH_X64 || V8_TARGET_ARCH_ARM64
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 : 20);
V8_EXTERNAL_CODE_SPACE_BOOL ? 4 : (COMPRESS_POINTERS_BOOL ? 8 : 52);
#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
#if V8_TARGET_ARCH_X64 || V8_TARGET_ARCH_ARM64
// 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
#elif V8_TARGET_ARCH_X64 || V8_TARGET_ARCH_ARM64
// 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
#if V8_TARGET_ARCH_X64 || V8_TARGET_ARCH_ARM64
// 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