Chromium Code Reviews| 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 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 130 javascript_(jsgraph->javascript()), | 130 javascript_(jsgraph->javascript()), |
| 131 jsgraph_(jsgraph), | 131 jsgraph_(jsgraph), |
| 132 instruction_zone_scope_(zone_stats_, ZONE_NAME), | 132 instruction_zone_scope_(zone_stats_, ZONE_NAME), |
| 133 instruction_zone_(instruction_zone_scope_.zone()), | 133 instruction_zone_(instruction_zone_scope_.zone()), |
| 134 register_allocation_zone_scope_(zone_stats_, ZONE_NAME), | 134 register_allocation_zone_scope_(zone_stats_, ZONE_NAME), |
| 135 register_allocation_zone_(register_allocation_zone_scope_.zone()), | 135 register_allocation_zone_(register_allocation_zone_scope_.zone()), |
| 136 protected_instructions_(protected_instructions) {} | 136 protected_instructions_(protected_instructions) {} |
| 137 | 137 |
| 138 // For machine graph testing entry point. | 138 // For machine graph testing entry point. |
| 139 PipelineData(ZoneStats* zone_stats, CompilationInfo* info, Graph* graph, | 139 PipelineData(ZoneStats* zone_stats, CompilationInfo* info, Graph* graph, |
| 140 Schedule* schedule) | 140 Schedule* schedule, SourcePositionTable* position_table) |
| 141 : isolate_(info->isolate()), | 141 : isolate_(info->isolate()), |
| 142 info_(info), | 142 info_(info), |
| 143 debug_name_(info_->GetDebugName()), | 143 debug_name_(info_->GetDebugName()), |
| 144 zone_stats_(zone_stats), | 144 zone_stats_(zone_stats), |
| 145 graph_zone_scope_(zone_stats_, ZONE_NAME), | 145 graph_zone_scope_(zone_stats_, ZONE_NAME), |
| 146 graph_(graph), | 146 graph_(graph), |
| 147 source_positions_(new (info->zone()) SourcePositionTable(graph_)), | 147 source_positions_(position_table ? position_table |
|
Michael Starzinger
2016/12/08 11:38:05
nit: Can we move this piece that maybe allocates a
Clemens Hammacher
2016/12/08 12:15:37
Done. I am wondering though if it would not be bet
| |
| 148 : new (info->zone()) | |
| 149 SourcePositionTable(graph_)), | |
| 148 schedule_(schedule), | 150 schedule_(schedule), |
| 149 instruction_zone_scope_(zone_stats_, ZONE_NAME), | 151 instruction_zone_scope_(zone_stats_, ZONE_NAME), |
| 150 instruction_zone_(instruction_zone_scope_.zone()), | 152 instruction_zone_(instruction_zone_scope_.zone()), |
| 151 register_allocation_zone_scope_(zone_stats_, ZONE_NAME), | 153 register_allocation_zone_scope_(zone_stats_, ZONE_NAME), |
| 152 register_allocation_zone_(register_allocation_zone_scope_.zone()) {} | 154 register_allocation_zone_(register_allocation_zone_scope_.zone()) {} |
| 153 | 155 |
| 154 // For register allocation testing entry point. | 156 // For register allocation testing entry point. |
| 155 PipelineData(ZoneStats* zone_stats, CompilationInfo* info, | 157 PipelineData(ZoneStats* zone_stats, CompilationInfo* info, |
| 156 InstructionSequence* sequence) | 158 InstructionSequence* sequence) |
| 157 : isolate_(info->isolate()), | 159 : isolate_(info->isolate()), |
| (...skipping 1476 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1634 Handle<Code> Pipeline::GenerateCodeForCodeStub(Isolate* isolate, | 1636 Handle<Code> Pipeline::GenerateCodeForCodeStub(Isolate* isolate, |
| 1635 CallDescriptor* call_descriptor, | 1637 CallDescriptor* call_descriptor, |
| 1636 Graph* graph, Schedule* schedule, | 1638 Graph* graph, Schedule* schedule, |
| 1637 Code::Flags flags, | 1639 Code::Flags flags, |
| 1638 const char* debug_name) { | 1640 const char* debug_name) { |
| 1639 CompilationInfo info(CStrVector(debug_name), isolate, graph->zone(), flags); | 1641 CompilationInfo info(CStrVector(debug_name), isolate, graph->zone(), flags); |
| 1640 if (isolate->serializer_enabled()) info.PrepareForSerializing(); | 1642 if (isolate->serializer_enabled()) info.PrepareForSerializing(); |
| 1641 | 1643 |
| 1642 // Construct a pipeline for scheduling and code generation. | 1644 // Construct a pipeline for scheduling and code generation. |
| 1643 ZoneStats zone_stats(isolate->allocator()); | 1645 ZoneStats zone_stats(isolate->allocator()); |
| 1644 PipelineData data(&zone_stats, &info, graph, schedule); | 1646 PipelineData data(&zone_stats, &info, graph, schedule, nullptr); |
| 1645 std::unique_ptr<PipelineStatistics> pipeline_statistics; | 1647 std::unique_ptr<PipelineStatistics> pipeline_statistics; |
| 1646 if (FLAG_turbo_stats || FLAG_turbo_stats_nvp) { | 1648 if (FLAG_turbo_stats || FLAG_turbo_stats_nvp) { |
| 1647 pipeline_statistics.reset(new PipelineStatistics(&info, &zone_stats)); | 1649 pipeline_statistics.reset(new PipelineStatistics(&info, &zone_stats)); |
| 1648 pipeline_statistics->BeginPhaseKind("stub codegen"); | 1650 pipeline_statistics->BeginPhaseKind("stub codegen"); |
| 1649 } | 1651 } |
| 1650 | 1652 |
| 1651 PipelineImpl pipeline(&data); | 1653 PipelineImpl pipeline(&data); |
| 1652 DCHECK_NOT_NULL(data.schedule()); | 1654 DCHECK_NOT_NULL(data.schedule()); |
| 1653 | 1655 |
| 1654 if (FLAG_trace_turbo) { | 1656 if (FLAG_trace_turbo) { |
| (...skipping 27 matching lines...) Expand all Loading... | |
| 1682 // static | 1684 // static |
| 1683 Handle<Code> Pipeline::GenerateCodeForTesting(CompilationInfo* info, | 1685 Handle<Code> Pipeline::GenerateCodeForTesting(CompilationInfo* info, |
| 1684 Graph* graph, | 1686 Graph* graph, |
| 1685 Schedule* schedule) { | 1687 Schedule* schedule) { |
| 1686 CallDescriptor* call_descriptor = | 1688 CallDescriptor* call_descriptor = |
| 1687 Linkage::ComputeIncoming(info->zone(), info); | 1689 Linkage::ComputeIncoming(info->zone(), info); |
| 1688 return GenerateCodeForTesting(info, call_descriptor, graph, schedule); | 1690 return GenerateCodeForTesting(info, call_descriptor, graph, schedule); |
| 1689 } | 1691 } |
| 1690 | 1692 |
| 1691 // static | 1693 // static |
| 1692 Handle<Code> Pipeline::GenerateCodeForTesting(CompilationInfo* info, | 1694 Handle<Code> Pipeline::GenerateCodeForTesting( |
| 1693 CallDescriptor* call_descriptor, | 1695 CompilationInfo* info, CallDescriptor* call_descriptor, Graph* graph, |
| 1694 Graph* graph, | 1696 Schedule* schedule, SourcePositionTable* source_positions) { |
| 1695 Schedule* schedule) { | |
| 1696 // Construct a pipeline for scheduling and code generation. | 1697 // Construct a pipeline for scheduling and code generation. |
| 1697 ZoneStats zone_stats(info->isolate()->allocator()); | 1698 ZoneStats zone_stats(info->isolate()->allocator()); |
| 1698 PipelineData data(&zone_stats, info, graph, schedule); | 1699 PipelineData data(&zone_stats, info, graph, schedule, source_positions); |
| 1699 std::unique_ptr<PipelineStatistics> pipeline_statistics; | 1700 std::unique_ptr<PipelineStatistics> pipeline_statistics; |
| 1700 if (FLAG_turbo_stats || FLAG_turbo_stats_nvp) { | 1701 if (FLAG_turbo_stats || FLAG_turbo_stats_nvp) { |
| 1701 pipeline_statistics.reset(new PipelineStatistics(info, &zone_stats)); | 1702 pipeline_statistics.reset(new PipelineStatistics(info, &zone_stats)); |
| 1702 pipeline_statistics->BeginPhaseKind("test codegen"); | 1703 pipeline_statistics->BeginPhaseKind("test codegen"); |
| 1703 } | 1704 } |
| 1704 | 1705 |
| 1705 PipelineImpl pipeline(&data); | 1706 PipelineImpl pipeline(&data); |
| 1706 | 1707 |
| 1707 if (FLAG_trace_turbo) { | 1708 if (FLAG_trace_turbo) { |
| 1708 TurboJsonFile json_of(info, std::ios_base::trunc); | 1709 TurboJsonFile json_of(info, std::ios_base::trunc); |
| (...skipping 265 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1974 data->DeleteRegisterAllocationZone(); | 1975 data->DeleteRegisterAllocationZone(); |
| 1975 } | 1976 } |
| 1976 | 1977 |
| 1977 CompilationInfo* PipelineImpl::info() const { return data_->info(); } | 1978 CompilationInfo* PipelineImpl::info() const { return data_->info(); } |
| 1978 | 1979 |
| 1979 Isolate* PipelineImpl::isolate() const { return info()->isolate(); } | 1980 Isolate* PipelineImpl::isolate() const { return info()->isolate(); } |
| 1980 | 1981 |
| 1981 } // namespace compiler | 1982 } // namespace compiler |
| 1982 } // namespace internal | 1983 } // namespace internal |
| 1983 } // namespace v8 | 1984 } // namespace v8 |
| OLD | NEW |