| OLD | NEW |
| 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 1040 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1051 } else if (obj->IsMap()) { | 1051 } else if (obj->IsMap()) { |
| 1052 ExtractMapReferences(entry, Map::cast(obj)); | 1052 ExtractMapReferences(entry, Map::cast(obj)); |
| 1053 } else if (obj->IsSharedFunctionInfo()) { | 1053 } else if (obj->IsSharedFunctionInfo()) { |
| 1054 ExtractSharedFunctionInfoReferences(entry, SharedFunctionInfo::cast(obj)); | 1054 ExtractSharedFunctionInfoReferences(entry, SharedFunctionInfo::cast(obj)); |
| 1055 } else if (obj->IsScript()) { | 1055 } else if (obj->IsScript()) { |
| 1056 ExtractScriptReferences(entry, Script::cast(obj)); | 1056 ExtractScriptReferences(entry, Script::cast(obj)); |
| 1057 } else if (obj->IsAccessorInfo()) { | 1057 } else if (obj->IsAccessorInfo()) { |
| 1058 ExtractAccessorInfoReferences(entry, AccessorInfo::cast(obj)); | 1058 ExtractAccessorInfoReferences(entry, AccessorInfo::cast(obj)); |
| 1059 } else if (obj->IsAccessorPair()) { | 1059 } else if (obj->IsAccessorPair()) { |
| 1060 ExtractAccessorPairReferences(entry, AccessorPair::cast(obj)); | 1060 ExtractAccessorPairReferences(entry, AccessorPair::cast(obj)); |
| 1061 } else if (obj->IsCodeCache()) { | |
| 1062 ExtractCodeCacheReferences(entry, CodeCache::cast(obj)); | |
| 1063 } else if (obj->IsCode()) { | 1061 } else if (obj->IsCode()) { |
| 1064 ExtractCodeReferences(entry, Code::cast(obj)); | 1062 ExtractCodeReferences(entry, Code::cast(obj)); |
| 1065 } else if (obj->IsBox()) { | 1063 } else if (obj->IsBox()) { |
| 1066 ExtractBoxReferences(entry, Box::cast(obj)); | 1064 ExtractBoxReferences(entry, Box::cast(obj)); |
| 1067 } else if (obj->IsCell()) { | 1065 } else if (obj->IsCell()) { |
| 1068 ExtractCellReferences(entry, Cell::cast(obj)); | 1066 ExtractCellReferences(entry, Cell::cast(obj)); |
| 1069 } else if (obj->IsPropertyCell()) { | 1067 } else if (obj->IsPropertyCell()) { |
| 1070 ExtractPropertyCellReferences(entry, PropertyCell::cast(obj)); | 1068 ExtractPropertyCellReferences(entry, PropertyCell::cast(obj)); |
| 1071 } else if (obj->IsAllocationSite()) { | 1069 } else if (obj->IsAllocationSite()) { |
| 1072 ExtractAllocationSiteReferences(entry, AllocationSite::cast(obj)); | 1070 ExtractAllocationSiteReferences(entry, AllocationSite::cast(obj)); |
| (...skipping 364 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1437 | 1435 |
| 1438 void V8HeapExplorer::ExtractAccessorPairReferences( | 1436 void V8HeapExplorer::ExtractAccessorPairReferences( |
| 1439 int entry, AccessorPair* accessors) { | 1437 int entry, AccessorPair* accessors) { |
| 1440 SetInternalReference(accessors, entry, "getter", accessors->getter(), | 1438 SetInternalReference(accessors, entry, "getter", accessors->getter(), |
| 1441 AccessorPair::kGetterOffset); | 1439 AccessorPair::kGetterOffset); |
| 1442 SetInternalReference(accessors, entry, "setter", accessors->setter(), | 1440 SetInternalReference(accessors, entry, "setter", accessors->setter(), |
| 1443 AccessorPair::kSetterOffset); | 1441 AccessorPair::kSetterOffset); |
| 1444 } | 1442 } |
| 1445 | 1443 |
| 1446 | 1444 |
| 1447 void V8HeapExplorer::ExtractCodeCacheReferences( | |
| 1448 int entry, CodeCache* code_cache) { | |
| 1449 TagObject(code_cache->default_cache(), "(default code cache)"); | |
| 1450 SetInternalReference(code_cache, entry, | |
| 1451 "default_cache", code_cache->default_cache(), | |
| 1452 CodeCache::kDefaultCacheOffset); | |
| 1453 TagObject(code_cache->normal_type_cache(), "(code type cache)"); | |
| 1454 SetInternalReference(code_cache, entry, | |
| 1455 "type_cache", code_cache->normal_type_cache(), | |
| 1456 CodeCache::kNormalTypeCacheOffset); | |
| 1457 } | |
| 1458 | |
| 1459 | |
| 1460 void V8HeapExplorer::TagBuiltinCodeObject(Code* code, const char* name) { | 1445 void V8HeapExplorer::TagBuiltinCodeObject(Code* code, const char* name) { |
| 1461 TagObject(code, names_->GetFormatted("(%s builtin)", name)); | 1446 TagObject(code, names_->GetFormatted("(%s builtin)", name)); |
| 1462 } | 1447 } |
| 1463 | 1448 |
| 1464 | 1449 |
| 1465 void V8HeapExplorer::TagCodeObject(Code* code) { | 1450 void V8HeapExplorer::TagCodeObject(Code* code) { |
| 1466 if (code->kind() == Code::STUB) { | 1451 if (code->kind() == Code::STUB) { |
| 1467 TagObject(code, names_->GetFormatted( | 1452 TagObject(code, names_->GetFormatted( |
| 1468 "(%s code)", | 1453 "(%s code)", |
| 1469 CodeStub::MajorName(CodeStub::GetMajorKey(code)))); | 1454 CodeStub::MajorName(CodeStub::GetMajorKey(code)))); |
| (...skipping 1684 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3154 for (int i = 1; i < sorted_strings.length(); ++i) { | 3139 for (int i = 1; i < sorted_strings.length(); ++i) { |
| 3155 writer_->AddCharacter(','); | 3140 writer_->AddCharacter(','); |
| 3156 SerializeString(sorted_strings[i]); | 3141 SerializeString(sorted_strings[i]); |
| 3157 if (writer_->aborted()) return; | 3142 if (writer_->aborted()) return; |
| 3158 } | 3143 } |
| 3159 } | 3144 } |
| 3160 | 3145 |
| 3161 | 3146 |
| 3162 } // namespace internal | 3147 } // namespace internal |
| 3163 } // namespace v8 | 3148 } // namespace v8 |
| OLD | NEW |