5 #ifndef V8_BASIC_BLOCK_PROFILER_H_ 6 #define V8_BASIC_BLOCK_PROFILER_H_ 13 #include "src/base/macros.h" 14 #include "src/base/platform/mutex.h" 15 #include "src/globals.h" 24 size_t n_blocks()
const {
return n_blocks_; }
25 const uint32_t* counts()
const {
return &counts_[0]; }
27 void SetCode(std::ostringstream* os);
28 void SetFunctionName(std::unique_ptr<
char[]> name);
29 void SetSchedule(std::ostringstream* os);
30 void SetBlockRpoNumber(
size_t offset, int32_t block_rpo);
31 intptr_t GetCounterAddress(
size_t offset);
35 friend std::ostream& operator<<(std::ostream& os,
38 explicit Data(
size_t n_blocks);
43 const size_t n_blocks_;
44 std::vector<int32_t> block_rpo_numbers_;
45 std::vector<uint32_t> counts_;
46 std::string function_name_;
47 std::string schedule_;
49 DISALLOW_COPY_AND_ASSIGN(
Data);
52 typedef std::list<Data*> DataList;
58 Data* NewData(
size_t n_blocks);
61 const DataList* data_list() {
return &data_list_; }
64 friend V8_EXPORT_PRIVATE std::ostream& operator<<(
73 V8_EXPORT_PRIVATE std::ostream& operator<<(std::ostream& os,
74 const BasicBlockProfiler& s);
75 std::ostream& operator<<(std::ostream& os,
const BasicBlockProfiler::Data& s);
80 #endif // V8_BASIC_BLOCK_PROFILER_H_