diff options
Diffstat (limited to 'chromium/v8/src/codegen/riscv64/constants-riscv64.h')
-rw-r--r-- | chromium/v8/src/codegen/riscv64/constants-riscv64.h | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/chromium/v8/src/codegen/riscv64/constants-riscv64.h b/chromium/v8/src/codegen/riscv64/constants-riscv64.h index 3b5ffff6dac..c8f54d8f7f9 100644 --- a/chromium/v8/src/codegen/riscv64/constants-riscv64.h +++ b/chromium/v8/src/codegen/riscv64/constants-riscv64.h @@ -8,6 +8,7 @@ #include "src/base/logging.h" #include "src/base/macros.h" #include "src/common/globals.h" +#include "src/flags/flags.h" // UNIMPLEMENTED_ macro for RISCV. #ifdef DEBUG @@ -55,8 +56,7 @@ const uint32_t kLessSignificantWordInDoublewordOffset = 4; namespace v8 { namespace internal { -// TODO(sigurds): Change this value once we use relative jumps. -constexpr size_t kMaxPCRelativeCodeRangeInMB = 0; +constexpr size_t kMaxPCRelativeCodeRangeInMB = 4096; // ----------------------------------------------------------------------------- // Registers and FPURegisters. @@ -727,18 +727,25 @@ class InstructionBase { kUnsupported = -1 }; + inline bool IsIllegalInstruction() const { + uint8_t FirstHalfWord = *reinterpret_cast<const uint16_t*>(this); + return FirstHalfWord == 0; + } + inline bool IsShortInstruction() const { uint8_t FirstByte = *reinterpret_cast<const uint8_t*>(this); return (FirstByte & 0x03) <= C2; } inline uint8_t InstructionSize() const { - return this->IsShortInstruction() ? kShortInstrSize : kInstrSize; + return (FLAG_riscv_c_extension && this->IsShortInstruction()) + ? kShortInstrSize + : kInstrSize; } // Get the raw instruction bits. inline Instr InstructionBits() const { - if (this->IsShortInstruction()) { + if (FLAG_riscv_c_extension && this->IsShortInstruction()) { return 0x0000FFFF & (*reinterpret_cast<const ShortInstr*>(this)); } return *reinterpret_cast<const Instr*>(this); |