Commit 1693abaf authored by Ng Zhi An's avatar Ng Zhi An Committed by Commit Bot

Check that opcodes fit within ArchOpcodeField

Strange things happen if we add too many opcodes such that we exceed the
number of bits ArchOpcodeField has, and in some arch (ARM64), we are
only one away from requiring 10 bits (at 0x1ff) now.

Bug: v8:10930
Change-Id: I8dc6b7e0822291f2403db4e4e1dfaf90b9416a8c
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2422843
Commit-Queue: Zhi An Ng <zhin@chromium.org>
Reviewed-by: 's avatarJakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/master@{#70061}
parent 64caf2b0
......@@ -270,6 +270,8 @@ using InstructionCode = uint32_t;
// continuation into a single InstructionCode which is stored as part of
// the instruction.
using ArchOpcodeField = base::BitField<ArchOpcode, 0, 9>;
static_assert(ArchOpcodeField::is_valid(kLastArchOpcode),
"All opcodes must fit in the 9-bit ArchOpcodeField.");
using AddressingModeField = base::BitField<AddressingMode, 9, 5>;
using FlagsModeField = base::BitField<FlagsMode, 14, 3>;
using FlagsConditionField = base::BitField<FlagsCondition, 17, 5>;
......
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