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 1157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1168 GlobalObject::kNativeContextOffset); | 1168 GlobalObject::kNativeContextOffset); |
1169 SetInternalReference(global_obj, entry, | 1169 SetInternalReference(global_obj, entry, |
1170 "global_proxy", global_obj->global_proxy(), | 1170 "global_proxy", global_obj->global_proxy(), |
1171 GlobalObject::kGlobalProxyOffset); | 1171 GlobalObject::kGlobalProxyOffset); |
1172 STATIC_ASSERT(GlobalObject::kHeaderSize - JSObject::kHeaderSize == | 1172 STATIC_ASSERT(GlobalObject::kHeaderSize - JSObject::kHeaderSize == |
1173 3 * kPointerSize); | 1173 3 * kPointerSize); |
1174 } else if (obj->IsJSArrayBufferView()) { | 1174 } else if (obj->IsJSArrayBufferView()) { |
1175 JSArrayBufferView* view = JSArrayBufferView::cast(obj); | 1175 JSArrayBufferView* view = JSArrayBufferView::cast(obj); |
1176 SetInternalReference(view, entry, "buffer", view->buffer(), | 1176 SetInternalReference(view, entry, "buffer", view->buffer(), |
1177 JSArrayBufferView::kBufferOffset); | 1177 JSArrayBufferView::kBufferOffset); |
| 1178 SetWeakReference(view, entry, "weak_next", view->weak_next(), |
| 1179 JSArrayBufferView::kWeakNextOffset); |
1178 } | 1180 } |
1179 TagObject(js_obj->properties(), "(object properties)"); | 1181 TagObject(js_obj->properties(), "(object properties)"); |
1180 SetInternalReference(obj, entry, | 1182 SetInternalReference(obj, entry, |
1181 "properties", js_obj->properties(), | 1183 "properties", js_obj->properties(), |
1182 JSObject::kPropertiesOffset); | 1184 JSObject::kPropertiesOffset); |
1183 TagObject(js_obj->elements(), "(object elements)"); | 1185 TagObject(js_obj->elements(), "(object elements)"); |
1184 SetInternalReference(obj, entry, | 1186 SetInternalReference(obj, entry, |
1185 "elements", js_obj->elements(), | 1187 "elements", js_obj->elements(), |
1186 JSObject::kElementsOffset); | 1188 JSObject::kElementsOffset); |
1187 } | 1189 } |
(...skipping 373 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1561 private: | 1563 private: |
1562 size_t size_; | 1564 size_t size_; |
1563 V8HeapExplorer* explorer_; | 1565 V8HeapExplorer* explorer_; |
1564 }; | 1566 }; |
1565 | 1567 |
1566 | 1568 |
1567 void V8HeapExplorer::ExtractJSArrayBufferReferences( | 1569 void V8HeapExplorer::ExtractJSArrayBufferReferences( |
1568 int entry, JSArrayBuffer* buffer) { | 1570 int entry, JSArrayBuffer* buffer) { |
1569 SetWeakReference(buffer, entry, "weak_next", buffer->weak_next(), | 1571 SetWeakReference(buffer, entry, "weak_next", buffer->weak_next(), |
1570 JSArrayBuffer::kWeakNextOffset); | 1572 JSArrayBuffer::kWeakNextOffset); |
| 1573 SetWeakReference(buffer, entry, |
| 1574 "weak_first_view", buffer->weak_first_view(), |
| 1575 JSArrayBuffer::kWeakFirstViewOffset); |
1571 // Setup a reference to a native memory backing_store object. | 1576 // Setup a reference to a native memory backing_store object. |
1572 if (!buffer->backing_store()) | 1577 if (!buffer->backing_store()) |
1573 return; | 1578 return; |
1574 size_t data_size = NumberToSize(heap_->isolate(), buffer->byte_length()); | 1579 size_t data_size = NumberToSize(heap_->isolate(), buffer->byte_length()); |
1575 JSArrayBufferDataEntryAllocator allocator(data_size, this); | 1580 JSArrayBufferDataEntryAllocator allocator(data_size, this); |
1576 HeapEntry* data_entry = | 1581 HeapEntry* data_entry = |
1577 filler_->FindOrAddEntry(buffer->backing_store(), &allocator); | 1582 filler_->FindOrAddEntry(buffer->backing_store(), &allocator); |
1578 filler_->SetNamedReference(HeapGraphEdge::kInternal, | 1583 filler_->SetNamedReference(HeapGraphEdge::kInternal, |
1579 entry, "backing_store", data_entry); | 1584 entry, "backing_store", data_entry); |
1580 } | 1585 } |
(...skipping 1578 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3159 writer_->AddString("\"<dummy>\""); | 3164 writer_->AddString("\"<dummy>\""); |
3160 for (int i = 1; i < sorted_strings.length(); ++i) { | 3165 for (int i = 1; i < sorted_strings.length(); ++i) { |
3161 writer_->AddCharacter(','); | 3166 writer_->AddCharacter(','); |
3162 SerializeString(sorted_strings[i]); | 3167 SerializeString(sorted_strings[i]); |
3163 if (writer_->aborted()) return; | 3168 if (writer_->aborted()) return; |
3164 } | 3169 } |
3165 } | 3170 } |
3166 | 3171 |
3167 | 3172 |
3168 } } // namespace v8::internal | 3173 } } // namespace v8::internal |
OLD | NEW |