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

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

Issue 1846963002: Use a dictionary-mode code cache on the map rather than a dual system. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Addressed comment Created 4 years, 8 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
« no previous file with comments | « src/profiler/heap-snapshot-generator.h ('k') | src/s390/code-stubs-s390.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 // 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
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
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
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
OLDNEW
« no previous file with comments | « src/profiler/heap-snapshot-generator.h ('k') | src/s390/code-stubs-s390.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698