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 852 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
863 Type type, | 863 Type type, |
864 const char* name, | 864 const char* name, |
865 uint64_t id, | 865 uint64_t id, |
866 int self_size, | 866 int self_size, |
867 int children_count, | 867 int children_count, |
868 int retainers_count) { | 868 int retainers_count) { |
869 snapshot_ = snapshot; | 869 snapshot_ = snapshot; |
870 type_ = type; | 870 type_ = type; |
871 painted_ = kUnpainted; | 871 painted_ = kUnpainted; |
872 name_ = name; | 872 name_ = name; |
873 #ifdef WIN32 | |
874 *(reinterpret_cast<uint64_t*>(&id_)) = id; | |
875 #else | |
876 id_ = id; | |
877 #endif | |
878 self_size_ = self_size; | 873 self_size_ = self_size; |
879 retained_size_ = 0; | 874 retained_size_ = 0; |
880 children_count_ = children_count; | 875 children_count_ = children_count; |
881 retainers_count_ = retainers_count; | 876 retainers_count_ = retainers_count; |
882 dominator_ = NULL; | 877 dominator_ = NULL; |
| 878 |
| 879 union { |
| 880 uint64_t set_id; |
| 881 Id stored_id; |
| 882 } id_adaptor = {id}; |
| 883 id_ = id_adaptor.stored_id; |
883 } | 884 } |
884 | 885 |
885 | 886 |
886 void HeapEntry::SetNamedReference(HeapGraphEdge::Type type, | 887 void HeapEntry::SetNamedReference(HeapGraphEdge::Type type, |
887 int child_index, | 888 int child_index, |
888 const char* name, | 889 const char* name, |
889 HeapEntry* entry, | 890 HeapEntry* entry, |
890 int retainer_index) { | 891 int retainer_index) { |
891 children_arr()[child_index].Init(child_index, type, name, entry); | 892 children_arr()[child_index].Init(child_index, type, name, entry); |
892 entry->retainers_arr()[retainer_index] = children_arr() + child_index; | 893 entry->retainers_arr()[retainer_index] = children_arr() + child_index; |
(...skipping 1866 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2759 void HeapSnapshotJSONSerializer::SortHashMap( | 2760 void HeapSnapshotJSONSerializer::SortHashMap( |
2760 HashMap* map, List<HashMap::Entry*>* sorted_entries) { | 2761 HashMap* map, List<HashMap::Entry*>* sorted_entries) { |
2761 for (HashMap::Entry* p = map->Start(); p != NULL; p = map->Next(p)) | 2762 for (HashMap::Entry* p = map->Start(); p != NULL; p = map->Next(p)) |
2762 sorted_entries->Add(p); | 2763 sorted_entries->Add(p); |
2763 sorted_entries->Sort(SortUsingEntryValue); | 2764 sorted_entries->Sort(SortUsingEntryValue); |
2764 } | 2765 } |
2765 | 2766 |
2766 } } // namespace v8::internal | 2767 } } // namespace v8::internal |
2767 | 2768 |
2768 #endif // ENABLE_LOGGING_AND_PROFILING | 2769 #endif // ENABLE_LOGGING_AND_PROFILING |
OLD | NEW |