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

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

Issue 18584007: Bugfix: AllocationSite objects need to be walkable by the heap snapshot (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 5 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 | Annotate | Revision Log
« no previous file with comments | « src/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 // 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
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(
Michael Achenbach 2013/07/09 12:53:10 nit: (unrelated) make one-liner
mvstanton 2013/07/09 14:20:18 Done.
959 entry, PropertyCell::cast(obj)); 959 entry, PropertyCell::cast(obj));
960 extract_indexed_refs = false; 960 extract_indexed_refs = false;
961 } else if (obj->IsAllocationSite()) {
962 ExtractAllocationSiteReferences(entry, AllocationSite::cast(obj));
963 extract_indexed_refs = false;
961 } 964 }
962 if (extract_indexed_refs) { 965 if (extract_indexed_refs) {
963 SetInternalReference(obj, entry, "map", obj->map(), HeapObject::kMapOffset); 966 SetInternalReference(obj, entry, "map", obj->map(), HeapObject::kMapOffset);
964 IndexedReferencesExtractor refs_extractor(this, obj, entry); 967 IndexedReferencesExtractor refs_extractor(this, obj, entry);
965 obj->Iterate(&refs_extractor); 968 obj->Iterate(&refs_extractor);
966 } 969 }
967 } 970 }
968 971
969 972
970 void V8HeapExplorer::ExtractJSGlobalProxyReferences( 973 void V8HeapExplorer::ExtractJSGlobalProxyReferences(
(...skipping 286 matching lines...) Expand 10 before | Expand all | Expand 10 after
1257 } 1260 }
1258 1261
1259 1262
1260 void V8HeapExplorer::ExtractPropertyCellReferences(int entry, 1263 void V8HeapExplorer::ExtractPropertyCellReferences(int entry,
1261 PropertyCell* cell) { 1264 PropertyCell* cell) {
1262 SetInternalReference(cell, entry, "value", cell->value()); 1265 SetInternalReference(cell, entry, "value", cell->value());
1263 SetInternalReference(cell, entry, "type", cell->type()); 1266 SetInternalReference(cell, entry, "type", cell->type());
1264 } 1267 }
1265 1268
1266 1269
1270 void V8HeapExplorer::ExtractAllocationSiteReferences(int entry,
1271 AllocationSite* site) {
1272 SetInternalReference(site, entry, "transition_info", site->transition_info());
1273 }
1274
1275
1267 void V8HeapExplorer::ExtractClosureReferences(JSObject* js_obj, int entry) { 1276 void V8HeapExplorer::ExtractClosureReferences(JSObject* js_obj, int entry) {
1268 if (!js_obj->IsJSFunction()) return; 1277 if (!js_obj->IsJSFunction()) return;
1269 1278
1270 JSFunction* func = JSFunction::cast(js_obj); 1279 JSFunction* func = JSFunction::cast(js_obj);
1271 if (func->shared()->bound()) { 1280 if (func->shared()->bound()) {
1272 FixedArray* bindings = func->function_bindings(); 1281 FixedArray* bindings = func->function_bindings();
1273 SetNativeBindReference(js_obj, entry, "bound_this", 1282 SetNativeBindReference(js_obj, entry, "bound_this",
1274 bindings->get(JSFunction::kBoundThisIndex)); 1283 bindings->get(JSFunction::kBoundThisIndex));
1275 SetNativeBindReference(js_obj, entry, "bound_function", 1284 SetNativeBindReference(js_obj, entry, "bound_function",
1276 bindings->get(JSFunction::kBoundFunctionIndex)); 1285 bindings->get(JSFunction::kBoundFunctionIndex));
(...skipping 1390 matching lines...) Expand 10 before | Expand all | Expand 10 after
2667 2676
2668 2677
2669 void HeapSnapshotJSONSerializer::SortHashMap( 2678 void HeapSnapshotJSONSerializer::SortHashMap(
2670 HashMap* map, List<HashMap::Entry*>* sorted_entries) { 2679 HashMap* map, List<HashMap::Entry*>* sorted_entries) {
2671 for (HashMap::Entry* p = map->Start(); p != NULL; p = map->Next(p)) 2680 for (HashMap::Entry* p = map->Start(); p != NULL; p = map->Next(p))
2672 sorted_entries->Add(p); 2681 sorted_entries->Add(p);
2673 sorted_entries->Sort(SortUsingEntryValue); 2682 sorted_entries->Sort(SortUsingEntryValue);
2674 } 2683 }
2675 2684
2676 } } // namespace v8::internal 2685 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/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