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

Unified Diff: src/interpreter/bytecodes.cc

Issue 1288333002: [interpreter]: Update BytecodeArrayBuilder register handling. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 4 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/bytecodes.h ('k') | test/cctest/cctest.gyp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/interpreter/bytecodes.cc
diff --git a/src/interpreter/bytecodes.cc b/src/interpreter/bytecodes.cc
index 5cb2ddfbb2b1f241a0696007dc6d9858bdcc9f5a..8232b657e78e0d1de05c86db3754b287779a1ee9 100644
--- a/src/interpreter/bytecodes.cc
+++ b/src/interpreter/bytecodes.cc
@@ -4,6 +4,8 @@
#include "src/interpreter/bytecodes.h"
+#include "src/interpreter/bytecode-array-builder.h"
+
namespace v8 {
namespace internal {
namespace interpreter {
@@ -38,6 +40,20 @@ const char* Bytecodes::ToString(Bytecode bytecode) {
// static
+const char* Bytecodes::OperandTypeToString(OperandType operand_type) {
+ switch (operand_type) {
+#define CASE(Name) \
+ case OperandType::k##Name: \
+ return #Name;
+ OPERAND_TYPE_LIST(CASE)
+#undef CASE
+ }
+ UNREACHABLE();
+ return "";
+}
+
+
+// static
uint8_t Bytecodes::ToByte(Bytecode bytecode) {
return static_cast<uint8_t>(bytecode);
}
@@ -114,7 +130,7 @@ std::ostream& Bytecodes::Decode(std::ostream& os,
os << "#" << static_cast<int>(operand);
break;
case interpreter::OperandType::kReg:
- os << "r" << static_cast<int>(operand);
+ os << "r" << Register::FromOperand(operand).index();
break;
case interpreter::OperandType::kNone:
UNREACHABLE();
@@ -132,6 +148,11 @@ std::ostream& operator<<(std::ostream& os, const Bytecode& bytecode) {
return os << Bytecodes::ToString(bytecode);
}
+
+std::ostream& operator<<(std::ostream& os, const OperandType& operand_type) {
+ return os << Bytecodes::OperandTypeToString(operand_type);
+}
+
} // namespace interpreter
} // namespace internal
} // namespace v8
« no previous file with comments | « src/interpreter/bytecodes.h ('k') | test/cctest/cctest.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698