OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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_V8_PLATFORM_H_ | 5 #ifndef V8_V8_PLATFORM_H_ |
6 #define V8_V8_PLATFORM_H_ | 6 #define V8_V8_PLATFORM_H_ |
7 | 7 |
| 8 #include <stdint.h> |
| 9 |
8 namespace v8 { | 10 namespace v8 { |
9 | 11 |
10 class Isolate; | 12 class Isolate; |
11 | 13 |
12 /** | 14 /** |
13 * A Task represents a unit of work. | 15 * A Task represents a unit of work. |
14 */ | 16 */ |
15 class Task { | 17 class Task { |
16 public: | 18 public: |
17 virtual ~Task() {} | 19 virtual ~Task() {} |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
100 } | 102 } |
101 | 103 |
102 /** | 104 /** |
103 * Monotonically increasing time in seconds from an arbitrary fixed point in | 105 * Monotonically increasing time in seconds from an arbitrary fixed point in |
104 * the past. This function is expected to return at least | 106 * the past. This function is expected to return at least |
105 * millisecond-precision values. For this reason, | 107 * millisecond-precision values. For this reason, |
106 * it is recommended that the fixed point be no further in the past than | 108 * it is recommended that the fixed point be no further in the past than |
107 * the epoch. | 109 * the epoch. |
108 **/ | 110 **/ |
109 virtual double MonotonicallyIncreasingTime() = 0; | 111 virtual double MonotonicallyIncreasingTime() = 0; |
| 112 |
| 113 /** |
| 114 * Called by TRACE_EVENT* macros, don't call this directly. |
| 115 * The name parameter is a category group for example: |
| 116 * TRACE_EVENT0("v8,parse", "V8.Parse") |
| 117 * The pointer returned points to a value with zero or more of the bits |
| 118 * defined in CategoryGroupEnabledFlags. |
| 119 **/ |
| 120 virtual const uint8_t* GetCategoryGroupEnabled(const char* name) = 0; |
| 121 |
| 122 /** |
| 123 * Gets the category group name of the given category_enabled_flag pointer. |
| 124 * Usually used while serliazing TRACE_EVENTs. |
| 125 **/ |
| 126 virtual const char* GetCategoryGroupName( |
| 127 const uint8_t* category_enabled_flag) = 0; |
| 128 |
| 129 /** |
| 130 * Adds a trace event to the platform tracing system. This function call is |
| 131 * usually the result of a TRACE_* macro from trace_event_common.h when |
| 132 * tracing and the category of the particular trace are enabled. It is not |
| 133 * advisable to call this function on its own; it is really only meant to be |
| 134 * used by the trace macros. The returned handle can be used by |
| 135 * UpdateTraceEventDuration to update the duration of COMPLETE events. |
| 136 */ |
| 137 virtual uint64_t AddTraceEvent( |
| 138 char phase, const uint8_t* category_enabled_flag, const char* name, |
| 139 uint64_t id, uint64_t bind_id, int32_t num_args, const char** arg_names, |
| 140 const uint8_t* arg_types, const uint64_t* arg_values, |
| 141 unsigned int flags) = 0; |
| 142 |
| 143 /** |
| 144 * Sets the duration field of a COMPLETE trace event. It must be called with |
| 145 * the handle returned from AddTraceEvent(). |
| 146 **/ |
| 147 virtual void UpdateTraceEventDuration(const uint8_t* category_enabled_flag, |
| 148 const char* name, uint64_t handle) = 0; |
110 }; | 149 }; |
111 | 150 |
112 } // namespace v8 | 151 } // namespace v8 |
113 | 152 |
114 #endif // V8_V8_PLATFORM_H_ | 153 #endif // V8_V8_PLATFORM_H_ |
OLD | NEW |