Chromium Code Reviews| Index: src/interpreter/bytecodes.cc |
| diff --git a/src/interpreter/bytecodes.cc b/src/interpreter/bytecodes.cc |
| index 46134b7f1d418c52dbecbfe82775ad20586f08cf..bce56728f8be9475a03c1f5bb431b4a811114d98 100644 |
| --- a/src/interpreter/bytecodes.cc |
| +++ b/src/interpreter/bytecodes.cc |
| @@ -276,6 +276,32 @@ bool Bytecodes::IsAccumulatorLoadWithoutEffects(Bytecode bytecode) { |
| } |
| } |
| +bool Bytecodes::IsJumpWithoutEffects(Bytecode bytecode) { |
|
rmcilroy
2016/06/08 11:31:40
// static
oth
2016/06/08 14:18:25
Done.
|
| + return IsJump(bytecode) && !IsJumpIfToBoolean(bytecode); |
| +} |
| + |
|
rmcilroy
2016/06/08 11:31:40
// static
oth
2016/06/08 14:18:25
Done.
|
| +bool Bytecodes::IsRegisterLoadWithoutEffects(Bytecode bytecode) { |
| + switch (bytecode) { |
| + case Bytecode::kMov: |
| + case Bytecode::kPopContext: |
| + case Bytecode::kPushContext: |
| + case Bytecode::kStar: |
| + case Bytecode::kLdrUndefined: |
| + return true; |
| + default: |
| + return false; |
| + } |
| +} |
| + |
| +// static |
| +bool Bytecodes::IsWithoutExternalSideEffects(Bytecode bytecode) { |
| + // These bytecodes only manipulate interpreter frame state and will |
| + // never throw. |
| + return (IsAccumulatorLoadWithoutEffects(bytecode) || |
| + IsRegisterLoadWithoutEffects(bytecode) || |
| + bytecode == Bytecode::kNop || IsJumpWithoutEffects(bytecode)); |
| +} |
| + |
| // static |
| OperandType Bytecodes::GetOperandType(Bytecode bytecode, int i) { |
| DCHECK_LE(bytecode, Bytecode::kLast); |
| @@ -488,15 +514,6 @@ bool Bytecodes::IsPrefixScalingBytecode(Bytecode bytecode) { |
| } |
| // static |
| -bool Bytecodes::IsWithoutExternalSideEffects(Bytecode bytecode) { |
| - // These bytecodes only manipulate interpreter frame state and will |
| - // never throw. |
| - return (IsAccumulatorLoadWithoutEffects(bytecode) || IsLdarOrStar(bytecode) || |
| - bytecode == Bytecode::kMov || bytecode == Bytecode::kNop || |
| - IsJump(bytecode)); |
| -} |
| - |
| -// static |
| bool Bytecodes::IsJumpOrReturn(Bytecode bytecode) { |
| return bytecode == Bytecode::kReturn || IsJump(bytecode); |
| } |