OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "src/compiler/code-generator.h" | 5 #include "src/compiler/code-generator.h" |
6 | 6 |
7 #include "src/compiler/code-generator-impl.h" | 7 #include "src/compiler/code-generator-impl.h" |
8 #include "src/compiler/linkage.h" | 8 #include "src/compiler/linkage.h" |
9 #include "src/compiler/pipeline.h" | 9 #include "src/compiler/pipeline.h" |
10 | 10 |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
89 if (block->IsDeferred() == (deferred == 0)) { | 89 if (block->IsDeferred() == (deferred == 0)) { |
90 continue; | 90 continue; |
91 } | 91 } |
92 // Align loop headers on 16-byte boundaries. | 92 // Align loop headers on 16-byte boundaries. |
93 if (block->IsLoopHeader()) masm()->Align(16); | 93 if (block->IsLoopHeader()) masm()->Align(16); |
94 // Bind a label for a block. | 94 // Bind a label for a block. |
95 current_block_ = block->rpo_number(); | 95 current_block_ = block->rpo_number(); |
96 if (FLAG_code_comments) { | 96 if (FLAG_code_comments) { |
97 // TODO(titzer): these code comments are a giant memory leak. | 97 // TODO(titzer): these code comments are a giant memory leak. |
98 Vector<char> buffer = Vector<char>::New(200); | 98 Vector<char> buffer = Vector<char>::New(200); |
99 SNPrintF(buffer, "-- B%d start%s%s%s%s --", block->rpo_number().ToInt(), | 99 char* buffer_start = buffer.start(); |
100 block->IsDeferred() ? " (deferred)" : "", | 100 |
101 block->needs_frame() ? "" : " (no frame)", | 101 int next = SNPrintF( |
102 block->must_construct_frame() ? " (construct frame)" : "", | 102 buffer, "-- B%d start%s%s%s%s", block->rpo_number().ToInt(), |
103 block->must_deconstruct_frame() ? " (deconstruct frame)" : ""); | 103 block->IsDeferred() ? " (deferred)" : "", |
104 masm()->RecordComment(buffer.start()); | 104 block->needs_frame() ? "" : " (no frame)", |
| 105 block->must_construct_frame() ? " (construct frame)" : "", |
| 106 block->must_deconstruct_frame() ? " (deconstruct frame)" : ""); |
| 107 |
| 108 buffer = buffer.SubVector(next, buffer.length()); |
| 109 |
| 110 if (block->IsLoopHeader()) { |
| 111 next = |
| 112 SNPrintF(buffer, " (loop up to %d)", block->loop_end().ToInt()); |
| 113 buffer = buffer.SubVector(next, buffer.length()); |
| 114 } |
| 115 if (block->loop_header().IsValid()) { |
| 116 next = |
| 117 SNPrintF(buffer, " (in loop %d)", block->loop_header().ToInt()); |
| 118 buffer = buffer.SubVector(next, buffer.length()); |
| 119 } |
| 120 SNPrintF(buffer, " --"); |
| 121 masm()->RecordComment(buffer_start); |
105 } | 122 } |
106 masm()->bind(GetLabel(current_block_)); | 123 masm()->bind(GetLabel(current_block_)); |
107 for (int i = block->code_start(); i < block->code_end(); ++i) { | 124 for (int i = block->code_start(); i < block->code_end(); ++i) { |
108 AssembleInstruction(code()->InstructionAt(i)); | 125 AssembleInstruction(code()->InstructionAt(i)); |
109 } | 126 } |
110 } | 127 } |
111 } | 128 } |
112 | 129 |
113 // Assemble all out-of-line code. | 130 // Assemble all out-of-line code. |
114 if (ools_) { | 131 if (ools_) { |
(...skipping 576 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
691 : masm_(gen->masm()), next_(gen->ools_) { | 708 : masm_(gen->masm()), next_(gen->ools_) { |
692 gen->ools_ = this; | 709 gen->ools_ = this; |
693 } | 710 } |
694 | 711 |
695 | 712 |
696 OutOfLineCode::~OutOfLineCode() {} | 713 OutOfLineCode::~OutOfLineCode() {} |
697 | 714 |
698 } // namespace compiler | 715 } // namespace compiler |
699 } // namespace internal | 716 } // namespace internal |
700 } // namespace v8 | 717 } // namespace v8 |
OLD | NEW |