| 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 #ifndef V8_COMPILER_PIPELINE_STATISTICS_H_ | 5 #ifndef V8_COMPILER_PIPELINE_STATISTICS_H_ |
| 6 #define V8_COMPILER_PIPELINE_STATISTICS_H_ | 6 #define V8_COMPILER_PIPELINE_STATISTICS_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "src/compilation-statistics.h" | 10 #include "src/compilation-statistics.h" |
| 11 #include "src/compiler/zone-pool.h" | 11 #include "src/compiler/zone-pool.h" |
| 12 | 12 |
| 13 namespace v8 { | 13 namespace v8 { |
| 14 namespace internal { | 14 namespace internal { |
| 15 namespace compiler { | 15 namespace compiler { |
| 16 | 16 |
| 17 class PhaseScope; | 17 class PhaseScope; |
| 18 | 18 |
| 19 class PipelineStatistics : public Malloced { | 19 class PipelineStatistics : public Malloced { |
| 20 public: | 20 public: |
| 21 PipelineStatistics(CompilationInfo* info, ZonePool* zone_pool); | 21 PipelineStatistics(CompilationInfo* info, ZonePool* zone_pool); |
| 22 ~PipelineStatistics(); | 22 ~PipelineStatistics(); |
| 23 | 23 |
| 24 void BeginPhaseKind(const char* phase_kind_name); | 24 void BeginPhaseKind(const char* phase_kind_name); |
| 25 void EndPhaseKind(); |
| 25 | 26 |
| 26 private: | 27 private: |
| 27 size_t OuterZoneSize() { | 28 size_t OuterZoneSize() { |
| 28 return static_cast<size_t>(outer_zone_->allocation_size()); | 29 return static_cast<size_t>(outer_zone_->allocation_size()); |
| 29 } | 30 } |
| 30 | 31 |
| 31 class CommonStats { | 32 class CommonStats { |
| 32 public: | 33 public: |
| 33 CommonStats() : outer_zone_initial_size_(0) {} | 34 CommonStats() : outer_zone_initial_size_(0) {} |
| 34 | 35 |
| 35 void Begin(PipelineStatistics* pipeline_stats); | 36 void Begin(PipelineStatistics* pipeline_stats); |
| 36 void End(PipelineStatistics* pipeline_stats, | 37 void End(PipelineStatistics* pipeline_stats, |
| 37 CompilationStatistics::BasicStats* diff); | 38 CompilationStatistics::BasicStats* diff); |
| 38 | 39 |
| 39 SmartPointer<ZonePool::StatsScope> scope_; | 40 SmartPointer<ZonePool::StatsScope> scope_; |
| 40 base::ElapsedTimer timer_; | 41 base::ElapsedTimer timer_; |
| 41 size_t outer_zone_initial_size_; | 42 size_t outer_zone_initial_size_; |
| 42 size_t allocated_bytes_at_start_; | 43 size_t allocated_bytes_at_start_; |
| 43 }; | 44 }; |
| 44 | 45 |
| 45 bool InPhaseKind() { return !phase_kind_stats_.scope_.is_empty(); } | 46 bool InPhaseKind() { return !phase_kind_stats_.scope_.is_empty(); } |
| 46 void EndPhaseKind(); | |
| 47 | 47 |
| 48 friend class PhaseScope; | 48 friend class PhaseScope; |
| 49 bool InPhase() { return !phase_stats_.scope_.is_empty(); } | 49 bool InPhase() { return !phase_stats_.scope_.is_empty(); } |
| 50 void BeginPhase(const char* name); | 50 void BeginPhase(const char* name); |
| 51 void EndPhase(); | 51 void EndPhase(); |
| 52 | 52 |
| 53 Isolate* isolate_; | 53 Isolate* isolate_; |
| 54 Zone* outer_zone_; | 54 Zone* outer_zone_; |
| 55 ZonePool* zone_pool_; | 55 ZonePool* zone_pool_; |
| 56 CompilationStatistics* compilation_stats_; | 56 CompilationStatistics* compilation_stats_; |
| (...skipping 29 matching lines...) Expand all Loading... |
| 86 PipelineStatistics* const pipeline_stats_; | 86 PipelineStatistics* const pipeline_stats_; |
| 87 | 87 |
| 88 DISALLOW_COPY_AND_ASSIGN(PhaseScope); | 88 DISALLOW_COPY_AND_ASSIGN(PhaseScope); |
| 89 }; | 89 }; |
| 90 | 90 |
| 91 } // namespace compiler | 91 } // namespace compiler |
| 92 } // namespace internal | 92 } // namespace internal |
| 93 } // namespace v8 | 93 } // namespace v8 |
| 94 | 94 |
| 95 #endif | 95 #endif |
| OLD | NEW |