[compiler] Fix issue with ALIGNAS on InstructionOperand on MSVC x86

MSVC on x86 has issues with ALIGNAS(8) on InstructionOperand,
but does align the object to 8 bytes anyway. As a work-around,
avoid ALIGNAS for InstructionOperand on MSVC x86.

BUG=v8:10796

Change-Id: Iabb465489d97f9518a4429e8d78c06296539ed97
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2358680
Reviewed-by: Tobias Tebbi <tebbi@chromium.org>
Commit-Queue: Ross McIlroy <rmcilroy@chromium.org>
Cr-Commit-Position: refs/heads/master@{#69450}
This commit is contained in:
Ross McIlroy 2020-08-17 17:52:21 +01:00 committed by Commit Bot
parent 4f4b061dd0
commit 0cdb250161

View File

@ -33,7 +33,16 @@ namespace compiler {
class Schedule;
class SourcePositionTable;
class V8_EXPORT_PRIVATE ALIGNAS(8) InstructionOperand {
#if defined(V8_CC_MSVC) && defined(V8_TARGET_ARCH_IA32)
// MSVC on x86 has issues with ALIGNAS(8) on InstructionOperand, but does
// align the object to 8 bytes anyway (covered by a static assert below).
// See crbug.com/v8/10796
#define INSTRUCTION_OPERAND_ALIGN
#else
#define INSTRUCTION_OPERAND_ALIGN ALIGNAS(8)
#endif
class V8_EXPORT_PRIVATE INSTRUCTION_OPERAND_ALIGN InstructionOperand {
public:
static const int kInvalidVirtualRegister = -1;
@ -1693,6 +1702,7 @@ class V8_EXPORT_PRIVATE InstructionSequence final
V8_EXPORT_PRIVATE std::ostream& operator<<(std::ostream&,
const InstructionSequence&);
#undef INSTRUCTION_OPERAND_ALIGN
} // namespace compiler
} // namespace internal