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 1271 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1282 | 1282 |
1283 /** | 1283 /** |
1284 * Returns whether or not the associated function is called as a | 1284 * Returns whether or not the associated function is called as a |
1285 * constructor via "new". | 1285 * constructor via "new". |
1286 */ | 1286 */ |
1287 bool IsConstructor() const; | 1287 bool IsConstructor() const; |
1288 }; | 1288 }; |
1289 | 1289 |
1290 | 1290 |
1291 /** | 1291 /** |
| 1292 * Isolate::Getsample collects the current JS execution state as a sample. |
| 1293 * A collected sample contains, |
| 1294 * - stack : An array of addresses. |
| 1295 * One address per stack frame. |
| 1296 * The address is the instruction pointer, |
| 1297 * pointing to the instruction which led to the |
| 1298 * creation of the stack frame. |
| 1299 * (for example, a function call) |
| 1300 * - frames_count: Number of stack frames that were captured. |
| 1301 * That is, stack[frames_count+i] might contain meaningless |
| 1302 * addresses for any i >= 0. |
| 1303 */ |
| 1304 struct V8_EXPORT Sample { |
| 1305 Sample() |
| 1306 : frames_count(0) {} |
| 1307 static const unsigned kMaxFramesCount = 255; |
| 1308 |
| 1309 void* stack[kMaxFramesCount]; // Call stack. |
| 1310 unsigned frames_count; // Number of captured frames. |
| 1311 }; |
| 1312 |
| 1313 |
| 1314 /** |
1292 * A JSON Parser. | 1315 * A JSON Parser. |
1293 */ | 1316 */ |
1294 class V8_EXPORT JSON { | 1317 class V8_EXPORT JSON { |
1295 public: | 1318 public: |
1296 /** | 1319 /** |
1297 * Tries to parse the string |json_string| and returns it as value if | 1320 * Tries to parse the string |json_string| and returns it as value if |
1298 * successful. | 1321 * successful. |
1299 * | 1322 * |
1300 * \param json_string The string to parse. | 1323 * \param json_string The string to parse. |
1301 * \return The corresponding value if successfully parsed. | 1324 * \return The corresponding value if successfully parsed. |
(...skipping 2899 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4201 * are in the range of 0 - GetNumberOfDataSlots() - 1. | 4224 * are in the range of 0 - GetNumberOfDataSlots() - 1. |
4202 */ | 4225 */ |
4203 V8_INLINE static uint32_t GetNumberOfDataSlots(); | 4226 V8_INLINE static uint32_t GetNumberOfDataSlots(); |
4204 | 4227 |
4205 /** | 4228 /** |
4206 * Get statistics about the heap memory usage. | 4229 * Get statistics about the heap memory usage. |
4207 */ | 4230 */ |
4208 void GetHeapStatistics(HeapStatistics* heap_statistics); | 4231 void GetHeapStatistics(HeapStatistics* heap_statistics); |
4209 | 4232 |
4210 /** | 4233 /** |
| 4234 * Get a sample from the isolate. |
| 4235 */ |
| 4236 void GetSample(Sample* sample); |
| 4237 |
| 4238 /** |
4211 * Adjusts the amount of registered external memory. Used to give V8 an | 4239 * Adjusts the amount of registered external memory. Used to give V8 an |
4212 * indication of the amount of externally allocated memory that is kept alive | 4240 * indication of the amount of externally allocated memory that is kept alive |
4213 * by JavaScript objects. V8 uses this to decide when to perform global | 4241 * by JavaScript objects. V8 uses this to decide when to perform global |
4214 * garbage collections. Registering externally allocated memory will trigger | 4242 * garbage collections. Registering externally allocated memory will trigger |
4215 * global garbage collections more often than it would otherwise in an attempt | 4243 * global garbage collections more often than it would otherwise in an attempt |
4216 * to garbage collect the JavaScript objects that keep the externally | 4244 * to garbage collect the JavaScript objects that keep the externally |
4217 * allocated memory alive. | 4245 * allocated memory alive. |
4218 * | 4246 * |
4219 * \param change_in_bytes the change in externally allocated memory that is | 4247 * \param change_in_bytes the change in externally allocated memory that is |
4220 * kept alive by JavaScript objects. | 4248 * kept alive by JavaScript objects. |
(...skipping 2481 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6702 */ | 6730 */ |
6703 | 6731 |
6704 | 6732 |
6705 } // namespace v8 | 6733 } // namespace v8 |
6706 | 6734 |
6707 | 6735 |
6708 #undef TYPE_CHECK | 6736 #undef TYPE_CHECK |
6709 | 6737 |
6710 | 6738 |
6711 #endif // V8_H_ | 6739 #endif // V8_H_ |
OLD | NEW |