Reviewers: danno, Erik Corry,
Description:
Output missing comments after the last disassembled instruction.
Please review this at http://codereview.chromium.org/7623014/
SVN Base: http://v8.googlecode.com/svn/branches/bleeding_edge/
Affected files:
M src/disassembler.cc
M src/full-codegen.cc
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);
}
Index: src/full-codegen.cc
===================================================================
--- src/full-codegen.cc (revision 8885)
+++ src/full-codegen.cc (working copy)
@@ -317,7 +317,6 @@
// field, and then a sequence of entries. Each entry is a pair of AST id
// and code-relative pc offset.
masm()->Align(kIntSize);
- masm()->RecordComment("[ Stack check table");
unsigned offset = masm()->pc_offset();
unsigned length = stack_checks_.length();
__ dd(length);
@@ -325,7 +324,6 @@
__ dd(stack_checks_[i].id);
__ dd(stack_checks_[i].pc_and_state);
}
- masm()->RecordComment("]");
return offset;
}
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev