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