OLD | NEW |
1 // Copyright 2010 the V8 project authors. All rights reserved. | 1 // Copyright 2010 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 407 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
418 */ | 418 */ |
419 const HeapSnapshot* TakeHeapSnapshot( | 419 const HeapSnapshot* TakeHeapSnapshot( |
420 Handle<String> title, | 420 Handle<String> title, |
421 ActivityControl* control = NULL, | 421 ActivityControl* control = NULL, |
422 ObjectNameResolver* global_object_name_resolver = NULL); | 422 ObjectNameResolver* global_object_name_resolver = NULL); |
423 | 423 |
424 /** | 424 /** |
425 * Starts tracking of heap objects population statistics. After calling | 425 * Starts tracking of heap objects population statistics. After calling |
426 * this method, all heap objects relocations done by the garbage collector | 426 * this method, all heap objects relocations done by the garbage collector |
427 * are being registered. | 427 * are being registered. |
| 428 * |
| 429 * |track_allocations| parameter controls whether stack trace of each |
| 430 * allocation in the heap will be recorded and reported as part of |
| 431 * HeapSnapshot. |
428 */ | 432 */ |
429 void StartTrackingHeapObjects(); | 433 void StartTrackingHeapObjects(bool track_allocations = false); |
430 | 434 |
431 /** | 435 /** |
432 * Adds a new time interval entry to the aggregated statistics array. The | 436 * Adds a new time interval entry to the aggregated statistics array. The |
433 * time interval entry contains information on the current heap objects | 437 * time interval entry contains information on the current heap objects |
434 * population size. The method also updates aggregated statistics and | 438 * population size. The method also updates aggregated statistics and |
435 * reports updates for all previous time intervals via the OutputStream | 439 * reports updates for all previous time intervals via the OutputStream |
436 * object. Updates on each time interval are provided as a stream of the | 440 * object. Updates on each time interval are provided as a stream of the |
437 * HeapStatsUpdate structure instances. | 441 * HeapStatsUpdate structure instances. |
438 * The return value of the function is the last seen heap object Id. | 442 * The return value of the function is the last seen heap object Id. |
439 * | 443 * |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
472 | 476 |
473 /** | 477 /** |
474 * Sets a RetainedObjectInfo for an object group (see V8::SetObjectGroupId). | 478 * Sets a RetainedObjectInfo for an object group (see V8::SetObjectGroupId). |
475 */ | 479 */ |
476 void SetRetainedObjectInfo(UniqueId id, RetainedObjectInfo* info); | 480 void SetRetainedObjectInfo(UniqueId id, RetainedObjectInfo* info); |
477 | 481 |
478 /** | 482 /** |
479 * Starts recording JS allocations immediately as they arrive and tracking of | 483 * Starts recording JS allocations immediately as they arrive and tracking of |
480 * heap objects population statistics. | 484 * heap objects population statistics. |
481 */ | 485 */ |
482 void StartRecordingHeapAllocations(); | 486 V8_DEPRECATED("Use StartTrackingHeapObjects instead", |
| 487 void StartRecordingHeapAllocations()); |
483 | 488 |
484 /** | 489 /** |
485 * Stops recording JS allocations and tracking of heap objects population | 490 * Stops recording JS allocations and tracking of heap objects population |
486 * statistics, cleans all collected heap objects population statistics data. | 491 * statistics, cleans all collected heap objects population statistics data. |
487 */ | 492 */ |
488 void StopRecordingHeapAllocations(); | 493 V8_DEPRECATED("Use StopTrackingHeapObjects instead", |
| 494 void StopRecordingHeapAllocations()); |
489 | 495 |
490 | 496 |
491 private: | 497 private: |
492 HeapProfiler(); | 498 HeapProfiler(); |
493 ~HeapProfiler(); | 499 ~HeapProfiler(); |
494 HeapProfiler(const HeapProfiler&); | 500 HeapProfiler(const HeapProfiler&); |
495 HeapProfiler& operator=(const HeapProfiler&); | 501 HeapProfiler& operator=(const HeapProfiler&); |
496 }; | 502 }; |
497 | 503 |
498 | 504 |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
580 uint32_t index; // Index of the time interval that was changed. | 586 uint32_t index; // Index of the time interval that was changed. |
581 uint32_t count; // New value of count field for the interval with this index. | 587 uint32_t count; // New value of count field for the interval with this index. |
582 uint32_t size; // New value of size field for the interval with this index. | 588 uint32_t size; // New value of size field for the interval with this index. |
583 }; | 589 }; |
584 | 590 |
585 | 591 |
586 } // namespace v8 | 592 } // namespace v8 |
587 | 593 |
588 | 594 |
589 #endif // V8_V8_PROFILER_H_ | 595 #endif // V8_V8_PROFILER_H_ |
OLD | NEW |