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