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

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

Issue 1651133002: [interpreter] Move temporary register allocator into own file. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Incorporate review comments from rmcilroy. Created 4 years, 11 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-generator.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 fc9e2f5e9037615a2d18c64dd78700a682bfc219..22e0512dc8bbf78c32fca897b8a86867d51c9cfb 100644
--- a/src/interpreter/bytecode-array-iterator.cc
+++ b/src/interpreter/bytecode-array-iterator.cc
@@ -89,15 +89,27 @@ Register BytecodeArrayIterator::GetRegisterOperand(int operand_index) const {
Bytecodes::GetOperandType(current_bytecode(), operand_index);
DCHECK(Bytecodes::IsRegisterOperandType(operand_type));
uint32_t operand = GetRawOperand(operand_index, operand_type);
+ Register reg;
switch (Bytecodes::GetOperandSize(current_bytecode(), operand_index)) {
case OperandSize::kByte:
- return Register::FromOperand(static_cast<uint8_t>(operand));
+ reg = Register::FromOperand(static_cast<uint8_t>(operand));
+ break;
case OperandSize::kShort:
- return Register::FromWideOperand(static_cast<uint16_t>(operand));
+ reg = Register::FromWideOperand(static_cast<uint16_t>(operand));
+ break;
case OperandSize::kNone:
UNREACHABLE();
+ reg = Register::invalid_value();
+ break;
}
- return Register();
+ DCHECK_GE(reg.index(),
+ Register::FromParameterIndex(0, bytecode_array()->parameter_count())
+ .index());
+ DCHECK(reg.index() < bytecode_array()->register_count() ||
+ (reg.index() == 0 &&
+ Bytecodes::IsMaybeRegisterOperandType(
+ Bytecodes::GetOperandType(current_bytecode(), operand_index))));
+ return reg;
}
int BytecodeArrayIterator::GetRegisterOperandRange(int operand_index) const {
@@ -121,8 +133,7 @@ int BytecodeArrayIterator::GetRegisterOperandRange(int operand_index) const {
// reciever.
OperandType next_operand_type =
Bytecodes::GetOperandType(current_bytecode(), operand_index + 1);
- if (next_operand_type == OperandType::kRegCount8 ||
- next_operand_type == OperandType::kRegCount16) {
+ if (Bytecodes::IsRegisterCountOperandType(next_operand_type)) {
return GetCountOperand(operand_index + 1);
}
}
« no previous file with comments | « src/interpreter/bytecode-array-builder.cc ('k') | src/interpreter/bytecode-generator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698