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 1613 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1624 // Lower changes that have been inserted before. | 1624 // Lower changes that have been inserted before. |
1625 Run<LateOptimizationPhase>(); | 1625 Run<LateOptimizationPhase>(); |
1626 // TODO(jarin, rossberg): Remove UNTYPED once machine typing works. | 1626 // TODO(jarin, rossberg): Remove UNTYPED once machine typing works. |
1627 RunPrintAndVerify("Late optimized", true); | 1627 RunPrintAndVerify("Late optimized", true); |
1628 | 1628 |
1629 data->source_positions()->RemoveDecorator(); | 1629 data->source_positions()->RemoveDecorator(); |
1630 | 1630 |
1631 return ScheduleAndSelectInstructions(linkage, true); | 1631 return ScheduleAndSelectInstructions(linkage, true); |
1632 } | 1632 } |
1633 | 1633 |
| 1634 // TODO(ishell): Remove verify_graph parameter and always enable the |
| 1635 // verification once all the issues are fixed. |
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, |
| 1641 bool verify_graph) { |
1639 CompilationInfo info(CStrVector(debug_name), isolate, graph->zone(), flags); | 1642 CompilationInfo info(CStrVector(debug_name), isolate, graph->zone(), flags); |
| 1643 info.set_verify_graph(verify_graph); |
1640 if (isolate->serializer_enabled()) info.PrepareForSerializing(); | 1644 if (isolate->serializer_enabled()) info.PrepareForSerializing(); |
1641 | 1645 |
1642 // Construct a pipeline for scheduling and code generation. | 1646 // Construct a pipeline for scheduling and code generation. |
1643 ZoneStats zone_stats(isolate->allocator()); | 1647 ZoneStats zone_stats(isolate->allocator()); |
1644 SourcePositionTable source_positions(graph); | 1648 SourcePositionTable source_positions(graph); |
1645 PipelineData data(&zone_stats, &info, graph, schedule, &source_positions); | 1649 PipelineData data(&zone_stats, &info, graph, schedule, &source_positions); |
1646 std::unique_ptr<PipelineStatistics> pipeline_statistics; | 1650 std::unique_ptr<PipelineStatistics> pipeline_statistics; |
1647 if (FLAG_turbo_stats || FLAG_turbo_stats_nvp) { | 1651 if (FLAG_turbo_stats || FLAG_turbo_stats_nvp) { |
1648 pipeline_statistics.reset(new PipelineStatistics(&info, &zone_stats)); | 1652 pipeline_statistics.reset(new PipelineStatistics(&info, &zone_stats)); |
1649 pipeline_statistics->BeginPhaseKind("stub codegen"); | 1653 pipeline_statistics->BeginPhaseKind("stub codegen"); |
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1765 RunPrintAndVerify("Late trimmed", true); | 1769 RunPrintAndVerify("Late trimmed", true); |
1766 } | 1770 } |
1767 if (data->schedule() == nullptr) Run<ComputeSchedulePhase>(); | 1771 if (data->schedule() == nullptr) Run<ComputeSchedulePhase>(); |
1768 TraceSchedule(data->info(), data->schedule()); | 1772 TraceSchedule(data->info(), data->schedule()); |
1769 | 1773 |
1770 if (FLAG_turbo_profiling) { | 1774 if (FLAG_turbo_profiling) { |
1771 data->set_profiler_data(BasicBlockInstrumentor::Instrument( | 1775 data->set_profiler_data(BasicBlockInstrumentor::Instrument( |
1772 info(), data->graph(), data->schedule())); | 1776 info(), data->graph(), data->schedule())); |
1773 } | 1777 } |
1774 | 1778 |
1775 // TODO(ishell): Always enable graph verification of stubs in debug mode | 1779 bool verify_stub_graph = data->info()->verify_graph(); |
1776 // once all the issues are fixed. | |
1777 bool verify_stub_graph = | |
1778 DEBUG_BOOL && FLAG_csa_verify && data->info()->IsStub(); | |
1779 | |
1780 if (verify_stub_graph || (FLAG_turbo_verify_machine_graph != nullptr && | 1780 if (verify_stub_graph || (FLAG_turbo_verify_machine_graph != nullptr && |
1781 (!strcmp(FLAG_turbo_verify_machine_graph, "*") || | 1781 (!strcmp(FLAG_turbo_verify_machine_graph, "*") || |
1782 !strcmp(FLAG_turbo_verify_machine_graph, | 1782 !strcmp(FLAG_turbo_verify_machine_graph, |
1783 data->info()->GetDebugName().get())))) { | 1783 data->info()->GetDebugName().get())))) { |
1784 if (FLAG_trace_csa_verify) { | 1784 if (FLAG_trace_csa_verify) { |
1785 AllowHandleDereference allow_deref; | 1785 AllowHandleDereference allow_deref; |
1786 CompilationInfo* info = data->info(); | 1786 CompilationInfo* info = data->info(); |
1787 CodeTracer::Scope tracing_scope(info->isolate()->GetCodeTracer()); | 1787 CodeTracer::Scope tracing_scope(info->isolate()->GetCodeTracer()); |
1788 OFStream os(tracing_scope.file()); | 1788 OFStream os(tracing_scope.file()); |
1789 os << "--------------------------------------------------\n" | 1789 os << "--------------------------------------------------\n" |
(...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1999 data->DeleteRegisterAllocationZone(); | 1999 data->DeleteRegisterAllocationZone(); |
2000 } | 2000 } |
2001 | 2001 |
2002 CompilationInfo* PipelineImpl::info() const { return data_->info(); } | 2002 CompilationInfo* PipelineImpl::info() const { return data_->info(); } |
2003 | 2003 |
2004 Isolate* PipelineImpl::isolate() const { return info()->isolate(); } | 2004 Isolate* PipelineImpl::isolate() const { return info()->isolate(); } |
2005 | 2005 |
2006 } // namespace compiler | 2006 } // namespace compiler |
2007 } // namespace internal | 2007 } // namespace internal |
2008 } // namespace v8 | 2008 } // namespace v8 |
OLD | NEW |