Chromium Code Reviews| Index: src/compiler/basic-block-profiler.h |
| diff --git a/src/compiler/basic-block-profiler.h b/src/compiler/basic-block-profiler.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..6669f9e1592bfe8ad5ca34671f3a12ef12f9803c |
| --- /dev/null |
| +++ b/src/compiler/basic-block-profiler.h |
| @@ -0,0 +1,68 @@ |
| +// Copyright 2014 the V8 project authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef V8_COMPILER_BASIC_BLOCK_PROFILER_H_ |
| +#define V8_COMPILER_BASIC_BLOCK_PROFILER_H_ |
| + |
| +#include <list> |
| + |
| +#include "src/v8.h" |
| + |
| +namespace v8 { |
| +namespace internal { |
| + |
| +class CompilationInfo; |
| + |
| +namespace compiler { |
| + |
| +class Schedule; |
| +class Graph; |
| + |
| +class BasicBlockProfiler { |
| + public: |
| + class Data { |
| + public: |
| + void SetCode(Handle<Code> code); |
| + |
| + private: |
| + friend class BasicBlockProfiler; |
| + |
| + Data(int n_blocks, int* block_ids, uint32_t* counts, |
| + OStringStream* function_name, OStringStream* schedule_stream); |
| + ~Data(); |
| + |
| + void DumpProfilingData(); |
| + void ResetCounts(); |
| + |
| + const int n_blocks_; |
| + int* const block_ids_; |
| + uint32_t* const counts_; |
| + OStringStream* const function_name_; |
| + OStringStream* const schedule_stream_; |
| + OStringStream* code_stream_; |
| + DISALLOW_COPY_AND_ASSIGN(Data); |
| + }; |
| + |
| + BasicBlockProfiler(); |
| + ~BasicBlockProfiler(); |
| + |
| + Data* Profile(CompilationInfo* info, Graph* graph, Schedule* schedule); |
|
titzer
2014/09/23 14:14:09
I think "Instrument" is a better name here.
|
| + |
| + void DumpProfilingData(); |
| + void ResetCounts(); |
| + |
| + private: |
| + void TearDown(); |
| + |
| + typedef std::list<Data*> DataList; |
| + DataList data_list_; |
| + |
| + DISALLOW_COPY_AND_ASSIGN(BasicBlockProfiler); |
| +}; |
| + |
| +} // namespace compiler |
| +} // namespace internal |
| +} // namespace v8 |
| + |
| +#endif // V8_COMPILER_BASIC_BLOCK_PROFILER_H_ |