| 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 |
| 873 id_ = id; | 876 id_ = id; |
| 877 #endif |
| 874 self_size_ = self_size; | 878 self_size_ = self_size; |
| 875 retained_size_ = 0; | 879 retained_size_ = 0; |
| 876 children_count_ = children_count; | 880 children_count_ = children_count; |
| 877 retainers_count_ = retainers_count; | 881 retainers_count_ = retainers_count; |
| 878 dominator_ = NULL; | 882 dominator_ = NULL; |
| 879 } | 883 } |
| 880 | 884 |
| 881 | 885 |
| 882 void HeapEntry::SetNamedReference(HeapGraphEdge::Type type, | 886 void HeapEntry::SetNamedReference(HeapGraphEdge::Type type, |
| 883 int child_index, | 887 int child_index, |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 945 void Apply(HeapEntry* entry) { } | 949 void Apply(HeapEntry* entry) { } |
| 946 }; | 950 }; |
| 947 | 951 |
| 948 void HeapEntry::PaintAllReachable() { | 952 void HeapEntry::PaintAllReachable() { |
| 949 NullClass null; | 953 NullClass null; |
| 950 ApplyAndPaintAllReachable(&null); | 954 ApplyAndPaintAllReachable(&null); |
| 951 } | 955 } |
| 952 | 956 |
| 953 | 957 |
| 954 void HeapEntry::Print(int max_depth, int indent) { | 958 void HeapEntry::Print(int max_depth, int indent) { |
| 955 OS::Print("%6d %6d [%llu] ", self_size(), RetainedSize(false), id_); | 959 OS::Print("%6d %6d [%llu] ", self_size(), RetainedSize(false), id()); |
| 956 if (type() != kString) { | 960 if (type() != kString) { |
| 957 OS::Print("%s %.40s\n", TypeAsString(), name_); | 961 OS::Print("%s %.40s\n", TypeAsString(), name_); |
| 958 } else { | 962 } else { |
| 959 OS::Print("\""); | 963 OS::Print("\""); |
| 960 const char* c = name_; | 964 const char* c = name_; |
| 961 while (*c && (c - name_) <= 40) { | 965 while (*c && (c - name_) <= 40) { |
| 962 if (*c != '\n') | 966 if (*c != '\n') |
| 963 OS::Print("%c", *c); | 967 OS::Print("%c", *c); |
| 964 else | 968 else |
| 965 OS::Print("\\n"); | 969 OS::Print("\\n"); |
| (...skipping 1789 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2755 void HeapSnapshotJSONSerializer::SortHashMap( | 2759 void HeapSnapshotJSONSerializer::SortHashMap( |
| 2756 HashMap* map, List<HashMap::Entry*>* sorted_entries) { | 2760 HashMap* map, List<HashMap::Entry*>* sorted_entries) { |
| 2757 for (HashMap::Entry* p = map->Start(); p != NULL; p = map->Next(p)) | 2761 for (HashMap::Entry* p = map->Start(); p != NULL; p = map->Next(p)) |
| 2758 sorted_entries->Add(p); | 2762 sorted_entries->Add(p); |
| 2759 sorted_entries->Sort(SortUsingEntryValue); | 2763 sorted_entries->Sort(SortUsingEntryValue); |
| 2760 } | 2764 } |
| 2761 | 2765 |
| 2762 } } // namespace v8::internal | 2766 } } // namespace v8::internal |
| 2763 | 2767 |
| 2764 #endif // ENABLE_LOGGING_AND_PROFILING | 2768 #endif // ENABLE_LOGGING_AND_PROFILING |
| OLD | NEW |