| OLD | NEW |
| 1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "src/profiler/heap-snapshot-generator.h" | 5 #include "src/profiler/heap-snapshot-generator.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "src/api.h" | 9 #include "src/api.h" |
| 10 #include "src/code-stubs.h" | 10 #include "src/code-stubs.h" |
| (...skipping 2179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2190 } | 2190 } |
| 2191 | 2191 |
| 2192 DisallowHeapAllocation no_allocation; | 2192 DisallowHeapAllocation no_allocation; |
| 2193 for (int i = 0, l = enumerator.count(); i < l; ++i) { | 2193 for (int i = 0, l = enumerator.count(); i < l; ++i) { |
| 2194 objects_tags_.SetTag(*enumerator.at(i), urls[i]); | 2194 objects_tags_.SetTag(*enumerator.at(i), urls[i]); |
| 2195 } | 2195 } |
| 2196 | 2196 |
| 2197 DeleteArray(urls); | 2197 DeleteArray(urls); |
| 2198 } | 2198 } |
| 2199 | 2199 |
| 2200 | 2200 class GlobalHandlesExtractor : public PersistentHandleVisitor { |
| 2201 class GlobalHandlesExtractor : public ObjectVisitor { | |
| 2202 public: | 2201 public: |
| 2203 explicit GlobalHandlesExtractor(NativeObjectsExplorer* explorer) | 2202 explicit GlobalHandlesExtractor(NativeObjectsExplorer* explorer) |
| 2204 : explorer_(explorer) {} | 2203 : explorer_(explorer) {} |
| 2205 ~GlobalHandlesExtractor() override {} | 2204 ~GlobalHandlesExtractor() override {} |
| 2206 void VisitPointers(Object** start, Object** end) override { UNREACHABLE(); } | 2205 void VisitPersistentHandle(Persistent<Value>* value, |
| 2207 void VisitEmbedderReference(Object** p, uint16_t class_id) override { | 2206 uint16_t class_id) override { |
| 2208 explorer_->VisitSubtreeWrapper(p, class_id); | 2207 Handle<Object> object = Utils::OpenPersistent(value); |
| 2208 explorer_->VisitSubtreeWrapper(object.location(), class_id); |
| 2209 } | 2209 } |
| 2210 |
| 2210 private: | 2211 private: |
| 2211 NativeObjectsExplorer* explorer_; | 2212 NativeObjectsExplorer* explorer_; |
| 2212 }; | 2213 }; |
| 2213 | 2214 |
| 2214 | 2215 |
| 2215 class BasicHeapEntriesAllocator : public HeapEntriesAllocator { | 2216 class BasicHeapEntriesAllocator : public HeapEntriesAllocator { |
| 2216 public: | 2217 public: |
| 2217 BasicHeapEntriesAllocator( | 2218 BasicHeapEntriesAllocator( |
| 2218 HeapSnapshot* snapshot, | 2219 HeapSnapshot* snapshot, |
| 2219 HeapEntry::Type entries_type) | 2220 HeapEntry::Type entries_type) |
| (...skipping 915 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3135 for (int i = 1; i < sorted_strings.length(); ++i) { | 3136 for (int i = 1; i < sorted_strings.length(); ++i) { |
| 3136 writer_->AddCharacter(','); | 3137 writer_->AddCharacter(','); |
| 3137 SerializeString(sorted_strings[i]); | 3138 SerializeString(sorted_strings[i]); |
| 3138 if (writer_->aborted()) return; | 3139 if (writer_->aborted()) return; |
| 3139 } | 3140 } |
| 3140 } | 3141 } |
| 3141 | 3142 |
| 3142 | 3143 |
| 3143 } // namespace internal | 3144 } // namespace internal |
| 3144 } // namespace v8 | 3145 } // namespace v8 |
| OLD | NEW |