| 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 | |
| 12 namespace base { | |
| 13 class Semaphore; | |
| 14 } | |
| 15 | |
| 16 namespace internal { | 11 namespace internal { |
| 17 | 12 |
| 18 class Isolate; | 13 class Isolate; |
| 19 class JSFunction; | 14 class JSFunction; |
| 20 class Object; | |
| 21 | 15 |
| 22 class RuntimeProfiler { | 16 class RuntimeProfiler { |
| 23 public: | 17 public: |
| 24 explicit RuntimeProfiler(Isolate* isolate); | 18 explicit RuntimeProfiler(Isolate* isolate); |
| 25 | 19 |
| 26 void MarkCandidatesForOptimization(); | 20 void MarkCandidatesForOptimization(); |
| 27 | 21 |
| 28 void NotifyICChanged() { any_ic_changed_ = true; } | 22 void NotifyICChanged() { any_ic_changed_ = true; } |
| 29 | 23 |
| 30 void AttemptOnStackReplacement(JSFunction* function, int nesting_levels = 1); | 24 void AttemptOnStackReplacement(JSFunction* function, int nesting_levels = 1); |
| 31 | 25 |
| 32 private: | 26 private: |
| 33 void MaybeOptimizeFullCodegen(JSFunction* function, int frame_count, | 27 void MaybeOptimizeFullCodegen(JSFunction* function, int frame_count, |
| 34 bool frame_optimized); | 28 bool frame_optimized); |
| 35 void MaybeOptimizeIgnition(JSFunction* function, bool frame_optimized); | 29 void MaybeOptimizeIgnition(JSFunction* function, bool frame_optimized); |
| 36 void Optimize(JSFunction* function, const char* reason); | 30 void Optimize(JSFunction* function, const char* reason); |
| 37 | 31 |
| 38 bool CodeSizeOKForOSR(Code* shared_code); | 32 bool CodeSizeOKForOSR(Code* shared_code); |
| 39 | 33 |
| 40 Isolate* isolate_; | 34 Isolate* isolate_; |
| 41 | 35 |
| 42 bool any_ic_changed_; | 36 bool any_ic_changed_; |
| 43 }; | 37 }; |
| 44 | 38 |
| 45 } // namespace internal | 39 } // namespace internal |
| 46 } // namespace v8 | 40 } // namespace v8 |
| 47 | 41 |
| 48 #endif // V8_RUNTIME_PROFILER_H_ | 42 #endif // V8_RUNTIME_PROFILER_H_ |
| OLD | NEW |