| OLD | NEW |
| 1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 the V8 project authors. All rights reserved. |
| 2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
| 3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
| 4 // met: | 4 // met: |
| 5 // | 5 // |
| 6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
| 7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
| 8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
| 9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
| 10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
| (...skipping 912 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 923 int parent_; | 923 int parent_; |
| 924 int next_index_; | 924 int next_index_; |
| 925 }; | 925 }; |
| 926 | 926 |
| 927 | 927 |
| 928 void V8HeapExplorer::ExtractReferences(HeapObject* obj) { | 928 void V8HeapExplorer::ExtractReferences(HeapObject* obj) { |
| 929 HeapEntry* heap_entry = GetEntry(obj); | 929 HeapEntry* heap_entry = GetEntry(obj); |
| 930 if (heap_entry == NULL) return; // No interest in this object. | 930 if (heap_entry == NULL) return; // No interest in this object. |
| 931 int entry = heap_entry->index(); | 931 int entry = heap_entry->index(); |
| 932 | 932 |
| 933 bool extract_indexed_refs = true; | |
| 934 if (obj->IsJSGlobalProxy()) { | 933 if (obj->IsJSGlobalProxy()) { |
| 935 ExtractJSGlobalProxyReferences(entry, JSGlobalProxy::cast(obj)); | 934 ExtractJSGlobalProxyReferences(entry, JSGlobalProxy::cast(obj)); |
| 936 } else if (obj->IsJSObject()) { | 935 } else if (obj->IsJSObject()) { |
| 937 ExtractJSObjectReferences(entry, JSObject::cast(obj)); | 936 ExtractJSObjectReferences(entry, JSObject::cast(obj)); |
| 938 } else if (obj->IsString()) { | 937 } else if (obj->IsString()) { |
| 939 ExtractStringReferences(entry, String::cast(obj)); | 938 ExtractStringReferences(entry, String::cast(obj)); |
| 940 } else if (obj->IsContext()) { | 939 } else if (obj->IsContext()) { |
| 941 ExtractContextReferences(entry, Context::cast(obj)); | 940 ExtractContextReferences(entry, Context::cast(obj)); |
| 942 } else if (obj->IsMap()) { | 941 } else if (obj->IsMap()) { |
| 943 ExtractMapReferences(entry, Map::cast(obj)); | 942 ExtractMapReferences(entry, Map::cast(obj)); |
| 944 } else if (obj->IsSharedFunctionInfo()) { | 943 } else if (obj->IsSharedFunctionInfo()) { |
| 945 ExtractSharedFunctionInfoReferences(entry, SharedFunctionInfo::cast(obj)); | 944 ExtractSharedFunctionInfoReferences(entry, SharedFunctionInfo::cast(obj)); |
| 946 } else if (obj->IsScript()) { | 945 } else if (obj->IsScript()) { |
| 947 ExtractScriptReferences(entry, Script::cast(obj)); | 946 ExtractScriptReferences(entry, Script::cast(obj)); |
| 948 } else if (obj->IsAccessorPair()) { | 947 } else if (obj->IsAccessorPair()) { |
| 949 ExtractAccessorPairReferences(entry, AccessorPair::cast(obj)); | 948 ExtractAccessorPairReferences(entry, AccessorPair::cast(obj)); |
| 950 } else if (obj->IsCodeCache()) { | 949 } else if (obj->IsCodeCache()) { |
| 951 ExtractCodeCacheReferences(entry, CodeCache::cast(obj)); | 950 ExtractCodeCacheReferences(entry, CodeCache::cast(obj)); |
| 952 } else if (obj->IsCode()) { | 951 } else if (obj->IsCode()) { |
| 953 ExtractCodeReferences(entry, Code::cast(obj)); | 952 ExtractCodeReferences(entry, Code::cast(obj)); |
| 954 } else if (obj->IsCell()) { | 953 } else if (obj->IsCell()) { |
| 955 ExtractCellReferences(entry, Cell::cast(obj)); | 954 ExtractCellReferences(entry, Cell::cast(obj)); |
| 956 extract_indexed_refs = false; | |
| 957 } else if (obj->IsPropertyCell()) { | 955 } else if (obj->IsPropertyCell()) { |
| 958 ExtractPropertyCellReferences(entry, PropertyCell::cast(obj)); | 956 ExtractPropertyCellReferences(entry, PropertyCell::cast(obj)); |
| 959 extract_indexed_refs = false; | |
| 960 } else if (obj->IsAllocationSite()) { | 957 } else if (obj->IsAllocationSite()) { |
| 961 ExtractAllocationSiteReferences(entry, AllocationSite::cast(obj)); | 958 ExtractAllocationSiteReferences(entry, AllocationSite::cast(obj)); |
| 962 } | 959 } |
| 963 if (extract_indexed_refs) { | 960 SetInternalReference(obj, entry, "map", obj->map(), HeapObject::kMapOffset); |
| 964 SetInternalReference(obj, entry, "map", obj->map(), HeapObject::kMapOffset); | 961 |
| 965 IndexedReferencesExtractor refs_extractor(this, obj, entry); | 962 // Extract unvisited fields as hidden references and restore tags |
| 966 obj->Iterate(&refs_extractor); | 963 // of visited fields. |
| 967 } | 964 IndexedReferencesExtractor refs_extractor(this, obj, entry); |
| 965 obj->Iterate(&refs_extractor); |
| 968 } | 966 } |
| 969 | 967 |
| 970 | 968 |
| 971 void V8HeapExplorer::ExtractJSGlobalProxyReferences( | 969 void V8HeapExplorer::ExtractJSGlobalProxyReferences( |
| 972 int entry, JSGlobalProxy* proxy) { | 970 int entry, JSGlobalProxy* proxy) { |
| 973 SetInternalReference(proxy, entry, | 971 SetInternalReference(proxy, entry, |
| 974 "native_context", proxy->native_context(), | 972 "native_context", proxy->native_context(), |
| 975 JSGlobalProxy::kNativeContextOffset); | 973 JSGlobalProxy::kNativeContextOffset); |
| 976 } | 974 } |
| 977 | 975 |
| (...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1102 i < Context::NATIVE_CONTEXT_SLOTS; | 1100 i < Context::NATIVE_CONTEXT_SLOTS; |
| 1103 ++i) { | 1101 ++i) { |
| 1104 SetWeakReference(context, entry, i, context->get(i), | 1102 SetWeakReference(context, entry, i, context->get(i), |
| 1105 FixedArray::OffsetOfElementAt(i)); | 1103 FixedArray::OffsetOfElementAt(i)); |
| 1106 } | 1104 } |
| 1107 } | 1105 } |
| 1108 } | 1106 } |
| 1109 | 1107 |
| 1110 | 1108 |
| 1111 void V8HeapExplorer::ExtractMapReferences(int entry, Map* map) { | 1109 void V8HeapExplorer::ExtractMapReferences(int entry, Map* map) { |
| 1112 SetInternalReference(map, entry, | |
| 1113 "prototype", map->prototype(), Map::kPrototypeOffset); | |
| 1114 SetInternalReference(map, entry, | |
| 1115 "constructor", map->constructor(), | |
| 1116 Map::kConstructorOffset); | |
| 1117 if (map->HasTransitionArray()) { | 1110 if (map->HasTransitionArray()) { |
| 1118 TransitionArray* transitions = map->transitions(); | 1111 TransitionArray* transitions = map->transitions(); |
| 1119 | 1112 int transitions_entry = GetEntry(transitions)->index(); |
| 1120 Object* back_pointer = transitions->back_pointer_storage(); | 1113 Object* back_pointer = transitions->back_pointer_storage(); |
| 1121 TagObject(transitions->back_pointer_storage(), "(back pointer)"); | 1114 TagObject(back_pointer, "(back pointer)"); |
| 1122 SetInternalReference(transitions, entry, | 1115 SetInternalReference(transitions, transitions_entry, |
| 1123 "backpointer", back_pointer, | 1116 "back_pointer", back_pointer); |
| 1124 TransitionArray::kBackPointerStorageOffset); | |
| 1125 IndexedReferencesExtractor transitions_refs(this, transitions, entry); | |
| 1126 transitions->Iterate(&transitions_refs); | |
| 1127 | |
| 1128 TagObject(transitions, "(transition array)"); | 1117 TagObject(transitions, "(transition array)"); |
| 1129 SetInternalReference(map, entry, | 1118 SetInternalReference(map, entry, |
| 1130 "transitions", transitions, | 1119 "transitions", transitions, |
| 1131 Map::kTransitionsOrBackPointerOffset); | 1120 Map::kTransitionsOrBackPointerOffset); |
| 1132 } else { | 1121 } else { |
| 1133 Object* back_pointer = map->GetBackPointer(); | 1122 Object* back_pointer = map->GetBackPointer(); |
| 1134 TagObject(back_pointer, "(back pointer)"); | 1123 TagObject(back_pointer, "(back pointer)"); |
| 1135 SetInternalReference(map, entry, | 1124 SetInternalReference(map, entry, |
| 1136 "backpointer", back_pointer, | 1125 "back_pointer", back_pointer, |
| 1137 Map::kTransitionsOrBackPointerOffset); | 1126 Map::kTransitionsOrBackPointerOffset); |
| 1138 } | 1127 } |
| 1139 DescriptorArray* descriptors = map->instance_descriptors(); | 1128 DescriptorArray* descriptors = map->instance_descriptors(); |
| 1140 TagObject(descriptors, "(map descriptors)"); | 1129 TagObject(descriptors, "(map descriptors)"); |
| 1141 SetInternalReference(map, entry, | 1130 SetInternalReference(map, entry, |
| 1142 "descriptors", descriptors, | 1131 "descriptors", descriptors, |
| 1143 Map::kDescriptorsOffset); | 1132 Map::kDescriptorsOffset); |
| 1144 | 1133 |
| 1145 SetInternalReference(map, entry, | 1134 SetInternalReference(map, entry, |
| 1146 "code_cache", map->code_cache(), | 1135 "code_cache", map->code_cache(), |
| 1147 Map::kCodeCacheOffset); | 1136 Map::kCodeCacheOffset); |
| 1137 SetInternalReference(map, entry, |
| 1138 "prototype", map->prototype(), Map::kPrototypeOffset); |
| 1139 SetInternalReference(map, entry, |
| 1140 "constructor", map->constructor(), |
| 1141 Map::kConstructorOffset); |
| 1148 } | 1142 } |
| 1149 | 1143 |
| 1150 | 1144 |
| 1151 void V8HeapExplorer::ExtractSharedFunctionInfoReferences( | 1145 void V8HeapExplorer::ExtractSharedFunctionInfoReferences( |
| 1152 int entry, SharedFunctionInfo* shared) { | 1146 int entry, SharedFunctionInfo* shared) { |
| 1153 HeapObject* obj = shared; | 1147 HeapObject* obj = shared; |
| 1154 SetInternalReference(obj, entry, | 1148 SetInternalReference(obj, entry, |
| 1155 "name", shared->name(), | 1149 "name", shared->name(), |
| 1156 SharedFunctionInfo::kNameOffset); | 1150 SharedFunctionInfo::kNameOffset); |
| 1157 TagObject(shared->code(), "(code)"); | 1151 TagObject(shared->code(), "(code)"); |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1247 "type_feedback_info", code->type_feedback_info(), | 1241 "type_feedback_info", code->type_feedback_info(), |
| 1248 Code::kTypeFeedbackInfoOffset); | 1242 Code::kTypeFeedbackInfoOffset); |
| 1249 } | 1243 } |
| 1250 SetInternalReference(code, entry, | 1244 SetInternalReference(code, entry, |
| 1251 "gc_metadata", code->gc_metadata(), | 1245 "gc_metadata", code->gc_metadata(), |
| 1252 Code::kGCMetadataOffset); | 1246 Code::kGCMetadataOffset); |
| 1253 } | 1247 } |
| 1254 | 1248 |
| 1255 | 1249 |
| 1256 void V8HeapExplorer::ExtractCellReferences(int entry, Cell* cell) { | 1250 void V8HeapExplorer::ExtractCellReferences(int entry, Cell* cell) { |
| 1257 SetInternalReference(cell, entry, "value", cell->value()); | 1251 SetInternalReference(cell, entry, "value", cell->value(), Cell::kValueOffset); |
| 1258 } | 1252 } |
| 1259 | 1253 |
| 1260 | 1254 |
| 1261 void V8HeapExplorer::ExtractPropertyCellReferences(int entry, | 1255 void V8HeapExplorer::ExtractPropertyCellReferences(int entry, |
| 1262 PropertyCell* cell) { | 1256 PropertyCell* cell) { |
| 1263 SetInternalReference(cell, entry, "value", cell->value()); | 1257 ExtractCellReferences(entry, cell); |
| 1264 SetInternalReference(cell, entry, "type", cell->type()); | 1258 SetInternalReference(cell, entry, "type", cell->type(), |
| 1259 PropertyCell::kTypeOffset); |
| 1260 SetInternalReference(cell, entry, "dependent_code", cell->dependent_code(), |
| 1261 PropertyCell::kDependentCodeOffset); |
| 1265 } | 1262 } |
| 1266 | 1263 |
| 1267 | 1264 |
| 1268 void V8HeapExplorer::ExtractAllocationSiteReferences(int entry, | 1265 void V8HeapExplorer::ExtractAllocationSiteReferences(int entry, |
| 1269 AllocationSite* site) { | 1266 AllocationSite* site) { |
| 1270 SetInternalReference(site, entry, "transition_info", site->transition_info(), | 1267 SetInternalReference(site, entry, "transition_info", site->transition_info(), |
| 1271 AllocationSite::kTransitionInfoOffset); | 1268 AllocationSite::kTransitionInfoOffset); |
| 1272 } | 1269 } |
| 1273 | 1270 |
| 1274 | 1271 |
| (...skipping 294 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1569 && object != heap_->one_pointer_filler_map() | 1566 && object != heap_->one_pointer_filler_map() |
| 1570 && object != heap_->two_pointer_filler_map(); | 1567 && object != heap_->two_pointer_filler_map(); |
| 1571 } | 1568 } |
| 1572 | 1569 |
| 1573 | 1570 |
| 1574 void V8HeapExplorer::SetContextReference(HeapObject* parent_obj, | 1571 void V8HeapExplorer::SetContextReference(HeapObject* parent_obj, |
| 1575 int parent_entry, | 1572 int parent_entry, |
| 1576 String* reference_name, | 1573 String* reference_name, |
| 1577 Object* child_obj, | 1574 Object* child_obj, |
| 1578 int field_offset) { | 1575 int field_offset) { |
| 1576 ASSERT(parent_entry == GetEntry(parent_obj)->index()); |
| 1579 HeapEntry* child_entry = GetEntry(child_obj); | 1577 HeapEntry* child_entry = GetEntry(child_obj); |
| 1580 if (child_entry != NULL) { | 1578 if (child_entry != NULL) { |
| 1581 filler_->SetNamedReference(HeapGraphEdge::kContextVariable, | 1579 filler_->SetNamedReference(HeapGraphEdge::kContextVariable, |
| 1582 parent_entry, | 1580 parent_entry, |
| 1583 collection_->names()->GetName(reference_name), | 1581 collection_->names()->GetName(reference_name), |
| 1584 child_entry); | 1582 child_entry); |
| 1585 IndexedReferencesExtractor::MarkVisitedField(parent_obj, field_offset); | 1583 IndexedReferencesExtractor::MarkVisitedField(parent_obj, field_offset); |
| 1586 } | 1584 } |
| 1587 } | 1585 } |
| 1588 | 1586 |
| 1589 | 1587 |
| 1590 void V8HeapExplorer::SetNativeBindReference(HeapObject* parent_obj, | 1588 void V8HeapExplorer::SetNativeBindReference(HeapObject* parent_obj, |
| 1591 int parent_entry, | 1589 int parent_entry, |
| 1592 const char* reference_name, | 1590 const char* reference_name, |
| 1593 Object* child_obj) { | 1591 Object* child_obj) { |
| 1592 ASSERT(parent_entry == GetEntry(parent_obj)->index()); |
| 1594 HeapEntry* child_entry = GetEntry(child_obj); | 1593 HeapEntry* child_entry = GetEntry(child_obj); |
| 1595 if (child_entry != NULL) { | 1594 if (child_entry != NULL) { |
| 1596 filler_->SetNamedReference(HeapGraphEdge::kShortcut, | 1595 filler_->SetNamedReference(HeapGraphEdge::kShortcut, |
| 1597 parent_entry, | 1596 parent_entry, |
| 1598 reference_name, | 1597 reference_name, |
| 1599 child_entry); | 1598 child_entry); |
| 1600 } | 1599 } |
| 1601 } | 1600 } |
| 1602 | 1601 |
| 1603 | 1602 |
| 1604 void V8HeapExplorer::SetElementReference(HeapObject* parent_obj, | 1603 void V8HeapExplorer::SetElementReference(HeapObject* parent_obj, |
| 1605 int parent_entry, | 1604 int parent_entry, |
| 1606 int index, | 1605 int index, |
| 1607 Object* child_obj) { | 1606 Object* child_obj) { |
| 1607 ASSERT(parent_entry == GetEntry(parent_obj)->index()); |
| 1608 HeapEntry* child_entry = GetEntry(child_obj); | 1608 HeapEntry* child_entry = GetEntry(child_obj); |
| 1609 if (child_entry != NULL) { | 1609 if (child_entry != NULL) { |
| 1610 filler_->SetIndexedReference(HeapGraphEdge::kElement, | 1610 filler_->SetIndexedReference(HeapGraphEdge::kElement, |
| 1611 parent_entry, | 1611 parent_entry, |
| 1612 index, | 1612 index, |
| 1613 child_entry); | 1613 child_entry); |
| 1614 } | 1614 } |
| 1615 } | 1615 } |
| 1616 | 1616 |
| 1617 | 1617 |
| 1618 void V8HeapExplorer::SetInternalReference(HeapObject* parent_obj, | 1618 void V8HeapExplorer::SetInternalReference(HeapObject* parent_obj, |
| 1619 int parent_entry, | 1619 int parent_entry, |
| 1620 const char* reference_name, | 1620 const char* reference_name, |
| 1621 Object* child_obj, | 1621 Object* child_obj, |
| 1622 int field_offset) { | 1622 int field_offset) { |
| 1623 ASSERT(parent_entry == GetEntry(parent_obj)->index()); |
| 1623 HeapEntry* child_entry = GetEntry(child_obj); | 1624 HeapEntry* child_entry = GetEntry(child_obj); |
| 1624 if (child_entry == NULL) return; | 1625 if (child_entry == NULL) return; |
| 1625 if (IsEssentialObject(child_obj)) { | 1626 if (IsEssentialObject(child_obj)) { |
| 1626 filler_->SetNamedReference(HeapGraphEdge::kInternal, | 1627 filler_->SetNamedReference(HeapGraphEdge::kInternal, |
| 1627 parent_entry, | 1628 parent_entry, |
| 1628 reference_name, | 1629 reference_name, |
| 1629 child_entry); | 1630 child_entry); |
| 1630 } | 1631 } |
| 1631 IndexedReferencesExtractor::MarkVisitedField(parent_obj, field_offset); | 1632 IndexedReferencesExtractor::MarkVisitedField(parent_obj, field_offset); |
| 1632 } | 1633 } |
| 1633 | 1634 |
| 1634 | 1635 |
| 1635 void V8HeapExplorer::SetInternalReference(HeapObject* parent_obj, | 1636 void V8HeapExplorer::SetInternalReference(HeapObject* parent_obj, |
| 1636 int parent_entry, | 1637 int parent_entry, |
| 1637 int index, | 1638 int index, |
| 1638 Object* child_obj, | 1639 Object* child_obj, |
| 1639 int field_offset) { | 1640 int field_offset) { |
| 1641 ASSERT(parent_entry == GetEntry(parent_obj)->index()); |
| 1640 HeapEntry* child_entry = GetEntry(child_obj); | 1642 HeapEntry* child_entry = GetEntry(child_obj); |
| 1641 if (child_entry == NULL) return; | 1643 if (child_entry == NULL) return; |
| 1642 if (IsEssentialObject(child_obj)) { | 1644 if (IsEssentialObject(child_obj)) { |
| 1643 filler_->SetNamedReference(HeapGraphEdge::kInternal, | 1645 filler_->SetNamedReference(HeapGraphEdge::kInternal, |
| 1644 parent_entry, | 1646 parent_entry, |
| 1645 collection_->names()->GetName(index), | 1647 collection_->names()->GetName(index), |
| 1646 child_entry); | 1648 child_entry); |
| 1647 } | 1649 } |
| 1648 IndexedReferencesExtractor::MarkVisitedField(parent_obj, field_offset); | 1650 IndexedReferencesExtractor::MarkVisitedField(parent_obj, field_offset); |
| 1649 } | 1651 } |
| 1650 | 1652 |
| 1651 | 1653 |
| 1652 void V8HeapExplorer::SetHiddenReference(HeapObject* parent_obj, | 1654 void V8HeapExplorer::SetHiddenReference(HeapObject* parent_obj, |
| 1653 int parent_entry, | 1655 int parent_entry, |
| 1654 int index, | 1656 int index, |
| 1655 Object* child_obj) { | 1657 Object* child_obj) { |
| 1658 ASSERT(parent_entry == GetEntry(parent_obj)->index()); |
| 1656 HeapEntry* child_entry = GetEntry(child_obj); | 1659 HeapEntry* child_entry = GetEntry(child_obj); |
| 1657 if (child_entry != NULL && IsEssentialObject(child_obj)) { | 1660 if (child_entry != NULL && IsEssentialObject(child_obj)) { |
| 1658 filler_->SetIndexedReference(HeapGraphEdge::kHidden, | 1661 filler_->SetIndexedReference(HeapGraphEdge::kHidden, |
| 1659 parent_entry, | 1662 parent_entry, |
| 1660 index, | 1663 index, |
| 1661 child_entry); | 1664 child_entry); |
| 1662 } | 1665 } |
| 1663 } | 1666 } |
| 1664 | 1667 |
| 1665 | 1668 |
| 1666 void V8HeapExplorer::SetWeakReference(HeapObject* parent_obj, | 1669 void V8HeapExplorer::SetWeakReference(HeapObject* parent_obj, |
| 1667 int parent_entry, | 1670 int parent_entry, |
| 1668 int index, | 1671 int index, |
| 1669 Object* child_obj, | 1672 Object* child_obj, |
| 1670 int field_offset) { | 1673 int field_offset) { |
| 1674 ASSERT(parent_entry == GetEntry(parent_obj)->index()); |
| 1671 HeapEntry* child_entry = GetEntry(child_obj); | 1675 HeapEntry* child_entry = GetEntry(child_obj); |
| 1672 if (child_entry != NULL) { | 1676 if (child_entry != NULL) { |
| 1673 filler_->SetIndexedReference(HeapGraphEdge::kWeak, | 1677 filler_->SetIndexedReference(HeapGraphEdge::kWeak, |
| 1674 parent_entry, | 1678 parent_entry, |
| 1675 index, | 1679 index, |
| 1676 child_entry); | 1680 child_entry); |
| 1677 IndexedReferencesExtractor::MarkVisitedField(parent_obj, field_offset); | 1681 IndexedReferencesExtractor::MarkVisitedField(parent_obj, field_offset); |
| 1678 } | 1682 } |
| 1679 } | 1683 } |
| 1680 | 1684 |
| 1681 | 1685 |
| 1682 void V8HeapExplorer::SetPropertyReference(HeapObject* parent_obj, | 1686 void V8HeapExplorer::SetPropertyReference(HeapObject* parent_obj, |
| 1683 int parent_entry, | 1687 int parent_entry, |
| 1684 Name* reference_name, | 1688 Name* reference_name, |
| 1685 Object* child_obj, | 1689 Object* child_obj, |
| 1686 const char* name_format_string, | 1690 const char* name_format_string, |
| 1687 int field_offset) { | 1691 int field_offset) { |
| 1692 ASSERT(parent_entry == GetEntry(parent_obj)->index()); |
| 1688 HeapEntry* child_entry = GetEntry(child_obj); | 1693 HeapEntry* child_entry = GetEntry(child_obj); |
| 1689 if (child_entry != NULL) { | 1694 if (child_entry != NULL) { |
| 1690 HeapGraphEdge::Type type = | 1695 HeapGraphEdge::Type type = |
| 1691 reference_name->IsSymbol() || String::cast(reference_name)->length() > 0 | 1696 reference_name->IsSymbol() || String::cast(reference_name)->length() > 0 |
| 1692 ? HeapGraphEdge::kProperty : HeapGraphEdge::kInternal; | 1697 ? HeapGraphEdge::kProperty : HeapGraphEdge::kInternal; |
| 1693 const char* name = name_format_string != NULL && reference_name->IsString() | 1698 const char* name = name_format_string != NULL && reference_name->IsString() |
| 1694 ? collection_->names()->GetFormatted( | 1699 ? collection_->names()->GetFormatted( |
| 1695 name_format_string, | 1700 name_format_string, |
| 1696 *String::cast(reference_name)->ToCString( | 1701 *String::cast(reference_name)->ToCString( |
| 1697 DISALLOW_NULLS, ROBUST_STRING_TRAVERSAL)) : | 1702 DISALLOW_NULLS, ROBUST_STRING_TRAVERSAL)) : |
| (...skipping 977 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2675 | 2680 |
| 2676 | 2681 |
| 2677 void HeapSnapshotJSONSerializer::SortHashMap( | 2682 void HeapSnapshotJSONSerializer::SortHashMap( |
| 2678 HashMap* map, List<HashMap::Entry*>* sorted_entries) { | 2683 HashMap* map, List<HashMap::Entry*>* sorted_entries) { |
| 2679 for (HashMap::Entry* p = map->Start(); p != NULL; p = map->Next(p)) | 2684 for (HashMap::Entry* p = map->Start(); p != NULL; p = map->Next(p)) |
| 2680 sorted_entries->Add(p); | 2685 sorted_entries->Add(p); |
| 2681 sorted_entries->Sort(SortUsingEntryValue); | 2686 sorted_entries->Sort(SortUsingEntryValue); |
| 2682 } | 2687 } |
| 2683 | 2688 |
| 2684 } } // namespace v8::internal | 2689 } } // namespace v8::internal |
| OLD | NEW |