Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(143)

Side by Side Diff: src/profiler/heap-snapshot-generator.cc

Issue 2204873003: Add WeakCell support to heap profiler. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/profiler/heap-snapshot-generator.h ('k') | test/cctest/test-heap-profiler.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 1029 matching lines...) Expand 10 before | Expand all | Expand 10 after
1040 } else if (obj->IsAccessorInfo()) { 1040 } else if (obj->IsAccessorInfo()) {
1041 ExtractAccessorInfoReferences(entry, AccessorInfo::cast(obj)); 1041 ExtractAccessorInfoReferences(entry, AccessorInfo::cast(obj));
1042 } else if (obj->IsAccessorPair()) { 1042 } else if (obj->IsAccessorPair()) {
1043 ExtractAccessorPairReferences(entry, AccessorPair::cast(obj)); 1043 ExtractAccessorPairReferences(entry, AccessorPair::cast(obj));
1044 } else if (obj->IsCode()) { 1044 } else if (obj->IsCode()) {
1045 ExtractCodeReferences(entry, Code::cast(obj)); 1045 ExtractCodeReferences(entry, Code::cast(obj));
1046 } else if (obj->IsBox()) { 1046 } else if (obj->IsBox()) {
1047 ExtractBoxReferences(entry, Box::cast(obj)); 1047 ExtractBoxReferences(entry, Box::cast(obj));
1048 } else if (obj->IsCell()) { 1048 } else if (obj->IsCell()) {
1049 ExtractCellReferences(entry, Cell::cast(obj)); 1049 ExtractCellReferences(entry, Cell::cast(obj));
1050 } else if (obj->IsWeakCell()) {
1051 ExtractWeakCellReferences(entry, WeakCell::cast(obj));
1050 } else if (obj->IsPropertyCell()) { 1052 } else if (obj->IsPropertyCell()) {
1051 ExtractPropertyCellReferences(entry, PropertyCell::cast(obj)); 1053 ExtractPropertyCellReferences(entry, PropertyCell::cast(obj));
1052 } else if (obj->IsAllocationSite()) { 1054 } else if (obj->IsAllocationSite()) {
1053 ExtractAllocationSiteReferences(entry, AllocationSite::cast(obj)); 1055 ExtractAllocationSiteReferences(entry, AllocationSite::cast(obj));
1054 } 1056 }
1055 return true; 1057 return true;
1056 } 1058 }
1057 1059
1058 1060
1059 bool V8HeapExplorer::ExtractReferencesPass2(int entry, HeapObject* obj) { 1061 bool V8HeapExplorer::ExtractReferencesPass2(int entry, HeapObject* obj) {
(...skipping 408 matching lines...) Expand 10 before | Expand all | Expand 10 after
1468 SetInternalReference(code, entry, 1470 SetInternalReference(code, entry,
1469 "gc_metadata", code->gc_metadata(), 1471 "gc_metadata", code->gc_metadata(),
1470 Code::kGCMetadataOffset); 1472 Code::kGCMetadataOffset);
1471 if (code->kind() == Code::OPTIMIZED_FUNCTION) { 1473 if (code->kind() == Code::OPTIMIZED_FUNCTION) {
1472 SetWeakReference(code, entry, 1474 SetWeakReference(code, entry,
1473 "next_code_link", code->next_code_link(), 1475 "next_code_link", code->next_code_link(),
1474 Code::kNextCodeLinkOffset); 1476 Code::kNextCodeLinkOffset);
1475 } 1477 }
1476 } 1478 }
1477 1479
1478
1479 void V8HeapExplorer::ExtractBoxReferences(int entry, Box* box) { 1480 void V8HeapExplorer::ExtractBoxReferences(int entry, Box* box) {
1480 SetInternalReference(box, entry, "value", box->value(), Box::kValueOffset); 1481 SetInternalReference(box, entry, "value", box->value(), Box::kValueOffset);
1481 } 1482 }
1482 1483
1483
1484 void V8HeapExplorer::ExtractCellReferences(int entry, Cell* cell) { 1484 void V8HeapExplorer::ExtractCellReferences(int entry, Cell* cell) {
1485 SetInternalReference(cell, entry, "value", cell->value(), Cell::kValueOffset); 1485 SetInternalReference(cell, entry, "value", cell->value(), Cell::kValueOffset);
1486 } 1486 }
1487 1487
1488 void V8HeapExplorer::ExtractWeakCellReferences(int entry, WeakCell* weak_cell) {
1489 SetWeakReference(weak_cell, entry, "value", weak_cell->value(),
1490 WeakCell::kValueOffset);
1491 TagObject(weak_cell->next(), "(weak cell)");
1492 SetWeakReference(weak_cell, entry, "next", weak_cell->next(),
ulan 2016/08/02 12:32:17 This is a non-essential reference. Might make sens
alph 2016/08/02 13:00:11 Done.
1493 WeakCell::kNextOffset);
1494 }
1488 1495
1489 void V8HeapExplorer::ExtractPropertyCellReferences(int entry, 1496 void V8HeapExplorer::ExtractPropertyCellReferences(int entry,
1490 PropertyCell* cell) { 1497 PropertyCell* cell) {
1491 SetInternalReference(cell, entry, "value", cell->value(), 1498 SetInternalReference(cell, entry, "value", cell->value(),
1492 PropertyCell::kValueOffset); 1499 PropertyCell::kValueOffset);
1493 MarkAsWeakContainer(cell->dependent_code()); 1500 MarkAsWeakContainer(cell->dependent_code());
1494 SetInternalReference(cell, entry, "dependent_code", cell->dependent_code(), 1501 SetInternalReference(cell, entry, "dependent_code", cell->dependent_code(),
1495 PropertyCell::kDependentCodeOffset); 1502 PropertyCell::kDependentCodeOffset);
1496 } 1503 }
1497 1504
(...skipping 1623 matching lines...) Expand 10 before | Expand all | Expand 10 after
3121 for (int i = 1; i < sorted_strings.length(); ++i) { 3128 for (int i = 1; i < sorted_strings.length(); ++i) {
3122 writer_->AddCharacter(','); 3129 writer_->AddCharacter(',');
3123 SerializeString(sorted_strings[i]); 3130 SerializeString(sorted_strings[i]);
3124 if (writer_->aborted()) return; 3131 if (writer_->aborted()) return;
3125 } 3132 }
3126 } 3133 }
3127 3134
3128 3135
3129 } // namespace internal 3136 } // namespace internal
3130 } // namespace v8 3137 } // namespace v8
OLDNEW
« no previous file with comments | « src/profiler/heap-snapshot-generator.h ('k') | test/cctest/test-heap-profiler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698