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