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 "src/code-stubs.h" | 7 #include "src/code-stubs.h" |
8 #include "src/conversions.h" | 8 #include "src/conversions.h" |
9 #include "src/debug/debug.h" | 9 #include "src/debug/debug.h" |
10 #include "src/objects-body-descriptors.h" | 10 #include "src/objects-body-descriptors.h" |
(...skipping 1503 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1514 size_t size_; | 1514 size_t size_; |
1515 V8HeapExplorer* explorer_; | 1515 V8HeapExplorer* explorer_; |
1516 }; | 1516 }; |
1517 | 1517 |
1518 | 1518 |
1519 void V8HeapExplorer::ExtractJSArrayBufferReferences( | 1519 void V8HeapExplorer::ExtractJSArrayBufferReferences( |
1520 int entry, JSArrayBuffer* buffer) { | 1520 int entry, JSArrayBuffer* buffer) { |
1521 // Setup a reference to a native memory backing_store object. | 1521 // Setup a reference to a native memory backing_store object. |
1522 if (!buffer->backing_store()) | 1522 if (!buffer->backing_store()) |
1523 return; | 1523 return; |
1524 size_t data_size = NumberToSize(heap_->isolate(), buffer->byte_length()); | 1524 size_t data_size = NumberToSize(buffer->byte_length()); |
1525 JSArrayBufferDataEntryAllocator allocator(data_size, this); | 1525 JSArrayBufferDataEntryAllocator allocator(data_size, this); |
1526 HeapEntry* data_entry = | 1526 HeapEntry* data_entry = |
1527 filler_->FindOrAddEntry(buffer->backing_store(), &allocator); | 1527 filler_->FindOrAddEntry(buffer->backing_store(), &allocator); |
1528 filler_->SetNamedReference(HeapGraphEdge::kInternal, | 1528 filler_->SetNamedReference(HeapGraphEdge::kInternal, |
1529 entry, "backing_store", data_entry); | 1529 entry, "backing_store", data_entry); |
1530 } | 1530 } |
1531 | 1531 |
1532 void V8HeapExplorer::ExtractFixedArrayReferences(int entry, FixedArray* array) { | 1532 void V8HeapExplorer::ExtractFixedArrayReferences(int entry, FixedArray* array) { |
1533 auto it = array_types_.find(array); | 1533 auto it = array_types_.find(array); |
1534 if (it == array_types_.end()) { | 1534 if (it == array_types_.end()) { |
(...skipping 1589 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3124 for (int i = 1; i < sorted_strings.length(); ++i) { | 3124 for (int i = 1; i < sorted_strings.length(); ++i) { |
3125 writer_->AddCharacter(','); | 3125 writer_->AddCharacter(','); |
3126 SerializeString(sorted_strings[i]); | 3126 SerializeString(sorted_strings[i]); |
3127 if (writer_->aborted()) return; | 3127 if (writer_->aborted()) return; |
3128 } | 3128 } |
3129 } | 3129 } |
3130 | 3130 |
3131 | 3131 |
3132 } // namespace internal | 3132 } // namespace internal |
3133 } // namespace v8 | 3133 } // namespace v8 |
OLD | NEW |