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

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: Rebase 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
« no previous file with comments | « src/interpreter/bytecode-array-builder.cc ('k') | src/interpreter/bytecode-array-writer.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..319d2a07bb7b66a87578d372cf5e8048b15b747d 100644
--- a/src/interpreter/bytecode-array-iterator.cc
+++ b/src/interpreter/bytecode-array-iterator.cc
@@ -128,26 +128,15 @@ Register BytecodeArrayIterator::GetRegisterOperand(int operand_index) const {
}
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;
- }
+ DCHECK_LE(operand_index, Bytecodes::NumberOfOperands(current_bytecode()));
+ const OperandType* operand_types =
+ Bytecodes::GetOperandTypes(current_bytecode());
+ DCHECK(Bytecodes::IsRegisterOperandType(operand_types[operand_index]));
+ if (operand_types[operand_index + 1] == OperandType::kRegCount) {
+ return GetRegisterCountOperand(operand_index + 1);
+ } else {
+ OperandType operand_type = operand_types[operand_index];
+ return Bytecodes::GetNumberOfRegistersRepresentedBy(operand_type);
}
}
« no previous file with comments | « src/interpreter/bytecode-array-builder.cc ('k') | src/interpreter/bytecode-array-writer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698