Commit 5333d90e authored by Lei Zhang's avatar Lei Zhang Committed by V8 LUCI CQ

Fix MSVC C4065 warning in HasMemoryAccessMode().

Avoid generating switch statements with only a default case. Instead,
when there are no instructions that can trap, simply have
HasMemoryAccessMode() return false. This avoids a MSVC warning when
doing a 32-bit build.

To do this, remove empty TARGET_ARCH_OPCODE_WITH_MEMORY_ACCESS_MODE_LIST
definitions from instruction-codes-$arch.h files.

Change-Id: Ifed76eb9cbca169f30c188c1999e1e9be0b2c6aa
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3224807Reviewed-by: 's avatarClemens Backes <clemensb@chromium.org>
Reviewed-by: 's avatarMaya Lekova <mslekova@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
Cr-Commit-Position: refs/heads/main@{#77441}
parent 5bcd2037
...@@ -315,6 +315,7 @@ using AccessModeField = base::BitField<MemoryAccessMode, 30, 2>; ...@@ -315,6 +315,7 @@ using AccessModeField = base::BitField<MemoryAccessMode, 30, 2>;
// scary. {HasMemoryAccessMode} does not include these instructions, so they can // scary. {HasMemoryAccessMode} does not include these instructions, so they can
// be easily found by guarding encoding. // be easily found by guarding encoding.
inline bool HasMemoryAccessMode(ArchOpcode opcode) { inline bool HasMemoryAccessMode(ArchOpcode opcode) {
#if defined(TARGET_ARCH_OPCODE_WITH_MEMORY_ACCESS_MODE_LIST)
switch (opcode) { switch (opcode) {
#define CASE(Name) \ #define CASE(Name) \
case k##Name: \ case k##Name: \
...@@ -324,6 +325,9 @@ inline bool HasMemoryAccessMode(ArchOpcode opcode) { ...@@ -324,6 +325,9 @@ inline bool HasMemoryAccessMode(ArchOpcode opcode) {
default: default:
return false; return false;
} }
#else
return false;
#endif
} }
using DeoptImmedArgsCountField = base::BitField<int, 22, 2>; using DeoptImmedArgsCountField = base::BitField<int, 22, 2>;
......
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