Output missing comments after the last disassembled instruction.

Review URL: http://codereview.chromium.org/7623014

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@8900 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
This commit is contained in:
svenpanne@chromium.org 2011-08-11 13:59:29 +00:00
parent 64bd51b8dd
commit 3c13926936
2 changed files with 12 additions and 4 deletions

View File

@ -122,6 +122,7 @@ static int DecodeIt(FILE* f,
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 @@ static int DecodeIt(FILE* f,
}
}
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 @@ static int DecodeIt(FILE* f,
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);
}

View File

@ -317,7 +317,6 @@ unsigned FullCodeGenerator::EmitStackCheckTable() {
// 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 @@ unsigned FullCodeGenerator::EmitStackCheckTable() {
__ dd(stack_checks_[i].id);
__ dd(stack_checks_[i].pc_and_state);
}
masm()->RecordComment("]");
return offset;
}