| OLD | NEW |
| 1 // Copyright 2016 the V8 project authors. All rights reserved. | 1 // Copyright 2016 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_DISPATCHER_COMPILER_DISPATCHER_TRACER_H_ | 5 #ifndef V8_COMPILER_DISPATCHER_COMPILER_DISPATCHER_TRACER_H_ |
| 6 #define V8_COMPILER_DISPATCHER_COMPILER_DISPATCHER_TRACER_H_ | 6 #define V8_COMPILER_DISPATCHER_COMPILER_DISPATCHER_TRACER_H_ |
| 7 | 7 |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "src/base/macros.h" | 10 #include "src/base/macros.h" |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 62 | 62 |
| 63 void RecordPrepareToParse(double duration_ms); | 63 void RecordPrepareToParse(double duration_ms); |
| 64 void RecordParse(double duration_ms, size_t source_length); | 64 void RecordParse(double duration_ms, size_t source_length); |
| 65 void RecordFinalizeParsing(double duration_ms); | 65 void RecordFinalizeParsing(double duration_ms); |
| 66 void RecordPrepareToCompile(double duration_ms); | 66 void RecordPrepareToCompile(double duration_ms); |
| 67 void RecordCompile(double duration_ms, size_t ast_size_in_bytes); | 67 void RecordCompile(double duration_ms, size_t ast_size_in_bytes); |
| 68 void RecordFinalizeCompiling(double duration_ms); | 68 void RecordFinalizeCompiling(double duration_ms); |
| 69 | 69 |
| 70 double EstimatePrepareToParseInMs() const; | 70 double EstimatePrepareToParseInMs() const; |
| 71 double EstimateParseInMs(size_t source_length) const; | 71 double EstimateParseInMs(size_t source_length) const; |
| 72 double EstimateFinalizeParsingInMs(); | 72 double EstimateFinalizeParsingInMs() const; |
| 73 double EstimatePrepareToCompileInMs(); | 73 double EstimatePrepareToCompileInMs() const; |
| 74 double EstimateCompileInMs(size_t ast_size_in_bytes); | 74 double EstimateCompileInMs(size_t ast_size_in_bytes) const; |
| 75 double EstimateFinalizeCompilingInMs(); | 75 double EstimateFinalizeCompilingInMs() const; |
| 76 | 76 |
| 77 private: | 77 private: |
| 78 static double Average(const base::RingBuffer<double>& buffer); | 78 static double Average(const base::RingBuffer<double>& buffer); |
| 79 static double Estimate( | 79 static double Estimate( |
| 80 const base::RingBuffer<std::pair<size_t, double>>& buffer, size_t num); | 80 const base::RingBuffer<std::pair<size_t, double>>& buffer, size_t num); |
| 81 | 81 |
| 82 mutable base::Mutex mutex_; | 82 mutable base::Mutex mutex_; |
| 83 base::RingBuffer<double> prepare_parse_events_; | 83 base::RingBuffer<double> prepare_parse_events_; |
| 84 base::RingBuffer<std::pair<size_t, double>> parse_events_; | 84 base::RingBuffer<std::pair<size_t, double>> parse_events_; |
| 85 base::RingBuffer<double> finalize_parsing_events_; | 85 base::RingBuffer<double> finalize_parsing_events_; |
| 86 base::RingBuffer<double> prepare_compile_events_; | 86 base::RingBuffer<double> prepare_compile_events_; |
| 87 base::RingBuffer<std::pair<size_t, double>> compile_events_; | 87 base::RingBuffer<std::pair<size_t, double>> compile_events_; |
| 88 base::RingBuffer<double> finalize_compiling_events_; | 88 base::RingBuffer<double> finalize_compiling_events_; |
| 89 | 89 |
| 90 RuntimeCallStats* runtime_call_stats_; | 90 RuntimeCallStats* runtime_call_stats_; |
| 91 | 91 |
| 92 DISALLOW_COPY_AND_ASSIGN(CompilerDispatcherTracer); | 92 DISALLOW_COPY_AND_ASSIGN(CompilerDispatcherTracer); |
| 93 }; | 93 }; |
| 94 | 94 |
| 95 } // namespace internal | 95 } // namespace internal |
| 96 } // namespace v8 | 96 } // namespace v8 |
| 97 | 97 |
| 98 #endif // V8_COMPILER_DISPATCHER_COMPILER_DISPATCHER_TRACER_H_ | 98 #endif // V8_COMPILER_DISPATCHER_COMPILER_DISPATCHER_TRACER_H_ |
| OLD | NEW |