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

Unified Diff: src/objects-printer.cc

Issue 1230753004: [Interpreter] Add BytecodeArray class and add to SharedFunctionInfo. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Don't use extra memory for BytecodeArray in SharedFunctionInfo and add a BytecodeArray test. Created 5 years, 5 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-printer.cc
diff --git a/src/objects-printer.cc b/src/objects-printer.cc
index 838a1a90755cc6e52a10bdf387c4aed58fee8527..ccfc3ce5dbaef412b6d3a9d4bf6cca8912b17fa6 100644
--- a/src/objects-printer.cc
+++ b/src/objects-printer.cc
@@ -7,6 +7,7 @@
#include "src/disasm.h"
#include "src/disassembler.h"
#include "src/heap/objects-visiting.h"
+#include "src/interpreter/bytecodes.h"
#include "src/jsregexp.h"
#include "src/ostreams.h"
@@ -72,6 +73,9 @@ void HeapObject::HeapObjectPrint(std::ostream& os) { // NOLINT
case BYTE_ARRAY_TYPE:
ByteArray::cast(this)->ByteArrayPrint(os);
break;
+ case BYTECODE_ARRAY_TYPE:
+ BytecodeArray::cast(this)->BytecodeArrayPrint(os);
+ break;
case FREE_SPACE_TYPE:
FreeSpace::cast(this)->FreeSpacePrint(os);
break;
@@ -201,6 +205,11 @@ void ByteArray::ByteArrayPrint(std::ostream& os) { // NOLINT
}
+void BytecodeArray::BytecodeArrayPrint(std::ostream& os) { // NOLINT
+ Disassemble(os);
+}
+
+
void FreeSpace::FreeSpacePrint(std::ostream& os) { // NOLINT
os << "free space, size " << Size();
}
@@ -764,6 +773,7 @@ void SharedFunctionInfo::SharedFunctionInfoPrint(std::ostream& os) { // NOLINT
os << "\n - optimized_code_map = " << Brief(optimized_code_map());
os << "\n - feedback_vector = ";
feedback_vector()->FixedArrayPrint(os);
+ os << "\n - bytecode_array = " << bytecode_array();
os << "\n";
}

Powered by Google App Engine
This is Rietveld 408576698