OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 2989 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3000 * Retrieve embedder-specific data from the isolate. | 3000 * Retrieve embedder-specific data from the isolate. |
3001 * Returns NULL if SetData has never been called. | 3001 * Returns NULL if SetData has never been called. |
3002 */ | 3002 */ |
3003 V8_INLINE(void* GetData()); | 3003 V8_INLINE(void* GetData()); |
3004 | 3004 |
3005 /** | 3005 /** |
3006 * Get statistics about the heap memory usage. | 3006 * Get statistics about the heap memory usage. |
3007 */ | 3007 */ |
3008 void GetHeapStatistics(HeapStatistics* heap_statistics); | 3008 void GetHeapStatistics(HeapStatistics* heap_statistics); |
3009 | 3009 |
| 3010 /** |
| 3011 * Adjusts the amount of registered external memory. Used to give V8 an |
| 3012 * indication of the amount of externally allocated memory that is kept alive |
| 3013 * by JavaScript objects. V8 uses this to decide when to perform global |
| 3014 * garbage collections. Registering externally allocated memory will trigger |
| 3015 * global garbage collections more often than it would otherwise in an attempt |
| 3016 * to garbage collect the JavaScript objects that keep the externally |
| 3017 * allocated memory alive. |
| 3018 * |
| 3019 * \param change_in_bytes the change in externally allocated memory that is |
| 3020 * kept alive by JavaScript objects. |
| 3021 * \returns the adjusted value. |
| 3022 */ |
| 3023 intptr_t AdjustAmountOfExternalAllocatedMemory(intptr_t change_in_bytes); |
| 3024 |
3010 private: | 3025 private: |
3011 Isolate(); | 3026 Isolate(); |
3012 Isolate(const Isolate&); | 3027 Isolate(const Isolate&); |
3013 ~Isolate(); | 3028 ~Isolate(); |
3014 Isolate& operator=(const Isolate&); | 3029 Isolate& operator=(const Isolate&); |
3015 void* operator new(size_t size); | 3030 void* operator new(size_t size); |
3016 void operator delete(void*, size_t); | 3031 void operator delete(void*, size_t); |
3017 }; | 3032 }; |
3018 | 3033 |
3019 | 3034 |
(...skipping 460 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3480 * are not guaranteed to live past each call. The \p event_handler must | 3495 * are not guaranteed to live past each call. The \p event_handler must |
3481 * copy strings and other parameters it needs to keep around. | 3496 * copy strings and other parameters it needs to keep around. |
3482 * \note the set of events declared in JitCodeEvent::EventType is expected to | 3497 * \note the set of events declared in JitCodeEvent::EventType is expected to |
3483 * grow over time, and the JitCodeEvent structure is expected to accrue | 3498 * grow over time, and the JitCodeEvent structure is expected to accrue |
3484 * new members. The \p event_handler function must ignore event codes | 3499 * new members. The \p event_handler function must ignore event codes |
3485 * it does not recognize to maintain future compatibility. | 3500 * it does not recognize to maintain future compatibility. |
3486 */ | 3501 */ |
3487 static void SetJitCodeEventHandler(JitCodeEventOptions options, | 3502 static void SetJitCodeEventHandler(JitCodeEventOptions options, |
3488 JitCodeEventHandler event_handler); | 3503 JitCodeEventHandler event_handler); |
3489 | 3504 |
3490 /** | 3505 // TODO(svenpanne) Really deprecate me when Chrome is fixed. |
3491 * Adjusts the amount of registered external memory. Used to give | 3506 /** Deprecated. Use Isolate::AdjustAmountOfExternalAllocatedMemory instead. */ |
3492 * V8 an indication of the amount of externally allocated memory | |
3493 * that is kept alive by JavaScript objects. V8 uses this to decide | |
3494 * when to perform global garbage collections. Registering | |
3495 * externally allocated memory will trigger global garbage | |
3496 * collections more often than otherwise in an attempt to garbage | |
3497 * collect the JavaScript objects keeping the externally allocated | |
3498 * memory alive. | |
3499 * | |
3500 * \param change_in_bytes the change in externally allocated memory | |
3501 * that is kept alive by JavaScript objects. | |
3502 * \returns the adjusted value. | |
3503 */ | |
3504 static intptr_t AdjustAmountOfExternalAllocatedMemory( | 3507 static intptr_t AdjustAmountOfExternalAllocatedMemory( |
3505 intptr_t change_in_bytes); | 3508 intptr_t change_in_bytes); |
3506 | 3509 |
3507 /** | 3510 /** |
3508 * Suspends recording of tick samples in the profiler. | 3511 * Suspends recording of tick samples in the profiler. |
3509 * When the V8 profiling mode is enabled (usually via command line | 3512 * When the V8 profiling mode is enabled (usually via command line |
3510 * switches) this function suspends recording of tick samples. | 3513 * switches) this function suspends recording of tick samples. |
3511 * Profiling ticks are discarded until ResumeProfiler() is called. | 3514 * Profiling ticks are discarded until ResumeProfiler() is called. |
3512 * | 3515 * |
3513 * See also the --prof and --prof_auto command line switches to | 3516 * See also the --prof and --prof_auto command line switches to |
(...skipping 1507 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5021 | 5024 |
5022 | 5025 |
5023 } // namespace v8 | 5026 } // namespace v8 |
5024 | 5027 |
5025 | 5028 |
5026 #undef V8EXPORT | 5029 #undef V8EXPORT |
5027 #undef TYPE_CHECK | 5030 #undef TYPE_CHECK |
5028 | 5031 |
5029 | 5032 |
5030 #endif // V8_H_ | 5033 #endif // V8_H_ |
OLD | NEW |