diff options
Diffstat (limited to 'deps/v8/src/interpreter/bytecode-operands.h')
-rw-r--r-- | deps/v8/src/interpreter/bytecode-operands.h | 54 |
1 files changed, 35 insertions, 19 deletions
diff --git a/deps/v8/src/interpreter/bytecode-operands.h b/deps/v8/src/interpreter/bytecode-operands.h index 4f953341d4..c9cca226ab 100644 --- a/deps/v8/src/interpreter/bytecode-operands.h +++ b/deps/v8/src/interpreter/bytecode-operands.h @@ -109,27 +109,29 @@ enum class OperandType : uint8_t { #undef COUNT_OPERAND_TYPES }; -enum class AccumulatorUse : uint8_t { +enum class ImplicitRegisterUse : uint8_t { kNone = 0, - kRead = 1 << 0, - kWrite = 1 << 1, - kReadWrite = kRead | kWrite + kReadAccumulator = 1 << 0, + kWriteAccumulator = 1 << 1, + kWriteShortStar = 1 << 2, + kReadWriteAccumulator = kReadAccumulator | kWriteAccumulator, + kReadAccumulatorWriteShortStar = kReadAccumulator | kWriteShortStar }; -constexpr inline AccumulatorUse operator&(AccumulatorUse lhs, - AccumulatorUse rhs) { - return static_cast<AccumulatorUse>(static_cast<int>(lhs) & - static_cast<int>(rhs)); +constexpr inline ImplicitRegisterUse operator&(ImplicitRegisterUse lhs, + ImplicitRegisterUse rhs) { + return static_cast<ImplicitRegisterUse>(static_cast<int>(lhs) & + static_cast<int>(rhs)); } -constexpr inline AccumulatorUse operator|(AccumulatorUse lhs, - AccumulatorUse rhs) { - return static_cast<AccumulatorUse>(static_cast<int>(lhs) | - static_cast<int>(rhs)); +constexpr inline ImplicitRegisterUse operator|(ImplicitRegisterUse lhs, + ImplicitRegisterUse rhs) { + return static_cast<ImplicitRegisterUse>(static_cast<int>(lhs) | + static_cast<int>(rhs)); } V8_EXPORT_PRIVATE std::ostream& operator<<(std::ostream& os, - const AccumulatorUse& use); + const ImplicitRegisterUse& use); V8_EXPORT_PRIVATE std::ostream& operator<<(std::ostream& os, const OperandScale& operand_scale); V8_EXPORT_PRIVATE std::ostream& operator<<(std::ostream& os, @@ -170,14 +172,28 @@ class BytecodeOperands : public AllStatic { return static_cast<int>(operand_scale) >> 1; } - // Returns true if |accumulator_use| reads the accumulator. - static constexpr bool ReadsAccumulator(AccumulatorUse accumulator_use) { - return (accumulator_use & AccumulatorUse::kRead) == AccumulatorUse::kRead; + // Returns true if |implicit_register_use| reads the + // accumulator. + static constexpr bool ReadsAccumulator( + ImplicitRegisterUse implicit_register_use) { + return (implicit_register_use & ImplicitRegisterUse::kReadAccumulator) == + ImplicitRegisterUse::kReadAccumulator; } - // Returns true if |accumulator_use| writes the accumulator. - static constexpr bool WritesAccumulator(AccumulatorUse accumulator_use) { - return (accumulator_use & AccumulatorUse::kWrite) == AccumulatorUse::kWrite; + // Returns true if |implicit_register_use| writes the + // accumulator. + static constexpr bool WritesAccumulator( + ImplicitRegisterUse implicit_register_use) { + return (implicit_register_use & ImplicitRegisterUse::kWriteAccumulator) == + ImplicitRegisterUse::kWriteAccumulator; + } + + // Returns true if |implicit_register_use| writes to a + // register not specified by an operand. + static constexpr bool WritesImplicitRegister( + ImplicitRegisterUse implicit_register_use) { + return (implicit_register_use & ImplicitRegisterUse::kWriteShortStar) == + ImplicitRegisterUse::kWriteShortStar; } // Returns true if |operand_type| is a scalable signed byte. |