OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 17 matching lines...) Expand all Loading... |
28 #ifndef V8_PROFILE_GENERATOR_H_ | 28 #ifndef V8_PROFILE_GENERATOR_H_ |
29 #define V8_PROFILE_GENERATOR_H_ | 29 #define V8_PROFILE_GENERATOR_H_ |
30 | 30 |
31 #include "allocation.h" | 31 #include "allocation.h" |
32 #include "hashmap.h" | 32 #include "hashmap.h" |
33 #include "../include/v8-profiler.h" | 33 #include "../include/v8-profiler.h" |
34 | 34 |
35 namespace v8 { | 35 namespace v8 { |
36 namespace internal { | 36 namespace internal { |
37 | 37 |
38 typedef uint32_t SnapshotObjectId; | |
39 | |
40 class TokenEnumerator { | 38 class TokenEnumerator { |
41 public: | 39 public: |
42 TokenEnumerator(); | 40 TokenEnumerator(); |
43 ~TokenEnumerator(); | 41 ~TokenEnumerator(); |
44 int GetTokenId(Object* token); | 42 int GetTokenId(Object* token); |
45 | 43 |
46 static const int kNoSecurityToken = -1; | 44 static const int kNoSecurityToken = -1; |
47 static const int kInheritsSecurityToken = -2; | 45 static const int kInheritsSecurityToken = -2; |
48 | 46 |
49 private: | 47 private: |
(...skipping 590 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
640 HeapSnapshotsCollection* collection() { return collection_; } | 638 HeapSnapshotsCollection* collection() { return collection_; } |
641 Type type() { return type_; } | 639 Type type() { return type_; } |
642 const char* title() { return title_; } | 640 const char* title() { return title_; } |
643 unsigned uid() { return uid_; } | 641 unsigned uid() { return uid_; } |
644 HeapEntry* root() { return root_entry_; } | 642 HeapEntry* root() { return root_entry_; } |
645 HeapEntry* gc_roots() { return gc_roots_entry_; } | 643 HeapEntry* gc_roots() { return gc_roots_entry_; } |
646 HeapEntry* natives_root() { return natives_root_entry_; } | 644 HeapEntry* natives_root() { return natives_root_entry_; } |
647 HeapEntry* gc_subroot(int index) { return gc_subroot_entries_[index]; } | 645 HeapEntry* gc_subroot(int index) { return gc_subroot_entries_[index]; } |
648 List<HeapEntry*>* entries() { return &entries_; } | 646 List<HeapEntry*>* entries() { return &entries_; } |
649 size_t raw_entries_size() { return raw_entries_size_; } | 647 size_t raw_entries_size() { return raw_entries_size_; } |
| 648 SnapshotObjectId max_snapshot_js_object_id() const { |
| 649 return max_snapshot_js_object_id_; |
| 650 } |
650 | 651 |
651 void AllocateEntries( | 652 void AllocateEntries( |
652 int entries_count, int children_count, int retainers_count); | 653 int entries_count, int children_count, int retainers_count); |
653 HeapEntry* AddEntry(HeapEntry::Type type, | 654 HeapEntry* AddEntry(HeapEntry::Type type, |
654 const char* name, | 655 const char* name, |
655 SnapshotObjectId id, | 656 SnapshotObjectId id, |
656 int size, | 657 int size, |
657 int children_count, | 658 int children_count, |
658 int retainers_count); | 659 int retainers_count); |
659 HeapEntry* AddRootEntry(int children_count); | 660 HeapEntry* AddRootEntry(int children_count); |
(...skipping 20 matching lines...) Expand all Loading... |
680 const char* title_; | 681 const char* title_; |
681 unsigned uid_; | 682 unsigned uid_; |
682 HeapEntry* root_entry_; | 683 HeapEntry* root_entry_; |
683 HeapEntry* gc_roots_entry_; | 684 HeapEntry* gc_roots_entry_; |
684 HeapEntry* natives_root_entry_; | 685 HeapEntry* natives_root_entry_; |
685 HeapEntry* gc_subroot_entries_[VisitorSynchronization::kNumberOfSyncTags]; | 686 HeapEntry* gc_subroot_entries_[VisitorSynchronization::kNumberOfSyncTags]; |
686 char* raw_entries_; | 687 char* raw_entries_; |
687 List<HeapEntry*> entries_; | 688 List<HeapEntry*> entries_; |
688 bool entries_sorted_; | 689 bool entries_sorted_; |
689 size_t raw_entries_size_; | 690 size_t raw_entries_size_; |
| 691 SnapshotObjectId max_snapshot_js_object_id_; |
690 | 692 |
691 friend class HeapSnapshotTester; | 693 friend class HeapSnapshotTester; |
692 | 694 |
693 DISALLOW_COPY_AND_ASSIGN(HeapSnapshot); | 695 DISALLOW_COPY_AND_ASSIGN(HeapSnapshot); |
694 }; | 696 }; |
695 | 697 |
696 | 698 |
697 class HeapObjectsMap { | 699 class HeapObjectsMap { |
698 public: | 700 public: |
699 HeapObjectsMap(); | 701 HeapObjectsMap(); |
(...skipping 456 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1156 | 1158 |
1157 friend class HeapSnapshotJSONSerializerEnumerator; | 1159 friend class HeapSnapshotJSONSerializerEnumerator; |
1158 friend class HeapSnapshotJSONSerializerIterator; | 1160 friend class HeapSnapshotJSONSerializerIterator; |
1159 | 1161 |
1160 DISALLOW_COPY_AND_ASSIGN(HeapSnapshotJSONSerializer); | 1162 DISALLOW_COPY_AND_ASSIGN(HeapSnapshotJSONSerializer); |
1161 }; | 1163 }; |
1162 | 1164 |
1163 } } // namespace v8::internal | 1165 } } // namespace v8::internal |
1164 | 1166 |
1165 #endif // V8_PROFILE_GENERATOR_H_ | 1167 #endif // V8_PROFILE_GENERATOR_H_ |
OLD | NEW |