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 526 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
537 const char* name, | 537 const char* name, |
538 SnapshotObjectId id, | 538 SnapshotObjectId id, |
539 int self_size, | 539 int self_size, |
540 int children_count, | 540 int children_count, |
541 int retainers_count); | 541 int retainers_count); |
542 | 542 |
543 HeapSnapshot* snapshot() { return snapshot_; } | 543 HeapSnapshot* snapshot() { return snapshot_; } |
544 Type type() { return static_cast<Type>(type_); } | 544 Type type() { return static_cast<Type>(type_); } |
545 const char* name() { return name_; } | 545 const char* name() { return name_; } |
546 void set_name(const char* name) { name_ = name; } | 546 void set_name(const char* name) { name_ = name; } |
547 inline SnapshotObjectId id(); | 547 inline SnapshotObjectId id() { return id_; } |
548 int self_size() { return self_size_; } | 548 int self_size() { return self_size_; } |
549 int retained_size() { return retained_size_; } | 549 int retained_size() { return retained_size_; } |
550 void add_retained_size(int size) { retained_size_ += size; } | 550 void add_retained_size(int size) { retained_size_ += size; } |
551 void set_retained_size(int value) { retained_size_ = value; } | 551 void set_retained_size(int value) { retained_size_ = value; } |
552 int ordered_index() { return ordered_index_; } | 552 int ordered_index() { return ordered_index_; } |
553 void set_ordered_index(int value) { ordered_index_ = value; } | 553 void set_ordered_index(int value) { ordered_index_ = value; } |
554 | 554 |
555 Vector<HeapGraphEdge> children() { | 555 Vector<HeapGraphEdge> children() { |
556 return Vector<HeapGraphEdge>(children_arr(), children_count_); } | 556 return Vector<HeapGraphEdge>(children_arr(), children_count_); } |
557 Vector<HeapGraphEdge*> retainers() { | 557 Vector<HeapGraphEdge*> retainers() { |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
601 | 601 |
602 unsigned painted_: 1; | 602 unsigned painted_: 1; |
603 unsigned type_: 4; | 603 unsigned type_: 4; |
604 int children_count_: 27; | 604 int children_count_: 27; |
605 int retainers_count_; | 605 int retainers_count_; |
606 int self_size_; | 606 int self_size_; |
607 union { | 607 union { |
608 int ordered_index_; // Used during dominator tree building. | 608 int ordered_index_; // Used during dominator tree building. |
609 int retained_size_; // At that moment, there is no retained size yet. | 609 int retained_size_; // At that moment, there is no retained size yet. |
610 }; | 610 }; |
| 611 SnapshotObjectId id_; |
611 HeapEntry* dominator_; | 612 HeapEntry* dominator_; |
612 HeapSnapshot* snapshot_; | 613 HeapSnapshot* snapshot_; |
613 struct Id { | |
614 uint32_t id1_; | |
615 uint32_t id2_; | |
616 } id_; // This is to avoid extra padding of 64-bit value. | |
617 const char* name_; | 614 const char* name_; |
618 | 615 |
619 DISALLOW_COPY_AND_ASSIGN(HeapEntry); | 616 DISALLOW_COPY_AND_ASSIGN(HeapEntry); |
620 }; | 617 }; |
621 | 618 |
622 | 619 |
623 class HeapSnapshotsCollection; | 620 class HeapSnapshotsCollection; |
624 | 621 |
625 // HeapSnapshot represents a single heap snapshot. It is stored in | 622 // HeapSnapshot represents a single heap snapshot. It is stored in |
626 // HeapSnapshotsCollection, which is also a factory for | 623 // HeapSnapshotsCollection, which is also a factory for |
(...skipping 532 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1159 | 1156 |
1160 friend class HeapSnapshotJSONSerializerEnumerator; | 1157 friend class HeapSnapshotJSONSerializerEnumerator; |
1161 friend class HeapSnapshotJSONSerializerIterator; | 1158 friend class HeapSnapshotJSONSerializerIterator; |
1162 | 1159 |
1163 DISALLOW_COPY_AND_ASSIGN(HeapSnapshotJSONSerializer); | 1160 DISALLOW_COPY_AND_ASSIGN(HeapSnapshotJSONSerializer); |
1164 }; | 1161 }; |
1165 | 1162 |
1166 } } // namespace v8::internal | 1163 } } // namespace v8::internal |
1167 | 1164 |
1168 #endif // V8_PROFILE_GENERATOR_H_ | 1165 #endif // V8_PROFILE_GENERATOR_H_ |
OLD | NEW |