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 <memory> |
| 6 |
5 #include "src/compiler.h" | 7 #include "src/compiler.h" |
6 #include "src/compiler/pipeline-statistics.h" | 8 #include "src/compiler/pipeline-statistics.h" |
7 #include "src/compiler/zone-pool.h" | 9 #include "src/compiler/zone-pool.h" |
8 | 10 |
9 namespace v8 { | 11 namespace v8 { |
10 namespace internal { | 12 namespace internal { |
11 namespace compiler { | 13 namespace compiler { |
12 | 14 |
13 void PipelineStatistics::CommonStats::Begin( | 15 void PipelineStatistics::CommonStats::Begin( |
14 PipelineStatistics* pipeline_stats) { | 16 PipelineStatistics* pipeline_stats) { |
(...skipping 30 matching lines...) Expand all Loading... |
45 ZonePool* zone_pool) | 47 ZonePool* zone_pool) |
46 : isolate_(info->isolate()), | 48 : isolate_(info->isolate()), |
47 outer_zone_(info->zone()), | 49 outer_zone_(info->zone()), |
48 zone_pool_(zone_pool), | 50 zone_pool_(zone_pool), |
49 compilation_stats_(isolate_->GetTurboStatistics()), | 51 compilation_stats_(isolate_->GetTurboStatistics()), |
50 source_size_(0), | 52 source_size_(0), |
51 phase_kind_name_(nullptr), | 53 phase_kind_name_(nullptr), |
52 phase_name_(nullptr) { | 54 phase_name_(nullptr) { |
53 if (info->has_shared_info()) { | 55 if (info->has_shared_info()) { |
54 source_size_ = static_cast<size_t>(info->shared_info()->SourceSize()); | 56 source_size_ = static_cast<size_t>(info->shared_info()->SourceSize()); |
55 base::SmartArrayPointer<char> name = | 57 std::unique_ptr<char[]> name = |
56 info->shared_info()->DebugName()->ToCString(); | 58 info->shared_info()->DebugName()->ToCString(); |
57 function_name_ = name.get(); | 59 function_name_ = name.get(); |
58 } | 60 } |
59 total_stats_.Begin(this); | 61 total_stats_.Begin(this); |
60 } | 62 } |
61 | 63 |
62 | 64 |
63 PipelineStatistics::~PipelineStatistics() { | 65 PipelineStatistics::~PipelineStatistics() { |
64 if (InPhaseKind()) EndPhaseKind(); | 66 if (InPhaseKind()) EndPhaseKind(); |
65 CompilationStatistics::BasicStats diff; | 67 CompilationStatistics::BasicStats diff; |
(...skipping 28 matching lines...) Expand all Loading... |
94 void PipelineStatistics::EndPhase() { | 96 void PipelineStatistics::EndPhase() { |
95 DCHECK(InPhaseKind()); | 97 DCHECK(InPhaseKind()); |
96 CompilationStatistics::BasicStats diff; | 98 CompilationStatistics::BasicStats diff; |
97 phase_stats_.End(this, &diff); | 99 phase_stats_.End(this, &diff); |
98 compilation_stats_->RecordPhaseStats(phase_kind_name_, phase_name_, diff); | 100 compilation_stats_->RecordPhaseStats(phase_kind_name_, phase_name_, diff); |
99 } | 101 } |
100 | 102 |
101 } // namespace compiler | 103 } // namespace compiler |
102 } // namespace internal | 104 } // namespace internal |
103 } // namespace v8 | 105 } // namespace v8 |
OLD | NEW |