| 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 226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 237 sequence_ = new (instruction_zone()) InstructionSequence( | 237 sequence_ = new (instruction_zone()) InstructionSequence( |
| 238 info()->isolate(), instruction_zone(), instruction_blocks); | 238 info()->isolate(), instruction_zone(), instruction_blocks); |
| 239 } | 239 } |
| 240 | 240 |
| 241 void InitializeRegisterAllocator(Zone* local_zone, | 241 void InitializeRegisterAllocator(Zone* local_zone, |
| 242 const RegisterConfiguration* config, | 242 const RegisterConfiguration* config, |
| 243 const char* debug_name) { | 243 const char* debug_name) { |
| 244 DCHECK(!register_allocator_); | 244 DCHECK(!register_allocator_); |
| 245 DCHECK(!frame_); | 245 DCHECK(!frame_); |
| 246 frame_ = new (instruction_zone()) Frame(); | 246 frame_ = new (instruction_zone()) Frame(); |
| 247 register_allocator_ = new (instruction_zone()) | 247 if (FLAG_turbo_greedy_regalloc) { |
| 248 RegisterAllocator(config, local_zone, frame(), sequence(), debug_name); | 248 register_allocator_ = new (instruction_zone()) RegisterAllocatorGreedy( |
| 249 config, local_zone, frame(), sequence(), debug_name); |
| 250 } else { |
| 251 register_allocator_ = new (instruction_zone()) RegisterAllocatorLinear( |
| 252 config, local_zone, frame(), sequence(), debug_name); |
| 253 } |
| 249 } | 254 } |
| 250 | 255 |
| 251 private: | 256 private: |
| 252 Isolate* isolate_; | 257 Isolate* isolate_; |
| 253 CompilationInfo* info_; | 258 CompilationInfo* info_; |
| 254 Zone* outer_zone_; | 259 Zone* outer_zone_; |
| 255 ZonePool* const zone_pool_; | 260 ZonePool* const zone_pool_; |
| 256 PipelineStatistics* pipeline_statistics_; | 261 PipelineStatistics* pipeline_statistics_; |
| 257 bool compilation_failed_; | 262 bool compilation_failed_; |
| 258 Handle<Code> code_; | 263 Handle<Code> code_; |
| (...skipping 1003 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1262 | 1267 |
| 1263 if (FLAG_trace_turbo && !data->MayHaveUnverifiableGraph()) { | 1268 if (FLAG_trace_turbo && !data->MayHaveUnverifiableGraph()) { |
| 1264 TurboCfgFile tcf(data->isolate()); | 1269 TurboCfgFile tcf(data->isolate()); |
| 1265 tcf << AsC1VAllocator("CodeGen", data->register_allocator()); | 1270 tcf << AsC1VAllocator("CodeGen", data->register_allocator()); |
| 1266 } | 1271 } |
| 1267 } | 1272 } |
| 1268 | 1273 |
| 1269 } // namespace compiler | 1274 } // namespace compiler |
| 1270 } // namespace internal | 1275 } // namespace internal |
| 1271 } // namespace v8 | 1276 } // namespace v8 |
| OLD | NEW |