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 <sstream> | 8 #include <sstream> |
| 9 | 9 |
| 10 #include "src/base/adapters.h" | 10 #include "src/base/adapters.h" |
| (...skipping 584 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 595 Linkage linkage_; | 595 Linkage linkage_; |
| 596 }; | 596 }; |
| 597 | 597 |
| 598 PipelineWasmCompilationJob::Status | 598 PipelineWasmCompilationJob::Status |
| 599 PipelineWasmCompilationJob::CreateGraphImpl() { | 599 PipelineWasmCompilationJob::CreateGraphImpl() { |
| 600 return SUCCEEDED; | 600 return SUCCEEDED; |
| 601 } | 601 } |
| 602 | 602 |
| 603 PipelineWasmCompilationJob::Status | 603 PipelineWasmCompilationJob::Status |
| 604 PipelineWasmCompilationJob::OptimizeGraphImpl() { | 604 PipelineWasmCompilationJob::OptimizeGraphImpl() { |
| 605 if (FLAG_trace_turbo) { | |
| 606 FILE* json_file = OpenVisualizerLogFile(info(), nullptr, "json", "w+"); | |
| 607 if (json_file != nullptr) { | |
| 608 OFStream json_of(json_file); | |
| 609 json_of << "{\"function\":\"" << info()->GetDebugName().get() | |
| 610 << "\", \"source\":\"\",\n\"phases\":["; | |
| 611 fclose(json_file); | |
| 612 } | |
| 613 } | |
| 614 | |
| 615 pipeline_.RunPrintAndVerify("Machine", true); | |
| 616 | |
| 605 if (!pipeline_.ScheduleAndSelectInstructions(&linkage_)) return FAILED; | 617 if (!pipeline_.ScheduleAndSelectInstructions(&linkage_)) return FAILED; |
| 606 return SUCCEEDED; | 618 return SUCCEEDED; |
| 607 } | 619 } |
| 608 | 620 |
| 609 PipelineWasmCompilationJob::Status | 621 PipelineWasmCompilationJob::Status |
| 610 PipelineWasmCompilationJob::GenerateCodeImpl() { | 622 PipelineWasmCompilationJob::GenerateCodeImpl() { |
| 611 pipeline_.GenerateCode(&linkage_); | 623 pipeline_.GenerateCode(&linkage_); |
| 612 return SUCCEEDED; | 624 return SUCCEEDED; |
| 613 } | 625 } |
| 614 | 626 |
| (...skipping 831 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1446 ZonePool zone_pool(info->isolate()->allocator()); | 1458 ZonePool zone_pool(info->isolate()->allocator()); |
| 1447 PipelineData data(&zone_pool, info, graph, schedule); | 1459 PipelineData data(&zone_pool, info, graph, schedule); |
| 1448 base::SmartPointer<PipelineStatistics> pipeline_statistics; | 1460 base::SmartPointer<PipelineStatistics> pipeline_statistics; |
| 1449 if (FLAG_turbo_stats) { | 1461 if (FLAG_turbo_stats) { |
| 1450 pipeline_statistics.Reset(new PipelineStatistics(info, &zone_pool)); | 1462 pipeline_statistics.Reset(new PipelineStatistics(info, &zone_pool)); |
| 1451 pipeline_statistics->BeginPhaseKind("test codegen"); | 1463 pipeline_statistics->BeginPhaseKind("test codegen"); |
| 1452 } | 1464 } |
| 1453 | 1465 |
| 1454 Pipeline pipeline(&data); | 1466 Pipeline pipeline(&data); |
| 1455 if (data.schedule() == nullptr) { | 1467 if (data.schedule() == nullptr) { |
| 1468 if (FLAG_trace_turbo) { | |
|
ahaas
2016/04/27 14:45:22
Why do you write the header only if there is no sc
Clemens Hammacher
2016/04/27 14:58:55
Because also the RunPrintAndVerity is only execute
| |
| 1469 FILE* json_file = OpenVisualizerLogFile(info, nullptr, "json", "w+"); | |
| 1470 if (json_file != nullptr) { | |
| 1471 OFStream json_of(json_file); | |
| 1472 json_of << "{\"function\":\"" << info->GetDebugName().get() | |
| 1473 << "\", \"source\":\"\",\n\"phases\":["; | |
| 1474 fclose(json_file); | |
| 1475 } | |
| 1476 } | |
| 1456 // TODO(rossberg): Should this really be untyped? | 1477 // TODO(rossberg): Should this really be untyped? |
| 1457 pipeline.RunPrintAndVerify("Machine", true); | 1478 pipeline.RunPrintAndVerify("Machine", true); |
| 1458 } | 1479 } |
| 1459 | 1480 |
| 1460 return pipeline.ScheduleAndGenerateCode(call_descriptor); | 1481 return pipeline.ScheduleAndGenerateCode(call_descriptor); |
| 1461 } | 1482 } |
| 1462 | 1483 |
| 1463 // static | 1484 // static |
| 1464 OptimizedCompileJob* Pipeline::NewCompilationJob(CompilationInfo* info) { | 1485 OptimizedCompileJob* Pipeline::NewCompilationJob(CompilationInfo* info) { |
| 1465 return new PipelineCompilationJob(info); | 1486 return new PipelineCompilationJob(info); |
| (...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1698 data->DeleteRegisterAllocationZone(); | 1719 data->DeleteRegisterAllocationZone(); |
| 1699 } | 1720 } |
| 1700 | 1721 |
| 1701 CompilationInfo* Pipeline::info() const { return data_->info(); } | 1722 CompilationInfo* Pipeline::info() const { return data_->info(); } |
| 1702 | 1723 |
| 1703 Isolate* Pipeline::isolate() const { return info()->isolate(); } | 1724 Isolate* Pipeline::isolate() const { return info()->isolate(); } |
| 1704 | 1725 |
| 1705 } // namespace compiler | 1726 } // namespace compiler |
| 1706 } // namespace internal | 1727 } // namespace internal |
| 1707 } // namespace v8 | 1728 } // namespace v8 |
| OLD | NEW |