Index: src/interpreter/bytecodes.cc |
diff --git a/src/interpreter/bytecodes.cc b/src/interpreter/bytecodes.cc |
index 74b8904b29f91872d3c62001984ce6ba1c5bad47..986e3d012e6c5a4cc34ae543eeac0db6276fb2d0 100644 |
--- a/src/interpreter/bytecodes.cc |
+++ b/src/interpreter/bytecodes.cc |
@@ -159,8 +159,8 @@ OperandSize Bytecodes::SizeOfOperand(OperandType operand_type) { |
// static |
-bool Bytecodes::IsJump(Bytecode bytecode) { |
- return bytecode == Bytecode::kJump || bytecode == Bytecode::kJumpIfTrue || |
+bool Bytecodes::IsConditionalJumpImmediate(Bytecode bytecode) { |
+ return bytecode == Bytecode::kJumpIfTrue || |
bytecode == Bytecode::kJumpIfFalse || |
bytecode == Bytecode::kJumpIfToBooleanTrue || |
bytecode == Bytecode::kJumpIfToBooleanFalse || |
@@ -170,18 +170,49 @@ bool Bytecodes::IsJump(Bytecode bytecode) { |
// static |
-bool Bytecodes::IsJumpConstant(Bytecode bytecode) { |
- return bytecode == Bytecode::kJumpConstant || |
- bytecode == Bytecode::kJumpIfTrueConstant || |
+bool Bytecodes::IsConditionalJumpConstant(Bytecode bytecode) { |
+ return bytecode == Bytecode::kJumpIfTrueConstant || |
bytecode == Bytecode::kJumpIfFalseConstant || |
bytecode == Bytecode::kJumpIfToBooleanTrueConstant || |
bytecode == Bytecode::kJumpIfToBooleanFalseConstant || |
- bytecode == Bytecode::kJumpIfNull || |
+ bytecode == Bytecode::kJumpIfNullConstant || |
bytecode == Bytecode::kJumpIfUndefinedConstant; |
} |
// static |
+bool Bytecodes::IsConditionalJump(Bytecode bytecode) { |
+ return IsConditionalJumpImmediate(bytecode) || |
+ IsConditionalJumpConstant(bytecode); |
+} |
+ |
+ |
+// static |
+bool Bytecodes::IsJumpImmediate(Bytecode bytecode) { |
+ return bytecode == Bytecode::kJump || IsConditionalJumpImmediate(bytecode); |
+} |
+ |
+ |
+// static |
+bool Bytecodes::IsJumpConstant(Bytecode bytecode) { |
+ return bytecode == Bytecode::kJumpConstant || |
+ IsConditionalJumpConstant(bytecode); |
+} |
+ |
+ |
+// static |
+bool Bytecodes::IsJump(Bytecode bytecode) { |
+ return IsJumpImmediate(bytecode) || IsJumpConstant(bytecode); |
+} |
+ |
+ |
+// static |
+bool Bytecodes::IsJumpOrReturn(Bytecode bytecode) { |
+ return bytecode == Bytecode::kReturn || IsJump(bytecode); |
+} |
+ |
+ |
+// static |
std::ostream& Bytecodes::Decode(std::ostream& os, const uint8_t* bytecode_start, |
int parameter_count) { |
Vector<char> buf = Vector<char>::New(50); |