Chromium Code Reviews| Index: src/interpreter/bytecodes.cc |
| diff --git a/src/interpreter/bytecodes.cc b/src/interpreter/bytecodes.cc |
| index 74b8904b29f91872d3c62001984ce6ba1c5bad47..f43e7c97161146da1091eb25239483795ab5435d 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::IsLocalControlFlow(Bytecode bytecode) { |
| + return bytecode == Bytecode::kReturn || IsJump(bytecode); |
|
Michael Starzinger
2015/12/16 12:40:12
nit: The name is not fully fitting, because the li
oth
2015/12/16 14:17:06
Renamed to IsJumpOrReturn(). Pedants might say ret
|
| +} |
| + |
| + |
| +// static |
| std::ostream& Bytecodes::Decode(std::ostream& os, const uint8_t* bytecode_start, |
| int parameter_count) { |
| Vector<char> buf = Vector<char>::New(50); |