Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(74)

Side by Side Diff: src/compiler/pipeline.cc

Issue 2053383002: Machine-readable TurboFan compiler statistics (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Code comments. Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/compilation-statistics.cc ('k') | src/flag-definitions.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 504 matching lines...) Expand 10 before | Expand all | Expand 10 after
515 515
516 private: 516 private:
517 PhaseScope phase_scope_; 517 PhaseScope phase_scope_;
518 ZonePool::Scope zone_scope_; 518 ZonePool::Scope zone_scope_;
519 }; 519 };
520 520
521 PipelineStatistics* CreatePipelineStatistics(CompilationInfo* info, 521 PipelineStatistics* CreatePipelineStatistics(CompilationInfo* info,
522 ZonePool* zone_pool) { 522 ZonePool* zone_pool) {
523 PipelineStatistics* pipeline_statistics = nullptr; 523 PipelineStatistics* pipeline_statistics = nullptr;
524 524
525 if (FLAG_turbo_stats) { 525 if (FLAG_turbo_stats || FLAG_turbo_stats_nvp) {
526 pipeline_statistics = new PipelineStatistics(info, zone_pool); 526 pipeline_statistics = new PipelineStatistics(info, zone_pool);
527 pipeline_statistics->BeginPhaseKind("initializing"); 527 pipeline_statistics->BeginPhaseKind("initializing");
528 } 528 }
529 529
530 if (FLAG_trace_turbo) { 530 if (FLAG_trace_turbo) {
531 TurboJsonFile json_of(info, std::ios_base::trunc); 531 TurboJsonFile json_of(info, std::ios_base::trunc);
532 Handle<Script> script = info->script(); 532 Handle<Script> script = info->script();
533 base::SmartArrayPointer<char> function_name = info->GetDebugName(); 533 base::SmartArrayPointer<char> function_name = info->GetDebugName();
534 int pos = info->shared_info()->start_position(); 534 int pos = info->shared_info()->start_position();
535 json_of << "{\"function\":\"" << function_name.get() 535 json_of << "{\"function\":\"" << function_name.get()
(...skipping 961 matching lines...) Expand 10 before | Expand all | Expand 10 after
1497 CallDescriptor* call_descriptor, 1497 CallDescriptor* call_descriptor,
1498 Graph* graph, Schedule* schedule, 1498 Graph* graph, Schedule* schedule,
1499 Code::Flags flags, 1499 Code::Flags flags,
1500 const char* debug_name) { 1500 const char* debug_name) {
1501 CompilationInfo info(CStrVector(debug_name), isolate, graph->zone(), flags); 1501 CompilationInfo info(CStrVector(debug_name), isolate, graph->zone(), flags);
1502 1502
1503 // Construct a pipeline for scheduling and code generation. 1503 // Construct a pipeline for scheduling and code generation.
1504 ZonePool zone_pool(isolate->allocator()); 1504 ZonePool zone_pool(isolate->allocator());
1505 PipelineData data(&zone_pool, &info, graph, schedule); 1505 PipelineData data(&zone_pool, &info, graph, schedule);
1506 base::SmartPointer<PipelineStatistics> pipeline_statistics; 1506 base::SmartPointer<PipelineStatistics> pipeline_statistics;
1507 if (FLAG_turbo_stats) { 1507 if (FLAG_turbo_stats || FLAG_turbo_stats_nvp) {
1508 pipeline_statistics.Reset(new PipelineStatistics(&info, &zone_pool)); 1508 pipeline_statistics.Reset(new PipelineStatistics(&info, &zone_pool));
1509 pipeline_statistics->BeginPhaseKind("stub codegen"); 1509 pipeline_statistics->BeginPhaseKind("stub codegen");
1510 } 1510 }
1511 1511
1512 PipelineImpl pipeline(&data); 1512 PipelineImpl pipeline(&data);
1513 DCHECK_NOT_NULL(data.schedule()); 1513 DCHECK_NOT_NULL(data.schedule());
1514 1514
1515 if (FLAG_trace_turbo) { 1515 if (FLAG_trace_turbo) {
1516 { 1516 {
1517 TurboJsonFile json_of(&info, std::ios_base::trunc); 1517 TurboJsonFile json_of(&info, std::ios_base::trunc);
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
1551 1551
1552 // static 1552 // static
1553 Handle<Code> Pipeline::GenerateCodeForTesting(CompilationInfo* info, 1553 Handle<Code> Pipeline::GenerateCodeForTesting(CompilationInfo* info,
1554 CallDescriptor* call_descriptor, 1554 CallDescriptor* call_descriptor,
1555 Graph* graph, 1555 Graph* graph,
1556 Schedule* schedule) { 1556 Schedule* schedule) {
1557 // Construct a pipeline for scheduling and code generation. 1557 // Construct a pipeline for scheduling and code generation.
1558 ZonePool zone_pool(info->isolate()->allocator()); 1558 ZonePool zone_pool(info->isolate()->allocator());
1559 PipelineData data(&zone_pool, info, graph, schedule); 1559 PipelineData data(&zone_pool, info, graph, schedule);
1560 base::SmartPointer<PipelineStatistics> pipeline_statistics; 1560 base::SmartPointer<PipelineStatistics> pipeline_statistics;
1561 if (FLAG_turbo_stats) { 1561 if (FLAG_turbo_stats || FLAG_turbo_stats_nvp) {
1562 pipeline_statistics.Reset(new PipelineStatistics(info, &zone_pool)); 1562 pipeline_statistics.Reset(new PipelineStatistics(info, &zone_pool));
1563 pipeline_statistics->BeginPhaseKind("test codegen"); 1563 pipeline_statistics->BeginPhaseKind("test codegen");
1564 } 1564 }
1565 1565
1566 PipelineImpl pipeline(&data); 1566 PipelineImpl pipeline(&data);
1567 1567
1568 if (FLAG_trace_turbo) { 1568 if (FLAG_trace_turbo) {
1569 TurboJsonFile json_of(info, std::ios_base::trunc); 1569 TurboJsonFile json_of(info, std::ios_base::trunc);
1570 json_of << "{\"function\":\"" << info->GetDebugName().get() 1570 json_of << "{\"function\":\"" << info->GetDebugName().get()
1571 << "\", \"source\":\"\",\n\"phases\":["; 1571 << "\", \"source\":\"\",\n\"phases\":[";
(...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after
1811 data->DeleteRegisterAllocationZone(); 1811 data->DeleteRegisterAllocationZone();
1812 } 1812 }
1813 1813
1814 CompilationInfo* PipelineImpl::info() const { return data_->info(); } 1814 CompilationInfo* PipelineImpl::info() const { return data_->info(); }
1815 1815
1816 Isolate* PipelineImpl::isolate() const { return info()->isolate(); } 1816 Isolate* PipelineImpl::isolate() const { return info()->isolate(); }
1817 1817
1818 } // namespace compiler 1818 } // namespace compiler
1819 } // namespace internal 1819 } // namespace internal
1820 } // namespace v8 1820 } // namespace v8
OLDNEW
« no previous file with comments | « src/compilation-statistics.cc ('k') | src/flag-definitions.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698