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

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: ASAN fix. 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
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..4bb112bc948a8214ce367b8b1344ecc9974e702b 100644
--- a/src/interpreter/bytecode-array-iterator.cc
+++ b/src/interpreter/bytecode-array-iterator.cc
@@ -89,15 +89,28 @@ 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();
rmcilroy 2016/02/02 10:53:28 break;
oth 2016/02/02 11:20:24 Done.
}
- 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::GetOperandType(current_bytecode(), operand_index) ==
+ OperandType::kMaybeReg8 ||
+ Bytecodes::GetOperandType(current_bytecode(), operand_index) ==
+ OperandType::kMaybeReg16)));
rmcilroy 2016/02/02 10:53:28 nit - could you pull out a helper for IsMaybeRegis
oth 2016/02/02 11:20:24 Done. Also IsRegisterCountOperandType used just be
+ return reg;
}
int BytecodeArrayIterator::GetRegisterOperandRange(int operand_index) const {

Powered by Google App Engine
This is Rietveld 408576698