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 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
50 // Architecture-specific, linkage-specific prologue. | 50 // Architecture-specific, linkage-specific prologue. |
51 info->set_prologue_offset(masm()->pc_offset()); | 51 info->set_prologue_offset(masm()->pc_offset()); |
52 AssemblePrologue(); | 52 AssemblePrologue(); |
53 | 53 |
54 // Assemble all non-deferred blocks, followed by deferred ones. | 54 // Assemble all non-deferred blocks, followed by deferred ones. |
55 for (int deferred = 0; deferred < 2; ++deferred) { | 55 for (int deferred = 0; deferred < 2; ++deferred) { |
56 for (auto const block : code()->instruction_blocks()) { | 56 for (auto const block : code()->instruction_blocks()) { |
57 if (block->IsDeferred() == (deferred == 0)) { | 57 if (block->IsDeferred() == (deferred == 0)) { |
58 continue; | 58 continue; |
59 } | 59 } |
| 60 // Align loop headers on 16-byte boundaries. |
| 61 if (block->IsLoopHeader()) masm()->Align(16); |
60 // Bind a label for a block. | 62 // Bind a label for a block. |
61 current_block_ = block->rpo_number(); | 63 current_block_ = block->rpo_number(); |
62 if (FLAG_code_comments) { | 64 if (FLAG_code_comments) { |
63 // TODO(titzer): these code comments are a giant memory leak. | 65 // TODO(titzer): these code comments are a giant memory leak. |
64 Vector<char> buffer = Vector<char>::New(32); | 66 Vector<char> buffer = Vector<char>::New(32); |
65 SNPrintF(buffer, "-- B%d start --", block->id().ToInt()); | 67 SNPrintF(buffer, "-- B%d start --", block->id().ToInt()); |
66 masm()->RecordComment(buffer.start()); | 68 masm()->RecordComment(buffer.start()); |
67 } | 69 } |
68 masm()->bind(GetLabel(current_block_)); | 70 masm()->bind(GetLabel(current_block_)); |
69 for (int i = block->code_start(); i < block->code_end(); ++i) { | 71 for (int i = block->code_start(); i < block->code_end(); ++i) { |
(...skipping 506 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
576 : masm_(gen->masm()), next_(gen->ools_) { | 578 : masm_(gen->masm()), next_(gen->ools_) { |
577 gen->ools_ = this; | 579 gen->ools_ = this; |
578 } | 580 } |
579 | 581 |
580 | 582 |
581 OutOfLineCode::~OutOfLineCode() {} | 583 OutOfLineCode::~OutOfLineCode() {} |
582 | 584 |
583 } // namespace compiler | 585 } // namespace compiler |
584 } // namespace internal | 586 } // namespace internal |
585 } // namespace v8 | 587 } // namespace v8 |
OLD | NEW |