| 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_BASIC_BLOCK_PROFILER_H_ | 5 #ifndef V8_BASIC_BLOCK_PROFILER_H_ |
| 6 #define V8_BASIC_BLOCK_PROFILER_H_ | 6 #define V8_BASIC_BLOCK_PROFILER_H_ |
| 7 | 7 |
| 8 #include <iosfwd> | 8 #include <iosfwd> |
| 9 #include <list> | 9 #include <list> |
| 10 #include <string> | 10 #include <string> |
| 11 #include <vector> | 11 #include <vector> |
| 12 | 12 |
| 13 #include "src/base/macros.h" | 13 #include "src/base/macros.h" |
| 14 #include "src/globals.h" | |
| 15 | 14 |
| 16 namespace v8 { | 15 namespace v8 { |
| 17 namespace internal { | 16 namespace internal { |
| 18 | 17 |
| 19 class BasicBlockProfiler { | 18 class BasicBlockProfiler { |
| 20 public: | 19 public: |
| 21 class Data { | 20 class Data { |
| 22 public: | 21 public: |
| 23 size_t n_blocks() const { return n_blocks_; } | 22 size_t n_blocks() const { return n_blocks_; } |
| 24 const uint32_t* counts() const { return &counts_[0]; } | 23 const uint32_t* counts() const { return &counts_[0]; } |
| (...skipping 27 matching lines...) Expand all Loading... |
| 52 | 51 |
| 53 BasicBlockProfiler(); | 52 BasicBlockProfiler(); |
| 54 ~BasicBlockProfiler(); | 53 ~BasicBlockProfiler(); |
| 55 | 54 |
| 56 Data* NewData(size_t n_blocks); | 55 Data* NewData(size_t n_blocks); |
| 57 void ResetCounts(); | 56 void ResetCounts(); |
| 58 | 57 |
| 59 const DataList* data_list() { return &data_list_; } | 58 const DataList* data_list() { return &data_list_; } |
| 60 | 59 |
| 61 private: | 60 private: |
| 62 friend V8_EXPORT_PRIVATE std::ostream& operator<<( | 61 friend std::ostream& operator<<(std::ostream& os, |
| 63 std::ostream& os, const BasicBlockProfiler& s); | 62 const BasicBlockProfiler& s); |
| 64 | 63 |
| 65 DataList data_list_; | 64 DataList data_list_; |
| 66 | 65 |
| 67 DISALLOW_COPY_AND_ASSIGN(BasicBlockProfiler); | 66 DISALLOW_COPY_AND_ASSIGN(BasicBlockProfiler); |
| 68 }; | 67 }; |
| 69 | 68 |
| 70 V8_EXPORT_PRIVATE std::ostream& operator<<(std::ostream& os, | 69 std::ostream& operator<<(std::ostream& os, const BasicBlockProfiler& s); |
| 71 const BasicBlockProfiler& s); | |
| 72 std::ostream& operator<<(std::ostream& os, const BasicBlockProfiler::Data& s); | 70 std::ostream& operator<<(std::ostream& os, const BasicBlockProfiler::Data& s); |
| 73 | 71 |
| 74 } // namespace internal | 72 } // namespace internal |
| 75 } // namespace v8 | 73 } // namespace v8 |
| 76 | 74 |
| 77 #endif // V8_BASIC_BLOCK_PROFILER_H_ | 75 #endif // V8_BASIC_BLOCK_PROFILER_H_ |
| OLD | NEW |