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/v8.h" | 5 #include "src/v8.h" |
6 | 6 |
7 #include "src/heap-snapshot-generator-inl.h" | 7 #include "src/heap-snapshot-generator-inl.h" |
8 | 8 |
9 #include "src/allocation-tracker.h" | 9 #include "src/allocation-tracker.h" |
10 #include "src/code-stubs.h" | 10 #include "src/code-stubs.h" |
(...skipping 1548 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1559 HeapEntry::kNative, "system / JSArrayBufferData", size_); | 1559 HeapEntry::kNative, "system / JSArrayBufferData", size_); |
1560 } | 1560 } |
1561 private: | 1561 private: |
1562 size_t size_; | 1562 size_t size_; |
1563 V8HeapExplorer* explorer_; | 1563 V8HeapExplorer* explorer_; |
1564 }; | 1564 }; |
1565 | 1565 |
1566 | 1566 |
1567 void V8HeapExplorer::ExtractJSArrayBufferReferences( | 1567 void V8HeapExplorer::ExtractJSArrayBufferReferences( |
1568 int entry, JSArrayBuffer* buffer) { | 1568 int entry, JSArrayBuffer* buffer) { |
1569 SetWeakReference(buffer, entry, "weak_next", buffer->weak_next(), | |
1570 JSArrayBuffer::kWeakNextOffset); | |
1571 // Setup a reference to a native memory backing_store object. | 1569 // Setup a reference to a native memory backing_store object. |
1572 if (!buffer->backing_store()) | 1570 if (!buffer->backing_store()) |
1573 return; | 1571 return; |
1574 size_t data_size = NumberToSize(heap_->isolate(), buffer->byte_length()); | 1572 size_t data_size = NumberToSize(heap_->isolate(), buffer->byte_length()); |
1575 JSArrayBufferDataEntryAllocator allocator(data_size, this); | 1573 JSArrayBufferDataEntryAllocator allocator(data_size, this); |
1576 HeapEntry* data_entry = | 1574 HeapEntry* data_entry = |
1577 filler_->FindOrAddEntry(buffer->backing_store(), &allocator); | 1575 filler_->FindOrAddEntry(buffer->backing_store(), &allocator); |
1578 filler_->SetNamedReference(HeapGraphEdge::kInternal, | 1576 filler_->SetNamedReference(HeapGraphEdge::kInternal, |
1579 entry, "backing_store", data_entry); | 1577 entry, "backing_store", data_entry); |
1580 } | 1578 } |
(...skipping 1581 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3162 writer_->AddString("\"<dummy>\""); | 3160 writer_->AddString("\"<dummy>\""); |
3163 for (int i = 1; i < sorted_strings.length(); ++i) { | 3161 for (int i = 1; i < sorted_strings.length(); ++i) { |
3164 writer_->AddCharacter(','); | 3162 writer_->AddCharacter(','); |
3165 SerializeString(sorted_strings[i]); | 3163 SerializeString(sorted_strings[i]); |
3166 if (writer_->aborted()) return; | 3164 if (writer_->aborted()) return; |
3167 } | 3165 } |
3168 } | 3166 } |
3169 | 3167 |
3170 | 3168 |
3171 } } // namespace v8::internal | 3169 } } // namespace v8::internal |
OLD | NEW |