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 char* buffer_start = buffer.start(); | 99 SNPrintF(buffer, "-- B%d start%s%s%s%s --", block->rpo_number().ToInt(), |
100 | 100 block->IsDeferred() ? " (deferred)" : "", |
101 int next = SNPrintF( | 101 block->needs_frame() ? "" : " (no frame)", |
102 buffer, "-- B%d start%s%s%s%s", block->rpo_number().ToInt(), | 102 block->must_construct_frame() ? " (construct frame)" : "", |
103 block->IsDeferred() ? " (deferred)" : "", | 103 block->must_deconstruct_frame() ? " (deconstruct frame)" : ""); |
104 block->needs_frame() ? "" : " (no frame)", | 104 masm()->RecordComment(buffer.start()); |
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); | |
122 } | 105 } |
123 masm()->bind(GetLabel(current_block_)); | 106 masm()->bind(GetLabel(current_block_)); |
124 for (int i = block->code_start(); i < block->code_end(); ++i) { | 107 for (int i = block->code_start(); i < block->code_end(); ++i) { |
125 AssembleInstruction(code()->InstructionAt(i)); | 108 AssembleInstruction(code()->InstructionAt(i)); |
126 } | 109 } |
127 } | 110 } |
128 } | 111 } |
129 | 112 |
130 // Assemble all out-of-line code. | 113 // Assemble all out-of-line code. |
131 if (ools_) { | 114 if (ools_) { |
(...skipping 576 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
708 : masm_(gen->masm()), next_(gen->ools_) { | 691 : masm_(gen->masm()), next_(gen->ools_) { |
709 gen->ools_ = this; | 692 gen->ools_ = this; |
710 } | 693 } |
711 | 694 |
712 | 695 |
713 OutOfLineCode::~OutOfLineCode() {} | 696 OutOfLineCode::~OutOfLineCode() {} |
714 | 697 |
715 } // namespace compiler | 698 } // namespace compiler |
716 } // namespace internal | 699 } // namespace internal |
717 } // namespace v8 | 700 } // namespace v8 |
OLD | NEW |