OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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_RUNTIME_PROFILER_H_ | 5 #ifndef V8_RUNTIME_PROFILER_H_ |
6 #define V8_RUNTIME_PROFILER_H_ | 6 #define V8_RUNTIME_PROFILER_H_ |
7 | 7 |
8 #include "src/allocation.h" | 8 #include "src/allocation.h" |
9 | 9 |
10 namespace v8 { | 10 namespace v8 { |
11 namespace internal { | 11 namespace internal { |
12 | 12 |
13 class Isolate; | 13 class Isolate; |
| 14 class JavaScriptFrame; |
14 class JSFunction; | 15 class JSFunction; |
15 | 16 |
16 class RuntimeProfiler { | 17 class RuntimeProfiler { |
17 public: | 18 public: |
18 explicit RuntimeProfiler(Isolate* isolate); | 19 explicit RuntimeProfiler(Isolate* isolate); |
19 | 20 |
20 void MarkCandidatesForOptimization(); | 21 void MarkCandidatesForOptimization(); |
21 | 22 |
22 void NotifyICChanged() { any_ic_changed_ = true; } | 23 void NotifyICChanged() { any_ic_changed_ = true; } |
23 | 24 |
24 void AttemptOnStackReplacement(JSFunction* function, int nesting_levels = 1); | 25 void AttemptOnStackReplacement(JavaScriptFrame* frame, |
| 26 int nesting_levels = 1); |
25 | 27 |
26 private: | 28 private: |
27 void MaybeOptimizeFullCodegen(JSFunction* function, int frame_count, | 29 void MaybeOptimizeFullCodegen(JSFunction* function, JavaScriptFrame* frame, |
28 bool frame_optimized); | 30 int frame_count); |
29 void MaybeBaselineIgnition(JSFunction* function, bool frame_optimized); | 31 void MaybeBaselineIgnition(JSFunction* function, JavaScriptFrame* frame); |
30 void MaybeOptimizeIgnition(JSFunction* function, bool frame_optimized); | 32 void MaybeOptimizeIgnition(JSFunction* function, JavaScriptFrame* frame); |
31 void Optimize(JSFunction* function, const char* reason); | 33 void Optimize(JSFunction* function, const char* reason); |
32 void Baseline(JSFunction* function, const char* reason); | 34 void Baseline(JSFunction* function, const char* reason); |
33 | 35 |
34 Isolate* isolate_; | 36 Isolate* isolate_; |
35 bool any_ic_changed_; | 37 bool any_ic_changed_; |
36 }; | 38 }; |
37 | 39 |
38 } // namespace internal | 40 } // namespace internal |
39 } // namespace v8 | 41 } // namespace v8 |
40 | 42 |
41 #endif // V8_RUNTIME_PROFILER_H_ | 43 #endif // V8_RUNTIME_PROFILER_H_ |
OLD | NEW |