Index: src/interpreter/bytecode-array-iterator.cc |
diff --git a/src/interpreter/bytecode-array-iterator.cc b/src/interpreter/bytecode-array-iterator.cc |
index 84be6cc676c86119819c7d16c590d11e2cd39695..076b8d31f6bce577ceef240e60cc5eb920981782 100644 |
--- a/src/interpreter/bytecode-array-iterator.cc |
+++ b/src/interpreter/bytecode-array-iterator.cc |
@@ -32,31 +32,34 @@ Bytecode BytecodeArrayIterator::current_bytecode() const { |
} |
-uint8_t BytecodeArrayIterator::GetOperand(int operand_index, |
- OperandType operand_type) const { |
+uint8_t BytecodeArrayIterator::GetRawOperand(int operand_index) const { |
oth
2015/09/24 10:14:00
Although more work in the test, making GetOperand
rmcilroy
2015/09/24 11:20:12
Sounds good, done.
|
DCHECK_GE(operand_index, 0); |
DCHECK_LT(operand_index, Bytecodes::NumberOfOperands(current_bytecode())); |
- DCHECK_EQ(operand_type, |
- Bytecodes::GetOperandType(current_bytecode(), operand_index)); |
int operands_start = bytecode_offset_ + 1; |
return bytecode_array()->get(operands_start + operand_index); |
} |
int8_t BytecodeArrayIterator::GetSmi8Operand(int operand_index) const { |
- uint8_t operand = GetOperand(operand_index, OperandType::kImm8); |
+ DCHECK_EQ(OperandType::kImm8, |
+ Bytecodes::GetOperandType(current_bytecode(), operand_index)); |
+ uint8_t operand = GetRawOperand(operand_index); |
return static_cast<int8_t>(operand); |
} |
int BytecodeArrayIterator::GetIndexOperand(int operand_index) const { |
- uint8_t operand = GetOperand(operand_index, OperandType::kIdx); |
+ DCHECK_EQ(OperandType::kIdx, |
+ Bytecodes::GetOperandType(current_bytecode(), operand_index)); |
+ uint8_t operand = GetRawOperand(operand_index); |
return static_cast<int>(operand); |
} |
Register BytecodeArrayIterator::GetRegisterOperand(int operand_index) const { |
- uint8_t operand = GetOperand(operand_index, OperandType::kReg); |
+ DCHECK_EQ(OperandType::kReg, |
+ Bytecodes::GetOperandType(current_bytecode(), operand_index)); |
+ uint8_t operand = GetRawOperand(operand_index); |
return Register::FromOperand(operand); |
} |