summaryrefslogtreecommitdiff
path: root/chromium/v8/include/v8-profiler.h
diff options
context:
space:
mode:
Diffstat (limited to 'chromium/v8/include/v8-profiler.h')
-rw-r--r--chromium/v8/include/v8-profiler.h115
1 files changed, 42 insertions, 73 deletions
diff --git a/chromium/v8/include/v8-profiler.h b/chromium/v8/include/v8-profiler.h
index 7898fef1967..217a938329e 100644
--- a/chromium/v8/include/v8-profiler.h
+++ b/chromium/v8/include/v8-profiler.h
@@ -30,36 +30,6 @@
#include "v8.h"
-#ifdef _WIN32
-// Setup for Windows DLL export/import. See v8.h in this directory for
-// information on how to build/use V8 as a DLL.
-#if defined(BUILDING_V8_SHARED) && defined(USING_V8_SHARED)
-#error both BUILDING_V8_SHARED and USING_V8_SHARED are set - please check the\
- build configuration to ensure that at most one of these is set
-#endif
-
-#ifdef BUILDING_V8_SHARED
-#define V8EXPORT __declspec(dllexport)
-#elif USING_V8_SHARED
-#define V8EXPORT __declspec(dllimport)
-#else
-#define V8EXPORT
-#endif
-
-#else // _WIN32
-
-// Setup for Linux shared library export. See v8.h in this directory for
-// information on how to build/use V8 as shared library.
-#if defined(__GNUC__) && ((__GNUC__ >= 4) || \
- (__GNUC__ == 3 && __GNUC_MINOR__ >= 3)) && defined(V8_SHARED)
-#define V8EXPORT __attribute__ ((visibility("default")))
-#else
-#define V8EXPORT
-#endif
-
-#endif // _WIN32
-
-
/**
* Profiler support for the V8 JavaScript engine.
*/
@@ -70,7 +40,7 @@ typedef uint32_t SnapshotObjectId;
/**
* CpuProfileNode represents a node in a call graph.
*/
-class V8EXPORT CpuProfileNode {
+class V8_EXPORT CpuProfileNode {
public:
/** Returns function name (empty string for anonymous functions.) */
Handle<String> GetFunctionName() const;
@@ -87,23 +57,20 @@ class V8EXPORT CpuProfileNode {
*/
int GetLineNumber() const;
- /**
- * Returns total (self + children) execution time of the function,
- * in milliseconds, estimated by samples count.
- */
- double GetTotalTime() const;
-
- /**
- * Returns self execution time of the function, in milliseconds,
- * estimated by samples count.
- */
- double GetSelfTime() const;
+ /** Returns bailout reason for the function
+ * if the optimization was disabled for it.
+ */
+ const char* GetBailoutReason() const;
- /** Returns the count of samples where function exists. */
- double GetTotalSamplesCount() const;
+ /** DEPRECATED. Please use GetHitCount instead.
+ * Returns the count of samples where function was currently executing.
+ */
+ V8_DEPRECATED(double GetSelfSamplesCount() const);
- /** Returns the count of samples where function was currently executing. */
- double GetSelfSamplesCount() const;
+ /**
+ * Returns the count of samples where the function was currently executing.
+ */
+ unsigned GetHitCount() const;
/** Returns function entry UID. */
unsigned GetCallUid() const;
@@ -125,7 +92,7 @@ class V8EXPORT CpuProfileNode {
* CpuProfile contains a CPU profile in a form of top-down call tree
* (from main() down to functions that do all the work).
*/
-class V8EXPORT CpuProfile {
+class V8_EXPORT CpuProfile {
public:
/** Returns CPU profile UID (assigned by the profiler.) */
unsigned GetUid() const;
@@ -176,16 +143,14 @@ class V8EXPORT CpuProfile {
* Interface for controlling CPU profiling. Instance of the
* profiler can be retrieved using v8::Isolate::GetCpuProfiler.
*/
-class V8EXPORT CpuProfiler {
+class V8_EXPORT CpuProfiler {
public:
/**
- * A note on security tokens usage. As scripts from different
- * origins can run inside a single V8 instance, it is possible to
- * have functions from different security contexts intermixed in a
- * single CPU profile. To avoid exposing function names belonging to
- * other contexts, filtering by security token is performed while
- * obtaining profiling results.
+ * Changes default CPU profiler sampling interval to the specified number
+ * of microseconds. Default interval is 1000us. This method must be called
+ * when there are no profiles being recorded.
*/
+ void SetSamplingInterval(int us);
/**
* Returns the number of profiles collected (doesn't include
@@ -222,6 +187,11 @@ class V8EXPORT CpuProfiler {
*/
void DeleteAllCpuProfiles();
+ /**
+ * Tells the profiler whether the embedder is idle.
+ */
+ void SetIdle(bool is_idle);
+
private:
CpuProfiler();
~CpuProfiler();
@@ -237,7 +207,7 @@ class HeapGraphNode;
* HeapSnapshotEdge represents a directed connection between heap
* graph nodes: from retainers to retained nodes.
*/
-class V8EXPORT HeapGraphEdge {
+class V8_EXPORT HeapGraphEdge {
public:
enum Type {
kContextVariable = 0, // A variable from a function context.
@@ -273,20 +243,22 @@ class V8EXPORT HeapGraphEdge {
/**
* HeapGraphNode represents a node in a heap graph.
*/
-class V8EXPORT HeapGraphNode {
+class V8_EXPORT HeapGraphNode {
public:
enum Type {
- kHidden = 0, // Hidden node, may be filtered when shown to user.
- kArray = 1, // An array of elements.
- kString = 2, // A string.
- kObject = 3, // A JS object (except for arrays and strings).
- kCode = 4, // Compiled code.
- kClosure = 5, // Function closure.
- kRegExp = 6, // RegExp.
- kHeapNumber = 7, // Number stored in the heap.
- kNative = 8, // Native object (not from V8 heap).
- kSynthetic = 9 // Synthetic object, usualy used for grouping
- // snapshot items together.
+ kHidden = 0, // Hidden node, may be filtered when shown to user.
+ kArray = 1, // An array of elements.
+ kString = 2, // A string.
+ kObject = 3, // A JS object (except for arrays and strings).
+ kCode = 4, // Compiled code.
+ kClosure = 5, // Function closure.
+ kRegExp = 6, // RegExp.
+ kHeapNumber = 7, // Number stored in the heap.
+ kNative = 8, // Native object (not from V8 heap).
+ kSynthetic = 9, // Synthetic object, usualy used for grouping
+ // snapshot items together.
+ kConsString = 10, // Concatenated string. A pair of pointers to strings.
+ kSlicedString = 11 // Sliced string. A fragment of another string.
};
/** Returns node type (see HeapGraphNode::Type). */
@@ -325,7 +297,7 @@ class V8EXPORT HeapGraphNode {
/**
* HeapSnapshots record the state of the JS heap at some moment.
*/
-class V8EXPORT HeapSnapshot {
+class V8_EXPORT HeapSnapshot {
public:
enum SerializationFormat {
kJSON = 0 // See format description near 'Serialize' method.
@@ -395,7 +367,7 @@ class RetainedObjectInfo;
* Interface for controlling heap profiling. Instance of the
* profiler can be retrieved using v8::Isolate::GetHeapProfiler.
*/
-class V8EXPORT HeapProfiler {
+class V8_EXPORT HeapProfiler {
public:
/**
* Callback function invoked for obtaining RetainedObjectInfo for
@@ -533,7 +505,7 @@ class V8EXPORT HeapProfiler {
* keeps them alive only during snapshot collection. Afterwards, they
* are freed by calling the Dispose class function.
*/
-class V8EXPORT RetainedObjectInfo { // NOLINT
+class V8_EXPORT RetainedObjectInfo { // NOLINT
public:
/** Called by V8 when it no longer needs an instance. */
virtual void Dispose() = 0;
@@ -599,7 +571,4 @@ struct HeapStatsUpdate {
} // namespace v8
-#undef V8EXPORT
-
-
#endif // V8_V8_PROFILER_H_