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 458 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
469 /** Returns whether two instances are equivalent. */ | 469 /** Returns whether two instances are equivalent. */ |
470 virtual bool IsEquivalent(RetainedObjectInfo* other) = 0; | 470 virtual bool IsEquivalent(RetainedObjectInfo* other) = 0; |
471 | 471 |
472 /** | 472 /** |
473 * Returns hash value for the instance. Equivalent instances | 473 * Returns hash value for the instance. Equivalent instances |
474 * must have the same hash value. | 474 * must have the same hash value. |
475 */ | 475 */ |
476 virtual intptr_t GetHash() = 0; | 476 virtual intptr_t GetHash() = 0; |
477 | 477 |
478 /** | 478 /** |
479 * Returns human-readable label. It must be a NUL-terminated UTF-8 | 479 * Returns human-readable label. It must be a null-terminated UTF-8 |
480 * encoded string. V8 copies its contents during a call to GetLabel. | 480 * encoded string. V8 copies its contents during a call to GetLabel. |
481 */ | 481 */ |
482 virtual const char* GetLabel() = 0; | 482 virtual const char* GetLabel() = 0; |
483 | 483 |
484 /** | 484 /** |
| 485 * Returns human-readable group label. It must be a null-terminated UTF-8 |
| 486 * encoded string. V8 copies its contents during a call to GetGroupLabel. |
| 487 * Heap snapshot generator will collect all the group names, create |
| 488 * top level entries with these names and attach the objects to the |
| 489 * corresponding top level group objects. There is a default |
| 490 * implementation which is required because embedders don't have their |
| 491 * own implementation yet. |
| 492 */ |
| 493 virtual const char* GetGroupLabel() { return GetLabel(); } |
| 494 |
| 495 /** |
485 * Returns element count in case if a global handle retains | 496 * Returns element count in case if a global handle retains |
486 * a subgraph by holding one of its nodes. | 497 * a subgraph by holding one of its nodes. |
487 */ | 498 */ |
488 virtual intptr_t GetElementCount() { return -1; } | 499 virtual intptr_t GetElementCount() { return -1; } |
489 | 500 |
490 /** Returns embedder's object size in bytes. */ | 501 /** Returns embedder's object size in bytes. */ |
491 virtual intptr_t GetSizeInBytes() { return -1; } | 502 virtual intptr_t GetSizeInBytes() { return -1; } |
492 | 503 |
493 protected: | 504 protected: |
494 RetainedObjectInfo() {} | 505 RetainedObjectInfo() {} |
495 virtual ~RetainedObjectInfo() {} | 506 virtual ~RetainedObjectInfo() {} |
496 | 507 |
497 private: | 508 private: |
498 RetainedObjectInfo(const RetainedObjectInfo&); | 509 RetainedObjectInfo(const RetainedObjectInfo&); |
499 RetainedObjectInfo& operator=(const RetainedObjectInfo&); | 510 RetainedObjectInfo& operator=(const RetainedObjectInfo&); |
500 }; | 511 }; |
501 | 512 |
502 | 513 |
503 } // namespace v8 | 514 } // namespace v8 |
504 | 515 |
505 | 516 |
506 #undef V8EXPORT | 517 #undef V8EXPORT |
507 | 518 |
508 | 519 |
509 #endif // V8_V8_PROFILER_H_ | 520 #endif // V8_V8_PROFILER_H_ |
OLD | NEW |