Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(166)

Side by Side Diff: include/v8.h

Issue 12207076: Added new GetHeapStatistics API entry and deprecated old one. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Removed Clear() again. Created 7 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | src/api.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 2822 matching lines...) Expand 10 before | Expand all | Expand 10 after
2833 class V8EXPORT HeapStatistics { 2833 class V8EXPORT HeapStatistics {
2834 public: 2834 public:
2835 HeapStatistics(); 2835 HeapStatistics();
2836 size_t total_heap_size() { return total_heap_size_; } 2836 size_t total_heap_size() { return total_heap_size_; }
2837 size_t total_heap_size_executable() { return total_heap_size_executable_; } 2837 size_t total_heap_size_executable() { return total_heap_size_executable_; }
2838 size_t total_physical_size() { return total_physical_size_; } 2838 size_t total_physical_size() { return total_physical_size_; }
2839 size_t used_heap_size() { return used_heap_size_; } 2839 size_t used_heap_size() { return used_heap_size_; }
2840 size_t heap_size_limit() { return heap_size_limit_; } 2840 size_t heap_size_limit() { return heap_size_limit_; }
2841 2841
2842 private: 2842 private:
2843 void set_total_heap_size(size_t size) { total_heap_size_ = size; }
2844 void set_total_heap_size_executable(size_t size) {
2845 total_heap_size_executable_ = size;
2846 }
2847 void set_total_physical_size(size_t size) {
2848 total_physical_size_ = size;
2849 }
2850 void set_used_heap_size(size_t size) { used_heap_size_ = size; }
2851 void set_heap_size_limit(size_t size) { heap_size_limit_ = size; }
2852
2853 size_t total_heap_size_; 2843 size_t total_heap_size_;
2854 size_t total_heap_size_executable_; 2844 size_t total_heap_size_executable_;
2855 size_t total_physical_size_; 2845 size_t total_physical_size_;
2856 size_t used_heap_size_; 2846 size_t used_heap_size_;
2857 size_t heap_size_limit_; 2847 size_t heap_size_limit_;
2858 2848
2859 friend class V8; 2849 friend class V8;
2850 friend class Isolate;
2860 }; 2851 };
2861 2852
2862 2853
2863 class RetainedObjectInfo; 2854 class RetainedObjectInfo;
2864 2855
2865 /** 2856 /**
2866 * Isolate represents an isolated instance of the V8 engine. V8 2857 * Isolate represents an isolated instance of the V8 engine. V8
2867 * isolates have completely separate states. Objects from one isolate 2858 * isolates have completely separate states. Objects from one isolate
2868 * must not be used in other isolates. When V8 is initialized a 2859 * must not be used in other isolates. When V8 is initialized a
2869 * default isolate is implicitly created and entered. The embedder 2860 * default isolate is implicitly created and entered. The embedder
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
2939 * Associate embedder-specific data with the isolate 2930 * Associate embedder-specific data with the isolate
2940 */ 2931 */
2941 V8_INLINE(void SetData(void* data)); 2932 V8_INLINE(void SetData(void* data));
2942 2933
2943 /** 2934 /**
2944 * Retrieve embedder-specific data from the isolate. 2935 * Retrieve embedder-specific data from the isolate.
2945 * Returns NULL if SetData has never been called. 2936 * Returns NULL if SetData has never been called.
2946 */ 2937 */
2947 V8_INLINE(void* GetData()); 2938 V8_INLINE(void* GetData());
2948 2939
2940 /**
2941 * Get statistics about the heap memory usage.
2942 */
2943 void GetHeapStatistics(HeapStatistics* heap_statistics);
2944
2949 private: 2945 private:
2950 Isolate(); 2946 Isolate();
2951 Isolate(const Isolate&); 2947 Isolate(const Isolate&);
2952 ~Isolate(); 2948 ~Isolate();
2953 Isolate& operator=(const Isolate&); 2949 Isolate& operator=(const Isolate&);
2954 void* operator new(size_t size); 2950 void* operator new(size_t size);
2955 void operator delete(void*, size_t); 2951 void operator delete(void*, size_t);
2956 }; 2952 };
2957 2953
2958 2954
(...skipping 534 matching lines...) Expand 10 before | Expand all | Expand 10 after
3493 * Releases any resources used by v8 and stops any utility threads 3489 * Releases any resources used by v8 and stops any utility threads
3494 * that may be running. Note that disposing v8 is permanent, it 3490 * that may be running. Note that disposing v8 is permanent, it
3495 * cannot be reinitialized. 3491 * cannot be reinitialized.
3496 * 3492 *
3497 * It should generally not be necessary to dispose v8 before exiting 3493 * It should generally not be necessary to dispose v8 before exiting
3498 * a process, this should happen automatically. It is only necessary 3494 * a process, this should happen automatically. It is only necessary
3499 * to use if the process needs the resources taken up by v8. 3495 * to use if the process needs the resources taken up by v8.
3500 */ 3496 */
3501 static bool Dispose(); 3497 static bool Dispose();
3502 3498
3503 /** 3499 /** Deprecated. Use Isolate::GetHeapStatistics instead. */
3504 * Get statistics about the heap memory usage. 3500 V8_DEPRECATED(static void GetHeapStatistics(HeapStatistics* heap_statistics));
3505 */
3506 static void GetHeapStatistics(HeapStatistics* heap_statistics);
3507 3501
3508 /** 3502 /**
3509 * Iterates through all external resources referenced from current isolate 3503 * Iterates through all external resources referenced from current isolate
3510 * heap. GC is not invoked prior to iterating, therefore there is no 3504 * heap. GC is not invoked prior to iterating, therefore there is no
3511 * guarantee that visited objects are still alive. 3505 * guarantee that visited objects are still alive.
3512 */ 3506 */
3513 static void VisitExternalResources(ExternalResourceVisitor* visitor); 3507 static void VisitExternalResources(ExternalResourceVisitor* visitor);
3514 3508
3515 /** 3509 /**
3516 * Iterates through all the persistent handles in the current isolate's heap 3510 * Iterates through all the persistent handles in the current isolate's heap
(...skipping 1411 matching lines...) Expand 10 before | Expand all | Expand 10 after
4928 4922
4929 4923
4930 } // namespace v8 4924 } // namespace v8
4931 4925
4932 4926
4933 #undef V8EXPORT 4927 #undef V8EXPORT
4934 #undef TYPE_CHECK 4928 #undef TYPE_CHECK
4935 4929
4936 4930
4937 #endif // V8_H_ 4931 #endif // V8_H_
OLDNEW
« no previous file with comments | « no previous file | src/api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698