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 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
91 if (block->IsDeferred() == (deferred == 0)) { | 91 if (block->IsDeferred() == (deferred == 0)) { |
92 continue; | 92 continue; |
93 } | 93 } |
94 // Align loop headers on 16-byte boundaries. | 94 // Align loop headers on 16-byte boundaries. |
95 if (block->IsLoopHeader()) masm()->Align(16); | 95 if (block->IsLoopHeader()) masm()->Align(16); |
96 // Bind a label for a block. | 96 // Bind a label for a block. |
97 current_block_ = block->rpo_number(); | 97 current_block_ = block->rpo_number(); |
98 if (FLAG_code_comments) { | 98 if (FLAG_code_comments) { |
99 // TODO(titzer): these code comments are a giant memory leak. | 99 // TODO(titzer): these code comments are a giant memory leak. |
100 Vector<char> buffer = Vector<char>::New(200); | 100 Vector<char> buffer = Vector<char>::New(200); |
101 SNPrintF(buffer, "-- B%d start%s%s%s%s --", block->rpo_number().ToInt(), | 101 auto buffer_start = buffer.start(); |
Jarin
2015/06/11 04:22:29
auto -> char*
Mircea Trofin
2015/06/11 19:00:56
Done.
| |
102 block->IsDeferred() ? " (deferred)" : "", | 102 |
103 block->needs_frame() ? "" : " (no frame)", | 103 int next = SNPrintF( |
104 block->must_construct_frame() ? " (construct frame)" : "", | 104 buffer, "-- B%d start%s%s%s%s", block->rpo_number().ToInt(), |
105 block->must_deconstruct_frame() ? " (deconstruct frame)" : ""); | 105 block->IsDeferred() ? " (deferred)" : "", |
106 masm()->RecordComment(buffer.start()); | 106 block->needs_frame() ? "" : " (no frame)", |
107 block->must_construct_frame() ? " (construct frame)" : "", | |
108 block->must_deconstruct_frame() ? " (deconstruct frame)" : ""); | |
109 | |
110 buffer = buffer.SubVector(next, buffer.length()); | |
111 | |
112 if (block->IsLoopHeader()) { | |
113 next = | |
114 SNPrintF(buffer, " (loop up to %d)", block->loop_end().ToInt()); | |
115 buffer = buffer.SubVector(next, buffer.length()); | |
116 } | |
117 if (block->loop_header().IsValid()) { | |
118 next = | |
119 SNPrintF(buffer, " (in loop %d)", block->loop_header().ToInt()); | |
120 buffer = buffer.SubVector(next, buffer.length()); | |
121 } | |
122 SNPrintF(buffer, " --"); | |
123 masm()->RecordComment(buffer_start); | |
107 } | 124 } |
108 masm()->bind(GetLabel(current_block_)); | 125 masm()->bind(GetLabel(current_block_)); |
109 for (int i = block->code_start(); i < block->code_end(); ++i) { | 126 for (int i = block->code_start(); i < block->code_end(); ++i) { |
110 AssembleInstruction(code()->InstructionAt(i)); | 127 AssembleInstruction(code()->InstructionAt(i)); |
111 } | 128 } |
112 } | 129 } |
113 } | 130 } |
114 | 131 |
115 // Assemble all out-of-line code. | 132 // Assemble all out-of-line code. |
116 if (ools_) { | 133 if (ools_) { |
(...skipping 567 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
684 : masm_(gen->masm()), next_(gen->ools_) { | 701 : masm_(gen->masm()), next_(gen->ools_) { |
685 gen->ools_ = this; | 702 gen->ools_ = this; |
686 } | 703 } |
687 | 704 |
688 | 705 |
689 OutOfLineCode::~OutOfLineCode() {} | 706 OutOfLineCode::~OutOfLineCode() {} |
690 | 707 |
691 } // namespace compiler | 708 } // namespace compiler |
692 } // namespace internal | 709 } // namespace internal |
693 } // namespace v8 | 710 } // namespace v8 |
OLD | NEW |