Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(393)

Unified Diff: src/interpreter/bytecode-array-iterator.cc

Issue 1947403002: [interpreter] Introduce bytecode generation pipeline. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix return type of BytecodeSourceInfo::is_statement() Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: src/interpreter/bytecode-array-iterator.cc
diff --git a/src/interpreter/bytecode-array-iterator.cc b/src/interpreter/bytecode-array-iterator.cc
index a17efcb6ca4b5a36c240e32474fe0ef92834e96a..ec5e26b871c765f72afaf54d449103312711b946 100644
--- a/src/interpreter/bytecode-array-iterator.cc
+++ b/src/interpreter/bytecode-array-iterator.cc
@@ -131,23 +131,14 @@ 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::kRegPair:
- case OperandType::kRegOutPair:
- return 2;
- case OperandType::kRegOutTriple:
- return 3;
- default: {
- if (operand_index + 1 !=
- Bytecodes::NumberOfOperands(current_bytecode())) {
- OperandType next_operand_type =
- Bytecodes::GetOperandType(current_bytecode(), operand_index + 1);
- if (OperandType::kRegCount == next_operand_type) {
- return GetRegisterCountOperand(operand_index + 1);
- }
- }
- return 1;
- }
+ int count = Bytecodes::GetNumberOfRegistersRepresentedBy(operand_type);
+ if (count == 1 &&
+ ++operand_index < Bytecodes::NumberOfOperands(current_bytecode()) &&
+ Bytecodes::GetOperandType(current_bytecode(), operand_index) ==
+ OperandType::kRegCount) {
+ return GetRegisterCountOperand(operand_index);
+ } else {
+ return count;
}
}

Powered by Google App Engine
This is Rietveld 408576698