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 <memory> | 8 #include <memory> |
9 #include <sstream> | 9 #include <sstream> |
10 | 10 |
(...skipping 265 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
276 } else { | 276 } else { |
277 DCHECK_EQ(0, descriptor->CalleeSavedFPRegisters()); | 277 DCHECK_EQ(0, descriptor->CalleeSavedFPRegisters()); |
278 DCHECK_EQ(0, descriptor->CalleeSavedRegisters()); | 278 DCHECK_EQ(0, descriptor->CalleeSavedRegisters()); |
279 } | 279 } |
280 } | 280 } |
281 | 281 |
282 void InitializeFrameData(CallDescriptor* descriptor) { | 282 void InitializeFrameData(CallDescriptor* descriptor) { |
283 DCHECK(frame_ == nullptr); | 283 DCHECK(frame_ == nullptr); |
284 int fixed_frame_size = 0; | 284 int fixed_frame_size = 0; |
285 if (descriptor != nullptr) { | 285 if (descriptor != nullptr) { |
286 fixed_frame_size = CalculateFixedFrameSize(descriptor); | 286 fixed_frame_size = descriptor->CalculateFixedFrameSize(); |
287 } | 287 } |
288 frame_ = new (instruction_zone()) Frame(fixed_frame_size); | 288 frame_ = new (instruction_zone()) Frame(fixed_frame_size); |
289 } | 289 } |
290 | 290 |
291 void InitializeRegisterAllocationData(const RegisterConfiguration* config, | 291 void InitializeRegisterAllocationData(const RegisterConfiguration* config, |
292 CallDescriptor* descriptor) { | 292 CallDescriptor* descriptor) { |
293 DCHECK(register_allocation_data_ == nullptr); | 293 DCHECK(register_allocation_data_ == nullptr); |
294 register_allocation_data_ = new (register_allocation_zone()) | 294 register_allocation_data_ = new (register_allocation_zone()) |
295 RegisterAllocationData(config, register_allocation_zone(), frame(), | 295 RegisterAllocationData(config, register_allocation_zone(), frame(), |
296 sequence(), debug_name_.get()); | 296 sequence(), debug_name_.get()); |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
348 ZoneStats::Scope register_allocation_zone_scope_; | 348 ZoneStats::Scope register_allocation_zone_scope_; |
349 Zone* register_allocation_zone_; | 349 Zone* register_allocation_zone_; |
350 RegisterAllocationData* register_allocation_data_ = nullptr; | 350 RegisterAllocationData* register_allocation_data_ = nullptr; |
351 | 351 |
352 // Basic block profiling support. | 352 // Basic block profiling support. |
353 BasicBlockProfiler::Data* profiler_data_ = nullptr; | 353 BasicBlockProfiler::Data* profiler_data_ = nullptr; |
354 | 354 |
355 // Source position output for --trace-turbo. | 355 // Source position output for --trace-turbo. |
356 std::string source_position_output_; | 356 std::string source_position_output_; |
357 | 357 |
358 int CalculateFixedFrameSize(CallDescriptor* descriptor) { | |
359 if (descriptor->IsJSFunctionCall()) { | |
360 return StandardFrameConstants::kFixedSlotCount; | |
361 } | |
362 return descriptor->IsCFunctionCall() | |
363 ? (CommonFrameConstants::kFixedSlotCountAboveFp + | |
364 CommonFrameConstants::kCPSlotCount) | |
365 : TypedFrameConstants::kFixedSlotCount; | |
366 } | |
367 | |
368 DISALLOW_COPY_AND_ASSIGN(PipelineData); | 358 DISALLOW_COPY_AND_ASSIGN(PipelineData); |
369 }; | 359 }; |
370 | 360 |
371 class PipelineImpl final { | 361 class PipelineImpl final { |
372 public: | 362 public: |
373 explicit PipelineImpl(PipelineData* data) : data_(data) {} | 363 explicit PipelineImpl(PipelineData* data) : data_(data) {} |
374 | 364 |
375 // Helpers for executing pipeline phases. | 365 // Helpers for executing pipeline phases. |
376 template <typename Phase> | 366 template <typename Phase> |
377 void Run(); | 367 void Run(); |
(...skipping 1615 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1993 data->DeleteRegisterAllocationZone(); | 1983 data->DeleteRegisterAllocationZone(); |
1994 } | 1984 } |
1995 | 1985 |
1996 CompilationInfo* PipelineImpl::info() const { return data_->info(); } | 1986 CompilationInfo* PipelineImpl::info() const { return data_->info(); } |
1997 | 1987 |
1998 Isolate* PipelineImpl::isolate() const { return info()->isolate(); } | 1988 Isolate* PipelineImpl::isolate() const { return info()->isolate(); } |
1999 | 1989 |
2000 } // namespace compiler | 1990 } // namespace compiler |
2001 } // namespace internal | 1991 } // namespace internal |
2002 } // namespace v8 | 1992 } // namespace v8 |
OLD | NEW |