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 937 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
948 } else if (obj->IsAccessorPair()) { | 948 } else if (obj->IsAccessorPair()) { |
949 ExtractAccessorPairReferences(entry, AccessorPair::cast(obj)); | 949 ExtractAccessorPairReferences(entry, AccessorPair::cast(obj)); |
950 } else if (obj->IsCodeCache()) { | 950 } else if (obj->IsCodeCache()) { |
951 ExtractCodeCacheReferences(entry, CodeCache::cast(obj)); | 951 ExtractCodeCacheReferences(entry, CodeCache::cast(obj)); |
952 } else if (obj->IsCode()) { | 952 } else if (obj->IsCode()) { |
953 ExtractCodeReferences(entry, Code::cast(obj)); | 953 ExtractCodeReferences(entry, Code::cast(obj)); |
954 } else if (obj->IsCell()) { | 954 } else if (obj->IsCell()) { |
955 ExtractCellReferences(entry, Cell::cast(obj)); | 955 ExtractCellReferences(entry, Cell::cast(obj)); |
956 extract_indexed_refs = false; | 956 extract_indexed_refs = false; |
957 } else if (obj->IsPropertyCell()) { | 957 } else if (obj->IsPropertyCell()) { |
958 ExtractPropertyCellReferences( | 958 ExtractPropertyCellReferences(entry, PropertyCell::cast(obj)); |
959 entry, PropertyCell::cast(obj)); | |
960 extract_indexed_refs = false; | 959 extract_indexed_refs = false; |
| 960 } else if (obj->IsAllocationSite()) { |
| 961 ExtractAllocationSiteReferences(entry, AllocationSite::cast(obj)); |
961 } | 962 } |
962 if (extract_indexed_refs) { | 963 if (extract_indexed_refs) { |
963 SetInternalReference(obj, entry, "map", obj->map(), HeapObject::kMapOffset); | 964 SetInternalReference(obj, entry, "map", obj->map(), HeapObject::kMapOffset); |
964 IndexedReferencesExtractor refs_extractor(this, obj, entry); | 965 IndexedReferencesExtractor refs_extractor(this, obj, entry); |
965 obj->Iterate(&refs_extractor); | 966 obj->Iterate(&refs_extractor); |
966 } | 967 } |
967 } | 968 } |
968 | 969 |
969 | 970 |
970 void V8HeapExplorer::ExtractJSGlobalProxyReferences( | 971 void V8HeapExplorer::ExtractJSGlobalProxyReferences( |
(...skipping 286 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1257 } | 1258 } |
1258 | 1259 |
1259 | 1260 |
1260 void V8HeapExplorer::ExtractPropertyCellReferences(int entry, | 1261 void V8HeapExplorer::ExtractPropertyCellReferences(int entry, |
1261 PropertyCell* cell) { | 1262 PropertyCell* cell) { |
1262 SetInternalReference(cell, entry, "value", cell->value()); | 1263 SetInternalReference(cell, entry, "value", cell->value()); |
1263 SetInternalReference(cell, entry, "type", cell->type()); | 1264 SetInternalReference(cell, entry, "type", cell->type()); |
1264 } | 1265 } |
1265 | 1266 |
1266 | 1267 |
| 1268 void V8HeapExplorer::ExtractAllocationSiteReferences(int entry, |
| 1269 AllocationSite* site) { |
| 1270 SetInternalReference(site, entry, "transition_info", site->transition_info(), |
| 1271 AllocationSite::kTransitionInfoOffset); |
| 1272 } |
| 1273 |
| 1274 |
1267 void V8HeapExplorer::ExtractClosureReferences(JSObject* js_obj, int entry) { | 1275 void V8HeapExplorer::ExtractClosureReferences(JSObject* js_obj, int entry) { |
1268 if (!js_obj->IsJSFunction()) return; | 1276 if (!js_obj->IsJSFunction()) return; |
1269 | 1277 |
1270 JSFunction* func = JSFunction::cast(js_obj); | 1278 JSFunction* func = JSFunction::cast(js_obj); |
1271 if (func->shared()->bound()) { | 1279 if (func->shared()->bound()) { |
1272 FixedArray* bindings = func->function_bindings(); | 1280 FixedArray* bindings = func->function_bindings(); |
1273 SetNativeBindReference(js_obj, entry, "bound_this", | 1281 SetNativeBindReference(js_obj, entry, "bound_this", |
1274 bindings->get(JSFunction::kBoundThisIndex)); | 1282 bindings->get(JSFunction::kBoundThisIndex)); |
1275 SetNativeBindReference(js_obj, entry, "bound_function", | 1283 SetNativeBindReference(js_obj, entry, "bound_function", |
1276 bindings->get(JSFunction::kBoundFunctionIndex)); | 1284 bindings->get(JSFunction::kBoundFunctionIndex)); |
(...skipping 1390 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2667 | 2675 |
2668 | 2676 |
2669 void HeapSnapshotJSONSerializer::SortHashMap( | 2677 void HeapSnapshotJSONSerializer::SortHashMap( |
2670 HashMap* map, List<HashMap::Entry*>* sorted_entries) { | 2678 HashMap* map, List<HashMap::Entry*>* sorted_entries) { |
2671 for (HashMap::Entry* p = map->Start(); p != NULL; p = map->Next(p)) | 2679 for (HashMap::Entry* p = map->Start(); p != NULL; p = map->Next(p)) |
2672 sorted_entries->Add(p); | 2680 sorted_entries->Add(p); |
2673 sorted_entries->Sort(SortUsingEntryValue); | 2681 sorted_entries->Sort(SortUsingEntryValue); |
2674 } | 2682 } |
2675 | 2683 |
2676 } } // namespace v8::internal | 2684 } } // namespace v8::internal |
OLD | NEW |