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

Unified Diff: src/objects.cc

Issue 1266713004: [Intepreter] Addition of BytecodeArrayBuilder and accumulator based bytecodes. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix MSVC/gcc-pedantic compilation. 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
Index: src/objects.cc
diff --git a/src/objects.cc b/src/objects.cc
index 8bb95c518c79327fe1548fcdf8cf017a9004cd16..053f7107b8e6cb03aac35dac8507dd42d2b09563 100644
--- a/src/objects.cc
+++ b/src/objects.cc
@@ -11615,7 +11615,6 @@ void BytecodeArray::Disassemble(std::ostream& os) {
for (int i = 0; i < this->length(); i += bytes) {
interpreter::Bytecode bytecode = interpreter::Bytecodes::FromByte(get(i));
bytes = interpreter::Bytecodes::Size(bytecode);
-
SNPrintF(buf, "%p : ", GetFirstBytecodeAddress() + i);
os << buf.start();
for (int j = 0; j < bytes; j++) {
@@ -11625,7 +11624,27 @@ void BytecodeArray::Disassemble(std::ostream& os) {
for (int j = bytes; j < interpreter::Bytecodes::MaximumSize(); j++) {
os << " ";
}
- os << bytecode << "\n";
+ os << bytecode << " ";
+ for (int j = 1; j < bytes; j++) {
picksi 2015/08/03 11:06:01 Should this for-loop be pulled out into a separate
oth 2015/08/03 15:39:59 Reworked in https://codereview.chromium.org/125919
+ interpreter::OperandType op_type =
+ interpreter::Bytecodes::GetOperandType(bytecode, j - 1);
+ uint8_t operand = get(i + j);
+ switch (op_type) {
+ case interpreter::OperandType::kImm8:
+ os << "#" << static_cast<int>(operand);
+ break;
+ case interpreter::OperandType::kReg:
+ os << "r" << static_cast<int>(operand);
+ break;
+ case interpreter::OperandType::kNone:
+ UNREACHABLE();
+ break;
+ }
+ if (j + 1 < bytes) {
+ os << ", ";
+ }
+ }
+ os << "\n";
}
}

Powered by Google App Engine
This is Rietveld 408576698