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/address-map.h" | 7 #include "src/address-map.h" |
8 #include "src/compiler/code-generator-impl.h" | 8 #include "src/compiler/code-generator-impl.h" |
9 #include "src/compiler/linkage.h" | 9 #include "src/compiler/linkage.h" |
10 #include "src/compiler/pipeline.h" | 10 #include "src/compiler/pipeline.h" |
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
146 AssemblePrologue(); | 146 AssemblePrologue(); |
147 // We need to setup the root register after we assemble the prologue, to | 147 // We need to setup the root register after we assemble the prologue, to |
148 // avoid clobbering callee saved registers in case of C linkage and | 148 // avoid clobbering callee saved registers in case of C linkage and |
149 // using the roots. | 149 // using the roots. |
150 // TODO(mtrofin): investigate how we can avoid doing this repeatedly. | 150 // TODO(mtrofin): investigate how we can avoid doing this repeatedly. |
151 if (linkage()->GetIncomingDescriptor()->InitializeRootRegister()) { | 151 if (linkage()->GetIncomingDescriptor()->InitializeRootRegister()) { |
152 masm()->InitializeRootRegister(); | 152 masm()->InitializeRootRegister(); |
153 } | 153 } |
154 } | 154 } |
155 | 155 |
156 for (int i = block->code_start(); i < block->code_end(); ++i) { | 156 if (FLAG_enable_embedded_constant_pool && !block->needs_frame()) { |
157 Instruction* instr = code()->InstructionAt(i); | 157 ConstantPoolUnavailableScope constant_pool_unavailable(masm()); |
158 AssembleInstruction(instr, block); | 158 for (int i = block->code_start(); i < block->code_end(); ++i) { |
159 Instruction* instr = code()->InstructionAt(i); | |
160 AssembleInstruction(instr, block); | |
161 } | |
162 } else { | |
163 for (int i = block->code_start(); i < block->code_end(); ++i) { | |
164 Instruction* instr = code()->InstructionAt(i); | |
Mircea Trofin
2016/03/30 22:39:24
To avoid code duplication, could you please factor
MTBrandyberry
2016/03/30 22:57:47
Will do.
MTBrandyberry
2016/03/31 02:06:35
Done.
| |
165 AssembleInstruction(instr, block); | |
166 } | |
159 } | 167 } |
160 } | 168 } |
161 } | 169 } |
162 | 170 |
163 // Assemble all out-of-line code. | 171 // Assemble all out-of-line code. |
164 if (ools_) { | 172 if (ools_) { |
165 masm()->RecordComment("-- Out of line code --"); | 173 masm()->RecordComment("-- Out of line code --"); |
166 for (OutOfLineCode* ool = ools_; ool; ool = ool->next()) { | 174 for (OutOfLineCode* ool = ools_; ool; ool = ool->next()) { |
167 masm()->bind(ool->entry()); | 175 masm()->bind(ool->entry()); |
168 ool->Generate(); | 176 ool->Generate(); |
(...skipping 620 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
789 : frame_(gen->frame()), masm_(gen->masm()), next_(gen->ools_) { | 797 : frame_(gen->frame()), masm_(gen->masm()), next_(gen->ools_) { |
790 gen->ools_ = this; | 798 gen->ools_ = this; |
791 } | 799 } |
792 | 800 |
793 | 801 |
794 OutOfLineCode::~OutOfLineCode() {} | 802 OutOfLineCode::~OutOfLineCode() {} |
795 | 803 |
796 } // namespace compiler | 804 } // namespace compiler |
797 } // namespace internal | 805 } // namespace internal |
798 } // namespace v8 | 806 } // namespace v8 |
OLD | NEW |