diff options
Diffstat (limited to 'deps/v8/src/interpreter/bytecode-operands.h')
-rw-r--r-- | deps/v8/src/interpreter/bytecode-operands.h | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/deps/v8/src/interpreter/bytecode-operands.h b/deps/v8/src/interpreter/bytecode-operands.h index 68e6800169..42d7445df0 100644 --- a/deps/v8/src/interpreter/bytecode-operands.h +++ b/deps/v8/src/interpreter/bytecode-operands.h @@ -114,8 +114,10 @@ enum class ImplicitRegisterUse : uint8_t { kNone = 0, kReadAccumulator = 1 << 0, kWriteAccumulator = 1 << 1, - kWriteShortStar = 1 << 2, + kClobberAccumulator = 1 << 2, + kWriteShortStar = 1 << 3, kReadWriteAccumulator = kReadAccumulator | kWriteAccumulator, + kReadAndClobberAccumulator = kReadAccumulator | kClobberAccumulator, kReadAccumulatorWriteShortStar = kReadAccumulator | kWriteShortStar }; @@ -187,6 +189,24 @@ class BytecodeOperands : public AllStatic { ImplicitRegisterUse::kWriteAccumulator; } + // Returns true if |implicit_register_use| clobbers the + // accumulator. + static constexpr bool ClobbersAccumulator( + ImplicitRegisterUse implicit_register_use) { + return (implicit_register_use & ImplicitRegisterUse::kClobberAccumulator) == + ImplicitRegisterUse::kClobberAccumulator; + } + + // Returns true if |implicit_register_use| writes or clobbers the + // accumulator. + static constexpr bool WritesOrClobbersAccumulator( + ImplicitRegisterUse implicit_register_use) { + return (implicit_register_use & + (ImplicitRegisterUse::kWriteAccumulator | + ImplicitRegisterUse::kClobberAccumulator)) != + ImplicitRegisterUse::kNone; + } + // Returns true if |implicit_register_use| writes to a // register not specified by an operand. static constexpr bool WritesImplicitRegister( |