OLD | NEW |
1 // Copyright 2007-2008 the V8 project authors. All rights reserved. | 1 // Copyright 2007-2008 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 1949 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1960 // --- C o n t e x t G e n e r a t o r --- | 1960 // --- C o n t e x t G e n e r a t o r --- |
1961 | 1961 |
1962 /** | 1962 /** |
1963 * Applications must provide a callback function which is called to generate | 1963 * Applications must provide a callback function which is called to generate |
1964 * a context if a context was not deserialized from the snapshot. | 1964 * a context if a context was not deserialized from the snapshot. |
1965 */ | 1965 */ |
1966 typedef Persistent<Context> (*ContextGenerator)(); | 1966 typedef Persistent<Context> (*ContextGenerator)(); |
1967 | 1967 |
1968 | 1968 |
1969 /** | 1969 /** |
| 1970 * Profiler modules. |
| 1971 * |
| 1972 * In V8, profiler consists of several modules: CPU profiler, and different |
| 1973 * kinds of heap profiling. Each can be turned on / off independently. |
| 1974 */ |
| 1975 enum ProfilerModules { |
| 1976 PROFILER_MODULE_NONE = 0, |
| 1977 PROFILER_MODULE_CPU = 1, |
| 1978 PROFILER_MODULE_HEAP_STATS = 1 << 1, |
| 1979 PROFILER_MODULE_JS_CONSTRUCTORS = 1 << 2 |
| 1980 }; |
| 1981 |
| 1982 |
| 1983 /** |
1970 * Container class for static utility functions. | 1984 * Container class for static utility functions. |
1971 */ | 1985 */ |
1972 class V8EXPORT V8 { | 1986 class V8EXPORT V8 { |
1973 public: | 1987 public: |
1974 /** Set the callback to invoke in case of fatal errors. */ | 1988 /** Set the callback to invoke in case of fatal errors. */ |
1975 static void SetFatalErrorHandler(FatalErrorCallback that); | 1989 static void SetFatalErrorHandler(FatalErrorCallback that); |
1976 | 1990 |
1977 /** | 1991 /** |
1978 * Ignore out-of-memory exceptions. | 1992 * Ignore out-of-memory exceptions. |
1979 * | 1993 * |
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2113 * See also PauseProfiler(). | 2127 * See also PauseProfiler(). |
2114 */ | 2128 */ |
2115 static void ResumeProfiler(); | 2129 static void ResumeProfiler(); |
2116 | 2130 |
2117 /** | 2131 /** |
2118 * Return whether profiler is currently paused. | 2132 * Return whether profiler is currently paused. |
2119 */ | 2133 */ |
2120 static bool IsProfilerPaused(); | 2134 static bool IsProfilerPaused(); |
2121 | 2135 |
2122 /** | 2136 /** |
| 2137 * Resumes specified profiler modules. |
| 2138 * "ResumeProfiler" is equivalent to "ResumeProfilerEx(PROFILER_MODULE_CPU)". |
| 2139 * See ProfilerModules enum. |
| 2140 * |
| 2141 * \param flags Flags specifying profiler modules. |
| 2142 */ |
| 2143 static void ResumeProfilerEx(int flags); |
| 2144 |
| 2145 /** |
| 2146 * Pauses specified profiler modules. |
| 2147 * "PauseProfiler" is equivalent to "PauseProfilerEx(PROFILER_MODULE_CPU)". |
| 2148 * See ProfilerModules enum. |
| 2149 * |
| 2150 * \param flags Flags specifying profiler modules. |
| 2151 */ |
| 2152 static void PauseProfilerEx(int flags); |
| 2153 |
| 2154 /** |
| 2155 * Returns active (resumed) profiler modules. |
| 2156 * See ProfilerModules enum. |
| 2157 * |
| 2158 * \returns active profiler modules. |
| 2159 */ |
| 2160 static int GetActiveProfilerModules(); |
| 2161 |
| 2162 /** |
2123 * If logging is performed into a memory buffer (via --logfile=*), allows to | 2163 * If logging is performed into a memory buffer (via --logfile=*), allows to |
2124 * retrieve previously written messages. This can be used for retrieving | 2164 * retrieve previously written messages. This can be used for retrieving |
2125 * profiler log data in the application. This function is thread-safe. | 2165 * profiler log data in the application. This function is thread-safe. |
2126 * | 2166 * |
2127 * Caller provides a destination buffer that must exist during GetLogLines | 2167 * Caller provides a destination buffer that must exist during GetLogLines |
2128 * call. Only whole log lines are copied into the buffer. | 2168 * call. Only whole log lines are copied into the buffer. |
2129 * | 2169 * |
2130 * \param from_pos specified a point in a buffer to read from, 0 is the | 2170 * \param from_pos specified a point in a buffer to read from, 0 is the |
2131 * beginning of a buffer. It is assumed that caller updates its current | 2171 * beginning of a buffer. It is assumed that caller updates its current |
2132 * position using returned size value from the previous call. | 2172 * position using returned size value from the previous call. |
(...skipping 494 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2627 | 2667 |
2628 } // namespace v8 | 2668 } // namespace v8 |
2629 | 2669 |
2630 | 2670 |
2631 #undef V8EXPORT | 2671 #undef V8EXPORT |
2632 #undef V8EXPORT_INLINE | 2672 #undef V8EXPORT_INLINE |
2633 #undef TYPE_CHECK | 2673 #undef TYPE_CHECK |
2634 | 2674 |
2635 | 2675 |
2636 #endif // V8_H_ | 2676 #endif // V8_H_ |
OLD | NEW |