Chromium Code Reviews| Index: src/compiler/code-generator.cc |
| diff --git a/src/compiler/code-generator.cc b/src/compiler/code-generator.cc |
| index 6be3f14f386333b58a58af85e6867cb2d74aa594..667dc73b8ae7253bd59670bf3af059e42b2a6e04 100644 |
| --- a/src/compiler/code-generator.cc |
| +++ b/src/compiler/code-generator.cc |
| @@ -98,12 +98,29 @@ Handle<Code> CodeGenerator::GenerateCode() { |
| if (FLAG_code_comments) { |
| // TODO(titzer): these code comments are a giant memory leak. |
| Vector<char> buffer = Vector<char>::New(200); |
| - SNPrintF(buffer, "-- B%d start%s%s%s%s --", block->rpo_number().ToInt(), |
| - block->IsDeferred() ? " (deferred)" : "", |
| - block->needs_frame() ? "" : " (no frame)", |
| - block->must_construct_frame() ? " (construct frame)" : "", |
| - block->must_deconstruct_frame() ? " (deconstruct frame)" : ""); |
| - masm()->RecordComment(buffer.start()); |
| + auto buffer_start = buffer.start(); |
|
Jarin
2015/06/11 04:22:29
auto -> char*
Mircea Trofin
2015/06/11 19:00:56
Done.
|
| + |
| + int next = SNPrintF( |
| + buffer, "-- B%d start%s%s%s%s", block->rpo_number().ToInt(), |
| + block->IsDeferred() ? " (deferred)" : "", |
| + block->needs_frame() ? "" : " (no frame)", |
| + block->must_construct_frame() ? " (construct frame)" : "", |
| + block->must_deconstruct_frame() ? " (deconstruct frame)" : ""); |
| + |
| + buffer = buffer.SubVector(next, buffer.length()); |
| + |
| + if (block->IsLoopHeader()) { |
| + next = |
| + SNPrintF(buffer, " (loop up to %d)", block->loop_end().ToInt()); |
| + buffer = buffer.SubVector(next, buffer.length()); |
| + } |
| + if (block->loop_header().IsValid()) { |
| + next = |
| + SNPrintF(buffer, " (in loop %d)", block->loop_header().ToInt()); |
| + buffer = buffer.SubVector(next, buffer.length()); |
| + } |
| + SNPrintF(buffer, " --"); |
| + masm()->RecordComment(buffer_start); |
| } |
| masm()->bind(GetLabel(current_block_)); |
| for (int i = block->code_start(); i < block->code_end(); ++i) { |