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 2830 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2841 char** raw_data; | 2841 char** raw_data; |
2842 }; | 2842 }; |
2843 | 2843 |
2844 | 2844 |
2845 /** | 2845 /** |
2846 * EntropySource is used as a callback function when v8 needs a source | 2846 * EntropySource is used as a callback function when v8 needs a source |
2847 * of entropy. | 2847 * of entropy. |
2848 */ | 2848 */ |
2849 typedef bool (*EntropySource)(unsigned char* buffer, size_t length); | 2849 typedef bool (*EntropySource)(unsigned char* buffer, size_t length); |
2850 | 2850 |
| 2851 |
| 2852 /** |
| 2853 * Interface for iterating though all external resources in the heap. |
| 2854 */ |
| 2855 class V8EXPORT ExternalResourceVisitor { |
| 2856 public: |
| 2857 virtual ~ExternalResourceVisitor() {} |
| 2858 virtual void VisitExternalString(Handle<String> string) {} |
| 2859 }; |
| 2860 |
| 2861 |
2851 /** | 2862 /** |
2852 * Container class for static utility functions. | 2863 * Container class for static utility functions. |
2853 */ | 2864 */ |
2854 class V8EXPORT V8 { | 2865 class V8EXPORT V8 { |
2855 public: | 2866 public: |
2856 /** Set the callback to invoke in case of fatal errors. */ | 2867 /** Set the callback to invoke in case of fatal errors. */ |
2857 static void SetFatalErrorHandler(FatalErrorCallback that); | 2868 static void SetFatalErrorHandler(FatalErrorCallback that); |
2858 | 2869 |
2859 /** | 2870 /** |
2860 * Set the callback to invoke to check if code generation from | 2871 * Set the callback to invoke to check if code generation from |
(...skipping 336 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3197 * to use if the process needs the resources taken up by v8. | 3208 * to use if the process needs the resources taken up by v8. |
3198 */ | 3209 */ |
3199 static bool Dispose(); | 3210 static bool Dispose(); |
3200 | 3211 |
3201 /** | 3212 /** |
3202 * Get statistics about the heap memory usage. | 3213 * Get statistics about the heap memory usage. |
3203 */ | 3214 */ |
3204 static void GetHeapStatistics(HeapStatistics* heap_statistics); | 3215 static void GetHeapStatistics(HeapStatistics* heap_statistics); |
3205 | 3216 |
3206 /** | 3217 /** |
| 3218 * Iterates through all external resources referenced from current isolate |
| 3219 * heap. |
| 3220 */ |
| 3221 static void VisitExternalResources(ExternalResourceVisitor* visitor); |
| 3222 |
| 3223 /** |
3207 * Optional notification that the embedder is idle. | 3224 * Optional notification that the embedder is idle. |
3208 * V8 uses the notification to reduce memory footprint. | 3225 * V8 uses the notification to reduce memory footprint. |
3209 * This call can be used repeatedly if the embedder remains idle. | 3226 * This call can be used repeatedly if the embedder remains idle. |
3210 * Returns true if the embedder should stop calling IdleNotification | 3227 * Returns true if the embedder should stop calling IdleNotification |
3211 * until real work has been done. This indicates that V8 has done | 3228 * until real work has been done. This indicates that V8 has done |
3212 * as much cleanup as it will be able to do. | 3229 * as much cleanup as it will be able to do. |
3213 * | 3230 * |
3214 * The hint argument specifies the amount of work to be done in the function | 3231 * The hint argument specifies the amount of work to be done in the function |
3215 * on scale from 1 to 1000. There is no guarantee that the actual work will | 3232 * on scale from 1 to 1000. There is no guarantee that the actual work will |
3216 * match the hint. | 3233 * match the hint. |
(...skipping 1031 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4248 | 4265 |
4249 | 4266 |
4250 } // namespace v8 | 4267 } // namespace v8 |
4251 | 4268 |
4252 | 4269 |
4253 #undef V8EXPORT | 4270 #undef V8EXPORT |
4254 #undef TYPE_CHECK | 4271 #undef TYPE_CHECK |
4255 | 4272 |
4256 | 4273 |
4257 #endif // V8_H_ | 4274 #endif // V8_H_ |
OLD | NEW |