Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 1280 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1291 | 1291 |
| 1292 /** | 1292 /** |
| 1293 * Returns whether or not the associated function is called as a | 1293 * Returns whether or not the associated function is called as a |
| 1294 * constructor via "new". | 1294 * constructor via "new". |
| 1295 */ | 1295 */ |
| 1296 bool IsConstructor() const; | 1296 bool IsConstructor() const; |
| 1297 }; | 1297 }; |
| 1298 | 1298 |
| 1299 | 1299 |
| 1300 /** | 1300 /** |
| 1301 * Isolate::Getsample collects the current JS execution state as a sample. | |
| 1302 * A collected sample contains, | |
| 1303 * - stack : An array of addresses. | |
| 1304 * One address per stack frame. | |
| 1305 * The address is the instruction pointer, | |
| 1306 * pointing to the instruction which led to the | |
| 1307 * creation of the stack frame. | |
| 1308 * (for example, a function call) | |
| 1309 * - frames_count: Number of stack frames that were captured. | |
| 1310 * That is, stack[frames_count+i] might contain meaningless | |
| 1311 * addresses for any i >= 0. | |
| 1312 */ | |
| 1313 struct V8_EXPORT Sample { | |
|
Benedikt Meurer
2014/09/03 04:24:30
I would really love to get rid of the public field
gholap
2014/09/03 19:44:29
Let us discuss this in person?
| |
| 1314 Sample() | |
| 1315 : frames_count(0) {} | |
| 1316 static const unsigned kMaxFramesCount = 255; | |
|
Benedikt Meurer
2014/09/03 04:24:30
Should probably be
enum { kMaxFramesCount = 255u
gholap
2014/09/03 19:44:29
Done.
| |
| 1317 | |
| 1318 void* stack[kMaxFramesCount]; // Call stack. | |
| 1319 unsigned frames_count; // Number of captured frames. | |
|
Benedikt Meurer
2014/09/03 04:24:30
I think this should be size_t instead of unsigned.
gholap
2014/09/03 19:44:29
Done.
| |
| 1320 }; | |
| 1321 | |
| 1322 | |
| 1323 /** | |
| 1301 * A JSON Parser. | 1324 * A JSON Parser. |
| 1302 */ | 1325 */ |
| 1303 class V8_EXPORT JSON { | 1326 class V8_EXPORT JSON { |
| 1304 public: | 1327 public: |
| 1305 /** | 1328 /** |
| 1306 * Tries to parse the string |json_string| and returns it as value if | 1329 * Tries to parse the string |json_string| and returns it as value if |
| 1307 * successful. | 1330 * successful. |
| 1308 * | 1331 * |
| 1309 * \param json_string The string to parse. | 1332 * \param json_string The string to parse. |
| 1310 * \return The corresponding value if successfully parsed. | 1333 * \return The corresponding value if successfully parsed. |
| (...skipping 2899 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 4210 * are in the range of 0 - GetNumberOfDataSlots() - 1. | 4233 * are in the range of 0 - GetNumberOfDataSlots() - 1. |
| 4211 */ | 4234 */ |
| 4212 V8_INLINE static uint32_t GetNumberOfDataSlots(); | 4235 V8_INLINE static uint32_t GetNumberOfDataSlots(); |
| 4213 | 4236 |
| 4214 /** | 4237 /** |
| 4215 * Get statistics about the heap memory usage. | 4238 * Get statistics about the heap memory usage. |
| 4216 */ | 4239 */ |
| 4217 void GetHeapStatistics(HeapStatistics* heap_statistics); | 4240 void GetHeapStatistics(HeapStatistics* heap_statistics); |
| 4218 | 4241 |
| 4219 /** | 4242 /** |
| 4243 * Get a sample from the isolate. | |
| 4244 */ | |
| 4245 void GetSample(Sample* sample); | |
| 4246 | |
| 4247 /** | |
| 4220 * Adjusts the amount of registered external memory. Used to give V8 an | 4248 * Adjusts the amount of registered external memory. Used to give V8 an |
| 4221 * indication of the amount of externally allocated memory that is kept alive | 4249 * indication of the amount of externally allocated memory that is kept alive |
| 4222 * by JavaScript objects. V8 uses this to decide when to perform global | 4250 * by JavaScript objects. V8 uses this to decide when to perform global |
| 4223 * garbage collections. Registering externally allocated memory will trigger | 4251 * garbage collections. Registering externally allocated memory will trigger |
| 4224 * global garbage collections more often than it would otherwise in an attempt | 4252 * global garbage collections more often than it would otherwise in an attempt |
| 4225 * to garbage collect the JavaScript objects that keep the externally | 4253 * to garbage collect the JavaScript objects that keep the externally |
| 4226 * allocated memory alive. | 4254 * allocated memory alive. |
| 4227 * | 4255 * |
| 4228 * \param change_in_bytes the change in externally allocated memory that is | 4256 * \param change_in_bytes the change in externally allocated memory that is |
| 4229 * kept alive by JavaScript objects. | 4257 * kept alive by JavaScript objects. |
| (...skipping 2473 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 6703 */ | 6731 */ |
| 6704 | 6732 |
| 6705 | 6733 |
| 6706 } // namespace v8 | 6734 } // namespace v8 |
| 6707 | 6735 |
| 6708 | 6736 |
| 6709 #undef TYPE_CHECK | 6737 #undef TYPE_CHECK |
| 6710 | 6738 |
| 6711 | 6739 |
| 6712 #endif // V8_H_ | 6740 #endif // V8_H_ |
| OLD | NEW |