OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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/pipeline.h" | 5 #include "src/compiler/pipeline.h" |
6 | 6 |
7 #include <fstream> // NOLINT(readability/streams) | 7 #include <fstream> // NOLINT(readability/streams) |
8 #include <sstream> | 8 #include <sstream> |
9 | 9 |
10 #include "src/base/platform/elapsed-timer.h" | 10 #include "src/base/platform/elapsed-timer.h" |
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
138 return source_positions_.get(); | 138 return source_positions_.get(); |
139 } | 139 } |
140 MachineOperatorBuilder* machine() const { return machine_; } | 140 MachineOperatorBuilder* machine() const { return machine_; } |
141 CommonOperatorBuilder* common() const { return common_; } | 141 CommonOperatorBuilder* common() const { return common_; } |
142 JSOperatorBuilder* javascript() const { return javascript_; } | 142 JSOperatorBuilder* javascript() const { return javascript_; } |
143 JSGraph* jsgraph() const { return jsgraph_; } | 143 JSGraph* jsgraph() const { return jsgraph_; } |
144 Typer* typer() const { return typer_.get(); } | 144 Typer* typer() const { return typer_.get(); } |
145 | 145 |
146 LoopAssignmentAnalysis* loop_assignment() const { return loop_assignment_; } | 146 LoopAssignmentAnalysis* loop_assignment() const { return loop_assignment_; } |
147 void set_loop_assignment(LoopAssignmentAnalysis* loop_assignment) { | 147 void set_loop_assignment(LoopAssignmentAnalysis* loop_assignment) { |
148 DCHECK(!loop_assignment_); | 148 DCHECK_EQ(nullptr, loop_assignment_); |
149 loop_assignment_ = loop_assignment; | 149 loop_assignment_ = loop_assignment; |
150 } | 150 } |
151 | 151 |
152 Node* context_node() const { return context_node_; } | 152 Node* context_node() const { return context_node_; } |
153 void set_context_node(Node* context_node) { | 153 void set_context_node(Node* context_node) { |
154 DCHECK(!context_node_); | 154 DCHECK_EQ(nullptr, context_node_); |
155 context_node_ = context_node; | 155 context_node_ = context_node; |
156 } | 156 } |
157 | 157 |
158 Schedule* schedule() const { return schedule_; } | 158 Schedule* schedule() const { return schedule_; } |
159 void set_schedule(Schedule* schedule) { | 159 void set_schedule(Schedule* schedule) { |
160 DCHECK(!schedule_); | 160 DCHECK_EQ(nullptr, schedule_); |
161 schedule_ = schedule; | 161 schedule_ = schedule; |
162 } | 162 } |
163 | 163 |
164 Zone* instruction_zone() const { return instruction_zone_; } | 164 Zone* instruction_zone() const { return instruction_zone_; } |
165 InstructionSequence* sequence() const { return sequence_; } | 165 InstructionSequence* sequence() const { return sequence_; } |
166 Frame* frame() const { return frame_; } | 166 Frame* frame() const { return frame_; } |
167 RegisterAllocator* register_allocator() const { return register_allocator_; } | 167 RegisterAllocator* register_allocator() const { return register_allocator_; } |
168 | 168 |
169 void DeleteGraphZone() { | 169 void DeleteGraphZone() { |
170 // Destroy objects with destructors first. | 170 // Destroy objects with destructors first. |
(...skipping 16 matching lines...) Expand all Loading... |
187 void DeleteInstructionZone() { | 187 void DeleteInstructionZone() { |
188 if (instruction_zone_ == nullptr) return; | 188 if (instruction_zone_ == nullptr) return; |
189 instruction_zone_scope_.Destroy(); | 189 instruction_zone_scope_.Destroy(); |
190 instruction_zone_ = nullptr; | 190 instruction_zone_ = nullptr; |
191 sequence_ = nullptr; | 191 sequence_ = nullptr; |
192 frame_ = nullptr; | 192 frame_ = nullptr; |
193 register_allocator_ = nullptr; | 193 register_allocator_ = nullptr; |
194 } | 194 } |
195 | 195 |
196 void InitializeInstructionSequence() { | 196 void InitializeInstructionSequence() { |
197 DCHECK(!sequence_); | 197 DCHECK_EQ(nullptr, sequence_); |
198 InstructionBlocks* instruction_blocks = | 198 InstructionBlocks* instruction_blocks = |
199 InstructionSequence::InstructionBlocksFor(instruction_zone(), | 199 InstructionSequence::InstructionBlocksFor(instruction_zone(), |
200 schedule()); | 200 schedule()); |
201 sequence_ = new (instruction_zone()) InstructionSequence( | 201 sequence_ = new (instruction_zone()) InstructionSequence( |
202 info()->isolate(), instruction_zone(), instruction_blocks); | 202 info()->isolate(), instruction_zone(), instruction_blocks); |
203 } | 203 } |
204 | 204 |
205 void InitializeRegisterAllocator(Zone* local_zone, | 205 void InitializeRegisterAllocator(Zone* local_zone, |
206 const RegisterConfiguration* config, | 206 const RegisterConfiguration* config, |
207 const char* debug_name) { | 207 const char* debug_name) { |
208 DCHECK(!register_allocator_); | 208 DCHECK_EQ(nullptr, register_allocator_); |
209 DCHECK(!frame_); | 209 DCHECK_EQ(nullptr, frame_); |
210 frame_ = new (instruction_zone()) Frame(); | 210 frame_ = new (instruction_zone()) Frame(); |
211 register_allocator_ = new (instruction_zone()) | 211 register_allocator_ = new (instruction_zone()) |
212 RegisterAllocator(config, local_zone, frame(), sequence(), debug_name); | 212 RegisterAllocator(config, local_zone, frame(), sequence(), debug_name); |
213 } | 213 } |
214 | 214 |
215 private: | 215 private: |
216 Isolate* isolate_; | 216 Isolate* isolate_; |
217 CompilationInfo* info_; | 217 CompilationInfo* info_; |
218 Zone* outer_zone_; | 218 Zone* outer_zone_; |
219 ZonePool* const zone_pool_; | 219 ZonePool* const zone_pool_; |
(...skipping 949 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1169 } | 1169 } |
1170 | 1170 |
1171 | 1171 |
1172 void Pipeline::TearDown() { | 1172 void Pipeline::TearDown() { |
1173 InstructionOperand::TearDownCaches(); | 1173 InstructionOperand::TearDownCaches(); |
1174 } | 1174 } |
1175 | 1175 |
1176 } // namespace compiler | 1176 } // namespace compiler |
1177 } // namespace internal | 1177 } // namespace internal |
1178 } // namespace v8 | 1178 } // namespace v8 |
OLD | NEW |