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* source_positions) |
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_(source_positions), |
148 schedule_(schedule), | 148 schedule_(schedule), |
149 instruction_zone_scope_(zone_stats_, ZONE_NAME), | 149 instruction_zone_scope_(zone_stats_, ZONE_NAME), |
150 instruction_zone_(instruction_zone_scope_.zone()), | 150 instruction_zone_(instruction_zone_scope_.zone()), |
151 register_allocation_zone_scope_(zone_stats_, ZONE_NAME), | 151 register_allocation_zone_scope_(zone_stats_, ZONE_NAME), |
152 register_allocation_zone_(register_allocation_zone_scope_.zone()) {} | 152 register_allocation_zone_(register_allocation_zone_scope_.zone()) {} |
153 | 153 |
154 // For register allocation testing entry point. | 154 // For register allocation testing entry point. |
155 PipelineData(ZoneStats* zone_stats, CompilationInfo* info, | 155 PipelineData(ZoneStats* zone_stats, CompilationInfo* info, |
156 InstructionSequence* sequence) | 156 InstructionSequence* sequence) |
157 : isolate_(info->isolate()), | 157 : isolate_(info->isolate()), |
(...skipping 1476 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1634 Handle<Code> Pipeline::GenerateCodeForCodeStub(Isolate* isolate, | 1634 Handle<Code> Pipeline::GenerateCodeForCodeStub(Isolate* isolate, |
1635 CallDescriptor* call_descriptor, | 1635 CallDescriptor* call_descriptor, |
1636 Graph* graph, Schedule* schedule, | 1636 Graph* graph, Schedule* schedule, |
1637 Code::Flags flags, | 1637 Code::Flags flags, |
1638 const char* debug_name) { | 1638 const char* debug_name) { |
1639 CompilationInfo info(CStrVector(debug_name), isolate, graph->zone(), flags); | 1639 CompilationInfo info(CStrVector(debug_name), isolate, graph->zone(), flags); |
1640 if (isolate->serializer_enabled()) info.PrepareForSerializing(); | 1640 if (isolate->serializer_enabled()) info.PrepareForSerializing(); |
1641 | 1641 |
1642 // Construct a pipeline for scheduling and code generation. | 1642 // Construct a pipeline for scheduling and code generation. |
1643 ZoneStats zone_stats(isolate->allocator()); | 1643 ZoneStats zone_stats(isolate->allocator()); |
1644 PipelineData data(&zone_stats, &info, graph, schedule); | 1644 SourcePositionTable source_positions(graph); |
1645 PipelineData data(&zone_stats, &info, graph, schedule, &source_positions); | |
1645 std::unique_ptr<PipelineStatistics> pipeline_statistics; | 1646 std::unique_ptr<PipelineStatistics> pipeline_statistics; |
1646 if (FLAG_turbo_stats || FLAG_turbo_stats_nvp) { | 1647 if (FLAG_turbo_stats || FLAG_turbo_stats_nvp) { |
1647 pipeline_statistics.reset(new PipelineStatistics(&info, &zone_stats)); | 1648 pipeline_statistics.reset(new PipelineStatistics(&info, &zone_stats)); |
1648 pipeline_statistics->BeginPhaseKind("stub codegen"); | 1649 pipeline_statistics->BeginPhaseKind("stub codegen"); |
1649 } | 1650 } |
1650 | 1651 |
1651 PipelineImpl pipeline(&data); | 1652 PipelineImpl pipeline(&data); |
1652 DCHECK_NOT_NULL(data.schedule()); | 1653 DCHECK_NOT_NULL(data.schedule()); |
1653 | 1654 |
1654 if (FLAG_trace_turbo) { | 1655 if (FLAG_trace_turbo) { |
(...skipping 27 matching lines...) Expand all Loading... | |
1682 // static | 1683 // static |
1683 Handle<Code> Pipeline::GenerateCodeForTesting(CompilationInfo* info, | 1684 Handle<Code> Pipeline::GenerateCodeForTesting(CompilationInfo* info, |
1684 Graph* graph, | 1685 Graph* graph, |
1685 Schedule* schedule) { | 1686 Schedule* schedule) { |
1686 CallDescriptor* call_descriptor = | 1687 CallDescriptor* call_descriptor = |
1687 Linkage::ComputeIncoming(info->zone(), info); | 1688 Linkage::ComputeIncoming(info->zone(), info); |
1688 return GenerateCodeForTesting(info, call_descriptor, graph, schedule); | 1689 return GenerateCodeForTesting(info, call_descriptor, graph, schedule); |
1689 } | 1690 } |
1690 | 1691 |
1691 // static | 1692 // static |
1692 Handle<Code> Pipeline::GenerateCodeForTesting(CompilationInfo* info, | 1693 Handle<Code> Pipeline::GenerateCodeForTesting( |
1693 CallDescriptor* call_descriptor, | 1694 CompilationInfo* info, CallDescriptor* call_descriptor, Graph* graph, |
1694 Graph* graph, | 1695 Schedule* schedule, SourcePositionTable* source_positions) { |
1695 Schedule* schedule) { | |
1696 // Construct a pipeline for scheduling and code generation. | 1696 // Construct a pipeline for scheduling and code generation. |
1697 ZoneStats zone_stats(info->isolate()->allocator()); | 1697 ZoneStats zone_stats(info->isolate()->allocator()); |
1698 PipelineData data(&zone_stats, info, graph, schedule); | 1698 if (!source_positions) |
1699 source_positions = new (info->zone()) SourcePositionTable(graph); | |
titzer
2016/12/08 14:08:50
I don't think you need this in the CompilationInfo
Clemens Hammacher
2016/12/08 15:26:21
The table will actually never be filled, so there
| |
1700 PipelineData data(&zone_stats, info, graph, schedule, source_positions); | |
1699 std::unique_ptr<PipelineStatistics> pipeline_statistics; | 1701 std::unique_ptr<PipelineStatistics> pipeline_statistics; |
1700 if (FLAG_turbo_stats || FLAG_turbo_stats_nvp) { | 1702 if (FLAG_turbo_stats || FLAG_turbo_stats_nvp) { |
1701 pipeline_statistics.reset(new PipelineStatistics(info, &zone_stats)); | 1703 pipeline_statistics.reset(new PipelineStatistics(info, &zone_stats)); |
1702 pipeline_statistics->BeginPhaseKind("test codegen"); | 1704 pipeline_statistics->BeginPhaseKind("test codegen"); |
1703 } | 1705 } |
1704 | 1706 |
1705 PipelineImpl pipeline(&data); | 1707 PipelineImpl pipeline(&data); |
1706 | 1708 |
1707 if (FLAG_trace_turbo) { | 1709 if (FLAG_trace_turbo) { |
1708 TurboJsonFile json_of(info, std::ios_base::trunc); | 1710 TurboJsonFile json_of(info, std::ios_base::trunc); |
(...skipping 265 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1974 data->DeleteRegisterAllocationZone(); | 1976 data->DeleteRegisterAllocationZone(); |
1975 } | 1977 } |
1976 | 1978 |
1977 CompilationInfo* PipelineImpl::info() const { return data_->info(); } | 1979 CompilationInfo* PipelineImpl::info() const { return data_->info(); } |
1978 | 1980 |
1979 Isolate* PipelineImpl::isolate() const { return info()->isolate(); } | 1981 Isolate* PipelineImpl::isolate() const { return info()->isolate(); } |
1980 | 1982 |
1981 } // namespace compiler | 1983 } // namespace compiler |
1982 } // namespace internal | 1984 } // namespace internal |
1983 } // namespace v8 | 1985 } // namespace v8 |
OLD | NEW |