Index: src/disassembler.cc |
=================================================================== |
--- src/disassembler.cc (revision 8897) |
+++ src/disassembler.cc (working copy) |
@@ -122,6 +122,7 @@ |
v8::internal::EmbeddedVector<char, 128> decode_buffer; |
v8::internal::EmbeddedVector<char, kOutBufferSize> out_buffer; |
+ StringBuilder out(out_buffer.start(), out_buffer.length()); |
byte* pc = begin; |
disasm::Disassembler d(converter); |
RelocIterator* it = NULL; |
@@ -184,8 +185,6 @@ |
} |
} |
- StringBuilder out(out_buffer.start(), out_buffer.length()); |
- |
// Comments. |
for (int i = 0; i < comments.length(); i++) { |
out.AddFormatted(" %s", comments[i]); |
@@ -302,6 +301,17 @@ |
DumpBuffer(f, &out); |
} |
+ // Emit comments following the last instruction (if any). |
+ if (it != NULL) { |
+ for ( ; !it->done(); it->next()) { |
+ if (RelocInfo::IsComment(it->rinfo()->rmode())) { |
+ out.AddFormatted(" %s", |
+ reinterpret_cast<const char*>(it->rinfo()->data())); |
+ DumpBuffer(f, &out); |
+ } |
+ } |
+ } |
+ |
delete it; |
return static_cast<int>(pc - begin); |
} |