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

Side by Side Diff: src/compiler/pipeline-statistics.h

Issue 2175233003: Replace SmartPointer<T> with unique_ptr<T> (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@smart-array
Patch Set: Created 4 years, 4 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
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 #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 <memory>
8 #include <string> 9 #include <string>
9 10
10 #include "src/base/platform/elapsed-timer.h" 11 #include "src/base/platform/elapsed-timer.h"
11 #include "src/base/smart-pointers.h"
12 #include "src/compilation-statistics.h" 12 #include "src/compilation-statistics.h"
13 #include "src/compiler/zone-pool.h" 13 #include "src/compiler/zone-pool.h"
14 14
15 namespace v8 { 15 namespace v8 {
16 namespace internal { 16 namespace internal {
17 namespace compiler { 17 namespace compiler {
18 18
19 class PhaseScope; 19 class PhaseScope;
20 20
21 class PipelineStatistics : public Malloced { 21 class PipelineStatistics : public Malloced {
(...skipping 10 matching lines...) Expand all
32 } 32 }
33 33
34 class CommonStats { 34 class CommonStats {
35 public: 35 public:
36 CommonStats() : outer_zone_initial_size_(0) {} 36 CommonStats() : outer_zone_initial_size_(0) {}
37 37
38 void Begin(PipelineStatistics* pipeline_stats); 38 void Begin(PipelineStatistics* pipeline_stats);
39 void End(PipelineStatistics* pipeline_stats, 39 void End(PipelineStatistics* pipeline_stats,
40 CompilationStatistics::BasicStats* diff); 40 CompilationStatistics::BasicStats* diff);
41 41
42 base::SmartPointer<ZonePool::StatsScope> scope_; 42 std::unique_ptr<ZonePool::StatsScope> scope_;
43 base::ElapsedTimer timer_; 43 base::ElapsedTimer timer_;
44 size_t outer_zone_initial_size_; 44 size_t outer_zone_initial_size_;
45 size_t allocated_bytes_at_start_; 45 size_t allocated_bytes_at_start_;
46
47 private:
48 DISALLOW_COPY_AND_ASSIGN(CommonStats);
46 }; 49 };
47 50
48 bool InPhaseKind() { return !phase_kind_stats_.scope_.is_empty(); } 51 bool InPhaseKind() { return !!phase_kind_stats_.scope_; }
Igor Sheludko 2016/07/25 09:58:10 !! is not necessary.
jochen (gone - plz use gerrit) 2016/07/25 10:34:38 the operator bool if unique_ptr is explicit, so ju
Igor Sheludko 2016/07/25 10:46:52 Ok, I see.
49 52
50 friend class PhaseScope; 53 friend class PhaseScope;
51 bool InPhase() { return !phase_stats_.scope_.is_empty(); } 54 bool InPhase() { return !!phase_stats_.scope_; }
Igor Sheludko 2016/07/25 09:58:10 same here
52 void BeginPhase(const char* name); 55 void BeginPhase(const char* name);
53 void EndPhase(); 56 void EndPhase();
54 57
55 Isolate* isolate_; 58 Isolate* isolate_;
56 Zone* outer_zone_; 59 Zone* outer_zone_;
57 ZonePool* zone_pool_; 60 ZonePool* zone_pool_;
58 CompilationStatistics* compilation_stats_; 61 CompilationStatistics* compilation_stats_;
59 std::string function_name_; 62 std::string function_name_;
60 63
61 // Stats for the entire compilation. 64 // Stats for the entire compilation.
(...skipping 26 matching lines...) Expand all
88 PipelineStatistics* const pipeline_stats_; 91 PipelineStatistics* const pipeline_stats_;
89 92
90 DISALLOW_COPY_AND_ASSIGN(PhaseScope); 93 DISALLOW_COPY_AND_ASSIGN(PhaseScope);
91 }; 94 };
92 95
93 } // namespace compiler 96 } // namespace compiler
94 } // namespace internal 97 } // namespace internal
95 } // namespace v8 98 } // namespace v8
96 99
97 #endif 100 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698