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 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
108 InstructionSelector::AlignmentRequirements()); | 108 InstructionSelector::AlignmentRequirements()); |
109 common_ = new (graph_zone_) CommonOperatorBuilder(graph_zone_); | 109 common_ = new (graph_zone_) CommonOperatorBuilder(graph_zone_); |
110 javascript_ = new (graph_zone_) JSOperatorBuilder(graph_zone_); | 110 javascript_ = new (graph_zone_) JSOperatorBuilder(graph_zone_); |
111 jsgraph_ = new (graph_zone_) | 111 jsgraph_ = new (graph_zone_) |
112 JSGraph(isolate_, graph_, common_, javascript_, simplified_, machine_); | 112 JSGraph(isolate_, graph_, common_, javascript_, simplified_, machine_); |
113 is_asm_ = info->shared_info()->asm_function(); | 113 is_asm_ = info->shared_info()->asm_function(); |
114 } | 114 } |
115 | 115 |
116 // For WASM compile entry point. | 116 // For WASM compile entry point. |
117 PipelineData(ZoneStats* zone_stats, CompilationInfo* info, JSGraph* jsgraph, | 117 PipelineData(ZoneStats* zone_stats, CompilationInfo* info, JSGraph* jsgraph, |
118 PipelineStatistics* pipeline_statistics, | |
118 SourcePositionTable* source_positions, | 119 SourcePositionTable* source_positions, |
119 ZoneVector<trap_handler::ProtectedInstructionData>* | 120 ZoneVector<trap_handler::ProtectedInstructionData>* |
120 protected_instructions) | 121 protected_instructions) |
121 : isolate_(info->isolate()), | 122 : isolate_(info->isolate()), |
122 info_(info), | 123 info_(info), |
123 debug_name_(info_->GetDebugName()), | 124 debug_name_(info_->GetDebugName()), |
124 zone_stats_(zone_stats), | 125 zone_stats_(zone_stats), |
126 pipeline_statistics_(pipeline_statistics), | |
125 graph_zone_scope_(zone_stats_, ZONE_NAME), | 127 graph_zone_scope_(zone_stats_, ZONE_NAME), |
126 graph_(jsgraph->graph()), | 128 graph_(jsgraph->graph()), |
127 source_positions_(source_positions), | 129 source_positions_(source_positions), |
128 machine_(jsgraph->machine()), | 130 machine_(jsgraph->machine()), |
129 common_(jsgraph->common()), | 131 common_(jsgraph->common()), |
130 javascript_(jsgraph->javascript()), | 132 javascript_(jsgraph->javascript()), |
131 jsgraph_(jsgraph), | 133 jsgraph_(jsgraph), |
132 instruction_zone_scope_(zone_stats_, ZONE_NAME), | 134 instruction_zone_scope_(zone_stats_, ZONE_NAME), |
133 instruction_zone_(instruction_zone_scope_.zone()), | 135 instruction_zone_(instruction_zone_scope_.zone()), |
134 register_allocation_zone_scope_(zone_stats_, ZONE_NAME), | 136 register_allocation_zone_scope_(zone_stats_, ZONE_NAME), |
(...skipping 506 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
641 class PipelineWasmCompilationJob final : public CompilationJob { | 643 class PipelineWasmCompilationJob final : public CompilationJob { |
642 public: | 644 public: |
643 explicit PipelineWasmCompilationJob( | 645 explicit PipelineWasmCompilationJob( |
644 CompilationInfo* info, JSGraph* jsgraph, CallDescriptor* descriptor, | 646 CompilationInfo* info, JSGraph* jsgraph, CallDescriptor* descriptor, |
645 SourcePositionTable* source_positions, | 647 SourcePositionTable* source_positions, |
646 ZoneVector<trap_handler::ProtectedInstructionData>* protected_insts, | 648 ZoneVector<trap_handler::ProtectedInstructionData>* protected_insts, |
647 bool allow_signalling_nan) | 649 bool allow_signalling_nan) |
648 : CompilationJob(info->isolate(), info, "TurboFan", | 650 : CompilationJob(info->isolate(), info, "TurboFan", |
649 State::kReadyToExecute), | 651 State::kReadyToExecute), |
650 zone_stats_(info->isolate()->allocator()), | 652 zone_stats_(info->isolate()->allocator()), |
651 data_(&zone_stats_, info, jsgraph, source_positions, protected_insts), | 653 pipeline_statistics_(CreatePipelineStatistics(info, &zone_stats_)), |
654 data_(&zone_stats_, info, jsgraph, pipeline_statistics_.get(), | |
655 source_positions, protected_insts), | |
652 pipeline_(&data_), | 656 pipeline_(&data_), |
653 linkage_(descriptor), | 657 linkage_(descriptor), |
654 allow_signalling_nan_(allow_signalling_nan) {} | 658 allow_signalling_nan_(allow_signalling_nan) {} |
655 | 659 |
656 protected: | 660 protected: |
657 Status PrepareJobImpl() final; | 661 Status PrepareJobImpl() final; |
658 Status ExecuteJobImpl() final; | 662 Status ExecuteJobImpl() final; |
659 Status FinalizeJobImpl() final; | 663 Status FinalizeJobImpl() final; |
660 | 664 |
661 private: | 665 private: |
662 ZoneStats zone_stats_; | 666 ZoneStats zone_stats_; |
667 std::unique_ptr<PipelineStatistics> pipeline_statistics_; | |
Mircea Trofin
2017/03/22 18:12:21
can we move this guy up in CompilationJob?
bradn
2017/03/22 18:46:45
Ugh.
If you mean CompilationJob, that's tricky as
| |
663 PipelineData data_; | 668 PipelineData data_; |
664 PipelineImpl pipeline_; | 669 PipelineImpl pipeline_; |
665 Linkage linkage_; | 670 Linkage linkage_; |
666 bool allow_signalling_nan_; | 671 bool allow_signalling_nan_; |
667 }; | 672 }; |
668 | 673 |
669 PipelineWasmCompilationJob::Status | 674 PipelineWasmCompilationJob::Status |
670 PipelineWasmCompilationJob::PrepareJobImpl() { | 675 PipelineWasmCompilationJob::PrepareJobImpl() { |
671 UNREACHABLE(); // Prepare should always be skipped for WasmCompilationJob. | 676 UNREACHABLE(); // Prepare should always be skipped for WasmCompilationJob. |
672 return SUCCEEDED; | 677 return SUCCEEDED; |
(...skipping 1349 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2022 data->DeleteRegisterAllocationZone(); | 2027 data->DeleteRegisterAllocationZone(); |
2023 } | 2028 } |
2024 | 2029 |
2025 CompilationInfo* PipelineImpl::info() const { return data_->info(); } | 2030 CompilationInfo* PipelineImpl::info() const { return data_->info(); } |
2026 | 2031 |
2027 Isolate* PipelineImpl::isolate() const { return info()->isolate(); } | 2032 Isolate* PipelineImpl::isolate() const { return info()->isolate(); } |
2028 | 2033 |
2029 } // namespace compiler | 2034 } // namespace compiler |
2030 } // namespace internal | 2035 } // namespace internal |
2031 } // namespace v8 | 2036 } // namespace v8 |
OLD | NEW |