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

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

Issue 1640213002: [Interpreter] Add option to trace bytecode execution. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Review comments 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-iterator.h ('k') | src/interpreter/bytecodes.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 6fde67f938cff42bf0689c9db010931e2ff602c7..47bcf0047a4cb2fd15ac74c86ce10265b62b27ea 100644
--- a/src/interpreter/bytecode-array-iterator.cc
+++ b/src/interpreter/bytecode-array-iterator.cc
@@ -100,6 +100,36 @@ Register BytecodeArrayIterator::GetRegisterOperand(int operand_index) const {
return Register();
}
+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::kRegPair8:
+ case OperandType::kRegPair16:
+ case OperandType::kRegOutPair8:
+ case OperandType::kRegOutPair16:
+ return 2;
+ case OperandType::kRegOutTriple8:
+ case OperandType::kRegOutTriple16:
+ return 3;
+ default: {
+ if (operand_index + 1 !=
+ Bytecodes::NumberOfOperands(current_bytecode())) {
+ // TODO(oth): Ensure all bytecodes specify the full range of registers
+ // with kRegCount (currently Call/CallJSRuntime are off by one due to
+ // reciever.
+ OperandType next_operand_type =
+ Bytecodes::GetOperandType(current_bytecode(), operand_index + 1);
+ if (next_operand_type == OperandType::kRegCount8 ||
+ next_operand_type == OperandType::kRegCount16) {
+ return GetCountOperand(operand_index + 1);
+ }
+ }
+ return 1;
+ }
+ }
+}
Handle<Object> BytecodeArrayIterator::GetConstantForIndexOperand(
int operand_index) const {
« no previous file with comments | « src/interpreter/bytecode-array-iterator.h ('k') | src/interpreter/bytecodes.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698