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