Chromium Code Reviews| Index: src/objects-printer.cc |
| diff --git a/src/objects-printer.cc b/src/objects-printer.cc |
| index 1dcc3d53948d13cd87f5770f06b04a0320f921ba..afbe945851ffa0b51e002afb43aff4224d50e5f0 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,16 @@ void ByteArray::ByteArrayPrint(std::ostream& os) { // NOLINT |
| } |
| +void BytecodeArray::BytecodeArrayPrint(std::ostream& os) { // NOLINT |
| + os << "bytecode array, data starts at " << GetDataStartAddress(); |
| + for (int i = 0; i < this->length(); i++) { |
| + byte bc = this->get(i); |
| + os << "\n" << i << " : " << this->get(i) << " " |
| + << static_cast<interpreter::Bytecode>(bc); |
|
rmcilroy
2015/07/15 13:33:38
How about we move this to a BytecodeArray::Dissass
oth
2015/07/16 09:15:50
Done.
|
| + } |
| +} |
| + |
| + |
| void FreeSpace::FreeSpacePrint(std::ostream& os) { // NOLINT |
| os << "free space, size " << Size(); |
| } |
| @@ -766,6 +780,8 @@ void SharedFunctionInfo::SharedFunctionInfoPrint(std::ostream& os) { // NOLINT |
| os << "\n - optimized_code_map = " << Brief(optimized_code_map()); |
| os << "\n - feedback_vector = "; |
| feedback_vector()->FixedArrayPrint(os); |
| + // TODO(oth): implement real bytecode printer |
|
rmcilroy
2015/07/15 13:33:38
Actually I think emitting the pointer here is fine
oth
2015/07/16 09:15:50
Done.
|
| + os << "\n - bytecode_array = " << bytecode_array(); |
| os << "\n"; |
| } |