Index: src/interpreter/bytecodes.h |
diff --git a/src/interpreter/bytecodes.h b/src/interpreter/bytecodes.h |
index bc54145950043cd6398505ea53a069db5419b8d3..05c0afe8f6bacd2ea33142eeee53d78c38762f6f 100644 |
--- a/src/interpreter/bytecodes.h |
+++ b/src/interpreter/bytecodes.h |
@@ -471,6 +471,12 @@ class V8_EXPORT_PRIVATE Bytecodes final { |
IsConditionalJumpConstant(bytecode); |
} |
+ // Returns true if the bytecode is an unconditional jump. |
+ static CONSTEXPR bool IsUnconditionalJump(Bytecode bytecode) { |
+ return bytecode == Bytecode::kJump || bytecode == Bytecode::kJumpConstant || |
+ bytecode == Bytecode::kJumpLoop; |
+ } |
+ |
// Returns true if the bytecode is a jump or a conditional jump taking |
// an immediate byte operand (OperandType::kImm). |
static CONSTEXPR bool IsJumpImmediate(Bytecode bytecode) { |
@@ -500,6 +506,12 @@ class V8_EXPORT_PRIVATE Bytecodes final { |
return IsJumpImmediate(bytecode) || IsJumpConstant(bytecode); |
} |
+ // Returns true if the bytecode is a forward jump or conditional jump taking |
+ // any kind of operand. |
+ static CONSTEXPR bool IsForwardJump(Bytecode bytecode) { |
+ return bytecode != Bytecode::kJumpLoop && IsJump(bytecode); |
+ } |
+ |
// Returns true if the bytecode is a conditional jump, a jump, or a return. |
static CONSTEXPR bool IsJumpOrReturn(Bytecode bytecode) { |
return bytecode == Bytecode::kReturn || IsJump(bytecode); |