runtime-profiler.h 865 Bytes
Newer Older
1
// Copyright 2012 the V8 project authors. All rights reserved.
2 3
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
4 5 6 7

#ifndef V8_RUNTIME_PROFILER_H_
#define V8_RUNTIME_PROFILER_H_

8
#include "src/allocation.h"
9 10

namespace v8 {
11 12 13 14 15

namespace base {
class Semaphore;
}

16 17
namespace internal {

18 19 20 21 22
class Isolate;
class JSFunction;
class Object;

class RuntimeProfiler {
23
 public:
24 25 26 27
  explicit RuntimeProfiler(Isolate* isolate);

  void OptimizeNow();

28 29
  void NotifyICChanged() { any_ic_changed_ = true; }

30
  void AttemptOnStackReplacement(JSFunction* function, int nesting_levels = 1);
31

32
 private:
33
  void Optimize(JSFunction* function, const char* reason);
34

35 36
  bool CodeSizeOKForOSR(Code* shared_code);

37
  Isolate* isolate_;
38

39
  bool any_ic_changed_;
40 41
};

42 43
}  // namespace internal
}  // namespace v8
44 45

#endif  // V8_RUNTIME_PROFILER_H_