Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef V8_COMPILER_BASIC_BLOCK_PROFILER_H_ | |
| 6 #define V8_COMPILER_BASIC_BLOCK_PROFILER_H_ | |
| 7 | |
| 8 #include <list> | |
| 9 | |
| 10 #include "src/v8.h" | |
| 11 | |
| 12 namespace v8 { | |
| 13 namespace internal { | |
| 14 | |
| 15 class CompilationInfo; | |
| 16 | |
| 17 namespace compiler { | |
| 18 | |
| 19 class Schedule; | |
| 20 class Graph; | |
| 21 | |
| 22 class BasicBlockProfiler { | |
| 23 public: | |
| 24 class Data { | |
| 25 public: | |
| 26 void SetCode(Handle<Code> code); | |
| 27 | |
| 28 private: | |
| 29 friend class BasicBlockProfiler; | |
| 30 | |
| 31 Data(int n_blocks, int* block_ids, uint32_t* counts, | |
| 32 OStringStream* function_name, OStringStream* schedule_stream); | |
| 33 ~Data(); | |
| 34 | |
| 35 void DumpProfilingData(); | |
| 36 void ResetCounts(); | |
| 37 | |
| 38 const int n_blocks_; | |
| 39 int* const block_ids_; | |
| 40 uint32_t* const counts_; | |
| 41 OStringStream* const function_name_; | |
| 42 OStringStream* const schedule_stream_; | |
| 43 OStringStream* code_stream_; | |
| 44 DISALLOW_COPY_AND_ASSIGN(Data); | |
| 45 }; | |
| 46 | |
| 47 BasicBlockProfiler(); | |
| 48 ~BasicBlockProfiler(); | |
| 49 | |
| 50 Data* Profile(CompilationInfo* info, Graph* graph, Schedule* schedule); | |
|
titzer
2014/09/23 14:14:09
I think "Instrument" is a better name here.
| |
| 51 | |
| 52 void DumpProfilingData(); | |
| 53 void ResetCounts(); | |
| 54 | |
| 55 private: | |
| 56 void TearDown(); | |
| 57 | |
| 58 typedef std::list<Data*> DataList; | |
| 59 DataList data_list_; | |
| 60 | |
| 61 DISALLOW_COPY_AND_ASSIGN(BasicBlockProfiler); | |
| 62 }; | |
| 63 | |
| 64 } // namespace compiler | |
| 65 } // namespace internal | |
| 66 } // namespace v8 | |
| 67 | |
| 68 #endif // V8_COMPILER_BASIC_BLOCK_PROFILER_H_ | |
| OLD | NEW |