OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
92 | 92 |
93 void HeapEntry::SetIndexedReference(HeapGraphEdge::Type type, | 93 void HeapEntry::SetIndexedReference(HeapGraphEdge::Type type, |
94 int index, | 94 int index, |
95 HeapEntry* entry) { | 95 HeapEntry* entry) { |
96 HeapGraphEdge edge(type, index, this->index(), entry->index()); | 96 HeapGraphEdge edge(type, index, this->index(), entry->index()); |
97 snapshot_->edges().Add(edge); | 97 snapshot_->edges().Add(edge); |
98 ++children_count_; | 98 ++children_count_; |
99 } | 99 } |
100 | 100 |
101 | 101 |
102 Handle<HeapObject> HeapEntry::GetHeapObject() { | |
103 return snapshot_->profiler()->FindHeapObjectById(id()); | |
104 } | |
105 | |
106 | |
107 void HeapEntry::Print( | 102 void HeapEntry::Print( |
108 const char* prefix, const char* edge_name, int max_depth, int indent) { | 103 const char* prefix, const char* edge_name, int max_depth, int indent) { |
109 STATIC_CHECK(sizeof(unsigned) == sizeof(id())); | 104 STATIC_CHECK(sizeof(unsigned) == sizeof(id())); |
110 OS::Print("%6d @%6u %*c %s%s: ", | 105 OS::Print("%6d @%6u %*c %s%s: ", |
111 self_size(), id(), indent, ' ', prefix, edge_name); | 106 self_size(), id(), indent, ' ', prefix, edge_name); |
112 if (type() != kString) { | 107 if (type() != kString) { |
113 OS::Print("%s %.40s\n", TypeAsString(), name_); | 108 OS::Print("%s %.40s\n", TypeAsString(), name_); |
114 } else { | 109 } else { |
115 OS::Print("\""); | 110 OS::Print("\""); |
116 const char* c = name_; | 111 const char* c = name_; |
(...skipping 2842 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2959 writer_->AddString("\"<dummy>\""); | 2954 writer_->AddString("\"<dummy>\""); |
2960 for (int i = 1; i < sorted_strings.length(); ++i) { | 2955 for (int i = 1; i < sorted_strings.length(); ++i) { |
2961 writer_->AddCharacter(','); | 2956 writer_->AddCharacter(','); |
2962 SerializeString(sorted_strings[i]); | 2957 SerializeString(sorted_strings[i]); |
2963 if (writer_->aborted()) return; | 2958 if (writer_->aborted()) return; |
2964 } | 2959 } |
2965 } | 2960 } |
2966 | 2961 |
2967 | 2962 |
2968 } } // namespace v8::internal | 2963 } } // namespace v8::internal |
OLD | NEW |