OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 2540 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2551 kGCCallbackFlagCompacted = 1 << 0 | 2551 kGCCallbackFlagCompacted = 1 << 0 |
2552 }; | 2552 }; |
2553 | 2553 |
2554 typedef void (*GCPrologueCallback)(GCType type, GCCallbackFlags flags); | 2554 typedef void (*GCPrologueCallback)(GCType type, GCCallbackFlags flags); |
2555 typedef void (*GCEpilogueCallback)(GCType type, GCCallbackFlags flags); | 2555 typedef void (*GCEpilogueCallback)(GCType type, GCCallbackFlags flags); |
2556 | 2556 |
2557 typedef void (*GCCallback)(); | 2557 typedef void (*GCCallback)(); |
2558 | 2558 |
2559 | 2559 |
2560 /** | 2560 /** |
2561 * Profiler modules. | |
2562 * | |
2563 * In V8, profiler consists of several modules. Each can be turned on / off | |
2564 * independently. | |
2565 */ | |
2566 enum ProfilerModules { | |
2567 PROFILER_MODULE_NONE = 0, | |
2568 PROFILER_MODULE_CPU = 1 | |
2569 }; | |
2570 | |
2571 | |
2572 /** | |
2573 * Collection of V8 heap information. | 2561 * Collection of V8 heap information. |
2574 * | 2562 * |
2575 * Instances of this class can be passed to v8::V8::HeapStatistics to | 2563 * Instances of this class can be passed to v8::V8::HeapStatistics to |
2576 * get heap statistics from V8. | 2564 * get heap statistics from V8. |
2577 */ | 2565 */ |
2578 class V8EXPORT HeapStatistics { | 2566 class V8EXPORT HeapStatistics { |
2579 public: | 2567 public: |
2580 HeapStatistics(); | 2568 HeapStatistics(); |
2581 size_t total_heap_size() { return total_heap_size_; } | 2569 size_t total_heap_size() { return total_heap_size_; } |
2582 size_t total_heap_size_executable() { return total_heap_size_executable_; } | 2570 size_t total_heap_size_executable() { return total_heap_size_executable_; } |
(...skipping 406 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2989 * See also PauseProfiler(). | 2977 * See also PauseProfiler(). |
2990 */ | 2978 */ |
2991 static void ResumeProfiler(); | 2979 static void ResumeProfiler(); |
2992 | 2980 |
2993 /** | 2981 /** |
2994 * Return whether profiler is currently paused. | 2982 * Return whether profiler is currently paused. |
2995 */ | 2983 */ |
2996 static bool IsProfilerPaused(); | 2984 static bool IsProfilerPaused(); |
2997 | 2985 |
2998 /** | 2986 /** |
2999 * Resumes specified profiler modules. Can be called several times to | |
3000 * mark the opening of a profiler events block with the given tag. | |
3001 * | |
3002 * "ResumeProfiler" is equivalent to "ResumeProfilerEx(PROFILER_MODULE_CPU)". | |
3003 * See ProfilerModules enum. | |
3004 * | |
3005 * \param flags Flags specifying profiler modules. | |
3006 * \param tag Profile tag. | |
3007 */ | |
3008 static void ResumeProfilerEx(int flags, int tag = 0); | |
3009 | |
3010 /** | |
3011 * Pauses specified profiler modules. Each call to "PauseProfilerEx" closes | |
3012 * a block of profiler events opened by a call to "ResumeProfilerEx" with the | |
3013 * same tag value. There is no need for blocks to be properly nested. | |
3014 * The profiler is paused when the last opened block is closed. | |
3015 * | |
3016 * "PauseProfiler" is equivalent to "PauseProfilerEx(PROFILER_MODULE_CPU)". | |
3017 * See ProfilerModules enum. | |
3018 * | |
3019 * \param flags Flags specifying profiler modules. | |
3020 * \param tag Profile tag. | |
3021 */ | |
3022 static void PauseProfilerEx(int flags, int tag = 0); | |
3023 | |
3024 /** | |
3025 * Returns active (resumed) profiler modules. | |
3026 * See ProfilerModules enum. | |
3027 * | |
3028 * \returns active profiler modules. | |
3029 */ | |
3030 static int GetActiveProfilerModules(); | |
3031 | |
3032 /** | |
3033 * If logging is performed into a memory buffer (via --logfile=*), allows to | 2987 * If logging is performed into a memory buffer (via --logfile=*), allows to |
3034 * retrieve previously written messages. This can be used for retrieving | 2988 * retrieve previously written messages. This can be used for retrieving |
3035 * profiler log data in the application. This function is thread-safe. | 2989 * profiler log data in the application. This function is thread-safe. |
3036 * | 2990 * |
3037 * Caller provides a destination buffer that must exist during GetLogLines | 2991 * Caller provides a destination buffer that must exist during GetLogLines |
3038 * call. Only whole log lines are copied into the buffer. | 2992 * call. Only whole log lines are copied into the buffer. |
3039 * | 2993 * |
3040 * \param from_pos specified a point in a buffer to read from, 0 is the | 2994 * \param from_pos specified a point in a buffer to read from, 0 is the |
3041 * beginning of a buffer. It is assumed that caller updates its current | 2995 * beginning of a buffer. It is assumed that caller updates its current |
3042 * position using returned size value from the previous call. | 2996 * position using returned size value from the previous call. |
(...skipping 1106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4149 | 4103 |
4150 | 4104 |
4151 } // namespace v8 | 4105 } // namespace v8 |
4152 | 4106 |
4153 | 4107 |
4154 #undef V8EXPORT | 4108 #undef V8EXPORT |
4155 #undef TYPE_CHECK | 4109 #undef TYPE_CHECK |
4156 | 4110 |
4157 | 4111 |
4158 #endif // V8_H_ | 4112 #endif // V8_H_ |
OLD | NEW |