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

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

Issue 2382273002: [Interpreter]: Add kRegList operand type for register list operands. (Closed)
Patch Set: Address comments Created 4 years, 2 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 | « no previous file | src/interpreter/bytecode-array-iterator.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/interpreter/bytecode-array-builder.cc
diff --git a/src/interpreter/bytecode-array-builder.cc b/src/interpreter/bytecode-array-builder.cc
index 4102c65a3881a0c951d7c118292000386f385ba9..281eb14d16f52f0b8b3b68772991f59d3661b207 100644
--- a/src/interpreter/bytecode-array-builder.cc
+++ b/src/interpreter/bytecode-array-builder.cc
@@ -857,19 +857,6 @@ bool BytecodeArrayBuilder::OperandsAreValid(
switch (operand_types[i]) {
case OperandType::kNone:
return false;
- case OperandType::kRegCount: {
- CHECK_NE(i, 0);
- CHECK(operand_types[i - 1] == OperandType::kMaybeReg ||
- operand_types[i - 1] == OperandType::kReg);
- if (i > 0 && operands[i] > 0) {
- Register start = Register::FromOperand(operands[i - 1]);
- Register end(start.index() + static_cast<int>(operands[i]) - 1);
- if (!RegisterIsValid(start) || !RegisterIsValid(end) || start > end) {
- return false;
- }
- }
- break;
- }
case OperandType::kFlag8:
case OperandType::kIntrinsicId:
if (Bytecodes::SizeForUnsignedOperand(operands[i]) >
@@ -890,11 +877,22 @@ bool BytecodeArrayBuilder::OperandsAreValid(
case OperandType::kUImm:
case OperandType::kImm:
break;
- case OperandType::kMaybeReg:
- if (Register::FromOperand(operands[i]) == Register(0)) {
- break;
+ case OperandType::kRegList: {
+ CHECK_LT(i, operand_count - 1);
+ CHECK(operand_types[i + 1] == OperandType::kRegCount);
+ int reg_count = static_cast<int>(operands[i + 1]);
+ if (reg_count == 0) {
+ return Register::FromOperand(operands[i]) == Register(0);
+ } else {
+ Register start = Register::FromOperand(operands[i]);
+ Register end(start.index() + reg_count - 1);
+ if (!RegisterIsValid(start) || !RegisterIsValid(end) || start > end) {
+ return false;
+ }
}
- // Fall-through to kReg case.
+ i++; // Skip past kRegCount operand.
+ break;
+ }
case OperandType::kReg:
case OperandType::kRegOut: {
Register reg = Register::FromOperand(operands[i]);
@@ -922,6 +920,8 @@ bool BytecodeArrayBuilder::OperandsAreValid(
}
break;
}
+ case OperandType::kRegCount:
+ UNREACHABLE(); // Dealt with in kRegList above.
}
}
« no previous file with comments | « no previous file | src/interpreter/bytecode-array-iterator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698