Chromium Code Reviews| Index: src/interpreter/bytecode-array-iterator.cc |
| diff --git a/src/interpreter/bytecode-array-iterator.cc b/src/interpreter/bytecode-array-iterator.cc |
| index 6fde67f938cff42bf0689c9db010931e2ff602c7..2839fe46942f5de1edade2a5900ff6653c7d3dff 100644 |
| --- a/src/interpreter/bytecode-array-iterator.cc |
| +++ b/src/interpreter/bytecode-array-iterator.cc |
| @@ -100,6 +100,33 @@ Register BytecodeArrayIterator::GetRegisterOperand(int operand_index) const { |
| return Register(); |
| } |
| +int BytecodeArrayIterator::GetRegisterOperandRange(int operand_index) const { |
| + interpreter::OperandType operand_type = |
| + Bytecodes::GetOperandType(current_bytecode(), operand_index); |
| + DCHECK(Bytecodes::IsRegisterOperandType(operand_type)); |
| + switch (operand_type) { |
| + case OperandType::kRegPair8: |
| + case OperandType::kRegPair16: |
| + case OperandType::kRegOutPair8: |
| + case OperandType::kRegOutPair16: |
| + return 2; |
| + case OperandType::kRegOutTriple8: |
| + case OperandType::kRegOutTriple16: |
| + return 3; |
| + default: { |
| + if (operand_index + 1 != |
| + Bytecodes::NumberOfOperands(current_bytecode())) { |
| + OperandType next_operand_type = |
|
oth
2016/01/27 15:10:09
Can you add a TODO(oth) here to update bytecodes s
rmcilroy
2016/01/28 16:39:51
Done.
|
| + Bytecodes::GetOperandType(current_bytecode(), operand_index + 1); |
| + if (next_operand_type == OperandType::kRegCount8 || |
| + next_operand_type == OperandType::kRegCount16) { |
| + return GetCountOperand(operand_index + 1); |
| + } |
| + } |
| + return 1; |
| + } |
| + } |
| +} |
| Handle<Object> BytecodeArrayIterator::GetConstantForIndexOperand( |
| int operand_index) const { |