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

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: Fixing jochen's comments. 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') | 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 // 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 4883 matching lines...) Expand 10 before | Expand all | Expand 10 after
4894 size_t total_heap_size_executable_; 4894 size_t total_heap_size_executable_;
4895 size_t total_physical_size_; 4895 size_t total_physical_size_;
4896 size_t used_heap_size_; 4896 size_t used_heap_size_;
4897 size_t heap_size_limit_; 4897 size_t heap_size_limit_;
4898 4898
4899 friend class V8; 4899 friend class V8;
4900 friend class Isolate; 4900 friend class Isolate;
4901 }; 4901 };
4902 4902
4903 4903
4904 class HeapSpaceStatistics {
4905 public:
4906 HeapSpaceStatistics();
4907 const char* space_name() { return space_name_; }
4908 size_t space_size() { return space_size_; }
4909 size_t space_used_size() { return space_used_size_; }
4910 size_t space_available_size() { return space_available_size_; }
4911 size_t physical_space_size() { return physical_space_size_; }
4912
4913 private:
4914 const char* space_name_;
4915 size_t space_size_;
4916 size_t space_used_size_;
4917 size_t space_available_size_;
4918 size_t physical_space_size_;
4919
4920 friend class Isolate;
4921 };
4922
4923
4904 class RetainedObjectInfo; 4924 class RetainedObjectInfo;
4905 4925
4906 4926
4907 /** 4927 /**
4908 * FunctionEntryHook is the type of the profile entry hook called at entry to 4928 * FunctionEntryHook is the type of the profile entry hook called at entry to
4909 * any generated function when function-level profiling is enabled. 4929 * any generated function when function-level profiling is enabled.
4910 * 4930 *
4911 * \param function the address of the function that's being entered. 4931 * \param function the address of the function that's being entered.
4912 * \param return_addr_location points to a location on stack where the machine 4932 * \param return_addr_location points to a location on stack where the machine
4913 * return address resides. This can be used to identify the caller of 4933 * return address resides. This can be used to identify the caller of
(...skipping 342 matching lines...) Expand 10 before | Expand all | Expand 10 after
5256 * are in the range of 0 - GetNumberOfDataSlots() - 1. 5276 * are in the range of 0 - GetNumberOfDataSlots() - 1.
5257 */ 5277 */
5258 V8_INLINE static uint32_t GetNumberOfDataSlots(); 5278 V8_INLINE static uint32_t GetNumberOfDataSlots();
5259 5279
5260 /** 5280 /**
5261 * Get statistics about the heap memory usage. 5281 * Get statistics about the heap memory usage.
5262 */ 5282 */
5263 void GetHeapStatistics(HeapStatistics* heap_statistics); 5283 void GetHeapStatistics(HeapStatistics* heap_statistics);
5264 5284
5265 /** 5285 /**
5286 * Returns the number of spaces in the heap.
5287 */
5288 size_t NumberOfHeapSpaces();
5289
5290 /**
5291 * Get the memory usage of a space in the heap.
5292 *
5293 * \param space_statistics The HeapSpaceStatistics object to fill in
5294 * statistics.
5295 * \param index The index of the space to get statistics from, which ranges
5296 * from 0 to NumberOfHeapSpaces() - 1.
5297 * \returns true on success.
5298 */
5299 bool GetHeapSpaceStatistics(HeapSpaceStatistics* space_statistics,
5300 size_t index);
5301
5302 /**
5266 * Get a call stack sample from the isolate. 5303 * Get a call stack sample from the isolate.
5267 * \param state Execution state. 5304 * \param state Execution state.
5268 * \param frames Caller allocated buffer to store stack frames. 5305 * \param frames Caller allocated buffer to store stack frames.
5269 * \param frames_limit Maximum number of frames to capture. The buffer must 5306 * \param frames_limit Maximum number of frames to capture. The buffer must
5270 * be large enough to hold the number of frames. 5307 * be large enough to hold the number of frames.
5271 * \param sample_info The sample info is filled up by the function 5308 * \param sample_info The sample info is filled up by the function
5272 * provides number of actual captured stack frames and 5309 * provides number of actual captured stack frames and
5273 * the current VM state. 5310 * the current VM state.
5274 * \note GetStackSample should only be called when the JS thread is paused or 5311 * \note GetStackSample should only be called when the JS thread is paused or
5275 * interrupted. Otherwise the behavior is undefined. 5312 * interrupted. Otherwise the behavior is undefined.
(...skipping 2818 matching lines...) Expand 10 before | Expand all | Expand 10 after
8094 */ 8131 */
8095 8132
8096 8133
8097 } // namespace v8 8134 } // namespace v8
8098 8135
8099 8136
8100 #undef TYPE_CHECK 8137 #undef TYPE_CHECK
8101 8138
8102 8139
8103 #endif // V8_H_ 8140 #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