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

Side by Side Diff: include/v8.h

Issue 1058253003: Adding V8 api to get memory statistics of spaces in V8::Heap. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Adding new APIs for space statistics. Created 5 years, 8 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
« no previous file with comments | « no previous file | src/api.cc » ('j') | src/api.cc » ('J')
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 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 /** \mainpage V8 API Reference Guide 5 /** \mainpage V8 API Reference Guide
6 * 6 *
7 * V8 is Google's open source JavaScript engine. 7 * V8 is Google's open source JavaScript engine.
8 * 8 *
9 * This set of documents provides reference material generated from the 9 * This set of documents provides reference material generated from the
10 * V8 header file, include/v8.h. 10 * V8 header file, include/v8.h.
(...skipping 4877 matching lines...) Expand 10 before | Expand all | Expand 10 after
4888 size_t total_heap_size_executable_; 4888 size_t total_heap_size_executable_;
4889 size_t total_physical_size_; 4889 size_t total_physical_size_;
4890 size_t used_heap_size_; 4890 size_t used_heap_size_;
4891 size_t heap_size_limit_; 4891 size_t heap_size_limit_;
4892 4892
4893 friend class V8; 4893 friend class V8;
4894 friend class Isolate; 4894 friend class Isolate;
4895 }; 4895 };
4896 4896
4897 4897
4898 class HeapSpaceStatistics {
4899 public:
4900 HeapSpaceStatistics();
4901 const char* space_name() { return space_name_; }
4902 size_t space_size() { return space_size_;}
4903 size_t space_used_size() { return space_used_size_; }
4904 size_t space_avalable_size() { return space_avalable_size_; }
4905 size_t physical_space_size() { return physical_space_size_; }
4906
4907 private:
4908 const char* space_name_;
4909 size_t space_size_;
4910 size_t space_used_size_;
4911 size_t space_avalable_size_;
4912 size_t physical_space_size_;
4913
4914 friend class Isolate;
4915 };
4916
4917
4898 class RetainedObjectInfo; 4918 class RetainedObjectInfo;
4899 4919
4900 4920
4901 /** 4921 /**
4902 * FunctionEntryHook is the type of the profile entry hook called at entry to 4922 * FunctionEntryHook is the type of the profile entry hook called at entry to
4903 * any generated function when function-level profiling is enabled. 4923 * any generated function when function-level profiling is enabled.
4904 * 4924 *
4905 * \param function the address of the function that's being entered. 4925 * \param function the address of the function that's being entered.
4906 * \param return_addr_location points to a location on stack where the machine 4926 * \param return_addr_location points to a location on stack where the machine
4907 * return address resides. This can be used to identify the caller of 4927 * return address resides. This can be used to identify the caller of
(...skipping 342 matching lines...) Expand 10 before | Expand all | Expand 10 after
5250 * are in the range of 0 - GetNumberOfDataSlots() - 1. 5270 * are in the range of 0 - GetNumberOfDataSlots() - 1.
5251 */ 5271 */
5252 V8_INLINE static uint32_t GetNumberOfDataSlots(); 5272 V8_INLINE static uint32_t GetNumberOfDataSlots();
5253 5273
5254 /** 5274 /**
5255 * Get statistics about the heap memory usage. 5275 * Get statistics about the heap memory usage.
5256 */ 5276 */
5257 void GetHeapStatistics(HeapStatistics* heap_statistics); 5277 void GetHeapStatistics(HeapStatistics* heap_statistics);
5258 5278
5259 /** 5279 /**
5280 * Returns the number of spaces in the heap.
5281 */
5282 int NumberOfHeapSpaces();
5283
5284 /**
5285 * Get the memory usage of a space in the heap.
5286 *
5287 * \param space_statistics the HeapSpaceStatistics object to fill in
5288 * statistics.
5289 * \param index ranges from 0 - number of spaces in the heap (given by
5290 * NumberOfHeapSpaces()).
5291 */
5292 void GetHeapSpaceStatistics(HeapSpaceStatistics* space_statistics, int index);
rmcilroy 2015/04/15 10:21:42 return a bool to inform caller of success or failu
ssid 2015/04/15 10:43:57 Done.
5293
5294 /**
5260 * Get a call stack sample from the isolate. 5295 * Get a call stack sample from the isolate.
5261 * \param state Execution state. 5296 * \param state Execution state.
5262 * \param frames Caller allocated buffer to store stack frames. 5297 * \param frames Caller allocated buffer to store stack frames.
5263 * \param frames_limit Maximum number of frames to capture. The buffer must 5298 * \param frames_limit Maximum number of frames to capture. The buffer must
5264 * be large enough to hold the number of frames. 5299 * be large enough to hold the number of frames.
5265 * \param sample_info The sample info is filled up by the function 5300 * \param sample_info The sample info is filled up by the function
5266 * provides number of actual captured stack frames and 5301 * provides number of actual captured stack frames and
5267 * the current VM state. 5302 * the current VM state.
5268 * \note GetStackSample should only be called when the JS thread is paused or 5303 * \note GetStackSample should only be called when the JS thread is paused or
5269 * interrupted. Otherwise the behavior is undefined. 5304 * interrupted. Otherwise the behavior is undefined.
(...skipping 2822 matching lines...) Expand 10 before | Expand all | Expand 10 after
8092 */ 8127 */
8093 8128
8094 8129
8095 } // namespace v8 8130 } // namespace v8
8096 8131
8097 8132
8098 #undef TYPE_CHECK 8133 #undef TYPE_CHECK
8099 8134
8100 8135
8101 #endif // V8_H_ 8136 #endif // V8_H_
OLDNEW
« no previous file with comments | « no previous file | src/api.cc » ('j') | src/api.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698