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

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

Issue 17064002: Refactor only: Rename JSGlobaPropertyCell to PropertyCell (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 6 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') | src/hydrogen.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 872 matching lines...) Expand 10 before | Expand all | Expand 10 after
883 switch (object->map()->instance_type()) { 883 switch (object->map()->instance_type()) {
884 case MAP_TYPE: 884 case MAP_TYPE:
885 switch (Map::cast(object)->instance_type()) { 885 switch (Map::cast(object)->instance_type()) {
886 #define MAKE_STRING_MAP_CASE(instance_type, size, name, Name) \ 886 #define MAKE_STRING_MAP_CASE(instance_type, size, name, Name) \
887 case instance_type: return "system / Map (" #Name ")"; 887 case instance_type: return "system / Map (" #Name ")";
888 STRING_TYPE_LIST(MAKE_STRING_MAP_CASE) 888 STRING_TYPE_LIST(MAKE_STRING_MAP_CASE)
889 #undef MAKE_STRING_MAP_CASE 889 #undef MAKE_STRING_MAP_CASE
890 default: return "system / Map"; 890 default: return "system / Map";
891 } 891 }
892 case CELL_TYPE: return "system / Cell"; 892 case CELL_TYPE: return "system / Cell";
893 case PROPERTY_CELL_TYPE: return "system / JSGlobalPropertyCell"; 893 case PROPERTY_CELL_TYPE: return "system / PropertyCell";
894 case FOREIGN_TYPE: return "system / Foreign"; 894 case FOREIGN_TYPE: return "system / Foreign";
895 case ODDBALL_TYPE: return "system / Oddball"; 895 case ODDBALL_TYPE: return "system / Oddball";
896 #define MAKE_STRUCT_CASE(NAME, Name, name) \ 896 #define MAKE_STRUCT_CASE(NAME, Name, name) \
897 case NAME##_TYPE: return "system / "#Name; 897 case NAME##_TYPE: return "system / "#Name;
898 STRUCT_LIST(MAKE_STRUCT_CASE) 898 STRUCT_LIST(MAKE_STRUCT_CASE)
899 #undef MAKE_STRUCT_CASE 899 #undef MAKE_STRUCT_CASE
900 default: return "system"; 900 default: return "system";
901 } 901 }
902 } 902 }
903 903
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
974 ExtractSharedFunctionInfoReferences(entry, SharedFunctionInfo::cast(obj)); 974 ExtractSharedFunctionInfoReferences(entry, SharedFunctionInfo::cast(obj));
975 } else if (obj->IsScript()) { 975 } else if (obj->IsScript()) {
976 ExtractScriptReferences(entry, Script::cast(obj)); 976 ExtractScriptReferences(entry, Script::cast(obj));
977 } else if (obj->IsCodeCache()) { 977 } else if (obj->IsCodeCache()) {
978 ExtractCodeCacheReferences(entry, CodeCache::cast(obj)); 978 ExtractCodeCacheReferences(entry, CodeCache::cast(obj));
979 } else if (obj->IsCode()) { 979 } else if (obj->IsCode()) {
980 ExtractCodeReferences(entry, Code::cast(obj)); 980 ExtractCodeReferences(entry, Code::cast(obj));
981 } else if (obj->IsCell()) { 981 } else if (obj->IsCell()) {
982 ExtractCellReferences(entry, Cell::cast(obj)); 982 ExtractCellReferences(entry, Cell::cast(obj));
983 extract_indexed_refs = false; 983 extract_indexed_refs = false;
984 } else if (obj->IsJSGlobalPropertyCell()) { 984 } else if (obj->IsPropertyCell()) {
985 ExtractJSGlobalPropertyCellReferences( 985 ExtractPropertyCellReferences(
986 entry, JSGlobalPropertyCell::cast(obj)); 986 entry, PropertyCell::cast(obj));
987 extract_indexed_refs = false; 987 extract_indexed_refs = false;
988 } 988 }
989 if (extract_indexed_refs) { 989 if (extract_indexed_refs) {
990 SetInternalReference(obj, entry, "map", obj->map(), HeapObject::kMapOffset); 990 SetInternalReference(obj, entry, "map", obj->map(), HeapObject::kMapOffset);
991 IndexedReferencesExtractor refs_extractor(this, obj, entry); 991 IndexedReferencesExtractor refs_extractor(this, obj, entry);
992 obj->Iterate(&refs_extractor); 992 obj->Iterate(&refs_extractor);
993 } 993 }
994 } 994 }
995 995
996 996
(...skipping 279 matching lines...) Expand 10 before | Expand all | Expand 10 after
1276 "gc_metadata", code->gc_metadata(), 1276 "gc_metadata", code->gc_metadata(),
1277 Code::kGCMetadataOffset); 1277 Code::kGCMetadataOffset);
1278 } 1278 }
1279 1279
1280 1280
1281 void V8HeapExplorer::ExtractCellReferences(int entry, Cell* cell) { 1281 void V8HeapExplorer::ExtractCellReferences(int entry, Cell* cell) {
1282 SetInternalReference(cell, entry, "value", cell->value()); 1282 SetInternalReference(cell, entry, "value", cell->value());
1283 } 1283 }
1284 1284
1285 1285
1286 void V8HeapExplorer::ExtractJSGlobalPropertyCellReferences( 1286 void V8HeapExplorer::ExtractPropertyCellReferences(int entry,
1287 int entry, JSGlobalPropertyCell* cell) { 1287 PropertyCell* cell) {
1288 SetInternalReference(cell, entry, "value", cell->value()); 1288 SetInternalReference(cell, entry, "value", cell->value());
1289 SetInternalReference(cell, entry, "type", cell->type()); 1289 SetInternalReference(cell, entry, "type", cell->type());
1290 } 1290 }
1291 1291
1292 1292
1293 void V8HeapExplorer::ExtractClosureReferences(JSObject* js_obj, int entry) { 1293 void V8HeapExplorer::ExtractClosureReferences(JSObject* js_obj, int entry) {
1294 if (!js_obj->IsJSFunction()) return; 1294 if (!js_obj->IsJSFunction()) return;
1295 1295
1296 JSFunction* func = JSFunction::cast(js_obj); 1296 JSFunction* func = JSFunction::cast(js_obj);
1297 if (func->shared()->bound()) { 1297 if (func->shared()->bound()) {
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
1379 } 1379 }
1380 } 1380 }
1381 } else { 1381 } else {
1382 NameDictionary* dictionary = js_obj->property_dictionary(); 1382 NameDictionary* dictionary = js_obj->property_dictionary();
1383 int length = dictionary->Capacity(); 1383 int length = dictionary->Capacity();
1384 for (int i = 0; i < length; ++i) { 1384 for (int i = 0; i < length; ++i) {
1385 Object* k = dictionary->KeyAt(i); 1385 Object* k = dictionary->KeyAt(i);
1386 if (dictionary->IsKey(k)) { 1386 if (dictionary->IsKey(k)) {
1387 Object* target = dictionary->ValueAt(i); 1387 Object* target = dictionary->ValueAt(i);
1388 // We assume that global objects can only have slow properties. 1388 // We assume that global objects can only have slow properties.
1389 Object* value = target->IsJSGlobalPropertyCell() 1389 Object* value = target->IsPropertyCell()
1390 ? JSGlobalPropertyCell::cast(target)->value() 1390 ? PropertyCell::cast(target)->value()
1391 : target; 1391 : target;
1392 if (k != heap_->hidden_string()) { 1392 if (k != heap_->hidden_string()) {
1393 SetPropertyReference(js_obj, entry, String::cast(k), value); 1393 SetPropertyReference(js_obj, entry, String::cast(k), value);
1394 } else { 1394 } else {
1395 TagObject(value, "(hidden properties)"); 1395 TagObject(value, "(hidden properties)");
1396 SetInternalReference(js_obj, entry, "hidden_properties", value); 1396 SetInternalReference(js_obj, entry, "hidden_properties", value);
1397 } 1397 }
1398 } 1398 }
1399 } 1399 }
1400 } 1400 }
(...skipping 1267 matching lines...) Expand 10 before | Expand all | Expand 10 after
2668 2668
2669 2669
2670 void HeapSnapshotJSONSerializer::SortHashMap( 2670 void HeapSnapshotJSONSerializer::SortHashMap(
2671 HashMap* map, List<HashMap::Entry*>* sorted_entries) { 2671 HashMap* map, List<HashMap::Entry*>* sorted_entries) {
2672 for (HashMap::Entry* p = map->Start(); p != NULL; p = map->Next(p)) 2672 for (HashMap::Entry* p = map->Start(); p != NULL; p = map->Next(p))
2673 sorted_entries->Add(p); 2673 sorted_entries->Add(p);
2674 sorted_entries->Sort(SortUsingEntryValue); 2674 sorted_entries->Sort(SortUsingEntryValue);
2675 } 2675 }
2676 2676
2677 } } // namespace v8::internal 2677 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/heap-snapshot-generator.h ('k') | src/hydrogen.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698