Index: src/objects-printer.cc |
diff --git a/src/objects-printer.cc b/src/objects-printer.cc |
index 838a1a90755cc6e52a10bdf387c4aed58fee8527..5c9295edebc806332d66ffa4ea6f8cc5c1c411a4 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; |
@@ -197,7 +201,18 @@ void HeapObject::HeapObjectPrint(std::ostream& os) { // NOLINT |
void ByteArray::ByteArrayPrint(std::ostream& os) { // NOLINT |
- os << "byte array, data starts at " << GetDataStartAddress(); |
+ ScopedVector<char> buf(100); |
+ SNPrintF(buf, "byte array, data starts at %p", GetDataStartAddress()); |
+ os << buf.start(); |
rmcilroy
2015/07/20 11:39:46
nit - do you need to change this function?
oth
2015/07/20 13:47:30
Done.
|
+} |
+ |
+ |
+void BytecodeArray::BytecodeArrayPrint(std::ostream& os) { // NOLINT |
+ ScopedVector<char> buf(100); |
+ SNPrintF(buf, "bytecode array, starts at %p (%d bytes)\n", |
+ GetFirstBytecodeAddress(), length()); |
+ os << buf.start(); |
rmcilroy
2015/07/20 11:39:46
I don't think these lines is necessary - it should
oth
2015/07/20 13:47:30
Done.
|
+ Disassemble(os); |
} |
@@ -764,6 +779,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"; |
} |