2012-02-09 10:19:46 +00:00
|
|
|
// Copyright 2012 the V8 project authors. All rights reserved.
|
2014-04-29 06:42:26 +00:00
|
|
|
// Use of this source code is governed by a BSD-style license that can be
|
|
|
|
// found in the LICENSE file.
|
2010-12-07 11:31:57 +00:00
|
|
|
|
|
|
|
#ifndef V8_RUNTIME_PROFILER_H_
|
|
|
|
#define V8_RUNTIME_PROFILER_H_
|
|
|
|
|
2014-06-03 08:12:43 +00:00
|
|
|
#include "src/allocation.h"
|
2010-12-07 11:31:57 +00:00
|
|
|
|
|
|
|
namespace v8 {
|
2014-06-30 13:25:46 +00:00
|
|
|
|
|
|
|
namespace base {
|
|
|
|
class Semaphore;
|
|
|
|
}
|
|
|
|
|
2010-12-07 11:31:57 +00:00
|
|
|
namespace internal {
|
|
|
|
|
2011-03-18 20:35:07 +00:00
|
|
|
class Isolate;
|
|
|
|
class JSFunction;
|
|
|
|
class Object;
|
|
|
|
|
|
|
|
class RuntimeProfiler {
|
2010-12-07 11:31:57 +00:00
|
|
|
public:
|
2011-03-18 20:35:07 +00:00
|
|
|
explicit RuntimeProfiler(Isolate* isolate);
|
|
|
|
|
|
|
|
void OptimizeNow();
|
|
|
|
|
2012-02-09 10:19:46 +00:00
|
|
|
void NotifyICChanged() { any_ic_changed_ = true; }
|
|
|
|
|
2014-06-24 09:31:30 +00:00
|
|
|
void AttemptOnStackReplacement(JSFunction* function, int nesting_levels = 1);
|
2012-02-22 16:45:35 +00:00
|
|
|
|
2011-03-18 20:35:07 +00:00
|
|
|
private:
|
2012-02-09 10:19:46 +00:00
|
|
|
void Optimize(JSFunction* function, const char* reason);
|
2011-03-18 20:35:07 +00:00
|
|
|
|
2013-06-14 11:35:00 +00:00
|
|
|
bool CodeSizeOKForOSR(Code* shared_code);
|
|
|
|
|
2011-03-18 20:35:07 +00:00
|
|
|
Isolate* isolate_;
|
2010-12-07 11:31:57 +00:00
|
|
|
|
2012-02-09 10:19:46 +00:00
|
|
|
bool any_ic_changed_;
|
2010-12-07 11:31:57 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
} } // namespace v8::internal
|
|
|
|
|
|
|
|
#endif // V8_RUNTIME_PROFILER_H_
|